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

更新

上级 7b90a5e9
...@@ -229,9 +229,7 @@ public class AllotBillController { ...@@ -229,9 +229,7 @@ public class AllotBillController {
PackingLibrary packingLibrary = packingLibraryService.getOne(deviceLibraryEntity.getPackingId()); PackingLibrary packingLibrary = packingLibraryService.getOne(deviceLibraryEntity.getPackingId());
PackingLibrary packingLibrary1 = packingLibraryService.findSamePacking(packingLibrary.getPartParentId(),1); PackingLibrary packingLibrary1 = packingLibraryService.findSamePacking(packingLibrary.getPartParentId(),1);
if (packingLibrary1==null){ if (packingLibrary1==null){
Map<String,Object> map = new HashMap<>(); throw new ApiException(ResponseEntity.status(20000).body(new ResultObj("序列号为"+deviceLibraryEntity.getSeqNumber()+"的装备所属列装不存在配用范围为省对下纵向的列装装备")));
map.put("error","序列号为"+deviceLibraryEntity.getSeqNumber()+"的装备所属列装不存在配用范围为省对下纵向的列装装备");
return ResponseEntity.ok(map);
} }
else { else {
deviceLibraryEntity.setPackingId(packingLibrary1.getId()); deviceLibraryEntity.setPackingId(packingLibrary1.getId());
...@@ -254,9 +252,7 @@ public class AllotBillController { ...@@ -254,9 +252,7 @@ public class AllotBillController {
PackingLibrary packingLibrary = packingLibraryService.getOne(deviceLibraryEntity.getPackingId()); PackingLibrary packingLibrary = packingLibraryService.getOne(deviceLibraryEntity.getPackingId());
PackingLibrary packingLibrary1 = packingLibraryService.findSamePacking(packingLibrary.getPartParentId(), 3); PackingLibrary packingLibrary1 = packingLibraryService.findSamePacking(packingLibrary.getPartParentId(), 3);
if (packingLibrary1 == null) { if (packingLibrary1 == null) {
Map<String, Object> map = new HashMap<>(); throw new ApiException(ResponseEntity.status(20000).body(new ResultObj("序列号为" + deviceLibraryEntity.getSeqNumber() + "的装备所属列装不存在配用范围为省对下横向的列装装备")));
map.put("error", "序列号为" + deviceLibraryEntity.getSeqNumber() + "的装备所属列装不存在配用范围为省对下横向的列装装备");
return ResponseEntity.ok(map);
} }
else { else {
changeMap.put(deviceLibraryEntity.getPackingId(),packingLibrary1.getId()); changeMap.put(deviceLibraryEntity.getPackingId(),packingLibrary1.getId());
......
...@@ -332,8 +332,17 @@ public class BackController { ...@@ -332,8 +332,17 @@ public class BackController {
allotBackBill.setReceiveUserbId(fileVo.getReceiveUserbId()); allotBackBill.setReceiveUserbId(fileVo.getReceiveUserbId());
idList.add(fileVo.getReceiveUserbId()); idList.add(fileVo.getReceiveUserbId());
} }
if (fileVo.getSendUserbId()!=null){
allotBackBill.setSendUserbId(fileVo.getSendUserbId());
allotBackBill.setAgent(userPublicService.getOne(fileVo.getSendUserbId()).getName());
List<Integer> idList1 = new ArrayList<>();
idList1.add(fileVo.getSendUserbId());
MessageBto messageBto = new MessageBto(taskBto.getId(), taskBto.getBusinessType(), "被选为签发人", idList1, 1);
messageService.add(messageBto);
}
//保存账单 //保存账单
allotBackBill.setSendFiles(FilesUtil.stringFileToList(fileVo.getAllotFiles())); allotBackBill.setSendFiles(FilesUtil.stringFileToList(fileVo.getAllotFiles()));
allotBackBill.setBackStatus(3);
allotBackBillService.update(allotBackBill); allotBackBillService.update(allotBackBill);
List<Integer> ids = StringSplitUtil.split(allotBackBill.getBackCheckDetail()); List<Integer> ids = StringSplitUtil.split(allotBackBill.getBackCheckDetail());
//业务完结 //业务完结
......
package com.tykj.dev.device.allot.controller;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.allot.service.AllotBillService;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.user.util.UserUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author dengdiyi
*/
@RestController
@RequestMapping(value = "/batchAllot")
@AutoDocument
@Api(tags = "装备配发模块", description = "装备配发接口")
@Slf4j
public class BatchAllotController {
@Autowired
private AllotBillService allotBillService;
@Autowired
private UserUtils userUtils;
@Autowired
private TaskService taskService;
@Autowired
private DeviceLibraryService deviceLibraryService;
@Autowired
private DeviceLogService deviceLogService;
@ApiOperation(value = "发起批量配发")
@PostMapping(value = "/createBatchAllot")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity createBatchAllot(){
return ResponseEntity.ok("");
}
}
package com.tykj.dev.device.library.controller; package com.tykj.dev.device.library.controller;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.config.cache.ConfigCache; import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
...@@ -27,6 +29,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -27,6 +29,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -134,10 +137,15 @@ public class DeviceLibraryController { ...@@ -134,10 +137,15 @@ public class DeviceLibraryController {
@ApiOperation(value = "查询检查装备列表", notes = "可以通过这个接口查询装备列表") @ApiOperation(value = "查询检查装备列表", notes = "可以通过这个接口查询装备列表")
@GetMapping("/selectCheckDeviceList") @GetMapping("/selectCheckDeviceList")
public ResponseEntity selectDeviceList() { public ResponseEntity selectDeviceList() {
List<DeviceLibrary> deviceLibraryEntities = deviceLibraryService.getCheckList(); String unit = userUtils.getCurrentUserUnitName();
deviceLibraryEntities.forEach(DeviceLibrary::setConfigName); PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
List<DeviceLibrary> deviceLibraries = deviceLibraryService.getNotInStockList(); predicateBuilder.eq("ownUnit", unit);
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build());
deviceLibraries.forEach(DeviceLibrary::setConfigName); deviceLibraries.forEach(DeviceLibrary::setConfigName);
List<DeviceLibrary> deviceLibraryEntities = deviceLibraries.stream()
.filter(deviceLibrary -> deviceLibrary.getLocationUnit().equals(unit))
.collect(Collectors.toList());
deviceLibraries.removeAll(deviceLibraryEntities);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("stockDevices",deviceLibraryEntities); map.put("stockDevices",deviceLibraryEntities);
map.put("notInStockDevices",deviceLibraries); map.put("notInStockDevices",deviceLibraries);
...@@ -154,77 +162,38 @@ public class DeviceLibraryController { ...@@ -154,77 +162,38 @@ public class DeviceLibraryController {
@ApiOperation(value = "模糊查询核心装备分页", notes = "可以通过这个接口查询装备列表") @ApiOperation(value = "模糊查询核心装备分页", notes = "可以通过这个接口查询装备列表")
@PostMapping("/core/feature/summary") @PostMapping("/core/feature/summary")
public ResponseEntity selectCoreDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) { public ResponseEntity selectCoreDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
List<DeviceVo> resultList = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo).stream().map(DeviceLibrary::parseVo).collect(Collectors.toList()); Boolean hasModelDim = deviceLibrarySelectVo.getModelDim()!=null;
// resultList.forEach(deviceVo -> deviceVo.setChilds(null)); Boolean hasNameDim = deviceLibrarySelectVo.getNameDim()!=null;
// List<Comparator<DeviceVo>> comparators = new ArrayList<>(); Boolean hasSeqDim = deviceLibrarySelectVo.getSeqDim()!=null;
// if (deviceLibrarySelectVo.getOrders().size() > 0) { Boolean hasLocationUnitDim = deviceLibrarySelectVo.getLocationUnitDim()!=null;
// for (CustomOrder c:deviceLibrarySelectVo.getOrders()) { Boolean hasOwnUnitDim = deviceLibrarySelectVo.getOwnUnitDim()!=null;
// if ("model".equals(c.getCoulmn())){ Boolean hasLifeStatusDim = deviceLibrarySelectVo.getLifeStatusDim()!=null;
// if ("ASC".equals(c.getDirection().toString())) { Boolean hasUpdateTimeDim = deviceLibrarySelectVo.getUpdateTimeDim()!=null;
// comparators.add(Comparator.comparing(DeviceVo::getModel,Comparator.nullsFirst(String::compareTo))); SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
// } List<DeviceLibrary> resultList = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
// else if ("DESC".equals(c.getDirection().toString())) { resultList.forEach(DeviceLibrary::setConfigName);
// comparators.add(Comparator.comparing(DeviceVo::getModel,Comparator.nullsFirst(String::compareTo)).reversed()); if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim) {
// } resultList = resultList.stream().filter(deviceLibrary -> {
// } Boolean containModelDim = !hasModelDim||deviceLibrary.getModel().contains(deviceLibrarySelectVo.getModelDim());
// else if ("name".equals(c.getCoulmn())){ Boolean containNameDim = !hasNameDim||deviceLibrary.getName().contains(deviceLibrarySelectVo.getNameDim());
// if ("ASC".equals(c.getDirection().toString())) { Boolean containSeqDim = !hasSeqDim||deviceLibrary.getSeqNumber().contains(deviceLibrarySelectVo.getSeqDim());
// comparators.add(Comparator.comparing(DeviceVo::getName,Comparator.nullsFirst(String::compareTo))); Boolean containLocationUnitDim = !hasLocationUnitDim||deviceLibrary.getLocationUnit().contains(deviceLibrarySelectVo.getLocationUnitDim());
// } Boolean containOwnUnitDim = !hasOwnUnitDim||deviceLibrary.getOwnUnit().contains(deviceLibrarySelectVo.getOwnUnitDim());
// else if ("DESC".equals(c.getDirection().toString())) { Boolean containLifeStatusDim = !hasLifeStatusDim||deviceLibrary.getLifeStatusName().contains(deviceLibrarySelectVo.getLifeStatusDim());
// comparators.add(Comparator.comparing(DeviceVo::getName,Comparator.nullsFirst(String::compareTo)).reversed()); Boolean containUpdateTimeDim = !hasUpdateTimeDim||sdf.format(deviceLibrary.getUpdateTime()).contains(deviceLibrarySelectVo.getUpdateTimeDim());
// } return containModelDim&&containNameDim&&containSeqDim&&containLocationUnitDim&&containOwnUnitDim&&containLifeStatusDim&&containUpdateTimeDim;
// } }).collect(Collectors.toList());
// else if ("seqNumber".equals(c.getCoulmn())){ }
// if ("ASC".equals(c.getDirection().toString())) { List<DeviceVo> deviceVos = resultList.stream().map(DeviceLibrary::parseVo).collect(Collectors.toList());
// comparators.add(Comparator.comparing(DeviceVo::getSeqNumber,Comparator.nullsFirst(String::compareTo))); Page<DeviceVo> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceVos, deviceLibrarySelectVo.getPageable());
// }
// else if ("DESC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getSeqNumber,Comparator.nullsFirst(String::compareTo)).reversed());
// }
// }
// else if ("locationUnit".equals(c.getCoulmn())){
// if ("ASC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getLocationUnit,Comparator.nullsFirst(String::compareTo)));
// }
// else if ("DESC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getLocationUnit,Comparator.nullsFirst(String::compareTo)).reversed());
// }
// }
// else if ("ownUnit".equals(c.getCoulmn())){
// if ("ASC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getOwnUnit,Comparator.nullsFirst(String::compareTo)));
// }
// else if ("DESC".equals(c.getDirection().toString())) {
// comparators.add(Comparator.comparing(DeviceVo::getOwnUnit,Comparator.nullsFirst(String::compareTo)).reversed());
// }
// }
// }
// if (comparators.size()==1){
// resultList = resultList.stream().sorted(comparators.get(0)).collect(Collectors.toList());
// }
// else if(comparators.size()==2){
// resultList = resultList.stream().sorted(comparators.get(0).thenComparing(comparators.get(1))).collect(Collectors.toList());
// }
// else if(comparators.size()==3){
// resultList = resultList.stream().sorted(comparators.get(0).thenComparing(comparators.get(1)).thenComparing(comparators.get(2))).collect(Collectors.toList());
// }
// else if(comparators.size()==4){
// resultList = resultList.stream().sorted(comparators.get(0).thenComparing(comparators.get(1)).thenComparing(comparators.get(2)).thenComparing(comparators.get(3))).collect(Collectors.toList());
// }
// else if(comparators.size()==5){
// resultList = resultList.stream().sorted(comparators.get(0).thenComparing(comparators.get(1)).thenComparing(comparators.get(2)).thenComparing(comparators.get(3)).thenComparing(comparators.get(4))).collect(Collectors.toList());
// }
// }
Page<DeviceVo> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), resultList, deviceLibrarySelectVo.getPageable());
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
Map<Integer,String> lifeStatusMap = configCache.getLifeStatusMap(); Map<Integer,String> lifeStatusMap = configCache.getLifeStatusMap();
Set<Integer> status = resultList.stream().map(DeviceVo::getLifeStatus).collect(Collectors.toSet()); Set<Integer> status = deviceVos.stream().map(DeviceVo::getLifeStatus).collect(Collectors.toSet());
map.put("pages",deviceLibraryEntities); map.put("pages",deviceLibraryEntities);
map.put("models",resultList.stream().map(DeviceVo::getModel).collect(Collectors.toSet())); map.put("models",deviceVos.stream().map(DeviceVo::getModel).collect(Collectors.toSet()));
map.put("names",resultList.stream().map(DeviceVo::getName).collect(Collectors.toSet())); map.put("names",deviceVos.stream().map(DeviceVo::getName).collect(Collectors.toSet()));
map.put("ownUnits",resultList.stream().map(DeviceVo::getOwnUnit).collect(Collectors.toSet())); map.put("ownUnits",deviceVos.stream().map(DeviceVo::getOwnUnit).collect(Collectors.toSet()));
map.put("locationUnits",resultList.stream().map(DeviceVo::getLocationUnit).collect(Collectors.toSet())); map.put("locationUnits",deviceVos.stream().map(DeviceVo::getLocationUnit).collect(Collectors.toSet()));
map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList())); map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
return ResultUtil.success(map); return ResultUtil.success(map);
} }
......
...@@ -98,4 +98,7 @@ public class DeviceLibrarySelectVo extends CustomPage { ...@@ -98,4 +98,7 @@ public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "生命状态模糊查询字段") @ApiModelProperty(value = "生命状态模糊查询字段")
private String lifeStatusDim; private String lifeStatusDim;
@ApiModelProperty(value = "更新时间模糊查询字段")
private String updateTimeDim;
} }
...@@ -240,7 +240,7 @@ public enum StatusEnum { ...@@ -240,7 +240,7 @@ public enum StatusEnum {
WAIT_UPLOAD_FILE(704, "等待上传签收单"), WAIT_UPLOAD_FILE(704, "等待上传签收单"),
WAIT_UPLOAD_SEND_FILE(722, "等待上传回执单"), WAIT_UPLOAD_SEND_FILE(722, "等待上传回执单"),
COUNTRY_REPAIRING(777, "等待接收维修退回装备"), COUNTRY_REPAIRING(777, "等待接收维修退回装备"),
REPAIR_SEND_DRAFT(788,"草稿"), REPAIR_SEND_DRAFT(788,"等待出库"),
REPAIR_SEND_SIGN_WAIT_CONFIRM(790,"申请签章待审核"), REPAIR_SEND_SIGN_WAIT_CONFIRM(790,"申请签章待审核"),
REPAIR_SEND_WAIT_SIGN(791,"等待盖章"), REPAIR_SEND_WAIT_SIGN(791,"等待盖章"),
/** /**
...@@ -253,7 +253,7 @@ public enum StatusEnum { ...@@ -253,7 +253,7 @@ public enum StatusEnum {
WAIT_UPLOAD_BACK_SEND_FILE(810, "等待上传回执单"), WAIT_UPLOAD_BACK_SEND_FILE(810, "等待上传回执单"),
REPAIR_BACK_SIGN_WAIT_CONFIRM(820,"申请签章待审核"), REPAIR_BACK_SIGN_WAIT_CONFIRM(820,"申请签章待审核"),
REPAIR_BACK_WAIT_SIGN(821,"等待盖章"), REPAIR_BACK_WAIT_SIGN(821,"等待盖章"),
REPAIR_BACK_DRAFT(888,"草稿"), REPAIR_BACK_DRAFT(888,"等待出库"),
/** /**
* 配发退回状态 * 配发退回状态
......
...@@ -4,8 +4,10 @@ import com.tykj.dev.misc.exception.ApiException; ...@@ -4,8 +4,10 @@ import com.tykj.dev.misc.exception.ApiException;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import java.math.BigInteger; import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -29,6 +31,8 @@ public class DeviceSeqUtil { ...@@ -29,6 +31,8 @@ public class DeviceSeqUtil {
list.add("生成1"); list.add("生成1");
list.add(""); list.add("");
System.out.println(getContinuousSeqs(list)); System.out.println(getContinuousSeqs(list));
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
System.out.println(sdf.format(new Date()));
} }
/** /**
......
...@@ -361,6 +361,11 @@ public class PackingController { ...@@ -361,6 +361,11 @@ public class PackingController {
@PostMapping("/update/model") @PostMapping("/update/model")
public ResponseEntity updateModel(@RequestBody @Validated PackingModelEdit packingModelEdit){ public ResponseEntity updateModel(@RequestBody @Validated PackingModelEdit packingModelEdit){
PackingLibrary packingLibrary = packingLibraryService.getOne(packingModelEdit.getPackingId()); PackingLibrary packingLibrary = packingLibraryService.getOne(packingModelEdit.getPackingId());
if (!packingLibrary.getModel().equals(packingModelEdit.getModel())&&packingLibraryService.modelIsExist(packingModelEdit.getModel())){
Map<String,Object> map = new HashMap<>();
map.put("error","型号"+packingModelEdit.getModel()+"已存在");
return ResponseEntity.ok(map);
}
List<PackingLibrary> packingLibraries = new ArrayList<>(); List<PackingLibrary> packingLibraries = new ArrayList<>();
if (packingLibrary.getShowOrder()>packingModelEdit.getShowOrder()){ if (packingLibrary.getShowOrder()>packingModelEdit.getShowOrder()){
for (int i = packingModelEdit.getShowOrder();i<packingLibrary.getShowOrder();i++){ for (int i = packingModelEdit.getShowOrder();i<packingLibrary.getShowOrder();i++){
...@@ -393,11 +398,6 @@ public class PackingController { ...@@ -393,11 +398,6 @@ public class PackingController {
packingLibraryDao.saveAll(packingLibraries); packingLibraryDao.saveAll(packingLibraries);
} }
if (packingLibrary.getIsRoot()==1){ if (packingLibrary.getIsRoot()==1){
if (!packingLibrary.getModel().equals(packingModelEdit.getModel())&&packingLibraryService.modelIsExist(packingModelEdit.getModel())){
Map<String,Object> map = new HashMap<>();
map.put("error","型号"+packingModelEdit.getModel()+"已存在");
return ResponseEntity.ok(map);
}
if (packingModelEdit.getModel()!=null&&!packingModelEdit.getModel().equals(packingLibrary.getModel())){ if (packingModelEdit.getModel()!=null&&!packingModelEdit.getModel().equals(packingLibrary.getModel())){
packingLibrary.setModel(packingModelEdit.getModel()); packingLibrary.setModel(packingModelEdit.getModel());
packingLibrary.setName(packingModelEdit.getModel()); packingLibrary.setName(packingModelEdit.getModel());
......
...@@ -679,6 +679,9 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -679,6 +679,9 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
if (packingLibrarySelectVo.getModel() != null) { if (packingLibrarySelectVo.getModel() != null) {
predicateBuilder.eq("model", packingLibrarySelectVo.getModel()); predicateBuilder.eq("model", packingLibrarySelectVo.getModel());
} }
if (packingLibrarySelectVo.getName() != null) {
predicateBuilder.eq("name", packingLibrarySelectVo.getName());
}
if (packingLibrarySelectVo.getType() != null) { if (packingLibrarySelectVo.getType() != null) {
predicateBuilder.eq("type", packingLibrarySelectVo.getType()); predicateBuilder.eq("type", packingLibrarySelectVo.getType());
} }
......
...@@ -88,7 +88,7 @@ public class RepairBillSelectController { ...@@ -88,7 +88,7 @@ public class RepairBillSelectController {
@GetMapping(value = "/repairNum") @GetMapping(value = "/repairNum")
public ResponseEntity getRepairNum(){ public ResponseEntity getRepairNum(){
RepairNum repairNum = new RepairNum(); RepairNum repairNum = new RepairNum();
RepairTaskSelectVo repairTaskSelectVo = new RepairTaskSelectVo(1); RepairTaskSelectVo repairTaskSelectVo = new RepairTaskSelectVo(1,null);
repairTaskSelectVo.setPage(0); repairTaskSelectVo.setPage(0);
repairTaskSelectVo.setSize(Integer.MAX_VALUE); repairTaskSelectVo.setSize(Integer.MAX_VALUE);
Page<RepairDetail> repairDetails = (Page)repairController.getRepairList(repairTaskSelectVo).getBody(); Page<RepairDetail> repairDetails = (Page)repairController.getRepairList(repairTaskSelectVo).getBody();
......
...@@ -281,6 +281,7 @@ public class RepairController { ...@@ -281,6 +281,7 @@ public class RepairController {
BeanUtils.copyProperties(repairBillSaveVo, repairBill1); BeanUtils.copyProperties(repairBillSaveVo, repairBill1);
BeanUtils.copyProperties(repairBillSaveVo, deviceRepairSendBillEntity1); BeanUtils.copyProperties(repairBillSaveVo, deviceRepairSendBillEntity1);
repairBill = deviceRepairBillService.addEntity(repairBill1); repairBill = deviceRepairBillService.addEntity(repairBill1);
deviceRepairSendBillEntity1.setDeviceRepairBillId(repairBill.getId());
deviceRepairSendBillEntity = deviceRepairSendBillService.addEntity(deviceRepairSendBillEntity1); deviceRepairSendBillEntity = deviceRepairSendBillService.addEntity(deviceRepairSendBillEntity1);
} }
if (repairBillSaveVo.getScriptSaveVos() != null) { if (repairBillSaveVo.getScriptSaveVos() != null) {
...@@ -1433,6 +1434,8 @@ public class RepairController { ...@@ -1433,6 +1434,8 @@ public class RepairController {
Integer type = repairTaskSelectVo.getType(); Integer type = repairTaskSelectVo.getType();
// Integer userId = userUtils.getCurrentUserId(); // Integer userId = userUtils.getCurrentUserId();
String unitName = userUtils.getCurrentUserUnitName(); String unitName = userUtils.getCurrentUserUnitName();
Integer year = repairTaskSelectVo.getYear();
Boolean hasYear = year!=null&&year>0;
//待维修装备 //待维修装备
if (type==1){ if (type==1){
List<Integer> integerList = new ArrayList<>(); List<Integer> integerList = new ArrayList<>();
...@@ -1487,7 +1490,7 @@ public class RepairController { ...@@ -1487,7 +1490,7 @@ public class RepairController {
}); });
List<String> units = unitsService.findListById(0).stream().map(Units::getName).collect(Collectors.toList()); List<String> units = unitsService.findListById(0).stream().map(Units::getName).collect(Collectors.toList());
units.addAll(unitsService.findBySubordinateNotOneself(userUtils.getCurrentUnitId()).stream().map(Units::getName).collect(Collectors.toList())); units.addAll(unitsService.findBySubordinateNotOneself(userUtils.getCurrentUnitId()).stream().map(Units::getName).collect(Collectors.toList()));
List<RepairDetail> repairDetails2 = repairDetails.stream().filter(repairDetail -> units.contains(repairDetail.getLocationUnit())).collect(Collectors.toList()); List<RepairDetail> repairDetails2 = repairDetails.stream().filter(repairDetail -> units.contains(repairDetail.getLocationUnit())&&(!hasYear||repairDetail.getUpdateTime().getYear()==year-1900)).collect(Collectors.toList());
return ResponseEntity.ok(PageUtil.getPerPage(repairTaskSelectVo.getPage(),repairTaskSelectVo.getSize(),repairDetails2,repairTaskSelectVo.getPageable())); return ResponseEntity.ok(PageUtil.getPerPage(repairTaskSelectVo.getPage(),repairTaskSelectVo.getSize(),repairDetails2,repairTaskSelectVo.getPageable()));
} }
else { else {
...@@ -1573,7 +1576,6 @@ public class RepairController { ...@@ -1573,7 +1576,6 @@ public class RepairController {
repairDetail.setRepairStatus(4); repairDetail.setRepairStatus(4);
repairDetail.setLocationUnit(deviceLibraryEntity.getLocationUnit()); repairDetail.setLocationUnit(deviceLibraryEntity.getLocationUnit());
repairDetail.setOwnUnit(deviceLibraryEntity.getLocationUnit()); repairDetail.setOwnUnit(deviceLibraryEntity.getLocationUnit());
deviceRepairDetailService.update(repairDetail);
deviceLibraryEntity.setOwnUnit(deviceLibraryEntity.getLocationUnit()); deviceLibraryEntity.setOwnUnit(deviceLibraryEntity.getLocationUnit());
deviceLibraryEntity.setLifeStatus(5); deviceLibraryEntity.setLifeStatus(5);
deviceLibraryService.update(deviceLibraryEntity); deviceLibraryService.update(deviceLibraryEntity);
...@@ -1600,18 +1602,20 @@ public class RepairController { ...@@ -1600,18 +1602,20 @@ public class RepairController {
} }
} }
deviceLibraryService.update(deviceLibrary); deviceLibraryService.update(deviceLibrary);
deviceRepairDetailService.save(newRepairDetail); RepairDetail repairDetail3 = deviceRepairDetailService.save(newRepairDetail);
repairDetail.setNewDeviceDetailId(repairDetail3.getId());
deviceRepairDetailService.update(repairDetail);
//修改所有父维修记录序列号 //修改所有父维修记录序列号
if (newRepairDetail.getPid()!=null){ if (repairDetail3.getPid()!=null){
RepairDetail repairDetail1 = deviceRepairDetailService.getOne(newRepairDetail.getPid()); RepairDetail repairDetail1 = deviceRepairDetailService.getOne(repairDetail3.getPid());
repairDetail1.setSeqNumber(newRepairDetail.getSeqNumber()); repairDetail1.setSeqNumber(repairDetail3.getSeqNumber());
repairDetail1.setDeviceId(newRepairDetail.getDeviceId()); repairDetail1.setDeviceId(repairDetail3.getDeviceId());
repairDetail1.setLocationUnit(userUtils.getCurrentUserUnitName()); repairDetail1.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceRepairDetailService.update(repairDetail1); deviceRepairDetailService.update(repairDetail1);
if (repairDetail1.getPid() != null) { if (repairDetail1.getPid() != null) {
RepairDetail repairDetail2 = deviceRepairDetailService.getOne(newRepairDetail.getPid()); RepairDetail repairDetail2 = deviceRepairDetailService.getOne(repairDetail1.getPid());
repairDetail2.setSeqNumber(newRepairDetail.getSeqNumber()); repairDetail2.setSeqNumber(repairDetail3.getSeqNumber());
repairDetail2.setDeviceId(newRepairDetail.getDeviceId()); repairDetail2.setDeviceId(repairDetail3.getDeviceId());
repairDetail2.setLocationUnit(userUtils.getCurrentUserUnitName()); repairDetail2.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceRepairDetailService.update(repairDetail2); deviceRepairDetailService.update(repairDetail2);
} }
...@@ -1818,18 +1822,18 @@ public class RepairController { ...@@ -1818,18 +1822,18 @@ public class RepairController {
*/ */
private List<RepairDetail> getRepairDetail(int repairBillId) { private List<RepairDetail> getRepairDetail(int repairBillId) {
List<RepairDetail> repairDetails = deviceRepairDetailService.findByBillId(repairBillId); List<RepairDetail> repairDetails = deviceRepairDetailService.findByBillId(repairBillId);
List<RepairDetail> orderList = new ArrayList<>(); // List<RepairDetail> orderList = new ArrayList<>();
repairDetails.forEach(repairDetail -> { // repairDetails.forEach(repairDetail -> {
if (!repairDetail.getRepairStatus().equals(RepairStatusEnum.CHANGE_NEW.id) && !repairDetail.getRepairStatus().equals(RepairStatusEnum.CHANGE_NEW_DEVICE.id)) { // if (!repairDetail.getRepairStatus().equals(RepairStatusEnum.CHANGE_NEW.id) && !repairDetail.getRepairStatus().equals(RepairStatusEnum.CHANGE_NEW_DEVICE.id)) {
orderList.add(repairDetail); // orderList.add(repairDetail);
if (repairDetail.getRepairStatus().equals(RepairStatusEnum.SCRAPPED.id)) { // if (repairDetail.getRepairStatus().equals(RepairStatusEnum.SCRAPPED.id)) {
if (repairDetail.getNewDeviceDetailId() > 0) { // if (repairDetail.getNewDeviceDetailId() > 0) {
orderList.add(deviceRepairDetailService.getOne(repairDetail.getNewDeviceDetailId())); // orderList.add(deviceRepairDetailService.getOne(repairDetail.getNewDeviceDetailId()));
} // }
} // }
} // }
}); // });
return orderList; return repairDetails;
} }
@ApiOperation(value = "上传送修发送方签发人", notes = "上传发送方签发人") @ApiOperation(value = "上传送修发送方签发人", notes = "上传发送方签发人")
......
...@@ -19,4 +19,6 @@ public class RepairTaskSelectVo extends CustomPage { ...@@ -19,4 +19,6 @@ public class RepairTaskSelectVo extends CustomPage {
@ApiModelProperty(value = "查询类型", example = "1") @ApiModelProperty(value = "查询类型", example = "1")
private Integer type; private Integer type;
@ApiModelProperty(value = "年份", example = "1")
private Integer year;
} }
...@@ -26,6 +26,7 @@ import org.springframework.http.ResponseEntity; ...@@ -26,6 +26,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -195,7 +196,29 @@ public class StatisticalController { ...@@ -195,7 +196,29 @@ public class StatisticalController {
@ApiOperation(value = "查询所有装备统计列表", notes = "可以通过这个接口查询所有装备统计列表") @ApiOperation(value = "查询所有装备统计列表", notes = "可以通过这个接口查询所有装备统计列表")
@PostMapping("/device") @PostMapping("/device")
public ResponseEntity selectAllDeviceStatList(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) { public ResponseEntity selectAllDeviceStatList(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
List<DeviceLibrary> deviceLibraryEntities = deviceLibraryService.getAllList(deviceLibrarySelectVo); Boolean hasModelDim = deviceLibrarySelectVo.getModelDim()!=null;
Boolean hasNameDim = deviceLibrarySelectVo.getNameDim()!=null;
Boolean hasSeqDim = deviceLibrarySelectVo.getSeqDim()!=null;
Boolean hasLocationUnitDim = deviceLibrarySelectVo.getLocationUnitDim()!=null;
Boolean hasOwnUnitDim = deviceLibrarySelectVo.getOwnUnitDim()!=null;
Boolean hasLifeStatusDim = deviceLibrarySelectVo.getLifeStatusDim()!=null;
Boolean hasUpdateTimeDim = deviceLibrarySelectVo.getUpdateTimeDim()!=null;
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
List<DeviceLibrary> resultList = deviceLibraryService.getAllList(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());
Boolean containNameDim = !hasNameDim||deviceLibrary.getName().contains(deviceLibrarySelectVo.getNameDim());
Boolean containSeqDim = !hasSeqDim||deviceLibrary.getSeqNumber().contains(deviceLibrarySelectVo.getSeqDim());
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());
return containModelDim&&containNameDim&&containSeqDim&&containLocationUnitDim&&containOwnUnitDim&&containLifeStatusDim&&containUpdateTimeDim;
}).collect(Collectors.toList());
}
List<DeviceLibrary> deviceLibraryEntities = resultList;
deviceLibraryEntities.forEach(DeviceLibrary::setConfigName); deviceLibraryEntities.forEach(DeviceLibrary::setConfigName);
Page<DeviceLibrary> deviceLibraries = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(),deviceLibrarySelectVo.getSize(),deviceLibraryEntities,deviceLibrarySelectVo.getPageable()); Page<DeviceLibrary> deviceLibraries = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(),deviceLibrarySelectVo.getSize(),deviceLibraryEntities,deviceLibrarySelectVo.getPageable());
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
......
...@@ -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); List<Integer> status = Arrays.asList(201,333,810,322,722,788,1250,2223,8110,888);
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);
......
hibernate.dialect.storage_engine=innodb
\ No newline at end of file
...@@ -44,12 +44,15 @@ public class Message { ...@@ -44,12 +44,15 @@ public class Message {
@ApiModelProperty(value = "信息内容") @ApiModelProperty(value = "信息内容")
private String content; private String content;
@Column(name = "involve_users",columnDefinition = "TEXT")
@ApiModelProperty(value = "阅知人员id(x作为分隔符),例如x1x2x,意为id为1,2的用户待阅知该信息") @ApiModelProperty(value = "阅知人员id(x作为分隔符),例如x1x2x,意为id为1,2的用户待阅知该信息")
private String involveUsers; private String involveUsers;
@Column(name = "complete_users",columnDefinition = "TEXT")
@ApiModelProperty(value = "已完成人员id(x作为分隔符),例如x1x2x,意为id为1,2的用户已完成阅知该信息") @ApiModelProperty(value = "已完成人员id(x作为分隔符),例如x1x2x,意为id为1,2的用户已完成阅知该信息")
private String completeUsers; private String completeUsers;
@Column(name = "user_read_detail",columnDefinition = "TEXT")
@ApiModelProperty(value = "用户阅读信息") @ApiModelProperty(value = "用户阅读信息")
private String userReadDetail; private String userReadDetail;
...@@ -72,6 +75,7 @@ public class Message { ...@@ -72,6 +75,7 @@ public class Message {
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)") @ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0; private Integer deleteTag = 0;
@Column(name = "record",columnDefinition = "TEXT")
@ApiModelProperty(value = "附加信息") @ApiModelProperty(value = "附加信息")
private String record; private String record;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论