订单同步接口测试

highway
zhaoxiaolin 1 year ago
parent f2151cc0b3
commit 944d9d9308

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

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

@ -129,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE bst.Shift_Id = #{shiftId}
</select>
<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 id="selectProOrderByOrderCode" parameterType="String" resultMap="ProOrderResult">

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

Loading…
Cancel
Save