|
@@ -1,14 +1,18 @@
|
|
|
package com.jkcredit.invoice.controller.localBussiness;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.jkcredit.invoice.annotation.LoginRequired;
|
|
|
import com.jkcredit.invoice.model.entity.customer.Customer;
|
|
|
import com.jkcredit.invoice.model.entity.CustomerRecharge;
|
|
|
import com.jkcredit.invoice.model.entity.customer.CustomerRec;
|
|
|
+import com.jkcredit.invoice.model.entity.manager.Param;
|
|
|
import com.jkcredit.invoice.service.customer.CustomerRecService;
|
|
|
import com.jkcredit.invoice.service.customer.CustomerRechargeService;
|
|
|
import com.jkcredit.invoice.service.customer.CustomerService;
|
|
|
import com.jkcredit.invoice.service.lowerService.CustomeLowerService;
|
|
|
+import com.jkcredit.invoice.service.manager.ParamService;
|
|
|
+import com.jkcredit.invoice.util.DateUtil;
|
|
|
import com.jkcredit.invoice.util.RespR;
|
|
|
import com.jkcredit.invoice.util.WordUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -19,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.*;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -39,6 +44,10 @@ public class CustomerController {
|
|
|
|
|
|
@Autowired
|
|
|
CustomerRecService customerRecService;
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ParamService paramService;
|
|
|
/**
|
|
|
* 分页查询客户
|
|
|
*
|
|
@@ -209,4 +218,65 @@ public class CustomerController {
|
|
|
return new RespR(false);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询客户备案预警信息
|
|
|
+ *
|
|
|
+ * @param page 参数集
|
|
|
+ * @return 用户集合
|
|
|
+ */
|
|
|
+ @PostMapping("/findCustomerRecTimeList")
|
|
|
+ @ApiOperation(value="客户备案预警查询", notes="客户备案预警查询")
|
|
|
+ @LoginRequired
|
|
|
+ public RespR findCustomerRecTimeList(Page page, CustomerRec customerRec) {
|
|
|
+
|
|
|
+ Param param = paramService.getParamsByParamName("CUST_EARLY_WARNING");
|
|
|
+ IPage ipage = customerRecService.findAllCustomerRec(page, customerRec);
|
|
|
+ List<CustomerRec> lists = ipage.getRecords();
|
|
|
+ if(lists.size()>0){
|
|
|
+ //遍历删除
|
|
|
+ Iterator<CustomerRec> iterator = lists.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ CustomerRec customerRec1 = iterator.next();
|
|
|
+ if (Integer.valueOf(param.getParamValue()) <= (DateUtil.daysBetween(customerRec1.getServiceEndTime(),new Date()))) {
|
|
|
+ iterator.remove();//使用迭代器的删除方法删除
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ipage.setTotal(lists.size());
|
|
|
+ return new RespR(ipage);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询余额告警用户
|
|
|
+ *
|
|
|
+ * @param page 参数集
|
|
|
+ * @return 用户集合
|
|
|
+ */
|
|
|
+ @PostMapping("/findCustomerMoney")
|
|
|
+ @ApiOperation(value="分页查询余额告警用户", notes="分页查询余额告警用户")
|
|
|
+ @LoginRequired
|
|
|
+ public RespR getCustomerMoneysByPage(Page page, Customer customer) {
|
|
|
+ Param param = paramService.getParamsByParamName("CUST_MONEY_WARNING");
|
|
|
+ IPage ipage = customerService.findAllCustomers(page, customer);
|
|
|
+ List<Customer> lists = ipage.getRecords();
|
|
|
+ if(lists.size()>0){
|
|
|
+ //遍历删除
|
|
|
+ Iterator<Customer> iterator = lists.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ Customer customer1 = iterator.next();
|
|
|
+ if (new BigDecimal(Double.valueOf(param.getParamValue())).compareTo(new BigDecimal(customer1.getAccountBalance())) < 0) {
|
|
|
+ iterator.remove();//使用迭代器的删除方法删除
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ipage.setTotal(lists.size());
|
|
|
+ return new RespR(ipage);
|
|
|
+ }
|
|
|
}
|