Browse Source

两票导出取消一个月限制

zhongwei
ty 10 months ago
parent
commit
44c91e1a5b
  1. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
  2. 60
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  3. 16
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java
  4. 38
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java

@ -106,12 +106,12 @@ public class StandardTicketInfoController extends BladeController {
= "操作票导出") = "操作票导出")
public void exportStandardTicket(HttpServletResponse response,@RequestBody StandardTicketInfoDto req) { public void exportStandardTicket(HttpServletResponse response,@RequestBody StandardTicketInfoDto req) {
try { try {
if(ObjectUtils.isEmpty(req.getStartTime())&&ObjectUtils.isEmpty(req.getEndTime())){ // if(ObjectUtils.isEmpty(req.getStartTime())&&ObjectUtils.isEmpty(req.getEndTime())){
LocalDateTime date = LocalDateTime.now(); // LocalDateTime date = LocalDateTime.now();
LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0); // LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0);
req.setStartTime(firstDay); // req.setStartTime(firstDay);
req.setEndTime(date); // req.setEndTime(date);
} // }
response.setContentType("application/vnd.ms-excel"); response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系

60
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java

@ -840,30 +840,42 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
exportVO.setTicketType(Optional.ofNullable(DictCache.getValue(TicketConstants.TICKET_TYPE, standardTicketInfoEntity.getTicketType())).orElse(null)); exportVO.setTicketType(Optional.ofNullable(DictCache.getValue(TicketConstants.TICKET_TYPE, standardTicketInfoEntity.getTicketType())).orElse(null));
exportVO.setCode(Optional.ofNullable(standardTicketInfoEntity.getCode()).orElse(null)); exportVO.setCode(Optional.ofNullable(standardTicketInfoEntity.getCode()).orElse(null));
exportVO.setTitle(Optional.ofNullable(standardTicketInfoEntity.getTitle()).orElse(null)); exportVO.setTitle(Optional.ofNullable(standardTicketInfoEntity.getTitle()).orElse(null));
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getIssueOrderPerson())) { if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getIssueOrderPersonName())) {
User issueOrderPerson = UserCache.getUser(standardTicketInfoEntity.getIssueOrderPerson()); exportVO.setIssueOrderPerson(standardTicketInfoEntity.getIssueOrderPersonName());
if (ObjectUtil.isNotEmpty(issueOrderPerson)) { }
exportVO.setIssueOrderPerson(issueOrderPerson.getName()); if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getAccessOrderPersonName())) {
} exportVO.setAccessOrderPerson(standardTicketInfoEntity.getAccessOrderPersonName());
} }
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getAccessOrderPerson())) { // if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getIssueOrderPerson())) {
User accessOrderPerson = UserCache.getUser(standardTicketInfoEntity.getAccessOrderPerson()); // User issueOrderPerson = UserCache.getUser(standardTicketInfoEntity.getIssueOrderPerson());
if (ObjectUtil.isNotEmpty(accessOrderPerson)) { // if (ObjectUtil.isNotEmpty(issueOrderPerson)) {
exportVO.setAccessOrderPerson(accessOrderPerson.getName()); // exportVO.setIssueOrderPerson(issueOrderPerson.getName());
} // }
} // }
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getGuardian())) { // if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getAccessOrderPerson())) {
User guardian = UserCache.getUser(standardTicketInfoEntity.getGuardian()); // User accessOrderPerson = UserCache.getUser(standardTicketInfoEntity.getAccessOrderPerson());
if (ObjectUtil.isNotEmpty(guardian)) { // if (ObjectUtil.isNotEmpty(accessOrderPerson)) {
exportVO.setGuardian(guardian.getName()); // exportVO.setAccessOrderPerson(accessOrderPerson.getName());
} // }
} // }
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getPrincipal())) { // if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getGuardian())) {
User principal = UserCache.getUser(standardTicketInfoEntity.getPrincipal()); // User guardian = UserCache.getUser(standardTicketInfoEntity.getGuardian());
if (ObjectUtil.isNotEmpty(principal)) { // if (ObjectUtil.isNotEmpty(guardian)) {
exportVO.setPrincipal(principal.getName()); // exportVO.setGuardian(guardian.getName());
} // }
} // }
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getGuardianName())) {
exportVO.setGuardian(standardTicketInfoEntity.getGuardianName());
}
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getPrincipalName())) {
exportVO.setPrincipal(standardTicketInfoEntity.getPrincipalName());
}
// if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getPrincipal())) {
// User principal = UserCache.getUser(standardTicketInfoEntity.getPrincipal());
// if (ObjectUtil.isNotEmpty(principal)) {
// exportVO.setPrincipal(principal.getName());
// }
// }
exportVO.setStartTime(Optional.ofNullable(DateUtil.format(standardTicketInfoEntity.getStartTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse("")); exportVO.setStartTime(Optional.ofNullable(DateUtil.format(standardTicketInfoEntity.getStartTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse(""));
exportVO.setEndTime(Optional.ofNullable(DateUtil.format(standardTicketInfoEntity.getEndTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse("")); exportVO.setEndTime(Optional.ofNullable(DateUtil.format(standardTicketInfoEntity.getEndTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse(""));
exportVO.setIsEvaluate("未评价"); exportVO.setIsEvaluate("未评价");

16
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java

@ -138,14 +138,14 @@ public class WorkTicketInfoController {
= "工作票导出") = "工作票导出")
public void exportWorkTicket(HttpServletResponse response,@RequestBody WorkTicketInfoDto req) { public void exportWorkTicket(HttpServletResponse response,@RequestBody WorkTicketInfoDto req) {
try { try {
if(ObjectUtils.isEmpty(req.getStartTime())&&ObjectUtils.isEmpty(req.getEndTime())){ // if(ObjectUtils.isEmpty(req.getStartTime())&&ObjectUtils.isEmpty(req.getEndTime())){
LocalDateTime date = LocalDateTime.now(); // LocalDateTime date = LocalDateTime.now();
String nowDate = date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); // String nowDate = date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0); // LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0);
String firstDate = firstDay.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); // String firstDate = firstDay.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
req.setStartTime(firstDate); // req.setStartTime(firstDate);
req.setEndTime(nowDate); // req.setEndTime(nowDate);
} // }
response.setContentType("application/vnd.ms-excel"); response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系

38
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

@ -1273,31 +1273,29 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
resEntity.setType(Optional.ofNullable(DictCache.getValue(TicketConstants.TICKET_TYPE, workTicketInfoVO.getType())).orElse("")); resEntity.setType(Optional.ofNullable(DictCache.getValue(TicketConstants.TICKET_TYPE, workTicketInfoVO.getType())).orElse(""));
resEntity.setCode(Optional.ofNullable(workTicketInfoVO.getCode()).orElse("")); resEntity.setCode(Optional.ofNullable(workTicketInfoVO.getCode()).orElse(""));
resEntity.setWorkContent(Optional.ofNullable(workTicketInfoVO.getWorkContent()).orElse("")); resEntity.setWorkContent(Optional.ofNullable(workTicketInfoVO.getWorkContent()).orElse(""));
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getSigner())) { // if (ObjectUtil.isNotEmpty(workTicketInfoVO.getSigner())) {
User user = UserCache.getUser(workTicketInfoVO.getSigner()); // User user = UserCache.getUser(workTicketInfoVO.getSigner());
if (ObjectUtil.isNotEmpty(user)) { // if (ObjectUtil.isNotEmpty(user)) {
resEntity.setSigner(user.getName()); // resEntity.setSigner(user.getName());
} // }
// }
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getSignerName())) {
resEntity.setSigner(workTicketInfoVO.getSignerName());
} }
//负责人-线上和线下 //负责人-线上和线下
if (Func.isEmpty(workTicketInfoVO.getPrincipal())) { if (Func.isEmpty(workTicketInfoVO.getPrincipalName())) {
resEntity.setPrincipal(workTicketInfoVO.getPrincipalManual()); resEntity.setPrincipal(workTicketInfoVO.getPrincipalManual());
} else { } else {
User principal = UserCache.getUser(workTicketInfoVO.getPrincipal()); resEntity.setPrincipal(workTicketInfoVO.getPrincipalName());
if (ObjectUtil.isNotEmpty(principal)) {
resEntity.setPrincipal(principal.getName());
}
} }
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getLicensor())) { if (ObjectUtil.isNotEmpty(workTicketInfoVO.getLicensorName())) {
User user = UserCache.getUser(workTicketInfoVO.getLicensor()); resEntity.setLicensor(workTicketInfoVO.getLicensorName());
if (ObjectUtil.isNotEmpty(user)) {
resEntity.setLicensor(user.getName());
}
}
workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembers());
if (Func.isNotEmpty(workTicketInfoVO.getClassGroupMembersManual())) {
workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembersManual());
} }
// if (Func.isNotEmpty(workTicketInfoVO.getClassGroupMembersName())){
// workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembersName());
// }else if (Func.isNotEmpty(workTicketInfoVO.getClassGroupMembersManual())) {
// workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembersManual());
// }
resEntity.setClassGroupMembers(Optional.ofNullable(workTicketInfoVO.getClassGroupMembersName()).orElse(workTicketInfoVO.getClassGroupMembersManual() == null ? "" : workTicketInfoVO.getClassGroupMembersManual())); resEntity.setClassGroupMembers(Optional.ofNullable(workTicketInfoVO.getClassGroupMembersName()).orElse(workTicketInfoVO.getClassGroupMembersManual() == null ? "" : workTicketInfoVO.getClassGroupMembersManual()));
resEntity.setCreateTime(Optional.ofNullable(DateUtil.format(workTicketInfoVO.getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse("")); resEntity.setCreateTime(Optional.ofNullable(DateUtil.format(workTicketInfoVO.getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse(""));
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getConfirmWorkTime())) { if (ObjectUtil.isNotEmpty(workTicketInfoVO.getConfirmWorkTime())) {
@ -1305,7 +1303,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
} }
resEntity.setIsEvaluate("未评价"); resEntity.setIsEvaluate("未评价");
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getIsEvaluate())&&1==workTicketInfoVO.getIsEvaluate()) { if (ObjectUtil.isNotEmpty(workTicketInfoVO.getIsEvaluate())&&1==workTicketInfoVO.getIsEvaluate()) {
TicketInfoEvaluateEntity ticketInfoEvaluateEntity = new TicketInfoEvaluateEntity(); // TicketInfoEvaluateEntity ticketInfoEvaluateEntity = new TicketInfoEvaluateEntity();
TicketInfoEvaluateEntity evaluateEntity = ticketInfoEvaluateService.getOne(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{ TicketInfoEvaluateEntity evaluateEntity = ticketInfoEvaluateService.getOne(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{
eq(TicketInfoEvaluateEntity::getTicketId, workTicketInfoVO.getId()); eq(TicketInfoEvaluateEntity::getTicketId, workTicketInfoVO.getId());
}}.last(" limit 1")); }}.last(" limit 1"));

Loading…
Cancel
Save