提交 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);
......
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论