zhangyuewww 2 лет назад
Родитель
Сommit
37be618b10

+ 10 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CustomerInfoController.java

@@ -96,5 +96,15 @@ public class CustomerInfoController {
     public List<CustomerInfo> customerList(@RequestParam String compId) {
         return customerInfoService.customerList(compId);
     }
+    /**
+     * 查看客户账户信息
+     * @param customerInfo
+     * @return
+     */
+    @GetMapping("/getPayeeInfo")
+    public CustomerInfo getPayeeInfo(CustomerInfo customerInfo) {
+        return customerInfoService.getPayeeInfo(customerInfo);
+    }
+
 }
 

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CustomerInfo.java

@@ -139,6 +139,11 @@ public class CustomerInfo extends BaseModel<CustomerInfo> {
      */
     @TableField(exist = false)
     private Float money;
+    /**
+     * 合同号
+     */
+    @TableField(exist = false)
+    private String contractNo;
 
     @Override
     protected Serializable pkVal() {

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICustomerInfoService.java

@@ -59,4 +59,9 @@ public interface ICustomerInfoService extends IService<CustomerInfo> {
      * @return
      */
     List<CustomerInfo> customerList(String compId);
+    /**
+     * 查看客户账户信息
+     * @param customerInfo
+     */
+    CustomerInfo getPayeeInfo(CustomerInfo customerInfo);
 }

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

@@ -8,6 +8,7 @@ import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CustomerInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ICustomerInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
@@ -38,6 +39,8 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
     private IPurchaseOrderService purchaseOrderService;
     @Autowired
     private ISaleOrderService saleOrderService;
+    @Autowired
+    private IContractManagementInfoService contractManagementInfoService;
 
     /**
      * 客户管理列表
@@ -224,4 +227,30 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
         return customerInfoList;
     }
 
+    /**
+     * 查看账户信息
+     * @param customerInfo
+     * @return
+     */
+    @Override
+    public CustomerInfo getPayeeInfo(CustomerInfo customerInfo) {
+        ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                .eq("contract_no",customerInfo.getContractNo())
+                .eq("comp_id",customerInfo.getCompId()));
+        //查询客户信息
+        Wrapper<CustomerInfo> customerInfoWrapper = new EntityWrapper<>();
+        customerInfoWrapper.eq("comp_id", customerInfo.getCompId());
+        //销售合同
+        if ("1".equals(contractManagementInfo.getContractType())){
+            customerInfoWrapper.andNew().eq("comp_name", contractManagementInfo.getBuyer()).or()
+                    .eq("customer_name", contractManagementInfo.getBuyer());
+        }
+        else {
+            customerInfoWrapper.andNew().eq("comp_name", contractManagementInfo.getSeller()).or()
+                    .eq("customer_name", contractManagementInfo.getSeller());
+        }
+        CustomerInfo customerInfo1 = this.selectOne(customerInfoWrapper);
+        return customerInfo1;
+    }
+
 }