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

更新

上级 dae697ce
...@@ -611,4 +611,14 @@ public class AllotBillController { ...@@ -611,4 +611,14 @@ public class AllotBillController {
} }
return ResponseEntity.ok("OK"); return ResponseEntity.ok("OK");
} }
@ApiOperation(value = "上传发送方签发人", notes = "上传发送方签发人")
@PostMapping(value = "/updateAgent/{id}/{name}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateAgent(@PathVariable("id") int taskId,@PathVariable("name") String name){
TaskBto taskBto = taskService.get(taskId);
AllotBill allotBill = allotBillService.getOne(taskBto.getBillId());
allotBill.setAgent(name);
return ResponseEntity.ok(allotBillService.update(allotBill));
}
} }
...@@ -36,10 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -36,10 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -288,4 +285,14 @@ public class BackController { ...@@ -288,4 +285,14 @@ public class BackController {
} }
return ResponseEntity.ok("OK"); return ResponseEntity.ok("OK");
} }
@ApiOperation(value = "上传发送方签发人", notes = "上传发送方签发人")
@PostMapping(value = "/updateAgent/{id}/{name}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateAgent(@PathVariable("id") int taskId, @PathVariable("name") String name){
TaskBto taskBto = taskService.get(taskId);
AllotBackBill allotBackBill = allotBackBillService.getOne(taskBto.getBillId());
allotBackBill.setAgent(name);
return ResponseEntity.ok(allotBackBillService.update(allotBackBill));
}
} }
...@@ -13,6 +13,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLog; ...@@ -13,6 +13,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLog;
import com.tykj.dev.device.library.subject.vo.*; import com.tykj.dev.device.library.subject.vo.*;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException; import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.GetTreeUtils;
import com.tykj.dev.misc.utils.PageUtil; import com.tykj.dev.misc.utils.PageUtil;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -143,6 +144,30 @@ public class DeviceLibraryController { ...@@ -143,6 +144,30 @@ public class DeviceLibraryController {
return ResultUtil.success(map); return ResultUtil.success(map);
} }
@ApiOperation(value = "模糊查询日常管理装备父子分页", notes = "可以通过这个接口查询装备列表")
@PostMapping("/core/feature/summary/daily")
public ResponseEntity selectDailyDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
Map<String,Object> map = new HashMap<>();
List<DeviceLibrary> resultList = deviceLibraryService.getList(deviceLibrarySelectVo);
resultList.forEach(DeviceLibrary::setConfigName);
Map<Integer, DeviceLibrary> nodeCollect =
resultList.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity));
List<DeviceVo> containList = GetTreeUtils.parseTreeFromDown(
resultList,
DeviceLibrary::getId,
deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())),
DeviceLibrary::addChildNode
).stream().map(DeviceLibrary::parseVo).sorted(Comparator.comparing(DeviceVo::getLifeStatus)).collect(Collectors.toList());
map.put("models",resultList.stream().map(DeviceLibrary::getModel).collect(Collectors.toSet()));
map.put("names",resultList.stream().map(DeviceLibrary::getName).collect(Collectors.toSet()));
Set<Integer> status = resultList.stream().map(DeviceLibrary::getLifeStatus).collect(Collectors.toSet());
Map<Integer,String> lifeStatusMap = configCache.getLifeStatusMap();
map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
Page<DeviceVo> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), containList, deviceLibrarySelectVo.getPageable());
map.put("pages",deviceLibraryEntities);
return ResultUtil.success(map);
}
@ApiOperation(value = "查询存在的装备名称", notes = "可以通过这个接口查询存在的装备名称") @ApiOperation(value = "查询存在的装备名称", notes = "可以通过这个接口查询存在的装备名称")
@GetMapping("/selectAllName") @GetMapping("/selectAllName")
public ResponseEntity selectAllName() { public ResponseEntity selectAllName() {
......
...@@ -2,6 +2,7 @@ package com.tykj.dev.device.library.subject.domin; ...@@ -2,6 +2,7 @@ package com.tykj.dev.device.library.subject.domin;
import com.tykj.dev.config.cache.ConfigCache; import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.device.library.subject.vo.DeviceVo; import com.tykj.dev.device.library.subject.vo.DeviceVo;
import com.tykj.dev.device.library.subject.vo.LifeStatusVo;
import com.tykj.dev.misc.base.BeanHelper; import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.utils.SpringUtils; import com.tykj.dev.misc.utils.SpringUtils;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -273,6 +274,10 @@ public class DeviceLibrary { ...@@ -273,6 +274,10 @@ public class DeviceLibrary {
} }
return this; return this;
} }
public LifeStatusVo getLifeStatusVo(){
return new LifeStatusVo(this.lifeStatus,this.lifeStatusName);
}
// public String getKeyWords(){ // public String getKeyWords(){
// StringBuffer stringBuffer = new StringBuffer(); // StringBuffer stringBuffer = new StringBuffer();
// stringBuffer.append(this.model); // stringBuffer.append(this.model);
......
package com.tykj.dev.device.library.subject.vo; package com.tykj.dev.device.library.subject.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
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;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
...@@ -77,4 +80,6 @@ public class DeviceVo { ...@@ -77,4 +80,6 @@ public class DeviceVo {
@ApiModelProperty(value = "入库类型") @ApiModelProperty(value = "入库类型")
private String storageTypeName; private String storageTypeName;
private List<DeviceLibrary> childs;
} }
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* @author dengdiyi
*/
@Data
@AllArgsConstructor
@ApiModel("装备生命状态类")
public class LifeStatusVo {
private Integer lifeStatus;
@ApiModelProperty(value = "生命状态")
private String lifeStatusName;
}
...@@ -212,6 +212,17 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -212,6 +212,17 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
final Integer status = selectPack.getStatus(); final Integer status = selectPack.getStatus();
final Integer secretLevel = selectPack.getSecretLevel(); final Integer secretLevel = selectPack.getSecretLevel();
List<PackingLibrary> packingLibraryEntities = packingLibraryDao.findAll(getSelectSpecification6()); List<PackingLibrary> packingLibraryEntities = packingLibraryDao.findAll(getSelectSpecification6());
// .stream().filter(packingLibrary -> {
// boolean isSameModel = model == null || packingLibrary.getModel().equals(model);
// boolean isSameName = name == null || packingLibrary.getName().equals(name);
// boolean isSameStatus = status == null || packingLibrary.getStatus().equals(status);
// boolean isSameSecretLevel = secretLevel == null || packingLibrary.getSecretLevel().equals(secretLevel);
// boolean isContainContent = content == null
// || packingLibrary.getModel().contains(content)
// || configCache.getInvisibleRangeMap().get(packingLibrary.getInvisibleRange()).contains(content)
// || configCache.getSecretLevelMap().get(packingLibrary.getSecretLevel()).contains(content);
// return isSameModel && isSameName && isSameStatus && isSameSecretLevel && isContainContent;
// }).collect(Collectors.toList());
packingLibraryEntities.forEach(PackingLibrary::setConfigName); packingLibraryEntities.forEach(PackingLibrary::setConfigName);
//返回父子结构 //返回父子结构
Map<Integer, PackingLibrary> nodeCollect = Map<Integer, PackingLibrary> nodeCollect =
......
...@@ -1763,4 +1763,24 @@ public class RepairController { ...@@ -1763,4 +1763,24 @@ public class RepairController {
}); });
return orderList; return orderList;
} }
@ApiOperation(value = "上传送修发送方签发人", notes = "上传发送方签发人")
@PostMapping(value = "/updateSendAgent/{id}/{name}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateSendAgent(@PathVariable("id") int taskId,@PathVariable("name") String name){
TaskBto taskBto = taskService.get(taskId);
RepairBill repairBill = deviceRepairBillService.getOne(taskBto.getBillId());
repairBill.setStartUserB(name);
return ResponseEntity.ok(deviceRepairBillService.update(repairBill));
}
@ApiOperation(value = "上传领取发送方签发人", notes = "上传发送方签发人")
@PostMapping(value = "/updateBackAgent/{id}/{name}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity updateBackAgent(@PathVariable("id") int taskId,@PathVariable("name") String name){
TaskBto taskBto = taskService.get(taskId);
RepairBackBill repairBackBill = deviceRepairBackBillService.getOne(taskBto.getBillId());
repairBackBill.setAgent(name);
return ResponseEntity.ok(deviceRepairBackBillService.update(repairBackBill));
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论