Browse Source

培训记录-考试填报代码提交

zhongwei
ty 10 months ago
parent
commit
73f991e487
  1. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java
  2. 15
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java
  3. 21
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java
  4. 19
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java
  5. 12
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java
  6. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java
  7. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java
  8. 41
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java
  9. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java
  10. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java

10
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;

15
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;
}

21
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;
}

19
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;
}

12
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<SpAllocationVO> 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<IPage<SpAllocationEntity>> list(SpAllocationEntity sp_allocation, Query query) {
IPage<SpAllocationEntity> 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)));
}

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java

@ -181,6 +181,11 @@ public class ConferenceRecordServiceImpl extends ServiceImpl<ConferenceRecordMap
ConferencePlanEntity conferencePlanEntity = conferencePlanMapper.selectById(planId);
BeanUtil.copy(conferencePlanEntity,trainRecordVO);
trainRecordVO.setActualStartTime(record.getActualStartTime());
trainRecordVO.setActualEndTime(record.getActualEndTime());
trainRecordVO.setRecorder(record.getRecorder());
trainRecordVO.setContent(record.getContent());
trainRecordVO.setCode(record.getCode());
trainRecordVO.setId(record.getId().toString());
recordlVOS.add(trainRecordVO);
}
res.setRecords(recordlVOS);

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java

@ -228,6 +228,10 @@ public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMappe
rehearsalRecordlVO.setPeopleNum(String.valueOf(length));
rehearsalRecordlVO.setActualStartTime(record.getActualStartTime());
rehearsalRecordlVO.setActualEndTime(record.getActualEndTime());
rehearsalRecordlVO.setCode(record.getCode());
rehearsalRecordlVO.setComment(record.getComment());
rehearsalRecordlVO.setRecord(record.getRecord());
rehearsalRecordlVO.setId(record.getId().toString());
recordlVOS.add(rehearsalRecordlVO);
}
res.setRecords(recordlVOS);

41
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java

@ -18,11 +18,18 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -38,6 +45,7 @@ import java.util.stream.Collectors;
@Slf4j
public class TestScoreServiceImpl extends ServiceImpl<TestScoreMapper, TestScoreEntity> implements ITestScoreService {
private final ISysClient sysClient;
private final IUserClient userClient;
@Resource
TestMapper testMapper;
@ -53,22 +61,32 @@ public class TestScoreServiceImpl extends ServiceImpl<TestScoreMapper, TestScore
* 批量填写分数
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateBatchScore(TestScoreDTO testScoreDTO) {
boolean b = this.removeRelativeTestScore(testScoreDTO.getTestId());
if (b) {
List<TestScoreVO> scoreList = testScoreDTO.getScoreList();
List<TestScoreEntity> testScoreEntities = new ArrayList<>();
R<List<Dept>> deptListR = sysClient.getDeptList();
if (!deptListR.isSuccess()&&CollectionUtils.isEmpty(deptListR.getData())){
log.error("获取所有机构数据失败");
}
List<Dept> 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<String> 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<Dept> 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<TestScoreMapper, TestScore
if (StringUtils.isNotBlank(peopleName)) {
String[] split = peopleName.split(",");
testScoreSumVO.setPeopleNum(split.length);
}
QueryWrapper<TestScoreEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(TestScoreEntity::getTestId, testId);
List<TestScoreEntity> list = this.list(queryWrapper);
list= list.stream().filter(s -> s.getScore() != null).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(list)) {
testScoreSumVO.setPeopleNum(list.size());
List<TestScoreEntity> 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<TestScoreEntity> 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;

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java

@ -215,13 +215,13 @@ public class TestServiceImpl extends ServiceImpl<TestMapper, TestEntity> impleme
User user = UserCache.getUser(Long.valueOf(personId[i]));
if (ObjectUtil.isNotEmpty(user)) {
testScoreEntity.setDeptId(user.getDeptId());
R<String> deptNameR = sysClient.getDeptName(Long.valueOf(personId[i]));
R<String> 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);
}

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java

@ -205,6 +205,13 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
TrainPlanEntity trainPlanEntity = trainPlanMapper.selectById(getTrainPlanId);
BeanUtil.copy(trainPlanEntity,trainRecordVO);
trainRecordVO.setActualEndTime(record.getActualEndTime());
trainRecordVO.setActualStartTime(record.getActualStartTime());
trainRecordVO.setScheduledStartTime(record.getActualStartTime());
trainRecordVO.setTrainRecordName(record.getTrainRecordName());
trainRecordVO.setContent(record.getContent());
trainRecordVO.setCommand(record.getCommand());
trainRecordVO.setCode(record.getCode());
trainRecordVO.setId(record.getId().toString());
recordlVOS.add(trainRecordVO);
}
res.setRecords(recordlVOS);

Loading…
Cancel
Save