提交 548d1b8d authored 作者: 邓砥奕's avatar 邓砥奕

修改为hash上链

上级 3ec17b41
package com.tykj.dev.device.allot.service.impl; package com.tykj.dev.device.allot.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.allot.repository.AllotBackBillDao; import com.tykj.dev.device.allot.repository.AllotBackBillDao;
import com.tykj.dev.device.allot.service.AllotBackBillService; import com.tykj.dev.device.allot.service.AllotBackBillService;
...@@ -28,7 +28,7 @@ public class AllotBackBillServiceImpl implements AllotBackBillService { ...@@ -28,7 +28,7 @@ public class AllotBackBillServiceImpl implements AllotBackBillService {
@Override @Override
public AllotBackBill addEntity(AllotBackBill allotBackBill) { public AllotBackBill addEntity(AllotBackBill allotBackBill) {
AllotBackBill allotBackBill1 = allotBackBillDao.save(allotBackBill); AllotBackBill allotBackBill1 = allotBackBillDao.save(allotBackBill);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(allotBackBill1)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(allotBackBill1));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
allotBackBill1.setRecordId(recordId); allotBackBill1.setRecordId(recordId);
return allotBackBillDao.save(allotBackBill1); return allotBackBillDao.save(allotBackBill1);
...@@ -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.appendText(JacksonUtil.toJSon(allotBackBill),allotBackBill.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(allotBackBill),allotBackBill.getRecordId());
return allotBackBillDao.save(allotBackBill); return allotBackBillDao.save(allotBackBill);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.allot.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.allot.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.allot.repository.AllotBillDao; import com.tykj.dev.device.allot.repository.AllotBillDao;
import com.tykj.dev.device.allot.service.AllotBillService; import com.tykj.dev.device.allot.service.AllotBillService;
...@@ -39,7 +39,7 @@ public class AllotBillServiceImpl implements AllotBillService { ...@@ -39,7 +39,7 @@ public class AllotBillServiceImpl implements AllotBillService {
@Override @Override
public AllotBill addEntity(AllotBill allotBillEntity) { public AllotBill addEntity(AllotBill allotBillEntity) {
AllotBill allotBill = allotBillDao.save(allotBillEntity); AllotBill allotBill = allotBillDao.save(allotBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(allotBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(allotBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
allotBill.setRecordId(recordId); allotBill.setRecordId(recordId);
return update(allotBill); return update(allotBill);
...@@ -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.appendText(JacksonUtil.toJSon(allotBillEntity),allotBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(allotBillEntity),allotBillEntity.getRecordId());
return allotBillDao.save(allotBillEntity); return allotBillDao.save(allotBillEntity);
} }
......
package com.tykj.dev.device.apply.service.impl; package com.tykj.dev.device.apply.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.apply.repository.DeviceApplyBillDao; import com.tykj.dev.device.apply.repository.DeviceApplyBillDao;
import com.tykj.dev.device.apply.service.DeviceApplyBillService; import com.tykj.dev.device.apply.service.DeviceApplyBillService;
...@@ -26,7 +26,7 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService { ...@@ -26,7 +26,7 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
@Override @Override
public DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity) { public DeviceApplyBill addEntity(DeviceApplyBill deviceApplyBillEntity) {
DeviceApplyBill deviceApplyBill = deviceApplyBillDao.save(deviceApplyBillEntity); DeviceApplyBill deviceApplyBill = deviceApplyBillDao.save(deviceApplyBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(deviceApplyBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceApplyBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
deviceApplyBill.setRecordId(recordId); deviceApplyBill.setRecordId(recordId);
return update(deviceApplyBill); return update(deviceApplyBill);
...@@ -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.appendText(JacksonUtil.toJSon(deviceApplyBillEntity),deviceApplyBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceApplyBillEntity),deviceApplyBillEntity.getRecordId());
return deviceApplyBillDao.save(deviceApplyBillEntity); return deviceApplyBillDao.save(deviceApplyBillEntity);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.destroy.service.Impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.destroy.service.Impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill; import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
import com.tykj.dev.device.destroy.entity.vo.DeviceDestroyBillSelectVo; import com.tykj.dev.device.destroy.entity.vo.DeviceDestroyBillSelectVo;
...@@ -48,7 +48,7 @@ public class DeviceDestroyBillServiceImpl implements DeviceDestroyBillService { ...@@ -48,7 +48,7 @@ public class DeviceDestroyBillServiceImpl implements DeviceDestroyBillService {
@Override @Override
public DeviceDestroyBill addEntity(DeviceDestroyBill deviceDestroyBillEntity) { public DeviceDestroyBill addEntity(DeviceDestroyBill deviceDestroyBillEntity) {
DeviceDestroyBill deviceDestroyBill = deviceDestroyBillDao.save(deviceDestroyBillEntity); DeviceDestroyBill deviceDestroyBill = deviceDestroyBillDao.save(deviceDestroyBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(deviceDestroyBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceDestroyBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
deviceDestroyBill.setRecordId(recordId); deviceDestroyBill.setRecordId(recordId);
return updateEntity(deviceDestroyBill); return updateEntity(deviceDestroyBill);
...@@ -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.appendText(JacksonUtil.toJSon(deviceDestoryBillEntity),deviceDestoryBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceDestoryBillEntity),deviceDestoryBillEntity.getRecordId());
return deviceDestroyBillDao.save(deviceDestoryBillEntity); return deviceDestroyBillDao.save(deviceDestoryBillEntity);
} }
......
package com.tykj.dev.device.library.service.impl; package com.tykj.dev.device.library.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.library.repository.DeviceChangeDao; import com.tykj.dev.device.library.repository.DeviceChangeDao;
import com.tykj.dev.device.library.service.DeviceChangeService; import com.tykj.dev.device.library.service.DeviceChangeService;
...@@ -30,10 +30,10 @@ public class DeviceChangeServiceImpl implements DeviceChangeService { ...@@ -30,10 +30,10 @@ public class DeviceChangeServiceImpl implements DeviceChangeService {
@Override @Override
public DeviceChange add(DeviceChange deviceChange) { public DeviceChange add(DeviceChange deviceChange) {
DeviceChange deviceChange1 = deviceChangeDao.save(deviceChange); DeviceChange deviceChange1 = deviceChangeDao.save(deviceChange);
BcText bcText = blockChainUtil.sendText(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.appendText(JacksonUtil.toJSon(deviceChange1),deviceChange1.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceChange1),deviceChange1.getRecordId());
return deviceChangeDao.save(deviceChange1); return deviceChangeDao.save(deviceChange1);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.library.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.library.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
...@@ -48,7 +48,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -48,7 +48,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Override @Override
public DeviceLibrary addEntity(DeviceLibrary deviceLibraryEntity) { public DeviceLibrary addEntity(DeviceLibrary deviceLibraryEntity) {
DeviceLibrary deviceLibrary = deviceLibraryDao.save(deviceLibraryEntity); DeviceLibrary deviceLibrary = deviceLibraryDao.save(deviceLibraryEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(deviceLibrary)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceLibrary));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
deviceLibrary.setRecordId(recordId); deviceLibrary.setRecordId(recordId);
return update(deviceLibrary); return update(deviceLibrary);
...@@ -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.appendText(JacksonUtil.toJSon(deviceLibraryEntity),deviceLibraryEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceLibraryEntity),deviceLibraryEntity.getRecordId());
return deviceLibraryDao.save(deviceLibraryEntity); return deviceLibraryDao.save(deviceLibraryEntity);
} }
......
package com.tykj.dev.device.library.service.impl; package com.tykj.dev.device.library.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.library.repository.DeviceLogDao; import com.tykj.dev.device.library.repository.DeviceLogDao;
import com.tykj.dev.device.library.service.DeviceLogService; import com.tykj.dev.device.library.service.DeviceLogService;
...@@ -30,10 +30,10 @@ public class DeviceLogServiceImpl implements DeviceLogService { ...@@ -30,10 +30,10 @@ public class DeviceLogServiceImpl implements DeviceLogService {
@Override @Override
public DeviceLogDto addLog(DeviceLogDto deviceLogDto) { public DeviceLogDto addLog(DeviceLogDto deviceLogDto) {
DeviceLog deviceLogEntity = deviceLogDao.save(deviceLogDto.toDo()); DeviceLog deviceLogEntity = deviceLogDao.save(deviceLogDto.toDo());
BcText bcText = blockChainUtil.sendText(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.appendText(JacksonUtil.toJSon(deviceLogEntity),deviceLogEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceLogEntity),deviceLogEntity.getRecordId());
return deviceLogDao.save(deviceLogEntity).parse2Dto(); return deviceLogDao.save(deviceLogEntity).parse2Dto();
} }
......
package com.tykj.dev.device.matching.service.impl; package com.tykj.dev.device.matching.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.matching.repository.MatchingDeviceBillDao; import com.tykj.dev.device.matching.repository.MatchingDeviceBillDao;
import com.tykj.dev.device.matching.service.MatchingDeviceBillService; import com.tykj.dev.device.matching.service.MatchingDeviceBillService;
...@@ -26,7 +26,7 @@ public class MatchingDeviceBillServiceImpl implements MatchingDeviceBillService ...@@ -26,7 +26,7 @@ public class MatchingDeviceBillServiceImpl implements MatchingDeviceBillService
@Override @Override
public MatchingDeviceBill addEntity(MatchingDeviceBill matchingDeviceBillEntity) { public MatchingDeviceBill addEntity(MatchingDeviceBill matchingDeviceBillEntity) {
MatchingDeviceBill matchingDeviceBill = matchingDeviceBillDao.save(matchingDeviceBillEntity); MatchingDeviceBill matchingDeviceBill = matchingDeviceBillDao.save(matchingDeviceBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(matchingDeviceBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(matchingDeviceBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
matchingDeviceBill.setRecordId(recordId); matchingDeviceBill.setRecordId(recordId);
return update(matchingDeviceBill); return update(matchingDeviceBill);
...@@ -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.appendText(JacksonUtil.toJSon(matchingDeviceBillEntity),matchingDeviceBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(matchingDeviceBillEntity),matchingDeviceBillEntity.getRecordId());
return matchingDeviceBillDao.save(matchingDeviceBillEntity); return matchingDeviceBillDao.save(matchingDeviceBillEntity);
} }
} }
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.matching.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.matching.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.matching.repository.MatchingDeviceLibraryDao; import com.tykj.dev.device.matching.repository.MatchingDeviceLibraryDao;
import com.tykj.dev.device.matching.service.MatchingDeviceLibraryService; import com.tykj.dev.device.matching.service.MatchingDeviceLibraryService;
...@@ -45,7 +45,7 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -45,7 +45,7 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
@Override @Override
public MatchingDeviceLibrary addEntity(MatchingDeviceLibrary matchingDeviceLibraryEntity) { public MatchingDeviceLibrary addEntity(MatchingDeviceLibrary matchingDeviceLibraryEntity) {
MatchingDeviceLibrary matchingDeviceLibrary = matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity); MatchingDeviceLibrary matchingDeviceLibrary = matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(matchingDeviceLibrary)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(matchingDeviceLibrary));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
matchingDeviceLibrary.setRecordId(recordId); matchingDeviceLibrary.setRecordId(recordId);
return update(matchingDeviceLibrary); return update(matchingDeviceLibrary);
...@@ -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.appendText(JacksonUtil.toJSon(matchingDeviceLibraryEntity),matchingDeviceLibraryEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(matchingDeviceLibraryEntity),matchingDeviceLibraryEntity.getRecordId());
return matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity); return matchingDeviceLibraryDao.save(matchingDeviceLibraryEntity);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.packing.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.packing.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.GlobalMap; import com.tykj.dev.config.GlobalMap;
import com.tykj.dev.device.packing.repository.PackingLibraryDao; import com.tykj.dev.device.packing.repository.PackingLibraryDao;
...@@ -44,7 +44,7 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -44,7 +44,7 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
@Override @Override
public PackingLibrary addEntity(PackingLibrary packingLibraryEntity) { public PackingLibrary addEntity(PackingLibrary packingLibraryEntity) {
PackingLibrary packingLibrary = packingLibraryDao.save(packingLibraryEntity); PackingLibrary packingLibrary = packingLibraryDao.save(packingLibraryEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(packingLibrary)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(packingLibrary));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
packingLibrary.setRecordId(recordId); packingLibrary.setRecordId(recordId);
return update(packingLibrary); return update(packingLibrary);
...@@ -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.appendText(JacksonUtil.toJSon(packingLibraryEntity),packingLibraryEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(packingLibraryEntity),packingLibraryEntity.getRecordId());
return packingLibraryDao.save(packingLibraryEntity); return packingLibraryDao.save(packingLibraryEntity);
} }
......
package com.tykj.dev.device.repair.service.impl; package com.tykj.dev.device.repair.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.repair.repository.RepairBackBillDao; import com.tykj.dev.device.repair.repository.RepairBackBillDao;
import com.tykj.dev.device.repair.service.RepairBackBillService; import com.tykj.dev.device.repair.service.RepairBackBillService;
...@@ -32,7 +32,7 @@ public class RepairBackBillServiceImpl implements RepairBackBillService { ...@@ -32,7 +32,7 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
@Override @Override
public RepairBackBill save(RepairBackBill deviceRepairBackBillEntity) { public RepairBackBill save(RepairBackBill deviceRepairBackBillEntity) {
RepairBackBill repairBackBill = deviceRepairBackBillDao.save(deviceRepairBackBillEntity); RepairBackBill repairBackBill = deviceRepairBackBillDao.save(deviceRepairBackBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(repairBackBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(repairBackBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
repairBackBill.setRecordId(recordId); repairBackBill.setRecordId(recordId);
return update(repairBackBill); return update(repairBackBill);
...@@ -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.appendText(JacksonUtil.toJSon(deviceRepairBackBillEntity),deviceRepairBackBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairBackBillEntity),deviceRepairBackBillEntity.getRecordId());
return deviceRepairBackBillDao.save(deviceRepairBackBillEntity); return deviceRepairBackBillDao.save(deviceRepairBackBillEntity);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.repair.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.repair.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.repair.repository.RepairBillDao; import com.tykj.dev.device.repair.repository.RepairBillDao;
import com.tykj.dev.device.repair.service.RepairBillService; import com.tykj.dev.device.repair.service.RepairBillService;
...@@ -38,7 +38,7 @@ public class RepairBillServiceImpl implements RepairBillService { ...@@ -38,7 +38,7 @@ public class RepairBillServiceImpl implements RepairBillService {
@Override @Override
public RepairBill addEntity(RepairBill deviceRepairBillEntity) { public RepairBill addEntity(RepairBill deviceRepairBillEntity) {
RepairBill repairBill = deviceRepairBillDao.save(deviceRepairBillEntity); RepairBill repairBill = deviceRepairBillDao.save(deviceRepairBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(repairBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(repairBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
repairBill.setRecordId(recordId); repairBill.setRecordId(recordId);
return update(repairBill); return update(repairBill);
...@@ -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.appendText(JacksonUtil.toJSon(deviceRepairBillEntity),deviceRepairBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairBillEntity),deviceRepairBillEntity.getRecordId());
return deviceRepairBillDao.save(deviceRepairBillEntity); return deviceRepairBillDao.save(deviceRepairBillEntity);
} }
......
package com.tykj.dev.device.repair.service.impl; package com.tykj.dev.device.repair.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.repair.repository.RepairDetailDao; import com.tykj.dev.device.repair.repository.RepairDetailDao;
import com.tykj.dev.device.repair.service.RepairDetailService; import com.tykj.dev.device.repair.service.RepairDetailService;
...@@ -32,7 +32,7 @@ public class RepairDetailServiceImpl implements RepairDetailService { ...@@ -32,7 +32,7 @@ public class RepairDetailServiceImpl implements RepairDetailService {
@Override @Override
public RepairDetail save(RepairDetail deviceRepairDetailEntity) { public RepairDetail save(RepairDetail deviceRepairDetailEntity) {
RepairDetail repairDetail = deviceRepairDetailDao.save(deviceRepairDetailEntity); RepairDetail repairDetail = deviceRepairDetailDao.save(deviceRepairDetailEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(repairDetail)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(repairDetail));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
repairDetail.setRecordId(recordId); repairDetail.setRecordId(recordId);
return update(repairDetail); return update(repairDetail);
...@@ -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.appendText(JacksonUtil.toJSon(deviceRepairDetailEntity),deviceRepairDetailEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairDetailEntity),deviceRepairDetailEntity.getRecordId());
return deviceRepairDetailDao.save(deviceRepairDetailEntity); return deviceRepairDetailDao.save(deviceRepairDetailEntity);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.repair.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.repair.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.repair.repository.RepairSendBillDao; import com.tykj.dev.device.repair.repository.RepairSendBillDao;
import com.tykj.dev.device.repair.service.RepairSendBillService; import com.tykj.dev.device.repair.service.RepairSendBillService;
...@@ -38,7 +38,7 @@ public class RepairSendBillServiceImpl implements RepairSendBillService { ...@@ -38,7 +38,7 @@ public class RepairSendBillServiceImpl implements RepairSendBillService {
@Override @Override
public RepairSendBill addEntity(RepairSendBill deviceRepairSendBillEntity) { public RepairSendBill addEntity(RepairSendBill deviceRepairSendBillEntity) {
RepairSendBill repairSendBill = deviceRepairSendBillDao.save(deviceRepairSendBillEntity); RepairSendBill repairSendBill = deviceRepairSendBillDao.save(deviceRepairSendBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(repairSendBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(repairSendBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
repairSendBill.setRecordId(recordId); repairSendBill.setRecordId(recordId);
return update(repairSendBill); return update(repairSendBill);
...@@ -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.appendText(JacksonUtil.toJSon(deviceRepairSendBillEntity),deviceRepairSendBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRepairSendBillEntity),deviceRepairSendBillEntity.getRecordId());
return deviceRepairSendBillDao.save(deviceRepairSendBillEntity); return deviceRepairSendBillDao.save(deviceRepairSendBillEntity);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.retired.service.Impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.retired.service.Impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
...@@ -36,7 +36,7 @@ public class DeviceRetiredBillServiceImpl implements DeviceRetiredBillService { ...@@ -36,7 +36,7 @@ public class DeviceRetiredBillServiceImpl implements DeviceRetiredBillService {
@Override @Override
public DeviceRetiredBill addEntity(DeviceRetiredBill deviceRetiredBillEntity) { public DeviceRetiredBill addEntity(DeviceRetiredBill deviceRetiredBillEntity) {
DeviceRetiredBill deviceRetiredBill = deviceRetiredBillDao.save(deviceRetiredBillEntity); DeviceRetiredBill deviceRetiredBill = deviceRetiredBillDao.save(deviceRetiredBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(deviceRetiredBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceRetiredBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
deviceRetiredBill.setRecordId(recordId); deviceRetiredBill.setRecordId(recordId);
return update(deviceRetiredBill); return update(deviceRetiredBill);
...@@ -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.appendText(JacksonUtil.toJSon(deviceRetiredBillEntity),deviceRetiredBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(deviceRetiredBillEntity),deviceRetiredBillEntity.getRecordId());
return deviceRetiredBillDao.save(deviceRetiredBillEntity); return deviceRetiredBillDao.save(deviceRetiredBillEntity);
} }
......
package com.tykj.dev.rfid.service.impl; package com.tykj.dev.rfid.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.rfid.entity.domin.AccessControlName; import com.tykj.dev.rfid.entity.domin.AccessControlName;
...@@ -25,10 +25,10 @@ public class AccessControlNameServiceImpl implements AccessControlNameService { ...@@ -25,10 +25,10 @@ public class AccessControlNameServiceImpl implements AccessControlNameService {
@Override @Override
public AccessControlName add(AccessControlName accessControlName) { public AccessControlName add(AccessControlName accessControlName) {
AccessControlName accessControlName1 = accessControlNameDao.save(accessControlName); AccessControlName accessControlName1 = accessControlNameDao.save(accessControlName);
BcText bcText = blockChainUtil.sendText(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.appendText(JacksonUtil.toJSon(accessControlName1),accessControlName1.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(accessControlName1),accessControlName1.getRecordId());
return accessControlNameDao.save(accessControlName1); return accessControlNameDao.save(accessControlName1);
} }
......
package com.tykj.dev.rfid.service.impl; package com.tykj.dev.rfid.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
...@@ -35,10 +35,10 @@ public class InputOutputDeviceServiceImpl implements InputOutputDeviceService { ...@@ -35,10 +35,10 @@ public class InputOutputDeviceServiceImpl implements InputOutputDeviceService {
@Override @Override
public InputOutputDevice addEntity(InputOutputDevice inputOutputDevice) { public InputOutputDevice addEntity(InputOutputDevice inputOutputDevice) {
InputOutputDevice inputOutputDevice1 = inputOutputDeviceDao.save(inputOutputDevice); InputOutputDevice inputOutputDevice1 = inputOutputDeviceDao.save(inputOutputDevice);
BcText bcText = blockChainUtil.sendText(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.appendText(JacksonUtil.toJSon(inputOutputDevice1),inputOutputDevice1.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(inputOutputDevice1),inputOutputDevice1.getRecordId());
return inputOutputDeviceDao.save(inputOutputDevice1); return inputOutputDeviceDao.save(inputOutputDevice1);
} }
......
package com.tykj.dev.rfid.service.impl; package com.tykj.dev.rfid.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.rfid.entity.domin.LibraryWarningLogDetail; import com.tykj.dev.rfid.entity.domin.LibraryWarningLogDetail;
...@@ -27,10 +27,10 @@ public class LibraryWarningLogDetailServiceImp implements LibraryWarningLogDetai ...@@ -27,10 +27,10 @@ public class LibraryWarningLogDetailServiceImp implements LibraryWarningLogDetai
@Override @Override
public LibraryWarningLogDetail addEntity(LibraryWarningLogDetail libraryWarningLogDetail) { public LibraryWarningLogDetail addEntity(LibraryWarningLogDetail libraryWarningLogDetail) {
LibraryWarningLogDetail libraryWarningLogDetail1 = libraryWarningLogDetailDao.save(libraryWarningLogDetail); LibraryWarningLogDetail libraryWarningLogDetail1 = libraryWarningLogDetailDao.save(libraryWarningLogDetail);
BcText bcText = blockChainUtil.sendText(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.appendText(JacksonUtil.toJSon(libraryWarningLogDetail1),libraryWarningLogDetail1.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLogDetail1),libraryWarningLogDetail1.getRecordId());
return libraryWarningLogDetailDao.save(libraryWarningLogDetail1); return libraryWarningLogDetailDao.save(libraryWarningLogDetail1);
} }
} }
...@@ -2,7 +2,7 @@ package com.tykj.dev.rfid.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.rfid.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.library.service.DeviceLibraryService; import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
...@@ -52,7 +52,7 @@ public class LibraryWarningLogServiceImpl implements LibraryWarningLogService { ...@@ -52,7 +52,7 @@ public class LibraryWarningLogServiceImpl implements LibraryWarningLogService {
@Override @Override
public LibraryWarningLog addEntity(LibraryWarningLog libraryWarningLog) { public LibraryWarningLog addEntity(LibraryWarningLog libraryWarningLog) {
LibraryWarningLog libraryWarningLog1 = libraryWarningLogDao.save(libraryWarningLog); LibraryWarningLog libraryWarningLog1 = libraryWarningLogDao.save(libraryWarningLog);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(libraryWarningLog1)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(libraryWarningLog1));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
libraryWarningLog1.setRecordId(recordId); libraryWarningLog1.setRecordId(recordId);
return update(libraryWarningLog1); return update(libraryWarningLog1);
...@@ -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.appendText(JacksonUtil.toJSon(libraryWarningLog),libraryWarningLog.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLog),libraryWarningLog.getRecordId());
return libraryWarningLogDao.save(libraryWarningLog); return libraryWarningLogDao.save(libraryWarningLog);
} }
......
package com.tykj.dev.rfid.service.impl; package com.tykj.dev.rfid.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.rfid.entity.domin.RfidChangeBill; import com.tykj.dev.rfid.entity.domin.RfidChangeBill;
...@@ -31,7 +31,7 @@ public class RfidChangeBillServiceImpl implements RfidChangeBillService { ...@@ -31,7 +31,7 @@ public class RfidChangeBillServiceImpl implements RfidChangeBillService {
@Override @Override
public RfidChangeBill addEntity(RfidChangeBill libraryWarningLogEntity) { public RfidChangeBill addEntity(RfidChangeBill libraryWarningLogEntity) {
RfidChangeBill rfidChangeBill = rfidChangeBillDao.save(libraryWarningLogEntity); RfidChangeBill rfidChangeBill = rfidChangeBillDao.save(libraryWarningLogEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(rfidChangeBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(rfidChangeBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
rfidChangeBill.setRecordId(recordId); rfidChangeBill.setRecordId(recordId);
return updateEntity(rfidChangeBill); return updateEntity(rfidChangeBill);
...@@ -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.appendText(JacksonUtil.toJSon(libraryWarningLogEntity),libraryWarningLogEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLogEntity),libraryWarningLogEntity.getRecordId());
return rfidChangeBillDao.save(libraryWarningLogEntity); return rfidChangeBillDao.save(libraryWarningLogEntity);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.rfid.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.rfid.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.rfid.entity.domin.RfidChangeLog; import com.tykj.dev.rfid.entity.domin.RfidChangeLog;
...@@ -44,7 +44,7 @@ public class RfidChangeLogServiceImpl implements RfidChangeLogService { ...@@ -44,7 +44,7 @@ public class RfidChangeLogServiceImpl implements RfidChangeLogService {
@Override @Override
public RfidChangeLog addEntity(RfidChangeLog rfidChangeLog) { public RfidChangeLog addEntity(RfidChangeLog rfidChangeLog) {
RfidChangeLog rfidChangeLog1 = rfidChangeLogDao.save(rfidChangeLog); RfidChangeLog rfidChangeLog1 = rfidChangeLogDao.save(rfidChangeLog);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(rfidChangeLog1)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(rfidChangeLog1));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
rfidChangeLog1.setRecordId(recordId); rfidChangeLog1.setRecordId(recordId);
return updateEntity(rfidChangeLog1); return updateEntity(rfidChangeLog1);
...@@ -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.appendText(JacksonUtil.toJSon(rfidChangeLog),rfidChangeLog.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(rfidChangeLog),rfidChangeLog.getRecordId());
return rfidChangeLogDao.save(rfidChangeLog); return rfidChangeLogDao.save(rfidChangeLog);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.scrap.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.scrap.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.scrap.repository.ScrapBillDao; import com.tykj.dev.device.scrap.repository.ScrapBillDao;
import com.tykj.dev.device.scrap.service.ScrapBillService; import com.tykj.dev.device.scrap.service.ScrapBillService;
...@@ -34,7 +34,7 @@ public class ScrapBillServiceImpl implements ScrapBillService { ...@@ -34,7 +34,7 @@ public class ScrapBillServiceImpl implements ScrapBillService {
@Override @Override
public ScrapBill add(ScrapBill scrapBill) { public ScrapBill add(ScrapBill scrapBill) {
ScrapBill scrapBill1 = scrapBillDao.save(scrapBill); ScrapBill scrapBill1 = scrapBillDao.save(scrapBill);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(scrapBill1)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(scrapBill1));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
scrapBill1.setRecordId(recordId); scrapBill1.setRecordId(recordId);
return update(scrapBill1); return update(scrapBill1);
...@@ -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.appendText(JacksonUtil.toJSon(scrapBill),scrapBill.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(scrapBill),scrapBill.getRecordId());
return scrapBillDao.save(scrapBill); return scrapBillDao.save(scrapBill);
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.selfcheck.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.selfcheck.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao; import com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao;
import com.tykj.dev.device.selfcheck.service.SelfCheckBillService; import com.tykj.dev.device.selfcheck.service.SelfCheckBillService;
...@@ -40,7 +40,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService { ...@@ -40,7 +40,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
@Override @Override
public SelfCheckBill addEntity(SelfCheckBill selfExaminationBillEntity) { public SelfCheckBill addEntity(SelfCheckBill selfExaminationBillEntity) {
SelfCheckBill selfCheckBill = selfExaminationBillDao.save(selfExaminationBillEntity); SelfCheckBill selfCheckBill = selfExaminationBillDao.save(selfExaminationBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(selfCheckBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(selfCheckBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
selfCheckBill.setRecordId(recordId); selfCheckBill.setRecordId(recordId);
return update(selfCheckBill); return update(selfCheckBill);
...@@ -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.appendText(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.service.impl; package com.tykj.dev.device.storage.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.storage.repository.StorageBillDao; import com.tykj.dev.device.storage.repository.StorageBillDao;
import com.tykj.dev.device.storage.service.StorageBillService; import com.tykj.dev.device.storage.service.StorageBillService;
...@@ -29,7 +29,7 @@ public class StorageBillServiceImpl implements StorageBillService { ...@@ -29,7 +29,7 @@ public class StorageBillServiceImpl implements StorageBillService {
@Override @Override
public StorageBill addEntity(StorageBill storageBillEntity) { public StorageBill addEntity(StorageBill storageBillEntity) {
StorageBill storageBill = storageBillDao.save(storageBillEntity); StorageBill storageBill = storageBillDao.save(storageBillEntity);
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(storageBill)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(storageBill));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
storageBill.setRecordId(recordId); storageBill.setRecordId(recordId);
return update(storageBill); return update(storageBill);
...@@ -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.appendText(JacksonUtil.toJSon(storageBillEntity),storageBillEntity.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(storageBillEntity),storageBillEntity.getRecordId());
return storageBillDao.save(storageBillEntity); return storageBillDao.save(storageBillEntity);
} }
......
package com.tykj.dev.device.task.service.impl; package com.tykj.dev.device.task.service.impl;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.task.repository.TaskLogDao; import com.tykj.dev.device.task.repository.TaskLogDao;
import com.tykj.dev.device.task.service.TaskLogService; import com.tykj.dev.device.task.service.TaskLogService;
...@@ -39,10 +39,10 @@ public class TaskLogServiceImpl implements TaskLogService { ...@@ -39,10 +39,10 @@ public class TaskLogServiceImpl implements TaskLogService {
@Override @Override
public TaskLogBto addLog(TaskLogBto taskLogBto) { public TaskLogBto addLog(TaskLogBto taskLogBto) {
TaskLog taskLog = taskLogDao.save(taskLogBto.toDo()); TaskLog taskLog = taskLogDao.save(taskLogBto.toDo());
BcText bcText = blockChainUtil.sendText(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.appendText(JacksonUtil.toJSon(taskLog),taskLog.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(taskLog),taskLog.getRecordId());
return taskLogDao.save(taskLog).parse2bto(); return taskLogDao.save(taskLog).parse2bto();
} }
......
...@@ -2,7 +2,7 @@ package com.tykj.dev.device.task.service.impl; ...@@ -2,7 +2,7 @@ package com.tykj.dev.device.task.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcText; import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.GlobalMap; import com.tykj.dev.config.GlobalMap;
import com.tykj.dev.config.Log; import com.tykj.dev.config.Log;
...@@ -272,7 +272,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -272,7 +272,7 @@ public class TaskServiceImpl implements TaskService {
@Log @Log
public TaskBto start(TaskBto taskBto) { public TaskBto start(TaskBto taskBto) {
Task task = taskDao.save(taskBto.toDo()); Task task = taskDao.save(taskBto.toDo());
BcText bcText = blockChainUtil.sendText(1000, JacksonUtil.toJSon(task)); BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(task));
String recordId = bcText.getData().getRecordID(); String recordId = bcText.getData().getRecordID();
task.setRecordId(recordId); task.setRecordId(recordId);
update(task.parse2Bto()); update(task.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.appendText(JacksonUtil.toJSon(taskBto.toDo()),taskBto.getRecordId()); blockChainUtil.appendHash(JacksonUtil.toJSon(taskBto.toDo()),taskBto.getRecordId());
return taskDao.save(taskBto.toDo()); return taskDao.save(taskBto.toDo());
} }
......
...@@ -2,6 +2,8 @@ package com.tykj.dev.device.usereport.service.impl; ...@@ -2,6 +2,8 @@ package com.tykj.dev.device.usereport.service.impl;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.device.allot.repository.AllotBillDao; import com.tykj.dev.device.allot.repository.AllotBillDao;
import com.tykj.dev.device.allot.subject.domin.AllotBill; import com.tykj.dev.device.allot.subject.domin.AllotBill;
import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill; import com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill;
...@@ -29,6 +31,7 @@ import com.tykj.dev.device.usereport.subject.domin.DeviceUseReport; ...@@ -29,6 +31,7 @@ import com.tykj.dev.device.usereport.subject.domin.DeviceUseReport;
import com.tykj.dev.device.usereport.subject.vo.DeviceStatistics; import com.tykj.dev.device.usereport.subject.vo.DeviceStatistics;
import com.tykj.dev.device.usereport.subject.vo.DeviceUseReportCreateVo; import com.tykj.dev.device.usereport.subject.vo.DeviceUseReportCreateVo;
import com.tykj.dev.device.usereport.subject.vo.DeviceUseReportSelectVo; import com.tykj.dev.device.usereport.subject.vo.DeviceUseReportSelectVo;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.StringSplitUtil; import com.tykj.dev.misc.utils.StringSplitUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
...@@ -80,9 +83,16 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -80,9 +83,16 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
@Autowired @Autowired
private RepairDetailDao repairDetailDao; private RepairDetailDao repairDetailDao;
@Autowired
private BlockChainUtil blockChainUtil;
@Override @Override
public DeviceUseReport addEntity(DeviceUseReport deviceUseReportEntity) { public DeviceUseReport addEntity(DeviceUseReport deviceUseReportEntity) {
return deviceUseReportDao.save(deviceUseReportEntity); DeviceUseReport deviceUseReport = deviceUseReportDao.save(deviceUseReportEntity);
BcHash bcText = blockChainUtil.sendHash(1000, JacksonUtil.toJSon(deviceUseReport));
String recordId = bcText.getData().getRecordID();
deviceUseReport.setRecordId(recordId);
return update(deviceUseReport);
} }
@Override @Override
...@@ -98,6 +108,7 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService { ...@@ -98,6 +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());
return deviceUseReportDao.save(deviceUseReportEntity); return deviceUseReportDao.save(deviceUseReportEntity);
} }
......
...@@ -78,4 +78,6 @@ public class DeviceUseReport { ...@@ -78,4 +78,6 @@ public class DeviceUseReport {
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)") @ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0; private Integer deleteTag = 0;
@ApiModelProperty(value = "区块链记录id")
private String recordId;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论