@@ -14,6 +14,8 @@ public interface EnterprisePurchaseLeadService extends IService<EnterprisePurcha
Page<EnterprisePurchaseLeadView> page(String status, String keyword, Integer start, Integer limit);
+ Boolean hasPending();
+
void updateStatus(EnterprisePurchaseLeadStatusReq req);
void updateRemark(EnterprisePurchaseLeadRemarkReq req);
@@ -76,6 +76,12 @@ public class EnterprisePurchaseLeadServiceImpl extends ServiceImpl<EnterprisePur
return viewPage;
}
+ @Override
+ public Boolean hasPending() {
+ return count(new LambdaQueryWrapper<EnterprisePurchaseLead>()
+ .eq(EnterprisePurchaseLead::getStatus, STATUS_PENDING)) > 0;
+ }
@Override
public void updateStatus(EnterprisePurchaseLeadStatusReq req) {
validateStatus(req.getStatus());
@@ -27,6 +27,11 @@ public class CmsEnterprisePurchaseLeadController {
return GatewayResponse.SUCCESS.newBuilder().toResult(enterprisePurchaseLeadService.page(status, keyword, start, limit));
+ @GetMapping("/pending/exists")
+ public Result<Boolean> hasPending() {
+ return GatewayResponse.SUCCESS.newBuilder().toResult(enterprisePurchaseLeadService.hasPending());
@GetMapping("/{id}")
public Result<EnterprisePurchaseLead> detail(@PathVariable Long id) {
return GatewayResponse.SUCCESS.newBuilder().toResult(enterprisePurchaseLeadService.getById(id));