提交 66ccd4bf authored 作者: 133's avatar 133

[清退 报废 销毁] 代码提交 清退代码修改 以及完结bug

上级 2f7a9b39
...@@ -76,4 +76,13 @@ public class DecommissioningQueryController { ...@@ -76,4 +76,13 @@ public class DecommissioningQueryController {
} }
/**
* 根据taskId查询业务详情
*/
@GetMapping(value ="/detail/{taskId}")
@ApiOperation(value = "根据taskId查询业务详情", notes = "根据taskId查询业务详情")
public ResponseEntity findDetail(@PathVariable Integer taskId){
return ResponseEntity.ok(deviceDecommissioningQueryService.findTaskIdDeviceDecommissioningDetail(taskId));
}
} }
package com.tykj.dev.device.decommissioning.service; package com.tykj.dev.device.decommissioning.service;
import com.tykj.dev.device.decommissioning.entity.DeviceDecommissioningDetail;
import com.tykj.dev.device.decommissioning.entity.vo.PagingVo; import com.tykj.dev.device.decommissioning.entity.vo.PagingVo;
import com.tykj.dev.device.decommissioning.entity.vo.RepelManagementVo; import com.tykj.dev.device.decommissioning.entity.vo.RepelManagementVo;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
...@@ -43,4 +44,9 @@ public interface DeviceDecommissioningQueryService { ...@@ -43,4 +44,9 @@ public interface DeviceDecommissioningQueryService {
*/ */
PagingVo retiredDeviceList(RepelManagementVo repelManagementVo); PagingVo retiredDeviceList(RepelManagementVo repelManagementVo);
/**
* 根据taskId查询退役业务详情
*/
DeviceDecommissioningDetail findTaskIdDeviceDecommissioningDetail(Integer taskId);
} }
package com.tykj.dev.device.decommissioning.service.impl; package com.tykj.dev.device.decommissioning.service.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.device.decommissioning.entity.DeviceDecommissioningDetail; import com.tykj.dev.device.decommissioning.entity.DeviceDecommissioningDetail;
import com.tykj.dev.device.decommissioning.repository.DeviceDecommissioningDetailDao; import com.tykj.dev.device.decommissioning.repository.DeviceDecommissioningDetailDao;
import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningDetailService; import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningDetailService;
import com.tykj.dev.device.file.service.FilesUtil; 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.ScriptSaveVo;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.StringSplitUtil; import com.tykj.dev.misc.utils.StringSplitUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -46,7 +49,8 @@ public class DeviceDecommissioningDetailServiceImpl implements DeviceDecommissio ...@@ -46,7 +49,8 @@ public class DeviceDecommissioningDetailServiceImpl implements DeviceDecommissio
Optional<DeviceDecommissioningDetail> optional = deviceDecommissioningDetailDao.findById(decommissioningId); Optional<DeviceDecommissioningDetail> optional = deviceDecommissioningDetailDao.findById(decommissioningId);
if (optional.isPresent()){ if (optional.isPresent()){
DeviceDecommissioningDetail deviceDecommissioningDetail=optional.get(); DeviceDecommissioningDetail deviceDecommissioningDetail=optional.get();
deviceDecommissioningDetail.setDeviceLibraryEntities(findInvoleDevice(deviceDecommissioningDetail.getDeviceIds())); deviceDecommissioningDetail.setScripts(JacksonUtil.readValue(deviceDecommissioningDetail.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() {
}));
deviceDecommissioningDetail.setBillFiles(FilesUtil.stringFileToList(deviceDecommissioningDetail.getBillFile())); deviceDecommissioningDetail.setBillFiles(FilesUtil.stringFileToList(deviceDecommissioningDetail.getBillFile()));
deviceDecommissioningDetail.setOutboundFiles(FilesUtil.stringFileToList(deviceDecommissioningDetail.getOutboundFile())); deviceDecommissioningDetail.setOutboundFiles(FilesUtil.stringFileToList(deviceDecommissioningDetail.getOutboundFile()));
deviceDecommissioningDetail.setInFiles(FilesUtil.stringFileToList(deviceDecommissioningDetail.getInFile())); deviceDecommissioningDetail.setInFiles(FilesUtil.stringFileToList(deviceDecommissioningDetail.getInFile()));
......
...@@ -2,8 +2,10 @@ package com.tykj.dev.device.decommissioning.service.impl; ...@@ -2,8 +2,10 @@ package com.tykj.dev.device.decommissioning.service.impl;
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.decommissioning.entity.DeviceDecommissioningDetail;
import com.tykj.dev.device.decommissioning.entity.vo.PagingVo; import com.tykj.dev.device.decommissioning.entity.vo.PagingVo;
import com.tykj.dev.device.decommissioning.entity.vo.RepelManagementVo; import com.tykj.dev.device.decommissioning.entity.vo.RepelManagementVo;
import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningDetailService;
import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningQueryService; import com.tykj.dev.device.decommissioning.service.DeviceDecommissioningQueryService;
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;
...@@ -46,6 +48,9 @@ public class DeviceDecommissioningQueryServiceImpl implements DeviceDecommission ...@@ -46,6 +48,9 @@ public class DeviceDecommissioningQueryServiceImpl implements DeviceDecommission
@Autowired @Autowired
DeviceLibraryDao deviceLibraryDao; DeviceLibraryDao deviceLibraryDao;
@Autowired
DeviceDecommissioningDetailService deviceDecommissioningDetailService;
@Override @Override
public List<TaskBto> findOutsideTheProvince() { public List<TaskBto> findOutsideTheProvince() {
List<TaskBto> taskBtoList; List<TaskBto> taskBtoList;
...@@ -105,6 +110,12 @@ public class DeviceDecommissioningQueryServiceImpl implements DeviceDecommission ...@@ -105,6 +110,12 @@ public class DeviceDecommissioningQueryServiceImpl implements DeviceDecommission
.size(repelManagementVo.getSize()).total((int)page.getTotalElements()).build(); .size(repelManagementVo.getSize()).total((int)page.getTotalElements()).build();
} }
@Override
public DeviceDecommissioningDetail findTaskIdDeviceDecommissioningDetail(Integer taskId) {
TaskBto taskBto=taskService.get(taskId);
return deviceDecommissioningDetailService.findDeviceDecommissioningDetail(taskBto.getBillId());
}
private Specification<DeviceLibrary> getRetiredSpecification(RepelManagementVo repelManagementVo) { private Specification<DeviceLibrary> getRetiredSpecification(RepelManagementVo repelManagementVo) {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(repelManagementVo); PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(repelManagementVo);
predicateBuilder.eq("lifeStatus", DeviceLifeStatus.RETIRE.id); predicateBuilder.eq("lifeStatus", DeviceLifeStatus.RETIRE.id);
......
...@@ -55,7 +55,6 @@ public class DeviceDestroyController { ...@@ -55,7 +55,6 @@ public class DeviceDestroyController {
/** /**
* 装备销毁对应的生命周期编号 * 装备销毁对应的生命周期编号
*/ */
private static final Integer DEVICE_DESTROY_LIFE_STATUS = 10;
private final DeviceDestroyBillService deviceDestroyBillService; private final DeviceDestroyBillService deviceDestroyBillService;
private final TaskService taskService; private final TaskService taskService;
private final DeviceLibraryService deviceLibraryService; private final DeviceLibraryService deviceLibraryService;
...@@ -253,7 +252,7 @@ public class DeviceDestroyController { ...@@ -253,7 +252,7 @@ public class DeviceDestroyController {
new FileVo("销毁单据", deviceDestroyBill.getDestroyFileName(), deviceDestroyBill.getDestroyFileUrl()) : null new FileVo("销毁单据", deviceDestroyBill.getDestroyFileName(), deviceDestroyBill.getDestroyFileUrl()) : null
); );
List<Integer> list = StringSplitUtil.split(deviceDestroyBill.getDestroyDeviceDetail()); List<Integer> list = StringSplitUtil.split(deviceDestroyBill.getDestroyDeviceDetail());
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.DESTROYED.id,list); deviceLibraryDao.upDateLeftStatusAndOwnUnitName(DeviceLifeStatus.DESTROYED.id,"",list);
for (Integer id : list) { for (Integer id : list) {
if (id > 0) { if (id > 0) {
//生成装备日志 //生成装备日志
......
...@@ -144,6 +144,10 @@ public class RfidServiceImpl implements RfidService { ...@@ -144,6 +144,10 @@ public class RfidServiceImpl implements RfidService {
"^LL264\n" + "^LL264\n" +
"^LS0\n" + "^LS0\n" +
"\n" + "\n" +
"^FS" +
"^RFW,H\n" +
"^FD"+content+"\n" +
"^FS" +
"^LH" + marginLeft + "," + marginTop + "\n" + "^LH" + marginLeft + "," + marginTop + "\n" +
// "^A1N,22,,E:SIM000.FNT^FR^FD\n" + // "^A1N,22,,E:SIM000.FNT^FR^FD\n" +
// "^LH"+marginLeft+",+"+marginTop + // "^LH"+marginLeft+",+"+marginTop +
......
package com.tykj.dev.device.scrap.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.scrap.service.ScrapBusinessService;
import com.tykj.dev.device.scrap.subject.vo.ScrapOrderOutData;
import com.tykj.dev.device.scrap.subject.vo.StorageScrap;
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("/scrapBusiness")
public class ScrapBusinessController {
@Autowired
ScrapBusinessService scrapBusinessService;
/**
* 省清退中办
*/
@ApiOperation(value = "省清退中办", notes = "省清退中办")
@PostMapping(value ="/provinceSendOutSuperior/{userId}")
public ResponseEntity provinceSendOutSuperior(@PathVariable Integer userId, @RequestBody ScrapOrderOutData scrapOrderOutData){
// repelBusinessService.provinceSendOutSuperior(userId,orderOutData);
return ResponseEntity.ok(scrapBusinessService.provinceScrap(userId,scrapOrderOutData));
}
/**
* 省上传中办回执单
*/
@ApiOperation(value = "省上传中办回执单", notes = "省上传中办回执单")
@PostMapping(value ="/receiptSingle/{taskId}")
public ResponseEntity receiptSingle(@PathVariable Integer taskId, @RequestBody StorageScrap storageScrap){
scrapBusinessService.receiptSingle(taskId,storageScrap);
return ResponseEntity.ok("省上传中办回执单,成功任务结束");
}
}
package com.tykj.dev.device.scrap.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.scrap.service.ScrapQueryService;
import com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo;
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("/scrapQuery")
public class ScrapQueryController {
@Autowired
ScrapQueryService scrapQueryService;
@GetMapping(value ="/detail/{taskId}")
@ApiOperation(value = "查询报废单据详情", notes = "查询报废单据详情")
public ResponseEntity clearedList4(@PathVariable Integer taskId){
return ResponseEntity.ok(scrapQueryService.findTaskId(taskId));
}
@PostMapping(value ="/listPage")
@ApiOperation(value = "分页查询报废清单", notes = "分页查询报废清单")
public ResponseEntity clearedList4(@RequestBody ScrapSelectVo scrapSelectVo){
return ResponseEntity.ok(scrapQueryService.findPageScrapList(scrapSelectVo));
}
}
package com.tykj.dev.device.scrap.service;
import com.tykj.dev.device.scrap.subject.domin.Scrap;
import com.tykj.dev.device.scrap.subject.vo.ScrapOrderOutData;
import com.tykj.dev.device.scrap.subject.vo.StorageScrap;
/**
* @author zjm
* @version 1.0.0
* @ClassName ScrapBusinessService.java
* @Description TODO
* @createTime 2021年03月31日 13:14:00
*/
public interface ScrapBusinessService {
/**
* 生成省中办报废的任务
* @param userId 用户id
* @param scrapOrderOutData 出库对象
*/
Scrap provinceScrap(Integer userId, ScrapOrderOutData scrapOrderOutData);
/**
* 报废上传中办的回执单
* @param taskId 任务ID
* @param storageScrap 单据 和装id对象
*/
void receiptSingle(Integer taskId, StorageScrap storageScrap);
}
package com.tykj.dev.device.scrap.service;
import com.tykj.dev.device.scrap.subject.domin.Scrap;
import com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo;
import org.springframework.data.domain.Page;
/**
* @author zjm
* @version 1.0.0
* @ClassName ScrapQueryService.java
* @Description TODO
* @createTime 2021年03月31日 14:13:00
*/
public interface ScrapQueryService {
Page<Scrap> findPageScrapList(ScrapSelectVo scrapSelectVo);
/**
* 根据taskId查询报废详情
* @param taskId 任务id
* @return 详情
*/
Scrap findTaskId(Integer taskId);
}
package com.tykj.dev.device.scrap.service; package com.tykj.dev.device.scrap.service;
import com.tykj.dev.device.scrap.subject.domin.Scrap; import com.tykj.dev.device.scrap.subject.domin.Scrap;
import com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo;
import org.springframework.data.domain.Page;
import java.util.List; import java.util.List;
...@@ -29,4 +31,6 @@ public interface ScrapService { ...@@ -29,4 +31,6 @@ public interface ScrapService {
* 查询所有的报废任务 * 查询所有的报废任务
*/ */
List<Scrap> findAll(); List<Scrap> findAll();
Page<Scrap> findPageScrapList(ScrapSelectVo scrapSelectVo);
} }
package com.tykj.dev.device.scrap.service.impl;
import com.tykj.dev.config.base.DeviceLifeStatus;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.domin.DeviceLog;
import com.tykj.dev.device.scrap.service.ScrapBusinessService;
import com.tykj.dev.device.scrap.service.ScrapService;
import com.tykj.dev.device.scrap.subject.domin.Scrap;
import com.tykj.dev.device.scrap.subject.vo.ScrapOrderOutData;
import com.tykj.dev.device.scrap.subject.vo.StorageScrap;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.subject.service.UserService;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.StringUtils;
import com.tykj.dev.misc.utils.TaskDisposeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
* @author zjm
* @version 1.0.0
* @ClassName ScrapBusinessServiceImpl.java
* @Description TODO
* @createTime 2021年03月31日 13:16:00
*/
@Service
public class ScrapBusinessServiceImpl implements ScrapBusinessService {
@Autowired
UserService userService;
@Autowired
UnitsService unitsService;
@Autowired
ScrapService scrapService;
@Autowired
DeviceLibraryDao deviceLibraryDao;
@Autowired
TaskService taskService;
@Autowired
DeviceLogService deviceLogService;
@Autowired
MessageService messageService;
@Override
public Scrap provinceScrap(Integer userId, ScrapOrderOutData scrapOrderOutData) {
User user = userService.findByUser(userId);
Units units=unitsService.findById(user.getUnitsId());
Scrap scrap=scrapOrderOutData.toScrap();
scrap.setDeviceIds(StringUtils.ListToString(scrapOrderOutData.getDevIds()));
scrap.setOutboundFile(FilesUtil.stringFileToList(scrapOrderOutData.getOutboundFileList()));
scrapService.saveScrap(scrap);
scrap.setScripts(scrapOrderOutData.getScriptSaveVos());
scrap.setScriptJson(JacksonUtil.toJSon(scrapOrderOutData.getScriptSaveVos()));
scrap.setNum("NO:第"+ LocalDateTime.now().getYear()+"QT"+scrap.getId());
List<DeviceLibrary> deviceLibraries= findInvoleDevice(scrap.getDeviceIds());
scrap.setDeviceLibraryEntities(findInvoleDevice(scrap.getDeviceIds()));
scrapService.saveScrap(scrap);
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.RETIRED.id,scrapOrderOutData.getDevIds());
devLogAdd(deviceLibraries,"发起了报废任务",userId);
TaskBto taskBto= sendOutSuperior(units.getUnitId(),scrap.getId(),userId);
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"发起退役任务,待上传回执单据",gainThisUser(user.getUserId(),user.getUnitsId())));
return scrap;
}
@Override
public void receiptSingle(Integer taskId, StorageScrap storageScrap) {
User user=userService.findByUser(storageScrap.getUserId());
TaskBto taskBto= taskService.get(taskId);
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.SEND_BACK_1210);
Scrap scrap=scrapService.findScrap(taskBto.getBillId());
scrap.setBillFile(FilesUtil.stringFileToList(storageScrap.getFileRets()));
if (storageScrap.getUserBName()!=null) {
scrap.setReceiveUserB(storageScrap.getUserBName());
}
if (storageScrap.getUserB()!=null){
scrap.setReceiveUserbId(storageScrap.getUserB());
}
if (storageScrap.getUserA()!=null){
scrap.setReceiveUseraId(storageScrap.getUserA());
}
if (storageScrap.getUserAName()!=null) {
scrap.setReceiveUserA(storageScrap.getUserAName());
}
taskService.moveToEnd(taskBto);
deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.RETIRE.id,scrap.getReceiveUnit(),0,StringUtils.stringToList(scrap.getDeviceIds()));
scrapService.saveScrap(scrap);
devLogAdd(findInvoleDevice(scrap.getDeviceIds()),"上传了报废单据,装备状态-》已报废",storageScrap.getUserId());
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"退役任务回执单据上传成功任务结束",gainThisUser(user.getUserId(),user.getUnitsId())));
}
/**
* 报废省出库中办
* @param userId 当前用户对象
* @param unitId 单位id
* @param repelDetailId 业务id
* @return
*/
private TaskBto sendOutSuperior(Integer unitId, Integer repelDetailId,Integer userId){
List<Integer> userIds = new ArrayList<>();
userIds.add(userId);
userIds.add(0);
return taskService.start(new TaskBto(StatusEnum.WAIT_UPLOAD_SCRAP_FILE.id, "报废业务", null, ".", repelDetailId, BusinessEnum.SCRAP.id, unitId, 1, "country", userIds));
}
/**
* 异步添加装备日志
* @param deviceLibraries
* @param remark
* @param userId
*/
private void devLogAdd(List<DeviceLibrary> deviceLibraries, String remark, Integer userId){
List<DeviceLog> logDtos=new ArrayList<>();
deviceLibraries.forEach(
deviceLibrary -> {
logDtos.add(new DeviceLogDto(deviceLibrary.getId(),remark,null,userId).toDo());
}
);
CompletableFuture.runAsync(() -> {
deviceLogService.saveAllLog(logDtos);
});
}
private void addMessage(MessageBto messageBto){
messageService.add(messageBto);
}
/**
* 根据单位id查询用户 去除用户id
* @param userId
* @param unitId
* @return
*/
private List<Integer> gainThisUser(Integer userId,Integer unitId){
return userService.findAllByUnite(unitId).stream().filter(user -> user.getUnitsId()!=userId).map(User::getUserId).collect(Collectors.toList());
}
/**
* 根据单位id查询用户id集合
* @param unitId
* @return
*/
private List<Integer> findUnitId(Integer unitId){
return userService.findAllByUnite(unitId).stream().map(User::getUserId).collect(Collectors.toList());
}
private List<DeviceLibrary> findInvoleDevice(String involeDevice){
if (involeDevice!=null && !involeDevice.equals(",") ) {
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).stream().map(DeviceLibrary::setConfigName).collect(Collectors.toList());
}else {
return new ArrayList<>();
}
}
}
package com.tykj.dev.device.scrap.service.impl;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.scrap.service.ScrapQueryService;
import com.tykj.dev.device.scrap.service.ScrapService;
import com.tykj.dev.device.scrap.subject.domin.Scrap;
import com.tykj.dev.device.scrap.subject.domin.ScrapBill;
import com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.lang.reflect.Field;
/**
* @author zjm
* @version 1.0.0
* @ClassName ScrapQueryServiceImpl.java
* @Description TODO
* @createTime 2021年03月31日 14:14:00
*/
@Service
public class ScrapQueryServiceImpl implements ScrapQueryService {
@Autowired
ScrapService scrapService;
@Autowired
TaskService taskService;
@Override
public Page<Scrap> findPageScrapList(ScrapSelectVo scrapSelectVo) {
return scrapService.findPageScrapList(scrapSelectVo);
}
@Override
public Scrap findTaskId(Integer taskId) {
TaskBto taskBto= taskService.get(taskId);
return scrapService.findScrap(taskBto.getBillId());
}
}
package com.tykj.dev.device.scrap.service.impl; package com.tykj.dev.device.scrap.service.impl;
import com.github.wenhao.jpa.PredicateBuilder;
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.scrap.repository.ScrapDao; import com.tykj.dev.device.scrap.repository.ScrapDao;
import com.tykj.dev.device.scrap.service.ScrapBillService;
import com.tykj.dev.device.scrap.service.ScrapService; import com.tykj.dev.device.scrap.service.ScrapService;
import com.tykj.dev.device.scrap.subject.domin.Scrap; import com.tykj.dev.device.scrap.subject.domin.Scrap;
import com.tykj.dev.device.scrap.subject.domin.ScrapBill;
import com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo;
import com.tykj.dev.misc.exception.ApiException;
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.http.ResponseEntity;
import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/** /**
* @author zjm * @author zjm
...@@ -16,6 +32,8 @@ import java.util.List; ...@@ -16,6 +32,8 @@ import java.util.List;
* @Description TODO * @Description TODO
* @createTime 2021年03月31日 10:23:00 * @createTime 2021年03月31日 10:23:00
*/ */
@Service
@Slf4j
public class ScrapServiceImpl implements ScrapService { public class ScrapServiceImpl implements ScrapService {
@Autowired @Autowired
ScrapDao scrapDao; ScrapDao scrapDao;
...@@ -24,21 +42,71 @@ public class ScrapServiceImpl implements ScrapService { ...@@ -24,21 +42,71 @@ public class ScrapServiceImpl implements ScrapService {
DeviceLibraryDao deviceLibraryDao; DeviceLibraryDao deviceLibraryDao;
@Override @Override
public Scrap saveScrap(Scrap scrap) { public Scrap saveScrap(Scrap scrap) {
return null; return scrapDao.save(scrap);
} }
@Override @Override
public Scrap findScrap(Integer scrapId) { public Scrap findScrap(Integer scrapId) {
return null; Optional<Scrap> optional = scrapDao.findById(scrapId);
} if (optional.isPresent()){
Scrap scrap=optional.get();
scrap.setDeviceLibraryEntities(findInvoleDevice(scrap.getDeviceIds()));
scrap.setBillFiles(FilesUtil.stringFileToList(scrap.getBillFile()));
scrap.setOutboundFiles(FilesUtil.stringFileToList(scrap.getOutboundFile()));
return scrap;
}else {
log.info("[报废] 详情查看错误,id没有找到{}",scrapId);
throw new ApiException(ResponseEntity.status(500).body("报废详情id没有找到:"+scrapId));
} }
@Override @Override
public Scrap findScrapNoDev(Integer scrapId) { public Scrap findScrapNoDev(Integer scrapId) {
return null; Optional<Scrap> optional = scrapDao.findById(scrapId);
} if (optional.isPresent()){
return optional.get();
}else {
log.info("[报废] 详情查看错误,id没有找到{}",scrapId);
throw new ApiException(ResponseEntity.status(500).body("报废详情id没有找到:"+scrapId));
} }
@Override @Override
public List<Scrap> findAll() { public List<Scrap> findAll() {
return null; return scrapDao.findAll();
}
@Override
public Page<Scrap> findPageScrapList(ScrapSelectVo scrapSelectVo) {
PredicateBuilder<Scrap> predicateBuilder = Specifications.and();
if (scrapSelectVo.getContent() != null) {
Class<ScrapBill> scrapBillClass = ScrapBill.class;
Field[] declaredFields = scrapBillClass.getDeclaredFields();
PredicateBuilder<ScrapBill> p = Specifications.or();
for (Field field : declaredFields) {
if (field.getType().equals(String.class) && field.getAnnotation(Transient.class) == null) {
p.like(field.getName(), "%" + scrapSelectVo.getContent() + "%");
}
}
predicateBuilder.predicate(p.build());
}
if (scrapSelectVo.getStartTime() != null) {
predicateBuilder.gt("updateTime", scrapSelectVo.getStartTime());
}
if (scrapSelectVo.getEndTime() != null) {
predicateBuilder.lt("updateTime", scrapSelectVo.getEndTime());
}
return scrapDao.findAll(predicateBuilder.build(), scrapSelectVo.getPageable());
}
private List<DeviceLibrary> findInvoleDevice(String involeDevice){
if (involeDevice!=null && !involeDevice.equals(",") ) {
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).stream().map(DeviceLibrary::setConfigName).collect(Collectors.toList());
}else {
return new ArrayList<>();
}
} }
} }
package com.tykj.dev.device.scrap.subject.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.device.scrap.subject.domin.Scrap;
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.ArrayList;
import java.util.Date;
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 ScrapOrderOutData {
/**
* 申请文号
*/
@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 senderUserA;
/**
* 签发人
*/
@ApiModelProperty(value = "签发人(B岗位)")
private String senderUserB;
/**
* 签发人
*/
@ApiModelProperty(value = "签发人(B岗位)")
private String sendUserbId;
/**
* 收件方 经办人
*/
@ApiModelProperty(value = "收件方id(A岗位)")
private Integer receiveUseraId;
/**
* 收件方 经办人名称
*/
@ApiModelProperty(value = "收件方名称(A岗位)")
private String receiveUserA;
/**
* 收件方id(B岗位)
*/
@ApiModelProperty(value = "收件方名称(B岗位)")
private String receiveUserB;
/**
* 收件方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集合
*/
@ApiModelProperty(value = "涉及装备的id集合")
private List<Integer> devIds;
/**
* 出库附件文件
*/
@ApiModelProperty(value = "出库附件文件")
private List<FileRet> outboundFileList;
/**
* 清退单文件
*/
@ApiModelProperty(value = "清退单文件")
private List<FileRet> billFileList;
@ApiModelProperty(value = "发件单位签章id")
private String leftSignatureId;
@ApiModelProperty(value = "批复文号文件集合")
private List<FileRet> replyFileList = new ArrayList<>();
@ApiModelProperty(value = "申请文号文件集合")
private List<FileRet> applyFileList = new ArrayList<>();
private List<FileRet> sendFileList = new ArrayList<>();
@ApiModelProperty(value = "单据装备数据信息")
private List<ScriptSaveVo> scriptSaveVos = new ArrayList<>();
public Scrap toScrap() {
ModelMapper mapper = BeanHelper.getUserMapper();
return mapper.map(this, Scrap.class);
}
}
...@@ -30,4 +30,5 @@ public class ScrapSelectVo extends CustomPage { ...@@ -30,4 +30,5 @@ public class ScrapSelectVo extends CustomPage {
@ApiModelProperty(value = "结束时间", example = "2020-10-10 01:10:10") @ApiModelProperty(value = "结束时间", example = "2020-10-10 01:10:10")
public Date endTime; public Date endTime;
} }
package com.tykj.dev.device.scrap.subject.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 StorageScrap {
/**
* 接收方单据
*/
private List<FileRet> fileRets;
/**
* 装备id集合
*/
private List<Integer> deviceIds;
/**
* 回执单据
*/
private List<FileRet> outFiles;
private Integer isIgnore;
private Integer userId;
private Integer taskId;
private Integer userA;
private Integer userB;
private String userAName;
private String userBName;
private String senderName;
private Integer senderId;
/**
* 电子签章发件方
*/
private String srcA;
/**
* 电子签章收件方
*/
private String srcB;
/**
* 接收方、发件方都使用电子签章
*/
private Integer isNotTwoSides;
}
...@@ -123,6 +123,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -123,6 +123,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
lifeStatus.add(DeviceLifeStatus.REPAIRING.id); lifeStatus.add(DeviceLifeStatus.REPAIRING.id);
lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id); lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id);
lifeStatus.add(DeviceLifeStatus.USE.id); lifeStatus.add(DeviceLifeStatus.USE.id);
lifeStatus.add(DeviceLifeStatus.SEND_BACK.id);
List<String> directlUnderUnitNames=new ArrayList<>(); List<String> directlUnderUnitNames=new ArrayList<>();
AtomicBoolean directlUnderUnit= new AtomicBoolean(false); AtomicBoolean directlUnderUnit= new AtomicBoolean(false);
AtomicBoolean correspondingLevel= new AtomicBoolean(false); AtomicBoolean correspondingLevel= new AtomicBoolean(false);
...@@ -193,6 +194,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -193,6 +194,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
lifeStatus.add(DeviceLifeStatus.REPAIRING.id); lifeStatus.add(DeviceLifeStatus.REPAIRING.id);
lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id); lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id);
lifeStatus.add(DeviceLifeStatus.USE.id); lifeStatus.add(DeviceLifeStatus.USE.id);
lifeStatus.add(DeviceLifeStatus.SEND_BACK.id);
User user = userService.findByUser(userId); User user = userService.findByUser(userId);
Units units=unitsService.findById(user.getUnitsId()); Units units=unitsService.findById(user.getUnitsId());
Area area=areaService.findByid(units.getAreaId()); Area area=areaService.findByid(units.getAreaId());
...@@ -275,6 +277,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -275,6 +277,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
lifeStatus.add(DeviceLifeStatus.REPAIRING.id); lifeStatus.add(DeviceLifeStatus.REPAIRING.id);
lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id); lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id);
lifeStatus.add(DeviceLifeStatus.USE.id); lifeStatus.add(DeviceLifeStatus.USE.id);
lifeStatus.add(DeviceLifeStatus.SEND_BACK.id);
if (repelAuditResult.getType()==1) { if (repelAuditResult.getType()==1) {
DeviceRepelDetail deviceRepelDetail = deviceRepelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId()); DeviceRepelDetail deviceRepelDetail = deviceRepelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId());
DeviceRepel deviceRepel = deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId()); DeviceRepel deviceRepel = deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
...@@ -412,7 +416,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -412,7 +416,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
// 判读是否还有需要审核待task // 判读是否还有需要审核待task
isCommission(taskBto,deviceRepelDetail.getRepelId()); isCommission(taskBto,deviceRepelDetail.getRepelId());
} }
...@@ -510,8 +513,16 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -510,8 +513,16 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}else { }else {
deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.SEND_BACK.id, deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds())); deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.SEND_BACK.id, deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
} }
List<DeviceLibrary> libraries = findInvoleDevice(deviceRepelDetail.getDeviceIds());
taskService.moveToEnd(taskBto); libraries.forEach(
deviceLibrary -> {
list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId()));
}
);
//添加根据type修改装备状态
repelDeviceUnitService.saveAllRepelDeviceUnit(list);
taskService.moveToEnd(taskBto);
taskService.moveToEnd(taskService.findBillTypeAndFatherId(BusinessEnum.SEND_BACK.id,taskId));
} else { } else {
if (storageDeviceRepel.getIsIgnore()==null) { if (storageDeviceRepel.getIsIgnore()==null) {
//判断当前状态是否为SEND_BACK_1209 清退装备等待入库 //判断当前状态是否为SEND_BACK_1209 清退装备等待入库
...@@ -527,27 +538,25 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -527,27 +538,25 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.SEND_BACK.id, deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds())); deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.SEND_BACK.id, deviceRepelDetail.getReceiveUnit(), 0, StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
} }
taskService.moveToEnd(taskBto); taskService.moveToEnd(taskBto);
taskService.moveToEnd(taskService.findBillTypeAndFatherId(BusinessEnum.SEND_BACK.id,taskId));
Documents documents= deviceRepelDetail.toDoc(); Documents documents= deviceRepelDetail.toDoc();
documents.setSrcA(storageDeviceRepel.getSrcA()); documents.setSrcA(storageDeviceRepel.getSrcA());
documents.setSrcB(storageDeviceRepel.getSrcB()); documents.setSrcB(storageDeviceRepel.getSrcB());
documents.setScriptSaveVos(JacksonUtil.readValue(deviceRepelDetail.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() { documents.setScriptSaveVos(JacksonUtil.readValue(deviceRepelDetail.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() {
})); }));
List<DeviceLibrary> libraries = findInvoleDevice(deviceRepelDetail.getDeviceIds());
libraries.forEach(
deviceLibrary -> {
list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId()));
}
);
//添加根据type修改装备状态
repelDeviceUnitService.saveAllRepelDeviceUnit(list);
FileRet fileRet= pdfService.billPdf(documents); FileRet fileRet= pdfService.billPdf(documents);
deviceRepelDetail.setOutboundFile(JacksonUtil.toJSon(fileRet)); deviceRepelDetail.setOutboundFile(JacksonUtil.toJSon(fileRet));
deviceRepelDetail.setSendFiles(JacksonUtil.toJSon(fileRet)); deviceRepelDetail.setSendFiles(JacksonUtil.toJSon(fileRet));
} }
} }
List<DeviceLibrary> libraries= findInvoleDevice(deviceRepelDetail.getDeviceIds());
libraries.forEach(
deviceLibrary -> {
list.add(new RepelDeviceUnit(deviceLibrary.getId(),deviceRepelDetail.getSendUnitId()));
}
);
//添加根据type修改装备状态
repelDeviceUnitService.saveAllRepelDeviceUnit(list);
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical); repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
isEnd(taskBto,deviceRepelDetail.getRepelId()); isEnd(taskBto,deviceRepelDetail.getRepelId());
...@@ -661,6 +670,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -661,6 +670,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.RETIRE.id,deviceRepelDetail.getReceiveUnit(),0,StringUtils.stringToList(deviceRepelDetail.getDeviceIds())); deviceLibraryDao.upDateLeftStatusAndUnitNameAndLockStatus(DeviceLifeStatus.RETIRE.id,deviceRepelDetail.getReceiveUnit(),0,StringUtils.stringToList(deviceRepelDetail.getDeviceIds()));
TaskBto fatherTask=taskService.get(taskBto.getParentTaskId()); TaskBto fatherTask=taskService.get(taskBto.getParentTaskId());
taskService.moveToEnd(fatherTask); taskService.moveToEnd(fatherTask);
isEnd(fatherTask,deviceRepelDetail.getRepelId());
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
} }
......
...@@ -92,13 +92,14 @@ public class RepelQueryServiceImpl implements RepelQueryService { ...@@ -92,13 +92,14 @@ public class RepelQueryServiceImpl implements RepelQueryService {
deviceLibraryDao.findAllByPackingIdInAndOwnUnit(fielding,units.getName()).stream() deviceLibraryDao.findAllByPackingIdInAndOwnUnit(fielding,units.getName()).stream()
.filter(deviceLibrary -> deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.IN_LIBRARY.id) .filter(deviceLibrary -> deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.IN_LIBRARY.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.REPEL.id) ||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.REPEL.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.SEND_BACK.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.REPAIRING.id) ||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.REPAIRING.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.IN_TRANSIT.id) ||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.IN_TRANSIT.id)
||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.USE.id)) ||deviceLibrary.getLifeStatus().equals(DeviceLifeStatus.USE.id))
.map(DeviceLibrary::setConfigName).forEach( .map(DeviceLibrary::setConfigName).forEach(
deviceLibrary -> { deviceLibrary -> {
if (deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){ if (deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){
if (deviceLibrary.getLifeStatus()==2||deviceLibrary.getLifeStatus()==15 ||deviceLibrary.getLifeStatus()==14) { if (deviceLibrary.getLifeStatus()==2||deviceLibrary.getLifeStatus()==15 ||deviceLibrary.getLifeStatus()==14||deviceLibrary.getLifeStatus()==6) {
deviceLibraries.add(deviceLibrary); deviceLibraries.add(deviceLibrary);
}else { }else {
deviceLibrariesAbnormal.add(deviceLibrary); deviceLibrariesAbnormal.add(deviceLibrary);
......
...@@ -56,7 +56,7 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE ...@@ -56,7 +56,7 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE
@Query("select o.billId from Task o where o.id=?1 and o.businessType=?2") @Query("select o.billId from Task o where o.id=?1 and o.businessType=?2")
Integer findBillId(int id, int businessType); Integer findBillId(int id, int businessType);
TaskBto findByParentTaskIdAndBusinessType(int parentTaskId, int businessType); Task findByParentTaskIdAndBusinessType(int parentTaskId, int businessType);
List<Task> findTaskEntitiesByParentTaskIdAndAndBusinessType(Integer parentTaskId,Integer businessType); List<Task> findTaskEntitiesByParentTaskIdAndAndBusinessType(Integer parentTaskId,Integer businessType);
......
...@@ -795,7 +795,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -795,7 +795,7 @@ public class TaskServiceImpl implements TaskService {
@Override @Override
public TaskBto findBillTypeAndFatherId(Integer billType, Integer fatherId) { public TaskBto findBillTypeAndFatherId(Integer billType, Integer fatherId) {
return taskDao.findByParentTaskIdAndBusinessType(fatherId,billType); return taskDao.findByParentTaskIdAndBusinessType(fatherId,billType).parse2Bto();
} }
@Override @Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论