|
@@ -52,7 +52,7 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
|
|
|
|
|
|
|
|
|
|
R<Boolean> booleanR = remoteKxsUserService.checkMobileCode(param.getPutMobile(), param.getCode(), SecurityConstants.FROM_IN);
|
|
R<Boolean> booleanR = remoteKxsUserService.checkMobileCode(param.getPutMobile(), param.getCode(), SecurityConstants.FROM_IN);
|
|
|
- if(booleanR.getStatus() != CommonConstants.SUCCESS || !booleanR.getData()){
|
|
|
|
|
|
|
+ if (booleanR.getStatus() != CommonConstants.SUCCESS || !booleanR.getData()) {
|
|
|
throw new GlobalCustomerException(booleanR.getMsg());
|
|
throw new GlobalCustomerException(booleanR.getMsg());
|
|
|
}
|
|
}
|
|
|
R<KxsUser> kxsUserR = remoteKxsUserService.loadUserByCode(param.getUserCode(), SecurityConstants.FROM_IN);
|
|
R<KxsUser> kxsUserR = remoteKxsUserService.loadUserByCode(param.getUserCode(), SecurityConstants.FROM_IN);
|
|
@@ -82,13 +82,22 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public GdDotNumVO dotNum() {
|
|
|
|
|
|
|
+ public GdDotNumVO dotNum(Integer putType) {
|
|
|
|
|
|
|
|
Long userId = SecurityUtils.getUser().getId();
|
|
Long userId = SecurityUtils.getUser().getId();
|
|
|
GdDotNumVO gdDotNumVO = new GdDotNumVO();
|
|
GdDotNumVO gdDotNumVO = new GdDotNumVO();
|
|
|
- gdDotNumVO.setPendNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId).eq(KxsGdReport::getStatus, GdReportEnum.PENDING.getType()))).orElse(0L));
|
|
|
|
|
- gdDotNumVO.setReportNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId).eq(KxsGdReport::getStatus, GdReportEnum.REPORT.getType()))).orElse(0L));
|
|
|
|
|
- gdDotNumVO.setCancelNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId).eq(KxsGdReport::getStatus, GdReportEnum.CANCEL.getType()))).orElse(0L));
|
|
|
|
|
|
|
+ gdDotNumVO.setPendNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId)
|
|
|
|
|
+ .eq(KxsGdReport::getPutType, putType)
|
|
|
|
|
+ .eq(KxsGdReport::getStatus, GdReportEnum.PENDING.getType())))
|
|
|
|
|
+ .orElse(0L));
|
|
|
|
|
+ gdDotNumVO.setReportNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery()
|
|
|
|
|
+ .eq(KxsGdReport::getPutType, putType)
|
|
|
|
|
+ .eq(KxsGdReport::getUserId, userId).eq(KxsGdReport::getStatus, GdReportEnum.REPORT.getType())))
|
|
|
|
|
+ .orElse(0L));
|
|
|
|
|
+ gdDotNumVO.setCancelNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery()
|
|
|
|
|
+ .eq(KxsGdReport::getPutType, putType)
|
|
|
|
|
+ .eq(KxsGdReport::getUserId, userId).eq(KxsGdReport::getStatus, GdReportEnum.CANCEL.getType())))
|
|
|
|
|
+ .orElse(0L));
|
|
|
|
|
|
|
|
return gdDotNumVO;
|
|
return gdDotNumVO;
|
|
|
}
|
|
}
|
|
@@ -99,7 +108,7 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
Optional.ofNullable(param.getId()).orElseThrow(() -> new GlobalCustomerException("参数错误"));
|
|
Optional.ofNullable(param.getId()).orElseThrow(() -> new GlobalCustomerException("参数错误"));
|
|
|
KxsGdReport kxsGdReport = this.getById(param.getId());
|
|
KxsGdReport kxsGdReport = this.getById(param.getId());
|
|
|
Optional.ofNullable(kxsGdReport).orElseThrow(() -> new GlobalCustomerException("参数错误"));
|
|
Optional.ofNullable(kxsGdReport).orElseThrow(() -> new GlobalCustomerException("参数错误"));
|
|
|
- if(Objects.equals(kxsGdReport.getStatus(), GdReportEnum.REPORT.getType())){
|
|
|
|
|
|
|
+ if (Objects.equals(kxsGdReport.getStatus(), GdReportEnum.REPORT.getType())) {
|
|
|
throw new GlobalCustomerException("该工单已报备,无法作废");
|
|
throw new GlobalCustomerException("该工单已报备,无法作废");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -114,16 +123,16 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
KxsGdReport kxsGdReport = this.getById(param.getId());
|
|
KxsGdReport kxsGdReport = this.getById(param.getId());
|
|
|
|
|
|
|
|
Optional.ofNullable(kxsGdReport).orElseThrow(() -> new GlobalCustomerException("参数错误"));
|
|
Optional.ofNullable(kxsGdReport).orElseThrow(() -> new GlobalCustomerException("参数错误"));
|
|
|
- if(!Objects.equals(kxsGdReport.getStatus(), GdReportEnum.PENDING.getType())){
|
|
|
|
|
|
|
+ if (!Objects.equals(kxsGdReport.getStatus(), GdReportEnum.PENDING.getType())) {
|
|
|
throw new GlobalCustomerException("该工单状态错误");
|
|
throw new GlobalCustomerException("该工单状态错误");
|
|
|
}
|
|
}
|
|
|
//判断sn是否重复
|
|
//判断sn是否重复
|
|
|
KxsGdReport report = this.getOne(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getGdSn, param.getGdSn()));
|
|
KxsGdReport report = this.getOne(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getGdSn, param.getGdSn()));
|
|
|
- if(report != null){
|
|
|
|
|
|
|
+ if (report != null) {
|
|
|
throw new GlobalCustomerException("该工单sn已报备");
|
|
throw new GlobalCustomerException("该工单sn已报备");
|
|
|
}
|
|
}
|
|
|
KxsGdReport reportMobile = this.getOne(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getGdMobile, param.getGdMobile()));
|
|
KxsGdReport reportMobile = this.getOne(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getGdMobile, param.getGdMobile()));
|
|
|
- if(reportMobile != null){
|
|
|
|
|
|
|
+ if (reportMobile != null) {
|
|
|
throw new GlobalCustomerException("该工单广电手机号码已报备");
|
|
throw new GlobalCustomerException("该工单广电手机号码已报备");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -142,7 +151,7 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
KxsGdReport kxsGdReport = this.getById(param.getId());
|
|
KxsGdReport kxsGdReport = this.getById(param.getId());
|
|
|
Optional.ofNullable(kxsGdReport).orElseThrow(() -> new GlobalCustomerException("参数错误"));
|
|
Optional.ofNullable(kxsGdReport).orElseThrow(() -> new GlobalCustomerException("参数错误"));
|
|
|
|
|
|
|
|
- if(Objects.equals(kxsGdReport.getIsCheck(), GdReportEnum.CHECK_SUC.getType())){
|
|
|
|
|
|
|
+ if (Objects.equals(kxsGdReport.getIsCheck(), GdReportEnum.CHECK_SUC.getType())) {
|
|
|
throw new GlobalCustomerException("该工单已匹配,无法更新");
|
|
throw new GlobalCustomerException("该工单已匹配,无法更新");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -193,18 +202,18 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
Long userId = SecurityUtils.getUser().getId();
|
|
Long userId = SecurityUtils.getUser().getId();
|
|
|
GdDqDotNumVO gdDotNumVO = new GdDqDotNumVO();
|
|
GdDqDotNumVO gdDotNumVO = new GdDqDotNumVO();
|
|
|
gdDotNumVO.setAllNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId)
|
|
gdDotNumVO.setAllNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId)
|
|
|
- .eq(KxsGdReport::getPutType, GdReportEnum.DQ.getType())))
|
|
|
|
|
|
|
+ .eq(KxsGdReport::getPutType, GdReportEnum.DQ.getType())))
|
|
|
.orElse(0L));
|
|
.orElse(0L));
|
|
|
gdDotNumVO.setReportNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery()
|
|
gdDotNumVO.setReportNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery()
|
|
|
- .eq(KxsGdReport::getUserId, userId)
|
|
|
|
|
- .eq(KxsGdReport::getStatus, GdReportEnum.REPORT.getType())
|
|
|
|
|
- .eq(KxsGdReport::getPutType, GdReportEnum.DQ.getType())))
|
|
|
|
|
|
|
+ .eq(KxsGdReport::getUserId, userId)
|
|
|
|
|
+ .eq(KxsGdReport::getStatus, GdReportEnum.REPORT.getType())
|
|
|
|
|
+ .eq(KxsGdReport::getPutType, GdReportEnum.DQ.getType())))
|
|
|
.orElse(0L));
|
|
.orElse(0L));
|
|
|
gdDotNumVO.setEndNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery()
|
|
gdDotNumVO.setEndNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery()
|
|
|
- .eq(KxsGdReport::getUserId, userId)
|
|
|
|
|
- .eq(KxsGdReport::getPutType, GdReportEnum.DQ.getType())
|
|
|
|
|
- .eq(KxsGdReport::getIsCheck, GdReportEnum.CHECK_SUC)
|
|
|
|
|
- .eq(KxsGdReport::getStatus, GdReportEnum.CANCEL.getType())))
|
|
|
|
|
|
|
+ .eq(KxsGdReport::getUserId, userId)
|
|
|
|
|
+ .eq(KxsGdReport::getPutType, GdReportEnum.DQ.getType())
|
|
|
|
|
+ .eq(KxsGdReport::getIsCheck, GdReportEnum.CHECK_SUC)
|
|
|
|
|
+ .eq(KxsGdReport::getStatus, GdReportEnum.CANCEL.getType())))
|
|
|
.orElse(0L));
|
|
.orElse(0L));
|
|
|
|
|
|
|
|
return gdDotNumVO;
|
|
return gdDotNumVO;
|