提交 c294fa6d authored 作者: 邓砥奕's avatar 邓砥奕

更新

上级 004e7331
...@@ -236,7 +236,7 @@ public class AllotBillController { ...@@ -236,7 +236,7 @@ public class AllotBillController {
deviceLibraryEntity.setMatchingRange(1); deviceLibraryEntity.setMatchingRange(1);
} }
// deviceLibraryEntity.setAllotType(2); // deviceLibraryEntity.setAllotType(2);
DeviceLogDto deviceLogDto = new DeviceLogDto(id, "纵向配发将配发类型由" + deviceLibraryEntity.getMatchingRangeName() + "改为"+configCache.getMatchingRangeMap().get(1), fileVoList); DeviceLogDto deviceLogDto = new DeviceLogDto(id, "纵向配发将所属列装由" + deviceLibraryEntity.getMatchingRangeName() + "的列装改为"+configCache.getMatchingRangeMap().get(1)+"的列装", fileVoList);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
} }
deviceLibraryEntity.setLifeStatus(3); deviceLibraryEntity.setLifeStatus(3);
...@@ -262,7 +262,7 @@ public class AllotBillController { ...@@ -262,7 +262,7 @@ public class AllotBillController {
} }
} }
// deviceLibraryEntity.setAllotType(1); // deviceLibraryEntity.setAllotType(1);
DeviceLogDto deviceLogDto = new DeviceLogDto(id, "横向配发将配发类型由" + deviceLibraryEntity.getMatchingRangeName() + "改为"+configCache.getMatchingRangeMap().get(3), fileVoList); DeviceLogDto deviceLogDto = new DeviceLogDto(id, "横向配发将所属列装由" + deviceLibraryEntity.getMatchingRangeName() + "的列装改为"+configCache.getMatchingRangeMap().get(3)+"的列装", fileVoList);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
} }
deviceLibraryEntity.setLocationUnit(allotBillSaveVo.getReceiveUnit()); deviceLibraryEntity.setLocationUnit(allotBillSaveVo.getReceiveUnit());
......
...@@ -96,7 +96,15 @@ public class BackController { ...@@ -96,7 +96,15 @@ public class BackController {
if (allotBillSaveVo.getTaskId()==null) { if (allotBillSaveVo.getTaskId()==null) {
a.setSendUseraId(userUtils.getCurrentUserId()); a.setSendUseraId(userUtils.getCurrentUserId());
} }
AllotBackBill allotBackBill = allotBackBillService.addEntity(a); AllotBackBill allotBackBill;
if (allotBillSaveVo.getTaskId()==null){
allotBackBill = allotBackBillService.addEntity(a);
}
else {
allotBackBill = allotBackBillService.getOne(taskService.get(allotBillSaveVo.getTaskId()).getBillId());
MapperUtils.copyNoNullProperties(a,allotBackBill);
allotBackBill = allotBackBillService.update(allotBackBill);
}
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date()); calendar.setTime(new Date());
int year = calendar.get(Calendar.YEAR); int year = calendar.get(Calendar.YEAR);
...@@ -486,7 +494,7 @@ public class BackController { ...@@ -486,7 +494,7 @@ public class BackController {
AllotBackBill allotBill = allotBackBillService.getOne(taskBto.getBillId()); AllotBackBill allotBill = allotBackBillService.getOne(taskBto.getBillId());
if (status==1){ if (status==1){
taskService.moveToSpecial(taskBto,StatusEnum.BACK_WAIT_SIGN); taskService.moveToSpecial(taskBto,StatusEnum.BACK_WAIT_SIGN);
if (allotBill.getBackStatus()==0) { if (allotBill.getBackStatus()==1) {
allotBill.setSendUserbId(userUtils.getCurrentUserId()); allotBill.setSendUserbId(userUtils.getCurrentUserId());
allotBill.setAgent(userUtils.getCurrentName()); allotBill.setAgent(userUtils.getCurrentName());
} }
...@@ -496,7 +504,7 @@ public class BackController { ...@@ -496,7 +504,7 @@ public class BackController {
allotBackBillService.update(allotBill); allotBackBillService.update(allotBill);
} }
else { else {
if (allotBill.getBackStatus()==0) { if (allotBill.getBackStatus()==1) {
taskService.moveToSpecial(taskBto, StatusEnum.BACK_DRAFT, taskBto.getCreateUserId()); taskService.moveToSpecial(taskBto, StatusEnum.BACK_DRAFT, taskBto.getCreateUserId());
} }
else { else {
......
...@@ -23,9 +23,8 @@ public interface DeviceApplyBillService { ...@@ -23,9 +23,8 @@ public interface DeviceApplyBillService {
DeviceApplyBill getOne(Integer id); DeviceApplyBill getOne(Integer id);
/** /**
* @param applyType 申请类型
* @param scriptSaveVos 退役/报废/销毁装备单据详情 * @param scriptSaveVos 退役/报废/销毁装备单据详情
*/ */
Boolean updateCompleteNum(Integer applyType,List<ScriptSaveVo> scriptSaveVos); void updateCompleteNum(List<ScriptSaveVo> scriptSaveVos);
} }
package com.tykj.dev.device.apply.service.impl; package com.tykj.dev.device.apply.service.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.blockcha.subject.entity.BcHash; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig; import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.device.apply.repository.DeviceApplyBillDao; import com.tykj.dev.device.apply.repository.DeviceApplyBillDao;
import com.tykj.dev.device.apply.service.DeviceApplyBillService; import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill; import com.tykj.dev.device.apply.subject.domin.DeviceApplyBill;
import com.tykj.dev.device.apply.subject.vo.ReplyVo;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo; import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task;
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.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.DeviceSeqUtil;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.*;
import java.util.Optional;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -29,6 +45,27 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService { ...@@ -29,6 +45,27 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
@Autowired @Autowired
private BlockChainUtil blockChainUtil; private BlockChainUtil blockChainUtil;
@Autowired
private TaskDao taskDao;
@Autowired
private DeviceLibraryService deviceLibraryService;
@Autowired
private MessageService messageService;
@Autowired
private TaskService taskService;
@Autowired
private UserPublicService userPublicService;
@Autowired
private UserUtils userUtils;
@Autowired
private DeviceApplyBillService deviceApplyBillService;
@Override @Override
public DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity) { public DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity) {
DeviceApplyBill deviceApplyBill = deviceApplyBillDao.save(deviceApplyBillEntity); DeviceApplyBill deviceApplyBill = deviceApplyBillDao.save(deviceApplyBillEntity);
...@@ -75,19 +112,60 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService { ...@@ -75,19 +112,60 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
} }
@Override @Override
public Boolean updateCompleteNum(Integer applyType, List<ScriptSaveVo> scriptSaveVos) { public void updateCompleteNum(List<ScriptSaveVo> scriptSaveVos) {
Map<Integer, Task> taskMap = taskDao.findAllByBusinessTypeAndBillStatus(9, StatusEnum.WAIT_CONFIRM_APPLY_DEVICE.id).stream().collect(Collectors.toMap(Task::getId, Function.identity()));
if (applyType==2){ Map<Integer, DeviceApplyBill> billMap = deviceApplyBillDao.findAll().stream().collect(Collectors.toMap(DeviceApplyBill::getId,Function.identity()));
Map<String, DeviceLibrary> seqMap = deviceLibraryService.getAllDeviceSeqMap();
} List<DeviceLibrary> deviceLibraries = new ArrayList<>();
else if (applyType==3){ for (ScriptSaveVo s:scriptSaveVos) {
} if (s.getSeqNumber()!=null){
else if (applyType==4) { DeviceSeqUtil.selectDeviceSeqs(s.getSeqNumber()).forEach(s1 -> deviceLibraries.add(seqMap.get(s1)));
}
} }
else { Map<Integer,List<DeviceLibrary>> taskIdMap= deviceLibraries.stream().collect(groupingBy(DeviceLibrary::getApplyTaskId));
throw new ApiException("applyType只能为2,3,4"); for (Integer taskId:taskIdMap.keySet()) {
Map<Integer,List<DeviceLibrary>> map = taskIdMap.get(taskId).stream().collect(groupingBy(DeviceLibrary::getPackingId));
TaskBto taskBto = taskMap.get(taskId).parse2Bto();
DeviceApplyBill deviceApplyBill = billMap.get(taskBto.getBillId());
Boolean isComplete = true;
if (deviceApplyBill.getReplyVos()!=null&&!"".equals(deviceApplyBill.getReplyVos())) {
List<ReplyVo> replyVos = JacksonUtil.readValue(deviceApplyBill.getReplyVos(), new TypeReference<List<ReplyVo>>() {
});
List<DeviceLibrary> deviceLibraryList = new ArrayList<>();
if (replyVos != null) {
for(ReplyVo r:replyVos){
if (map.get(r.getId())!=null){
r.setCompleteCount(r.getCompleteCount()+map.get(r.getId()).size());
if (!r.getCompleteCount().equals(r.getNum())){
isComplete = false;
List<String> seqs = DeviceSeqUtil.selectDeviceSeqs(r.getSeqInterval());
seqs.removeAll(map.get(r.getId()).stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList()));
seqs.forEach(s -> deviceLibraryList.add(seqMap.get(s)));
}
}
}
if (!isComplete){
Set<Integer> lifeStatus = deviceLibraryList.stream().map(DeviceLibrary::getLifeStatus).collect(Collectors.toSet());
if (lifeStatus.size()==1&&lifeStatus.iterator().next()==11){
isComplete = true;
}
}
if (isComplete){
taskService.moveToEnd(taskBto);
//发送阅知信息
MessageBto messageBto = new MessageBto();
messageBto.setContent("业务办结");
messageBto.setTaskId(taskBto.getId());
messageBto.setIsHighLight(0);
messageBto.setInvolveUserIdList(userPublicService.findOtherUser(userUtils.getCurrentUserId()));
messageBto.setBusinessType(taskBto.getBusinessType());
messageService.add(messageBto);
}
deviceApplyBill.setApplyStat(JacksonUtil.toJSon(replyVos));
deviceApplyBillService.update(deviceApplyBill);
}
}
} }
return null;
} }
} }
...@@ -294,9 +294,43 @@ public class DeviceLibraryController { ...@@ -294,9 +294,43 @@ public class DeviceLibraryController {
@ApiOperation(value = "模糊查询标签管理装备分页", notes = "可以通过这个接口查询装备列表") @ApiOperation(value = "模糊查询标签管理装备分页", notes = "可以通过这个接口查询装备列表")
@PostMapping("/selectTagDevicePage") @PostMapping("/selectTagDevicePage")
public ResponseEntity selectTagDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) { public ResponseEntity selectTagDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
Page<DeviceLibrary> deviceLibraryEntities = deviceLibraryService.getTagPage(deviceLibrarySelectVo, deviceLibrarySelectVo.getPageable()); Boolean hasModelDim = deviceLibrarySelectVo.getModelDim()!=null;
deviceLibraryEntities.forEach(DeviceLibrary::setConfigName); Boolean hasNameDim = deviceLibrarySelectVo.getNameDim()!=null;
return ResultUtil.success(deviceLibraryEntities); Boolean hasSeqDim = deviceLibrarySelectVo.getSeqDim()!=null;
Boolean hasSurfaceDim = deviceLibrarySelectVo.getSurfaceDim()!=null;
Boolean hasLocationUnitDim = deviceLibrarySelectVo.getLocationUnitDim()!=null;
Boolean hasOwnUnitDim = deviceLibrarySelectVo.getOwnUnitDim()!=null;
Boolean hasLifeStatusDim = deviceLibrarySelectVo.getLifeStatusDim()!=null;
Boolean hasUpdateTimeDim = deviceLibrarySelectVo.getUpdateTimeDim()!=null;
Boolean hasCreateTimeDim = deviceLibrarySelectVo.getCreateTimeDim()!=null;
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
List<DeviceLibrary> resultList = deviceLibraryService.getTagPage(deviceLibrarySelectVo, deviceLibrarySelectVo.getPageable());
resultList.forEach(DeviceLibrary::setConfigName);
if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim) {
resultList = resultList.stream().filter(deviceLibrary -> {
Boolean containModelDim = !hasModelDim||deviceLibrary.getModel().contains(deviceLibrarySelectVo.getModelDim());
Boolean containNameDim = !hasNameDim||deviceLibrary.getName().contains(deviceLibrarySelectVo.getNameDim());
Boolean containSeqDim = !hasSeqDim||deviceLibrary.getSeqNumber().contains(deviceLibrarySelectVo.getSeqDim());
Boolean containSurfaceDim = !hasSurfaceDim||(deviceLibrary.getRfidSurfaceId()!=null&&deviceLibrary.getRfidSurfaceId().contains(deviceLibrarySelectVo.getSurfaceDim()));
Boolean containLocationUnitDim = !hasLocationUnitDim||deviceLibrary.getLocationUnit().contains(deviceLibrarySelectVo.getLocationUnitDim());
Boolean containOwnUnitDim = !hasOwnUnitDim||deviceLibrary.getOwnUnit().contains(deviceLibrarySelectVo.getOwnUnitDim());
Boolean containLifeStatusDim = !hasLifeStatusDim||deviceLibrary.getLifeStatusName().contains(deviceLibrarySelectVo.getLifeStatusDim());
Boolean containUpdateTimeDim = !hasUpdateTimeDim||sdf.format(deviceLibrary.getUpdateTime()).contains(deviceLibrarySelectVo.getUpdateTimeDim());
Boolean containCreateTimeDim = !hasCreateTimeDim||sdf.format(deviceLibrary.getCreateTime()).contains(deviceLibrarySelectVo.getCreateTimeDim());
return containModelDim&&containNameDim&&containSeqDim&&containLocationUnitDim&&containOwnUnitDim&&containLifeStatusDim&&containUpdateTimeDim&&containCreateTimeDim&&containSurfaceDim;
}).collect(Collectors.toList());
}
Page<DeviceLibrary> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), resultList, deviceLibrarySelectVo.getPageable());
Map<String,Object> map = new HashMap<>();
Map<Integer,String> lifeStatusMap = configCache.getLifeStatusMap();
Set<Integer> status = resultList.stream().map(DeviceLibrary::getLifeStatus).collect(Collectors.toSet());
map.put("pages",deviceLibraryEntities);
map.put("models",resultList.stream().map(DeviceLibrary::getModel).collect(Collectors.toSet()));
map.put("names",resultList.stream().map(DeviceLibrary::getName).collect(Collectors.toSet()));
map.put("ownUnits",resultList.stream().map(DeviceLibrary::getOwnUnit).collect(Collectors.toSet()));
map.put("locationUnits",resultList.stream().map(DeviceLibrary::getLocationUnit).collect(Collectors.toSet()));
map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
return ResultUtil.success(map);
} }
@ApiOperation(value = "模糊查询核心装备统计分页", notes = "可以通过这个接口查询装备列表") @ApiOperation(value = "模糊查询核心装备统计分页", notes = "可以通过这个接口查询装备列表")
...@@ -370,7 +404,7 @@ public class DeviceLibraryController { ...@@ -370,7 +404,7 @@ public class DeviceLibraryController {
} }
if (libraryUpdateVo.getLifeStatus() != null && !libraryUpdateVo.getLifeStatus().equals(deviceLibraryEntity.getLifeStatus())) { if (libraryUpdateVo.getLifeStatus() != null && !libraryUpdateVo.getLifeStatus().equals(deviceLibraryEntity.getLifeStatus())) {
//添加装备日志 //添加装备日志
String remark = "将装备的生命状态由" + configCache.getLifeStatusMap().get(deviceLibraryEntity.getLifeStatus()) + "改为" + configCache.getLifeStatusMap().get(libraryUpdateVo.getLifeStatus()); String remark = "将装备的生命状态由" + configCache.getLifeStatusMap().getOrDefault(deviceLibraryEntity.getLifeStatus(),"空") + "改为" + configCache.getLifeStatusMap().get(libraryUpdateVo.getLifeStatus());
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), remark, null); DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), remark, null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setLifeStatus(libraryUpdateVo.getLifeStatus()); deviceLibraryEntity.setLifeStatus(libraryUpdateVo.getLifeStatus());
...@@ -387,7 +421,7 @@ public class DeviceLibraryController { ...@@ -387,7 +421,7 @@ public class DeviceLibraryController {
} }
if (libraryUpdateVo.getMatchingRange() != null && !libraryUpdateVo.getMatchingRange().equals(deviceLibraryEntity.getMatchingRange())) { if (libraryUpdateVo.getMatchingRange() != null && !libraryUpdateVo.getMatchingRange().equals(deviceLibraryEntity.getMatchingRange())) {
//添加装备日志 //添加装备日志
String remark = "将装备的配用范围由" + configCache.getMatchingRangeMap().get(deviceLibraryEntity.getMatchingRange()) + "改为" + configCache.getMatchingRangeMap().get(libraryUpdateVo.getMatchingRange()); String remark = "将装备的配用范围由" + configCache.getMatchingRangeMap().getOrDefault(deviceLibraryEntity.getMatchingRange(),"空") + "改为" + configCache.getMatchingRangeMap().get(libraryUpdateVo.getMatchingRange());
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), remark, null); DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), remark, null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setMatchingRange(libraryUpdateVo.getMatchingRange()); deviceLibraryEntity.setMatchingRange(libraryUpdateVo.getMatchingRange());
...@@ -436,7 +470,7 @@ public class DeviceLibraryController { ...@@ -436,7 +470,7 @@ public class DeviceLibraryController {
} }
if (libraryUpdateVo.getStorageType() != null && !libraryUpdateVo.getStorageType().equals(deviceLibraryEntity.getStorageType())) { if (libraryUpdateVo.getStorageType() != null && !libraryUpdateVo.getStorageType().equals(deviceLibraryEntity.getStorageType())) {
//添加装备日志 //添加装备日志
String remark = "将装备的入库类型由" + configCache.getStorageTypeMap().get(deviceLibraryEntity.getStorageType()) + "改为" + configCache.getStorageTypeMap().get(libraryUpdateVo.getStorageType()); String remark = "将装备的入库类型由" + configCache.getStorageTypeMap().getOrDefault(deviceLibraryEntity.getStorageType(),"空") + "改为" + configCache.getStorageTypeMap().get(libraryUpdateVo.getStorageType());
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), remark, null); DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), remark, null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setStorageType(libraryUpdateVo.getStorageType()); deviceLibraryEntity.setStorageType(libraryUpdateVo.getStorageType());
......
...@@ -34,7 +34,7 @@ public interface DeviceLibraryService { ...@@ -34,7 +34,7 @@ public interface DeviceLibraryService {
* @param deviceLibrarySelectVo 装备查询vo * @param deviceLibrarySelectVo 装备查询vo
* @param pageable 获取标签管理分页 * @param pageable 获取标签管理分页
*/ */
Page<DeviceLibrary> getTagPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable); List<DeviceLibrary> getTagPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable);
/** /**
* @param deviceLibrarySelectVo 装备查询vo * @param deviceLibrarySelectVo 装备查询vo
...@@ -154,10 +154,15 @@ public interface DeviceLibraryService { ...@@ -154,10 +154,15 @@ public interface DeviceLibraryService {
int getDeviceCount(); int getDeviceCount();
/** /**
* 获取所有装备map * 获取所有装备id map
*/ */
Map<Integer,DeviceLibrary> getAllDeviceMap(); Map<Integer,DeviceLibrary> getAllDeviceMap();
/**
* 获取所有装备序列号map
*/
Map<String,DeviceLibrary> getAllDeviceSeqMap();
/** /**
* 根据单位 以及生命状态集合 查询设备数量 * 根据单位 以及生命状态集合 查询设备数量
*/ */
......
...@@ -87,8 +87,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -87,8 +87,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
} }
@Override @Override
public Page<DeviceLibrary> getTagPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable) { public List<DeviceLibrary> getTagPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable) {
return deviceLibraryDao.findAll(getSelectSpecification4(deviceLibrarySelectVo), deviceLibrarySelectVo.getPageable()); PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo);
predicateBuilder.notIn("ownUnit", unitsService.findSuperiorUnitsList().stream().map(Units::getName).toArray());
return deviceLibraryDao.findAll(predicateBuilder.build());
} }
@Override @Override
...@@ -478,6 +480,16 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -478,6 +480,16 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return libraries.stream().collect(Collectors.toMap(DeviceLibrary::getId, Function.identity())); return libraries.stream().collect(Collectors.toMap(DeviceLibrary::getId, Function.identity()));
} }
/**
* 获取所有装备序列号map
*/
@Override
public Map<String, DeviceLibrary> getAllDeviceSeqMap() {
List<DeviceLibrary> libraries = deviceLibraryDao.findAll();
libraries.forEach(DeviceLibrary::setConfigName);
return libraries.stream().filter(deviceLibrary -> deviceLibrary.getSeqNumber()!=null&&!"".equals(deviceLibrary.getSeqNumber())).collect(Collectors.toMap(DeviceLibrary::getSeqNumber, Function.identity()));
}
@Override @Override
public Integer countAllRepel(List<Integer> fieldingIds, List<String> unitNames, List<String> seqNums,List<Integer> lifeStatusList) { public Integer countAllRepel(List<Integer> fieldingIds, List<String> unitNames, List<String> seqNums,List<Integer> lifeStatusList) {
//判断装备序列号是否为空 是 走列装id查询。 //判断装备序列号是否为空 是 走列装id查询。
...@@ -675,7 +687,14 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -675,7 +687,14 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
if (deviceLibrarySelectVo.getIsPart() != null) { if (deviceLibrarySelectVo.getIsPart() != null) {
predicateBuilder.eq("isPart", deviceLibrarySelectVo.getIsPart()); predicateBuilder.eq("isPart", deviceLibrarySelectVo.getIsPart());
} }
if (deviceLibrarySelectVo.getIsPrint()!=null){
if (deviceLibrarySelectVo.getIsPrint()==1){
predicateBuilder.notIn("rfidSurfaceId", (Object) null);
}
else if (deviceLibrarySelectVo.getIsPrint()==0){
predicateBuilder.eq("rfidSurfaceId", (Object) null);
}
}
if (deviceLibrarySelectVo.getContent() != null) { if (deviceLibrarySelectVo.getContent() != null) {
Class<DeviceLibrary> deviceLibraryEntity = DeviceLibrary.class; Class<DeviceLibrary> deviceLibraryEntity = DeviceLibrary.class;
Field[] declaredFields = deviceLibraryEntity.getDeclaredFields(); Field[] declaredFields = deviceLibraryEntity.getDeclaredFields();
......
...@@ -90,6 +90,9 @@ public class DeviceLibrarySelectVo extends CustomPage { ...@@ -90,6 +90,9 @@ public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "序列号模糊查询字段") @ApiModelProperty(value = "序列号模糊查询字段")
private String seqDim; private String seqDim;
@ApiModelProperty(value = "表面号模糊查询字段")
private String surfaceDim;
@ApiModelProperty(value = "所在单位模糊查询字段") @ApiModelProperty(value = "所在单位模糊查询字段")
private String locationUnitDim; private String locationUnitDim;
...@@ -102,6 +105,12 @@ public class DeviceLibrarySelectVo extends CustomPage { ...@@ -102,6 +105,12 @@ public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "更新时间模糊查询字段") @ApiModelProperty(value = "更新时间模糊查询字段")
private String updateTimeDim; private String updateTimeDim;
@ApiModelProperty(value = "创建时间模糊查询字段")
private String createTimeDim;
@ApiModelProperty(value = "更新时间年份") @ApiModelProperty(value = "更新时间年份")
private Integer year; private Integer year;
@ApiModelProperty(value = "查询是否打印标签(有没有表面号)装备")
private Integer isPrint;
} }
...@@ -248,7 +248,7 @@ public class MatchingDeviceController { ...@@ -248,7 +248,7 @@ public class MatchingDeviceController {
} }
if (matchingDeviceEditVo.getLifeStatus() != null && !m.getLifeStatus().equals(matchingDeviceEditVo.getLifeStatus())) { if (matchingDeviceEditVo.getLifeStatus() != null && !m.getLifeStatus().equals(matchingDeviceEditVo.getLifeStatus())) {
//添加设备日志 //添加设备日志
String remark = "将设备的生命状态由" + configCache.getLifeStatusMap().get(m.getLifeStatus()) + "改为" + configCache.getLifeStatusMap().get(matchingDeviceEditVo.getLifeStatus()); String remark = "将设备的生命状态由" + configCache.getLifeStatusMap().getOrDefault(m.getLifeStatus(),"空") + "改为" + configCache.getLifeStatusMap().get(matchingDeviceEditVo.getLifeStatus());
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null); DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
m.setLifeStatus(matchingDeviceEditVo.getLifeStatus()); m.setLifeStatus(matchingDeviceEditVo.getLifeStatus());
......
...@@ -15,13 +15,10 @@ import com.tykj.dev.device.packing.subject.domin.PackingLog; ...@@ -15,13 +15,10 @@ import com.tykj.dev.device.packing.subject.domin.PackingLog;
import com.tykj.dev.device.packing.subject.vo.*; import com.tykj.dev.device.packing.subject.vo.*;
import com.tykj.dev.device.task.service.TaskLogService; import com.tykj.dev.device.task.service.TaskLogService;
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.vo.TaskLogUserVo;
import com.tykj.dev.device.user.read.service.MessageService; 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.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.service.UserPublicService; import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.exception.ApiException; 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.GetTreeUtils; import com.tykj.dev.misc.utils.GetTreeUtils;
...@@ -92,18 +89,18 @@ public class PackingController { ...@@ -92,18 +89,18 @@ public class PackingController {
public ResponseEntity selectDetail(@PathVariable("billId") @Min(value = 1,message = "billId不能小于1") int billId) { public ResponseEntity selectDetail(@PathVariable("billId") @Min(value = 1,message = "billId不能小于1") int billId) {
PackingDetailVo packingDetailVo = new PackingDetailVo(); PackingDetailVo packingDetailVo = new PackingDetailVo();
//获取taskBto //获取taskBto
TaskBto taskBto = taskService.get(billId, BusinessEnum.PACKING.id); // TaskBto taskBto = taskService.get(billId, BusinessEnum.PACKING.id);
//获取列装主件 //获取列装主件
PackingLibrary packingLibraryEntity = packingLibraryService.getOne(billId); PackingLibrary packingLibraryEntity = packingLibraryService.getOne(billId);
packingLibraryEntity.setUserA(userPublicService.getOne(packingLibraryEntity.getUseraId()).getName()); // packingLibraryEntity.setUserA(userPublicService.getOne(packingLibraryEntity.getUseraId()).getName());
packingLibraryEntity.setUserB(userPublicService.getOne(packingLibraryEntity.getUserbId()).getName()); // packingLibraryEntity.setUserB(userPublicService.getOne(packingLibraryEntity.getUserbId()).getName());
packingDetailVo.setPackingLibrary(packingLibraryEntity.setConfigName()); packingDetailVo.setPackingLibrary(packingLibraryEntity.setConfigName());
//获取所有配件 //获取所有配件
List<PackingLibrary> packingLibraryEntities = packingLibraryService.selectAllPart(billId); List<PackingLibrary> packingLibraryEntities = packingLibraryService.selectAllPart(billId);
packingDetailVo.setParts(packingLibraryEntities); packingDetailVo.setParts(packingLibraryEntities);
//获取业务日志 //获取业务日志
List<TaskLogUserVo> taskLogUserVos = taskLogService.getByTaskId(taskBto.getId()); List<DeviceLogUserVo> deviceLogUserVos = packingLogDao.getAllByPackingId(billId).stream().map(PackingLog::toVo).sorted(Comparator.comparing(DeviceLogUserVo::getCreateTime).reversed()).collect(Collectors.toList());
packingDetailVo.setTaskLogUserVos(taskLogUserVos); packingDetailVo.setDeviceLogUserVos(deviceLogUserVos);
return ResultUtil.success(packingDetailVo); return ResultUtil.success(packingDetailVo);
} }
...@@ -448,7 +445,7 @@ public class PackingController { ...@@ -448,7 +445,7 @@ public class PackingController {
if (packingLibraryUpdateVo.getApplyType()!=null&&!packingLibraryUpdateVo.getApplyType().equals(packingLibrary.getApplyType())){ if (packingLibraryUpdateVo.getApplyType()!=null&&!packingLibraryUpdateVo.getApplyType().equals(packingLibrary.getApplyType())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
packingLog.setRemark("将应用类型从"+configCache.getApplyTypeMap().get(packingLibrary.getApplyType())+"改为"+configCache.getApplyTypeMap().get(packingLibraryUpdateVo.getApplyType())); packingLog.setRemark("将应用类型从"+configCache.getApplyTypeMap().getOrDefault(packingLibrary.getApplyType(),"空")+"改为"+configCache.getApplyTypeMap().get(packingLibraryUpdateVo.getApplyType()));
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setApplyType(packingLibraryUpdateVo.getApplyType()); packingLibrary.setApplyType(packingLibraryUpdateVo.getApplyType());
...@@ -456,7 +453,7 @@ public class PackingController { ...@@ -456,7 +453,7 @@ public class PackingController {
if (packingLibraryUpdateVo.getSecretLevel()!=null&&!packingLibraryUpdateVo.getSecretLevel().equals(packingLibrary.getSecretLevel())){ if (packingLibraryUpdateVo.getSecretLevel()!=null&&!packingLibraryUpdateVo.getSecretLevel().equals(packingLibrary.getSecretLevel())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
packingLog.setRemark("将密级从"+configCache.getSecretLevelMap().get(packingLibrary.getSecretLevel())+"改为"+configCache.getSecretLevelMap().get(packingLibraryUpdateVo.getSecretLevel())); packingLog.setRemark("将密级从"+configCache.getSecretLevelMap().getOrDefault(packingLibrary.getSecretLevel(),"空")+"改为"+configCache.getSecretLevelMap().get(packingLibraryUpdateVo.getSecretLevel()));
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setSecretLevel(packingLibraryUpdateVo.getSecretLevel()); packingLibrary.setSecretLevel(packingLibraryUpdateVo.getSecretLevel());
...@@ -464,7 +461,7 @@ public class PackingController { ...@@ -464,7 +461,7 @@ public class PackingController {
if (packingLibraryUpdateVo.getMatchingRange()!=null&&!packingLibraryUpdateVo.getMatchingRange().equals(packingLibrary.getMatchingRange())&&!packingLibraryService.matchingRangeIsExist(packingLibrary.getPartParentId(),packingLibraryUpdateVo.getMatchingRange())){ if (packingLibraryUpdateVo.getMatchingRange()!=null&&!packingLibraryUpdateVo.getMatchingRange().equals(packingLibrary.getMatchingRange())&&!packingLibraryService.matchingRangeIsExist(packingLibrary.getPartParentId(),packingLibraryUpdateVo.getMatchingRange())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
packingLog.setRemark("将配用范围从"+configCache.getMatchingRangeMap().get(packingLibrary.getMatchingRange())+"改为"+configCache.getMatchingRangeMap().get(packingLibraryUpdateVo.getMatchingRange())); packingLog.setRemark("将配用范围从"+configCache.getMatchingRangeMap().getOrDefault(packingLibrary.getMatchingRange(),"空")+"改为"+configCache.getMatchingRangeMap().get(packingLibraryUpdateVo.getMatchingRange()));
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setMatchingRange(packingLibraryUpdateVo.getMatchingRange()); packingLibrary.setMatchingRange(packingLibraryUpdateVo.getMatchingRange());
...@@ -472,7 +469,7 @@ public class PackingController { ...@@ -472,7 +469,7 @@ public class PackingController {
if (packingLibraryUpdateVo.getInvisibleRange()!=null&&!packingLibraryUpdateVo.getInvisibleRange().equals(packingLibrary.getInvisibleRange())){ if (packingLibraryUpdateVo.getInvisibleRange()!=null&&!packingLibraryUpdateVo.getInvisibleRange().equals(packingLibrary.getInvisibleRange())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
packingLog.setRemark("将可见范围从"+configCache.getInvisibleRangeMap().get(packingLibrary.getInvisibleRange())+"改为"+configCache.getInvisibleRangeMap().get(packingLibraryUpdateVo.getInvisibleRange())); packingLog.setRemark("将可见范围从"+configCache.getInvisibleRangeMap().getOrDefault(packingLibrary.getInvisibleRange(),"空")+"改为"+configCache.getInvisibleRangeMap().get(packingLibraryUpdateVo.getInvisibleRange()));
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setInvisibleRange(packingLibraryUpdateVo.getInvisibleRange()); packingLibrary.setInvisibleRange(packingLibraryUpdateVo.getInvisibleRange());
...@@ -480,7 +477,7 @@ public class PackingController { ...@@ -480,7 +477,7 @@ public class PackingController {
if (packingLibraryUpdateVo.getType()!=null&&!packingLibraryUpdateVo.getType().equals(packingLibrary.getType())){ if (packingLibraryUpdateVo.getType()!=null&&!packingLibraryUpdateVo.getType().equals(packingLibrary.getType())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
packingLog.setRemark("将形态从"+configCache.getStyleMap().get(packingLibrary.getType())+"改为"+configCache.getStyleMap().get(packingLibraryUpdateVo.getType())); packingLog.setRemark("将形态从"+configCache.getStyleMap().getOrDefault(packingLibrary.getType(),"空")+"改为"+configCache.getStyleMap().get(packingLibraryUpdateVo.getType()));
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setType(packingLibraryUpdateVo.getType()); packingLibrary.setType(packingLibraryUpdateVo.getType());
...@@ -488,7 +485,7 @@ public class PackingController { ...@@ -488,7 +485,7 @@ public class PackingController {
if (packingLibraryUpdateVo.getNature()!=null&&!packingLibraryUpdateVo.getNature().equals(packingLibrary.getNature())){ if (packingLibraryUpdateVo.getNature()!=null&&!packingLibraryUpdateVo.getNature().equals(packingLibrary.getNature())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
packingLog.setRemark("将列装性质从"+configCache.getNatureMap().get(packingLibrary.getNature())+"改为"+configCache.getNatureMap().get(packingLibraryUpdateVo.getNature())); packingLog.setRemark("将列装性质从"+configCache.getNatureMap().getOrDefault(packingLibrary.getNature(),"空")+"改为"+configCache.getNatureMap().get(packingLibraryUpdateVo.getNature()));
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setNature(packingLibraryUpdateVo.getNature()); packingLibrary.setNature(packingLibraryUpdateVo.getNature());
...@@ -506,7 +503,8 @@ public class PackingController { ...@@ -506,7 +503,8 @@ public class PackingController {
if (packingLibraryUpdateVo.getProdUnit()!=null&&!packingLibraryUpdateVo.getProdUnit().equals(packingLibrary.getProdUnit())){ if (packingLibraryUpdateVo.getProdUnit()!=null&&!packingLibraryUpdateVo.getProdUnit().equals(packingLibrary.getProdUnit())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
packingLog.setRemark("将生产单位从"+packingLibrary.getProdUnit()+"改为"+packingLibraryUpdateVo.getProdUnit()); String origin = packingLibrary.getProdUnit()==null?"无":packingLibrary.getProdUnit();
packingLog.setRemark("将生产单位从"+origin+"改为"+packingLibraryUpdateVo.getProdUnit());
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setProdUnit(packingLibraryUpdateVo.getProdUnit()); packingLibrary.setProdUnit(packingLibraryUpdateVo.getProdUnit());
...@@ -514,7 +512,8 @@ public class PackingController { ...@@ -514,7 +512,8 @@ public class PackingController {
if (packingLibraryUpdateVo.getPrice()!=null&&!packingLibraryUpdateVo.getPrice().equals(packingLibrary.getPrice())){ if (packingLibraryUpdateVo.getPrice()!=null&&!packingLibraryUpdateVo.getPrice().equals(packingLibrary.getPrice())){
//添加列装日志 //添加列装日志
PackingLog packingLog = new PackingLog(); PackingLog packingLog = new PackingLog();
packingLog.setRemark("将价格从"+packingLibrary.getPrice()+"改为"+packingLibraryUpdateVo.getPrice()); String origin = packingLibrary.getPrice()==null?"无":packingLibrary.getPrice();
packingLog.setRemark("将价格从"+origin+"改为"+packingLibraryUpdateVo.getPrice());
packingLog.setPackingId(packingLibrary.getId()); packingLog.setPackingId(packingLibrary.getId());
packingLogService.add(packingLog); packingLogService.add(packingLog);
packingLibrary.setPrice(packingLibraryUpdateVo.getPrice()); packingLibrary.setPrice(packingLibraryUpdateVo.getPrice());
......
package com.tykj.dev.device.packing.subject.vo; package com.tykj.dev.device.packing.subject.vo;
import com.tykj.dev.device.library.subject.vo.DeviceLogUserVo;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary; import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -24,5 +24,5 @@ public class PackingDetailVo { ...@@ -24,5 +24,5 @@ public class PackingDetailVo {
private List<PackingLibrary> parts; private List<PackingLibrary> parts;
@ApiModelProperty(name = "业务日志") @ApiModelProperty(name = "业务日志")
private List<TaskLogUserVo> taskLogUserVos; private List<DeviceLogUserVo> deviceLogUserVos;
} }
...@@ -259,7 +259,7 @@ public class RepairController { ...@@ -259,7 +259,7 @@ public class RepairController {
if (detailIds.size()>0){ if (detailIds.size()>0){
detailIds.forEach(integer -> { detailIds.forEach(integer -> {
RepairDetail repairDetail = deviceRepairDetailService.getOne(integer); RepairDetail repairDetail = deviceRepairDetailService.getOne(integer);
if (repairDetail.getRepairStatus()!=1&&repairDetail.getRepairStatus()!=9){ if ((repairDetail.getRepairStatus()!=1&&repairDetail.getRepairStatus()!=9)||repairDetailDao.findAllByPid(repairDetail.getId()).size()>0){
throw new ApiException(ResponseEntity.status(303).body("序列号"+repairDetail.getSeqNumber()+"的装备已被其他专管员操作")); throw new ApiException(ResponseEntity.status(303).body("序列号"+repairDetail.getSeqNumber()+"的装备已被其他专管员操作"));
} }
}); });
...@@ -417,6 +417,16 @@ public class RepairController { ...@@ -417,6 +417,16 @@ public class RepairController {
repairDetail.setLocationUnit(repairBillSaveVo.getReceiveUnit()); repairDetail.setLocationUnit(repairBillSaveVo.getReceiveUnit());
repairDetail.setRepairStatus(1); repairDetail.setRepairStatus(1);
deviceRepairDetailService.update(repairDetail); deviceRepairDetailService.update(repairDetail);
if (repairDetail.getPid()!=null){
RepairDetail repairDetail1 = deviceRepairDetailService.getOne(repairDetail.getPid());
repairDetail1.setLocationUnit(repairBill.getReceiveUnit());
deviceRepairDetailService.update(repairDetail1);
if (repairDetail1.getPid()!=null){
RepairDetail repairDetail2 = deviceRepairDetailService.getOne(repairDetail.getPid());
repairDetail2.setLocationUnit(repairBill.getReceiveUnit());
deviceRepairDetailService.update(repairDetail2);
}
}
}); });
} }
//添加出库白名单 //添加出库白名单
...@@ -541,6 +551,11 @@ public class RepairController { ...@@ -541,6 +551,11 @@ public class RepairController {
repairDetail.setLocationUnit(repairBill.getReceiveUnit()); repairDetail.setLocationUnit(repairBill.getReceiveUnit());
repairDetail.setRepairStatus(1); repairDetail.setRepairStatus(1);
deviceRepairDetailService.update(repairDetail); deviceRepairDetailService.update(repairDetail);
if (repairDetail.getPid()!=null){
RepairDetail repairDetail1 = deviceRepairDetailService.getOne(repairDetail.getPid());
repairDetail1.setLocationUnit(repairBill.getReceiveUnit());
deviceRepairDetailService.update(repairDetail1);
}
}); });
//发送阅知信息 //发送阅知信息
if (repairReceiveVo.getReceiveUserbId()!=null) { if (repairReceiveVo.getReceiveUserbId()!=null) {
......
...@@ -16,4 +16,5 @@ public interface RepairDetailDao extends JpaRepository<RepairDetail, Integer>, J ...@@ -16,4 +16,5 @@ public interface RepairDetailDao extends JpaRepository<RepairDetail, Integer>, J
List<RepairDetail> findAllByRepairStatus(Integer repairStatus); List<RepairDetail> findAllByRepairStatus(Integer repairStatus);
List<RepairDetail> findAllByRepairStatus(Integer repairStatus, Sort s); List<RepairDetail> findAllByRepairStatus(Integer repairStatus, Sort s);
List<RepairDetail> findAllByDeviceId(Integer deviceId); List<RepairDetail> findAllByDeviceId(Integer deviceId);
List<RepairDetail> findAllByPid(Integer pid);
} }
...@@ -145,6 +145,7 @@ public class DeviceRetiredController { ...@@ -145,6 +145,7 @@ public class DeviceRetiredController {
//发送阅知信息 //发送阅知信息
List<Integer> userIds = userPublicService.findOtherUser(userUtils.getCurrentUserId()); List<Integer> userIds = userPublicService.findOtherUser(userUtils.getCurrentUserId());
MessageBto messageBto = new MessageBto(task.getId(),task.getBusinessType(),"业务办结",userIds,0); MessageBto messageBto = new MessageBto(task.getId(),task.getBusinessType(),"业务办结",userIds,0);
messageBto.setRecord(String.valueOf(task.getBillId()));
messageService.add(messageBto); messageService.add(messageBto);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResultUtil.success("退装申请成功"); return ResultUtil.success("退装申请成功");
......
...@@ -207,7 +207,7 @@ public class StatisticalController { ...@@ -207,7 +207,7 @@ public class StatisticalController {
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ); SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
List<DeviceLibrary> resultList = deviceLibraryService.getAllList(deviceLibrarySelectVo); List<DeviceLibrary> resultList = deviceLibraryService.getAllList(deviceLibrarySelectVo);
resultList.forEach(DeviceLibrary::setConfigName); resultList.forEach(DeviceLibrary::setConfigName);
if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim) { if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim||hasYear) {
resultList = resultList.stream().filter(deviceLibrary -> { resultList = resultList.stream().filter(deviceLibrary -> {
Boolean containModelDim = !hasModelDim||deviceLibrary.getModel().contains(deviceLibrarySelectVo.getModelDim()); Boolean containModelDim = !hasModelDim||deviceLibrary.getModel().contains(deviceLibrarySelectVo.getModelDim());
Boolean containNameDim = !hasNameDim||deviceLibrary.getName().contains(deviceLibrarySelectVo.getNameDim()); Boolean containNameDim = !hasNameDim||deviceLibrary.getName().contains(deviceLibrarySelectVo.getNameDim());
......
...@@ -208,6 +208,7 @@ public class StorageBillController { ...@@ -208,6 +208,7 @@ public class StorageBillController {
//是否申请业务导入 //是否申请业务导入
List<DeviceApplyBill> deviceApplyBills = new ArrayList<>(); List<DeviceApplyBill> deviceApplyBills = new ArrayList<>();
Map<Integer, ApplyBillDetailVo> map = new HashMap<>(); Map<Integer, ApplyBillDetailVo> map = new HashMap<>();
Boolean isPrint = storageBillSaveVo.getIsPrint() != 0;
if (storageBillSaveVo.getApplyTaskIds()!=null&&storageBillSaveVo.getApplyTaskIds().size()>0){ if (storageBillSaveVo.getApplyTaskIds()!=null&&storageBillSaveVo.getApplyTaskIds().size()>0){
for (Integer id:storageBillSaveVo.getApplyTaskIds()) { for (Integer id:storageBillSaveVo.getApplyTaskIds()) {
TaskBto taskBto1 = taskService.get(id); TaskBto taskBto1 = taskService.get(id);
...@@ -269,6 +270,10 @@ public class StorageBillController { ...@@ -269,6 +270,10 @@ public class StorageBillController {
deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName()); deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName()); deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setPartParentId(null); deviceLibraryEntity.setPartParentId(null);
//如果未打印标签,表面号清空
if (!isPrint){
deviceLibraryEntity.setRfidSurfaceId(null);
}
if (deviceLibraryEntity.getRfidCardId()==null||"".equals(deviceLibraryEntity.getRfidCardId())){ if (deviceLibraryEntity.getRfidCardId()==null||"".equals(deviceLibraryEntity.getRfidCardId())){
deviceLibraryEntity.setRfidCardId(null); deviceLibraryEntity.setRfidCardId(null);
} }
......
...@@ -150,6 +150,9 @@ public class StorageBill { ...@@ -150,6 +150,9 @@ public class StorageBill {
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)") @ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0; private Integer deleteTag = 0;
@ApiModelProperty(value = "是否打印标签(0:未打印,1:已打印)")
private Integer isPrint;
@ApiModelProperty(value = "经办人") @ApiModelProperty(value = "经办人")
@Transient @Transient
private String receiveUserA; private String receiveUserA;
......
...@@ -28,6 +28,9 @@ public class StorageBillSaveVo { ...@@ -28,6 +28,9 @@ public class StorageBillSaveVo {
@ApiModelProperty(value = "任务Id") @ApiModelProperty(value = "任务Id")
private Integer taskId; private Integer taskId;
@ApiModelProperty(value = "是否打印rfid标签(1:是,0:否)")
private Integer isPrint = 0;
@ApiModelProperty(value = "导入申请任务Id集合") @ApiModelProperty(value = "导入申请任务Id集合")
private List<Integer> applyTaskIds; private List<Integer> applyTaskIds;
......
...@@ -73,6 +73,8 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE ...@@ -73,6 +73,8 @@ public interface TaskDao extends JpaRepository<Task, Integer>, JpaSpecificationE
List<Task> findAllByBusinessType(Integer businessType); List<Task> findAllByBusinessType(Integer businessType);
List<Task> findAllByBusinessTypeAndBillStatus(Integer businessType,Integer billStatus);
List<Task> findAllByBillIdInAndBusinessType(List<Integer> ids,Integer type); List<Task> findAllByBillIdInAndBusinessType(List<Integer> ids,Integer type);
List<Task> findAllByBusinessTypeAndCustomInfo(Integer businessType,String customInfo); List<Task> findAllByBusinessTypeAndCustomInfo(Integer businessType,String customInfo);
......
...@@ -898,7 +898,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -898,7 +898,7 @@ public class TaskServiceImpl implements TaskService {
//查询跟踪 //查询跟踪
if (taskSelectVo.getSelectNum() == 3) { if (taskSelectVo.getSelectNum() == 3) {
//所有涉及人员所在单位包含当前用户所在单位且指针对应UserId不是当前用户 //所有涉及人员所在单位包含当前用户所在单位且指针对应UserId不是当前用户
List<Integer> status = Arrays.asList(201,333,810,322,722,788,1250,2223,8110,888); List<Integer> status = Arrays.asList(201,333,810,322,722,788,1250,2223,8110,888,140);
List<TaskBto> taskBtoList = taskBtos.stream() List<TaskBto> taskBtoList = taskBtos.stream()
.filter(taskBto -> { .filter(taskBto -> {
// boolean unitExists = getUnitsByUsers(taskBto.getInvolveUserIdList()).contains(unitId); // boolean unitExists = getUnitsByUsers(taskBto.getInvolveUserIdList()).contains(unitId);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论