提交 2f45b15d authored 作者: 133's avatar 133

[清退 用户] 代码提交

上级 135e1726
......@@ -32,5 +32,9 @@ public class Documents {
private List<DocumentDevice> documentDevices;
@ApiModelProperty(name = "发件单位")
private String senderUnit;
@ApiModelProperty(name = "签章数据")
private String srcA;
@ApiModelProperty(name = "签章数据")
private String srcB;
}
......@@ -198,6 +198,8 @@ public class JavaToPdfHtmlFreeMarker {
data.put("senderUnit",documents.getSenderUnit());
data.put("page",page);
data.put("count",count);
data.put("srcA",documents.getSrcA());
data.put("srcB",documents.getSrcB());
List<DocumentDevice> list1=new ArrayList<>();
AtomicInteger i= new AtomicInteger(1);
list.forEach(
......
......@@ -228,6 +228,18 @@ public class DeviceRepelDetail extends BaseEntity {
@ApiModelProperty(value = "清退状态",name = "1.清退中,2.清退完成")
private Integer repelStatus;
@Column(name = "reply_files",columnDefinition = "TEXT")
private String replyFiles;
@Column(name = "send_files",columnDefinition = "TEXT")
private String sendFiles;
@Transient
private List<FileRet> replyFileList = new ArrayList<>();
@Transient
private List<FileRet> sendFileList = new ArrayList<>();
@Transient
@ApiModelProperty(value = "装备List")
......
......@@ -10,6 +10,9 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper;
import javax.persistence.Column;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -162,6 +165,12 @@ public class OrderOutData {
@ApiModelProperty(value = "清退单文件")
private List<FileRet> billFileList;
@Transient
private List<FileRet> replyFileList = new ArrayList<>();
@Transient
private List<FileRet> sendFileList = new ArrayList<>();
public DeviceRepelDetail toTrainDetailsVo() {
ModelMapper mapper = BeanHelper.getUserMapper();
return mapper.map(this, DeviceRepelDetail.class);
......
......@@ -20,6 +20,8 @@ import com.tykj.dev.device.sendback.service.*;
import com.tykj.dev.device.sendback.util.StringUtils;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.entity.Area;
import com.tykj.dev.device.user.subject.entity.SecurityUser;
import com.tykj.dev.device.user.subject.entity.Units;
......@@ -94,6 +96,10 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Autowired
DeviceLibraryService deviceLibraryService;
@Autowired
MessageService messageService;
@Override
public void initiateRepel(DeviceRepel deviceRepel, Integer userId) {
User user = userService.findByUser(userId);
......@@ -121,6 +127,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setRepelId(deviceRepel1.getId());
deviceRepelDetail.setRepelStatus(1);
TaskBto taskBto= statsXTask(units.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle());
//给本单位其他专管员阅知
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"发起清退任务["+deviceRepel1.getTitle()+"]",gainThisUser(userId,units.getUnitId())));
// repelTaskStatisticalService.saveRepelTaskStatistical(new RepelTaskStatistical(deviceRepel1.getId(),null,taskBto.getId(),null,area.getName()));
List<RepelTaskStatistical> list=new ArrayList<>();
List<ModelCount> modelCounts=new ArrayList<>();
......@@ -212,6 +221,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setRepelId(deviceRepel1.getId());
deviceRepelDetail.setRepelStatus(1);
TaskBto taskBto= cityTotalTask(units.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"转发清退任务["+deviceRepel1.getTitle()+"]",gainThisUser(userId,units.getUnitId())));
// repelTaskStatisticalService.saveRepelTaskStatistical(new RepelTaskStatistical(deviceRepel1.getId(),null,taskBto.getId(),null,area.getName()));
Set<ModelCount> modelCounts=new HashSet<>();
deviceRepel.getModels().forEach(i->{
......@@ -264,6 +275,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail.setRepelId(deviceRepel1.getId());
deviceRepelDetail.setRepelStatus(1);
TaskBto taskBto= cityInitiateTask(unitsFather.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle(),userId);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"发起清退任务["+deviceRepel1.getTitle()+"]",gainThisUser(userId,units.getUnitId())));
// repelTaskStatisticalService.saveRepelTaskStatistical(new RepelTaskStatistical(deviceRepel1.getId(),null,taskBto.getId(),null,area.getName()));
// Set<ModelCount> modelCounts=new HashSet<>();
......@@ -332,6 +344,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Override
public void resolveConfirm(Integer taskId,Integer userId) {
User user = userService.findByUser(userId);
TaskBto taskBto= taskService.get(taskId);
List<StatusEnum> list=new ArrayList<>();
......@@ -352,6 +365,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
repelTaskStatistical.setTaskStatus(3);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
DeviceRepel deviceRepel= deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"操作了["+deviceRepel.getTitle()+"]任务,选择了退回装备",gainThisUser(userId,user.getUnitsId())));
// 修改当前任务的状态 清退待提交装备审核
// 修改上级任务是否代办
......@@ -454,6 +469,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Override
public DeviceRepelDetail sendBackOutCheck(Integer taskId, Integer userId, OrderOutData orderOutData) {
User user = userService.findByUser(userId);
TaskBto taskBto= taskService.get(taskId);
List<StatusEnum> statusEnums=new ArrayList<>();
statusEnums.add(StatusEnum.SEND_BACK_1205);
......@@ -469,12 +485,17 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
orderOutDataRepelDetail.setLeftSignatureId(UUID.randomUUID().toString());
orderOutDataRepelDetail.setRightSignatureId(UUID.randomUUID().toString());
orderOutDataRepelDetail.setNum("NO:第"+ LocalDateTime.now().getYear()+"QT"+taskBto.getBillId());
deviceRepelDetailService.saveDeviceRepelDetail(orderOutDataRepelDetail);
orderOutDataRepelDetail.setReplyFiles(FilesUtil.stringFileToList(orderOutData.getReplyFileList()));
orderOutDataRepelDetail.setSendFiles(FilesUtil.stringFileToList(orderOutData.getSendFileList()));
deviceRepelDetailService.saveDeviceRepelDetail(orderOutDataRepelDetail);
deviceLibraryDao.upDateLeftStatusAndOwnUnitName(DeviceLifeStatus.REPEL.id,orderOutData.getReceiveUnit(),StringUtils.stringToList(orderOutDataRepelDetail.getDeviceIds()));
taskBto.setCreateUserId(userId);
taskBto.setOwnUnit(orderOutData.getReceiveUnitId());
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1209,0);
DeviceRepel deviceRepel= deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
waitingReceiptsTask(orderOutData.getSendUnitId(),deviceRepelDetail.getId(),taskBto.getParentTaskId(),"清退装备出库等待上传回执单");
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"根据["+deviceRepel.getTitle()+"]任务,已完成退回出库",gainThisUser(userId,user.getUnitsId())));
devLogAdd(findInvoleDevice(deviceRepelDetail.getDeviceIds()),deviceRepelDetail.getSendUnit()+"装备清退出库"+",等待"+deviceRepelDetail.getReceiveUnit()+"接收",userId);
orderOutDataRepelDetail.setDeviceLibraryEntities(findInvoleDevice(deviceRepelDetail.getDeviceIds()));
......@@ -489,8 +510,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
//是 直接入库 任务完结
//否 状态改为入库待补充文件
//修改统计表中的数据信息 状态
User user=userService.findByUser(storageDeviceRepel.getUserId());
List<RepelDeviceUnit> list=new ArrayList<>();
TaskBto taskBto= taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail = deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
......@@ -546,9 +566,11 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
repelTaskStatistical.setTaskStatus(1);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
DeviceRepel deviceRepel= deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
isEnd(taskBto,deviceRepelDetail.getRepelId());
devLogAdd(findInvoleDevice(deviceRepelDetail.getDeviceIds()),deviceRepelDetail.getReceiveUnit()+"接收"+deviceRepelDetail.getSendUnit()+"装备清退装备,任务完成",storageDeviceRepel.getUserId());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"接收了总任务["+deviceRepel.getTitle()+"]"+deviceRepelDetail.getSendUnit()+"的退回的装备",gainThisUser(user.getUserId(),user.getUnitsId())));
}
......@@ -587,8 +609,11 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
repelTaskStatistical.setTaskStatus(1);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
DeviceRepel deviceRepel= deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
isEnd(taskBto,deviceRepelDetail.getRepelId());
devLogAdd(libraries,"省本级清退,把装备转变为待清退",userId);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"完成["+deviceRepel.getTitle()+"]本级清退任务",gainThisUser(user.getUserId(),user.getUnitsId())));
//完结当前任务
//修改统计表中的数据信息 状态
//把装备的状态都修改为待清退。
......@@ -636,12 +661,14 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
deviceLibraryDao.upDateLeftStatusAndOwnUnitName(DeviceLifeStatus.REPEL.id,orderOutData.getReceiveUnit(),orderOutData.getDevIds());
deviceRepelDetail.setDeviceLibraryEntities(findInvoleDevice(deviceRepelDetail.getDeviceIds()));
sendOutSuperior(units.getUnitId(),deviceRepelDetail.getId(),null);
TaskBto taskBto= sendOutSuperior(units.getUnitId(),deviceRepelDetail.getId(),null);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"发起退役任务,待上传回执单据",gainThisUser(user.getUserId(),user.getUnitsId())));
return deviceRepelDetail;
}
@Override
public void receiptSingle(Integer taskId, StorageDeviceRepel storageDeviceRepel) {
User user=userService.findByUser(storageDeviceRepel.getUserId());
List<RepelDeviceUnit> list=new ArrayList<>();
TaskBto taskBto= taskService.get(taskId);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.SEND_BACK_1210);
......@@ -676,6 +703,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
});
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"退役任务单据上传成功",gainThisUser(user.getUserId(),user.getUnitsId())));
}
@Override
......@@ -852,6 +881,12 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
}
/**
* 异步添加装备日志
* @param deviceLibraries
* @param remark
* @param userId
*/
public void devLogAdd(List<DeviceLibrary> deviceLibraries,String remark,Integer userId){
List<DeviceLog> logDtos=new ArrayList<>();
deviceLibraries.forEach(
......@@ -866,6 +901,12 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
public void addMessage(MessageBto messageBto){
messageService.add(messageBto);
}
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
}
}
package com.tykj.dev.device.user.base.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName DropDownUserLocation.java
* @Description
下拉位置更换参数对象
选中用户 更改用户的顺序 提供下一次默认选中。
* @createTime 2021年03月01日 11:27:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel(value = "下拉列表选中对象位置替换参数对象", description = "下拉列表选中对象位置替换参数对象")
public class DropDownUserLocation {
@ApiModelProperty(value = "单位id", name = "unitId", example = "12321L")
private Integer unitId;
@ApiModelProperty(value = "用户id", name = "userId", example = "12321L")
private Integer userId;
@ApiModelProperty(value = "位置序号 1.A岗人员 2.B岗人员", name = "locationCode", example = "12321L")
private Integer locationCode;
}
package com.tykj.dev.device.user.base.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName NotIsUser.java
* @Description TODO
* @createTime 2021年03月01日 10:34:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel(value = "下拉列表添加用户对象", description = "下拉列表添加用户对象")
public class NotIsUser {
@ApiModelProperty(value = "名称", name = "userName", example = "12321L")
private String name;
@ApiModelProperty(value = "单位id", name = "userName", example = "12321L")
private Integer unitId;
}
package com.tykj.dev.device.user.base.ret;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -14,14 +16,22 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel(value = "下拉列表选中对象位置替换参数对象", description = "下拉列表选中对象位置替换参数对象")
public class UserShenRe {
@ApiModelProperty(value = "用户id", name = "userId", example = "12321L")
private Integer userId;
@ApiModelProperty(value = "用户名称", name = "userName", example = "12321L")
private String name;
/**
* 培训状态 0.已培训 1.已过期 2.未培训 3.快过期
*/
@ApiModelProperty(value = "培训状态", name = "userName", example = "12321L")
private Integer trainStatus;
@ApiModelProperty(value = "排序号", name = "userName", example = "12321L")
private Integer showOrder;
}
package com.tykj.dev.device.user.subject.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.user.base.req.DropDownUserLocation;
import com.tykj.dev.device.user.base.req.LoginUser;
import com.tykj.dev.device.user.base.req.NotIsUser;
import com.tykj.dev.device.user.base.req.VenitalisVo;
import com.tykj.dev.device.user.base.ret.UserUpdatePw;
import com.tykj.dev.device.user.config.MyFilter;
......@@ -233,4 +235,20 @@ public class UserController {
userService.updateUserPass();
return ResponseEntity.ok("ok");
}
@PostMapping("/notIs/add")
@ApiOperation(value = "下拉列表添加用户接口(用户不能登入)")
public ResponseEntity addNotIsUser(@RequestBody NotIsUser notIsUser){
return ResponseEntity.ok(userService.addNoIsUser(notIsUser));
}
@PostMapping("/replaceOptFor")
@ApiOperation(value = "下拉列表选择用户换位置的接口")
public ResponseEntity replaceOptFor(@RequestBody DropDownUserLocation dropDownUserLocation){
userService.replaceOptFor(dropDownUserLocation);
return ResponseEntity.ok("替换完成");
}
}
......@@ -148,6 +148,7 @@ public class User {
);
}
public MemberThat toVo() {
ModelMapper mapper = BeanHelper.getUserMapper();
return mapper.map(this, MemberThat.class);
......@@ -165,7 +166,7 @@ public class User {
}
public UserShenRe toRe() {
return new UserShenRe(userId, name, trainStatus);
return new UserShenRe(userId, name, trainStatus,showOrder);
}
}
package com.tykj.dev.device.user.subject.service;
import com.tykj.dev.device.user.base.req.DropDownUserLocation;
import com.tykj.dev.device.user.base.req.NotIsUser;
import com.tykj.dev.device.user.base.ret.*;
import com.tykj.dev.device.user.subject.entity.SecurityUser;
import com.tykj.dev.device.user.subject.entity.Units;
......@@ -145,4 +147,16 @@ public interface UserService extends PublicService<User> {
void updateUserPass();
/**
* 不是专管员添加接口
*/
User addNoIsUser(NotIsUser notIsUser);
/**
* 人员位置下拉列表选中接口
* 根据单位id 选中人员 以及位置 替换对应人员的位置
* 提供给前端默认选中
*/
void replaceOptFor(DropDownUserLocation dropDownUserLocation);
}
package com.tykj.dev.device.user.subject.service.impl;
import com.tykj.dev.device.user.base.req.DropDownUserLocation;
import com.tykj.dev.device.user.base.req.NotIsUser;
import com.tykj.dev.device.user.base.ret.*;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
......@@ -19,10 +21,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
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.Collectors;
/**
......@@ -151,7 +150,7 @@ public class UserServiceImpl implements UserService {
@Override
public List<UserShenRe> findByUniteId(Integer unitsId) {
return userDao.findAllByUnitsId(unitsId).stream().map(User::toRe).collect(Collectors.toList());
return userDao.findAllByUnitsId(unitsId).stream().map(User::toRe).sorted(Comparator.comparing(UserShenRe::getShowOrder)).collect(Collectors.toList());
}
@Override
......@@ -382,7 +381,7 @@ public class UserServiceImpl implements UserService {
List<UserSuperiorVo> list = new ArrayList<>();
User user = userDao.findById(userId).get();
userDao.findAllByUnitsIdIn(unitsService.findSuperiorByunitsId(user.getUnitsId())).forEach(
userDao.findAllByUnitsIdIn(unitsService.findSuperiorByunitsId(user.getUnitsId())).stream().filter(user1 -> user1.getUsername()!=null&&!user1.getUsername().equals("")).forEach(
user1 -> {
UserSuperiorVo userSuperiorVo = user1.toUserSuperiorVo();
userSuperiorVo.setUnitsName(unitsService.findById(user1.getUnitsId()).getName());
......@@ -424,6 +423,33 @@ public class UserServiceImpl implements UserService {
userDao.saveAll(users);
}
@Override
public User addNoIsUser(NotIsUser notIsUser) {
User user=new User();
user.setName(notIsUser.getName());
user.setUnitsId(notIsUser.getUnitId());
user.setShowOrder(3);
user.setTrainStatus(2);
return user;
}
@Override
public void replaceOptFor(DropDownUserLocation dropDownUserLocation) {
List<User> users= userDao.findAllByUnitsId(dropDownUserLocation.getUnitId());
users.forEach(
user -> {
if (user.getUserId().equals(dropDownUserLocation.getUserId())){
user.setShowOrder(dropDownUserLocation.getLocationCode());
}else {
if (user.getShowOrder()>2|| user.getShowOrder().equals(dropDownUserLocation.getLocationCode())){
user.setShowOrder(3);
}
}
}
);
userDao.saveAll(users);
}
private List<Integer> to(List<Integer> ids,Area area){
if (area.getFatherId()==null){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论