From c846ca4a6af3a272abe044615784e67aa77506dd Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 6 Aug 2024 19:04:32 +0800 Subject: [PATCH 1/2] =?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=88=90=E7=BB=A9=E5=8D=95=E5=8F=8A=E6=A0=BC?= =?UTF-8?q?=E7=8E=87=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=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 --- .../com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java index 84a7a7f..9cff3d9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java @@ -135,10 +135,10 @@ public class TestScoreServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(TestScoreEntity::getTestId, testId); List list = this.list(queryWrapper); - list= list.stream().filter(s -> s.getScore() != null).collect(Collectors.toList()); + list = list.stream().filter(s -> s.getScore() != null).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(list)) { testScoreSumVO.setActualPeopleNum(list.size()); - List passCollect = list.stream().filter(s -> s.getScore() > testEntity.getPassingScore()).collect(Collectors.toList()); + List passCollect = list.stream().filter(s -> s.getScore() >= testEntity.getPassingScore()).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(list)&&CollectionUtils.isNotEmpty(passCollect)) { double result = BigDecimal.valueOf(passCollect.size()).divide(BigDecimal.valueOf(list.size()),2, RoundingMode.UP).doubleValue(); testScoreSumVO.setPercentage(result); From 2680202ac7089be007dff9b08d4366df6834981b Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Tue, 6 Aug 2024 19:23:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?#=E5=AE=89=E5=85=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD&bug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzinfo/inspect/task/vo/TaskOfflineVO.java | 9 ++++ .../train/entity/InstitutionalEntity.java | 24 +++++++++ .../safeproduct/train/entity/TrainEntity.java | 47 ++++++++++++++++- .../safeproduct/train/vo/InstitutionalParamVo.java | 26 ++++++++++ .../hzims/safeproduct/train/vo/TrainParamVo.java | 23 +++++++++ .../hzims/safeproduct/train/vo/TrainSummaryVo.java | 20 ++++++++ hzims-service/hzims-basic/pom.xml | 4 +- .../service/impl/OperAccessLibraryServiceImpl.java | 3 +- .../hazard/controller/DangerSourceController.java | 6 ++- .../service/impl/TrainRecordServiceImpl.java | 6 +-- .../train/controller/InstitutionalController.java | 42 +++++++++++++-- .../train/controller/TrainController.java | 59 +++++++++++++++++++--- .../safeproduct/train/mapper/TrainMapper.java | 4 ++ .../hzims/safeproduct/train/mapper/TrainMapper.xml | 15 ++++++ .../train/service/IInstitutionalService.java | 3 ++ .../safeproduct/train/service/ITrainService.java | 19 +++++++ .../service/impl/InstitutionalServiceImpl.java | 30 +++++++++++ .../train/service/impl/TrainServiceImpl.java | 58 +++++++++++++++++++++ 18 files changed, 380 insertions(+), 18 deletions(-) create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/InstitutionalParamVo.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/TrainParamVo.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/TrainSummaryVo.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/ITrainService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/TrainServiceImpl.java diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskOfflineVO.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskOfflineVO.java index 72977ca..efd4db4 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskOfflineVO.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskOfflineVO.java @@ -1,8 +1,10 @@ package com.hnac.hzinfo.inspect.task.vo; +import com.baomidou.mybatisplus.annotation.SqlCondition; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springblade.core.mp.support.QueryField; import org.springblade.core.tenant.mp.TenantEntity; import org.springframework.format.annotation.DateTimeFormat; @@ -141,5 +143,12 @@ public class TaskOfflineVO extends TenantEntity { @ApiModelProperty(value = "值班id") private Long dutyId; + /** + * 路线名称 + */ + @ApiModelProperty(value = "路线名称") + @QueryField(condition = SqlCondition.LIKE) + private String routeName; + } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/InstitutionalEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/InstitutionalEntity.java index 211bc4f..aefa8e8 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/InstitutionalEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/InstitutionalEntity.java @@ -2,6 +2,7 @@ package com.hnac.hzims.safeproduct.train.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.tenant.mp.TenantEntity; @@ -17,4 +18,27 @@ import org.springblade.core.tenant.mp.TenantEntity; @ApiModel(value = "制度资料实体类") public class InstitutionalEntity extends TenantEntity { + @ApiModelProperty(value = "站点编码") + private String stationId; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "资料类型 : 0-制度 1-资料") + private Integer dataType; + + @ApiModelProperty(value = "文档权限范围 : 0-厂站 1- 完全公开") + private Integer filePurview; + + @ApiModelProperty(value = "文档名称") + private String fileName; + + @ApiModelProperty(value = "文件说明") + private String fileExplain; + + @ApiModelProperty(value = "附件上传地址") + private String dataAttachmentPath; + + @ApiModelProperty(value = "附件名称") + private String dataAttachmentName; } \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/TrainEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/TrainEntity.java index c3351f6..62cfb70 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/TrainEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/entity/TrainEntity.java @@ -1,10 +1,16 @@ package com.hnac.hzims.safeproduct.train.entity; 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.tenant.mp.TenantEntity; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; /** @@ -12,9 +18,48 @@ import org.springblade.core.tenant.mp.TenantEntity; * @created 2020/9/8 15:09 **/ @Data -@TableName("hzims_safety_training") +@TableName("hzims_safety_train") @EqualsAndHashCode(callSuper = true) @ApiModel(value = "安全培训实体类") public class TrainEntity extends TenantEntity { + @ApiModelProperty(value = "站点编码") + private String stationId; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "主讲人ID") + private Long speaker; + + @ApiModelProperty(value = "主讲人名称") + private String speakerName; + + @ApiModelProperty(value = "培训内容") + private String trainContent; + + @ApiModelProperty(value = "应到人数") + private Integer answerCount; + + @ApiModelProperty(value = "实到人数") + private Integer actualCount; + + @ApiModelProperty(value = "培训开始时间") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + private Date trainStartTime; + + @ApiModelProperty(value = "培训结束时间") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + private Date trainEndTime; + + @ApiModelProperty(value = "迟到/缺席人数及原因") + private String lateReason; + + @ApiModelProperty(value = "培训附件上次路径") + private String trainAttachmentPath; + + @ApiModelProperty(value = "培训附件名称") + private String trainAttachmentName; } \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/InstitutionalParamVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/InstitutionalParamVo.java new file mode 100644 index 0000000..951e9ab --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/InstitutionalParamVo.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.safeproduct.train.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class InstitutionalParamVo { + + @ApiModelProperty(value = "站点Id") + private String stationId; + + @ApiModelProperty(value = "月份") + private String month; + + @ApiModelProperty(value = "资料类型 : 0-制度 1-资料") + private Integer dataType; + + @ApiModelProperty(value = "文档名称") + private String fileName; + + @ApiModelProperty(value = "文档名称") + private Integer status; +} \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/TrainParamVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/TrainParamVo.java new file mode 100644 index 0000000..0e2f95e --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/TrainParamVo.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.safeproduct.train.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class TrainParamVo { + + @ApiModelProperty(value = "站点Id") + private String stationId; + + @ApiModelProperty(value = "月份") + private String month; + + @ApiModelProperty(value = "培训起止时间") + private String startTime; + + @ApiModelProperty(value = "培训结束时间") + private String endTime; +} \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/TrainSummaryVo.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/TrainSummaryVo.java new file mode 100644 index 0000000..2db55a6 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/train/vo/TrainSummaryVo.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.safeproduct.train.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class TrainSummaryVo { + + @ApiModelProperty(value = "站点Id") + private String stationId; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "培训次数") + private Integer count; +} \ No newline at end of file diff --git a/hzims-service/hzims-basic/pom.xml b/hzims-service/hzims-basic/pom.xml index 265b0bc..7b334b0 100644 --- a/hzims-service/hzims-basic/pom.xml +++ b/hzims-service/hzims-basic/pom.xml @@ -70,12 +70,12 @@ org.apache.poi poi-ooxml - 5.2.3 + 4.1.2 org.apache.poi poi - 5.2.3 + 3.15 org.apache.poi diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java index 077bc8e..6845a99 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java @@ -86,8 +86,7 @@ public class OperAccessLibraryServiceImpl extends ServiceImpl - detail(Long id) { + public R detail(Long id) { OperAccessLibraryVO detail = OperAccessLibraryWrapper.build(emInfoClient).entityVO(super.getById(id)); if(StringUtils.isEmpty(detail.getSafeInfos())){ R.data(detail); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/DangerSourceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/DangerSourceController.java index 630b521..3bce672 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/DangerSourceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/DangerSourceController.java @@ -19,6 +19,7 @@ import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -74,7 +75,10 @@ public class DangerSourceController extends BladeController { @GetMapping("/detail") @ApiOperationSupport(order = 40) @ApiOperation(value = "详情", notes = "传入dangerSource") - public R detail(@RequestParam Long id) { + public R detail(@RequestParam(value = "id",required = false) Long id) { + if(ObjectUtil.isEmpty(id)){ + return R.data(new DangerSourceVO()); + } return dangerSourceService.detail(id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java index 4debd00..4d96ddd 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java @@ -22,11 +22,11 @@ import com.hnac.hzims.safeproduct.utils.TimeUtils; import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordVO; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.CollectionUtil; 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 org.springframework.util.CollectionUtils; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -84,7 +84,7 @@ public class TrainRecordServiceImpl extends ServiceImpl trainRecordList = getRelativeTrainRecord(trainPlanId); // 若无关联培训记录,直接返回true - if (CollectionUtils.isEmpty(trainRecordList)) { + if (CollectionUtil.isEmpty(trainRecordList)) { return true; } // 删除关联培训记录 @@ -207,7 +207,7 @@ public class TrainRecordServiceImpl extends ServiceImpl list = getTrainByMonth(currentMonth); - if (CollectionUtils.isEmpty(list)) { + if (CollectionUtil.isEmpty(list)) { return null; } return list.get(0).getCode(); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/InstitutionalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/InstitutionalController.java index 3ad05cc..b30d4c7 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/InstitutionalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/InstitutionalController.java @@ -1,13 +1,22 @@ package com.hnac.hzims.safeproduct.train.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.safeproduct.Constants; +import com.hnac.hzims.safeproduct.train.entity.InstitutionalEntity; import com.hnac.hzims.safeproduct.train.service.IInstitutionalService; +import com.hnac.hzims.safeproduct.train.vo.InstitutionalParamVo; import com.hnac.hzinfo.log.annotation.Business; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; /** * @author ysj @@ -19,6 +28,33 @@ import org.springframework.web.bind.annotation.RestController; @Api(tags = "制度资料") public class InstitutionalController extends BladeController { - private final IInstitutionalService institutionalService; + private final IInstitutionalService service; + @PostMapping("/save") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增制度资料", notes = "传入TrainEntity") + public R save(@RequestBody InstitutionalEntity entity) { + return R.status(service.save(entity)); + } + + @PostMapping("/update") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "修改制度资料", notes = "传入TrainEntity") + public R update(@RequestBody InstitutionalEntity entity) { + return R.status(service.updateById(entity)); + } + + @PostMapping("/remove") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "删除制度资料", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + return R.status(service.removeByIds(Func.toLongList(ids))); + } + + @GetMapping("/pages") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "分页查询制度资料", notes = "查询条件:entity") + public R> pageCondition(InstitutionalParamVo params, Query query) { + return R.data(service.pageCondition(params, Condition.getPage(query))); + } } \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java index 18624e4..1ccc218 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/controller/TrainController.java @@ -1,13 +1,25 @@ package com.hnac.hzims.safeproduct.train.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.safeproduct.Constants; +import com.hnac.hzims.safeproduct.train.entity.RectificationEntity; +import com.hnac.hzims.safeproduct.train.entity.TrainEntity; import com.hnac.hzims.safeproduct.train.service.ITrainService; +import com.hnac.hzims.safeproduct.train.vo.RectificationParamVo; +import com.hnac.hzims.safeproduct.train.vo.TrainParamVo; +import com.hnac.hzims.safeproduct.train.vo.TrainSummaryVo; import com.hnac.hzinfo.log.annotation.Business; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; /** * @author ysj @@ -15,9 +27,44 @@ import org.springframework.web.bind.annotation.RestController; @RestController @AllArgsConstructor @RequestMapping("/train") -@Business(module = Constants.APP_NAME, value = "培训管理") -@Api(value = "培训管理", tags = "培训管理接口") +@Business(module = Constants.APP_NAME, value = "安全培训") +@Api(value = "安全培训", tags = "安全培训接口") public class TrainController extends BladeController { - private final ITrainService trainService; -} \ No newline at end of file + private final ITrainService service; + + @PostMapping("/save") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增安全培训", notes = "传入TrainEntity") + public R save(@RequestBody TrainEntity entity) { + return R.status(service.save(entity)); + } + + @PostMapping("/update") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "修改安全培训", notes = "传入TrainEntity") + public R update(@RequestBody TrainEntity entity) { + return R.status(service.updateById(entity)); + } + + @PostMapping("/remove") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "删除安全培训", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + return R.status(service.removeByIds(Func.toLongList(ids))); + } + + @GetMapping("/pages") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "分页查询安全培训", notes = "查询条件:entity") + public R> pageCondition(TrainParamVo params, Query query) { + return R.data(service.pageCondition(params, Condition.getPage(query))); + } + + @GetMapping("/summary") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "汇总", notes = "查询条件:站点ID、月份") + public R> summary(TrainParamVo params, Query query) { + return R.data(service.summary(params, Condition.getPage(query))); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.java index ac9736c..3fbbffb 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.java @@ -1,6 +1,9 @@ package com.hnac.hzims.safeproduct.train.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.train.entity.TrainEntity; +import com.hnac.hzims.safeproduct.train.vo.TrainParamVo; +import com.hnac.hzims.safeproduct.train.vo.TrainSummaryVo; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; @@ -10,4 +13,5 @@ import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; public interface TrainMapper extends UserDataScopeBaseMapper { + IPage summary(TrainParamVo params, IPage page); } \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.xml index 773c9e3..39ac4cf 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/mapper/TrainMapper.xml @@ -2,4 +2,19 @@ + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IInstitutionalService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IInstitutionalService.java index 571e06c..2d32993 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IInstitutionalService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/IInstitutionalService.java @@ -1,11 +1,14 @@ package com.hnac.hzims.safeproduct.train.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.train.entity.InstitutionalEntity; +import com.hnac.hzims.safeproduct.train.vo.InstitutionalParamVo; /** * @author ysj */ public interface IInstitutionalService extends IService { + IPage pageCondition(InstitutionalParamVo params, IPage page); } \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/ITrainService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/ITrainService.java new file mode 100644 index 0000000..952135b --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/ITrainService.java @@ -0,0 +1,19 @@ +package com.hnac.hzims.safeproduct.train.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.train.entity.TrainEntity; +import com.hnac.hzims.safeproduct.train.vo.TrainParamVo; +import com.hnac.hzims.safeproduct.train.vo.TrainSummaryVo; + + +/** + * @author ysj + */ +public interface ITrainService extends IService { + + + IPage pageCondition(TrainParamVo params, IPage page); + + IPage summary(TrainParamVo params, IPage page); +} \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/InstitutionalServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/InstitutionalServiceImpl.java index 3c87632..528a6ff 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/InstitutionalServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/InstitutionalServiceImpl.java @@ -1,10 +1,16 @@ package com.hnac.hzims.safeproduct.train.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.safeproduct.train.entity.InstitutionalEntity; +import com.hnac.hzims.safeproduct.train.entity.RectificationEntity; import com.hnac.hzims.safeproduct.train.mapper.InstitutionalMapper; import com.hnac.hzims.safeproduct.train.service.IInstitutionalService; +import com.hnac.hzims.safeproduct.train.vo.InstitutionalParamVo; import lombok.RequiredArgsConstructor; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; @@ -16,4 +22,28 @@ import org.springframework.stereotype.Service; @RequiredArgsConstructor public class InstitutionalServiceImpl extends ServiceImpl implements IInstitutionalService { + /** + * 分页列表查询制度资料 + * @param params + * @param page + * @return + */ + @Override + public IPage pageCondition(InstitutionalParamVo params, IPage page) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); + wrapper.orderByDesc(InstitutionalEntity::getCreateTime); + if(StringUtil.isNotBlank(params.getStationId())){ + wrapper.eq(InstitutionalEntity::getStationId,params.getStationId()); + } + if(ObjectUtil.isNotEmpty(params.getDataType())){ + wrapper.eq(InstitutionalEntity::getDataType,params.getDataType()); + } + if(ObjectUtil.isNotEmpty(params.getFileName())){ + wrapper.like(InstitutionalEntity::getFileName,params.getFileName()); + } + if(ObjectUtil.isNotEmpty(params.getStatus())){ + wrapper.eq(InstitutionalEntity::getStatus,params.getStatus()); + } + return super.page(page,wrapper); + } } \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/TrainServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/TrainServiceImpl.java new file mode 100644 index 0000000..215eba3 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/train/service/impl/TrainServiceImpl.java @@ -0,0 +1,58 @@ +package com.hnac.hzims.safeproduct.train.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.train.entity.TrainEntity; +import com.hnac.hzims.safeproduct.train.entity.ViolationEntity; +import com.hnac.hzims.safeproduct.train.mapper.TrainMapper; +import com.hnac.hzims.safeproduct.train.service.ITrainService; +import com.hnac.hzims.safeproduct.train.vo.TrainParamVo; +import com.hnac.hzims.safeproduct.train.vo.TrainSummaryVo; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; + + +/** + * 安全培训 + * @author ysj + */ +@Service +public class TrainServiceImpl extends ServiceImpl implements ITrainService { + + /** + * 分页列表查询安全培训 + * @param params + * @param page + * @return + */ + @Override + public IPage pageCondition(TrainParamVo params, IPage page) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); + wrapper.orderByDesc(TrainEntity::getCreateTime); + if(StringUtil.isNotBlank(params.getStationId())){ + wrapper.eq(TrainEntity::getStationId,params.getStartTime()); + } + if(StringUtil.isNotBlank(params.getStartTime())){ + wrapper.ge(TrainEntity::getTrainStartTime,params.getStartTime()); + } + if(StringUtil.isNotBlank(params.getEndTime())){ + wrapper.le(TrainEntity::getTrainEndTime,params.getEndTime()); + } + return super.page(page,wrapper); + } + + /** + * 分页列表查询安全培训汇总 + * @param params + * @param page + * @return + */ + @Override + public IPage summary(TrainParamVo params, IPage page) { + return this.baseMapper.summary(params,page); + } + + +} \ No newline at end of file