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

修改为hash上链

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