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. 52
      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) {
try {
if(ObjectUtils.isEmpty(req.getStartTime())&&ObjectUtils.isEmpty(req.getEndTime())){
LocalDateTime date = LocalDateTime.now();
LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0);
req.setStartTime(firstDay);
req.setEndTime(date);
}
// if(ObjectUtils.isEmpty(req.getStartTime())&&ObjectUtils.isEmpty(req.getEndTime())){
// LocalDateTime date = LocalDateTime.now();
// LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0);
// req.setStartTime(firstDay);
// req.setEndTime(date);
// }
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系

52
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.setCode(Optional.ofNullable(standardTicketInfoEntity.getCode()).orElse(null));
exportVO.setTitle(Optional.ofNullable(standardTicketInfoEntity.getTitle()).orElse(null));
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getIssueOrderPerson())) {
User issueOrderPerson = UserCache.getUser(standardTicketInfoEntity.getIssueOrderPerson());
if (ObjectUtil.isNotEmpty(issueOrderPerson)) {
exportVO.setIssueOrderPerson(issueOrderPerson.getName());
}
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getIssueOrderPersonName())) {
exportVO.setIssueOrderPerson(standardTicketInfoEntity.getIssueOrderPersonName());
}
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getAccessOrderPerson())) {
User accessOrderPerson = UserCache.getUser(standardTicketInfoEntity.getAccessOrderPerson());
if (ObjectUtil.isNotEmpty(accessOrderPerson)) {
exportVO.setAccessOrderPerson(accessOrderPerson.getName());
}
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getAccessOrderPersonName())) {
exportVO.setAccessOrderPerson(standardTicketInfoEntity.getAccessOrderPersonName());
}
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getGuardian())) {
User guardian = UserCache.getUser(standardTicketInfoEntity.getGuardian());
if (ObjectUtil.isNotEmpty(guardian)) {
exportVO.setGuardian(guardian.getName());
}
// if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getIssueOrderPerson())) {
// User issueOrderPerson = UserCache.getUser(standardTicketInfoEntity.getIssueOrderPerson());
// if (ObjectUtil.isNotEmpty(issueOrderPerson)) {
// exportVO.setIssueOrderPerson(issueOrderPerson.getName());
// }
// }
// if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getAccessOrderPerson())) {
// User accessOrderPerson = UserCache.getUser(standardTicketInfoEntity.getAccessOrderPerson());
// if (ObjectUtil.isNotEmpty(accessOrderPerson)) {
// exportVO.setAccessOrderPerson(accessOrderPerson.getName());
// }
// }
// if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getGuardian())) {
// User guardian = UserCache.getUser(standardTicketInfoEntity.getGuardian());
// if (ObjectUtil.isNotEmpty(guardian)) {
// exportVO.setGuardian(guardian.getName());
// }
// }
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getGuardianName())) {
exportVO.setGuardian(standardTicketInfoEntity.getGuardianName());
}
if (ObjectUtil.isNotEmpty(standardTicketInfoEntity.getPrincipal())) {
User principal = UserCache.getUser(standardTicketInfoEntity.getPrincipal());
if (ObjectUtil.isNotEmpty(principal)) {
exportVO.setPrincipal(principal.getName());
}
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.setEndTime(Optional.ofNullable(DateUtil.format(standardTicketInfoEntity.getEndTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse(""));
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) {
try {
if(ObjectUtils.isEmpty(req.getStartTime())&&ObjectUtils.isEmpty(req.getEndTime())){
LocalDateTime date = LocalDateTime.now();
String nowDate = date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0);
String firstDate = firstDay.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
req.setStartTime(firstDate);
req.setEndTime(nowDate);
}
// if(ObjectUtils.isEmpty(req.getStartTime())&&ObjectUtils.isEmpty(req.getEndTime())){
// LocalDateTime date = LocalDateTime.now();
// String nowDate = date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0);
// String firstDate = firstDay.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// req.setStartTime(firstDate);
// req.setEndTime(nowDate);
// }
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
// 这里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.setCode(Optional.ofNullable(workTicketInfoVO.getCode()).orElse(""));
resEntity.setWorkContent(Optional.ofNullable(workTicketInfoVO.getWorkContent()).orElse(""));
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getSigner())) {
User user = UserCache.getUser(workTicketInfoVO.getSigner());
if (ObjectUtil.isNotEmpty(user)) {
resEntity.setSigner(user.getName());
}
// if (ObjectUtil.isNotEmpty(workTicketInfoVO.getSigner())) {
// User user = UserCache.getUser(workTicketInfoVO.getSigner());
// if (ObjectUtil.isNotEmpty(user)) {
// 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());
} else {
User principal = UserCache.getUser(workTicketInfoVO.getPrincipal());
if (ObjectUtil.isNotEmpty(principal)) {
resEntity.setPrincipal(principal.getName());
}
}
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getLicensor())) {
User user = UserCache.getUser(workTicketInfoVO.getLicensor());
if (ObjectUtil.isNotEmpty(user)) {
resEntity.setLicensor(user.getName());
}
resEntity.setPrincipal(workTicketInfoVO.getPrincipalName());
}
workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembers());
if (Func.isNotEmpty(workTicketInfoVO.getClassGroupMembersManual())) {
workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembersManual());
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getLicensorName())) {
resEntity.setLicensor(workTicketInfoVO.getLicensorName());
}
// 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.setCreateTime(Optional.ofNullable(DateUtil.format(workTicketInfoVO.getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse(""));
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getConfirmWorkTime())) {
@ -1305,7 +1303,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
}
resEntity.setIsEvaluate("未评价");
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getIsEvaluate())&&1==workTicketInfoVO.getIsEvaluate()) {
TicketInfoEvaluateEntity ticketInfoEvaluateEntity = new TicketInfoEvaluateEntity();
// TicketInfoEvaluateEntity ticketInfoEvaluateEntity = new TicketInfoEvaluateEntity();
TicketInfoEvaluateEntity evaluateEntity = ticketInfoEvaluateService.getOne(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{
eq(TicketInfoEvaluateEntity::getTicketId, workTicketInfoVO.getId());
}}.last(" limit 1"));

Loading…
Cancel
Save