From 9cf45385b6d95368bee2c949c09e195e675aa995 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 May 2023 14:26:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8A=9E=E4=BA=8B=E5=A4=A7=E5=8E=85?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AFend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LingshanOfficeHallServiceRecordDTO.java | 8 +++- ...shanOfficeHallServiceRecordController.java | 11 ++--- ...ingshanOfficeHallServiceRecordService.java | 2 +- ...hanOfficeHallServiceRecordServiceImpl.java | 45 ++++++++++++++++--- 4 files changed, 52 insertions(+), 14 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java index f95bd871ec..208ea845e0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -116,7 +117,9 @@ public class LingshanOfficeHallServiceRecordDTO implements Serializable { /** * 申请日期 */ - @NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @NotNull(message = "申请日期1111不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) private Date applicantTime; /** @@ -136,7 +139,8 @@ public class LingshanOfficeHallServiceRecordDTO implements Serializable { /** * 办结日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date closeTime; /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java index 8ce453b22d..feda2f66a0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.LingshanOfficeHallServiceRecordDTO; import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO; +import com.epmet.excel.LingshanOfficeHallServiceRecordExportExcel; import com.epmet.service.LingshanOfficeHallServiceRecordService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -89,8 +90,7 @@ public class LingshanOfficeHallServiceRecordController { dto.setCustomerId(tokenDto.getCustomerId()); dto.setSourceType("gov_pc"); ValidatorUtils.validateEntity(dto, LingshanOfficeHallServiceRecordDTO.AddShowGroup.class, LingshanOfficeHallServiceRecordDTO.AddInternalGroup.class); - lingshanOfficeHallServiceRecordService.save(dto); - return new Result(); + return new Result().ok(lingshanOfficeHallServiceRecordService.save(dto)); } /** @@ -127,6 +127,7 @@ public class LingshanOfficeHallServiceRecordController { @PostMapping("export") public void exportEnterprise(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordPageFormDTO formDTO, HttpServletResponse response) throws IOException { formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); ExcelWriter excelWriter = null; formDTO.setPageNo(NumConstant.ONE); formDTO.setPageSize(NumConstant.TEN_THOUSAND); @@ -140,16 +141,16 @@ public class LingshanOfficeHallServiceRecordController { contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); FreezeAndFilter writeHandler = new FreezeAndFilter(); - excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), LingshanOfficeHallServiceRecordDTO.class) + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), LingshanOfficeHallServiceRecordExportExcel.class) .registerWriteHandler(horizontalCellStyleStrategy) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .registerWriteHandler(writeHandler).build(); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); PageData data = null; - List list = null; + List list = null; do { data = lingshanOfficeHallServiceRecordService.page(formDTO); - list = ConvertUtils.sourceToTarget(data.getList(), LingshanOfficeHallServiceRecordDTO.class); + list = ConvertUtils.sourceToTarget(data.getList(), LingshanOfficeHallServiceRecordExportExcel.class); formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); excelWriter.write(list, writeSheet); } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java index d2f2f96834..2deff3860d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java @@ -44,7 +44,7 @@ public interface LingshanOfficeHallServiceRecordService extends BaseService> categoryRes = adminOpenFeignClient.dictMap(DictTypeEnum.LINGSHAN_OFFICE_HALL_SERVICE_RECORD.getCode()); + resultDto.setCategoryName(MapUtils.isNotEmpty(categoryRes.getData()) ? categoryRes.getData().get(resultDto.getCategoryCode()) : StrConstant.EPMETY_STR); + //未办结:0;已办结:1 + if(NumConstant.ZERO_STR.equals(resultDto.getStatus())){ + resultDto.setStatusName("未办结"); + }else if(NumConstant.ONE_STR.equals(resultDto.getStatus())){ + resultDto.setStatusName("已办结"); + } + if(null!=resultDto.getSatisfication()){ + // 满意度评价。-1不满意,0基本满意,1非常满意 + switch(resultDto.getSatisfication()) + { + case -1: + resultDto.setSatisficationName("不满意"); + break; + case 0: + resultDto.setSatisficationName("基本满意"); + break; + case 1: + resultDto.setSatisficationName("非常满意"); + break; + default: + resultDto.setSatisficationName(StrConstant.EPMETY_STR); + break; + } + } + return resultDto; } @Override @Transactional(rollbackFor = Exception.class) - public void save(LingshanOfficeHallServiceRecordDTO dto) { + public String save(LingshanOfficeHallServiceRecordDTO dto) { LingshanOfficeHallServiceRecordEntity entity = ConvertUtils.sourceToTarget(dto, LingshanOfficeHallServiceRecordEntity.class); entity.setStatus(NumConstant.ZERO_STR); if (StringUtils.isNotBlank(dto.getApplicantOrgId())) { @@ -95,7 +127,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< // 本条数据属于网格 entity.setOrgId(gridInfoCache.getId()); - entity.setOrgType(dto.getOrgType()); + entity.setOrgType(dto.getApplicantOrgType()); entity.setOrgIdPath(entity.getApplicantOrgIdPath()); } else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) { AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId()); @@ -103,7 +135,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< entity.setApplicantOrgName(agencyInfoCache.getOrganizationName()); // 本条数据属于组织 entity.setOrgId(agencyInfoCache.getId()); - entity.setOrgType(dto.getOrgType()); + entity.setOrgType(dto.getApplicantOrgType()); entity.setOrgIdPath(entity.getApplicantOrgIdPath()); } } else { @@ -113,6 +145,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(entity.getOrgId(), entity.getOrgType())); } insert(entity); + return entity.getId(); } @Override @@ -126,7 +159,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< entity.setApplicantOrgName(gridInfoCache.getGridNamePath()); // 本条数据属于网格 entity.setOrgId(gridInfoCache.getId()); - entity.setOrgType(dto.getOrgType()); + entity.setOrgType(dto.getApplicantOrgType()); entity.setOrgIdPath(entity.getApplicantOrgIdPath()); } else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) { AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId()); @@ -134,7 +167,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< entity.setApplicantOrgName(agencyInfoCache.getOrganizationName()); // 本条数据属于组织 entity.setOrgId(agencyInfoCache.getId()); - entity.setOrgType(dto.getOrgType()); + entity.setOrgType(dto.getApplicantOrgType()); entity.setOrgIdPath(entity.getApplicantOrgIdPath()); } } else { From a4bae4cc59b3480ca662363a48e2cbb19581f65d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 May 2023 14:29:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89111?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java index 208ea845e0..8e43d3739b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java @@ -119,7 +119,7 @@ public class LingshanOfficeHallServiceRecordDTO implements Serializable { */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") - @NotNull(message = "申请日期1111不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) private Date applicantTime; /** From ef533b8c3708a36e16ea8a638074ff1fa9ae8ac4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 May 2023 14:39:38 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E3=80=81=E7=BB=93=E6=9D=9F=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E3=80=81=E5=8A=9E=E7=BB=93=E5=BC=80=E5=A7=8B=E3=80=81=E5=8A=9E?= =?UTF-8?q?=E7=BB=93=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ingshanOfficeHallServiceRecordPageFormDTO.java | 15 +++++++++++++-- .../dao/LingshanOfficeHallServiceRecordDao.java | 6 ++++-- ...ingshanOfficeHallServiceRecordServiceImpl.java | 7 ++++++- .../mapper/LingshanOfficeHallServiceRecordDao.xml | 14 ++++++++++---- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java index 9f6102afff..2edc3a6b2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java @@ -24,16 +24,27 @@ public class LingshanOfficeHallServiceRecordPageFormDTO extends PageFormDTO { * 满意度评价。-1不满意,0基本满意,1非常满意 */ private Integer satisfication; + + /** + * 申请开始日期 + */ + private String applicantStartDate; + + /** + * 申请结束日期 + */ + private String applicantEndDate; + /** * 办结日期 */ // @DateTimeFormat(pattern = "yyyy-MM-dd") // @JsonFormat(pattern = "yyyy-MM-dd") - private String startDate; + private String closeStartDate; // @DateTimeFormat(pattern = "yyyy-MM-dd") // @JsonFormat(pattern = "yyyy-MM-dd") - private String endDate; + private String closeEndDate; /** * 未办结:0;已办结:1 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java index 51cc8bc63b..d19c69460d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java @@ -22,7 +22,9 @@ public interface LingshanOfficeHallServiceRecordDao extends BaseDao resultList = baseDao.pageList(formDTO.getCustomerId(), orgIdPath, formDTO.getCategoryCode(), formDTO.getContent(), formDTO.getSatisfication(), formDTO.getStartDate(), formDTO.getEndDate(), formDTO.getStatus()); + List resultList = baseDao.pageList(formDTO.getCustomerId(), orgIdPath, + formDTO.getCategoryCode(), formDTO.getContent(), + formDTO.getSatisfication(), + formDTO.getApplicantStartDate(), formDTO.getApplicantEndDate(), + formDTO.getCloseStartDate(), formDTO.getCloseEndDate(), + formDTO.getStatus()); if (CollectionUtils.isNotEmpty(resultList)) { Result> categoryRes = adminOpenFeignClient.dictMap(DictTypeEnum.LINGSHAN_OFFICE_HALL_SERVICE_RECORD.getCode()); resultList.forEach(dto -> { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml index 2b09eaf521..47beac5b32 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml @@ -31,11 +31,17 @@ and r.STATUS = #{status} - - AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') >= #{startDate} + + AND DATE_FORMAT(r.APPLICANT_TIME,'%Y-%m-%d') >= #{applicantStartDate} - - AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') #{endDate} + + AND DATE_FORMAT(r.APPLICANT_TIME,'%Y-%m-%d') #{applicantEndDate} + + + AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') >= #{closeStartDate} + + + AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') #{closeEndDate} ORDER BY R.CREATED_TIME DESC