Selaa lähdekoodia

报验单历史操作记录

wangming 1 vuosi sitten
vanhempi
commit
cda140d224

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

@@ -0,0 +1,16 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpOperLogDo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 外部报验-ITP报验操作日志 Mapper 接口
+ * </p>
+ *
+ * @author fpy
+ * @since 2024-03-18
+ */
+public interface ZhcxOutsideInspectionItpOperLogDao extends BaseMapper<ZhcxOutsideInspectionItpOperLogDo> {
+
+}

+ 34 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxOutsideInspectionItpOperLogService.java

@@ -0,0 +1,34 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpOperLogDo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 外部报验-ITP报验操作日志 服务类
+ * </p>
+ *
+ * @author fpy
+ * @since 2024-03-18
+ */
+public interface ZhcxOutsideInspectionItpOperLogService extends IService<ZhcxOutsideInspectionItpOperLogDo> {
+
+    /**
+     * 获取新的日志
+     *
+     * @return
+     */
+    ZhcxOutsideInspectionItpOperLogDo getNew();
+
+    /**
+     * 获取新的日志
+     *
+     * @param itpId
+     * @param operType
+     * @param operTime
+     * @return
+     */
+    ZhcxOutsideInspectionItpOperLogDo getNew(String itpId, String operType, Date operTime);
+}

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

@@ -0,0 +1,61 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.rongwei.bscommon.sys.utils.ZhcxCommon;
+import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpOperLogDo;
+import com.rongwei.bscommon.sys.dao.ZhcxOutsideInspectionItpOperLogDao;
+import com.rongwei.bscommon.sys.service.ZhcxOutsideInspectionItpOperLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
+import com.rongwei.rwcommon.utils.SecurityUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 外部报验-ITP报验操作日志 服务实现类
+ * </p>
+ *
+ * @author fpy
+ * @since 2024-03-18
+ */
+@Service
+public class ZhcxOutsideInspectionItpOperLogServiceImpl extends ServiceImpl<ZhcxOutsideInspectionItpOperLogDao, ZhcxOutsideInspectionItpOperLogDo> implements ZhcxOutsideInspectionItpOperLogService {
+
+    @Autowired
+    private ZhcxCommon zhcxCommon;
+
+    /**
+     * 获取新的日志
+     *
+     * @return
+     */
+    @Override
+    public ZhcxOutsideInspectionItpOperLogDo getNew() {
+        SysUserVo user = zhcxCommon.getCurrentUser();
+        ZhcxOutsideInspectionItpOperLogDo itpLog = new ZhcxOutsideInspectionItpOperLogDo();
+        itpLog.setId(SecurityUtil.getUUID());
+        itpLog.setOperuserid(user.getId());
+        itpLog.setOperusername(user.getName());
+
+        return itpLog;
+    }
+
+    /**
+     * 获取新的日志
+     *
+     * @param itpId
+     * @param operType
+     * @param operTime
+     * @return
+     */
+    @Override
+    public ZhcxOutsideInspectionItpOperLogDo getNew(String itpId, String operType, Date operTime) {
+        ZhcxOutsideInspectionItpOperLogDo operLogDo = getNew();
+        operLogDo.setItpid(itpId);
+        operLogDo.setOpertime(operTime);
+        operLogDo.setOpertype(operType);
+        return operLogDo;
+    }
+}

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

@@ -18,6 +18,7 @@ import com.rongwei.bsentity.domain.ZhcxOutsideInspectionComponentTrackDo;
 import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpDo;
 import com.rongwei.bscommon.sys.dao.ZhcxOutsideInspectionItpDao;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpOperLogDo;
 import com.rongwei.bsentity.domain.ZhcxOutsideInspectionItpSupervisionDispatchDo;
 import com.rongwei.bsentity.dto.NotifyDto;
 import com.rongwei.bsentity.vo.*;
@@ -99,6 +100,9 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
     @Value("${temp.filepath:#{null}}")
     private String filepath;
 
+    @Autowired
+    private ZhcxOutsideInspectionItpOperLogService zhcxOutsideInspectionItpOperLogService;
+
     /**
      * 拆单
      *
@@ -164,6 +168,10 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
 //                hasJjyRole = true;
 //            }
 //        }
+
+        List<ZhcxOutsideInspectionItpOperLogDo> logList = new ArrayList<>();
+        Date nowDate = new Date();
+
         for(int i =0;i<vo.size();i++){
             String operType = vo.get(i).getOperType();
             String itpId = vo.get(i).getItpId();
@@ -185,6 +193,10 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
 //                dispatchDo.setId(SecurityUtil.getUUID());
 //            }
 
+            ZhcxOutsideInspectionItpOperLogDo itpLog = zhcxOutsideInspectionItpOperLogService
+                    .getNew(itpId, "5", nowDate);
+            itpLog.setOpertype(operType);
+
             //10未派单 20已派单
             if (dispatchDo != null && "20".equals(dispatchDo.getDispatchstatus())) {
                 log.info("有Dispatch,有dispatchId="+dispatchId);
@@ -337,6 +349,8 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
                 }
                 inspectionItpDos.add(inspectionItpDo);
             }
+
+            logList.add(itpLog);
         }
         if(sb.length()> 0){
             return R.error(sb.toString());
@@ -370,6 +384,9 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
             }
         }
 
+        //操作记录
+        zhcxOutsideInspectionItpOperLogService.saveBatch(logList);
+
         return R.ok();
     }
 
@@ -437,6 +454,10 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
         List<String> newItpIdList = new ArrayList<>();
         List<ZhcxOutsideInspectionComponentTrackDo> trackDos = new ArrayList<>();
 
+        //操作记录
+        List<ZhcxOutsideInspectionItpOperLogDo> logList = new ArrayList<>();
+        Date nowDate = new Date();
+
         int count = -1;
         for(int m = 0, n = structureNames.length; m < n; m++) {
             for(String inspectionContent : inspectionContents) {
@@ -457,6 +478,10 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
                     if(ObjectUtil.isNotNull(trackDo)) {
                         trackDos.add(trackDo);
                     }
+
+                    ZhcxOutsideInspectionItpOperLogDo itpLog = zhcxOutsideInspectionItpOperLogService
+                            .getNew(itpDo.getId(), "5", nowDate);
+                    logList.add(itpLog);
                     continue;
                 }
 
@@ -470,6 +495,10 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
                 insertList.add(entity);
                 newItpIdList.add(entity.getId());
 
+                ZhcxOutsideInspectionItpOperLogDo itpLog = zhcxOutsideInspectionItpOperLogService
+                        .getNew(entity.getId(), "5", nowDate);
+                logList.add(itpLog);
+
                 //空派单
                 ZhcxOutsideInspectionItpSupervisionDispatchDo dispatchDo = new ZhcxOutsideInspectionItpSupervisionDispatchDo();
                 dispatchDo.setId(SecurityUtil.getUUID());
@@ -499,6 +528,9 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
         if(ObjectUtil.isNotEmpty(trackDos)) {
             inspectionComponentTrackService.saveBatch(trackDos);
         }
+
+        //日志
+        zhcxOutsideInspectionItpOperLogService.saveBatch(logList);
     }
 
     /**
@@ -521,6 +553,11 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
         updateEntity.setId(itpDo.getId());
         updateEntity.setInspectioncode(genCode());
         updateById(updateEntity);
+
+        //操作记录
+        ZhcxOutsideInspectionItpOperLogDo itpLog = zhcxOutsideInspectionItpOperLogService
+                .getNew(itpDo.getId(), "5", new Date());
+        zhcxOutsideInspectionItpOperLogService.save(itpLog);
     }
 
     /**

+ 81 - 0
business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxOutsideInspectionItpOperLogDo.java

@@ -0,0 +1,81 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.rongwei.rwcommon.base.BaseDo;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 外部报验-ITP报验操作日志
+ * </p>
+ *
+ * @author fpy
+ * @since 2024-03-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("ZHCX_OUTSIDE_INSPECTION_ITP_OPER_LOG")
+public class ZhcxOutsideInspectionItpOperLogDo extends BaseDo {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 主键
+     */
+    @TableField("ID")
+    private String id;
+    /**
+     * 租户ID
+     */
+    @TableField("TENANTID")
+    private String tenantid;
+    /**
+     * 扩展预留
+     */
+    @TableField("ROPTION")
+    private String roption;
+    /**
+     * ITP报验id
+     */
+    @TableField("ITPID")
+    private String itpid;
+    /**
+     * 操作类型
+     */
+    @TableField("OPERTYPE")
+    private String opertype;
+    /**
+     * 操作描述
+     */
+    @TableField("OPERDESCRIPTION")
+    private String operdescription;
+    /**
+     * 操作来源(移动端,PC端)
+     */
+    @TableField("OPERSOURCE")
+    private String opersource;
+    /**
+     * 操作时间
+     */
+    @TableField("OPERTIME")
+    private Date opertime;
+
+    /**
+     * 操作用户id
+     */
+    @TableField("OPERUSERID")
+    private String operuserid;
+
+    /**
+     * 操作用户姓名
+     */
+    @TableField("OPERUSERNAME")
+    private String operusername;
+
+
+}