提交 70f3cd01 authored 作者: 133's avatar 133

清退

上级 a5275b5b
......@@ -15,7 +15,7 @@ import java.util.List;
*/
public class FilesUtil {
public static List<FileRet> stringFileToList(String fileString){
if (fileString!=null) {
if (fileString!=null && !"".equals(fileString)) {
List<FileRet> fileRetList = new ArrayList<>();
String[] fileRets = fileString.substring(3).split("<\\*>");
List<String> strings = Arrays.asList(fileRets);
......@@ -38,7 +38,7 @@ public class FilesUtil {
public static String stringFileToList(List<FileRet> fileRets){
StringBuffer fileString = new StringBuffer();
fileRets.forEach(
fileRets.forEach(
fileRet -> fileString.append("<*>").append(fileRet.getName())
.append(",")
.append(fileRet.getFilePath())
......
......@@ -60,5 +60,7 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
boolean existsAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames);
List<DeviceLibrary> findAllByPackingIdInAndOwnUnit(List<Integer> packingIds,String unitNames);
List<DeviceLibrary> findAllByOwnUnitAndLocationUnitAndLifeStatus(String ownUnitName,String locationUnitName,Integer status);
}
......@@ -73,6 +73,9 @@ public enum StatusEnum {
SEND_BACK_1207(1207, "清退装备等待审核确认"),
SEND_BACK_1208(1208, "清退装备等待出库"),
SEND_BACK_1209(1209, "清退装备等待入库"),
SEND_BACK_1210(1210, "省清退送往中办等待回执单"),
SEND_BACK_1211(1211, "市发清退任务待省审核"),
// SEND_BACK_1204(1204, "入库待审核"),
......
......@@ -3,6 +3,7 @@ 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.RepelAuditResult;
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;
......@@ -65,9 +66,9 @@ public class RepelDevController {
* 审核接口
*/
@ApiOperation(value = "清退代办业务审核接口", notes = "清退代办业务审核接口")
@PostMapping(value ="/resolveAudit/{type}/{taskId}")
public ResponseEntity resolveAudit(@PathVariable Integer taskId, @PathVariable Integer type){
repelBusinessService.resolveAudit(taskId,type);
@PostMapping(value ="/resolveAudit/{taskId}")
public ResponseEntity resolveAudit(@PathVariable Integer taskId, @RequestBody RepelAuditResult repelAuditResult){
repelBusinessService.resolveAudit(taskId,repelAuditResult);
return ResponseEntity.ok("审核成功");
}
......@@ -95,4 +96,55 @@ public class RepelDevController {
}
/**
* 省本级清退任务
*/
@ApiOperation(value = "省本级清退任务", notes = "省本级清退任务")
@PostMapping(value ="/oneselfRepel/{taskId}/{userId}")
public ResponseEntity oneselfRepel(@PathVariable Integer taskId, @RequestBody StorageDeviceRepel storageDeviceRepel, @PathVariable Integer userId){
repelBusinessService.oneselfRepel(taskId, storageDeviceRepel, userId);
return ResponseEntity.ok("入库任务");
}
/**
* 省清退中办
*/
@ApiOperation(value = "省清退中办", notes = "省清退中办")
@PostMapping(value ="/provinceSendOutSuperior/{userId}")
public ResponseEntity provinceSendOutSuperior(@PathVariable Integer userId, @RequestBody OrderOutData orderOutData){
repelBusinessService.provinceSendOutSuperior(userId,orderOutData);
return ResponseEntity.ok("省清退中办发起成功,等待回执单");
}
/**
* 省上传中办回执单
*/
@ApiOperation(value = "省上传中办回执单", notes = "省上传中办回执单")
@PostMapping(value ="/receiptSingle/{taskId}")
public ResponseEntity receiptSingle(@PathVariable Integer taskId, @RequestBody StorageDeviceRepel storageDeviceRepel){
repelBusinessService.receiptSingle(taskId,storageDeviceRepel);
return ResponseEntity.ok("省上传中办回执单,成功任务结束");
}
/**
* 市发起清退任务
*/
@ApiOperation(value = "市发起清退任务", notes = "市发起清退任务")
@PostMapping(value ="/receiptSingle/{userId}")
public ResponseEntity receiptSingle(@PathVariable Integer userId, @RequestBody DeviceRepel deviceRepel){
repelBusinessService.cityInitiateRepel(deviceRepel,userId);
return ResponseEntity.ok("省上传中办回执单,成功任务结束");
}
/**
* 省审核市清退任务
*/
@ApiOperation(value = "省审核市清退任务", notes = "省审核市清退任务")
@PostMapping(value ="/receiptSingle/{taskId}/{userId}")
public ResponseEntity receiptSingle(@PathVariable Integer taskId,@PathVariable Integer userId, @RequestBody RepelAuditResult repelAuditResult){
repelBusinessService.provinceAuditCity(taskId,userId,repelAuditResult);
return ResponseEntity.ok("省上传中办回执单,成功任务结束");
}
}
......@@ -54,4 +54,22 @@ public class RepelQueryController {
public ResponseEntity findDeviceSendOut(@PathVariable Integer taskId){
return ResponseEntity.ok(repelQueryService.findDeviceSendOut(taskId));
}
/**
* 待清退列表
*/
@GetMapping(value ="/toRepelList/{unitName}")
@ApiOperation(value = "待清退列表", notes = "待清退列表")
public ResponseEntity toRepelList(@PathVariable String unitName){
return ResponseEntity.ok(repelQueryService.toRepelList(unitName));
}
/**
* 已清退列表
*/
@GetMapping(value ="/clearedList/{unitId}")
@ApiOperation(value = "已清退列表", notes = "待清退列表")
public ResponseEntity clearedList(@PathVariable Integer unitId){
return ResponseEntity.ok(repelQueryService.clearedList(unitId));
}
}
......@@ -78,6 +78,21 @@ public class DeviceRepel extends BaseEntity {
@ApiModelProperty(value = "清退状态 1。全量清退 2。部分清退")
private Integer repelStatus;
/**
* 发起人名称
*/
private String initiateName;
/**
* 发起单位
*/
private String unitName;
/**
* 发起单位id
*/
private Integer unitId;
/**
* 类型集合多个列装id
* 页面类型
......
......@@ -175,13 +175,8 @@ public class DeviceRepelDetail extends BaseEntity {
*/
@ApiModelProperty(value = "接收方检查结果(缺失数量x新增数量),例如1x1,意为缺失1台,新增一条")
private String receiveCheckResult;
/**
* Ǵ作为分隔符,维修装备的主键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;
@ApiModelProperty(value = "装备id")
@ApiModelProperty(value = "装备id集合")
private String deviceIds;
@ApiModelProperty(value = "发件单位签章id")
......
package com.tykj.dev.device.sendback.entity.domain;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Id;
import javax.persistence.*;
/**
* @author zjm
......@@ -17,10 +17,13 @@ import javax.persistence.Id;
*/
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@EntityListeners(AuditingEntityListener.class)
@ApiModel("已清退装备信息")
public class RepelDeviceUnit {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private Integer deviceId;
......@@ -31,4 +34,28 @@ public class RepelDeviceUnit {
this.deviceId = deviceId;
this.unitsId = unitsId;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getDeviceId() {
return deviceId;
}
public void setDeviceId(Integer deviceId) {
this.deviceId = deviceId;
}
public Integer getUnitsId() {
return unitsId;
}
public void setUnitsId(Integer unitsId) {
this.unitsId = unitsId;
}
}
package com.tykj.dev.device.sendback.entity.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet;
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;
......@@ -147,12 +148,21 @@ public class OrderOutData {
private String sendCheckResult;
/**
* Ǵ作为分隔符,维修装备的主键id加备注,例如x1Ǵ备注1Ǵx2Ǵ备注2Ǵx,意为id为1的装备在维修,备注为备注1,id为2的装备在维修,备注为备注2
* 装备id集合
*/
@ApiModelProperty(value = "Ǵ作为分隔符,维修装备的主键id加备注,例如x1Ǵ备注1Ǵx2Ǵ备注2Ǵx,意为id为1的装备在维修,备注为备注1,id为2的装备在维修,备注为备注2")
private String repairDeviceDetail;
@ApiModelProperty(value = "涉及装备的id集合")
private List<Integer> devIds;
/**
* 出库附件文件
*/
@ApiModelProperty(value = "出库附件文件")
private List<FileRet> outboundFileList;
/**
* 清退单文件
*/
@ApiModelProperty(value = "清退单文件")
private List<FileRet> billFileList;
public DeviceRepelDetail toTrainDetailsVo() {
ModelMapper mapper = BeanHelper.getUserMapper();
......
package com.tykj.dev.device.sendback.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelAuditResult.java
* @Description TODO
* @createTime 2021年01月11日 17:36:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RepelAuditResult {
/**
* 审核结果
*/
@ApiModelProperty(value = "审核结果 1。通过 2。驳回")
private Integer type;
/**
* 描述
*/
@ApiModelProperty(value = "des")
private String des;
}
package com.tykj.dev.device.sendback.entity.vo;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelStatisticsVo.java
* @Description 清退统计详情
* @createTime 2021年01月11日 16:53:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RepelStatisticsVo {
/**
* 发起人名称
*/
private String initiateName;
/**
* 截止时间
*/
private Date endTime;
/**
* 各下级单位清退任务情况
*/
private List<RepelTaskStatistical> repelTaskStatistical;
}
......@@ -2,10 +2,10 @@ package com.tykj.dev.device.sendback.service;
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.RepelAuditResult;
import com.tykj.dev.device.sendback.entity.vo.ResolveConfirm;
import com.tykj.dev.device.sendback.entity.vo.StorageDeviceRepel;
import java.util.List;
public interface RepelBusinessService {
/**
......@@ -18,6 +18,18 @@ public interface RepelBusinessService {
*/
void resolveRepel(DeviceRepel deviceRepel,Integer taskId,Integer userId);
/**
* 市发起清退任务
*/
void cityInitiateRepel(DeviceRepel deviceRepel,Integer userId);
/**
* 省审核市清退任务
*/
void provinceAuditCity(Integer taskId,Integer userId,RepelAuditResult repelAuditResult);
/**
* 1。市提交装备提交装备信息,省进行确认
* 2。区县提交装备信息,市进行确认
......@@ -40,7 +52,7 @@ public interface RepelBusinessService {
* 市:同意则 区县出库流程,把装备送到市
* 不同意 统一添加备注
*/
void resolveAudit(Integer taskId,Integer type);
void resolveAudit(Integer taskId, RepelAuditResult repelAuditResult);
/**
* 清退装备待出库 装备出库任务
......@@ -61,18 +73,34 @@ public interface RepelBusinessService {
*/
void oneselfRepel(Integer taskId,StorageDeviceRepel storageDeviceRepel,Integer userId);
// /**
// * 省直属单位装备清退
// */
// void provinceDirectlyUnder(Integer taskId,StorageDeviceRepel storageDeviceRepel,Integer userId);
/**
* 省清退任待办结 需要打印清退清单 签字上传
* 省\市清退任待办结 签字上传
*/
void provinceRepel(Integer taskId);
/**
* 市清退任待办结 需要打印清退清单 签字上传
*/
void cityRepelEnd(Integer taskId);
/**
* 生成省中办出库的任务
* @param userId 用户id
* @param orderOutData 出库对象
*/
void provinceSendOutSuperior(Integer userId, OrderOutData orderOutData);
/**
* 上传中办的回执单
* @param taskId 任务ID
* @param storageDeviceRepel 单据 和装备id对象
*/
void receiptSingle(Integer taskId, StorageDeviceRepel storageDeviceRepel);
}
......@@ -5,6 +5,7 @@ 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.entity.vo.DeviceChooseRepel;
import com.tykj.dev.device.sendback.entity.vo.RepelStatisticsVo;
import java.util.List;
......@@ -12,7 +13,7 @@ public interface RepelQueryService {
/**
* 省、市清退任务待各市提交查询接口
*/
List<RepelTaskStatistical> findRepelTaskStatisticals(Integer taskId,Integer billId);
RepelStatisticsVo findRepelTaskStatisticals(Integer taskId, Integer billId);
/**
......@@ -39,4 +40,15 @@ public interface RepelQueryService {
* 区县出库界面查询接口 根据taskid查询出库装备列表
*/
List<DeviceLibrary> findDeviceSendOut(Integer taskId);
/**
* 待清退列表 省
*/
List<DeviceLibrary> toRepelList(String unitName);
/**
* 已清退列表
*/
List<DeviceLibrary> clearedList(Integer unitId);
}
......@@ -69,7 +69,6 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
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);
}
}
......@@ -8,10 +8,7 @@ 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.RepelDeviceUnit;
import com.tykj.dev.device.sendback.entity.domain.RepelTaskStatistical;
import com.tykj.dev.device.sendback.entity.vo.ModelCount;
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.entity.vo.*;
import com.tykj.dev.device.sendback.service.*;
import com.tykj.dev.device.sendback.util.StringUtils;
import com.tykj.dev.device.task.service.TaskService;
......@@ -111,6 +108,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
directlUnderUnit.set(true);
}
}else {
deviceRepelDetail.setSendUnit(units1.getName());
deviceRepelDetail.setSendUnitId(units1.getUnitId());
if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(userId))){
TaskBto taskBto1= cityRepelTask(unisId,deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle(),taskBto.getId());
list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto1.getId(),null,area1.getName(),model,""));
......@@ -119,7 +118,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
);
deviceRepelDetail.setSendUnitId(units.getUnitId());
deviceRepelDetail.setSendUnit(units.getName());
if (directlUnderUnit.get()){
TaskBto taskBto1 = directlyUnderTask(units.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId());
list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto1.getId(),null,"省直属",model,""));
......@@ -164,6 +164,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
unisId->{
Units units1= unitsService.findById(userId);
Area area1=areaService.findByid(units1.getAreaId());
deviceRepelDetail.setSendUnit(units1.getName());
deviceRepelDetail.setSendUnitId(units1.getUnitId());
if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(userId))){
TaskBto taskBto1= countyRepelTask(unisId,deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle(),taskBto.getId());
list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto1.getId(),null,area1.getName(),model,""));
......@@ -177,7 +179,75 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
public void cityInitiateRepel(DeviceRepel deviceRepel, Integer userId) {
User user = userService.findByUser(userId);
Units units=unitsService.findById(user.getUnitsId());
Area area=areaService.findByid(units.getAreaId());
Units unitsFather= unitsService.findByAreaId(area.getFatherId());
deviceRepel.setFielding(StringUtils.ListToString(deviceRepel.getFieldingIds()));
deviceRepel.setTaskScope(StringUtils.ListToString(deviceRepel.getTaskScopes()));
deviceRepel.setFiles(FilesUtil.stringFileToList(deviceRepel.getFileRets()));
DeviceRepel deviceRepel1= deviceRepelService.saveDeviceRepel(deviceRepel);
DeviceRepelDetail deviceRepelDetail=new DeviceRepelDetail();
deviceRepelDetail.setRepelId(deviceRepel1.getId());
TaskBto taskBto= cityTotalTask(unitsFather.getUnitId(),deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle());
// repelTaskStatisticalService.saveRepelTaskStatistical(new RepelTaskStatistical(deviceRepel1.getId(),null,taskBto.getId(),null,area.getName()));
// Set<ModelCount> modelCounts=new HashSet<>();
// deviceRepel.getModels().forEach(i->{
// modelCounts.add(new ModelCount(i,0));
// });
// String model=JacksonUtil.toJSon(modelCounts);
// List<RepelTaskStatistical> list=new ArrayList<>();
// deviceRepel.getTaskScopes().forEach(
// unisId->{
// Units units1= unitsService.findById(userId);
// Area area1=areaService.findByid(units1.getAreaId());
// deviceRepelDetail.setSendUnit(units1.getName());
// deviceRepelDetail.setSendUnitId(units1.getUnitId());
// if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(userId))){
// TaskBto taskBto1= countyRepelTask(unisId,deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(),deviceRepel.getTitle(),null);
// list.add(new RepelTaskStatistical(deviceRepel1.getId(),taskBto.getId(),taskBto1.getId(),null,area1.getName(),model,""));
// }
//
// }
// );
// repelTaskStatisticalService.saveAllRepelTaskStatistical(list);
}
@Override
public void provinceAuditCity(Integer taskId, Integer userId,RepelAuditResult repelAuditResult) {
TaskBto taskBto=taskService.get(taskId);
if (repelAuditResult.getType()==1) {
DeviceRepelDetail deviceRepelDetail = deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
DeviceRepel deviceRepel = deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
Set<ModelCount> modelCounts = new HashSet<>();
deviceRepel.getModels().forEach(i -> {
modelCounts.add(new ModelCount(i, 0));
});
String model = JacksonUtil.toJSon(modelCounts);
List<RepelTaskStatistical> list = new ArrayList<>();
deviceRepel.getTaskScopes().forEach(
unisId -> {
Units units1 = unitsService.findById(userId);
Area area1 = areaService.findByid(units1.getAreaId());
deviceRepelDetail.setSendUnit(units1.getName());
deviceRepelDetail.setSendUnitId(units1.getUnitId());
if (deviceLibraryDao.existsAllByPackingIdInAndOwnUnitIn(deviceRepel.getFieldingIds(), unitsService.findBySubordinateUnitName(userId))) {
TaskBto taskBto1 = countyRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId());
list.add(new RepelTaskStatistical(deviceRepel.getId(), taskBto.getId(), taskBto1.getId(), null, area1.getName(), model, ""));
}
}
);
repelTaskStatisticalService.saveAllRepelTaskStatistical(list);
taskBto.setOwnUnit(deviceRepel.getUnitId());
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1204,-1);
}else {
taskService.moveToEnd(taskBto);
}
}
@Override
......@@ -207,7 +277,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
Map<String,Integer> map=new HashMap<>();
StringBuffer ids=new StringBuffer();
TaskBto taskBto= taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId());
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
List<DeviceLibrary> deviceLibraries=deviceLibraryDao.getDeviceLibraryEntitiesByIdIn(resolveConfirm.getDevIds());
deviceLibraries.forEach(
......@@ -238,14 +308,14 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
public void resolveAudit(Integer taskId,Integer type) {
public void resolveAudit(Integer taskId, RepelAuditResult repelAuditResult) {
TaskBto taskBto = taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
repelTaskStatistical.setTaskStatus(0);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
//1 审核通过
if (type==1){
if (repelAuditResult.getType()==1){
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1208,0);
}else {
//审核失败
......@@ -256,6 +326,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
);
deviceLibraryDao.saveAll(deviceLibraries);
}
deviceRepelDetail.setAuditingFeedback(repelAuditResult.getDes());
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
//检查上级任务是完成
// 修改当前任务的状态 清退提交装备待出库
......@@ -277,7 +349,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
orderOutDataRepelDetail.setRightSignatureId(UUID.randomUUID().toString());
deviceRepelDetailService.saveDeviceRepelDetail(orderOutDataRepelDetail);
taskBto.setOwnUnit(orderOutData.getReceiveUnitId());
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1208,0);
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1209,0);
//把一些字段填写到对象中,保存入库
//把任务状态修改为 清退提交装备待接收
}
......@@ -289,13 +361,20 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
DeviceRepelDetail deviceRepelDetail=deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
deviceRepelDetail.setBillFile(FilesUtil.stringFileToList(storageDeviceRepel.getFileRets()));
taskService.moveToEnd(taskBto);
//判断是否为 市提交 是则为在库
//否则为待清退
Integer inStock;
if (unitsService.findById(taskBto.getOwnUnit()).getLevel()==2){
inStock=2;
}else {
inStock=12;
}
List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds());
libraries.forEach(
deviceLibrary -> {
deviceLibrary.setLocationUnit(deviceRepelDetail.getReceiveUnit());
deviceLibrary.setOwnUnit(deviceRepelDetail.getReceiveUnit());
deviceLibrary.setLifeStatus(2);
deviceLibrary.setLifeStatus(inStock);
list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId()));
}
);
......@@ -329,7 +408,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
list.add(new RepelDeviceUnit(deviceLibrary.getId(),units1.getUnitId()));
deviceLibrary.setLocationUnit(units.getName());
deviceLibrary.setOwnUnit(units.getName());
deviceLibrary.setLifeStatus(2);
deviceLibrary.setLifeStatus(12);
ids.append(",").append(deviceLibrary.getId());
}
);
......@@ -343,9 +422,15 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
//把装备的状态都修改为待清退。
}
// @Override
// public void provinceDirectlyUnder(Integer taskId, StorageDeviceRepel storageDeviceRepel, Integer userId) {
//
// }
@Override
public void provinceRepel(Integer taskId) {
//需要上传清退单
taskService.moveToEnd(taskService.get(taskId));
}
@Override
......@@ -353,6 +438,40 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
taskService.moveToEnd(taskService.get(taskId));
}
@Override
public void provinceSendOutSuperior(Integer userId, OrderOutData orderOutData) {
User user = userService.findByUser(userId);
Units units=unitsService.findById(user.getUnitsId());
DeviceRepelDetail deviceRepelDetail=orderOutData.toTrainDetailsVo();
deviceRepelDetail.setDeviceIds(StringUtils.ListToString(orderOutData.getDevIds()));
deviceRepelDetail.setBillFile(FilesUtil.stringFileToList(orderOutData.getBillFileList()));
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
sendOutSuperior(units.getUnitId(),deviceRepelDetail.getId(),null);
}
@Override
public void receiptSingle(Integer taskId, StorageDeviceRepel storageDeviceRepel) {
List<RepelDeviceUnit> list=new ArrayList<>();
TaskBto taskBto= taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail=deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
deviceRepelDetail.setBillFile(FilesUtil.stringFileToList(storageDeviceRepel.getFileRets()));
taskService.moveToEnd(taskBto);
List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds());
libraries.forEach(
deviceLibrary -> {
deviceLibrary.setLocationUnit(deviceRepelDetail.getReceiveUnit());
deviceLibrary.setOwnUnit(deviceRepelDetail.getReceiveUnit());
deviceLibrary.setLifeStatus(2);
list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId()));
}
);
deviceLibraryDao.saveAll(libraries);
repelDeviceUnitService.saveAllRepelDeviceUnit(list);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
}
/**
* 生成区清退任务
......@@ -364,7 +483,23 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
*/
private TaskBto countyRepelTask(Integer unitId,Integer repelDetailId,String title,Integer parentTaskId){
//省清退任务待市提交
return taskService.start(new TaskBto(StatusEnum.SEND_BACK_1205.id, title, parentTaskId, ".", repelDetailId, BusinessEnum.SEND_BACK.id, unitId, 0, "", new ArrayList<>(0)));
List<Integer> list=new ArrayList<>();
list.add(0);
return taskService.start(new TaskBto(StatusEnum.SEND_BACK_1205.id, title, parentTaskId, ".", repelDetailId, BusinessEnum.SEND_BACK.id, unitId, 0, "", list));
}
/**
* 市发起清退
* @param unitId
* @param repelDetailId
* @param title
* @return
*/
private TaskBto cityInitiateTask(Integer unitId,Integer repelDetailId,String title){
//省清退任务待市提交
List<Integer> list=new ArrayList<>();
list.add(-1);
return taskService.start(new TaskBto(StatusEnum.SEND_BACK_1211.id, title, null, ".", repelDetailId, BusinessEnum.SEND_BACK_STATISTICAL.id, unitId, 0, "", list));
}
/**
......@@ -380,7 +515,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
list.add(-1);
return taskService.start(new TaskBto(StatusEnum.SEND_BACK_1204.id, title, null, ".", repelDetailId, BusinessEnum.SEND_BACK_STATISTICAL.id, unitId, 0, "", list));
}
// private String listIdsToString(List<Integer> idList){
// StringBuffer stringBuffer=new StringBuffer();
// idList.forEach(
......@@ -442,6 +576,20 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
return taskService.start(new TaskBto(StatusEnum.SEND_BACK_1203.id, "省本级装备清退", parentTaskId, ".", repelDetailId, BusinessEnum.SEND_BACK.id, unitId, 0, "", list));
}
/**
* 省出库中办 16
* @param unitId
* @param repelDetailId
* @param parentTaskId
* @return
*/
private TaskBto sendOutSuperior(Integer unitId, Integer repelDetailId, Integer parentTaskId){
List<Integer> list=new ArrayList<>();
list.add(0);
return taskService.start(new TaskBto(StatusEnum.SEND_BACK_1210.id, "省本级装备清退", parentTaskId, ".", repelDetailId, BusinessEnum.SEND_BACK.id, unitId, 0, "", list));
}
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());
......
......@@ -4,8 +4,9 @@ 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.entity.domain.RepelDeviceUnit;
import com.tykj.dev.device.sendback.entity.vo.DeviceChooseRepel;
import com.tykj.dev.device.sendback.entity.vo.RepelStatisticsVo;
import com.tykj.dev.device.sendback.service.*;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
......@@ -44,10 +45,13 @@ public class RepelQueryServiceImpl implements RepelQueryService {
@Autowired
UnitsService unitsService;
@Autowired
RepelDeviceUnitService deviceUnitService;
@Override
public List<RepelTaskStatistical> findRepelTaskStatisticals(Integer taskId,Integer billId) {
public RepelStatisticsVo findRepelTaskStatisticals(Integer taskId, Integer billId) {
DeviceRepelDetail deviceRepelDetail= repelDetailService.findDeviceRepelDetailNoDev(billId);
return repelTaskStatisticalService.findAllRepelTaskStatistical(taskId,deviceRepelDetail.getRepelId());
DeviceRepel deviceRepel=deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
return new RepelStatisticsVo(deviceRepel.getInitiateName(),deviceRepel.getTime(),repelTaskStatisticalService.findAllRepelTaskStatistical(taskId,deviceRepelDetail.getRepelId()));
}
@Override
......@@ -88,6 +92,17 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return findInvoleDevice(deviceRepelDetail.getDeviceIds());
}
@Override
public List<DeviceLibrary> toRepelList(String unitName) {
return deviceLibraryDao.findAllByOwnUnitAndLocationUnitAndLifeStatus(unitName,unitName,12);
}
@Override
public List<DeviceLibrary> clearedList(Integer unitId) {
return deviceUnitService.findHasRepel(unitId);
}
private List<DeviceLibrary> findInvoleDevice(String involeDevice){
List<String> idStringList = Arrays.asList(involeDevice.split(","));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论