1
This commit is contained in:
@@ -8,12 +8,15 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.utils.http.HttpUtils;
|
import com.ruoyi.common.utils.http.HttpUtils;
|
||||||
import com.ruoyi.jarvis.domain.JDOrder;
|
import com.ruoyi.jarvis.domain.JDOrder;
|
||||||
|
import com.ruoyi.jarvis.domain.OrderRows;
|
||||||
import com.ruoyi.jarvis.service.IJDOrderService;
|
import com.ruoyi.jarvis.service.IJDOrderService;
|
||||||
|
import com.ruoyi.jarvis.service.IOrderRowsService;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,11 +29,16 @@ import java.util.Map;
|
|||||||
@RequestMapping("/jarvis/jdorder")
|
@RequestMapping("/jarvis/jdorder")
|
||||||
public class JDOrderController extends BaseController {
|
public class JDOrderController extends BaseController {
|
||||||
private final IJDOrderService jdOrderService;
|
private final IJDOrderService jdOrderService;
|
||||||
|
private final IOrderRowsService orderRowsService;
|
||||||
|
|
||||||
public JDOrderController(IJDOrderService jdOrderService) {
|
public JDOrderController(IJDOrderService jdOrderService, IOrderRowsService orderRowsService) {
|
||||||
this.jdOrderService = jdOrderService;
|
this.jdOrderService = jdOrderService;
|
||||||
|
this.orderRowsService = orderRowsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final static String skey = "2192057370ef8140c201079969c956a3";
|
||||||
|
private final static String requestUrl = "http://192.168.8.88:6666/jd/";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询(分页)
|
* 列表查询(分页)
|
||||||
*/
|
*/
|
||||||
@@ -38,11 +46,20 @@ public class JDOrderController extends BaseController {
|
|||||||
public TableDataInfo list(JDOrder query) {
|
public TableDataInfo list(JDOrder query) {
|
||||||
startPage();
|
startPage();
|
||||||
java.util.List<JDOrder> list = jdOrderService.selectJDOrderList(query);
|
java.util.List<JDOrder> list = jdOrderService.selectJDOrderList(query);
|
||||||
return getDataTable(list);
|
TableDataInfo dataTable = getDataTable(list);
|
||||||
|
List<JDOrder> rows = (List<JDOrder>) dataTable.getRows();
|
||||||
|
for (JDOrder jdOrder : rows) {
|
||||||
|
OrderRows orderRows = orderRowsService.selectOrderRowsByOrderId(jdOrder.getOrderId());
|
||||||
|
if (orderRows != null) {
|
||||||
|
jdOrder.setProPriceAmount(orderRows.getProPriceAmount());
|
||||||
|
jdOrder.setFinishTime(orderRows.getFinishTime());
|
||||||
|
} else {
|
||||||
|
jdOrder.setProPriceAmount(0.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private final static String skey = "2192057370ef8140c201079969c956a3";
|
|
||||||
private final static String requestUrl = "http://192.168.8.88:6666/jd/";
|
|
||||||
|
|
||||||
|
return dataTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/generatePromotionContent")
|
@PostMapping("/generatePromotionContent")
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ruoyi.jarvis.domain;
|
|||||||
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.data.annotation.Transient;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -49,6 +50,12 @@ public class JDOrder extends BaseEntity {
|
|||||||
|
|
||||||
/** 备注(状态) */
|
/** 备注(状态) */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private Double proPriceAmount;
|
||||||
|
@Transient
|
||||||
|
private Date finishTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,4 +71,12 @@ public interface OrderRowsMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteOrderRowsByIds(String[] ids);
|
public int deleteOrderRowsByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID查询京粉订单
|
||||||
|
*
|
||||||
|
* @param orderId 订单ID
|
||||||
|
* @return 京粉订单
|
||||||
|
*/
|
||||||
|
public OrderRows selectOrderRowsByOrderId(String orderId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,4 +70,6 @@ public interface IOrderRowsService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteOrderRowsById(String id);
|
public int deleteOrderRowsById(String id);
|
||||||
|
|
||||||
|
public OrderRows selectOrderRowsByOrderId(String orderId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,4 +107,9 @@ public class OrderRowsServiceImpl implements IOrderRowsService
|
|||||||
{
|
{
|
||||||
return orderRowsMapper.deleteOrderRowsById(id);
|
return orderRowsMapper.deleteOrderRowsById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrderRows selectOrderRowsByOrderId(String orderId) {
|
||||||
|
return orderRowsMapper.selectOrderRowsByOrderId(orderId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -376,4 +376,9 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectOrderRowsByOrderId" parameterType="String" resultMap="OrderRowsResult">
|
||||||
|
<include refid="selectOrderRowsVo"/>
|
||||||
|
where order_id = #{orderId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user