|
|
|
|
@ -140,7 +140,7 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
|
|
|
|
|
throw new ServiceReturnCodeException(InstrumentHttpCodeEnum.TWO_HUNDRED_AND_FIVE.getInfo(), InstrumentHttpCodeEnum.TWO_HUNDRED_AND_FIVE.getCode());
|
|
|
|
|
}
|
|
|
|
|
WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(wxInstrumentSerial.getInstrumentId());
|
|
|
|
|
if(wxInstrument != null) {
|
|
|
|
|
if (wxInstrument != null) {
|
|
|
|
|
wxInstrumentSerial.setInstrumentName(wxInstrument.getName());
|
|
|
|
|
}
|
|
|
|
|
return wxInstrumentSerial;
|
|
|
|
|
@ -359,7 +359,8 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
|
|
|
|
|
|
|
|
|
|
// 3.2、更新旧的序列号状态为已解绑
|
|
|
|
|
// 当后管解除了用户和仪器的绑定,状态变为已解绑,无需再次修改序列号的绑定状态
|
|
|
|
|
if (BindingStatusEnums.UN_BOUND.getCode() == wxUserInstrument.getBindingStatus()) {
|
|
|
|
|
logger.info("用户仪器绑定状态:{},需解绑的旧序列号:{},", wxUserInstrument.getBindingStatus(), wxUserInstrument.getSerial());
|
|
|
|
|
if (BindingStatusEnums.BINDED.getCode() == wxUserInstrument.getBindingStatus()) {
|
|
|
|
|
WxInstrumentSerial oldUpdate = new WxInstrumentSerial();
|
|
|
|
|
oldUpdate.setBindingStatus(BindingStatusEnums.UN_BOUND.getCode());
|
|
|
|
|
oldUpdate.setSerial(wxUserInstrument.getSerial());
|
|
|
|
|
@ -383,9 +384,11 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
|
|
|
|
|
updateEntity.setUpdateBy(wxUserMember.getNickname());
|
|
|
|
|
updateEntity.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
wxUserInstrumentMapper.updateWxUserInstrument(updateEntity);
|
|
|
|
|
// 3.5、用户仪器关联记录表
|
|
|
|
|
|
|
|
|
|
// 3.5、用户仪器关联操作日志表
|
|
|
|
|
// 当后管解除了用户和仪器的绑定,操作记录已记录,无需再次记录
|
|
|
|
|
if (BindingStatusEnums.UN_BOUND.getCode() == wxUserInstrument.getBindingStatus()) {
|
|
|
|
|
logger.info("旧序列号日志记录:用户仪器绑定状态:{}", wxUserInstrument.getBindingStatus());
|
|
|
|
|
if (BindingStatusEnums.BINDED.getCode() == wxUserInstrument.getBindingStatus()) {
|
|
|
|
|
WxUserInstrumentLog oldUserInstrumentLog = new WxUserInstrumentLog();
|
|
|
|
|
oldUserInstrumentLog.setUserInstrumentId(wxUserInstrument.getId());
|
|
|
|
|
oldUserInstrumentLog.setUserId(wxUserMember.getId());
|
|
|
|
|
|