Forráskód Böngészése

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

ccjgmwz 3 éve
szülő
commit
0a40c4c539

+ 37 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CustomerInfoServiceImpl.java

@@ -1,15 +1,20 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.entity.CustomerInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseOrder;
+import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CustomerInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ICustomerInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
+import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -31,6 +36,10 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
 
     @Autowired
     private ICustomerInfoService customerInfoService;
+    @Autowired
+    private IPurchaseOrderService purchaseOrderService;
+    @Autowired
+    private ISaleOrderService saleOrderService;
 
     /**
      * 客户管理列表
@@ -72,6 +81,34 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
             //0 修改定金比例
             if(customerInfo.getFlag()==0) {
                 customerInfo1.setDepositRatio(customerInfo.getDepositRatio());
+                //查询采购订单表信息
+                Wrapper<PurchaseOrder> purchaseOrderWrapper = new EntityWrapper<>();
+                purchaseOrderWrapper.andNew().eq("customer", customerInfo1.getCustomerName()).or()
+                        .eq("customer", customerInfo1.getCompName());
+                purchaseOrderWrapper.eq("delete_flag", "0");
+                List<PurchaseOrder> purchaseOrderList = purchaseOrderService.selectList(purchaseOrderWrapper);
+                if (!CollectionUtils.isEmpty(purchaseOrderList)){
+                    for (PurchaseOrder purchaseOrder:purchaseOrderList){
+                        //更改订单表拖欠定金
+                        //拖欠定金=交易量x定金比例-已冻结定金
+                        purchaseOrder.setDefaultDeposit(purchaseOrder.getTransactionsNumber()*customerInfo.getDepositRatio()-purchaseOrder.getFreezingDeposit());
+                        purchaseOrderService.updateById(purchaseOrder);
+                    }
+                }
+                //查询销售订单表信息
+                Wrapper<SaleOrder> saleOrderWrapper = new EntityWrapper<>();
+                saleOrderWrapper.andNew().eq("customer", customerInfo1.getCustomerName()).or()
+                        .eq("customer", customerInfo1.getCompName());
+                saleOrderWrapper.eq("delete_flag", "0");
+                List<SaleOrder> saleOrderList = saleOrderService.selectList(saleOrderWrapper);
+                if (!CollectionUtils.isEmpty(saleOrderList)){
+                    for (SaleOrder saleOrder:saleOrderList){
+                        //更改订单表拖欠定金
+                        //拖欠定金=交易量x定金比例-已冻结定金
+                        saleOrder.setDefaultDeposit(saleOrder.getTransactionsNumber()*customerInfo.getDepositRatio()-saleOrder.getFreezingDeposit());
+                        saleOrderService.updateById(saleOrder);
+                    }
+                }
                 //更改客户信息
                 this.updateById(customerInfo1);
                 return "OK";

+ 6 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/IdentityAuthenticationInfoServiceImpl.java

@@ -76,6 +76,11 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
      */
     @Override
     public String modifyIdentityPhone(IdentityAuthenticationInfo identityAuthenticationInfo) {
+        IdentityAuthenticationInfo identityAuthenticationInfo2=this.selectById(identityAuthenticationInfo.getId());
+        //已覆盖的粮商解除覆盖状态
+        if("1".equals(identityAuthenticationInfo2.getCover())){
+            identityAuthenticationInfo2.setCover("0");
+        }
         IdentityAuthenticationInfo identityAuthenticationInfo1=this.selectOne(new EntityWrapper<IdentityAuthenticationInfo>()
                 .eq("customer_phone",identityAuthenticationInfo.getCustomerPhone())
                 .eq("delete_flag","0"));
@@ -85,7 +90,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
             this.updateById(identityAuthenticationInfo1);
         }
         //修改身份认证信息
-        this.updateById(identityAuthenticationInfo);
+        this.updateById(identityAuthenticationInfo2);
         return "OK";
     }