提交 3f901863 authored 作者: 邓砥奕's avatar 邓砥奕

修改bug

上级 cd3358fa
...@@ -36,7 +36,7 @@ public class AllotBackBillServiceImpl implements AllotBackBillService { ...@@ -36,7 +36,7 @@ public class AllotBackBillServiceImpl implements AllotBackBillService {
@Override @Override
public AllotBackBill update(AllotBackBill allotBackBill) { public AllotBackBill update(AllotBackBill allotBackBill) {
blockChainUtil.appendHash(JacksonUtil.toJSon(allotBackBill),allotBackBill.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(allotBackBill),allotBackBill.getRecordId());
return allotBackBillDao.save(allotBackBill); return allotBackBillDao.save(allotBackBill);
} }
......
...@@ -47,7 +47,7 @@ public class AllotBillServiceImpl implements AllotBillService { ...@@ -47,7 +47,7 @@ public class AllotBillServiceImpl implements AllotBillService {
@Override @Override
public AllotBill update(AllotBill allotBillEntity) { public AllotBill update(AllotBill allotBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(allotBillEntity),allotBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(allotBillEntity),allotBillEntity.getRecordId());
return allotBillDao.save(allotBillEntity); return allotBillDao.save(allotBillEntity);
} }
......
...@@ -34,7 +34,7 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService { ...@@ -34,7 +34,7 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
@Override @Override
public DeviceApplyBill update(DeviceApplyBill deviceApplyBillEntity) { public DeviceApplyBill update(DeviceApplyBill deviceApplyBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceApplyBillEntity),deviceApplyBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceApplyBillEntity),deviceApplyBillEntity.getRecordId());
return deviceApplyBillDao.save(deviceApplyBillEntity); return deviceApplyBillDao.save(deviceApplyBillEntity);
} }
......
package com.tykj.dev.blockcha.subject.entity; package com.tykj.dev.blockcha.subject.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -13,5 +14,6 @@ import lombok.NoArgsConstructor; ...@@ -13,5 +14,6 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
public class BcHashData { public class BcHashData {
@JSONField(name = "recordID")
private String recordID; private String recordID;
} }
...@@ -4,12 +4,9 @@ import com.tykj.dev.blockcha.conf.BcUrl; ...@@ -4,12 +4,9 @@ import com.tykj.dev.blockcha.conf.BcUrl;
import com.tykj.dev.blockcha.subject.entity.*; import com.tykj.dev.blockcha.subject.entity.*;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import sun.applet.Main;
import java.io.UnsupportedEncodingException;
import java.util.Map; import java.util.Map;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
......
...@@ -85,7 +85,7 @@ public class DeviceDestroyBillServiceImpl implements DeviceDestroyBillService { ...@@ -85,7 +85,7 @@ public class DeviceDestroyBillServiceImpl implements DeviceDestroyBillService {
@Override @Override
public DeviceDestroyBill updateEntity(DeviceDestroyBill deviceDestoryBillEntity) { public DeviceDestroyBill updateEntity(DeviceDestroyBill deviceDestoryBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceDestoryBillEntity),deviceDestoryBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceDestoryBillEntity),deviceDestoryBillEntity.getRecordId());
return deviceDestroyBillDao.save(deviceDestoryBillEntity); return deviceDestroyBillDao.save(deviceDestoryBillEntity);
} }
......
...@@ -33,7 +33,7 @@ public class DeviceChangeServiceImpl implements DeviceChangeService { ...@@ -33,7 +33,7 @@ public class DeviceChangeServiceImpl implements DeviceChangeService {
BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceChange1)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceChange1));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
deviceChange1.setRecordId(recordId); deviceChange1.setRecordId(recordId);
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceChange1),deviceChange1.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceChange1),deviceChange1.getRecordId());
return deviceChangeDao.save(deviceChange1); return deviceChangeDao.save(deviceChange1);
} }
......
...@@ -384,7 +384,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -384,7 +384,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Override @Override
public DeviceLibrary update(DeviceLibrary deviceLibraryEntity) { public DeviceLibrary update(DeviceLibrary deviceLibraryEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceLibraryEntity),deviceLibraryEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceLibraryEntity),deviceLibraryEntity.getRecordId());
return deviceLibraryDao.save(deviceLibraryEntity); return deviceLibraryDao.save(deviceLibraryEntity);
} }
......
...@@ -33,7 +33,7 @@ public class DeviceLogServiceImpl implements DeviceLogService { ...@@ -33,7 +33,7 @@ public class DeviceLogServiceImpl implements DeviceLogService {
BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceLogEntity)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceLogEntity));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
deviceLogEntity.setRecordId(recordId); deviceLogEntity.setRecordId(recordId);
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceLogEntity),deviceLogEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceLogEntity),deviceLogEntity.getRecordId());
return deviceLogDao.save(deviceLogEntity).parse2Dto(); return deviceLogDao.save(deviceLogEntity).parse2Dto();
} }
......
...@@ -40,7 +40,7 @@ public class MatchingDeviceBillServiceImpl implements MatchingDeviceBillService ...@@ -40,7 +40,7 @@ public class MatchingDeviceBillServiceImpl implements MatchingDeviceBillService
@Override @Override
public MatchingDeviceBill update(MatchingDeviceBill matchingDeviceBillEntity) { public MatchingDeviceBill update(MatchingDeviceBill matchingDeviceBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(matchingDeviceBillEntity),matchingDeviceBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(matchingDeviceBillEntity),matchingDeviceBillEntity.getRecordId());
return matchingDeviceBillDao.save(matchingDeviceBillEntity); return matchingDeviceBillDao.save(matchingDeviceBillEntity);
} }
} }
...@@ -59,7 +59,7 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -59,7 +59,7 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
@Override @Override
public MatchingDeviceLibrary update(MatchingDeviceLibrary matchingDeviceLibraryEntity) { public MatchingDeviceLibrary update(MatchingDeviceLibrary matchingDeviceLibraryEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(matchingDeviceLibraryEntity),matchingDeviceLibraryEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(matchingDeviceLibraryEntity),matchingDeviceLibraryEntity.getRecordId());
return matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity); return matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity);
} }
......
...@@ -104,7 +104,7 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -104,7 +104,7 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
@Override @Override
public PackingLibrary update(PackingLibrary packingLibraryEntity) { public PackingLibrary update(PackingLibrary packingLibraryEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(packingLibraryEntity),packingLibraryEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(packingLibraryEntity),packingLibraryEntity.getRecordId());
return packingLibraryDao.save(packingLibraryEntity); return packingLibraryDao.save(packingLibraryEntity);
} }
......
...@@ -50,7 +50,7 @@ public class RepairBackBillServiceImpl implements RepairBackBillService { ...@@ -50,7 +50,7 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
@Override @Override
public RepairBackBill update(RepairBackBill deviceRepairBackBillEntity) { public RepairBackBill update(RepairBackBill deviceRepairBackBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairBackBillEntity),deviceRepairBackBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairBackBillEntity),deviceRepairBackBillEntity.getRecordId());
return deviceRepairBackBillDao.save(deviceRepairBackBillEntity); return deviceRepairBackBillDao.save(deviceRepairBackBillEntity);
} }
......
...@@ -57,7 +57,7 @@ public class RepairBillServiceImpl implements RepairBillService { ...@@ -57,7 +57,7 @@ public class RepairBillServiceImpl implements RepairBillService {
@Override @Override
public RepairBill update(RepairBill deviceRepairBillEntity) { public RepairBill update(RepairBill deviceRepairBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairBillEntity),deviceRepairBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairBillEntity),deviceRepairBillEntity.getRecordId());
return deviceRepairBillDao.save(deviceRepairBillEntity); return deviceRepairBillDao.save(deviceRepairBillEntity);
} }
......
...@@ -50,7 +50,7 @@ public class RepairDetailServiceImpl implements RepairDetailService { ...@@ -50,7 +50,7 @@ public class RepairDetailServiceImpl implements RepairDetailService {
@Override @Override
public RepairDetail update(RepairDetail deviceRepairDetailEntity) { public RepairDetail update(RepairDetail deviceRepairDetailEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairDetailEntity),deviceRepairDetailEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairDetailEntity),deviceRepairDetailEntity.getRecordId());
return deviceRepairDetailDao.save(deviceRepairDetailEntity); return deviceRepairDetailDao.save(deviceRepairDetailEntity);
} }
......
...@@ -64,7 +64,7 @@ public class RepairSendBillServiceImpl implements RepairSendBillService { ...@@ -64,7 +64,7 @@ public class RepairSendBillServiceImpl implements RepairSendBillService {
@Override @Override
public RepairSendBill update(RepairSendBill deviceRepairSendBillEntity) { public RepairSendBill update(RepairSendBill deviceRepairSendBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairSendBillEntity),deviceRepairSendBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairSendBillEntity),deviceRepairSendBillEntity.getRecordId());
return deviceRepairSendBillDao.save(deviceRepairSendBillEntity); return deviceRepairSendBillDao.save(deviceRepairSendBillEntity);
} }
......
...@@ -51,7 +51,7 @@ public class DeviceRetiredBillServiceImpl implements DeviceRetiredBillService { ...@@ -51,7 +51,7 @@ public class DeviceRetiredBillServiceImpl implements DeviceRetiredBillService {
@Override @Override
public DeviceRetiredBill update(DeviceRetiredBill deviceRetiredBillEntity) { public DeviceRetiredBill update(DeviceRetiredBill deviceRetiredBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRetiredBillEntity),deviceRetiredBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRetiredBillEntity),deviceRetiredBillEntity.getRecordId());
return deviceRetiredBillDao.save(deviceRetiredBillEntity); return deviceRetiredBillDao.save(deviceRetiredBillEntity);
} }
......
...@@ -28,7 +28,7 @@ public class AccessControlNameServiceImpl implements AccessControlNameService { ...@@ -28,7 +28,7 @@ public class AccessControlNameServiceImpl implements AccessControlNameService {
BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(accessControlName1)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(accessControlName1));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
accessControlName1.setRecordId(recordId); accessControlName1.setRecordId(recordId);
blockChainUtil.appendHash(JacksonUtil.toJSon(accessControlName1),accessControlName1.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(accessControlName1),accessControlName1.getRecordId());
return accessControlNameDao.save(accessControlName1); return accessControlNameDao.save(accessControlName1);
} }
......
...@@ -38,7 +38,7 @@ public class InputOutputDeviceServiceImpl implements InputOutputDeviceService { ...@@ -38,7 +38,7 @@ public class InputOutputDeviceServiceImpl implements InputOutputDeviceService {
BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(inputOutputDevice1)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(inputOutputDevice1));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
inputOutputDevice1.setRecordId(recordId); inputOutputDevice1.setRecordId(recordId);
blockChainUtil.appendHash(JacksonUtil.toJSon(inputOutputDevice1),inputOutputDevice1.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(inputOutputDevice1),inputOutputDevice1.getRecordId());
return inputOutputDeviceDao.save(inputOutputDevice1); return inputOutputDeviceDao.save(inputOutputDevice1);
} }
......
...@@ -30,7 +30,7 @@ public class LibraryWarningLogDetailServiceImp implements LibraryWarningLogDetai ...@@ -30,7 +30,7 @@ public class LibraryWarningLogDetailServiceImp implements LibraryWarningLogDetai
BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(libraryWarningLogDetail1)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(libraryWarningLogDetail1));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
libraryWarningLogDetail1.setRecordId(recordId); libraryWarningLogDetail1.setRecordId(recordId);
blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLogDetail1),libraryWarningLogDetail1.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLogDetail1),libraryWarningLogDetail1.getRecordId());
return libraryWarningLogDetailDao.save(libraryWarningLogDetail1); return libraryWarningLogDetailDao.save(libraryWarningLogDetail1);
} }
} }
...@@ -97,7 +97,7 @@ public class LibraryWarningLogServiceImpl implements LibraryWarningLogService { ...@@ -97,7 +97,7 @@ public class LibraryWarningLogServiceImpl implements LibraryWarningLogService {
@Override @Override
public Integer updateDetailHandleResult(WarningHandleVo warningHandleVo) { public Integer updateDetailHandleResult(WarningHandleVo warningHandleVo) {
LibraryWarningLogDetail detailEntity = libraryWarningLogDetailDao.getOne(warningHandleVo.getWarningDetailId()); LibraryWarningLogDetail detailEntity = libraryWarningLogDetailDao.findById(warningHandleVo.getWarningDetailId()).get();
detailEntity.setHandleResult(warningHandleVo.getHandleResult()); detailEntity.setHandleResult(warningHandleVo.getHandleResult());
detailEntity.setWarningHandle(1); detailEntity.setWarningHandle(1);
LibraryWarningLogDetail save = libraryWarningLogDetailDao.save(detailEntity); LibraryWarningLogDetail save = libraryWarningLogDetailDao.save(detailEntity);
...@@ -129,7 +129,7 @@ public class LibraryWarningLogServiceImpl implements LibraryWarningLogService { ...@@ -129,7 +129,7 @@ public class LibraryWarningLogServiceImpl implements LibraryWarningLogService {
@Override @Override
public LibraryWarningLog update(LibraryWarningLog libraryWarningLog) { public LibraryWarningLog update(LibraryWarningLog libraryWarningLog) {
blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLog),libraryWarningLog.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLog),libraryWarningLog.getRecordId());
return libraryWarningLogDao.save(libraryWarningLog); return libraryWarningLogDao.save(libraryWarningLog);
} }
......
...@@ -39,7 +39,7 @@ public class RfidChangeBillServiceImpl implements RfidChangeBillService { ...@@ -39,7 +39,7 @@ public class RfidChangeBillServiceImpl implements RfidChangeBillService {
@Override @Override
public RfidChangeBill updateEntity(RfidChangeBill libraryWarningLogEntity) { public RfidChangeBill updateEntity(RfidChangeBill libraryWarningLogEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLogEntity),libraryWarningLogEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLogEntity),libraryWarningLogEntity.getRecordId());
return rfidChangeBillDao.save(libraryWarningLogEntity); return rfidChangeBillDao.save(libraryWarningLogEntity);
} }
......
...@@ -52,7 +52,7 @@ public class RfidChangeLogServiceImpl implements RfidChangeLogService { ...@@ -52,7 +52,7 @@ public class RfidChangeLogServiceImpl implements RfidChangeLogService {
@Override @Override
public RfidChangeLog updateEntity(RfidChangeLog rfidChangeLog) { public RfidChangeLog updateEntity(RfidChangeLog rfidChangeLog) {
blockChainUtil.appendHash(JacksonUtil.toJSon(rfidChangeLog),rfidChangeLog.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(rfidChangeLog),rfidChangeLog.getRecordId());
return rfidChangeLogDao.save(rfidChangeLog); return rfidChangeLogDao.save(rfidChangeLog);
} }
......
...@@ -89,7 +89,7 @@ public class RfidServiceImpl implements RfidService { ...@@ -89,7 +89,7 @@ public class RfidServiceImpl implements RfidService {
Connection connection = new TcpConnection("192.168.0.222", 6101); Connection connection = new TcpConnection("192.168.0.222", 6101);
connection.open(); connection.open();
printer = ZebraPrinterFactory.getInstance(connection); printer = ZebraPrinterFactory.getInstance(connection);
String demoFile = createDemoFile(printer.getPrinterControlLanguage(),makeNumber,deviceNumber, content, 53, 80); String demoFile = createDemoFile(printer.getPrinterControlLanguage(),makeNumber,deviceNumber, content, 60, 55);
printer.sendFileContents(demoFile); printer.sendFileContents(demoFile);
} catch (ConnectionException e) { } catch (ConnectionException e) {
throw new ApiException(ResultUtil.failed("未找到对应的打印机")); throw new ApiException(ResultUtil.failed("未找到对应的打印机"));
...@@ -145,17 +145,17 @@ public class RfidServiceImpl implements RfidService { ...@@ -145,17 +145,17 @@ public class RfidServiceImpl implements RfidService {
"^LS0\n" + "^LS0\n" +
"\n" + "\n" +
"^LH" + marginLeft + "," + marginTop + "\n" + "^LH" + marginLeft + "," + marginTop + "\n" +
"^A1N,30,,E:SIM000.FNT^FR^FD\n" + // "^A1N,22,,E:SIM000.FNT^FR^FD\n" +
"^LH"+marginLeft+",+"+marginTop + // "^LH"+marginLeft+",+"+marginTop +
"^FDxx测试^FS\n" + // "^FDxx测试^FS\n" +
"^A1N,30,,E:SIM000.FNT^FR^FD\n" + "^A1N,25,,E:SIM000.FNT^FR^FD\n" +
"^FO0,50^FD生产号:"+makeNumber+"^FS\n" + "^FO0,0^FD生产号:"+makeNumber+"^FS\n" +
"^A1N,30,,E:SIM000.FNT^FR^FD\n" + "^A1N,25,,E:SIM000.FNT^FR^FD\n" +
"^FO0,90^FD装备号:"+deviceNumber+"^FS\n" + "^FO0,30^FD装备号:"+deviceNumber+"^FS\n" +
"^A1N,32,,E:SIM000.FNT^FR^FD\n" + "^A1N,25,,E:SIM000.FNT^FR^FD\n" +
"^FO0,130^FD表面号:^FS"+ "^FO0,60^FD表面号:^FS"+
"^A1N,32,,E:SIM000.FNT^FR^FD\n" + "^A1N,25,,E:SIM000.FNT^FR^FD\n" +
"^FO0,170^FD"+content+"^FS"+ "^FO0,90^FD"+content+"^FS"+
"^PQ1,0,1,Y\n" + "^PQ1,0,1,Y\n" +
"^XZ\n" + "^XZ\n" +
"^XZ").getBytes(); "^XZ").getBytes();
......
...@@ -52,7 +52,7 @@ public class ScrapBillServiceImpl implements ScrapBillService { ...@@ -52,7 +52,7 @@ public class ScrapBillServiceImpl implements ScrapBillService {
@Override @Override
public ScrapBill update(ScrapBill scrapBill) { public ScrapBill update(ScrapBill scrapBill) {
blockChainUtil.appendHash(JacksonUtil.toJSon(scrapBill),scrapBill.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(scrapBill),scrapBill.getRecordId());
return scrapBillDao.save(scrapBill); return scrapBillDao.save(scrapBill);
} }
......
...@@ -48,7 +48,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService { ...@@ -48,7 +48,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
@Override @Override
public SelfCheckBill update(SelfCheckBill selfExaminationBillEntity) { public SelfCheckBill update(SelfCheckBill selfExaminationBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(selfExaminationBillEntity),selfExaminationBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(selfExaminationBillEntity),selfExaminationBillEntity.getRecordId());
return selfExaminationBillDao.save(selfExaminationBillEntity); return selfExaminationBillDao.save(selfExaminationBillEntity);
} }
......
package com.tykj.dev.device.storage.controller; package com.tykj.dev.device.storage.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService; import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto; import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
...@@ -24,6 +25,7 @@ import com.tykj.dev.device.user.subject.service.UserPublicService; ...@@ -24,6 +25,7 @@ import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum; import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum; import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.DeviceSeqUtil; import com.tykj.dev.misc.utils.DeviceSeqUtil;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import com.tykj.dev.misc.utils.StringSplitUtil; import com.tykj.dev.misc.utils.StringSplitUtil;
...@@ -78,6 +80,9 @@ public class StorageBillController { ...@@ -78,6 +80,9 @@ public class StorageBillController {
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
@Autowired
private DeviceLibraryDao deviceLibraryDao;
@ApiOperation(value = "获取序列号区间列表", notes = "可以通过这个接口获取序列号区间列表") @ApiOperation(value = "获取序列号区间列表", notes = "可以通过这个接口获取序列号区间列表")
@GetMapping(value = "/getSeq/{num}/{string}") @GetMapping(value = "/getSeq/{num}/{string}")
public ResponseEntity getSeq(@PathVariable("string") String s,@PathVariable("num") Integer num){ public ResponseEntity getSeq(@PathVariable("string") String s,@PathVariable("num") Integer num){
...@@ -149,37 +154,42 @@ public class StorageBillController { ...@@ -149,37 +154,42 @@ public class StorageBillController {
//3.存装备 //3.存装备
Integer parentId = null; Integer parentId = null;
for (DeviceLibrarySaveVo d : storageBillSaveVo.getDeviceLibrarySaveVoList()) { for (DeviceLibrarySaveVo d : storageBillSaveVo.getDeviceLibrarySaveVoList()) {
DeviceLibrary saveEntity = new DeviceLibrary(); if (deviceLibraryDao.getAllByRfidCardId(d.getRfidCardId()).size()==0) {
DeviceLibrary deviceLibraryEntity = new DeviceLibrary(); DeviceLibrary saveEntity = new DeviceLibrary();
PackingLibrary packingLibraryEntity = packingLibraryService.getOne(d.getPackingId()); DeviceLibrary deviceLibraryEntity = new DeviceLibrary();
BeanUtils.copyProperties(packingLibraryEntity, deviceLibraryEntity); PackingLibrary packingLibraryEntity = packingLibraryService.getOne(d.getPackingId());
deviceLibraryEntity.setId(null); BeanUtils.copyProperties(packingLibraryEntity, deviceLibraryEntity);
deviceLibraryEntity.setLifeStatus(2); deviceLibraryEntity.setId(null);
BeanUtils.copyProperties(d, deviceLibraryEntity); deviceLibraryEntity.setLifeStatus(2);
deviceLibraryEntity.setStorageBillId(storageBillId); BeanUtils.copyProperties(d, deviceLibraryEntity);
deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName()); deviceLibraryEntity.setStorageBillId(storageBillId);
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName()); deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setPartParentId(null); deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
//如果不是单独的配件,设置父装备id为上一个装备的id deviceLibraryEntity.setPartParentId(null);
if (d.getIsSinglePart() == 0) { //如果不是单独的配件,设置父装备id为上一个装备的id
if (deviceLibraryEntity.getIsPart() == 0) { if (d.getIsSinglePart() == 0) {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity); if (deviceLibraryEntity.getIsPart() == 0) {
parentId = saveEntity.getId(); saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
parentId = saveEntity.getId();
}
if (deviceLibraryEntity.getIsPart() == 1) {
deviceLibraryEntity.setPartParentId(parentId);
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
}
} }
if (deviceLibraryEntity.getIsPart() == 1) { //如果是单独的配件,不用设置父装备id
deviceLibraryEntity.setPartParentId(parentId); else {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity); saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
} }
stringBuffer.append(saveEntity.getId());
//存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(saveEntity.getId(), "发起装备入库", fileVoList);
deviceLogService.addLog(deviceLogDto);
stringBuffer.append("x");
} }
//如果是单独的配件,不用设置父装备id
else { else {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity); throw new ApiException("系统中已存在rfid卡号为"+d.getRfidCardId()+"的装备!");
} }
stringBuffer.append(saveEntity.getId());
//存装备日志
DeviceLogDto deviceLogDto = new DeviceLogDto(saveEntity.getId(), "发起装备入库", fileVoList);
deviceLogService.addLog(deviceLogDto);
stringBuffer.append("x");
} }
//4.更新入库单入库详情 //4.更新入库单入库详情
storageBillEntity.setStorageDetail(stringBuffer.toString()); storageBillEntity.setStorageDetail(stringBuffer.toString());
......
...@@ -47,7 +47,7 @@ public class StorageBillServiceImpl implements StorageBillService { ...@@ -47,7 +47,7 @@ public class StorageBillServiceImpl implements StorageBillService {
@Override @Override
public StorageBill update(StorageBill storageBillEntity) { public StorageBill update(StorageBill storageBillEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(storageBillEntity),storageBillEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(storageBillEntity),storageBillEntity.getRecordId());
return storageBillDao.save(storageBillEntity); return storageBillDao.save(storageBillEntity);
} }
......
...@@ -6,10 +6,7 @@ import com.tykj.dev.device.task.service.TaskLogService; ...@@ -6,10 +6,7 @@ import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService; import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo; import com.tykj.dev.device.task.subject.vo.*;
import com.tykj.dev.device.task.subject.vo.TaskSelectVo;
import com.tykj.dev.device.task.subject.vo.TaskTopVo;
import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import com.tykj.dev.device.task.utils.TaskUtils; import com.tykj.dev.device.task.utils.TaskUtils;
import com.tykj.dev.device.user.util.UserUtils; import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum; import com.tykj.dev.misc.base.BusinessEnum;
...@@ -175,4 +172,10 @@ public class TaskController { ...@@ -175,4 +172,10 @@ public class TaskController {
.collect(Collectors.toList()); .collect(Collectors.toList());
return ResultUtil.success(taskLogUserVoList); return ResultUtil.success(taskLogUserVoList);
} }
@ApiOperation(value = "查询所有业务日志", notes = "可以通过这个接口查询业务日志")
@PostMapping("/manage/detail/logs")
public ResponseEntity selectAllLogs(@RequestBody TaskLogSelectVo taskLogSelectVo){
return ResponseEntity.ok( PageUtil.getPerPage(taskLogSelectVo.getPage(), taskLogSelectVo.getSize(), taskLogService.getAllByTime(taskLogSelectVo), taskLogSelectVo.getPageable()));
}
} }
...@@ -42,7 +42,7 @@ public class TaskLogServiceImpl implements TaskLogService { ...@@ -42,7 +42,7 @@ public class TaskLogServiceImpl implements TaskLogService {
BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(taskLog)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(taskLog));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
taskLog.setRecordId(recordId); taskLog.setRecordId(recordId);
blockChainUtil.appendHash(JacksonUtil.toJSon(taskLog),taskLog.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(taskLog),taskLog.getRecordId());
return taskLogDao.save(taskLog).parse2bto(); return taskLogDao.save(taskLog).parse2bto();
} }
......
...@@ -284,7 +284,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -284,7 +284,7 @@ public class TaskServiceImpl implements TaskService {
*/ */
@Override @Override
public Task update(TaskBto taskBto) { public Task update(TaskBto taskBto) {
blockChainUtil.appendHash(JacksonUtil.toJSon(taskBto.toDo()),taskBto.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(taskBto.toDo()),taskBto.getRecordId());
return taskDao.save(taskBto.toDo()); return taskDao.save(taskBto.toDo());
} }
...@@ -584,9 +584,10 @@ public class TaskServiceImpl implements TaskService { ...@@ -584,9 +584,10 @@ public class TaskServiceImpl implements TaskService {
.filter(taskBto -> { .filter(taskBto -> {
boolean unitExists = getUnitsByUsers(taskBto.getInvolveUserIdList()).contains(unitId); boolean unitExists = getUnitsByUsers(taskBto.getInvolveUserIdList()).contains(unitId);
// boolean involveExists = taskBto.getInvolveUserIdList().contains(userId); // boolean involveExists = taskBto.getInvolveUserIdList().contains(userId);
boolean userConfirm2 = taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()) == -1;
boolean pointExists = taskBto.getCurrentPoint() < taskBto.getInvolveUserIdList().size(); boolean pointExists = taskBto.getCurrentPoint() < taskBto.getInvolveUserIdList().size();
boolean userConfirm = userId.equals(taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint())); boolean userConfirm = userId.equals(taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()));
return unitExists && pointExists && !userConfirm; return unitExists && pointExists && !userConfirm && !userConfirm2;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
//涉及人员当前指针为-1,且所属单位为当前单位 //涉及人员当前指针为-1,且所属单位为当前单位
......
package com.tykj.dev.device.task.subject.vo; package com.tykj.dev.device.task.subject.vo;
import com.tykj.dev.misc.base.CustomPage;
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;
...@@ -11,7 +12,7 @@ import java.util.Date; ...@@ -11,7 +12,7 @@ import java.util.Date;
*/ */
@Data @Data
@ApiModel("业务日志查询类") @ApiModel("业务日志查询类")
public class TaskLogSelectVo { public class TaskLogSelectVo extends CustomPage {
@ApiModelProperty(value = "发起时间", example = "2020-10-10 01:10:10") @ApiModelProperty(value = "发起时间", example = "2020-10-10 01:10:10")
public Date startTime; public Date startTime;
......
...@@ -56,8 +56,8 @@ public class UserPublicServiceImpl implements UserPublicService { ...@@ -56,8 +56,8 @@ public class UserPublicServiceImpl implements UserPublicService {
@Override @Override
public User getOne(Integer userId) { public User getOne(Integer userId) {
if (userId!=null) { if (userId!=null) {
Optional<User> resultEntity = userDao.findById(userId); User resultEntity = userCache.findById(userId);
return resultEntity.orElse(null); return resultEntity;
}else { }else {
return new User(); return new User();
} }
......
...@@ -108,7 +108,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -108,7 +108,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
@Override @Override
public DeviceUseReport update(DeviceUseReport deviceUseReportEntity) { public DeviceUseReport update(DeviceUseReport deviceUseReportEntity) {
blockChainUtil.appendHash(JacksonUtil.toJSon(deviceUseReportEntity),deviceUseReportEntity.getRecordId()); // blockChainUtil.appendHash(JacksonUtil.toJSon(deviceUseReportEntity),deviceUseReportEntity.getRecordId());
return deviceUseReportDao.save(deviceUseReportEntity); return deviceUseReportDao.save(deviceUseReportEntity);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论