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

更新业务查询

上级 4d7b4d18
......@@ -10,6 +10,23 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>device-apply</artifactId>
<dependencies>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-user</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-task</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-allot</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-library</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.tykj.dev.device.apply;
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 applyApp {
public static void main(String[] args) {
SpringApplication.run(applyApp.class, args);
}
}
package com.tykj.dev.device.apply.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.allot.service.AllotBillService;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import com.tykj.dev.device.apply.subject.vo.DeviceApplyAllotSaveVo;
import com.tykj.dev.device.apply.subject.vo.DeviceApplyConfirmVo;
import com.tykj.dev.device.apply.subject.vo.DeviceApplySaveVo;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
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.StatusEnum;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.vo.FileVo;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.StringSplitUtil;
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.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author dengdiyi
*/
@RestController
@Api(tags = "装备申请模块",description = "申请模块")
@AutoDocument
@RequestMapping("/apply")
public class DeviceApplyController {
@Autowired
private DeviceApplyBillService deviceApplyBillService;
@Autowired
private UserUtils userUtils;
@Autowired
private TaskService taskService;
@Autowired
private DeviceLogService deviceLogService;
@Autowired
private UserPublicService userPublicService;
@Autowired
private AllotBillService allotBillService;
@Autowired
private TaskLogService taskLogService;
@ApiOperation(value = "发起装备申请",notes = "可以通过这个接口发起装备申请")
@PostMapping("/addDeviceApplyBill")
public ResponseEntity<DeviceApplyBill> addDeviceApplyBill(@RequestBody DeviceApplySaveVo deviceApplySaveVo){
//添加申请单
DeviceApplyBill deviceApplyBillEntity = deviceApplyBillService.addEntity(deviceApplySaveVo.toDo());
Integer userId = userUtils.getCurrentUserId();
//发起任务
TaskBto taskBto;
if (deviceApplySaveVo.getReplyUseraId()!=null) {
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
userIds.add(deviceApplySaveVo.getReplyUseraId());
taskBto = new TaskBto(StatusEnum.DEVICE_APPLY_CONFIRM.id, "申请业务", null, ".", deviceApplyBillEntity.getId(), 9, userPublicService.findUnitIdByName(deviceApplySaveVo.getReplyUnit()), 1, null, userIds);
}
else{
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
userIds.add(0);
taskBto = new TaskBto(StatusEnum.DEVICE_APPLY_CONFIRM.id, "申请业务", null, ".", deviceApplyBillEntity.getId(), 9, userPublicService.findUnitIdByName(deviceApplySaveVo.getReplyUnit()), 1, null, userIds);
}
Task saveEntity = taskService.start(taskBto);
TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起装备申请",null);
taskLogService.addLog(taskLogBto);
return ResultUtil.success(deviceApplyBillEntity);
}
@ApiOperation(value = "装备申请批复",notes = "可以通过这个接口批复")
@PostMapping("/replay")
public ResponseEntity<TaskBto> addDeviceApplyBillReplay(@RequestBody DeviceApplyConfirmVo deviceApplyConfirmVo){
TaskBto taskBto = taskService.get(deviceApplyConfirmVo.getTaskId());
Integer userId = userUtils.getCurrentUserId();
DeviceApplyBill applyBillEntity = deviceApplyBillService.getOne(taskBto.getBillId());
if (deviceApplyConfirmVo.getReplyNumber()!=null){
applyBillEntity.setReplayNumber(deviceApplyConfirmVo.getReplyNumber());
}
//批复驳回
if (deviceApplyConfirmVo.getStatus()==1){
applyBillEntity.setApplyStatus(1);
taskService.update(taskService.moveToArchive(taskBto));
deviceApplyBillService.update(applyBillEntity);
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"装备申请批复驳回",null);
taskLogService.addLog(taskLogBto);
return ResultUtil.success(taskBto);
}
//批复成功
if (deviceApplyConfirmVo.getStatus()==0){
applyBillEntity.setApplyStatus(2);
taskService.update(taskService.moveToEnd(taskBto));
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"装备申请批复通过",null);
taskLogService.addLog(taskLogBto);
//生成配发子任务
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_ALLOT.id, "配发业务", taskBto.getId(), "."+taskBto.getId()+".", 0, 3, userUtils.getCurrentUnitId(), 0, null, userIds);
Task task = taskService.start(taskBto1);
deviceApplyBillService.update(applyBillEntity);
return ResultUtil.success(task.parse2Bto());
}
else {
return ResultUtil.failed();
}
}
@ApiOperation(value = "装备申请后发起配发",notes = "可以通过这个接口装备申请后发起配发")
@PostMapping("/allot")
public ResponseEntity<String> allot(@RequestBody DeviceApplyAllotSaveVo deviceApplyAllotSaveVo){
TaskBto taskBto = taskService.get(deviceApplyAllotSaveVo.getTaskId());
TaskBto applyTask = taskService.get(taskBto.getParentTaskId());
Integer userId = userUtils.getCurrentUserId();
DeviceApplyBill deviceApplyBillEntity = deviceApplyBillService.getOne(applyTask.getBillId());
AllotBill allotBillEntity = new AllotBill();
BeanUtils.copyProperties(deviceApplyAllotSaveVo,allotBillEntity);
allotBillEntity.setTitle("申请后配发");
allotBillEntity.setSendUseraId(userId);
allotBillEntity.setReceiveUseraId(applyTask.getCreateUserId());
allotBillEntity.setApplyNumber(deviceApplyBillEntity.getApplyNumber());
allotBillEntity.setReplayNumber(deviceApplyBillEntity.getReplayNumber());
allotBillEntity.setSendUnit(deviceApplyBillEntity.getReplyUnit());
allotBillEntity.setReceiveUnit(deviceApplyBillEntity.getApplyUnit());
allotBillEntity.setSendTime(new Date());
allotBillEntity.setAllotType(2);
allotBillEntity.setAllotStatus(0);
AllotBill allotBillEntity1 = allotBillService.addEntity(allotBillEntity);
taskBto.setBillId(allotBillEntity1.getId());
taskService.update(taskService.moveToNext(taskBto,deviceApplyAllotSaveVo.getSendUserbId()));
List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("出库确认单",allotBillEntity.getFileName(),allotBillEntity.getFileUrl()));
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"对" + allotBillEntity.getReceiveUnit() + "发起配发",fileVoList);
taskLogService.addLog(taskLogBto);
List<Integer> integerList = StringSplitUtil.split(allotBillEntity.getAllotCheckDetail());
if (integerList.size()>0) {
for (Integer id : integerList) {
if (id > 0) {
DeviceLogDto deviceLogDto = new DeviceLogDto(id,"对" + allotBillEntity.getReceiveUnit() + "发起配发",fileVoList);
deviceLogService.addLog(deviceLogDto);
}
}
}
return ResultUtil.success("发起配发成功");
}
}
package com.tykj.dev.device.apply.repository;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author dengdiyi
*/
public interface DeviceApplyBillDao extends JpaRepository<DeviceApplyBill,Integer>, JpaSpecificationExecutor<DeviceApplyBill> {
}
package com.tykj.dev.device.apply.service;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
/**
* @author dengdiyi
*/
public interface DeviceApplyBillService {
DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity);
DeviceApplyBill update(DeviceApplyBill deviceApplyBillEntity);
DeviceApplyBill getOne(Integer id);
}
package com.tykj.dev.device.apply.service.impl;
import com.tykj.dev.device.apply.repository.DeviceApplyBillDao;
import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* @author dengdiyi
*/
@Service
public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
@Autowired
private DeviceApplyBillDao deviceApplyBillDao;
@Override
public DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity) {
return deviceApplyBillDao.save(deviceApplyBillEntity);
}
@Override
public DeviceApplyBill update(DeviceApplyBill deviceApplyBillEntity) {
return deviceApplyBillDao.save(deviceApplyBillEntity);
}
@Override
public DeviceApplyBill getOne(Integer id) {
Optional<DeviceApplyBill> deviceApplyBillEntity = deviceApplyBillDao.findById(id);
return deviceApplyBillEntity.orElse(null);
}
}
package com.tykj.dev.device.apply.subject.domin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
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;
/**
* entity class for device_apply_bill
* 申请账单
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update device_apply_bill set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("申请账单")
public class DeviceApplyBill {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(name = "主键id")
private Integer id;
/**
* 申请文号
*/
@ApiModelProperty(value = "申请文号")
private String applyNumber;
/**
* 批复文号
*/
@ApiModelProperty(value = "批复文号")
private String replayNumber;
/**
* 申请单位
*/
@ApiModelProperty(value = "申请单位")
private String applyUnit;
/**
* 批复单位
*/
@ApiModelProperty(value = "批复单位")
private String replyUnit;
/**
* 经办人
*/
@ApiModelProperty(value = "经办人")
private String agent;
/**
* 配发单id
*/
@ApiModelProperty(value = "配发单id")
private Integer allotId;
/**
* 申请方id(A岗位)
*/
@ApiModelProperty(value = "申请方id(A岗位)")
private Integer applyUseraId;
/**
* 批复方id(A岗位)
*/
@ApiModelProperty(value = "批复方id(A岗位)")
private Integer replyUseraId;
/**
* 申请状态(0:申请待审核,1:申请审核失败,2:申请中,3:已批复待审核,4:批复审核失败,5:申请成功)
*/
@ApiModelProperty(value = "申请状态(0:申请待审核,1:申请审核失败,2:申请中,3:驳回,4:申请成功)")
private Integer applyStatus;
/**
* 列装库主键idx数量(,作为分隔符),例如1x2,2x3,意为列装库id为1的申请2件,id为2的申请3件
*/
@ApiModelProperty(value = "列装库主键idx数量(,作为分隔符),例如1x2,2x3,意为列装库id为1的申请2件,id为2的申请3件")
private String applyDetail;
/**
* 创建用户id
*/
@CreatedBy
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
/**
* 创建时间
*/
@CreatedDate
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 更新用户id
*/
@LastModifiedBy
@ApiModelProperty(value = "更新用户id")
private Integer updateUserId;
/**
* 更新时间
*/
@LastModifiedDate
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
@ApiModelProperty(value = "申请人")
@Transient
private String applyUser;
}
package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author dengdiyi
*/
@Data
@ApiModel("入库详情类")
public class ApplyBillDetailVo {
@ApiModelProperty(value = "列装id")
private Integer packingId;
@ApiModelProperty(value = "申请数量")
private Integer storageCount;
@ApiModelProperty(value = "配件列表")
List<ApplyBillDetailVo> list;
}
package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dengdiyi
*/
@Data
@ApiModel("申请后配发类")
public class DeviceApplyAllotSaveVo {
@ApiModelProperty(value = "发件方(B岗位)")
private Integer sendUserbId;
@ApiModelProperty(value = "账单文件名")
private String fileName;
@ApiModelProperty(value = "账单文件地址URL")
private String fileUrl;
@ApiModelProperty(value = "配发设备数量")
private Integer allotCount;
@ApiModelProperty(value = "已配发设备数量")
private Integer allotedCount;
@ApiModelProperty(value = "配发出库检查详情(装备主键id+核对结果(0缺失1无误3不匹配,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的不匹配)")
private String allotCheckDetail;
@ApiModelProperty(value = "配发出库检查结果")
private String allotCheckResult;
@ApiModelProperty(value = "对应任务ID",example = "1")
private Integer taskId;
}
package com.tykj.dev.device.apply.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dengdiyi
*/
@Data
@ApiModel("申请审核类")
public class DeviceApplyConfirmVo {
@ApiModelProperty(value = "对应任务ID",example = "1")
private Integer taskId;
@ApiModelProperty(name = "需要修改的状态",example = "0",value = "0为审核通过,1为驳回")
private Integer status;
@ApiModelProperty(value = "批复文号")
private String replyNumber;
}
package com.tykj.dev.device.apply.subject.vo;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import java.util.List;
/**
* @author dengdiyi
*/
@Data
@ApiModel("装备申请存储类")
public class DeviceApplySaveVo {
@ApiModelProperty(value = "申请文号")
private String applyNumber;
@ApiModelProperty(value = "批复文号")
private String replayNumber;
@ApiModelProperty(value = "申请单位")
private String applyUnit;
@ApiModelProperty(value = "批复单位")
private String replyUnit;
@ApiModelProperty(value = "经办人")
private String agent;
@ApiModelProperty(value = "申请人id")
private Integer applyUseraId;
@ApiModelProperty(value = "批复人id")
private Integer replyUseraId;
@ApiModelProperty(value = "入库列装数量详情")
private List<ApplyBillDetailVo> storageBillDetailVoList;
public DeviceApplyBill toDo(){
DeviceApplyBill deviceApplyBillEntity = new DeviceApplyBill();
BeanUtils.copyProperties(this,deviceApplyBillEntity);
deviceApplyBillEntity.setApplyStatus(0);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("x");
if (this.storageBillDetailVoList.size()>0){
for (ApplyBillDetailVo s:storageBillDetailVoList) {
stringBuffer.append(s.getPackingId()).append("x");
stringBuffer.append(s.getStorageCount()).append("x");
}
}
deviceApplyBillEntity.setApplyDetail(stringBuffer.toString());
return deviceApplyBillEntity;
}
}
......@@ -11,7 +11,7 @@
<dependencies>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-task</artifactId>
<artifactId>device-user</artifactId>
</dependency>
</dependencies>
<artifactId>device-library</artifactId>
......
......@@ -2,7 +2,6 @@ package com.tykj.dev.device.library.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.task.subject.vo.BussinessLogVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
......@@ -28,8 +27,6 @@ public interface DeviceLibraryService {
List<String> getAllName();
List<BussinessLogVo> getDeviceLog(Integer id);
List<DeviceLibrary> getList(DeviceLibrarySelectVo deviceLibrarySelectVo);
List<DeviceLibrary> getAllList(DeviceLibrarySelectVo deviceLibrarySelectVo);
......
......@@ -6,7 +6,6 @@ import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.task.subject.vo.BussinessLogVo;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
......@@ -272,12 +271,6 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return new ArrayList<>(s);
}
@Override
public List<BussinessLogVo> getDeviceLog(Integer id) {
return null;
}
@Override
public List<DeviceLibrary> getList(DeviceLibrarySelectVo deviceLibrarySelectVo) {
List<DeviceLibrary> deviceLibraryEntities = deviceLibraryDao.findAll(getSelectSpecification(deviceLibrarySelectVo));
......
......@@ -4,15 +4,11 @@ import com.tykj.dev.device.library.repository.DeviceLogDao;
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.DeviceLog;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.ResultUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Optional;
......
package com.tykj.dev.device.library.subject.Dto;
import com.tykj.dev.device.library.subject.domin.DeviceLog;
import com.tykj.dev.device.task.subject.vo.FileVo;
import com.tykj.dev.device.library.subject.vo.FileVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......
package com.tykj.dev.device.library.subject.domin;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.vo.FileVo;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.utils.StringSplitUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author dengdiyi
*/
@Data
@ApiModel("装备详情日志返回类")
public class DeviceLogVo {
@ApiModelProperty(value = "时间")
private Date time;
@ApiModelProperty(value = "单位")
private String unit;
@ApiModelProperty(value = "用户")
private String user;
@ApiModelProperty(value = "操作")
private String operation;
@ApiModelProperty(value = "单据列表")
private List<FileVo> fileVoList;
}
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author dengdiyi
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("附件信息返回类")
public class FileVo {
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "附件名")
private String fileName;
@ApiModelProperty(value = "附件url")
private String fileUrl;
}
......@@ -3,13 +3,16 @@ package com.tykj.dev.device.selfcheck.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
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.selfcheck.service.SelfCheckBillService;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
import com.tykj.dev.device.selfcheck.subject.vo.*;
import com.tykj.dev.device.task.repository.TaskDao;
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.StatusEnum;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.subject.service.UserPublicService;
......@@ -43,20 +46,17 @@ public class SelfCheckController {
@Autowired
private TaskService taskService;
@Autowired
private TaskDao taskDao;
@Autowired
private DeviceLibraryService deviceLibraryService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
// @Autowired
// private DeviceLogService deviceLogService;
//
// @Autowired
// private DeviceLogDao deviceLogDao;
@Autowired
private DeviceLogService deviceLogService;
@Autowired
private TaskLogService taskLogService;
@Autowired
private UserPublicService userPublicService;
......@@ -151,17 +151,15 @@ public class SelfCheckController {
userIds.add(selfExaminationBillEntity1.getUserbId());
TaskBto taskBto = new TaskBto(StatusEnum.SELF_CHECK_CONFIRM.id,"自查业务",null,".",selfExaminationBillEntity1.getId(),4,userUtils.getCurrentUnitId(),1,null,userIds);
Task saveEntity = taskService.start(taskBto);
// for (String s:strings) {
// if (s.length()>=2) {
// Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
// LogVo bussinessLogVo = new LogVo();
// bussinessLogVo.setDeviceId(id);
// bussinessLogVo.setFileDetail("Ǵ");
// bussinessLogVo.setRemark("发起自查");
// bussinessLogVo.setTaskId(saveEntity.getId());
// deviceLogService.addLog(bussinessLogVo);
// }
// }
TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起自查",null);
taskLogService.addLog(taskLogBto);
for (String s:strings) {
if (s.length()>=2) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
DeviceLogDto deviceLogDto = new DeviceLogDto(id,"发起自查",null);
deviceLogService.addLog(deviceLogDto);
}
}
return ResultUtil.success(selfExaminationBillEntity1);
}
......@@ -175,37 +173,33 @@ public class SelfCheckController {
//审核通过,改变账单和任务状态,发起确认的任务
if (selfExaminationConfirmVo.getStatus()==0){
taskService.update(taskService.moveToEnd(taskBto));
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"自查审核成功",null);
taskLogService.addLog(taskLogBto);
selfExaminationBillEntity.setCheckStatus(2);
selfExaminationBillService.update(selfExaminationBillEntity);
// for (String s:strings) {
// if (s.length()>=2) {
// Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
// LogVo bussinessLogVo = new LogVo();
// bussinessLogVo.setDeviceId(id);
// bussinessLogVo.setFileDetail("Ǵ");
// bussinessLogVo.setRemark("自查审核成功");
// bussinessLogVo.setTaskId(taskBto.getId());
// deviceLogService.addLog(bussinessLogVo);
// }
// }
for (String s:strings) {
if (s.length()>=2) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
DeviceLogDto deviceLogDto = new DeviceLogDto(id,"自查审核成功",null);
deviceLogService.addLog(deviceLogDto);
}
}
return ResultUtil.success("审核通过自查完成");
}
//审核不通过,改变账单和任务状态
if (selfExaminationConfirmVo.getStatus()==1){
taskService.update(taskService.moveToArchive(taskBto));
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"自查审核失败",null);
taskLogService.addLog(taskLogBto);
selfExaminationBillEntity.setCheckStatus(1);
selfExaminationBillService.update(selfExaminationBillEntity);
// for (String s:strings) {
// if (s.length()>=2) {
// Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
// LogVo bussinessLogVo = new LogVo();
// bussinessLogVo.setDeviceId(id);
// bussinessLogVo.setFileDetail("Ǵ");
// bussinessLogVo.setRemark("自查审核失败");
// bussinessLogVo.setTaskId(taskBto.getId());
// deviceLogService.addLog(bussinessLogVo);
// }
// }
for (String s:strings) {
if (s.length()>=2) {
Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
DeviceLogDto deviceLogDto = new DeviceLogDto(id,"自查审核失败",null);
deviceLogService.addLog(deviceLogDto);
}
}
return ResultUtil.success("自查审核失败");
}
else {
......
......@@ -117,7 +117,7 @@ public class StorageBillController {
//2.发起入库任务
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
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);
Task taskEntity1 = taskService.start(taskBto);
//存业务日志
......
......@@ -32,10 +32,10 @@ public class StorageBillSaveVo {
private Date sendTime;
@ApiModelProperty(value = "接收单位A岗")
private Integer receiveUserAId;
private Integer receiveUseraId;
@ApiModelProperty(value = "接收单位B岗")
private Integer receiveUserBId;
private Integer receiveUserbId;
@ApiModelProperty(value = "配发单附件名")
private String fileName;
......
......@@ -21,6 +21,10 @@
<groupId>com.tykj.dev</groupId>
<artifactId>device-user</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>device-library</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.tykj.dev.device.task.subject.bto.TaskBto;
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.vo.TaskSelectVo;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import java.util.List;
......@@ -95,5 +96,5 @@ public interface TaskService {
* @param taskSelectVo
* 获取跟踪和待办业务列表
*/
List<Task> getList(TaskSelectVo taskSelectVo);
List<TaskUserVo> getList(TaskSelectVo taskSelectVo);
}
package com.tykj.dev.device.task.subject.bto;
import com.tykj.dev.device.task.subject.common.GlobalMap;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.utils.StringSplitUtil;
import io.swagger.annotations.ApiModelProperty;
......@@ -9,11 +11,10 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -22,8 +23,12 @@ import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Repository
public class TaskBto {
@Autowired
private UserPublicService userPublicService;
@ApiModelProperty(value = "主键id")
private Integer id;
......@@ -54,6 +59,15 @@ public class TaskBto {
@ApiModelProperty(value = "自定义信息,针对不同业务需要保存一些自定信息")
private String customInfo;
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "置顶用户id的List")
private List<Integer> topFlagDetailList;
......@@ -86,7 +100,9 @@ public class TaskBto {
//复制相同属性
ModelMapper modelMapper = BeanHelper.getUserMapper();
TaskUserVo taskUserVo = modelMapper.map(this,TaskUserVo.class);
//set vo字段 toDo
//set vo字段
taskUserVo.setStartUnit(userPublicService.findUnitsNameByUserId(this.createUserId));
taskUserVo.setStatus(GlobalMap.getStatusEnumMap().get(this.billStatus).name);
return taskUserVo;
}
......
......@@ -17,7 +17,7 @@ public class GlobalMap {
.collect(Collectors.toMap(statusEnum -> statusEnum.id, Function.identity()));
}
public static Map<Integer, StatusEnum> getHashMap() {
public static Map<Integer, StatusEnum> getStatusEnumMap() {
return statusEnumMap;
}
}
......@@ -85,7 +85,13 @@ public enum StatusEnum {
/**
* 自查待审核
*/
SELF_CHECK_CONFIRM(401,"自查待审核");
SELF_CHECK_CONFIRM(401,"自查待审核"),
/**
* 装备申请待批复
*/
DEVICE_APPLY_CONFIRM(500,"装备申请待批复"),
;
public Integer id;
......
......@@ -53,6 +53,12 @@ public class TaskUserVo {
@ApiModelProperty(value = "工作涉及人员id")
private List<Integer> involveUserIdList;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "跟踪时间")
@Transient
private String userTime;
......
package com.tykj.dev.device.task.utils;
import com.tykj.dev.device.task.subject.domin.TaskLog;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
/**
* @author dengdiyi
* task工具类
*/
@Component
public class TaskUtils {
/**
* @param list 业务日志list
* 按照日志创建时间降序排列
*/
public List<TaskLog> orderByCreateTimeDesc(List<TaskLog> list){
Collections.sort(list, (o1, o2) -> {
int flag = o2.getCreateTime().compareTo(o1.getCreateTime());
return flag;
});
return list;
}
/**
* @param list taskUserVo list
* 按照跟踪时间增序排列
*/
public List<TaskUserVo> orderByUserTimeDateAsc(List<TaskUserVo> list){
Collections.sort(list, (o1, o2) -> {
int flag = o1.getUserTimeDate().compareTo(o2.getUserTimeDate());
return flag;
});
return list;
}
/**
* @param list taskUserVo list
* 按照跟踪时间降序排列
*/
public List<TaskUserVo> orderByUserTimeDateDesc(List<TaskUserVo> list){
Collections.sort(list, (o1, o2) -> {
int flag = o2.getUserTimeDate().compareTo(o1.getUserTimeDate());
return flag;
});
return list;
}
/**
* @param list taskUserVo list
* 按照待办时间增序排列
*/
public List<TaskUserVo> orderByTrackingTimeDateAsc(List<TaskUserVo> list){
Collections.sort(list, (o1, o2) -> {
int flag = o1.getTrackingTimeDate().compareTo(o2.getTrackingTimeDate());
return flag;
});
return list;
}
/**
* @param list taskUserVo list
* 按照待办时间降序排列
*/
public List<TaskUserVo> orderByTrackingTimeDateDesc(List<TaskUserVo> list){
Collections.sort(list, (o1, o2) -> {
int flag = o2.getTrackingTimeDate().compareTo(o1.getTrackingTimeDate());
return flag;
});
return list;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论