|
@@ -21,13 +21,16 @@ import com.kxs.product.api.amqp.rabbit.RabbitGdActQueueMQ;
|
|
|
import com.kxs.product.api.dto.kxsapp.gd.GdDqReportDTO;
|
|
import com.kxs.product.api.dto.kxsapp.gd.GdDqReportDTO;
|
|
|
import com.kxs.product.api.dto.kxsapp.gd.GdReportDTO;
|
|
import com.kxs.product.api.dto.kxsapp.gd.GdReportDTO;
|
|
|
import com.kxs.product.api.dto.kxsapp.gd.GdReportPutDTO;
|
|
import com.kxs.product.api.dto.kxsapp.gd.GdReportPutDTO;
|
|
|
|
|
+import com.kxs.product.api.model.KxsGdOrder;
|
|
|
import com.kxs.product.api.model.KxsGdReport;
|
|
import com.kxs.product.api.model.KxsGdReport;
|
|
|
import com.kxs.product.api.vo.kxsapp.gd.GdDotNumVO;
|
|
import com.kxs.product.api.vo.kxsapp.gd.GdDotNumVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.gd.GdDqDotNumVO;
|
|
import com.kxs.product.api.vo.kxsapp.gd.GdDqDotNumVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.gd.GdReportListVO;
|
|
import com.kxs.product.api.vo.kxsapp.gd.GdReportListVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.machine.MachineUnBindListVO;
|
|
import com.kxs.product.api.vo.kxsapp.machine.MachineUnBindListVO;
|
|
|
import com.kxs.product.biz.constant.enums.GdReportEnum;
|
|
import com.kxs.product.biz.constant.enums.GdReportEnum;
|
|
|
|
|
+import com.kxs.product.biz.constant.enums.ProductErrorTypeEnum;
|
|
|
import com.kxs.product.biz.mapper.KxsGdReportMapper;
|
|
import com.kxs.product.biz.mapper.KxsGdReportMapper;
|
|
|
|
|
+import com.kxs.product.biz.service.KxsGdOrderService;
|
|
|
import com.kxs.product.biz.service.KxsGdReportService;
|
|
import com.kxs.product.biz.service.KxsGdReportService;
|
|
|
import com.kxs.product.biz.service.KxsGdService;
|
|
import com.kxs.product.biz.service.KxsGdService;
|
|
|
import com.kxs.product.biz.util.GdRsaUtils;
|
|
import com.kxs.product.biz.util.GdRsaUtils;
|
|
@@ -36,6 +39,7 @@ import com.kxs.user.api.model.KxsUser;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
@@ -58,6 +62,7 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
private final RemoteKxsUserService remoteKxsUserService;
|
|
private final RemoteKxsUserService remoteKxsUserService;
|
|
|
|
|
|
|
|
private final KxsGdService kxsGdService;
|
|
private final KxsGdService kxsGdService;
|
|
|
|
|
+ private final KxsGdOrderService kxsGdOrderService;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -124,10 +129,14 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
if (Objects.equals(kxsGdReport.getStatus(), GdReportEnum.REPORT.getType())) {
|
|
if (Objects.equals(kxsGdReport.getStatus(), GdReportEnum.REPORT.getType())) {
|
|
|
throw new GlobalCustomerException("该工单已报备,无法作废");
|
|
throw new GlobalCustomerException("该工单已报备,无法作废");
|
|
|
}
|
|
}
|
|
|
|
|
+ if(param.getUserId() != null && !Objects.equals(kxsGdReport.getUserId(), param.getUserId())){
|
|
|
|
|
+ throw new GlobalCustomerException(ProductErrorTypeEnum.DATA_EMPTY.getDescription());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- kxsGdReport.setStatus(GdReportEnum.CANCEL.getType());
|
|
|
|
|
-
|
|
|
|
|
- return this.updateById(kxsGdReport);
|
|
|
|
|
|
|
+ return this.update(Wrappers.<KxsGdReport>lambdaUpdate().eq(KxsGdReport::getId, param.getId())
|
|
|
|
|
+ .set(KxsGdReport::getStatus, GdReportEnum.CANCEL.getType())
|
|
|
|
|
+ .set(KxsGdReport::getGdMobile, null)
|
|
|
|
|
+ .set(KxsGdReport::getGdSn, null));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -140,13 +149,16 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
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("该手机号码已报备");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -154,6 +166,17 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
kxsGdReport.setGdMobile(param.getGdMobile());
|
|
kxsGdReport.setGdMobile(param.getGdMobile());
|
|
|
kxsGdReport.setGdSn(param.getGdSn());
|
|
kxsGdReport.setGdSn(param.getGdSn());
|
|
|
|
|
|
|
|
|
|
+ //判断报备的手机号码是否已经激活
|
|
|
|
|
+ KxsGdOrder order = kxsGdOrderService.getOne(Wrappers.<KxsGdOrder>lambdaQuery()
|
|
|
|
|
+ .eq(KxsGdOrder::getGdMobile, kxsGdReport.getGdMobile())
|
|
|
|
|
+ .eq(KxsGdOrder::getReceiveMobile, kxsGdReport.getPutMobile()));
|
|
|
|
|
+ //激活成功
|
|
|
|
|
+ if (order != null && order.getStatus() == 6) {
|
|
|
|
|
+ kxsGdService.toSendMq(order, kxsGdReport.getGdSn());
|
|
|
|
|
+ //修改为已匹配
|
|
|
|
|
+ kxsGdReport.setIsCheck(GdReportEnum.CHECK_SUC.getType());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return this.updateById(kxsGdReport);
|
|
return this.updateById(kxsGdReport);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -192,6 +215,7 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean dqReport(GdDqReportDTO param) {
|
|
public Boolean dqReport(GdDqReportDTO param) {
|
|
|
|
|
|
|
|
R<KxsUser> kxsUserR = remoteKxsUserService.loadUserById(SecurityUtils.getUser().getId(), SecurityConstants.FROM_IN);
|
|
R<KxsUser> kxsUserR = remoteKxsUserService.loadUserById(SecurityUtils.getUser().getId(), SecurityConstants.FROM_IN);
|
|
@@ -199,6 +223,10 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
.getData()
|
|
.getData()
|
|
|
.orElseThrow(() -> new GlobalCustomerException(ErrorTypeEnum.USER_NOT_FOUND.getDescription()));
|
|
.orElseThrow(() -> new GlobalCustomerException(ErrorTypeEnum.USER_NOT_FOUND.getDescription()));
|
|
|
|
|
|
|
|
|
|
+ KxsGdReport report = getOne(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getGdMobile, param.getGdMobile()));
|
|
|
|
|
+ if(report != null){
|
|
|
|
|
+ throw new GlobalCustomerException("该广电号码已报备");
|
|
|
|
|
+ }
|
|
|
KxsGdReport kxsGdReport = new KxsGdReport();
|
|
KxsGdReport kxsGdReport = new KxsGdReport();
|
|
|
BeanUtil.copyProperties(param, kxsGdReport);
|
|
BeanUtil.copyProperties(param, kxsGdReport);
|
|
|
kxsGdReport.setUserId(user.getId());
|
|
kxsGdReport.setUserId(user.getId());
|