Browse Source

Merge remote-tracking branch 'origin/dev_ic_platform' into develop

master
yinzuomei 4 years ago
parent
commit
fb0c153715
  1. 34
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  2. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  3. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  4. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  5. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java
  6. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

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

@ -29,10 +29,13 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
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.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -178,7 +181,14 @@ public class IcResiUserController {
* @throws Exception
*/
@RequestMapping(value = "/exportExcel2")
public void exportExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
public void exportExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
String staffOrgPath = StrConstant.EPMETY_STR;
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
}else{
staffOrgPath=staffInfoCacheResult.getAgencyId();
}
pageFormDTO.setCustomerId(customerId);
pageFormDTO.setPageFlag(false);
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId());
@ -229,7 +239,7 @@ public class IcResiUserController {
}
}
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath);
//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));
String templatePath = "excel/ic_resi_info_cid.xls";
@ -246,7 +256,7 @@ public class IcResiUserController {
if (item.getChildGroup() != null) {
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) {
Map<String, FormItem> itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName());
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions());
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath);
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
Map<String, Object> mapData2 = new HashMap<>();
@ -263,7 +273,14 @@ public class IcResiUserController {
}
@RequestMapping(value = "/exportExcel")
public void exportExcelByEasyExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
public void exportExcelByEasyExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
String staffOrgPath = StrConstant.EPMETY_STR;
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
}else{
staffOrgPath=staffInfoCacheResult.getAgencyId();
}
pageFormDTO.setCustomerId(customerId);
pageFormDTO.setPageFlag(false);
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId());
@ -314,7 +331,7 @@ public class IcResiUserController {
}
}
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath);
//=========================================
String templatePath = "excel/ic_resi_info_cid_for_easy_excel.xlsx";
@ -334,7 +351,7 @@ public class IcResiUserController {
if (item.getChildGroup() != null) {
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) {
Map<String, FormItem> itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName());
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions());
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath);
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
int sheetNo = n.incrementAndGet();
@ -397,13 +414,14 @@ public class IcResiUserController {
}
@PostMapping("test")
public Result<List<Map<String, Object>>> test(@RequestBody DynamicQueryFormDTO formDTO) {
public Result<List<Map<String, Object>>> test(@LoginUser TokenDto tokenDto,@RequestBody DynamicQueryFormDTO formDTO) {
formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
//formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<Map<String, Object>>>().ok(icResiUserService.dynamicQuery(formDTO.getCustomerId(),
formDTO.getFormCode(),
formDTO.getResultTableName(),
formDTO.getConditions()));
formDTO.getConditions(),
tokenDto.getUserId(),null));
}
/**

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

@ -100,7 +100,9 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<Map<String,Object>> dynamicQuery(@Param("customerId")String customerId,
@Param("resultTableName")String resultTableName,
@Param("conditions") List<ResiUserQueryValueDTO> conditions,
@Param("subTables") List<String> subTables);
@Param("subTables") List<String> subTables,
@Param("currentStaffAgencyId")String currentStaffAgencyId,
@Param("staffOrgPath")String staffOrgPath);
/**
* @Description 查询个人信息

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -80,7 +80,9 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
List<Map<String,Object>> dynamicQuery(String customerId,
String formCode,
String resultTableName,
List<ResiUserQueryValueDTO> conditions);
List<ResiUserQueryValueDTO> conditions,
String currentStaffAgencyId,
String staffOrgPath);
/**
* @Description 查询个人数据
@ -111,7 +113,8 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @param conditions
* @return
*/
Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> itemList, Map<String, Map<String, Object>> resiMainList, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions);
Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> itemList, Map<String, Map<String, Object>> resiMainList, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions,String currentStaffAgencyId,
String staffOrgPath);
/**
* @Description 家庭关系

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

@ -290,6 +290,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
String staffOrgPath=StrConstant.EPMETY_STR;
if(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds())&& !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())){
staffOrgPath=staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
}else{
staffOrgPath=staffInfoCacheResult.getAgencyId();
}
// 查询列表展示项,如果没有,直接返回
@ -467,16 +469,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
public List<Map<String,Object>> dynamicQuery(String customerId,
String formCode,
String resultTableName,
List<ResiUserQueryValueDTO> conditions){
List<ResiUserQueryValueDTO> conditions,
String currentStaffAgencyId,
String staffOrgPath){
CustomerFormQueryDTO queryDTO=new CustomerFormQueryDTO();
queryDTO.setCustomerId(customerId);
queryDTO.setFormCode(formCode);
//所有的子表
Result<List<String>> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO);
List<String> subTables=new ArrayList<>();
if(subTablesRes.success()&&CollectionUtils.isNotEmpty(subTablesRes.getData())){
subTables =subTablesRes.getData();
}
return baseDao.dynamicQuery(customerId,resultTableName,conditions,subTables);
return baseDao.dynamicQuery(customerId,resultTableName,conditions,subTables,currentStaffAgencyId,staffOrgPath);
}
/**
@ -616,8 +621,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @return
*/
@Override
public Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> formItemMap, Map<String, Map<String, Object>> resiMainList, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions) {
List<Map<String, Object>> mapList = this.dynamicQuery(customerId, formCode, baseTableName, conditions);
public Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> formItemMap, Map<String, Map<String, Object>> resiMainList, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions,
String currentStaffAgencyId,
String staffOrgPath) {
List<Map<String, Object>> mapList = this.dynamicQuery(customerId, formCode, baseTableName, conditions,currentStaffAgencyId,staffOrgPath);
Map<String, Map<String, Object>> result = new LinkedHashMap<>();
mapList.stream().filter(Objects::nonNull).forEach(map -> {
map.forEach((k,o) -> {

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java

@ -47,6 +47,9 @@ public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl<Stat
return result;
}
public static void main(String[] args) {
System.out.println(DateUtils.getBeforeNDay(NumConstant.ZERO));
}
/**
* @Description 查询巡查次数和时长
* @Param agencyId

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

@ -143,7 +143,7 @@
</if>
<where>
<include refid="listWhere"></include>
<include refid="listWhereForPage"></include>
</where>
group by IC_RESI_USER.id
order by ic_resi_user.CREATED_TIME desc

Loading…
Cancel
Save