提交 4d7b4d18 authored 作者: 黄夏豪's avatar 黄夏豪

项目重构代码补充

上级 92d7f9ea
package com.tykj.dev.device.destroy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......@@ -8,7 +10,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @Description TODO
* @createTime 2020年09月01日 14:32:00
*/
@SpringBootApplication
@SpringBootApplication(scanBasePackages={
"com.tykj.dev.*",
}
)
public class DestroyApp {
public static void main(String[] args) {
SpringApplication.run(DestroyApp.class, args);
......
package controller;
package com.tykj.dev.device.destroy.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.destroy.entity.vo.*;
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;
......@@ -20,19 +21,17 @@ import com.tykj.dev.device.user.util.AuthenticationUtils;
import com.tykj.dev.misc.utils.ListUtil;
import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.StringSplitUtil;
import entity.domain.DeviceDestroyBill;
import entity.enums.DestroyStatus;
import entity.vo.*;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.entity.enums.DestroyStatus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import service.DeviceDestroyBillService;
import com.tykj.dev.device.destroy.service.DeviceDestroyBillService;
import javax.transaction.Transactional;
import javax.validation.constraints.NotNull;
......@@ -43,7 +42,7 @@ import java.util.*;
* @author huangxiahao
*/
@RestController
@RequestMapping(value = "/destory")
@RequestMapping(value = "/destroy")
@AutoDocument
@Api(tags = "销毁业务模块", value = "销毁业务模块")
public class DeviceDestroyController {
......@@ -123,8 +122,8 @@ public class DeviceDestroyController {
}
@ApiOperation(value = "查询销毁单详情", notes = "可以通过这个接口查询销毁单")
@GetMapping(value = "/detail/{destroyId}")
public ResponseEntity<DeviceDestroyDetailResultVo> selectDestoryDetail(@Validated @NotNull @PathVariable("destroyId") Integer destroyId) {
@GetMapping(value = "/detail")
public ResponseEntity<DeviceDestroyDetailResultVo> selectDestroyDetail(@Validated @NotNull Integer destroyId) {
//装备文号
String docNumber;
DeviceDestroyDetailResultVo destroyDetailResultVo;
......@@ -204,7 +203,7 @@ public class DeviceDestroyController {
taskLogService.addLog(new TaskLogBto(task.getId(),deviceDestoryConfirmVo.getResult() == 0?"销毁成功":"销毁审核失败",billList));
taskLogService.addLog(new TaskLogBto(task.getId(),"业务完结",billList));
// myWebSocket.sendMessage1();
return selectDestoryDetail(deviceDestroyBill.getId());
return selectDestroyDetail(deviceDestroyBill.getId());
}
private void handleDeviceDetail(DeviceDestroyBill deviceDestroyBill,ArrayList<FileVo> billList,Integer flag) {
......
package entity.domain;
package com.tykj.dev.device.destroy.entity.domain;
import com.tykj.dev.device.user.subject.entity.User;
import entity.enums.DestroyStatus;
import entity.vo.DeviceDestroyFormVo;
import com.tykj.dev.device.destroy.entity.enums.DestroyStatus;
import com.tykj.dev.device.destroy.entity.vo.DeviceDestroyFormVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
......@@ -26,6 +28,8 @@ import java.util.List;
*/
@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update device_destroy_bill set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
......@@ -147,6 +151,7 @@ public class DeviceDestroyBill {
this.leader = leader;
this.undertaker = undertaker;
this.userA = userA;
this.destroyDeviceDetail = destroyDeviceDetail;
}
public static DeviceDestroyBill formVoToBill(DeviceDestroyFormVo formVo, User user){
......
package entity.domain;
package com.tykj.dev.device.destroy.entity.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
......@@ -20,6 +22,8 @@ import java.util.Date;
*/
@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update device_destory_detail set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
......
package entity.vo;
package com.tykj.dev.device.destroy.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package entity.vo;
package com.tykj.dev.device.destroy.entity.vo;
import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel;
......
package entity.vo;
package com.tykj.dev.device.destroy.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -16,10 +16,6 @@ import javax.validation.constraints.NotNull;
@ApiModel("销毁单确认")
public class DeviceDestroyConfirmVo {
@NotNull
@ApiModelProperty(value = "工作ID",example = "1")
private Integer jobId;
@NotNull
@ApiModelProperty(value = "任务ID",example = "1")
private Integer taskId;
......
package entity.vo;
package com.tykj.dev.device.destroy.entity.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import io.swagger.annotations.ApiModel;
......
package entity.vo;
package com.tykj.dev.device.destroy.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package entity.vo;
package com.tykj.dev.device.destroy.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package entity.vo;
package com.tykj.dev.device.destroy.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package repository;
package com.tykj.dev.device.destroy.repository;
import entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......
package service;
package com.tykj.dev.device.destroy.service;
import entity.domain.DeviceDestroyBill;
import entity.vo.DeviceDestroyBillSelectVo;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.entity.vo.DeviceDestroyBillSelectVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
......
package service.impl;
package com.tykj.dev.device.destroy.service.Impl;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
......@@ -8,8 +8,8 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.misc.utils.StringSplitUtil;
import com.tykj.dev.misc.utils.TimestampUtil;
import entity.domain.DeviceDestroyBill;
import entity.vo.DeviceDestroyBillSelectVo;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.entity.vo.DeviceDestroyBillSelectVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......@@ -17,8 +17,8 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import repository.DeviceDestroyBillDao;
import service.DeviceDestroyBillService;
import com.tykj.dev.device.destroy.repository.DeviceDestroyBillDao;
import com.tykj.dev.device.destroy.service.DeviceDestroyBillService;
import javax.persistence.Transient;
import java.lang.reflect.Field;
......
package com.tykj.dev.device.retired;
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(scanBasePackages={
"com.tykj.dev.*",
}
)
public class RetiredApp {
public static void main(String[] args) {
SpringApplication.run(RetiredApp.class, args);
}
}
package controller;
package com.tykj.dev.device.retired.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.service.DeviceLibraryService;
......@@ -9,30 +9,27 @@ import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.packing.service.PackingLibraryService;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.packing.subject.vo.PackingLibrarySelectVo;
import com.tykj.dev.device.retired.entity.vo.*;
import com.tykj.dev.device.task.service.TaskLogService;
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.TaskLogBto;
import com.tykj.dev.device.task.subject.common.BusinessEnum;
import com.tykj.dev.device.task.subject.common.StatusEnum;
import com.tykj.dev.device.task.subject.domin.TaskLog;
import com.tykj.dev.device.task.subject.vo.FileVo;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.util.AuthenticationUtils;
import com.tykj.dev.misc.utils.ListUtil;
import com.tykj.dev.misc.utils.ResultUtil;
import entity.domain.DeviceRetiredBill;
import entity.enums.RetiredStatus;
import entity.vo.*;
import com.tykj.dev.device.retired.entity.domain.DeviceRetiredBill;
import com.tykj.dev.device.retired.entity.enums.RetiredStatus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.support.TaskUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import service.DeviceRetiredBillService;
import com.tykj.dev.device.retired.service.DeviceRetiredBillService;
import javax.transaction.Transactional;
import java.sql.Timestamp;
......@@ -63,15 +60,11 @@ public class DeviceRetiredController {
private final TaskLogService taskLogService;
final
TaskUtils taskUtils;
public DeviceRetiredController(DeviceRetiredBillService deviceRetiredBillService, TaskService taskService, PackingLibraryService packingLibraryService, DeviceLibraryService deviceLibraryService, TaskUtils taskUtils, DeviceLogService deviceLogService, TaskLogService taskLogService) {
public DeviceRetiredController(DeviceRetiredBillService deviceRetiredBillService, TaskService taskService, PackingLibraryService packingLibraryService, DeviceLibraryService deviceLibraryService, DeviceLogService deviceLogService, TaskLogService taskLogService) {
this.deviceRetiredBillService = deviceRetiredBillService;
this.taskService = taskService;
this.packingLibraryService = packingLibraryService;
this.deviceLibraryService = deviceLibraryService;
this.taskUtils = taskUtils;
this.deviceLogService = deviceLogService;
this.taskLogService = taskLogService;
}
......@@ -105,8 +98,7 @@ public class DeviceRetiredController {
DeviceRetiredBill retiredBill = DeviceRetiredBill.formVoToBill(formVo,currentUserInfo);
retiredBill= deviceRetiredBillService.addEntity(retiredBill);
//生成Task
TaskBto task = initTaskBto(retiredBill);
taskService.start(task);
Task task = taskService.start(initTaskBto(retiredBill));
//生成任务日志
taskLogService.addLog(new TaskLogBto(task.getId(),"发起退装",null));
taskLogService.addLog(new TaskLogBto(task.getId(),"退装待审核",null));
......@@ -135,7 +127,7 @@ public class DeviceRetiredController {
@ApiOperation(value = "退装出库单审核",notes = "可以通过这个审核退装单")
@PutMapping(value = "/confirmation")
@Transactional
public ResponseEntity<DeviceRetiredDetailResultVo> confirmDestory( @RequestBody @Validated DeviceRetiredConfirmVo deviceRetiredConfirmVo){
public ResponseEntity<DeviceRetiredDetailResultVo> confirmDestroy( @RequestBody @Validated DeviceRetiredConfirmVo deviceRetiredConfirmVo){
//初始化需要的数据
TaskBto task = taskService.get(deviceRetiredConfirmVo.getTaskId());
DeviceRetiredBill deviceRetiredBillEntity = deviceRetiredBillService.getOne(task.getBillId());
......
package entity.domain;
package com.tykj.dev.device.retired.entity.domain;
import com.tykj.dev.device.user.subject.entity.User;
import entity.enums.RetiredStatus;
import entity.vo.DeviceRetiredFormVo;
import com.tykj.dev.device.retired.entity.enums.RetiredStatus;
import com.tykj.dev.device.retired.entity.vo.DeviceRetiredFormVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
......@@ -25,6 +27,8 @@ import java.util.List;
*/
@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update device_retired_bill set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
......
package entity.vo;
package com.tykj.dev.device.retired.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package entity.vo;
package com.tykj.dev.device.retired.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -16,10 +16,6 @@ import javax.validation.constraints.NotNull;
@ApiModel("退装单确认")
public class DeviceRetiredConfirmVo {
@NotNull
@ApiModelProperty(value = "工作ID",example = "1")
private Integer jobId;
@NotNull
@ApiModelProperty(value = "任务ID",example = "1")
private Integer taskId;
......
package entity.vo;
package com.tykj.dev.device.retired.entity.vo;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import io.swagger.annotations.ApiModel;
......
package entity.vo;
package com.tykj.dev.device.retired.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package entity.vo;
package com.tykj.dev.device.retired.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package repository;
package com.tykj.dev.device.retired.repository;
import entity.domain.DeviceRetiredBill;
import com.tykj.dev.device.retired.entity.domain.DeviceRetiredBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......
package service;
package com.tykj.dev.device.retired.service;
import entity.domain.DeviceRetiredBill;
import com.tykj.dev.device.retired.entity.domain.DeviceRetiredBill;
/**
* @author HuangXiahao
......
package service.Impl;
package com.tykj.dev.device.retired.service.Impl;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import entity.domain.DeviceRetiredBill;
import com.tykj.dev.device.retired.entity.domain.DeviceRetiredBill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import repository.DeviceRetiredBillDao;
import service.DeviceRetiredBillService;
import com.tykj.dev.device.retired.repository.DeviceRetiredBillDao;
import com.tykj.dev.device.retired.service.DeviceRetiredBillService;
import java.util.Optional;
......
......@@ -14,8 +14,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
"com.tykj.dev.*",
}
)
public class userApp {
public class UserApp {
public static void main(String[] args) {
SpringApplication.run(userApp.class, args);
SpringApplication.run(UserApp.class, args);
}
}
......@@ -154,7 +154,7 @@ public class RfidController {
});
BeanUtils.copyProperties(rfidChangeBill,rfidChangeBillResultVo);
rfidChangeBillResultVo.setUserAName(userPublicService.getOne(rfidChangeBill.getUserAId()).getName());
rfidChangeBillResultVo.setUserBName(userPublicService.getOne(rfidChangeBill.getUserAId()).getName());
rfidChangeBillResultVo.setUserBName(userPublicService.getOne(rfidChangeBill.getUserBId()).getName());
return ResultUtil.success(rfidChangeBillResultVo);
}
......
......@@ -2,7 +2,9 @@ package com.tykj.dev.rfid.entity.domin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
......@@ -19,6 +21,8 @@ import java.util.Date;
*/
@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update library_warning_log_detail set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
......
......@@ -16,10 +16,6 @@ import javax.validation.constraints.NotNull;
@ApiModel("rfid修改确认")
public class RfidChangeConfirmVo {
@NotNull
@ApiModelProperty(value = "工作ID",example = "1")
private Integer jobId;
@NotNull
@ApiModelProperty(value = "任务ID",example = "1")
private Integer taskId;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论