|
|
@@ -13,11 +13,13 @@ import com.kxs.common.core.exception.GlobalCustomerException;
|
|
|
import com.kxs.common.core.util.R;
|
|
|
import com.kxs.common.core.util.RetOps;
|
|
|
import com.kxs.common.security.util.SecurityUtils;
|
|
|
+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.GdReportPutDTO;
|
|
|
import com.kxs.product.api.model.KxsGdReport;
|
|
|
import com.kxs.product.api.res.gd.GdQueryOrderRes;
|
|
|
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.GdReportListVO;
|
|
|
import com.kxs.product.api.vo.kxsapp.machine.MachineUnBindListVO;
|
|
|
import com.kxs.product.biz.constant.enums.GdReportEnum;
|
|
|
@@ -75,6 +77,14 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
return baseMapper.getByPage(page, userId, status, keyword);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public IPage<GdReportListVO> getDqByPage(Page<GdReportListVO> page, Integer status, String keyword) {
|
|
|
+
|
|
|
+ Long userId = SecurityUtils.getUser().getId();
|
|
|
+
|
|
|
+ return baseMapper.getDqByPage(page, userId, status, keyword);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public GdDotNumVO dotNum() {
|
|
|
|
|
|
@@ -163,6 +173,47 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
|
|
|
return baseMapper.getByUnBindPage(page, userId, posSn);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean dqReport(GdDqReportDTO param) {
|
|
|
+
|
|
|
+ R<KxsUser> kxsUserR = remoteKxsUserService.loadUserById(SecurityUtils.getUser().getId(), SecurityConstants.FROM_IN);
|
|
|
+ KxsUser user = RetOps.of(kxsUserR)
|
|
|
+ .getData()
|
|
|
+ .orElseThrow(() -> new GlobalCustomerException(ErrorTypeEnum.USER_NOT_FOUND.getDescription()));
|
|
|
+
|
|
|
+ KxsGdReport kxsGdReport = new KxsGdReport();
|
|
|
+ BeanUtil.copyProperties(param, kxsGdReport);
|
|
|
+ kxsGdReport.setUserId(user.getId());
|
|
|
+ kxsGdReport.setUsername(user.getUsername());
|
|
|
+ kxsGdReport.setUserCode(user.getUserCode());
|
|
|
+ kxsGdReport.setStatus(GdReportEnum.REPORT.getType());
|
|
|
+
|
|
|
+ return this.save(kxsGdReport);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public GdDqDotNumVO dqDotNum() {
|
|
|
+
|
|
|
+ Long userId = SecurityUtils.getUser().getId();
|
|
|
+ GdDqDotNumVO gdDotNumVO = new GdDqDotNumVO();
|
|
|
+ gdDotNumVO.setAllNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId)
|
|
|
+ .eq(KxsGdReport::getPutType, GdReportEnum.DQ.getType())))
|
|
|
+ .orElse(0L));
|
|
|
+ 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())))
|
|
|
+ .orElse(0L));
|
|
|
+ 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())))
|
|
|
+ .orElse(0L));
|
|
|
+
|
|
|
+ return gdDotNumVO;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|