From 912e07e938ff307856dec4fcc226667087dfde99 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 27 Oct 2021 17:45:16 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/CustomerFormQueryDTO.java | 5 +++++ .../main/java/com/epmet/controller/IcFormController.java | 6 ++++++ .../src/main/java/com/epmet/dao/IcFormDao.java | 4 ++-- .../main/java/com/epmet/service/impl/IcFormServiceImpl.java | 4 ++-- .../src/main/resources/mapper/IcFormDao.xml | 5 ++++- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java index e2bafc12df..55e1160110 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java @@ -19,5 +19,10 @@ public class CustomerFormQueryDTO implements Serializable { @NotBlank(message = "tokenDto获取customerId不能为空",groups =AddUserInternalGroup.class ) private String customerId; + + /** + * 是否动态 + */ + private Boolean dynamic; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java index f6e0d66c98..708bc42093 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java @@ -114,6 +114,9 @@ public class IcFormController { if (StringUtils.isBlank(formDto.getCustomerId())){ formDto.setCustomerId(customerId); } + if (formDto.getDynamic() == null){ + formDto.setDynamic(true); + } ValidatorUtils.validateEntity(formDto,CustomerFormQueryDTO.AddUserInternalGroup.class); return new Result().ok(icFormService.getCustomerForm(formDto)); } @@ -131,6 +134,9 @@ public class IcFormController { @PostMapping("conditionlist") public Result> queryConditionList(@LoginUser TokenDto tokenDto, @RequestBody CustomerFormQueryDTO formDto){ formDto.setCustomerId(tokenDto.getCustomerId()); + if (formDto.getDynamic() == null){ + formDto.setDynamic(true); + } ValidatorUtils.validateEntity(formDto,CustomerFormQueryDTO.AddUserInternalGroup.class); return new Result>().ok(icFormItemService.queryConditionList(formDto)); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java index bed3566120..846e59ad72 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormDao.java @@ -47,7 +47,7 @@ public interface IcFormDao extends BaseDao { */ CustomerFormResultDTO selectByCode(@Param("customerId") String customerId, @Param("formCode") String formCode); - List selectItemList(String formId); + List selectItemList(String formId, Boolean dynamic); List selectItemListByGroupId(String groupId); List selectListOption(String itemId); @@ -55,4 +55,4 @@ public interface IcFormDao extends BaseDao { List selectListGroup(String formId); FormGroupDTO selectChildGroup(String itemId); -} \ No newline at end of file +} 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 03b03ffaf8..6a4d8a426c 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 @@ -118,7 +118,7 @@ public class IcFormServiceImpl extends BaseServiceImpl if (null == resultDTO) { throw new RenException(EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getCode(),EpmetErrorCode.CUSTOMER_FORM_NOT_EXITS.getMsg()); } - List itemList=baseDao.selectItemList(resultDTO.getFormId()); + List itemList=baseDao.selectItemList(resultDTO.getFormId(),formDto.getDynamic()); List groupList=baseDao.selectListGroup(resultDTO.getFormId()); resultDTO.setItemList(itemList); @@ -126,4 +126,4 @@ public class IcFormServiceImpl extends BaseServiceImpl return resultDTO; } -} \ No newline at end of file +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml index 536fe55472..9612996019 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml @@ -106,6 +106,9 @@ WHERE fi.DEL_FLAG = '0' AND fi.FORM_ID = #{formId} + + fi.DYNAMIC = #{dynamic} + AND fi.ITEM_GROUP_ID = '0' ORDER BY fi.SORT ASC @@ -196,4 +199,4 @@ g.SORT ASC - \ No newline at end of file + From 2d4b0c73436fc33738bd4e07f3aef6db0bf12702 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 27 Oct 2021 17:51:54 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IcResiUserController.java | 60 ++++++++++++++--- .../ExcelDiceAddressListHandlerImpl.java | 64 +++++++++++++++++++ 2 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/handler/ExcelDiceAddressListHandlerImpl.java diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 415dcd9323..4e49766a21 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -39,14 +39,19 @@ import com.epmet.dto.form.IcResiUserFormDTO; import com.epmet.dto.result.CustomerFormResultDTO; import com.epmet.excel.IcResiUserExcel; import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.handler.ExcelDiceAddressListHandlerImpl; import com.epmet.service.IcResiUserService; +import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.FileOutputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** @@ -137,18 +142,52 @@ public class IcResiUserController { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } System.out.println(JSON.toJSONString(resultForm.getData())); - List colList = new ArrayList<>(); + List firstHeaderList = new ArrayList<>(); resultForm.getData().getItemList().forEach(item->{ - + ExcelExportEntity header = new ExcelExportEntity(item.getLabel(),item.getColumnName().concat(String.valueOf(item.getColumnNum()))); + header.setNeedMerge(true); + firstHeaderList.add(header); + String baseTableName = "resi_base_info"; + + if (item.getChildGroup() != null){ + //baseTableName单独的一个sheet + if (baseTableName.equals(item.getTableName())){ + header = new ExcelExportEntity(item.getChildGroup().getLabel(),item.getChildGroup().getTableName()); + header.setNeedMerge(true); + }else{ + header = new ExcelExportEntity(item.getChildGroup().getLabel(),item.getChildGroup().getTableName()); + header.setNeedMerge(true); + } + if (item.getColumnName().equals("GENDER")){ + header.setReplace(new String[]{"男_1","女_2"}); + } + List secondHeaderList = new ArrayList<>(); + item.getChildGroup().getItemList().forEach(item2->{ + ExcelExportEntity secondHeader = new ExcelExportEntity(item2.getLabel(),item2.getColumnName().concat(String.valueOf(item2.getColumnNum()))); + secondHeader.setNeedMerge(true); + secondHeaderList.add(secondHeader); + if (CollectionUtils.isNotEmpty(item2.getOptions())){ + List thirdHeaderList = new ArrayList<>(); + item2.getOptions().forEach(child->{ + ExcelExportEntity thirdHeader = new ExcelExportEntity(child.getLabel()); + thirdHeader.setNeedMerge(true); + thirdHeaderList.add(thirdHeader); + }); + secondHeader.setList(thirdHeaderList); + } + }); + header.setList(secondHeaderList); + firstHeaderList.add(header); + } }); - ExcelExportEntity desginGroup = new ExcelExportEntity("表头名称","键"); + /* ExcelExportEntity desginGroup = new ExcelExportEntity("表头名称","键"); desginGroup.setNeedMerge(true); List paramCols = new ArrayList<>(); List headerList = Arrays.asList("头1","头2","头3"); @@ -157,15 +196,16 @@ public class IcResiUserController { }); desginGroup.setList(paramCols); - colList.add(desginGroup); + colList.add(desginGroup);*/ List> dataList =new ArrayList<>(); Map dataMap = new HashMap<>(); - dataMap.put("头1","1"); - dataMap.put("头2","2"); - dataMap.put("头3","3"); + dataMap.put("GENDER0","1"); + dataMap.put("ID_CARD0","371888991"); + dataList.add(dataMap); - ExportParams entity = new ExportParams(); - Workbook workbook = ExcelExportUtil.exportExcel(entity, colList, dataList); + ExportParams exportParams = new ExportParams(); + exportParams.setDictHandler(new ExcelDiceAddressListHandlerImpl()); + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, firstHeaderList, dataList); //ExcelExportUtil.exportExcel FileOutputStream fos = new FileOutputStream("//Users/liujianjun/Downloads/基础信息表/Dow.tt.xls"); workbook.write(fos); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/handler/ExcelDiceAddressListHandlerImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/handler/ExcelDiceAddressListHandlerImpl.java new file mode 100644 index 0000000000..b03634c761 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/handler/ExcelDiceAddressListHandlerImpl.java @@ -0,0 +1,64 @@ +package com.epmet.handler; + +import cn.afterturn.easypoi.handler.inter.IExcelDictHandler; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 模拟使用,生产请用真实字典 + * + * @author jueyue on 20-4-26. + */ +public class ExcelDiceAddressListHandlerImpl implements IExcelDictHandler { + + /** + * 返回字典所有值 + * key: dictKey + * + * @param dict 字典Key + * @return + */ + public List getList(String dict) { + List list = new ArrayList<>(); + Map dictMap = new HashMap<>(); + dictMap.put("dictKey", "1"); + dictMap.put("dictValue", "男"); + list.add(dictMap); + dictMap = new HashMap<>(); + dictMap.put("dictKey", "2"); + dictMap.put("dictValue", "女"); + list.add(dictMap); + return list; + } + + @Override + public String toName(String dict, Object obj, String name, Object value) { + if ("level".equals(dict)) { + int level = Integer.parseInt(value.toString()); + switch (level) { + case 1: + return "男"; + case 2: + return "女"; + } + } + return null; + } + + @Override + public String toValue(String dict, Object obj, String name, Object value) { + if ("level".equals(dict)) { + int level = Integer.parseInt(value.toString()); + switch (level) { + case 1: + return "男"; + case 2: + return "女"; + } + } + return null; + } +} From db8267572a33e39101fb54c6aeb95f1ae40e34fd Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 28 Oct 2021 08:58:44 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcFormDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml index 9612996019..80cdaee859 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml @@ -107,7 +107,7 @@ fi.DEL_FLAG = '0' AND fi.FORM_ID = #{formId} - fi.DYNAMIC = #{dynamic} + AND fi.DYNAMIC = #{dynamic} AND fi.ITEM_GROUP_ID = '0' ORDER BY From 5683872d39cb1f87ae6caa3270954ef01471cc52 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 28 Oct 2021 09:13:23 +0800 Subject: [PATCH 4/4] zancun --- .../dto/epmetuser/IcFormResColumnDTO.java | 17 ++ .../epmetuser/form/IcResiDetailFormDTO.java | 20 ++ .../epmetuser/form/IcResiUserPageFormDTO.java | 37 ++++ .../epmetuser/form/ResiUserQueryValueDTO.java | 20 ++ .../result/IcResiUserPageResultDTO.java | 172 ++++++++++++++++++ .../controller/IcResiUserController.java | 45 +++++ .../dao/epmetuser/IcResiUserDao.java | 18 ++ .../dao/opercustomize/CustomerFootBarDao.java | 5 + .../service/epmetuser/IcResiUserService.java | 14 ++ .../epmetuser/impl/IcResiUserServiceImpl.java | 85 +++++++++ .../opercustomize/CustomerFootBarService.java | 7 + .../impl/CustomerFootBarServiceImpl.java | 11 ++ .../mapper/epmetuser/IcResiUserDao.xml | 65 +++++++ .../opercustomize/CustomerFootBarDao.xml | 40 ++++ 14 files changed, 556 insertions(+) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiDetailFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiUserPageFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResiUserQueryValueDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcResiUserPageResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcResiUserController.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/IcResiUserService.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java new file mode 100644 index 0000000000..2679aa595b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/IcFormResColumnDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dataaggre.dto.epmetuser; + +import lombok.Data; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 4:26 下午 + */ +@Data +public class IcFormResColumnDTO { + private String tableName; + private String columnName; + private String label; + private String link; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiDetailFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiDetailFormDTO.java new file mode 100644 index 0000000000..8d45b774b5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiDetailFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 查看详情,回显表单 + * @Author yinzuomei + * @Date 2021/10/27 10:22 下午 + */ +@Data +public class IcResiDetailFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + @NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class) + private String icResiUserId; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiUserPageFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiUserPageFormDTO.java new file mode 100644 index 0000000000..e9ae3c2eea --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcResiUserPageFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民信息,分页查询入参 + * @Author yinzuomei + * @Date 2021/10/27 2:06 下午 + */ +@Data +public class IcResiUserPageFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + @NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) + private Integer pageSize; + + @NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) + private String formCode; + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 表对应的字段及值 + */ + private List conditions; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResiUserQueryValueDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResiUserQueryValueDTO.java new file mode 100644 index 0000000000..7e11156ba3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResiUserQueryValueDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 6:02 下午 + */ +@Data +public class ResiUserQueryValueDTO implements Serializable { + private String queryType; + private List columnValue; + private String columnName; + private String tableName; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcResiUserPageResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcResiUserPageResultDTO.java new file mode 100644 index 0000000000..3c8774abf9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcResiUserPageResultDTO.java @@ -0,0 +1,172 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民信息分页查询表单返参 + * @Author yinzuomei + * @Date 2021/10/27 2:07 下午 + */ +@Data +public class IcResiUserPageResultDTO implements Serializable { + private String icResiUserId; + private String gridId; + private String gridName; + /** + * 所属小区ID + */ + private String villageId; + private String vallageName; + + + /** + * 所属楼宇Id + */ + private String buildId; + private String buildName; + + /** + * 单元id + */ + private String unitId; + private String unitName; + + /** + * 所属家庭Id + */ + private String homeId; + private String homeName; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + + /** + * 是否党员 + */ + private Boolean isParty; + + /** + * 是否低保户 + */ + private Boolean isDbh; + + /** + * 是否保障房 + */ + private Boolean isEnsureHouse; + + /** + * 是否失业 + */ + private Boolean isUnemployed; + + /** + * 是否育龄妇女 + */ + private Boolean isYlfn; + + /** + * 是否退役军人 + */ + private Boolean isVeterans; + + /** + * 是否统战人员 + */ + private Boolean isUnitedFront; + + /** + * 是否信访人员 + */ + private Boolean isXfry; + + /** + * 是否志愿者 + */ + private Boolean isVolunteer; + + /** + * 是否老年人 + */ + private Boolean isOldPeople; + + /** + * 是否空巢 + */ + private Boolean isKc; + + /** + * 是否失独 + */ + private Boolean isSd; + + /** + * 是否失能 + */ + private Boolean isSn; + + /** + * 是否失智 + */ + private Boolean isSz; + + /** + * 是否残疾 + */ + private Boolean isCj; + + /** + * 是否大病 + */ + private Boolean isDb; + + /** + * 是否慢病 + */ + private Boolean isMb; + + /** + * 是否特殊人群 + */ + private Boolean isSpecial; + + private List demandCategoryIds; + + private String demandName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcResiUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcResiUserController.java new file mode 100644 index 0000000000..ae62a23057 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcResiUserController.java @@ -0,0 +1,45 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; +import com.epmet.dataaggre.service.epmetuser.IcResiUserService; +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; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 2:03 下午 + */ +@RestController +@RequestMapping("icresiuser") +public class IcResiUserController { + + @Autowired + private IcResiUserService icResiUserService; + + + @PostMapping("listresi") + public Result> queryListResi(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){ + //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icResiUserService.pageResi(pageFormDTO)); + } + + + @PostMapping("detail") + public Result queryIcResiDetail(@RequestBody IcResiDetailFormDTO pageFormDTO){ + ValidatorUtils.validateEntity(pageFormDTO,IcResiDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO)); + } +} + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java new file mode 100644 index 0000000000..f7ba23a038 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.dao.epmetuser; + +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; +import com.epmet.dataaggre.dto.epmetuser.form.ResiUserQueryValueDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface IcResiUserDao { + List selectListResi(@Param("customerId") String customerId, + @Param("formCode") String formCode, + @Param("conditions") List conditions, + @Param("resultColumns") List resultColumns, + @Param("subTables") List subTables); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java index 7d5d11dda7..340b09f34d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java @@ -19,6 +19,7 @@ package com.epmet.dataaggre.dao.opercustomize; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -56,4 +57,8 @@ public interface CustomerFootBarDao extends BaseDao { * @date 2021/7/28 10:56 */ CustomerFootBarEntity selectDefaultIcon(@Param("customerId") String customerId, @Param("appType")String appType, @Param("barKey")String barKey); + + List queryConditions(@Param("customerId") String customerId, @Param("formCode")String formCode); + + List querySubTables(@Param("customerId") String customerId, @Param("formCode")String formCode); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/IcResiUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/IcResiUserService.java new file mode 100644 index 0000000000..d439b7b5bd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/IcResiUserService.java @@ -0,0 +1,14 @@ +package com.epmet.dataaggre.service.epmetuser; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; + +import java.util.Map; + +public interface IcResiUserService { + PageData pageResi(IcResiUserPageFormDTO pageFormDTO); + + Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java new file mode 100644 index 0000000000..ddc2dda57e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java @@ -0,0 +1,85 @@ +package com.epmet.dataaggre.service.epmetuser.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmetuser.IcResiUserDao; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; +import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; +import com.epmet.dataaggre.service.epmetuser.IcResiUserService; +import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/10/27 2:04 下午 + */ +@Service +@DataSource(DataSourceConstant.EPMET_USER) +@Slf4j +public class IcResiUserServiceImpl implements IcResiUserService { + @Autowired + private IcResiUserDao icResiUserDao; + @Autowired + private CustomerFootBarService customerFootBarService; + + + + @Override + public PageData pageResi(IcResiUserPageFormDTO formDTO) { + // 查询列表展示项,如果没有,直接返回 + List resultColumns=customerFootBarService.queryConditions(formDTO.getCustomerId(),formDTO.getFormCode()); + if(CollectionUtils.isEmpty(resultColumns)){ + log.warn("没有配置列表展示列"); + return new PageData(new ArrayList(), NumConstant.ZERO); + } + + // 查询列表展示项需要用到哪些子表 + List subTables=customerFootBarService.querySubTables(formDTO.getCustomerId(),formDTO.getFormCode()); + + /* Set subTableList=resultColumns.stream().filter(item->!item.getTableName().equals("ic_resi_user") + && StringUtils.isNotBlank(item.getLink())) + .map(IcFormResColumnDTO :: getTableName).collect(Collectors.toSet()); + List subTables=new ArrayList<>(); + subTableList.forEach(tableName->{ + //'left join ',temp.TABLE_NAME, ' on ( ic_resi_user.ID=',temp.TABLE_NAME,'.IC_RESI_USER and ',temp.TABLE_NAME,'.del_flag="0" )' + String joinSql=String.format("% join %s on ( ic_resi_user.ID=%s.IC_RESI_USER and %s.del_flag=\"0\" "); + subTables.add(joinSql); + });*/ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResi(formDTO.getCustomerId(), + formDTO.getFormCode(), + formDTO.getConditions(), + resultColumns, + subTables)); + List list = pageInfo.getList(); + //todo 还早着呢 + + + + pageInfo.setList(list); + return new PageData<>(pageInfo.getList(),pageInfo.getTotal()); + } + + @Override + public Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO) { + + return null; + } + + +} + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java index b185b9746a..269dcb4be3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java @@ -20,8 +20,11 @@ package com.epmet.dataaggre.service.opercustomize; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; +import java.util.List; + /** * APP底部菜单栏信息 * @@ -39,4 +42,8 @@ public interface CustomerFootBarService extends BaseService queryConditions(String customerId, String formCode); + + List querySubTables(String customerId, String formCode); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java index 4e1546f5a5..53a717d53e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao; import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; +import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; import com.epmet.dataaggre.service.opercrm.CustomerParameterService; @@ -112,4 +113,14 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl queryConditions(String customerId, String formCode) { + return baseDao.queryConditions(customerId,formCode); + } + + @Override + public List querySubTables(String customerId, String formCode) { + return baseDao.querySubTables(customerId,formCode); + } + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml new file mode 100644 index 0000000000..6ae2537dd4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml index b412fd552f..1a01106cec 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml @@ -38,4 +38,44 @@ and c.BAR_KEY=#{barKey} AND C.DISPLAY='1' + + + + \ No newline at end of file