提交 7bba8d2a authored 作者: Matrix's avatar Matrix

Merge branch 'master' into release

# Conflicts: # dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
package com.tykj.dev.config;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.stereotype.Component;
@Component
public class BeanConfig {
@Bean
public TaskScheduler taskScheduler() {
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.setPoolSize(10);
return taskScheduler;
}
}
package com.tykj.dev.config;
import com.tykj.dev.misc.base.StatusEnum;
import lombok.AllArgsConstructor;
import static com.tykj.dev.misc.base.StatusEnum.*;
......@@ -141,8 +142,31 @@ public enum LogType {
ALLOT_BACK_3(59, ALLOT_BACK_CONFIRM.id, END.id, "配发退回装备接收审核成功"),
ALLOT_BACK_4(60, ALLOT_BACK_CONFIRM.id, ARCHIVE.id, "配发退回装备接收审核失败");
ALLOT_BACK_4(60, ALLOT_BACK_CONFIRM.id, ARCHIVE.id, "配发退回装备接收审核失败"),
TRAIN1(61,ORIGIN_STATUS.id,TRAIN1000.id,"创建培训成功,等待报名"),
TRAIN2(62,TRAIN1000.id, TRAIN1010.id,"报名结束,待培训"),
TRAIN3(63,TRAIN1010.id,TRAIN1004.id,"培训中"),
TRAIN4(64,TRAIN1004.id,TRAIN1005.id,"市培训成绩录入完成"),
TRAIN5(65,TRAIN1005.id,TRAIN1006.id,"市向省申请发证"),
TRAIN6(66,TRAIN1006.id,END.id,"市培训完成"),
TRAIN7(67,TRAIN1004.id,TRAIN1007.id,"省培训成绩录入完成,等待审核"),
TRAIN8(68,TRAIN1007.id,END.id,"省培训完成"),
SEND_BACK_1(69,ORIGIN_STATUS.id,SEND_BACK_1200.id,"清退任务创建完成,等待下属单位把装备退回"),
SEND_BACK_2(70,ORIGIN_STATUS.id,SEND_BACK_1203.id,"装备出库校验完成,等待出库"),
SEND_BACK_3(71,SEND_BACK_1203.id,SEND_BACK_1202.id,"装备出库完成,等待审核"),
SEND_BACK_4(72,SEND_BACK_1202.id,SEND_BACK_1206.id,"清退装备出库审核通过,等待签收"),
SEND_BACK_5(73,SEND_BACK_1206.id,SEND_BACK_1204.id,"签收成功等待入库审核"),
SEND_BACK_6(74,SEND_BACK_1204.id,END.id,"入库审核通过"),
SEND_BACK_7(75,ORIGIN_STATUS.id,SEND_BACK_1205.id,"异常装备任务生成,等待填写装备异常信息"),
SEND_BACK_8(76,SEND_BACK_1205.id,END.id,"异常装备处理完成"),
SEND_BACK_9(77,ORIGIN_STATUS.id,SEND_BACK_1207.id,"异常装备的确认任务"),
SEND_BACK_10(78,SEND_BACK_1207.id,END.id,"异常装备的确认任务通过"),
WORK_H1(79,ORIGIN_STATUS.id,WORKHANDOVER1011.id,"工作交接任务生成完成,等待上传交接单"),
WORK_H2(80,WORKHANDOVER1011.id,END.id,"工作交接完成");
public Integer id;
/**
......
......@@ -468,9 +468,11 @@ public class DeviceCheckController {
// 如果是4流程的,则需要指定核查组成员A接任务
detailRepo.updateCheckStatus(id, checkStatus);
if (userAId > 0 && userBId > 0) {
log.info("[核查模块] 该详情任务是一个4流程任务,推送到C状态...");
taskService.moveToNext(currentTask, userAId);
} else {
// 如果是2流程的,则直接结束该任务
log.info("[核查模块] 该详情任务是一个2流程任务,结束任务并统计数据...");
taskService.moveToEnd(currentTask);
summaryDetail(currentTask, currentDetail);
}
......@@ -495,7 +497,6 @@ public class DeviceCheckController {
// 如果当前是第3步(利用余数来判断),则需要指定核查组B的人来接受任务
boolean stepC = currentTask.getBillStatus() % 10 == 2;
boolean stepD = currentTask.getBillStatus() % 10 == 3;
if (stepC) {
log.info("[核查模块] C 检查组成员A正在进行核查操作,核查详情账单id为 : {}", id);
if (!currentTask.getBillStatus().equals(CHECK_DETAIL_2.id)) {
......@@ -586,8 +587,8 @@ public class DeviceCheckController {
// 如果汇总完毕则将父级的统计任务推进
if (over) {
TaskBto fatherTask = taskService.get(fatherTaskId);
//如果上一个id是-1 则证明是所有人的跟踪统计,即自动核查,那么下一步推进到所有人的待办
Integer lastUserId = fatherTask.getLastUserId() == -1 ? 0 : fatherTask.getLastUserId();
//如果上一个id是-1 则证明是所有人的跟踪统计,即自动核查,那么下一步推进到所有人的跟踪,否则设置为-2,即维持跟踪者id
Integer lastUserId = fatherTask.getLastUserId() == -1 ? -1 : -2;
taskService.moveToNext(fatherTask, lastUserId);
}
log.info("[核查模块] 数据汇总完毕");
......
......@@ -6,6 +6,8 @@ import com.alibaba.fastjson.TypeReference;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.SendBackBill;
import com.tykj.dev.device.sendback.entity.domain.SendBackBillDetail;
......@@ -67,6 +69,9 @@ public class SendBackServiceImpl implements SendBackService {
@Autowired
DeviceLibraryService deviceLibraryService;
@Autowired
DeviceLogService deviceLogService;
@Autowired
public SendBackServiceImpl(TaskService taskService,DeviceLibraryDao deviceLibraryDao, SendBackBillDao sendBackBillEntityDao, TaskDao taskDao, UnitsDao unitsDao, AreaDao areaDao, UserDao userDao, UserDao userDao1, SendBackBillDetailDao sendBackBillDetailEntityDao) {
this.taskService=taskService;
......@@ -333,7 +338,6 @@ public class SendBackServiceImpl implements SendBackService {
/*
保存task
*/
/*
生成一条代办的job,生成一条跟踪的job
*/
......@@ -372,7 +376,12 @@ public class SendBackServiceImpl implements SendBackService {
根据idList查询装备列表
*/
List<DeviceLibrary> deviceList = deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(idList);
deviceList.forEach(devices -> devices.setOwnUnit(units.getName()));
deviceList.forEach(devices -> {
DeviceLogDto deviceLogDto = new DeviceLogDto(devices.getId(),"清退异常将装备的所属单位从"+devices.getOwnUnit()+"改为"+units.getName(),null);
deviceLogService.addLog(deviceLogDto);
devices.setOwnUnit(units.getName());
deviceLibraryService.update(devices);
});
/*
在parentTask的账单中移除id
......@@ -500,6 +509,7 @@ public class SendBackServiceImpl implements SendBackService {
SendBackBillDetail backBillDetailEntity = sendBackBillDetailEntityDao.save(sendBackBillDetailEntity);
bill.setFormId(backBillDetailEntity.getId());
sendBackBillEntityDao.save(bill);
return ResponseEntity.ok("装备出库发起成功等待审核");
}
......@@ -952,51 +962,6 @@ public class SendBackServiceImpl implements SendBackService {
return taskService.start(new TaskBto(StatusEnum.SEND_BACK_1200.id,"装备清退",null,".",billEntity.getId(), BusinessEnum.SEND_BACK.id,unitId,1,null,integers));
}
/**
* 添加一个job,结束上一个job
* @param taskId 任务id
* @param billStatus 任务状态
* @param involeUserId 用户id
*/
// private void addJob(Integer taskId,Integer billStatus,Integer involeUserId,JobEntity oldJob,Integer belongUserId,Integer isDone){
//
// /*
// 新增一个job
// */
// JobEntity jobEntity = new JobEntity();
// /*
// 结束上一个,继承参与人的字段
// */
// String involeUser = "";
// if(oldJob != null){
// involeUser = oldJob.getInvoleUserId();
// }
// if(!involeUser.contains("x" + involeUserId)){
// jobEntity.setInvoleUserId(involeUser+"x"+involeUserId);
// }else {
// jobEntity.setInvoleUserId(involeUser);
// }
// /*
// 任务id
// */
// jobEntity.setTaskId(taskId);
// /*
// 任务状态
// */
// jobEntity.setBillStatus(billStatus);
// /*
// 所属人id
// */
// jobEntity.setBelongUserId(belongUserId);
//
// /*
// job状态
// */
// jobEntity.setIsDone(isDone);
// jobDao.save(jobEntity);
//
// }
/**
* 按照需求返回单位和区域的映射关系
......
......@@ -203,19 +203,10 @@ public class TrainJobController {
trainTaskService.selectBillidAndBillType(trainId,BusinessEnum.TRAIN.id,StatusEnum.TRAIN1000.id).forEach(
taskBto ->taskService.moveToSpecial(taskBto,StatusEnum.TRAIN1010)
);
// TaskEntity taskEntity=taskService.findByParentAndBillIdAndBussType(0,trainTheme.getTrainId(),BusinessEnum.TRAIN.id);
// taskEntity.setBillStatus(7);
// taskService.update(taskEntity);
// JobEntity jobEntity= taskUtils.getCurrentJob(taskEntity.getId());
// jobEntity.setIsDone(1);
// jobService.update(jobEntity);
// JobEntity jobEntity1=new JobEntity();
// BeanUtils.copyProperties(jobEntity,jobEntity1);
// jobEntity1.setIsDone(0);
// jobEntity1.setId(null);
// //5 待培训
// jobEntity1.setBillStatus(7);
// jobService.addEntity(jobEntity1);
//查询主task
TaskBto taskBto= trainTaskService.selectFatherIsNullAndBillidAndBillType(trainTheme.getTrainId(), BusinessEnum.TRAIN.id);
// //主task往下推待培训状态,0
taskService.moveToSpecial(taskBto,StatusEnum.TRAIN1010,0);
//5 待培训
trainTheme.setTrainStatus(StatusEnum.TRAIN1010.id);
myWebSocket.sendMessage1();
......@@ -243,6 +234,9 @@ public class TrainJobController {
// jobEntity1.setBillStatus(8);
// jobService.addEntity(jobEntity1);
//5 培训中
TaskBto taskBto= trainTaskService.selectFatherIsNullAndBillidAndBillType(trainTheme.getTrainId(), BusinessEnum.TRAIN.id);
// //主task往下推待培训状态,0
taskService.moveToSpecial(taskBto,StatusEnum.TRAIN1004,0);
trainTheme.setTrainStatus(StatusEnum.TRAIN1004.id);
myWebSocket.sendMessage1();
return ResponseEntity.ok(trainThemeService.save(trainTheme));
......
......@@ -25,6 +25,7 @@ import com.tykj.dev.device.repair.subject.domin.RepairBill;
import com.tykj.dev.device.repair.subject.domin.RepairSendBill;
import com.tykj.dev.device.retired.service.DeviceRetiredBillService;
import com.tykj.dev.device.selfcheck.service.SelfCheckBillService;
import com.tykj.dev.device.sendback.entity.domain.SendBackBill;
import com.tykj.dev.device.sendback.repository.SendBackBillDao;
import com.tykj.dev.device.storage.service.StorageBillService;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
......@@ -382,7 +383,11 @@ public class LogAspect {
case 16:
SendBackBillDao sendBackBillDao = SpringUtils.getBean("sendBackBillDao");
if (sendBackBillDao != null) {
getFieldsParam(sendBackBillDao.getOne(outPutTask.getBillId()));
SendBackBill sendBackBill = sendBackBillDao.getOne(outPutTask.getBillId());
getFieldsParam(sendBackBill);
// if (){
//
// }
}
break;
case 19:
......
package com.tykj.dev.union;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.Arrays;
@SpringBootApplication(scanBasePackages = "com.tykj.dev.*")
@EnableSwagger2
......
spring.datasource.url=jdbc:mysql://192.168.100.249:3306/device?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.url=jdbc:mysql://localhost:3306/device?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
......
......@@ -137,7 +137,7 @@ class DeviceCheckControllerTest extends BaseTest {
// .build())
// .get(0);
initTask = taskRepo.findById(724).get();
initTask = taskRepo.findById(741).get();
detailBillId = initTask.getBillId();
......@@ -180,7 +180,7 @@ class DeviceCheckControllerTest extends BaseTest {
@Test
void checkUserA2D() throws Exception {
initTask = taskRepo.findById(723).get();
initTask = taskRepo.findById(748).get();
detailBillId = initTask.getBillId();
......@@ -220,7 +220,7 @@ class DeviceCheckControllerTest extends BaseTest {
// checkUserB 接口 测试审核通过
String url_b = baseUrl + "B/" + detailBillId + "?" + "checkStatus=1";
String url_b = baseUrl + "B/" + detailBillId + "?" + "checkStatus=1&checkUserAId=3&checkUserBId=4";
request = put(url_b)
.header("Origin", "*");
......
......@@ -21,10 +21,7 @@ public class UserSuperiorVo {
/**
* 用户
*/
@ApiModelProperty(value = "用户数据ID", name = "userId", example = "12321L")
// @GeneratedValue(generator="UserIdentityGenerator",strategy = GenerationType.AUTO)
// @GenericGenerator(name = "UserIdentityGenerator", strategy = "UserIdentityGenerator")
private Integer userId;
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论