diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java
index f1f20319..1ced87ef 100644
--- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java
+++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java
@@ -173,7 +173,9 @@ public class ProOrderServiceImpl implements IProOrderService {
ProOrderWorkorderBatch proOrderWorkorderBatch = setCommonBatchAttribute();
// 设置工单
proOrderWorkorder.setWorkorderId(IdUtils.fastSimpleUUID());
- proOrderWorkorder.setWorkorderCode(proOrder.getOrderCode()+"-1");
+ // 设置工单code
+ int endCode = getEndCode(proOrder.getId());
+ proOrderWorkorder.setWorkorderCode(proOrder.getOrderCode()+"-"+endCode);
proOrderWorkorder.setOrderId(proOrder.getId());
proOrderWorkorder.setOrderCode(proOrder.getOrderCode());
proOrderWorkorder.setUnit(proOrder.getUnit());
diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java
index 8afda4c1..04c4757d 100644
--- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java
+++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java
@@ -88,6 +88,7 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
int num = 1;
// 创建主订单
proOrder.setPlanFactoryCode(factory);
+ proOrder.setFactoryCode(factory);
proOrder.setId(IdUtils.fastSimpleUUID());
proOrder.setParentOrder("0");
proOrder.setStatus("o0");
@@ -141,11 +142,12 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
childProOrder.setProdDesc(prodDescs[i]);
childProOrder.setProdCode(prodCodes[i]);
childProOrder.setPlanFactoryCode(factory);
+ childProOrder.setFactoryCode(factory);
childProOrder.setId(IdUtils.fastSimpleUUID());
childProOrder.setParentOrder(orderCode);
childProOrder.setStatus("o0");
childProOrder.setOrderType(proOrder.getProdType());
- childProOrder.setOrderCode(orderCode+"-"+num++);
+ childProOrder.setOrderCode(orderCode+num++);
childProOrder.setCreateBy(SecurityContextHolder.getUserName());
childProOrder.setCreateTime(DateUtils.getNowDate());
childProOrder.setUpdateBy(SecurityContextHolder.getUserName());
diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProWhiteOrderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProWhiteOrderMapper.xml
index 616aa83d..f53c7b1d 100644
--- a/op-modules/op-plan/src/main/resources/mapper/plan/ProWhiteOrderMapper.xml
+++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProWhiteOrderMapper.xml
@@ -89,6 +89,7 @@
insert into pro_order
id,
+ plan_factory_code,
factory_code,
order_type,
order_code,
@@ -113,6 +114,7 @@
#{id},
+ #{planFactoryCode},
#{factoryCode},
#{orderType},
#{orderCode},