Ver Fonte

开工确认单调整

yzc há 10 meses atrás
pai
commit
e20dccbcd0

+ 2 - 2
hx-mes/src/main/java/com/fjhx/mes/entity/production/po/ProductionOrder.java

@@ -72,9 +72,9 @@ public class ProductionOrder extends BasePo {
     private Integer confirmStatus;
 
     /**
-     * 是否同意开工
+     * 开工状态 10确认中 20不同意 30同意
      */
-    private Long isAgreeWork;
+    private Long beginWorkStatus;
 
     /**
      * 开工确认Id

+ 4 - 0
hx-mes/src/main/java/com/fjhx/mes/entity/production/vo/ProductionOrderDetailVo.java

@@ -220,4 +220,8 @@ public class ProductionOrderDetailVo extends ProductionOrderDetail {
      * 是否同意开工
      */
     private Integer isAgreeWork;
+    /**
+     * 开工申请状态
+     */
+    private Integer prodConfirmStatus;
 }

+ 3 - 1
hx-mes/src/main/java/com/fjhx/mes/flow/ProdBeginConfirmFlow.java

@@ -46,6 +46,7 @@ public class ProdBeginConfirmFlow extends FlowDelegate {
         produceOrderService.update(q -> q
                 .eq(ProductionOrder::getId, orderById.getId())
                 .set(ProductionOrder::getProdBeginConfirmId, dto.getId())
+                .set(ProductionOrder::getBeginWorkStatus, 10)
         );
 
         return dto.getId();
@@ -65,9 +66,10 @@ public class ProdBeginConfirmFlow extends FlowDelegate {
                 .eq(ProductionBeginConfirm::getId, businessId)
                 .set(ProductionBeginConfirm::getStatus, FlowStatusEnum1.PASS.getKey())
         );
+
         produceOrderService.update(q -> q
                 .eq(ProductionOrder::getId, pbcById.getProdOrderId())
-                .set(ProductionOrder::getIsAgreeWork, pbcById.getIsAgreeWork())
+                .set(ProductionOrder::getBeginWorkStatus, pbcById.getIsAgreeWork() == 1 ? 30 : 20)
                 .set(ProductionOrder::getProdBeginConfirmId, businessId)
         );
     }

+ 1 - 1
hx-mes/src/main/java/com/fjhx/mes/service/production/impl/ProduceOrderDetailServiceImpl.java

@@ -529,7 +529,7 @@ public class ProduceOrderDetailServiceImpl extends ServiceImpl<ProduceOrderDetai
         Assert.notEmpty(taskById, "查询不到任务信息");
         ProductionOrder orderById = produceOrderService.getById(taskById.getProduceOrderId());
         Assert.notEmpty(orderById, "查询不到订单信息");
-        if (ObjectUtil.notEqual(orderById.getIsAgreeWork(), 1)) {
+        if (ObjectUtil.notEqual(orderById.getBeginWorkStatus(), 30)) {
             throw new ServiceException("订单开工确认未通过,禁止排程!");
         }
     }

+ 2 - 1
hx-mes/src/main/java/com/fjhx/mes/service/production/impl/ProductionBeginConfirmServiceImpl.java

@@ -51,6 +51,7 @@ public class ProductionBeginConfirmServiceImpl extends ServiceImpl<ProductionBeg
 
         JSONObject startData = (JSONObject) JSONObject.toJSON(dto);
         startData.put("salesmanId", contractById.getSalesmanId());
+        startData.put("prodCompanyId", orderById.getProduceCompanyId());
 
         InitiateDto initiateDto = new InitiateDto();
         initiateDto.setFlowKey("prod_begin_confirm_flow");
@@ -68,7 +69,7 @@ public class ProductionBeginConfirmServiceImpl extends ServiceImpl<ProductionBeg
 
     @Override
     public List<ProductionBeginConfirm> getHistoryList(Long orderId) {
-        return this.list(q -> q.eq(ProductionBeginConfirm::getProdOrderId, orderId));
+        return this.list(q -> q.eq(ProductionBeginConfirm::getProdOrderId, orderId).orderByDesc(ProductionBeginConfirm::getCreateTime));
     }
 
 }

+ 3 - 8
hx-mes/src/main/resources/mapper/production/ProduceOrderDetailMapper.xml

@@ -20,20 +20,14 @@
                pod.update_time,
                pod.del_flag,
                pod.report_lock,
---                pod.expect_begin_time,
---                pod.expect_delivery_time,
---                pod.is_agree_work,
---                pod.cabinet_exit_time,
---                pod.is_cabinet_confirm,
---                pod.work_remark,
---                pod.begin_work_status,
                pod.other_prod_remark,
                po.code                                                        AS orderCode,
                po.create_time                                                 AS orderCreateTime,
                po.produce_time,
                po.delivery_period,
                po.company_id,
-               po.is_agree_work,
+               po.begin_work_status,
+               pbc.`status`                                                   AS prod_confirm_status,
                (if(IFNULL(po.finish_time, NOW()) > po.delivery_period, 1, 0)) AS isOverdue,
                pod.remark,
                c.prod_tag,
@@ -59,6 +53,7 @@
                                 AND ep.`status` IN (10, 30, 60)
                                      LEFT JOIN stock_wait sw ON sw.purchase_id = ep.id
                             GROUP BY sd.contract_id) t2 ON t2.contract_id = pod.contract_id
+                 LEFT JOIN production_begin_confirm pbc ON pbc.id = po.prod_begin_confirm_id
     </sql>
 
     <select id="getPage" resultType="com.fjhx.mes.entity.production.vo.ProductionOrderDetailVo">

+ 1 - 1
hx-mes/src/main/resources/mapper/production/ProduceOrderMapper.xml

@@ -23,7 +23,7 @@
                c.quality_lv,
                IFNULL(t2.lackStatus, 0)                                       as lackStatus,
                pbc.`status`                                                   AS prod_confirm_status,
-               po.is_agree_work
+               po.begin_work_status
         from production_order po
                  LEFT JOIN contract c ON po.contract_id = c.id
                  LEFT JOIN (SELECT sd.prod_order_id,