Browse Source

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

dev_shibei_match
jianjun 4 years ago
parent
commit
be69ddb4e8
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  3. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java
  4. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  5. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  6. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java
  7. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java
  8. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java
  9. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java
  10. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java
  11. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java
  12. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java
  13. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
  14. 27
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  15. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java
  16. 58
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java
  17. 53
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java
  18. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java
  19. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
  20. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  21. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  22. 45
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  23. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml
  24. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java
  25. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java
  26. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java
  27. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java
  28. 28
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java
  29. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java
  30. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java
  31. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java
  32. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java
  33. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java
  34. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  35. 21
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java
  36. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
  37. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java
  38. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java
  39. 16
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml
  40. 6
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml
  41. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml
  42. 6
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml
  43. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml
  44. 227
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  45. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -153,6 +153,8 @@ public enum EpmetErrorCode {
// 预约某事项在某时间段存在记录时
APPOINTMENT_TIME_ERROR(8527, "该时间段已被预约,请选择其他时间段"),
APPOINTMENT_ERROR(8528, "%s尚有未履行的预约存在,请确认后操作"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),
OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"),

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -632,4 +632,5 @@ public class RedisKeys {
public static String getResiTempChangedKey(String customerId) {
return rootPrefix.concat("resi:").concat("export").concat(":template:changed").concat(customerId);
}
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java

@ -121,7 +121,7 @@ public class ExcelUtils {
out.flush();
out.close();
}
public static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception {
public static OutputStream getOutputStreamForExcel(String fileName, HttpServletResponse response) throws Exception {
fileName = URLEncoder.encode(fileName, "UTF-8");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf8");

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -268,7 +268,7 @@ public class ScreenProjectController {
//String template = this.getClass().getResource(templatePath).getPath();
String fileName = "项目统计.xlsx";
excelWriter = EasyExcel.write(ExcelUtils.getOutputStream(fileName, response)).withTemplate(inputStream).build();
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response)).withTemplate(inputStream).build();
WriteSheet writeSheet = EasyExcel.writerSheet().build();
excelWriter.fill(mapData, writeSheet);

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java

@ -163,7 +163,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
baseDao.deleteByProjectId(param.getCustomerId(), item.getProjectId());
screenProjectImgDataDao.deleteByProjectId(param.getCustomerId(), item.getProjectId());
baseDao.insert(screenProjectDataEntity);
saveCategory(param.getCustomerId(), Collections.singletonList(screenProjectDataEntity))
saveCategory(param.getCustomerId(), Collections.singletonList(screenProjectDataEntity));
//插入该项目图片表
String[] projectImgUrl = item.getProjectImgUrl();
if (ArrayUtils.isNotEmpty(projectImgUrl)) {
@ -174,7 +174,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
screenProjectImgDataEntity.setProjectId(item.getProjectId());
screenProjectImgDataEntity.setProjectImgUrl(projectImgUrl[i]);
screenProjectImgDataEntity.setSort(i);
imgList.add(screenProjectImgDataEntity)
imgList.add(screenProjectImgDataEntity);
}
screenProjectImgDataDao.insertBatch(imgList);
}
@ -359,8 +359,12 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
if ("external".equals(categoryEntity.getCustomerType())) {
entity.setCategoryCode(categoryEntity.getEpmetCategoryCode());
CustomerProjectCategoryDictEntity parent = customerProjectCategoryDictService.getByCategoryCode(parentCustomer.getData(), categoryEntity.getEpmetCategoryCode());
entity.setParentCategoryCode(parent.getParentCategoryCode());
entity.setLevel(parent.getLevel());
if (null != parent) {
entity.setParentCategoryCode(parent.getParentCategoryCode());
entity.setLevel(parent.getLevel());
} else {
log.error("未找到对应分类");
}
} else {
entity.setCategoryCode(categoryEntity.getCategoryCode());
entity.setParentCategoryCode(categoryEntity.getParentCategoryCode());

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.BaseReportConstant;
import com.epmet.dao.stats.BaseReportDao;
import com.epmet.dto.basereport.form.*;
import com.epmet.service.BaseReportService;
@ -60,7 +59,8 @@ public class BaseReportServiceImpl implements BaseReportService {
} while (deleteNum > NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
baseReportDao.insertBatchAgencyRegUser(formDTO.getDataList());
ListUtils.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED)
.forEach(part->baseReportDao.insertBatchAgencyRegUser(part);
}
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java

@ -101,7 +101,7 @@ public class IcSocietyOrgDTO implements Serializable {
/**
* 维度
*/
private String dimension;
private String latitude;
/**
* 备注

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java

@ -96,7 +96,7 @@ public class AddSocietyOrgFormDTO implements Serializable {
/**
* 维度
*/
private String dimension;
private String latitude;
//token中userId
private String staffId;

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java

@ -85,7 +85,7 @@ public class EditSocietyOrgFormDTO implements Serializable {
/**
* 维度
*/
private String dimension;
private String latitude;
//token中userId
private String staffId;

1
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java

@ -15,6 +15,7 @@ import java.io.Serializable;
public class PartyUnitFormDTO implements Serializable {
private static final long serialVersionUID = 1256798619648265622L;
private String customerId;
private String agencyId;
private String unitName;
private String serviceMatter;

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java

@ -67,7 +67,7 @@ public class GetListSocietyOrgResultDTO implements Serializable {
//经度
private String longitude;
//维度
private String dimension;
private String latitude;
}
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java

@ -56,6 +56,6 @@ public class SocietyOrgListResultDTO implements Serializable {
//经度
private String longitude;
//维度
private String dimension;
private String latitude;
}

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java

@ -32,7 +32,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
@ -75,9 +76,19 @@ public class IcPartyActivityController {
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcPartyActivityDTO> list = icPartyActivityService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcPartyActivityExcel.class);
public void export(@RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception {
List<IcPartyActivityDTO> list = icPartyActivityService.list(formDTO);
AtomicInteger i = new AtomicInteger(0);
List<IcPartyActivityExcel> excelList = list.stream().map(item -> {
IcPartyActivityExcel excel = new IcPartyActivityExcel();
excel.setIndex(i.getAndIncrement());
excel.setUnitName(item.getUnitName());
excel.setTitle(item.getTitle());
excel.setAddress(item.getAddress());
excel.setPeopleCount(item.getPeopleCount());
excel.setActivityTime(item.getActivityTime());
return excel;
}).collect(Collectors.toList());
ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyActivityExcel.class);
}
}

27
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -37,7 +37,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
@ -54,7 +55,8 @@ public class IcPartyUnitController {
private IcPartyUnitService icPartyUnitService;
@PostMapping("list")
public Result<PageData<IcPartyUnitDTO>> search(@RequestBody PartyUnitFormDTO formDTO){
public Result<PageData<IcPartyUnitDTO>> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
PageData<IcPartyUnitDTO> page = icPartyUnitService.search(formDTO);
return new Result<PageData<IcPartyUnitDTO>>().ok(page);
}
@ -83,9 +85,24 @@ public class IcPartyUnitController {
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcPartyUnitDTO> list = icPartyUnitService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcPartyUnitExcel.class);
public void export(@RequestBody PartyUnitFormDTO formDTO, HttpServletResponse response) throws Exception {
List<IcPartyUnitDTO> list = icPartyUnitService.list(formDTO);
AtomicInteger i = new AtomicInteger(0);
List<IcPartyUnitExcel> excelList = list.stream().map(item -> {
IcPartyUnitExcel excel = new IcPartyUnitExcel();
excel.setIndex(i.getAndIncrement());
excel.setUnitName(item.getUnitName());
excel.setContact(item.getContact());
excel.setContactMobile(item.getContactMobile());
excel.setType(item.getType());
excel.setMemberCount(item.getMemberCount());
excel.setRemark(item.getRemark());
excel.setSatisfaction(item.getSatisfaction());
excel.setServiceMatter(String.join(String.valueOf((char)10), item.getServiceMatterList()));
return excel;
}).collect(Collectors.toList());
ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyUnitExcel.class);
}
/**

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java

@ -101,7 +101,7 @@ public class IcSocietyOrgEntity extends BaseEpmetEntity {
/**
* 维度
*/
private String dimension;
private String latitude;
/**
* 备注

58
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java

@ -31,32 +31,17 @@ import java.util.Date;
@Data
public class IcPartyActivityExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "序号")
private Integer index;
@Excel(name = "客户id")
private String customerId;
@Excel(name = "组织ID")
private String agencyId;
@Excel(name = "组织的所有上级")
private String pids;
@Excel(name = "单位ID")
private String unitId;
@Excel(name = "服务事项")
private String serviceMatter;
@Excel(name = "单位名称")
private String unitName;
@Excel(name = "活动标题")
private String title;
@Excel(name = "活动目标")
private String target;
@Excel(name = "活动内容")
private String content;
@Excel(name = "活动地址")
private String address;
@Excel(name = "服务人数")
private Integer peopleCount;
@ -64,35 +49,4 @@ public class IcPartyActivityExcel {
@Excel(name = "活动时间")
private Date activityTime;
@Excel(name = "活动地址")
private String address;
@Excel(name = "活动地址经度")
private String longitude;
@Excel(name = "活动地址纬度")
private String latitude;
@Excel(name = "活动结果")
private String result;
@Excel(name = "删除标识 0未删除、1已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

53
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java

@ -20,8 +20,6 @@ package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 联建单位
*
@ -31,28 +29,16 @@ import java.util.Date;
@Data
public class IcPartyUnitExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户id")
private String customerId;
@Excel(name = "组织ID")
private String agencyId;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "")
private String pids;
@Excel(name = "序号")
private Integer index;
@Excel(name = "单位名称")
private String unitName;
@Excel(name = "分类 楼宇党建 两新组织 区域单位党建 机关直属部门 其他")
@Excel(name = "分类")
private String type;
@Excel(name = "服务事项 多选逗号隔开")
@Excel(name = "服务事项")
private String serviceMatter;
@Excel(name = "联系人")
@ -61,41 +47,12 @@ public class IcPartyUnitExcel {
@Excel(name = "联系电话")
private String contactMobile;
@Excel(name = "在职党员")
@Excel(name = "在职党员")
private Integer memberCount;
@Excel(name = "地址")
private String address;
@Excel(name = "中心位置经度")
private String longitude;
@Excel(name = "中心位置纬度")
private String latitude;
@Excel(name = "群众满意度")
private String satisfaction;
@Excel(name = "备注")
private String remark;
@Excel(name = "删除标识 0未删除、1已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java

@ -71,7 +71,7 @@ public class IcSocietyOrgExcel {
private String longitude;
@Excel(name = "维度")
private String dimension;
private String latitude;
@Excel(name = "备注")
private String remarks;

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java

@ -24,7 +24,6 @@ import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.entity.IcPartyActivityEntity;
import java.util.List;
import java.util.Map;
/**
* 联建活动
@ -47,12 +46,12 @@ public interface IcPartyActivityService extends BaseService<IcPartyActivityEntit
/**
* 默认查询
*
* @param params
* @param formDTO
* @return java.util.List<IcPartyActivityDTO>
* @author generator
* @date 2021-11-19
*/
List<IcPartyActivityDTO> list(Map<String, Object> params);
List<IcPartyActivityDTO> list(PartyActivityFormDTO formDTO);
/**
* 单条查询

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -26,7 +26,6 @@ import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import java.util.List;
import java.util.Map;
/**
* 联建单位
@ -49,12 +48,12 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
/**
* 默认查询
*
* @param params
* @param formDTO
* @return java.util.List<IcPartyUnitDTO>
* @author generator
* @date 2021-11-19
*/
List<IcPartyUnitDTO> list(Map<String, Object> params);
List<IcPartyUnitDTO> list(PartyUnitFormDTO formDTO);
/**
* 单条查询

23
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -83,10 +83,27 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
}
@Override
public List<IcPartyActivityDTO> list(Map<String, Object> params) {
List<IcPartyActivityEntity> entityList = baseDao.selectList(getWrapper(params));
public List<IcPartyActivityDTO> list(PartyActivityFormDTO formDTO) {
LambdaQueryWrapper<IcPartyActivityEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter());
wrapper.like(StringUtils.isNotBlank(formDTO.getTitle()), IcPartyActivityEntity::getTitle, formDTO.getTitle());
wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime());
wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime);
List<IcPartyActivityEntity> list = baseDao.selectList(wrapper);
List<IcPartyActivityDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class);
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(dtoList)) {
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(dto -> {
dto.setUnitName(option.get(dto.getUnitId()));
});
}
return ConvertUtils.sourceToTarget(entityList, IcPartyActivityDTO.class);
return dtoList;
}
private QueryWrapper<IcPartyActivityEntity> getWrapper(Map<String, Object> params){

45
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -33,16 +33,17 @@ import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -61,8 +62,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Resource
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
@Resource
private IcUserDemandRecService icUserDemandRecService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Override
@ -79,11 +82,17 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
List<IcPartyUnitEntity> list = baseDao.selectList(wrapper);
List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class);
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(item -> {
item.setType(unitTypeMap.getData().get(item.getType()));
//TODO 服务事项
if (StringUtils.isNotBlank(item.getServiceMatter())) {
List<String> matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA));
item.setServiceMatterList(matters.stream().map(categoryMap::get).collect(Collectors.toList()));
} else {
item.setServiceMatterList(new ArrayList<>());
}
});
PageInfo<IcPartyUnitDTO> pageInfo = new PageInfo<>(dtoList);
@ -91,10 +100,32 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
}
@Override
public List<IcPartyUnitDTO> list(Map<String, Object> params) {
List<IcPartyUnitEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcPartyUnitDTO.class);
public List<IcPartyUnitDTO> list(PartyUnitFormDTO formDTO) {
LambdaQueryWrapper<IcPartyUnitEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyUnitEntity::getAgencyId, formDTO.getAgencyId());
wrapper.like(StringUtils.isNotBlank(formDTO.getUnitName()), IcPartyUnitEntity::getUnitName, formDTO.getUnitName());
wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, formDTO.getServiceMatter());
wrapper.eq(StringUtils.isNotBlank(formDTO.getType()), IcPartyUnitEntity::getType, formDTO.getType());
wrapper.like(StringUtils.isNotBlank(formDTO.getContact()), IcPartyUnitEntity::getContact, formDTO.getContact());
wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile());
wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime);
List<IcPartyUnitEntity> list = baseDao.selectList(wrapper);
List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class);
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(item -> {
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
List<String> matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA));
item.setServiceMatterList(matters.stream().map(categoryMap::get).collect(Collectors.toList()));
} else {
item.setServiceMatterList(new ArrayList<>());
}
});
return dtoList;
}
private QueryWrapper<IcPartyUnitEntity> getWrapper(Map<String, Object> params){

2
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

@ -16,7 +16,7 @@
admin_staff_id adminStaffId,
address address,
longitude longitude,
dimension dimension
latitude latitude
FROM
ic_society_org
WHERE

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java

@ -106,7 +106,7 @@ public class AddPlacePatrolTeamFormDTO implements Serializable {
* 分队成员信息
*/
@Valid
@NotEmpty(message = "成员列表不能为空")
@NotEmpty(message = "成员列表不能为空", groups = {Add.class})
private List<Member> memberList;
//token中userId
@ -115,7 +115,7 @@ public class AddPlacePatrolTeamFormDTO implements Serializable {
public interface Add { }
@Data
public class Member {
public static class Member {
//姓名
private String name;
//联系电话

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java

@ -80,7 +80,12 @@ public class EditPartyServiceCenterFormDTO implements Serializable {
private String partyServiceCenterId;
/**
* 可预约事项
* 新增的可预约事项
*/
private List<IcPartyServiceCenterMatterDTO> matterList;
/**
* 要删除的事项
*/
private List<String> delMatterList;
}

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java

@ -35,6 +35,11 @@ import java.util.List;
public class EditPlacePatrolTeamFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 分队Id
*/
@ -99,7 +104,7 @@ public class EditPlacePatrolTeamFormDTO implements Serializable {
}
@Data
public class Member {
public static class Member {
//姓名
private String name;
//联系电话

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java

@ -32,9 +32,9 @@ import java.io.Serializable;
public class GetListPlacePatrolReviewRecordFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
//巡查记录Id
@NotBlank(message = "巡查记录Id不能为空", groups = {GetData.class})
private String placePatrolRecordId;
//复查记录Id
@NotBlank(message = "复查记录Id不能为空", groups = {GetData.class})
private String placePatrolReviewRecordId;
//页码
@Min(1)

28
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/11/23 10:45 上午
* @DESC
*/
@Data
public class AppointmentExistRecordResultDTO implements Serializable {
private static final long serialVersionUID = 6651436509788141940L;
/**
* 事项名
*/
private String matterName;
private String matterId;
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java

@ -68,6 +68,7 @@ public class IcPlacePatrolTeamController {
@PostMapping("edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Edit.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
placePatrolTeamService.edit(formDTO);
return new Result();
}
@ -79,7 +80,7 @@ public class IcPlacePatrolTeamController {
@PostMapping("del")
public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Del.class);
placePatrolTeamService.del(formDTO.getTeamId());
placePatrolTeamService.del(tokenDto.getUserId(), formDTO.getTeamId());
return new Result();
}

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

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AppointmentExistRecordResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.entity.IcMatterAppointmentRecordEntity;
import org.apache.ibatis.annotations.Mapper;
@ -43,4 +44,12 @@ public interface IcMatterAppointmentRecordDao extends BaseDao<IcMatterAppointmen
*/
List<AppointmentRecordResultDTO> appointmentRecord(@Param("matterId")String matterId,@Param("date")String date);
/**
* @Description 查询事项是不是存在预约记录
* @param matterIds
* @author zxc
* @date 2021/11/23 3:48 下午
*/
List<AppointmentExistRecordResultDTO> appointmentExistRecord(@Param("matterIds")List<String> matterIds);
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java

@ -51,4 +51,10 @@ public interface IcPlacePatrolTeamStaffDao extends BaseDao<IcPlacePatrolTeamStaf
* @Description 批量查询分队下人员信息
**/
List<IcPlacePatrolTeamStaffDTO> selectByTeamIds(@Param("teamIds") List<String> teamIds);
/**
* @Author sun
* @Description 逻辑删除分队成员子表数据
**/
int upByTeamId(@Param("staffId") String staffId, @Param("teamId") String teamId);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java

@ -49,7 +49,7 @@ public interface IcPlacePatrolTeamService extends BaseService<IcPlacePatrolTeamE
* @Author sun
* @Description 删除九小场所巡查分队人员管理
**/
void del(String teamId);
void del(String staffId, String teamId);
/**
* @Author sun

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java

@ -43,4 +43,10 @@ public interface IcPlacePatrolTeamStaffService extends BaseService<IcPlacePatrol
* @Description 查询分队下人员列表数据
**/
List<IcPlacePatrolTeamStaffDTO> getList(String teamId);
/**
* @Author sun
* @Description 逻辑删除分队成员子表数据
**/
void upByTeamId(String staffId, String teamId);
}

19
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -39,6 +39,7 @@ import com.epmet.dao.IcPartyServiceCenterDao;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.TimeDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AppointmentExistRecordResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
@ -200,6 +201,22 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
});
matterService.insertBatch(matters);
}
// del matter
if (CollectionUtils.isNotEmpty(formDTO.getDelMatterList())){
List<String> delMatterList = formDTO.getDelMatterList();
List<AppointmentExistRecordResultDTO> existRecord = matterAppointmentRecordDao.appointmentExistRecord(delMatterList);
if (CollectionUtils.isNotEmpty(existRecord)){
StringBuffer sb = new StringBuffer();
existRecord.forEach(e -> {
sb.append(e.getMatterName()).append(",");
});
String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE);
EpmetErrorCode.APPOINTMENT_ERROR.setMsg(String.format(EpmetErrorCode.APPOINTMENT_ERROR.getMsg(),copywriter));
throw new RenException(EpmetErrorCode.APPOINTMENT_ERROR.getCode());
}else {
matterService.deleteBatchIds(delMatterList);
}
}
}
/**
@ -242,7 +259,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
records.forEach(r -> {
timeIds.addAll(Arrays.asList(r.getTimeId().split(",")));
});
if (timeIds.retainAll(Arrays.asList(formDTO.getTimeId().split(",")))){
if (timeIds.containsAll(Arrays.asList(formDTO.getTimeId().split(",")))){
throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode());
}
}

21
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java

@ -112,7 +112,7 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl<IcPlacePatro
@Override
public PlacePatrolRecordDetailResultDTO detail(String placePatrolRecordId) {
PlacePatrolRecordDetailResultDTO resultDTO = new PlacePatrolRecordDetailResultDTO();
//1.查询场所基础信息
//1.查询巡查记录信息
GetListPlacePatrolRecordFormDTO dto = new GetListPlacePatrolRecordFormDTO();
dto.setPlacePatrolRecordId(placePatrolRecordId);
List<PlacePatrolRecordDetailResultDTO> result = baseDao.getList(dto);
@ -127,12 +127,27 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl<IcPlacePatro
throw new RenException("获取九小场所基本信息失败......");
}
//3.封装九小场所数据
//3.查询所有分队下人员名单
List<String> teamIds = new ArrayList<>();
teamIds.add(resultDTO.getPlacePatrolTeamId());
List<IcPlacePatrolTeamStaffDTO> teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds);
//4.封装九小场所、分队成员数据
for (OptionResultDTO n : nineList.getData()){
if(resultDTO.getNinePlaceVal().equals(n.getValue())){
resultDTO.setNinePlaceName(n.getLabel());
}
}
//分队成员
StringBuffer inspectorsNames = new StringBuffer("");
for (String str : resultDTO.getInspectors().split(",")) {
teamDTOList.forEach(r -> {
if (str.equals(r.getId())) {
inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName());
}
});
}
resultDTO.setInspectorsNames(inspectorsNames.toString());
return resultDTO;
}
@ -175,7 +190,7 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl<IcPlacePatro
for (String str : dto.getInspectors().split(",")) {
teamDTOList.forEach(r -> {
if (str.equals(r.getId())) {
inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName());
inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName());
}
});
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java

@ -153,7 +153,7 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl<IcPlac
for (String str : resultDTO.getInspectors().split(",")) {
teamDTOList.forEach(r -> {
if (str.equals(r.getId())) {
inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName());
inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName());
}
});
}
@ -189,7 +189,7 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl<IcPlac
for (String str : dto.getInspectors().split(",")) {
teamDTOList.forEach(r -> {
if (str.equals(r.getId())) {
inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName());
inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName());
}
});
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java

@ -119,6 +119,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
entity1.setMobile(m.getMobile());
entityList.add(entity1);
}
//物理删除
placePatrolTeamStaffService.delByTeamId(formDTO.getTeamId());
placePatrolTeamStaffService.insertBatch(entityList);
@ -130,13 +131,13 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void del(String teamId) {
public void del(String staffId, String teamId) {
//1.删除分队主表数据
if (baseDao.deleteById(teamId) < NumConstant.ONE) {
throw new RenException(String.format("删除九小场所下分队信息失败,分队Id->%s", teamId));
}
//2.删除分队成员字表数据
placePatrolTeamStaffService.delByTeamId(teamId);
//2.逻辑删除分队成员字表数据
placePatrolTeamStaffService.upByTeamId(staffId, teamId);
}
/**
@ -174,7 +175,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
StringBuffer gridNames = new StringBuffer("");
for (String str : resultDTO.getGridIds().split(",")) {
gridList.forEach(r -> {
if (str.equals(r.getGridName())) {
if (str.equals(r.getId())) {
gridNames.append("".equals(gridNames) ? r.getGridName() : "," + r.getGridName());
}
});
@ -230,7 +231,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
StringBuffer gridNames = new StringBuffer("");
for (String str : dto.getGridIds().split(",")) {
gridList.forEach(r -> {
if (str.equals(r.getGridName())) {
if (str.equals(r.getId())) {
gridNames.append("".equals(gridNames) ? r.getGridName() : "," + r.getGridName());
}
});

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java

@ -48,9 +48,22 @@ public class IcPlacePatrolTeamStaffServiceImpl extends BaseServiceImpl<IcPlacePa
return baseDao.delByTeamId(teamId);
}
/**
* @Author sun
* @Description 查询分队下人员列表数据
**/
@Override
public List<IcPlacePatrolTeamStaffDTO> getList(String teamId) {
return baseDao.getByTeamId(teamId);
}
/**
* @Author sun
* @Description 逻辑删除分队成员子表数据
**/
@Override
public void upByTeamId(String staffId, String teamId) {
baseDao.upByTeamId(staffId, teamId);
}
}

16
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml

@ -18,4 +18,20 @@
AND ar.APPOINTMENT_DATE = #{date}
AND ar.`STATUS` = 'appointing'
</select>
<!-- 查询事项是不是存在预约记录 -->
<select id="appointmentExistRecord" resultType="com.epmet.dto.result.AppointmentExistRecordResultDTO">
SELECT
cm.MATTER_NAME,
cm.id AS matterId
FROM ic_matter_appointment_record ar
LEFT JOIN ic_party_service_center_matter cm ON (cm.ID = ar.MATTER_ID AND cm.DEL_FLAG = 0)
WHERE ar.DEL_FLAG = 0
AND ar.`STATUS` = 'appointing'
AND ar.MATTER_ID IN
<foreach collection="matterIds" item="m" separator="," open="(" close=")">
#{m}
</foreach>
GROUP BY matterId
</select>
</mapper>

6
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml

@ -8,7 +8,7 @@
a.id placeOrgId,
a.grid_id gridId,
b.grid_name gridName,
a.nine_place_val ninePlaceVale,
a.nine_place_val ninePlaceVal,
a.place_org_name placeOrgName,
a.address address,
a.scale scale,
@ -28,8 +28,8 @@
<if test="gridId != null and gridId.trim() != ''">
AND a.grid_id = #{gridId}
</if>
<if test="ninePlacsVal != null and ninePlacsVal.trim() != ''">
AND a.nine_place_val = #{ninePlacsVal}
<if test="ninePlaceVal != null and ninePlaceVal.trim() != ''">
AND a.nine_place_val = #{ninePlaceVal}
</if>
<if test="placeOrgName != null and placeOrgName.trim() != ''">
AND a.place_org_name LIKE CONCAT('%', #{placeOrgName}, '%')

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml

@ -13,7 +13,7 @@
c.place_org_name placeOrgName,
a.place_patrol_team_id placePatrolTeamId,
d.team_name placePatrolTeamName,
a.nine_placs_val ninePlaceVal,
a.nine_place_val ninePlaceVal,
a.inspectors inspectors,
a.first_time firstTime,
a.first_result firstResult,
@ -28,15 +28,17 @@
LEFT JOIN ic_place_patrol_team d ON a.place_patrol_team_id = d.id
WHERE
a.del_flag = '0'
AND a.customer_id = ''
<if test="placePatrolRecordId != null and placePatrolRecordId.trim() != ''">
AND a.id = #{placePatrolRecordId}
</if>
<if test="customerId != null and customerId.trim() != ''">
AND a.customer_id = #{customerId}
</if>
<if test="gridId != null and gridId.trim() != ''">
AND a.grid_id = #{gridId}
</if>
<if test="ninePlacsVal != null and ninePlacsVal.trim() != ''">
AND a.nine_place_val = #{ninePlacsVal}
<if test="ninePlaceVal != null and ninePlaceVal.trim() != ''">
AND a.nine_place_val = #{ninePlaceVal}
</if>
<if test="placeOrgName != null and placeOrgName.trim() != ''">
AND a.place_org_id IN (select id from ic_place_org where place_org_name like concat('%', #{placeOrgName}, '%'))

6
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml

@ -6,7 +6,7 @@
<resultMap id="teamList" type="com.epmet.dto.result.PlacePatrolTeamDetailResultDTO">
<result property="teamId" column="id"/>
<result property="gridIds" column="grid_ids"/>
<result property="ninePlaceVals" column="nine_placs_vals"/>
<result property="ninePlaceVals" column="nine_place_vals"/>
<result property="teamName" column="team_name"/>
<result property="plan" column="plan"/>
<result property="time" column="time"/>
@ -30,8 +30,8 @@
<if test="gridId != null and gridId.trim() != ''">
AND grid_ids LIKE CONCAT('%', #{gridId}, '%')
</if>
<if test="ninePlacsVal != null and ninePlacsVal.trim() != ''">
AND nine_placs_vals LIKE CONCAT('%', #{ninePlacsVal}, '%')
<if test="ninePlaceVal != null and ninePlaceVal.trim() != ''">
AND nine_place_vals LIKE CONCAT('%', #{ninePlaceVal}, '%')
</if>
<if test="personInCharge != null and personInCharge.trim() != ''">
AND person_in_charge LIKE CONCAT('%', #{personInCharge}, '%')

11
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml

@ -36,4 +36,15 @@
place_patrol_team_id ASC
</select>
<update id="upByTeamId">
UPDATE
ic_place_patrol_team_staff
SET
del_flag = '1',
updated_by = #{staffId},
updated_time = NOW()
WHERE
place_patrol_team_id = #{teamId}
</update>
</mapper>

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

@ -17,15 +17,10 @@
package com.epmet.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.enums.WriteDirectionEnum;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.fill.FillWrapper;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
@ -40,12 +35,11 @@ import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
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.ExcelUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.IcResiUserConstant;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.*;
@ -62,20 +56,20 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@ -234,155 +228,6 @@ public class IcResiUserController {
return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO));
}
/**
* desc :备用 easypoi
*
* @param customerId
* @param pageFormDTO
* @param response
* @throws Exception
*/
@RequestMapping(value = "/exportExcel2")
public void exportExcel(@RequestHeader String customerId, @LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
//tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02");
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
String staffOrgPath = null;
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 = getResiFormAddItems(pageFormDTO.getCustomerId());
Map<String, Map<String, FormItemResult>> otherSheetItems = buildItemMap(resiFormItems);
Map<String, Map<String, Object>> resiMainList = null;//icResiUserService.getDataForExport(otherSheetItems.get(IcResiUserConstant.IC_RESI_USER), IcResiUserConstant.IC_RESI_USER, pageFormDTO, 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";
TemplateExportParams params = new TemplateExportParams(templatePath, true);
Map<Integer, Map<String, Object>> sheetMap = new HashMap<>();
Map<String, Object> mapData = new HashMap<>();
mapData.put("list", resiMainList.values());
System.out.println("===resiMainList===" + " " + JSON.toJSONString(resiMainList.values()));
sheetMap.put(0, mapData);
AtomicInteger n = new AtomicInteger();
for (FormItemResult item : resiFormItems.getItemList()) {
//如果 childGroup是空 或者是主表 则跳过 继续下次循环
if (item.getChildGroup() == null || IcResiUserConstant.IC_RESI_USER.equals(item.getChildGroup().getTableName())) {
continue;
}
String tableName = item.getChildGroup().getTableName();
Map<String, FormItemResult> itemMap1 = otherSheetItems.get(tableName);
Map<String, Map<String, Object>> resiChildMap = null;//icResiUserService.getDataForExport(itemMap1, tableName, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath);
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
Map<String, Object> mapData2 = new HashMap<>();
mapData2.put("list", resiChildMap.values());
System.out.println("===resiChildMap===" + tableName + " " + JSON.toJSONString(resiChildMap.values()));
sheetMap.put(n.incrementAndGet(), mapData2);
}
Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params);
workbook.setActiveSheet(0);
workbook.write(getOutputStream("居民基本信息.xls", response));
}
@RequestMapping(value = "/exportExcel3")
public void exportExcelByEasyExcel3(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
//tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02");
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
String staffOrgPath = null;
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 = getResiFormAddItems(pageFormDTO.getCustomerId());
Map<String, Map<String, FormItemResult>> otherSheetItems = buildItemMap(resiFormItems);
/*List<FormItemResult> resiFormAllItems = getResiFormAllItems(pageFormDTO.getCustomerId());
resiFormAllItems.stream().collect(Collectors.groupingBy(e ->e.get));*/
//获取模版文件
File file = getExportTemplateFile(customerId);
ExcelWriter excelWriter = EasyExcel.write(getOutputStream("居民基本信息.xlsx", response)).withTemplate(file).build();
FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build();
IcResiUserTableEnum tableEnums = IcResiUserTableEnum.getObjectByTableName(IcResiUserConstant.IC_RESI_USER);
WriteSheet fistSheet = EasyExcel.writerSheet(tableEnums.getSheetNo()).build();
pageFormDTO.setPageSize(NumConstant.FIVE_HUNDRED);
pageFormDTO.setPageNo(NumConstant.ONE);
//子表是否停止查询
Set<String> stopSearchSet = new HashSet<>();
Map<String, WriteSheet> childTableWriteSheetMap = new HashMap<>();
Map<String, Map<String, Object>> resiMainTableMap = null;
do {
resiMainTableMap = null;//icResiUserService.getDataForExport(otherSheetItems.get(IcResiUserConstant.IC_RESI_USER), IcResiUserConstant.IC_RESI_USER, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath);
//如果 返回的条数小于每页显示的数 则退出查询
if (resiMainTableMap.keySet().size() < pageFormDTO.getPageSize()) {
stopSearchSet.add(IcResiUserConstant.IC_RESI_USER);
}
//写入数据
excelWriter.fill(new FillWrapper("t1", resiMainTableMap.values()), fillConfig, fistSheet);
pageFormDTO.setPageNo(pageFormDTO.getPageNo() + 1);
//重置数据
resiMainTableMap.clear();
} while (!stopSearchSet.contains(IcResiUserConstant.IC_RESI_USER));
//子表数据写入
AtomicInteger n = new AtomicInteger();
for (FormItemResult item : resiFormItems.getItemList()) {
//如果 childGroup是空 或者是主表 则跳过 继续下次循环
if (item.getChildGroup() == null || IcResiUserConstant.IC_RESI_USER.equals(item.getChildGroup().getTableName())) {
continue;
}
String tableName = item.getChildGroup().getTableName();
pageFormDTO.setPageNo(NumConstant.ONE);
//循环一次 写入每个sheet
do {
//如果包含则说明子表的数据 已经查询完毕 无需再继续查询了
boolean contains = stopSearchSet.contains(tableName);
if (contains) {
continue;
}
Map<String, FormItemResult> itemMap1 = otherSheetItems.get(tableName);
Map<String, Map<String, Object>> resiChildMap = null;//icResiUserService.getDataForExport(itemMap1, tableName, pageFormDTO, staffInfoCacheResult.getAgencyId(), staffOrgPath);
//如果 返回的条数小于每页显示的数 则退出查询
if (resiChildMap.keySet().size() < pageFormDTO.getPageSize()) {
stopSearchSet.add(tableName);
}
tableEnums = IcResiUserTableEnum.getObjectByTableName(tableName);
if (tableEnums == null) {
continue;
}
//构建新的sheet
WriteSheet childWriteSheet = childTableWriteSheetMap.get(tableName);
if (childWriteSheet == null) {
childWriteSheet = EasyExcel.writerSheet(tableEnums.getSheetNo()).build();
}
childTableWriteSheetMap.put(tableName, childWriteSheet);
//写入数据
excelWriter.fill(new FillWrapper("t" + (tableEnums.getSheetNo() + NumConstant.ONE), resiChildMap.values()), childWriteSheet);
pageFormDTO.setPageNo(pageFormDTO.getPageNo() + NumConstant.ONE);
//重置数据
resiChildMap.clear();
} while (!stopSearchSet.contains(tableName));
}
excelWriter.finish();
}
/**
* desc: 导出居民信息
*
@ -412,7 +257,7 @@ public class IcResiUserController {
File file = getExportTemplateFile(customerId);
ExcelWriter excelWriter = null;
try {
excelWriter = EasyExcel.write(getOutputStream("居民基本信息.xlsx", response)).withTemplate(file).build();
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("居民基本信息.xlsx", response)).withTemplate(file).build();
//子表是否停止查询
Set<String> stopSearchSet = new HashSet<>();
@ -519,66 +364,6 @@ public class IcResiUserController {
return file;
}
@NotNull
private Map<String, Map<String, FormItemResult>> buildItemMap(CustomerFormResultDTO resiFormItems) {
Map<String, Map<String, FormItemResult>> otherSheetItems = new HashMap<>();
//主表的
for (FormItemResult formItemResult : resiFormItems.getItemList()) {
if (StringUtils.isBlank(formItemResult.getColumnName())) {
continue;
}
Map<String, FormItemResult> itemMap = otherSheetItems.getOrDefault(formItemResult.getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(formItemResult.getTableName(), itemMap);
if (formItemResult.getItemType().equals("checkbox") || formItemResult.getItemType().equals("select") || formItemResult.getItemType().equals("radio")) {
itemMap.put(formItemResult.getColumnName().concat(formItemResult.getColumnNum() == 0 ? "" : formItemResult.getColumnNum().toString()), formItemResult);
}
if (formItemResult.getChildGroup() != null) {
itemMap = otherSheetItems.getOrDefault(formItemResult.getChildGroup().getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(formItemResult.getChildGroup().getTableName(), itemMap);
for (FormItemResult2 item2 : formItemResult.getChildGroup().getItemList()) {
if (StringUtils.isBlank(item2.getColumnName())) {
continue;
}
if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) {
itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItemResult.class));
}
}
}
}
//其他sheet
for (FormGroupDTO groupItem : resiFormItems.getGroupList()) {
if (groupItem.getItemList() == null) {
continue;
}
Map<String, FormItemResult> itemMap = otherSheetItems.getOrDefault(groupItem.getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(groupItem.getTableName(), itemMap);
for (FormItemResult2 formItemResult2 : groupItem.getItemList()) {
if (StringUtils.isBlank(formItemResult2.getColumnName())) {
continue;
}
if ("checkbox".equals(formItemResult2.getItemType()) || "select".equals(formItemResult2.getItemType()) || "radio".equals(formItemResult2.getItemType())) {
itemMap.put(formItemResult2.getColumnName().concat(formItemResult2.getColumnNum() == 0 ? "" : formItemResult2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItemResult2, FormItemResult.class));
}
}
}
return otherSheetItems;
}
private static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception {
fileName = URLEncoder.encode(fileName, "UTF-8");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf8");
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
response.addHeader("Access-Control-Expose-Headers", "Content-disposition");
return response.getOutputStream();
}
/**
* excel导入居民基本信息
*

5
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -670,13 +670,16 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
ColumnWrapper columnWrapper = new ColumnWrapper();
String columnName = item.getColumnName();
Integer columnNum = item.getColumnNum();
// 填充options
columnWrapper.setItemType(item.getItemType());
columnWrapper.setItemId(item.getItemId());
String groupLabel = item.getGroupLabel();
String combinedLabel = StringUtils.isBlank(groupLabel) ? item.getLabel() : groupLabel.concat(":").concat(item.getLabel());
columnWrapper.setCombinedLabel(combinedLabel);
columnWrapper.setColumnName(item.getColumnName());
columnWrapper.setColumnName((columnNum == null || columnNum == 0) ? columnName : columnName + columnNum);
columnWrapper.setColIndex(entry.getValue());
columnWrapper.setRequired(item.getRequired());

Loading…
Cancel
Save