提交 fa4c735b authored 作者: zhoushaopan's avatar zhoushaopan

修改了销毁时间的bug,以及经办人显示不出来

上级 205ebcb8
......@@ -655,6 +655,8 @@ public class AllotBillController {
});
allotBill.setReceiveFiles(FilesUtil.stringFileToList(fileUploadVo.getReceiveFileList()));
}
//测试
allotBill.setReceiveUserbId(fileUploadVo.getReceiveUserbId());
allotBillService.update(allotBill);
//添加装备日志
List<Integer> deviceIds = StringSplitUtil.split(allotBill.getAllotCheckDetail());
......
......@@ -31,7 +31,9 @@ public class BatchAllotController {
@Transactional(rollbackFor = Exception.class)
public ResponseEntity createBatchAllot(@PathVariable("type") int type, @PathVariable("userId") int userId ,@RequestBody List<AllotBillSaveVo> allotBillSaveVoList){
if (type==1){
allotBillSaveVoList.forEach(allotBillSaveVo -> allotBillController.addAllotBill(allotBillSaveVo));
allotBillSaveVoList.forEach(allotBillSaveVo ->
allotBillController.addAllotBill(allotBillSaveVo)
);
}
else {
List<Integer> taskIds = new ArrayList<>();
......
......@@ -119,8 +119,10 @@ public class DeviceApplyController {
@PostMapping("/addDeviceApplyBill")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity addDeviceApplyBill(@RequestBody @Validated DeviceApplySaveVo deviceApplySaveVo) {
//装备申请
if (deviceApplySaveVo.getApplyType()!=1) {
for (ApplyBillDetailVo applyBillDetailVo : GetTreeUtils.splitTree2(deviceApplySaveVo.getStorageBillDetailVoList(),ApplyBillDetailVo::getChilds)) {
//判断该装备是否存在装备库
ResponseEntity responseEntity = packingController.seqsExist(applyBillDetailVo.getPackingId(), applyBillDetailVo.getStorageCount(), applyBillDetailVo.getSeqInterval());
if (!"ok".equals(responseEntity.getBody())) {
return responseEntity;
......@@ -147,6 +149,7 @@ public class DeviceApplyController {
title = "装备申请";
}
if (userUtils.getCurrentUnitLevel()==1){
//如果是省 等待中办 设置状态为3
deviceApplyBillEntity.setApplyStatus(3);
deviceApplyBillService.update(deviceApplyBillEntity);
List<Integer> userIds = new ArrayList<>();
......@@ -161,6 +164,7 @@ public class DeviceApplyController {
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
userIds.add(deviceApplySaveVo.getReplyUseraId());
//DEVICE_APPLY_CONFIRM 装备申请待批复
taskBto = new TaskBto(StatusEnum.DEVICE_APPLY_CONFIRM.id, title, null, ".", deviceApplyBillEntity.getId(), 9, userPublicService.findUnitIdByName(deviceApplySaveVo.getReplyUnit()), 1, null, userIds);
}
//不指定批复人
......@@ -201,7 +205,7 @@ public class DeviceApplyController {
}
@ApiOperation(value = "装备申请批复", notes = "可以通过这个接口批复")
@PostMapping("/replay")
@PostMapping("/replay")//不用了
@Transactional(rollbackFor = Exception.class)
public ResponseEntity addDeviceApplyBillReplay(@RequestBody @Validated DeviceApplyConfirmVo deviceApplyConfirmVo) {
TaskBto taskBto = taskService.get(deviceApplyConfirmVo.getTaskId());
......@@ -253,9 +257,10 @@ public class DeviceApplyController {
}
@ApiOperation(value = "装备申请后发起配发", notes = "可以通过这个接口装备申请后发起配发")
@PostMapping("/allot")
@PostMapping("/allot")//不用了
@Transactional(rollbackFor = Exception.class)
public ResponseEntity allot(@RequestBody @Validated DeviceApplyAllotSaveVo deviceApplyAllotSaveVo) {
//判断装备状态是否在库或待退役(若不是抛出303异常)
deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(deviceApplyAllotSaveVo.getAllotCheckDetail()));
//获取配发的业务
TaskBto taskBto = taskService.get(deviceApplyAllotSaveVo.getTaskId());
......@@ -266,7 +271,7 @@ public class DeviceApplyController {
taskService.addInvolveUser(taskBto,userId);
//获取申请账单
DeviceApplyBill deviceApplyBillEntity = deviceApplyBillService.getOne(applyTask.getBillId());
//添加配发单
//添加配发单 配发单中的配发类型 就是申请单中的申请类型吗
AllotBill allotBillEntity = new AllotBill();
BeanUtils.copyProperties(deviceApplyAllotSaveVo, allotBillEntity);
allotBillEntity.setTitle("申请后配发");
......@@ -279,11 +284,13 @@ public class DeviceApplyController {
allotBillEntity.setSendUnit(deviceApplyBillEntity.getReplyUnit());
allotBillEntity.setReceiveUnit(deviceApplyBillEntity.getApplyUnit());
allotBillEntity.setSendTime(new Date());
allotBillEntity.setAllotType(2);
allotBillEntity.setAllotStatus(2);
allotBillEntity.setAllotType(2);//?????
allotBillEntity.setAllotStatus(2); //配发中
//判断单据是否为空
if(deviceApplyAllotSaveVo.getScriptSaveVos()!=null) {
allotBillEntity.setScriptJson(JacksonUtil.toJSon(deviceApplyAllotSaveVo.getScriptSaveVos()));
}
//判断接收人发送人是否为空号
if (deviceApplyAllotSaveVo.getSendUserbId()!=null) {
allotBillEntity.setAgent(userPublicService.getOne(deviceApplyAllotSaveVo.getSendUserbId()).getName());
}
......@@ -298,13 +305,14 @@ public class DeviceApplyController {
//生成电子签章id
// Long signId = snowflake.creatNextId();
Long signId2 = snowflake.creatNextId();
//左签单
if (deviceApplyAllotSaveVo.getLeftSignatureId()!=null) {
allotBill.setLeftSignatureId(deviceApplyAllotSaveVo.getLeftSignatureId());
}
allotBill.setRightSignatureId(signId2.toString());
AllotBill allotBill1 = allotBillService.update(allotBill);
taskBto.setBillId(allotBill.getId());
//配发业务移动到下一阶段
//配发业务移动到下一阶段 配发中
TaskBto taskBto1 = taskService.moveToSpecial(taskBto,StatusEnum.ALLOTING);
taskBto1.setOwnUnit(userPublicService.findUnitIdByName(allotBill.getReceiveUnit()));
Task saveEntity = taskService.update(taskBto1);
......@@ -325,14 +333,14 @@ public class DeviceApplyController {
ids.add(id);
//改变装备状态
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(id);
deviceLibraryEntity.setLifeStatus(3);
deviceLibraryEntity.setManageStatus(0);
deviceLibraryEntity.setLifeStatus(3);//配发状态
deviceLibraryEntity.setManageStatus(0);//不在属于单位
DeviceLogDto deviceLogDto = new DeviceLogDto(id, "对" + allotBillEntity.getReceiveUnit() + "发起配发", fileVoList);
deviceLogService.addLog(deviceLogDto);
}
}
}
//添加出库白名单
//添加出库白名单 0 是入 1是出
inputOutputDeviceService.addWhiteDevices(ids, userUtils.getCurrentUnitId(), 1);
//发送阅知信息
List<Integer> userIds = userPublicService.findOtherUser(userId);
......@@ -484,7 +492,7 @@ public class DeviceApplyController {
}
@ApiOperation(value = "确认接收申请装备", notes = "确认接收申请装备")
@PostMapping("/confirm/{id}")
@PostMapping("/confirm/{id}")//不用了
@Transactional(rollbackFor = Exception.class)
public ResponseEntity confirm(@PathVariable("id") int taskId) {
TaskBto taskBto = taskService.get(taskId);
......
......@@ -6,6 +6,7 @@ import com.tykj.dev.config.service.SystemConfigService;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.config.vo.ConfigUpdateVo;
import com.tykj.dev.config.vo.ConfigVo;
import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......
......@@ -107,11 +107,13 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
DeviceDestroyBill deviceDestroyBill;
List<String> seqNumbers= scriptListToStringList(deviceDestroyBillVo);
//判断装备序列号中是否有不等于指定的leftStatus的装备
deviceLibraryService.judgeSeqNumbersInNotEqualLifeStatus(seqNumbers,DeviceLifeStatus.TO_BE_DESTROYED.id);
if (deviceDestroyBillVo.getTaskId()==null){
deviceDestroyBill=deviceDestroyBillVo.toDeviceDestroyBill();
deviceDestroyBillService.saveDeviceDestroyBill(deviceDestroyBill);
deviceDestroyBill.setNum("NO:第" + LocalDateTime.now().getYear() + "XF" + deviceDestroyBill.getId());
//等待上传销毁单据
TaskBto taskBto= awaitUploadDestructionTask(securityUser.getCurrentUserInfo().getUnitsId(),deviceDestroyBill.getId(),securityUser.getCurrentUserInfo().getUserId());
deviceDestroyBill.setDestroyStatus(taskBto.getBillStatus());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"销毁任务等待补充手续",gainThisUser(securityUser.getCurrentUserInfo().getUserId(),securityUser.getCurrentUserInfo().getUnitsId())));
......@@ -162,7 +164,9 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
}
deviceDestroyBill.setDestructionFiles(FilesUtil.stringFileToList(deviceDestroyBillVo.getDestructionFileList()));
taskBto= taskService.moveToEnd(taskBto);
deviceDestroyBill.setDestroyTime(new Date());
//修改的
deviceDestroyBill.setDestroyTime(deviceDestroyBillVo.getDestroyTime());
// deviceDestroyBill.setDestroyTime(new Date());
deviceDestroyBill.setDestroyStatus(taskBto.getBillStatus());
deviceDestroyBillService.saveDeviceDestroyBill(deviceDestroyBill);
deviceLibraryDao.upDateSeqNumbersLeftStatus(DeviceLifeStatus.DESTROYED.id,seqNumbers);
......
......@@ -180,6 +180,7 @@ public class PackingController {
// TaskBto taskBto = new TaskBto(StatusEnum.END.id, "列装业务", null, ".", packingLibrary1.getId(), 1, userUtils.getCurrentUnitId(), 0, null, Collections.singletonList(userUtils.getCurrentUserId()));
// TaskBto saveEntity = taskService.start(taskBto);
if (packingLibrary1.getIsRoot()==1){
//不是配件
packingLibrary.setIsPart(0);
String message = "添加列装型号"+addPack.getModel()+"下的装备:"+addPack.getName();
// //添加业务日志
......@@ -197,6 +198,7 @@ public class PackingController {
packingLogService.add(packingLog);
}
else {
//是配件
packingLibrary.setIsPart(1);
String message = "添加列装型号"+addPack.getModel()+"下的装备附件:"+addPack.getName();
// //添加业务日志
......@@ -277,7 +279,7 @@ public class PackingController {
return ResponseEntity.ok(packingLibraryService.setAllotNum(packingLibraryEntities));
}
@ApiOperation(value = "根据型号查询所有装备附件")
@ApiOperation(value = "批量配发获取序列号")
@PostMapping("/getAllotSeqs/{num}")
public ResponseEntity getAllotSeqs(@RequestBody List<Integer> ids,@PathVariable("num") int num){
List<String> strings = new ArrayList<>();
......
......@@ -115,6 +115,10 @@ public class StorageBillSaveVo {
@ApiModelProperty(value = "存在申请任务的序列号")
private List<String> hasTaskSeqs = new ArrayList<>();
public StorageBill toDo() {
//modelMap复制
ModelMapper mapper = BeanHelper.getUserMapper();
......
......@@ -20,6 +20,7 @@ import com.tykj.dev.misc.utils.StringSplitUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.OrderComparator;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论