提交 1eedee84 authored 作者: 邓砥奕's avatar 邓砥奕

[退装模块]修改分隔退装详情Bug

上级 5beb80d5
......@@ -24,6 +24,7 @@ import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.ListUtil;
import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.StringSplitUtil;
import com.tykj.dev.socket.MyWebSocket;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -116,9 +117,8 @@ public class DeviceRetiredController {
DeviceRetiredDetailResultVo deviceRetiredDetailResultVo = new DeviceRetiredDetailResultVo();
DeviceRetiredBill deviceRetiredBillEntity = deviceRetiredBillService.getOne(retiredId);
//获取销毁详情里的装备
String[] deviceDetails = getRetiredDeviceList(deviceRetiredBillEntity.getRetiredDetail());
for (String deviceDetail : deviceDetails) {
Integer deviceId = Integer.valueOf(deviceDetail.substring(0, deviceDetail.length() - 1));
List<Integer> deviceDetails = getRetiredDeviceList(deviceRetiredBillEntity.getRetiredDetail());
for (Integer deviceId : deviceDetails) {
deviceRetiredDetailResultVo.getPackingLibrarys().add(packingLibraryService.getOne(deviceId));
}
deviceRetiredDetailResultVo.setRetiredStatus(deviceRetiredBillEntity.getRetiredStatus());
......@@ -148,9 +148,8 @@ public class DeviceRetiredController {
taskService.moveToEnd(task);
taskService.update(task);
//更改对应列装库的状态为退装
String[] deviceRetiredArrays = getRetiredDeviceList(deviceRetiredBillEntity.getRetiredDetail());
for (String deviceDetail : deviceRetiredArrays) {
Integer deviceId = Integer.valueOf(deviceDetail.substring(0, deviceDetail.length() - 1));
List<Integer> deviceRetiredArrays = getRetiredDeviceList(deviceRetiredBillEntity.getRetiredDetail());
for (Integer deviceId : deviceRetiredArrays) {
PackingLibrary packingLibraryServiceOne = packingLibraryService.getOne(deviceId);
packingLibraryServiceOne.setPackingStatus(3);
packingLibraryServiceOne.setExitTime(Timestamp.from(new Date().toInstant()));
......@@ -166,9 +165,8 @@ public class DeviceRetiredController {
}
private String[] getRetiredDeviceList(String destoryDeviceDetail) {
destoryDeviceDetail = destoryDeviceDetail.substring(1);
return destoryDeviceDetail.split("x");
private List<Integer> getRetiredDeviceList(String destoryDeviceDetail) {
return StringSplitUtil.split(destoryDeviceDetail);
}
private DeviceRetiredResultVo calcDeviceRetiredResultVo(PackingLibrary packingLibraryEntity) {
......
package com.tykj.dev.device.selfcheck.base;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.SpringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component
public class SelfCheckSchedulerTask {
/**
* 月度
*/
private String cron1 = "0 0 0 1 1/1 ? ";
/**
* 季度
*/
private String cron2 = "0 0 0 1 3,6,9,12 ? ";
/**
* 年度
*/
private String cron3 = "0 0 0 1 1 ? *";
private ThreadPoolTaskScheduler threadPoolTaskScheduler;
// @Async
// @Scheduled(cron = "0 0/1 * * * ? ")
// public void createSelfCheckTask() throws InterruptedException{
// UnitsDao unitsDao = SpringUtils.getBean("unitsDao");
// TaskService taskService = SpringUtils.getBean("taskServiceImpl");
// if (unitsDao != null && taskService!=null) {
// List<Units> unitsList = unitsDao.findAll();
// unitsList.forEach(units -> {
// //发起待自查任务
// List<Integer> userIds = new ArrayList<>();
// userIds.add(0);
// TaskBto taskBto = new TaskBto(StatusEnum.WAIT_SELF_CHECK.id,"自查业务",null,".",0,4,units.getUnitId(),0,null,userIds);
// taskService.start(taskBto);
// });
// }
// }
}
......@@ -125,7 +125,7 @@ public class TaskBto {
ModelMapper modelMapper = BeanHelper.getUserMapper();
TaskUserVo taskUserVo = modelMapper.map(this, TaskUserVo.class);
//set vo字段
if (userPublicService != null) {
if (userPublicService != null&&this.createUserId!=null) {
taskUserVo.setStartUnit(userPublicService.findUnitsNameByUserId(this.createUserId));
}
taskUserVo.setStatus(GlobalMap.getStatusEnumMap().get(this.billStatus).name);
......
......@@ -285,7 +285,7 @@ public class LogAspect {
break;
case 22:
AllotBackBillService allotBackBillService = SpringUtils.getBean("allotBackBillServiceImpl");
if (allotBackBillService != null) {
if (allotBackBillService != null && outPutTask.getBillId()>0) {
AllotBackBill allotBackBill = allotBackBillService.getOne(outPutTask.getBillId());
getFieldsParam(allotBackBill);
if ((this.oldStatus.equals(StatusEnum.ORIGIN_STATUS.id)&&this.newStatus.equals(StatusEnum.ALLOT_BACKING.id))){
......@@ -299,7 +299,7 @@ public class LogAspect {
break;
case 4:
SelfCheckBillService selfCheckBillService = SpringUtils.getBean("selfCheckBillServiceImpl");
if (selfCheckBillService != null) {
if (selfCheckBillService != null && outPutTask.getBillId()>0) {
getFieldsParam(selfCheckBillService.getOne(outPutTask.getBillId()));
}
break;
......
......@@ -6,6 +6,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
......@@ -15,6 +16,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@ServletComponentScan
@EnableJpaAuditing
@EnableTransactionManagement
@EnableScheduling
public class UnionApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论