Jelajahi Sumber

作废、sop编辑修改

wangliang 1 tahun lalu
induk
melakukan
49a4359a8a

+ 10 - 8
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDeviceDeliveryServiceImpl.java

@@ -542,14 +542,16 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
                             new QueryWrapper<TBDeviceInOut>().lambda().eq(TBDeviceInOut::getSopNo, sopNo)
                                     .eq(TBDeviceInOut::getType, InOutTypeEnum.OUT)
                                     .eq(TBDeviceInOut::getSerialNo, deviceInOutForm.getSerialNo()));
-                    SysDevice sysDevice = sysDeviceService.getOne(new QueryWrapper<SysDevice>().lambda()
-                            .eq(SysDevice::getSerialNo, deviceInOutForm.getSerialNo()));
-                    sysDevice.setLocation(tbDeviceInOut.getLocation());
-                    sysDevice.setLocationArr(tbDeviceInOut.getAddressArr());
-                    sysDevice.updateInfo(userId);
-
-                    tbDeviceInOutService.removeById(tbDeviceInOut.getId());
-                    sysDeviceService.updateById(sysDevice);
+                    if (Objects.nonNull(tbDeviceInOut)) {
+                        SysDevice sysDevice = sysDeviceService.getOne(new QueryWrapper<SysDevice>().lambda()
+                                .eq(SysDevice::getSerialNo, deviceInOutForm.getSerialNo()));
+                        sysDevice.setLocation(tbDeviceInOut.getLocation());
+                        sysDevice.setLocationArr(tbDeviceInOut.getAddressArr());
+                        sysDevice.updateInfo(userId);
+
+                        tbDeviceInOutService.removeById(tbDeviceInOut.getId());
+                        sysDeviceService.updateById(sysDevice);
+                    }
                 }
             }
         }

+ 4 - 8
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -1245,18 +1245,14 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             tbSopInfoService.saveJobRemind(map);
 
             if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW
-                    && tfFlowApprove.getSetup().intValue() == 4) {
+                    && tfFlowApprove.getSetup().intValue() >= 4) {
+                tbSopInfoService.sopDeviceInOutSave(map, 4);
+            } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
+                    && tfFlowApprove.getSetup().intValue() >= 4) {
                 tbSopInfoService.sopDeviceInOutSave(map, 4);
-            }
-
-            if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
-                    && tfFlowApprove.getSetup().intValue() > 4) {
                 FlowTaskResult flowTaskResultDeviceOut = this.getFormProperties(tfCustomFlowEntity, 4);
                 tbDeviceDeliveryService.updateStatusBySop(flowTaskResultDeviceOut, tfCustomFlowEntity.getCrmNo(),
                         DeviceDeliveryStatusEnum.RECEIVE, sysUser.getId());
-            } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
-                    && tfFlowApprove.getSetup().intValue() == 4) {
-                tbSopInfoService.sopDeviceInOutSave(map, 4);
             }
 
             FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);