|
|
@ -75,6 +75,9 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit |
|
|
|
@Value("${hzims.equipment.emInfo.emInfoList}") |
|
|
|
@Value("${hzims.equipment.emInfo.emInfoList}") |
|
|
|
public String em_info_list_path; |
|
|
|
public String em_info_list_path; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${hzims.equipment.emInfo.code-prefix}") |
|
|
|
|
|
|
|
public String emInfoCodePrefix; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R<EmInfoEntity> getEmInfoByCode(String emCode) { |
|
|
|
public R<EmInfoEntity> getEmInfoByCode(String emCode) { |
|
|
|
EmInfoNoScopeMapper mapper = SpringUtil.getBean("emInfoNoScopeMapper"); |
|
|
|
EmInfoNoScopeMapper mapper = SpringUtil.getBean("emInfoNoScopeMapper"); |
|
|
@ -108,7 +111,7 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit |
|
|
|
// 验证设备信息
|
|
|
|
// 验证设备信息
|
|
|
|
this.validEmInfo(em_info); |
|
|
|
this.validEmInfo(em_info); |
|
|
|
EmInfoEntity infoEntity = em_info.getInfo(); |
|
|
|
EmInfoEntity infoEntity = em_info.getInfo(); |
|
|
|
infoEntity.setNumber(Long.toString(IdWorker.getId())); |
|
|
|
infoEntity.setNumber(emInfoCodePrefix + IdWorker.getId()); |
|
|
|
if (this.save(infoEntity)) { |
|
|
|
if (this.save(infoEntity)) { |
|
|
|
this.getStationCodeStoreRedis(); |
|
|
|
this.getStationCodeStoreRedis(); |
|
|
|
Long infoId = em_info.getInfo().getId(); |
|
|
|
Long infoId = em_info.getInfo().getId(); |
|
|
@ -477,7 +480,7 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit |
|
|
|
// 验证设备序号
|
|
|
|
// 验证设备序号
|
|
|
|
if(Func.isNotEmpty(em_info.getInfo().getEmIndex())) { |
|
|
|
if(Func.isNotEmpty(em_info.getInfo().getEmIndex())) { |
|
|
|
List<EmInfoEntity> exist = super.list(Wrappers.<EmInfoEntity>lambdaQuery() |
|
|
|
List<EmInfoEntity> exist = super.list(Wrappers.<EmInfoEntity>lambdaQuery() |
|
|
|
.eq(EmInfoEntity::getCreateDept, AuthUtil.getDeptId()) |
|
|
|
.eq(EmInfoEntity::getDepartment, em_info.getInfo().getDepartment()) |
|
|
|
.eq(EmInfoEntity::getEmIndex, em_info.getInfo().getEmIndex()) |
|
|
|
.eq(EmInfoEntity::getEmIndex, em_info.getInfo().getEmIndex()) |
|
|
|
); |
|
|
|
); |
|
|
|
Assert.isTrue(CollectionUtil.isEmpty(exist),() -> { |
|
|
|
Assert.isTrue(CollectionUtil.isEmpty(exist),() -> { |
|
|
|