Selaa lähdekoodia

aps-开工获取坯料成分优化,开工更新工序作业优化

sucheng 1 vuosi sitten
vanhempi
commit
5e19488910

+ 3 - 3
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/dao/ApsReportRecordsDao.java

@@ -20,8 +20,8 @@ import java.util.List;
  */
 public interface ApsReportRecordsDao extends BaseMapper<ApsReportRecordsDo> {
 
-    @Update("update aps_process_operation set ACTUALSTARTDATE = IFNULL(ACTUALSTARTDATE,NOW()),STARTINGROLL = STARTINGROLL+1 where ID = #{id}")
-    void updateProcessActualStartDate(@Param("id") String id);
+//    @Update("update aps_process_operation set ACTUALSTARTDATE = IFNULL(ACTUALSTARTDATE,NOW()),STARTINGROLL = STARTINGROLL+1 where ID = #{id}")
+//    void updateProcessActualStartDate(@Param("id") String id);
 
     @Update("update asp_check_items set WAITREPORTID = #{id} where ID = #{processdeviceid}")
     void updateDeviceWaitReportId(@Param("id") String id, @Param("processdeviceid") String processdeviceid);
@@ -50,7 +50,7 @@ public interface ApsReportRecordsDao extends BaseMapper<ApsReportRecordsDo> {
     @Select("select aci.EQUIPMENTCODE AS 'deviceCode',so.ROPTION AS 'organizationCode',aci.WAITREPORTID AS 'waitReportId',aci.OWNEDFACTORY AS 'ownedFactory' from asp_check_items aci LEFT JOIN sys_organization so ON aci.USEDEPTID = so.ID AND so.DELETED = 0 where aci.ID = #{processdeviceid} limit 1")
     OrganizationCodeAndDeviceCodeVo selectOrganizationCodeAndDeviceCode(@Param("processdeviceid") String processdeviceid);
 
-    @Select("select arr.ID from aps_process_operation apo LEFT JOIN aps_report_records arr ON arr.DELETED = 0 AND arr.PROCESSOPERATIONID = apo.ID LEFT JOIN aps_report_output aro ON aro.DELETED = 0 AND aro.MAINID = arr.ID where apo.DELETED = 0 AND aro.OUTPUTNUMBER = #{inputBatchNumber} ORDER BY arr.CREATEDATE desc limit 1")
+    @Select("select arr.ID from aps_process_operation apo LEFT JOIN aps_report_records arr ON arr.DELETED = 0 AND arr.PROCESSOPERATIONID = apo.ID LEFT JOIN aps_report_output aro ON aro.DELETED = 0 AND aro.MAINID = arr.ID where apo.DELETED = 0 AND aro.OUTPUTNUMBER = #{inputBatchNumber} AND aro.CHECKSTATUS = '已检验' ORDER BY arr.CREATEDATE desc limit 1")
     String selectLastReoprtRecordByBatchNumber(@Param("inputBatchNumber") String inputBatchNumber);
 
     @Update("update aps_process_operation_process_equ set BACHMATERIALPROCESS = REPLACE(REPLACE(REPLACE(BACHMATERIALPROCESS,'${inputBatchNumber},',''),',${inputBatchNumber}',''),'${inputBatchNumber}','') where DELETED = 0 AND PREVIOUSPROCESSESIDS = #{previousprocessesids}")

+ 12 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportRecordsServiceImpl.java

@@ -370,7 +370,18 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
         apsProcessOperationProcessEquService.updateById(needUpdateProcessOperationProcessEqu);
 
         //===============更新工序作业==================
-        this.baseMapper.updateProcessActualStartDate(apsProcessOperationDo.getId());
+        ApsProcessOperationDo needUpdateProcessOperation = new ApsProcessOperationDo();
+        needUpdateProcessOperation.setId(apsProcessOperationDo.getId());
+        Integer processStartingRoll = apsProcessOperationDo.getStartingroll();
+        Integer newProcessStartingRoll = processStartingRoll + 1;
+        needUpdateProcessOperation.setStartingroll(newProcessStartingRoll);
+        if (newProcessStartingRoll.equals(1)) {
+            needUpdateProcessOperation.setActualstartdate(DateUtil.date());
+            needUpdateProcessOperation.setWorkstatus("加工中");
+            needUpdateProcessOperation.setProcessstatus(SaveConstans.ProductionStatus.PROCESSING);
+        }
+        apsProcessOperationService.updateById(needUpdateProcessOperation);
+//        this.baseMapper.updateProcessActualStartDate(apsProcessOperationDo.getId());
 
 //        //=============更新设备的报工记录ID=============
 //        String newWaitReportId = "";