提交 478554fa authored 作者: 133's avatar 133

清退 提交

上级 235734e4
...@@ -15,21 +15,25 @@ import java.util.List; ...@@ -15,21 +15,25 @@ import java.util.List;
*/ */
public class FilesUtil { public class FilesUtil {
public static List<FileRet> stringFileToList(String fileString){ public static List<FileRet> stringFileToList(String fileString){
List<FileRet> fileRetList=new ArrayList<>(); if (fileString!=null) {
FileRet fileRet = new FileRet(); List<FileRet> fileRetList = new ArrayList<>();
String [] fileRets = fileString.substring(3).split("<\\*>"); FileRet fileRet = new FileRet();
List<String> strings= Arrays.asList(fileRets); String[] fileRets = fileString.substring(3).split("<\\*>");
strings.forEach( List<String> strings = Arrays.asList(fileRets);
file->{ strings.forEach(
System.out.println(file); file -> {
String [] files= file.split(","); System.out.println(file);
fileRet.setName(files[0]); String[] files = file.split(",");
fileRet.setFilePath(files[1]); fileRet.setName(files[0]);
fileRet.setPreviewPath(files[2]); fileRet.setFilePath(files[1]);
fileRetList.add(fileRet); fileRet.setPreviewPath(files[2]);
} fileRetList.add(fileRet);
); }
return fileRetList; );
return fileRetList;
}else {
return new ArrayList<>();
}
} }
public static String stringFileToList(List<FileRet> fileRets){ public static String stringFileToList(List<FileRet> fileRets){
......
...@@ -68,7 +68,7 @@ public enum BusinessEnum { ...@@ -68,7 +68,7 @@ public enum BusinessEnum {
/** /**
* 清退业务 * 清退业务
*/ */
SEND_BACK(16, "清退业务"), SEND_BACK(16, "清退装备交接业务"),
/** /**
* 清退异常处理 * 清退异常处理
*/ */
...@@ -76,7 +76,7 @@ public enum BusinessEnum { ...@@ -76,7 +76,7 @@ public enum BusinessEnum {
/** /**
* 清退出库 * 清退出库
*/ */
SEND_BACK_OUT(18, "清退出库"), SEND_BACK_STATISTICAL(18, "清退统计"),
/** /**
* 新增配套设备 * 新增配套设备
*/ */
......
...@@ -54,14 +54,25 @@ public enum StatusEnum { ...@@ -54,14 +54,25 @@ public enum StatusEnum {
* 清退任务 * 清退任务
*/ */
//以下为stat状态 //以下为stat状态
SEND_BACK_1200(1200, "省市清退查看"), // SEND_BACK_1200(1200, "省市清退查看"),
SEND_BACK_1201(1201, "统计数据等待办结"), // SEND_BACK_1201(1201, "统计数据等待办结"),
SEND_BACK_1202(1202, "出库待审核"), // SEND_BACK_1202(1202, "出库待审核"),
SEND_BACK_1203(1203, "出库待校验"), // SEND_BACK_1203(1203, "出库待校验"),
SEND_BACK_1204(1204, "入库待审核"), // SEND_BACK_1204(1204, "入库待审核"),
SEND_BACK_1205(1205, "异常装备待描述"), // SEND_BACK_1205(1205, "异常装备待描述"),
SEND_BACK_1206(1206, "入库待校验"), // SEND_BACK_1206(1206, "入库待校验"),
SEND_BACK_1207(1207, "异常装备确认"), // SEND_BACK_1207(1207, "异常装备确认"),
SEND_BACK_1200(1200, "省清退任务待各市提交"),
SEND_BACK_1201(1201, "市清退任务待执行"),
SEND_BACK_1202(1202, "省直属装备待清退"),
SEND_BACK_1203(1203, "省本级装备待清退"),
SEND_BACK_1204(1204, "市清退任务待各市提交"),
SEND_BACK_1205(1205, "区清退任务待执行"),
SEND_BACK_1206(1206, "等待选择清退装备"),
SEND_BACK_1207(1207, "清退装备等待审核确认"),
SEND_BACK_1208(1208, "清退装备等待出库"),
SEND_BACK_1209(1209, "清退装备等待入库"),
// SEND_BACK_1204(1204, "入库待审核"), // SEND_BACK_1204(1204, "入库待审核"),
......
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
<groupId>com.tykj.dev</groupId> <groupId>com.tykj.dev</groupId>
<artifactId>misc</artifactId> <artifactId>misc</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-file</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.tykj.dev</groupId> <groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId> <artifactId>config</artifactId>
......
package com.tykj.dev.device.sendback.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.vo.OrderOutData;
import com.tykj.dev.device.sendback.entity.vo.ResolveConfirm;
import com.tykj.dev.device.sendback.entity.vo.StorageDeviceRepel;
import com.tykj.dev.device.sendback.service.RepelBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelDevController.java
* @Description TODO
* @createTime 2021年01月10日 13:52:00
*/
@RestController
@Api(tags = "装备清退(新)", description = "包括装备清退、装备异常处理、装备出库、装备入库")
@AutoDocument
@RequestMapping("/repel")
public class RepelDevController {
@Autowired
RepelBusinessService repelBusinessService;
@PostMapping(value ="/initiateRepel/{userId}")
@ApiOperation(value = "省发布清退接口", notes = "省发布清退接口")
public ResponseEntity initiateRepel(@PathVariable Integer userId,@RequestBody DeviceRepel deviceRepel){
repelBusinessService.initiateRepel(deviceRepel,userId);
return ResponseEntity.ok("发布成功");
}
@ApiOperation(value = "市转发省级任务接口", notes = "市转发省级任务接口")
@PostMapping(value ="/resolveRepel/{userId}/{taskId}")
public ResponseEntity resolveRepel(@PathVariable Integer userId, @RequestBody DeviceRepel deviceRepel, @PathVariable Integer taskId){
repelBusinessService.resolveRepel(deviceRepel, taskId, userId);
return ResponseEntity.ok("市转发省级任务成功");
}
/**
* 选则装备等待审核
*/
@ApiOperation(value = "选则装备等待审核", notes = "选择装备的接口")
@PostMapping(value ="/resolveConfirm/{userId}/{taskId}")
public ResponseEntity resolveConfirm(@PathVariable Integer userId, @RequestBody ResolveConfirm resolveConfirm, @PathVariable Integer taskId){
repelBusinessService.resolveConfirm(taskId,resolveConfirm,userId);
return ResponseEntity.ok("选中装备提交成功");
}
/**
* 审核接口
*/
@ApiOperation(value = "清退代办业务审核接口", notes = "清退代办业务审核接口")
@PostMapping(value ="/resolveAudit/{type}/{taskId}")
public ResponseEntity resolveAudit(@PathVariable Integer taskId, @PathVariable Integer type){
repelBusinessService.resolveAudit(taskId,type);
return ResponseEntity.ok("审核成功");
}
/**
* 出库任务
* @param taskId
* @param userId
* @return
*/
@ApiOperation(value = "清退出库任务接口", notes = "清退出库任务接口")
@PostMapping(value ="/sendBackOutCheck/{userId}/{taskId}")
public ResponseEntity sendBackOutCheck(@PathVariable Integer taskId, @RequestBody OrderOutData orderOutData, @PathVariable Integer userId){
repelBusinessService.sendBackOutCheck(taskId,userId,orderOutData);
return ResponseEntity.ok("审核成功");
}
/**
* 入库任务
*/
@ApiOperation(value = "清退入库任务接口", notes = "清退入库任务接口")
@PostMapping(value ="/storageDeviceRepel/{taskId}")
public ResponseEntity storageDeviceRepel(@PathVariable Integer taskId, @RequestBody StorageDeviceRepel storageDeviceRepel){
repelBusinessService.storageDeviceRepel(taskId,storageDeviceRepel);
return ResponseEntity.ok("入库任务");
}
}
package com.tykj.dev.device.sendback.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.sendback.service.RepelQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelQueryController.java
* @Description TODO
* @createTime 2021年01月10日 15:43:00
*/
@RestController
@Api(tags = "装备清退查询接口模块", description = "包括装备清退、装备异常处理、装备出库、装备入库")
@AutoDocument
@RequestMapping("/repelQuery")
public class RepelQueryController {
@Autowired
RepelQueryService repelQueryService;
@GetMapping(value ="/repelTaskStatistical/{taskId}/{billId}")
@ApiOperation(value = "省、市清退任务的统计页面详情", notes = "省、市清退任务的统计页面")
public ResponseEntity findRepelTaskStatisticals(@PathVariable Integer taskId, @PathVariable Integer billId){
return ResponseEntity.ok(repelQueryService.findRepelTaskStatisticals(taskId, billId));
}
@GetMapping(value ="/deviceRepelDetail/{taskId}")
@ApiOperation(value = "统计任务审核页面详情", notes = "统计任务审核页面详情")
public ResponseEntity findDeviceRepelDetail(@PathVariable Integer taskId){
return ResponseEntity.ok(repelQueryService.findDeviceRepelDetail(taskId));
}
@GetMapping(value ="/deviceRepel/{taskId}")
@ApiOperation(value = "代办任务通知页面详情", notes = "代办任务通知页面详情")
public ResponseEntity findDeviceRepel(@PathVariable Integer taskId){
return ResponseEntity.ok(repelQueryService.findDeviceRepel(taskId));
}
}
package com.tykj.dev.device.sendback.entity.domain; package com.tykj.dev.device.sendback.entity.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.misc.base.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.SQLDelete;
import org.springframework.data.jpa.domain.support.AuditingEntityListener; import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*; import javax.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author zjm * @author zjm
...@@ -20,7 +25,8 @@ import java.util.Date; ...@@ -20,7 +25,8 @@ import java.util.Date;
@Entity @Entity
@EntityListeners(AuditingEntityListener.class) @EntityListeners(AuditingEntityListener.class)
@ApiModel("清退账单") @ApiModel("清退账单")
public class DeviceRepel { @SQLDelete(sql = "update device_check_bill set delete_tag = 1 where id = ?")
public class DeviceRepel extends BaseEntity {
/** /**
* 数据id * 数据id
*/ */
...@@ -28,35 +34,72 @@ public class DeviceRepel { ...@@ -28,35 +34,72 @@ public class DeviceRepel {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id; private Integer id;
/**
* 清退标题
*/
@ApiModelProperty(value = "清退标题")
private String title;
/** /**
* 类型集合多个列装id * 类型集合多个列装id
* 页面类型 * 页面类型
*/ */
@ApiModelProperty(value = "列装id文本 新建时不用填写")
private String fielding; private String fielding;
/** /**
* 描述 * 描述
*/ */
@ApiModelProperty(value = "描述")
private String describes; private String describes;
/** /**
* 任务范围 * 任务范围
* 字典值 * 字典值
*/ */
private Integer taskScope; @ApiModelProperty(value = "任务范围 新建时不用填写")
private String taskScope;
/** /**
* 全省清退单 *征文
* 中办签字 *
*/ */
private String fineName; @ApiModelProperty(value = "正文")
private String files;
/**
* 单据rul
*/
private String url;
@ApiModelProperty(value = "截至日期") @ApiModelProperty(value = "截至日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date time; private Date time;
/**
* 清退状态
* 1。全量清退 2。部分清退
*/
@ApiModelProperty(value = "清退状态 1。全量清退 2。部分清退")
private Integer repelStatus;
/**
* 类型集合多个列装id
* 页面类型
*/
@Transient
@ApiModelProperty(value = "列装id集合")
private List<Integer> fieldingIds;
@Transient
@ApiModelProperty(value = "文件对象集合")
private List<FileRet> fileRets;
@Transient
@ApiModelProperty(value = "清退单位id集合")
private List<Integer> taskScopes;
@Transient
@ApiModelProperty(value = "涉及单位名称集合,查询使用")
private List<String> unitNames;
@Transient
@ApiModelProperty(value = "涉及型号集合 添加填写")
private List<String> models;
} }
...@@ -2,13 +2,11 @@ package com.tykj.dev.device.sendback.entity.domain; ...@@ -2,13 +2,11 @@ package com.tykj.dev.device.sendback.entity.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.misc.base.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
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 org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*; import javax.persistence.*;
...@@ -27,7 +25,7 @@ import java.util.List; ...@@ -27,7 +25,7 @@ import java.util.List;
@Entity @Entity
@EntityListeners(AuditingEntityListener.class) @EntityListeners(AuditingEntityListener.class)
@ApiModel("清退详情") @ApiModel("清退详情")
public class DeviceRepelDetail { public class DeviceRepelDetail extends BaseEntity {
/** /**
* 主键id * 主键id
*/ */
...@@ -57,6 +55,18 @@ public class DeviceRepelDetail { ...@@ -57,6 +55,18 @@ public class DeviceRepelDetail {
*/ */
@ApiModelProperty(value = "发件单位") @ApiModelProperty(value = "发件单位")
private String sendUnit; private String sendUnit;
/**
* 发件单位id
*/
@ApiModelProperty(value = "发件单位id")
private Integer sendUnitId;
/**
* 收件单位id
*/
@ApiModelProperty(value = "收件单位id")
private Integer receiveUnitId;
/** /**
* 收件单位 * 收件单位
*/ */
...@@ -75,45 +85,56 @@ public class DeviceRepelDetail { ...@@ -75,45 +85,56 @@ public class DeviceRepelDetail {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date receiveTime; private Date receiveTime;
/** /**
* 发件方id(A岗位) * 经办人
*/ */
@ApiModelProperty(value = "发件方id(A岗位)") @ApiModelProperty(value = "发件方id(A岗位)")
private Integer sendUserAId; private Integer sendUserAId;
/** /**
* 发件方id(B岗位) * 经办人 名称
*/ */
@ApiModelProperty(value = "发件方id(B岗位)") @ApiModelProperty(value = "发件方名称(A岗位)")
private Integer sendUserBId; private String sendUserAName;
/**
* 签发人
*/
@ApiModelProperty(value = "签发人(B岗位)")
private String sendUserBName;
/** /**
* 收件方id(A岗位) * 收件方 经办人
*/ */
@ApiModelProperty(value = "收件方id(A岗位)") @ApiModelProperty(value = "收件方id(A岗位)")
private Integer receiveUserAId; private Integer receiveUserAId;
/** /**
* 收件方id(B岗位) * 收件方 经办人名称
*/ */
@ApiModelProperty(value = "收件方id(B岗位)") @ApiModelProperty(value = "收件方名称(A岗位)")
private Integer receiveUserBId; private String receiveUserAName;
/** /**
* 出库附件文件名 * 收件方id(B岗位)
*/ */
@ApiModelProperty(value = "出库附件文件名") @ApiModelProperty(value = "收件方名称(B岗位)")
private String fileName; private String receiveUserBName;
/** /**
* 出库附件文件地址URL * 收件方id(B岗位)
*/ */
@ApiModelProperty(value = "出库附件文件地址URL") @ApiModelProperty(value = "收件方id(B岗位)")
private String fileUrl; private Integer receiveUserBId;
/** /**
* 账单文件名 * 出库附件文件
*/ */
@ApiModelProperty(value = "账单文件名") @ApiModelProperty(value = "出库附件文件")
private String billFileName; private String outboundFile;
/** /**
* 账单文件地址URL * 清退单文件
*/ */
@ApiModelProperty(value = "账单文件地址URL") @ApiModelProperty(value = "清退单文件")
private String billFileUrl; private String billFile;
/** /**
* 退回状态(1:退回待审核,2:退回审核失败,3:退回中,4:退回接收待审核,5:退回接收审核失败,6:退回成功) * 退回状态(1:退回待审核,2:退回审核失败,3:退回中,4:退回接收待审核,5:退回接收审核失败,6:退回成功)
*/ */
...@@ -159,66 +180,10 @@ public class DeviceRepelDetail { ...@@ -159,66 +180,10 @@ public class DeviceRepelDetail {
*/ */
@ApiModelProperty(value = "Ǵ作为分隔符,维修装备的主键id加备注,例如x1Ǵ备注1Ǵx2Ǵ备注2Ǵx,意为id为1的装备在维修,备注为备注1,id为2的装备在维修,备注为备注2") @ApiModelProperty(value = "Ǵ作为分隔符,维修装备的主键id加备注,例如x1Ǵ备注1Ǵx2Ǵ备注2Ǵx,意为id为1的装备在维修,备注为备注1,id为2的装备在维修,备注为备注2")
private String repairDeviceDetail; private String repairDeviceDetail;
/**
* 创建用户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 = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag;
/****************czq**************/
@ApiModelProperty(value = "发件方名称(A岗位)")
private String sendUserAName;
@ApiModelProperty(value = "发件方名称(B岗位)")
private String sendUserBName;
@ApiModelProperty(value = "收件方名称(A岗位)")
private String receiveUserAName;
@ApiModelProperty(value = "收件方名称(B岗位)")
private String receiveUserBName;
@ApiModelProperty(value = "装备id") @ApiModelProperty(value = "装备id")
private String deviceIds; private String deviceIds;
@ApiModelProperty(value = "签发人")
private String agent;
@Transient
@ApiModelProperty(value = "装备List")
private List<DeviceLibrary> deviceLibraryEntities =new ArrayList<>();
@ApiModelProperty(value = "不知道是什么的号码")
private String num;
@ApiModelProperty(value = "发件单位签章id") @ApiModelProperty(value = "发件单位签章id")
private String leftSignatureId; private String leftSignatureId;
...@@ -233,10 +198,14 @@ public class DeviceRepelDetail { ...@@ -233,10 +198,14 @@ public class DeviceRepelDetail {
*/ */
@ApiModelProperty(value = "提交描述") @ApiModelProperty(value = "提交描述")
private String submitDescription; private String submitDescription;
/** /**
* 审核反馈 * 审核反馈
*/ */
@ApiModelProperty(value = "审核反馈") @ApiModelProperty(value = "审核反馈")
private String auditingFeedback; private String auditingFeedback;
@Transient
@ApiModelProperty(value = "装备List")
private List<DeviceLibrary> deviceLibraryEntities =new ArrayList<>();
} }
package com.tykj.dev.device.sendback.entity.domain;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Id;
/**
* @author zjm
* @version 1.0.0
* @ClassName DeviceRepel.java
* @Description
* @createTime 2021年01月10日 10:34:00
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@ApiModel("已清退装备信息")
public class RepelDeviceUnit {
@Id
private Integer id;
private Integer deviceId;
private Integer unitsId;
public RepelDeviceUnit(Integer deviceId, Integer unitsId) {
this.deviceId = deviceId;
this.unitsId = unitsId;
}
}
...@@ -2,9 +2,13 @@ package com.tykj.dev.device.sendback.entity.domain; ...@@ -2,9 +2,13 @@ package com.tykj.dev.device.sendback.entity.domain;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.device.sendback.entity.vo.ModelCount; import com.tykj.dev.device.sendback.entity.vo.ModelCount;
import com.tykj.dev.misc.base.BaseEntity;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.jpa.domain.support.AuditingEntityListener; import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Entity; import javax.persistence.Entity;
...@@ -24,53 +28,80 @@ import java.util.List; ...@@ -24,53 +28,80 @@ import java.util.List;
@Entity @Entity
@EntityListeners(AuditingEntityListener.class) @EntityListeners(AuditingEntityListener.class)
@ApiModel("清退统计维护") @ApiModel("清退统计维护")
public class RepelTaskStatistical { @NoArgsConstructor
@AllArgsConstructor
public class RepelTaskStatistical extends BaseEntity {
/** /**
* 数据id * 数据id
*/ */
@Id @Id
@ApiModelProperty(value = "数据id")
private Integer id; private Integer id;
/** /**
* repelId * repelId
*/ */
@ApiModelProperty(value = "业务id")
private Integer repelId; private Integer repelId;
/** /**
* 父类taskId * 父类taskId
*/ */
@ApiModelProperty(value = "父类taskId")
private Integer fatherTaskId; private Integer fatherTaskId;
/** /**
* taskId * taskId
*/ */
@ApiModelProperty(value = "任务id")
private Integer taskId; private Integer taskId;
/** /**
* 任务状态 * 任务状态 1.正常提交 2.延期 3.等待审核
*/ */
@ApiModelProperty(value = "任务状态 1.正常提交 2.延期 3.等待审核")
private Integer taskStatus; private Integer taskStatus;
/** /**
* 区域名称 * 区域名称
*/ */
@ApiModelProperty(value = "区域名称")
private String areaName; private String areaName;
/** /**
* 提交的型号和数量 json存储modelCount对象 * 提交的型号和数量 json存储modelCount对象
*/ */
@ApiModelProperty(value = "提交的型号和数量 json存储modelCount对象")
private String modelCount; private String modelCount;
/**
* 描述
*/
@ApiModelProperty(value = "描述")
private String des;
/** /**
* modelCount json转对象 不存数据库 * modelCount json转对象 不存数据库
*/ */
@ApiModelProperty(value = "modelCount json转对象 不存数据库")
@Transient @Transient
private List<ModelCount> modelCountList; private List<ModelCount> modelCountList;
public RepelTaskStatistical toModelCountList(){
modelCountList= JacksonUtil.readValue(modelCount,new TypeReference<List<ModelCount>>() { public RepelTaskStatistical(Integer repelId, Integer fatherTaskId, Integer taskId, Integer taskStatus, String areaName) {
}); this.repelId = repelId;
return this; this.fatherTaskId = fatherTaskId;
this.taskId = taskId;
this.taskStatus = taskStatus;
this.areaName = areaName;
} }
public RepelTaskStatistical(Integer repelId, Integer fatherTaskId, Integer taskId, Integer taskStatus, String areaName, String modelCount, String des) {
this.repelId = repelId;
this.fatherTaskId = fatherTaskId;
this.taskId = taskId;
this.taskStatus = taskStatus;
this.areaName = areaName;
this.modelCount = modelCount;
this.des = des;
}
} }
...@@ -3,6 +3,7 @@ package com.tykj.dev.device.sendback.entity.vo; ...@@ -3,6 +3,7 @@ package com.tykj.dev.device.sendback.entity.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* @author zjm * @author zjm
...@@ -13,6 +14,7 @@ import lombok.Data; ...@@ -13,6 +14,7 @@ import lombok.Data;
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor
@ApiModel("每个单位清退的类型-数量") @ApiModel("每个单位清退的类型-数量")
public class ModelCount { public class ModelCount {
/** /**
......
package com.tykj.dev.device.sendback.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.misc.base.BeanHelper;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName OrderOutData.java
* @Description TODO
* @createTime 2021年01月10日 09:43:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderOutData {
/**
* 申请文号
*/
@ApiModelProperty(value = "申请文号")
private String applyNumber;
/**
* 批复文号
*/
@ApiModelProperty(value = "批复文号")
private String replayNumber;
/**
* 发件单位
*/
@ApiModelProperty(value = "发件单位")
private String sendUnit;
/**
* 发件单位id
*/
@ApiModelProperty(value = "发件单位id")
private Integer sendUnitId;
/**
* 收件单位id
*/
@ApiModelProperty(value = "收件单位id")
private Integer receiveUnitId;
/**
* 收件单位
*/
@ApiModelProperty(value = "收件单位")
private String receiveUnit;
/**
* 配发时间
*/
@ApiModelProperty(value = "配发时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date sendTime=new Date();
/**
* 经办人
*/
@ApiModelProperty(value = "发件方id(A岗位)")
private Integer sendUserAId;
/**
* 经办人 名称
*/
@ApiModelProperty(value = "发件方名称(A岗位)")
private String sendUserAName;
/**
* 签发人
*/
@ApiModelProperty(value = "签发人(B岗位)")
private String sendUserBName;
/**
* 收件方 经办人
*/
@ApiModelProperty(value = "收件方id(A岗位)")
private Integer receiveUserAId;
/**
* 收件方 经办人名称
*/
@ApiModelProperty(value = "收件方名称(A岗位)")
private String receiveUserAName;
/**
* 收件方id(B岗位)
*/
@ApiModelProperty(value = "收件方名称(B岗位)")
private String receiveUserBName;
/**
* 收件方id(B岗位)
*/
@ApiModelProperty(value = "收件方id(B岗位)")
private Integer receiveUserBId;
/**
* 出库附件文件
*/
@ApiModelProperty(value = "出库附件文件")
private String outboundFile;
/**
* 清退单文件
*/
@ApiModelProperty(value = "清退单文件")
private String billFile;
/**
* 退回状态(1:退回待审核,2:退回审核失败,3:退回中,4:退回接收待审核,5:退回接收审核失败,6:退回成功)
*/
@ApiModelProperty(value = "退回状态(1:退回待审核,2:退回审核失败,3:退回中,4:退回接收待审核,5:退回接收审核失败,6:退回成功)")
private Integer sendBackStatus;
/**
* 退回装备数量
*/
@ApiModelProperty(value = "退回装备数量")
private Integer sendBackCount;
/**
* 已出库装备数量
*/
@ApiModelProperty(value = "已出库装备数量")
private Integer sendedCount;
/**
* 已接收装备数量
*/
@ApiModelProperty(value = "已接收装备数量")
private Integer receiveCount;
/**
* 出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配
*/
@ApiModelProperty(value = "出库检查详情(装备主键id+核对结果(0缺失1无误3新增,字符x作为分隔符)),例如x10x21x32x,意为主键id为1的装备缺失,为2的无误,为3的不匹配")
private String sendCheckDetail;
/**
* 出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条
*/
@ApiModelProperty(value = "出库检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条")
private String sendCheckResult;
/**
* Ǵ作为分隔符,维修装备的主键id加备注,例如x1Ǵ备注1Ǵx2Ǵ备注2Ǵx,意为id为1的装备在维修,备注为备注1,id为2的装备在维修,备注为备注2
*/
@ApiModelProperty(value = "Ǵ作为分隔符,维修装备的主键id加备注,例如x1Ǵ备注1Ǵx2Ǵ备注2Ǵx,意为id为1的装备在维修,备注为备注1,id为2的装备在维修,备注为备注2")
private String repairDeviceDetail;
public DeviceRepelDetail toTrainDetailsVo() {
ModelMapper mapper = BeanHelper.getUserMapper();
return mapper.map(this, DeviceRepelDetail.class);
}
}
package com.tykj.dev.device.sendback.entity.vo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName ResolveConfirm.java
* @Description 提交装备
* @createTime 2021年01月09日 16:29:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("清退出库表单")
public class ResolveConfirm {
/**
* 选中装备的id集合
*/
private List<Integer> devIds;
/**
* 提交描述
*/
private String des;
}
package com.tykj.dev.device.sendback.entity.vo;
import com.tykj.dev.device.file.entity.FileRet;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName StorageDeviceRepel.java
* @Description 入库参数对象
* @createTime 2021年01月10日 13:01:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("入库参数对象以及省本级、直属单位清退提交对象")
public class StorageDeviceRepel {
private List<FileRet> fileRets;
private List<Integer> deviceIds;
}
package com.tykj.dev.device.sendback.repository;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelDeviceUnit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelDeviceUnitDao.java
* @Description TODO
* @createTime 2021年01月10日 10:40:00
*/
public interface RepelDeviceUnitDao extends JpaRepository<RepelDeviceUnit, Integer>, JpaSpecificationExecutor<RepelDeviceUnit> {
List<RepelDeviceUnit> findAllByUnitsId(Integer unitId);
}
...@@ -8,4 +8,6 @@ import java.util.List; ...@@ -8,4 +8,6 @@ import java.util.List;
public interface RepelTaskStatisticalDao extends JpaRepository<RepelTaskStatistical, Integer>, JpaSpecificationExecutor<RepelTaskStatistical> { public interface RepelTaskStatisticalDao extends JpaRepository<RepelTaskStatistical, Integer>, JpaSpecificationExecutor<RepelTaskStatistical> {
List<RepelTaskStatistical> findAllByFatherTaskIdAndAndRepelId(Integer fatherId,Integer repelId); List<RepelTaskStatistical> findAllByFatherTaskIdAndAndRepelId(Integer fatherId,Integer repelId);
RepelTaskStatistical findByTaskIdAndAndRepelId(Integer taskId,Integer repelId);
} }
...@@ -15,4 +15,11 @@ public interface DeviceRepelDetailService { ...@@ -15,4 +15,11 @@ public interface DeviceRepelDetailService {
* @return 详情对象 * @return 详情对象
*/ */
DeviceRepelDetail findDeviceRepelDetail(Integer repelDetailId); DeviceRepelDetail findDeviceRepelDetail(Integer repelDetailId);
/**
* 根据清退详情id查询清退详情(不包括装备详情)
* @param repelDetailId 清退详情id
* @return 详情对象
*/
DeviceRepelDetail findDeviceRepelDetailNoDev(Integer repelDetailId);
} }
package com.tykj.dev.device.sendback.service; package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel; import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.vo.OrderOutData;
import com.tykj.dev.device.sendback.entity.vo.ResolveConfirm;
import com.tykj.dev.device.sendback.entity.vo.StorageDeviceRepel;
import java.util.List; import java.util.List;
...@@ -8,12 +11,12 @@ public interface RepelBusinessService { ...@@ -8,12 +11,12 @@ public interface RepelBusinessService {
/** /**
* 发起清退任务 * 发起清退任务
*/ */
void initiateRepel(DeviceRepel deviceRepel); void initiateRepel(DeviceRepel deviceRepel,Integer userId);
/** /**
* 市分解任务 * 市分解任务
*/ */
void resolveRepel(List<Integer> devIds,Integer taskId); void resolveRepel(DeviceRepel deviceRepel,Integer taskId,Integer userId);
/** /**
* 1。市提交装备提交装备信息,省进行确认 * 1。市提交装备提交装备信息,省进行确认
...@@ -22,7 +25,7 @@ public interface RepelBusinessService { ...@@ -22,7 +25,7 @@ public interface RepelBusinessService {
* 以及修改账单的详情把装备写入到实体中 * 以及修改账单的详情把装备写入到实体中
*/ */
void resolveConfirm(Integer taskId); void resolveConfirm(Integer taskId, ResolveConfirm resolveConfirm,Integer userId);
/** /**
* 省市审核需要清退装备信息 * 省市审核需要清退装备信息
...@@ -30,34 +33,39 @@ public interface RepelBusinessService { ...@@ -30,34 +33,39 @@ public interface RepelBusinessService {
* 市:同意则 区县出库流程,把装备送到市 * 市:同意则 区县出库流程,把装备送到市
* 不同意 统一添加备注 * 不同意 统一添加备注
*/ */
void resolveAudit(Integer taskId); void resolveAudit(Integer taskId,Integer type);
/** /**
* 清退装备待出库 装备出库任务 * 清退装备待出库 装备出库任务
* 出库操作 上传出库单 * 出库操作 上传出库单
*/ */
void sendBackOutCheck(Integer taskId,Integer userId); void sendBackOutCheck(Integer taskId, Integer userId, OrderOutData orderOutData);
/** /**
* 上级清退装备入库 * 上级清退装备入库
* todo * todo
*/ */
void storageDeviceRepel(Integer taskId); void storageDeviceRepel(Integer taskId, StorageDeviceRepel storageDeviceRepel);
/** /**
* 本级装备待清退提交 * 本级装备待清退提交
*/ */
void oneselfRepel(Integer taskId,List<Integer> devIds); void oneselfRepel(Integer taskId,StorageDeviceRepel storageDeviceRepel,Integer userId);
/** /**
* 省清退任待办结 需要打印清退清单 签字上传 * 省清退任待办结 需要打印清退清单 签字上传
*/ */
void provinceRepel(Integer taskId); void provinceRepel(Integer taskId);
/** /**
* * 市清退任待办结 需要打印清退清单 签字上传
*/ */
void cityRepelEnd(Integer taskId);
} }
package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.RepelDeviceUnit;
import java.util.List;
public interface RepelDeviceUnitService {
RepelDeviceUnit saveRepelDeviceUnit(RepelDeviceUnit repelDeviceUnit);
void saveAllRepelDeviceUnit(List<RepelDeviceUnit> repelDeviceUnits);
List<DeviceLibrary> findHasRepel(Integer unitId);
}
package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import java.util.List;
public interface RepelQueryService {
/**
* 省、市清退任务待各市提交查询接口
*/
List<RepelTaskStatistical> findRepelTaskStatisticals(Integer taskId,Integer billId);
/**
* 审核详情页面
* @param taskId 任务id
* @return 详情
*/
DeviceRepelDetail findDeviceRepelDetail(Integer taskId);
/**
* 通知页面的查询接口
*/
DeviceRepel findDeviceRepel(Integer taskId);
}
...@@ -16,4 +16,14 @@ public interface RepelTaskStatisticalService { ...@@ -16,4 +16,14 @@ public interface RepelTaskStatisticalService {
*/ */
List<RepelTaskStatistical> findAllRepelTaskStatistical(Integer fatherTaskId,Integer repelId); List<RepelTaskStatistical> findAllRepelTaskStatistical(Integer fatherTaskId,Integer repelId);
/**
* 集合添加清退任务统计数据
*/
void saveAllRepelTaskStatistical(List<RepelTaskStatistical> repelTaskStatisticalList);
/**
* 根据taskid,账单id查询对应的数据
*/
RepelTaskStatistical findRepelTaskStatistical(Integer taskId,Integer repelId);
} }
package com.tykj.dev.device.sendback.service.impl; package com.tykj.dev.device.sendback.service.impl;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail; import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.repository.DeviceRepelDetailDao; import com.tykj.dev.device.sendback.repository.DeviceRepelDetailDao;
import com.tykj.dev.device.sendback.service.DeviceRepelDetailService; import com.tykj.dev.device.sendback.service.DeviceRepelDetailService;
...@@ -9,7 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -9,7 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors;
/** /**
* @author zjm * @author zjm
...@@ -24,6 +29,9 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService { ...@@ -24,6 +29,9 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
@Autowired @Autowired
DeviceRepelDetailDao deviceRepelDetailDao; DeviceRepelDetailDao deviceRepelDetailDao;
@Autowired
DeviceLibraryDao deviceLibraryDao;
@Override @Override
public DeviceRepelDetail saveDeviceRepelDetail(DeviceRepelDetail deviceRepelDetail) { public DeviceRepelDetail saveDeviceRepelDetail(DeviceRepelDetail deviceRepelDetail) {
...@@ -33,6 +41,19 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService { ...@@ -33,6 +41,19 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
@Override @Override
public DeviceRepelDetail findDeviceRepelDetail(Integer repelDetailId) { public DeviceRepelDetail findDeviceRepelDetail(Integer repelDetailId) {
Optional<DeviceRepelDetail> optional = deviceRepelDetailDao.findById(repelDetailId);
if (optional.isPresent()){
DeviceRepelDetail deviceRepelDetail=optional.get();
deviceRepelDetail.setDeviceLibraryEntities(findInvoleDevice(deviceRepelDetail.getDeviceIds()));
return deviceRepelDetail;
}else {
log.info("[清退] 详情查看错误,id没有找到{}",repelDetailId);
throw new ApiException(ResponseEntity.status(500).body("清退详情id没有找到:"+repelDetailId));
}
}
@Override
public DeviceRepelDetail findDeviceRepelDetailNoDev(Integer repelDetailId) {
Optional<DeviceRepelDetail> optional = deviceRepelDetailDao.findById(repelDetailId); Optional<DeviceRepelDetail> optional = deviceRepelDetailDao.findById(repelDetailId);
if (optional.isPresent()){ if (optional.isPresent()){
return optional.get(); return optional.get();
...@@ -41,4 +62,14 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService { ...@@ -41,4 +62,14 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
throw new ApiException(ResponseEntity.status(500).body("清退详情id没有找到:"+repelDetailId)); throw new ApiException(ResponseEntity.status(500).body("清退详情id没有找到:"+repelDetailId));
} }
} }
private List<DeviceLibrary> findInvoleDevice(String involeDevice){
List<String> idStringList = Arrays.asList(involeDevice.split(","));
List<String> idListString = idStringList.stream().filter(list2->!list2.equals("")).collect(Collectors.toList());
System.out.println(idListString);
List<Integer> devIds = idListString.stream().map(Integer::parseInt).collect(Collectors.toList());
return deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(devIds);
}
} }
package com.tykj.dev.device.sendback.service.impl; package com.tykj.dev.device.sendback.service.impl;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel; import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.repository.DeviceRepelDao; import com.tykj.dev.device.sendback.repository.DeviceRepelDao;
import com.tykj.dev.device.sendback.service.DeviceRepelService; import com.tykj.dev.device.sendback.service.DeviceRepelService;
import com.tykj.dev.device.sendback.util.StringUtils;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.misc.exception.ApiException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors;
/** /**
* @author zjm * @author zjm
...@@ -23,6 +29,8 @@ import java.util.Optional; ...@@ -23,6 +29,8 @@ import java.util.Optional;
public class DeviceRepelServiceImpl implements DeviceRepelService { public class DeviceRepelServiceImpl implements DeviceRepelService {
@Autowired @Autowired
DeviceRepelDao deviceRepelDao; DeviceRepelDao deviceRepelDao;
@Autowired
UnitsService unitsService;
@Override @Override
public DeviceRepel saveDeviceRepel(DeviceRepel deviceRepel) { public DeviceRepel saveDeviceRepel(DeviceRepel deviceRepel) {
...@@ -33,7 +41,11 @@ public class DeviceRepelServiceImpl implements DeviceRepelService { ...@@ -33,7 +41,11 @@ public class DeviceRepelServiceImpl implements DeviceRepelService {
public DeviceRepel findDeviceRepel(Integer repelId) { public DeviceRepel findDeviceRepel(Integer repelId) {
Optional<DeviceRepel> optional = deviceRepelDao.findById(repelId); Optional<DeviceRepel> optional = deviceRepelDao.findById(repelId);
if (optional.isPresent()){ if (optional.isPresent()){
return optional.get(); DeviceRepel deviceRepel = optional.get();
deviceRepel.setFileRets(FilesUtil.stringFileToList(deviceRepel.getFiles()));
List<String> unitNames= unitsService.findAllByIdIn(StringUtils.stringToList(deviceRepel.getTaskScope())).stream().map(Units::getName).collect(Collectors.toList());
deviceRepel.setUnitNames(unitNames);
return deviceRepel;
}else { }else {
throw new ApiException(ResponseEntity.status(500).body("[清退] 未找到清退账单:"+repelId)); throw new ApiException(ResponseEntity.status(500).body("[清退] 未找到清退账单:"+repelId));
} }
......
package com.tykj.dev.device.sendback.service.impl;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.RepelDeviceUnit;
import com.tykj.dev.device.sendback.repository.RepelDeviceUnitDao;
import com.tykj.dev.device.sendback.service.RepelDeviceUnitService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelDeviceUnitServiceImpl.java
* @Description TODO
* @createTime 2021年01月10日 10:52:00
*/
@Service
@Slf4j
public class RepelDeviceUnitServiceImpl implements RepelDeviceUnitService {
@Autowired
RepelDeviceUnitDao repelDeviceUnitDao;
@Autowired
DeviceLibraryDao deviceLibraryDao;
@Override
public RepelDeviceUnit saveRepelDeviceUnit(RepelDeviceUnit repelDeviceUnit) {
return repelDeviceUnitDao.save(repelDeviceUnit);
}
@Override
public void saveAllRepelDeviceUnit(List<RepelDeviceUnit> repelDeviceUnits) {
repelDeviceUnitDao.saveAll(repelDeviceUnits);
}
@Override
public List<DeviceLibrary> findHasRepel(Integer unitId) {
List<Integer> ids= repelDeviceUnitDao.findAllByUnitsId(unitId).stream().map(RepelDeviceUnit::getDeviceId).collect(Collectors.toList());
return deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(ids);
}
}
package com.tykj.dev.device.sendback.service.impl;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import com.tykj.dev.device.sendback.service.*;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelQueryServiceImpl.java
* @Description 清退查询接口服务
* @createTime 2021年01月10日 15:30:00
*/
@Service
@Slf4j
public class RepelQueryServiceImpl implements RepelQueryService {
@Autowired
RepelTaskStatisticalService repelTaskStatisticalService;
@Autowired
DeviceRepelDetailService repelDetailService;
@Autowired
TaskService taskService;
@Autowired
DeviceRepelService deviceRepelService;
@Autowired
DeviceLibraryDao deviceLibraryDao;
@Override
public List<RepelTaskStatistical> findRepelTaskStatisticals(Integer taskId,Integer billId) {
DeviceRepelDetail deviceRepelDetail= repelDetailService.findDeviceRepelDetailNoDev(billId);
return repelTaskStatisticalService.findAllRepelTaskStatistical(taskId,deviceRepelDetail.getRepelId());
}
@Override
public DeviceRepelDetail findDeviceRepelDetail(Integer taskId) {
TaskBto taskBto= taskService.get(taskId);
return repelDetailService.findDeviceRepelDetail(taskBto.getBillId());
}
@Override
public DeviceRepel findDeviceRepel(Integer taskId) {
TaskBto taskBto= taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail= repelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId());
return deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
}
}
package com.tykj.dev.device.sendback.service.impl; package com.tykj.dev.device.sendback.service.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical; import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import com.tykj.dev.device.sendback.entity.vo.ModelCount;
import com.tykj.dev.device.sendback.repository.RepelTaskStatisticalDao; import com.tykj.dev.device.sendback.repository.RepelTaskStatisticalDao;
import com.tykj.dev.device.sendback.service.RepelTaskStatisticalService; import com.tykj.dev.device.sendback.service.RepelTaskStatisticalService;
import com.tykj.dev.misc.utils.JacksonUtil;
import jdk.nashorn.internal.ir.IfNode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -30,6 +34,26 @@ public class RepelTaskStatisticalServiceImpl implements RepelTaskStatisticalServ ...@@ -30,6 +34,26 @@ public class RepelTaskStatisticalServiceImpl implements RepelTaskStatisticalServ
@Override @Override
public List<RepelTaskStatistical> findAllRepelTaskStatistical(Integer fatherTaskId, Integer repelId) { public List<RepelTaskStatistical> findAllRepelTaskStatistical(Integer fatherTaskId, Integer repelId) {
return repelTaskStatisticalDao.findAllByFatherTaskIdAndAndRepelId(fatherTaskId,repelId).stream().map(RepelTaskStatistical::toModelCountList).collect(Collectors.toList()); List<RepelTaskStatistical> list= repelTaskStatisticalDao.findAllByFatherTaskIdAndAndRepelId(fatherTaskId,repelId);
list.forEach(
repelTaskStatistical ->{
if (repelTaskStatistical.getModelCount()!=null){
repelTaskStatistical.setModelCountList(JacksonUtil.readValue(repelTaskStatistical.getModelCount(),new TypeReference<List<ModelCount>>() {}));
}
}
);
return list;
}
@Override
public void saveAllRepelTaskStatistical(List<RepelTaskStatistical> repelTaskStatisticalList) {
repelTaskStatisticalDao.saveAll(repelTaskStatisticalList);
}
@Override
public RepelTaskStatistical findRepelTaskStatistical(Integer taskId, Integer repelId) {
return repelTaskStatisticalDao.findByTaskIdAndAndRepelId(taskId, repelId);
} }
} }
package com.tykj.dev.device.sendback.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zjm
* @version 1.0.0
* @ClassName StringUtils.java
* @Description TODO
* @createTime 2021年01月10日 16:20:00
*/
public class StringUtils {
public static String ListToString(List<Integer> idList){
StringBuffer stringBuffer=new StringBuffer();
idList.forEach(
i->stringBuffer.append(",").append(i)
);
return stringBuffer.toString();
}
public static List<Integer> stringToList(String idStirng){
if (idStirng!=null) {
List<String> idStringList = Arrays.asList(idStirng.split(","));
return idStringList.stream().filter(list2 -> !list2.equals("")).map(Integer::parseInt).collect(Collectors.toList());
}else {
return new ArrayList<>();
}
}
}
...@@ -72,6 +72,7 @@ public interface TaskService { ...@@ -72,6 +72,7 @@ public interface TaskService {
*/ */
TaskBto moveToSpecial(TaskBto taskBto, StatusEnum statusEnum, Integer userId); TaskBto moveToSpecial(TaskBto taskBto, StatusEnum statusEnum, Integer userId);
/** /**
* <p>业务进行到特殊状态</p> * <p>业务进行到特殊状态</p>
* <li>指定待办用户</li> * <li>指定待办用户</li>
......
package com.tykj.dev.device.user.subject.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.user.subject.service.GroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author zjm
* @version 1.0.0
* @ClassName GroupsController.java
* @Description TODO
* @createTime 2021年01月10日 14:52:00
*/
@RestController
@AutoDocument
@Api(tags = "组模块", description = "提供区域模块的接口")
@RequestMapping("/groups")
public class GroupsController {
@Autowired
GroupService groupService;
@GetMapping(value = "/findAll/{type}")
@ApiOperation(value = "组列表的查询", notes = "成功返回分类的权限对象")
public ResponseEntity findAll(@PathVariable Integer type){
return ResponseEntity.ok(groupService.findAll(type));
}
}
package com.tykj.dev.device.user.subject.dao;
import com.tykj.dev.device.user.subject.entity.Groups;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
public interface GroupDao extends JpaRepository<Groups, Integer>, JpaSpecificationExecutor<Groups> {
List<Groups> findAllByType(Integer type);
}
package com.tykj.dev.device.user.subject.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName Group.java
* @Description TODO
* @createTime 2021年01月09日 12:00:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
@ApiModel(value = "组对象", description = "组对象详细信息")
public class Groups {
/**
* 组id
*/
@Id
private Integer id;
/**
* 组的类型 1。单位组
*/
private Integer type;
/**
* 组的名称
*/
private String name;
/**
* 对应的组成员id ,分割
*/
private String memberId;
@Transient
private List<Integer> members;
}
...@@ -60,7 +60,9 @@ public class Units { ...@@ -60,7 +60,9 @@ public class Units {
private Integer idDel; private Integer idDel;
/** /**
* 序列号 * 序列号 1.在系统单位
* 2.省直属单位
* 3.省上级单位
*/ */
@ApiModelProperty(value = "序列号", name = "code", example = "12321L") @ApiModelProperty(value = "序列号", name = "code", example = "12321L")
private String code; private String code;
......
package com.tykj.dev.device.user.subject.service;
import com.tykj.dev.device.user.subject.entity.Groups;
import java.util.List;
public interface GroupService {
/**
* 添加分组
* @param group 组对象
*/
void saveGroup(Groups group);
/**
* 根据类型查询
* @param type 类型
* @return 组集合
*/
List<Groups> findAll(Integer type);
/**
* 根据id删除组
* @param id 组id
*/
void delectGroup(Integer id);
/**
* 根据id查询单位ID集合
* @param id 组id
*/
List<Integer> findGroup(Integer id);
}
...@@ -17,6 +17,8 @@ public interface UnitsService extends PublicService<Units> { ...@@ -17,6 +17,8 @@ public interface UnitsService extends PublicService<Units> {
Units findById(Integer unitId); Units findById(Integer unitId);
Units findbyName(String name);
/** /**
* 下级全部单位 * 下级全部单位
* @param leven 等级 * @param leven 等级
...@@ -81,13 +83,21 @@ public interface UnitsService extends PublicService<Units> { ...@@ -81,13 +83,21 @@ public interface UnitsService extends PublicService<Units> {
Units findByAreaId(Integer unitsId); Units findByAreaId(Integer unitsId);
/** /**
* 根据区域id查询下级级对象 * 根据单位id查询下级级对象
* *
* @param unitsId 单位id * @param unitsId 单位id
* @return 单位对象 * @return 单位对象
*/ */
List<Units> findBySubordinate(Integer unitsId); List<Units> findBySubordinate(Integer unitsId);
/**
* 根据单位id查询下级单位名称集合
*
* @param unitsId 单位id
* @return 单位对象
*/
List<String> findBySubordinateUnitName(Integer unitsId);
UnitsPage selectPage(Integer page, Integer size); UnitsPage selectPage(Integer page, Integer size);
...@@ -98,4 +108,9 @@ public interface UnitsService extends PublicService<Units> { ...@@ -98,4 +108,9 @@ public interface UnitsService extends PublicService<Units> {
*/ */
List<Units> findByUserIdUnitsTrainListVo(Integer unitsId); List<Units> findByUserIdUnitsTrainListVo(Integer unitsId);
} /**
* 根据id的集合查询单位集合
*/
List<Units> findAllByIdIn(List<Integer> ids);
}
...@@ -64,6 +64,15 @@ public interface UserService extends PublicService<User> { ...@@ -64,6 +64,15 @@ public interface UserService extends PublicService<User> {
*/ */
MemberThat findById(Integer userId); MemberThat findById(Integer userId);
/**
* 根据用户ID查询用户详情
*
* @param userId 用户id
* @return user
*/
User findByUser(Integer userId);
/** /**
* 根据用户ID查询下级所有用户 * 根据用户ID查询下级所有用户
* *
...@@ -128,4 +137,6 @@ public interface UserService extends PublicService<User> { ...@@ -128,4 +137,6 @@ public interface UserService extends PublicService<User> {
* 根据单位id查询 上级的用户id * 根据单位id查询 上级的用户id
*/ */
List<Integer> findAllLastUserids(Integer userId); List<Integer> findAllLastUserids(Integer userId);
} }
package com.tykj.dev.device.user.subject.service.impl;
import com.tykj.dev.device.user.subject.dao.GroupDao;
import com.tykj.dev.device.user.subject.entity.Groups;
import com.tykj.dev.device.user.subject.service.GroupService;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zjm
* @version 1.0.0
* @ClassName GroupServiceImpl.java
* @Description TODO
* @createTime 2021年01月09日 12:16:00
*/
@Service
@Slf4j
public class GroupServiceImpl implements GroupService {
@Autowired
GroupDao groupDao;
@Override
public void saveGroup(Groups group) {
StringBuffer stringBuffer=new StringBuffer();
group.getMembers().forEach(
integer -> stringBuffer.append(",").append(integer)
);
group.setMemberId(stringBuffer.toString());
groupDao.save(group);
}
@Override
public List<Groups> findAll(Integer type) {
List<Groups> list= groupDao.findAllByType(type);
list.forEach(groups -> groups.setMembers(integerList(groups.getMemberId())));
return list;
}
private List<Integer> integerList(String ids){
List<String> idStringList = Arrays.asList(ids.split(","));
return idStringList.stream().filter(list2->!list2.equals("")).map(Integer::parseInt).collect(Collectors.toList());
}
@Override
public void delectGroup(Integer id) {
groupDao.deleteById(id);
}
@Override
public List<Integer> findGroup(Integer id) {
Groups group= groupDao.findById(id).get();
return Arrays.asList(group.getMemberId().substring(2).split(",")).stream().map(Integer::parseInt).collect(Collectors.toList());
}
}
...@@ -42,6 +42,11 @@ public class UnitsServiceImpl implements UnitsService { ...@@ -42,6 +42,11 @@ public class UnitsServiceImpl implements UnitsService {
return unit.orElse(null); return unit.orElse(null);
} }
@Override
public Units findbyName(String name) {
return unitsDao.findByName(name);
}
@Override @Override
public List<Units> findListById(Integer leven) { public List<Units> findListById(Integer leven) {
return unitsDao.findAllByLevel(leven); return unitsDao.findAllByLevel(leven);
...@@ -200,6 +205,18 @@ public class UnitsServiceImpl implements UnitsService { ...@@ -200,6 +205,18 @@ public class UnitsServiceImpl implements UnitsService {
return unitsDao.findAllByAreaIdIn(areaIds); return unitsDao.findAllByAreaIdIn(areaIds);
} }
@Override
public List<String> findBySubordinateUnitName(Integer unitsId) {
Units units = unitsDao.findById(unitsId).get();
List<Integer> areaIds= areaDao.findAllByFatherId(units.getAreaId()).stream().map(Area::getId).collect(Collectors.toList());
List<String> list=new ArrayList<>();
list.add(units.getName());
unitsDao.findAllByAreaIdIn(areaIds).forEach(
units1 -> list.add(units1.getName())
);
return list;
}
@Override @Override
public UnitsPage selectPage(Integer page, Integer size) { public UnitsPage selectPage(Integer page, Integer size) {
Pageable pageable = PageRequest.of(page, size, Sort.Direction.ASC, "level"); Pageable pageable = PageRequest.of(page, size, Sort.Direction.ASC, "level");
...@@ -245,6 +262,11 @@ public class UnitsServiceImpl implements UnitsService { ...@@ -245,6 +262,11 @@ public class UnitsServiceImpl implements UnitsService {
} }
} }
@Override
public List<Units> findAllByIdIn(List<Integer> ids) {
return unitsDao.findAllById(ids);
}
@Override @Override
public Units save(Units units) { public Units save(Units units) {
......
package com.tykj.dev.device.user.subject.service.impl;
import com.tykj.dev.device.user.base.ret.UserDateScreen;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserDataScreenService;
import jdk.nashorn.internal.ir.IfNode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zjm
* @version 1.0.0
* @ClassName UserDataScreenServiceImpl.java
* @Description TODO
* @createTime 2020年12月14日 09:50:00
*/
@Service
@Slf4j
public class UserDataScreenServiceImpl implements UserDataScreenService {
@Autowired
UserDao userDao;
@Autowired
UnitsDao unitsDao;
@Override
public List<UserDateScreen> selectUserDataScreen() {
List<UserDateScreen> list=new ArrayList<>();
Map<Integer,UserDateScreen> map=new HashMap<>();
List<Integer> levels=new ArrayList<>();
levels.add(1);
levels.add(2);
List<Integer> unitIds= unitsDao.findAllByLevelIn(levels).stream().map(Units::getUnitId).collect(Collectors.toList());
List<User> users= userDao.findAllByUnitsIdIn(unitIds);
users.forEach(
user -> {
UserDateScreen userDateScreen=new UserDateScreen();
if (map.containsKey(user.getUnitsId())){
userDateScreen=map.get(user.getUnitsId());
}
switch (user.getTrainStatus()){
case 0:
userDateScreen.setHadBeenTraining(userDateScreen.getHadBeenTraining()+1);
break;
case 1:
userDateScreen.setExpired(userDateScreen.getExpired()+1);
break;
case 2:
userDateScreen.setNoTraining(userDateScreen.getNoTraining()+1);
break;
case 3:
userDateScreen.setHadBeenTraining(userDateScreen.getHadBeenTraining()+1);
break;
default:
log.info("[用户] 未找到对应的培训状态{}",user.getTrainStatus());
}
map.put(user.getUnitsId(),userDateScreen);
}
);
for (Integer unitId:map.keySet()){
Units units= unitsDao.findById(unitId).get();
UserDateScreen userDateScreen=map.get(unitId);
userDateScreen.setUnitName(units.getName());
list.add(userDateScreen);
}
return list;
}
}
...@@ -281,6 +281,16 @@ public class UserServiceImpl implements UserService { ...@@ -281,6 +281,16 @@ public class UserServiceImpl implements UserService {
return memberThat; return memberThat;
} }
@Override
public User findByUser(Integer userId) {
Optional<User> optionalUser = userDao.findById(userId);
if (optionalUser.isPresent()){
return optionalUser.get();
}else {
throw new ApiException(ResponseEntity.status(500).body("[用户] 没有找到对应的id"+userId));
}
}
@Override @Override
public List<User> findSubordinate(Integer userId) { public List<User> findSubordinate(Integer userId) {
Integer unitsId = userDao.findById(userId).get().getUnitsId(); Integer unitsId = userDao.findById(userId).get().getUnitsId();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论