diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java index 8292f97..17e5119 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java @@ -1,11 +1,13 @@ package com.hnac.hzims.safeproduct.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.mp.base.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -41,10 +43,18 @@ public class TestEntity extends BaseEntity { private String unit; @NotNull + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm" + ) @ApiModelProperty("考试开始时间") private Date testStartTime; @NotNull + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm" + ) @ApiModelProperty("考试结束时间") private Date testEndTime; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java index 4be7da9..615c5aa 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java @@ -17,6 +17,9 @@ import java.util.List; @ApiModel(value = "会议记录表VO类") public class ConferenceRecordVO { + @ApiModelProperty("id") + private String id; + @ApiModelProperty("编码") private String code; @@ -26,9 +29,15 @@ public class ConferenceRecordVO { @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("会议计划开始时间") private Date scheduledStartTime; + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("会议计划开始时间") + private Date scheduledEndTime; @JsonFormat(pattern = "yyyy-MM-dd HH:mm") @ApiModelProperty("会议实际开始时间") private Date actualStartTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @ApiModelProperty("会议实际开始时间") + private Date actualEndTime; @ApiModelProperty("会议地点") @@ -46,4 +55,10 @@ public class ConferenceRecordVO { @ApiModelProperty("会议状态") private String conferenceStatus; + @ApiModelProperty("记录人") + private String recorder; + + @ApiModelProperty("会议内容") + private String content; + } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java index fc888b2..f92966e 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -18,6 +19,8 @@ public class RehearsalRecordlVO { @ApiModelProperty("编码") private String code; + @ApiModelProperty("id") + private String id; @ApiModelProperty("单位") private String unit; @@ -25,8 +28,15 @@ public class RehearsalRecordlVO { @ApiModelProperty("演练科目") private String subject; - @ApiModelProperty("计划演练时间") - private String planTime; + + @JsonFormat(pattern = DateUtil.PATTERN_DATE) + @ApiModelProperty("演练计划开始时间") + private Date scheduledStartTime; + + + @JsonFormat(pattern = DateUtil.PATTERN_DATE) + @ApiModelProperty("演练计划结束时间") + private Date scheduledEndTime; @ApiModelProperty("参演人员") private String peopleName; @@ -51,4 +61,11 @@ public class RehearsalRecordlVO { @ApiModelProperty("演练状态") private String rehearsalStatus; + + @ApiModelProperty("演练记录") + private String record; + + @ApiModelProperty("演练评价") + private String comment; + } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java index ef67b05..b1e8744 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.constraints.Size; import java.util.Date; @@ -17,12 +18,21 @@ import java.util.Date; @ApiModel(value = "培训记录表VO类") public class TrainRecordVO { + @ApiModelProperty("id") + private String id; + @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("计划培训时间") private Date scheduledStartTime; + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("计划培训时间") + private Date scheduledEndTime; + @ApiModelProperty("单位") private String unit; + @ApiModelProperty("记录名称") + private String trainRecordName; @ApiModelProperty("培训地点") private String location; @@ -38,6 +48,8 @@ public class TrainRecordVO { @ApiModelProperty("实际培训结束时间") private Date actualEndTime; + @ApiModelProperty("实际培训开始时间") + private Date actualStartTime; @ApiModelProperty("关联考试:0-否,1-是") @@ -47,5 +59,12 @@ public class TrainRecordVO { @ApiModelProperty("培训状态") private String trainStatus; + @ApiModelProperty("编码") + private String code; + + @ApiModelProperty("培训内容") + private String content; + @ApiModelProperty("培训评价") + private String command; } diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java index 65c7295..9db6aa5 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java @@ -2,12 +2,16 @@ package com.hnac.hzims.spare.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.AssetsConstants; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; +import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.spare.entity.SpAllocationEntity; import com.hnac.hzims.spare.service.ISpAllocationService; import com.hnac.hzims.spare.vo.SpAllocationVO; +import com.hnac.hzinfo.log.annotation.Business; +import com.hnac.hzinfo.log.annotation.Operate; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -34,6 +38,7 @@ import javax.validation.Valid; @AllArgsConstructor @RequestMapping("/sp_allocation") @Api(value = "调拨单管理", tags = "调拨单管理") +@Business(module = AssetsConstants.APP_NAME,value = "消息推送统计管理",ignore = false) public class SpAllocationController extends BladeController { private final ISpAllocationService sp_allocationService; @@ -44,6 +49,7 @@ public class SpAllocationController extends BladeController { @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入sp_allocation") + @Operate(label = "调拨单详情",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) public R detail(SpAllocationEntity sp_allocation) { SpAllocationVO detail = sp_allocationService.getDetail(sp_allocation); return R.data(detail); @@ -56,6 +62,7 @@ public class SpAllocationController extends BladeController { @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入sp_allocation") @ApiIgnore + @Operate(label = "调拨单分页查询",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) public R> list(SpAllocationEntity sp_allocation, Query query) { IPage pages = sp_allocationService.page(Condition.getPage(query), Condition.getQueryWrapper(sp_allocation)); return R.data(pages); @@ -67,6 +74,7 @@ public class SpAllocationController extends BladeController { @GetMapping("/pageList") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入sp_allocation") + @Operate(label = "资产管理-调拨单详情",type = com.hnac.hzinfo.log.contants.BusinessType.QUERY,ignore = false) @OperationAnnotation(moduleName = "资产管理", title = "调泼单",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询调泼单列表") @@ -81,6 +89,7 @@ public class SpAllocationController extends BladeController { @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入sp_allocation") + @Operate(label = "调拨单新增",type = com.hnac.hzinfo.log.contants.BusinessType.INSERT,ignore = false) public R save(@Valid @RequestBody SpAllocationEntity sp_allocation) { return R.status(sp_allocationService.save(sp_allocation)); } @@ -91,6 +100,7 @@ public class SpAllocationController extends BladeController { @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入sp_allocation") + @Operate(label = "调拨单修改",type = com.hnac.hzinfo.log.contants.BusinessType.UPDATE,ignore = false) public R update(@Valid @RequestBody SpAllocationEntity sp_allocation) { return R.status(sp_allocationService.updateById(sp_allocation)); } @@ -100,6 +110,7 @@ public class SpAllocationController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 6) + @Operate(label = "调拨单新增或修改",type = com.hnac.hzinfo.log.contants.BusinessType.UPDATE,ignore = false) @ApiOperation(value = "新增或修改", notes = "传入sp_allocation") public R submit(@Valid @RequestBody SpAllocationEntity sp_allocation) { return R.status(sp_allocationService.saveOrUpdate(sp_allocation)); @@ -112,6 +123,7 @@ public class SpAllocationController extends BladeController { @PostMapping("/remove") @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") + @Operate(label = "调拨单逻辑删除",type = com.hnac.hzinfo.log.contants.BusinessType.DELETE,ignore = false) public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(sp_allocationService.deleteLogic(Func.toLongList(ids))); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java index 22b129b..0977dff 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java @@ -181,6 +181,11 @@ public class ConferenceRecordServiceImpl extends ServiceImpl implements ITestScoreService { private final ISysClient sysClient; + private final IUserClient userClient; @Resource TestMapper testMapper; @@ -53,22 +61,32 @@ public class TestScoreServiceImpl extends ServiceImpl scoreList = testScoreDTO.getScoreList(); List testScoreEntities = new ArrayList<>(); + R> deptListR = sysClient.getDeptList(); + if (!deptListR.isSuccess()&&CollectionUtils.isEmpty(deptListR.getData())){ + log.error("获取所有机构数据失败"); + } + List deptList = deptListR.getData(); scoreList.forEach(score -> { TestScoreEntity testScoreEntity = new TestScoreEntity(); BeanUtils.copyProperties(score, testScoreEntity); testScoreEntity.setTestId(testScoreDTO.getTestId()); - if (!"^".equals(score.getUserId())&&ObjectUtil.isNotEmpty(score.getDept())) { - R deptNameR = sysClient.getDeptName(score.getDept()); - if (deptNameR.isSuccess()&&StringUtils.isNotBlank(deptNameR.getData())){ - testScoreEntity.setDeptName(deptNameR.getData()); + if (!"^".equals(score.getUserId())&&StringUtils.isEmpty(score.getDeptName())) { + User user = UserCache.getUser(Long.valueOf(score.getUserId())); + if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getDeptId())){ + testScoreEntity.setDeptId(user.getDeptId()); + List depts = deptList.stream().filter(s -> Long.valueOf(user.getDeptId()).equals(s.getId())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(depts)) { + testScoreEntity.setDeptName(depts.get(0).getDeptName()); + } } }else { - testScoreEntity.setUserId(""); + testScoreEntity.setUserId(null); } testScoreEntities.add(testScoreEntity); }); @@ -113,16 +131,19 @@ 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()); if (CollectionUtils.isNotEmpty(list)) { - testScoreSumVO.setPeopleNum(list.size()); - List collect = list.stream().filter(s -> s.getScore() > 60).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(list)) { - testScoreSumVO.setPercentage(new Double(collect.size() / list.size())); + testScoreSumVO.setActualPeopleNum(list.size()); + List passCollect = list.stream().filter(s -> s.getScore() > 60).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); + }else { + testScoreSumVO.setPercentage(0.0); } } return testScoreSumVO; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java index 5d2b0d5..4179aae 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java @@ -215,13 +215,13 @@ public class TestServiceImpl extends ServiceImpl impleme User user = UserCache.getUser(Long.valueOf(personId[i])); if (ObjectUtil.isNotEmpty(user)) { testScoreEntity.setDeptId(user.getDeptId()); - R deptNameR = sysClient.getDeptName(Long.valueOf(personId[i])); + R deptNameR = sysClient.getDeptName(Long.valueOf(user.getDeptId())); if (deptNameR.isSuccess() && StringUtils.isNotBlank(deptNameR.getData())) { testScoreEntity.setDeptName(deptNameR.getData()); } } }else { - testScoreEntity.setUserId(""); + testScoreEntity.setUserId(null); } res.add(testScoreEntity); } 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 be17274..866364c 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 @@ -205,6 +205,13 @@ public class TrainRecordServiceImpl extends ServiceImpl