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

更新日志

上级 51035bb2
...@@ -49,13 +49,15 @@ public class DeviceLogDto { ...@@ -49,13 +49,15 @@ public class DeviceLogDto {
deviceLog.setRemark(this.remark); deviceLog.setRemark(this.remark);
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("Ǵ"); stringBuffer.append("Ǵ");
for (FileVo f:this.fileVoList) { if (this.fileVoList!=null&&this.fileVoList.size()>0) {
stringBuffer.append(f.getFileName()); for (FileVo f : this.fileVoList) {
stringBuffer.append("Ǒ"); stringBuffer.append(f.getFileName());
stringBuffer.append(f.getFileUrl()); stringBuffer.append("Ǒ");
stringBuffer.append("Ǒ"); stringBuffer.append(f.getFileUrl());
stringBuffer.append(f.getTitle()); stringBuffer.append("Ǒ");
stringBuffer.append("Ǵ"); stringBuffer.append(f.getTitle());
stringBuffer.append("Ǵ");
}
} }
deviceLog.setFileDetail(stringBuffer.toString()); deviceLog.setFileDetail(stringBuffer.toString());
return deviceLog; return deviceLog;
......
...@@ -6,8 +6,10 @@ import com.tykj.dev.device.packing.subject.domin.PackingLibrary; ...@@ -6,8 +6,10 @@ import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.packing.subject.vo.PackingLibraryConfirmVo; import com.tykj.dev.device.packing.subject.vo.PackingLibraryConfirmVo;
import com.tykj.dev.device.packing.subject.vo.PackingLibrarySaveVo; import com.tykj.dev.device.packing.subject.vo.PackingLibrarySaveVo;
import com.tykj.dev.device.packing.subject.vo.PartSaveVo; import com.tykj.dev.device.packing.subject.vo.PartSaveVo;
import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService; 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.TaskBto;
import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import com.tykj.dev.device.task.subject.common.StatusEnum; import com.tykj.dev.device.task.subject.common.StatusEnum;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
...@@ -44,8 +46,8 @@ public class PackingController { ...@@ -44,8 +46,8 @@ public class PackingController {
@Autowired @Autowired
UserPublicService userPublicService; UserPublicService userPublicService;
// @Autowired @Autowired
// DeviceLogService deviceLogService; TaskLogService taskLogService;
@ApiOperation(value = "新增列装",notes = "可以通过这个接口发起列装") @ApiOperation(value = "新增列装",notes = "可以通过这个接口发起列装")
@PostMapping("/addPackingLibrary") @PostMapping("/addPackingLibrary")
...@@ -68,12 +70,8 @@ public class PackingController { ...@@ -68,12 +70,8 @@ public class PackingController {
userIds.add(packingLibrarySaveVo.getUserbId()); userIds.add(packingLibrarySaveVo.getUserbId());
TaskBto taskBto = new TaskBto(StatusEnum.PACKING_CONFIRM.id,"列装业务",null,".",packingLibraryEntity.getId(),1,userUtils.getCurrentUnitId(),1,null,userIds); TaskBto taskBto = new TaskBto(StatusEnum.PACKING_CONFIRM.id,"列装业务",null,".",packingLibraryEntity.getId(),1,userUtils.getCurrentUnitId(),1,null,userIds);
Task saveEntity = taskService.start(taskBto); Task saveEntity = taskService.start(taskBto);
// LogVo bussinessLogVo = new LogVo(); TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起列装",null);
// bussinessLogVo.setDeviceId(0); taskLogService.addLog(taskLogBto);
// bussinessLogVo.setFileDetail("Ǵ");
// bussinessLogVo.setRemark("发起列装");
// bussinessLogVo.setTaskId(saveEntity.getId());
// deviceLogService.addLog(bussinessLogVo);
return ResultUtil.success(packingLibraryEntity); return ResultUtil.success(packingLibraryEntity);
} }
...@@ -90,12 +88,8 @@ public class PackingController { ...@@ -90,12 +88,8 @@ public class PackingController {
} }
packingLibraryService.selectAllPart(taskBto.getBillId()); packingLibraryService.selectAllPart(taskBto.getBillId());
packingLibraryService.update(packingLibraryEntity); packingLibraryService.update(packingLibraryEntity);
// LogVo bussinessLogVo = new LogVo(); TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"列装审核成功",null);
// bussinessLogVo.setDeviceId(0); taskLogService.addLog(taskLogBto);
// bussinessLogVo.setFileDetail("Ǵ");
// bussinessLogVo.setRemark("列装审核成功");
// bussinessLogVo.setTaskId(taskEntity.getId());
// deviceLogService.addLog(bussinessLogVo);
return ResultUtil.success("审核通过列装成功"); return ResultUtil.success("审核通过列装成功");
} }
if (packingLibraryConfirmVo.getStatus()==1){ if (packingLibraryConfirmVo.getStatus()==1){
...@@ -107,12 +101,8 @@ public class PackingController { ...@@ -107,12 +101,8 @@ public class PackingController {
} }
packingLibraryService.update(packingLibraryEntity); packingLibraryService.update(packingLibraryEntity);
taskService.update(taskBto); taskService.update(taskBto);
// LogVo bussinessLogVo = new LogVo(); TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"列装审核失败",null);
// bussinessLogVo.setDeviceId(0); taskLogService.addLog(taskLogBto);
// bussinessLogVo.setFileDetail("Ǵ");
// bussinessLogVo.setRemark("列装审核失败");
// bussinessLogVo.setTaskId(taskEntity.getId());
// deviceLogService.addLog(bussinessLogVo);
return ResultUtil.success("列装审核失败"); return ResultUtil.success("列装审核失败");
} }
else { else {
......
...@@ -2,6 +2,8 @@ package com.tykj.dev.device.storage.controller; ...@@ -2,6 +2,8 @@ package com.tykj.dev.device.storage.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.service.DeviceLibraryService; 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.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySaveVo; import com.tykj.dev.device.library.subject.vo.DeviceLibrarySaveVo;
import com.tykj.dev.device.packing.service.PackingLibraryService; import com.tykj.dev.device.packing.service.PackingLibraryService;
...@@ -11,10 +13,13 @@ import com.tykj.dev.device.storage.subject.domin.StorageBill; ...@@ -11,10 +13,13 @@ import com.tykj.dev.device.storage.subject.domin.StorageBill;
import com.tykj.dev.device.storage.subject.vo.StorageBillConfirmVo; import com.tykj.dev.device.storage.subject.vo.StorageBillConfirmVo;
import com.tykj.dev.device.storage.subject.vo.StorageBillDetailVo; import com.tykj.dev.device.storage.subject.vo.StorageBillDetailVo;
import com.tykj.dev.device.storage.subject.vo.StorageBillSaveVo; import com.tykj.dev.device.storage.subject.vo.StorageBillSaveVo;
import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService; 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.TaskBto;
import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import com.tykj.dev.device.task.subject.common.StatusEnum; import com.tykj.dev.device.task.subject.common.StatusEnum;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.vo.FileVo;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -55,8 +60,11 @@ public class StorageBillController { ...@@ -55,8 +60,11 @@ public class StorageBillController {
@Autowired @Autowired
private PackingLibraryService packingLibraryService; private PackingLibraryService packingLibraryService;
// @Autowired @Autowired
// private DeviceLogService deviceLogService; private DeviceLogService deviceLogService;
@Autowired
private TaskLogService taskLogService;
@ApiOperation(value = "选择入库型号数量",notes = "可以通过这个接口选择入库型号数量") @ApiOperation(value = "选择入库型号数量",notes = "可以通过这个接口选择入库型号数量")
@PostMapping(value = "/addStorageDetail") @PostMapping(value = "/addStorageDetail")
...@@ -112,6 +120,12 @@ public class StorageBillController { ...@@ -112,6 +120,12 @@ public class StorageBillController {
userIds.add(storageBillSaveVo.getReceiveUserBId()); userIds.add(storageBillSaveVo.getReceiveUserBId());
TaskBto taskBto = new TaskBto(StatusEnum.STORAGE_CONFIRM.id,"入库业务",null,".",storageBillEntity.getId(),2,userUtils.getCurrentUnitId(),1,null,userIds); TaskBto taskBto = new TaskBto(StatusEnum.STORAGE_CONFIRM.id,"入库业务",null,".",storageBillEntity.getId(),2,userUtils.getCurrentUnitId(),1,null,userIds);
Task taskEntity1 = taskService.start(taskBto); Task taskEntity1 = taskService.start(taskBto);
//存业务日志
List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("配发单",storageBillEntity.getFileName(),storageBillEntity.getFileUrl()));
fileVoList.add(new FileVo("入库确认单",storageBillEntity.getReceiveFileName(),storageBillEntity.getReceiveFileUrl()));
TaskLogBto taskLogBto = new TaskLogBto(taskEntity1.getId(),"发起入库",fileVoList);
taskLogService.addLog(taskLogBto);
//3.存装备 //3.存装备
Integer parentId = null; Integer parentId = null;
for (DeviceLibrarySaveVo d:storageBillSaveVo.getDeviceLibrarySaveVoList()) { for (DeviceLibrarySaveVo d:storageBillSaveVo.getDeviceLibrarySaveVoList()) {
...@@ -134,12 +148,9 @@ public class StorageBillController { ...@@ -134,12 +148,9 @@ public class StorageBillController {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity); saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
} }
stringBuffer.append(saveEntity.getId()); stringBuffer.append(saveEntity.getId());
// LogVo bussinessLogVo = new LogVo(); //存装备日志
// bussinessLogVo.setDeviceId(saveEntity.getId()); DeviceLogDto deviceLogDto = new DeviceLogDto(saveEntity.getId(),"发起入库",fileVoList);
// bussinessLogVo.setFileDetail("Ǵ"+storageBillEntity.getFileName()+"Ǒ"+storageBillEntity.getFileUrl()+"Ǒ"+"配发单"+"Ǵ"+storageBillEntity.getReceiveFileName()+"Ǒ"+storageBillEntity.getReceiveFileUrl()+"Ǒ"+"入库确认单"+"Ǵ"); deviceLogService.addLog(deviceLogDto);
// bussinessLogVo.setRemark("发起入库");
// bussinessLogVo.setTaskId(taskEntity1.getId());
// deviceLogService.addLog(bussinessLogVo);
stringBuffer.append("x"); stringBuffer.append("x");
} }
//4.更新入库单入库详情 //4.更新入库单入库详情
...@@ -154,36 +165,32 @@ public class StorageBillController { ...@@ -154,36 +165,32 @@ public class StorageBillController {
//1.审核成功,入库任务结束,发起新的确认任务,改变装备状态 //1.审核成功,入库任务结束,发起新的确认任务,改变装备状态
if(storageBillConfirmVo.getStatus()==0){ if(storageBillConfirmVo.getStatus()==0){
taskService.update(taskService.moveToEnd(taskBto)); taskService.update(taskService.moveToEnd(taskBto));
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"入库审核成功",null);
taskLogService.addLog(taskLogBto);
StorageBill storageBillEntity = storageBillService.getOne(taskBto.getBillId()); StorageBill storageBillEntity = storageBillService.getOne(taskBto.getBillId());
storageBillEntity.setStorageStatus(2); storageBillEntity.setStorageStatus(2);
storageBillService.update(storageBillEntity); storageBillService.update(storageBillEntity);
List<DeviceLibrary> libraryEntities = deviceLibraryService.getListByBillId(taskBto.getBillId()); List<DeviceLibrary> libraryEntities = deviceLibraryService.getListByBillId(taskBto.getBillId());
for (DeviceLibrary d:libraryEntities) { for (DeviceLibrary d:libraryEntities) {
d.setLifeStatus(2); d.setLifeStatus(2);
// LogVo bussinessLogVo = new LogVo(); DeviceLogDto deviceLogDto = new DeviceLogDto(d.getId(),"入库审核成功",null);
// bussinessLogVo.setDeviceId(d.getId()); deviceLogService.addLog(deviceLogDto);
// bussinessLogVo.setFileDetail("Ǵ");
// bussinessLogVo.setRemark("入库审核成功");
// bussinessLogVo.setTaskId(taskEntity.getId());
// deviceLogService.addLog(bussinessLogVo);
} }
return ResultUtil.success("审核通过列装成功"); return ResultUtil.success("审核通过列装成功");
} }
//3.审核失败 //3.审核失败
if (storageBillConfirmVo.getStatus()==1){ if (storageBillConfirmVo.getStatus()==1){
taskService.update(taskService.moveToArchive(taskBto)); taskService.update(taskService.moveToArchive(taskBto));
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"入库审核失败",null);
taskLogService.addLog(taskLogBto);
StorageBill storageBillEntity = storageBillService.getOne(taskBto.getBillId()); StorageBill storageBillEntity = storageBillService.getOne(taskBto.getBillId());
storageBillEntity.setStorageStatus(1); storageBillEntity.setStorageStatus(1);
storageBillService.update(storageBillEntity); storageBillService.update(storageBillEntity);
List<DeviceLibrary> libraryEntities = deviceLibraryService.getListByBillId(taskBto.getBillId()); List<DeviceLibrary> libraryEntities = deviceLibraryService.getListByBillId(taskBto.getBillId());
for (DeviceLibrary d:libraryEntities) { for (DeviceLibrary d:libraryEntities) {
d.setLifeStatus(1); d.setLifeStatus(1);
// LogVo bussinessLogVo = new LogVo(); DeviceLogDto deviceLogDto = new DeviceLogDto(d.getId(),"入库审核失败",null);
// bussinessLogVo.setDeviceId(d.getId()); deviceLogService.addLog(deviceLogDto);
// bussinessLogVo.setFileDetail("Ǵ");
// bussinessLogVo.setRemark("入库审核失败");
// bussinessLogVo.setTaskId(taskBto.getId());
// deviceLogService.addLog(bussinessLogVo);
} }
return ResultUtil.success("入库审核失败"); return ResultUtil.success("入库审核失败");
} }
......
...@@ -45,13 +45,15 @@ public class TaskLogBto { ...@@ -45,13 +45,15 @@ public class TaskLogBto {
taskLog.setRemark(this.remark); taskLog.setRemark(this.remark);
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("Ǵ"); stringBuffer.append("Ǵ");
for (FileVo f:this.fileVoList) { if (this.fileVoList!=null&&this.fileVoList.size()>0) {
stringBuffer.append(f.getFileName()); for (FileVo f : this.fileVoList) {
stringBuffer.append("Ǒ"); stringBuffer.append(f.getFileName());
stringBuffer.append(f.getFileUrl()); stringBuffer.append("Ǒ");
stringBuffer.append("Ǒ"); stringBuffer.append(f.getFileUrl());
stringBuffer.append(f.getTitle()); stringBuffer.append("Ǒ");
stringBuffer.append("Ǵ"); stringBuffer.append(f.getTitle());
stringBuffer.append("Ǵ");
}
} }
taskLog.setFileDetail(stringBuffer.toString()); taskLog.setFileDetail(stringBuffer.toString());
return taskLog; return taskLog;
......
...@@ -29,20 +29,25 @@ public enum StatusEnum { ...@@ -29,20 +29,25 @@ public enum StatusEnum {
*/ */
STORAGE_CONFIRM(200,"入库待审核"), STORAGE_CONFIRM(200,"入库待审核"),
/**
* 待配发
*/
WAIT_ALLOT(300,"待配发"),
/** /**
* 配发出库待审核 * 配发出库待审核
*/ */
ALLOT_SEND_CONFIRM(300,"配发出库待审核"), ALLOT_SEND_CONFIRM(301,"配发出库待审核"),
/** /**
* 配发中 * 配发中
*/ */
ALLOTING(301,"配发中"), ALLOTING(302,"配发中"),
/** /**
* 配发入库待审核 * 配发入库待审核
*/ */
ALLOT_RECEIVE_CONFIRM(302,"配发入库待审核"), ALLOT_RECEIVE_CONFIRM(303,"配发入库待审核"),
/** /**
* 待自查 * 待自查
......
...@@ -2,12 +2,16 @@ package com.tykj.dev.device.task.subject.vo; ...@@ -2,12 +2,16 @@ package com.tykj.dev.device.task.subject.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
@Data @Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("附件信息返回类") @ApiModel("附件信息返回类")
public class FileVo { public class FileVo {
......
package com.tykj.dev.device.user.base.beabs;
import com.tykj.dev.device.user.util.UserUtils;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
import java.util.Optional;
/**
* @author dengdiyi
*/
@Configuration
public class UserIDAuditorBean implements AuditorAware<Integer> {
/*
*实现jpa自动插入当前用户id
*/
@Override
public Optional<Integer> getCurrentAuditor() {
//获取当前用户Id并返回
UserUtils userUtils = com.tykj.dev.misc.utils.SpringUtils.getBean("userUtils");
Integer userId = null;
if (userUtils != null) {
userId = userUtils.getCurrentUserId();
}
if (userId != null){
return Optional.of(userId);
}
else {
return Optional.empty();
}
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论