|
@@ -155,7 +155,7 @@ public class TBCrmServiceImpl extends ServiceImpl<TBCrmMapper, TBCrm> implements
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public TBCrm findByCrmNo(String crmNo) {
|
|
public TBCrm findByCrmNo(String crmNo) {
|
|
- List<TBCrm> tbCrmList = this.list(new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getCrmNo, crmNo));
|
|
|
|
|
|
+ List<TBCrm> tbCrmList = this.list(new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getCrmNo, crmNo).eq(TBCrm::getEnable,true));
|
|
if (CollectionUtils.isEmpty(tbCrmList)) {
|
|
if (CollectionUtils.isEmpty(tbCrmList)) {
|
|
throw ExceptionResultEnum.ERROR.exception("派单不存在[" + crmNo + "]");
|
|
throw ExceptionResultEnum.ERROR.exception("派单不存在[" + crmNo + "]");
|
|
}
|
|
}
|
|
@@ -193,8 +193,9 @@ public class TBCrmServiceImpl extends ServiceImpl<TBCrmMapper, TBCrm> implements
|
|
Long serviceId = tBCrm.getServiceId();
|
|
Long serviceId = tBCrm.getServiceId();
|
|
if (result && serviceId != null && serviceId > 0) {
|
|
if (result && serviceId != null && serviceId > 0) {
|
|
Long regionLeaderId = tbServiceRegionService.findRegionLeader(serviceId, tBCrm.getCrmNo());
|
|
Long regionLeaderId = tbServiceRegionService.findRegionLeader(serviceId, tBCrm.getCrmNo());
|
|
- tBCrm.setLeadId(regionLeaderId);
|
|
|
|
- this.updateById(tBCrm);
|
|
|
|
|
|
+ UpdateWrapper<TBCrm> updateWrapper = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.lambda().eq(TBCrm::getId,tBCrm.getId()).set(TBCrm::getLeadId,regionLeaderId);
|
|
|
|
+ this.update(updateWrapper);
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|