提交 03caa782 authored 作者: 邓砥奕's avatar 邓砥奕

更新

上级 0268c8b6
......@@ -389,9 +389,9 @@ public class AllotBillController {
allotBill1.setAllotStatus(0);
AllotBill allotBill = allotBillService.addEntity(allotBill1);
//发起任务
TaskBto taskBto = new TaskBto(StatusEnum.ALLOT_DRAFT.id, "配发业务", null, ".", allotBill.getId(), 3, userUtils.getCurrentUnitId(), 1, null, userIds);
taskService.start(taskBto);
return ResponseEntity.ok("保存成功");
TaskBto taskBto = new TaskBto(StatusEnum.ALLOT_DRAFT.id, "配发业务", null, ".", allotBill.getId(), 3, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto1 = taskService.start(taskBto);
return ResponseEntity.ok("保存成功"+taskBto1.getId());
}
else {
//更新账单
......
......@@ -45,7 +45,7 @@ public class AllotBillSaveVo {
@ApiModelProperty(value = "发件方(B岗位)")
private Integer sendUserbId;
@NotNull(message = "receiveUseraId不能为空")
// @NotNull(message = "receiveUseraId不能为空")
@Min(value = 1,message = "receiveUseraId不能小于1")
@ApiModelProperty(value = "收件方(A岗位)")
private Integer receiveUseraId;
......
......@@ -63,6 +63,18 @@ public class DeviceLibraryController {
return ResponseEntity.ok(deviceLibraries);
}
@ApiOperation(value = "根据装备id查询装备详情", notes = "根据装备id查询装备详情")
@PostMapping("/selectRepairDeviceByIds")
public ResponseEntity selectByIds2(@RequestBody List<Detail> ids){
List<DeviceLibrary> deviceLibraries = new ArrayList<>();
ids.forEach(detail -> {
DeviceLibrary d = deviceLibraryService.getOne(detail.getDeviceId());
d.setDetailId(detail.getId());
deviceLibraries.add(d);
});
return ResponseEntity.ok(deviceLibraries);
}
@ApiOperation(value = "模糊查询装备分页", notes = "可以通过这个接口查询装备")
@PostMapping("/selectDevicePage")
public ResponseEntity selectDevicePage(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
......
......@@ -55,5 +55,7 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
List<DeviceLibrary> getAllByPackingId(Integer packingId);
List<DeviceLibrary> getAllBySeqNumber(String seq);
boolean existsAllByPackingIdInAndOwnUnitIn(List<Integer> packingIds,List<String> unitNames);
}
......@@ -207,6 +207,9 @@ public class DeviceLibrary {
@Transient
private Integer repairStatus;
@Transient
private Integer detailId;
@ApiModelProperty(value = "区块链记录id")
private String recordId;
......
......@@ -30,13 +30,17 @@ public enum RepairStatusEnum {
*/
SCRAPPED(4, "已报废"),
/**
* 已领取
* 已领取入库
*/
RECEIVED(5, "已领取"),
RECEIVED(5, "已领取入库"),
/**
* 新装备换新
*/
CHANGE_NEW_DEVICE(6, "新装备换新");
CHANGE_NEW_DEVICE(6, "新装备换新"),
/**
* 已领取待入库
*/
RECEIVE_WAIT_STORAGE(7, "已领取待入库");
public Integer id;
......
......@@ -7,7 +7,6 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.packing.service.PackingLibraryService;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.packing.subject.vo.*;
import com.tykj.dev.misc.utils.PageUtil;
import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -236,6 +235,14 @@ public class PackingLibraryController {
return ResultUtil.success(packingLibraryService.getPackingDetail(id));
}
@ApiOperation(value = "查询多个列装详情", notes = "可以通过这个接口查询多个列装详情")
@GetMapping("/selectMoreDetail/")
public ResponseEntity selectMorePackingDetail(@RequestBody List<Integer> ids) {
List<PackingLibrary> packingLibraries = new ArrayList<>();
ids.forEach(integer -> packingLibraries.add(packingLibraryService.getOne(integer)));
return ResultUtil.success(packingLibraries);
}
@ApiOperation(value = "查询退装详情页", notes = "可以通过这个接口查询存在的类型")
@GetMapping("/retired/detail/{id}")
public ResponseEntity selectInvalidDetail(@PathVariable("id") @Min(value = 1,message = "id不能小于1") int id) {
......
......@@ -206,6 +206,9 @@ public class PackingLibrary {
@ApiModelProperty(value = "预分配的装备序列号")
@Transient
private String seq;
@ApiModelProperty(value = "预分配的生产序列号")
@Transient
private String prodNumber;
public void addChildNode(PackingLibrary packingLibraryEntity) {
childs.add(packingLibraryEntity);
......
......@@ -9,4 +9,6 @@ import java.util.List;
public interface RepairDetailDao extends JpaRepository<RepairDetail, Integer>, JpaSpecificationExecutor<RepairDetail> {
List<RepairDetail> findByDeviceRepairBillId(Integer billId);
List<RepairDetail> findByRepairBackBillId(Integer billId);
List<RepairDetail> findAllByRepairStatusAndOwnUnit(Integer repairStatus,String ownUnit);
List<RepairDetail> findAllByRepairStatus(Integer repairStatus);
}
......@@ -134,5 +134,11 @@ public class RepairDetail {
@ApiModelProperty(value = "维修记录信息")
private String record;
@ApiModelProperty(value = "维修记录信息")
private String record2;
@ApiModelProperty(value = "维修记录信息")
private String record3;
private Integer repairBackBillId;
}
......@@ -18,7 +18,7 @@ import javax.validation.constraints.NotNull;
@ApiModel("维修装备详情类")
public class DeviceDetailVo {
@NotNull(message = "id不能为空")
// @NotNull(message = "id不能为空")
@Min(value = 1,message = "id不能小于1")
@ApiModelProperty(value = "维修详情ID", example = "1")
private Integer id;
......
......@@ -17,7 +17,7 @@ import java.util.List;
@ApiModel("维修返回单存储类")
public class RepairBackBillSaveVo {
@NotNull(message = "taskId不能为空")
// @NotNull(message = "taskId不能为空")
@Min(value = 1,message = "taskId不能小于1")
@ApiModelProperty(value = "任务Id")
private Integer taskId;
......@@ -45,11 +45,11 @@ public class RepairBackBillSaveVo {
// @ApiModelProperty(value = "接收经手人", example = "1")
// private Integer receiveUseraId;
@NotNull(message = "applyNumber不能为空")
// @NotNull(message = "applyNumber不能为空")
@ApiModelProperty(value = "申请文号")
private String applyNumber;
@NotNull(message = "replayNumber不能为空")
// @NotNull(message = "replayNumber不能为空")
@ApiModelProperty(value = "批复文号")
private String replayNumber;
......
......@@ -38,11 +38,11 @@ public class RepairBillSaveVo {
@ApiModelProperty(value = "维修经手人", example = "1")
private Integer repairUseraId;
@NotNull(message = "applyNumber不能为空")
// @NotNull(message = "applyNumber不能为空")
@ApiModelProperty(value = "申请文号")
private String applyNumber;
@NotNull(message = "replayNumber不能为空")
// @NotNull(message = "replayNumber不能为空")
@ApiModelProperty(value = "批复文号")
private String replayNumber;
......
......@@ -6,6 +6,8 @@ import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
/**
* @author dengdiyi
......@@ -19,7 +21,7 @@ public class RepairReceiveVo {
@ApiModelProperty(value = "接收单位B岗")
private Integer receiveUserbId;
@NotNull(message = "taskId不能为空")
// @NotNull(message = "taskId不能为空")
@Min(value = 1,message = "taskId不能小于1")
@ApiModelProperty(value = "任务Id")
private Integer taskId;
......@@ -56,4 +58,7 @@ public class RepairReceiveVo {
@NotNull(message = "status不能为空")
@ApiModelProperty(value = "是否缺失单据(0:否,1:是)")
private Integer status = 0;
@ApiModelProperty(value = "维修装备详情列表")
private List<DeviceDetailVo> deviceList = new ArrayList<>();
}
package com.tykj.dev.device.repair.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author dengdiyi
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("维修装备详情类")
public class RepairRecord {
@Min(value = 1,message = "id不能小于1")
@ApiModelProperty(value = "维修详情ID", example = "1")
private Integer id;
@NotNull
@ApiModelProperty(value = "维修记录")
private String record;
}
......@@ -16,7 +16,7 @@ import java.util.List;
@ApiModel("装备维修状态修改类")
public class RepairStatusChangeVo {
@NotNull(message = "taskId不能为空")
// @NotNull(message = "taskId不能为空")
@Min(value = 1,message = "taskId不能小于1")
@ApiModelProperty(name = "业务id", value = "1")
private Integer taskId;
......
......@@ -168,8 +168,12 @@ public class SelfCheckController {
List<DeviceLibrary> deviceLibraryEntities = new ArrayList<>();
List<DeviceLibrary> newList = new ArrayList<>();
List<DeviceLibrary> resultList = new ArrayList<>();
for (Integer id : list) {
DeviceLibrary d = deviceLibraryService.getOne(id);
List<Integer> detailIds = compareVo.getDetailIdList();
for (int i = 0;i<list.size();i++) {
DeviceLibrary d = deviceLibraryService.getOne(list.get(i));
if (detailIds.size()>i){
d.setDetailId(detailIds.get(i));
}
//list1存应查装备rfid卡号
list1.add(d.getRfidCardId());
//deviceLibraryEntities存应查装备
......
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -18,4 +19,7 @@ public class CompareVo {
@ApiModelProperty(value = "二维码上传RFID列表")
private List<String> rfidResultList;
@ApiModelProperty(value = "detailid列表")
private List<Integer> detailIdList = new ArrayList<>();
}
package com.tykj.dev.device.storage.controller;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
......@@ -84,6 +85,12 @@ public class StorageBillController {
@ApiOperation(value = "获取序列号区间列表", notes = "可以通过这个接口获取序列号区间列表")
@GetMapping(value = "/getSeq/{num}/{string}")
public ResponseEntity getSeq(@PathVariable("string") String s,@PathVariable("num") Integer num){
List<String> strings = DeviceSeqUtil.createDeviceSeqs(s,num);
strings.forEach(s1 -> {
if (deviceLibraryDao.getAllBySeqNumber(s1).size()>0){
throw new ApiException("序列号"+s1+"已存在");
}
});
return ResultUtil.success(DeviceSeqUtil.createDeviceSeqs(s,num));
}
......@@ -94,6 +101,7 @@ public class StorageBillController {
Map<Integer, List<PackingLibrary>> map = new HashMap<>();
for (StorageBillDetailVo s : list) {
List<String> strings = DeviceSeqUtil.createDeviceSeqs(s.getSeqInterval(),s.getStorageCount());
List<String> strings3 = DeviceSeqUtil.createDeviceSeqs(s.getProdInterval(),s.getStorageCount());
List<List<String>> sons = new ArrayList<>();
int count = 1;
Integer deviceNum = s.getStorageCount();
......@@ -101,7 +109,14 @@ public class StorageBillController {
PackingLibrary packingLibraryEntity = new PackingLibrary();
BeanUtils.copyProperties(packingLibraryService.getOne(s.getPackingId()), packingLibraryEntity);
packingLibraryEntity.setCorresponding(count);
if (!strings3.isEmpty()) {
packingLibraryEntity.setProdNumber(strings3.get(0));
strings3.remove(0);
}
if (!strings.isEmpty()) {
if (deviceLibraryDao.getAllBySeqNumber(strings.get(0)).size()>0){
throw new ApiException("序列号"+strings.get(0)+"已存在");
}
packingLibraryEntity.setSeq(strings.get(0));
strings.remove(0);
}
......@@ -326,8 +341,8 @@ public class StorageBillController {
StorageBill storageBill = storageBillService.addEntity(storageBill1);
//发起任务
TaskBto taskBto = new TaskBto(StatusEnum.WAIT_STORAGE.id, "入库业务", null, ".", storageBill.getId(), 2, userUtils.getCurrentUnitId(), 0, null, userIds);
taskService.start(taskBto);
return ResponseEntity.ok("保存成功");
TaskBto taskBto1 = taskService.start(taskBto);
return ResponseEntity.ok("保存成功"+taskBto1.getId());
}
else {
//更新账单
......@@ -359,8 +374,19 @@ public class StorageBillController {
StorageBill storageBillEntity = storageBillService.getOne(taskBto.getBillId());
storageBillEntity.setReceiveUserA(userPublicService.getOne(storageBillEntity.getReceiveUseraId()).getName());
storageBillEntity.setReceiveUserB(userPublicService.getOne(storageBillEntity.getReceiveUserbId()).getName());
storageBillEntity.setStorageBillDetailVos(JacksonUtil.readValueToList(storageBillEntity.getPackingDetail(),StorageBillDetailVo.class));
storageBillEntity.getStorageBillDetailVos().forEach(storageBillDetailVo -> storageBillDetailVo.setPackingLibrary(packingLibraryService.getOne(storageBillDetailVo.getPackingId())));
List<StorageBillDetailVo> storageBillDetailVos = JacksonUtil.readValue(storageBillEntity.getPackingDetail(), new TypeReference<List<StorageBillDetailVo>>() {
});
setPackingLibrary(storageBillDetailVos);
storageBillEntity.setStorageBillDetailVos(storageBillDetailVos);
return ResponseEntity.ok(storageBillEntity);
}
private void setPackingLibrary(List<StorageBillDetailVo> storageBillDetailVos){
storageBillDetailVos.forEach(storageBillDetailVo -> {
storageBillDetailVo.setPackingLibrary(packingLibraryService.getOne(storageBillDetailVo.getPackingId()));
if (storageBillDetailVo.getList()!=null&&storageBillDetailVo.getList().size()>0){
setPackingLibrary(storageBillDetailVo.getList());
}
});
}
}
......@@ -22,6 +22,8 @@ public class StorageBillDetailVo {
private Integer storageCount;
@ApiModelProperty(value = "序列号区间")
private String seqInterval;
@ApiModelProperty(value = "生产号区间")
private String prodInterval;
@ApiModelProperty(value = "列装装备")
private PackingLibrary packingLibrary;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论