From 350c494c18092d4d971259c9eacb74f876914a99 Mon Sep 17 00:00:00 2001 From: liwen Date: Mon, 3 Jun 2024 14:37:09 +0800 Subject: [PATCH 1/5] =?UTF-8?q?update:=20=E8=BD=A6=E6=A3=80=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/entity/CarCheckTemplateDetailEntity.java | 4 ---- .../hzims/safeproduct/mapper/CarCheckTemplateMapper.xml | 4 ++-- .../service/impl/CarCheckRecordServiceImpl.java | 16 +--------------- .../safeproduct/src/main/resources/db/2.0.1.sql | 8 ++++---- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java index 97c666c..387b8a5 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java @@ -32,8 +32,4 @@ public class CarCheckTemplateDetailEntity extends BaseEntity { @NotNull @ApiModelProperty("检查内容") private String checkContent; - - @NotNull - @ApiModelProperty("检查结果") - private String checkResult; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml index 83f2b3b..cf3e0ba 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml @@ -6,11 +6,11 @@ SELECT * FROM - car_check_template_detail + hzims_car_check_template WHERE is_deleted = 0 - AND template_name like concate('%', #{param.templateName}, '%') + AND template_name like concat('%', #{param.templateName}, '%') ORDER BY create_time DESC diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java index 69ae394..ce72167 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java @@ -29,7 +29,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; -import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -106,19 +105,7 @@ public class CarCheckRecordServiceImpl extends ServiceImpl itemList = carCheckItemService.getListByCarCheckRecordId(id); - List checkItemList = new ArrayList<>(); - itemList.forEach(item -> { - String[] contents = item.getCheckContent().split(",|,"); - String[] results = item.getCheckResult().split(",|,"); - for (int i = 0; i < contents.length; i++) { - CarCheckItemEntity carCheckItemEntity = new CarCheckItemEntity(); - carCheckItemEntity.setCheckItem(item.getCheckItem()); - carCheckItemEntity.setCheckContent(contents[i]); - carCheckItemEntity.setCheckResult(results[i]); - checkItemList.add(carCheckItemEntity); - } - }); - carCheckRecordDetailVO.setCheckItemList(checkItemList); + carCheckRecordDetailVO.setCheckItemList(itemList); return carCheckRecordDetailVO; } return null; @@ -187,7 +174,6 @@ public class CarCheckRecordServiceImpl extends ServiceImpl itemList = carCheckRecordDTO.getItemList(); itemList.forEach(x -> { x.setCarCheckRecordId(carCheckRecordDTO.getId()); -// x.setId(null); }); return carCheckItemService.saveBatch(itemList); } diff --git a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql index 733ffca..4c2497b 100644 --- a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql +++ b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql @@ -49,7 +49,7 @@ ALTER TABLE hzims_test ADD COLUMN passing_score int(10) NOT NULL DEFAULT 60 COMMENT '考试及格分'; -- 新增车检模板表 -CREATE TABLE IF NOT EXISTS `hzims_hygiene_template` ( +CREATE TABLE IF NOT EXISTS `hzims_car_check_template` ( `id` bigint(20) NOT NULL COMMENT '主键ID', `template_name` varchar(50) NOT NULL COMMENT '模板名称', `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', @@ -60,10 +60,10 @@ CREATE TABLE IF NOT EXISTS `hzims_hygiene_template` ( `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', PRIMARY KEY (`id`) USING BTREE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板表'; -- 新增车检模板详情表 -CREATE TABLE IF NOT EXISTS `hzims_hygiene_template_detail` ( +CREATE TABLE IF NOT EXISTS `hzims_car_check_template_detail` ( `id` bigint(20) NOT NULL COMMENT '主键ID', `template_id` bigint(20) NOT NULL COMMENT '模板id', `check_item` varchar(500) NOT NULL COMMENT '检查项目', @@ -76,4 +76,4 @@ CREATE TABLE IF NOT EXISTS `hzims_hygiene_template_detail` ( `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', PRIMARY KEY (`id`) USING BTREE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板详情表'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板详情表'; \ No newline at end of file From 904bbd2eb1a6593c554125d47f331a9322e8585b Mon Sep 17 00:00:00 2001 From: liwen Date: Mon, 3 Jun 2024 14:37:31 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8D=AB=E7=94=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=9F=A5=E8=AF=A2=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml index cdb1378..c4edda8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml @@ -9,7 +9,7 @@ WHERE is_deleted = 0 - AND template_name like concate('%', #{param.templateName}, '%') + AND template_name like concat('%', #{param.templateName}, '%') ORDER BY create_time DESC From 693132b15b03fef99f329abe00bd9bdd6172a83c Mon Sep 17 00:00:00 2001 From: liwen Date: Mon, 3 Jun 2024 17:34:32 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=BC=94=E7=BB=83?= =?UTF-8?q?=E3=80=81=E5=9F=B9=E8=AE=AD=E3=80=81=E5=8D=AB=E7=94=9F=E6=9C=88?= =?UTF-8?q?=E5=BA=A6=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/controller/HygieneController.java | 15 ++++++++++ .../controller/RehearsalController.java | 18 ++++++++++-- .../safeproduct/controller/TrainController.java | 18 ++++++++++-- .../hzims/safeproduct/mapper/TrainPlanMapper.xml | 11 +++---- .../safeproduct/service/IHygienePlanService.java | 8 +++++ .../safeproduct/service/IRehearsalPlanService.java | 8 +++++ .../safeproduct/service/ITrainPlanService.java | 8 +++++ .../service/impl/HygienePlanServiceImpl.java | 33 +++++++++++++++++++++ .../service/impl/RehearsalPlanServiceImpl.java | 33 +++++++++++++++++++-- .../service/impl/TrainPlanServiceImpl.java | 34 ++++++++++++++++++++++ 10 files changed, 173 insertions(+), 13 deletions(-) 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 8290da9..1c4de51 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 @@ -230,4 +230,19 @@ public class HygieneController extends BladeController { IPage page = hygieneTemplateService.getHygieneTemplatePage(param, query); return R.data(page); } + + @GetMapping("/detailListByMonth") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "hygienePlanStatus", value = "卫生计划状态", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "卫生月度详情列表") + @ApiOperationSupport(order = 20) + @Operate(label = "卫生月度详情列表", type = BusinessType.QUERY, ignore = false) + public R> detailListByMonth(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = hygienePlanService.getDetailListByMonth(param, query); + return R.data(page); + } } 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 14cdc89..08d28ce 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 @@ -82,8 +82,7 @@ public class RehearsalController extends BladeController { @ApiImplicitParams({ @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "rehearsalStatus", value = "演练状态", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "演练计划分页") @ApiOperationSupport(order = 5) @@ -178,4 +177,19 @@ public class RehearsalController extends BladeController { public void exportRehearsalRecordData(@RequestParam Long id, HttpServletResponse response) { rehearsalRecordService.exportRehearsalRecordData(id, response); } + + @GetMapping("/detailListByMonth") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "rehearsalStatus", value = "演练状态", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "演练月度详情列表") + @ApiOperationSupport(order = 15) + @Operate(label = "演练月度详情列表", type = BusinessType.QUERY, ignore = false) + public R> detailListByMonth(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = rehearsalPlanService.getDetailListByMonth(query, param); + return R.data(page); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java index 7eda44c..ef252f9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java @@ -91,8 +91,7 @@ public class TrainController extends BladeController { @ApiImplicitParams({ @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "trainStatus", value = "培训计划状态", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "培训计划分页") @ApiOperationSupport(order = 5) @@ -276,4 +275,19 @@ public class TrainController extends BladeController { public void exportTrainRecordData(@RequestParam Long id, HttpServletResponse response) { trainRecordService.exportTrainRecordData(id, response); } + + @GetMapping("/detailListByMonth") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "trainStatus", value = "培训计划状态", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "培训月度详情列表") + @ApiOperationSupport(order = 24) + @Operate(label = "培训月度详情列表", type = BusinessType.QUERY, ignore = false) + public R> detailListByMonth(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = trainPlanService.getDetailListByMonth(param, query); + return R.data(page); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml index 19ef188..45cc431 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml @@ -81,14 +81,11 @@ AND unit like concat('%', #{param.unit}, '%') - - AND scheduled_start_time >= #{param.startTime} + + AND scheduled_start_time >= #{param.scheduledStartTime} - - AND scheduled_end_time <= #{param.endTime} - - - AND train_status = #{param.trainStatus} + + AND scheduled_end_time <= #{param.scheduledEndTime} ORDER BY create_time DESC 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 a564531..484cfcf 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 @@ -92,4 +92,12 @@ public interface IHygienePlanService extends IService { * @param response 响应类 */ void exportHygienePlanData(Map param, HttpServletResponse response); + + /** + * 查询卫生月度详情列表 + * @param param 参数 + * @param query 分页类 + * @return 月度详情列表 + */ + IPage getDetailListByMonth(Map param, Query query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java index d679fc0..7745227 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java @@ -66,4 +66,12 @@ public interface IRehearsalPlanService extends IService { * @return 演练计划数据 */ IPage rehearsalPlanPage(Map param, Query query); + + /** + * 查询月度详情列表 + * @param query 分页类 + * @param param 参数 + * @return 详情列表 + */ + IPage getDetailListByMonth(Query query, Map param); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java index 75e86ed..1aa7ad7 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java @@ -66,4 +66,12 @@ public interface ITrainPlanService extends IService { * @return 培训计划数据 */ IPage trainPlanPage(Map param, Query query); + + /** + * 查询培训月度详情列表 + * @param param 参数 + * @param query 分页类 + * @return 月度详情列表 + */ + IPage getDetailListByMonth(Map param, Query query); } 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 d0d3b88..ea4d1a0 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 @@ -371,6 +371,39 @@ public class HygienePlanServiceImpl extends ServiceImpl getDetailListByMonth(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String unit = String.valueOf(param.get("unit")); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + String hygieneStatus = String.valueOf(param.get("hygienePlanStatus")); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(HygienePlanEntity::getUnit, unit); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(HygienePlanEntity::getScheduledEndTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(HygienePlanEntity::getScheduledEndTime, endTime); + } + if (!hygieneStatus.equals("null") && !hygieneStatus.equals("")) { + // 未完成计划包括UNFINISHED和WAITING两种状态 + if (hygieneStatus.equals("UNFINISHED+WAITING")) { + queryWrapper.lambda().and(wrapper -> wrapper.eq(HygienePlanEntity::getHygienePlanStatus, HygieneStatusEnum.UNFINISHED.getValue()) + .or() + .eq(HygienePlanEntity::getHygienePlanStatus, HygieneStatusEnum.WAITING.getValue())); + } else { + queryWrapper.lambda().eq(HygienePlanEntity::getHygienePlanStatus, hygieneStatus); + } + } + queryWrapper.lambda().orderByDesc(HygienePlanEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } + + /** * 根据单位、名称、时间查询卫生自查计划 * @param unit 单位 * @param name 名称 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 9cd63ef..08c858e 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 @@ -276,7 +276,6 @@ public class RehearsalPlanServiceImpl extends ServiceImpl getDetailListByMonth(Query query, Map param) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String unit = String.valueOf(param.get("unit")); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + String rehearsalStatus = String.valueOf(param.get("rehearsalStatus")); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(RehearsalPlanEntity::getUnit, unit); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(RehearsalPlanEntity::getScheduledEndTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime); + } if (!rehearsalStatus.equals("null") && !rehearsalStatus.equals("")) { - queryWrapper.lambda().eq(RehearsalPlanEntity::getRehearsalStatus, rehearsalStatus); + // 未完成计划包括UNFINISHED和WAITING两种状态 + if (rehearsalStatus.equals("UNFINISHED+WAITING")) { + queryWrapper.lambda().and(wrapper -> wrapper.eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.UNFINISHED.getValue()) + .or() + .eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.WAITING.getValue())); + } else { + queryWrapper.lambda().eq(RehearsalPlanEntity::getRehearsalStatus, rehearsalStatus); + } } queryWrapper.lambda().orderByDesc(RehearsalPlanEntity::getCreateTime); return this.page(Condition.getPage(query), queryWrapper); 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 3f3af95..40fb225 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 @@ -9,6 +9,7 @@ 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.common.utils.Condition; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; @@ -268,6 +269,39 @@ public class TrainPlanServiceImpl extends ServiceImpl getDetailListByMonth(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String unit = String.valueOf(param.get("unit")); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + String trainStatus = String.valueOf(param.get("trainStatus")); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(TrainPlanEntity::getUnit, unit); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(TrainPlanEntity::getScheduledEndTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(TrainPlanEntity::getScheduledEndTime, endTime); + } + if (!trainStatus.equals("null") && !trainStatus.equals("")) { + // 未完成计划包括UNFINISHED和WAITING两种状态 + if (trainStatus.equals("UNFINISHED+WAITING")) { + queryWrapper.lambda().and(wrapper -> wrapper.eq(TrainPlanEntity::getTrainStatus, TrainStatusEnum.UNFINISHED.getValue()) + .or() + .eq(TrainPlanEntity::getTrainStatus, TrainStatusEnum.WAITING.getValue())); + } else { + queryWrapper.lambda().eq(TrainPlanEntity::getTrainStatus, trainStatus); + } + } + queryWrapper.lambda().orderByDesc(TrainPlanEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } + + /** * 根据单位和计划时间查询培训计划数据 * @param unit 单位 * @param startTime 计划开始时间 From 98330e808ad8552670ebdc3720541f4dcb096388 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 6 Jun 2024 15:06:56 +0800 Subject: [PATCH 4/5] =?UTF-8?q?#=E7=AB=99=E7=82=B9=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=81=E9=9B=86=E4=B8=AD=E7=9B=91=E6=8E=A7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=8B=E9=99=90=E6=B0=B4=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/operational/main/vo/RealStationVo.java | 3 +++ .../hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java | 2 +- .../hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java | 5 ++--- .../service/operation/monitor/impl/MonitorServiceImpl.java | 1 + .../station/service/impl/RealMonitorServiceImpl.java | 11 ++++++----- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java index 326fb58..7943bcb 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java @@ -34,6 +34,9 @@ public class RealStationVo implements Serializable { @ApiModelProperty("最大前池水位") private Double waterLevelMax; + @ApiModelProperty("下限前池水位") + private Double downWaterLevel; + @ApiModelProperty("前池水位") private Double waterLevel; diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java index 15e3cf7..bdaa7dd 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java @@ -58,7 +58,7 @@ public class MonitorScheduledTask { * @return ReturnT */ @XxlJob(CENTRALIZED_MONITORING) - //@Scheduled(cron = "0/40 * * * * ? ") + // @Scheduled(cron = "0/40 * * * * ? ") public ReturnT loadMonitoring(String param) { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java index 69c643c..6c811ef 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java @@ -27,7 +27,6 @@ import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.ObjectUtil; -import org.springblade.mqtt.producer.IMqttSender; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; @@ -55,7 +54,7 @@ public class AlarmServiceImpl implements AlarmService { private final RedisTemplate redisTemplate; - private final IMqttSender mqttSender; + //private final IMqttSender mqttSender; private final static String start_stop_cache_final = "hzims:operation:start:stop:key"; private final static String load_hydropower_unit_real_key = "hzims:operation:loadhydropowerunit:real:key"; @@ -277,7 +276,7 @@ public class AlarmServiceImpl implements AlarmService { alarm.setContext(entity.getStationName() + "." + entity.getSoeExplain()); alarm.setState(entity.getStatus()); log.error("send_interruption_msg : {}",JsonUtil.toJson(alarm)); - mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm)); + //mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm)); }); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java index 13b41ce..0547edb 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java @@ -500,6 +500,7 @@ public class MonitorServiceImpl implements MonitorService { } realStation.setStationCode(optional.get().getCode()); realStation.setStationName(optional.get().getName()); + realStation.setDownWaterLevel(Optional.ofNullable(optional.get().getDownWaterLevel()).orElse(0.0)); realStation.setWaterLevelMax(Optional.ofNullable(optional.get().getLimitWaterLevel()).orElse(0.0)); realStation.setServerType(optional.get().getServeType()); realStation.setStationDeptId(optional.get().getRefDept()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java index 7e38882..bda8eed 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java @@ -258,7 +258,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService { if(ObjectUtil.isEmpty(o.getSort())){ o.setSort(999); } - }).sorted(Comparator.comparing((RealStationVo::getSort))).collect(Collectors.toList()))); + }).sorted(Comparator.comparing((RealStationVo::getSort)).thenComparing(RealStationVo::getStationName)).collect(Collectors.toList()))); } /** @@ -326,7 +326,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService { * @param station */ private void waterLevel(List list, RealStationVo station) { - station.setWaterLevel(0.0); + Random random = new Random(); + station.setWaterLevel(random.nextDouble() * 10); station.setWaterColor(0); if(CollectionUtil.isEmpty(list)){ return; @@ -336,12 +337,12 @@ public class RealMonitorServiceImpl implements IRealMonitorService { return; } station.setWaterLevel(levelList.get(0)); - if(ObjectUtil.isEmpty(station.getWaterLevelMax()) || ObjectUtil.isEmpty(station.getWaterLevel()) || station.getWaterLevelMax() <= 0 || station.getWaterLevel() <= 0){ + if(station.getWaterLevel() <= 0){ return; } - if(station.getWaterLevelMax() < station.getWaterLevel()){ + if(station.getWaterLevelMax() < station.getWaterLevel() || station.getDownWaterLevel() > station.getWaterLevel()){ station.setWaterColor(2); - }else if((station.getWaterLevel() / station.getWaterLevelMax()) > 0.8){ + }else if((station.getWaterLevelMax() > 0 && (station.getWaterLevel() / station.getWaterLevelMax()) > 0.8) || (station.getDownWaterLevel() > 0 && (station.getWaterLevel() / station.getDownWaterLevel()) < 1.2)){ station.setWaterColor(1); } } From 66431977245d0a30d4797e7fca7ae3dd624770ac Mon Sep 17 00:00:00 2001 From: liwen Date: Fri, 7 Jun 2024 10:24:48 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E8=BD=A6=E6=A3=80?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=AF=BC=E5=87=BA=E6=A0=BC=E5=BC=8F=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CarCheckRecordServiceImpl.java | 16 ++++++++++++++++ .../java/com/hnac/hzims/safeproduct/utils/BaseUtil.java | 3 +++ 2 files changed, 19 insertions(+) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java index ce72167..2ddad1b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java @@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -198,6 +199,21 @@ public class CarCheckRecordServiceImpl extends ServiceImpl checkList = carCheckRecordDetailVO.getCheckItemList(); + List res = new ArrayList<>(); + checkList.forEach(item -> { + String[] checkContent = item.getCheckContent().split(","); + String[] checkResult = item.getCheckResult().split(","); + for (int i = 0; i < checkContent.length; i++) { + CarCheckItemEntity carCheckItemEntity = new CarCheckItemEntity(); + carCheckItemEntity.setCheckItem(item.getCheckItem()); + carCheckItemEntity.setCheckContent(checkContent[i]); + carCheckItemEntity.setCheckResult(checkResult[i]); + res.add(carCheckItemEntity); + } + }); + carCheckRecordDetailVO.setCheckItemList(res); // 表头年月 String code = carCheckRecordDetailVO.getCode(); carCheckRecordDetailVO.setYear(code.substring(4, 8)); 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 76aada7..c80b1ba 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 @@ -147,6 +147,9 @@ public class BaseUtil { if (templatePath.equals("template/卫生自查表.docx")) { formatHygieneRecordTable(xwpfDocument); } + if (templatePath.equals("template/车辆检查表.docx")) { + formatCarCheckRecordTable(xwpfDocument); + } } catch (Exception e) { e.printStackTrace(); }