wangxianzhang 3 years ago
parent
commit
ac2785fcb6
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java
  2. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  3. 14
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  4. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
  5. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  6. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
  7. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  8. 30
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java
  9. 2
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  10. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
  11. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
  12. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  13. 22
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
  14. 31
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  15. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java
  16. 6
      epmet-module/oper-customize/oper-customize-server/pom.xml
  17. 16
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormListItemDao.java
  18. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java
  19. 46
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormListItemEntity.java
  20. 42
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java
  21. 22
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormListItemDao.xml
  22. 16
      pom.xml

1
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;

11
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);
}

14
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);
}
}

23
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<List<OptionDTO>>().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();
}
}

10
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<IcResiDemandDictEnt
* @return
*/
List<DemandCategoryResDTO> queryLatestOrder(String userId, String customerId);
/**
* 客户初始化
* @Param customerId
* @Return
* @Author zhaoqifeng
* @Date 2022/4/14 14:31
*/
void customerInit(String customerId);
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java

@ -70,4 +70,13 @@ public interface IcServiceItemDictService extends BaseService<IcServiceItemDictE
* @return
*/
List<OptionDTO> queryDictListForSelect(ServiceItemSelectFormDTO formDTO);
/**
* 客户初始化
* @Param customerId
* @Return
* @Author zhaoqifeng
* @Date 2022/4/14 14:31
*/
void customerInit(String customerId);
}

29
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<IcResiDemandDic
return new ArrayList<>();
}
/**
* 客户初始化
*
* @param customerId
* @Param customerId
* @Return
* @Author zhaoqifeng
* @Date 2022/4/14 14:31
*/
@Override
public void customerInit(String customerId) {
String defaultCustomerId = "default";
LambdaQueryWrapper<IcResiDemandDictEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiDemandDictEntity::getCustomerId, defaultCustomerId);
List<IcResiDemandDictEntity> 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);
});
}
}
}

30
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<IcServiceItemD
return resultList;
}
/**
* 客户初始化
*
* @param customerId
* @Param customerId
* @Return
* @Author zhaoqifeng
* @Date 2022/4/14 14:31
*/
@Override
public void customerInit(String customerId) {
String defaultCustomerId = "default";
LambdaQueryWrapper<IcServiceItemDictEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcServiceItemDictEntity::getCustomerId, defaultCustomerId);
List<IcServiceItemDictEntity> 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);
});
}
}
}

2
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -41,7 +41,7 @@
ORDER BY sort ASC
</select>
<!-- sql递归 查询客户议题项目的分类信息以及递归查询二级分类信息 end-->
<select id="selectCategoryListByCustomer" resultType="com.epmet.dto.IssueProjectCategoryDictDTO">
<select id="selectCategoryListByCustomer" resultType="com.epmet.entity.IssueProjectCategoryDictEntity">
SELECT
ID,
PID,

14
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 = "小区名称的值未填写或者所填写信息在系统中未找到";
}

28
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<BuildingIn
// 应产品要求添加
if (StringUtils.isNotBlank(dto.getType()) && (!dto.getType().equals("商品房") && !dto.getType().equals("自建房")) && !dto.getType().equals("别墅")){
nums.add(num);
disposeErrorMsg(info, ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info, BUILDING_TYPE_ERROR);
return;
}
dto.setType(BuildingTypeEnums.getKeyByValue(dto.getType()));
@ -150,7 +152,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
// 集合里重复的
nums.add(r.getNum());
BuildingInfoModel buildingInfoModel = ConvertUtils.sourceToTarget(r, BuildingInfoModel.class);
disposeErrorMsg(buildingInfoModel,ImportErrorMsgConstants.EXIST_ERROR);
disposeErrorMsg(buildingInfoModel,DOCUMENT_EXIST_ERROR);
r.setExistStatus(true);
r.setAddStatus(true);
}
@ -231,19 +233,19 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
//排除不是本小区的
if (!dto.getNeighborHoodName().equals(neighborHoodGeneralDTO.getNeighborHoodName())){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info,"所属小区的值未填写或者所填写信息在系统中未找到");
}else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(neighborHoodGeneralDTO.getGridId());
if (null == gridInfo){
nums.add(num);
disposeErrorMsg(info, ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info, BELONG_GRID_ERROR);
return;
}
// 1.排除网格名不一样但小区名一样 2.排除组织不一样,网格一样,小区一样
if ((!gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName())) ||
(!gridInfo.getAgencyName().equals(dto.getAgencyName()) && gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()))){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
dto.setNeighborHoodId(formDTO.getOrgId());
@ -252,7 +254,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info, ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info, BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());
@ -273,13 +275,13 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
if (null == gridInfo){
nums.add(num);
disposeErrorMsg(info, ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info, BELONG_GRID_ERROR);
return;
}
//排除不是本网格的 gridName不一样排除,gridName一样但是agencyName不一样也得排除
if (dto.getGridName().compareTo(gridName) != 0 || (!dto.getAgencyName().equals(gridInfo.getAgencyName()) && dto.getGridName().equals(gridName))){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
}else {
//
dto.setGridId(formDTO.getOrgId());
@ -287,7 +289,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info, ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info, BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());
@ -308,21 +310,21 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
//排除不是本组织的
if (!dto.getAgencyName().equals(agencyName)){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info,BELONG_AGENCY_ERROR);
}else {
// 根据组织查询出所有网格,甩出不是本组织下的网格
gridInfos = null == gridInfos ? getGridInfos(formDTO.getOrgId()) : gridInfos;
if (null == gridInfos){
// 组织下确实不存在网格
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
// 根据网格名对比,没有找到的就把行号加入到未执行成功队列中
Object cacheGridName = icHouseRedis.getTemporaryCacheGrid(formDTO.getCustomerId(), formDTO.getUserId(), dto.getGridName());
if (null == cacheGridName){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
dto.setGridId(cacheGridName.toString());
@ -330,7 +332,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info, ImportErrorMsgConstants.BUILDING_ERROR);
disposeErrorMsg(info, BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -36,6 +36,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/13 1:25 下午
@ -163,7 +165,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
if (StringUtils.isNotBlank(dto.getHouseType()) ){
if( !"楼房".equals(dto.getHouseType()) && !dto.getHouseType().equals("平房") && !dto.getHouseType().equals("别墅") ){
nums.add(num);
disposeErrorMsg(info,"房屋类型的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info,HOUSE_TYPE_ERROR);
return;
}
}
@ -229,7 +231,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
if (!r.getAddStatus()){
nums.add(r.getNum());
info = ConvertUtils.sourceToTarget(r,HouseInfoModel.class);
disposeErrorMsg(info,"文件中存在重复数据");
disposeErrorMsg(info,DOCUMENT_EXIST_ERROR);
r.setExistStatus(true);
r.setAddStatus(true);
}
@ -302,7 +304,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(buildingGeneralDTO.getGridId());
if (null == gridInfo){
nums.add(num);
disposeErrorMsg(info, "所属网格的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info, BELONG_GRID_ERROR);
return;
}
// 排除 1、小区名不一样&&楼栋名一样 2、网格名不一样&&小区名一样&&楼名一样 3、组织名不一样&&网格名一样&&小区名一样&&楼名一样
@ -310,7 +312,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
|| (!gridInfo.getGridName().equals(dto.getGridName())&&buildingGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()) && buildingGeneralDTO.getBuildingName().equals(dto.getBuildingName()))
|| (!gridInfo.getAgencyName().equals(dto.getAgencyName())&&gridInfo.getGridName().equals(dto.getGridName())&&buildingGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()) && buildingGeneralDTO.getBuildingName().equals(dto.getBuildingName()))){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.HOUSE_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
dto.setBuildingId(formDTO.getOrgId());
@ -320,7 +322,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info, "所属组织的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info, BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());
@ -358,14 +360,14 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(neighborHoodGeneralDTO.getGridId());
if (null == gridInfo){
nums.add(num);
disposeErrorMsg(info, "所属网格的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info, BELONG_GRID_ERROR);
return;
}
// 1.排除网格名不一样但小区名一样 2.排除组织不一样,网格一样,小区一样
if ((!gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName())) ||
(!gridInfo.getAgencyName().equals(dto.getAgencyName()) && gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()))){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.HOUSE_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
dto.setNeighborHoodId(formDTO.getOrgId());
@ -374,7 +376,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info, "所属组织的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info, BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());
@ -395,13 +397,13 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
if (null == gridInfo){
nums.add(num);
disposeErrorMsg(info, "所属网格的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info, BELONG_GRID_ERROR);
return;
}
//排除不是本网格的 gridName不一样排除,gridName一样但是agencyName不一样也得排除
if (dto.getGridName().compareTo(gridName) != 0 || (!dto.getAgencyName().equals(gridInfo.getAgencyName()) && dto.getGridName().equals(gridName))){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.HOUSE_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
}else {
//
dto.setGridId(formDTO.getOrgId());
@ -409,7 +411,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info, "所属组织的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info, BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());
@ -430,21 +432,21 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
//排除不是本组织的
if (!dto.getAgencyName().equals(agencyName)){
nums.add(num);
disposeErrorMsg(info,"所属组织的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info,BELONG_AGENCY_ERROR);
}else {
// 根据组织查询出所有网格,甩出不是本组织下的网格
gridInfos = null == gridInfos ? getGridInfos(formDTO.getOrgId()) : gridInfos;
if (null == gridInfos){
// 组织下确实不存在网格
nums.add(num);
disposeErrorMsg(info,"所属网格的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
// 根据网格名对比,没有找到的就把行号加入到未执行成功队列中
Object cacheGridName = icHouseRedis.getTemporaryCacheGrid(formDTO.getCustomerId(), formDTO.getUserId(), dto.getGridName());
if (null == cacheGridName){
nums.add(num);
disposeErrorMsg(info,"所属网格的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
dto.setGridId(cacheGridName.toString());
@ -452,7 +454,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info, "所属组织的值未填写或者所填写信息在系统中未找到");
disposeErrorMsg(info, BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());

22
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java

@ -33,6 +33,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 2:16 下午
@ -84,11 +86,10 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
}
info = data;
num = num + NumConstant.ONE;
log.info("读数据"+num);
if (StringUtils.isBlank(data.getNeighborHoodName()) ||
StringUtils.isBlank(data.getGridName()) || StringUtils.isBlank(data.getAgencyName()) || StringUtils.isBlank(data.getAddress())){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.NEIGHBOR_HOOD_ERROR);
disposeErrorMsg(info,NEIGHBORHOOD_TYPE_ERROR);
return;
}
if(StringUtils.isBlank(data.getAgencyName())){
@ -123,7 +124,6 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (num%NumConstant.ONE_HUNDRED == NumConstant.ZERO){
finalDispose();
}
log.info("读数据"+num+"完毕");
}
public void finalDispose(){
@ -140,7 +140,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
// 集合里重复的
nums.add(r.getNum());
NeighborHoodInfoModel neighborHoodInfoModel = ConvertUtils.sourceToTarget(r, NeighborHoodInfoModel.class);
disposeErrorMsg(neighborHoodInfoModel, ImportErrorMsgConstants.EXIST_ERROR);
disposeErrorMsg(neighborHoodInfoModel, DOCUMENT_EXIST_ERROR);
r.setExistStatus(true);
r.setAddStatus(true);
}
@ -219,13 +219,13 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
if (null == gridInfo){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.NEIGHBOR_HOOD_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
//排除不是本网格的 gridName不一样排除,gridName一样但是agencyName不一样也得排除
if (dto.getGridName().compareTo(gridName) != 0 || (!dto.getAgencyName().equals(gridInfo.getAgencyName()) && dto.getGridName().equals(gridName))){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.NEIGHBOR_HOOD_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
}else {
//
dto.setGridId(formDTO.getOrgId());
@ -233,7 +233,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.NEIGHBOR_HOOD_ERROR);
disposeErrorMsg(info,BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());
@ -253,21 +253,21 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
//排除不是本组织的
if (!dto.getAgencyName().equals(agencyName)){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.NEIGHBOR_HOOD_ERROR);
disposeErrorMsg(info,BELONG_AGENCY_ERROR);
}else {
// 根据组织查询出所有网格,甩出不是本组织下的网格
gridInfos = null == gridInfos ? getGridInfos(formDTO.getOrgId()) : gridInfos;
if (null == gridInfos){
// 组织下确实不存在网格
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.NEIGHBOR_HOOD_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
// 根据网格名对比,没有找到的就把行号加入到未执行成功队列中
Object cacheGridName = icHouseRedis.getTemporaryCacheGrid(formDTO.getCustomerId(), formDTO.getUserId(), dto.getGridName());
if (null == cacheGridName){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.NEIGHBOR_HOOD_ERROR);
disposeErrorMsg(info,BELONG_GRID_ERROR);
return;
}
dto.setGridId(cacheGridName.toString());
@ -275,7 +275,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
nums.add(num);
disposeErrorMsg(info,ImportErrorMsgConstants.NEIGHBOR_HOOD_ERROR);
disposeErrorMsg(info,BELONG_AGENCY_ERROR);
return;
}
dto.setPid(agencyInfo.getPid());

31
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -12,7 +12,9 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
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.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -535,25 +537,26 @@ public class BuildingServiceImpl implements BuildingService {
//如果楼宇单元大于之前的楼宇单元,新增单元
Integer nowUnit= formDTO.getTotalUnitNum();
Integer unit = icBuilding.getTotalUnitNum();
if(nowUnit>=unit){
//新增单元
List<IcBuildingUnitEntity> unitList = new ArrayList<>();
for(int i =unit ;i<nowUnit;i++){
IcBuildingUnitEntity icBuildingUnit= new IcBuildingUnitEntity();
if(nowUnit<unit){
//如果小于,判断是否存在房屋,如果存在就提示不能更改
throw new EpmetException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),EpmetErrorCode.ORG_EDIT_FAILED.getMsg(),"暂不支持单元号减小");
}
//新增单元
List<OptionResultDTO> units = icBuildingUnitService.getUnitOptions(icBuilding.getId());
Map<String, String> unitMap = units.stream().collect(Collectors.toMap(OptionResultDTO::getCode, OptionResultDTO::getLabel));
List<IcBuildingUnitEntity> 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);
}
/**

1
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<IcBuildingUnitDao
return list.stream().map(item -> {
OptionResultDTO dto = new OptionResultDTO();
dto.setValue(item.getId());
dto.setCode(item.getUnitNum());
dto.setLabel(item.getUnitName());
return dto;
}).collect(Collectors.toList());

6
epmet-module/oper-customize/oper-customize-server/pom.xml

@ -83,6 +83,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

16
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<IcFormListItemEntity> {
}

12
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;
}

46
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;
}

42
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<IcFormDao, IcFormEntity>
private IcResiCategoryStatsConfigDao icResiCategoryStatsConfigDao;
@Autowired
private IcResiCategoryWarnConfigDao icResiCategoryWarnConfigDao;
@Resource
private IcFormListItemDao icFormListItemDao;
@Resource
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
/**
* 获取居民信息表单
@ -131,7 +139,9 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
@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<IcFormDao, IcFormEntity>
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<IcFormDao, IcFormEntity>
icFormItemDao.insert(item);
});
//设置ic_form_item_options
LambdaQueryWrapper<IcFormItemOptionsEntity> wrapperOptions = new LambdaQueryWrapper<>();
wrapperOptions.eq(IcFormItemOptionsEntity::getCustomerId, defaultCustomerId);
wrapperOptions.eq(IcFormItemOptionsEntity::getFormCode, formCode);
@ -209,6 +220,7 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
icFormItemOptionsDao.insert(item);
});
//设置ic_form_item_group
LambdaQueryWrapper<IcFormItemGroupEntity> wrapperGroup = new LambdaQueryWrapper<>();
wrapperGroup.eq(IcFormItemGroupEntity::getCustomerId, defaultCustomerId);
wrapperGroup.eq(IcFormItemGroupEntity::getFormCode, formCode);
@ -225,6 +237,7 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
icFormItemGroupDao.insert(item);
});
//设置ic_form_query_builder
LambdaQueryWrapper<IcFormQueryBuilderEntity> wrapperQuery = new LambdaQueryWrapper<>();
wrapperQuery.eq(IcFormQueryBuilderEntity::getCustomerId, defaultCustomerId);
wrapperQuery.eq(IcFormQueryBuilderEntity::getFormCode, formCode);
@ -241,6 +254,7 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
icFormQueryBuilderDao.insert(item);
});
//设置ic_resi_category_stats_config
LambdaQueryWrapper<IcResiCategoryStatsConfigEntity> wrapperStats = new LambdaQueryWrapper<>();
wrapperStats.eq(IcResiCategoryStatsConfigEntity::getCustomerId, defaultCustomerId);
List<IcResiCategoryStatsConfigEntity> statsConfigList = icResiCategoryStatsConfigDao.selectList(wrapperStats);
@ -255,6 +269,7 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
icResiCategoryStatsConfigDao.insert(item);
});
//设置ic_resi_category_warn_config
LambdaQueryWrapper<IcResiCategoryWarnConfigEntity> wrapperWarn = new LambdaQueryWrapper<>();
wrapperWarn.eq(IcResiCategoryWarnConfigEntity::getCustomerId, defaultCustomerId);
List<IcResiCategoryWarnConfigEntity> warnConfigList = icResiCategoryWarnConfigDao.selectList(wrapperWarn);
@ -269,6 +284,31 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
icResiCategoryWarnConfigDao.insert(item);
});
//设置ic_form_list_item
LambdaQueryWrapper<IcFormListItemEntity> listItemWapper = new LambdaQueryWrapper<>();
listItemWapper.eq(IcFormListItemEntity::getCustomerId, defaultCustomerId);
listItemWapper.eq(IcFormListItemEntity::getFormCode, formCode);
List<IcFormListItemEntity> 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;
}
}

22
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormListItemDao.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcFormListItemDao">
<resultMap type="com.epmet.entity.IcFormListItemEntity" id="icFormListItemMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="formItemId" column="FORM_ITEM_ID"/>
<result property="formCode" column="FORM_CODE"/>
<result property="width" column="WIDTH"/>
<result property="sort" column="SORT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

16
pom.xml

@ -97,11 +97,6 @@
</dependencyManagement>
<repositories>
<!--<repository>
<id>mvnrepo</id>
<name>jianjun gitee</name>
<url>https://gitee.com/jianjun4833/mvnrepo/blob/master/</url>
</repository>-->
<repository>
<id>public</id>
<name>aliyun nexus</name>
@ -110,6 +105,11 @@
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>epmet</id>
<name>maven-releases</name>
<url>https://nexus.elinkservice.cn/repository/maven-releases/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
@ -124,5 +124,11 @@
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>epmet</id>
<url>https://nexus.elinkservice.cn/repository/maven-releases/</url>
</repository>
</distributionManagement>
</project>

Loading…
Cancel
Save