Explorar o código

内部报验-修改/重新报验

wangming hai 1 ano
pai
achega
a34b177c83

+ 20 - 5
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxInsideInspectionDispatchDao.java

@@ -19,11 +19,26 @@ public interface ZhcxInsideInspectionDispatchDao extends BaseMapper<ZhcxInsideIn
      *
      * @param entity
      */
-    @Update("update INCONTROL.ZHCX_INSIDE_INSPECTION_DISPATCH " +
-            "set SFILES = '', CANVAS = '', SIGNATURE = '', DISPATCHSTATUS = '10', CANCELTYPE = '', CANCELREASON = '', " +
-            "INSPECTIONCONCLUSION = '',REFUSEREASON='',SUPERVISIONID = ''," +
-            "SUPERVISION = '',SUPERVISIONPHONE = '',CHECKSTARTTIME = '', CHECKENDTIME = '' " +
-            "where ID = #{id}")
+    @Update("UPDATE  " +
+            " ZHCX_INSIDE_INSPECTION_DISPATCH disp,  " +
+            " ZHCX_INSIDE_INSPECTION inside  " +
+            "SET  " +
+            " disp.SFILES = '',  " +
+            " disp.CANVAS = '',  " +
+            " disp.SIGNATURE = '',  " +
+            " disp.DISPATCHSTATUS = '20',  " +
+            " disp.CANCELTYPE = '',  " +
+            " disp.CANCELREASON = '',  " +
+            " disp.INSPECTIONCONCLUSION = '',  " +
+            " disp.REFUSEREASON = '',  " +
+            " disp.CHECKSTARTTIME = '',  " +
+            " disp.CHECKENDTIME = '',  " +
+            " disp.SUPERVISIONID = inside.CHECKERID,  " +
+            " disp.SUPERVISION = inside.CHECKERNAME,  " +
+            " disp.SUPERVISIONPHONE = inside.CHECKERCONTACT  " +
+            "WHERE  " +
+            " disp.ID = #{id}  " +
+            " AND inside.ID = disp.INSIDEID")
     void reInspection(ZhcxInsideInspectionDispatchDo entity);
 
 }

+ 12 - 9
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxInsideInspectionDispatchServiceImpl.java

@@ -39,17 +39,9 @@ public class ZhcxInsideInspectionDispatchServiceImpl extends ServiceImpl<ZhcxIns
         LambdaQueryWrapper<ZhcxInsideInspectionDispatchDo> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(ZhcxInsideInspectionDispatchDo::getInsideid, inspectionDo.getId());
         queryWrapper.eq(ZhcxInsideInspectionDispatchDo::getDeleted, "0");
-        int count = count(queryWrapper);
-        if(count > 0) {
-            return ;
-        }
+        ZhcxInsideInspectionDispatchDo dispatch = getOne(queryWrapper);
 
-        //生成派单信息
         ZhcxInsideInspectionDispatchDo dispatchDo = new ZhcxInsideInspectionDispatchDo();
-        dispatchDo.setId(SecurityUtil.getUUID());
-        dispatchDo.setDeleted("0");
-        dispatchDo.setInsideid(inspectionDo.getId());
-
         //存在派单
         if(ObjectUtil.isNotEmpty(inspectionDo.getCheckerid())) {
             dispatchDo.setSupervisionid(inspectionDo.getCheckerid());
@@ -60,6 +52,17 @@ public class ZhcxInsideInspectionDispatchServiceImpl extends ServiceImpl<ZhcxIns
             dispatchDo.setDispatchstatus("10");
         }
 
+        if(ObjectUtil.isNotNull(dispatch)) {
+            dispatchDo.setId(dispatch.getId());
+            updateById(dispatchDo);
+            return ;
+        }
+
+        //生成派单信息
+        dispatchDo.setId(SecurityUtil.getUUID());
+        dispatchDo.setDeleted("0");
+        dispatchDo.setInsideid(inspectionDo.getId());
+
 
         save(dispatchDo);
     }

+ 5 - 2
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxInsideInspectionServiceImpl.java

@@ -4,10 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.rongwei.bscommon.sys.feign.SysNotifyFeginService;
 import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionDispatchService;
 import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionOperLogService;
 import com.rongwei.bscommon.sys.utils.ZhcxCommon;
@@ -78,6 +76,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * @param req
      */
     @Override
+    @Transactional
     public void launch(InsideInspectionOperRequest req) {
         ZhcxInsideInspectionDo inspectionDo = getById(req.getId());
         //生成报验单号
@@ -92,6 +91,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * @param req
      */
     @Override
+    @Transactional
     public void cancel(InsideInspectionRequest req) {
 
         if(ObjectUtil.isEmpty(req.getInsideIdList())) {
@@ -174,6 +174,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * @param req
      */
     @Override
+    @Transactional
     public void dispatch(InsideInspectionDispatchRequest req) {
         if(ObjectUtil.isEmpty(req.getInsideIdList())) {
             throw  new CustomException("请联系管理员,暂无报验单");
@@ -239,6 +240,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * @param dto
      */
     @Override
+    @Transactional
     public void reDispatch(InsideInspectionDispatchRequest dto) {
         dispatch(dto);
     }
@@ -249,6 +251,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * @param req
      */
     @Override
+    @Transactional
     public void execute(InsideInspectionExecuteRequest req) {
 
         if(ObjectUtil.isEmpty(req.getInsideIdList())) {