Browse Source

子表修改

wangming 3 months ago
parent
commit
b73a8c4c75

+ 16 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxOutsideInspectionItpDao.java

@@ -122,4 +122,20 @@ public interface ZhcxOutsideInspectionItpDao extends BaseMapper<ZhcxOutsideInspe
             "WHERE " +
             " sd.INSPECTIONCONCLUSION IN ('10', '30') AND i.DELETED = '0' AND sd.DELETED = '0'")
     List<OutsideInspectionVo> getShipInspectionDisplay();
+
+    /**
+     * 修改qc修改次数
+     *
+     * @param id
+     */
+    @Update("update ZHCX_OUTSIDE_INSPECTION_ITP set QCMODIFYNUMBER = ifnull(QCMODIFYNUMBER, 0) + 1 where ID = #{id}")
+    void updateQcModifyNumber(@Param("id") String id);
+
+    /**
+     * 修改ndt修改次数
+     *
+     * @param id
+     */
+    @Update("update ZHCX_OUTSIDE_INSPECTION_ITP set NDTMODIFYNUMBER = ifnull(NDTMODIFYNUMBER, 0) + 1 where ID = #{id}")
+    void updateNdtModifyNumber(@Param("id") String id);
 }

+ 22 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxOutsideInspectionItpServiceImpl.java

@@ -33,7 +33,9 @@ import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.rwcommon.utils.StringUtils;
+import com.rongwei.rwcommon.vo.generalsql.GeneralUpdateVo;
 import com.rongwei.rwcommon.vo.generalsql.MasterSlaveUpdateVo;
+import com.rongwei.rwcommon.vo.generalsql.SlaveDMLVo;
 import com.rongwei.rwcommoncomponent.excel.aspose.ExcelFormData;
 import com.rongwei.rwcommoncomponent.excel.vo.FormData;
 import com.rongwei.rwcommoncomponent.file.service.SysFileItemService;
@@ -177,7 +179,27 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
         //重新报验
         else if("reInspection".equals(req.getOperType())) {
             reInspection(req.getId(), req.getUpdate());
+        } else if("updateChildren".equals(req.getOperType())) { //修改子表
+            try {
+                for (SlaveDMLVo slaveDMLVo : req.getUpdate().getSlaveUpdate()) { //只会修改qc和ndt
+                    if(!"ZHCX_OUTSIDE_INSPECTION_ITP_QC_ITEM_RESULT".equals(slaveDMLVo.getTableName())
+                            && !"ZHCX_OUTSIDE_INSPECTION_ITP_NDT_RESULT".equals(slaveDMLVo.getTableName())) {
+                        continue;
+                    }
+
+                    for (GeneralUpdateVo generalUpdate : slaveDMLVo.getSlaveUpdate()) {
+                        sysGeneralCRUDService.generalUpdate(generalUpdate);
+                    }
+                }
+            } catch (Exception e) {
+                log.error("更新失败", e);
+                throw new CustomException("更新失败");
+            }
+
         }
+
+        dao.updateQcModifyNumber(req.getId()); //修改qc次数
+        dao.updateNdtModifyNumber(req.getId()); //修改ndt次数
     }
 
     /**

+ 12 - 0
business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxOutsideInspectionItpDo.java

@@ -354,4 +354,16 @@ public class ZhcxOutsideInspectionItpDo extends BaseDo {
      */
     @TableField("SERIALNUMBER")
     private String serialnumber;
+
+    /**
+     * qc修改次数
+     */
+    @TableField("QCMODIFYNUMBER")
+    private String qcmodifynumber;
+
+    /**
+     * ndt修改次数
+     */
+    @TableField("NDTMODIFYNUMBER")
+    private String ndtmodifynumber;
 }