提交 89836d79 authored 作者: 133's avatar 133

[销毁 报废 用户] bug修改提交

上级 b5b12a51
......@@ -61,7 +61,7 @@ public enum DeviceLifeStatus {
/**
* 退役
*/
RETIRE(12, "退役"),
RETIRE(12, "退役"),
// /**
// * 报废不在省库
// */
......
......@@ -215,8 +215,9 @@ public class DeviceDecommissioningBusinessServiceImpl implements DeviceDecommiss
if (orderOutData.getTaskId()==null){
deviceDecommissioningDetail = orderOutData.toDeviceDecommissioningDetail();
deviceDecommissioningDetailService.saveDeviceDecommissioningDetail(deviceDecommissioningDetail);
deviceDecommissioningDetail.setNum("NO:第" + LocalDateTime.now().getYear() + "QT" + deviceDecommissioningDetail.getId());
sealOfAuditTask(units.getUnitId(), deviceDecommissioningDetail.getId(),orderOutData.getSendUserbId());
}else {
} else {
TaskBto taskBto = taskService.get(orderOutData.getTaskId());
List<StatusEnum> statusEnums = new ArrayList<>();
statusEnums.add(StatusEnum.DECOMMISSIONING_1250);
......
......@@ -92,6 +92,12 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.lockStatus=:lock ,o.updateTime=current_timestamp where o.id in :idList")
int upDateLeftStatusAndLockStatus(Integer lifeStatus,Integer lock,@Param("idList") List<Integer> idList);
@Transactional
@Modifying
@Query("update DeviceLibrary o set o.lockStatus=:lock ,o.updateTime=current_timestamp where o.id in :idList")
int upDateLockStatus(Integer lock,@Param("idList") List<Integer> idList);
@Transactional
@Modifying
@Query("update DeviceLibrary o set o.lifeStatus = :lifeStatus ,o.locationUnit = :unitName,o.ownUnit = :unitName ,o.lockStatus=:lock ,o.updateTime=current_timestamp where o.id in :idList")
......
......@@ -207,6 +207,7 @@ public class ScrapBusinessServiceImpl implements ScrapBusinessService {
if (scrapOrderOutData.getTaskId()==null){
scrap = scrapOrderOutData.toScrap();
scrapService.saveScrap(scrap);
scrap.setNum("NO:第" + LocalDateTime.now().getYear() + "QT" + scrap.getId());
sealOfAuditTask(units.getUnitId(), scrap.getId(),user.getUserId());
}else {
TaskBto taskBto = taskService.get(scrapOrderOutData.getTaskId());
......
package com.tykj.dev.device.sendback.entity.vo;
import com.tykj.dev.misc.base.CustomPage;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
......@@ -9,5 +13,18 @@ import com.tykj.dev.misc.base.CustomPage;
* @Description TODO
* @createTime 2021年04月14日 15:02:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("选择装备接口条件vo")
public class DeviceSelectVo extends CustomPage {
/**
* 类型
*/
private String model;
/**
* 形态
*/
private Integer type;
}
......@@ -48,6 +48,8 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
deviceRepelDetail.setBillFiles(FilesUtil.stringFileToList(deviceRepelDetail.getBillFile()));
deviceRepelDetail.setOutboundFiles(FilesUtil.stringFileToList(deviceRepelDetail.getOutboundFile()));
deviceRepelDetail.setInFiles(FilesUtil.stringFileToList(deviceRepelDetail.getInFile()));
deviceRepelDetail.setApplyFileList(FilesUtil.stringFileToList(deviceRepelDetail.getApplyFiles()));
deviceRepelDetail.setReplyFileList(FilesUtil.stringFileToList(deviceRepelDetail.getReplyFiles()));
return deviceRepelDetail;
}else {
log.info("[清退] 详情查看错误,id没有找到{}",repelDetailId);
......
......@@ -153,7 +153,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
List<SupervisorVo> supervisorVoList=new ArrayList<>();
//市区关系信息
Map<Integer,List<SupervisorVo>> supervisorMap=new HashMap<>();
//省本级
SupervisorVo corresponding=null;
//省直属 待考虑
......@@ -461,7 +460,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
repelTaskStatistical.setDes(resolveConfirm.getDes());
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
//装备状态改为锁定
deviceLibraryDao.upDateLeftStatusAndLockStatus(2,1,resolveConfirm.getDevIds());
deviceLibraryDao.upDateLockStatus(1,resolveConfirm.getDevIds());
deviceRepelDetail.setDeviceIds(StringUtils.ListToString(resolveConfirm.getDevIds()));
deviceRepelDetail.setSubmitDescription(resolveConfirm.getDes());
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
......@@ -488,7 +487,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}else {
//审核失败
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1206,0);
deviceLibraryDao.upDateLeftStatusAndLockStatus(2,0,StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
deviceLibraryDao.upDateLockStatus(0,StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
}
deviceRepelDetail.setAuditingFeedback(repelAuditResult.getDes());
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
......@@ -785,10 +784,13 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Override
public void receipts(StorageDeviceRepel storageDeviceRepel) {
User user= userService.findByUser(storageDeviceRepel.getUserId());
Units units=unitsService.findById(user.getUnitsId());
TaskBto taskBto = taskService.get(storageDeviceRepel.getTaskId());
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.SEND_BACK_1214);
taskService.moveToEnd(taskBto);
DeviceRepelDetail deviceRepelDetail=deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
DeviceRepel deviceRepel=deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
if (storageDeviceRepel.getSenderName()!=null) {
deviceRepelDetail.setSenderUserB(storageDeviceRepel.getSenderName());
}
......@@ -810,7 +812,11 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (storageDeviceRepel.getUserAName()!=null) {
deviceRepelDetail.setReceiveUserA(storageDeviceRepel.getUserAName());
}
deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.RETIRE.id,deviceRepelDetail.getReceiveUnit(),0,StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
if (units.getLevel()==3) {
deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.RETIRE.id, deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
}else {
deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(filterTypeReturnLeftStatus(deviceRepel.getType()), deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
}
TaskBto fatherTask=taskService.get(taskBto.getParentTaskId());
taskService.moveToEnd(fatherTask);
DeviceRepelDetail deviceRepelDetailFather= deviceRepelDetailService.findDeviceRepelDetail(fatherTask.getBillId());
......
......@@ -145,12 +145,22 @@ public class RepelQueryServiceImpl implements RepelQueryService {
isNotSub = 0;
}
}
Page<DeviceLibrary> deviceLibraryPage= PageUtil.getPerPage(deviceChoosePageVo.getDeviceSelectVos().getPage(), deviceChoosePageVo.getDeviceSelectVos().getSize(), deviceLibraries, deviceChoosePageVo.getDeviceSelectVos().getPageable());
Page<DeviceLibrary> deviceLibraryPageAbnormal= PageUtil.getPerPage(deviceChoosePageVo.getDeviceSelectVoAbnormal().getPage(), deviceChoosePageVo.getDeviceSelectVoAbnormal().getSize(), deviceLibrariesAbnormal, deviceChoosePageVo.getDeviceSelectVoAbnormal().getPageable());
Page<DeviceLibrary> deviceLibraryPage= PageUtil.getPerPage(deviceChoosePageVo.getDeviceSelectVos().getPage(), deviceChoosePageVo.getDeviceSelectVos().getSize(), findModelAndType(deviceChoosePageVo.getDeviceSelectVos(),deviceLibraries), deviceChoosePageVo.getDeviceSelectVos().getPageable());
Page<DeviceLibrary> deviceLibraryPageAbnormal= PageUtil.getPerPage(deviceChoosePageVo.getDeviceSelectVoAbnormal().getPage(), deviceChoosePageVo.getDeviceSelectVoAbnormal().getSize(), findModelAndType(deviceChoosePageVo.getDeviceSelectVoAbnormal(),deviceLibrariesAbnormal), deviceChoosePageVo.getDeviceSelectVoAbnormal().getPageable());
return new DeviceChooseRepel(deviceLibraryPage,deviceLibraryPageAbnormal,isNotSub);
}
private List<DeviceLibrary> findModelAndType(DeviceSelectVo deviceSelectVo,List<DeviceLibrary> libraries){
if (deviceSelectVo.getModel()!=null&&deviceSelectVo.getType()==null){
return libraries.stream().filter(deviceLibrary -> deviceLibrary.getModel().equals(deviceSelectVo.getModel())).collect(Collectors.toList());
}else if (deviceSelectVo.getModel()==null&&deviceSelectVo.getType()!=null){
return libraries.stream().filter(deviceLibrary -> deviceLibrary.getType().equals(deviceSelectVo.getType())).collect(Collectors.toList());
}else if (deviceSelectVo.getModel()!=null&&deviceSelectVo.getType()!=null){
return libraries.stream().filter(deviceLibrary -> deviceLibrary.getType().equals(deviceSelectVo.getType())&&deviceLibrary.getModel().equals(deviceSelectVo.getModel())).collect(Collectors.toList());
}else {
return libraries;
}
}
// private PredicateBuilder<DeviceLibrary> getPredicateBuilderDeviceChooseRepel(List<Integer> packingList,List<Integer> lifeStatusList) {
// PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
......
......@@ -72,16 +72,6 @@ public class HandoverController {
return ResponseEntity.ok(workHandoverService.handedList(securityUser));
}
/**
* 查询交接人
*/
@PostMapping(value = "/handover")
@ApiOperation(value = "查询交接人")
public ResponseEntity handedList(@RequestBody WorkHandoverAddVo workHandoverAddVo) {
return ResponseEntity.ok(workHandoverService.handover(workHandoverAddVo.getTurnOverUserAId()));
}
/**
* 工作交接-查询交接人下拉
*/
......
package com.tykj.dev.device.train.entity;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.train.entity.vo.WorkHandoverUserVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverVo;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.misc.base.BeanHelper;
......@@ -34,7 +35,6 @@ public class WorkHandover {
* 工作交接id
*/
@Id
@GeneratedValue()
@ApiModelProperty(value = "工作交接id")
@Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT")
private Integer workHandoverId;
......@@ -47,15 +47,8 @@ public class WorkHandover {
/**
* 交接相关人员
*/
@Column(name = "handover_user_ids",columnDefinition = "TEXT")
private String handoverUserIds;
/**
* 移交人a
*/
@Column(name = "turn_over_user_ids",columnDefinition = "TEXT")
private String turnOverUserIds;
@Column(name = "work_handover_users",columnDefinition = "TEXT")
private String workHandoverUsers;
/**
* 监交人
......@@ -67,18 +60,9 @@ public class WorkHandover {
*/
private String leadershipName;
/**
* 代办业务 json
*/
private String commissionWord;
/**
* 跟踪业务 json
*/
private String trackingWord;
/**
* 文件集合(装备列表签字文件集合)
* 工作交接签章文件 db
*/
@Column(name = "file" ,columnDefinition = "TEXT")
private String file;
......@@ -88,38 +72,20 @@ public class WorkHandover {
*/
private Integer status=1;
/**
* 创建时间
*/
@CreatedDate
private Date createTime;
/**
* 更新时间
*/
@LastModifiedDate
private Date updateTime;
@ApiModelProperty(value = "区块链RID",name = "recordId")
private String recordId;
/**
* 发起用户集合
*/
@Transient
private List<User> handoverUserList;
/**
* 接收用户集合
* 工作交接单据集合
*/
@Transient
private List<User> turnOverUserList;
private List<FileRet> fileRets;
/**
* 接收用户集合
* 本次交接人员信息组
*/
@Transient
private List<FileRet> fileRets;
private List<WorkHandoverUserVo> workHandoverUserVoList;
/**
* 本次交接装备信息清单
......
......@@ -23,9 +23,9 @@ import java.util.List;
public class WorkHandoverAddVo {
/**
* 移交人a
* 工作交接人员组
*/
private List<Integer> turnOverUserAId;
private List<WorkHandoverUserVo> workHandoverUserVoList;
/**
* 监交人
......
package com.tykj.dev.device.train.entity.vo;
import com.tykj.dev.device.user.subject.entity.User;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName WorkHandoverUserVo.java
* @Description 工作交接 交接组
* @createTime 2021年04月16日 14:59:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "工作交接人员对象", description = "工作交接人员对象")
public class WorkHandoverUserVo {
/**
* 交接人员id集合
*/
private List<Integer> handoverUserIds;
/**
* 移交人员id
*/
private Integer turnOverUserIds;
/**
* 交接人员详情集合
*/
private List<User> handoverUsers;
/**
* 交接人员详情
*/
private User turnOverUser;
}
......@@ -117,6 +117,7 @@ public class TrainThemeServiceImpl implements TrainThemeService {
}
@Override
public TrainRegistrationVo findRegistrationVo(Integer trainThemeId) {
TrainTheme trainTheme = trainThemeDao.findById(trainThemeId).get();
......
......@@ -12,6 +12,7 @@ import com.tykj.dev.device.train.entity.WorkHandover;
import com.tykj.dev.device.train.entity.WorkHandoverDev;
import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverUserVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverVo;
import com.tykj.dev.device.train.service.TrainTaskService;
import com.tykj.dev.device.train.service.WorkHandoverService;
......@@ -30,10 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors;
......@@ -69,18 +67,16 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
public WorkHandover createWorkHandover(WorkHandoverAddVo workHandoverAddVo, SecurityUser securityUser) {
log.info("[workHandover] 新建工作交接");
// WorkHandover
List<User> users= userService.findAllByUnite(securityUser.getCurrentUserInfo().getUnitsId());
List<Integer> handoverIds= users.stream().filter(user -> user.getTrainStatus()!=5).map(User::getUserId).collect(Collectors.toList());
WorkHandover workHandover=new WorkHandover();
if (workHandoverAddVo.getInUserName()!=null) {
workHandover.setInUserName(workHandoverAddVo.getInUserName());
}
if (workHandoverAddVo.getLeadershipName()!=null) {
workHandover.setLeadershipName(workHandoverAddVo.getLeadershipName());
}
workHandover.setWorkHandoverUsers(JacksonUtil.toJSon(workHandoverAddVo.getWorkHandoverUserVoList()));
workHandover.setStatus(1);
workHandover.setTurnOverUserIds(StringSplitUtil.ListToString(workHandoverAddVo.getTurnOverUserAId()));
workHandover.setHandoverUserIds(StringSplitUtil.ListToString(handoverIds));
workHandover.setInitiateUserId(securityUser.getCurrentUserInfo().getUserId());
//创建workHandoverDB 存储数据库
workHandover = workHandoverDao.save(workHandover);
......@@ -93,8 +89,7 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
List<Integer> integers = new ArrayList<>();
integers.add(securityUser.getCurrentUserInfo().getUserId());
taskService.start(new TaskBto(StatusEnum.WORKHANDOVER1011.id, "工作交接", null, null, workHandover.getWorkHandoverId(), BusinessEnum.WORK_HANDOVER.id, securityUser.getCurrentUserInfo().getUnitsId(), 0, null, integers));
workHandover.setTurnOverUserList(userService.findAllUserIdInUser(workHandoverAddVo.getTurnOverUserAId()));
workHandover.setHandoverUserList(userService.findAllUserIdInUser(handoverIds));
return workHandover;
}
......@@ -115,14 +110,28 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
workHandover.setFile(FilesUtil.stringFileToList(workHandoverEndAddVo.getFileLists()));
workHandover = workHandoverDao.save(workHandover);
//把移交人的所有代办任务和跟踪任务替换名称,换成交接人
// taskService.workHandover(workHandover.getHandoverUserAId(), workHandover.getTurnOverUserAId());
//推入完结状态
TaskBto taskBto = trainTaskService.selectFatherIsNullAndBillidAndBillType(workHandover.getWorkHandoverId(), BusinessEnum.WORK_HANDOVER.id);
taskService.moveToEnd(taskBto);
//拿到工作交接人员对象组
List<WorkHandoverUserVo> workHandoverUserVoList=JacksonUtil.readValue(workHandover.getWorkHandoverUsers(), new TypeReference<List<WorkHandoverUserVo>>() {});
List<Integer> integerList=new ArrayList<>();
workHandoverUserVoList.forEach(
workHandoverUserVo -> {
workHandoverUserVo.getHandoverUserIds().forEach(
integerId ->{
integerList.add(integerId);
taskService.workHandover(integerId,workHandoverUserVo.getTurnOverUserIds());
}
);
}
);
//把交接人账号状态改为冻结
User user= userService.findByUser(workHandover.getInitiateUserId());
user.setIsDel(1);
userService.save(user);
List<User> users= userService.findAllUserIdInUser(integerList);
users.forEach(
user -> user.setIsDel(1)
);
userService.saveAll(users);
return workHandover;
}
......@@ -131,10 +140,15 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
Optional<WorkHandover> optionalWorkHandover = workHandoverDao.findById(workHandoverId);
if (optionalWorkHandover.isPresent()) {
WorkHandover workHandover = optionalWorkHandover.get();
workHandover.setHandoverUserList(userService.findAllUserIdInUser(StringSplitUtil.stringToList(workHandover.getHandoverUserIds())));
workHandover.setTurnOverUserList(userService.findAllUserIdInUser(StringSplitUtil.stringToList(workHandover.getTurnOverUserIds())));
workHandover.setFileRets(FilesUtil.stringFileToList(workHandover.getFile()));
workHandover.setWorkHandoverDevs(workHandoverDevDao.findAllByWordId(workHandover.getWorkHandoverId()));
workHandover.setWorkHandoverUserVoList(JacksonUtil.readValue(workHandover.getWorkHandoverUsers(), new TypeReference<List<WorkHandoverUserVo>>() {}));
workHandover.getWorkHandoverUserVoList().forEach(
workHandoverUserVo -> {
workHandoverUserVo.setTurnOverUser(userService.findByUser(workHandoverUserVo.getTurnOverUserIds()));
workHandoverUserVo.setHandoverUsers(userService.findAllUserIdInUser(workHandoverUserVo.getHandoverUserIds()));
}
);
return workHandover;
} else {
throw new ApiException(ResponseEntity.status(500).body("没有这个id:" + workHandoverId));
......
......@@ -38,9 +38,15 @@ public class UserLogController {
UserLogService userLogService;
@GetMapping("/find/select/{userId}")
@ApiOperation(value = "分页查询area对象", notes = "成功返回区域对象")
@ApiOperation(value = "查询用户履历", notes = "查询用户履历")
public ResponseEntity selectPage(@PathVariable Integer userId){
return ResponseEntity.ok(userLogService.findAllByuserID(userId));
}
@GetMapping("/find")
@ApiOperation(value = "303", notes = "查询用户履历")
public ResponseEntity selectPage1(){
throw new ApiException(ResponseEntity.status(303).body("错误"));
}
}
......@@ -179,5 +179,6 @@ public interface UserService extends PublicService<User> {
*/
List<UserShenRe> findUnitIdListUser(Integer unitId);
List<User> saveAll(List<User> users);
}
......@@ -490,6 +490,11 @@ public class UserServiceImpl implements UserService {
return userDao.findAllByUnitsId(unitId).stream().filter(user -> user.getTrainStatus()!=5).map(User::toRe).collect(Collectors.toList());
}
@Override
public List<User> saveAll(List<User> users) {
return userDao.saveAll(users);
}
private List<Integer> to(List<Integer> ids,Area area){
if (area.getFatherId()==null){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论