diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java index c9dadf1..adf341f 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/entity/WorkTaskEntity.java @@ -30,7 +30,7 @@ public class WorkTaskEntity extends TenantEntity { @ApiModelProperty(value = "工作负责人名称") private String headName; - @ApiModelProperty(value = "工作负责人名称") + @ApiModelProperty(value = "工作负责人处理时间") private Date headHandleTime; @ApiModelProperty(value = "班组ID") @@ -45,12 +45,6 @@ public class WorkTaskEntity extends TenantEntity { @ApiModelProperty(value = "班组成员名称 : 按 “,”分割") private String memberName; - @ApiModelProperty(value = "签名班组人员ID : 按 “,”分割") - private String signatureMember; - - @ApiModelProperty(value = "签名班组成员名称 : 按 “,”分割") - private String signatureMemberName; - @ApiModelProperty(value = "工作计划开始时间") private Date planStartTime; @@ -78,6 +72,12 @@ public class WorkTaskEntity extends TenantEntity { @ApiModelProperty(value = "许可时间") private Date licensorTime; + @ApiModelProperty(value = "工作终结人") + private Long terminator; + + @ApiModelProperty(value = "工作终结人名称") + private String terminatorName; + @ApiModelProperty(value = "工作结束时间") private Date workEndTime; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java new file mode 100644 index 0000000..e2cd03d --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskContentVO.java @@ -0,0 +1,18 @@ +package com.hnac.hzims.ticket.repair.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class WorkTaskContentVO { + + @ApiModelProperty(value = "工作地点") + private String location; + + @ApiModelProperty(value = "工作内容") + private Integer content; + +} diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java new file mode 100644 index 0000000..090f28e --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskPreviewVO.java @@ -0,0 +1,83 @@ +package com.hnac.hzims.ticket.repair.vo; + +import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author ysj + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class WorkTaskPreviewVO extends WorkTaskEntity { + + @ApiModelProperty(value = "机构名称") + private String deptName; + + @ApiModelProperty(value = "班组成员数量") + private Integer groupCount; + + @ApiModelProperty(value = "工作地点") + private String location; + + @ApiModelProperty(value = "工作内容") + private String content; + + @ApiModelProperty(value = "计划工作时间") + private String planTimeInterval; + + @ApiModelProperty(value = "工作派工单签发人") + private String createName; + + @ApiModelProperty(value = "签发时间: 年") + private Integer createYear; + + @ApiModelProperty(value = "签发时间: 月") + private Integer createMon; + + @ApiModelProperty(value = "签发时间: 日") + private Integer createDay; + + @ApiModelProperty(value = "签发时间: 时") + private Integer createHour; + + @ApiModelProperty(value = "签发时间: 分") + private Integer createMin; + + + @ApiModelProperty(value = "开票处理时间: 年") + private Integer headYear; + + @ApiModelProperty(value = "开票处理时间: 月") + private Integer headMon; + + @ApiModelProperty(value = "开票处理时间: 日") + private Integer headDay; + + @ApiModelProperty(value = "开票处理时间: 时") + private Integer headHour; + + @ApiModelProperty(value = "开票处理时间: 分") + private Integer headMin; + + + @ApiModelProperty(value = "结束时间: 年") + private Integer endYear; + + @ApiModelProperty(value = "结束时间: 月") + private Integer endMon; + + @ApiModelProperty(value = "结束时间: 日") + private Integer endDay; + + @ApiModelProperty(value = "结束时间: 时") + private Integer endHour; + + @ApiModelProperty(value = "结束时间: 分") + private Integer endMin; + + @ApiModelProperty(value = "许可时间") + private String licensorExportTime; + +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java index bafc8de..dba391b 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java @@ -38,7 +38,7 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { public IPage early(IPage page, TabulateEarlyVo tabulateEarly) { StbAnalysisDTO param = new StbAnalysisDTO(); if(StringUtil.isNotBlank(tabulateEarly.getStartTime())){ - param.setStartTime(LocalDateTime.parse(tabulateEarly.getStartTime())); + param.setStartTime(LocalDateTime.parse(tabulateEarly.getStartTime(),DateUtil.DATETIME_FORMATTER)); } if(StringUtil.isNotBlank(tabulateEarly.getEndTime())){ param.setEndTime(LocalDateTime.parse(tabulateEarly.getEndTime(), DateUtil.DATETIME_FORMATTER)); diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/WorkTaskServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/WorkTaskServiceImpl.java index e9f5d72..dd9d8a6 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/WorkTaskServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/WorkTaskServiceImpl.java @@ -4,9 +4,13 @@ import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.middle.processflow.service.ProcessDictService; import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; +import com.hnac.hzims.ticket.repair.fegin.IWorkTaskClient; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.api.R; import org.springframework.stereotype.Service; + import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.WORK_TASK; /** @@ -19,6 +23,8 @@ public class WorkTaskServiceImpl extends ProcessAbstractService { private final ProcessDictService processDictService; + private final IWorkTaskClient workTaskClient; + /** * 消息确认-工作任务单 * @param flowQueue @@ -36,9 +42,9 @@ public class WorkTaskServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { - - /*if (!defect.isSuccess()) { + R workTask = workTaskClient.listener(response); + if (!workTask.isSuccess() || !workTask.getData()) { throw new ServiceException("检修任务业务执行异常!"); - }*/ + } } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java index 27cf9f0..45ba555 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java @@ -52,20 +52,22 @@ public class WorkTaskController extends BladeController { return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask)); } - @GetMapping("/workTicketList") + @GetMapping("/preview") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页") + @ApiOperation(value = "工作任务单预览", notes = "工作任务单预览") + public void preview(@RequestParam @ApiParam("工作任务单预览主键ID") @NotNull @Valid Long id) { + workTaskService.preview(id); + } + + @GetMapping("/workTicketList") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "查询工作票") public R> workTicketList(@RequestParam(value = "ticketCode",required = false) String ticketCode) { return R.data(workTaskService.workTicketList(ticketCode)); } - /** - * 工作任务单-开启流程 - * @param workTask - * @return - */ @PostMapping("/startProcess") - @ApiOperationSupport(order = 3) + @ApiOperationSupport(order = 4) @ApiOperation(value = "工作任务单") public R startV4(@RequestBody WorkTaskVO workTask) { return R.status(workTaskService.start(workTask)); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java index 9595912..119bdf0 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java @@ -21,5 +21,8 @@ public interface IWorkTaskService extends BaseService { IPage workTaskService(IPage page, WorkTaskVO workTask); + + void preview(Long id); + List workTicketList(String ticketName); } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java index 26e35ba..cc05cf4 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java @@ -1,38 +1,45 @@ package com.hnac.hzims.ticket.repair.service.impl; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.mapper.WorkTaskMapper; import com.hnac.hzims.ticket.repair.service.IWorkTaskService; +import com.hnac.hzims.ticket.repair.vo.WorkTaskContentVO; +import com.hnac.hzims.ticket.repair.vo.WorkTaskPreviewVO; import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; +import com.hnac.hzims.ticket.utils.ExcelUtil; +import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Workbook; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.DateUtil; -import org.springblade.core.tool.utils.ObjectUtil; -import org.springblade.core.tool.utils.StringUtil; +import org.springblade.core.tool.utils.*; import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.utils.FlowUtil; import org.springblade.flow.core.utils.TaskUtil; import org.springblade.system.entity.Dept; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.entity.User; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; -import java.util.Date; -import java.util.List; -import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import java.util.*; /** * @author ysj @@ -48,43 +55,14 @@ public class WorkTaskServiceImpl extends BaseServiceImpl workTaskService(IPage page, WorkTaskVO workTask) { - QueryWrapper wrapper = Condition.getQueryWrapper(workTask); - if(StringUtil.isNotBlank(workTask.getStartTime())){ - wrapper.ge("CREATE_TIME",workTask.getStartTime()); - } - if(StringUtil.isNotBlank(workTask.getEndTime())){ - wrapper.le("CREATE_TIME",workTask.getEndTime()); - } - if(ObjectUtil.isNotEmpty(workTask.getGroupId())){ - wrapper.eq("GROUP_ID",workTask.getGroupId()); - } - if(ObjectUtil.isNotEmpty(workTask.getGroupId())){ - wrapper.eq("CREATE_DEPT",workTask.getDeptId()); - } - return super.page(page, wrapper); - } + private final IUserClient userClient; + + @Value("${hzims.ticket.workTask.saveWrokTask.xlsx}") + private String saveWrokTaskXlsxPath; + + @Value("${hzims.ticket.workTask.saveWrokTask.pdf}") + private String saveWrokTaskPdfPath; - /** - * 查询工作票数据 - * @param ticketCode - * @return - */ - @Override - public List workTicketList(String ticketCode) { - if(StringUtil.isEmpty(ticketCode)){ - return workTicketInfoService.list(); - } - return workTicketInfoService.list(Wrappers.lambdaQuery() - .like(WorkTicketInfoEntity::getCode,ticketCode)); - } /** * 工作任务单-开启流程 @@ -106,8 +84,12 @@ public class WorkTaskServiceImpl extends BaseServiceImpl member.length){ + variables.put("duty" + i, ""); + }else{ + variables.put("duty" + i, TaskUtil.getTaskUser(member[i-1])); + } } R result = flowClient.startProcessInstanceContainNameByKey("work_task", FlowUtil.getBusinessKey("work_task_v4",String.valueOf(workTask.getId())), workTask.getCode(), variables); log.error("work_task_start_process_result :{}",result); @@ -142,14 +124,206 @@ public class WorkTaskServiceImpl extends BaseServiceImpl variables = (Map) processWorkFlowResponse.getVariables(); + log.error("work_task_listener_variables : {}",variables); + Object head = variables.get("head"); + if(ObjectUtil.isNotEmpty(head)){ + variables.put("head",head.toString().replaceAll("taskUser_","")); + } WorkTaskVO entity = JSONObject.parseObject(JSONObject.toJSONString(variables), new TypeReference(){}); // 当前流程名称 entity.setTaskName(processWorkFlowResponse.getTaskName()); // 流程阶段执行人员名称 entity.setNextStepOperator(processWorkFlowResponse.getNextStepOperator()); - + if(ObjectUtil.isNotEmpty(entity.getWorkTicketId())){ + entity.setHeadHandleTime(new Date()); + } + if(ObjectUtil.isNotEmpty(entity.getTerminator())){ + entity.setWorkEndTime(new Date()); + } + if(StringUtil.isNotBlank(entity.getLicensorName())){ + entity.setLicensorTime(new Date()); + } // 更新工作任务单信息 this.updateById(entity); - return false; + return true; + } + + /** + * 工作任务单-分页查询 + * @param page + * @param workTask + * @return + */ + @Override + public IPage workTaskService(IPage page, WorkTaskVO workTask) { + QueryWrapper wrapper = Condition.getQueryWrapper(workTask); + if(StringUtil.isNotBlank(workTask.getStartTime())){ + wrapper.ge("CREATE_TIME",workTask.getStartTime()); + } + if(StringUtil.isNotBlank(workTask.getEndTime())){ + wrapper.le("CREATE_TIME",workTask.getEndTime()); + } + if(ObjectUtil.isNotEmpty(workTask.getGroupId())){ + wrapper.eq("GROUP_ID",workTask.getGroupId()); + } + if(ObjectUtil.isNotEmpty(workTask.getGroupId())){ + wrapper.eq("CREATE_DEPT",workTask.getDeptId()); + } + return super.page(page, wrapper); + } + + /** + * 工作任务单预览 + * @param id + */ + @Override + public void preview(Long id) { + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + //准备数据 + WorkTaskPreviewVO preview = this.workTaskExport(id); + if(ObjectUtil.isEmpty(preview)){ + throw new ServiceException("查询应急抢修单失败"); + } + Map params = new HashMap<>(); + try { + params = PdfUtils.objectToMap(preview); + }catch (Exception e) { + log.error("转换对象失败!"); + } + TemplateExportParams templateExportParams = new TemplateExportParams("template/excel/work_task_template.xlsx", true); + Workbook workbook = null; + try { + workbook = ExcelUtil.getWorkbook(templateExportParams,params); + } catch (Exception e) { + e.printStackTrace(); + } + //上传xlsx至服务器 + String fileName = preview.getCode() + "_工作任务单" + PdfUtils.XLSX_SUFFIX; + try { + ExcelUtil.upload(workbook,saveWrokTaskXlsxPath,fileName); + } catch (Exception e) { + e.printStackTrace(); + } + //将docx文件转换为pdf并保存 + String pdfFileName = preview.getCode() + "_工作任务单" + PdfUtils.PDF_SUFFIX; + String xlsxFileName = preview.getCode() + "_工作任务单" + PdfUtils.XLSX_SUFFIX; + PdfUtils.convertPdf(saveWrokTaskPdfPath, xlsxFileName, saveWrokTaskPdfPath, pdfFileName); + String savePath = saveWrokTaskPdfPath + pdfFileName; + // 设置response参数,可以打开下载页面 + PdfUtils.readPdf(response,savePath); + } + + /** + * 转换工作任务单预览对象 + * @param id + * @return + */ + private WorkTaskPreviewVO workTaskExport(Long id) { + // 查询工作任务单对象 + WorkTaskEntity workTask = this.getById(id); + if(ObjectUtil.isEmpty(workTask)){ + throw new ServiceException("未查询到工作任务单数据!"); + } + // 对象属性拷贝 + WorkTaskPreviewVO preview = new WorkTaskPreviewVO(); + BeanUtil.copyProperties(preview,workTask); + // 机构名称 + R result = sysClient.getDept(workTask.getCreateDept()); + if(result.isSuccess() && ObjectUtil.isNotEmpty(result.getData())){ + preview.setDeptName(result.getData().getDeptName()); + } + // 班组数量 + if(StringUtil.isNotBlank(workTask.getMember())){ + preview.setGroupCount(workTask.getMember().split(",").length); + } + // 工作地点 、工作内容 + if(StringUtil.isNotBlank(workTask.getWorkTask())){ + List contents = JSONObject.parseObject(workTask.getWorkTask(), new TypeReference>() {}); + if(CollectionUtil.isNotEmpty(contents)){ + StringBuilder location = new StringBuilder(),content = new StringBuilder(); + for(WorkTaskContentVO item : contents){ + location.append(item.getLocation()).append("\n"); + content.append(item.getContent()).append("\n"); + } + preview.setLocation(location.substring(0,location.toString().length() - 1)); + preview.setContent(content.substring(0,location.toString().length() - 1)); + } + } + // 计划工作时间 + if(ObjectUtil.isNotEmpty(workTask.getPlanStartTime()) && ObjectUtil.isNotEmpty(workTask.getPlanEndTime())){ + Calendar start = Calendar.getInstance(); + start.setTime(workTask.getPlanStartTime()); + StringBuilder planTimeInterval = new StringBuilder(); + + planTimeInterval.append(start.get(Calendar.YEAR)).append("年").append(start.get(Calendar.MONTH)).append("月").append(start.get(Calendar.DAY_OF_MONTH)) + .append("日").append(start.get(Calendar.HOUR_OF_DAY)).append("时").append(start.get(Calendar.MINUTE)).append("分").append("至"); + Calendar end = Calendar.getInstance(); + end.setTime(workTask.getPlanStartTime()); + planTimeInterval.append(end.get(Calendar.YEAR)).append("年").append(end.get(Calendar.MONTH)).append("月").append(end.get(Calendar.DAY_OF_MONTH)) + .append("日").append(end.get(Calendar.HOUR_OF_DAY)).append("时").append(end.get(Calendar.MINUTE)).append("分"); + preview.setPlanTimeInterval(planTimeInterval.toString()); + } + // 工作派工单签发人 + R user = userClient.userInfoById(workTask.getCreateUser()); + if(user.isSuccess() && ObjectUtil.isNotEmpty(user.getData())){ + preview.setCreateName(user.getData().getName()); + } + // 工作派工单签发时间 + if(ObjectUtil.isNotEmpty(workTask.getCreateTime())){ + Calendar createTime = Calendar.getInstance(); + createTime.setTime(workTask.getCreateTime()); + preview.setCreateYear(createTime.get(Calendar.YEAR)); + preview.setCreateMon(createTime.get(Calendar.MONTH)); + preview.setCreateDay(createTime.get(Calendar.DAY_OF_MONTH)); + preview.setCreateHour(createTime.get(Calendar.HOUR_OF_DAY)); + preview.setCreateMin(createTime.get(Calendar.MINUTE)); + } + // 开票处理时间 + if(ObjectUtil.isNotEmpty(workTask.getHeadHandleTime())){ + Calendar headTime = Calendar.getInstance(); + headTime.setTime(workTask.getHeadHandleTime()); + preview.setHeadYear(headTime.get(Calendar.YEAR)); + preview.setHeadMon(headTime.get(Calendar.MONTH)); + preview.setHeadDay(headTime.get(Calendar.DAY_OF_MONTH)); + preview.setHeadHour(headTime.get(Calendar.HOUR_OF_DAY)); + preview.setHeadMin(headTime.get(Calendar.MINUTE)); + } + // 工单结束时间 + if(ObjectUtil.isNotEmpty(workTask.getWorkEndTime())){ + Calendar entTime = Calendar.getInstance(); + entTime.setTime(workTask.getWorkEndTime()); + preview.setEndYear(entTime.get(Calendar.YEAR)); + preview.setEndMon(entTime.get(Calendar.MONTH)); + preview.setEndDay(entTime.get(Calendar.DAY_OF_MONTH)); + preview.setEndHour(entTime.get(Calendar.HOUR_OF_DAY)); + preview.setEndMin(entTime.get(Calendar.MINUTE)); + } + // 许可时间 + if(ObjectUtil.isNotEmpty(workTask.getLicensorTime())){ + Calendar licensorTime = Calendar.getInstance(); + licensorTime.setTime(workTask.getLicensorTime()); + String licensorExportTime = licensorTime.get(Calendar.YEAR) + "年" + licensorTime.get(Calendar.MONTH) + "月" + licensorTime.get(Calendar.DAY_OF_MONTH) + + "日" + licensorTime.get(Calendar.HOUR_OF_DAY) + "时" + licensorTime.get(Calendar.MINUTE) + "分"; + preview.setLicensorExportTime(licensorExportTime); + } + return preview; + } + + + /** + * 查询工作票数据 + * @param ticketCode + * @return + */ + @Override + public List workTicketList(String ticketCode) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.lambda().orderByDesc(WorkTicketInfoEntity::getCreateTime); + if(StringUtil.isEmpty(ticketCode)){ + return workTicketInfoService.list(queryWrapper); + } + queryWrapper.lambda().like(WorkTicketInfoEntity::getCode,ticketCode); + return workTicketInfoService.list(queryWrapper); } } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/resources/template/excel/work_task_template.xlsx b/hzims-service/ticket/src/main/resources/template/excel/work_task_template.xlsx new file mode 100644 index 0000000..bf8b776 Binary files /dev/null and b/hzims-service/ticket/src/main/resources/template/excel/work_task_template.xlsx differ