2 Commits ebb1909a41 ... b35cdedb88

Autore SHA1 Messaggio Data
  linhuili b35cdedb88 Merge remote-tracking branch 'origin/develop' into develop 2 anni fa
  linhuili 6ec795b4cd 生成项目交付范围代码调整 2 anni fa

+ 1 - 0
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/define/service/IObjectInfoService.java

@@ -137,4 +137,5 @@ public interface IObjectInfoService {
      * @return
      * @return
      */
      */
     Page<Map<String, Object>> queryCollectInfos(Page pageable, String projectId, QueryWrapper<ObjectInfoDefine> wrapper);
     Page<Map<String, Object>> queryCollectInfos(Page pageable, String projectId, QueryWrapper<ObjectInfoDefine> wrapper);
+
 }
 }

+ 5 - 10
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/delivery/controller/ObjectTypeCollectController.java

@@ -11,7 +11,7 @@ import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.exception.BusinessException;
 import com.persagy.dmp.common.exception.BusinessException;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.common.utils.ResultHelper;
 import com.persagy.dmp.common.utils.ResultHelper;
-import com.persagy.dmp.delivery.dto.boss.DeliveryOrderDTO;
+import com.persagy.dmp.delivery.dto.DeliveryPlanDTO;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.rwd.delivery.service.IObjectTypeCollectService;
 import com.persagy.dmp.rwd.delivery.service.IObjectTypeCollectService;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
@@ -60,21 +60,16 @@ public class ObjectTypeCollectController {
     }
     }
 
 
     /**
     /**
-     * 设置项目交付范围信息
+     * 生成项目交付范围
      * @param voList
      * @param voList
      * @return
      * @return
      */
      */
-    @PostMapping("/setting")
-    public CommonResult<List<DeliveryOrderDTO>> settingProjectDelivery(@RequestBody List<DeliveryOrderDTO> voList) throws Exception{
+    @PostMapping("/createProjDelivery")
+    public CommonResult<List<DeliveryPlanDTO>> createProjectDelivery(@RequestBody List<DeliveryPlanDTO> voList) throws Exception{
         if(CollUtil.isEmpty(voList)){
         if(CollUtil.isEmpty(voList)){
             throw new BusinessException(ResponseCode.A0400.getCode(), ResponseCode.A0400.getDesc());
             throw new BusinessException(ResponseCode.A0400.getCode(), ResponseCode.A0400.getDesc());
         }
         }
-        for (DeliveryOrderDTO deliveryOrderDTO : voList) {
-            if(CollUtil.isEmpty(deliveryOrderDTO.getGoodsCode())){
-                throw new BusinessException(ResponseCode.A0400.getCode(), "商品编码不允许为空");
-            }
-        }
-        service.settingProjectDelivery(voList);
+        service.createProjectDelivery(voList);
         return ResultHelper.multi(voList);
         return ResultHelper.multi(voList);
     }
     }
 
 

+ 0 - 12
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/delivery/dao/BossBdtpTypeRelMapper.java

@@ -1,12 +0,0 @@
-package com.persagy.dmp.rwd.delivery.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.dmp.delivery.entity.BossBdtpTypeRel;
-
-/**
- *  BOSS商品-BDTP类型映射关系 DTO
- * @author:linhuili
- * @date:2022/1/19
- */
-public interface BossBdtpTypeRelMapper extends BaseMapper<BossBdtpTypeRel> {
-}

+ 0 - 20
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/delivery/service/IBossBdtpTypeRelService.java

@@ -1,20 +0,0 @@
-package com.persagy.dmp.rwd.delivery.service;
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.persagy.dmp.delivery.entity.BossBdtpTypeRel;
-import java.util.List;
-
-/**
- * BOSS商品-BDTP类型映射关系
- * @author:linhuili
- * @date:2022/1/19
- */
-public interface IBossBdtpTypeRelService {
-
-    /**
-     * 条件查询BOSS-BDTP商品映射关系
-     * @param queryWrapper 查询条件
-     * @return 返回结果
-     */
-    List<BossBdtpTypeRel> queryByCondition(Wrapper<BossBdtpTypeRel> queryWrapper);
-}

+ 2 - 2
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/delivery/service/IObjectTypeCollectService.java

@@ -3,7 +3,7 @@ package com.persagy.dmp.rwd.delivery.service;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.persagy.dmp.delivery.dto.boss.DeliveryOrderDTO;
+import com.persagy.dmp.delivery.dto.DeliveryPlanDTO;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 
 
@@ -58,5 +58,5 @@ public interface IObjectTypeCollectService extends IService<ObjectTypeCollect> {
      */
      */
     void delete(List<String> idList);
     void delete(List<String> idList);
 
 
-    List<DeliveryOrderDTO> settingProjectDelivery(@RequestBody List<DeliveryOrderDTO> voList) throws Exception;
+    List<DeliveryPlanDTO> createProjectDelivery(@RequestBody List<DeliveryPlanDTO> voList) throws Exception;
 }
 }

+ 0 - 31
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/delivery/service/impl/BossBdtpTypeRelServiceImpl.java

@@ -1,31 +0,0 @@
-package com.persagy.dmp.rwd.delivery.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.persagy.dmp.delivery.entity.BossBdtpTypeRel;
-import com.persagy.dmp.rwd.delivery.dao.BossBdtpTypeRelMapper;
-import com.persagy.dmp.rwd.delivery.service.IBossBdtpTypeRelService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import java.util.List;
-
-/**
- * BOSS商品-BDTP类型映射关系
- * @author:linhuili
- * @date:2022/1/19
- */
-@Service
-public class BossBdtpTypeRelServiceImpl implements IBossBdtpTypeRelService {
-
-    @Autowired
-    private BossBdtpTypeRelMapper boosBdtpTypeRelMapper;
-
-    /**
-     * 条件查询BOSS-BDTP商品映射关系
-     * @param queryWrapper 查询条件
-     * @return
-     */
-    @Override
-    public List<BossBdtpTypeRel> queryByCondition(Wrapper<BossBdtpTypeRel> queryWrapper) {
-        return boosBdtpTypeRelMapper.selectList(queryWrapper);
-    }
-}

+ 128 - 126
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/delivery/service/impl/ObjectTypeCollectServiceImpl.java

@@ -9,18 +9,18 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.persagy.dmp.common.constant.ValidEnum;
 import com.persagy.dmp.common.constant.ValidEnum;
 import com.persagy.dmp.common.model.entity.BaseEntity;
 import com.persagy.dmp.common.model.entity.BaseEntity;
 import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import com.persagy.dmp.define.entity.ObjectTypeDefine;
+import com.persagy.dmp.delivery.dto.DeliveryPlanDTO;
 import com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO;
 import com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO;
-import com.persagy.dmp.delivery.dto.boss.DeliveryOrderDTO;
 import com.persagy.dmp.delivery.entity.BossBdtpTypeRel;
 import com.persagy.dmp.delivery.entity.BossBdtpTypeRel;
 import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.delivery.entity.RelationDefineCollect;
 import com.persagy.dmp.delivery.entity.RelationDefineCollect;
 import com.persagy.dmp.rwd.define.service.IObjectTypeService;
 import com.persagy.dmp.rwd.define.service.IObjectTypeService;
 import com.persagy.dmp.rwd.delivery.dao.ObjectTypeCollectMapper;
 import com.persagy.dmp.rwd.delivery.dao.ObjectTypeCollectMapper;
-import com.persagy.dmp.rwd.delivery.service.IBossBdtpTypeRelService;
 import com.persagy.dmp.rwd.delivery.service.IObjectInfoCollectService;
 import com.persagy.dmp.rwd.delivery.service.IObjectInfoCollectService;
 import com.persagy.dmp.rwd.delivery.service.IObjectTypeCollectService;
 import com.persagy.dmp.rwd.delivery.service.IObjectTypeCollectService;
 import com.persagy.dmp.rwd.delivery.service.IRelationDefineCollectService;
 import com.persagy.dmp.rwd.delivery.service.IRelationDefineCollectService;
@@ -49,9 +49,6 @@ public class ObjectTypeCollectServiceImpl extends ServiceImpl<ObjectTypeCollectM
     private IObjectTypeService objectTypeService;
     private IObjectTypeService objectTypeService;
 
 
     @Autowired
     @Autowired
-    private IBossBdtpTypeRelService bossBdtpTypeRelService;
-
-    @Autowired
     private IObjectTypeCollectService objectTypeCollectService;
     private IObjectTypeCollectService objectTypeCollectService;
 
 
     @Autowired
     @Autowired
@@ -81,108 +78,28 @@ public class ObjectTypeCollectServiceImpl extends ServiceImpl<ObjectTypeCollectM
     }
     }
 
 
     /**
     /**
-     * 设置项目交付范围信息
+     * 生成项目交付范围信息
      * @param voList
      * @param voList
      * @return
      * @return
      * @throws Exception
      * @throws Exception
      */
      */
     @Override
     @Override
-    public List<DeliveryOrderDTO> settingProjectDelivery(List<DeliveryOrderDTO> voList) throws Exception {
-        //1. 查询商品映射关系
-        Map<String, Set<String>> typeRelMap = queryBossBdtpTypeRel();
-        if(CollUtil.isEmpty(typeRelMap)){
-            return voList;
-        }
-        //2. 查询BDTP标准交付范围-对象类型
+    public List<DeliveryPlanDTO> createProjectDelivery(List<DeliveryPlanDTO> voList) throws Exception {
+        //1. 查询BDTP标准交付范围-对象类型
         Map<String, ObjectTypeCollect> typeCollectMap = queryBdtpObjectTypeCollect();
         Map<String, ObjectTypeCollect> typeCollectMap = queryBdtpObjectTypeCollect();
-        //3. 查询BDTP标准交付范围-信息点
+        //2. 查询BDTP标准交付范围-信息点
         Map<String, List<ObjectInfoCollect>> infoCollectMap = queryBdtpObjectInfoCollect();
         Map<String, List<ObjectInfoCollect>> infoCollectMap = queryBdtpObjectInfoCollect();
-        //4. 查询BDTP标准交付范围- 关系
-        Map<String, List<RelationDefineCollect>> relationCollectMap = queryBdtpObjectRelCollect();
-
-        //5. 初始化项目交付范围
-        for (DeliveryOrderDTO deliveryOrderDTO : voList) {
-            ArrayNode goodsCode = deliveryOrderDTO.getGoodsCode();
-            if(CollUtil.isEmpty(goodsCode)){
-                continue;
-            }
-            //获取项目需交付类型编码
-            Set<String> allTypeCodes = new HashSet<>();
-            goodsCode.forEach(item->{
-                Set<String> typecodes = typeRelMap.get(item);
-                if(CollUtil.isEmpty(typecodes)){
-                    allTypeCodes.addAll(typecodes);
-                }
-            });
-            //初始化对象类型交付范围
-            initDelivertyObjectType(deliveryOrderDTO,allTypeCodes,typeCollectMap);
-            //初始化信息点交付范围
-            initDelivertyObjectInfo(deliveryOrderDTO,allTypeCodes,infoCollectMap);
-            //初始化关系交付范围
-            //存储原订单信息
-        }
-        return null;
-    }
+        //3. 查询BDTP标准交付范围- 关系
+        List<RelationDefineCollect> relationCollectList = queryBdtpObjectRelCollect();
+        //4. 初始化项目交付范围
 
 
-    /**
-     * 初始化对象类型交付范围
-     * @param deliveryOrderDTO
-     * @param allTypeCodes
-     */
-    private void initDelivertyObjectType(DeliveryOrderDTO deliveryOrderDTO,Set<String> allTypeCodes,Map<String, ObjectTypeCollect> typeCollectMap) throws Exception{
-       if(CollUtil.isEmpty(allTypeCodes) || CollUtil.isEmpty(typeCollectMap)){
-           return;
-       }
-       //组装类型交付信息
-       List<ObjectTypeCollect> content = new ArrayList<>();
-       for (String typeCode : allTypeCodes) {
-            ObjectTypeCollect typeCollect = typeCollectMap.get(typeCode);
-            if(typeCollect == null){
-                log.info("BOSS项目范围交付:交付类型不在BDTP标准交付范围内:{}"+typeCode);
-                continue;
-            }
-            typeCollect.setProjectId(deliveryOrderDTO.getProjectId());
-            typeCollect.setIsDelivery(1);
-            content.add(typeCollect);
-        }
-       if(CollUtil.isEmpty(content)){
-           log.info("BOSS项目范围交付:无类型交付信息");
-           return;
-       }
-       //类型信息交付
-       objectTypeCollectService.insert(content);
-    }
-
-
-    /**
-     * 初始化对象类型交付范围
-     * @param deliveryOrderDTO
-     * @param allTypeCodes
-     */
-    private void initDelivertyObjectInfo(DeliveryOrderDTO deliveryOrderDTO,Set<String> allTypeCodes,Map<String, List<ObjectInfoCollect>> infoCollectMap) throws Exception{
-        if(CollUtil.isEmpty(allTypeCodes) || CollUtil.isEmpty(infoCollectMap)){
-            return;
-        }
-        //组装信息点交付信息
-        List<ObjectInfoCollect> content = new ArrayList<>();
-        for (String typeCode : allTypeCodes) {
-            List<ObjectInfoCollect> infoCollectList = infoCollectMap.get(typeCode);
-            if(CollUtil.isEmpty(infoCollectList)){
-                log.info("该类型下无需交付的信息点:{}"+typeCode);
-                continue;
-            }
-            infoCollectList.forEach(item->{
-                item.setProjectId(deliveryOrderDTO.getProjectId());
-                item.setIsDelivery(true);
-                content.add(item);
-            });
-        }
-        if(CollUtil.isEmpty(content)){
-            log.info("BOSS项目范围交付:无信息点交付信息");
-            return;
-        }
-        //类型信息交付
-        objectInfoCollectService.insert(content);
+        //5.1 初始化对象类型交付范围
+        initDelivertyObjectType(voList,typeCollectMap);
+        //5.2 初始化信息点交付范围
+        initDelivertyObjectInfo(voList,infoCollectMap);
+        //5.3 初始化关系交付范围
+        initDeliveryGraphRel(voList,relationCollectList);
+        return new ArrayList<>();
     }
     }
 
 
     /**
     /**
@@ -320,19 +237,6 @@ public class ObjectTypeCollectServiceImpl extends ServiceImpl<ObjectTypeCollectM
     }
     }
 
 
     /**
     /**
-     * 查询商品类型映射关系
-     * @return
-     */
-    private Map<String,Set<String>> queryBossBdtpTypeRel(){
-       List<BossBdtpTypeRel> typeRelList = bossBdtpTypeRelService.queryByCondition(new QueryWrapper<>());
-       if(CollUtil.isEmpty(typeRelList)){
-           return new HashMap<>();
-       }
-        return typeRelList.stream().collect(Collectors.groupingBy(BossBdtpTypeRel::getGoodCode,
-               Collectors.mapping(BossBdtpTypeRel::getTypeCode, Collectors.toSet())));
-    }
-
-    /**
      * 查询BDTP标准交付范围-对象类型
      * 查询BDTP标准交付范围-对象类型
      */
      */
     private Map<String,ObjectTypeCollect> queryBdtpObjectTypeCollect(){
     private Map<String,ObjectTypeCollect> queryBdtpObjectTypeCollect(){
@@ -367,28 +271,126 @@ public class ObjectTypeCollectServiceImpl extends ServiceImpl<ObjectTypeCollectM
     /**
     /**
      * 查询BDTP标准交付范围-关系
      * 查询BDTP标准交付范围-关系
      */
      */
-    private Map<String,List<RelationDefineCollect>> queryBdtpObjectRelCollect(){
+    private List<RelationDefineCollect> queryBdtpObjectRelCollect(){
         LambdaQueryWrapper<RelationDefineCollect> wrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<RelationDefineCollect> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(RelationDefineCollect::getGroupCode,"0");
         wrapper.eq(RelationDefineCollect::getGroupCode,"0");
         wrapper.eq(RelationDefineCollect::getProjectId,"0");
         wrapper.eq(RelationDefineCollect::getProjectId,"0");
         wrapper.eq(RelationDefineCollect::getValid,ValidEnum.TRUE.getType());
         wrapper.eq(RelationDefineCollect::getValid,ValidEnum.TRUE.getType());
-        List<RelationDefineCollect> relationCollects = relationDefineCollectService.queryByCondition(wrapper);
-        if(CollUtil.isEmpty(relationCollects)){
-            return new HashMap<>();
-        }/*
+        return relationDefineCollectService.queryByCondition(wrapper);
+    }
+
+    /**
+     * 初始化对象类型交付范围
+     * @param deliverPlanList
+     */
+    private void initDelivertyObjectType(List<DeliveryPlanDTO> deliverPlanList,Map<String, ObjectTypeCollect> typeCollectMap) throws Exception{
+        if(CollUtil.isEmpty(deliverPlanList) || CollUtil.isEmpty(typeCollectMap)){
+            return;
+        }
+        //组装类型交付信息
+        List<ObjectTypeCollect> content = new ArrayList<>();
+        for (DeliveryPlanDTO deliveryPlan : deliverPlanList) {
+            String classCode = deliveryPlan.getClassCode();
+            ObjectTypeCollect typeCollect = typeCollectMap.get(classCode);
+            if(typeCollect == null){
+                log.info("BOSS项目范围交付:交付类型不在BDTP标准交付范围内:{}"+classCode);
+                continue;
+            }
+            typeCollect.setProjectId(deliveryPlan.getProjectId());
+            typeCollect.setIsDelivery(1);
+            content.add(typeCollect);
+        }
+        if(CollUtil.isEmpty(content)){
+            log.info("BOSS项目范围交付:无类型交付信息");
+            return;
+        }
+        //类型信息交付
+        objectTypeCollectService.insert(content);
+    }
+
+
+    /**
+     * 初始化对象类型交付范围
+     * @param deliverPlanList
+     */
+    private void initDelivertyObjectInfo(List<DeliveryPlanDTO> deliverPlanList,Map<String, List<ObjectInfoCollect>> infoCollectMap) throws Exception{
+        if(CollUtil.isEmpty(deliverPlanList) || CollUtil.isEmpty(infoCollectMap)){
+            return;
+        }
+        //组装信息点交付信息
+        List<ObjectInfoCollect> content = new ArrayList<>();
+        for (DeliveryPlanDTO deliveryPlan : deliverPlanList) {
+            String classCode = deliveryPlan.getClassCode();
+            List<ObjectInfoCollect> infoCollectList = infoCollectMap.get(classCode);
+            if(CollUtil.isEmpty(infoCollectList)){
+                log.info("该类型下无需交付的信息点:{}"+classCode);
+                continue;
+            }
+            infoCollectList.forEach(item->{
+                item.setProjectId(deliveryPlan.getProjectId());
+                item.setIsDelivery(true);
+                content.add(item);
+            });
+        }
+        if(CollUtil.isEmpty(content)){
+            log.info("BOSS项目范围交付:无信息点交付信息");
+            return;
+        }
+        //类型信息交付
+        objectInfoCollectService.insert(content);
+    }
 
 
-        Map<String,List<RelationDefineCollect>> resultMap = new HashMap<>();
-        for (RelationDefineCollect relationCollect : relationCollects) {
-            ArrayNode sourceTypeCodes = relationCollect.getSourceTypeCodes();
+    /**
+     * 初始化交付范围关系定义
+     * @param deliverPlanList
+     * @param relDefineCollectList
+     */
+    private void initDeliveryGraphRel(List<DeliveryPlanDTO> deliverPlanList,List<RelationDefineCollect> relDefineCollectList) throws Exception {
+        if(CollUtil.isEmpty(deliverPlanList) || CollUtil.isEmpty(relDefineCollectList)){
+            return;
+        }
+        Set<String> allTypeCodes = relDefineCollectList.stream().map(RelationDefineCollect::getId).collect(Collectors.toSet());
+        List<RelationDefineCollect> result = new ArrayList<>();
+        for (RelationDefineCollect relCollect : relDefineCollectList) {
+            ArrayNode sourceTypeCodes = relCollect.getSourceTypeCodes();
+            //获取源端和末端对象类型在交付范围内的对象类型
             if(CollUtil.isNotEmpty(sourceTypeCodes)){
             if(CollUtil.isNotEmpty(sourceTypeCodes)){
-                sourceTypeCodes.forEach(item->{
-                    List<RelationDefineCollect> list = new ArrayList<>();
-                });
+                sourceTypeCodes = getInDeliveryTypeCode(sourceTypeCodes, allTypeCodes);
             }
             }
-            ArrayNode endTypeCodes = relationCollect.getEndTypeCodes();
+            ArrayNode endTypeCodes = relCollect.getEndTypeCodes();
+            if(CollUtil.isNotEmpty(endTypeCodes)){
+                endTypeCodes = getInDeliveryTypeCode(endTypeCodes, allTypeCodes);
+            }
+            if(CollUtil.isEmpty(sourceTypeCodes) && CollUtil.isEmpty(endTypeCodes)){
+                continue;
+            }
+            //重置源端和末端对象类型
+            relCollect.setSourceTypeCodes(sourceTypeCodes);
+            relCollect.setEndTypeCodes(endTypeCodes);
+            //设置项目信息
+            relCollect.setProjectId(relDefineCollectList.get(0).getProjectId());
+            result.add(relCollect);
         }
         }
-        */
-        return new HashMap<>();
+        //2.初始化关系交付范围
+        relationDefineCollectService.insert(result);
     }
     }
 
 
+    /**
+     * 获取类型在交付范围内的关系数据
+     * @param typeCodes
+     * @param allTypeCodes
+     * @return
+     */
+    private ArrayNode getInDeliveryTypeCode(ArrayNode typeCodes,Set<String> allTypeCodes){
+        ArrayNode array = JsonNodeFactory.instance.arrayNode();
+        if(CollUtil.isEmpty(typeCodes) || CollUtil.isEmpty(allTypeCodes)){
+            return array;
+        }
+        typeCodes.forEach(item->{
+            if(allTypeCodes.contains(item)){
+                array.add(item);
+            }
+        });
+        return array;
+    }
 }
 }

+ 23 - 36
dmp-business/dmp-rwd/src/main/resources/db/init/schema.sql

@@ -311,27 +311,28 @@ CREATE TABLE IF NOT EXISTS `dt_sync_data` (
 ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC COMMENT='adm交付数据同步到项目现场';
 ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC COMMENT='adm交付数据同步到项目现场';
 
 
 CREATE TABLE IF NOT EXISTS `dt_define_type_delivery` (
 CREATE TABLE IF NOT EXISTS `dt_define_type_delivery` (
-    `id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '主键ID',
-    `group_code` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '集团编码',
-    `project_id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目ID',
-    `define_type_id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '类型ID',
-    `code` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '对象类型编码',
-    `obj_type` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '对象类型',
-    `delivery_type` tinyint(1) DEFAULT '0' COMMENT '交付类型:0-项目交付 1-现场交付',
-    `is_delivery` tinyint(1) DEFAULT NULL COMMENT '是否交付 0-否 1-是',
-    `instance_scope` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '交付范围:实例范围',
-    `association_relation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '交付范围:依赖&关联',
-    `delivery_way` tinyint DEFAULT NULL COMMENT '正逆向交付方式 0-逆向 1-正向 2-不确定',
-    `room_func_types` text COLLATE utf8mb4_general_ci COMMENT '交付主张不确定时,正向时设备所在物业空间的空间功能类型',
-    `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '交付范围:备注',
-    `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
-    `creation_time` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建时间',
-    `modifier` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最后修改人',
-    `modified_time` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最后修改时间',
-    `valid` tinyint(1) NOT NULL DEFAULT '1' COMMENT '合法标识',
-    `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '乐观锁',
-    PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='对象类型交付表';
+    "id" varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '主键ID',
+    "group_code" varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '集团编码',
+    "project_id" varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目ID',
+    "define_type_id" varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '类型ID',
+    "code" varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '对象类型编码',
+    "obj_type" varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '对象类型',
+    "delivery_type" tinyint(1) DEFAULT '0' COMMENT '交付类型:0-项目交付 1-现场交付',
+    "is_delivery" tinyint(1) DEFAULT NULL COMMENT '是否交付 0-否 1-是',
+    "instance_scope" text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '交付范围:实例范围',
+    "association_relation" text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '交付范围:依赖&关联',
+    "delivery_way" tinyint DEFAULT NULL COMMENT '正逆向交付方式 0-逆向 1-正向 2-不确定',
+    "room_func_types" text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '交付主张不确定时,正向时设备所在物业空间的空间功能类型',
+    "delivery_info" json DEFAULT NULL COMMENT '交付信息',
+    "remark" text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '交付范围:备注',
+    "creator" varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
+    "creation_time" char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建时间',
+    "modifier" varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最后修改人',
+    "modified_time" char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最后修改时间',
+    "valid" tinyint(1) NOT NULL DEFAULT '1' COMMENT '合法标识',
+    "ts" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '乐观锁',
+    PRIMARY KEY ("id") USING BTREE
+    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='对象类型交付表';
 
 
 CREATE TABLE IF NOT EXISTS `dt_define_info_delivery` (
 CREATE TABLE IF NOT EXISTS `dt_define_info_delivery` (
   `id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
   `id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
@@ -375,18 +376,4 @@ CREATE TABLE IF NOT EXISTS `dt_define_relation_delivery` (
   `valid` tinyint DEFAULT '1' COMMENT '合法标识',
   `valid` tinyint DEFAULT '1' COMMENT '合法标识',
   `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '乐观锁',
   `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '乐观锁',
   PRIMARY KEY (`id`) USING BTREE
   PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
-
-CREATE TABLE IF NOT EXISTS `boss_bdtp_type_rel` (
-  `id` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
-  `good_code` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'BOSS:商品编码',
-  `type_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'BDTP:对象类型编码',
-  `obj_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '对象类型',
-  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
-  `creation_time` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建时间',
-  `modifier` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最后修改人',
-  `modified_time` char(14) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最后修改时间',
-  `valid` tinyint NOT NULL DEFAULT '1' COMMENT '合法标识',
-  `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '乐观锁',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

+ 18 - 0
dmp-comp/dmp-digital-starter/src/main/java/com/persagy/dmp/delivery/client/DigitalObjectTypeCollectClient.java

@@ -3,6 +3,7 @@ package com.persagy.dmp.delivery.client;
 import com.persagy.dmp.basic.config.DigitalFeignConfig;
 import com.persagy.dmp.basic.config.DigitalFeignConfig;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.delivery.dto.DeliveryPlanDTO;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -52,6 +53,23 @@ public interface DigitalObjectTypeCollectClient {
                                           @RequestParam("appId") String appId,
                                           @RequestParam("appId") String appId,
                                           @RequestParam("userId") String userId,
                                           @RequestParam("userId") String userId,
                                           @RequestBody ObjectTypeCollect vo);
                                           @RequestBody ObjectTypeCollect vo);
+
+    /**
+     * 生成项目交付范围
+     * @param groupCode: 集团编码
+     * @param projectId: 项目ID
+     * @param appId: 应用ID
+     * @param userId: 用户ID
+     * @param voList: 新增对象类型对象
+     * @return 对象类型对象
+     */
+    @PostMapping("createProjDelivery")
+    CommonResult<List<DeliveryPlanDTO>> createProjectDelivery(@RequestParam("groupCode") String groupCode,
+                                                          @RequestParam("projectId") String projectId,
+                                                          @RequestParam("appId") String appId,
+                                                          @RequestParam("userId") String userId,
+                                                          @RequestBody List<DeliveryPlanDTO> voList);
+
     /**
     /**
      * 新增对象类型交付范围-批量新增
      * 新增对象类型交付范围-批量新增
      * @param groupCode: 集团编码
      * @param groupCode: 集团编码

+ 15 - 0
dmp-comp/dmp-digital-starter/src/main/java/com/persagy/dmp/delivery/client/DigitalObjectTypeCollectFacade.java

@@ -4,6 +4,7 @@ import cn.hutool.extra.spring.SpringUtil;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.common.utils.ResultHelper;
 import com.persagy.dmp.common.utils.ResultHelper;
+import com.persagy.dmp.delivery.dto.DeliveryPlanDTO;
 import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
 
 
@@ -71,6 +72,20 @@ public class DigitalObjectTypeCollectFacade {
         CommonResult<List<ObjectTypeCollect>> commonResult = client.createBatch(groupCode, projectId, appId, userId, voList);
         CommonResult<List<ObjectTypeCollect>> commonResult = client.createBatch(groupCode, projectId, appId, userId, voList);
         return commonResult.getData();
         return commonResult.getData();
     }
     }
+
+    /**
+     * 生成项目交付范围
+     * @param groupCode 集团编码
+     * @param projectId 项目ID
+     * @param appId 应用ID
+     * @param userId 用户ID
+     * @param voList 对象类型对象数组
+     * @return 对象类型对象数组
+     */
+    public static List<DeliveryPlanDTO> createProjectDelivery(String groupCode, String projectId, String appId, String userId, List<DeliveryPlanDTO> voList) {
+        CommonResult<List<DeliveryPlanDTO>> commonResult = client.createProjectDelivery(groupCode, projectId, appId, userId, voList);
+        return commonResult.getData();
+    }
     /**
     /**
      * 更新类型定义交付范围
      * 更新类型定义交付范围
      * @param groupCode 集团编码
      * @param groupCode 集团编码

+ 25 - 0
dmp-comp/dmp-digital-starter/src/main/java/com/persagy/dmp/delivery/dto/DeliveryPlanDTO.java

@@ -0,0 +1,25 @@
+package com.persagy.dmp.delivery.dto;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import lombok.Data;
+
+/**
+ * Description
+ *
+ * @author:linhuili
+ * @date:2022/1/18
+ */
+@Data
+public class DeliveryPlanDTO {
+
+    /** 项目ID */
+    private String projectId;
+
+    /** 类型编码 */
+    private String classCode;
+
+    /** 交付信息 */
+    private JsonNode deliveryInfo;
+
+
+}

+ 0 - 42
dmp-comp/dmp-digital-starter/src/main/java/com/persagy/dmp/delivery/dto/boss/DeliveryOrderDTO.java

@@ -1,42 +0,0 @@
-package com.persagy.dmp.delivery.dto.boss;
-
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import lombok.Data;
-
-/**
- * Description
- *
- * @author:linhuili
- * @date:2022/1/18
- */
-@Data
-public class DeliveryOrderDTO {
-
-    /** 交付计划总ID */
-    private String id;
-
-    /** 交付计划ID */
-    private String planId;
-
-    /** 商品编码 */
-    private ArrayNode goodsCode;
-
-    /** 商品数量 */
-    private Integer goodsNum;
-
-    /** 开始时间 */
-    private String startTime;
-
-    /** 结束时间 */
-    private String endTime;
-
-    /** 项目ID */
-    private String projectId;
-
-    /** 项目名称 */
-    private String projectName;
-
-    /** 管家账户 */
-    private String account;
-
-}

+ 4 - 0
dmp-comp/dmp-digital-starter/src/main/java/com/persagy/dmp/delivery/entity/ObjectTypeCollect.java

@@ -3,6 +3,7 @@ package com.persagy.dmp.delivery.entity;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.persagy.dmp.common.model.entity.AuditableEntity;
 import com.persagy.dmp.common.model.entity.AuditableEntity;
 import lombok.Data;
 import lombok.Data;
@@ -43,6 +44,9 @@ public class ObjectTypeCollect extends AuditableEntity {
     /** 交付主张不确定时,正向时设备所在物业空间的空间功能类型*/
     /** 交付主张不确定时,正向时设备所在物业空间的空间功能类型*/
     @TableField(typeHandler = JacksonTypeHandler.class)
     @TableField(typeHandler = JacksonTypeHandler.class)
     private ArrayNode roomFuncTypes;
     private ArrayNode roomFuncTypes;
+    /** 交付信息 */
+    @TableField(typeHandler = JacksonTypeHandler.class)
+    private JsonNode deliveryInfo;
     /** 备注 */
     /** 备注 */
     private String remark;
     private String remark;