Explorar el Código

功能提交:去掉中间人一对一

杨六六 hace 4 años
padre
commit
917ba872ff

+ 0 - 3
common/fire-dto/src/main/java/com/fire/dto/CustomerInfo.java

@@ -27,9 +27,6 @@ public class CustomerInfo {
     @TableId(value = "customer_id", type = IdType.INPUT)
     private Long customerId;
 
-    @ApiModelProperty(value = "合作伙伴[中间人]ID")
-    private Long partnerId;
-
     @ApiModelProperty(value = "客户名称")
     private String customerName;
 

+ 15 - 1
modules/admin/src/main/java/com/fire/admin/rest/CustomerController.java

@@ -1,5 +1,6 @@
 package com.fire.admin.rest;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fire.admin.dto.CustomerDto;
 import com.fire.admin.service.CustomerService;
@@ -10,7 +11,10 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
+import java.net.URLDecoder;
 
 /**
  * @author: liuliu
@@ -82,10 +86,20 @@ public class CustomerController {
 
 
     @ApiOperation("获取所有的客户信息{用于各种对客户条件的查询}")
-    @GetMapping("/{customerName}")
+    @GetMapping("/customerName")
     public BaseRestResponse getCustomerInfo(@RequestParam(value = "customerName", required = false) String customerName) {
         return new BaseRestResponse<>(customerService.queryCustomerInfo(customerName));
     }
 
+ /*   @ApiOperation("获取所有的客户信息{用于各种对客户条件的查询}")
+    @GetMapping("/customerName")
+    public BaseRestResponse getCustomerInfo(HttpServletRequest request, @RequestParam(value = "customerName", required = false) String customerName) throws UnsupportedEncodingException {
+        String name=request.getParameter("customerName");
+        if(ObjectUtil.isNotEmpty(name)){
+            name= URLDecoder.decode(name,"UTF-8");
+        }
+        return new BaseRestResponse<>(customerService.queryCustomerInfo(name));
+    }*/
+
 
 }

+ 4 - 1
modules/admin/src/main/java/com/fire/admin/rest/TestController.java

@@ -19,6 +19,7 @@ import org.springframework.web.multipart.support.StandardMultipartHttpServletReq
 import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -91,7 +92,9 @@ public class TestController {
 
         String collect = list.stream().map(ipWhiteListDto -> ipWhiteListDto.getIpAddr()+";").collect(Collectors.joining());
         System.out.println("collect = " + collect);*/
-
+        BigDecimal decimal = new BigDecimal(123451200);
+        BigDecimal bigDecimal = decimal.divide(new BigDecimal(10000)).setScale(4, RoundingMode.HALF_DOWN);
+        System.out.println("bigDecimal = " + bigDecimal);
     }
 
 }

+ 5 - 4
modules/admin/src/main/java/com/fire/admin/service/impl/CustomerServiceImpl.java

@@ -29,6 +29,7 @@ import redis.clients.jedis.JedisCluster;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.time.LocalDateTime;
 import java.util.List;
 
@@ -70,12 +71,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
     @Override
     public IPage<CustomerInfoVo> getCustomerInfoPage(Page page, CustomerDto customerDto) {
         IPage<CustomerInfoVo> customerInfoVoIPage = baseMapper.queryCustomerInfoPage(page, customerDto);
-
         List<CustomerInfoVo> infoVos = customerInfoVoIPage.getRecords();
         if (!infoVos.isEmpty()) {
             infoVos.forEach(info -> {
                 // TODO  返回客户的银行卡信息
                 info.setBankCards(bankCardService.getBankCardList(info.getCustomerId(), 2));
+                if (ObjectUtil.isNotEmpty(info.getCreditAmount())) {
+                    info.setCreditAmount(new BigDecimal(info.getCreditAmount()).divide(new BigDecimal(10000)).setScale(4, RoundingMode.HALF_DOWN).toString());
+                }
             });
         }
         return customerInfoVoIPage;
@@ -95,7 +98,6 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
         // TODO   新增客户
         CustomerInfo customerInfo = CustomerInfo.builder()
                 .customerId(jedisCluster.incr(GLOBAL_ID_INCR.key()))
-                .partnerId(customerDto.getPartnerId())
                 .customerName(customerDto.getCustomerName().trim())
                 .shorterName(customerDto.getShorterName().trim())
                 .linkmanName(customerDto.getLinkmanName())
@@ -160,7 +162,6 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
     @Override
     public void updateCustomerInfo(CustomerDto customerDto) {
         CustomerInfo customerInfo = CustomerInfo.builder().customerId(customerDto.getCustomerId())
-                .partnerId(customerDto.getPartnerId())
                 .customerName(customerDto.getCustomerName())
                 .shorterName(customerDto.getShorterName())
                 .linkmanName(customerDto.getLinkmanName())
@@ -207,7 +208,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
     @Override
     public List<CustomerInfo> queryCustomerInfo(String customerName) {
         LambdaQueryWrapper<CustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.select(CustomerInfo::getCustomerId, CustomerInfo::getCustomerName,CustomerInfo::getUserId)
+        queryWrapper.select(CustomerInfo::getCustomerId, CustomerInfo::getCustomerName, CustomerInfo::getUserId)
                 .like(customerName != null, CustomerInfo::getCustomerName, customerName);
 
         return baseMapper.selectList(queryWrapper);

+ 11 - 5
modules/admin/src/main/java/com/fire/admin/service/impl/OperatorMaintenanceServiceImpl.java

@@ -51,10 +51,16 @@ public class OperatorMaintenanceServiceImpl extends ServiceImpl<OperatorMaintena
     public int operatorMaintenanceServiceSaveOrUpdate(OperatorMaintenance operatorMaintenance) {
         if (ObjectUtil.isNotEmpty(operatorMaintenance)) {
             // TODO 设置维护类型为手动
-            operatorMaintenance.setFacePrice(Long.parseLong(new BigDecimal(operatorMaintenance.getFacePrice()).multiply(new BigDecimal(10000)).toString()));
+            if(!operatorMaintenance.getFacePrice().equals(0L)){
+                operatorMaintenance.setFacePrice(Long.parseLong(new BigDecimal(operatorMaintenance.getFacePrice()).multiply(new BigDecimal(10000)).toString()));
+            }
+        /*    if(operatorMaintenance.getFacePrice().toString().equals("所有面额")){
+                operatorMaintenance.setFacePrice(0L);
+            }*/
             operatorMaintenance.setOrderType(1);
             operatorMaintenance.setCreateUser(SecurityUtil.getUser().getUsername());
             operatorMaintenance.setModifyUser(SecurityUtil.getUser().getUsername());
+
             operatorMaintenance.setProvince(EnumUtils.convert(operatorMaintenance.getProvince()));
 
             log.info("添加的维护信息为:【{}】", operatorMaintenance.toString());
@@ -100,9 +106,9 @@ public class OperatorMaintenanceServiceImpl extends ServiceImpl<OperatorMaintena
                 if (ObjectUtil.isNotEmpty(operator.getFacePrice()) && !operator.getFacePrice().equals("0")) {
                     operator.setFacePrice(new BigDecimal(operator.getFacePrice()).divide(new BigDecimal(10000)).toString());
                 }
-                if(operator.getFacePrice().equals("0")){
+            /*    if(operator.getFacePrice().equals("0")){
                     operator.setFacePrice("所有面额");
-                }
+                }*/
             });
         }
         return operatorMaintenanceIPage;
@@ -120,9 +126,9 @@ public class OperatorMaintenanceServiceImpl extends ServiceImpl<OperatorMaintena
     public void removeOperatorMaintenance(OperatorMaintenanceDto operatorMaintenanceDto) {
         if (ObjectUtil.isNotEmpty(operatorMaintenanceDto.getOperator()) && ObjectUtil.isNotEmpty(operatorMaintenanceDto.getFacePrice()) && ObjectUtil.isNotEmpty(operatorMaintenanceDto.getProvince())) {
             operatorMaintenanceDto.setProvince(EnumUtils.convert(operatorMaintenanceDto.getProvince()));
-            if(operatorMaintenanceDto.getFacePrice().equals("所有面额")){
+         /*   if(operatorMaintenanceDto.getFacePrice().equals("所有面额")){
                 operatorMaintenanceDto.setFacePrice("0");
-            }
+            }*/
             operatorMaintenanceDto.setFacePrice(new BigDecimal(operatorMaintenanceDto.getFacePrice()).multiply(new BigDecimal(10000)).toString());
             int count = baseMapper.deleteOperatorMaintenance(operatorMaintenanceDto);
             if (count > 0) {

+ 1 - 7
modules/admin/src/main/java/com/fire/admin/vo/CustomerInfoVo.java

@@ -26,12 +26,6 @@ public class CustomerInfoVo {
     private Long customerId;
 
 
-    @ApiModelProperty(value = "合作伙伴[中间人]ID")
-    private Long partnerId;
-
-    @ApiModelProperty(value = "合作伙伴姓名(中间人姓名)")
-    private String partnerName;
-
     @ApiModelProperty(value = "客户名称")
     private String customerName;
 
@@ -57,7 +51,7 @@ public class CustomerInfoVo {
     private BigDecimal balance;
 
     @ApiModelProperty(value = "授信额度")
-    private BigDecimal creditAmount;
+    private String creditAmount;
 
     @ApiModelProperty(value = "当前费用")
     private BigDecimal currentAmount;

+ 1 - 6
modules/admin/src/main/resources/mapper/CustomerMapper.xml

@@ -5,7 +5,6 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.fire.dto.CustomerInfo">
         <id column="customer_id" property="customerId"/>
-        <result column="partner_id" property="partnerId"/>
         <result column="customer_name" property="customerName"/>
         <result column="shorter_name" property="shorterName"/>
         <result column="linkman_name" property="linkmanName"/>
@@ -30,8 +29,6 @@
 
     <resultMap id="ResultMapPage" type="com.fire.admin.vo.CustomerInfoVo">
         <result column="customer_id" property="customerId"/>
-        <result column="partner_id" property="partnerId"/>
-        <result column="partner_name" property="partnerName"/>
         <result column="customer_name" property="customerName"/>
         <result column="shorter_name" property="shorterName"/>
         <result column="linkman_name" property="linkmanName"/>
@@ -68,8 +65,6 @@
 
     <sql id="selectCustomerInfoPage">
         c.customer_id ,
-        c.partner_id,
-        u.username as partner_name,
         c.customer_name,
         c.shorter_name,
         c.linkman_name,
@@ -106,7 +101,7 @@
         FROM
         customer_info AS c
         LEFT JOIN flow_app_info AS app ON c.customer_id = app.customer_id
-        LEFT JOIN sys_user AS u ON c.partner_id = u.user_id
+      /*  LEFT JOIN sys_user AS u ON c.partner_id = u.user_id*/
         <where>
             <if test="query.customerName !=null and query.customerName!='' ">
                 and c.customer_name LIKE CONCAT('%',#{query.customerName},'%')