提交 f4fbd944 authored 作者: Matrix's avatar Matrix

Merge branch '0914tmp'

合并了部分代码
package com.tykj.dev.device.confirmcheck.common;
import lombok.Getter;
/**
* CcNodeType.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/23 at 12:48 下午
*/
@Getter
public enum CcNodeType {
/**
* 核查节点
*/
CHECK,
/**
* 检查节点
*/
EXAM,
/**
* 自查节点
*/
MANUAL,
/**
* 统计数据确认节点
*/
CONFIRM,
/**
* 不属于以上的其他节点
*/
NONE;
}
package com.tykj.dev.device.confirmcheck.controller;
import cn.hutool.core.lang.Func;
import com.github.wenhao.jpa.Specifications;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.tykj.dev.config.GlobalMap;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.confirmcheck.common.CcNodeType;
import com.tykj.dev.device.confirmcheck.common.CheckChart;
import com.tykj.dev.device.confirmcheck.common.CheckType;
import com.tykj.dev.device.confirmcheck.common.TaskPeriod;
......@@ -24,11 +24,15 @@ import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.selfcheck.controller.SelfCheckController;
import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.base.enums.AuExample;
import com.tykj.dev.device.user.cache.AreaCache;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.AreaDao;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.entity.Area;
......@@ -38,7 +42,6 @@ import com.tykj.dev.device.user.subject.entity.bto.AreaUnit;
import com.tykj.dev.device.user.subject.service.AuService;
import com.tykj.dev.device.user.subject.service.UserService;
import com.tykj.dev.device.user.util.AuthenticationUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.ResultObj;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.exception.ApiException;
......@@ -62,7 +65,6 @@ import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_DETAIL;
import static com.tykj.dev.misc.base.BusinessEnum.CONFIRM_CHECK_STAT;
......@@ -81,10 +83,10 @@ import static java.util.stream.Collectors.*;
@Api(tags = "核查模块", description = "核查模块", position = 1)
public class DeviceCheckController {
final String CHECK_RESULT_WAIT = "等待省查阅";
final String CHECK_RESULT_DONE = "已查阅";
Map<Integer, String> desMap = new HashMap<>();
Map<Integer, String> desBillMap = new HashMap<>();
@Autowired
private DeviceCheckStatDao statRepo;
@Autowired
......@@ -119,10 +121,12 @@ public class DeviceCheckController {
private MyWebSocket myWebSocket;
@Autowired
private SelfCheckController selfCheckController;
final String CHECK_RESULT_WAIT = "等待省查阅";
final String CHECK_RESULT_DONE = "已查阅";
private int specialDetailId = 0;
private List<String> specialUnits = new ArrayList<>();
@Autowired
private MessageService messageService;
@Autowired
private TaskLogService taskLogService;
@GetMapping("/area/{fatherId}")
@ApiOperation(value = "查询指定区域下的所有区域信息")
......@@ -226,7 +230,6 @@ public class DeviceCheckController {
return ccService.findAllStatTable(checkBillSelectVo);
}
@ApiOperation(value = "根据id查询核查详情数据", notes = "可以通过这个接口查询核查详情数据")
@GetMapping("/detail/{id}")
public ResponseEntity<ResultObj<CheckDetailVo>> findDetail(@PathVariable Integer id) {
......@@ -249,47 +252,44 @@ public class DeviceCheckController {
return ResponseEntity.ok(new ResultObj<>(detailVoList));
}
private int specialDetailId = 0;
private List<String> specialUnits = new ArrayList<>();
@GetMapping("/detail/refresh/remove/{checkId}/{detailId}")
public ResponseEntity<String> removeUnitTask(@PathVariable Integer checkId,@PathVariable Integer detailId){
log.info("[核查模块] 移除billId = {} 中 detailId = {}的数据 ",checkId,detailId);
public ResponseEntity<String> removeUnitTask(@PathVariable Integer checkId, @PathVariable Integer detailId) {
log.info("[核查模块] 移除billId = {} 中 detailId = {}的数据 ", checkId, detailId);
DeviceCheckDetail detail = detailRepo.findById(detailId).get();
DeviceCheckStat dcs = statRepo.findById(checkId).get();
removeDetailFromDcs(detail,dcs);
log.info("[核查模块] 从stat id = {} 中删除detail id = {}的数据",checkId,detailId);
removeDetailFromDcs(detail, dcs);
log.info("[核查模块] 从stat id = {} 中删除detail id = {}的数据", checkId, detailId);
// 删除task
Task task = taskRepo.findByBillIdAndBusinessType(detailId, CONFIRM_CHECK_DETAIL.id).get();
taskRepo.deleteById(task.getId());
log.info("[核查模块] 删除task id = {} 的任务",task.getId());
log.info("[核查模块] 删除task id = {} 的任务", task.getId());
return ResponseEntity.ok("成功删除数据");
}
@GetMapping("/detail/refresh/active/{id}")
public ResponseEntity<String> activeSpecialData(@PathVariable Integer id,@RequestParam Integer unitId1,@RequestParam(defaultValue = "0") Integer unitId2){
public ResponseEntity<String> activeSpecialData(@PathVariable Integer id, @RequestParam Integer unitId1, @RequestParam(defaultValue = "0") Integer unitId2) {
String unitName1 = "";
String unitName2 = "";
unitName1 = unitsRepo.findById(unitId1).get().getName();
unitName2 = unitsRepo.findById(unitId2).get().getName();
if (!StringUtils.isEmpty(unitName1)){
if (!StringUtils.isEmpty(unitName1)) {
specialUnits.add(unitName1);
}
if (!StringUtils.isEmpty(unitName2)){
if (!StringUtils.isEmpty(unitName2)) {
specialUnits.add(unitName2);
}
log.info("[核查模块] 特殊数据处理,设置specialDetailId = {},specialUnitsId = {} {} ",id,unitId1,unitId2);
log.info("[核查模块] 特殊数据处理,设置specialDetailId = {},specialUnitsId = {} {} ", id, unitId1, unitId2);
specialDetailId = id;
return ResponseEntity.ok("设置特殊数据处理成功");
}
@GetMapping("/detail/refresh/reset")
public ResponseEntity<String> resetSpecialData(){
public ResponseEntity<String> resetSpecialData() {
log.info("[核查模块] 重置特殊数据! ");
specialDetailId = 0;
specialUnits = new ArrayList<>();
......@@ -297,7 +297,6 @@ public class DeviceCheckController {
return ResponseEntity.ok("设置特殊数据处理成功");
}
@ApiOperation(value = "根据id 刷新 核查详情数据", notes = "可以通过这个接口 刷新 核查详情数据")
@GetMapping("/detail/refresh/{id}")
public ResponseEntity<ResultObj<CheckDetailVo>> refreshDetail(@PathVariable Integer id) {
......@@ -313,12 +312,12 @@ public class DeviceCheckController {
List<DeviceLibrary> devNotInLib = devLib.get(false);
// 特殊单位处理 if DetailId = x , 则补充添加 name=[],[]单位的装备进来
if (specialDetailId !=0 && specialUnits.size() != 0 && id == specialDetailId){
if (specialDetailId != 0 && specialUnits.size() != 0 && id == specialDetailId) {
String unitsString = specialUnits.stream().collect(joining(",", "[", "]"));
log.info("[核查模块] 特殊数据处理,要补充特殊数据的省本级detail Id ={},要补充的单位名 = {}",id,unitsString);
log.info("[核查模块] 特殊数据处理,要补充特殊数据的省本级detail Id ={},要补充的单位名 = {}", id, unitsString);
for (String specialUnit : specialUnits) {
log.info("[核查模块] 正在补充 {} 的数据",specialUnit);
log.info("[核查模块] 正在补充 {} 的数据", specialUnit);
Map<Boolean, List<DeviceLibrary>> specialLib = getDevLibMap(specialUnit, allDevices);
devInLib.addAll(specialLib.get(true));
devNotInLib.addAll(specialLib.get(false));
......@@ -337,6 +336,7 @@ public class DeviceCheckController {
/**
* 获得指定单位的在库装备与非在库装备
*
* @param checkUnit 单位名
* @param allDevices 装备列表
* @return true -> 在库装备,false -> 非在库装备
......@@ -524,14 +524,14 @@ public class DeviceCheckController {
// check type = 1 检查页面 看见的是自查
if (ctVo.getCheckType() == 1) {
Integer createUserId = ctVo.getCreateUserId();
if (userIsProv(createUserId)){
if (userIsProv(createUserId)) {
linkVo.setType(2);
}else {
} else {
linkVo.setType(3);
}
//看到的都是自查 根据tpye和billId找到父级节点 这里的根节点只能是检查节点
Task rootTask = taskRepo.findAllByBillIdAndBusinessType(billId, type).stream()
.filter(task -> Objects.nonNull(task.getCustomInfo()) &&task.getCustomInfo().contains("exam"))
.filter(task -> Objects.nonNull(task.getCustomInfo()) && task.getCustomInfo().contains("exam"))
.findFirst()
.orElseThrow(() -> new ApiException("[核查模块]没有找到对应billId的检查任务,您给的billId = " + billId));
// 找到所有的子节点
......@@ -780,9 +780,9 @@ public class DeviceCheckController {
//根据detail userC为省且任务状态是完结状态时 变为无误 否则是等待省审核
Integer detailId = task.getBillId();
Integer userCId = detailRepo.findById(detailId).get().getUserCId();
if (task.getBillStatus().equals(END.id) && userIsProv(userCId)){
if (task.getBillStatus().equals(END.id) && userIsProv(userCId)) {
checkResult = CHECK_RESULT_DONE;
}else {
} else {
checkResult = CHECK_RESULT_WAIT;
}
}
......@@ -823,7 +823,7 @@ public class DeviceCheckController {
* @return
*/
private boolean userIsProv(Integer userId) {
if (Objects.isNull(userId) || userId == 0){
if (Objects.isNull(userId) || userId == 0) {
return false;
}
Integer unitsId = userService.findById(userId).getUnitsId();
......@@ -896,7 +896,6 @@ public class DeviceCheckController {
return new ResultObj<>(resultIds, "自动核查任务发起成功");
}
@ApiOperation(value = "根据地区ID获取下级的单位", notes = "根据地区ID获取下级的单位")
@GetMapping("/under/{areaId}")
public ResponseEntity getUnitsUnderAreaId(@PathVariable Integer areaId, @RequestParam(defaultValue = "true") boolean filter) {
......@@ -1451,7 +1450,7 @@ public class DeviceCheckController {
taskService.moveToNext(currentTask);
summaryDetail(currentTask, currentDetail);
// // 检查该exam任务是否可以完结推进了
// advanceExamTask(currentTask.getParentTaskId());
advanceExamTask(currentTask.getParentTaskId());
}
} else {
//不通过则回到第一阶段
......@@ -1493,7 +1492,7 @@ public class DeviceCheckController {
currentDetail = detailRepo.save(currentDetail);
summaryDetail(currentTask, currentDetail);
// // 检查该exam任务是否可以完结推进了
// advanceExamTask(currentTask.getParentTaskId());
advanceExamTask(currentTask.getParentTaskId());
return ResponseEntity.ok("市专管员审核通过,结束" + currentDetail.getCheckUnit() + " 区的自查任务并汇总数据");
} else {
......@@ -1522,11 +1521,12 @@ public class DeviceCheckController {
/**
* 尝试自动完结检查任务(市/省的)
* 1. 当且仅当该检查任务的状态等于@link{CHECK_EXAM_STAT_1}时且其下的所有子任务均为完结状态,自动推进
*
* @param exam的taskId
*/
private void advanceExamTask(Integer examTaskId) {
TaskBto parentTask = taskService.findByTaskId(examTaskId);
if (parentTask.getBillStatus().equals(CHECK_EXAM_STAT_1.id)&&taskService.TaskTreeIsOver(examTaskId)){
if (parentTask.getBillStatus().equals(CHECK_EXAM_STAT_1.id) && taskService.TaskTreeIsOver(examTaskId)) {
log.info("[核查模块] 检测到task id = {}的检查任务已经可以自动推进了,自动推进至下一步", examTaskId);
statConfirm(parentTask.getBillId());
}
......@@ -1554,6 +1554,26 @@ public class DeviceCheckController {
}
}
@ApiOperation(value = "终结stat任务,多指核查任务")
@PutMapping("/stat/shutdown/{statId}")
public ResponseEntity shutDown(@PathVariable Integer statId) {
//
Task checkTask = taskRepo.findByBillIdAndBusinessType(statId, CONFIRM_CHECK_STAT.id).get();
// 检验所有还没有end的节点
// 1级节点分为两类 自查类节点&统计数据确认节点 以及 检查类节点
List<Task> l1Childs = taskRepo.findAllByParentTaskId(checkTask.getId());
for (Task c1 : l1Childs) {
if (predNodeType(c1).equals(CcNodeType.EXAM)) {
List<Task> c2Childs = taskRepo.findAllByParentTaskId(c1.getId());
c2Childs.forEach(c2 -> shutDownNode(c2));
} else {
shutDownNode(c1);
}
}
return ResponseEntity.ok(String.format("任务节点task id = %d 的任务已经成功关闭", checkTask.getId()));
}
/**
* 将detail里的detailString里的检查数字该为指定数值
*
......@@ -1654,9 +1674,9 @@ public class DeviceCheckController {
removeDetailFromDcs(detail, dcs);
//4.父级任务变为进行中 如果父级是核查,变成111,如果父级是检查,变成131
if (fatherTask.getCustomInfo().contains("exam")){
if (fatherTask.getCustomInfo().contains("exam")) {
fatherTask.setBillStatus(CHECK_EXAM_STAT_1.id);
}else if (fatherTask.getCustomInfo().contains("check")){
} else if (fatherTask.getCustomInfo().contains("check")) {
fatherTask.setBillStatus(CHECK_STAT_1.id);
}
taskRepo.save(fatherTask.toDo());
......@@ -1736,7 +1756,6 @@ public class DeviceCheckController {
return updateDetail;
}
/**
* 将统计数据中指定城市的统计数据重置
*
......@@ -1757,6 +1776,70 @@ public class DeviceCheckController {
statRepo.save(statVo.toDo());
}
/**
* 关闭某个节点,该节点下必须没有子节点树了
* <p>1.将该任务进度推进至9999</>
* <p>2.手动补充终结日志</>
* <p>3.将终结信息添加阅知列表里面</>
*
* @param node
*/
private void shutDownNode(Task node) {
log.info("[核查模块] 终止任务-正在关闭 task id = {} 的任务节点");
// 如果是核查类捡点,抛出异常
if (node.getCustomInfo().equals("check") || node.getCustomInfo().equals("exam")) {
throw new ApiException("关闭节点里不处理核查/核查节点...,你提供的任务节点id = " + node.getId());
}
// 其余节点,执行关闭策略
// 1.将该任务进度推进至9999
TaskBto nodeBto = node.parse2Bto();
taskService.moveToEnd(nodeBto);
// 2.手动补充终结日志
String adminUser = authenticationUtils.getAuthentication().getCurrentUserInfo().getName();
String shutDownMsg = String.format("专管员[%s]终止了该任务", adminUser);
TaskLogBto taskLog = new TaskLogBto(node.getId(), shutDownMsg);
taskLogService.addLog(taskLog);
// 3.添加阅知信息
MessageBto msgBto = new MessageBto(node.getId(), node.getBusinessType(), shutDownMsg, nodeBto.getInvolveUserIdList());
messageService.add(msgBto);
log.info("[核查模块] 终止任务-task id = {} 成功关闭");
}
/**
* 用来判断该节点类型
*
* @param task 任务节点
* @return {@link com.tykj.dev.device.confirmcheck.common.CcNodeType}
*/
private CcNodeType predNodeType(Task task) {
// bussiness type = 7
Integer type = task.getBusinessType();
if (type.equals(CONFIRM_CHECK_STAT.id)) {
// 核查 检查 统计数据确认
if (task.getCustomInfo().equals("check")) {
return CcNodeType.CHECK;
}
if (task.getCustomInfo().equals("exam")) {
return CcNodeType.EXAM;
}
if (task.getTitle().contains("统计数据确认任务")) {
return CcNodeType.CONFIRM;
}
} else if (type.equals(CONFIRM_CHECK_DETAIL.id)) {
// 自查任务
return CcNodeType.MANUAL;
} else {
// 其他任务
return CcNodeType.NONE;
}
return CcNodeType.NONE;
}
/**
* @param taskId 待办任务id
* @param statId 市级统计的STAT ID
......@@ -1849,7 +1932,7 @@ public class DeviceCheckController {
List<Task> existsDone = doneTaskList.get(statId);
if (Objects.nonNull(existsDone)){
if (Objects.nonNull(existsDone)) {
for (Task d : existsDone) {
log.info("[核查模块] 发现了id = {}市的重复的统计确认任务,将其完结并剔除整个树节点", d.getId());
d.setParentTaskId(0);
......@@ -2121,7 +2204,7 @@ public class DeviceCheckController {
* @param unitsList 被核查单位列表
* @return 一份初始化好统计数据(没有向上合并 , 只做了同级地区数据合并)的核查统计单
*/
private DeviceCheckStat initStatData(String title, String remark, Integer checkAId, Integer checkBId, String startUnitName, List<Units> unitsList, LocalDateTime endTime) {
private DeviceCheckStat initStatData(String title, String remark, Integer checkAId, Integer checkBId, String startUnitName, List<Units> unitsList, LocalDateTime endTime) {
//获得要被统计的单位名列表
List<String> unitNameList = unitsList.stream()
.map(Units::getName)
......
......@@ -309,10 +309,8 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
*/
@Override
public Page<CheckStatTableVo> findAllStatTable(CheckBillSelectVo checkBillSelectVo) {
//过滤出顶级节点
//过滤出顶级节点 过滤逻辑是1.自己就是父节点2.自己的customInfo = exam or check
List<TaskBto> topStatList = taskService.findBillType(7);
// List<TaskBto> topDetailList = taskService.findBillType(8);
// topStatList.addAll(topDetailList);
List<Integer> topIdList = topStatList.stream()
.filter(taskBto -> taskBto.getParentTaskId().equals(0) || taskBto.getParentTaskId() == null)
......
......@@ -223,6 +223,7 @@ public class TrainJobController {
TaskBto taskBto = taskService.get(signUpReturn.getTaskId());
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.TRAIN1002);
Integer taskId=taskBto.getId();
List<Integer> userIds=new ArrayList<>();
TrainUnit trainUnit= trainUnitDao.findByTrainIdAndUnitId(trainTheme.getTrainId(),taskBto.getOwnUnit());
if (trainTheme.getTrainTime().getTime()<new Date().getTime()){
trainUnit.setSubmitStatus(3);
......@@ -238,6 +239,8 @@ public class TrainJobController {
trainUser.setArriveTime(signUpUser.getArriveTime());
trainUser.setLeaveMeal(signUpUser.getLeaveMeal());
trainUser.setLeaveTime(signUpUser.getLeaveTime());
trainUser.setNote(signUpUser.getNote());
userIds.add(trainUser.getUserId());
userLogService.save(new UserLog(trainUser.getUserId(),new Date(),"报名参加培训"));
} else {
trainUser.setIsSignUp(2);
......@@ -249,12 +252,10 @@ public class TrainJobController {
TaskLogBto taskLogBto = new TaskLogBto(taskId, "提交了培训名单", null);
taskLogService.addLog(taskLogBto);
// userLogService.save(new UserLog(securityUser.getCurrentUserInfo().getUserId(),new Date(),"不参加培训"));
taskBto.setCreateUserId(securityUser.getCurrentUserInfo().getUserId());
taskBto = taskService.moveToEnd(taskBto);
// taskBto.setCreateUserId(securityUser.getCurrentUserInfo().getUserId());
// taskBto = taskService.moveToEnd(taskBto);
trainUnitDao.save(trainUnit);
List<Integer> userIds=userService.findAllByUnite(securityUser.getCurrentUserInfo().getUnitsId()).stream().map(User::getUserId).collect(Collectors.toList());
userIds.addAll(userService.findAllByUnite(trainTheme.getUnitsId()).stream().map(User::getUserId).collect(Collectors.toList()));
userIds.remove(securityUser.getCurrentUserInfo().getUserId());
messageService.add(new MessageBto(0, BusinessEnum.TRAIN_SIGN_UP.id, securityUser.getCurrentUserInfo().getName()+"帮你报名["+trainTheme.getName()+"]培训,培训地点:"+trainTheme.getTrainLocation(), userIds, trainTheme.getTrainId().toString()));
return ResponseEntity.ok(taskBto);
}
......@@ -274,9 +275,8 @@ public class TrainJobController {
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(), StatusEnum.END);
taskBto = taskService.moveToSpecial(taskBto, StatusEnum.TRAIN1002, 0);
List<Integer> userIds = userService.findAllByUnite(securityUser.getCurrentUserInfo().getUnitsId()).stream().map(User::getUserId).collect(Collectors.toList());
userIds.addAll(userService.findAllByUnite(trainTheme.getUnitsId()).stream().map(User::getUserId).collect(Collectors.toList()));
userIds.remove(securityUser.getCurrentUserInfo().getUserId());
messageService.add(new MessageBto(taskBto.getId(), BusinessEnum.TRAIN.id, securityUser.getUsername() + "拒绝了"+units.getName()+"培训报名", userIds, trainTheme.getTrainId().toString()));
userIds.addAll(userService.findAllByUnite(trainTheme.getUnitsId()).stream().filter(user -> !user.getUserId().equals(securityUser.getCurrentUserInfo().getUserId())).map(User::getUserId).collect(Collectors.toList()));
messageService.add(new MessageBto(0, BusinessEnum.TRAIN.id, securityUser.getCurrentUserInfo().getName()+"让"+units.getName()+"重新培训报名", userIds, trainTheme.getTrainId().toString()));
return ResponseEntity.ok(taskBto);
}
......
......@@ -88,6 +88,7 @@ public class TrainTheme {
* 培训开始时间
*/
@ApiModelProperty(value = "培训开始时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date startTime;
/**
* 培训结束时间
......
......@@ -145,11 +145,11 @@ public class TrainUser {
@ApiModelProperty(value = "到达就餐 0.无 1.午饭 2.晚饭", name = "arriveMeal")
private Integer arriveMeal;
private String arriveMeal;
@ApiModelProperty(value = "离开就餐 0.无 1.午饭 2.晚饭", name = "leaveMeal")
private Integer leaveMeal;
private String leaveMeal;
@ApiModelProperty(value = "是否必须报名 1.必须 2.不必须", name = "certificate")
private Integer isNotJoinUserId;
......@@ -176,29 +176,7 @@ public class TrainUser {
}else {
trainUserExcelVo.setPositionString("干事");
}
switch (this.getArriveMeal()){
case 0:
trainUserExcelVo.setArriveMealString("不包括饭");
break;
case 1:
trainUserExcelVo.setArriveMealString("午饭");
break;
case 2:
trainUserExcelVo.setArriveMealString("晚饭");
break;
}
switch (this.getLeaveMeal()){
case 0:
trainUserExcelVo.setLeaveMealString("不包括饭");
break;
case 1:
trainUserExcelVo.setLeaveMealString("午饭");
break;
case 2:
trainUserExcelVo.setLeaveMealString("晚饭");
break;
}
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
Instant instant = this.getLeaveTime().toInstant();
ZoneId zoneId = ZoneId.systemDefault();
......@@ -207,7 +185,8 @@ public class TrainUser {
LocalDateTime ArriveTime=instant1.atZone(zoneId).toLocalDateTime();
trainUserExcelVo.setArriveTime(ArriveTime.format(df));
trainUserExcelVo.setLeaveTime(LeaveTime.format(df));
trainUserExcelVo.setLeaveMealString(this.leaveMeal);
trainUserExcelVo.setArriveMealString(this.arriveMeal);
int daysNum=(int)(LeaveTime.toLocalDate().toEpochDay() - ArriveTime.toLocalDate().toEpochDay());
if (daysNum > 0){
trainUserExcelVo.setDayNum(daysNum);
......
......@@ -45,11 +45,11 @@ public class SignUpUsers {
@ApiModelProperty(value = "到达就餐 1.午饭 2.晚饭", name = "arriveMeal")
private Integer arriveMeal;
private String arriveMeal;
@ApiModelProperty(value = "离开就餐 1.午饭 2.晚饭", name = "leaveMeal")
private Integer leaveMeal;
private String leaveMeal;
}
......@@ -58,22 +58,22 @@ public class TrainUserExcelVo {
@ApiModelProperty(value = "到达时间", name = "arriveTime")
@Excel(name = "到达时间", orderNum = "1", width = 30, needMerge = true)
@Excel(name = "到达日期", orderNum = "1", width = 30, needMerge = true)
private String arriveTime;
@ApiModelProperty(value = "离开时间", name = "leaveTime")
@Excel(name = "离开时间", orderNum = "1", width = 30, needMerge = true)
@Excel(name = "离开日期", orderNum = "1", width = 30, needMerge = true)
private String leaveTime;
@ApiModelProperty(value = "到达就餐 0.无 1.午饭 2.晚饭", name = "arriveMeal")
@Excel(name = "到达就餐", orderNum = "1", width = 30, needMerge = true)
@Excel(name = "到达时间", orderNum = "1", width = 30, needMerge = true)
private String arriveMealString;
@ApiModelProperty(value = "离开就餐 0.无 1.午饭 2.晚饭", name = "leaveMeal")
@Excel(name = "离开就餐", orderNum = "1", width = 30, needMerge = true)
@Excel(name = "离开时间", orderNum = "1", width = 30, needMerge = true)
private String leaveMealString;
@ApiModelProperty(value = "住宿天数", name = "leaveMeal")
......
......@@ -193,7 +193,7 @@ public class TrainThemeServiceImpl implements TrainThemeService {
taskBto1 -> {
TrainUnit trainUnit=trainUnitMap.get(taskBto1.getOwnUnit());
List<TrainUser> trainUsersNotSignUp = trainUsers.stream().filter(trainUser -> trainUser.getUnitsId().equals(taskBto1.getOwnUnit()) && trainUser.getIsSignUp() == 2).collect(Collectors.toList());
if (taskBto1.getBillStatus().equals(StatusEnum.TRAIN1002.id)){
if (taskBto1.getBillStatus().equals(StatusEnum.TRAIN1002.id) && trainUnit.getSubmitStatus()==1){
flag.set(false);
List<TrainUser> trainUserList = trainUsers.stream().filter(trainUser -> trainUser.getUnitsId().equals(taskBto1.getOwnUnit())).collect(Collectors.toList());
notSignUpTrainUserToUnitVo.add(new TrainUserToUnitVo(taskBto1.getOwnUnit(), unitsCache.findById(taskBto1.getOwnUnit()).getName(), trainUserList, taskBto1.getId(),trainUnit.getSubmitStatus()));
......@@ -202,9 +202,7 @@ public class TrainThemeServiceImpl implements TrainThemeService {
if (trainUsersSignUp.size() != 0) {
signUpTrainUserToUnitVo.add(new TrainUserToUnitVo(taskBto1.getOwnUnit(),unitsCache.findById(taskBto1.getOwnUnit()).getName(), trainUsersSignUp, taskBto1.getId(),trainUnit.getSubmitStatus()));
}
if (trainUsersNotSignUp.size() != 0) {
notSignUpTrainUserToUnitVo.add(new TrainUserToUnitVo(taskBto1.getOwnUnit(), unitsCache.findById(taskBto1.getOwnUnit()).getName(), trainUsersNotSignUp, taskBto1.getId(),trainUnit.getSubmitStatus()));
}
notSignUpTrainUserToUnitVo.add(new TrainUserToUnitVo(taskBto1.getOwnUnit(), unitsCache.findById(taskBto1.getOwnUnit()).getName(), trainUsersNotSignUp, taskBto1.getId(),trainUnit.getSubmitStatus()));
}
}
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论