提交 5b2e11d1 authored 作者: zhoushaopan's avatar zhoushaopan

提交代码

上级 7ee461e4
package com.tykj.dev.device.allot.controller; package com.tykj.dev.device.allot.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.allot.subject.vo.AllotBillSaveVo; import com.tykj.dev.device.allot.subject.vo.AllotBillSaveVo;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.misc.base.ResultObj;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -11,7 +14,9 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -11,7 +14,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author dengdiyi * @author dengdiyi
...@@ -26,25 +31,57 @@ public class BatchAllotController { ...@@ -26,25 +31,57 @@ public class BatchAllotController {
@Autowired @Autowired
private AllotBillController allotBillController; private AllotBillController allotBillController;
@Autowired
private TaskService taskService;
@ApiOperation(value = "发起批量配发(type 1:签字配发,2:签章配发)") @ApiOperation(value = "发起批量配发(type 1:签字配发,2:签章配发)")
@PostMapping(value = "/createBatchAllot/{type}/{userId}") @PostMapping(value = "/createBatchAllot/{type}/{userId}")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity createBatchAllot(@PathVariable("type") int type, @PathVariable("userId") int userId ,@RequestBody List<AllotBillSaveVo> allotBillSaveVoList){ public ResponseEntity createBatchAllot(@PathVariable("type") int type, @PathVariable("userId") int userId ,@RequestBody List<AllotBillSaveVo> allotBillSaveVoList){
// List<Integer> billIds = new ArrayList<>();
Map<String, Integer> map = new HashMap<>();//存放的key 接受单位 value billId
if (type==1){ if (type==1){
allotBillSaveVoList.forEach(allotBillSaveVo -> // allotBillSaveVoList.forEach(allotBillSaveVo ->
allotBillController.addAllotBill(allotBillSaveVo) // allotBillController.addAllotBill(allotBillSaveVo)
); // );
for (AllotBillSaveVo allotBillSaveVo : allotBillSaveVoList) {
ResponseEntity responseEntity = allotBillController.addAllotBill(allotBillSaveVo);
ResultObj resultObj = (ResultObj)responseEntity.getBody();
AllotBill allotBill = (AllotBill)resultObj.getData();
String receiveUnit = allotBillSaveVo.getReceiveUnit();
Integer billId = allotBill.getId();
map.put(receiveUnit,billId);
}
} }
else { else {
List<Integer> taskIds = new ArrayList<>(); //任务id
List<String> taskIds = new ArrayList<>();
//批量保存草稿 //批量保存草稿
allotBillSaveVoList.forEach(allotBillSaveVo -> { // allotBillSaveVoList.forEach(allotBillSaveVo -> {
// String s = (String)allotBillController.saveAllotBill(allotBillSaveVo).getBody();
// taskIds.add(Integer.valueOf(s.substring(4)));
// });
for (AllotBillSaveVo allotBillSaveVo : allotBillSaveVoList) {
String s = (String)allotBillController.saveAllotBill(allotBillSaveVo).getBody(); String s = (String)allotBillController.saveAllotBill(allotBillSaveVo).getBody();
taskIds.add(Integer.valueOf(s.substring(4))); String newS = s.substring(4);
}); String receiveUnit = allotBillSaveVo.getReceiveUnit();
String taskId = newS+","+receiveUnit;
taskIds.add(taskId);
}
//批量申请签章 //批量申请签章
taskIds.forEach(integer -> allotBillController.applySign(integer,userId)); // taskIds.forEach(integer -> allotBillController.applySign(integer,userId));
for (String taskId : taskIds) {
String[] strings = taskId.split(",");
//取出来taskId
String realStringTaskId = strings[0];
//取出来接受单位
String receiveUnit = strings[1];
Integer realTaskId = Integer.valueOf(realStringTaskId);
allotBillController.applySign(realTaskId,userId);
Integer billId = taskService.get(realTaskId).getBillId();
map.put(receiveUnit,billId);
}
} }
return ResponseEntity.ok("发起成功"); return ResponseEntity.ok(map);
} }
} }
...@@ -32,7 +32,8 @@ public enum LogType { ...@@ -32,7 +32,8 @@ public enum LogType {
ALLOT_1(7,ALLOT.id, ALLOT_DRAFT.id, ALLOTING.id, "对(%receiveUnit)发起配发"), ALLOT_1(7,ALLOT.id, ALLOT_DRAFT.id, ALLOTING.id, "对(%receiveUnit)发起配发"),
ALLOT_2(8,ALLOT.id, ORIGIN_STATUS.id, ALLOT_DRAFT.id, "保存配发草稿"), // ALLOT_2(8,ALLOT.id, ORIGIN_STATUS.id, ALLOT_DRAFT.id, "保存配发草稿"),
ALLOT_2(8,ALLOT.id, ORIGIN_STATUS.id, ALLOT_DRAFT.id, "配发盖章申请"),
ALLOT_3(9,ALLOT.id, ALLOT_DRAFT.id, ARCHIVE.id, "删除配发草稿"), ALLOT_3(9,ALLOT.id, ALLOT_DRAFT.id, ARCHIVE.id, "删除配发草稿"),
...@@ -278,7 +279,7 @@ public enum LogType { ...@@ -278,7 +279,7 @@ public enum LogType {
REPAIR_SEND_12(97, REPAIR.id, WAIT_UPLOAD_SEND_FILE.id, ARCHIVE.id, "取消上传送修单"), REPAIR_SEND_12(97, REPAIR.id, WAIT_UPLOAD_SEND_FILE.id, ARCHIVE.id, "取消上传送修单"),
ALLOT_BACK_6(98, ALLOT_BACK.id, WAIT_UPLOAD_BACK_FILE_2.id, ARCHIVE.id, "取消上传退回单"), ALLOT_BACK_6(98, ALLOT_BACK.id, WAIT_UPLOAD_BACK_FILE_2.id, ARCHIVE.id, "取消上传退回单"),
ALLOT_12(99, ALLOT.id, ALLOTING.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, "接收配发装备(缺失单据)"), ALLOT_12(99, ALLOT.id, ALLOTING.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, "接收配发装备(缺失单据)"),
ALLOT_13(101, ALLOT.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, END.id, "上传配发签收单"), ALLOT_13(101, ALLOT.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, END.id, "上传相关单据,任务完结"),
ALLOT_14(102,ALLOT.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, ARCHIVE.id, "取消上传配发单"), ALLOT_14(102,ALLOT.id, WAIT_UPLOAD_ALLOT_RECEIVE_FILE.id, ARCHIVE.id, "取消上传配发单"),
ALLOT_BACK_7(103, ALLOT_BACK.id, WAIT_UPLOAD_ALLOT_BACK_FILE.id, ARCHIVE.id, "取消上传退回单"), ALLOT_BACK_7(103, ALLOT_BACK.id, WAIT_UPLOAD_ALLOT_BACK_FILE.id, ARCHIVE.id, "取消上传退回单"),
REPAIR_SEND_13(104, REPAIR.id, WAIT_UPLOAD_FILE.id, ARCHIVE.id, "取消上传送修单"), REPAIR_SEND_13(104, REPAIR.id, WAIT_UPLOAD_FILE.id, ARCHIVE.id, "取消上传送修单"),
...@@ -328,13 +329,18 @@ public enum LogType { ...@@ -328,13 +329,18 @@ public enum LogType {
ALLOT_BACK_17(142,ALLOT_BACK.id, ORIGIN_STATUS.id, BACK_DRAFT.id, "从草稿发起退回"), ALLOT_BACK_17(142,ALLOT_BACK.id, ORIGIN_STATUS.id, BACK_DRAFT.id, "从草稿发起退回"),
ALLOT_23(143,ALLOT.id, ALLOTING.id, SIGN_WAIT_CONFIRM.id, "申请入库签章"), ALLOT_23(143,ALLOT.id, ALLOTING.id, SIGN_WAIT_CONFIRM.id, "申请入库签章"),
ALLOT_24(144,ALLOT.id, ORIGIN_STATUS.id, WAIT_UPLOAD_ALLOT_FILE.id, "待上传回执单"),//0-322 ALLOT_24(144,ALLOT.id, ORIGIN_STATUS.id, WAIT_UPLOAD_ALLOT_FILE.id, "待上传回执单"),//0-322
// REPAIR_BACK_22(145,REPAIR_BACK.id, ORIGIN_STATUS.id, REPAIR_BACK_DRAFT.id, "维修退回等待出库"), REPAIR_BACK_22(145,REPAIR_BACK.id, ORIGIN_STATUS.id, REPAIR_BACK_DRAFT.id, "维修退回等待出库"),
REPAIR_BACK_23(146,REPAIR_BACK.id, REPAIR_BACK_DRAFT.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, "申请签章待审核"), REPAIR_BACK_23(146,REPAIR_BACK.id, REPAIR_BACK_DRAFT.id, REPAIR_BACK_SIGN_WAIT_CONFIRM.id, "申请签章待审核"),
// REPAIR_SEND_22(147,REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_DRAFT.id, "送修等待出库"), // REPAIR_SEND_22(147,REPAIR.id, ORIGIN_STATUS.id, REPAIR_SEND_DRAFT.id, "送修等待出库"),
REPAIR_SEND_23(148,REPAIR.id, ORIGIN_STATUS.id, WAIT_UPLOAD_SEND_FILE.id, "等待上传回执单"), REPAIR_SEND_23(148,REPAIR.id, ORIGIN_STATUS.id, WAIT_UPLOAD_SEND_FILE.id, "等待上传回执单"),
ALLOT_25(149,ALLOT.id,ALLOT_DRAFT.id,ALLOT_DRAFT.id,"申请电子签章被拒绝"), ALLOT_25(149,ALLOT.id,ALLOT_DRAFT.id,ALLOT_DRAFT.id,"申请电子签章被拒绝"),
ALLOT_26(150,ALLOT.id,SIGN_WAIT_CONFIRM.id,ARCHIVE.id,"该业务已经被撤回"), ALLOT_26(150,ALLOT.id,SIGN_WAIT_CONFIRM.id,ARCHIVE.id,"该业务已经被撤回"),
ALLOT_27(151,REPAIR_BACK.id,ORIGIN_STATUS.id,WAIT_UPLOAD_BACK_SEND_FILE.id,"等待上传回执单") ALLOT_27(151,REPAIR_BACK.id,ORIGIN_STATUS.id,WAIT_UPLOAD_BACK_SEND_FILE.id,"等待上传回执单"),
REPAIR_BACK_24(152,REPAIR_BACK.id,REPAIR_BACK_SIGN_WAIT_CONFIRM.id,REPAIR_BACK_WAIT_SIGN.id,"同意签章审核"),
REPAIR_BACK_25(153,REPAIR_BACK.id,WAIT_BACK_RECEIVE.id,REPAIR_BACK_SIGN_WAIT_CONFIRM.id,"等待签章审核"),
REPAIR_BACK_26(154,REPAIR_BACK.id,REPAIR_BACK_SIGN_WAIT_CONFIRM.id,REPAIR_BACK_WAIT_SIGN.id,"等待签章审核"),
REPAIR_BACK_27(155,REPAIR_BACK.id,REPAIR_BACK_WAIT_SIGN.id,WAIT_BACK_RECEIVE.id,"等待签章审核"),
REPAIR_BACK_28(156,REPAIR_BACK.id,REPAIR_BACK_WAIT_SIGN.id,WAIT_UPLOAD_BACK_FILE.id,"等待上传相关单据"),
; ;
public Integer id; public Integer id;
......
...@@ -203,7 +203,7 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe ...@@ -203,7 +203,7 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
List<Integer> userIds = new ArrayList<>(); List<Integer> userIds = new ArrayList<>();
userIds.add(userId); userIds.add(userId);
userIds.add(0); userIds.add(0);
return taskService.start(new TaskBto(StatusEnum.DESTROY_2.id, unitId+"要进行销毁设备任务", null, ".", repelDetailId, BusinessEnum.DESTROY.id, unitId, 1, "", userIds)); return taskService.start(new TaskBto(StatusEnum.DESTROY_2.id, "销毁设备任务", null, ".", repelDetailId, BusinessEnum.DESTROY.id, unitId, 1, "", userIds));
} }
private List<String> scriptListToStringList(DeviceDestroyBillVo deviceDestroyBillVo){ private List<String> scriptListToStringList(DeviceDestroyBillVo deviceDestroyBillVo){
......
...@@ -213,6 +213,7 @@ public class DeviceLibraryController { ...@@ -213,6 +213,7 @@ public class DeviceLibraryController {
Set<String> names = new HashSet<>(); Set<String> names = new HashSet<>();
Set<String> ownUnits = new HashSet<>(); Set<String> ownUnits = new HashSet<>();
Set<String> locationUnits = new HashSet<>(); Set<String> locationUnits = new HashSet<>();
Set<String> storageLocation = new HashSet<>();
resultList.forEach(deviceVo -> { resultList.forEach(deviceVo -> {
deviceVo.setConfigName(); deviceVo.setConfigName();
status.add(deviceVo.getLifeStatus()); status.add(deviceVo.getLifeStatus());
...@@ -220,6 +221,7 @@ public class DeviceLibraryController { ...@@ -220,6 +221,7 @@ public class DeviceLibraryController {
names.add(deviceVo.getName()); names.add(deviceVo.getName());
ownUnits.add(deviceVo.getOwnUnit()); ownUnits.add(deviceVo.getOwnUnit());
locationUnits.add(deviceVo.getLocationUnit()); locationUnits.add(deviceVo.getLocationUnit());
storageLocation.add(deviceVo.getStorageLocation());
}); });
map.put("pages",deviceLibraryEntities); map.put("pages",deviceLibraryEntities);
...@@ -228,7 +230,8 @@ public class DeviceLibraryController { ...@@ -228,7 +230,8 @@ public class DeviceLibraryController {
map.put("ownUnits",ownUnits); map.put("ownUnits",ownUnits);
map.put("locationUnits",locationUnits); map.put("locationUnits",locationUnits);
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()));
// System.out.println("时间:"+(System.currentTimeMillis()-strat)); map.put("storageLocation",storageLocation);
// System.out.println("222");
return ResultUtil.success(map); return ResultUtil.success(map);
} }
...@@ -604,4 +607,7 @@ public class DeviceLibraryController { ...@@ -604,4 +607,7 @@ public class DeviceLibraryController {
deviceLibraries.forEach(DeviceLibrary::setConfigName); deviceLibraries.forEach(DeviceLibrary::setConfigName);
return ResultUtil.success(deviceLibraries.stream().filter(deviceLibrary1 -> !deviceLibrary1.getId().equals(id) && deviceLibrary1.getLifeStatus() == 2 && deviceLibrary1.getOwnUnit().equals(userUtils.getCurrentUserUnitName()) &&deviceLibrary1.getLocationUnit().equals(userUtils.getCurrentUserUnitName())).collect(Collectors.toList())); return ResultUtil.success(deviceLibraries.stream().filter(deviceLibrary1 -> !deviceLibrary1.getId().equals(id) && deviceLibrary1.getLifeStatus() == 2 && deviceLibrary1.getOwnUnit().equals(userUtils.getCurrentUserUnitName()) &&deviceLibrary1.getLocationUnit().equals(userUtils.getCurrentUserUnitName())).collect(Collectors.toList()));
} }
} }
...@@ -230,6 +230,9 @@ public class DeviceLibrary { ...@@ -230,6 +230,9 @@ public class DeviceLibrary {
@ApiModelProperty(value = "对应申请任务id") @ApiModelProperty(value = "对应申请任务id")
private Integer applyTaskId; private Integer applyTaskId;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation;
@Transient @Transient
private List<DeviceLibrary> childs = new ArrayList<>(); private List<DeviceLibrary> childs = new ArrayList<>();
......
...@@ -57,4 +57,7 @@ public class DeviceLibrarySaveVo { ...@@ -57,4 +57,7 @@ public class DeviceLibrarySaveVo {
@ApiModelProperty(value = "是否需要绑定",notes = "0 是绑定, 1 是未绑定") @ApiModelProperty(value = "是否需要绑定",notes = "0 是绑定, 1 是未绑定")
private Integer isBinding = 0; private Integer isBinding = 0;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation;
} }
...@@ -514,8 +514,8 @@ public class PackingController { ...@@ -514,8 +514,8 @@ public class PackingController {
throw new ApiException("该型号下已存在配用范围为"+configCache.getMatchingRangeMap().get(packingLibraryUpdateVo.getMatchingRange())+"的相同装备"); throw new ApiException("该型号下已存在配用范围为"+configCache.getMatchingRangeMap().get(packingLibraryUpdateVo.getMatchingRange())+"的相同装备");
} }
//复制相同的字段 //复制相同的字段
if (packingLibraryUpdateVo.getName()!=null&&!packingLibraryUpdateVo.getName().equals(packingLibrary.getName())&&!packingLibraryUpdateVo.getName().equals(packingLibrary.getName())){ if (packingLibraryUpdateVo.getName()!=null&&!packingLibraryUpdateVo.getName().equals(packingLibrary.getName())){
if (packingLibraryService.nameIsExist(packingLibrary.getModel(),packingLibraryUpdateVo.getName(),packingLibrary.getPartParentId())){ if (packingLibraryService.nameIsExist1(packingLibrary.getModel(),packingLibraryUpdateVo.getName(),packingLibrary.getPartParentId(),packingLibrary.getMatchingRange())){
throw new ApiException("该型号下已存在配用范围为"+configCache.getMatchingRangeMap().get(packingLibraryUpdateVo.getMatchingRange())+"的相同名称装备"); throw new ApiException("该型号下已存在配用范围为"+configCache.getMatchingRangeMap().get(packingLibraryUpdateVo.getMatchingRange())+"的相同名称装备");
} }
//添加列装日志 //添加列装日志
......
...@@ -148,6 +148,8 @@ public interface PackingLibraryService { ...@@ -148,6 +148,8 @@ public interface PackingLibraryService {
Boolean nameIsExist(String model,String name ,Integer partParentId); Boolean nameIsExist(String model,String name ,Integer partParentId);
Boolean nameIsExist1(String model,String name ,Integer partParentId,Integer matchingRange);
Boolean matchingRangeIsExist(Integer parentId,Integer matchingRange,Integer type,Integer style,String name,Integer secretLevel,Integer invisibleRange); Boolean matchingRangeIsExist(Integer parentId,Integer matchingRange,Integer type,Integer style,String name,Integer secretLevel,Integer invisibleRange);
......
...@@ -573,6 +573,17 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -573,6 +573,17 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
return packingLibraryDao.findAll(predicateBuilder.build()).size()>0; return packingLibraryDao.findAll(predicateBuilder.build()).size()>0;
} }
@Override
public Boolean nameIsExist1(String model, String name, Integer partParentId, Integer matchingRange) {
PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and();
predicateBuilder.eq("isRoot", 0);
predicateBuilder.eq("model", model);
predicateBuilder.eq("name", name);
predicateBuilder.eq("partParentId", partParentId);
predicateBuilder.eq("matchingRange", matchingRange);
return packingLibraryDao.findAll(predicateBuilder.build()).size()>0;
}
@Override @Override
public Boolean matchingRangeIsExist(Integer parentId,Integer matchingRange,Integer type,Integer style,String name,Integer secretLevel,Integer invisibleRange) { public Boolean matchingRangeIsExist(Integer parentId,Integer matchingRange,Integer type,Integer style,String name,Integer secretLevel,Integer invisibleRange) {
PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and(); PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and();
......
...@@ -150,6 +150,9 @@ public class PackingLibrary { ...@@ -150,6 +150,9 @@ public class PackingLibrary {
*/ */
@ApiModelProperty(value = "附件名称") @ApiModelProperty(value = "附件名称")
private String fileName; private String fileName;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation;
/** /**
* 附件url地址 * 附件url地址
*/ */
......
...@@ -430,4 +430,30 @@ public class RfidController { ...@@ -430,4 +430,30 @@ public class RfidController {
deviceLogService.addLog(new DeviceLogDto(d.getDeviceId(), flag == 0 ? "标签替换成功" : "标签替换审核失败", billList,null,null)); deviceLogService.addLog(new DeviceLogDto(d.getDeviceId(), flag == 0 ? "标签替换成功" : "标签替换审核失败", billList,null,null));
}); });
} }
@ApiOperation(value = "打印或者更新rfid", notes = "打印rfid")
@GetMapping("/print/deviceId")
public ResponseEntity printRfid(Integer id) {
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(id);
DeviceLogDto deviceLogDto = null;
// List<PrintVo> printVos = new ArrayList<>();
PrintVo printVo1 = new PrintVo(RfidServiceImpl.completeRfidStr(String.valueOf(deviceLibrary.getId())), deviceLibrary.getModel(), deviceLibrary.getName(),deviceLibrary.getSeqNumber());
if ("".equals(deviceLibrary.getRfidCardId())) {
deviceLibrary.setRfidCardId(RfidServiceImpl.completeRfidStr(String.valueOf(deviceLibrary.getId())));
if (rfidService.printString1(printVo1)){
deviceLibraryService.update(deviceLibrary);
deviceLogDto = new DeviceLogDto(deviceLibrary.getId(), "打印标签", null, null, null);
}
}
else {
rfidService.printString1(printVo1);
deviceLogDto = new DeviceLogDto(deviceLibrary.getId(), "更新标签", null, null, null);
}
// printVos.add(printVo1);
// rfidService.printString(printVos.stream().sorted(Comparator.comparing(PrintVo::getRfidContent)).collect(Collectors.toList()));
deviceLogService.addLog(deviceLogDto);
return ResponseEntity.ok(deviceLibrary.getRfidCardId());
}
} }
...@@ -37,6 +37,13 @@ public interface RfidService { ...@@ -37,6 +37,13 @@ public interface RfidService {
*/ */
boolean printString(List<PrintVo> printVos); boolean printString(List<PrintVo> printVos);
/**
* 描述:调用打印机打印内容(如出现打印不对齐的情况请联系管理员)
*
* @return
*/
boolean printString1(PrintVo printVo);
/** /**
* 描述:生成装备的RFID表面号 * 描述:生成装备的RFID表面号
* *
......
...@@ -109,6 +109,26 @@ public class RfidServiceImpl implements RfidService { ...@@ -109,6 +109,26 @@ public class RfidServiceImpl implements RfidService {
return true; return true;
} }
@Override
public boolean printString1(PrintVo printVo) {
try {
Connection connection = new TcpConnection("10.153.4.16", 6101);
connection.open();
printer = ZebraPrinterFactory.getInstance(connection);
String demoFile = createDemoFile(printer.getPrinterControlLanguage(),printVo.getRfidContent(),printVo.getStr1(), printVo.getStr2(),printVo.getStr3(), 55, 50);
printer.sendFileContents(demoFile);
connection.close();
} catch (ConnectionException e) {
throw new ApiException("未找到对应的打印机");
} catch (ZebraPrinterLanguageUnknownException e) {
throw new ApiException("打印机内容错误");
} catch (IOException e) {
throw new ApiException("生成打印文件失败");
}
return true;
}
/** /**
* @param pl 打印机语言 * @param pl 打印机语言
......
...@@ -245,6 +245,7 @@ public class StorageBillController { ...@@ -245,6 +245,7 @@ public class StorageBillController {
packingLibraryEntity = packingLibraryService.getOne(s2.getPackingId()); packingLibraryEntity = packingLibraryService.getOne(s2.getPackingId());
packingLibraryEntity.setCorresponding(0); packingLibraryEntity.setCorresponding(0);
packingLibraryEntity.setIsSinglePart(1); packingLibraryEntity.setIsSinglePart(1);
if (!strings2.isEmpty()) { if (!strings2.isEmpty()) {
if (deviceLibraryDao.getAllBySeqNumber(strings2.get(0)).size() > 0) { if (deviceLibraryDao.getAllBySeqNumber(strings2.get(0)).size() > 0) {
throw new ApiException("序列号" + strings2.get(0) + "已存在"); throw new ApiException("序列号" + strings2.get(0) + "已存在");
...@@ -277,6 +278,7 @@ public class StorageBillController { ...@@ -277,6 +278,7 @@ public class StorageBillController {
if (s3.getStorageCount() >= count) { if (s3.getStorageCount() >= count) {
packingLibraryEntity.setIsSinglePart(0); packingLibraryEntity.setIsSinglePart(0);
packingLibraryEntity.setCorresponding(count); packingLibraryEntity.setCorresponding(count);
if (!strings4.isEmpty()) { if (!strings4.isEmpty()) {
if (deviceLibraryDao.getAllBySeqNumber(strings4.get(0)).size() > 0) { if (deviceLibraryDao.getAllBySeqNumber(strings4.get(0)).size() > 0) {
throw new ApiException("序列号" + strings4.get(0) + "已存在"); throw new ApiException("序列号" + strings4.get(0) + "已存在");
...@@ -300,6 +302,8 @@ public class StorageBillController { ...@@ -300,6 +302,8 @@ public class StorageBillController {
packingLibraryEntity = packingLibraryService.getOne(s3.getPackingId()); packingLibraryEntity = packingLibraryService.getOne(s3.getPackingId());
packingLibraryEntity.setCorresponding(0); packingLibraryEntity.setCorresponding(0);
packingLibraryEntity.setIsSinglePart(1); packingLibraryEntity.setIsSinglePart(1);
if (!strings4.isEmpty()) { if (!strings4.isEmpty()) {
if (deviceLibraryDao.getAllBySeqNumber(strings4.get(0)).size() > 0) { if (deviceLibraryDao.getAllBySeqNumber(strings4.get(0)).size() > 0) {
throw new ApiException("序列号" + strings4.get(0) + "已存在"); throw new ApiException("序列号" + strings4.get(0) + "已存在");
...@@ -382,7 +386,7 @@ public class StorageBillController { ...@@ -382,7 +386,7 @@ public class StorageBillController {
if (storageBillSaveVo.getTaskId()==null) { if (storageBillSaveVo.getTaskId()==null) {
storageBillEntity = storageBillService.addEntity(storageBillSaveVo.toDo()); storageBillEntity = storageBillService.addEntity(storageBillSaveVo.toDo());
//2.发起入库任务 //2.发起入库任务
TaskBto taskBto = new TaskBto(StatusEnum.END.id, storageBillSaveVo.getSendUnit()+"发起了入库业务", null, ".", storageBillEntity.getId(), 2, userUtils.getCurrentUnitId(), 0, null, userIds); TaskBto taskBto = new TaskBto(StatusEnum.END.id, storageBillSaveVo.getSendUnit()+"进行了入库业务", null, ".", storageBillEntity.getId(), 2, userUtils.getCurrentUnitId(), 0, null, userIds);
taskEntity1 = taskService.start(taskBto); taskEntity1 = taskService.start(taskBto);
} }
else { else {
...@@ -429,6 +433,7 @@ public class StorageBillController { ...@@ -429,6 +433,7 @@ public class StorageBillController {
deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName()); deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName()); deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setPartParentId(null); deviceLibraryEntity.setPartParentId(null);
//如果不是单独的配件,设置父装备id为上一个装备的id 0-不是,1-是 //如果不是单独的配件,设置父装备id为上一个装备的id 0-不是,1-是
if (d.getIsBinding() == 0){ if (d.getIsBinding() == 0){
if (d.getIsSinglePart() == 0) { if (d.getIsSinglePart() == 0) {
...@@ -675,7 +680,7 @@ public class StorageBillController { ...@@ -675,7 +680,7 @@ public class StorageBillController {
storageBill1.setStorageStatus(0); storageBill1.setStorageStatus(0);
StorageBill storageBill = storageBillService.addEntity(storageBill1); StorageBill storageBill = storageBillService.addEntity(storageBill1);
//发起任务 //发起任务
TaskBto taskBto = new TaskBto(StatusEnum.WAIT_STORAGE.id, storageBillSaveVo.getSendUnit()+"发起了入库业务", null, ".", storageBill.getId(), 2, userUtils.getCurrentUnitId(), 0, null, userIds); TaskBto taskBto = new TaskBto(StatusEnum.WAIT_STORAGE.id, storageBillSaveVo.getSendUnit()+"进行了入库业务", null, ".", storageBill.getId(), 2, userUtils.getCurrentUnitId(), 0, null, userIds);
TaskBto taskBto1 = taskService.start(taskBto); TaskBto taskBto1 = taskService.start(taskBto);
myWebSocket.sendMessage1(); myWebSocket.sendMessage1();
return ResponseEntity.ok("保存成功"+taskBto1.getId()); return ResponseEntity.ok("保存成功"+taskBto1.getId());
......
...@@ -153,6 +153,9 @@ public class StorageBill { ...@@ -153,6 +153,9 @@ public class StorageBill {
@ApiModelProperty(value = "是否打印标签(0:未打印,1:已打印)") @ApiModelProperty(value = "是否打印标签(0:未打印,1:已打印)")
private Integer isPrint; private Integer isPrint;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation;
@ApiModelProperty(value = "经办人") @ApiModelProperty(value = "经办人")
@Transient @Transient
private String receiveUserA; private String receiveUserA;
......
...@@ -29,4 +29,6 @@ public class StorageBillDetail { ...@@ -29,4 +29,6 @@ public class StorageBillDetail {
private String name; private String name;
@ApiModelProperty(value = "形态") @ApiModelProperty(value = "形态")
private String typeName; private String typeName;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation;
} }
...@@ -26,4 +26,7 @@ public class StorageBillDetailVo { ...@@ -26,4 +26,7 @@ public class StorageBillDetailVo {
private String prodInterval; private String prodInterval;
@ApiModelProperty(value = "列装装备") @ApiModelProperty(value = "列装装备")
private PackingLibrary packingLibrary; private PackingLibrary packingLibrary;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation;
} }
...@@ -115,7 +115,8 @@ public class StorageBillSaveVo { ...@@ -115,7 +115,8 @@ public class StorageBillSaveVo {
@ApiModelProperty(value = "存在申请任务的序列号") @ApiModelProperty(value = "存在申请任务的序列号")
private List<String> hasTaskSeqs = new ArrayList<>(); private List<String> hasTaskSeqs = new ArrayList<>();
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation ;
......
...@@ -338,7 +338,6 @@ public class TaskController { ...@@ -338,7 +338,6 @@ public class TaskController {
Integer businessType = taskBusinessTypeVo.getBusinessType(); Integer businessType = taskBusinessTypeVo.getBusinessType();
Integer taskId = taskBusinessTypeVo.getTaskId(); Integer taskId = taskBusinessTypeVo.getTaskId();
// Integer parentTaskId = taskService.get(taskId).getParentTaskId();
//当前状态 //当前状态
Integer billStatus = taskService.get(taskId).getBillStatus(); Integer billStatus = taskService.get(taskId).getBillStatus();
List<TaskLogUserVo> taskLogUserVos = taskLogService.getByTaskId2(taskId); List<TaskLogUserVo> taskLogUserVos = taskLogService.getByTaskId2(taskId);
...@@ -360,7 +359,7 @@ public class TaskController { ...@@ -360,7 +359,7 @@ public class TaskController {
case 10 : case 10 :
//语句 //语句
return ResponseEntity.ok(repairBack(taskLogUserVos,billStatus)); return ResponseEntity.ok(repairBack(taskLogUserVos,billStatus));
case 11 : case 5 :
//语句 //语句
return ResponseEntity.ok(repair(taskLogUserVos,billStatus)); return ResponseEntity.ok(repair(taskLogUserVos,billStatus));
...@@ -370,36 +369,6 @@ public class TaskController { ...@@ -370,36 +369,6 @@ public class TaskController {
} }
// @ApiOperation(value = "任务撤回", notes = "根据任务id撤回任务")
// @GetMapping("/revokeTask/taskId")
// public ResponseEntity revokeTask(Integer taskId){
//
// //根据任务id查询子任务 发件方是子任务 收件方是主任务
// TaskBto taskBto = taskService.get(taskId);
// Integer parentTaskId = taskBto.getParentTaskId();
//
// TaskBto parentTask = taskService.get(parentTaskId);
// //父任务未被完成 可以被撤回
// Integer billId = taskBto.getBillId();
// String title = taskBto.getTitle();
//
//
// List<DeviceLibrary> deviceLibraryList = deviceLibraryService.getListByBillId(billId);
//
//
//
// for (DeviceLibrary deviceLibrary : deviceLibraryList) {
// deviceLibrary.setLifeStatus(2);
// deviceLibraryService.update(deviceLibrary);
// }
// //将任务都完结
// taskService.moveToArchive(taskBto);
//
// taskService.moveToArchive(parentTask);
// return ResponseEntity.ok(title + "的任务撤回成功");
//
//
// }
private Map<String, String> allot(List<TaskLogUserVo> taskLogUserVos,Integer billStatus){ private Map<String, String> allot(List<TaskLogUserVo> taskLogUserVos,Integer billStatus){
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
...@@ -423,11 +392,7 @@ public class TaskController { ...@@ -423,11 +392,7 @@ public class TaskController {
} }
} else { } else {
//0 333 //0 333
// if (billStatus == 333){
// map.clear();
// }else {
map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser()); map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser());
// }
} }
} }
...@@ -488,19 +453,20 @@ public class TaskController { ...@@ -488,19 +453,20 @@ public class TaskController {
if (billStatus == 788 && taskLogUserVo.getOldStatus() == 790){ if (billStatus == 788 && taskLogUserVo.getOldStatus() == 790){
map.clear(); map.clear();
}else { }else {
map.put("790",taskLogUserVo.getUser()); map.put("790",taskLogUserVo.getUser());
} }
} }
} }
}else { }else {
// if (billStatus == 788){ if (taskLogUserVo.getOldStatus() == 791){
// map.clear(); if (map.containsKey("791") && map.containsKey("790j")){
// }else { map.put("791j",taskLogUserVo.getUser());
}else {
map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser());
}
}else {
map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser()); map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser());
}
// }
} }
} }
...@@ -531,11 +497,15 @@ public class TaskController { ...@@ -531,11 +497,15 @@ public class TaskController {
} }
} }
}else { }else {
// if (billStatus == 888){ if (taskLogUserVo.getOldStatus() == 821){
// map.clear(); if (map.containsKey("821") && map.containsKey("820j")){
// }else { map.put("821j",taskLogUserVo.getUser());
}else {
map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser());
}
}else {
map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser()); map.put(taskLogUserVo.getOldStatus()+"",taskLogUserVo.getUser());
// } }
} }
} }
......
...@@ -164,7 +164,7 @@ public class MessageServiceImpl implements MessageService { ...@@ -164,7 +164,7 @@ public class MessageServiceImpl implements MessageService {
&&(!hasBusinessType||messageBto.getBusinessType().equals(messageSelectVo.getBusinessType())) &&(!hasBusinessType||messageBto.getBusinessType().equals(messageSelectVo.getBusinessType()))
&&(!hasYear||messageBto.getCreateTime().getYear()==messageSelectVo.getYear()-1900)) &&(!hasYear||messageBto.getCreateTime().getYear()==messageSelectVo.getYear()-1900))
.map(MessageBto::toVo) .map(MessageBto::toVo)
.filter(messageUserVo -> messageUserVo.getIsRead().equals(messageSelectVo.getIsRead())) // .filter(messageUserVo -> messageUserVo.getIsRead().equals(messageSelectVo.getIsRead()))
.sorted(Comparator.comparing(MessageUserVo::getCreateTime,Comparator.nullsLast(Date::compareTo)).reversed()) .sorted(Comparator.comparing(MessageUserVo::getCreateTime,Comparator.nullsLast(Date::compareTo)).reversed())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论