Quellcode durchsuchen

试车树保存

zhuang vor 7 Monaten
Ursprung
Commit
722044c1f2

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

@@ -0,0 +1,16 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.rongwei.bsentity.domain.ZhcxCommissionCheckDetailTreeDo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author dlc
+ * @since 2024-12-28
+ */
+public interface ZhcxCommissionCheckDetailTreeDao extends BaseMapper<ZhcxCommissionCheckDetailTreeDo> {
+
+}

+ 16 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxCommissionCheckDetailTreeService.java

@@ -0,0 +1,16 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.rongwei.bsentity.domain.ZhcxCommissionCheckDetailTreeDo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author dlc
+ * @since 2024-12-28
+ */
+public interface ZhcxCommissionCheckDetailTreeService extends IService<ZhcxCommissionCheckDetailTreeDo> {
+
+}

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

@@ -0,0 +1,20 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.rongwei.bsentity.domain.ZhcxCommissionCheckDetailTreeDo;
+import com.rongwei.bscommon.sys.dao.ZhcxCommissionCheckDetailTreeDao;
+import com.rongwei.bscommon.sys.service.ZhcxCommissionCheckDetailTreeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author dlc
+ * @since 2024-12-28
+ */
+@Service
+public class ZhcxCommissionCheckDetailTreeServiceImpl extends ServiceImpl<ZhcxCommissionCheckDetailTreeDao, ZhcxCommissionCheckDetailTreeDo> implements ZhcxCommissionCheckDetailTreeService {
+
+}

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

@@ -29,6 +29,7 @@ import com.rongwei.rwcommoncomponent.excel.vo.FormData;
 import com.rongwei.rwcommoncomponent.file.service.SysFileItemService;
 import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.scheduling.annotation.Async;
@@ -82,6 +83,8 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
 
     @Autowired
     private ZhcxCommissionCheckBaseInfoTreeService zhcxCommissionCheckBaseInfoTreeService;
+    @Autowired
+    private ZhcxCommissionCheckDetailTreeService zhcxCommissionCheckDetailTreeService;
 
     @Autowired
     private ExcelUtils excelUtils;
@@ -141,10 +144,15 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
                 .eq(ZhcxCommissionCheckBaseInfoTreeDo::getBaseinfoid,productTypeId);
         List<ZhcxCommissionCheckBaseInfoTreeDo> list = zhcxCommissionCheckBaseInfoTreeService.list(queryWrapper);
         if(list.size() > 0){
+            List<ZhcxCommissionCheckDetailTreeDo> targetList = new ArrayList<>();
             list.forEach(tree -> {
-                tree.setId(tree.getId()+check.getProjectcode());
+                tree.setId(tree.getId()+check.getProjectcode()).setBaseinfoid(check.getProjectcode());
+                ZhcxCommissionCheckDetailTreeDo target = new ZhcxCommissionCheckDetailTreeDo(); // 初始化一个目标对象
+                BeanUtils.copyProperties(tree, target);
+                targetList.add(target);
             });
-            zhcxCommissionCheckBaseInfoTreeService.saveBatch(list);
+            //zhcxCommissionCheckBaseInfoTreeService.saveBatch(list);
+            zhcxCommissionCheckDetailTreeService.saveBatch(targetList);
         }
         // 试车子表
         List<ZhcxCommissionCheckDetailDo> checkDetails = checkDTO.getCheckDetails();
@@ -165,10 +173,10 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
         // 正片开始
         for (ZhcxCommissionCheckParameterSetDetalDo setDetail : setDetails) {
             // 试车检查主表机号判断 如果该机已存在就返回
-            LambdaQueryWrapper<ZhcxCommissionCheckDo> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(ZhcxCommissionCheckDo::getDeleted,"0")
+            LambdaQueryWrapper<ZhcxCommissionCheckDo> queryWrapper1 = new LambdaQueryWrapper<>();
+            queryWrapper1.eq(ZhcxCommissionCheckDo::getDeleted,"0")
                     .eq(ZhcxCommissionCheckDo::getMachineid,setDetail.getMachineid());
-            List<ZhcxCommissionCheckDo> checkDos = this.list(queryWrapper);
+            List<ZhcxCommissionCheckDo> checkDos = this.list(queryWrapper1);
             if (!checkDos.isEmpty()){
                 continue;
             }

+ 81 - 0
business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxCommissionCheckDetailTreeDo.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>
+ * 
+ * </p>
+ *
+ * @author dlc
+ * @since 2024-12-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("ZHCX_COMMISSION_CHECK_DETAIL_TREE")
+public class ZhcxCommissionCheckDetailTreeDo extends BaseDo {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 主键
+     */
+    @TableField("ID")
+    private String id;
+    /**
+     * 租户id
+     */
+    @TableField("TENANTID")
+    private String tenantid;
+    /**
+     * 扩展json格式配置
+     */
+    @TableField("ROPTION")
+    private String roption;
+    /**
+     * 父id
+     */
+    @TableField("PID")
+    private String pid;
+    /**
+     * 分类
+     */
+    @TableField("NAME")
+    private String name;
+    /**
+     * 排序
+     */
+    @TableField("SORT")
+    private Integer sort;
+    /**
+     * 标准主表id
+     */
+    @TableField("BASEINFOID")
+    private String baseinfoid;
+    /**
+     * 产品类型
+     */
+    @TableField("PRODUCTTYPE")
+    private String producttype;
+    /**
+     * FULLPID
+     */
+    @TableField("FULLPID")
+    private String fullpid;
+    /**
+     * 层级
+     */
+    @TableField("LEVEL")
+    private Integer level;
+    @TableField("TREECODE")
+    private String treecode;
+
+
+}