提交 92d7f9ea authored 作者: 黄夏豪's avatar 黄夏豪

项目重构代码补充

上级 cc48e970
......@@ -15,6 +15,10 @@
<groupId>com.tykj.dev</groupId>
<artifactId>device-library</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-library</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author zjm
* @version 1.0.0
* @ClassName userApp.java
* @Description TODO
* @createTime 2020年09月01日 14:32:00
*/
@SpringBootApplication
public class DestroyApp {
public static void main(String[] args) {
SpringApplication.run(DestroyApp.class, args);
}
}
......@@ -88,7 +88,7 @@ public class DeviceDestroyController {
@Transactional(rollbackOn = Exception.class)
public ResponseEntity<String> selectRepairBill(@Validated @RequestBody DeviceDestroyFormVo formVo) {
//生成销毁账单
User currentUserInfo = Objects.requireNonNull(AuthenticationUtils.getAuthentication()).getCurrentUserInfo();
User currentUserInfo = AuthenticationUtils.getAuthentication().getCurrentUserInfo();
DeviceDestroyBill destroyBill = DeviceDestroyBill.formVoToBill(formVo,currentUserInfo);
//保存销毁账单
DeviceDestroyBill deviceDestroyBillEntitySaved = deviceDestroyBillService.addEntity(destroyBill);
......@@ -118,6 +118,7 @@ public class DeviceDestroyController {
deviceLibrarySelectVo.setLifeStatus(Arrays.asList(2, 5, 12));
List<DeviceLibrary> list = deviceLibraryService.getList(deviceLibrarySelectVo);
// myWebSocket.sendMessage1();
return ResultUtil.success(list);
}
......
......@@ -14,6 +14,7 @@ import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
......
......@@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull;
/**
* @author HuangXiahao
* @version V1.0
* @class DeviceDestoryReadComfirm
* @class DeviceDestroyReadComfirm
* @packageName com.tykj.dev.device.destory.subject.entity.vo
**/
@ApiModel("销毁状态阅读确认")
......
......@@ -104,16 +104,12 @@ public class DeviceRetiredController {
User currentUserInfo = Objects.requireNonNull(AuthenticationUtils.getAuthentication()).getCurrentUserInfo();
DeviceRetiredBill retiredBill = DeviceRetiredBill.formVoToBill(formVo,currentUserInfo);
retiredBill= deviceRetiredBillService.addEntity(retiredBill);
//生成日志所需的文件列表
ArrayList<FileVo> billList = ListUtil.createList(
new FileVo("标签替换单据", null, null)
);
//生成Task
TaskBto task = initTaskBto(retiredBill);
taskService.start(task);
//生成任务日志
taskLogService.addLog(new TaskLogBto(task.getId(),"发起退装",billList));
taskLogService.addLog(new TaskLogBto(task.getId(),"退装待审核",billList));
taskLogService.addLog(new TaskLogBto(task.getId(),"发起退装",null));
taskLogService.addLog(new TaskLogBto(task.getId(),"退装待审核",null));
// myWebSocket.sendMessage1();
return ResultUtil.success("退装申请成功");
}
......@@ -147,7 +143,6 @@ public class DeviceRetiredController {
if (deviceRetiredConfirmVo.getResult()==0){
//更改账单状态
deviceRetiredBillEntity.setRetiredStatus(RetiredStatus.CONFIRM_FAILED.getStatus());
//todo 生成日志
}else {
//更改账单状态
deviceRetiredBillEntity.setRetiredStatus(RetiredStatus.CONFIRM_SUCCESS.getStatus());
......@@ -162,8 +157,10 @@ public class DeviceRetiredController {
//更改对应的装备为退装
changeDeviceToRetired(packingLibraryServiceOne.getId());
}
//todo 生成日志
}
//生成日志
taskLogService.addLog(new TaskLogBto(task.getId(),deviceRetiredConfirmVo.getResult()==0?"退装审核失败":"退装审核成功",null));
taskLogService.addLog(new TaskLogBto(task.getId(),"业务完结",null));
//将任务推进至完结
taskService.moveToEnd(task);
//更改对应任务的状态
......@@ -209,17 +206,17 @@ public class DeviceRetiredController {
list.forEach(d->{
d.setLifeStatus(8);
deviceLibraryService.addEntity(d);
deviceLogService.addLog(new DeviceLogDto(d.getId(),"装备退装",null));
//包括装备的配件也设置为退装
List<DeviceLibrary> deviceChildren = d.getChilds();
for (DeviceLibrary childDevice : deviceChildren) {
childDevice.setLifeStatus(8);
deviceLibraryService.addEntity(childDevice);
deviceLogService.addLog(new DeviceLogDto(childDevice.getId(),"装备退装",null));
}
});
}
private TaskBto initTaskBto(DeviceRetiredBill retiredBill){
//生成Task
TaskBto taskBto = new TaskBto(
......
......@@ -88,7 +88,7 @@
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-destory</artifactId>
<artifactId>device-destroy</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
......
......@@ -22,7 +22,7 @@
<module>dev-misc</module>
<module>dev-rfid</module>
<module>dev-union</module>
<module>device-storage</module>
<module>dev-device/device-storage</module>
</modules>
<properties>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论