提交 e882ac99 authored 作者: zhoushaopan's avatar zhoushaopan

feat(装备模块): 新增为工作交接查询装备的接口

新增为工作交接查询装备的接口
上级 ed83577e
...@@ -942,7 +942,11 @@ public class AllotBillController { ...@@ -942,7 +942,11 @@ public class AllotBillController {
} }
@GetMapping("/getFileList")
@ApiOperation("通过任务id查询账单中文件")
public ResponseEntity getFileList(Integer taskId){
return ResponseEntity.ok(allotBillService.getFileList(taskId));
}
...@@ -1068,11 +1072,6 @@ public class AllotBillController { ...@@ -1068,11 +1072,6 @@ public class AllotBillController {
} }
} }
@GetMapping("getFileList")
@ApiOperation("通过任务id查询账单中文件")
public ResponseEntity getFileList(Integer taskId){
return ResponseEntity.ok(allotBillService.getFileList(taskId));
}
} }
...@@ -1131,6 +1131,12 @@ public class DeviceLibraryController { ...@@ -1131,6 +1131,12 @@ public class DeviceLibraryController {
return setOrderNumber(sortNum, allListAndParent); return setOrderNumber(sortNum, allListAndParent);
} }
@ApiOperation(value = "为工作交接查询装备", notes = "为工作交接查询装备")
@GetMapping("/selectDeviceForWorkUse")
public List<WorkUseVo> selectDeviceForWorkUse(){
return deviceLibraryService.getDevicesForWorkUse();
}
public List<DeviceLibrary> getAllListAndParent(){ public List<DeviceLibrary> getAllListAndParent(){
DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo(); DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo();
......
...@@ -499,4 +499,10 @@ public interface DeviceLibraryService { ...@@ -499,4 +499,10 @@ public interface DeviceLibraryService {
void updateStorageLocation(UpdateStorageLocationVo updateStorageLocationVo); void updateStorageLocation(UpdateStorageLocationVo updateStorageLocationVo);
/**
* 查询装备给工作交接使用
* @return WorkUseVos
*/
List<WorkUseVo> getDevicesForWorkUse();
} }
...@@ -1162,6 +1162,47 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1162,6 +1162,47 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
}); });
} }
@Override
public List<WorkUseVo> getDevicesForWorkUse() {
//获取当前登录的单位名称
String currentUserUnitName = userUtils.getCurrentUserUnitName();
PredicateBuilder<DeviceLibrary> builder = Specifications.and();
builder.eq("ownUnit",currentUserUnitName);
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll(builder.build());
List<Integer> status= new ArrayList<>(Arrays.asList(5,11,12));
deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus()))
.collect(Collectors.toList());
//进行过滤赋值、
deviceLibraries.forEach(deviceLibrary -> {
if (!deviceLibrary.getOwnUnit().equals(deviceLibrary.getLocationUnit())){
//不在库
deviceLibrary.setIsInLibrary(1);
}else {
//在库
deviceLibrary.setIsInLibrary(0);
}
});
//按照型号,名称,是否在库进行分组 "Ǵ"
Map<String, List<DeviceLibrary>> map = deviceLibraries.stream().collect(groupingBy(deviceLibrary ->
deviceLibrary.getModel() + "Ǵ" +
deviceLibrary.getName() + "Ǵ" +
deviceLibrary.getIsInLibrary()));
List<WorkUseVo> workUseVos = new ArrayList<>();
map.keySet().forEach(s -> {
WorkUseVo workUseVo = new WorkUseVo();
String[] split = s.split("Ǵ");
workUseVo.setModel(split[0]);
workUseVo.setName(split[1]);
workUseVo.setIsInLibrary(Integer.valueOf(split[2]));
List<DeviceLibrary> deviceLibraries1 = map.get(s);
List<String> seqList = deviceLibraries1.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
workUseVo.setSeqNumber(String.join("-",seqList));
workUseVo.setDeviceCount(deviceLibraries1.size());
workUseVos.add(workUseVo);
});
return workUseVos;
}
// @Override // @Override
// @UpdateCache // @UpdateCache
// public int updatePartParentId(List<Integer> deviceIds) { // public int updatePartParentId(List<Integer> deviceIds) {
......
...@@ -4,6 +4,7 @@ import com.tykj.dev.config.cache.ConfigCache; ...@@ -4,6 +4,7 @@ import com.tykj.dev.config.cache.ConfigCache;
import com.tykj.dev.device.library.subject.vo.DeviceExcel; import com.tykj.dev.device.library.subject.vo.DeviceExcel;
import com.tykj.dev.device.library.subject.vo.DeviceExcelVo; import com.tykj.dev.device.library.subject.vo.DeviceExcelVo;
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.WorkUseVo;
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;
...@@ -277,6 +278,10 @@ public class DeviceLibrary implements Serializable { ...@@ -277,6 +278,10 @@ public class DeviceLibrary implements Serializable {
@Transient @Transient
private Integer orderNumber; private Integer orderNumber;
@ApiModelProperty(value = "是否在库",notes = "0 在库 1不在库")
@Transient
private Integer isInLibrary;
public void addChildNode(DeviceLibrary deviceLibraryEntity) { public void addChildNode(DeviceLibrary deviceLibraryEntity) {
childs.add(deviceLibraryEntity); childs.add(deviceLibraryEntity);
} }
...@@ -292,6 +297,13 @@ public class DeviceLibrary implements Serializable { ...@@ -292,6 +297,13 @@ public class DeviceLibrary implements Serializable {
return mapper.map(this, DeviceVo.class); return mapper.map(this, DeviceVo.class);
} }
// public WorkUseVo toWorkUse(){
// setConfigName();
// //modelMap复制
// ModelMapper mapper = BeanHelper.getUserMapper();
// return mapper.map(this, WorkUseVo.class);
// }
public DeviceExcelVo toDeviceExcelVo(){ public DeviceExcelVo toDeviceExcelVo(){
setConfigName(); setConfigName();
//modelMap复制 //modelMap复制
......
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.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("返回给工作交接的vo")
@Repository
public class WorkUseVo {
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "序列号")
private String seqNumber;
@ApiModelProperty(value = "装备数量")
private Integer deviceCount;
@ApiModelProperty(value = "是否在库",notes = "0 在库 1不在库")
private Integer isInLibrary;
}
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author zsp
*/
@Data
@ApiModel("返回给工作交接的vos")
@Repository
public class WorkUseVos {
@ApiModelProperty(value = "非在库装备列表")
private List<WorkUseVo> exceptionList;
@ApiModelProperty(value = "在库装备列表")
private List<WorkUseVo> normalList;
// @ApiModelProperty(value = "是否在库",notes = "0 在库 1不在库")
// private Integer isInLibrary;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论