提交 75cb624c authored 作者: zhoushaopan's avatar zhoushaopan

feat(装备模块,配套设备库模块): 装备的绑定和解除,配套设备库生成序列号和入库

装备的绑定和解除,配套设备库生成序列号和入库
上级 40d13d6b
...@@ -840,6 +840,7 @@ public class DeviceLibraryController { ...@@ -840,6 +840,7 @@ public class DeviceLibraryController {
@ApiOperation(value = "通过序列号查询配件", notes = "通过表面号查询配件") @ApiOperation(value = "通过序列号查询配件", notes = "通过表面号查询配件")
@GetMapping("/selectPart/{rfid}") @GetMapping("/selectPart/{rfid}")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity selectPart(@PathVariable("rfid") String rfid) { public ResponseEntity selectPart(@PathVariable("rfid") String rfid) {
List<DeviceLibrary> libraryEntities = deviceLibraryDao.getAllBySeqNumber(rfid); List<DeviceLibrary> libraryEntities = deviceLibraryDao.getAllBySeqNumber(rfid);
libraryEntities.forEach(DeviceLibrary::setConfigName); libraryEntities.forEach(DeviceLibrary::setConfigName);
...@@ -847,6 +848,20 @@ public class DeviceLibraryController { ...@@ -847,6 +848,20 @@ public class DeviceLibraryController {
return ResultUtil.success(deviceLibraryEntityList); return ResultUtil.success(deviceLibraryEntityList);
} }
// @ApiOperation(value = "通过序列号查询配件", notes = "通过表面号查询配件")
// @PostMapping("/selectPart/rfIds")
// public ResponseEntity selectPart(@RequestBody List<String> rfid) {
// if (rfid.size()>0){
// for (String s : rfid) {
// List<DeviceLibrary> libraryEntities = deviceLibraryDao.getAllBySeqNumber(s);
// libraryEntities.forEach(DeviceLibrary::setConfigName);
// List<DeviceLibrary> deviceLibraryEntityList = libraryEntities.stream().filter(deviceLibraryEntity -> deviceLibraryEntity.getIsPart() == 1).collect(Collectors.toList());
// return ResultUtil.success(deviceLibraryEntityList);
// }
// }
//
// }
@ApiOperation(value = "通过序列号查询装备", notes = "通过表面号查询装备") @ApiOperation(value = "通过序列号查询装备", notes = "通过表面号查询装备")
@GetMapping("/selectDevice/{rfid}") @GetMapping("/selectDevice/{rfid}")
public ResponseEntity selectDevice(@PathVariable("rfid") String rfid) { public ResponseEntity selectDevice(@PathVariable("rfid") String rfid) {
...@@ -953,18 +968,116 @@ public class DeviceLibraryController { ...@@ -953,18 +968,116 @@ public class DeviceLibraryController {
return deviceLibraries; return deviceLibraries;
} }
// @ApiOperation(value = "解除装备绑定", notes = "解除装备绑定")
// @GetMapping("/relieveDevice/{deviceId}")
// public ResponseEntity relieveDevice(@PathVariable("deviceId") Integer deviceId){
// deviceLibraryService.relieveDevice(deviceId);
// return ResponseEntity.ok("解除成功");
// }
// @ApiOperation(value = "进行装备绑定", notes = "进行装备绑定")
// @PostMapping("/bindingDevice")
// public ResponseEntity bindingDevice(BindingDeviceVo bindingDeviceVo){
// deviceLibraryService.bindingDevice(bindingDeviceVo);
// return ResponseEntity.ok("绑定成功");
// }
@ApiOperation(value = "进行装备绑定", notes = "进行装备绑定")
@PostMapping("/boundDevice")
public ResponseEntity boundDevice(@RequestBody BindingDeviceVo bindingDeviceVo){
deviceLibraryService.boundDevice(bindingDeviceVo);
return ResponseEntity.ok("绑定成功");
}
@ApiOperation(value = "解除装备绑定", notes = "解除装备绑定") @ApiOperation(value = "解除装备绑定", notes = "解除装备绑定")
@GetMapping("/relieveDevice/{deviceId}") @PostMapping("/unboundDevice")
public ResponseEntity relieveDevice(@PathVariable("deviceId") Integer deviceId){ public ResponseEntity unboundDevice(@RequestBody List<DeviceLibrary> deviceLibraries){
deviceLibraryService.relieveDevice(deviceId); deviceLibraryService.unboundDevice(deviceLibraries);
return ResponseEntity.ok("解除成功"); return ResponseEntity.ok("解除成功");
} }
@ApiOperation(value = "进行装备绑定", notes = "进行装备绑定")
@PostMapping("/bindingDevice") @ApiOperation(value = "查询可绑定的附件", notes = "查询可绑定的附件")
public ResponseEntity bindingDevice(BindingDeviceVo bindingDeviceVo){ @PostMapping("/selectPartDevice")
deviceLibraryService.bindingDevice(bindingDeviceVo); public ResponseEntity selectPartDevice(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo){
return ResponseEntity.ok("绑定成功"); 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;
Boolean hasRfidCardDim = deviceLibrarySelectVo.getRfidCardDim()!=null;
//库存位置
Boolean hasStorageLocationDim = deviceLibrarySelectVo.getRfidCardDim()!=null;
//形态
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
List<DeviceLibrary> resultList = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
resultList = resultList.stream().filter(deviceLibrary -> deviceLibrary.getIsPart() == 1).collect(Collectors.toList());
//根据装备id查询附件 然后过滤
List<DeviceLibrary> allByPartParentId = deviceLibraryService.findAllByPartParentId(deviceLibrarySelectVo.getDeviceId());
List<Integer> ids = allByPartParentId.stream().map(DeviceLibrary::getId).collect(Collectors.toList());
resultList = resultList.stream().filter(deviceLibrary -> !ids.contains(deviceLibrary.getId())).collect(Collectors.toList());
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());
Boolean containRfidCardDim = !hasRfidCardDim||(deviceLibrary.getRfidCardId()!=null&&deviceLibrary.getRfidCardId().contains(deviceLibrarySelectVo.getRfidCardDim()));
Boolean containStorageLocationDim = !hasStorageLocationDim||deviceLibrary.getStorageLocation().contains(deviceLibrarySelectVo.getStorageLocationDim());
// Boolean containTypeDim = !hasTypeDim||deviceLibrary.getType().contains(deviceLibrarySelectVo.getTypeDim());
return containModelDim&&containNameDim&&containSeqDim&&containLocationUnitDim&&containOwnUnitDim&&containLifeStatusDim&&containUpdateTimeDim&&containRfidCardDim&&containStorageLocationDim;
}).collect(Collectors.toList());
}
// 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();
//
Map<Integer, String> styleMap = configCache.getStyleMap();
Set<Integer> status = new HashSet<>();
List<String> models = new ArrayList<>();
List<String> names = new ArrayList<>();
List<String> ownUnits = new ArrayList<>();
List<String> locationUnits = new ArrayList<>();
Set<String> storageLocation = new HashSet<>();
//形态
List<Integer> types = new ArrayList<>();
resultList.forEach(deviceVo -> {
deviceVo.setConfigName();
status.add(deviceVo.getLifeStatus());
models.add(deviceVo.getModel());
names.add(deviceVo.getName());
ownUnits.add(deviceVo.getOwnUnit());
locationUnits.add(deviceVo.getLocationUnit());
storageLocation.add(deviceVo.getStorageLocation());
types.add(deviceVo.getType());
});
map.put("pages",deviceLibraryEntities);
//修改 增加排序
//做一下去重
List<String> finalModels = models.stream().distinct().collect(Collectors.toList());
List<String> modelToSort = DeviceModelSort.modelToSort(finalModels);
map.put("models",modelToSort);
List<String> nameList = names.stream().distinct().sorted(Comparator.comparing(s -> s)).collect(Collectors.toList());
map.put("names",nameList);
List<String> finalOwnUnits = DeviceModelSort.unitToSort(ownUnits);
map.put("ownUnits",finalOwnUnits.stream().distinct().collect(Collectors.toList()));
List<String> finalLocationUnits = DeviceModelSort.unitToSort(locationUnits);
map.put("locationUnits",finalLocationUnits.stream().distinct().collect(Collectors.toList()));
map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
map.put("storageLocation",storageLocation);
//形态
List<TypeVo> typeVoList = types.stream().distinct().map(integer -> new TypeVo(integer, styleMap.get(integer))).sorted(Comparator.comparing(TypeVo::getType)).collect(Collectors.toList());
map.put("types",typeVoList);
return ResultUtil.success(map);
} }
/** /**
......
...@@ -218,6 +218,12 @@ public interface DeviceLibraryService { ...@@ -218,6 +218,12 @@ public interface DeviceLibraryService {
*/ */
List<DeviceLibrary> findAllByPackingId(Integer packingId); List<DeviceLibrary> findAllByPackingId(Integer packingId);
/**
* 根据partParentId查询附件
* @param id 装备的id
*/
List<DeviceLibrary> findAllByPartParentId(Integer id);
/** /**
* 通过列装id查询所有装备 * 通过列装id查询所有装备
*/ */
...@@ -275,13 +281,13 @@ public interface DeviceLibraryService { ...@@ -275,13 +281,13 @@ public interface DeviceLibraryService {
* 装备的解除 * 装备的解除
* @param deviceId 装备id * @param deviceId 装备id
*/ */
void relieveDevice(int deviceId); // void relieveDevice(int deviceId);
/** // /**
* 装备的绑定 // * 装备的绑定
* @param // * @param
*/ // */
void bindingDevice(BindingDeviceVo bindingDeviceVo); // void bindingDevice(BindingDeviceVo bindingDeviceVo);
/** /**
* 以下接口都为缓存做铺垫 * 以下接口都为缓存做铺垫
...@@ -441,4 +447,23 @@ public interface DeviceLibraryService { ...@@ -441,4 +447,23 @@ public interface DeviceLibraryService {
// * @return 影响行数 // * @return 影响行数
// */ // */
// int updatePartParentId(List<Integer> deviceIds); // int updatePartParentId(List<Integer> deviceIds);
/**
* 装备进行解绑
* @param deviceLibraries 装备附件的集合
*/
void unboundDevice(List<DeviceLibrary> deviceLibraries);
/**
* 装备绑定
* @param bindingDeviceVo 装备绑定的vo
*/
void boundDevice(BindingDeviceVo bindingDeviceVo);
/**
* 根据rfid查询装备
* @return 装备的集合
*/
List<DeviceLibrary> getAllBySeqNumber(String rfid);
} }
...@@ -656,6 +656,11 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -656,6 +656,11 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return deviceLibraryDao.findAllByPackingId(packingId); return deviceLibraryDao.findAllByPackingId(packingId);
} }
@Override
public List<DeviceLibrary> findAllByPartParentId(Integer id) {
return deviceLibraryDao.findAllByPartParentId(id);
}
// @Override // @Override
// public List<DeviceLibrary> findAllByPackingId2(List<Integer> packingIds) { // public List<DeviceLibrary> findAllByPackingId2(List<Integer> packingIds) {
// //查询可以使用并且在库 是所在或者所属是自己的 // //查询可以使用并且在库 是所在或者所属是自己的
...@@ -817,48 +822,48 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -817,48 +822,48 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
} }
@Override // @Override
@UpdateCache // @UpdateCache
public void relieveDevice(int deviceId) { // public void relieveDevice(int deviceId) {
Integer currentUserId = userUtils.getCurrentUserId(); // Integer currentUserId = userUtils.getCurrentUserId();
//根据装备id查询附件 // //根据装备id查询附件
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAllByPartParentId(deviceId); // List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAllByPartParentId(deviceId);
deviceLibraries.forEach(deviceLibrary -> { // deviceLibraries.forEach(deviceLibrary -> {
deviceLibrary.setPartParentId(null); // deviceLibrary.setPartParentId(null);
update(deviceLibrary); // update(deviceLibrary);
//添加日志 // //添加日志
String remark = "该装备进行解绑"; // String remark = "该装备进行解绑";
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceId, remark, null,currentUserId,null); // DeviceLogDto deviceLogDto = new DeviceLogDto(deviceId, remark, null,currentUserId,null);
deviceLogService.addLog(deviceLogDto); // deviceLogService.addLog(deviceLogDto);
}); // });
} // }
@Override // @Override
@UpdateCache // @UpdateCache
public void bindingDevice(BindingDeviceVo bindingDeviceVo) { // public void bindingDevice(BindingDeviceVo bindingDeviceVo) {
Integer currentUserId = userUtils.getCurrentUserId(); // Integer currentUserId = userUtils.getCurrentUserId();
//查询需要绑定的装备的型号和被绑定的装备的型号 // //查询需要绑定的装备的型号和被绑定的装备的型号
DeviceLibrary originDev = deviceLibraryDao.findById(bindingDeviceVo.getOriginDeviceId()).get(); // DeviceLibrary originDev = deviceLibraryDao.findById(bindingDeviceVo.getOriginDeviceId()).get();
DeviceLibrary toDev = deviceLibraryDao.findById(bindingDeviceVo.getToDeviceId()).get(); // DeviceLibrary toDev = deviceLibraryDao.findById(bindingDeviceVo.getToDeviceId()).get();
if (!originDev.getModel().equals(toDev.getModel())){ // if (!originDev.getModel().equals(toDev.getModel())){
//型号进行修改 // //型号进行修改
List<DeviceLibrary> libraries = deviceLibraryDao.findAllByPartParentId(originDev.getId()); // List<DeviceLibrary> libraries = deviceLibraryDao.findAllByPartParentId(originDev.getId());
libraries.forEach(deviceLibrary -> { // libraries.forEach(deviceLibrary -> {
deviceLibrary.setModel(toDev.getModel()); // deviceLibrary.setModel(toDev.getModel());
update(deviceLibrary); // update(deviceLibrary);
}); // });
String remark = "由于需要进行装备的绑定,原来型号修改为"+toDev.getModel(); // String remark = "由于需要进行装备的绑定,原来型号修改为"+toDev.getModel();
DeviceLogDto deviceLogDto = new DeviceLogDto(toDev.getId(), remark, null,currentUserId,null); // DeviceLogDto deviceLogDto = new DeviceLogDto(toDev.getId(), remark, null,currentUserId,null);
deviceLogService.addLog(deviceLogDto); // deviceLogService.addLog(deviceLogDto);
} // }
originDev.setModel(toDev.getModel()); // originDev.setModel(toDev.getModel());
originDev.setPartParentId(toDev.getId()); // originDev.setPartParentId(toDev.getId());
update(originDev); // update(originDev);
//添加日志 // //添加日志
String remark = "原装备和"+toDev.getName()+"的装备进行绑定"; // String remark = "原装备和"+toDev.getName()+"的装备进行绑定";
DeviceLogDto deviceLogDto = new DeviceLogDto(toDev.getId(), remark, null,currentUserId,null); // DeviceLogDto deviceLogDto = new DeviceLogDto(toDev.getId(), remark, null,currentUserId,null);
deviceLogService.addLog(deviceLogDto); // deviceLogService.addLog(deviceLogDto);
} // }
@Override @Override
@UpdateCache @UpdateCache
...@@ -977,6 +982,40 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -977,6 +982,40 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return cacheLibraryService.getAllDeviceLibraryList(); return cacheLibraryService.getAllDeviceLibraryList();
} }
@Override
@UpdateCache
public void unboundDevice(List<DeviceLibrary> deviceLibraries) {
//将附件的父id设置为null
if (deviceLibraries.size()>0){
deviceLibraries.forEach(deviceLibrary -> {
deviceLibrary.setPartParentId(null);
update(deviceLibrary);
});
}else {
throw new ApiException("请选择解绑的装备");
}
}
@Override
@UpdateCache
public void boundDevice(BindingDeviceVo bindingDeviceVo) {
//取出装备的id
DeviceLibrary orginDeviceLibrary = bindingDeviceVo.getOrginDeviceLibrary();
Integer id = orginDeviceLibrary.getId();
//将附件的父id设置为装备的id
List<DeviceLibrary> deviceLibraries = bindingDeviceVo.getDeviceLibraries();
deviceLibraries.forEach(deviceLibrary -> {
deviceLibrary.setPartParentId(id);
deviceLibrary.setModel(orginDeviceLibrary.getModel());
update(deviceLibrary);
});
}
@Override
public List<DeviceLibrary> getAllBySeqNumber(String rfid) {
return deviceLibraryDao.getAllBySeqNumber(rfid);
}
// @Override // @Override
// @UpdateCache // @UpdateCache
// public int updatePartParentId(List<Integer> deviceIds) { // public int updatePartParentId(List<Integer> deviceIds) {
......
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.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel("装备绑定的vo") @ApiModel("装备绑定的vo")
public class BindingDeviceVo { public class BindingDeviceVo {
@ApiModelProperty(value = "要绑定的装备id") @ApiModelProperty(value = "装备")
private Integer originDeviceId; private DeviceLibrary orginDeviceLibrary;
@ApiModelProperty(value = "需要绑定到的装备id") @ApiModelProperty(value = "附件集合")
private Integer toDeviceId; private List<DeviceLibrary> deviceLibraries;
} }
...@@ -15,6 +15,9 @@ import java.util.List; ...@@ -15,6 +15,9 @@ import java.util.List;
@ApiModel("装备查询类") @ApiModel("装备查询类")
public class DeviceLibrarySelectVo extends CustomPage { public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "装备id", example = "1")
public Integer deviceId;
@ApiModelProperty(value = "操作人", example = "1") @ApiModelProperty(value = "操作人", example = "1")
public Integer UserAId; public Integer UserAId;
......
...@@ -4,8 +4,13 @@ import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary; ...@@ -4,8 +4,13 @@ import com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
public interface MatchingDeviceLibraryDao extends JpaRepository<MatchingDeviceLibrary, Integer>, JpaSpecificationExecutor<MatchingDeviceLibrary> { public interface MatchingDeviceLibraryDao extends JpaRepository<MatchingDeviceLibrary, Integer>, JpaSpecificationExecutor<MatchingDeviceLibrary> {
List<MatchingDeviceLibrary> findAllByModel(String model);
} }
package com.tykj.dev.device.matching.repository;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @author zsp
*/
public interface MatchingDeviceModelDao extends JpaRepository<MatchingDeviceModel, Integer>, JpaSpecificationExecutor<MatchingDeviceModel> {
MatchingDeviceModel findByModel(String model);
}
...@@ -52,4 +52,12 @@ public interface MatchingDeviceLibraryService { ...@@ -52,4 +52,12 @@ public interface MatchingDeviceLibraryService {
* @return 所有名称 * @return 所有名称
*/ */
List<String> getAllName(); List<String> getAllName();
/**
* 根据型号查询序列号是否是第一次生成
* @param model 型号
* @return 返回值是序列号列表
*/
List<String> findByModelForSeqNumber(String model);
} }
package com.tykj.dev.device.matching.service;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceModel;
public interface MatchingDeviceModelService {
/**
* 新增
*/
MatchingDeviceModel addEntity(MatchingDeviceModel matchingDeviceModel);
/**
* 通过型号查询
*/
MatchingDeviceModel findByModel(String model);
}
...@@ -155,6 +155,16 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -155,6 +155,16 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
return new ArrayList<>(names); return new ArrayList<>(names);
} }
@Override
public List<String> findByModelForSeqNumber(String model) {
//根据型号查询是否是第一次生成 如果不是取出来最大值
List<MatchingDeviceLibrary> matchingDeviceLibraryList = matchingDeviceLibraryDao.findAllByModel(model);
return matchingDeviceLibraryList.stream().filter(matchingDeviceLibrary -> matchingDeviceLibrary.getSeqNumber().contains(model))
.map(matchingDeviceLibrary -> matchingDeviceLibrary.getSeqNumber().substring(matchingDeviceLibrary.getSeqNumber().length()-4))
.sorted(Comparator.comparing(String::toString).reversed())
.collect(Collectors.toList());
}
/** /**
* @param matchingDeviceSelectVo 配套设备查询vo * @param matchingDeviceSelectVo 配套设备查询vo
* 创建通用查询条件筛选器 * 创建通用查询条件筛选器
......
package com.tykj.dev.device.matching.service.impl;
import com.tykj.dev.device.matching.repository.MatchingDeviceModelDao;
import com.tykj.dev.device.matching.service.MatchingDeviceModelService;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MatchingDeviceModelServiceImpl implements MatchingDeviceModelService {
@Autowired
private MatchingDeviceModelDao matchingDeviceModelDao;
@Override
public MatchingDeviceModel addEntity(MatchingDeviceModel matchingDeviceModel) {
return matchingDeviceModelDao.save(matchingDeviceModel);
}
@Override
public MatchingDeviceModel findByModel(String model) {
return matchingDeviceModelDao.findByModel(model);
}
}
...@@ -104,6 +104,8 @@ public class MatchingDeviceBill { ...@@ -104,6 +104,8 @@ public class MatchingDeviceBill {
@Column(name = "file_rets",columnDefinition = "TEXT") @Column(name = "file_rets",columnDefinition = "TEXT")
private String fileRets; private String fileRets;
@Transient @Transient
@ApiModelProperty(value = "配发文件集合对象") @ApiModelProperty(value = "配发文件集合对象")
private List<FileRet> fileRetList ; private List<FileRet> fileRetList ;
......
package com.tykj.dev.device.matching.subject.domin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
/**
* zsp
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update matching_device_model set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("配套设备型号")
public class MatchingDeviceModel {
/**
* 主键id
*/
@Id
@GeneratedValue
@ApiModelProperty(name = "主键id")
@Column(columnDefinition = "integer NOT NULL AUTO_INCREMENT")
private Integer id;
/**
* 型号
*/
@ApiModelProperty(value = "型号")
private String model;
/**
* delete_tag
*/
@ApiModelProperty(value = "删除标志位")
private Integer delete_tag = 0;
}
...@@ -40,6 +40,12 @@ public class MatchingDeviceBillSaveVo { ...@@ -40,6 +40,12 @@ public class MatchingDeviceBillSaveVo {
private List<FileRet> fileRets; private List<FileRet> fileRets;
@ApiModelProperty(value = "是否打印rfid标签(1:是,0:否)")
private Integer isPrint = 0;
@ApiModelProperty(value = "任务id")
private Integer taskId = 0;
@Valid @Valid
@NotEmpty(message = "matchingDeviceSaveVoList不能为空") @NotEmpty(message = "matchingDeviceSaveVoList不能为空")
@ApiModelProperty(value = "配套设备列表") @ApiModelProperty(value = "配套设备列表")
......
package com.tykj.dev.device.matching.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zsp
*/
@Data
@ApiModel("配套设备的装备序列号")
public class MatchingDeviceCreateSeqVo {
@ApiModelProperty(name = "型号")
private String model;
@ApiModelProperty(name = "名称")
private String name;
@ApiModelProperty(name = "形态",example = "1")
private String style;
@ApiModelProperty(name = "数量")
private Integer num;
}
...@@ -7,6 +7,7 @@ import lombok.Data; ...@@ -7,6 +7,7 @@ import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -27,6 +28,10 @@ public class MatchingDeviceSaveVo { ...@@ -27,6 +28,10 @@ public class MatchingDeviceSaveVo {
@ApiModelProperty(value = "设备名称") @ApiModelProperty(value = "设备名称")
private String name; private String name;
@NotNull(message = "name不能为空")
@ApiModelProperty(value = "形态")
private String style;
@NotNull(message = "createUnit不能为空") @NotNull(message = "createUnit不能为空")
@ApiModelProperty(value = "创建单位") @ApiModelProperty(value = "创建单位")
private String createUnit; private String createUnit;
...@@ -43,6 +48,12 @@ public class MatchingDeviceSaveVo { ...@@ -43,6 +48,12 @@ public class MatchingDeviceSaveVo {
@ApiModelProperty(value = "rfid卡号") @ApiModelProperty(value = "rfid卡号")
private String rfidCardId; private String rfidCardId;
@ApiModelProperty(value = "入库的数量")
private Integer storageCount;
@ApiModelProperty(value = "序列号集合")
private List<String> seqList;
public MatchingDeviceLibrary toDo() { public MatchingDeviceLibrary toDo() {
MatchingDeviceLibrary matchingDeviceLibraryEntity = new MatchingDeviceLibrary(); MatchingDeviceLibrary matchingDeviceLibraryEntity = new MatchingDeviceLibrary();
BeanUtils.copyProperties(this, matchingDeviceLibraryEntity); BeanUtils.copyProperties(this, matchingDeviceLibraryEntity);
......
package com.tykj.dev.device.matching.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* zsp
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("配套设备序列号vo")
public class MatchingDeviceSeqVo {
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(name = "名称")
private String name;
@ApiModelProperty(name = "形态",example = "1")
private String style;
@ApiModelProperty(value = "入库数量")
private Integer storageCount;
@ApiModelProperty(value = "序列号区间")
private String seqInterval;
@ApiModelProperty(value = "序列号集合")
private List<String> seqList;
}
package com.tykj.dev.device.matching.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* zsp
*/
@Data
@ApiModel("新增配套详情返回类")
public class MatchingDeviceSplitVo {
@ApiModelProperty(value = "配套设备的vo")
private List<MatchingDeviceSaveVo> matchingDeviceSaveVos;
}
package com.tykj.dev.device.storage.subject.vo; package com.tykj.dev.device.storage.subject.vo;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
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;
import java.util.List;
/** /**
* @author dengdiyi * @author zsp
*/ */
@Data @Data
@ApiModel("生成附件的装备序列号") @ApiModel("生成附件的装备序列号")
...@@ -20,8 +14,11 @@ public class CreateSeqVo { ...@@ -20,8 +14,11 @@ public class CreateSeqVo {
@ApiModelProperty(name = "型号") @ApiModelProperty(name = "型号")
private String model; private String model;
@ApiModelProperty(name = "形态") @ApiModelProperty(name = "类型",example = "1")
private Integer style; private String type;
@ApiModelProperty(name = "形态",example = "1")
private String style;
@ApiModelProperty(name = "数量") @ApiModelProperty(name = "数量")
private Integer num; private Integer num;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论