Browse Source

fix: 解决演练、培训、卫生月度统计数据异常的问题

zhongwei
liwen 6 months ago
parent
commit
31e98b4a72
  1. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java
  2. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  3. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
  4. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml
  5. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java
  6. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java
  7. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java
  8. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java
  9. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java
  10. 34
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java

@ -230,4 +230,19 @@ public class HygieneController extends BladeController {
IPage<HygieneTemplateEntity> 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<IPage<HygienePlanEntity>> detailListByMonth(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<HygienePlanEntity> page = hygienePlanService.getDetailListByMonth(param, query);
return R.data(page);
}
}

18
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<IPage<RehearsalPlanEntity>> detailListByMonth(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<RehearsalPlanEntity> page = rehearsalPlanService.getDetailListByMonth(query, param);
return R.data(page);
}
}

18
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<IPage<TrainPlanEntity>> detailListByMonth(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<TrainPlanEntity> page = trainPlanService.getDetailListByMonth(param, query);
return R.data(page);
}
}

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml

@ -81,14 +81,11 @@
<if test="param.unit != null and param.unit != ''">
AND unit like concat('%', #{param.unit}, '%')
</if>
<if test="param.startTime != null and param.startTime != ''">
AND scheduled_start_time >= #{param.startTime}
<if test="param.scheduledStartTime != null and param.scheduledStartTime != ''">
AND scheduled_start_time >= #{param.scheduledStartTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND scheduled_end_time &lt;= #{param.endTime}
</if>
<if test="param.trainStatus != null and param.trainStatus != ''">
AND train_status = #{param.trainStatus}
<if test="param.scheduledEndTime != null and param.scheduledEndTime != ''">
AND scheduled_end_time &lt;= #{param.scheduledEndTime}
</if>
ORDER BY
create_time DESC

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java

@ -92,4 +92,12 @@ public interface IHygienePlanService extends IService<HygienePlanEntity> {
* @param response 响应类
*/
void exportHygienePlanData(Map<String, Object> param, HttpServletResponse response);
/**
* 查询卫生月度详情列表
* @param param 参数
* @param query 分页类
* @return 月度详情列表
*/
IPage<HygienePlanEntity> getDetailListByMonth(Map<String, Object> param, Query query);
}

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java

@ -66,4 +66,12 @@ public interface IRehearsalPlanService extends IService<RehearsalPlanEntity> {
* @return 演练计划数据
*/
IPage<RehearsalPlanEntity> rehearsalPlanPage(Map<String, Object> param, Query query);
/**
* 查询月度详情列表
* @param query 分页类
* @param param 参数
* @return 详情列表
*/
IPage<RehearsalPlanEntity> getDetailListByMonth(Query query, Map<String, Object> param);
}

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java

@ -66,4 +66,12 @@ public interface ITrainPlanService extends IService<TrainPlanEntity> {
* @return 培训计划数据
*/
IPage<TrainPlanEntity> trainPlanPage(Map<String, Object> param, Query query);
/**
* 查询培训月度详情列表
* @param param 参数
* @param query 分页类
* @return 月度详情列表
*/
IPage<TrainPlanEntity> getDetailListByMonth(Map<String, Object> param, Query query);
}

33
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java

@ -371,6 +371,39 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
}
/**
* 查询卫生月度详情列表
*/
@Override
public IPage<HygienePlanEntity> getDetailListByMonth(Map<String, Object> param, Query query) {
QueryWrapper<HygienePlanEntity> 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 名称

33
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java

@ -276,7 +276,6 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
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);
}
@ -286,8 +285,38 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
if (!endTime.equals("null") && !endTime.equals("")) {
queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime);
}
queryWrapper.lambda().orderByDesc(RehearsalPlanEntity::getCreateTime);
return this.page(Condition.getPage(query), queryWrapper);
}
/**
* 查询月度详情列表
*/
@Override
public IPage<RehearsalPlanEntity> getDetailListByMonth(Query query, Map<String, Object> param) {
QueryWrapper<RehearsalPlanEntity> 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);

34
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<TrainPlanMapper, TrainPlan
}
/**
* 查询培训月度详情列表
*/
@Override
public IPage<TrainPlanEntity> getDetailListByMonth(Map<String, Object> param, Query query) {
QueryWrapper<TrainPlanEntity> 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 计划开始时间

Loading…
Cancel
Save