订单同步接口测试

highway
zhaoxiaolin 1 year ago
parent f2151cc0b3
commit 944d9d9308

@ -54,6 +54,8 @@ public class SapProOrder extends TreeEntity {
@Excel(name = "任务清单") @Excel(name = "任务清单")
private String workerOrder; private String workerOrder;
private Date createTime;
public Long getQuantitySplit() { public Long getQuantitySplit() {
return quantitySplit; return quantitySplit;
} }
@ -104,6 +106,16 @@ public class SapProOrder extends TreeEntity {
@Excel(name = "产品类型") @Excel(name = "产品类型")
private String prodType; private String prodType;
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }

@ -248,10 +248,13 @@ public class ProOrderServiceImpl implements IProOrderService {
//获取当前所选工厂 //获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName"; String key = "#header.poolName";
sapqo.setFactoryCode(request.getHeader(key.substring(8))); sapqo.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
R<List<SapProOrder>> rSapProOrder = remoteSapService.shopOrderSync(sapqo); R<List<SapProOrder>> rSapProOrder = remoteSapService.shopOrderSync(sapqo);
List<SapProOrder> newOrders = rSapProOrder.getData(); List<SapProOrder> newOrders = rSapProOrder.getData();
if(CollectionUtils.isEmpty(newOrders)){
return AjaxResult.error("无"+sapqo.getCreateTime()+"之后的最新订单");
}
ProOrder proOrder = null; ProOrder proOrder = null;
for (SapProOrder sapProOrder : newOrders) { for (SapProOrder sapProOrder : newOrders) {
//工单下达后整个订单就被锁定//订单存在就更新,不存在就插入 //工单下达后整个订单就被锁定//订单存在就更新,不存在就插入

@ -129,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE bst.Shift_Id = #{shiftId} WHERE bst.Shift_Id = #{shiftId}
</select> </select>
<select id="getMaxCreatetime" resultType="com.op.system.api.model.SapProOrder"> <select id="getMaxCreatetime" resultType="com.op.system.api.model.SapProOrder">
select max(create_time) from pro_order where order_type = 'prod' select CONVERT(varchar(100),max(create_time), 20) createTime from pro_order where order_type != 'white'
</select> </select>
<select id="selectProOrderByOrderCode" parameterType="String" resultMap="ProOrderResult"> <select id="selectProOrderByOrderCode" parameterType="String" resultMap="ProOrderResult">

@ -86,7 +86,7 @@ public class SapOrderServiceImpl implements SapOrderService {
return R.ok(proOrderList); return R.ok(proOrderList);
} catch (Exception e) { } catch (Exception e) {
return null; return R.fail(e.getMessage());
} }
} }

Loading…
Cancel
Save