wxz 2 years ago
parent
commit
ff2f8d2e88
  1. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java
  2. 15
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java
  3. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java
  4. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java
  5. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java
  6. 52
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java
  7. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml

6
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 com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ -116,6 +117,8 @@ public class LingshanOfficeHallServiceRecordDTO implements Serializable {
/** /**
* 申请日期 * 申请日期
*/ */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) @NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
private Date applicantTime; 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; private Date closeTime;
/** /**

15
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非常满意 * 满意度评价-1不满意0基本满意1非常满意
*/ */
private Integer satisfication; private Integer satisfication;
/**
* 申请开始日期
*/
private String applicantStartDate;
/**
* 申请结束日期
*/
private String applicantEndDate;
/** /**
* 办结日期 * 办结日期
*/ */
// @DateTimeFormat(pattern = "yyyy-MM-dd") // @DateTimeFormat(pattern = "yyyy-MM-dd")
// @JsonFormat(pattern = "yyyy-MM-dd") // @JsonFormat(pattern = "yyyy-MM-dd")
private String startDate; private String closeStartDate;
// @DateTimeFormat(pattern = "yyyy-MM-dd") // @DateTimeFormat(pattern = "yyyy-MM-dd")
// @JsonFormat(pattern = "yyyy-MM-dd") // @JsonFormat(pattern = "yyyy-MM-dd")
private String endDate; private String closeEndDate;
/** /**
* 未办结0已办结1 * 未办结0已办结1

11
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.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.LingshanOfficeHallServiceRecordDTO; import com.epmet.dto.LingshanOfficeHallServiceRecordDTO;
import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO; import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO;
import com.epmet.excel.LingshanOfficeHallServiceRecordExportExcel;
import com.epmet.service.LingshanOfficeHallServiceRecordService; import com.epmet.service.LingshanOfficeHallServiceRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -89,8 +90,7 @@ public class LingshanOfficeHallServiceRecordController {
dto.setCustomerId(tokenDto.getCustomerId()); dto.setCustomerId(tokenDto.getCustomerId());
dto.setSourceType("gov_pc"); dto.setSourceType("gov_pc");
ValidatorUtils.validateEntity(dto, LingshanOfficeHallServiceRecordDTO.AddShowGroup.class, LingshanOfficeHallServiceRecordDTO.AddInternalGroup.class); ValidatorUtils.validateEntity(dto, LingshanOfficeHallServiceRecordDTO.AddShowGroup.class, LingshanOfficeHallServiceRecordDTO.AddInternalGroup.class);
lingshanOfficeHallServiceRecordService.save(dto); return new Result().ok(lingshanOfficeHallServiceRecordService.save(dto));
return new Result();
} }
/** /**
@ -127,6 +127,7 @@ public class LingshanOfficeHallServiceRecordController {
@PostMapping("export") @PostMapping("export")
public void exportEnterprise(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordPageFormDTO formDTO, HttpServletResponse response) throws IOException { public void exportEnterprise(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordPageFormDTO formDTO, HttpServletResponse response) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
ExcelWriter excelWriter = null; ExcelWriter excelWriter = null;
formDTO.setPageNo(NumConstant.ONE); formDTO.setPageNo(NumConstant.ONE);
formDTO.setPageSize(NumConstant.TEN_THOUSAND); formDTO.setPageSize(NumConstant.TEN_THOUSAND);
@ -140,16 +141,16 @@ public class LingshanOfficeHallServiceRecordController {
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
FreezeAndFilter writeHandler = new FreezeAndFilter(); 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(horizontalCellStyleStrategy)
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.registerWriteHandler(writeHandler).build(); .registerWriteHandler(writeHandler).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<LingshanOfficeHallServiceRecordDTO> data = null; PageData<LingshanOfficeHallServiceRecordDTO> data = null;
List<LingshanOfficeHallServiceRecordDTO> list = null; List<LingshanOfficeHallServiceRecordExportExcel> list = null;
do { do {
data = lingshanOfficeHallServiceRecordService.page(formDTO); data = lingshanOfficeHallServiceRecordService.page(formDTO);
list = ConvertUtils.sourceToTarget(data.getList(), LingshanOfficeHallServiceRecordDTO.class); list = ConvertUtils.sourceToTarget(data.getList(), LingshanOfficeHallServiceRecordExportExcel.class);
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE);
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
} while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize());

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java

@ -22,7 +22,9 @@ public interface LingshanOfficeHallServiceRecordDao extends BaseDao<LingshanOffi
@Param("categoryCode") String categoryCode, @Param("categoryCode") String categoryCode,
@Param("content") String content, @Param("content") String content,
@Param("satisfication") Integer satisfication, @Param("satisfication") Integer satisfication,
@Param("startDate") String startDate, @Param("applicantStartDate") String applicantStartDate,
@Param("endDate") String endDate, @Param("applicantEndDate") String applicantEndDate,
@Param("closeStartDate") String closeStartDate,
@Param("closeEndDate") String closeEndDate,
@Param("status") String status); @Param("status") String status);
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java

@ -44,7 +44,7 @@ public interface LingshanOfficeHallServiceRecordService extends BaseService<Ling
* @author generator * @author generator
* @date 2023-05-15 * @date 2023-05-15
*/ */
void save(LingshanOfficeHallServiceRecordDTO dto); String save(LingshanOfficeHallServiceRecordDTO dto);
/** /**
* 默认更新 * 默认更新

52
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java

@ -6,6 +6,8 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
@ -59,7 +61,12 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl<
} }
String orgIdPath = queryOrgIdPath(formDTO.getCustomerId(), formDTO.getStaffId(), formDTO.getOrgId(), formDTO.getOrgType()); String orgIdPath = queryOrgIdPath(formDTO.getCustomerId(), formDTO.getStaffId(), formDTO.getOrgId(), formDTO.getOrgType());
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<LingshanOfficeHallServiceRecordDTO> resultList = baseDao.pageList(formDTO.getCustomerId(), orgIdPath, formDTO.getCategoryCode(), formDTO.getContent(), formDTO.getSatisfication(), formDTO.getStartDate(), formDTO.getEndDate(), formDTO.getStatus()); List<LingshanOfficeHallServiceRecordDTO> 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)) { if (CollectionUtils.isNotEmpty(resultList)) {
Result<Map<String, String>> categoryRes = adminOpenFeignClient.dictMap(DictTypeEnum.LINGSHAN_OFFICE_HALL_SERVICE_RECORD.getCode()); Result<Map<String, String>> categoryRes = adminOpenFeignClient.dictMap(DictTypeEnum.LINGSHAN_OFFICE_HALL_SERVICE_RECORD.getCode());
resultList.forEach(dto -> { resultList.forEach(dto -> {
@ -79,12 +86,42 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl<
@Override @Override
public LingshanOfficeHallServiceRecordDTO get(String id) { public LingshanOfficeHallServiceRecordDTO get(String id) {
LingshanOfficeHallServiceRecordEntity entity = baseDao.selectById(id); LingshanOfficeHallServiceRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, LingshanOfficeHallServiceRecordDTO.class); if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"办事大厅服务记录不存在","服务记录不存在");
}
LingshanOfficeHallServiceRecordDTO resultDto=ConvertUtils.sourceToTarget(entity, LingshanOfficeHallServiceRecordDTO.class);
Result<Map<String, String>> 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 @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(LingshanOfficeHallServiceRecordDTO dto) { public String save(LingshanOfficeHallServiceRecordDTO dto) {
LingshanOfficeHallServiceRecordEntity entity = ConvertUtils.sourceToTarget(dto, LingshanOfficeHallServiceRecordEntity.class); LingshanOfficeHallServiceRecordEntity entity = ConvertUtils.sourceToTarget(dto, LingshanOfficeHallServiceRecordEntity.class);
entity.setStatus(NumConstant.ZERO_STR); entity.setStatus(NumConstant.ZERO_STR);
if (StringUtils.isNotBlank(dto.getApplicantOrgId())) { if (StringUtils.isNotBlank(dto.getApplicantOrgId())) {
@ -95,7 +132,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl<
// 本条数据属于网格 // 本条数据属于网格
entity.setOrgId(gridInfoCache.getId()); entity.setOrgId(gridInfoCache.getId());
entity.setOrgType(dto.getOrgType()); entity.setOrgType(dto.getApplicantOrgType());
entity.setOrgIdPath(entity.getApplicantOrgIdPath()); entity.setOrgIdPath(entity.getApplicantOrgIdPath());
} else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) { } else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId()); AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId());
@ -103,7 +140,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl<
entity.setApplicantOrgName(agencyInfoCache.getOrganizationName()); entity.setApplicantOrgName(agencyInfoCache.getOrganizationName());
// 本条数据属于组织 // 本条数据属于组织
entity.setOrgId(agencyInfoCache.getId()); entity.setOrgId(agencyInfoCache.getId());
entity.setOrgType(dto.getOrgType()); entity.setOrgType(dto.getApplicantOrgType());
entity.setOrgIdPath(entity.getApplicantOrgIdPath()); entity.setOrgIdPath(entity.getApplicantOrgIdPath());
} }
} else { } else {
@ -113,6 +150,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl<
entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(entity.getOrgId(), entity.getOrgType())); entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(entity.getOrgId(), entity.getOrgType()));
} }
insert(entity); insert(entity);
return entity.getId();
} }
@Override @Override
@ -126,7 +164,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl<
entity.setApplicantOrgName(gridInfoCache.getGridNamePath()); entity.setApplicantOrgName(gridInfoCache.getGridNamePath());
// 本条数据属于网格 // 本条数据属于网格
entity.setOrgId(gridInfoCache.getId()); entity.setOrgId(gridInfoCache.getId());
entity.setOrgType(dto.getOrgType()); entity.setOrgType(dto.getApplicantOrgType());
entity.setOrgIdPath(entity.getApplicantOrgIdPath()); entity.setOrgIdPath(entity.getApplicantOrgIdPath());
} else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) { } else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId()); AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId());
@ -134,7 +172,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl<
entity.setApplicantOrgName(agencyInfoCache.getOrganizationName()); entity.setApplicantOrgName(agencyInfoCache.getOrganizationName());
// 本条数据属于组织 // 本条数据属于组织
entity.setOrgId(agencyInfoCache.getId()); entity.setOrgId(agencyInfoCache.getId());
entity.setOrgType(dto.getOrgType()); entity.setOrgType(dto.getApplicantOrgType());
entity.setOrgIdPath(entity.getApplicantOrgIdPath()); entity.setOrgIdPath(entity.getApplicantOrgIdPath());
} }
} else { } else {

14
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml

@ -31,11 +31,17 @@
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and r.STATUS = #{status} and r.STATUS = #{status}
</if> </if>
<if test='startDate != null and startDate != "" '> <if test='applicantStartDate != null and applicantStartDate != "" '>
AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') >= #{startDate} AND DATE_FORMAT(r.APPLICANT_TIME,'%Y-%m-%d') >= #{applicantStartDate}
</if> </if>
<if test='endDate != null and endDate != "" '> <if test='applicantEndDate != null and applicantEndDate != "" '>
AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{endDate} AND DATE_FORMAT(r.APPLICANT_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{applicantEndDate}
</if>
<if test='closeStartDate != null and closeStartDate != "" '>
AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') >= #{closeStartDate}
</if>
<if test='closeEndDate != null and closeEndDate != "" '>
AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{closeEndDate}
</if> </if>
ORDER BY R.CREATED_TIME DESC ORDER BY R.CREATED_TIME DESC
</select> </select>

Loading…
Cancel
Save