From 6cbfbeb8acc904842388da392b2f718b3177dbcc Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Jan 2024 13:46:01 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=BC=94=E7=BB=83?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E4=B8=8D=E5=B1=95=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/dto/RehearsalExportDTO.java | 10 +- .../safeproduct/entity/RehearsalPlanEntity.java | 5 +- .../safeproduct/vo/RehearsalRecordDetailVO.java | 11 ++ .../service/impl/RehearsalPlanServiceImpl.java | 10 +- .../service/impl/RehearsalRecordServiceImpl.java | 21 +++- .../com/hnac/hzims/safeproduct/utils/BaseUtil.java | 120 ++++++++++++--------- .../main/resources/template/演练记录表.docx | Bin 11999 -> 12208 bytes 7 files changed, 121 insertions(+), 56 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java index df269e3..f79db79 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java @@ -26,11 +26,9 @@ public class RehearsalExportDTO { private String subject; @ApiModelProperty("演练计划开始时间") - @ExcelProperty(value = "计划开始时间", index = 2) private Date scheduledStartTime; @ApiModelProperty("演练计划结束时间") - @ExcelProperty(value = "计划结束时间", index = 3) private Date scheduledEndTime; @ApiModelProperty("演练地点") @@ -40,4 +38,12 @@ public class RehearsalExportDTO { @ApiModelProperty("演练状态") @ExcelProperty(value = "演练状态", index = 5) private String rehearsalStatus; + + @ApiModelProperty("计划开始时间") + @ExcelProperty(value = "计划开始时间", index = 2) + private String startTime; + + @ApiModelProperty("计划结束时间") + @ExcelProperty(value = "计划结束时间", index = 3) + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java index 4cd4306..45acd49 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import org.springblade.core.tool.utils.DateUtil; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -33,12 +34,12 @@ public class RehearsalPlanEntity extends BaseEntity { private String subject; @NotNull - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = DateUtil.PATTERN_DATE) @ApiModelProperty("演练计划开始时间") private Date scheduledStartTime; @NotNull - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = DateUtil.PATTERN_DATE) @ApiModelProperty("演练计划结束时间") private Date scheduledEndTime; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java index 86afcbe..9b57e9c 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -52,4 +54,13 @@ public class RehearsalRecordDetailVO { @ApiModelProperty("演练科目") private String subject; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java index 040e07a..a296345 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java @@ -21,6 +21,7 @@ import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO; import com.hnac.hzims.safeproduct.vo.RehearsalYearVO; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,8 +46,7 @@ import java.util.stream.Collectors; * @date 2023-12-27 */ @Service -public class RehearsalPlanServiceImpl extends ServiceImpl - implements IRehearsalPlanService { +public class RehearsalPlanServiceImpl extends ServiceImpl implements IRehearsalPlanService { @Autowired IRehearsalRecordService rehearsalRecordService; @@ -190,8 +190,9 @@ public class RehearsalPlanServiceImpl extends ServiceImpl rehearsalList = getRehearsalByUnitAndDate(unit, startTime, endTime); - // 处理演练状态信息 + // 数据处理 rehearsalList.forEach(record -> { + // 演练状态 String status; if (record.getRehearsalStatus().equals(RehearsalStatusEnum.WAITING.getValue())) { status = RehearsalStatusEnum.WAITING.getDesc(); @@ -201,6 +202,9 @@ public class RehearsalPlanServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + rehearsalRecordDetailVO.setImages(list); + } + // 表头年月 + String code = rehearsalRecordDetailVO.getCode(); + rehearsalRecordDetailVO.setYear(code.substring(4, 8)); + rehearsalRecordDetailVO.setMonth(code.substring(8, 10)); + // 演练方式 String rehearsalMethod = rehearsalRecordDetailVO.getRehearsalMethod(); if (rehearsalMethod.equals(RehearsalMethodEnum.MIXED.getValue())) { rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.MIXED.getDesc()); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java index 1cc74f1..3118280 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java @@ -2,7 +2,7 @@ package com.hnac.hzims.safeproduct.utils; import cn.afterturn.easypoi.word.WordExportUtil; import com.hnac.hzims.common.logs.utils.StringUtils; -import com.hnac.hzims.ticket.annotation.DateTimeToMap; +import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; import org.apache.poi.xwpf.usermodel.XWPFDocument; @@ -13,10 +13,12 @@ import org.springblade.core.tool.utils.ObjectUtil; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.lang.reflect.Field; +import java.net.HttpURLConnection; +import java.net.URL; import java.net.URLEncoder; +import java.nio.file.Files; import java.time.LocalDateTime; import java.util.*; -import java.util.stream.Collectors; /** * 公用工具类 @@ -156,8 +158,8 @@ public class BaseUtil { * @return map参数 */ public static Map obj2Map(Object obj) { + Map result = new HashMap<>(); if (ObjectUtil.isNotEmpty(obj) && null != obj.getClass()) { - Map result = new HashMap<>(); List fieldList = new ArrayList<>(); Class clazz = obj.getClass(); while (clazz != null) { @@ -172,59 +174,81 @@ public class BaseUtil { } catch (IllegalAccessException e) { throw new ServiceException("获取属性性出错"); } - if (value instanceof List) { - List> list = ((List) value).stream().map(BaseUtil::obj2Map).collect(Collectors.toList()); - result.put(field.getName(),list); - } - else if (value instanceof LocalDateTime) { - DateTimeToMap dateTimeToMap = field.getAnnotation(DateTimeToMap.class); - LocalDateTime time = (LocalDateTime) value; - if(ObjectUtil.isEmpty(dateTimeToMap)) { - result.put(field.getName(),time.format(DateUtil.TIME_FORMATTER)); - } - else { - result.putAll(LocalDateConvertMap(time,dateTimeToMap.prefix(),dateTimeToMap.split())); - } + if (value instanceof LocalDateTime) { + value = DateUtil.format((LocalDateTime) value, SafeProductConstant.SAFEPRODUCT_EXPORT_DATE); } else if (value instanceof Date) { - DateTimeToMap dateTimeToMap = field.getAnnotation(DateTimeToMap.class); - Date time = (Date) value; - if (ObjectUtil.isEmpty(dateTimeToMap)) { - result.put(field.getName(),DateUtil.format(time,DateUtil.PATTERN_DATETIME)); - } - else { - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"year", time.getYear()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"month", time.getMonth()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"day", time.getDay()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"hour", time.getHours()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"minuter", time.getMinutes()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"second", time.getSeconds()); - } - } - else { - result.put(field.getName(),value); + value = DateUtil.format((Date) value, SafeProductConstant.SAFEPRODUCT_EXPORT_DATE); } + result.put(field.getName(),value); }); - return result; } - return null; + return result; + } + + /** + * 图片转字节 + * @param tempImgPath 图片路径 + * @return 图片字节 + */ + public static byte[] imgToByte(String tempImgPath) { + File file = new File(tempImgPath); + byte[] buffer = null; + try { + FileInputStream fis = new FileInputStream(file); + ByteArrayOutputStream bos = new ByteArrayOutputStream(1000); + byte[] b = new byte[1000]; + int n; + while ((n = fis.read(b)) != -1) { + bos.write(b, 0, n); + } + fis.close(); + bos.close(); + buffer = bos.toByteArray(); + } catch (IOException e) { + log.error(e.getMessage()); + } + //删除临时文件 + file.delete(); + return buffer; } /** - * 将时间按格式转化为map对象 - * @param dateTime 待转换时间 - * @param prefix 转换格式Key前缀 - * @param split 转换格式Key分隔符 - * @return map对象 + * 下载文件 + * @param fileUrl 文件路径 + * @param downloadFileDir 下载路径 + * @return 下载文件路径 */ - public static Map LocalDateConvertMap(LocalDateTime dateTime,String prefix,String split) { - return new HashMap() {{ - put(prefix + split + "year", dateTime.getYear()); - put(prefix + split + "month", dateTime.getMonthValue()); - put(prefix + split + "day", dateTime.getDayOfMonth()); - put(prefix + split + "hour", dateTime.getHour()); - put(prefix + split + "minuter", dateTime.getMinute()); - put(prefix + split + "second", dateTime.getSecond()); - }}; + public static String downloadFileByUrl(String fileUrl, String downloadFileDir){ + URL url; + String fileName = null; + try { + url = new URL(fileUrl); + HttpURLConnection connection = (HttpURLConnection)url.openConnection(); + connection.setConnectTimeout(5000); + connection.setReadTimeout(5000); + connection.connect(); + int responseCode = connection.getResponseCode(); + if (responseCode == 200) { + InputStream inputStream = connection.getInputStream(); + int lastSlashIndex = fileUrl.lastIndexOf("/"); + if (lastSlashIndex > 0) { + fileName = fileUrl.substring(lastSlashIndex+1); + String filePath = downloadFileDir + fileName; + File file = new File(filePath); + if (file.exists()){ + file.delete(); + } + OutputStream outputStream = Files.newOutputStream(file.toPath()); + // 将文件流拷贝到本地处理 + IOUtils.copy(inputStream, outputStream); + } else { + throw new ServiceException("下载文件路径异常:" + downloadFileDir); + } + } + } catch (Exception e) { + throw new ServiceException("文件图片下载失败!"); + } + return fileName; } } diff --git a/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx b/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx index ce1bbf9b172eef5b5c87bb6a2f750d339aaab482..f3c34385275a290ed86fdeeafec27340f572a61e 100644 GIT binary patch delta 5354 zcmZXYWl$Shw}z7-CAhmMxNAv^77p&N#U+#yv`{QXihBwacW8k^aSF6Z3xN_G3Pp<* zD+G7B=X_`8elz#3AN$w4X7=ng@7nV|%QhcvQ>DPloZ`B+KmfoeP5vI)e}~QGd_2N9 zAS)td;TT@jG2Vy#`FUizz4U(ZUh09@gO#0pmrkB`N79gniFS%Sn5~SQM?eo+j}Hw^ z3cdCg*D(xPfYz0sY;z?{Z2QtCsi8P6xloe5C=c;|iNr~dzs5x4E=&Wu^;FxQ1tb-p zn0@xw>H_L(;owpO001HaK#cCHq9k0*(+JfMWJT8NeibE;4uCFk92LxJ%o$o}@B?>L zxS$b=9+{!fAr9yUok@8h6NIS_?VDN#Cx{3?yt%*IZ^fqfJ(Q^aCW&{=Bs4mDvO5#kC zNYd%p-S6tZb0$1Ky4++x2dG71KH{QreTiEYZOK%oAb4!4SAB0-6upSK)b&SJMF|dD zXTsCYMv3ypeZKdy_#Ics@4pqgFkoH?wj%CtuZ?`P?;v@peACwcX}4g9uIg5RlvfKE zJ7?he3P%1ErwILmXM^KQ`$!gVg1Y3PhS^rkWS)v&kP`T%=E30fG9p~f)VX0arFHat z=7$7x^D%F>f3=I>F6i5az1OX2v{ysGJ;a836Iy|SuKw42fL%+>9p}5R!+)uU^lGb z=aaP;7nf>J9@m+x_x>FCSgTzcY4Odmw*|81ErlgbOg4_~i}i^{s`Uf4){ZN??yugG zahVcgoF1^hW#%3qnB~hL4VGir^NLuf(G$bjh)%%eyP%$b8u3kDtAj$%uxublzl2n7 zUNW>aVg&-B@-SEOqoM>0U#h~hIF>!sqpAz%ly5W_CVcx#1$(q)(g-dbMI4rvF$^5Z!0GXPI2(i7HZ^$ID$J28`kw49j*N02x(6B2D@y!% z7?@E5dF@K77oJPVpvhZsj|8o)Bd&ON;9p)--#doAMn1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wY#4{YA$m+2 zbKZ8?rRsYi%EII9Na&ucd_z@$FZ0bwn?U>VCAo13C^=lCx7(X*TXG7mv8NI}3sAg7 zAJe4(!6eL-ocnh)EKpyH-a0J!_LB&!P&;vr_STzo_(uUKR@~M^L|~lN@(8+TLJiMB zMm2!Us#`NJE+mUv`F;H;9u(2PLROkeI>=WTCegDI&2tPYiso51a#|-;Jr3%LYOr90 zZ&QN+-CTIq;YSZUJZ1Ojn`yrP5cTOO&ad+fx4($S`ZA|gkEdMJ0yjYbTtwPmz;9$0 z*cFz@%z*TcpaJ~$@SWaF0V|;0o=435@+`tNXzBJ6=<_{T`SAppixmVH3D{ge)7qlO z$g}q@F~dpG)S3pre-7~;-OI73E|rhpqmpnK8ap|~ae#K*s0&_s;3Nl1oKF~d!GUt( z)BBgDp@#WH8UEo|e~~r6zlP~=&hocm0hs^tjVKVm9F{Q3kY54o9qI$WFcu@~E58I# zi3^1*Ai(&qF8OcbdwP_n04w8vNA%yy)vTxl0XByJBA$N(q)^`k Date: Tue, 23 Jan 2024 14:06:04 +0800 Subject: [PATCH 2/8] =?UTF-8?q?update:=20=E6=BC=94=E7=BB=83=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/RehearsalController.java | 7 +++--- .../service/IRehearsalRecordService.java | 11 ++++++++++ .../service/impl/RehearsalRecordServiceImpl.java | 25 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java index afb6c70..73c8b0a 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java @@ -112,13 +112,14 @@ public class RehearsalController extends BladeController { @GetMapping("/rehearsalRecordPage") @ApiImplicitParams({ - @ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "演练记录分页") @ApiOperationSupport(order = 10) public R> rehearsalRecordPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = rehearsalRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( - param, RehearsalRecordEntity.class).lambda().orderByDesc(RehearsalRecordEntity::getCreateTime)); + IPage page = rehearsalRecordService.rehearsalRecordPage(param, query); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java index 83dec8b..92b08c8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java @@ -1,10 +1,13 @@ package com.hnac.hzims.safeproduct.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; +import org.springblade.core.mp.support.Query; import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * 演练记录服务类 @@ -48,4 +51,12 @@ public interface IRehearsalRecordService extends IService * @return 演练记录表VO类 */ RehearsalRecordDetailVO getRecordDetailVOById(Long id); + + /** + * 演练记录分页 + * @param param 入参 + * @param query 分页类 + * @return 演练记录数据 + */ + IPage rehearsalRecordPage(Map param, Query query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java index bcc53ee..e172ce0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java @@ -4,8 +4,10 @@ import cn.afterturn.easypoi.entity.ImageEntity; import cn.hutool.core.date.DatePattern; import com.alibaba.excel.util.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.common.logs.utils.StringUtils; +import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; @@ -17,6 +19,7 @@ import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.support.Query; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -174,4 +177,26 @@ public class RehearsalRecordServiceImpl extends ServiceImpl rehearsalRecordPage(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String rehearsalPlanId = String.valueOf(param.get("rehearsalPlanId")); + String actualStartTime = String.valueOf(param.get("actualStartTime")); + String actualEndTime = String.valueOf(param.get("actualEndTime")); + if (!rehearsalPlanId.equals("null") && !rehearsalPlanId.equals("")) { + queryWrapper.lambda().eq(RehearsalRecordEntity::getRehearsalPlanId, rehearsalPlanId); + } + if (!actualStartTime.equals("null") && !actualStartTime.equals("")) { + queryWrapper.lambda().ge(RehearsalRecordEntity::getActualStartTime, actualStartTime); + } + if (!actualEndTime.equals("null") && !actualEndTime.equals("")) { + queryWrapper.lambda().le(RehearsalRecordEntity::getActualEndTime, actualEndTime); + } + queryWrapper.lambda().orderByDesc(RehearsalRecordEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } } From a9b4b4a995da762e0d325d85a480c82a5ea0e5f0 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Jan 2024 14:45:00 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=87=E4=BB=B6=E5=AF=BC=E5=87=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/dto/ConferenceExportDTO.java | 10 +++- .../safeproduct/vo/ConferenceRecordDetailVO.java | 11 ++++ .../controller/ConferenceController.java | 8 +-- .../service/IConferenceRecordService.java | 11 ++++ .../service/impl/ConferencePlanServiceImpl.java | 6 ++- .../service/impl/ConferenceRecordServiceImpl.java | 60 ++++++++++++++++++--- .../main/resources/template/会议记录表.docx | Bin 11789 -> 11834 bytes 7 files changed, 92 insertions(+), 14 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java index e72d988..b232cc4 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java @@ -22,11 +22,9 @@ public class ConferenceExportDTO { private String unit; @ApiModelProperty("会议计划开始时间") - @ExcelProperty(value = "会议计划开始时间", index = 1) private Date scheduledStartTime; @ApiModelProperty("会议计划结束时间") - @ExcelProperty(value = "会议计划结束时间", index = 2) private Date scheduledEndTime; @ApiModelProperty("会议主题") @@ -48,4 +46,12 @@ public class ConferenceExportDTO { @ApiModelProperty("会议状态") @ExcelProperty(value = "会议状态", index = 7) private String conferenceStatus; + + @ApiModelProperty("计划开始时间") + @ExcelProperty(value = "计划开始时间", index = 1) + private String startTime; + + @ApiModelProperty("计划结束时间") + @ExcelProperty(value = "计划结束时间", index = 2) + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java index 515a252..c876c9a 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -52,4 +54,13 @@ public class ConferenceRecordDetailVO { @ApiModelProperty("会议附件") private String filePath; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java index 8b1f328..9856bec 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java @@ -2,7 +2,6 @@ package com.hnac.hzims.safeproduct.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.service.IConferencePlanService; @@ -110,13 +109,14 @@ public class ConferenceController extends BladeController { @GetMapping("/recordPage") @ApiImplicitParams({ - @ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "会议记录分页") @ApiOperationSupport(order = 10) public R> recordPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = conferenceRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( - param, ConferenceRecordEntity.class).lambda().orderByDesc(ConferenceRecordEntity::getCreateTime)); + IPage page = conferenceRecordService.recordPage(param, query); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java index a792243..569623e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java @@ -1,10 +1,13 @@ package com.hnac.hzims.safeproduct.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; +import org.springblade.core.mp.support.Query; import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * 会议记录服务类 @@ -41,4 +44,12 @@ public interface IConferenceRecordService extends IService recordPage(Map param, Query query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java index 6a2dcf8..dbfb3cb 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java @@ -18,6 +18,7 @@ import com.hnac.hzims.safeproduct.service.IConferencePlanService; import com.hnac.hzims.safeproduct.service.IConferenceRecordService; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -89,7 +90,7 @@ public class ConferencePlanServiceImpl extends ServiceImpl conferenceList = getConferenceByUnitAndDate(unit, startTime, endTime); - // 处理会议数据信息 + // 数据处理 conferenceList.forEach(conference -> { // 会议方式 String method; @@ -111,6 +112,9 @@ public class ConferencePlanServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + conferenceRecordDetailVO.setImages(list); + } Map params = BaseUtil.obj2Map(conferenceRecordDetailVO); String templateFile = "template/会议记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/会议记录表" + SafeProductConstant.DOCX_SUFFIX; @@ -110,13 +135,34 @@ public class ConferenceRecordServiceImpl extends ServiceImpl recordPage(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String conferencePlanId = String.valueOf(param.get("conferencePlanId")); + String startTime = String.valueOf(param.get("actualStartTime")); + String endTime = String.valueOf((param.get("actualEndTime"))); + if (!conferencePlanId.equals("null") && !conferencePlanId.equals("")) { + queryWrapper.lambda().eq(ConferenceRecordEntity::getConferencePlanId, conferencePlanId); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(ConferenceRecordEntity::getActualStartTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(ConferenceRecordEntity::getActualEndTime, endTime); + } + queryWrapper.lambda().orderByDesc(ConferenceRecordEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } + + /** * 查询是否存在同月编号 * @param currentMonth 当月 * @return 存在则返回上一编号,否则返回null */ private String getLastCode(String currentMonth) { - String month = currentMonth.substring(currentMonth.length() - 2); - List list = getConferenceByMonth(month); + List list = getConferenceByMonth(currentMonth); if (CollectionUtils.isEmpty(list)) { return null; } diff --git a/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx b/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx index fd5f3736036aac08b537891967922366f87645b8..e4af627340ce2aa44b920eac3292cf968a53fce5 100644 GIT binary patch delta 4397 zcmV+|5z_9BT)JG4H3dzCR%%|6Iv;<+Fc5_AmHG}*?uni7Q;HlT8p^3^kqG68EN4Tk zCbnf81aDubsUW@fwlgb_KkbmkrEP*U7%P;_!X(CF0FtXx$YU1nigh##1M8S9S)(Lm z;T3GSppOq^W0VHt1lYhwNSlSVb9#=DfJ3jkaT(t+Lq<~g8%mIDxaGJPOt|jQ^k_|h8r3pd( zK=#U%mSTeXf#fwaj5~j)&KxN6CZvDq&3^Dnh8+#l^^ZAFq)?7Eg=m4M{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Kv}=UmX0e?4BI` jmRAf|fllES1y-Rac;Ps6G-x1*4$bkDl7Q>+zm@+28a_?v From 92b99a680d279ffa75cc46cfda0eb762a3fac6a3 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Jan 2024 15:59:08 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=9F=B9=E8=AE=AD?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=87=E4=BB=B6=E5=AF=BC=E5=87=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/entity/TrainPlanEntity.java | 12 ++++++++++-- .../hzims/safeproduct/vo/TrainRecordDetailVO.java | 11 +++++++++++ .../safeproduct/service/impl/TestServiceImpl.java | 1 + .../service/impl/TrainPlanServiceImpl.java | 6 +++++- .../service/impl/TrainRecordServiceImpl.java | 21 ++++++++++++++++++++- .../main/resources/template/培训记录表.docx | Bin 11819 -> 11871 bytes 6 files changed, 47 insertions(+), 4 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java index 93db233..3f67a4d 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java @@ -35,13 +35,11 @@ public class TrainPlanEntity extends BaseEntity { @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("计划开始时间") - @ExcelProperty(value = "计划开始时间", index = 6) private Date scheduledStartTime; @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("计划结束时间") - @ExcelProperty(value = "计划结束时间", index = 7) private Date scheduledEndTime; @NotNull @@ -80,4 +78,14 @@ public class TrainPlanEntity extends BaseEntity { @ApiModelProperty("是否考试") @ExcelProperty(value = "是否考试", index = 5) private String hasTest; + + @TableField(exist = false) + @ApiModelProperty("计划开始时间") + @ExcelProperty(value = "计划开始时间", index = 6) + private String startTime; + + @TableField(exist = false) + @ApiModelProperty("计划结束时间") + @ExcelProperty(value = "计划结束时间", index = 7) + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java index ecf6b78..e7a6dff 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -52,4 +54,13 @@ public class TrainRecordDetailVO { @ApiModelProperty("培训附件") private String filePath; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java index eeaa00a..5573afa 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java @@ -87,6 +87,7 @@ public class TestServiceImpl extends ServiceImpl impleme /** * 删除关联考试记录 */ + @Transactional(rollbackFor = Exception.class) @Override public boolean removeRelativeTest(Long trainRecordId) { // 查询关联考试记录 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index 9dc05c5..37aabc0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java @@ -23,6 +23,7 @@ import com.hnac.hzims.safeproduct.vo.TrainMonthVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -194,7 +195,7 @@ public class TrainPlanServiceImpl extends ServiceImpl trainPlanList = getTrainPlanByUnitAndDate(unit, startTime, endTime); - // 处理字段信息 + // 数据处理 trainPlanList.forEach(train -> { // 培训状态 String status; @@ -209,6 +210,9 @@ public class TrainPlanServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + trainRecordDetailVO.setImages(list); + } + // 表头年月 + String code = trainRecordDetailVO.getCode(); + trainRecordDetailVO.setYear(code.substring(4, 8)); + trainRecordDetailVO.setMonth(code.substring(8, 10)); Map params = BaseUtil.obj2Map(trainRecordDetailVO); String templateFile = "template/培训记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/培训记录表" + SafeProductConstant.DOCX_SUFFIX; diff --git a/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx b/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx index 9fd0baffd18eeb7cb7e623adcc4a9a12093c0a85..803c5329fb305527c241bb1800dee99359a991af 100644 GIT binary patch delta 3560 zcmVmF& z@f#t@<8!QNVQJUeZKI|k!LJZf)$m56z##F zd3Jh|@S5^U!>z7r&{l%+97!3<>lAIQttrNaZ=hr*a1Q0fRi#U2U8&c&X8f70e*s5? z%y0>o31%5?fqp#@QI8aSK-Mq1=m3IaD4+yo4Gx14e|s(H()@X$Q%25G+I{Wb)W;pO z1wV*`duQZeY?>x$;x2~EAL7U5&0Y6YU#j-6IG`*MylY3f24+Ec4nPm>j>~9QA6&nc zAzazJ|B)_=b8<$*DV<)7(j5U=+h4<0wtJL?2_BbS^>bOWFHlPZ1e2{R8naLXzY7VX z744*e1ONcFvltI^0Rg*{j1WF(pL4q7Hm@G@J5Nj$@>;Ws6TTJMtVn~Xk15R zk8gPT2w4!oKwIJ8kKn6+05CVDc>?U7?=n2b2&xFE|Nl5Edp4#dn-bVN`M^`yj{oYc zRfM)(X6|4W-;h-G5fVAHlnJ=mG&-~f?;geb9o;;v1$kd@I@9^fX12av&4xerPs8bc zww|`9`?t+(zG*)VH^JZYW#@f8B8wmWzNsmAKJo{*YFaurhZn$q2{!>ja5Ly!jJviC zhU+-(%gb?h^lf~~`CKQs81{Pp@bUwl%gdnS4+p25UN`W+jd~wM@NF;(+T&h{5|B=n z0}IXl_AIZj?8(ezgV}i=AQnr48dGxvLJ?RP%grs}jvr&dJ$%fG^4Kw(P0LUWQ91^U zaf~tm78+O^;zenHmQIme)^;li`5_g6_3>cKTmo3$0kCJ*TOmL`4cZY6|YnB;Lq?_${&=NWI?(*7y)|(sp?SE zx{lVZY49?zazRZyceL}G)^jv?yA|OIutHM8Hvow4Xy^+;sVH!I?}&Zxgk+0QLcs%1 zXr5vi5ZEL2z#|PWM^oYYy?Ol)kQ%eW6Iuoe&~dZ@=Li4*KY5cS8Yq9ks)ItfN>HH& z+Q(|V9@|@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Nicx`9DlM(j(p4?odX}zY%i%0_D;6hNg`hNrE|g_gmi;i-2t0k9_`VE#oqjBT#+-Eq6C;Jvuc#oql?HXWc5W$!z15vge_H z+EkM!|M#THyO*2Wk8gIryVc!Dv*xcnJgVD^V;DmVJ#-9H#Qo@hOq+ z!?#;MexI-cltBA0=u?iC+Bq22{Egdx+fK){n@ez*gfhI!@G8R#){oWHQ7h>)x6dqH zGD+whEDiq3AedSPrIVk4vVw&pjkMy3$DvElk9{%P)bcW zJP_`}78AH%DzPIY*~(G)Ia6Ri`MgK;n65RCp0*4Gheg71XH#rNNCRUyTCA$g&Q8$Q znr*^Tl1X$x zf3nCx>n-HLNoV1SlRyPubQ~`Ep_ylNl?M z1u)=T4N{Y_D^vn91Cvh!6_Xq+Dglg>M=UY{Xp?#@I0BI;li?>GD^N=T0u%rg00008 z0EbTEKu#iw{k;eP06%yD01*HH000000096X0000Dll?3{0{J47JuM^~Ozl{QcLV?c zn+gB`5dZ)H000000RSKX0004#d@Vi!uamniJOQVZ_$@dA(33GPC Date: Tue, 23 Jan 2024 17:04:54 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=A3=80=E4=BF=AE=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=92=8C=E4=BB=BB=E5=8A=A1=E6=B7=BB=E5=8A=A0=E5=A7=93=E5=90=8D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../access/entity/OperAccessPlanEntity.java | 16 +++++++++++ .../access/entity/OperAccessStatisticsEntity.java | 8 ++++++ .../access/entity/OperAccessTaskDetailEntity.java | 4 +++ .../access/entity/OperAccessTaskEntity.java | 6 ++++ .../entity/OperMaintenancePlanEntity.java | 12 ++++++++ .../entity/OperMaintenanceTaskEntity.java | 13 +++++++++ .../hzinfo/inspect/task/entity/TaskUserEntity.java | 2 ++ .../inspect/task/controller/TaskController.java | 11 +++++--- .../service/impl/AccessPlanV4ServiceImpl.java | 20 ++++++++++++++ .../service/impl/AccessTaskV4ServiceImpl.java | 11 ++++++++ .../impl/OperAccessStatisticsServiceImpl.java | 20 +++++++++++++- .../impl/OperAccessTaskDetailServiceImpl.java | 11 ++++++++ .../service/impl/OperAccessTaskServiceImpl.java | 12 ++++++++ .../access/vo/OperAccessStatisticsVO.java | 7 ----- .../access/vo/OperAccessTaskDetailVO.java | 4 --- .../operational/access/vo/OperAccessTaskVO.java | 16 +++++------ .../wrapper/OperAccessStatisticsWrapper.java | 12 ++++---- .../wrapper/OperAccessTaskDetailWrapper.java | 8 +++--- .../access/wrapper/OperAccessTaskWrapper.java | 12 ++++---- .../duty/service/impl/ImsDutyMainServiceImpl.java | 32 +++++++++++++--------- .../duty/service/impl/ImsDutyRecServiceImpl.java | 20 ++++++++++---- .../controller/OperMaintenancePlanController.java | 17 ++++++++++++ .../wrapper/OperMaintenancePlanWrapper.java | 12 ++++---- .../wrapper/OperMaintenanceTaskWrapper.java | 24 ++++++++-------- .../file/线下工作票审批流程.bpmn20.xml | 6 ++-- 25 files changed, 237 insertions(+), 79 deletions(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java index b58b9d9..a8d6a20 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java @@ -149,7 +149,23 @@ public class OperAccessPlanEntity extends TenantEntity { @ApiModelProperty("当前步骤任务名称") private String taskName; + /** + * 技术负责人 + */ + @ApiModelProperty(value = "技术负责人") + private String techLeadName; + /** + * 管理负责人 + */ + @ApiModelProperty(value = "管理负责人") + private String managerName; @ApiModelProperty("当前环节处理人") private String nextStepOperator; + + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java index 273e5e1..336feff 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java @@ -111,4 +111,12 @@ public class OperAccessStatisticsEntity extends TenantEntity { @ApiModelProperty(value = "描述") private String descripiton; + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("修改人名称") + private String updateUserName; + + @ApiModelProperty("负责人名称") + private String managerName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java index 42c2995..fef2bc3 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java @@ -49,7 +49,11 @@ public class OperAccessTaskDetailEntity extends TenantEntity { @ApiModelProperty(value = "任务内容") private String content; + @ApiModelProperty("创建人名称") + private String createUserName; + @ApiModelProperty("修改人名称") + private String updateUserName; public void setValue(OperAccessContentDetailEntity contentDetailEntity){ contentDetailId = contentDetailEntity.getId(); content = contentDetailEntity.getContent(); diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java index cd0e6f8..27345a2 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java @@ -132,5 +132,11 @@ public class OperAccessTaskEntity extends TenantEntity { @ApiModelProperty("当前环节处理人") private String nextStepOperator; + @ApiModelProperty(value = "任务执行人") + private String handlerName; + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java index 82364f4..d1f9a3f 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.operational.maintenance.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.NullSerializer; @@ -72,6 +73,12 @@ public class OperMaintenancePlanEntity extends TenantEntity { @JsonSerialize(nullsUsing = NullSerializer.class) private Long disposer; /** + * 执行人 + */ + @ApiModelProperty(value = "执行人") + @JsonSerialize(nullsUsing = NullSerializer.class) + private String disposerName; + /** * 执行日期 */ @ApiModelProperty(value = "执行日期") @@ -114,4 +121,9 @@ public class OperMaintenancePlanEntity extends TenantEntity { */ private String stationCode; + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java index b0104d5..2f9fa11 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java @@ -71,6 +71,13 @@ public class OperMaintenanceTaskEntity extends TenantEntity { @ApiModelProperty(value = "执行人") @JsonSerialize(nullsUsing = NullSerializer.class) private String disposer; + + /** + * 执行人 + */ + @ApiModelProperty(value = "执行人") + @JsonSerialize(nullsUsing = NullSerializer.class) + private String disposerName; /** * 执行日期 */ @@ -198,4 +205,10 @@ public class OperMaintenanceTaskEntity extends TenantEntity { @ApiModelProperty("是否延期") private Boolean isDelay; + + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java index 4ff234c..4c018c6 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java @@ -50,4 +50,6 @@ public class TaskUserEntity extends TenantEntity { */ @ApiModelProperty(value = "领用时间") private LocalDateTime claimTime; + @ApiModelProperty(value = "用户ID") + private String userName; } \ No newline at end of file diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java index 3c9b55d..314dff3 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java @@ -94,11 +94,14 @@ public class TaskController extends BladeController { TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.query().lambda().eq(TaskUserEntity::getTaskId, id).eq(TaskUserEntity::getClaimStatus,ClaimStatusEnum.COLLECT.getStatus())); if(taskUserEntity!=null){ detail.setUserId(taskUserEntity.getUserId()); - User user = UserCache.getUser(taskUserEntity.getUserId()); - if(user!=null){ - String userName = user.getRealName(); - detail.setUserName(userName); + if(taskUserEntity.getUserId()!=null) { + detail.setUserName(taskUserEntity.getUserName()); } +// User user = UserCache.getUser(taskUserEntity.getUserId()); +// if(user!=null){ +// String userName = user.getRealName(); +// detail.setUserName(userName); +// } } //巡检记录 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java index 9c2a6c5..dc1f1c4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.fegin.IMessageClient; @@ -28,6 +29,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.util.CellRangeAddress; import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; @@ -39,6 +41,7 @@ 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.feign.ISysClient; +import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; @@ -120,6 +123,23 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{ entity.setCode("PLAN_" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999))); entity.setProcDefId("overhaul_plan"); entity.setActStartTime(new Date()); + if (ObjectUtil.isNotEmpty(entity.getTechLead())){ + User user = UserCache.getUser(entity.getTechLead()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setTechLeadName(user.getName()); + } + } + if (ObjectUtil.isNotEmpty(entity.getManager())){ + User user = UserCache.getUser(entity.getManager()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setManagerName(user.getName()); + } + } + BladeUser user = AuthUtil.getUser(); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){ + entity.setCreateUserName(user.getUserName()); + entity.setUpdateUserName(user.getUserName()); + } planService.save(entity); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java index ec72544..fe8dc20 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.fegin.IMessageClient; @@ -31,6 +32,7 @@ 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.feign.ISysClient; +import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; @@ -113,6 +115,14 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { private void save(AccessTaskV4DTO entity) { entity.setCode("TASK" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999))); List materialEntityList = JSONObject.parseArray(JSON.toJSONString(entity.getAccessMaterials()), OperAccessMaterialEntity.class); + if (ObjectUtil.isNotEmpty(entity.getHandler())){ + User user = UserCache.getUser(entity.getHandler()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setHandlerName(user.getName()); + entity.setCreateUserName(user.getName()); + entity.setUpdateUserName(user.getName()); + } + } taskService.save(entity); } @@ -254,6 +264,7 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { statisticsDTO.setEmCode(entity.getEmCode()); statisticsDTO.setPlanHours(entity.getPlanHours()); statisticsDTO.setManager(entity.getHandler()); + statisticsDTO.setManagerName(entity.getHandlerName()); OperAccessContentEntity content = contentService.getById(entity.getId()); if (ObjectUtil.isNotEmpty(content)) { statisticsDTO.setPid(content.getLibraryId()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java index 548fd15..15e1726 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO; import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity; import com.hnac.hzims.operational.access.excel.OperAccessStatisticsExport; @@ -16,8 +17,13 @@ import org.apache.poi.ss.usermodel.Workbook; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,7 +44,19 @@ public class OperAccessStatisticsServiceImpl extends BaseServiceImpl materialEntityList = JSONObject.parseArray(JSON.toJSONString(req.getAccessMaterials()), OperAccessMaterialEntity.class); if (super.save(req)) { if (CollectionUtil.isNotEmpty(materialEntityList)) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java index 1b085da..9dfb3f0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java @@ -20,14 +20,7 @@ public class OperAccessStatisticsVO extends OperAccessStatisticsEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - @ApiModelProperty("修改人名称") - private String updateUserName; - - @ApiModelProperty("负责人名称") - private String managerName; @ApiModelProperty(value = "任务名称") private String taskName; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java index 4281ee8..49542be 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java @@ -17,9 +17,5 @@ public class OperAccessTaskDetailVO extends OperAccessTaskDetailEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - @ApiModelProperty("修改人名称") - private String updateUserName; } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java index 1254b4c..cdc7cae 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java @@ -20,14 +20,14 @@ public class OperAccessTaskVO extends OperAccessTaskEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - - @ApiModelProperty("修改人名称") - private String updateUserName; - - @ApiModelProperty("执行人名称") - private String handlerName; +// @ApiModelProperty("创建人名称") +// private String createUserName; +// +// @ApiModelProperty("修改人名称") +// private String updateUserName; +// +// @ApiModelProperty("执行人名称") +// private String handlerName; @ApiModelProperty("状态名称") private String statusName; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java index 6489318..894278d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java @@ -24,12 +24,12 @@ public class OperAccessStatisticsWrapper extends BaseEntityWrapper OperAccessTaskVO entityVOExtras(T entity) { OperAccessTaskVO vo = BeanUtil.copy(entity, OperAccessTaskVO.class); - User createUser = UserCache.getUser(entity.getCreateUser()); - User updateUser = UserCache.getUser(entity.getUpdateUser()); - User handlerName = UserCache.getUser(entity.getHandler()); - vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null)); - vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null)); - vo.setHandlerName(Optional.ofNullable(handlerName).map(User :: getName).orElse(null)); +// User createUser = UserCache.getUser(entity.getCreateUser()); +// User updateUser = UserCache.getUser(entity.getUpdateUser()); +// User handlerName = UserCache.getUser(entity.getHandler()); +// vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null)); +// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null)); +// vo.setHandlerName(Optional.ofNullable(handlerName).map(User :: getName).orElse(null)); vo.setStatusName(DictCache.getValue(DictConstant.ACCESS_TASK_STATUS, entity.getStatus())); return vo; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java index 22831e7..fafd0e9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java @@ -177,20 +177,23 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl() {{ - eq(ImsDutyMainPersonEntity::getDutyMainId, imsSchedulingVo.getId()); - last("limit 1"); - }}); - imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson()); - } else { - ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsSchedulingVo.getGroupId()); - imsSchedulingVo.setGroupName(imsDutyGroupEntity.getGroupName()); - imsSchedulingVo.setGroupId(imsDutyGroupEntity.getId()); - imsSchedulingVo.setManagerId(imsDutyGroupEntity.getManagerId()); + if(ObjectUtil.isNotEmpty(imsSchedulingVo)) { + if (null == imsSchedulingVo.getGroupId()) { + imsSchedulingVo.setGroupName("临时班组"); + ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper() {{ + eq(ImsDutyMainPersonEntity::getDutyMainId, imsSchedulingVo.getId()); + last("limit 1"); + }}); + imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson()); + } else { + ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsSchedulingVo.getGroupId()); + imsSchedulingVo.setGroupName(imsDutyGroupEntity.getGroupName()); + imsSchedulingVo.setGroupId(imsDutyGroupEntity.getId()); + imsSchedulingVo.setManagerId(imsDutyGroupEntity.getManagerId()); + } + return imsSchedulingVo; } - return imsSchedulingVo; + return new ImsSchedulingVo(); } @Override @@ -1257,6 +1260,9 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl userR = userClient.userInfoById(imsSchedulingVo.getManagerId()); imsSchedulingVo.setManagerName(userR.getData().getName()); imsSchedulingVo.setCreateDept(userR.getData().getCreateDept()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index 83fbfed..ff91a6a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; +import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.fegin.IMessageClient; @@ -63,6 +64,7 @@ import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; import javax.annotation.Resource; +import javax.xml.ws.WebServiceException; import java.math.BigDecimal; import java.sql.Time; import java.text.SimpleDateFormat; @@ -455,6 +457,9 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpllambdaUpdate() - .set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME)) - .eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId()) - ); + ImsDutyLogEntity update = imsDutyLogService.getOne(Wrappers.lambdaQuery() + .eq(ImsDutyLogEntity::getDutyId, imsDutyLogEntity.getDutyId()) + .last("limit 1")); + update.setCarryTime(DateUtil.format(new Date(), PATTERN_DATETIME)); + imsDutyLogService.updateById(update); +// imsDutyLogService.update(Wrappers.lambdaUpdate() +// .set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME)) +// .eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId()) +// ); log.info("更新值班日志"); } ImsDutyRecEntity dutyRec = BeanUtil.copy(recDTO, ImsDutyRecEntity.class); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java index f5a2407..de37b9c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java @@ -1,10 +1,12 @@ package com.hnac.hzims.operational.maintenance.controller; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.operational.maintenance.dto.OperMaintenancePlanDTO; import com.hnac.hzims.operational.maintenance.entity.OperMaintenancePlanEntity; import com.hnac.hzims.operational.maintenance.scheduled.MaintenancePlanCreateTask; @@ -18,8 +20,12 @@ import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -59,6 +65,17 @@ public class OperMaintenancePlanController extends BladeController { public R save(@Valid @RequestBody OperMaintenancePlanEntity req) { //设备为临时任务类型 req.setTaskType("1"); + if (ObjectUtil.isNotEmpty(req.getDisposer())){ + User user = UserCache.getUser(req.getDisposer()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + req.setDisposerName(user.getName()); + } + } + BladeUser user = AuthUtil.getUser(); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){ + req.setCreateUserName(user.getUserName()); + req.setUpdateUserName(user.getUserName()); + } planService.save(req); return R.data(req); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java index ebe750f..3de3235 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java @@ -36,12 +36,12 @@ public class OperMaintenancePlanWrapper extends BaseEntityWrapper{ - List disposerList = Arrays.stream(s.split(",")).collect(Collectors.toList()); - return disposerList.stream().map(d ->{ - User user = UserCache.getUser(Long.parseLong(d)); - return Optional.ofNullable(user).map(User::getName).orElse(""); - }).collect(Collectors.joining(",")); - }).orElse(""); - vo.setDisposerName(disposerName); +// String disposerName = Optional.ofNullable(entity.getDisposer()).map(s->{ +// List disposerList = Arrays.stream(s.split(",")).collect(Collectors.toList()); +// return disposerList.stream().map(d ->{ +// User user = UserCache.getUser(Long.parseLong(d)); +// return Optional.ofNullable(user).map(User::getName).orElse(""); +// }).collect(Collectors.joining(",")); +// }).orElse(""); +// vo.setDisposerName(disposerName); return vo; } diff --git a/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml b/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml index 3e2c854..1ff2eac 100644 --- a/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml +++ b/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml @@ -1,6 +1,6 @@ - + @@ -60,8 +60,8 @@ - - + + From 9932411a799e49b18704701b5c15aa80dc606c56 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Jan 2024 18:42:51 +0800 Subject: [PATCH 6/8] =?UTF-8?q?update:=20=E6=B7=BB=E5=8A=A0=E5=8D=AB?= =?UTF-8?q?=E7=94=9F=E8=87=AA=E6=9F=A5=E8=AE=A1=E5=88=92=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/entity/HygienePlanEntity.java | 13 +++ .../hzims/safeproduct/vo/HygieneRecordPageVO.java | 3 + .../safeproduct/controller/HygieneController.java | 18 +++- .../safeproduct/mapper/HygieneRecordMapper.xml | 11 ++- .../safeproduct/service/IHygienePlanService.java | 7 ++ .../service/impl/HygienePlanServiceImpl.java | 110 ++++++++++++++++++--- .../service/impl/HygieneRecordServiceImpl.java | 17 ++-- 7 files changed, 158 insertions(+), 21 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java index f93c6c8..fd77873 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.safeproduct.entity; +import com.alibaba.excel.annotation.ExcelProperty; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; @@ -23,13 +24,16 @@ import java.util.Date; public class HygienePlanEntity extends BaseEntity { @Size(max = 50, message = "计划名称字段长度不能超过50") + @ExcelProperty(value = "计划名称", index = 0) @ApiModelProperty("计划名称") private String name; @Size(max = 50, message = "单位字段长度不能超过50") + @ExcelProperty(value = "单位", index = 1) @ApiModelProperty("单位") private String unit; + @ExcelProperty(value = "标准总分值", index = 2) @ApiModelProperty("标准总分值") private Integer standardScore; @@ -43,6 +47,15 @@ public class HygienePlanEntity extends BaseEntity { @ApiModelProperty("计划结束时间") private Date scheduledEndTime; + @ExcelProperty(value = "自查计划状态", index = 5) @ApiModelProperty("自查计划状态") private String hygienePlanStatus; + + @ExcelProperty(value = "计划开始时间", index = 3) + @ApiModelProperty("计划开始时间") + private String startTime; + + @ExcelProperty(value = "计划结束时间", index = 4) + @ApiModelProperty("计划结束时间") + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java index 9cc2f9a..17793cc 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java @@ -17,6 +17,9 @@ public class HygieneRecordPageVO { @ApiModelProperty("卫生自查记录id") private Long id; + @ApiModelProperty("卫生自查计划id") + private Long hygienePlanId; + @ApiModelProperty("单位") private String unit; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java index 0a271f9..0af5879 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java @@ -114,7 +114,10 @@ public class HygieneController extends BladeController { @GetMapping("/recordPage") @ApiImplicitParams({ - @ApiImplicitParam(name = "hygienePlanId", value = "卫生自查计划id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "hygienePlanId", value = "卫生自查计划id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualStartTime", value = "开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualEndTime", value = "结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "卫生自查记录分页") @ApiOperationSupport(order = 10) @@ -148,4 +151,17 @@ public class HygieneController extends BladeController { public void exportMonthData(@ApiIgnore @RequestParam Map param, Query query, HttpServletResponse response) { hygienePlanService.exportMonthData(param, query, response); } + + @GetMapping("/exportHygienePlanData") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "name", value = "名称", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "卫生自查计划导出") + @ApiOperationSupport(order = 14) + public void exportHygienePlanData(@ApiIgnore @RequestParam Map param, HttpServletResponse response) { + hygienePlanService.exportHygienePlanData(param, response); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml index 36b935f..9f06eb5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml @@ -14,7 +14,7 @@ diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java index 5337d07..a564531 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java @@ -85,4 +85,11 @@ public interface IHygienePlanService extends IService { * @return 卫生自查计划数据 */ List getWaitingHygienePlanInTimeRange(String startTime, String endTime); + + /** + * 卫生自查计划数据导出 + * @param param 入参 + * @param response 响应类 + */ + void exportHygienePlanData(Map param, HttpServletResponse response); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java index 4cf06fd..2c3b176 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java @@ -23,6 +23,7 @@ import com.hnac.hzims.safeproduct.vo.HygieneMonthVO; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -125,10 +126,7 @@ public class HygienePlanServiceImpl extends ServiceImpl standardScore) { - return R.fail("累计分值已超过标准总分值"); + throw new ServiceException("累计分值超过标准总分值"); } } - return sum < standardScore ? R.fail("标准总分值未全部分配") : R.data(sum); + if (sum < standardScore) { + throw new ServiceException("标准总分值未全部分配"); + } } /** @@ -297,4 +294,93 @@ public class HygienePlanServiceImpl extends ServiceImpl param, HttpServletResponse response) { + ServletOutputStream outputStream = null; + try { + outputStream = response.getOutputStream(); + String unit = String.valueOf(param.get("unit")); + String name = String.valueOf(param.get("name")); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + List hygienePlanList = getHygienePlanByUnitNameAndTime(unit, name, startTime, endTime); + // 数据处理 + hygienePlanList.forEach(plan -> { + // 卫生自查状态 + String status; + if (plan.getHygienePlanStatus().equals(HygieneStatusEnum.WAITING.getValue())) { + status = HygieneStatusEnum.WAITING.getDesc(); + } else if (plan.getHygienePlanStatus().equals(HygieneStatusEnum.UNFINISHED.getValue())) { + status = HygieneStatusEnum.UNFINISHED.getDesc(); + } else { + status = HygieneStatusEnum.FINISHED.getDesc(); + } + plan.setHygienePlanStatus(status); + // 时间格式 + plan.setStartTime(DateUtil.format(plan.getScheduledStartTime(), DateUtil.PATTERN_DATE)); + plan.setEndTime(DateUtil.format(plan.getScheduledEndTime(), DateUtil.PATTERN_DATE)); + }); + // 设置响应头 + // URLEncoder.encode防止中文乱码 + String fileName = URLEncoder.encode("卫生自查计划表", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("UTF-8"); + // ExcelWriter初始化 + ExcelWriter excelWriter = EasyExcel + .write(response.getOutputStream()) + .autoCloseStream(Boolean.TRUE) + .registerConverter(new LongStringConverter()) + .registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) + .build(); + WriteSheet writeSheet = EasyExcel.writerSheet(1, "卫生自查计划表").head(HygienePlanEntity.class) + .build(); + excelWriter.write(hygienePlanList, writeSheet); + excelWriter.finish(); + } catch (Exception e) { + // 重置response + response.reset(); + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + throw new ServiceException("卫生自查计划表数据导出异常: " + e.getMessage()); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + log.error("卫生自查计划表数据导出输出流关闭异常: " + e.getMessage()); + } + } + } + } + + /** + * 根据单位、名称、时间查询卫生自查计划 + * @param unit 单位 + * @param name 名称 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return 卫生自查计划数据 + */ + private List getHygienePlanByUnitNameAndTime(String unit, String name, String startTime, String endTime) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(HygienePlanEntity::getUnit, unit); + } + if (!name.equals("null") && !name.equals("")) { + queryWrapper.lambda().like(HygienePlanEntity::getName, name); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(HygienePlanEntity::getScheduledStartTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(HygienePlanEntity::getScheduledEndTime, endTime); + } + queryWrapper.lambda().orderByDesc(HygienePlanEntity::getCreateTime); + return this.list(queryWrapper); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java index e37c3fd..608f1ed 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java @@ -20,12 +20,14 @@ import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; import com.hnac.hzims.safeproduct.vo.HygieneZoneDetailVO; import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; +import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -73,17 +75,19 @@ public class HygieneRecordServiceImpl extends ServiceImpl hygienePlanEntity.getStandardScore()) { - return R.fail("评分不能大于标准总分值"); + throw new ServiceException("评分不能大于标准总分值"); } } boolean save = this.save(hygieneRecordEntity); @@ -178,8 +182,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl list = getHygieneByMonth(month); + List list = getHygieneByMonth(currentMonth); if (CollectionUtils.isEmpty(list)) { return null; } From fcc5554456b25398247dfed911be362c0807f46d Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Jan 2024 18:53:04 +0800 Subject: [PATCH 7/8] =?UTF-8?q?update:=20=E7=89=B9=E7=A7=8D=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/entity/DeviceEntity.java | 71 ------------ .../safeproduct/entity/SpecialDeviceEntity.java | 71 ++++++++++++ .../entity/SpecialDeviceInspectionEntity.java | 43 ++++++++ .../safeproduct/controller/DeviceController.java | 76 ------------- .../controller/SpecialDeviceController.java | 121 +++++++++++++++++++++ .../com/hnac/hzims/safeproduct/jobs/DeviceJob.java | 96 ---------------- .../hzims/safeproduct/jobs/SpecialDeviceJob.java | 96 ++++++++++++++++ .../hzims/safeproduct/mapper/DeviceMapper.java | 16 --- .../hnac/hzims/safeproduct/mapper/DeviceMapper.xml | 4 - .../mapper/SpecialDeviceInspectionMapper.java | 26 +++++ .../mapper/SpecialDeviceInspectionMapper.xml | 24 ++++ .../safeproduct/mapper/SpecialDeviceMapper.java | 16 +++ .../safeproduct/mapper/SpecialDeviceMapper.xml | 4 + .../hzims/safeproduct/service/IDeviceService.java | 22 ---- .../service/ISpecialDeviceInspectionService.java | 39 +++++++ .../safeproduct/service/ISpecialDeviceService.java | 22 ++++ .../service/impl/DeviceServiceImpl.java | 33 ------ .../impl/SpecialDeviceInspectionServiceImpl.java | 79 ++++++++++++++ .../service/impl/SpecialDeviceServiceImpl.java | 33 ++++++ 19 files changed, 574 insertions(+), 318 deletions(-) delete mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java delete mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java delete mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java delete mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java delete mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml delete mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java delete mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java deleted file mode 100644 index 486b76f..0000000 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.hnac.hzims.safeproduct.entity; - -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; - -import javax.validation.constraints.Size; -import java.util.Date; - -/** - * @author liwen - * @date 2024-01-12 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("hzims_device") -@ApiModel(value = "特种设备实体类") -public class DeviceEntity extends BaseEntity { - - @Size(max = 50, message = "设备名称长度不能超过50") - @ApiModelProperty("设备名称") - private String name; - - @Size(max = 50, message = "规格型号长度不能超过50") - @ApiModelProperty("规格型号") - private String type; - - @Size(max = 50, message = "设备编码长度不能超过50") - @ApiModelProperty("设备编码") - private String code; - - @Size(max = 255, message = "产品合格证号长度不能超过255") - @ApiModelProperty("产品合格证号") - private String qualityCertificateNo; - - @ApiModelProperty("生产日期") - private Date productionTime; - - @ApiModelProperty("使用时间") - private Date usedTime; - - @Size(max = 255, message = "使用地点长度不能超过255") - @ApiModelProperty("使用地点") - private String usedLocation; - - @ApiModelProperty("检验周期") - private Integer inspectionPeriod; - - @ApiModelProperty("本次检验日期") - private Date inspectionCurrentTime; - - @ApiModelProperty("下次检验日期") - private Date inspectionNextTime; - - @ApiModelProperty("上次检验日期") - private Date inspectionLastTime; - - @ApiModelProperty("设备管理人id") - private Long managerId; - - @Size(max = 50, message = "设备管理人长度不能超过50") - @ApiModelProperty("设备管理人") - private String manager; - - @Size(max = 20, message = "设备状态长度不能超过20") - @ApiModelProperty("设备状态") - private String deviceStatus; -} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java new file mode 100644 index 0000000..5c12f90 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java @@ -0,0 +1,71 @@ +package com.hnac.hzims.safeproduct.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import javax.validation.constraints.Size; +import java.util.Date; + +/** + * @author liwen + * @date 2024-01-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_device") +@ApiModel(value = "特种设备实体类") +public class SpecialDeviceEntity extends BaseEntity { + + @Size(max = 50, message = "设备名称长度不能超过50") + @ApiModelProperty("设备名称") + private String name; + + @Size(max = 50, message = "规格型号长度不能超过50") + @ApiModelProperty("规格型号") + private String type; + + @Size(max = 50, message = "设备编码长度不能超过50") + @ApiModelProperty("设备编码") + private String code; + + @Size(max = 255, message = "产品合格证号长度不能超过255") + @ApiModelProperty("产品合格证号") + private String qualityCertificateNo; + + @ApiModelProperty("生产日期") + private Date productionTime; + + @ApiModelProperty("使用时间") + private Date usedTime; + + @Size(max = 255, message = "使用地点长度不能超过255") + @ApiModelProperty("使用地点") + private String usedLocation; + + @ApiModelProperty("检验周期") + private Integer inspectionPeriod; + + @ApiModelProperty("本次检验日期") + private Date inspectionCurrentTime; + + @ApiModelProperty("下次检验日期") + private Date inspectionNextTime; + + @ApiModelProperty("上次检验日期") + private Date inspectionLastTime; + + @ApiModelProperty("设备管理人id") + private Long managerId; + + @Size(max = 50, message = "设备管理人长度不能超过50") + @ApiModelProperty("设备管理人") + private String manager; + + @Size(max = 20, message = "设备状态长度不能超过20") + @ApiModelProperty("设备状态") + private String deviceStatus; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java new file mode 100644 index 0000000..697de96 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java @@ -0,0 +1,43 @@ +package com.hnac.hzims.safeproduct.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import javax.validation.constraints.Size; +import java.util.Date; + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_device_inspection") +@ApiModel(value = "特种设备检验记录实体类") +public class SpecialDeviceInspectionEntity extends BaseEntity { + + @ApiModelProperty("设备id") + private Long deviceId; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("检验时间") + private Date inspectionTime; + + @Size(max = 255, message = "检验地点长度不能超过255") + @ApiModelProperty("检验地点") + private String location; + + @Size(max = 1000, message = "检验照片长度不能超过1000") + @ApiModelProperty("检验照片") + private String imgPath; + + @TableField(exist = false) + @ApiModelProperty("下次检验时间") + private Date nextInspectionTime; + + @TableField(exist = false) + @ApiModelProperty("上次检验时间") + private Date lastInspectionTime; +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java deleted file mode 100644 index c507455..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.hnac.hzims.safeproduct.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.hnac.hzims.common.utils.Condition; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; -import com.hnac.hzims.safeproduct.service.IDeviceService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.validation.Valid; -import java.util.Map; - -/** - * 特种设备管理接口类 - * - * @author liwen - * @date 2024-01-12 - */ -@RequestMapping("/device") -@AllArgsConstructor -@RestController -@Api(value = "特种设备", tags = "特种设备接口") -public class DeviceController extends BladeController { - - private final IDeviceService deviceService; - - @PostMapping("/save") - @ApiOperation(value = "新增") - @ApiOperationSupport(order = 1) - public R save(@Valid @RequestBody DeviceEntity deviceEntity) { - return R.status(deviceService.save(deviceEntity)); - } - - @PostMapping("/update") - @ApiOperation(value = "修改") - @ApiOperationSupport(order = 2) - public R update(@Valid @RequestBody DeviceEntity deviceEntity) { - return R.status(deviceService.updateById(deviceEntity)); - } - - @PostMapping("/remove") - @ApiOperation(value = "删除") - @ApiOperationSupport(order = 3) - public R remove(@RequestParam Long id) { - return R.status(deviceService.removeById(id)); - } - - @GetMapping("/detail") - @ApiOperation(value = "详情") - @ApiOperationSupport(order = 4) - public R detail(@RequestParam Long id) { - return R.data(deviceService.getById(id)); - } - - @GetMapping("/page") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "设备名称", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "deviceStatus", value = "设备状态", dataType = "query", paramType = "string") - }) - @ApiOperation(value = "分页") - @ApiOperationSupport(order = 5) - public R> page(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = deviceService.page(Condition.getPage(query), Condition.getQueryWrapper(param, DeviceEntity.class) - .lambda().orderByDesc(DeviceEntity::getCreateTime)); - return R.data(page); - } -} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java new file mode 100644 index 0000000..4013e52 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java @@ -0,0 +1,121 @@ +package com.hnac.hzims.safeproduct.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.common.utils.Condition; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceInspectionService; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.validation.Valid; +import java.util.Map; + +/** + * 特种设备管理接口类 + * + * @author liwen + * @date 2024-01-12 + */ +@RequestMapping("/specialDevice") +@AllArgsConstructor +@RestController +@Api(value = "特种设备", tags = "特种设备接口") +public class SpecialDeviceController extends BladeController { + + private final ISpecialDeviceService specialDeviceService; + + private final ISpecialDeviceInspectionService specialDeviceInspectionService; + + @PostMapping("/save") + @ApiOperation(value = "新增设备") + @ApiOperationSupport(order = 1) + public R save(@Valid @RequestBody SpecialDeviceEntity specialDeviceEntity) { + return R.status(specialDeviceService.save(specialDeviceEntity)); + } + + @PostMapping("/update") + @ApiOperation(value = "修改设备") + @ApiOperationSupport(order = 2) + public R update(@Valid @RequestBody SpecialDeviceEntity specialDeviceEntity) { + return R.status(specialDeviceService.updateById(specialDeviceEntity)); + } + + @PostMapping("/remove") + @ApiOperation(value = "删除设备") + @ApiOperationSupport(order = 3) + public R remove(@RequestParam Long id) { + return R.status(specialDeviceService.removeById(id)); + } + + @GetMapping("/detail") + @ApiOperation(value = "设备详情") + @ApiOperationSupport(order = 4) + public R detail(@RequestParam Long id) { + return R.data(specialDeviceService.getById(id)); + } + + @GetMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "设备名称", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "deviceStatus", value = "设备状态", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "设备分页") + @ApiOperationSupport(order = 5) + public R> page(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = specialDeviceService.page(Condition.getPage(query), Condition.getQueryWrapper(param, SpecialDeviceEntity.class) + .lambda().orderByDesc(SpecialDeviceEntity::getCreateTime)); + return R.data(page); + } + + @PostMapping("/saveInspection") + @ApiOperation(value = "新增设备检验记录") + @ApiOperationSupport(order = 6) + public R saveInspection(@Valid @RequestBody SpecialDeviceInspectionEntity specialDeviceInspectionEntity) { + return R.status(specialDeviceInspectionService.saveInspection(specialDeviceInspectionEntity)); + } + + @PostMapping("/updateInspection") + @ApiOperation(value = "修改设备检验记录") + @ApiOperationSupport(order = 7) + public R updateInspection(@Valid @RequestBody SpecialDeviceInspectionEntity specialDeviceInspectionEntity) { + return R.status(specialDeviceInspectionService.updateInspection(specialDeviceInspectionEntity)); + } + + @PostMapping("/removeInspection") + @ApiOperation(value = "删除设备检验记录") + @ApiOperationSupport(order = 8) + public R removeInspection(@RequestParam Long id) { + return R.status(specialDeviceInspectionService.removeById(id)); + } + + @GetMapping("/inspectionDetail") + @ApiOperation(value = "设备检验记录详情") + @ApiOperationSupport(order = 9) + public R inspectionDetail(@RequestParam Long id) { + return R.data(specialDeviceInspectionService.getById(id)); + } + + @GetMapping("/inspectionPage") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceId", value = "设备id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "设备检验记录分页") + @ApiOperationSupport(order = 10) + public R> inspectionPage(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = specialDeviceInspectionService.getInspectionPage(param, query); + return R.data(page); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java deleted file mode 100644 index 81b4964..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.hnac.hzims.safeproduct.jobs; - -import com.hnac.hzims.common.constant.CommonConstant; -import com.hnac.hzims.common.logs.utils.StringUtils; -import com.hnac.hzims.message.dto.BusinessMessageDTO; -import com.hnac.hzims.message.fegin.IMessageClient; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; -import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; -import com.hnac.hzims.safeproduct.service.IDeviceService; -import com.xxl.job.core.biz.model.ReturnT; -import com.xxl.job.core.handler.annotation.XxlJob; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.DateUtil; -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.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; - -import java.util.Date; -import java.util.List; - -/** - * 特种设备模块定时任务 - * - * @author liwen - * @date 2024-01-16 - */ -@Slf4j -@Component -public class DeviceJob { - - @Autowired - IDeviceService deviceService; - - @Autowired - IUserClient userClient; - - @Autowired - ISysClient sysClient; - - @Autowired - IMessageClient messageClient; - - @XxlJob("autoChangeDeviceStatus") - public ReturnT autoChangeDeviceStatus(String param) { - // 获取时间范围 - Date current = DateUtil.now(); - Date before = DateUtil.minusDays(current, 1); - String today = DateUtil.format(current, DateUtil.PATTERN_DATE); - String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE); - // 查询昨天的过期设备 - List list = deviceService.getExpiredDeviceByTime(yesterday, today); - if (CollectionUtils.isEmpty(list)) { - return ReturnT.SUCCESS; - } - list.forEach(device -> { - device.setDeviceStatus(DeviceStatusEnum.EXPIRED.getValue()); - sendExpiredMessage(device); - }); - // 更新状态 - boolean update = deviceService.updateBatchById(list); - return update ? ReturnT.SUCCESS : ReturnT.FAIL; - } - - /** - * 推送设备过期消息 - * @param deviceEntity 特种设备实体类 - */ - private void sendExpiredMessage(DeviceEntity deviceEntity) { - if (deviceEntity.getManagerId() == null) { - log.error("系统无该用户信息,推送设备过期消息失败"); - return; - } - // 查询用户 - R userRes = userClient.userInfoById(deviceEntity.getManagerId()); - User user = userRes.getData(); - BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); - if (StringUtils.isNotEmpty(user.getDeptId())) { - Long id = Long.valueOf(user.getDeptId()); - businessMessageDTO.setDeptId(id); - businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); - businessMessageDTO.setBusinessKey("设备到期"); - businessMessageDTO.setBusinessClassify("system"); - businessMessageDTO.setTaskId(deviceEntity.getId()); - businessMessageDTO.setSubject("设备到期通知"); - businessMessageDTO.setContent("您所管理的特种设备" + deviceEntity.getName() + "已到期,请尽快进行检验。"); - businessMessageDTO.setUserIds(String.valueOf(deviceEntity.getManagerId())); - businessMessageDTO.setCreateUser(deviceEntity.getCreateUser()); - businessMessageDTO.setTenantId(CommonConstant.TENANT_ID); - } - messageClient.sendAppAndWsMsgByUsers(businessMessageDTO); - } -} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java new file mode 100644 index 0000000..e6ec1ab --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java @@ -0,0 +1,96 @@ +package com.hnac.hzims.safeproduct.jobs; + +import com.hnac.hzims.common.constant.CommonConstant; +import com.hnac.hzims.common.logs.utils.StringUtils; +import com.hnac.hzims.message.dto.BusinessMessageDTO; +import com.hnac.hzims.message.fegin.IMessageClient; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; +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.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.List; + +/** + * 特种设备模块定时任务 + * + * @author liwen + * @date 2024-01-16 + */ +@Slf4j +@Component +public class SpecialDeviceJob { + + @Autowired + ISpecialDeviceService deviceService; + + @Autowired + IUserClient userClient; + + @Autowired + ISysClient sysClient; + + @Autowired + IMessageClient messageClient; + + @XxlJob("autoChangeDeviceStatus") + public ReturnT autoChangeDeviceStatus(String param) { + // 获取时间范围 + Date current = DateUtil.now(); + Date before = DateUtil.minusDays(current, 1); + String today = DateUtil.format(current, DateUtil.PATTERN_DATE); + String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE); + // 查询昨天的过期设备 + List list = deviceService.getExpiredDeviceByTime(yesterday, today); + if (CollectionUtils.isEmpty(list)) { + return ReturnT.SUCCESS; + } + list.forEach(device -> { + device.setDeviceStatus(DeviceStatusEnum.EXPIRED.getValue()); + sendExpiredMessage(device); + }); + // 更新状态 + boolean update = deviceService.updateBatchById(list); + return update ? ReturnT.SUCCESS : ReturnT.FAIL; + } + + /** + * 推送设备过期消息 + * @param specialDeviceEntity 特种设备实体类 + */ + private void sendExpiredMessage(SpecialDeviceEntity specialDeviceEntity) { + if (specialDeviceEntity.getManagerId() == null) { + log.error("系统无该用户信息,推送设备过期消息失败"); + return; + } + // 查询用户 + R userRes = userClient.userInfoById(specialDeviceEntity.getManagerId()); + User user = userRes.getData(); + BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); + if (StringUtils.isNotEmpty(user.getDeptId())) { + Long id = Long.valueOf(user.getDeptId()); + businessMessageDTO.setDeptId(id); + businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); + businessMessageDTO.setBusinessKey("设备到期"); + businessMessageDTO.setBusinessClassify("system"); + businessMessageDTO.setTaskId(specialDeviceEntity.getId()); + businessMessageDTO.setSubject("设备到期通知"); + businessMessageDTO.setContent("您所管理的特种设备" + specialDeviceEntity.getName() + "已到期,请尽快进行检验。"); + businessMessageDTO.setUserIds(String.valueOf(specialDeviceEntity.getManagerId())); + businessMessageDTO.setCreateUser(specialDeviceEntity.getCreateUser()); + businessMessageDTO.setTenantId(CommonConstant.TENANT_ID); + } + messageClient.sendAppAndWsMsgByUsers(businessMessageDTO); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java deleted file mode 100644 index c15512d..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hnac.hzims.safeproduct.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 特种设备Mapper类 - * - * @author liwen - * @date 2024-01-12 - */ -@Mapper -public interface DeviceMapper extends BaseMapper { - -} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml deleted file mode 100644 index a863567..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java new file mode 100644 index 0000000..fec09d7 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.safeproduct.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.Map; + +/** + * 特种设备检验记录Mapper类 + * + * @author liwen + * @date 2024-01-22 + */ +@Mapper +public interface SpecialDeviceInspectionMapper extends BaseMapper { + + /** + * 设备检验记录分页 + * @param param 入参 + * @param page 分页类 + * @return 设备检验记录数据 + */ + IPage getInspectionPage(IPage page, Map param); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml new file mode 100644 index 0000000..adf843b --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java new file mode 100644 index 0000000..1c2ace4 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.safeproduct.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 特种设备Mapper类 + * + * @author liwen + * @date 2024-01-12 + */ +@Mapper +public interface SpecialDeviceMapper extends BaseMapper { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml new file mode 100644 index 0000000..f9520d9 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java deleted file mode 100644 index 5500bf9..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.hnac.hzims.safeproduct.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; - -import java.util.List; - -/** - * 特种设备服务类 - * - * @author liwen - * @date 2024-01-12 - */ -public interface IDeviceService extends IService { - - /** - * 查找时间范围内的过期设备 - * @param startTime 开始时间 - * @param endTime 结束时间 - */ - List getExpiredDeviceByTime(String startTime, String endTime); -} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java new file mode 100644 index 0000000..c751eda --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java @@ -0,0 +1,39 @@ +package com.hnac.hzims.safeproduct.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; +import org.springblade.core.mp.support.Query; + +import java.util.Map; + +/** + * 特种设备检验记录服务类 + * + * @author liwen + * @date 2024-01-22 + */ +public interface ISpecialDeviceInspectionService extends IService { + + /** + * 新增设备检验记录 + * @param specialDeviceInspectionEntity 特种设备检验记录实体类 + * @return true-成功,false-失败 + */ + boolean saveInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity); + + /** + * 修改设备检验记录 + * @param specialDeviceInspectionEntity 特种设备检验记录实体类 + * @return true-成功,false-失败 + */ + boolean updateInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity); + + /** + * 设备检验记录分页 + * @param param 入参 + * @param query 分页类 + * @return 设备检验记录数据 + */ + IPage getInspectionPage(Map param, Query query); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java new file mode 100644 index 0000000..ebcbe1c --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.safeproduct.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; + +import java.util.List; + +/** + * 特种设备服务类 + * + * @author liwen + * @date 2024-01-12 + */ +public interface ISpecialDeviceService extends IService { + + /** + * 查找时间范围内的过期设备 + * @param startTime 开始时间 + * @param endTime 结束时间 + */ + List getExpiredDeviceByTime(String startTime, String endTime); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java deleted file mode 100644 index bee1994..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.hnac.hzims.safeproduct.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; -import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; -import com.hnac.hzims.safeproduct.mapper.DeviceMapper; -import com.hnac.hzims.safeproduct.service.IDeviceService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 特种设备服务实现类 - * - * @author liwen - * @date 2024-01-12 - */ -@Service -public class DeviceServiceImpl extends ServiceImpl implements IDeviceService { - - /** - * 查找时间范围内的过期设备 - */ - @Override - public List getExpiredDeviceByTime(String startTime, String endTime) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(DeviceEntity::getDeviceStatus, DeviceStatusEnum.NORMAL.getValue()) - .ge(DeviceEntity::getInspectionNextTime, startTime) - .le(DeviceEntity::getInspectionNextTime, endTime); - return this.list(queryWrapper); - } -} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java new file mode 100644 index 0000000..7bfd8c2 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java @@ -0,0 +1,79 @@ +package com.hnac.hzims.safeproduct.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; +import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; +import com.hnac.hzims.safeproduct.mapper.SpecialDeviceInspectionMapper; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceInspectionService; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; +import org.springblade.core.mp.support.Query; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Map; + +/** + * 特种设备检验记录服务实现类 + * + * @author liwen + * @date 2024-01-22 + */ +@Service +public class SpecialDeviceInspectionServiceImpl extends ServiceImpl implements ISpecialDeviceInspectionService { + + @Autowired + ISpecialDeviceService deviceService; + + /** + * 新增设备检验记录 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public boolean saveInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity) { + boolean save = this.save(specialDeviceInspectionEntity); + if (save) { + SpecialDeviceEntity specialDeviceEntity = deviceService.getById(specialDeviceInspectionEntity.getDeviceId()); + if (specialDeviceEntity != null) { + specialDeviceEntity.setInspectionLastTime(specialDeviceInspectionEntity.getLastInspectionTime()); + specialDeviceEntity.setInspectionCurrentTime(specialDeviceInspectionEntity.getInspectionTime()); + specialDeviceEntity.setInspectionNextTime(specialDeviceInspectionEntity.getNextInspectionTime()); + specialDeviceEntity.setDeviceStatus(DeviceStatusEnum.NORMAL.getValue()); + return deviceService.updateById(specialDeviceEntity); + } + } + return false; + } + + /** + * 修改设备检验记录 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public boolean updateInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity) { + boolean update = this.updateById(specialDeviceInspectionEntity); + if (update) { + SpecialDeviceEntity specialDeviceEntity = deviceService.getById(specialDeviceInspectionEntity.getDeviceId()); + if (specialDeviceEntity != null) { + specialDeviceEntity.setInspectionLastTime(specialDeviceInspectionEntity.getLastInspectionTime()); + specialDeviceEntity.setInspectionCurrentTime(specialDeviceInspectionEntity.getInspectionTime()); + specialDeviceEntity.setInspectionNextTime(specialDeviceInspectionEntity.getNextInspectionTime()); + return deviceService.updateById(specialDeviceEntity); + } + } + return false; + } + + /** + * 设备检验记录分页 + */ + @Override + public IPage getInspectionPage(Map param, Query query) { + IPage page = new Page<>(query.getCurrent(), query.getSize()); + return baseMapper.getInspectionPage(page, param); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java new file mode 100644 index 0000000..179568e --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.safeproduct.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; +import com.hnac.hzims.safeproduct.mapper.SpecialDeviceMapper; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 特种设备服务实现类 + * + * @author liwen + * @date 2024-01-12 + */ +@Service +public class SpecialDeviceServiceImpl extends ServiceImpl implements ISpecialDeviceService { + + /** + * 查找时间范围内的过期设备 + */ + @Override + public List getExpiredDeviceByTime(String startTime, String endTime) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SpecialDeviceEntity::getDeviceStatus, DeviceStatusEnum.NORMAL.getValue()) + .ge(SpecialDeviceEntity::getInspectionNextTime, startTime) + .le(SpecialDeviceEntity::getInspectionNextTime, endTime); + return this.list(queryWrapper); + } +} From ca21f0d8112d74b3c5763a1a99cef2ab65c11f79 Mon Sep 17 00:00:00 2001 From: liwen Date: Wed, 24 Jan 2024 10:08:50 +0800 Subject: [PATCH 8/8] =?UTF-8?q?update:=20=E6=93=8D=E4=BD=9C=E7=A5=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=9C=E5=BA=9F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/ticket/constants/TicketConstants.java | 6 +++ .../entity/StandardTicketInfoEntity.java | 41 ++---------------- .../service/impl/OperationTicketServiceImpl.java | 15 ++++--- .../vo/operation/StandardTicketInfoVo.java | 48 ++-------------------- 4 files changed, 23 insertions(+), 87 deletions(-) diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java index 320d3e0..03808ec 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java @@ -25,6 +25,12 @@ public interface TicketConstants { String LICENSOR_ROLE = "licensor"; /** + * 操作票监护人确认结果 + */ + String OPERATION_TICKET_APPROVED = "approved"; + String OPERATION_TICKET_REJECTED = "rejected"; + + /** * 工作票安措新增类型 **/ String DUTY_PATTERN = "1"; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java index ec3aa06..ade487d 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.ticket.standardTicket.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; @@ -106,7 +107,6 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab @ApiModelProperty("是否评价") private Integer isEvaluate; - /** * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性 * 站点标识-两票编码 @@ -114,65 +114,30 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab @ApiModelProperty("站点标识-两票编码") private String signage; - - /** - * 编号(原站点ID) - */ @ApiModelProperty("编号(原站点ID)") private String signageCode; - - /** - * 流程状态' - */ @ApiModelProperty("流程状态") private Integer flowStatus; - /** - * 流程描述 - */ @ApiModelProperty("流程描述") private String flowDescription; - - /** - * 下一个审批人 - */ @ApiModelProperty("下一个审批人") private String nextStepOperator; - - /** - * 用户Id - */ @ApiModelProperty("用户Id") private String flowUserId; - - /** - * 当前任务名 - */ @ApiModelProperty("当前任务名") private String flowTaskName; - - /** - * 当前任务名 - */ @ApiModelProperty("当前任务名") private String flowTaskId; - - /** - * 项目 - */ @ApiModelProperty("项目") private String projectName; - - /** - * - */ @ApiModelProperty("分组") private String classGroupName; @@ -182,7 +147,6 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab @ApiModelProperty("更新人名称") private String updateUserName; - @ApiModelProperty("发令人名称") private String issueOrderPersonName; @@ -195,4 +159,7 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab @ApiModelProperty("许可人名称") private String guardianName; + @TableField(exist = false) + @ApiModelProperty("监护人确认结果:approved-确认,rejected-作废") + private String verifyResult; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index d4c5c2c..05f9fa7 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java @@ -303,11 +303,16 @@ public class OperationTicketServiceImpl implements OperationTicketService { String taskId = response.getTaskId(); log.info("StringUtils.isBlank(taskId) = " + StringUtils.isBlank(taskId)); if (StringUtils.isBlank(taskId)) { - newStandardTicketInfoEntity.setFlowDescription("结束"); - newStandardTicketInfoEntity.setFlowTaskId(" "); - newStandardTicketInfoEntity.setFlowTaskName("结束"); - newStandardTicketInfoEntity.setNextStepOperator(" "); - newStandardTicketInfoEntity.setFlowStatus(999); + if (newStandardTicketInfoEntity.equals(TicketConstants.OPERATION_TICKET_APPROVED)) { + newStandardTicketInfoEntity.setFlowDescription("结束"); + newStandardTicketInfoEntity.setFlowTaskId(" "); + newStandardTicketInfoEntity.setFlowTaskName("结束"); + newStandardTicketInfoEntity.setNextStepOperator(" "); + newStandardTicketInfoEntity.setFlowStatus(999); + } else { + newStandardTicketInfoEntity.setFlowDescription("作废"); + newStandardTicketInfoEntity.setFlowTaskName("作废"); + } } else { //如果response.getHandleType() 是0使用户 newStandardTicketInfoEntity.setFlowUserId(response.getUserId()); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java index 9d8cd24..e777e6e 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java @@ -3,6 +3,7 @@ package com.hnac.hzims.ticket.twoTicket.vo.operation; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.springblade.core.tenant.mp.TenantEntity; import org.springframework.format.annotation.DateTimeFormat; @@ -17,22 +18,19 @@ import java.util.List; * @Date 2023/6/6 15:39 */ @Data +@EqualsAndHashCode(callSuper = true) @Accessors(chain = true) public class StandardTicketInfoVo extends TenantEntity { - @ApiModelProperty("票据类型") private String ticketType; - - @ApiModelProperty("单位") private String company; @ApiModelProperty("工作流ID") private String processInstanceId; - @ApiModelProperty("编号") private String code; @@ -97,7 +95,6 @@ public class StandardTicketInfoVo extends TenantEntity { @ApiModelProperty("是否评价") private Integer isEvaluate; - /** * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性 * 站点标识-两票编码 @@ -105,70 +102,33 @@ public class StandardTicketInfoVo extends TenantEntity { @ApiModelProperty("站点标识-两票编码") private String signage; - - /** - * 项目 - */ @ApiModelProperty("项目") private String projectName; - - /** - * - */ @ApiModelProperty("分组") private String classGroupName; - - /** - * 编号(原站点ID) - */ @ApiModelProperty("编号(原站点ID)") private String signageCode; - /** - * 流程状态' - */ @ApiModelProperty("流程状态") private Integer flowStatus; - /** - * 流程描述 - */ @ApiModelProperty("流程描述") private String flowDescription; - - - /** - * 下一个审批人 - */ @ApiModelProperty("下一个审批人") private String nextStepOperator; - - /** - * 用户Id - */ @ApiModelProperty("用户Id") private String flowUserId; - - /** - * 当前任务名 - */ @ApiModelProperty("当前任务名") private String flowTaskName; - - /** - * 当前任务名 - */ @ApiModelProperty("当前任务名") private String flowTaskId; - - @ApiModelProperty("创建人名称") private String createUserName; @@ -190,8 +150,6 @@ public class StandardTicketInfoVo extends TenantEntity { @ApiModelProperty("许可人名称") private String guardianName; - /** - * 安全措施 - */ + @ApiModelProperty("安全措施") private List standardTicketMeasureVos; }