diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java index 8c42570bc3..95741eb813 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java @@ -14,6 +14,7 @@ import java.util.List; public class OptionResultDTO implements Serializable { private static final long serialVersionUID = 8618231166600518980L; private String label; + private String code; private String value; private String pValue; private String sysDictDataId; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 25cf270549..5c71e7bcf1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -12,6 +12,7 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -92,4 +93,14 @@ public interface EpmetHeartOpenFeignClient { */ @PostMapping("/heart/resi/volunteer/modifyVolunteerGrid") Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO); + + /** + * 客户初始化数据 + * @Param customerId + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/4/14 14:50 + */ + @GetMapping("/heart/serviceitem/initCustomer/{customerId}") + Result customerInit(@PathVariable(value = "customerId") String customerId); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index 06bdc642c9..28e1fc50b8 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -88,4 +88,18 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "modifyVolunteerGrid", volunteerInfoDTO); } + + /** + * 客户初始化数据 + * + * @param customerId + * @Param customerId + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/4/14 14:50 + */ + @Override + public Result customerInit(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "customerInit", customerId); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java index 12b617b6bc..7608069b76 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java @@ -12,13 +12,12 @@ import com.epmet.dto.form.demand.ServiceItemSelectFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; +import com.epmet.service.IcResiDemandDictService; import com.epmet.service.IcServiceItemDictService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.List; /** @@ -33,6 +32,8 @@ public class IcServiceItemDictController { @Autowired private IcServiceItemDictService icServiceItemDictService; + @Resource + private IcResiDemandDictService icResiDemandDictService; /** @@ -85,4 +86,18 @@ public class IcServiceItemDictController { ValidatorUtils.validateEntity(formDTO,ServiceItemSelectFormDTO.AddUserInternalGroup.class); return new Result>().ok(icServiceItemDictService.queryDictListForSelect(formDTO)); } + + /** + * 客户初始化数据 + * @Param customerId + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/4/14 14:50 + */ + @GetMapping("initCustomer/{customerId}") + public Result customerInit(@PathVariable(value = "customerId") String customerId) { + icServiceItemDictService.customerInit(customerId); + icResiDemandDictService.customerInit(customerId); + return new Result(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java index ce861497cf..4510a34341 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java @@ -20,7 +20,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.demand.DemandCategoryResDTO; import com.epmet.dto.result.demand.DemandPageResDTO; @@ -147,4 +146,13 @@ public interface IcResiDemandDictService extends BaseService queryLatestOrder(String userId, String customerId); + + /** + * 客户初始化 + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2022/4/14 14:31 + */ + void customerInit(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java index 4e704aff54..af01c8a4c3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java @@ -70,4 +70,13 @@ public interface IcServiceItemDictService extends BaseService queryDictListForSelect(ServiceItemSelectFormDTO formDTO); + + /** + * 客户初始化 + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2022/4/14 14:31 + */ + void customerInit(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java index c6d0e0946f..5081bfd574 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -333,5 +333,34 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl(); } + /** + * 客户初始化 + * + * @param customerId + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2022/4/14 14:31 + */ + @Override + public void customerInit(String customerId) { + String defaultCustomerId = "default"; + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiDemandDictEntity::getCustomerId, defaultCustomerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + item.setId(uuid); + item.setCustomerId(customerId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + baseDao.insert(item); + }); + } + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index 76e431aa44..3fbda7cd37 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -42,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; /** * 服务事项分类字典表 @@ -171,5 +172,34 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcServiceItemDictEntity::getCustomerId, defaultCustomerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + item.setId(uuid); + item.setCustomerId(customerId); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + baseDao.insert(item); + }); + } + } + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 6c38707498..f67db1aaa1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -41,7 +41,7 @@ ORDER BY sort ASC - SELECT ID, PID, diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java index be68d37843..ff66dcb167 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java @@ -9,14 +9,16 @@ public interface ImportErrorMsgConstants { String EXIST_ERROR = "数据已存在"; - String HOUSE_ERROR = "所属组织、所属网格、所属小区、所属楼栋、单元号、房屋类型、房屋用途、出租的值未填写,或者所填写信息在系统中未找到"; + String DOCUMENT_EXIST_ERROR = "文件中存在重复数据"; - String BUILDING_ERROR = "所属组织、所属网格、所属小区、楼栋类型、单元数的值未填写,或者所填写信息在系统中未找到"; + String BELONG_GRID_ERROR = "所属网格的值未填写或者所填写信息在系统中未找到"; - String NEIGHBOR_HOOD_ERROR = "所属组织、所属网格、详细地址的值未填写,或者所填写信息在系统中未找到"; + String BELONG_AGENCY_ERROR = "所属组织的值未填写或者所填写信息在系统中未找到"; - String HOUSE_ERROR_NAME = "导入失败的列表-房屋"; - String BUILDING_ERROR_NAME = "导入失败的列表-楼宇"; - String NEIGHBORHOOD_ERROR_NAME = "导入失败的列表-小区"; + String HOUSE_TYPE_ERROR = "房屋类型的值未填写或者所填写信息在系统中未找到"; + + String BUILDING_TYPE_ERROR = "楼栋类型的值未填写或者所填写信息在系统中未找到"; + + String NEIGHBORHOOD_TYPE_ERROR = "小区名称的值未填写或者所填写信息在系统中未找到"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java index 7451f1f996..47681e15d1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java @@ -30,6 +30,8 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import static com.epmet.constant.ImportErrorMsgConstants.*; + /** * @Author zxc * @DateTime 2022/2/15 10:06 上午 @@ -117,7 +119,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener=unit){ - //新增单元 - List unitList = new ArrayList<>(); - for(int i =unit ;i units = icBuildingUnitService.getUnitOptions(icBuilding.getId()); + Map unitMap = units.stream().collect(Collectors.toMap(OptionResultDTO::getCode, OptionResultDTO::getLabel)); + List unitList = new ArrayList<>(); + for (int i = 1; i <= nowUnit; i++) { + String unitNum = String.valueOf(i); + if (!unitMap.containsKey(unitNum)) { + IcBuildingUnitEntity icBuildingUnit = new IcBuildingUnitEntity(); icBuildingUnit.setBuildingId(icBuilding.getId()); icBuildingUnit.setCustomerId(customerId); - icBuildingUnit.setUnitName((i + 1) +"单元"); - icBuildingUnit.setUnitNum(String.valueOf(i+1)); + icBuildingUnit.setUnitName(unitNum + "单元"); + icBuildingUnit.setUnitNum(unitNum); unitList.add(icBuildingUnit); } - icBuildingUnitService.insertBatch(unitList); - }else{ - //如果小于,判断是否存在房屋,如果存在就提示不能更改 - throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼宇单元下存在房屋,无法更新"); - } - - + icBuildingUnitService.insertBatch(unitList); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java index ae1fd471a9..2e800bbda5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java @@ -128,6 +128,7 @@ public class IcBuildingUnitServiceImpl extends BaseServiceImpl { OptionResultDTO dto = new OptionResultDTO(); dto.setValue(item.getId()); + dto.setCode(item.getUnitNum()); dto.setLabel(item.getUnitName()); return dto; }).collect(Collectors.toList()); diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index e1803ba56f..6682174cf0 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -83,6 +83,12 @@ 2.0.0 compile + + com.epmet + epmet-heart-client + 2.0.0 + compile + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormListItemDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormListItemDao.java new file mode 100644 index 0000000000..673ff3b2f3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormListItemDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcFormListItemEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 列表展示项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-14 + */ +@Mapper +public interface IcFormListItemDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java index c5c509ea25..9727a6276d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java @@ -41,7 +41,7 @@ public class IcFormItemEntity extends BaseEpmetEntity { private String customerId; /** - * + * */ private String areaCode; @@ -135,4 +135,14 @@ public class IcFormItemEntity extends BaseEpmetEntity { */ private Integer columnNum; + /** + * 是否为固定列 1动态,0固定 + */ + private Integer dynamic; + + /** + * 是否为多选 1可以多选,0单选 + */ + private Integer multiSelect; + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormListItemEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormListItemEntity.java new file mode 100644 index 0000000000..b5426d37de --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormListItemEntity.java @@ -0,0 +1,46 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 列表展示项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-04-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_form_list_item") +public class IcFormListItemEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * ic_form_item.id + */ + private String formItemId; + + /** + * ic_form.form_code,举例:resi_base_info + */ + private String formCode; + + /** + * 表头宽度 + */ + private Integer width; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java index 3d453ea38c..3e88b05f7b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java @@ -24,16 +24,19 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; import com.epmet.dto.form.CustomerFormQueryDTO; import com.epmet.dto.result.CustomerFormResultDTO; import com.epmet.dto.result.FormGroupDTO; import com.epmet.dto.result.FormItemResult; import com.epmet.entity.*; +import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.redis.CustomerFootBarRedis; import com.epmet.service.IcFormService; import lombok.extern.slf4j.Slf4j; @@ -43,6 +46,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; import java.util.Date; import java.util.List; @@ -72,6 +76,10 @@ public class IcFormServiceImpl extends BaseServiceImpl private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao; @Autowired private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao; + @Resource + private IcFormListItemDao icFormListItemDao; + @Resource + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; /** * 获取居民信息表单 @@ -131,7 +139,9 @@ public class IcFormServiceImpl extends BaseServiceImpl @Override public String initCustomerFormByCode(String customerId, String areaCode, String formCode) { CustomerFormResultDTO formResultDTO = baseDao.selectByCode(customerId, formCode); + //客户已经存在了表单的数据 if (formResultDTO != null) { + return "该客户已经存在了表单的数据"; } String defaultCustomerId = "default"; @@ -164,7 +174,7 @@ public class IcFormServiceImpl extends BaseServiceImpl if (CollectionUtils.isEmpty(itemList)) { return "默认配置错误"; } - //设置item + //设置ic_form_item itemList.forEach(item -> { item.setId(newPrefixed + item.getId()); item.setCustomerId(customerId); @@ -192,6 +202,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemDao.insert(item); }); + //设置ic_form_item_options LambdaQueryWrapper wrapperOptions = new LambdaQueryWrapper<>(); wrapperOptions.eq(IcFormItemOptionsEntity::getCustomerId, defaultCustomerId); wrapperOptions.eq(IcFormItemOptionsEntity::getFormCode, formCode); @@ -209,6 +220,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemOptionsDao.insert(item); }); + //设置ic_form_item_group LambdaQueryWrapper wrapperGroup = new LambdaQueryWrapper<>(); wrapperGroup.eq(IcFormItemGroupEntity::getCustomerId, defaultCustomerId); wrapperGroup.eq(IcFormItemGroupEntity::getFormCode, formCode); @@ -225,6 +237,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemGroupDao.insert(item); }); + //设置ic_form_query_builder LambdaQueryWrapper wrapperQuery = new LambdaQueryWrapper<>(); wrapperQuery.eq(IcFormQueryBuilderEntity::getCustomerId, defaultCustomerId); wrapperQuery.eq(IcFormQueryBuilderEntity::getFormCode, formCode); @@ -241,6 +254,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormQueryBuilderDao.insert(item); }); + //设置ic_resi_category_stats_config LambdaQueryWrapper wrapperStats = new LambdaQueryWrapper<>(); wrapperStats.eq(IcResiCategoryStatsConfigEntity::getCustomerId, defaultCustomerId); List statsConfigList = icResiCategoryStatsConfigDao.selectList(wrapperStats); @@ -255,6 +269,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icResiCategoryStatsConfigDao.insert(item); }); + //设置ic_resi_category_warn_config LambdaQueryWrapper wrapperWarn = new LambdaQueryWrapper<>(); wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, defaultCustomerId); List warnConfigList = icResiCategoryWarnConfigDao.selectList(wrapperWarn); @@ -269,6 +284,31 @@ public class IcFormServiceImpl extends BaseServiceImpl icResiCategoryWarnConfigDao.insert(item); }); + //设置ic_form_list_item + LambdaQueryWrapper listItemWapper = new LambdaQueryWrapper<>(); + listItemWapper.eq(IcFormListItemEntity::getCustomerId, defaultCustomerId); + listItemWapper.eq(IcFormListItemEntity::getFormCode, formCode); + List listItemList = icFormListItemDao.selectList(listItemWapper); + if (CollectionUtils.isEmpty(listItemList)) { + return "默认配置错误"; + } + listItemList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormItemId(newPrefixed + item.getFormItemId()); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("stats:"+ JSON.toJSONString(item)); + icFormListItemDao.insert(item); + }); + + //设置ic_service_item_dict和ic_resi_demand_dict + Result result = epmetHeartOpenFeignClient.customerInit(customerId); + if (!result.success()) { + throw new EpmetException(result.getCode(), result.getMsg()); + } return "初始化成功!客户ID:" + customerId + " formCode:" + formCode; } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormListItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormListItemDao.xml new file mode 100644 index 0000000000..d31304f648 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormListItemDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2a30af4cf9..ff15bf358e 100644 --- a/pom.xml +++ b/pom.xml @@ -97,11 +97,6 @@ - public aliyun nexus @@ -110,6 +105,11 @@ true + + epmet + maven-releases + https://nexus.elinkservice.cn/repository/maven-releases/ + @@ -124,5 +124,11 @@ + + + epmet + https://nexus.elinkservice.cn/repository/maven-releases/ + +