Browse Source

Merge branch 'dev_ic_platform' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_ic_platform

dev_shibei_match
wangxianzhang 4 years ago
parent
commit
bcc80300be
  1. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  2. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  3. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  5. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java
  6. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  7. 12
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  8. 20
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ColumnTableNameResultDTO.java
  9. 9
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  10. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  11. 11
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java
  12. 7
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java
  13. 7
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java
  14. 18
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java
  15. 17
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml
  16. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java
  17. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java
  18. 39
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  19. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  20. 131
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  21. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls
  22. 2
      epmet-user/epmet-user-server/src/main/resources/logback-spring.xml
  23. 64
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -507,4 +507,13 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/icneighborhood/neighborhoodoption")
Result<List<OptionResultDTO>> getNeighborHoodOptions(IcNeighborHoodDTO dto);
/**
* @Description 查询房屋信息
* @param idCard
* @author zxc
* @date 2021/11/3 3:30 下午
*/
@PostMapping("/gov/org/ichouse/selecthouseinfobyidcard")
Result<List<String>> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -305,6 +305,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getNeighborHoodOptions", dto);
}
@Override
public Result<List<String>> selectHouseInfoByIdCard(String idCard) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectHouseInfoByIdCard", idCard);
}
@Override
public Result<String> selectPidsByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java

@ -88,4 +88,15 @@ public class IcHouseController {
return new Result<List<OptionResultDTO>>().ok(icHouseService.getHouseOption(formDTO));
}
/**
* @Description 查询房屋信息
* @param idCard
* @author zxc
* @date 2021/11/3 3:30 下午
*/
@PostMapping("selecthouseinfobyidcard")
public Result<List<String>> selectHouseInfoByIdCard(@RequestParam("idCard")String idCard){
return new Result<List<String>>().ok(icHouseService.selectHouseInfoByIdCard(idCard));
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -52,4 +52,13 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
List<IcHouseExcel> searchAllHouse(@Param("house") IcHouseEntity house);
List<HouseInfoDTO> queryHouseInfo(@Param("houseIdList") Set<String> houseIdList);
/**
* @Description 查询房屋信息
* @param idCard
* @author zxc
* @date 2021/11/3 3:30 下午
*/
List<String> selectHouseInfoByIdCard(@Param("idCard") String idCard);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java

@ -103,4 +103,13 @@ public interface IcHouseService extends BaseService<IcHouseEntity> {
* @Date 2021/10/25 17:04
*/
List<OptionResultDTO> getHouseOption(HouseFormDTO formDTO);
/**
* @Description 查询房屋信息
* @param idCard
* @author zxc
* @date 2021/11/3 3:30 下午
*/
List<String> selectHouseInfoByIdCard(String idCard);
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -36,10 +36,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -135,4 +132,19 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
}).collect(Collectors.toList());
}
/**
* @Description 查询房屋信息
* @param idCard
* @author zxc
* @date 2021/11/3 3:30 下午
*/
@Override
public List<String> selectHouseInfoByIdCard(String idCard) {
List<String> result = baseDao.selectHouseInfoByIdCard(idCard);
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
return result;
}
}

12
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -252,4 +252,16 @@
ih.ID = #{houseId}
</foreach>
</select>
<!-- 查询房屋信息 -->
<select id="selectHouseInfoByIdCard" resultType="java.lang.String">
SELECT
CONCAT(inh.NEIGHBOR_HOOD_NAME,ib.BUILDING_NAME,ibu.UNIT_NAME,ih.HOUSE_NAME)
FROM ic_house ih
LEFT JOIN ic_neighbor_hood inh ON (inh.ID = ih.NEIGHBOR_HOOD_ID AND inh.DEL_FLAG = '0')
LEFT JOIN ic_building ib ON (ib.ID = ih.BUILDING_ID AND ib.DEL_FLAG = '0')
LEFT JOIN ic_building_unit ibu ON (ibu.ID = ih.BUILDING_UNIT_ID AND ibu.DEL_FLAG = '0')
WHERE ih.DEL_FLAG = '0'
AND ih.OWNER_ID_CARD = #{idCard}
</select>
</mapper>

20
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ColumnTableNameResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 查询必填字段-接口返参
* @Author sun
*/
@Data
public class ColumnTableNameResultDTO implements Serializable {
private static final long serialVersionUID = -8441112171986914418L;
//表名
private String tableName;
//字段中文名
private String label;
//字段名
private String columnName;
}

9
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -11,6 +11,7 @@ import com.epmet.dto.result.*;
import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -88,4 +89,12 @@ public interface OperCustomizeOpenFeignClient {
*/
@PostMapping("/oper/customize/icform/items")
Result<List<FormItem>> listItems(@RequestBody CustomerFormQueryDTO formDto);
/**
* @Author sun
* @Description 居民信息新增查询各表必填字段
**/
@PostMapping("/oper/customize/icformitem/getmustcolumn/{customerId}")
Result<List<ColumnTableNameResultDTO>> getMustColumn(@PathVariable("customerId") String customerId);
}

5
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -74,4 +74,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
public Result<List<FormItem>> listItems(CustomerFormQueryDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listItems", formDto);
}
@Override
public Result<List<ColumnTableNameResultDTO>> getMustColumn(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getMustColumn", customerId);
}
}

11
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java

@ -26,6 +26,8 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcFormItemDTO;
import com.epmet.dto.result.ColumnTableNameResultDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.excel.IcFormItemExcel;
import com.epmet.service.IcFormItemService;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,4 +93,13 @@ public class IcFormItemController {
ExcelUtils.exportExcelToTarget(response, null, list, IcFormItemExcel.class);
}
/**
* @Author sun
* @Description 居民信息新增查询各表必填字段
**/
@PostMapping("getmustcolumn/{customerId}")
public Result<List<ColumnTableNameResultDTO>> getMustColumn(@PathVariable String customerId) {
return new Result<List<ColumnTableNameResultDTO>>().ok(icFormItemService.getMustColumn(customerId));
}
}

7
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.ColumnTableNameResultDTO;
import com.epmet.dto.result.ConditionResultDTO;
import com.epmet.dto.result.IcFormResColumnDTO;
import com.epmet.dto.result.TableHeaderResultDTO;
@ -64,4 +65,10 @@ public interface IcFormItemDao extends BaseDao<IcFormItemEntity> {
List<String> querySubTables(@Param("customerId") String customerId, @Param("formCode")String formCode);
Set<String> queryIcResiSubTables(@Param("customerId") String customerId, @Param("formCode")String formCode);
/**
* @Author sun
* @Description 居民信息新增查询各表必填字段
**/
List<ColumnTableNameResultDTO> getMustColumn(@Param("customerId")String customerId);
}

7
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcFormItemDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.result.ColumnTableNameResultDTO;
import com.epmet.dto.result.ConditionResultDTO;
import com.epmet.dto.result.IcFormResColumnDTO;
import com.epmet.dto.result.TableHeaderResultDTO;
@ -115,4 +116,10 @@ public interface IcFormItemService extends BaseService<IcFormItemEntity> {
List<String> querySubTables(String customerId, String formCode);
Set<String> queryIcResiSubTables(String customerId, String formCode);
/**
* @Author sun
* @Description 居民信息新增查询各表必填字段
**/
List<ColumnTableNameResultDTO> getMustColumn(String customerId);
}

18
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcFormItemDao;
import com.epmet.dto.IcFormItemDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.result.ColumnTableNameResultDTO;
import com.epmet.dto.result.ConditionResultDTO;
import com.epmet.dto.result.IcFormResColumnDTO;
import com.epmet.dto.result.TableHeaderResultDTO;
@ -128,6 +129,14 @@ public class IcFormItemServiceImpl extends BaseServiceImpl<IcFormItemDao, IcForm
list.addAll(result);
}
//list.add(new TableHeaderResultDTO("需求分类","DEMAND_NAME","input"));
TableHeaderResultDTO categoryName=new TableHeaderResultDTO();
categoryName.setItemType("input");
categoryName.setItemId(StrConstant.EPMETY_STR);
categoryName.setColumnName("CATEGORY_NAME");
categoryName.setLabel("居民需求");
categoryName.setOptions(new ArrayList<>());
list.add(categoryName);
TableHeaderResultDTO houseType=new TableHeaderResultDTO();
houseType.setItemType("input");
houseType.setItemId(StrConstant.EPMETY_STR);
@ -153,4 +162,13 @@ public class IcFormItemServiceImpl extends BaseServiceImpl<IcFormItemDao, IcForm
return baseDao.queryIcResiSubTables(customerId,formCode);
}
/**
* @Author sun
* @Description 居民信息新增查询各表必填字段
**/
@Override
public List<ColumnTableNameResultDTO> getMustColumn(String customerId) {
return baseDao.getMustColumn(customerId);
}
}

17
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml

@ -141,4 +141,21 @@
AND m.CUSTOMER_ID = #{customerId}
AND m.FORM_CODE = #{formCode}
</select>
<select id="getMustColumn" resultType="com.epmet.dto.result.ColumnTableNameResultDTO">
SELECT
a.label "label",
a.column_name "columnName",
IF (
('' = b.table_name OR b.table_name IS NULL ), 'ic_resi_user', b.table_name
) "tableName"
FROM
ic_form_item a
LEFT JOIN ic_form_item_group b ON a.item_group_id = b.id
WHERE
a.del_flag = '0'
AND a.required = '1'
AND a.customer_id = #{customerId}
</select>
</mapper>

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserPageFormDTO.java

@ -34,5 +34,8 @@ public class IcResiUserPageFormDTO implements Serializable {
*/
private List<ResiUserQueryValueDTO> conditions;
private Boolean pageFlag;
@NotBlank(message = "当前用户id不能为空", groups = AddUserInternalGroup.class)
private String staffId;
}

7
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java

@ -52,7 +52,10 @@ public class PersonDataResultDTO implements Serializable {
/**
* 志愿者类别
*/
private String volunteerCategory;
private List<String> volunteerCategory;
@JsonIgnore
private List<String> volunteerCategoryEn;
public PersonDataResultDTO() {
this.workUnit = "";
@ -61,7 +64,7 @@ public class PersonDataResultDTO implements Serializable {
this.name = "";
this.financialSituation = new FinancialSituationDTO();
this.houseInfo = new ArrayList<>();
this.volunteerCategory = "";
this.volunteerCategory = new ArrayList<>();
}
/**

39
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -307,6 +307,7 @@ public class IcResiUserController {
public Result<PageData<Map<String,Object>>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){
//pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
pageFormDTO.setCustomerId(tokenDto.getCustomerId());
pageFormDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class);
return new Result<PageData<Map<String,Object>>>().ok(icResiUserService.pageResiMap(pageFormDTO));
}
@ -328,35 +329,24 @@ public class IcResiUserController {
@RequestMapping(value = "/exportExcel")
public void exportExcel(/*@LoginUser TokenDto tokenDto,*/ @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws IOException {
pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
pageFormDTO.setPageFlag(false);
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId());
/* Map<String,List<OptionDTO>> checkListMap = new HashMap<>();
for (FormItem item : resiFormItems.getItemList()) {
if ("checkbox".equals(item.getItemType())) {
List<OptionDTO> options = null;
if ("remote".equals(item.getOptionSourceType())) {
} else if ("local".equals(item.getOptionSourceType())) {
options = item.getOptions();
}
checkListMap.put(item.getColumnName().concat(item.getColumnNum().equals(0) ? "" : item.getColumnNum().toString()), options);
}
}*/
//PageData<Map<String, Object>> mapPageData = icResiUserService.pageResiMap(pageFormDTO);
//List<Map<String, Object>> resiMainList = mapPageData.getList();
Map<String, FormItem> itemMap = new HashMap<>();
for (FormItem formItem : resiFormItems.getItemList()) {
if (StringUtils.isNotBlank(formItem.getColumnName())){
if (StringUtils.isBlank(formItem.getColumnName())){
continue;
}
if (formItem.getItemType().equals("checkbox") || formItem.getItemType().equals("select")){
itemMap.put(formItem.getColumnName().concat(formItem.getColumnNum() == 0 ? "" : formItem.getColumnNum().toString()), formItem);
}
if (formItem.getChildGroup() != null) {
for (FormItem2 item2 : formItem.getChildGroup().getItemList()) {
if (item2.getItemType().equals("checkbox")) {
if (StringUtils.isBlank(item2.getColumnName())){
continue;
}
if (item2.getItemType().equals("checkbox") || item2.getItemType().equals("select")){
itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2,FormItem.class));
}
}
@ -369,11 +359,13 @@ public class IcResiUserController {
if (StringUtils.isBlank(item.getColumnName())){
continue;
}
System.out.println(item.getColumnName()+item.getColumnNum());
itemMap.put(item.getColumnName().concat(item.getColumnNum() == 0 ? "" : item.getColumnNum().toString()), ConvertUtils.sourceToTarget(item,FormItem.class));
if (item.getItemType().equals("checkbox") || item.getItemType().equals("select")){
itemMap.put(item.getColumnName().concat(item.getColumnNum() == 0 ? "" : item.getColumnNum().toString()), ConvertUtils.sourceToTarget(item, FormItem.class));
}
}
}
}
System.out.println("checkbox:"+JSON.toJSONString(itemMap));
Map<String,Map<String, Object>> resiMainList = icResiUserService.getDataForExport(itemMap,pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
//resiMainList = (List<Map<String, Object>>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]");
log.info("resiMainList:{}", JSON.toJSONString(resiMainList));
@ -390,10 +382,6 @@ public class IcResiUserController {
if (item.getChildGroup() != null) {
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) {
//itemMap = item.getChildGroup().getItemList().stream().filter(o -> o.getItemType().equals("checkbox")).collect(Collectors.toMap(o -> o.getColumnName().concat(o.getColumnNum() == 0 ? "" : o.getColumnNum().toString()), o -> ConvertUtils.sourceToTarget(o,FormItem.class)));
Map<String,Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions());
resiChildMap.forEach((key,value)->{
value.putAll(resiMainList.get(key));
@ -401,7 +389,6 @@ public class IcResiUserController {
Map<String, Object> mapData2 = new HashMap<>();
mapData2.put("list", resiChildMap.values());
System.out.println("========="+item.getChildGroup().getTableName()+" data:"+resiChildMap.size());
sheetMap.put(n.incrementAndGet(),mapData2);
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -28,6 +28,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 用户基础信息
@ -54,7 +55,9 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("formCode") String formCode,
@Param("conditions") List<ResiUserQueryValueDTO> conditions,
@Param("resultColumns") List<IcFormResColumnDTO> resultColumns,
@Param("subTables") List<String> subTables);
@Param("subTables") List<String> subTables,
@Param("currentStaffAgencyId")String currentStaffAgencyId,
@Param("staffOrgPath") String staffOrgPath);
/**
* 查询主表
*
@ -115,4 +118,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<SearchByNameResultDTO> searchByName(@Param("name")String name, @Param("agencyId")String agencyId,@Param("pageNo")Integer pageNo);
Set<String> selectUserDemandCode(String icResiUserId);
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);
}

131
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -92,10 +92,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@Override
public PageData<IcResiUserDTO> page(Map<String, Object> params) {
IPage<IcResiUserEntity> page = baseDao.selectPage(
@ -162,6 +162,28 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Transactional(rollbackFor = Exception.class)
public void add(TokenDto tokenDto, List<IcResiUserFormDTO> formDTO) {
//循环自动拼接sql语句,往多个表新增数据
//0.校验必填字段是否为空
Result<List<ColumnTableNameResultDTO>> resultList = operCustomizeOpenFeignClient.getMustColumn(tokenDto.getCustomerId());
if (resultList.success() && null != resultList.getData()) {
StringBuffer str = new StringBuffer("");
formDTO.forEach(f -> {
resultList.getData().forEach(l -> {
if (f.getTableName().equals(l.getTableName())) {
f.getList().forEach(map -> {
if (!map.containsKey(l.getColumnName())) {
str.append(str.length() < NumConstant.ONE ? l.getLabel() : "、" + l.getLabel());
}
});
}
});
});
if (str.length() > NumConstant.ZERO ) {
throw new RenException(String.format("新增居民信息,必要字段值为空,%s值为空", str));
}
} else {
throw new RenException(String.format("新增居民信息-根据客户Id查询必填信息失败,customerId->%s", tokenDto.getCustomerId()));
}
//1.先往主表新增数据
//主表Id
String resiUserId = UUID.randomUUID().toString().replaceAll("-", "");
@ -293,6 +315,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
public PageData<Map<String, Object>> pageResiMap(IcResiUserPageFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId());
String staffOrgPath=StrConstant.EPMETY_STR;
if(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds())&& !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())){
staffOrgPath=staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
}
// 查询列表展示项,如果没有,直接返回
CustomerFormQueryDTO queryDTO1=new CustomerFormQueryDTO();
queryDTO1.setCustomerId(formDTO.getCustomerId());
@ -309,18 +337,22 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
PageInfo<Map<String, Object>> pageInfo=new PageInfo<>();
if (null == formDTO.getPageFlag()||formDTO.getPageFlag()) {
//分页
String finalStaffOrgPath = staffOrgPath;
pageInfo= PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListResiMap(formDTO.getCustomerId(),
formDTO.getFormCode(),
formDTO.getConditions(),
resultColumns,
subTables));
subTables,
staffInfoCacheResult.getAgencyId(), finalStaffOrgPath
));
}else{
List<Map<String,Object>> list=baseDao.selectListResiMap(formDTO.getCustomerId(),
formDTO.getFormCode(),
formDTO.getConditions(),
resultColumns,
subTables);
subTables,staffInfoCacheResult.getAgencyId(),
staffOrgPath);
pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size());
pageInfo.setList(list);
}
@ -380,8 +412,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
} else if (HouseTypeEnum.BIESHU.getCode().equals(houseType)) {
resultMap.put(UserConstant.HOUSE_TYPE_KEY, HouseTypeEnum.BIESHU.getName());
}
resultMap.put(UserConstant.HOME_ID, neighBorName.concat(buildName).concat(unitName).concat(doorName));
resultMap.put("CATEGORY_NAME",queryUserDemandName(formDTO.getCustomerId(),(String) resultMap.get("icResiUserId")));
}
if (resultMap.containsKey(UserConstant.GENDER)) {
@ -399,6 +432,24 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
private String queryUserDemandName(String customerId,String icResiUserId) {
Set<String> demandCodePath=baseDao.selectUserDemandCode(icResiUserId);
if(CollectionUtils.isEmpty(demandCodePath)){
return StrConstant.EPMETY_STR;
}
Set<String> codeSet=new HashSet<>();
for(String codePath:demandCodePath){
if(codePath.contains(StrConstant.COMMA)){
String[] codeAtt=codePath.split(StrConstant.COMMA);
codeSet.add(codeAtt[codeAtt.length-1]);
}else{
codeSet.add(codePath);
}
}
String demandName=baseDao.selectCategoryNames(customerId,codeSet);
return demandName;
}
/**
* 编辑页面显示居民信息详情
*
@ -550,11 +601,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @param currUserAgencyId 当前用户的组织id
* @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文
*/
private void persist(Map<String, ColumnWrapper> headerColumnWrapper, List<Map<Integer, String>> dataRows,
private void persist(Map<String, ColumnWrapper> headerColumnWrapper, List<Map<Integer, String>> dataRows,
String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, String tableName,
String currUserAgencyPids, String currentUserId) {
for (Map<Integer, String> row : dataRows) {
// 当前行的列们
// List<ColumnWrapper> columnsOfCurrRow = new ArrayList<>();
@ -610,7 +661,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
columnAndValues.put("IS_UNITED_FRONT", "0");
columnAndValues.put("IS_VETERANS", "0");
columnAndValues.put("IS_VOLUNTEER", "0");
columnAndValues.put("AGENCY_ID", currUserAgencyId);
columnAndValues.put("PIDS", currUserAgencyPids);
columnAndValues.put("CUSTOMER_ID", loginUserUtil.getCurrentCustomerId());
@ -623,7 +674,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
// });
// System.out.println("-------------------");
baseDao.add(tableName, columnAndValues);
}
}
@ -780,7 +831,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
cascadeItemId = uriParts[1];
// 根据uri上的id,找到关联的itemid,从而找到关联的item的值
cascadeItemColumnWrapper = columnWrappers.get(cascadeItemId);
if (columnWrappers != null){
cascadeItemColumnWrapper = columnWrappers.get(cascadeItemId);
}
} else {
pureUri = fullUri;
}
@ -991,9 +1044,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
*/
@Override
public PersonDataResultDTO personData(PersonDataFormDTO formDTO) {
baseDao.personData(formDTO.getUserId());
PersonDataResultDTO personData = baseDao.personData(formDTO.getUserId());
if (null == personData){
return new PersonDataResultDTO();
}
// 房屋信息查询
Result<List<String>> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard());
if (!listResult.success()){
throw new RenException("查询房屋信息失败");
}
personData.setHouseInfo(listResult.getData());
// TODO
return null;
return personData;
}
/**
@ -1039,17 +1101,45 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
Map<String, Map<String, Object>> result = new LinkedHashMap<>();
mapList.stream().filter(Objects::nonNull).forEach(map -> {
String resiId = (String) map.getOrDefault(UserConstant.IC_RESI_USER, "");
formItemMap.forEach((k, v)->{
for (Map.Entry<String, FormItem> e : formItemMap.entrySet()) {
String k = e.getKey();
FormItem v = e.getValue();
Object temp = map.get(k);
if (temp != null){
if (v.getOptionSourceType().equals("remote")){
//todo 获取 options
if (temp != null) {
if (v.getOptionSourceType().equals("remote")) {
try {
//todo 获取 options
Map<String, String> stringMap = listRemoteOptions(new HashMap<>(), v.getOptionSourceValue(), null);
System.out.println("======remote:"+v.getLabel()+" "+JSON.toJSONString(stringMap));
if ("checkbox".equals(v.getItemType())) {
stringMap.forEach((label, value) -> map.put(value, temp.toString().contains(value) ? "是" : "否"));
} else if ("select".equals(v.getItemType())) {
stringMap.forEach((label,value)->{
if (temp.toString().equals(value)){
map.put(k, label);
}
});
}
} catch (Exception ex) {
log.warn("listRemoteOptions url:{}",v.getOptionSourceValue());
}
} else {
if ("checkbox".equals(v.getItemType())) {
v.getOptions().forEach(optionDTO -> {
map.put(optionDTO.getValue(), temp.toString().contains(optionDTO.getValue()) ? "是" : "否");
});
} else if ("select".equals(v.getItemType())) {
v.getOptions().forEach(optionDTO -> {
if (optionDTO.getLabel().equals(temp.toString())){
map.put(k, optionDTO.getLabel());
}
});
}
}
v.getOptions().forEach(optionDTO -> {
map.put(optionDTO.getValue(),temp.toString().contains(optionDTO.getValue())?"是":"否");
});
}
});
}
if ("ic_resi_user".equals(baseTableName)) {
resiId = (String) map.get("ID");
}
@ -1080,6 +1170,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
map.put("VILLAGE_NAME", houseInfoDTO.getNeighborHoodName());
map.put("BUILD_NAME", houseInfoDTO.getBuildingName());
map.put("HOME_ID", houseInfoDTO.getDoorName());
map.put("UNIT_ID", houseInfoDTO.getUnitName());
}
}

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls

Binary file not shown.

2
epmet-user/epmet-user-server/src/main/resources/logback-spring.xml

@ -139,7 +139,7 @@
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<springProfile name="local,dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>

64
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -44,8 +44,32 @@
select * from ${subTableName} where del_flag='0' and IC_RESI_USER=#{icResiUserId} and customer_id=#{customerId}
</select>
<!-- 列表查询 -->
<sql id="listWhereForPage">
ic_resi_user.DEL_FLAG = '0'
and ic_resi_user.customer_id=#{customerId}
and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%'))
<if test="null != conditions and conditions.size() > 0">
<foreach item="subCondition" collection="conditions" open="" separator="" close="">
<if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0">
<if test="subCondition.queryType!= null and subCondition.queryType == 'equal' ">
and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]}
</if>
<if test="subCondition.queryType!= null and subCondition.queryType == 'like' ">
and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%')
</if>
<if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' ">
and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]}
</if>
</if>
</foreach>
</if>
</sql>
<!-- 公用where条件 -->
<!-- 导出公用where条件 -->
<sql id="listWhere">
ic_resi_user.DEL_FLAG = '0'
and ic_resi_user.customer_id=#{customerId}
@ -73,12 +97,10 @@
<select id="selectListResiMap" parameterType="map" resultType="map">
select
ic_resi_user.id as icResiUserId,
ic_resi_user.AGENCY_ID as ORG_ID,
<foreach item="column" collection="resultColumns" open="" separator="," close="">
${column.columnName}
</foreach>
,
GROUP_CONCAT(ic_resi_demand.CATEGORY_CODE) as DEMAND_CATEGORY_IDS,
GROUP_CONCAT(ic_resi_demand_dict.CATEGORY_NAME) as DEMAND_NAME
FROM
ic_resi_user
<if test="null != subTables and subTables.size() > 0">
@ -86,12 +108,8 @@
${subTableName}
</foreach>
</if>
left join ic_resi_demand_dict
on(ic_resi_user.customer_id=ic_resi_demand_dict.CUSTOMER_ID
and ic_resi_demand.CATEGORY_CODE=ic_resi_demand_dict.CATEGORY_CODE )
<where>
<include refid="listWhere"></include>
<include refid="listWhereForPage"></include>
</where>
group by IC_RESI_USER.id
order by ic_resi_user.CREATED_TIME desc
@ -160,4 +178,32 @@
AND `NAME` LIKE CONCAT('%',#{name},'%')
ORDER BY `NAME`
</select>
<select id="selectUserDemandCode" parameterType="java.lang.String" resultType="java.lang.String">
SELECT DISTINCT
m.CATEGORY_CODE
FROM
ic_resi_demand m
WHERE
m.DEL_FLAG = '0'
AND m.IC_RESI_USER = #{icResiUserId}
ORDER BY
m.CREATED_TIME ASC
</select>
<select id="selectCategoryNames" parameterType="map" resultType="java.lang.String">
SELECT
GROUP_CONCAT(m.CATEGORY_NAME)
FROM
ic_resi_demand_dict m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
<if test="null != codeSet and codeSet.size() > 0">
AND m.CATEGORY_CODE IN
<foreach item="code" collection="codeSet" open="(" separator="," close=")">
#{code}
</foreach>
</if>
</select>
</mapper>
Loading…
Cancel
Save