Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit 34c1159514

@ -117,7 +117,7 @@ public class ProOrderWorkorder extends TreeEntity {
/** 单据状态 */
@Excel(name = "工单状态",readConverterExp = "w0=未派发,w1=排队,w2=活动,w3=报工")
private String status;
private String statusArray;
/** 预留字段1 */
private String attr1;
@ -401,6 +401,14 @@ public class ProOrderWorkorder extends TreeEntity {
this.ancestors = ancestors;
}
public String getStatusArray() {
return statusArray;
}
public void setStatusArray(String statusArray) {
this.statusArray = statusArray;
}
public String getAncestors() {
return ancestors;
}

@ -191,4 +191,6 @@ public interface ProOrderMapper {
List<CascaderDTO> getRouteProcessEquips(@Param("list") List<CascaderDTO> level);
@MapKey("value")
Map<String, CascaderDTO> getEquipInfoByCodes(String equipCodes);
ProOrder getMaxPlanDate();
}

@ -325,13 +325,14 @@ public class ProOrderServiceImpl implements IProOrderService {
@DS("#header.poolName")
public AjaxResult syncSAP() {
SapProOrder sapqo = new SapProOrder();
sapqo.setCreateTime(DateUtils.getNowDate());
sapqo.setCreateTime(DateUtils.addDays(DateUtils.getNowDate(),-4));
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
sapqo.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
R<List<SapProOrder>> rSapProOrder = remoteSapService.shopOrderSync(sapqo);
R<List<SapProOrder>> rSapProOrder = remoteSapService.shopOrderSync(sapqo);//sap只能同步指定日期的数据
List<SapProOrder> newOrders = rSapProOrder.getData();
if(CollectionUtils.isEmpty(newOrders)){
return AjaxResult.error("无"+sapqo.getCreateTime()+"之后的最新订单");
@ -357,12 +358,12 @@ public class ProOrderServiceImpl implements IProOrderService {
//proOrder.setCreateTime(nowDate);
proOrder.setCreateBy(SecurityUtils.getUsername());
proOrderMapper.insertProOrder(proOrder);
} else {//存在,如果没下发,更新,否则不允许更新,关闭订单
} else {//存在,如果没活动更新,否则不允许更新,关闭订单
proOrder.setId(orderExit.getId());
proOrder.setQuantitySplit(0L);
ProOrderWorkorder owork = new ProOrderWorkorder();
owork.setOrderCode(proOrder.getOrderCode());
owork.setStatus("w1");
owork.setStatusArray("'w2','w3','w4'");//已派发w1未派w0活动w2报工w3暂停w4
List<ProOrderWorkorder> workOrders = proOrderWorkorderMapper.selectProOrderWorkorderList(owork);
if (CollectionUtils.isEmpty(workOrders)) {//更新
proOrder.setUpdateTime(nowDate);
@ -378,9 +379,10 @@ public class ProOrderServiceImpl implements IProOrderService {
//删除工单pro_order_workorder
proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderIds(ids);
}
} else {//关闭订单
remoteSapService.sapCloseOrder(proOrder.getOrderCode());
}
// else {//关闭订单
// remoteSapService.sapCloseOrder(proOrder.getOrderCode());
// }
}
}
}

@ -170,8 +170,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select equipment_code value,equipment_name label from base_equipment where equipment_code in
('${equipCodes}')
</select>
<select id="getMaxPlanDate" resultType="com.op.plan.domain.ProOrder">
select max(plan_pro_date) planProDate
from pro_order where prod_type != 'white'
</select>
<insert id="insertProOrder" parameterType="ProOrder">
<insert id="insertProOrder" parameterType="ProOrder">
insert into pro_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
@ -199,6 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="prodType != null">prod_type,</if>
<if test="prodSpc != null">prod_spc,</if>
<if test="carNum != null">car_num,</if>
sync_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -226,6 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="prodType != null">#{prodType},</if>
<if test="prodSpc != null">#{prodSpc},</if>
<if test="carNum != null">#{carNum},</if>
sync_time = GETDATE(),
</trim>
</insert>

@ -68,6 +68,7 @@
<if test="parentOrder != null and parentOrder != ''"> and parent_order = #{parentOrder}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="statusArray != null and statusArray != ''"> and status in (${statusArray})</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>

Loading…
Cancel
Save