Pārlūkot izejas kodu

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

jinsy 7 gadi atpakaļ
vecāks
revīzija
ae75c4dcdd
95 mainītis faili ar 1621 papildinājumiem un 1044 dzēšanām
  1. 20 1
      applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/ProductApi.java
  2. 96 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProdStorageDTO.java
  3. 47 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductSalerDTO.java
  4. 71 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductSalerUploadDTO.java
  5. 94 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductUploadDTO.java
  6. 3 143
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bankinformation.java
  7. 10 0
      applications/document/document-server/pom.xml
  8. 50 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  9. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  10. 27 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductSalerMapper.java
  11. 32 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  12. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  13. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  14. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  15. 81 8
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  16. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  17. 7 1
      applications/document/document-server/src/main/resources/application.yml
  18. 4 2
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  19. 2 2
      applications/document/document-server/src/main/resources/mapper/CurrencyMapper.xml
  20. 42 0
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  21. 10 0
      applications/document/document-server/src/main/resources/mapper/ProductSalerMapper.xml
  22. 21 13
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  23. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  24. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  25. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  26. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  27. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  28. 2 2
      applications/operation/operation-server/src/main/resources/mapper/AccoutMapper.xml
  29. 2 2
      applications/operation/operation-server/src/main/resources/mapper/CompanyMapper.xml
  30. 6 5
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  31. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java
  32. 2 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java
  33. 1 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  34. 49 11
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  35. 1 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml
  36. 1 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  37. 1 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  38. 1 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  39. 1 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java
  40. 5 2
      applications/transfers/mall-api/src/main/java/com/usoftchina/inquiry/api/InquiryApi.java
  41. 6 1
      applications/transfers/mall-api/src/main/java/com/usoftchina/inquiry/api/PublicProductApi.java
  42. 14 6
      applications/transfers/mall-api/src/test/java/com/usoftchina/inquiry/test/InquiryApiTest.java
  43. 4 4
      applications/transfers/mall-api/src/test/java/com/usoftchina/inquiry/test/PublicProductApiTest.java
  44. 0 15
      applications/transfers/transfers-api/src/main/java/com/usoftchina/saas/transfers/api/SendApi.java
  45. 23 0
      applications/transfers/transfers-api/src/main/java/com/usoftchina/saas/transfers/api/SendMessageApi.java
  46. 1 1
      applications/transfers/transfers-api/src/main/java/com/usoftchina/saas/transfers/api/SendMessageApiFallBack.java
  47. 4 0
      applications/transfers/transfers-auth/pom.xml
  48. 10 0
      applications/transfers/transfers-auth/src/main/java/com/usoftchina/saas/transfers/auth/configuration/OpenApiConfig.java
  49. 29 12
      applications/transfers/transfers-auth/src/main/java/com/usoftchina/saas/transfers/auth/interceptor/OpenApiAuthInterceptor.java
  50. 101 101
      applications/transfers/transfers-dto/src/main/java/com/usoftchina/saas/transfers/dto/MessageInfo.java
  51. 13 0
      applications/transfers/transfers-server/pom.xml
  52. 4 1
      applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/service/ReceiveService.java
  53. 3 1
      applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/Executable.java
  54. 115 0
      applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendProductTask.java
  55. 3 1
      applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendPurchaseInTask.java
  56. 3 1
      applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendPurchaseOutTask.java
  57. 3 1
      applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendPurchaseTask.java
  58. 12 1
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyDTO.java
  59. 9 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/Company.java
  60. 3 2
      base-servers/account/account-server/src/main/resources/mapper/CompanyMapper.xml
  61. 0 1
      framework/core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixContextScheduler.java
  62. 1 1
      framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java
  63. 18 6
      frontend/saas-web/app/model/money/FundTransfer.js
  64. 6 1
      frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.js
  65. 13 0
      frontend/saas-web/app/view/core/dbfind/types/BankInfoDbfindTrigger.js
  66. 1 1
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  67. 15 1
      frontend/saas-web/app/view/core/form/FormPanel.js
  68. 28 13
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  69. 4 0
      frontend/saas-web/app/view/money/fundtransfer/FormPanelController.js
  70. 1 1
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  71. 7 1
      frontend/saas-web/app/view/money/othreceipts/FormPanelController.js
  72. 1 1
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  73. 6 0
      frontend/saas-web/app/view/money/othspendings/FormPanelController.js
  74. 13 14
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  75. 52 65
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  76. 29 25
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  77. 47 78
      frontend/saas-web/app/view/money/recBalance/FormPanelController.js
  78. 95 74
      frontend/saas-web/app/view/money/verification/FormPanel.js
  79. 34 257
      frontend/saas-web/app/view/money/verification/FormPanelController.js
  80. 23 34
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  81. 4 0
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  82. 13 0
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  83. 8 19
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  84. 4 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  85. 13 0
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  86. 8 19
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  87. 4 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  88. 13 0
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  89. 17 28
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  90. 2 2
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  91. 13 0
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  92. 17 28
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  93. 13 0
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  94. 17 16
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  95. 13 0
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

+ 20 - 1
applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/ProductApi.java

@@ -1,10 +1,13 @@
 package com.usoftchina.saas.document.api;
 
 import com.usoftchina.saas.auth.client.interceptor.ServiceFeignInterceptor;
+import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.document.dto.ProductDTO;
+import com.usoftchina.saas.document.dto.ProductUploadDTO;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
@@ -31,5 +34,21 @@ public interface ProductApi {
     * @Date: 2018/10/16
     */
     @RequestMapping("/product/updateLatestPurchasePrice")
-    public void updateLatestPurchasePrice(@RequestParam(value = "id") Long pu_id);
+    void updateLatestPurchasePrice(@RequestParam(value = "id") Long pu_id);
+
+    /**
+     * 获取需要上传的物料数据
+     * @return
+     */
+    @GetMapping("/b2b/upload/data")
+    Result<List<ProductUploadDTO>> getUploadData();
+
+    /**
+     * 批量更新物料上传状态
+     * @param ids
+     * @param status
+     * @return
+     */
+    @PostMapping("/b2b/status/update")
+    Result updateStatus(@RequestParam("ids") String ids, @RequestParam("status") String status);
 }

+ 96 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProdStorageDTO.java

@@ -0,0 +1,96 @@
+package com.usoftchina.saas.document.dto;
+
+import java.io.Serializable;
+
+/**
+ * @Description 产品库列表
+ * @Author chenwei
+ * @Date 2019/01/10
+ */
+public class ProdStorageDTO implements Serializable {
+
+    private Long prodId;
+    private String prodName;
+    private String prodCode;
+    private String prodOrispeccode;
+    private String prodSpec;
+    private String prodBrand;
+    private String prodUnit;
+    private String prodLeadtime;
+    /**
+     * 绑定状态
+     */
+    private Short status;
+
+    public Long getProdId() {
+        return prodId;
+    }
+
+    public void setProdId(Long prodId) {
+        this.prodId = prodId;
+    }
+
+    public String getProdName() {
+        return prodName;
+    }
+
+    public void setProdName(String prodName) {
+        this.prodName = prodName;
+    }
+
+    public String getProdCode() {
+        return prodCode;
+    }
+
+    public void setProdCode(String prodCode) {
+        this.prodCode = prodCode;
+    }
+
+    public String getProdOrispeccode() {
+        return prodOrispeccode;
+    }
+
+    public void setProdOrispeccode(String prodOrispeccode) {
+        this.prodOrispeccode = prodOrispeccode;
+    }
+
+    public String getProdSpec() {
+        return prodSpec;
+    }
+
+    public void setProdSpec(String prodSpec) {
+        this.prodSpec = prodSpec;
+    }
+
+    public String getProdBrand() {
+        return prodBrand;
+    }
+
+    public void setProdBrand(String prodBrand) {
+        this.prodBrand = prodBrand;
+    }
+
+    public String getProdUnit() {
+        return prodUnit;
+    }
+
+    public void setProdUnit(String prodUnit) {
+        this.prodUnit = prodUnit;
+    }
+
+    public String getProdLeadtime() {
+        return prodLeadtime;
+    }
+
+    public void setProdLeadtime(String prodLeadtime) {
+        this.prodLeadtime = prodLeadtime;
+    }
+
+    public Short getStatus() {
+        return status;
+    }
+
+    public void setStatus(Short status) {
+        this.status = status;
+    }
+}

+ 47 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductSalerDTO.java

@@ -0,0 +1,47 @@
+package com.usoftchina.saas.document.dto;
+
+import java.io.Serializable;
+
+/**
+ * @Description 个人物料库
+ * @Author chenwei
+ * @Date 2019/01/10
+ */
+public class ProductSalerDTO implements Serializable {
+    /**
+     * 物料ID
+     */
+    private Long prodId;
+    /**
+     * 物料编号
+     */
+    private String prodCode;
+    /**
+     * 操作类型, 0:解绑 1:绑定
+     */
+    private Short operate;
+
+    public Long getProdId() {
+        return prodId;
+    }
+
+    public void setProdId(Long prodId) {
+        this.prodId = prodId;
+    }
+
+    public String getProdCode() {
+        return prodCode;
+    }
+
+    public void setProdCode(String prodCode) {
+        this.prodCode = prodCode;
+    }
+
+    public Short getOperate() {
+        return operate;
+    }
+
+    public void setOperate(Short operate) {
+        this.operate = operate;
+    }
+}

+ 71 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductSalerUploadDTO.java

@@ -0,0 +1,71 @@
+package com.usoftchina.saas.document.dto;
+
+import java.io.Serializable;
+
+/**
+ * @Description 个人物料库上传B2B传输对象
+ * @Author chenwei
+ * @Date 2019/01/10
+ */
+public class ProductSalerUploadDTO implements Serializable {
+    /**
+     * 主键id
+     */
+    private Long ps_id;
+
+    /**
+     * 物料code
+     */
+    private String ps_code;
+
+    /**
+     * 个人uu号
+     */
+    private Long em_uu;
+    /**
+     * 企业uu号
+     */
+    private Long en_uu;
+
+    public Long getPs_id() {
+        return ps_id;
+    }
+
+    public void setPs_id(Long ps_id) {
+        this.ps_id = ps_id;
+    }
+
+    public String getPs_code() {
+        return ps_code;
+    }
+
+    public void setPs_code(String ps_code) {
+        this.ps_code = ps_code;
+    }
+
+    public Long getEm_uu() {
+        return em_uu;
+    }
+
+    public void setEm_uu(Long em_uu) {
+        this.em_uu = em_uu;
+    }
+
+    public Long getEn_uu() {
+        return en_uu;
+    }
+
+    public void setEn_uu(Long en_uu) {
+        this.en_uu = en_uu;
+    }
+
+    public ProductSalerUploadDTO(Long ps_id, String ps_code, Long em_uu, Long en_uu) {
+        this.ps_id = ps_id;
+        this.ps_code = ps_code;
+        this.em_uu = em_uu;
+        this.en_uu = en_uu;
+    }
+
+    public ProductSalerUploadDTO() {
+    }
+}

+ 94 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductUploadDTO.java

@@ -0,0 +1,94 @@
+package com.usoftchina.saas.document.dto;
+
+import java.io.Serializable;
+
+/**
+ * @Description 上传B2B 物料对象
+ * @Author chenwei
+ * @Date 2019/01/10
+ */
+public class ProductUploadDTO implements Serializable {
+
+    private String pr_code;
+    private String pr_detail;
+    private Double pr_leadtime;
+    private String pr_spec;
+    private String pr_unit;
+    private Double pr_zxbzs;
+    private Long pr_id;
+    private Double pr_zxdhl;
+    private String pr_orispeccode;
+
+    public String getPr_code() {
+        return pr_code;
+    }
+
+    public void setPr_code(String pr_code) {
+        this.pr_code = pr_code;
+    }
+
+    public String getPr_detail() {
+        return pr_detail;
+    }
+
+    public void setPr_detail(String pr_detail) {
+        this.pr_detail = pr_detail;
+    }
+
+    public Double getPr_leadtime() {
+        return pr_leadtime;
+    }
+
+    public void setPr_leadtime(Double pr_leadtime) {
+        this.pr_leadtime = pr_leadtime;
+    }
+
+    public String getPr_spec() {
+        return pr_spec;
+    }
+
+    public void setPr_spec(String pr_spec) {
+        this.pr_spec = pr_spec;
+    }
+
+    public String getPr_unit() {
+        return pr_unit;
+    }
+
+    public void setPr_unit(String pr_unit) {
+        this.pr_unit = pr_unit;
+    }
+
+    public Double getPr_zxbzs() {
+        return pr_zxbzs;
+    }
+
+    public void setPr_zxbzs(Double pr_zxbzs) {
+        this.pr_zxbzs = pr_zxbzs;
+    }
+
+    public Long getPr_id() {
+        return pr_id;
+    }
+
+    public void setPr_id(Long pr_id) {
+        this.pr_id = pr_id;
+    }
+
+    public Double getPr_zxdhl() {
+        return pr_zxdhl;
+    }
+
+    public void setPr_zxdhl(Double pr_zxdhl) {
+        this.pr_zxdhl = pr_zxdhl;
+    }
+
+    public String getPr_orispeccode() {
+        return pr_orispeccode;
+    }
+
+    public void setPr_orispeccode(String pr_orispeccode) {
+        this.pr_orispeccode = pr_orispeccode;
+    }
+
+}

+ 3 - 143
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bankinformation.java

@@ -1,10 +1,12 @@
 package com.usoftchina.saas.document.entities;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
 
+@Data
 public class Bankinformation extends CommonBaseEntity implements Serializable {
 
     private String bk_bankcode;
@@ -43,148 +45,6 @@ public class Bankinformation extends CommonBaseEntity implements Serializable {
 
     private String bk_currency;
 
-    public String getBk_currency() {
-        return bk_currency;
-    }
+    private Double cr_rate;
 
-    public void setBk_currency(String bk_currency) {
-        this.bk_currency = bk_currency;
-    }
-
-    public Double getBk_income() {
-        return bk_income;
-    }
-
-    public void setBk_income(Double bk_income) {
-        this.bk_income = bk_income;
-    }
-
-    public Double getBk_spending() {
-        return bk_spending;
-    }
-
-    public void setBk_spending(Double bk_spending) {
-        this.bk_spending = bk_spending;
-    }
-
-    public String getBk_bankcode() {
-        return bk_bankcode;
-    }
-
-    public void setBk_bankcode(String bk_bankcode) {
-        this.bk_bankcode = bk_bankcode;
-    }
-
-    public String getBk_bankname() {
-        return bk_bankname;
-    }
-
-    public void setBk_bankname(String bk_bankname) {
-        this.bk_bankname = bk_bankname;
-    }
-
-    public Date getBk_date() {
-        return bk_date;
-    }
-
-    public void setBk_date(Date bk_date) {
-        this.bk_date = bk_date;
-    }
-
-    public String getBk_type() {
-        return bk_type;
-    }
-
-    public void setBk_type(String bk_type) {
-        this.bk_type = bk_type;
-    }
-
-    public Double getBk_beginamount() {
-        return bk_beginamount;
-    }
-
-    public void setBk_beginamount(Double bk_beginamount) {
-        this.bk_beginamount = bk_beginamount;
-    }
-
-    public Double getBk_thisamount() {
-        return bk_thisamount;
-    }
-
-    public void setBk_thisamount(Double bk_thisamount) {
-        this.bk_thisamount = bk_thisamount;
-    }
-
-    public String getBk_status() {
-        return bk_status;
-    }
-
-    public void setBk_status(String bk_status) {
-        this.bk_status = bk_status;
-    }
-
-    public String getBk_statuscode() {
-        return bk_statuscode;
-    }
-
-    public void setBk_statuscode(String bk_statuscode) {
-        this.bk_statuscode = bk_statuscode;
-    }
-
-
-    public Integer getBk_ym() {
-        return bk_ym;
-    }
-
-    public void setBk_ym(Integer bk_ym) {
-        this.bk_ym = bk_ym;
-    }
-
-    public String getBk_text1() {
-        return bk_text1;
-    }
-
-    public void setBk_text1(String bk_text1) {
-        this.bk_text1 = bk_text1;
-    }
-
-    public String getBk_text2() {
-        return bk_text2;
-    }
-
-    public void setBk_text2(String bk_text2) {
-        this.bk_text2 = bk_text2;
-    }
-
-    public String getBk_text3() {
-        return bk_text3;
-    }
-
-    public void setBk_text3(String bk_text3) {
-        this.bk_text3 = bk_text3;
-    }
-
-    public String getBk_text4() {
-        return bk_text4;
-    }
-
-    public void setBk_text4(String bk_text4) {
-        this.bk_text4 = bk_text4;
-    }
-
-    public String getBk_text5() {
-        return bk_text5;
-    }
-
-    public void setBk_text5(String bk_text5) {
-        this.bk_text5 = bk_text5;
-    }
-
-    public String getBk_remark() {
-        return bk_remark;
-    }
-
-    public void setBk_remark(String bk_remark) {
-        this.bk_remark = bk_remark;
-    }
 }

+ 10 - 0
applications/document/document-server/pom.xml

@@ -83,10 +83,20 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>account-dto</artifactId>
         </dependency>
+        <dependency>
+          <groupId>com.usoftchina.saas</groupId>
+          <artifactId>transfers-api</artifactId>
+          <version>1.0.0-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>datacenter-client</artifactId>
         </dependency>
+        <dependency>
+          <groupId>com.usoftchina.saas</groupId>
+          <artifactId>mall-api</artifactId>
+          <version>1.0.0-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 50 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java

@@ -10,8 +10,11 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.dto.ProductListDTO;
+import com.usoftchina.saas.document.dto.ProductSalerDTO;
+import com.usoftchina.saas.document.dto.ProductUploadDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.service.ProductService;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -122,4 +125,51 @@ public class ProductController {
         return Result.success();
     }
 
+    /**
+     * 上传至B2B平台
+     * @return
+     */
+    @PostMapping("/b2b/upload")
+    public Result uploadToB2B(){
+        productService.uploadToB2B();
+        return Result.success();
+    }
+
+    /**
+     * 获取需要上传的物料数据
+     * @return
+     */
+    @GetMapping("/b2b/upload/data")
+    public Result<List<ProductUploadDTO>> getUploadData(){
+        return Result.success(productService.getUploadData());
+    }
+
+    /**
+     * 批量更新物料上传状态
+     * @param ids
+     * @param status
+     * @return
+     */
+    @PostMapping("/b2b/status/update")
+    public Result updateStatus(@RequestParam("ids") String ids, @RequestParam("status") String status){
+        productService.updateB2BStatus(ids, status);
+        return Result.success();
+    }
+
+    /**
+     * 产品库列表
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    @GetMapping("/prodStorage/list")
+    public Result getProdStorage(@PageDefault(number = 1, size = 10) PageRequest page, ListReqDTO listReqDTO){
+        return Result.success(productService.getProdStorage(page, listReqDTO));
+    }
+
+    @PostMapping("/prodStorage/saler")
+    public Result createProdSaler(@RequestBody ProductSalerDTO productSalerDTO){
+        productService.createProdSaler(productSalerDTO);
+        return Result.success();
+    }
 }

+ 8 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java

@@ -2,8 +2,10 @@ package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.commons.dto.ComboDTO;
+import com.usoftchina.saas.document.dto.ProdStorageDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
+import com.usoftchina.saas.document.dto.ProductUploadDTO;
 import com.usoftchina.saas.document.entities.ProdIODetail;
 import com.usoftchina.saas.document.entities.ProdInOut;
 import com.usoftchina.saas.document.entities.Product;
@@ -62,4 +64,10 @@ public interface ProductMapper extends CommonBaseMapper<Product> {
     int selectSale(Long id);
 
     int selectPurchase(Long id);
+
+    List<ProductUploadDTO> selectUploadProdByCompanyId(@Param("companyId") Long companyId);
+
+    void updateB2BStatus(List<String> idsList, @Param("status") String status);
+
+    List<ProdStorageDTO> getProdStorage(@Param("condition") String condition, @Param("companyId") Long companyId, @Param("userId") Long userId);
 }

+ 27 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductSalerMapper.java

@@ -0,0 +1,27 @@
+package com.usoftchina.saas.document.mapper;
+
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @Description 个人物料库
+ * @Author chenwei
+ * @Date 2019/01/11
+ */
+public interface ProductSalerMapper {
+    /**
+     * 绑定
+     * @param prodId
+     * @param userId
+     * @param companyId
+     */
+    void bind(@Param("prodId") Long prodId, @Param("userId") Long userId, @Param("companyId") Long companyId);
+
+    /**
+     * 解绑
+     * @param prodId
+     * @param userId
+     * @param companyId
+     */
+    void unbind(@Param("prodId") Long prodId, @Param("userId") Long userId, @Param("companyId") Long companyId);
+
+}

+ 32 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java

@@ -8,9 +8,7 @@ import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
-import com.usoftchina.saas.document.dto.ProductDTO;
-import com.usoftchina.saas.document.dto.ProductListDTO;
-import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
+import com.usoftchina.saas.document.dto.*;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
 
@@ -120,4 +118,35 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
     boolean deleteDetailById(Long id);
 
     void saveToFormal(Integer id, boolean update);
+
+    /**
+     * 上传至B2B
+     */
+    void uploadToB2B();
+
+    /**
+     * 获取需要上传的数据
+     */
+    List<ProductUploadDTO> getUploadData();
+
+    /**
+     * 批量更新物料上传状态
+     * @param ids
+     * @param status
+     */
+    void updateB2BStatus(String ids, String status);
+
+    /**
+     * 产品库列表
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    PageInfo<ProdStorageDTO> getProdStorage(PageRequest page, ListReqDTO listReqDTO);
+
+    /**
+     * 绑定/解绑 个人物料库
+     * @param productSalerDTO
+     */
+    void createProdSaler(ProductSalerDTO productSalerDTO);
 }

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java

@@ -256,7 +256,7 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
            //  maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.BANKINFORMATION.getCaller()).getData();
         }

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java

@@ -326,7 +326,7 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.BOM.getCaller()).getData();
         }

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -652,7 +652,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             if (res.isSuccess()) {
                 cu_code = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //cu_code =  maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.CUSTOMER.getCaller()).getData();
         }

+ 81 - 8
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.account.api.AccountApi;
+import com.usoftchina.saas.account.api.CompanyApi;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
@@ -18,14 +20,9 @@ import com.usoftchina.saas.commons.po.DataImportDetail;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.dto.ProductDTO;
-import com.usoftchina.saas.document.dto.ProductListDTO;
-import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
+import com.usoftchina.saas.document.dto.*;
 import com.usoftchina.saas.document.entities.*;
-import com.usoftchina.saas.document.mapper.DataImportMapper;
-import com.usoftchina.saas.document.mapper.ProductDetailMapper;
-import com.usoftchina.saas.document.mapper.ProductMapper;
-import com.usoftchina.saas.document.mapper.WarehouseMapper;
+import com.usoftchina.saas.document.mapper.*;
 import com.usoftchina.saas.document.service.*;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
@@ -60,6 +57,16 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     private ProductunitService productunitService;
     @Autowired
     private ProducttypeService producttypeService;
+    /*@Autowired
+    private SendMessageApi sendMessageApi;*/
+    /*@Autowired
+    private PublicProductApi publicProductApi;*/
+    @Autowired
+    private CompanyApi companyApi;
+    @Autowired
+    private AccountApi accountApi;
+    @Autowired
+    private ProductSalerMapper productSalerMapper;
 
     @Override
     public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO) {
@@ -737,6 +744,72 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         }
     }
 
+    /**
+     * 生成物料上传的消息
+     */
+    @Override
+    public void uploadToB2B() {
+        /*MessageInfo messageInfo = new MessageInfo(BaseContextHolder.getUserId(), BillCodeSeq.PRODUCT.name(), "", BaseContextHolder.getCompanyId());
+        sendMessageApi.sendMsg(messageInfo);*/
+    }
+
+    /**
+     * 获取需要上传的数据, 上传状态为待上传
+     * @return
+     */
+    @Override
+    public List<ProductUploadDTO> getUploadData(){
+        return getMapper().selectUploadProdByCompanyId(BaseContextHolder.getCompanyId());
+    }
+
+    /**
+     * 更新物料传输状态
+     * @param ids       物料ids
+     * @param status    状态: 待上传 已上传
+     */
+    @Override
+    public void updateB2BStatus(String ids, String status){
+        List<String> idsList = new ArrayList<String>(Arrays.asList(ids.split(",")));
+        getMapper().updateB2BStatus(idsList, status);
+    }
+
+    /**
+     * 产品库列表
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    @Override
+    public PageInfo<ProdStorageDTO> getProdStorage(PageRequest page, ListReqDTO listReqDTO){
+        Long companyId = BaseContextHolder.getCompanyId();
+        Long userId = BaseContextHolder.getUserId();
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        String condition = listReqDTO.getFinalCondition();
+        List<ProdStorageDTO> prodStorageDTOList = getMapper().getProdStorage(condition, companyId, userId);
+        PageInfo<ProdStorageDTO> pageInfo = new PageInfo<ProdStorageDTO>(prodStorageDTOList);
+        return pageInfo;
+    }
+
+    /**
+     * 绑定/解绑 个人物料库
+     * @param productSalerDTO
+     */
+    @Override
+    public void createProdSaler(ProductSalerDTO productSalerDTO){
+        /*Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
+        Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
+        ProductSalerUploadDTO productSalerUploadDTO = new ProductSalerUploadDTO(productSalerDTO.getProdId(), productSalerDTO.getProdCode(), enUU, userUU);
+        if (productSalerDTO.getOperate() == 0){
+            //解绑
+            publicProductApi.uploadProductSalerForCancel(JsonUtils.toJsonString(productSalerDTO));
+            productSalerMapper.unbind(productSalerDTO.getProdId(), BaseContextHolder.getUserId(), BaseContextHolder.getCompanyId());
+        }else if (productSalerDTO.getOperate() == 1){
+            //绑定
+            publicProductApi.updateProdSaler(JsonUtils.toJsonString(productSalerDTO));
+            productSalerMapper.bind(productSalerDTO.getProdId(), BaseContextHolder.getUserId(), BaseContextHolder.getCompanyId());
+        }*/
+    }
+
     private List<ProductReserveCostDTO> geReserveCost(ListReqDTO listReqDTO) {
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();
@@ -790,7 +863,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //billCode = maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.PRODUCT.getCaller()).getData();
         }

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java

@@ -305,7 +305,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             // maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.WAREHOUSE.getCaller()).getData();
         }

+ 7 - 1
applications/document/document-server/src/main/resources/application.yml

@@ -90,4 +90,10 @@ hystrix:
                 enabled: true
               isolation:
                     thread:
-                        timeoutInMilliseconds: 4000
+                        timeoutInMilliseconds: 4000
+b2b:
+  baseUrl:
+    inquiry: https://test-inquiry.uuzcc.cn
+    Component: https://test-mall.uuzcc.cn
+    product: http://test-product.uuzcc.cn
+    uu: https://test-b2b.uuzcc.cn

+ 4 - 2
applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -24,14 +24,15 @@
     <result column="bk_spending" property="bk_spending" jdbcType="DOUBLE" />
     <result column="bk_income" property="bk_income" jdbcType="DOUBLE" />
     <result column="bk_currency" property="bk_currency" jdbcType="VARCHAR" />
+    <result column="cr_rate" property="cr_rate" jdbcType="DOUBLE" />
   </resultMap>
   <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Bankinformation" extends="BaseResultMap" >
     <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount, 
-    bk_status, bk_statuscode, bk_ym, companyid,
-    updaterId, updateTime, bk_text1, bk_text2, bk_text3, bk_text4, bk_text5, bk_remark,bk_currency
+    bk_status, bk_statuscode, bk_ym, bankinformation.companyid companyid,
+    bankinformation.updaterId updaterId, bankinformation.updateTime updateTime, bk_text1, bk_text2, bk_text3, bk_text4, bk_text5, bk_remark,bk_currency,cr_rate
   </sql>
   <sql id="Blob_Column_List" >
     bk_remark
@@ -320,6 +321,7 @@
     select
     <include refid="Base_Column_List" />
     from bankinformation
+    left join currencys on currencys.companyId = Bankinformation.companyid and cr_name = bk_currency
     <where>
       <if test="con != null">
         ${con}

+ 2 - 2
applications/document/document-server/src/main/resources/mapper/CurrencyMapper.xml

@@ -131,10 +131,10 @@
       ORDER BY CR_ID DESC
     </select>
     <update id="clearStandard">
-      UPDATE CURRENCYS SET CR_STANDARD = 0 WHERE COMPANYID = #{companyId}
+      UPDATE CURRENCYS SET CR_STANDARD = 0, CR_RATE = 0 WHERE COMPANYID = #{companyId}
     </update>
     <update id="setStandard">
-      UPDATE CURRENCYS SET CR_STANDARD = #{standard} WHERE COMPANYID = #{companyId} AND CR_NAME = #{name}
+      UPDATE CURRENCYS SET CR_STANDARD = #{standard}, CR_RATE = 1 WHERE COMPANYID = #{companyId} AND CR_NAME = #{name}
     </update>
     <select id="selectCountByName" resultType="int">
       SELECT COUNT(*) FROM CURRENCYS WHERE CR_NAME = #{name} AND COMPANYID = #{companyId}

+ 42 - 0
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -960,5 +960,47 @@
     <select id="selectPurchase" resultType="int">
         SELECT COUNT(*) FROM PURCHASE LEFT JOIN PURCHASEDETAIL ON PU_ID = PD_PUID WHERE IFNULL(PU_ACCEPTSTATUS,' ') != '已出库' AND IFNULL(PU_ACCEPTSTATUSCODE,' ') != '已关闭' AND IFNULL(PD_PRODID,0) = #{id}
     </select>
+    <select id="selectUploadProdByCompanyId" resultType="com.usoftchina.saas.document.dto.ProductUploadDTO">
+        SELECT pr_id,pr_code,pr_spec,pr_detail,pr_leadtime,pr_unit,pr_zxbzs,pr_brand,pr_orispeccode
+        FROM PRODUCT WHERE COMPANYID = #{companyId} AND IFNULL(B2BSTATUS, '待上传') = '待上传'
+    </select>
+    <update id="updateB2BStatus">
+        UPDATE PRODUCT SET B2BSTATUS = #{status} WHERE PR_ID IN
+        <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
+          #{id}
+        </foreach>
+    </update>
+    <select id="getProdStorage" resultType="com.usoftchina.saas.document.dto.ProdStorageDTO">
+      SELECT * FROM (
+      SELECT pr_id prodId, pr_detail prodName, pr_code prodCode, pr_spec prodSpec, pr_unid prodUnit, pr_brand prodBrand,
+      pr_orispeccode prodSpeccode,pr_leadtime prodLeadtime, 1 status
+      FROM product
+      <where>
+          <if test="userId != null">
+            and pr_id in (select ps_prid from productsaler where ps_acid = #{userId})
+          </if>
+          <if test="companyId != null">
+            and product.companyId = #{companyId}
+          </if>
+        </where>
+        union all
+        SELECT pr_id prodId, pr_detail prodName, pr_code prodCode, pr_spec prodSpec, pr_unid prodUnit, pr_brand prodBrand,
+        pr_orispeccode prodSpeccode,pr_leadtime prodLeadtime, 0 status
+        FROM product
+        <where>
+          <if test="userId != null">
+            and pr_id not in (select ps_prid from productsaler where ps_acid = #{userId})
+          </if>
+          <if test="companyId != null">
+            and product.companyId = #{companyId}
+          </if>
+        </where>
+      ) result
+      <where>
+        <if test="condition != null">
+          ${condition}
+        </if>
+      </where>
+    </select>
 </mapper>
 

+ 10 - 0
applications/document/document-server/src/main/resources/mapper/ProductSalerMapper.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.document.mapper.ProductSalerMapper">
+  <insert id="bind">
+    INSERT INTO productsaler(ps_prid,ps_acid,companyid) VALUES (#{prodId}, #{userId}, #{companyId})
+  </insert>
+  <delete id="unbind">
+    DELETE FROM productSaler WHERE ps_prid = #{prodId} and ps_acid = #{userId} and companyId = #{companyId}
+  </delete>
+</mapper>

+ 21 - 13
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java

@@ -93,9 +93,9 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             fundtransferdetail.setCompanyId(BaseContextHolder.getCompanyId());
             fundtransferdetail.setFtd_ftid(Math.toIntExact(id));
             fundtransferdetail.setFt_date(fundtransfer.getFt_date());
-            if (!(fundtransferdetail.getFtd_currency().equals(fundtransferdetail.getFtd_incurrency()))){
-                throw new BizException(500, BizExceptionCode.CURRENCY_NOT_EQUALS.getMessage());
-            }
+//            if (!(fundtransferdetail.getFtd_currency().equals(fundtransferdetail.getFtd_incurrency()))){
+//                throw new BizException(500, BizExceptionCode.CURRENCY_NOT_EQUALS.getMessage());
+//            }
             if (fundtransferdetail.getId() > 0 ){
                 fundtransferdetailMapper.updateByPrimaryKeySelective(fundtransferdetail);
             }else {
@@ -132,6 +132,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         while (isList.hasNext()){
             Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
             Double amount = fundtransferdetail.getFtd_nowbalance();
+            Double inamount = fundtransferdetail.getFtd_innowbalance();
             //收款
             Banksubledger banksubledger = new Banksubledger();
             banksubledger.setCompanyId(BaseContextHolder.getCompanyId());
@@ -143,7 +144,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
 
             banksubledger.setBl_kind("资金转账");
             banksubledger.setBl_date(fundtransfer.getFt_date());
-            banksubledger.setBl_income(fundtransferdetail.getFtd_nowbalance());
+            banksubledger.setBl_income(inamount);
             banksubledger.setBl_remark(fundtransferdetail.getFtd_remark());
             banksubledgerMapper.insertSelective(banksubledger);
 
@@ -157,7 +158,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             banksubledger1.setBl_code(fundtransfer.getFt_code());
             banksubledger1.setBl_kind("资金转账");
             banksubledger1.setBl_date(fundtransfer.getFt_date());
-            banksubledger1.setBl_spending(fundtransferdetail.getFtd_nowbalance());
+            banksubledger1.setBl_spending(amount);
             banksubledger1.setBl_remark(fundtransferdetail.getFtd_remark());
             banksubledgerMapper.insertSelective(banksubledger1);
 
@@ -165,7 +166,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             int bk_id = fundtransferdetail.getFtd_bankid();
             int bk_inid = fundtransferdetail.getFtd_inbankid();
 
-            Double bk_amount = fundtransferdetail.getFtd_nowbalance();
+//            Double bk_amount = fundtransferdetail.getFtd_nowbalance();
             //付款方
             Bankinformation bankinformation = bankinformationMapper.selectByPrimaryKey(bk_id);
             Double beginamount = bankinformation.getBk_beginamount() == null ? new Double(0) : bankinformation.getBk_beginamount();
@@ -175,9 +176,9 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
             Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
             Bankinformation newbankinformation = new Bankinformation();
-            newbankinformation.setBk_thisamount(beginamount + incomme - (spending + bk_amount));
+            newbankinformation.setBk_thisamount(beginamount + incomme - (spending + amount));
             newbankinformation.setBk_income(incomme);
-            newbankinformation.setBk_spending(spending + bk_amount);
+            newbankinformation.setBk_spending(spending + amount);
             newbankinformation.setId(bankinformation.getId());
             newbankinformation.setCompanyId(BaseContextHolder.getCompanyId());
             bankinformationMapper.updateByPrimaryKeySelective(newbankinformation);
@@ -188,8 +189,8 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             Double inspending = inbankinformation.getBk_spending() == null ? new Double(0) : inbankinformation.getBk_spending();
             Double inincomme = inbankinformation.getBk_income() == null ? new Double(0) : inbankinformation.getBk_income();
             Bankinformation newinbankinformation = new Bankinformation();
-            newinbankinformation.setBk_thisamount(inbeginamount + (inincomme + bk_amount) - inspending );
-            newinbankinformation.setBk_income(inincomme + bk_amount);
+            newinbankinformation.setBk_thisamount(inbeginamount + (inincomme + inamount) - inspending );
+            newinbankinformation.setBk_income(inincomme + inamount);
             newinbankinformation.setBk_spending(inspending);
             newinbankinformation.setId(inbankinformation.getId());
             newinbankinformation.setCompanyId(BaseContextHolder.getCompanyId());
@@ -372,7 +373,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             if (res.isSuccess()) {
                 codeString = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //codeString = maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.FUNDTRANSFER.getCaller()).getData();
         }
@@ -420,9 +421,16 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
 //                banksubledger.setBl_asstype(null);
 //            }
             banksubledger.setBl_assid(0);
-            banksubledger.setBl_spending(fundtransferdetail.getFtd_nowbalance());
             banksubledger.setBl_remark(fundtransferdetail.getFtd_remark());
-            banksubledger.setBl_orderamount(fundtransferdetail.getFtd_nowbalance() * -1);
+
+            //判断转入转出
+            if(fundtransferdetail.getFtd_bankname().equals(banksubledger.getBl_bankname())){
+                banksubledger.setBl_spending(fundtransferdetail.getFtd_nowbalance());
+                banksubledger.setBl_orderamount(fundtransferdetail.getFtd_nowbalance() * -1);
+            }else {
+                banksubledger.setBl_spending(fundtransferdetail.getFtd_innowbalance());
+                banksubledger.setBl_orderamount(fundtransferdetail.getFtd_innowbalance() * -1);
+            }
             if (banksubledgerMapper.selectCode(banksubledger.getBl_code(), BaseContextHolder.getCompanyId()) == null){
                 banksubledgerMapper.insertSelective(banksubledger);
             }else {

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java

@@ -392,7 +392,7 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
             if (res.isSuccess()) {
                 codeString = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //codeString = maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.OTHRECEIPTS.getCaller()).getData();
         }

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java

@@ -387,7 +387,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             if (res.isSuccess()) {
                 codeString = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //codeString = maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.OTHSPENDINGS.getCaller()).getData();
         }

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java

@@ -524,7 +524,7 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
             if (res.isSuccess()) {
                 codeString = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //codeString = maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.PAYBALANCE.getCaller()).getData();
         }

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

@@ -535,7 +535,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
             if (res.isSuccess()) {
                 codeString = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //codeString = maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.RECBALANCE.getCaller()).getData();
         }

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java

@@ -1113,7 +1113,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
         }
         return billCode;

+ 2 - 2
applications/operation/operation-server/src/main/resources/mapper/AccoutMapper.xml

@@ -44,7 +44,7 @@
         <if test="con != null">
             ${con}
         </if>
-    </where>
+    </where> order by id desc
     </select>
     <select id="getLogin" parameterType="string" resultMap="loginMap">
         SELECT * FROM (select account_id  ,count(account_id) login_num,max(ac_account.realname) username,max(login_time) lastesttime, max(ac_account.mobile) mobile from saas_auth.au_authorize_log left join saas_account.ac_account on account_id= ac_account.id  where login_time >  date_sub(now(),interval 3 MONTH) GROUP BY account_id order by lastesttime desc
@@ -53,7 +53,7 @@
             <if test="con != null">
                 ${con}
             </if>
-        </where>
+        </where>  order by account_id desc
     </select>
 
     <select id="getConpanyAnalyze" parameterType="string" resultMap="companymap">

+ 2 - 2
applications/operation/operation-server/src/main/resources/mapper/CompanyMapper.xml

@@ -14,13 +14,13 @@
     </resultMap>
 
     <select id="findCompanyByCondition" parameterType="string" resultMap="baseMap">
-         select name,business_code,address,tel,fax,realname,mobile,ac_company.create_time,ac_company.uu from saas_account.ac_company
+         select ac_company.id,name,business_code,address,tel,fax,realname,mobile,ac_company.create_time,ac_company.uu from saas_account.ac_company
         left join saas_account.ac_account on ac_account.id = ac_company.creator_id
         <where>
             <if test="con != null">
                 ${con}
             </if>
-        </where>
+        </where> order by id desc
     </select>
 
 

+ 6 - 5
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -11,6 +11,7 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.*;
 import com.usoftchina.saas.purchase.po.PurchaseList;
 import com.usoftchina.saas.purchase.service.PurchaseService;
+import com.usoftchina.saas.utils.JsonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -208,7 +209,7 @@ public class PurchaseController {
      * @return
      */
     @PostMapping("/inquiry/deal")
-    public Result dealInquiry(InquiryDealReqDTO inquiryDealReqDTO){
+    public Result dealInquiry(@RequestBody InquiryDealReqDTO inquiryDealReqDTO){
         purchaseService.DealInquiry(inquiryDealReqDTO);
         return Result.success();
     }
@@ -217,9 +218,9 @@ public class PurchaseController {
      * 发起询价
      * @return
      */
-    @PostMapping("/inquiry/save")
-    public Result saveInquiry(List<InquiryAddDTO> inquiryAddDTO){
-        purchaseService.saveInquiry(inquiryAddDTO);
-        return Result.success();
+    @PostMapping("/inquiry/send")
+    public Result saveInquiry(@RequestBody String data){
+        List<InquiryAddDTO> inquiryAddDTOList = JsonUtils.fromJsonArray(data, InquiryAddDTO.class);
+        return Result.success(purchaseService.saveInquiry(inquiryAddDTOList));
     }
 }

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java

@@ -77,6 +77,8 @@ public class PurchaseList extends CommonBaseEntity implements Serializable {
 
     private String pu_currency;
 
+    private Double pu_rate;
+
     //从表字段
     private Long pd_id;
 

+ 2 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java

@@ -14,6 +14,7 @@ import com.usoftchina.saas.purchase.po.Purchase;
 import com.usoftchina.saas.purchase.po.PurchaseList;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author yingp
@@ -164,5 +165,5 @@ public interface PurchaseService extends CommonBaseService<PurchaseMapper, Purch
      * 发起询价
      * @param inquiryAddDTO
      */
-    void saveInquiry(List<InquiryAddDTO> inquiryAddDTO);
+    List<Map<String, String>> saveInquiry(List<InquiryAddDTO> inquiryAddDTO);
 }

+ 1 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java

@@ -671,7 +671,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //billCode = maxnumberService.pushMaxnubmer(count, pi_inoutno, caller).getData();
         }

+ 49 - 11
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -38,6 +38,9 @@ import com.usoftchina.saas.purchase.service.ProdInOutService;
 import com.usoftchina.saas.purchase.service.PurchaseService;
 import com.usoftchina.saas.utils.BeanMapper;
 import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.saas.utils.JsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -45,6 +48,7 @@ import org.springframework.util.StringUtils;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.concurrent.CountDownLatch;
 
 
 /**
@@ -81,6 +85,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     @Autowired
     private AccountApi accountApi;
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(PurchaseServiceImpl.class);
 
     @Override
     public PageInfo<PurchaseList> getListData(PageRequest page, ListReqDTO req) {
@@ -187,10 +192,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             return baseDTO;
         }
         //校验有来源的验收验退币别是否与源单据一致
-        String puCode = purchaseMapper.validateCurrency(pu_id,purchase.getPu_currency());
-        if(puCode!=null){
-            throw new BizException(BizExceptionCode.CURRENCY_VALID);
-        }
+       // String puCode = purchaseMapper.validateCurrency(pu_id,purchase.getPu_currency());
+//        if(puCode!=null){
+//            throw new BizException(BizExceptionCode.CURRENCY_VALID);
+//        }
         //更新操作
         purchaseMapper.updateByPrimaryKeySelective(purchase);
         //添加从表传输对象
@@ -658,7 +663,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
            // billCode = maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.PURCHASE.getCaller()).getData();
         }
@@ -682,9 +687,11 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         IPage<PurcInquiryItemInfo> purcInquiryItemInfoIPage = null;
         Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
         if (inquiryReqDTO.getQuoted() == 1){
-            purcInquiryItemInfoIPage = inquiryApi.findQuotationsByPage("done", enUU, inquiryReqDTO.getPageNumber(), inquiryReqDTO.getPageSize());
+            purcInquiryItemInfoIPage = inquiryApi.findQuotationsByPage("done", enUU, inquiryReqDTO.getPageNumber(), inquiryReqDTO.getPageSize(),
+                    inquiryReqDTO.getFromDate(), inquiryReqDTO.getKeyword(), inquiryReqDTO.getOverdue(), inquiryReqDTO.getEndDate());
         }else{
-            purcInquiryItemInfoIPage = inquiryApi.getInquiryList(enUU, inquiryReqDTO.getOverdue(), inquiryReqDTO.getPageNumber(), inquiryReqDTO.getPageSize(), "todo");
+            purcInquiryItemInfoIPage = inquiryApi.getInquiryList(enUU, inquiryReqDTO.getOverdue(), inquiryReqDTO.getPageNumber(), inquiryReqDTO.getPageSize(),
+                    "todo", inquiryReqDTO.getFromDate(), inquiryReqDTO.getKeyword(), inquiryReqDTO.getEndDate());
         }
         List<PurcInquiryItemInfo> purcInquiryItemInfoList =  purcInquiryItemInfoIPage.getContent();
         if (CollectionUtils.isEmpty(purcInquiryItemInfoList)){
@@ -718,7 +725,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
      * @param inquiryAddDTOList
      */
     @Override
-    public void saveInquiry(List<InquiryAddDTO> inquiryAddDTOList) {
+    public List<Map<String, String>> saveInquiry(List<InquiryAddDTO> inquiryAddDTOList) {
         List<PurcInquiry> purcInquiryList = new ArrayList<PurcInquiry>();
         CompanyRspDTO companyRspDTO = companyApi.getCompanyRspDTOById(BaseContextHolder.getCompanyId()).getData();
         AccountDTO accountDTO = accountApi.getAccountById(BaseContextHolder.getUserId()).getData();
@@ -734,6 +741,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             PurcInquiry purcInquiry = new PurcInquiry();
             //询价主表信息
             purcInquiry.setEnterprise(enterprise);
+            purcInquiry.setEnUU(companyRspDTO.getUu());
             purcInquiry.setEnName(companyRspDTO.getName());
             purcInquiry.setRecorderUU(accountDTO.getUu());
             purcInquiry.setDate(new Date());
@@ -758,8 +766,37 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             purcInquiry.setInquiryItems(purcInquiryItemSet);
             purcInquiryList.add(purcInquiry);
         }
-        //调用商城ap,保存询价
-
+        //开启线程调用商城ap,保存询价
+        int length = purcInquiryList.size();
+        CountDownLatch latch = new CountDownLatch(length);
+        List<Map<String, String>> result = new ArrayList<Map<String, String>>();    //失败数据
+        for (int i = 0; i < length; i++) {
+            PurcInquiry purcInquiry = purcInquiryList.get(i);
+            new Thread(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        PurcInquiry result = inquiryApi.saveInquiry(purcInquiry);
+                        LOGGER.info("发起询价,成功,返回数据: {}", JsonUtils.toJsonString(result));
+                        latch.countDown();
+                    }catch (Exception e){
+                        LOGGER.info("发起询价,失败,传入数据: {}, 失败原因: {}, 返回结果: {}", JsonUtils.toJsonString(purcInquiry), e.getMessage(), JsonUtils.toJsonString(result));
+                        Map<String, String> map = new HashMap<String, String>();
+                        map.put("errCode", purcInquiry.getInquiryItems().iterator().next().getProdCode());
+                        result.add(map);
+                        latch.countDown();
+                    }
+                }
+            }).start();
+        }
+        try {
+            latch.await();
+            LOGGER.info("发起询价,处理完成.");
+            return result;
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        return null;
     }
 
     /**
@@ -777,7 +814,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             inquiryRspDTO.setProdBrand(purcInquiryItemInfo.getProduct().getBrand());
             inquiryRspDTO.setProdName(purcInquiryItemInfo.getProdTitle());
             inquiryRspDTO.setProdSpec(purcInquiryItemInfo.getSpec());
-            inquiryRspDTO.setStartDate(purcInquiryItemInfo.getFromDate());
+            inquiryRspDTO.setStartDate(purcInquiryItemInfo.getDate());
             inquiryRspDTO.setEndDate(purcInquiryItemInfo.getEndDate());
             inquiryRspDTO.setQuoted(purcInquiryItemInfo.getQuoted());
             //报价信息
@@ -792,6 +829,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                     quotationRspDTO.setLeadTime(publicInquiryItem.getLeadtime());
                     quotationRspDTO.setTel(publicInquiryItem.getUserTel());
                     quotationRspDTO.setAgreed(publicInquiryItem.getAgreed());
+                    quotationRspDTO.setRefusereason(publicInquiryItem.getRefusereason());
                     quotationRspDTO.setReplaceOrispeccode(publicInquiryItem.getCmpCode());
                     //分段报价信息
                     List<PublicInquiryReply> publicInquiryReplyList = publicInquiryItem.getReplies();

+ 1 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml

@@ -37,6 +37,7 @@
         <result column="pu_said" property="pu_said" jdbcType="INTEGER" />
         <result column="pu_sacode" property="pu_sacode" jdbcType="VARCHAR" />
         <result column="pu_currency" property="pu_currency" jdbcType="VARCHAR" />
+        <result column="pu_rate" property="pu_rate" jdbcType="DOUBLE" />
         <result column="PD_ID" property="pd_id" jdbcType="INTEGER" />
         <result column="PD_PUID" property="pd_puid" jdbcType="INTEGER" />
         <result column="PD_CODE" property="pd_code" jdbcType="VARCHAR" />

+ 1 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java

@@ -860,7 +860,7 @@ public class SaleServiceImpl implements SaleService{
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //billCode = maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.SALE.getCaller()).getData();
         }

+ 1 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -823,7 +823,7 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             if (res.isSuccess()) {
                 ma_code = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
            // ma_code =  maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.MAKE.getCaller()).getData();
         }

+ 1 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java

@@ -483,7 +483,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             if (res.isSuccess()) {
                 code = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //code = maxnumberService.pushMaxnubmer(count, pi_inoutno, caller).getData();
         }

+ 1 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java

@@ -221,7 +221,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
             if (res.isSuccess()) {
                 billCode = res.getData();
             } else {
-                throw new BizException(123456, res.getMessage());
+                throw new BizException(res.getCode(), res.getMessage());
             }
             //billCode = maxnumberService.pushMaxnubmer(count, pi_inoutno, caller).getData();
         }

+ 5 - 2
applications/transfers/mall-api/src/main/java/com/usoftchina/inquiry/api/InquiryApi.java

@@ -87,7 +87,8 @@ public interface InquiryApi {
     @GetMapping("/buyer/list")
     IPage<PurcInquiryItemInfo> getInquiryList(@RequestParam("enUU") Long enUU, @RequestParam("overdue") Integer overdue,
                                               @RequestParam("pageNumber") int pageNumber, @RequestParam("pageSize") int pageSize,
-                                              @RequestParam("state") String state);
+                                              @RequestParam("state") String state, @RequestParam("fromDate") Long fromDate,
+                                              @RequestParam("keyword") String keyword, @RequestParam("endDate") Long endDate);
 
     /**
      * 查看已报价列表
@@ -99,7 +100,9 @@ public interface InquiryApi {
      */
     @GetMapping("/buyer/quotations")
     IPage<PurcInquiryItemInfo> findQuotationsByPage(@RequestParam("state") String state, @RequestParam("enUU") Long enUU,
-                                                    @RequestParam("pageNumber") int pageNumber, @RequestParam("pageSize") int pageSize);
+                                                    @RequestParam("pageNumber") int pageNumber, @RequestParam("pageSize") int pageSize,
+                                                    @RequestParam("fromDate") Long fromDate, @RequestParam("keyword") String keyword,
+                                                    @RequestParam("overdue") Integer overdue, @RequestParam("endDate") Long endDate);
 
     /**
      * 采纳

+ 6 - 1
applications/transfers/mall-api/src/main/java/com/usoftchina/inquiry/api/ProductApi.java → applications/transfers/mall-api/src/main/java/com/usoftchina/inquiry/api/PublicProductApi.java

@@ -7,9 +7,14 @@ import org.springframework.web.bind.annotation.RequestParam;
 
 @FeignClient(url = "${b2b.baseUrl.product}", name = "product-server")
 @RequestMapping("/product")
-public interface ProductApi {
+public interface PublicProductApi {
 
     @PostMapping("/erp/save")
     void saveProducts(@RequestParam("data") String data, @RequestParam("enUU")Long enUU);
 
+    @PostMapping("/produser")
+    void updateProdSaler(@RequestParam("data") String data);
+
+    @PostMapping("//produser/quit")
+    void uploadProductSalerForCancel(@RequestParam("data") String data);
 }

+ 14 - 6
applications/transfers/mall-api/src/test/java/com/usoftchina/inquiry/test/InquiryApiTest.java

@@ -122,14 +122,14 @@ public class InquiryApiTest {
 
         //询价明细
         PurcInquiryItem purcInquiryItem = new PurcInquiryItem();
-        purcInquiryItem.setCmpCode("MT8783V");
+        purcInquiryItem.setCmpCode("123123");
         purcInquiryItem.setUserUU(1000012297L);
         purcInquiryItem.setUserName("何炎");
         purcInquiryItem.setUserTel("13978887888");
-        purcInquiryItem.setProdCode("CPU0000001");
-        purcInquiryItem.setProdTitle("控制器IC");
-        purcInquiryItem.setSpec("MT8783V/CT,VFBGA641,SMD,无卤");
-        purcInquiryItem.setInbrand("MTK");
+        purcInquiryItem.setProdCode("PR0006");
+        purcInquiryItem.setProdTitle("1");
+        purcInquiryItem.setSpec("1");
+        purcInquiryItem.setInbrand("YAGEO");
 
         Set<PurcInquiryItem> purcInquiryItemSet = new HashSet<PurcInquiryItem>();
         purcInquiryItemSet.add(purcInquiryItem);
@@ -139,9 +139,17 @@ public class InquiryApiTest {
         System.out.println(JsonUtils.toJsonString(result));
     }
 
+    @Test
+    public void testE_saveInquiry2(){
+        String data = "{\"id\":null,\"enUU\":null,\"enterprise\":{\"uu\":null,\"enName\":\"何炎\",\"enTel\":null,\"enAddress\":null,\"businesscode\":null,\"adminUU\":null},\"enName\":\"何炎\",\"recorderUU\":1000012297,\"code\":null,\"date\":\"2019-01-10 10:38:17\",\"recorder\":\"何炎\",\"endDate\":\"2019-01-11 10:38:17\",\"remark\":null,\"environment\":null,\"inquiryItems\":[{\"id\":null,\"number\":null,\"inquiry\":null,\"userUU\":1000012297,\"userName\":\"何炎\",\"userTel\":\"18702604709\",\"productId\":null,\"product\":null,\"prodCode\":\"PR0006\",\"prodTitle\":\"1\",\"spec\":\"1\",\"cmpCode\":\"123123\",\"inbrand\":\"YAGEO\",\"currency\":null,\"taxrate\":null,\"fromDate\":null,\"replies\":null,\"status\":null,\"agreed\":null,\"overdue\":null,\"source\":null,\"needquantity\":null,\"sourceid\":null,\"date\":null,\"enuu\":null,\"offerAmount\":null,\"endDate\":null,\"remainingTime\":null,\"valid\":null}],\"attachs\":null,\"enteryStatus\":null,\"ship\":null,\"invoice\":null,\"ifTax\":null,\"currency\":null,\"inquirytype\":null,\"sourceapp\":\"sp\",\"erpid\":null,\"erpdate\":null,\"amount\":null,\"spec\":null,\"count\":1,\"quotedAmount\":null,\"replaceQuotedAmount\":null,\"minPriceSum\":null,\"minDeliverySum\":null}";
+        PurcInquiry purcInquiry = JsonUtils.fromJsonString(data, PurcInquiry.class);
+        PurcInquiry result  = inquiryApi.saveInquiry(purcInquiry);
+        System.out.println(JsonUtils.toJsonString(result));
+    }
+
     @Test
     public void testF_getInquiryList(){
-        IPage<PurcInquiryItemInfo> getInquiryList = inquiryApi.getInquiryList(enUU, 1, pageNum, pageSize, "todo");
+        IPage<PurcInquiryItemInfo> getInquiryList = inquiryApi.getInquiryList(enUU, 1, pageNum, pageSize, "todo", null, null, null);
         System.out.println(JsonUtils.toJsonString(getInquiryList));
     }
 

+ 4 - 4
applications/transfers/mall-api/src/test/java/com/usoftchina/inquiry/test/ProductApiTest.java → applications/transfers/mall-api/src/test/java/com/usoftchina/inquiry/test/PublicProductApiTest.java

@@ -1,6 +1,6 @@
 package com.usoftchina.inquiry.test;
 
-import com.usoftchina.inquiry.api.ProductApi;
+import com.usoftchina.inquiry.api.PublicProductApi;
 import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -12,16 +12,16 @@ import org.springframework.test.context.junit4.SpringRunner;
 @RunWith(SpringRunner.class)
 @SpringBootTest
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class ProductApiTest {
+public class PublicProductApiTest {
 
     @Autowired
-    private ProductApi productApi;
+    private PublicProductApi publicProductApi;
 
     @Test
     public void testA_saveProduct(){
         String data = "[{\"pr_code\":\"0204020020015\",\"pr_detail\":\"P沟道场效应管\",\"pr_id\":3057682,\"pr_ispubsale\":0,\"pr_ispurchase\":1,\"pr_issale\":1,\"pr_isshow\":0,\"pr_leadtime\":28.0,\"pr_ltinstock\":0.0,\"pr_spec\":\"WPM1485-6/TR,-7.4A,-12V,DFN8,SMD,无卤/WPM1485-6/TR/Will SEMI\",\"pr_unit\":\"PCS\",\"pr_zxbzs\":3000.0,\"pr_zxdhl\":3000.0},{\"pr_code\":\"B2B001\",\"pr_detail\":\"B2B平台测试\",\"pr_id\":50688771,\"pr_ispubsale\":0,\"pr_ispurchase\":1,\"pr_issale\":1,\"pr_isshow\":0,\"pr_leadtime\":0.0,\"pr_orispeccode\":\"LMK01020ISQX/NOPB\",\"pr_spec\":\"B2B平台测试01\",\"pr_unit\":\"PCS\",\"pr_uuid\":\"1200200000000521\",\"pr_zxbzs\":0.0,\"pr_zxdhl\":0.0}]";
         Long enUU = 10050573L;
-        productApi.saveProducts(data, enUU);
+        publicProductApi.saveProducts(data, enUU);
         System.out.println("success");
     }
 

+ 0 - 15
applications/transfers/transfers-api/src/main/java/com/usoftchina/saas/transfers/api/SendApi.java

@@ -1,15 +0,0 @@
-package com.usoftchina.saas.transfers.api;
-
-import com.usoftchina.saas.base.Result;
-import com.usoftchina.saas.transfers.dto.MessageInfo;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-@FeignClient(name = "transfers-server" , fallback = SendApiFallBack.class)
-public interface SendApi {
-
-    @PostMapping("/send/Message")
-    public Result sendMsg(@RequestBody MessageInfo info);
-
-}

+ 23 - 0
applications/transfers/transfers-api/src/main/java/com/usoftchina/saas/transfers/api/SendMessageApi.java

@@ -0,0 +1,23 @@
+package com.usoftchina.saas.transfers.api;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.transfers.dto.MessageInfo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@FeignClient(name = "transfers-server" , fallback = SendMessageApiFallBack.class)
+public interface SendMessageApi {
+
+    @PostMapping("/send/Message")
+    Result sendMsg(@RequestBody MessageInfo info);
+
+    @Component
+    class SendMessageApiFallBack implements SendMessageApi {
+        @Override
+        public Result sendMsg(MessageInfo info) {
+            return null;
+        }
+    }
+}

+ 1 - 1
applications/transfers/transfers-api/src/main/java/com/usoftchina/saas/transfers/api/SendApiFallBack.java → applications/transfers/transfers-api/src/main/java/com/usoftchina/saas/transfers/api/SendMessageApiFallBack.java

@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody;
  * @create: 2019-01-09 13:50
  **/
 @Component
-public class SendApiFallBack implements SendApi{
+public class SendMessageApiFallBack implements SendMessageApi {
 
     @Override
     public Result sendMsg(@RequestBody MessageInfo info) {

+ 4 - 0
applications/transfers/transfers-auth/pom.xml

@@ -34,6 +34,10 @@
             <groupId>io.github.openfeign</groupId>
             <artifactId>feign-core</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>account-api</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 10 - 0
applications/transfers/transfers-auth/src/main/java/com/usoftchina/saas/transfers/auth/configuration/OpenApiConfig.java

@@ -10,9 +10,19 @@ public class OpenApiConfig {
     private String signatureParam;
     @Value("${openapi.timestampParam:_timestamp}")
     private String timestampParam;
+    @Value("${openaip.companyuu:access_id}")
+    private String companyuu;
     @Value("${openapi.timeout:60000}")
     private int timeout;
 
+    public String getCompanyuu() {
+        return companyuu;
+    }
+
+    public void setCompanyuu(String companyuu) {
+        this.companyuu = companyuu;
+    }
+
     public String getSignatureParam() {
         return signatureParam;
     }

+ 29 - 12
applications/transfers/transfers-auth/src/main/java/com/usoftchina/saas/transfers/auth/interceptor/OpenApiAuthInterceptor.java

@@ -1,5 +1,8 @@
 package com.usoftchina.saas.transfers.auth.interceptor;
 
+import com.usoftchina.saas.account.api.CompanyApi;
+import com.usoftchina.saas.account.dto.CompanyDTO;
+import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.transfers.auth.annotation.IgnoreOpenApiAuth;
 import com.usoftchina.saas.transfers.auth.configuration.OpenApiConfig;
 import com.usoftchina.saas.utils.StringUtils;
@@ -25,6 +28,9 @@ public class OpenApiAuthInterceptor extends HandlerInterceptorAdapter{
     @Autowired
     private OpenApiConfig openApiConfig;
 
+    @Autowired
+    private CompanyApi companyApi;
+
     // 已使用签名
     private Map<String, Long> signatureCache = new ConcurrentHashMap<>();
 
@@ -44,26 +50,37 @@ public class OpenApiAuthInterceptor extends HandlerInterceptorAdapter{
             }
 
             String sign = request.getParameter(openApiConfig.getSignatureParam());
-            if (!StringUtils.isEmpty(sign)) {
+            String companyuu = request.getParameter(openApiConfig.getCompanyuu());
+            if (!StringUtils.isEmpty(sign) && StringUtils.isEmpty(companyuu)) {
                 String urlMessage = request.getRequestURL() + "?"
                         + request.getQueryString().substring(0, request.getQueryString().indexOf(openApiConfig.getSignatureParam()) - 1);
 
                 logger.info("urlMessage:{}", urlMessage);
                 String servletPath = request.getServletPath();
                 logger.info("servletPath:{}", servletPath);
+
                 boolean check = false;
+                //获取密钥
+                Result<CompanyDTO> companyResult = companyApi.getCompanyByUu(Long.valueOf(companyuu));
+                if (companyResult.isSuccess()) {
+                    String localSign = null;
 
-                if (servletPath.indexOf("openapi") > -1) {
-                    check = sign.equals(HmacUtils.encode(urlMessage));
-                }
-                if (check) {
-                    String timestamp = request.getParameter(openApiConfig.getTimestampParam());
-                    long now = System.currentTimeMillis();
-                    if (!StringUtils.isEmpty(timestamp) && Math.abs(now - Long.parseLong(timestamp)) <= openApiConfig.getTimeout()
-                            && !signatureCache.containsKey(sign)) {
-                        // 加入历史记录
-                        signatureCache.put(sign, now);
-                        return true;
+                    localSign = companyResult.getData().getAccessKey() == null ? HmacUtils.encode(urlMessage) :
+                                HmacUtils.encode(urlMessage, companyResult.getData().getAccessKey());
+
+                    if (servletPath.indexOf("openapi") > -1) {
+                        check = sign.equals(localSign);
+                    }
+
+                    if (check) {
+                        String timestamp = request.getParameter(openApiConfig.getTimestampParam());
+                        long now = System.currentTimeMillis();
+                        if (!StringUtils.isEmpty(timestamp) && Math.abs(now - Long.parseLong(timestamp)) <= openApiConfig.getTimeout()
+                                && !signatureCache.containsKey(sign)) {
+                            // 加入历史记录
+                            signatureCache.put(sign, now);
+                            return true;
+                        }
                     }
                 }
             }

+ 101 - 101
applications/transfers/transfers-dto/src/main/java/com/usoftchina/saas/transfers/dto/MessageInfo.java

@@ -9,105 +9,105 @@ import java.util.UUID;
  * @create: 2019-01-09 11:33
  **/
 public class MessageInfo implements Serializable{
-        /**
-         * 消息ID
-         */
-        private String msgId;
-        /**
-         * 用户ID
-         */
-        private String userId;
-        /**
-         * 应用ID
-         */
-        private String appId;
-        /**
-         * 业务类型
-         */
-        private String bizType;
-
-        /**
-         * 业务单据ID
-         */
-
-        private String bizId;
-        /**
-         * 公司id
-         * @return
-         */
-        private Long companyId;
-
-        /**
-         * 时间戳
-         */
-        private long timestamp;
-
-        public long getTimestamp() {
-            return timestamp;
-        }
-
-        public void setTimestamp(long timestamp) {
-            this.timestamp = timestamp;
-        }
-
-        public String getMsgId() {
-            return msgId;
-        }
-
-        public void setMsgId(String msgId) {
-            this.msgId = msgId;
-        }
-
-        public String getUserId() {
-            return userId;
-        }
-
-        public void setUserId(String userId) {
-            this.userId = userId;
-        }
-
-        public String getAppId() {
-            return appId;
-        }
-
-        public void setAppId(String appId) {
-            this.appId = appId;
-        }
-
-        public String getBizType() {
-            return bizType;
-        }
-
-        public void setBizType(String bizType) {
-            this.bizType = bizType;
-        }
-
-        public String getBizId() {
-            return bizId;
-        }
-
-        public void setBizId(String bizId) {
-            this.bizId = bizId;
-        }
-
-        public MessageInfo(String userId, String bizType, String bizId, Long companyId) {
-            this.msgId = UUID.randomUUID().toString();
-            this.userId = userId;
-            this.appId = "trade";
-            this.bizType = bizType;
-            this.bizId = bizId;
-            this.companyId = companyId;
-            this.timestamp = new Date().getTime();
-        }
-
-        public MessageInfo() {
-
-        }
-        public Long getCompanyId() {
-            return companyId;
-        }
-
-        public void setCompanyId(Long companyId) {
-            this.companyId = companyId;
-        }
+    /**
+     * 消息ID
+     */
+    private String msgId;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 应用ID
+     */
+    private String appId;
+    /**
+     * 业务类型
+     */
+    private String bizType;
+
+    /**
+     * 业务单据ID
+     */
+
+    private String bizId;
+    /**
+     * 公司id
+     * @return
+     */
+    private Long companyId;
+
+    /**
+     * 时间戳
+     */
+    private long timestamp;
+
+    public long getTimestamp() {
+        return timestamp;
+    }
+
+    public void setTimestamp(long timestamp) {
+        this.timestamp = timestamp;
+    }
+
+    public String getMsgId() {
+        return msgId;
+    }
+
+    public void setMsgId(String msgId) {
+        this.msgId = msgId;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public String getBizType() {
+        return bizType;
+    }
+
+    public void setBizType(String bizType) {
+        this.bizType = bizType;
+    }
+
+    public String getBizId() {
+        return bizId;
+    }
+
+    public void setBizId(String bizId) {
+        this.bizId = bizId;
+    }
+
+    public MessageInfo(Long userId, String bizType, String bizId, Long companyId) {
+        this.msgId = UUID.randomUUID().toString();
+        this.userId = userId;
+        this.appId = "trade";
+        this.bizType = bizType;
+        this.bizId = bizId;
+        this.companyId = companyId;
+        this.timestamp = new Date().getTime();
+    }
+
+    public MessageInfo() {
+
+    }
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
 }

+ 13 - 0
applications/transfers/transfers-server/pom.xml

@@ -56,6 +56,19 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>transfers-dto</artifactId>
         </dependency>
+        <dependency>
+          <groupId>com.usoftchina.saas</groupId>
+          <artifactId>document-api</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>com.usoftchina.saas</groupId>
+          <artifactId>account-api</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>com.usoftchina.saas</groupId>
+          <artifactId>mall-api</artifactId>
+          <version>1.0.0-SNAPSHOT</version>
+        </dependency>
         <!-- db -->
         <dependency>
             <groupId>mysql</groupId>

+ 4 - 1
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/service/ReceiveService.java

@@ -65,9 +65,12 @@ public class ReceiveService {
                case PURCHASEOUT:
                    task = new SendPurchaseOutTask();
                    break;
+               case PRODUCT:        //物料库上传
+                   task = new SendProductTask();
+                   break;
            }
 
-           task.execute();
+           task.execute(info);
 
            //更新状态
            brokerMessageLogMapper.updateSuccess(info.getMsgId());

+ 3 - 1
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/Executable.java

@@ -1,5 +1,7 @@
 package com.usoftchina.saas.transfers.task;
 
+import com.usoftchina.saas.transfers.dto.MessageInfo;
+
 /**
  * @author: guq
  * @create: 2019-01-08 13:38
@@ -18,5 +20,5 @@ public abstract class Executable {
     /**
      * 执行任务
      */
-    public abstract void execute();
+    public abstract void execute(MessageInfo messageInfo);
 }

+ 115 - 0
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendProductTask.java

@@ -0,0 +1,115 @@
+package com.usoftchina.saas.transfers.task;
+
+import com.usoftchina.inquiry.api.PublicProductApi;
+import com.usoftchina.saas.account.api.CompanyApi;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.api.ProductApi;
+import com.usoftchina.saas.document.dto.ProductUploadDTO;
+import com.usoftchina.saas.transfers.dto.MessageInfo;
+import com.usoftchina.saas.transfers.service.SendService;
+import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.saas.utils.DateUtils;
+import com.usoftchina.saas.utils.JsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.*;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * @Description 物料上传
+ * @Author chenwei
+ * @Date 2019/01/09
+ */
+public class SendProductTask extends Executable{
+
+    @Autowired
+    private ProductApi productApi;
+    @Autowired
+    private PublicProductApi publicProductApi;
+    @Autowired
+    private CompanyApi companyApi;
+    @Autowired
+    private SendService sendService;
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SendProductTask.class);
+
+    @Override
+    public void execute(MessageInfo messageInfo) {
+        Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
+        //需要上传的物料信息
+        List<ProductUploadDTO> productUploadDTOList = productApi.getUploadData().getData();
+        //上传结果反馈
+        List<Long> successIds = new ArrayList<Long>();
+        List<Long> failedIds = new ArrayList<Long>();
+        if (!CollectionUtils.isEmpty(productUploadDTOList)){
+            //分批次上传,每次50条. 物料服务提供接口采用@requestParam接收物料数据,存在数据长度限制
+            if (productUploadDTOList.size() >= 50){
+                int count = (int) Math.ceil(productUploadDTOList.size() / 50.0);
+                CountDownLatch latch = new CountDownLatch(count);
+                for (int i = 0; i < count; i++) {
+                    //第loop次循环
+                    int loop = i;
+                    new Thread(new Runnable() {
+                        @Override
+                        public void run() {
+                            int startPoint = loop * 50;
+                            int endPoint = 0;
+                            if (loop + 1 == count) {
+                                endPoint = productUploadDTOList.size() - 1;
+                            }else{
+                                endPoint = (loop + 1) * 50;
+                            }
+                            List<ProductUploadDTO> subList = productUploadDTOList.subList(startPoint, endPoint);
+                            try {
+                                publicProductApi.saveProducts(JsonUtils.toJsonString(subList), enUU);
+                                subList.forEach(ProductUploadDTO -> successIds.add(ProductUploadDTO.getPr_id()));
+                                LOGGER.info("本批次第{}至{},物料上传成功, 发起时间 {}",startPoint, endPoint, DateUtils.format(new Date(System.currentTimeMillis()), "yyyy-MM-dd hh:mm:ss"));
+                            }catch (Exception e){
+                                subList.forEach(ProductUploadDTO -> failedIds.add(ProductUploadDTO.getPr_id()));
+                                LOGGER.info("本批次第{}至{},物料上传失败,原因:{}, 发起时间 {}",startPoint, endPoint, e.getMessage(), DateUtils.format(new Date(System.currentTimeMillis()), "yyyy-MM-dd hh:mm:ss"));
+                            }finally {
+                                latch.countDown();
+                            }
+                        }
+                    }).start();
+                }
+                try {
+                    latch.await();
+                    LOGGER.info("物料上传完成, 成功{}条,失败{}条", successIds.size(), failedIds.size());
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }else{
+                try {
+                    publicProductApi.saveProducts(JsonUtils.toJsonString(productUploadDTOList), enUU);
+                    productUploadDTOList.forEach(productUploadDTO -> successIds.add(productUploadDTO.getPr_id()));
+                    LOGGER.info(",物料上传成功,条数{}, 发起时间 {}",productUploadDTOList.size(), DateUtils.format(new Date(System.currentTimeMillis()), "yyyy-MM-dd hh:mm:ss"));
+                }catch (Exception e){
+                    productUploadDTOList.forEach(productUploadDTO -> failedIds.add(productUploadDTO.getPr_id()));
+                    LOGGER.info("物料上传失败,条数{},原因:{}, 发起时间 {}", productUploadDTOList.size(), e.getMessage(), DateUtils.format(new Date(System.currentTimeMillis()), "yyyy-MM-dd hh:mm:ss"));
+                }
+            }
+            //更新物料状态
+            if (successIds.size() > 0) {
+                Iterator<Long> it = successIds.iterator();
+                StringBuilder success = new StringBuilder();
+                while (it.hasNext()){
+                    success.append(it.next() + ",");
+                }
+                productApi.updateStatus(success.substring(0, success.length() - 1), "已上传");
+            }
+            if (failedIds.size() > 0){
+                Iterator<Long> it = failedIds.iterator();
+                StringBuilder failed = new StringBuilder();
+                while (it.hasNext()){
+                    failed.append(it.next() + ",");
+                }
+                String failedStr = failed.substring(0, failed.length() - 1);
+                MessageInfo newMessageInfo = new MessageInfo(messageInfo.getUserId(), messageInfo.getBizType(), failedStr, messageInfo.getCompanyId());
+                sendService.sendMessage(newMessageInfo);
+            }
+        }
+    }
+}

+ 3 - 1
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendPurchaseInTask.java

@@ -1,12 +1,14 @@
 package com.usoftchina.saas.transfers.task;
 
+import com.usoftchina.saas.transfers.dto.MessageInfo;
+
 /**
  * @author: guq
  * @create: 2019-01-08 13:53
  **/
 public class SendPurchaseInTask extends Executable{
     @Override
-    public void execute() {
+    public void execute(MessageInfo messageInfo) {
         //TODO
     }
 }

+ 3 - 1
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendPurchaseOutTask.java

@@ -1,12 +1,14 @@
 package com.usoftchina.saas.transfers.task;
 
+import com.usoftchina.saas.transfers.dto.MessageInfo;
+
 /**
  * @author: guq
  * @create: 2019-01-08 13:53
  **/
 public class SendPurchaseOutTask extends Executable{
     @Override
-    public void execute() {
+    public void execute(MessageInfo messageInfo) {
         //TODO
     }
 }

+ 3 - 1
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/SendPurchaseTask.java

@@ -1,12 +1,14 @@
 package com.usoftchina.saas.transfers.task;
 
+import com.usoftchina.saas.transfers.dto.MessageInfo;
+
 /**
  * @author: guq
  * @create: 2019-01-08 13:45
  **/
 public class SendPurchaseTask extends Executable {
     @Override
-    public void execute() {
+    public void execute(MessageInfo messageInfo) {
         //TODO
     }
 }

+ 12 - 1
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyDTO.java

@@ -27,7 +27,18 @@ public class CompanyDTO implements Serializable{
     private String dcName;
     private String tel;
     private String fax;
-    private String signet;      //电子章
+    private String signet;
+    private String accessKey;
+
+    public String getAccessKey() {
+        return accessKey;
+    }
+
+    public void setAccessKey(String accessKey) {
+        this.accessKey = accessKey;
+    }
+
+    //电子章
     private List<Map<String, FileInfoDTO>> fileInfoList;
 
     public List<Map<String, FileInfoDTO>> getFileInfoList() {

+ 9 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/Company.java

@@ -73,6 +73,15 @@ public class Company implements Serializable {
     private Date updateTime;
     private long updaterId;
     private Long uu;
+    private String accessKey;
+
+    public String getAccessKey() {
+        return accessKey;
+    }
+
+    public void setAccessKey(String accessKey) {
+        this.accessKey = accessKey;
+    }
 
     public String getName() {
         return name;

+ 3 - 2
base-servers/account/account-server/src/main/resources/mapper/CompanyMapper.xml

@@ -18,6 +18,7 @@
         <result column="uu" jdbcType="VARCHAR" property="uu"/>
         <result column="logo_url" jdbcType="VARCHAR" property="logoUrl"/>
         <result column="dc_name" jdbcType="VARCHAR" property="dcName"/>
+        <result column="access_key" jdbcType="VARCHAR" property="accessKey"/>
     </resultMap>
     <resultMap id="BaseResultMap" type="com.usoftchina.saas.account.vo.CompanyBaseVO">
         <id column="id" jdbcType="BIGINT" property="id"/>
@@ -26,7 +27,7 @@
         <result column="dc_name" jdbcType="VARCHAR" property="dcName"/>
     </resultMap>
     <sql id="baseColumns">
-        id,name,business_code,address,uu,creator_id,create_time,updater_id,update_time,fax,tel,signet,uu,logo_url,dc_name
+        id,name,business_code,address,uu,creator_id,create_time,updater_id,update_time,fax,tel,signet,uu,logo_url,dc_name,access_key
     </sql>
     <insert id="insert" parameterType="com.usoftchina.saas.account.po.Company"
             useGeneratedKeys="true" keyProperty="id">
@@ -128,7 +129,7 @@
     </select>
     <select id="getCompanyRspDTOById" resultType="com.usoftchina.saas.account.dto.CompanyRspDTO">
         SELECT
-          ac.id,ac.name,aa.realname admin,aa.mobile adminMobile
+          ac.id,ac.name,aa.realname admin,aa.mobile adminMobile,aa.uu adminUU,ac.uu,ac.tel,ac.address,ac.business_code businessCode
         FROM
           ac_company ac
           INNER JOIN ac_account aa on ac.creator_id = aa.id

+ 0 - 1
framework/core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixContextScheduler.java

@@ -175,7 +175,6 @@ public class HystrixContextScheduler extends Scheduler {
             sa.addParent(subscription);
 
             ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor();
-            LOGGER.info("创建新线程...............");
             Runnable runnable = TtlRunnable.get(sa);
             FutureTask<?> f = (FutureTask<?>) executor.submit(runnable);
             sa.add(new FutureCompleterWithConfigurableInterrupt(f, shouldInterruptThread, executor));

+ 1 - 1
framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java

@@ -13,7 +13,7 @@ public enum ExceptionCode implements BaseExceptionCode {
     ILLEGAL_ARGUMENTS(20001, "参数错误"),
     // jwt token 相关 start
     // 过期
-    JWT_TOKEN_EXPIRED(40001, "token超时,请检查 token 的有效期"),
+    JWT_TOKEN_EXPIRED(40001, "登录超时,请重新登录"),
     // 签名错误
     JWT_SIGNATURE(40002, "不合法的token,请认真比对 token 的签名"),
     // token 为空

+ 18 - 6
frontend/saas-web/app/model/money/FundTransfer.js

@@ -4,16 +4,28 @@ Ext.define('saas.model.money.FundTransfer', {
         { name: 'ftd_id', type: 'int' },
         { name: 'ftd_ftid', type: 'int' },
         { name: 'ftd_detno', type: 'int' },
-        { name: 'ftd_ym', type: 'int' },
+        { name: 'ftd_ym', type: 'int' }, //期间
         { name: 'ftd_bankid', type: 'int' },
         { name: 'ftd_bankcode', type: 'string' },
-        { name: 'ftd_bankname', type: 'string' },
+        { name: 'ftd_bankname', type: 'string' },//转出账户
+        { name: 'ftd_currency', type: 'string' },//转出币别
+        { name: 'ftd_nowbalance', type: 'float' },//转出金额
         { name: 'ftd_inbankid', type: 'int' },
         { name: 'ftd_inbankcode', type: 'string' },
-        { name: 'ftd_inbankname', type: 'string' },
-        { name: 'ftd_nowbalance', type: 'float' },
-        { name: 'ftd_paymethod', type: 'string' },
-        { name: 'ftd_paycode', type: 'string' },
+        { name: 'ftd_inbankname', type: 'string' },//转入账户
+        { name: 'ftd_incurrency', type: 'string' },//转入币别
+        { name: 'ftd_innowbalance', type: 'float' },//转入金额
+        { name: 'ftd_rate', type: 'float', //转存汇率 = 转出金额/转入金额
+            convert: function(v, rec) {
+                if(rec.get('ftd_innowbalance')&&rec.get('ftd_nowbalance')){
+                    var t = rec.get('ftd_nowbalance') /  rec.get('ftd_innowbalance');
+                    return Number(saas.util.BaseUtil.numberFormat(t, 6, false)); 
+                }
+            },
+            depends: ['ftd_innowbalance', 'ftd_nowbalance'] 
+        },
+        { name: 'ftd_paymethod', type: 'string' },//结算方式
+        { name: 'ftd_paycode', type: 'string' },//结算号
         { name: 'ftd_remark', type: 'string' },
         { name: 'ftd_text1', type: 'string' },
         { name: 'ftd_text2', type: 'string' },

+ 6 - 1
frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.js

@@ -22,12 +22,15 @@ Ext.define('saas.view.core.form.field.ConDbfindTrigger', {
         dbType = me.dbType,
         dbfinds = me.dbfinds,
         name0 = dbfinds[0].to,
-        name1 = dbfinds[1].to;
+        name1 = dbfinds[1].to,
+        fieldLabel = me.fieldLabel;
 
         Ext.apply(me, {
             items: [Ext.Object.merge({
                 xtype: dbType,
                 name: name0,
+                fieldLabel: fieldLabel,
+                hideLabel: true,
                 allowBlank: allowBlank,
                 msgTarget: 'none',
                 bind: {
@@ -38,6 +41,8 @@ Ext.define('saas.view.core.form.field.ConDbfindTrigger', {
             }, me.mainFieldConfig), Ext.Object.merge({
                 xtype: 'textfield',
                 name: name1,
+                fieldLabel: fieldLabel,
+                hideLabel: true,
                 allowBlank: allowBlank,
                 readOnly: true,
                 defaultReadOnly: true,

+ 13 - 0
frontend/saas-web/app/view/core/dbfind/types/BankInfoDbfindTrigger.js

@@ -46,6 +46,19 @@ Ext.define('saas.view.core.dbfind.types.BankInfoDbfindTrigger', {
         dataIndex: "bk_type",
         width: 110,
         xtype: ""
+    }, {
+        text: "币别",
+        dataIndex: "bk_currency",
+        align:'center',
+        width: 65
+    }, {
+        text: "汇率",
+        dataIndex: "cr_rate",
+        xtype: 'numbercolumn',
+        width: 80,
+        renderer: function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 6, false);
+        }
     }, {
         text: "账户余额",
         dataIndex: "bk_thisamount",

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

@@ -66,7 +66,7 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
         xtype:'numbercolumn',
         dataIndex: "cr_rate",
         width:80
-    },, {
+    }, {
         text: "业务员编号",
         dataIndex: "cu_sellercode",
         width:150,

+ 15 - 1
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -264,13 +264,27 @@ Ext.define('saas.view.core.form.FormPanel', {
     addItems: function (items) {
         let me = this;
         me.setBindFields(items);
-        let formItems = me.add(items);
+        let addItems = me.add(items);
+        let formItems = [];
+        
+        for(let i = 0; i < addItems.length; i++) {
+            let item = addItems[i];
+
+            if(item.getXTypes().split('/').indexOf('condbfindtrigger') != -1) {
+                let confields = item.items.items;
+                formItems.push(confields[0]);
+                formItems.push(confields[1]);
+            }else {
+                formItems.push(item); 
+            }
+        }
         let codeField = me.getForm().findField(me._codeField);
         if(codeField && !Ext.Array.findBy(formItems, function(i) {
             return i.name == me._codeField;
         })) {
             formItems.push(codeField);
         }
+
         me.formItems = formItems;
         return formItems;
     },

+ 28 - 13
frontend/saas-web/app/view/money/fundtransfer/FormPanel.js

@@ -86,9 +86,26 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                         valueField: "value"
                     }
                 }, {
-                    text: "转出账户币别",
+                    text: "转出币别",
                     dataIndex: "ftd_currency",
-                    ignore: true
+                    align:'center'
+                }, {
+                    text: "转出金额(元)",
+                    xtype: 'numbercolumn',
+                    dataIndex: "ftd_nowbalance",
+                    allowBlank: false,
+                    width: 150.0,
+                    editor: {
+                        xtype: "numberfield",
+                        decimalPrecision: 2
+                    },
+                    renderer: function(v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    },
+                    summaryType: 'sum',
+                    summaryRenderer: function(v, d, f, m) {
+                        return saas.util.BaseUtil.numberFormat(v, 2, true);
+                    }
                 }, {
                     text: "转入账户ID",
                     dataIndex: "ftd_inbankid",
@@ -118,16 +135,15 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                         xtype: "bandinfoDbfindTrigger"
                     }
                 }, {
-                    text: "转入账户币别",
+                    text: "转入币别",
                     dataIndex: "ftd_incurrency",
-                    ignore: true,
-                    width: 150.0
+                    align:'center'
                 }, {
-                    text: "本次转出金额(元)",
+                    text: "转入金额(元)",
                     xtype: 'numbercolumn',
-                    dataIndex: "ftd_nowbalance",
-                    width: 150.0,
+                    dataIndex: "ftd_innowbalance",
                     allowBlank: false,
+                    width: 150.0,
                     editor: {
                         xtype: "numberfield",
                         decimalPrecision: 2
@@ -140,11 +156,10 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
                 }, {
-                        text: "转存汇率",
-                        dataIndex: "ftd_rate",
-                        ignore: true,
-                        width: 150.0
-                    }, {
+                    text: "转存汇率",
+                    dataIndex: "ftd_rate",
+                    width: 150.0
+                }, {
                     text: "结算方式",
                     width: 110.0,
                     dataIndex: "ftd_paymethod",

+ 4 - 0
frontend/saas-web/app/view/money/fundtransfer/FormPanelController.js

@@ -16,6 +16,8 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                             from:'id',to:'ftd_bankid',ignore:true
                         },{
                             from:'bk_thisamount',to:'bk_outthisamount'
+                        },{
+                            from:'bk_currency',to:'ftd_currency'
                         }],
                     }) ;
                 }
@@ -33,6 +35,8 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                             from:'id',to:'ftd_inbankid',ignore:true
                         },{
                             from:'bk_thisamount',to:'bk_inthisamount'
+                        },{
+                            from:'bk_currency',to:'ftd_incurrency'
                         }],
                     }) ;   
 

+ 1 - 1
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -77,7 +77,7 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 //     or_rate: 1
                 // },
                 mainFieldConfig: {
-                    readOnly: false,
+                    readOnly: true,
                     defaultReadOnly: false,
                 },
                 supFieldConfig: {

+ 7 - 1
frontend/saas-web/app/view/money/othreceipts/FormPanelController.js

@@ -99,8 +99,14 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
                             from: 'bk_bankname',
                             to: 'or_bankname'
                         }, {
-                            from: 'id',
+                            from: 'id', 
                             to: 'or_bankid',ignore:true
+                        }, {
+                            from: 'bk_currency',
+                            to: 'or_currency'
+                        }, {
+                            from: 'cr_rate',
+                            to: 'or_rate'
                         }],
                     });
 

+ 1 - 1
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -71,7 +71,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 //     os_rate: 1
                 // },
                 mainFieldConfig: {
-                    readOnly: false,
+                    readOnly: true,
                     defaultReadOnly: false,
                 },
                 supFieldConfig: {

+ 6 - 0
frontend/saas-web/app/view/money/othspendings/FormPanelController.js

@@ -92,6 +92,12 @@ Ext.define('saas.view.money.othspendings.FormPanelController', {
                         }, {
                             from: 'id',
                             to: 'os_bankid',ignore:true
+                        }, {
+                            from: 'bk_currency',
+                            to: 'os_currency'
+                        }, {
+                            from: 'cr_rate',
+                            to: 'os_rate'
                         }],
                     });
 

+ 13 - 14
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -50,16 +50,10 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 name: "pb_vendname",
                 fieldLabel: "供应商名称",
                 allowBlank: false,
+                columnWidth: 0.5,
                 listeners: {
                     change: 'clearDetails'
                 }
-            }, {
-                xtype: "numberfield",
-                name: "ve_leftamount",
-                fieldLabel: "总欠款(元)",
-                thousandSeparator: ',',
-                ignore: true,
-                readOnly: true
             }, {
                 xtype: "datefield",
                 name: "pb_date",
@@ -76,10 +70,9 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 }, {
                     from: 'cr_rate', to: 'pb_rate'
                 }],
-                // defaultValue: {
-                //     pb_currency: 'RMB',
-                //     pb_rate: 1
-                // },
+                listeners: {
+                    change: 'clearDetails'
+                },
                 supFieldConfig: {
                     xtype: 'numberfield',
                     readOnly: false,
@@ -87,12 +80,18 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                     decimalPrecision: 6,
                     vtype: 'positiveNumber'
                 }
-            },
-                {
+            }, {
                 xtype: 'textfield',
                 name: 'pb_manname',
                 fieldLabel: '付款人',
                 defaultValue: saas.util.BaseUtil.getCurrentUser().realname
+            }, {
+                xtype: "numberfield",
+                name: "ve_leftamount",
+                fieldLabel: "总欠款(元)",
+                thousandSeparator: ',',
+                ignore: true,
+                readOnly: true
             }, {
                 xtype: 'hidden',
                 name: 'pb_pdamount',
@@ -110,7 +109,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 thousandSeparator: ',',
                 readOnly: true
             }, {
-                xtype: 'numberfield',
+                xtype: 'hidden',
                 name: 'pb_discounts',
                 fieldLabel: '整单折扣(元)',
                 hidden: true

+ 52 - 65
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -9,62 +9,6 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
             'dbfindtrigger[name=pb_vendname]':{
                 beforerender: function (f) {
                     Ext.apply(f, {
-                        dbColumns:[{
-                            text: "供应商ID",
-                            hidden: true,
-                            dataIndex: "id",
-                            xtype: "numbercolumn"
-                        },{
-                            text: "供应商编号",
-                            dataIndex: "ve_code",
-                            width: 150
-                        }, {
-                            text: "供应商名称",
-                            dataIndex: "ve_name",
-                            width: 200
-                        }, {
-                            text: "供应商类型",
-                            dataIndex: "ve_type",
-                            width: 110,
-                        }, {
-                            text: "税率(%)",
-                            dataIndex: "ve_taxrate",
-                            width: 80,
-                            xtype: 'numbercolumn',
-                            align:'end',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, false);
-                            }
-                        }, {
-                            text: "应付款余额",
-                            dataIndex: "ve_leftamount",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, true);
-                            }
-                        },{
-                            text: "结算天数",
-                            dataIndex: "ve_promisedays",
-                            width: 110,
-                            xtype: 'numbercolumn',
-                            align: 'end',
-                            renderer : function(v, m, r) {
-                                return Ext.util.Format.number(v, '0');
-                            }
-                        }, {
-                            text: "纳税人识别号",
-                            dataIndex: "ve_nsrzh",
-                            width: 150
-                        }, {
-                            text: "开户银行",
-                            dataIndex: "ve_bankcode",
-                            width: 150
-                        }, {
-                            text: "银行账户",
-                            dataIndex: "ve_bankaccount",
-                            width: 200
-                        }],
                         dbfinds: [{
                             from: 've_code',
                             to: 'pb_vendcode'
@@ -78,6 +22,10 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                             from: 'id',
                             to: 'pb_vendid',
                             ignore:true
+                        },{
+                            from:'ve_currency',to:'pb_currency'
+                        },{
+                            from:'cr_rate',to:'pb_rate'
                         }],
                     });
 
@@ -114,26 +62,46 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                             to:'pbd_nowbalance'
                         }],
                         defaultCondition: "sl_vendid<>0 and ((sl_kind in ('采购验收单','采购验退单')) or (sl_kind='期初余额' and sl_ym="+
-                                  "'(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid))) and sl_namount<>0'"
+                                  "(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid))) and sl_namount<>0"
                     });
                 },
                 beforequery: function(f) {
                     var me = this,
                     viewModel = me.getViewModel(),
-                    pb_vendname = viewModel.get('pb_vendname');
+                    pb_vendname = viewModel.get('pb_vendname'),
+                    pb_currency = viewModel.get('pb_currency'),
+                    pb_vendid = viewModel.get('pb_vendid');
                     if(!pb_vendname) {
                         saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">供应商名称</span>】');
                         return false;
                     }
+                    if(!pb_currency) {
+                        saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">币别</span>】');
+                        return false;
+                    }
+                    Ext.apply(f, {
+                        defaultCondition: "sl_vendid = "+pb_vendid+" and sl_currency ='"+pb_currency+"' AND sl_custid <> 0 AND (  sl_kind IN ( '出货单', '销售退货单' ) OR ( sl_kind = '期初余额' AND sl_ym = (select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) ) "+
+                        ") and sl_namount<>0 "
+                    });
                 },
                 beforetriggerclick: function(f) {
                     var me = this,
                     viewModel = me.getViewModel(),
-                    pb_vendname = viewModel.get('pb_vendname');
+                    pb_vendname = viewModel.get('pb_vendname'),
+                    pb_currency = viewModel.get('pb_currency'),
+                    pb_vendid = viewModel.get('pb_vendid');
                     if(!pb_vendname) {
                         saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">供应商名称</span>】');
                         return false;
                     }
+                    if(!pb_currency) {
+                        saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">币别</span>】');
+                        return false;
+                    }
+                    Ext.apply(f, {
+                        defaultCondition: "sl_vendid = "+pb_vendid+" and sl_currency ='"+pb_currency+"' AND sl_custid <> 0 AND (  sl_kind IN ( '出货单', '销售退货单' ) OR ( sl_kind = '期初余额' AND sl_ym = (select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) ) "+
+                        ") and sl_namount<>0 "
+                    });
                 }
             },
 
@@ -152,25 +120,40 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                             to: 'pd_bankname'
                         }],
                     });
-
                 },
                 beforequery: function(f) {
                     var me = this,
                     viewModel = me.getViewModel(),
-                    rb_custname = viewModel.get('pb_vendname');
+                    rb_custname = viewModel.get('pb_vendname'),
+                    pb_currency = viewModel.get('pb_currency');
                     if(!rb_custname) {
                         saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">供应商名称</span>】');
                         return false;
                     }
+                    if(!pb_currency) {
+                        saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">币别</span>】');
+                        return false;
+                    }
+                    Ext.apply(f, {
+                        defaultCondition: "bk_currency ='"+pb_currency+"'"
+                    });
                 },
                 beforetriggerclick: function(f) {
                     var me = this,
                     viewModel = me.getViewModel(),
-                    rb_custname = viewModel.get('pb_vendname');
+                    rb_custname = viewModel.get('pb_vendname'),
+                    pb_currency = viewModel.get('pb_currency');
                     if(!rb_custname) {
                         saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">供应商名称</span>】');
                         return false;
                     }
+                    if(!pb_currency) {
+                        saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">币别</span>】');
+                        return false;
+                    }
+                    Ext.apply(f, {
+                        defaultCondition: "bk_currency ='"+pb_currency+"'"
+                    });
                 }
             }
         });
@@ -259,14 +242,18 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
     },
     vendnamechange:function(dbfindtrigger){
         var me = this,
-            viewModel = me.getViewModel();
-
-        var c = viewModel.get('pb_vendname_change');
+            viewModel = me.getViewModel(),
+            c = viewModel.get('pb_vendname_change'),
+            pb_currency = viewModel.get('pb_currency');
+            console.log('vendnamechange');
         if(c!=null&&c!=''){
             c = ' and sl_vendid='+c;
         }else{
             c ='';
         }
+        if(pb_currency!=null&&pb_currency!='') {
+            c = ' and sl_currency='+pb_currency+"'";
+        }
         dbfindtrigger.defaultCondition="((sl_kind in ('采购验收单','采购验退单')) or (sl_kind='期初余额' and sl_ym="+
         "(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid))) and sl_namount<>0" + c
     },

+ 29 - 25
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -49,26 +49,10 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 name: "rb_custname",
                 fieldLabel: "客户名称",
                 allowBlank: false,
+                columnWidth: 0.5,
                 listeners: {
                     change: 'clearDetails'
                 }
-            }, {
-                xtype: "numberfield",
-                name: "cu_leftamount",
-                fieldLabel: "总欠款",
-                thousandSeparator: ',',
-                ignore: true,
-                readOnly: true
-            }, {
-                xtype: 'hidden',
-                name: 'rb_rbdamount',
-                fieldLabel: '本次核销金额(元)',
-                thousandSeparator: ','
-            }, {
-                xtype: 'hidden',
-                name: 'rb_rdamount',
-                fieldLabel: '本次付款金额(元)',
-                thousandSeparator: ','
             }, {
                 xtype: "datefield",
                 name: "rb_date",
@@ -85,10 +69,9 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 }, {
                     from: 'cr_rate', to: 'rb_rate'
                 }],
-                // defaultValue: {
-                //     rb_currency: 'RMB',
-                //     rb_rate: 1
-                // },
+                listeners: {
+                    change: 'clearDetails'
+                },
                 supFieldConfig: {
                     xtype: 'numberfield',
                     readOnly: false,
@@ -96,11 +79,30 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                     decimalPrecision: 6,
                     vtype: 'positiveNumber'
                 }
-                }, {
+            }, {
                 xtype: "textfield",
                 name: "rb_manname",
                 fieldLabel: "收款人",
                 defaultValue: saas.util.BaseUtil.getCurrentUser().realname
+            }, {
+                xtype: "numberfield",
+                name: "cu_leftamount",
+                fieldLabel: "总欠款(元)",
+                thousandSeparator: ',',
+                ignore: true,
+                readOnly: true
+            }, {
+                xtype: 'hidden',
+                name: 'rb_rbdamount',
+                fieldLabel: '本次核销金额(元)',
+                thousandSeparator: ',',
+                hidden: true
+            }, {
+                xtype: 'hidden',
+                name: 'rb_rdamount',
+                fieldLabel: '本次付款金额(元)',
+                thousandSeparator: ',',
+                hidden: true
             }, {
                 xtype: "numberfield",
                 name: "rb_discounts",
@@ -109,12 +111,14 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
             }, {
                 xtype: 'numberfield',
                 name: 'rb_preamount',
-                fieldLabel: '本次预收款',
+                fieldLabel: '本次预收(元)',
+                thousandSeparator: ',',
                 readOnly: true
             }, {
-                xtype: 'hidden',
+                xtype: 'numberfield',
                 name: 'rb_havebalance',
-                fieldLabel: '已核销金额(元)'
+                fieldLabel: '已核销金额(元)',
+                hidden: true
             }, {
                 xtype: "detailGridField",
                 name: 'detail1',

+ 47 - 78
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -9,72 +9,6 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
             'dbfindtrigger[name=rb_custname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dbColumns: [{
-                            conditionCode: 'id',
-                            text: "客户ID",
-                            dataIndex: "id",
-                            hidden:true,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_code',
-                            text: "客户编号",
-                            dataIndex: "cu_code",
-                            width: 150,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_name',
-                            text: "客户名称",
-                            dataIndex: "cu_name",
-                            width: 200,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_type',
-                            text: "客户类型",
-                            dataIndex: "cu_type",
-                            width: 110,
-                            xtype: "",
-                        }, {
-                            text: "业务员编号",
-                            dataIndex: "cu_sellercode",
-                            width:110
-                        }, {
-                            text: "业务员",
-                            dataIndex: "cu_sellername",
-                            width:110
-                        }, {
-                            text: "税率(%)",
-                            dataIndex: "cu_taxrate",
-                            xtype: 'numbercolumn',
-                            width:80,
-                            renderer: function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, false);
-                            }
-                        },{
-                            text: "应收款余额",
-                            dataIndex: "cu_leftamount",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, true);
-                            }
-                        }, {
-                            text: "结算天数",
-                            dataIndex: "cu_promisedays",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer: function(v, m, r) {
-                                return Ext.util.Format.number(v, '0');
-                            }
-                        }, {
-                            text: "额度",
-                            dataIndex: "cu_credit",
-                            width:110,
-                            xtype: 'numbercolumn',
-                        }, {
-                            text: "客户地址",
-                            dataIndex: "ca_address",
-                            width: 250
-                        }],
                         //赋值 
                         dbfinds:[{
                             from: 'id', to: 'rb_custid',ignore:true
@@ -88,8 +22,7 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             from:'cu_currency',to:'rb_currency'
                         },{
                             from:'cr_rate',to:'rb_rate'
-                        }
-                        ],
+                        }],
                     }) ;   
                 }
             },
@@ -112,20 +45,36 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                 beforequery: function(f) {
                     var me = this,
                     viewModel = me.getViewModel(),
-                    rb_custname = viewModel.get('rb_custname');
+                    rb_custname = viewModel.get('rb_custname'),
+                    rb_currency = viewModel.get('rb_currency');
                     if(!rb_custname) {
                         saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">客户名称</span>】');
                         return false;
                     }
+                    if(!rb_currency) {
+                        saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">币别</span>】');
+                        return false;
+                    }
+                    Ext.apply(f, {
+                        defaultCondition: "bk_currency ='"+rb_currency+"'"
+                    });
                 },
                 beforetriggerclick: function(f) {
                     var me = this,
                     viewModel = me.getViewModel(),
-                    rb_custname = viewModel.get('rb_custname');
+                    rb_custname = viewModel.get('rb_custname'),
+                    rb_currency = viewModel.get('rb_currency');
                     if(!rb_custname) {
                         saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">客户名称</span>】');
                         return false;
                     }
+                    if(!rb_currency) {
+                        saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">币别</span>】');
+                        return false;
+                    }
+                    Ext.apply(f, {
+                        defaultCondition: "bk_currency ='"+rb_currency+"'"
+                    });
                 }
             },
 
@@ -158,32 +107,49 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             from: 'sl_namount',
                             to: 'rbd_nowbalance'
                         }],
-                        defaultCondition: "sl_custid<>0 and ((sl_kind in ('出货单','销售退货单')) or (sl_kind='期初余额' and sl_ym="+
-                        "'(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid))) and sl_namount<>0'"
                     });
                 },
                 beforequery: function(f) {
                     var me = this,
                     viewModel = me.getViewModel(),
-                    rb_custname = viewModel.get('rb_custname');
+                    rb_custname = viewModel.get('rb_custname'),
+                    rb_currency = viewModel.get('rb_currency'),
+                    rb_custid = viewModel.get('rb_custid');
                     if(!rb_custname) {
                         saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">客户名称</span>】');
                         return false;
                     }
+                    if(!rb_currency) {
+                        saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">币别</span>】');
+                        return false;
+                    }
+                    Ext.apply(f, {
+                        defaultCondition: "sl_custid = "+rb_custid+" and sl_currency ='"+rb_currency+"' AND sl_custid <> 0 AND (  sl_kind IN ( '出货单', '销售退货单' ) OR ( sl_kind = '期初余额' AND sl_ym = (select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) ) "+
+                        ") and sl_namount<>0 "
+                    });
                 },
                 beforetriggerclick: function(f) {
                     var me = this,
                     viewModel = me.getViewModel(),
-                    rb_custname = viewModel.get('rb_custname');
+                    rb_custname = viewModel.get('rb_custname'),
+                    rb_currency = viewModel.get('rb_currency'),
+                    rb_custid = viewModel.get('rb_custid');
                     if(!rb_custname) {
                         saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">客户名称</span>】');
                         return false;
                     }
+                    if(!rb_currency) {
+                        saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">币别</span>】');
+                        return false;
+                    }
+                    Ext.apply(f, {
+                        defaultCondition: "sl_custid = "+rb_custid+" and sl_currency ='"+rb_currency+"' AND sl_custid <> 0 AND (  sl_kind IN ( '出货单', '销售退货单' ) OR ( sl_kind = '期初余额' AND sl_ym = (select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) ) "+
+                        ") and sl_namount<>0 "
+                    });
                 }
             },
         });
     },
-
     turnIn: function() {
         var me = this,
         form = me.getView(),
@@ -244,14 +210,17 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
     },
     custnamechange:function(dbfindtrigger){
         var me = this,
-            viewModel = me.getViewModel();
-
-        var c = viewModel.get('rb_custname_change');
+            viewModel = me.getViewModel(),
+            c = viewModel.get('rb_custname_change'),
+            rb_currency = viewModel.get('rb_currency');
         if(c!=null&&c!=''){
             c = ' and sl_custid='+c;
         }else{
             c ='';
         }
+        if(rb_currency!=null&&rb_currency!='') {
+            c = ' and sl_currency='+rb_currency+"'";
+        }
         dbfindtrigger.defaultCondition="((sl_kind in ('出货单','销售退货单')) or (sl_kind='期初余额' and sl_ym="+
         "(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid))) and sl_namount<>0 " + c
 

+ 95 - 74
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -48,7 +48,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 items = FormUtil.initItems(items);
                 items = FormUtil.applyCusMainItemConfig(items, cfg);
                 items = FormUtil.applyCusDetailItemConfig(items, cfg);
-                
+
                 me.configItems = items;
 
                 items = FormUtil.applyDefaultItems(me, items);
@@ -180,11 +180,11 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         xtype: 'numbercolumn',
                         dataIndex: "vd_amount",
                         width: 110,
-                        renderer: function(v, m, r) {
+                        renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         },
                         summaryType: 'sum',
-                        summaryRenderer: function(v, d, f, m) {
+                        summaryRenderer: function (v, d, f, m) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         }
                     }, {
@@ -193,11 +193,11 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         dataIndex: "sl_yamount",
                         width: 120,
                         ignore: true,
-                        renderer: function(v, m, r) {
+                        renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         },
                         summaryType: 'sum',
-                        summaryRenderer: function(v, d, f, m) {
+                        summaryRenderer: function (v, d, f, m) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         }
                     }, {
@@ -206,11 +206,11 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         dataIndex: "sl_namount",
                         width: 120,
                         ignore: true,
-                        renderer: function(v, m, r) {
+                        renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         },
                         summaryType: 'sum',
-                        summaryRenderer: function(v, d, f, m) {
+                        summaryRenderer: function (v, d, f, m) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         }
                     }, {
@@ -223,11 +223,11 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             decimalPrecision: 2
                         },
                         allowBlank: false,
-                        renderer: function(v, m, r) {
+                        renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         },
                         summaryType: 'sum',
-                        summaryRenderer: function(v, d, f, m) {
+                        summaryRenderer: function (v, d, f, m) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         }
                     }, {
@@ -324,11 +324,11 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         xtype: 'numbercolumn',
                         dataIndex: "vcd_amount",
                         width: 110,
-                        renderer: function(v, m, r) {
+                        renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         },
                         summaryType: 'sum',
-                        summaryRenderer: function(v, d, f, m) {
+                        summaryRenderer: function (v, d, f, m) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         }
                     }, {
@@ -337,11 +337,11 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         dataIndex: "sl_yamount",
                         width: 120,
                         ignore: true,
-                        renderer: function(v, m, r) {
+                        renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         },
                         summaryType: 'sum',
-                        summaryRenderer: function(v, d, f, m) {
+                        summaryRenderer: function (v, d, f, m) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         }
                     }, {
@@ -350,11 +350,11 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         dataIndex: "sl_namount",
                         width: 120,
                         ignore: true,
-                        renderer: function(v, m, r) {
+                        renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         },
                         summaryType: 'sum',
-                        summaryRenderer: function(v, d, f, m) {
+                        summaryRenderer: function (v, d, f, m) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         }
                     }, {
@@ -367,11 +367,11 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             xtype: "numberfield",
                             decimalPrecision: 2
                         },
-                        renderer: function(v, m, r) {
+                        renderer: function (v, m, r) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         },
                         summaryType: 'sum',
-                        summaryRenderer: function(v, d, f, m) {
+                        summaryRenderer: function (v, d, f, m) {
                             return saas.util.BaseUtil.numberFormat(v, 2, true);
                         }
                     }, {
@@ -531,13 +531,14 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         allowBlank: false,
                         dbType: 'currencyDbfindTrigger',
                         dbfinds: [{
-                            from: 'cr_name', to: 'vc_currency'
+                            from: 'cr_name',
+                            to: 'vc_currency'
                         }, {
-                            from: 'cr_rate', to: 'vc_rate'
+                            from: 'cr_rate',
+                            to: 'vc_rate'
                         }],
-                        // defaultValue: {
-                        //     vc_currency: 'RMB',
-                        //     vc_rate: 1
+                        // listeners: {
+                        //     change: 'clearDetails'
                         // },
                         supFieldConfig: {
                             xtype: 'numberfield',
@@ -546,7 +547,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             decimalPrecision: 6,
                             vtype: 'positiveNumber'
                         },
-                    },{
+                    }, {
                         xtype: 'hidden',
                         name: 'vc_amount1',
                         thousandSeparator: ',',
@@ -586,19 +587,20 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         defaultValue: new Date(),
                         allowBlank: false,
                         name: 'vc_date'
-                    },  {
+                    }, {
                         xtype: 'condbfindtrigger',
                         fieldLabel: '币别汇率',
                         allowBlank: false,
                         dbType: 'currencyDbfindTrigger',
                         dbfinds: [{
-                            from: 'cr_name', to: 'vc_currency'
+                            from: 'cr_name',
+                            to: 'vc_currency'
                         }, {
-                            from: 'cr_rate', to: 'vc_rate'
+                            from: 'cr_rate',
+                            to: 'vc_rate'
                         }],
-                        // defaultValue: {
-                        //     vc_currency: 'RMB',
-                        //     vc_rate: 1
+                        // listeners: {
+                        //     change: 'clearDetails'
                         // },
                         supFieldConfig: {
                             xtype: 'numberfield',
@@ -607,7 +609,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             decimalPrecision: 6,
                             vtype: 'positiveNumber'
                         },
-                    },{
+                    }, {
                         xtype: 'hidden',
                         name: 'vc_amount1',
                         thousandSeparator: ',',
@@ -641,7 +643,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         fieldLabel: '客户名称',
                         xtype: 'customerDbfindTrigger',
                         name: 'vc_custname',
-                        allowBlank: false,
+                        allowBlank: false
                     }, {
                         xtype: 'hidden',
                         name: 'vc_vendid',
@@ -657,7 +659,18 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         xtype: "vendorDbfindTrigger",
                         name: "vc_vendname",
                         fieldLabel: "供应商名称",
-                        allowBlank: false
+                        allowBlank: false,
+                        dbfinds: [{
+                            from: 'id',
+                            to: 'vc_vendid',
+                            ignore: true
+                        }, {
+                            from: 've_code',
+                            to: 'vc_vendcode'
+                        }, {
+                            from: 've_name',
+                            to: 'vc_vendname'
+                        }],
                     }, {
                         fieldLabel: '日期',
                         xtype: 'datefield',
@@ -665,27 +678,28 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         allowBlank: false,
                         name: 'vc_date'
                     }, {
-                            xtype: 'condbfindtrigger',
-                            fieldLabel: '币别汇率',
-                            allowBlank: false,
-                            dbType: 'currencyDbfindTrigger',
-                            dbfinds: [{
-                                from: 'cr_name', to: 'vc_currency'
-                            }, {
-                                from: 'cr_rate', to: 'vc_rate'
-                            }],
-                            // defaultValue: {
-                            //     vc_currency: 'RMB',
-                            //     vc_rate: 1
-                            // },
-                            supFieldConfig: {
-                                xtype: 'numberfield',
-                                readOnly: false,
-                                defaultReadOnly: false,
-                                decimalPrecision: 6,
-                                vtype: 'positiveNumber'
-                            },
-                        },{
+                        xtype: 'condbfindtrigger',
+                        fieldLabel: '币别汇率',
+                        allowBlank: false,
+                        dbType: 'currencyDbfindTrigger',
+                        dbfinds: [{
+                            from: 'cr_name',
+                            to: 'vc_currency'
+                        }, {
+                            from: 'cr_rate',
+                            to: 'vc_rate'
+                        }],
+                        // listeners: {
+                        //     change: 'clearDetails'
+                        // },
+                        supFieldConfig: {
+                            xtype: 'numberfield',
+                            readOnly: false,
+                            defaultReadOnly: false,
+                            decimalPrecision: 6,
+                            vtype: 'positiveNumber'
+                        },
+                    }, {
                         xtype: 'hidden',
                         name: 'vc_amount1',
                         thousandSeparator: ',',
@@ -741,19 +755,20 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         defaultValue: new Date(),
                         allowBlank: false,
                         name: 'vc_date'
-                    },  {
+                    }, {
                         xtype: 'condbfindtrigger',
                         fieldLabel: '币别汇率',
                         allowBlank: false,
                         dbType: 'currencyDbfindTrigger',
                         dbfinds: [{
-                            from: 'cr_name', to: 'vc_currency'
+                            from: 'cr_name',
+                            to: 'vc_currency'
                         }, {
-                            from: 'cr_rate', to: 'vc_rate'
+                            from: 'cr_rate',
+                            to: 'vc_rate'
                         }],
-                        // defaultValue: {
-                        //     vc_currency: 'RMB',
-                        //     vc_rate: 1
+                        // listeners: {
+                        //     change: 'clearDetails'
                         // },
                         supFieldConfig: {
                             xtype: 'numberfield',
@@ -762,7 +777,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             decimalPrecision: 6,
                             vtype: 'positiveNumber'
                         },
-                    },{
+                    }, {
                         xtype: 'hidden',
                         name: 'vc_amount1',
                         thousandSeparator: ',',
@@ -818,19 +833,20 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         defaultValue: new Date(),
                         allowBlank: false,
                         name: 'vc_date'
-                    },  {
+                    }, {
                         xtype: 'condbfindtrigger',
                         fieldLabel: '币别汇率',
                         allowBlank: false,
                         dbType: 'currencyDbfindTrigger',
                         dbfinds: [{
-                            from: 'cr_name', to: 'vc_currency'
+                            from: 'cr_name',
+                            to: 'vc_currency'
                         }, {
-                            from: 'cr_rate', to: 'vc_rate'
+                            from: 'cr_rate',
+                            to: 'vc_rate'
                         }],
-                        // defaultValue: {
-                        //     vc_currency: 'RMB',
-                        //     vc_rate: 1
+                        // listeners: {
+                        //     change: 'clearDetails'
                         // },
                         supFieldConfig: {
                             xtype: 'numberfield',
@@ -839,7 +855,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             decimalPrecision: 6,
                             vtype: 'positiveNumber'
                         },
-                    },{
+                    }, {
                         xtype: 'hidden',
                         name: 'vc_amount1',
                         thousandSeparator: ',',
@@ -855,32 +871,37 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 },
 
                 defaultConditions: {
-                    receipts_offset_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+                    receipts_offset_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
                         ' and ((sl_kind=\'收款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
                         '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
-                        'ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+
+
+                        'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
                         ' and (sl_kind in (\'出货单\',\'销售退货单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
                         '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
                     ],
-                    prepaid_offset_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+                    prepaid_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
                         ' and ((sl_kind=\'付款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
                         '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
+
+
                         'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
                         ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
                         '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
                     ],
-                    receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+                    receivable_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
                         ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
                         '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
-                        'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+
+                        'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
                         ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
                         '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
                     ],
-                    receivable_to_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+                    receivable_to_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
                         ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
                         '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
                     ],
-                    payable_to_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+                    payable_to_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
                         ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
                         '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
                     ]

+ 34 - 257
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -9,72 +9,6 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             'dbfindtrigger[name=vc_custname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dbColumns: [{
-                            conditionCode: 'id',
-                            text: "客户ID",
-                            dataIndex: "id",
-                            hidden:true,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_code',
-                            text: "客户编号",
-                            dataIndex: "cu_code",
-                            width: 150,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_name',
-                            text: "客户名称",
-                            dataIndex: "cu_name",
-                            width: 200,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_type',
-                            text: "客户类型",
-                            dataIndex: "cu_type",
-                            width: 110,
-                            xtype: "",
-                        }, {
-                            text: "业务员编号",
-                            dataIndex: "cu_sellercode",
-                            width:110
-                        }, {
-                            text: "业务员",
-                            dataIndex: "cu_sellername",
-                            width:110
-                        }, {
-                            text: "税率(%)",
-                            dataIndex: "cu_taxrate",
-                            xtype: 'numbercolumn',
-                            width:80,
-                            renderer: function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, false);
-                            }
-                        },{
-                            text: "应收款余额",
-                            dataIndex: "cu_leftamount",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, true);
-                            }
-                        }, {
-                            text: "结算天数",
-                            dataIndex: "cu_promisedays",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer: function(v, m, r) {
-                                return Ext.util.Format.number(v, '0');
-                            }
-                        }, {
-                            text: "额度",
-                            dataIndex: "cu_credit",
-                            width:110,
-                            xtype: 'numbercolumn',
-                        }, {
-                            text: "客户地址",
-                            dataIndex: "ca_address",
-                            width: 250
-                        }],
                         //赋值 
                         dbfinds:[{
                             from: 'id', to: 'vc_custid',ignore:true
@@ -86,7 +20,7 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                             from:'cu_currency',to:'vc_currency'
                         },{
                             from:'cr_rate',to:'vc_rate'
-                        }
+                        } 
                         ],
                     }) ;   
 
@@ -96,72 +30,6 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             'dbfindtrigger[name=vc_turncustname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dbColumns: [{
-                            conditionCode: 'id',
-                            text: "客户ID",
-                            dataIndex: "id",
-                            hidden:true,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_code',
-                            text: "客户编号",
-                            dataIndex: "cu_code",
-                            width: 150,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_name',
-                            text: "客户名称",
-                            dataIndex: "cu_name",
-                            width: 200,
-                            xtype: "",
-                        }, {
-                            conditionCode: 'cu_type',
-                            text: "客户类型",
-                            dataIndex: "cu_type",
-                            width: 110,
-                            xtype: "",
-                        }, {
-                            text: "业务员编号",
-                            dataIndex: "cu_sellercode",
-                            width:110
-                        }, {
-                            text: "业务员",
-                            dataIndex: "cu_sellername",
-                            width:110
-                        }, {
-                            text: "税率(%)",
-                            dataIndex: "cu_taxrate",
-                            xtype: 'numbercolumn',
-                            width:80,
-                            renderer: function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, false);
-                            }
-                        },{
-                            text: "应收款余额",
-                            dataIndex: "cu_leftamount",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, true);
-                            }
-                        }, {
-                            text: "结算天数",
-                            dataIndex: "cu_promisedays",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer: function(v, m, r) {
-                                return Ext.util.Format.number(v, '0');
-                            }
-                        }, {
-                            text: "额度",
-                            dataIndex: "cu_credit",
-                            width:110,
-                            xtype: 'numbercolumn',
-                        }, {
-                            text: "客户地址",
-                            dataIndex: "ca_address",
-                            width: 250
-                        }],
                         //赋值 
                         dbfinds:[{
                             from: 'id', to: 'vc_turncustid',ignore:true
@@ -178,62 +46,6 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             'dbfindtrigger[name=vc_vendname]':{
                 beforerender: function (f) {
                     Ext.apply(f, {
-                        dbColumns:[{
-                            text: "供应商ID",
-                            hidden: true,
-                            dataIndex: "id",
-                            xtype: "numbercolumn"
-                        },{
-                            text: "供应商编号",
-                            dataIndex: "ve_code",
-                            width: 150
-                        }, {
-                            text: "供应商名称",
-                            dataIndex: "ve_name",
-                            width: 200
-                        }, {
-                            text: "供应商类型",
-                            dataIndex: "ve_type",
-                            width: 110,
-                        }, {
-                            text: "税率(%)",
-                            dataIndex: "ve_taxrate",
-                            width: 80,
-                            xtype: 'numbercolumn',
-                            align:'end',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, false);
-                            }
-                        }, {
-                            text: "应付款余额",
-                            dataIndex: "ve_leftamount",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, true);
-                            }
-                        },{
-                            text: "结算天数",
-                            dataIndex: "ve_promisedays",
-                            width: 110,
-                            xtype: 'numbercolumn',
-                            align: 'end',
-                            renderer : function(v, m, r) {
-                                return Ext.util.Format.number(v, '0');
-                            }
-                        }, {
-                            text: "纳税人识别号",
-                            dataIndex: "ve_nsrzh",
-                            width: 150
-                        }, {
-                            text: "开户银行",
-                            dataIndex: "ve_bankcode",
-                            width: 150
-                        }, {
-                            text: "银行账户",
-                            dataIndex: "ve_bankaccount",
-                            width: 200
-                        }],
                         dbfinds: [{
                             from: 'id',
                             to: 'vc_vendid',
@@ -245,7 +57,7 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                             from: 've_name',
                             to: 'vc_vendname'
                         },{
-                            from:'cu_currency',to:'vc_currency'
+                            from:'ve_currency',to:'vc_currency'
                         },{
                             from:'cr_rate',to:'vc_rate'
                         }
@@ -258,62 +70,6 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             'dbfindtrigger[name=vc_turnvendname]':{
                 beforerender: function (f) {
                     Ext.apply(f, {
-                        dbColumns:[{
-                            text: "供应商ID",
-                            hidden: true,
-                            dataIndex: "id",
-                            xtype: "numbercolumn"
-                        },{
-                            text: "供应商编号",
-                            dataIndex: "ve_code",
-                            width: 150
-                        }, {
-                            text: "供应商名称",
-                            dataIndex: "ve_name",
-                            width: 200
-                        }, {
-                            text: "供应商类型",
-                            dataIndex: "ve_type",
-                            width: 110,
-                        }, {
-                            text: "税率(%)",
-                            dataIndex: "ve_taxrate",
-                            width: 80,
-                            xtype: 'numbercolumn',
-                            align:'end',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, false);
-                            }
-                        }, {
-                            text: "应付款余额",
-                            dataIndex: "ve_leftamount",
-                            width:110,
-                            xtype: 'numbercolumn',
-                            renderer : function(v, m, r) {
-                                return saas.util.BaseUtil.numberFormat(v, 2, true);
-                            }
-                        },{
-                            text: "结算天数",
-                            dataIndex: "ve_promisedays",
-                            width: 110,
-                            xtype: 'numbercolumn',
-                            align: 'end',
-                            renderer : function(v, m, r) {
-                                return Ext.util.Format.number(v, '0');
-                            }
-                        }, {
-                            text: "纳税人识别号",
-                            dataIndex: "ve_nsrzh",
-                            width: 150
-                        }, {
-                            text: "开户银行",
-                            dataIndex: "ve_bankcode",
-                            width: 150
-                        }, {
-                            text: "银行账户",
-                            dataIndex: "ve_bankaccount",
-                            width: 200
-                        }],
                         dbfinds: [{
                             from: 'id',
                             to: 'vc_turnvendid',
@@ -444,19 +200,40 @@ Ext.define('saas.view.money.verification.FormPanelController', {
         defaultConditions = etc.defaultConditions,
         defaultConditionMode = defaultConditions[acitveType][idx];
 
-        var reg = /(.*){(.*)}(.*)/g;
-        var fieldName = defaultConditionMode.match(/(.*){(.*)}(.*)/)[2];
-        var fieldLabel = Ext.Array.findBy(formItems, function(f) {
-            return f.name == fieldName;
-        }).fieldLabel;
-        var fieldValue = viewModel.get(fieldName);
-        if(!fieldValue) {
-            saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">' + fieldLabel + '</span>】');
+
+        var reg = /{.+?}/g;
+        var arr = defaultConditionMode.match(reg) || [];
+        var fields = {};
+        var nullFields = [];
+        var defaultCondition = defaultConditionMode;
+
+        // TODO arr未去重
+
+        arr.map(function(a) {
+            var fieldName = a.replace(/[{|}]/g, '');
+            var field = Ext.Array.findBy(formItems, function(f) {
+                return f.name == fieldName;
+            });
+            var fieldLabel = field.fieldLabel || field.name;
+            var fieldValue = viewModel.get(fieldName);
+            fields[fieldName] = fieldValue;
+            
+            if(!fieldValue && nullFields.indexOf(fieldLabel) == -1) {
+                nullFields.push(fieldLabel);
+            }
+        });
+
+        if(nullFields.length == 0) {
+            var keys = Ext.Object.getAllKeys(fields);
+            keys.map(function(k) {
+                var v = fields[k];
+                defaultCondition = defaultCondition.replace(new RegExp('{' + k + '}', 'g'), v);
+            });
+            return defaultCondition;
+        }else {
+            saas.util.BaseUtil.showErrorToast('请先选择【' + '<span style="color: red;">' + nullFields.join(',') + '</span>】');
             return null;
         }
-        var defaultCondition = defaultConditionMode.replace(reg, '$1' + fieldValue + '$3');
-
-        return defaultCondition;
     },
 
     /**

+ 23 - 34
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -43,6 +43,29 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 name: "pu_vendname",
                 fieldLabel: "供应商名称",
                 allowBlank: false,
+                columnWidth: 0.5
+            }, {
+                xtype: 'condbfindtrigger',
+                fieldLabel: '币别汇率',
+                allowBlank: false,
+                dbType: 'currencyDbfindTrigger',
+                dbfinds: [{
+                    from: 'cr_name', to: 'pu_currency'
+                }, {
+                    from: 'cr_rate', to: 'pu_rate'
+                }],
+                defaultValue: {
+                    pu_currency: 'RMB',
+                    pu_rate: 1
+                },
+                supFieldConfig: {
+                    xtype: 'numberfield',
+                    readOnly: false,
+                    defaultReadOnly: false,
+                    defaultValue: 1,
+                    decimalPrecision: 6,
+                    vtype: 'positiveNumber'
+                }
             }, {
                 xtype: "datefield",
                 name: "pu_delivery",
@@ -73,40 +96,6 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     });
                     this.dialog.show();
                 }
-            }, {
-                xtype: 'condbfindtrigger',
-                fieldLabel: '币别汇率',
-                allowBlank: false,
-                dbType: 'currencyDbfindTrigger',
-                dbfinds: [{
-                    from: 'cr_name', to: 'pu_currency'
-                }, {
-                    from: 'cr_rate', to: 'pu_rate'
-                }],
-                defaultValue: {
-                    pu_currency: 'RMB',
-                    pu_rate: 1
-                },
-                supFieldConfig: {
-                    xtype: 'numberfield',
-                    readOnly: false,
-                    defaultReadOnly: false,
-                    defaultValue: 1,
-                    decimalPrecision: 6,
-                    vtype: 'positiveNumber'
-                }
-            // }, {
-            //     xtype: "currencyDbfindTrigger",
-            //     name: "pu_currency",
-            //     fieldLabel: "币别",
-            //     defaultValue: 'RMB'
-            // }, {
-            //     xtype: "numberfield",
-            //     name: "pu_rate",
-            //     fieldLabel: "汇率",
-            //     defaultValue: 1,
-            //     decimalPrecision: 6,
-            //     vtype: 'positiveNumber'
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 4 - 0
frontend/saas-web/app/view/purchase/purchase/FormPanelController.js

@@ -21,6 +21,10 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             from:'ve_buyercode',to:'pu_buyercode'
                         },{
                             from:'ve_buyername',to:'pu_buyername'
+                        },{
+                            from:'ve_currency',to:'pu_currency'
+                        },{
+                            from:'cr_rate',to:'pu_rate'
                         }],
                     }) ; 
                 }

+ 13 - 0
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -252,6 +252,19 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
                     renderer: function(v, m, r) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
+                }, {
+                    text: '币别',
+                    dataIndex: 'pu_currency',
+                    align: 'center',
+                    width: 65
+                }, {
+                    text: "汇率",
+                    dataIndex: "pu_rate",
+                    xtype: 'numbercolumn',
+                    width: 80,
+                    renderer: function(v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 6, false);
+                    }
                 }, {
                     text: '关联销售单号',
                     dataIndex: 'pd_salecode',

+ 8 - 19
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -64,13 +64,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 name: 'pi_vendname',
                 fieldLabel: '供应商名称',
                 allowBlank: false,
-            }, {
-                xtype: "datefield",
-                name: "pi_date",
-                fieldLabel: "单据日期",
-                allowBlank: false,
-                columnWidth: 0.25,
-                defaultValue: new Date()
+                columnWidth: 0.5
             }, {
                 xtype: 'condbfindtrigger',
                 fieldLabel: '币别汇率',
@@ -93,18 +87,13 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                     decimalPrecision: 6,
                     vtype: 'positiveNumber'
                 },
-            // }, {
-            //     xtype: "currencyDbfindTrigger",
-            //     name: "pi_currency",
-            //     fieldLabel: "币别",
-            //     defaultValue: 'RMB'
-            // }, {
-            //     xtype: "numberfield",
-            //     name: "pi_rate",
-            //     fieldLabel: "汇率",
-            //     defaultValue: 1,
-            //     decimalPrecision: 6,
-            //     vtype: 'positiveNumber'
+            }, {
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
             },{
                 xtype: "hidden",
                 name: "pi_puid",

+ 4 - 0
frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js

@@ -27,6 +27,10 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
                             from:'ve_buyercode',to:'pi_buyercode'
                         },{
                             from:'ve_buyername',to:'pi_buyername'
+                        },{
+                            from:'ve_currency',to:'pi_currency'
+                        },{
+                            from:'cr_rate',to:'pi_rate'
                         }],
                     }) ;   
 

+ 13 - 0
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -263,6 +263,19 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
                     renderer: function(v, m, r) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
+                }, {
+                    text: '币别',
+                    dataIndex: 'pi_currency',
+                    align: 'center',
+                    width: 65
+                }, {
+                    text: "汇率",
+                    dataIndex: "pi_rate",
+                    xtype: 'numbercolumn',
+                    width: 80,
+                    renderer: function(v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 6, false);
+                    }
                 }, {
                     text: '关联采购单号',
                     dataIndex: 'pi_pucode',

+ 8 - 19
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -60,13 +60,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 name: 'pi_vendname',
                 fieldLabel: '供应商名称',
                 allowBlank: false,
-            }, {
-                xtype: "datefield",
-                name: "pi_date",
-                fieldLabel: "单据日期",
-                allowBlank: false,
-                columnWidth: 0.25,
-                defaultValue: new Date()
+                columnWidth: 0.5
             }, {
                 xtype: 'condbfindtrigger',
                 fieldLabel: '币别汇率',
@@ -89,18 +83,13 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                     decimalPrecision: 6,
                     vtype: 'positiveNumber'
                 }
-            // }, {
-            //     xtype: "currencyDbfindTrigger",
-            //     name: "pi_currency",
-            //     fieldLabel: "币别",
-            //     defaultValue: 'RMB'
-            // }, {
-            //     xtype: "numberfield",
-            //     name: "pi_rate",
-            //     fieldLabel: "汇率",
-            //     defaultValue: 1,
-            //     decimalPrecision: 6,
-            //     vtype: 'positiveNumber'
+            }, {
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
             }, {
                 xtype: "hidden",
                 name: "pi_puid",

+ 4 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js

@@ -27,6 +27,10 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                             from:'ve_buyercode',to:'pi_buyercode'
                         },{
                             from:'ve_buyername',to:'pi_buyername'
+                        },{
+                            from:'ve_currency',to:'pi_currency'
+                        },{
+                            from:'cr_rate',to:'pi_rate'
                         }],
                     }) ;   
 

+ 13 - 0
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -268,6 +268,19 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
                     renderer: function(v, m, r) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     },
+                }, {
+                    text: '币别',
+                    dataIndex: 'pi_currency',
+                    align: 'center',
+                    width: 65
+                }, {
+                    text: "汇率",
+                    dataIndex: "pi_rate",
+                    xtype: 'numbercolumn',
+                    width: 80,
+                    renderer: function(v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 6, false);
+                    }
                 }, {
                     text: '关联验收单号',
                     dataIndex: 'pi_iocode',

+ 17 - 28
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -44,6 +44,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 name: "sa_custname",
                 fieldLabel: "客户名称",
                 allowBlank: false,
+                columnWidth: 0.5,
                 setValue: function (value) {
                     var me = this,
                         bind, valueBind;
@@ -79,22 +80,6 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     }
                     return me;
                 }
-            }, {
-                xtype: "datefield",
-                name: "sa_delivery",
-                fieldLabel: "交货日期",
-                allowBlank: false,
-                defaultValue: new Date(),
-                columnWidth: 0.25,
-            }, {
-                name: "sa_toplace",
-                xtype: "remotecombo",
-                fieldLabel: "交货地址",
-                editable: false,
-                allowBlank: false,
-                columnWidth: 0.5,
-                storeUrl: '/api/document/customer/getAddressCombo',
-                hiddenBtn: true, //true 则会关闭新增按钮功能
             }, {
                 xtype: 'condbfindtrigger',
                 fieldLabel: '币别汇率',
@@ -117,18 +102,22 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                     decimalPrecision: 6,
                     vtype: 'positiveNumber'
                 }
-            // }, {
-            //     xtype: "currencyDbfindTrigger",
-            //     name: "sa_currency",
-            //     fieldLabel: "币别",
-            //     defaultValue: 'RMB'
-            // }, {
-            //     xtype: "numberfield",
-            //     name: "sa_rate",
-            //     fieldLabel: "汇率",
-            //     defaultValue: 1,
-            //     decimalPrecision: 6,
-            //     vtype: 'positiveNumber'
+            }, {
+                xtype: "datefield",
+                name: "sa_delivery",
+                fieldLabel: "交货日期",
+                allowBlank: false,
+                defaultValue: new Date(),
+                columnWidth: 0.25,
+            }, {
+                name: "sa_toplace",
+                xtype: "remotecombo",
+                fieldLabel: "交货地址",
+                editable: false,
+                allowBlank: false,
+                columnWidth: 0.5,
+                storeUrl: '/api/document/customer/getAddressCombo',
+                hiddenBtn: true, //true 则会关闭新增按钮功能
             },{
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 2 - 2
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -5,7 +5,7 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
         var me = this;
         this.control({
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=sa_custname]': {
+            'customerDbfindTrigger[name=sa_custname]': {
                 beforerender: function (f) {
                     Ext.apply(f, {
                         dbfinds: [{
@@ -30,7 +30,7 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                         }, {
                             from:'cu_sellerid',to:'cu_sellerid'
                         },{
-                            from:'cu_currency',to:'sa_currency'
+                            from:'cu_currency',to:'sa_currency' 
                         },{
                             from:'cr_rate',to:'sa_rate'
                         }

+ 13 - 0
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -260,6 +260,19 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
                     renderer : function(v, m, r) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
+                }, {
+                    text: '币别',
+                    dataIndex: 'sa_currency',
+                    align:'center',
+                    width: 65
+                }, {
+                    text: '汇率',
+                    dataIndex: 'sa_rate',
+                    xtype: 'numbercolumn',
+                    width: 80,
+                    renderer: function(v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 6, false);
+                    }
                 }, {
                     text: '备注',
                     dataIndex: 'sd_remark',

+ 17 - 28
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -52,6 +52,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 name: "pi_custname",
                 fieldLabel: "客户名称",
                 allowBlank: false,
+                columnWidth: 0.5,
                 setValue: function (value) {
                     var me = this,
                         bind, valueBind;
@@ -87,22 +88,6 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     }
                     return me;
                 }
-            }, {
-                xtype: "datefield",
-                name: "pi_date",
-                fieldLabel: "单据日期",
-                allowBlank: false,
-                columnWidth: 0.25,
-                defaultValue: new Date()
-            }, {
-                columnWidth: 0.5,
-                name: "pi_address",
-                xtype: "remotecombo",
-                fieldLabel: "交货地址",
-                editable: false,
-                allowBlank: false,
-                storeUrl: '/api/document/customer/getAddressCombo',
-                hiddenBtn: true, //true 则会关闭新增按钮功能
             }, {
                 xtype: 'condbfindtrigger',
                 fieldLabel: '币别汇率',
@@ -125,18 +110,22 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                     decimalPrecision: 6,
                     vtype: 'positiveNumber'
                 }
-            // }, {
-            //     xtype: "currencyDbfindTrigger",
-            //     name: "pi_currency",
-            //     fieldLabel: "币别",
-            //     defaultValue: 'RMB'
-            // }, {
-            //     xtype: "numberfield",
-            //     name: "pi_rate",
-            //     fieldLabel: "汇率",
-            //     defaultValue: 1,
-            //     decimalPrecision: 6,
-            //     vtype: 'positiveNumber'
+            }, {
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
+            }, {
+                columnWidth: 0.5,
+                name: "pi_address",
+                xtype: "remotecombo",
+                fieldLabel: "交货地址",
+                editable: false,
+                allowBlank: false,
+                storeUrl: '/api/document/customer/getAddressCombo',
+                hiddenBtn: true, //true 则会关闭新增按钮功能
             },{
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 13 - 0
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -262,6 +262,19 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
                     renderer: function(v, m, r) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
+                }, {
+                    text: '币别',
+                    dataIndex: 'pi_currency',
+                    align:'center',
+                    width: 65
+                }, {
+                    text: '汇率',
+                    dataIndex: 'pi_rate',
+                    xtype: 'numbercolumn',
+                    width: 80,
+                    renderer: function(v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 6, false);
+                    }
                 }, {
                     text: '关联出货单号',
                     dataIndex: 'pi_iocode',

+ 17 - 16
frontend/saas-web/app/view/sale/saleOut/FormPanel.js

@@ -61,6 +61,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 name: "pi_custname",
                 fieldLabel: "客户名称",
                 allowBlank: false,
+                columnWidth: 0.5,
                 setValue: function (value) {
                     var me = this,
                         bind, valueBind;
@@ -96,22 +97,6 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                     }
                     return me;
                 }
-            }, {
-                xtype: "datefield",
-                name: "pi_date",
-                fieldLabel: "单据日期",
-                allowBlank: false,
-                columnWidth: 0.25,
-                defaultValue: new Date()
-            }, {
-                columnWidth: 0.5,
-                name: "pi_address",
-                xtype: "remotecombo",
-                fieldLabel: "交货地址",
-                editable: false,
-                allowBlank: false,
-                storeUrl: '/api/document/customer/getAddressCombo',
-                hiddenBtn: true, //true 则会关闭新增按钮功能
             }, {
                 xtype: 'condbfindtrigger',
                 fieldLabel: '币别汇率',
@@ -134,6 +119,22 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                     decimalPrecision: 6,
                     vtype: 'positiveNumber'
                 }
+            }, {
+                xtype: "datefield",
+                name: "pi_date",
+                fieldLabel: "单据日期",
+                allowBlank: false,
+                columnWidth: 0.25,
+                defaultValue: new Date()
+            }, {
+                columnWidth: 0.5,
+                name: "pi_address",
+                xtype: "remotecombo",
+                fieldLabel: "交货地址",
+                editable: false,
+                allowBlank: false,
+                storeUrl: '/api/document/customer/getAddressCombo',
+                hiddenBtn: true, //true 则会关闭新增按钮功能
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 13 - 0
frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

@@ -262,6 +262,19 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
                     renderer: function(v, m, r) {
                         return saas.util.BaseUtil.numberFormat(v, 2, true);
                     }
+                }, {
+                    text: '币别',
+                    dataIndex: 'pi_currency',
+                    align: 'center',
+                    width: 65
+                }, {
+                    text: "汇率",
+                    dataIndex: "pi_rate",
+                    xtype: 'numbercolumn',
+                    width: 80,
+                    renderer: function(v, m, r) {
+                        return saas.util.BaseUtil.numberFormat(v, 6, false);
+                    }
                 }, {
                     text: '关联销售单号',
                     dataIndex: 'pd_ordercode',