From 7596ef709fa4b7f8720286062e0ded46066948bb Mon Sep 17 00:00:00 2001 From: liwen Date: Thu, 18 Jan 2024 15:13:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8D=AB=E7=94=9F?= =?UTF-8?q?=E8=87=AA=E6=9F=A5=E3=80=81=E8=BD=A6=E8=BE=86=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=81=E7=89=B9=E7=A7=8D=E8=AE=BE=E5=A4=87=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/safeproduct/entity/CarEntity.java | 1 - .../hnac/hzims/safeproduct/entity/DeviceEntity.java | 3 +++ .../hzims/safeproduct/vo/HygieneRecordDetailVO.java | 3 +++ .../safeproduct/controller/DeviceController.java | 6 +++--- .../com/hnac/hzims/safeproduct/jobs/CarJob.java | 10 ++++++++++ .../safeproduct/mapper/CarMaintenanceMapper.xml | 2 +- .../safeproduct/mapper/HygieneRecordMapper.xml | 2 +- .../service/impl/CarMaintenanceServiceImpl.java | 2 +- .../safeproduct/service/impl/CarServiceImpl.java | 4 ++-- .../safeproduct/src/main/resources/db/1.0.2.sql | 5 +++-- .../main/resources/template/卫生自查表.docx | Bin 11350 -> 11332 bytes .../resources/template/车辆维保记录单.docx | Bin 11896 -> 11915 bytes 12 files changed, 27 insertions(+), 11 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java index 4a0beb3..4db2df7 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarEntity.java @@ -88,7 +88,6 @@ public class CarEntity extends BaseEntity { @ApiModelProperty("保养状态") private String maintenanceStatus; - @NotNull @ApiModelProperty("车辆管理人id") private Long managerId; 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 index 34776c9..486b76f 100644 --- 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 @@ -58,6 +58,9 @@ public class DeviceEntity extends BaseEntity { @ApiModelProperty("上次检验日期") private Date inspectionLastTime; + @ApiModelProperty("设备管理人id") + private Long managerId; + @Size(max = 50, message = "设备管理人长度不能超过50") @ApiModelProperty("设备管理人") private String manager; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java index da9328f..1aeae76 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordDetailVO.java @@ -24,6 +24,9 @@ public class HygieneRecordDetailVO { @ApiModelProperty("检查人") private String checkUser; + @ApiModelProperty("检查时间") + private Date checkTime; + @ApiModelProperty("责任区id") private String hygieneZoneIds; 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 index 768b523..c507455 100644 --- 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 @@ -43,7 +43,7 @@ public class DeviceController extends BladeController { @PostMapping("/update") @ApiOperation(value = "修改") @ApiOperationSupport(order = 2) - public R update(DeviceEntity deviceEntity) { + public R update(@Valid @RequestBody DeviceEntity deviceEntity) { return R.status(deviceService.updateById(deviceEntity)); } @@ -63,8 +63,8 @@ public class DeviceController extends BladeController { @GetMapping("/page") @ApiImplicitParams({ - @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "plateNumber", value = "车牌号", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "name", value = "设备名称", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "deviceStatus", value = "设备状态", dataType = "query", paramType = "string") }) @ApiOperation(value = "分页") @ApiOperationSupport(order = 5) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java index e386ef5..c150dd7 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java @@ -12,6 +12,7 @@ import com.hnac.hzims.safeproduct.service.ICarMaintenanceService; import com.hnac.hzims.safeproduct.service.ICarService; 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.secure.utils.AuthUtil; import org.springblade.core.tool.utils.DateUtil; import org.springblade.system.feign.ISysClient; @@ -29,6 +30,7 @@ import java.util.List; * @author liwen * @date 2024-01-11 */ +@Slf4j @Component public class CarJob { @@ -92,6 +94,10 @@ public class CarJob { * @param carEntity 车辆实体类 */ private void sendUninsuredMessage(CarEntity carEntity) { + if (carEntity.getManagerId() == null) { + log.error("系统无该用户信息,推送车保过期消息失败"); + return; + } BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); String deptId = AuthUtil.getDeptId(); if (StringUtils.isNotEmpty(deptId)) { @@ -115,6 +121,10 @@ public class CarJob { * @param carEntity 车辆实体类 */ private void sendUnMaintainedMessage(CarEntity carEntity) { + if (carEntity.getManagerId() == null) { + log.error("系统无该用户信息,推送维保过期消息失败"); + return; + } BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); String deptId = AuthUtil.getDeptId(); if (StringUtils.isNotEmpty(deptId)) { diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml index e9f9afc..4f71d3e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml @@ -5,7 +5,7 @@ SELECT code, actual_end_time, check_user, hygiene_zone_ids, check_result,comprehensive_score, week_num, - img_path, hygiene_plan_id + img_path, hygiene_plan_id, check_time FROM hzims_hygiene_record WHERE diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java index 9672634..ad95b50 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java @@ -99,7 +99,7 @@ public class CarMaintenanceServiceImpl extends ServiceImpl implements queryWrapper.lambda().eq(CarEntity::getPlateNumber, carEntity.getPlateNumber()); CarEntity car = this.getOne(queryWrapper); if (car == null) { + carEntity.setMaintenanceStatus(CarMaintenanceStatusEnum.UNMAINTAINED.getValue()); return R.status(this.save(carEntity)); } return R.fail("车牌号已存在"); diff --git a/hzims-service/safeproduct/src/main/resources/db/1.0.2.sql b/hzims-service/safeproduct/src/main/resources/db/1.0.2.sql index 054a765..f315d37 100644 --- a/hzims-service/safeproduct/src/main/resources/db/1.0.2.sql +++ b/hzims-service/safeproduct/src/main/resources/db/1.0.2.sql @@ -240,7 +240,7 @@ CREATE TABLE `hzims_car` ( `maintenance_next_time` date DEFAULT NULL COMMENT '下期保养时间', `maintenance_mileage` decimal(10, 2) DEFAULT NULL COMMENT '保养里程', `maintenance_status` varchar(50) DEFAULT NULL COMMENT '保养状态', - `manager_id` bigint(20) NOT NULL COMMENT '车辆管理人id', + `manager_id` bigint(20) DEFAULT NULL COMMENT '车辆管理人id', `manager` varchar(50) NOT NULL COMMENT '车辆管理人', `img_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆图片', `file_path` varchar(1000) NOT NULL DEFAULT '' COMMENT '车辆附件', @@ -345,7 +345,7 @@ CREATE TABLE `hzims_device` ( `name` varchar(50) NOT NULL COMMENT '设备名称', `type` varchar(50) NOT NULL DEFAULT '' COMMENT '规格型号', `code` varchar(50) NOT NULL COMMENT '编码', - `quality_cerfiticate_no` varchar(255) NOT NULL DEFAULT '' COMMENT '产品合格证号', + `quality_certificate_no` varchar(255) NOT NULL DEFAULT '' COMMENT '产品合格证号', `production_time` date DEFAULT NULL COMMENT '生产日期', `used_time` date DEFAULT NULL COMMENT '使用日期', `used_location` varchar(255) NOT NULL DEFAULT '' COMMENT '使用地点', @@ -353,6 +353,7 @@ CREATE TABLE `hzims_device` ( `inspection_current_time` date DEFAULT NULL COMMENT '本次检验日期', `inspection_next_time` date DEFAULT NULL COMMENT '下次检验日期', `inspection_last_time` date DEFAULT NULL COMMENT '上次检验日期', + `manager_id` bigint(20) DEFAULT NULL COMMENT '设备管理人id', `manager` varchar(50) NOT NULL DEFAULT '' COMMENT '设备管理人', `device_status` varchar(20) NOT NULL DEFAULT 'NORMAL' COMMENT '设备状态', `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', diff --git a/hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx b/hzims-service/safeproduct/src/main/resources/template/卫生自查表.docx index 07d4aa615bc814daac8cbd789ade58824904329e..80ba5d7281dbf818c957b6d18d8f18f174a2e001 100644 GIT binary patch delta 3891 zcmZ9PXEYlQ--Z*L+M-tMl^CV=3>u0mLhTWI*QmYPn58yB)h=SxsGZtsQ+r1#HL6Bx zR%^80|NlJayw5q$m*0oqx$m#neXd2b0kbq|;;Dnj{K#|#PE?;bZOl>D6}7>SR|UsU z5|Zesc8prIVtm!Jo3v{LTAkR4ylpC~xVkP{C52N}@M$|3&nQV|;Y_O-?WBGHpJ{B` z0?+Dhp6gwb#rx*<54Fu=OzXd9z+h>$2CPX8wuGGAc%GVqIlmZ@_ivqKE$*ywpbG&l2r@Lmre_@vS=J4Pzx&6xor$9s16{#MRnYIP%l&WEhtU|)A(0_e>-9V zc;)=My+fCOM5Pw#rD(HWpKdwkmi_*qjnv$m)47Y8+ZAC=70_sYB;Xb!h;vMGVXnX> z6x-3CV17gtCHXA zxrqsdp+6w;F7DF2PkJXS((;L$cpczCn$HOZU4pJCR6vKaz11Yxq^K9-55}~<<<35> zcfNV!3DArguO}KN@}tD6+R&)a^AdBWT@7ZktNKv#Yau2##mP>vOOfdpQ+Em^e8>9O z{m;r_KXOEW8-Q2CEGdWD>!L$v2VGC&em@KFTT)&SGrBefBeKc9w3My_{J1(vR8wv7 zdSm_D`wBKCB0L6%=xLe?`L<%dk{Bia-`o2~*k0ah3Eb}R=iO_M1D2GPkj(LRW6Aaa z;O43LhZn+dIb6pr+N%)FlI*~$ueqleQG@rkHEj;dj3wuIZT-{Fyiu&_9^uj*a_7Y^a0&-fzLD(G#WMRbmP1bN+q?DNi+Me}9%D#v6NLnfYnaE=Z)%j~hR zsp!jXnW@}Ywk)%J0-4{RSI>Fbgk-VIocWISkEx^6)hYP1S1M!d+xW=qV0!Ss2{zU8 zAni%%#pJM&-HN;?J##Pv~{{JoD@TdL<+C z)^*Lc@Uod1qydOYqx>E{lK9!I^lc+?jm4-(J&G^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 3223c2296253e3fa1d69e277f539b8190c0dc59d Mon Sep 17 00:00:00 2001 From: liwen Date: Thu, 18 Jan 2024 15:58:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E8=BD=A6=E8=BE=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/safeproduct/jobs/CarJob.java | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java index c150dd7..dc9baef 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java @@ -14,8 +14,11 @@ 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.secure.utils.AuthUtil; +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.transaction.annotation.Transactional; @@ -46,6 +49,9 @@ public class CarJob { @Autowired ISysClient sysClient; + @Autowired + IUserClient userClient; + /** * 车辆台账自动变更 */ @@ -98,10 +104,12 @@ public class CarJob { log.error("系统无该用户信息,推送车保过期消息失败"); return; } + // 查询用户 + R userRes = userClient.userInfoById(carEntity.getManagerId()); + User user = userRes.getData(); BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); - String deptId = AuthUtil.getDeptId(); - if (StringUtils.isNotEmpty(deptId)) { - Long id = Long.valueOf(deptId); + if (StringUtils.isNotEmpty(user.getDeptId())) { + Long id = Long.valueOf(user.getDeptId()); businessMessageDTO.setDeptId(id); businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); businessMessageDTO.setBusinessKey("车保到期"); @@ -125,10 +133,12 @@ public class CarJob { log.error("系统无该用户信息,推送维保过期消息失败"); return; } + // 查询用户 + R userRes = userClient.userInfoById(carEntity.getManagerId()); + User user = userRes.getData(); BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); - String deptId = AuthUtil.getDeptId(); - if (StringUtils.isNotEmpty(deptId)) { - Long id = Long.valueOf(deptId); + if (StringUtils.isNotEmpty(user.getDeptId())) { + Long id = Long.valueOf(user.getDeptId()); businessMessageDTO.setDeptId(id); businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); businessMessageDTO.setBusinessKey("维保到期"); From 8ff603a6de3a2e22979072145b86b4a57111459d Mon Sep 17 00:00:00 2001 From: liwen Date: Thu, 18 Jan 2024 16:42:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?update:=20=E7=89=B9=E7=A7=8D=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/safeproduct/jobs/DeviceJob.java | 53 +++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) 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 index 2e5c414..81b4964 100644 --- 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 @@ -1,11 +1,20 @@ 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; @@ -19,12 +28,22 @@ 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) { // 获取时间范围 @@ -37,9 +56,41 @@ public class DeviceJob { if (CollectionUtils.isEmpty(list)) { return ReturnT.SUCCESS; } - list.forEach(e -> e.setDeviceStatus(DeviceStatusEnum.EXPIRED.getValue())); + 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); + } }