提交 455477f5 authored 作者: 133's avatar 133

[清退] 添加无装备提交接口

上级 dfab5a5c
...@@ -194,6 +194,11 @@ public enum LogType { ...@@ -194,6 +194,11 @@ public enum LogType {
SEND_BACK_33(100023,SEND_BACK.id, SEND_BACK_1209.id,SEND_BACK_1220.id , "入库任务调用电子签章,等待审核"), SEND_BACK_33(100023,SEND_BACK.id, SEND_BACK_1209.id,SEND_BACK_1220.id , "入库任务调用电子签章,等待审核"),
SEND_BACK_34(100024,SEND_BACK.id, SEND_BACK_1220.id,SEND_BACK_1218.id , "入库任务调用电子签章审核通过,等待盖章入库"), SEND_BACK_34(100024,SEND_BACK.id, SEND_BACK_1220.id,SEND_BACK_1218.id , "入库任务调用电子签章审核通过,等待盖章入库"),
SEND_BACK_35(100025,SEND_BACK.id, SEND_BACK_1220.id,SEND_BACK_1209.id , "入库任务调用电子签章审核不通过,等待重新入库"), SEND_BACK_35(100025,SEND_BACK.id, SEND_BACK_1220.id,SEND_BACK_1209.id , "入库任务调用电子签章审核不通过,等待重新入库"),
SEND_BACK_36(100026,SEND_BACK.id, SEND_BACK_1207.id,END.id , "审核提交清退装备任务通过,本次任务无提交任何装备,任务结束"),
SEND_BACK_37(100027,SEND_BACK.id, SEND_BACK_1205.id,END.id , "本次提交任务无装备,任务结束"),
SEND_BACK_38(100028,SEND_BACK.id, SEND_BACK_1203.id,END.id , "本次提交任务无装备,任务结束"),
SEND_BACK_39(100029,SEND_BACK.id, SEND_BACK_1206.id,END.id , "本次提交任务无装备,任务结束"),
SEND_BACK_40(100030,SEND_BACK.id, SEND_BACK_1208.id,END.id , "本次提交任务无装备,任务结束"),
......
...@@ -172,4 +172,11 @@ public class RepelDevController { ...@@ -172,4 +172,11 @@ public class RepelDevController {
return ResponseEntity.status(303).body("test"); return ResponseEntity.status(303).body("test");
} }
@ApiOperation(value = "全部清退无装备办结接口", notes = "全部清退无装备办结接口")
@GetMapping(value ="/AllRepelNotDeviceSubmit/{taskId}")
public ResponseEntity AllRepelNotDeviceSubmit(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser,@PathVariable Integer taskId){
repelBusinessService.AllRepelNotDeviceSubmit(securityUser,taskId);
return ResponseEntity.ok("任务办结完成");
}
} }
...@@ -175,5 +175,9 @@ public class RepelQueryController { ...@@ -175,5 +175,9 @@ public class RepelQueryController {
return ResponseEntity.ok(repelQueryService.provinceDirectlyUnderDev(taskId)); return ResponseEntity.ok(repelQueryService.provinceDirectlyUnderDev(taskId));
} }
@PostMapping(value ="/judgeFieldingIsNotNormal")
@ApiOperation(value = "判断发起的列装是否需要提示接口", notes = "判断发起的列装是否需要提示接口")
public ResponseEntity provinceDirectlyUnderDevice(@RequestBody List<RepelFieldingVo> repelFieldingVoList){
return ResponseEntity.ok(repelQueryService.judgeFieldingIsNotNormal(repelFieldingVoList));
}
} }
...@@ -115,6 +115,11 @@ public class DeviceRepel extends BaseEntity { ...@@ -115,6 +115,11 @@ public class DeviceRepel extends BaseEntity {
@Column(name = "equipment_involving_unit",columnDefinition = "TEXT") @Column(name = "equipment_involving_unit",columnDefinition = "TEXT")
private String equipmentInvolvingUnit; private String equipmentInvolvingUnit;
/**
* 清退任务是否办结
*/
private Integer status=0;
/** /**
* 类型集合多个列装id * 类型集合多个列装id
* 页面类型 * 页面类型
...@@ -139,4 +144,5 @@ public class DeviceRepel extends BaseEntity { ...@@ -139,4 +144,5 @@ public class DeviceRepel extends BaseEntity {
@ApiModelProperty(value = "涉及型号集合 添加填写") @ApiModelProperty(value = "涉及型号集合 添加填写")
private List<String> models; private List<String> models;
} }
...@@ -182,8 +182,8 @@ public class DeviceRepelDetail extends BaseEntity { ...@@ -182,8 +182,8 @@ public class DeviceRepelDetail extends BaseEntity {
@Column(name = "auditing_feedback",columnDefinition = "TEXT") @Column(name = "auditing_feedback",columnDefinition = "TEXT")
private String auditingFeedback; private String auditingFeedback;
@ApiModelProperty(value = "清退状态",name = "1.清退中,2.清退完成") @ApiModelProperty(value = "清退状态",name = "1.清退中,2.清退完成 ,3.无装备清退完成")
private Integer repelStatus; private Integer repelStatus=1;
@ApiModelProperty(value = "清退单据类型",name = "1.出入库,2.直属 3.本级") @ApiModelProperty(value = "清退单据类型",name = "1.出入库,2.直属 3.本级")
private Integer repelType=1; private Integer repelType=1;
......
package com.tykj.dev.device.sendback.entity.vo;
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 RepelFieldingPrompt.java
* @Description 清退判断是否有正在清退的列装信息是否存在正在清退的任务中
* @createTime 2021年04月28日 14:27:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("清退列装信息返回vo")
public class RepelFieldingPrompt {
@ApiModelProperty(value = "是否提示 true-是 false-否")
private boolean isNotPrompt;
@ApiModelProperty(value = "提示信息")
private String information;
}
package com.tykj.dev.device.sendback.entity.vo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName RepelFieldingVo.java
* @Description 清退判断列装是否正常的参数对象
* @createTime 2021年04月28日 15:16:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("清退判断列装是否正常的参数对象vo")
public class RepelFieldingVo {
private Integer id;
private String name;
private String model;
}
...@@ -2,6 +2,8 @@ package com.tykj.dev.device.sendback.service; ...@@ -2,6 +2,8 @@ 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 java.util.List;
public interface DeviceRepelService { public interface DeviceRepelService {
/** /**
* 添加账单 * 添加账单
...@@ -12,4 +14,9 @@ public interface DeviceRepelService { ...@@ -12,4 +14,9 @@ public interface DeviceRepelService {
* 根据账单id查询账单内容 * 根据账单id查询账单内容
*/ */
DeviceRepel findDeviceRepel(Integer repelId); DeviceRepel findDeviceRepel(Integer repelId);
/**
* 查询所有未完成的清退信息列表
*/
List<DeviceRepel> findNotEndDeviceRepel();
} }
...@@ -130,4 +130,13 @@ public interface RepelBusinessService { ...@@ -130,4 +130,13 @@ public interface RepelBusinessService {
*/ */
void directlyRetired(List<Integer> ids); void directlyRetired(List<Integer> ids);
/**
* 全部清退无装备提交调用接口
* 完成清退任务 修改清退统计表中的这条任务的状态
* 任务直接结束
*/
void AllRepelNotDeviceSubmit(SecurityUser securityUser,Integer taskId);
} }
...@@ -124,4 +124,8 @@ public interface RepelQueryService { ...@@ -124,4 +124,8 @@ public interface RepelQueryService {
DeviceRepelDetail findByBillIdDeviceRepelDetail(Integer repelId); DeviceRepelDetail findByBillIdDeviceRepelDetail(Integer repelId);
/**
* 判断发起的列装是否需要提示
*/
RepelFieldingPrompt judgeFieldingIsNotNormal(List<RepelFieldingVo> repelFieldingVoList);
} }
...@@ -85,6 +85,7 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService { ...@@ -85,6 +85,7 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
@Override @Override
public List<Integer> findYearAndUnitToDeviceList(Date time,Date endTime,Integer unitId) { public List<Integer> findYearAndUnitToDeviceList(Date time,Date endTime,Integer unitId) {
Set<Integer> libraries=new HashSet<>(); Set<Integer> libraries=new HashSet<>();
List<DeviceRepelDetail> list= deviceRepelDetailDao.findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus(time,endTime,unitId,2);
deviceRepelDetailDao.findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus(time,endTime,unitId,2).forEach( deviceRepelDetailDao.findAllBySendTimeBetweenAndSendUnitIdAndRepelStatus(time,endTime,unitId,2).forEach(
deviceRepelDetail -> libraries.addAll(StringUtils.stringToList(deviceRepelDetail.getDeviceIds())) deviceRepelDetail -> libraries.addAll(StringUtils.stringToList(deviceRepelDetail.getDeviceIds()))
); );
......
...@@ -52,4 +52,9 @@ public class DeviceRepelServiceImpl implements DeviceRepelService { ...@@ -52,4 +52,9 @@ public class DeviceRepelServiceImpl implements DeviceRepelService {
throw new ApiException(ResponseEntity.status(500).body("[清退] 未找到清退账单:"+repelId)); throw new ApiException(ResponseEntity.status(500).body("[清退] 未找到清退账单:"+repelId));
} }
} }
@Override
public List<DeviceRepel> findNotEndDeviceRepel() {
return deviceRepelDao.findAll().stream().filter(deviceRepel -> deviceRepel.getStatus()==0).collect(Collectors.toList());
}
} }
...@@ -175,7 +175,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -175,7 +175,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (supervisorMap.containsKey(units1.getUnitId())) { if (supervisorMap.containsKey(units1.getUnitId())) {
List<SupervisorVo> supervisorVoList1 = supervisorMap.get(units1.getUnitId()); List<SupervisorVo> supervisorVoList1 = supervisorMap.get(units1.getUnitId());
supervisorMap.put(units1.getUnitId(), supervisorVoList1); supervisorMap.put(units1.getUnitId(), supervisorVoList1);
} else { } else {
supervisorVoList.add(new SupervisorVo(units1.getName(), units1.getUnitId())); supervisorVoList.add(new SupervisorVo(units1.getName(), units1.getUnitId()));
supervisorMap.put(units1.getUnitId(), supervisorVoList); supervisorMap.put(units1.getUnitId(), supervisorVoList);
...@@ -213,7 +212,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -213,7 +212,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
Integer count=deviceLibraryService.countAllRepel(deviceRepel.getFieldingIds(),unitsService.findBySubordinateUnitName(units1.getUnitId()), seqNumbers,lifeStatus); Integer count=deviceLibraryService.countAllRepel(deviceRepel.getFieldingIds(),unitsService.findBySubordinateUnitName(units1.getUnitId()), seqNumbers,lifeStatus);
log.info("count 时间:{}",System.currentTimeMillis()-time); log.info("count 时间:{}",System.currentTimeMillis()-time);
if (count!=0) { if (count!=0) {
TaskBto taskBto1 = cityRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId(),userId); TaskBto taskBto1 = cityRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId(), userId);
list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), repelStatusJudgeCount(deviceRepel.getRepelStatus(),count), "")); list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), repelStatusJudgeCount(deviceRepel.getRepelStatus(),count), ""));
} }
} }
...@@ -427,12 +426,12 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -427,12 +426,12 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
list.add(StatusEnum.SEND_BACK_1206); list.add(StatusEnum.SEND_BACK_1206);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),list); TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),list);
StringBuffer ids=new StringBuffer();
DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId()); DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
TaskBto parentTask= taskService.get(taskBto.getParentTaskId()); TaskBto parentTask= taskService.get(taskBto.getParentTaskId());
taskService.moveToSpecial(parentTask, GlobalMap.getStatusEnumMap().get(parentTask.getBillStatus()),0); taskService.moveToSpecial(parentTask, GlobalMap.getStatusEnumMap().get(parentTask.getBillStatus()),0);
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1207,-1); taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1207,-1);
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId()); RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
repelTaskStatistical.setCount(StringUtils.stringToList(deviceRepelDetail.getDeviceIds()).size());
repelTaskStatistical.setTaskStatus(3); repelTaskStatistical.setTaskStatus(3);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical); repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
...@@ -493,7 +492,13 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -493,7 +492,13 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical); repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
//1 审核通过 //1 审核通过
if (repelAuditResult.getType()==1){ if (repelAuditResult.getType()==1){
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1208,0); List<Integer> list= StringUtils.stringToList(deviceRepelDetail.getDeviceIds());
if (list!=null&&list.size()!=0) {
taskService.moveToSpecial(taskBto, StatusEnum.SEND_BACK_1208, 0);
}else {
taskBto = taskService.moveToEnd(taskBto);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"清退任务审核通过,无提交装备任务结束",findUnitId(taskBto.getOwnUnit())));
}
}else { }else {
//审核失败 //审核失败
taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1206,0); taskService.moveToSpecial(taskBto,StatusEnum.SEND_BACK_1206,0);
...@@ -808,7 +813,10 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -808,7 +813,10 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
enumList.add(StatusEnum.SEND_BACK_1212); enumList.add(StatusEnum.SEND_BACK_1212);
enumList.add(StatusEnum.SEND_BACK_1204); enumList.add(StatusEnum.SEND_BACK_1204);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),enumList); TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),enumList);
taskService.moveToEnd(taskService.get(taskId)); taskService.moveToEnd(taskService.get(taskId));
DeviceRepel deviceRepel= deviceRepelService.findDeviceRepel(taskBto.getBillId());
deviceRepel.setStatus(1);
deviceRepelService.saveDeviceRepel(deviceRepel);
} }
@Override @Override
...@@ -846,6 +854,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -846,6 +854,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}else { }else {
deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(filterTypeReturnLeftStatus(deviceRepel.getType()), deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds())); deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(filterTypeReturnLeftStatus(deviceRepel.getType()), deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
} }
deviceRepelDetail.setRepelStatus(2);
TaskBto fatherTask=taskService.get(taskBto.getParentTaskId()); TaskBto fatherTask=taskService.get(taskBto.getParentTaskId());
taskService.moveToEnd(fatherTask); taskService.moveToEnd(fatherTask);
DeviceRepelDetail deviceRepelDetailFather= deviceRepelDetailService.findDeviceRepelDetail(fatherTask.getBillId()); DeviceRepelDetail deviceRepelDetailFather= deviceRepelDetailService.findDeviceRepelDetail(fatherTask.getBillId());
...@@ -877,6 +886,32 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -877,6 +886,32 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
//任务完结 //任务完结
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.REPEL.id,ids); deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.REPEL.id,ids);
}
@Override
public void AllRepelNotDeviceSubmit(SecurityUser securityUser, Integer taskId) {
TaskBto taskBto= taskService.get(taskId);
List<StatusEnum> enumList=new ArrayList<>();
enumList.add(StatusEnum.SEND_BACK_1205);
enumList.add(StatusEnum.SEND_BACK_1203);
enumList.add(StatusEnum.SEND_BACK_1206);
enumList.add(StatusEnum.SEND_BACK_1208);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),enumList);
DeviceRepelDetail deviceRepelDetail=deviceRepelDetailService.findDeviceRepelDetail(taskBto.getBillId());
deviceRepelDetail.setRepelStatus(3);
taskService.moveToEnd(taskBto);
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
repelTaskStatistical.setTaskStatus(1);
repelTaskStatistical.setCount(0);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
isEnd(taskBto,deviceRepelDetail.getRepelId());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"本单位无装备提交,完成了清退任务",gainThisUser(securityUser.getCurrentUserInfo().getUserId(),securityUser.getCurrentUserInfo().getUnitsId())));
} }
...@@ -977,6 +1012,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -977,6 +1012,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
} }
/** /**
* 清退出库等待上传回执单 * 清退出库等待上传回执单
* @param unitId * @param unitId
......
...@@ -3,10 +3,8 @@ package com.tykj.dev.device.sendback.service.impl; ...@@ -3,10 +3,8 @@ package com.tykj.dev.device.sendback.service.impl;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceVo;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo; import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
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.domain.DeviceRepelDetail; import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
...@@ -14,13 +12,11 @@ import com.tykj.dev.device.sendback.entity.vo.*; ...@@ -14,13 +12,11 @@ import com.tykj.dev.device.sendback.entity.vo.*;
import com.tykj.dev.device.sendback.service.*; import com.tykj.dev.device.sendback.service.*;
import com.tykj.dev.device.task.service.TaskService; import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.entity.SecurityUser;
import com.tykj.dev.device.user.subject.entity.Units; import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.service.UnitsService; import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.misc.base.BusinessEnum; import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.DeviceLifeStatus; import com.tykj.dev.misc.base.DeviceLifeStatus;
import com.tykj.dev.misc.base.StatusEnum; import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.DeviceSeqUtil; import com.tykj.dev.misc.utils.DeviceSeqUtil;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.PageUtil; import com.tykj.dev.misc.utils.PageUtil;
...@@ -29,12 +25,12 @@ import lombok.extern.slf4j.Slf4j; ...@@ -29,12 +25,12 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specification;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -489,7 +485,7 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -489,7 +485,7 @@ public class RepelQueryServiceImpl implements RepelQueryService {
//unitId为空,默认查询当前单位 //unitId为空,默认查询当前单位
List<Integer> ids= repelDetailService.findYearAndUnitToDeviceList(new Date(repelManagementVo.getTime()),new Date(repelManagementVo.getEndTime()),repelManagementVo.getUnitId()); List<Integer> ids= repelDetailService.findYearAndUnitToDeviceList(new Date(repelManagementVo.getTime()),new Date(repelManagementVo.getEndTime()),repelManagementVo.getUnitId());
if (ids!=null&&ids.size()!=0) { if (ids!=null&&ids.size()!=0) {
predicateBuilder.in("id", repelDetailService.findYearAndUnitToDeviceList(new Date(repelManagementVo.getTime()), new Date(repelManagementVo.getEndTime()), repelManagementVo.getUnitId()).toArray()); predicateBuilder.in("id", ids.toArray());
deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build()); deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build());
} }
Page<DeviceLibrary> page = PageUtil.getPerPage(repelManagementVo.getPage(), repelManagementVo.getSize(), deviceLibraries, repelManagementVo.getPageable()); Page<DeviceLibrary> page = PageUtil.getPerPage(repelManagementVo.getPage(), repelManagementVo.getSize(), deviceLibraries, repelManagementVo.getPageable());
...@@ -533,6 +529,31 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -533,6 +529,31 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return repelDetailService.findDeviceRepelDetailNoDev(repelId); return repelDetailService.findDeviceRepelDetailNoDev(repelId);
} }
@Override
public RepelFieldingPrompt judgeFieldingIsNotNormal(List<RepelFieldingVo> repelFieldingVoList) {
RepelFieldingPrompt repelFieldingPrompt=new RepelFieldingPrompt();
StringBuilder stringBuilder=new StringBuilder();
StringBuilder message=new StringBuilder();
message.append("以下列装信息:");
deviceRepelService.findNotEndDeviceRepel().forEach(
deviceRepel -> {
stringBuilder.append(",").append(deviceRepel.getFielding());
}
);
AtomicBoolean falg= new AtomicBoolean(false);
repelFieldingVoList.forEach(repelFieldingVo -> {
if (stringBuilder.indexOf(","+repelFieldingVo.getId()+",")!=-1){
message.append("(").append(repelFieldingVo.getModel()).append("-")
.append(repelFieldingVo.getName()).append(")");
falg.set(true);
}
});
message.append("已经存在于未完成的清退任务中,是否继续发起");
repelFieldingPrompt.setNotPrompt(falg.get());
repelFieldingPrompt.setInformation(message.toString());
return repelFieldingPrompt;
}
private Specification<DeviceLibrary> getRepelDeviceSpecificationIn(RepelManagementVo repelManagementVo) { private Specification<DeviceLibrary> getRepelDeviceSpecificationIn(RepelManagementVo repelManagementVo) {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(repelManagementVo); PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(repelManagementVo);
//unitId为空,默认查询当前单位 //unitId为空,默认查询当前单位
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论