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

更新

上级 6298624e
......@@ -484,17 +484,24 @@ public class DeviceApplyController {
for (ReplyVo replyVo : replyVos){
seqs.addAll(DeviceSeqUtil.selectDeviceSeqs(replyVo.getSeqInterval()));
}
Set<Integer> lifeStatus = deviceLibraryService.findAllBySeqNumber(seqs).stream().map(DeviceLibrary::getLifeStatus).collect(Collectors.toSet());
List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllBySeqNumber(seqs);
Set<Integer> lifeStatus = deviceLibraries.stream().map(DeviceLibrary::getLifeStatus).collect(Collectors.toSet());
Set<Integer> integers = new HashSet<>();
integers.add(11);
if (deviceApplyBill.getApplyType()==2) {
integers.add(15);
integers.add(12);
integers.add(16);
}
if (deviceApplyBill.getApplyType()==3){
integers.add(17);
integers.add(5);
integers.add(18);
}
if (deviceApplyBill.getApplyType()==4){
integers.add(19);
integers.add(10);
integers.add(20);
}
if (integers.containsAll(lifeStatus)){
return ResponseEntity.ok(true);
......
......@@ -25,6 +25,6 @@ public interface DeviceApplyBillService {
/**
* @param scriptSaveVos 退役/报废/销毁装备单据详情
*/
void updateCompleteNum(List<ScriptSaveVo> scriptSaveVos);
void updateCompleteNum(Integer applyType , List<ScriptSaveVo> scriptSaveVos);
}
......@@ -63,9 +63,6 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
@Autowired
private UserUtils userUtils;
@Autowired
private DeviceApplyBillService deviceApplyBillService;
@Override
public DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity) {
DeviceApplyBill deviceApplyBill = deviceApplyBillDao.save(deviceApplyBillEntity);
......@@ -112,7 +109,7 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
}
@Override
public void updateCompleteNum(List<ScriptSaveVo> scriptSaveVos) {
public void updateCompleteNum(Integer applyType,List<ScriptSaveVo> scriptSaveVos) {
Map<Integer, Task> taskMap = taskDao.findAllByBusinessTypeAndBillStatus(9, StatusEnum.WAIT_CONFIRM_APPLY_DEVICE.id).stream().collect(Collectors.toMap(Task::getId, Function.identity()));
Map<Integer, DeviceApplyBill> billMap = deviceApplyBillDao.findAll().stream().collect(Collectors.toMap(DeviceApplyBill::getId,Function.identity()));
Map<String, DeviceLibrary> seqMap = deviceLibraryService.getAllDeviceSeqMap();
......@@ -146,7 +143,24 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
}
if (!isComplete){
Set<Integer> lifeStatus = deviceLibraryList.stream().map(DeviceLibrary::getLifeStatus).collect(Collectors.toSet());
if (lifeStatus.size()==1&&lifeStatus.iterator().next()==11){
Set<Integer> integers = new HashSet<>();
integers.add(11);
if (applyType==2) {
integers.add(15);
integers.add(12);
integers.add(16);
}
if (applyType==3){
integers.add(17);
integers.add(5);
integers.add(18);
}
if (applyType==4){
integers.add(19);
integers.add(10);
integers.add(20);
}
if (integers.containsAll(lifeStatus)){
isComplete = true;
}
}
......@@ -162,7 +176,7 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
messageService.add(messageBto);
}
deviceApplyBill.setApplyStat(JacksonUtil.toJSon(replyVos));
deviceApplyBillService.update(deviceApplyBill);
update(deviceApplyBill);
}
}
}
......
......@@ -88,7 +88,7 @@ public class DeviceApplyBill {
/**
* 申请状态(0:申请待审核,1:申请审核失败,2:申请中,3:已批复待审核,4:批复审核失败,5:申请成功)
*/
@ApiModelProperty(value = "申请状态(0:申请待审核,1:申请审核失败,2:申请完结,3:等待中办回执单,4:等待确认接收中办装备)")
@ApiModelProperty(value = "申请状态(0:申请待审核,1:申请审核失败,2:申请完结,3:等待中办批复,4:批复后待执行)")
private Integer applyStatus;
/**
* 列装库主键idx数量(,作为分隔符),例如1x2,2x3,意为列装库id为1的申请2件,id为2的申请3件
......
......@@ -162,6 +162,7 @@ public class DeviceLibraryController {
@ApiOperation(value = "模糊查询核心装备分页", notes = "可以通过这个接口查询装备列表")
@PostMapping("/core/feature/summary")
public ResponseEntity selectCoreDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
// long strat = System.currentTimeMillis();
Boolean hasModelDim = deviceLibrarySelectVo.getModelDim()!=null;
Boolean hasNameDim = deviceLibrarySelectVo.getNameDim()!=null;
Boolean hasSeqDim = deviceLibrarySelectVo.getSeqDim()!=null;
......@@ -171,7 +172,6 @@ public class DeviceLibraryController {
Boolean hasUpdateTimeDim = deviceLibrarySelectVo.getUpdateTimeDim()!=null;
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
List<DeviceLibrary> resultList = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
resultList.forEach(DeviceLibrary::setConfigName);
if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim) {
resultList = resultList.stream().filter(deviceLibrary -> {
Boolean containModelDim = !hasModelDim||deviceLibrary.getModel().contains(deviceLibrarySelectVo.getModelDim());
......@@ -184,17 +184,29 @@ public class DeviceLibraryController {
return containModelDim&&containNameDim&&containSeqDim&&containLocationUnitDim&&containOwnUnitDim&&containLifeStatusDim&&containUpdateTimeDim;
}).collect(Collectors.toList());
}
List<DeviceVo> deviceVos = resultList.stream().map(DeviceLibrary::parseVo).collect(Collectors.toList());
Page<DeviceVo> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceVos, deviceLibrarySelectVo.getPageable());
// List<DeviceVo> deviceVos = resultList.stream().map(DeviceLibrary::parseVo).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 = deviceVos.stream().map(DeviceVo::getLifeStatus).collect(Collectors.toSet());
Set<Integer> status = new HashSet<>();
Set<String> models = new HashSet<>();
Set<String> names = new HashSet<>();
Set<String> ownUnits = new HashSet<>();
Set<String> locationUnits = new HashSet<>();
resultList.forEach(deviceVo -> {
status.add(deviceVo.getLifeStatus());
models.add(deviceVo.getModel());
names.add(deviceVo.getName());
ownUnits.add(deviceVo.getOwnUnit());
locationUnits.add(deviceVo.getLocationUnit());
});
map.put("pages",deviceLibraryEntities);
map.put("models",deviceVos.stream().map(DeviceVo::getModel).collect(Collectors.toSet()));
map.put("names",deviceVos.stream().map(DeviceVo::getName).collect(Collectors.toSet()));
map.put("ownUnits",deviceVos.stream().map(DeviceVo::getOwnUnit).collect(Collectors.toSet()));
map.put("locationUnits",deviceVos.stream().map(DeviceVo::getLocationUnit).collect(Collectors.toSet()));
map.put("models",models);
map.put("names",names);
map.put("ownUnits",ownUnits);
map.put("locationUnits",locationUnits);
map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
// System.out.println("时间:"+(System.currentTimeMillis()-strat));
return ResultUtil.success(map);
}
......
......@@ -120,7 +120,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
// if (deviceLibrarySelectVo.getContent()!=null){
// resultList = resultList.stream().filter(deviceLibrary -> deviceLibrary.getKeyWords().contains(deviceLibrarySelectVo.getContent())).collect(Collectors.toList());
// }
return GetTreeUtils.splitTree(libraryEntities,DeviceLibrary::getChilds,DeviceLibrary::setChildNull);
// return GetTreeUtils.splitTree(libraryEntities,DeviceLibrary::getChilds,DeviceLibrary::setChildNull);
return libraryEntities;
}
//areId不为空,查询某个区域下的所有单位的所有装备
else {
......@@ -133,7 +134,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
List<DeviceLibrary> libraryEntities = getAllList(deviceLibrarySelectVo).stream()
.filter(deviceLibraryEntity -> units.contains(deviceLibraryEntity.getOwnUnit()))
.collect(Collectors.toList());
List<DeviceLibrary> deviceLibraries = getList4(libraryEntities);
// List<DeviceLibrary> deviceLibraries = getList4(libraryEntities);
// List<DeviceLibrary> resultList = new ArrayList<>();
// for (DeviceLibrary d : deviceLibraries) {
// resultList.add(d);
......@@ -144,7 +145,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
// if (deviceLibrarySelectVo.getContent()!=null){
// resultList = resultList.stream().filter(deviceLibrary -> deviceLibrary.getKeyWords().contains(deviceLibrarySelectVo.getContent())).collect(Collectors.toList());
// }
return GetTreeUtils.splitTree(deviceLibraries,DeviceLibrary::getChilds,DeviceLibrary::setChildNull);
// return GetTreeUtils.splitTree(deviceLibraries,DeviceLibrary::getChilds,DeviceLibrary::setChildNull);
return libraryEntities;
}
//省能看到所有装备
if (selectLevel == 1) {
......@@ -152,7 +154,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
List<DeviceLibrary> deviceLibraries = getAllList(deviceLibrarySelectVo).stream()
.filter(deviceLibraryEntity -> !unitNames.contains(deviceLibraryEntity.getOwnUnit()))
.collect(Collectors.toList());
List<DeviceLibrary> libraryEntities = getList4(deviceLibraries);
// List<DeviceLibrary> libraryEntities = getList4(deviceLibraries);
// List<DeviceLibrary> resultList = new ArrayList<>();
// for (DeviceLibrary d : libraryEntities) {
// resultList.add(d);
......@@ -163,7 +165,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
// if (deviceLibrarySelectVo.getContent()!=null){
// resultList = resultList.stream().filter(deviceLibrary -> deviceLibrary.getKeyWords().contains(deviceLibrarySelectVo.getContent())).collect(Collectors.toList());
// }
return GetTreeUtils.splitTree(libraryEntities,DeviceLibrary::getChilds,DeviceLibrary::setChildNull);
// return GetTreeUtils.splitTree(libraryEntities,DeviceLibrary::getChilds,DeviceLibrary::setChildNull);
return deviceLibraries;
} else {
throw new ApiException(ResultUtil.failed("区域等级只能为1,2,3"));
}
......@@ -333,27 +336,29 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
public List<DeviceLibrary> getList2(DeviceLibrarySelectVo deviceLibrarySelectVo) {
List<DeviceLibrary> deviceLibraryEntities = deviceLibraryDao.findAll(getSelectSpecification6(deviceLibrarySelectVo),deviceLibrarySelectVo.getPageable().getSort());
//返回父子结构
Map<Integer, DeviceLibrary> nodeCollect =
deviceLibraryEntities.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity));
return GetTreeUtils.parseTreeFromDown(
deviceLibraryEntities,
DeviceLibrary::getId,
deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())),
DeviceLibrary::addChildNode
);
// Map<Integer, DeviceLibrary> nodeCollect =
// deviceLibraryEntities.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity));
// return GetTreeUtils.parseTreeFromDown(
// deviceLibraryEntities,
// DeviceLibrary::getId,
// deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())),
// DeviceLibrary::addChildNode
// );
return deviceLibraryEntities;
}
public List<DeviceLibrary> getList3(DeviceLibrarySelectVo deviceLibrarySelectVo, String name) {
List<DeviceLibrary> deviceLibraryEntities = deviceLibraryDao.findAll(getSelectSpecification2(deviceLibrarySelectVo, name),deviceLibrarySelectVo.getPageable().getSort());
//返回父子结构
Map<Integer, DeviceLibrary> nodeCollect =
deviceLibraryEntities.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity));
return GetTreeUtils.parseTreeFromDown(
deviceLibraryEntities,
DeviceLibrary::getId,
deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())),
DeviceLibrary::addChildNode
);
// Map<Integer, DeviceLibrary> nodeCollect =
// deviceLibraryEntities.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity));
// return GetTreeUtils.parseTreeFromDown(
// deviceLibraryEntities,
// DeviceLibrary::getId,
// deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())),
// DeviceLibrary::addChildNode
// );
return deviceLibraryEntities;
}
public List<DeviceLibrary> getList4(List<DeviceLibrary> deviceLibraryEntities) {
......
......@@ -921,6 +921,11 @@ public class RepairController {
ids.add(repairDetail1.getId());
messageMap.put(unitId,ids);
}
if (repairDetail1.getPid()!=null){
RepairDetail repairDetail2 = deviceRepairDetailService.getOne(repairDetail1.getPid());
repairDetail2.setLocationUnit(repairBackBill.getReceiveUnit());
deviceRepairDetailService.update(repairDetail2);
}
}
deviceRepairDetailService.update(repairDetail);
}
......@@ -952,6 +957,11 @@ public class RepairController {
ids.add(repairDetail1.getId());
messageMap.put(unitId,ids);
}
if (repairDetail1.getPid()!=null){
RepairDetail repairDetail2 = deviceRepairDetailService.getOne(repairDetail1.getPid());
repairDetail2.setLocationUnit(repairBackBill.getReceiveUnit());
deviceRepairDetailService.update(repairDetail2);
}
}
deviceRepairDetailService.update(repairDetail);
});
......@@ -1731,6 +1741,11 @@ public class RepairController {
integers.add(repairDetail1.getId());
messageMap.put(unitId,integers);
}
if (repairDetail1.getPid()!=null){
RepairDetail repairDetail2 = deviceRepairDetailService.getOne(repairDetail1.getPid());
repairDetail2.setLocationUnit(repairBackBill.getReceiveUnit());
deviceRepairDetailService.update(repairDetail2);
}
}
deviceRepairDetailService.update(repairDetail);
});
......@@ -1821,6 +1836,11 @@ public class RepairController {
repairDetail.setLocationUnit(repairBill.getReceiveUnit());
repairDetail.setRepairStatus(1);
deviceRepairDetailService.update(repairDetail);
if (repairDetail.getPid()!=null){
RepairDetail repairDetail1 = deviceRepairDetailService.getOne(repairDetail.getPid());
repairDetail1.setLocationUnit(repairBill.getReceiveUnit());
deviceRepairDetailService.update(repairDetail1);
}
});
if (idList.size()>0) {
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为经办人", idList, 1);
......
......@@ -14,10 +14,8 @@ import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.socket.MyWebSocket;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.Date;
......@@ -49,7 +47,7 @@ public class TrainTask {
@Autowired
TrainThemeDao trainThemeDao;
@Scheduled(cron = "0 0/1 * * * ?")
@Scheduled(cron = "0 0/1 0 * * ? ")
private void signUpDeadline() {
trainThemeService.findAllStatus(StatusEnum.TRAIN1000.id).forEach(
trainTheme -> {
......@@ -81,7 +79,7 @@ public class TrainTask {
}
@Scheduled(cron = "0 0/1 * * * ?")
@Scheduled(cron = "0 0/1 0 * * ? ")
private void trainingStarted() {
long time=new Date().getTime();
trainThemeService.findAllStatus(StatusEnum.TRAIN1010.id).forEach(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论