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

更新

上级 82bd9c0c
......@@ -574,27 +574,28 @@ public class AllotBillController {
public ResponseEntity saveAllotBill(@RequestBody AllotBillSaveVo allotBillSaveVo) {
//第一次保存
if (allotBillSaveVo.getTaskId()==null){
Integer userId = userUtils.getCurrentUserId();
//保存入库单
List<Integer> userIds = new ArrayList<>();
userIds.add(0);
userIds.add(userId);
AllotBill allotBill1 = allotBillSaveVo.toDo();
allotBill1.setAllotStatus(0);
allotBill1.setSendUseraId(userUtils.getCurrentUserId());
allotBill1.setSendUseraId(userId);
AllotBill allotBill = allotBillService.addEntity(allotBill1);
//发起任务
TaskBto taskBto = new TaskBto(StatusEnum.ALLOT_DRAFT.id, "配发业务", null, ".", allotBill.getId(), 3, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto1 = taskService.start(taskBto);
//改变装备状态为待配发
if (allotBillSaveVo.getAllotCheckDetail()!=null){
Map<Integer,DeviceLibrary> map = deviceLibraryService.getAllDeviceMap();
StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()).forEach(integer -> {
if (map.get(integer)!=null){
DeviceLibrary deviceLibrary = map.get(integer);
deviceLibrary.setLifeStatus(21);
deviceLibraryService.update(deviceLibrary);
}
});
}
// if (allotBillSaveVo.getAllotCheckDetail()!=null){
// Map<Integer,DeviceLibrary> map = deviceLibraryService.getAllDeviceMap();
// StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()).forEach(integer -> {
// if (map.get(integer)!=null){
// DeviceLibrary deviceLibrary = map.get(integer);
// deviceLibrary.setLifeStatus(21);
// deviceLibraryService.update(deviceLibrary);
// }
// });
// }
Integer id = taskBto1.getId();
myWebSocket.sendMessage1();
return ResponseEntity.ok("保存成功"+id);
......@@ -621,17 +622,17 @@ public class AllotBillController {
TaskBto taskBto1 = taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
taskService.moveToArchive(taskBto1);
//更改装备状态为在库
AllotBill allotBill = allotBillService.getOne(taskBto1.getBillId());
if (allotBill.getAllotCheckDetail()!=null){
Map<Integer,DeviceLibrary> map = deviceLibraryService.getAllDeviceMap();
StringSplitUtil.split(allotBill.getAllotCheckDetail()).forEach(integer -> {
if (map.get(integer)!=null){
DeviceLibrary deviceLibrary = map.get(integer);
deviceLibrary.setLifeStatus(2);
deviceLibraryService.update(deviceLibrary);
}
});
}
// AllotBill allotBill = allotBillService.getOne(taskBto1.getBillId());
// if (allotBill.getAllotCheckDetail()!=null){
// Map<Integer,DeviceLibrary> map = deviceLibraryService.getAllDeviceMap();
// StringSplitUtil.split(allotBill.getAllotCheckDetail()).forEach(integer -> {
// if (map.get(integer)!=null){
// DeviceLibrary deviceLibrary = map.get(integer);
// deviceLibrary.setLifeStatus(2);
// deviceLibraryService.update(deviceLibrary);
// }
// });
// }
myWebSocket.sendMessage1();
return ResponseEntity.ok("删除成功");
}
......@@ -655,6 +656,10 @@ public class AllotBillController {
TaskBto taskBto = taskService.get(taskId);
if (status==1){
taskService.moveToSpecial(taskBto,StatusEnum.WAIT_SIGN);
AllotBill allotBill = allotBillService.getOne(taskBto.getBillId());
allotBill.setSendUserbId(userUtils.getCurrentUserId());
allotBill.setAgent(userUtils.getCurrentName());
allotBillService.update(allotBill);
}
else {
taskService.moveToSpecial(taskBto,StatusEnum.ALLOT_DRAFT,taskBto.getCreateUserId());
......
......@@ -376,26 +376,28 @@ public class BackController {
public ResponseEntity saveBackBill(@RequestBody AllotBillSaveVo allotBillSaveVo) {
//第一次保存
if (allotBillSaveVo.getTaskId()==null){
Integer userId = userUtils.getCurrentUserId();
//保存退回单
List<Integer> userIds = new ArrayList<>();
userIds.add(0);
userIds.add(userId);
AllotBackBill allotBackBill = allotBillSaveVo.toBackDo();
allotBackBill.setBackStatus(1);
allotBackBill.setSendUseraId(userId);
AllotBackBill allotBackBill1 = allotBackBillService.addEntity(allotBackBill);
//发起任务
TaskBto taskBto = new TaskBto(StatusEnum.BACK_DRAFT.id, "退回业务", null, ".", allotBackBill1.getId(), 22, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto1 = taskService.start(taskBto);
//改变装备状态为待退回
if (allotBillSaveVo.getAllotCheckDetail()!=null){
Map<Integer,DeviceLibrary> map = deviceLibraryService.getAllDeviceMap();
StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()).forEach(integer -> {
if (map.get(integer)!=null){
DeviceLibrary deviceLibrary = map.get(integer);
deviceLibrary.setLifeStatus(22);
deviceLibraryService.update(deviceLibrary);
}
});
}
// if (allotBillSaveVo.getAllotCheckDetail()!=null){
// Map<Integer,DeviceLibrary> map = deviceLibraryService.getAllDeviceMap();
// StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()).forEach(integer -> {
// if (map.get(integer)!=null){
// DeviceLibrary deviceLibrary = map.get(integer);
// deviceLibrary.setLifeStatus(22);
// deviceLibraryService.update(deviceLibrary);
// }
// });
// }
Integer id = taskBto1.getId();
myWebSocket.sendMessage1();
return ResponseEntity.ok("保存成功"+id);
......@@ -421,17 +423,17 @@ public class BackController {
TaskBto taskBto1 = taskService.addInvolveUser(taskBto,userUtils.getCurrentUserId());
taskService.moveToArchive(taskBto1);
//更改装备状态为在库
AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto1.getBillId());
if (allotBackBill.getBackCheckDetail()!=null){
Map<Integer,DeviceLibrary> map = deviceLibraryService.getAllDeviceMap();
StringSplitUtil.split(allotBackBill.getBackCheckDetail()).forEach(integer -> {
if (map.get(integer)!=null){
DeviceLibrary deviceLibrary = map.get(integer);
deviceLibrary.setLifeStatus(2);
deviceLibraryService.update(deviceLibrary);
}
});
}
// AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto1.getBillId());
// if (allotBackBill.getBackCheckDetail()!=null){
// Map<Integer,DeviceLibrary> map = deviceLibraryService.getAllDeviceMap();
// StringSplitUtil.split(allotBackBill.getBackCheckDetail()).forEach(integer -> {
// if (map.get(integer)!=null){
// DeviceLibrary deviceLibrary = map.get(integer);
// deviceLibrary.setLifeStatus(2);
// deviceLibraryService.update(deviceLibrary);
// }
// });
// }
myWebSocket.sendMessage1();
return ResponseEntity.ok("删除成功");
}
......@@ -455,6 +457,10 @@ public class BackController {
TaskBto taskBto = taskService.get(taskId);
if (status==1){
taskService.moveToSpecial(taskBto,StatusEnum.BACK_WAIT_SIGN);
AllotBackBill allotBill = allotBackBillService.getOne(taskBto.getBillId());
allotBill.setSendUserbId(userUtils.getCurrentUserId());
allotBill.setAgent(userUtils.getCurrentUserName());
allotBackBillService.update(allotBill);
}
else {
taskService.moveToSpecial(taskBto,StatusEnum.BACK_DRAFT,taskBto.getCreateUserId());
......
......@@ -404,7 +404,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
public void isInStock(List<Integer> ids) {
ids.forEach(integer -> {
DeviceLibrary deviceLibrary = getOne(integer);
if (deviceLibrary.getLifeStatus()!=2){
if (deviceLibrary.getLifeStatus()!=2&&deviceLibrary.getLifeStatus()!=14){
throw new ApiException(ResponseEntity.status(303).body("序列号"+deviceLibrary.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
......@@ -434,7 +434,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
public void isInStockOrWaitRetired(List<Integer> ids) {
ids.forEach(integer -> {
DeviceLibrary deviceLibrary = getOne(integer);
if (deviceLibrary.getLifeStatus()!=2 && deviceLibrary.getLifeStatus()!=15&& deviceLibrary.getLifeStatus()!=DeviceLifeStatus.SEND_BACK.id){
if (deviceLibrary.getLifeStatus()!=2 && deviceLibrary.getLifeStatus()!=15&&deviceLibrary.getLifeStatus()!=14&& !deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.SEND_BACK.id)){
throw new ApiException(ResponseEntity.status(303).body("序列号"+deviceLibrary.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
......@@ -449,7 +449,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
public void isInStockOrRepairing(List<Integer> ids) {
ids.forEach(integer -> {
DeviceLibrary deviceLibrary = getOne(integer);
if (deviceLibrary.getLifeStatus()!=2&&deviceLibrary.getLifeStatus()!=4){
if (deviceLibrary.getLifeStatus()!=2&&deviceLibrary.getLifeStatus()!=4&&deviceLibrary.getLifeStatus()!=14){
throw new ApiException(ResponseEntity.status(303).body("序列号"+deviceLibrary.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
......
......@@ -431,7 +431,7 @@ public class StorageBillController {
//保存入库单
Integer userId = userUtils.getCurrentUserId();
List<Integer> userIds = new ArrayList<>();
userIds.add(0);
userIds.add(userId);
StorageBill storageBill1 = storageBillSaveVo.toDo();
storageBill1.setStorageStatus(0);
StorageBill storageBill = storageBillService.addEntity(storageBill1);
......
......@@ -32,6 +32,11 @@ public class UserUtils {
return authentication.getCurrentUserInfo().getUsername();
}
public String getCurrentName() {
SecurityUser authentication = AuthenticationUtils.getAuthentication();
return authentication.getCurrentUserInfo().getName();
}
public String getCurrentUserUnitName() {
SecurityUser authentication = AuthenticationUtils.getAuthentication();
Integer unitId = authentication.getCurrentUserInfo().getUnitsId();
......
......@@ -6,7 +6,6 @@ import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.allot.repository.AllotBillDao;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.repository.DeviceDestroyBillDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
......@@ -124,6 +123,8 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
public DeviceUseReport createReport(DeviceUseReportCreateVo deviceUseReportCreateVo) {
DeviceUseReport deviceUseReportEntity = new DeviceUseReport();
deviceUseReportEntity.setUnit(userUtils.getCurrentUserUnitName());
deviceUseReportEntity.setStartTime(deviceUseReportCreateVo.getStartTime());
deviceUseReportEntity.setEndTime(deviceUseReportCreateVo.getEndTime());
StringBuffer stringBuffer = new StringBuffer();
//按照开始时间和结束时间设置标题
Date date = deviceUseReportCreateVo.getStartTime();
......
......@@ -81,4 +81,10 @@ public class DeviceUseReport {
@ApiModelProperty(value = "区块链记录id")
private String recordId;
@ApiModelProperty(value = "报告开始时间")
private Date startTime;
@ApiModelProperty(value = "报告结束时间")
private Date endTime;
}
......@@ -44,4 +44,10 @@ public class DeviceUseReportDetailVo {
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "报告开始时间")
private Date startTime;
@ApiModelProperty(value = "报告结束时间")
private Date endTime;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论