Browse Source

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

hy 7 years ago
parent
commit
23af78009a
73 changed files with 810 additions and 451 deletions
  1. 1 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 5 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/CustomerList.java
  3. 6 2
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java
  4. 3 0
      applications/document/document-server/src/main/resources/config/application-dev.yml
  5. 5 1
      applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml
  6. 4 1
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  7. 12 110
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/AccountDetailsView.java
  8. 8 110
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java
  9. 9 110
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java
  10. 2 0
      applications/money/money-server/src/main/resources/mapper/AccountDetailsViewMapper.xml
  11. 2 1
      applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml
  12. 1 1
      applications/money/money-server/src/main/resources/mapper/PayablesdetailMapper.xml
  13. 10 8
      applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml
  14. 1 1
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  15. 1 1
      applications/money/money-server/src/main/resources/mapper/ReceivablesdetailMapper.xml
  16. 2 1
      applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml
  17. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java
  18. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  19. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/report/PurchaseReportDetail.java
  20. 10 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  21. 5 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  22. 3 0
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml
  23. 4 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  24. 2 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseReportMapper.xml
  25. 4 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDTO.java
  26. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutMapper.java
  27. 4 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  28. 4 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java
  29. 7 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  30. 5 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  31. 5 0
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml
  32. 3 1
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  33. 13 0
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  34. 2 0
      applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml
  35. 4 1
      framework/core/pom.xml
  36. 222 0
      framework/core/src/main/java/com/netflix/hystrix/strategy/concurrency/HystrixContextScheduler.java
  37. 3 0
      frontend/operation-web/app/view/statistical/CompanyAnalysis.js
  38. 26 0
      frontend/operation-web/app/view/statistical/PersonRegInfo.js
  39. 21 0
      frontend/saas-web/app/model/report/PayDetail.js
  40. 4 1
      frontend/saas-web/app/model/report/Purchase.js
  41. 21 0
      frontend/saas-web/app/model/report/RecDetail.js
  42. 4 1
      frontend/saas-web/app/model/report/Sale.js
  43. 3 1
      frontend/saas-web/app/model/report/SaleProfit.js
  44. 1 0
      frontend/saas-web/app/model/report/TotalPayDetail.js
  45. 1 0
      frontend/saas-web/app/model/report/TotalRecDetail.js
  46. 1 1
      frontend/saas-web/app/view/core/dbfind/ConDbfindTrigger.js
  47. 5 4
      frontend/saas-web/app/view/core/dbfind/types/CurrencyDbfindTrigger.js
  48. 10 0
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  49. 10 0
      frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js
  50. 2 1
      frontend/saas-web/app/view/document/bankinformation/DataList.js
  51. 4 4
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  52. 4 4
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  53. 6 1
      frontend/saas-web/app/view/money/recBalance/FormPanelController.js
  54. 10 0
      frontend/saas-web/app/view/money/report/AccountDetails.js
  55. 6 3
      frontend/saas-web/app/view/money/report/PayDetail.js
  56. 9 5
      frontend/saas-web/app/view/money/report/ProfitDetail.js
  57. 6 3
      frontend/saas-web/app/view/money/report/RecDetail.js
  58. 5 0
      frontend/saas-web/app/view/money/report/TotalPayDetail.js
  59. 5 0
      frontend/saas-web/app/view/money/report/TotalRecDetail.js
  60. 37 16
      frontend/saas-web/app/view/money/verification/FormPanel.js
  61. 12 2
      frontend/saas-web/app/view/money/verification/FormPanelController.js
  62. 10 8
      frontend/saas-web/app/view/purchase/report/Purchase.js
  63. 2 1
      frontend/saas-web/app/view/purchase/report/PurchasePay.js
  64. 158 0
      frontend/saas-web/app/view/sale/business/Product.js
  65. 10 10
      frontend/saas-web/app/view/sale/report/Sale.js
  66. 9 0
      frontend/saas-web/app/view/sale/report/SaleProfit.js
  67. 2 1
      frontend/saas-web/app/view/sale/report/SaleRec.js
  68. 6 1
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  69. 4 6
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  70. 4 6
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  71. 0 12
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  72. 4 6
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  73. 6 0
      pom.xml

+ 1 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -72,6 +72,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     CUSTOMER_ISCLOSE(79507, "客户资料已关闭"),
     REQUIREDFIELD_NULL(79508,"存在必填字段为空"),
     USER_EXIST(79509, ""),
+    CURRENCY_VALID(79510, "币别与源单据不一致不允许修改"),
 
     //采购 70000-71999
     PURCCHECKIN_POST_ERROR(70000,""),

+ 5 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/CustomerList.java

@@ -62,6 +62,11 @@ public class CustomerList extends CommonBaseEntity{
     private Double cu_preamount;
 
     private String cu_remark;
+
+    private String cu_currency;
+
+    //currencys
+    private Double cr_rate;
 //customeraddress
 
     private Long ca_cuid;

+ 6 - 2
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java

@@ -106,6 +106,12 @@ public class VendorList implements Serializable {
 
     private String ve_address;
 
+    private String ve_currency;
+
+    //currencys
+
+    private Double cr_rate;
+
     /* 从表字段 */
 
     private Integer vc_veid;
@@ -132,6 +138,4 @@ public class VendorList implements Serializable {
 
     private String vc_default;
 
-    private String ve_currency;
-
 }

+ 3 - 0
applications/document/document-server/src/main/resources/config/application-dev.yml

@@ -11,3 +11,6 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+logging:
+  level:
+    com.usoftchina.saas.auth.client: DEBUG

+ 5 - 1
applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml

@@ -22,6 +22,7 @@
     <result column="cu_leftamount" jdbcType="DOUBLE" property="cu_leftamount" />
     <result column="cu_recamount" jdbcType="DOUBLE" property="cu_recamount" />
     <result column="cu_preamount" jdbcType="DOUBLE" property="cu_preamount" />
+    <result column="cu_currency" jdbcType="VARCHAR" property="cu_currency" />
     <result column="ca_cuid" jdbcType="INTEGER" property="ca_cuid" />
     <result column="ca_detno" jdbcType="INTEGER" property="ca_detno" />
     <result column="ca_person" jdbcType="VARCHAR" property="ca_person" />
@@ -38,6 +39,7 @@
     <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
     <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
     <result column="cu_remark" property="cu_remark" jdbcType="VARCHAR"/>
+    <result column="cr_rate" property="cr_rate" jdbcType="DOUBLE"/>
   </resultMap>
 
 
@@ -55,7 +57,9 @@
   </select>
 
   <select id="selectDbFind" resultMap="BaseResultMap">
-    SELECT * FROM CUSTOMER LEFT JOIN CUSTOMERADDRESS ON CU_ID=CA_CUID AND CUSTOMERADDRESS.CA_DEFAULT=1
+    SELECT * FROM CUSTOMER
+    LEFT JOIN CUSTOMERADDRESS ON CU_ID=CA_CUID AND CUSTOMERADDRESS.CA_DEFAULT=1
+    left join currencys on cr_name = cu_currency and currencys.companyid = CUSTOMER.companyid
     <where>
       <if test="condition != null">
         ${condition}

+ 4 - 1
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -99,10 +99,13 @@
         <result column="vc_text5" property="vc_text5" jdbcType="VARCHAR" />
         <result column="vc_default" property="vc_default" jdbcType="VARCHAR" />
         <result column="ve_currency" property="ve_currency" jdbcType="VARCHAR" />
+        <result column="cr_rate" property="cr_rate" jdbcType="DOUBLE" />
     </resultMap>
 
     <select id="getListDataByCondition" resultMap="VendorListResultMapper">
-        SELECT * FROM VENDOR LEFT JOIN VENDORCONTACT ON VE_ID = VC_VEID and vc_default = 1
+        SELECT * FROM VENDOR
+        LEFT JOIN VENDORCONTACT ON VE_ID = VC_VEID and vc_default = 1
+        left join currencys on cr_name = ve_currency and currencys.companyid = VENDOR.companyid
         <where>
             <if test="condition!=null">
                 ${condition}

+ 12 - 110
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/AccountDetailsView.java

@@ -1,14 +1,18 @@
 package com.usoftchina.saas.money.po;
 
-import java.util.Date;
+import lombok.Data;
 
+import java.util.Date;
+@Data
 public class AccountDetailsView {
     private String sl_code;
 
     private String sl_kind;
 
     private String ve_name;
+
     private String cu_name;
+
     private Double sl_amount;
 
     private Integer pb_id;
@@ -18,121 +22,19 @@ public class AccountDetailsView {
     private String pb_code;
 
     private Double total;
-    private Date date;
-    private Long companyId;
-    private Double sl_orderamount;
-    private Double pbd_nowbalance;
-    private Date pb_date;
-
-    public Double getPbd_nowbalance() {
-        return pbd_nowbalance;
-    }
-
-    public void setPbd_nowbalance(Double pbd_nowbalance) {
-        this.pbd_nowbalance = pbd_nowbalance;
-    }
-
-    public Date getPb_date() {
-        return pb_date;
-    }
-
-    public void setPb_date(Date pb_date) {
-        this.pb_date = pb_date;
-    }
-
-    public Double getSl_orderamount() {
-        return sl_orderamount;
-    }
-
-    public void setSl_orderamount(Double sl_orderamount) {
-        this.sl_orderamount = sl_orderamount;
-    }
-
-    public String getCu_name() {
-        return cu_name;
-    }
-
-    public void setCu_name(String cu_name) {
-        this.cu_name = cu_name;
-    }
 
-    public Long getCompanyId() {
-        return companyId;
-    }
-
-    public void setCompanyId(Long companyId) {
-        this.companyId = companyId;
-    }
-
-    public Date getDate() {
-        return date;
-    }
-
-    public void setDate(Date date) {
-        this.date = date;
-    }
-
-    public String getSl_code() {
-        return sl_code;
-    }
-
-    public void setSl_code(String sl_code) {
-        this.sl_code = sl_code;
-    }
-
-    public String getSl_kind() {
-        return sl_kind;
-    }
-
-    public void setSl_kind(String sl_kind) {
-        this.sl_kind = sl_kind;
-    }
-
-    public String getVe_name() {
-        return ve_name;
-    }
-
-    public void setVe_name(String ve_name) {
-        this.ve_name = ve_name;
-    }
-
-    public Double getSl_amount() {
-        return sl_amount;
-    }
-
-    public void setSl_amount(Double sl_amount) {
-        this.sl_amount = sl_amount;
-    }
-
-    public Integer getPb_id() {
-        return pb_id;
-    }
+    private Date date;
 
-    public void setPb_id(Integer pb_id) {
-        this.pb_id = pb_id;
-    }
+    private Long companyId;
 
-    public String getPb_kind() {
-        return pb_kind;
-    }
+    private Double sl_orderamount;
 
-    public void setPb_kind(String pb_kind) {
-        this.pb_kind = pb_kind;
-    }
+    private Double pbd_nowbalance;
 
-    public String getPb_code() {
-        return pb_code;
-    }
+    private Date pb_date;
 
-    public void setPb_code(String pb_code) {
-        this.pb_code = pb_code;
-    }
+    private String currency;
 
-    public Double getTotal() {
-        return total;
-    }
+    private Double rate;
 
-    public void setTotal(Double total) {
-        this.total = total;
-    }
 }

+ 8 - 110
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java

@@ -1,6 +1,10 @@
 package com.usoftchina.saas.money.po;
 
+import lombok.Data;
+
+@Data
 public class Custmonth {
+
     private Integer cm_id;
 
     private Integer cm_yearmonth;
@@ -22,119 +26,13 @@ public class Custmonth {
     private Integer companyid;
 
     private Double cm_beginpreamount;
-    private Double cm_nowpayamount;
-    private Double cm_nowprepayamount;
-    private Double cm_endpreamount;
-
-    public Double getCm_beginpreamount() {
-        return cm_beginpreamount;
-    }
-
-    public void setCm_beginpreamount(Double cm_beginpreamount) {
-        this.cm_beginpreamount = cm_beginpreamount;
-    }
-
-    public Double getCm_nowpayamount() {
-        return cm_nowpayamount;
-    }
-
-    public void setCm_nowpayamount(Double cm_nowpayamount) {
-        this.cm_nowpayamount = cm_nowpayamount;
-    }
-
-    public Double getCm_nowprepayamount() {
-        return cm_nowprepayamount;
-    }
-
-    public void setCm_nowprepayamount(Double cm_nowprepayamount) {
-        this.cm_nowprepayamount = cm_nowprepayamount;
-    }
-
-    public Double getCm_endpreamount() {
-        return cm_endpreamount;
-    }
-
-    public void setCm_endpreamount(Double cm_endpreamount) {
-        this.cm_endpreamount = cm_endpreamount;
-    }
-
-    public Integer getCm_id() {
-        return cm_id;
-    }
-
-    public void setCm_id(Integer cm_id) {
-        this.cm_id = cm_id;
-    }
-
-    public Integer getCm_yearmonth() {
-        return cm_yearmonth;
-    }
 
-    public void setCm_yearmonth(Integer cm_yearmonth) {
-        this.cm_yearmonth = cm_yearmonth;
-    }
-
-    public Integer getCm_custid() {
-        return cm_custid;
-    }
-
-    public void setCm_custid(Integer cm_custid) {
-        this.cm_custid = cm_custid;
-    }
-
-    public String getCm_custcode() {
-        return cm_custcode;
-    }
-
-    public void setCm_custcode(String cm_custcode) {
-        this.cm_custcode = cm_custcode == null ? null : cm_custcode.trim();
-    }
-
-    public String getCm_custname() {
-        return cm_custname;
-    }
-
-    public void setCm_custname(String cm_custname) {
-        this.cm_custname = cm_custname == null ? null : cm_custname.trim();
-    }
-
-    public Double getCm_beginamount() {
-        return cm_beginamount;
-    }
-
-    public void setCm_beginamount(Double cm_beginamount) {
-        this.cm_beginamount = cm_beginamount;
-    }
-
-    public Double getCm_nowamount() {
-        return cm_nowamount;
-    }
-
-    public void setCm_nowamount(Double cm_nowamount) {
-        this.cm_nowamount = cm_nowamount;
-    }
-
-    public Double getCm_nowpreamount() {
-        return cm_nowpreamount;
-    }
-
-    public void setCm_nowpreamount(Double cm_nowpreamount) {
-        this.cm_nowpreamount = cm_nowpreamount;
-    }
+    private Double cm_nowpayamount;
 
-    public Double getCm_endamount() {
-        return cm_endamount;
-    }
+    private Double cm_nowprepayamount;
 
-    public void setCm_endamount(Double cm_endamount) {
-        this.cm_endamount = cm_endamount;
-    }
+    private Double cm_endpreamount;
 
-    public Integer getCompanyid() {
-        return companyid;
-    }
+    private String cm_currency;
 
-    public void setCompanyid(Integer companyid) {
-        this.companyid = companyid;
-    }
 }

+ 9 - 110
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java

@@ -1,6 +1,10 @@
 package com.usoftchina.saas.money.po;
 
+import lombok.Data;
+
+@Data
 public class Vendmonth {
+
     private Integer vm_id;
 
     private Integer vm_yearmonth;
@@ -20,120 +24,15 @@ public class Vendmonth {
     private Double vm_endamount;
 
     private Integer companyid;
-    private Double vm_beginpreamount;
-    private Double vm_nowpayamount;
-    private Double vm_nowprepayamount;
-    private Double vm_endpreamount;
-
-    public Double getVm_beginpreamount() {
-        return vm_beginpreamount;
-    }
-
-    public void setVm_beginpreamount(Double vm_beginpreamount) {
-        this.vm_beginpreamount = vm_beginpreamount;
-    }
-
-    public Double getVm_nowpayamount() {
-        return vm_nowpayamount;
-    }
-
-    public void setVm_nowpayamount(Double vm_nowpayamount) {
-        this.vm_nowpayamount = vm_nowpayamount;
-    }
-
-    public Double getVm_nowprepayamount() {
-        return vm_nowprepayamount;
-    }
-
-    public void setVm_nowprepayamount(Double vm_nowprepayamount) {
-        this.vm_nowprepayamount = vm_nowprepayamount;
-    }
-
-    public Double getVm_endpreamount() {
-        return vm_endpreamount;
-    }
-
-    public void setVm_endpreamount(Double vm_endpreamount) {
-        this.vm_endpreamount = vm_endpreamount;
-    }
-
-    public Integer getVm_id() {
-        return vm_id;
-    }
-
-    public void setVm_id(Integer vm_id) {
-        this.vm_id = vm_id;
-    }
 
-    public Integer getVm_yearmonth() {
-        return vm_yearmonth;
-    }
-
-    public void setVm_yearmonth(Integer vm_yearmonth) {
-        this.vm_yearmonth = vm_yearmonth;
-    }
-
-    public Integer getVm_vendid() {
-        return vm_vendid;
-    }
-
-    public void setVm_vendid(Integer vm_vendid) {
-        this.vm_vendid = vm_vendid;
-    }
-
-    public String getVm_vendcode() {
-        return vm_vendcode;
-    }
-
-    public void setVm_vendcode(String vm_vendcode) {
-        this.vm_vendcode = vm_vendcode;
-    }
-
-    public String getVm_vendname() {
-        return vm_vendname;
-    }
-
-    public void setVm_vendname(String vm_vendname) {
-        this.vm_vendname = vm_vendname;
-    }
-
-    public Double getVm_beginamount() {
-        return vm_beginamount;
-    }
-
-    public void setVm_beginamount(Double vm_beginamount) {
-        this.vm_beginamount = vm_beginamount;
-    }
-
-    public Double getVm_nowamount() {
-        return vm_nowamount;
-    }
-
-    public void setVm_nowamount(Double vm_nowamount) {
-        this.vm_nowamount = vm_nowamount;
-    }
-
-    public Double getVm_nowpreamount() {
-        return vm_nowpreamount;
-    }
+    private Double vm_beginpreamount;
 
-    public void setVm_nowpreamount(Double vm_nowpreamount) {
-        this.vm_nowpreamount = vm_nowpreamount;
-    }
+    private Double vm_nowpayamount;
 
-    public Double getVm_endamount() {
-        return vm_endamount;
-    }
+    private Double vm_nowprepayamount;
 
-    public void setVm_endamount(Double vm_endamount) {
-        this.vm_endamount = vm_endamount;
-    }
+    private Double vm_endpreamount;
 
-    public Integer getCompanyid() {
-        return companyid;
-    }
+    private String vm_currency;
 
-    public void setCompanyid(Integer companyid) {
-        this.companyid = companyid;
-    }
 }

+ 2 - 0
applications/money/money-server/src/main/resources/mapper/AccountDetailsViewMapper.xml

@@ -16,6 +16,8 @@
     <result column="pb_date" property="pb_date" jdbcType="TIMESTAMP" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="pbd_nowbalance" property="pbd_nowbalance" jdbcType="DOUBLE" />
+    <result column="currency" property="currency" jdbcType="VARCHAR" />
+    <result column="rate" property="rate" jdbcType="DOUBLE" />
   </resultMap>
   <select id="selectByCondition" resultMap="BaseResultMap">
     select  *  from account_details_view

+ 2 - 1
applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml

@@ -16,10 +16,11 @@
     <result column="cm_nowpayamount" property="cm_nowpayamount" jdbcType="DOUBLE" />
     <result column="cm_nowprepayamount" property="cm_nowprepayamount" jdbcType="DOUBLE" />
     <result column="cm_endpreamount" property="cm_endpreamount" jdbcType="DOUBLE" />
+    <result column="cm_currency" property="cm_currency" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     cm_id, cm_yearmonth, cm_custid, cm_custcode, cm_custname, CM_BEGINAMOUNT, CM_NOWAMOUNT, 
-    CM_NOWPREAMOUNT, CM_ENDAMOUNT, companyid,cm_endpreamount,cm_nowprepayamount,cm_nowpayamount,cm_beginpreamount
+    CM_NOWPREAMOUNT, CM_ENDAMOUNT, companyid,cm_endpreamount,cm_nowprepayamount,cm_nowpayamount,cm_beginpreamount,cm_currency
   </sql>
 
   <select id="selectByCondition" resultMap="BaseResultMap">

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/PayablesdetailMapper.xml

@@ -34,7 +34,7 @@
         ${con}
       </if>
       <if test="companyId != null">
-        and  companyId = #{companyId} and pd_query =1 and (pd_addpay + pd_addpre + pd_remain) != 0
+        and  companyId = #{companyId} and pd_query =1
       </if>
     </where>
     order by pd_vendid DESC, pd_detno asc, pd_date desc

+ 10 - 8
applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml

@@ -91,7 +91,6 @@ prodinout.companyid= prodiodetail.companyid
 		IFNULL(a.costamount,0) as costamount,
 		IFNULL(SUM(a.netamount - a.costamount),0) as profit,
 		IFNULL((SUM(a.netamount - a.costamount)/IFNULL(a.netamount,SUM(a.netamount - a.costamount))),0) as profitpresent
-
 		FROM
 		(
 		SELECT
@@ -99,9 +98,7 @@ prodinout.companyid= prodiodetail.companyid
 		pi_custname,
 		cu_type,
 		cu_sellername,
-		SUM(
-		IFNULL(pd_sendprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
-		) AS saamount,
+		SUM( (IFNULL( pd_sendprice, 0 ) * ( IFNULL( pd_outqty, 0 ) - IFNULL( pd_inqty, 0 ) )) * ifnull(cr_rate,1) ) AS saamount,,
 		SUM(
 		IFNULL(pd_netprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
 		) AS netamount,
@@ -111,7 +108,8 @@ prodinout.companyid= prodiodetail.companyid
 		FROM
 		prodinout,
 		prodiodetail,
-		customer
+		customer,
+		currencys
 		<where>
 			<if test="con != null">
 				${con}
@@ -120,9 +118,13 @@ prodinout.companyid= prodiodetail.companyid
 				and  prodinout.companyid = #{companyId}
 			</if>
 		</where>
-		and	pi_id = pd_piid
-		AND pi_custid = cu_id and pi_status = '已审核' and
-		prodinout.companyid= prodiodetail.companyid and prodiodetail.companyid = prodinout.companyid
+		AND	pi_id = pd_piid
+		AND pi_custid = cu_id
+		AND pi_status = '已审核'
+		AND prodinout.companyid= prodiodetail.companyid
+		AND prodiodetail.companyid = prodinout.companyid
+		AND currencys.cr_name = prodinout.pi_currency
+		AND currencys.companyid = prodinout.companyid
 		GROUP BY
 		pi_custcode,
 		pi_custname,

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml

@@ -110,7 +110,7 @@
     rb_rdamount, rb_rbdamount, rb_preamount, rb_discounts, rb_havebalance, rb_status, rb_statuscode, rb_remark,
     recbalance.companyId,
     recbalance.updaterId,recbalance.updatedate, rb_text1, rb_text2, rb_text3, rb_text4, rb_text5,
-    recbalance.creatorName, recbalance.createTime, rb_auditman, rb_auditdate, rb_amount
+    recbalance.creatorName, recbalance.createTime, rb_auditman, rb_auditdate, rb_amount,rb_rate,rb_currency
   </sql>
   <sql id="left_Column_List">
     cu_leftamount

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/ReceivablesdetailMapper.xml

@@ -34,7 +34,7 @@
         ${con}
       </if>
       <if test="companyId != null">
-        and  companyId = #{companyId} and rd_query = 1 and (rd_addrec + rd_addpre + rd_remain) != 0
+        and  companyId = #{companyId} and rd_query = 1
       </if>
     </where>
     order by rd_custid DESC, rd_detno asc, rd_date desc

+ 2 - 1
applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml

@@ -16,10 +16,11 @@
     <result column="vm_nowpayamount" property="vm_nowpayamount" jdbcType="DOUBLE" />
     <result column="vm_nowprepayamount" property="vm_nowprepayamount" jdbcType="DOUBLE" />
     <result column="vm_endpreamount" property="vm_endpreamount" jdbcType="DOUBLE" />
+    <result column="vm_currency" property="vm_currency" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     vm_id, vm_yearmonth, vm_vendid, VM_VENDCODE, VM_VENDNAME, VM_BEGINAMOUNT, VM_NOWAMOUNT, 
-    VM_NOWPREAMOUNT, VM_ENDAMOUNT, companyid,vm_endpreamount,vm_nowprepayamount,vm_nowpayamount,vm_beginpreamount
+    VM_NOWPREAMOUNT, VM_ENDAMOUNT, companyid,vm_endpreamount,vm_nowprepayamount,vm_nowpayamount,vm_beginpreamount,vm_currency
   </sql>
 
   <select id="selectByCondition" resultMap="BaseResultMap">

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java

@@ -26,4 +26,6 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
     int checkQtyFromProdIn(Long id);
 
     void updateCreator(@Param("userId") Long userId,@Param("userName") String userName,@Param("id") Long pi_id);
+
+    String validateCurrency(@Param("piId") Long piId, @Param("piCurrency") String piCurrency);
 }

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java

@@ -42,4 +42,6 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
     Integer checkPurchaseRequiredField(Long id);
 
     Integer checkClose(Long id);
+
+    String validateCurrency(@Param("puId") Long piId, @Param("puCurrency") String piCurrency);
 }

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/report/PurchaseReportDetail.java

@@ -68,6 +68,10 @@ public class PurchaseReportDetail extends CommonBaseEntity implements Serializab
 
     private String pu_shipaddresscode;
 
+    private String pu_currency;
+
+    private Double pu_rate;
+
     //从表字段
     private Long pd_id;
 

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

@@ -190,6 +190,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             messageLogService.save(baseDTO);
             return baseDTO;
         }
+        //校验有来源的验收验退币别是否与源单据一致
+        String piInoutno = getMapper().validateCurrency(pi_id,prodInOut.getPi_currency());
+        if(piInoutno!=null){
+            throw new BizException(BizExceptionCode.CURRENCY_VALID);
+        }
         //更新操作
         getMapper().updateByPrimaryKeySelective(prodInOut);
         //添加从表传输对象
@@ -460,11 +465,16 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_vendid(sourcePi.getPi_vendid());
         targetPi.setPi_vendcode(sourcePi.getPi_vendcode());
         targetPi.setPi_vendname(sourcePi.getPi_vendname());
+        //来源采购
         targetPi.setPi_puid(sourcePi.getPi_puid());
         targetPi.setPi_pucode(sourcePi.getPi_pucode());
+        //记录来源
         targetPi.setPi_ioid(sourcePi.getId());
         targetPi.setPi_iocode(sourcePi.getPi_inoutno());
+        //币别、汇率
         targetPi.setPi_currency(sourcePi.getPi_currency());
+        targetPi.setPi_rate(sourcePi.getPi_rate());
+        //采购员
         targetPi.setPi_buyerid(sourcePi.getPi_buyerid());
         targetPi.setPi_buyercode(sourcePi.getPi_buyercode());
         targetPi.setPi_buyername(sourcePi.getPi_buyername());

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

@@ -186,6 +186,11 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             messageLogService.save(baseDTO);
             return baseDTO;
         }
+        //校验有来源的验收验退币别是否与源单据一致
+        String puCode = purchaseMapper.validateCurrency(pu_id,purchase.getPu_currency());
+        if(puCode!=null){
+            throw new BizException(BizExceptionCode.CURRENCY_VALID);
+        }
         //更新操作
         purchaseMapper.updateByPrimaryKeySelective(purchase);
         //添加从表传输对象

+ 3 - 0
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -492,5 +492,8 @@
     update prodinout set creatorId = #{userId} , creatorName=#{userName} where pi_id=#{id}
   </update>
 
+  <select id="validateCurrency" resultType="java.lang.String">
+    select pi_inoutno from prodinout where ( ifnull(pi_pucode,'') != '' or ifnull(pi_iocode,'') != '' ) and  pi_id = #{piId} and pi_currency != #{piCurrency}
+  </select>
 
 </mapper>

+ 4 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -477,4 +477,8 @@
     select count(1) from purchase where pu_id = #{id} and PU_ACCEPTSTATUSCODE='CLOSE'
   </select>
 
+  <select id="validateCurrency" resultType="java.lang.String">
+    select pu_code from purchase where ifnull(pu_sacode,'') != '' and  pu_id = #{puId} and pu_currency != #{puCurrency}
+  </select>
+
 </mapper>

+ 2 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseReportMapper.xml

@@ -51,6 +51,8 @@
     <result column="pu_text3" property="pu_text3" jdbcType="VARCHAR" />
     <result column="pu_text4" property="pu_text4" jdbcType="VARCHAR" />
     <result column="pu_text5" property="pu_text5" 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" />

+ 4 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDTO.java

@@ -66,4 +66,8 @@ public class PurchaseDTO extends CommonBaseEntity implements Serializable {
     private Long pu_said;
 
     private String pu_sacode;
+
+    private String pu_currency;
+
+    private Double pu_rate;
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutMapper.java

@@ -49,4 +49,6 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
     void updateCreator(@Param("userId") Long userId, @Param("userName") String userName, @Param("id") Long id);
 
     Integer checkSaleInQty(Long pi_id);
+
+    String validateCurrency(@Param("piId") Long piId, @Param("piCurrency") String piCurrency);
 }

+ 4 - 2
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java

@@ -71,6 +71,10 @@ public class SaleList implements Serializable {
 
     private Double sa_nettotal;
 
+    private String sa_currency;
+
+    private Double sa_rate;
+
     private Integer sd_id;
 
     private Integer sd_said;
@@ -117,8 +121,6 @@ public class SaleList implements Serializable {
     //已转数
     private Double sd_yqty;
 
-    private String sa_currency;
-
     //private ProductDTO productDTO;级联属性会导致分页查询出现BUG,设置数与查询数量不一致
     private Long pr_id;
     private String pr_code;

+ 4 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java

@@ -66,4 +66,8 @@ public class SaleProfitView {
     private String pr_brand;
 
     private String pr_orispeccode;
+
+    private String pi_currency;
+
+    private Double pi_rate;
 }

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

@@ -148,6 +148,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             messageLogService.save(baseDTO);
             return baseDTO;
         }
+        //校验来源销售订单或出货单 币别,必须与来源保持一致
+        String piInoutno = prodInOutMapper.validateCurrency(pi_id,prodInOut.getPi_currency());
+        if(piInoutno!=null){
+            throw new BizException(BizExceptionCode.CURRENCY_VALID);
+        }
         //更新操作
         prodInOutMapper.updateByPrimaryKeySelective(prodInOut);
         //添加从表传输对象
@@ -497,8 +502,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //来源的单号
         targetPi.setPi_ioid(sourcePi.getId());
         targetPi.setPi_iocode(sourcePi.getPi_inoutno());
-        //币别、业务员
+        //币别、业务员、汇率
         targetPi.setPi_currency(sourcePi.getPi_currency());
+        targetPi.setPi_rate(sourcePi.getPi_rate());
         targetPi.setPi_sellerid(sourcePi.getPi_sellerid());
         targetPi.setPi_sellercode(sourcePi.getPi_sellercode());
         targetPi.setPi_seller(sourcePi.getPi_seller());

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

@@ -509,8 +509,9 @@ public class SaleServiceImpl implements SaleService{
 
         prodInOut.setPi_prstatus(Status.RECNONE.getDisplay());
         prodInOut.setPi_prstatuscode(Status.RECNONE.name());
-        //币别 业务员
+        //币别 业务员 汇率
         prodInOut.setPi_currency(sale.getSa_currency());
+        prodInOut.setPi_rate(sale.getSa_rate());
         prodInOut.setPi_sellerid(sale.getSa_sellerid());
         prodInOut.setPi_sellercode(sale.getSa_sellercode());
         prodInOut.setPi_seller(sale.getSa_seller());
@@ -630,6 +631,9 @@ public class SaleServiceImpl implements SaleService{
         purchase.setCreatorId(BaseContextHolder.getUserId());
         purchase.setCreateTime(new Date());
         purchase.setCreatorName(BaseContextHolder.getUserName());
+        //币别、汇率
+        purchase.setPu_currency(sale.getSa_currency());
+        purchase.setPu_rate(sale.getSa_rate());
         saleMapper.turnPurchase(purchase);
         Long purchaseId = purchase.getId();
         for (SaleList detail : dateilList){

+ 5 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -621,4 +621,9 @@ update ProdInOut SET
     select count(1) from prodinout left join prodiodetail a on pi_id=pd_piid where
     pi_class='销售退货单' and ifnull(pd_inqty,0) > (select ifnull(pd_outqty,0) from prodiodetail where pd_id=a.pd_ioid) and pi_id=#{pi_id};
   </select>
+
+  <select id="validateCurrency" resultType="java.lang.String">
+    select pi_inoutno from prodinout where ( ifnull(pi_sacode,'') != '' or ifnull(pi_iocode,'') != '' ) and  pi_id = #{piId} and pi_currency != #{piCurrency}
+  </select>
+
 </mapper>

+ 3 - 1
applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml

@@ -31,6 +31,8 @@
         <result column="sa_text5" property="sa_text5" jdbcType="VARCHAR" />
         <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
         <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
+        <result column="sa_currency" property="sa_currency" jdbcType="VARCHAR"/>
+        <result column="sa_rate" property="sa_rate" jdbcType="DOUBLE" />
         <result column="sd_id" property="sd_id" jdbcType="INTEGER" />
         <result column="sd_said" property="sd_said" jdbcType="INTEGER" />
         <result column="sd_detno" property="sd_detno" jdbcType="INTEGER" />
@@ -54,7 +56,7 @@
         <result column="sd_text3" property="sd_text3" jdbcType="VARCHAR" />
         <result column="sd_text4" property="sd_text4" jdbcType="VARCHAR" />
         <result column="sd_text5" property="sd_text5" jdbcType="VARCHAR" />
-        <result column="sa_currency" property="sa_currency" jdbcType="VARCHAR"/>
+
         <result column="pr_id" property="pr_id"/>
         <result column="pr_code" property="pr_code"/>
         <result column="pr_detail" property="pr_detail"/>

+ 13 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -583,6 +583,12 @@
       <if test="pu_sacode != null" >
         pu_sacode,
       </if>
+      <if test="pu_currency != null" >
+        pu_currency,
+      </if>
+      <if test="pu_rate != null" >
+        pu_rate,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="pu_code != null" >
@@ -687,6 +693,12 @@
       <if test="pu_sacode != null" >
         #{pu_sacode,jdbcType=VARCHAR},
       </if>
+      <if test="pu_currency != null" >
+        #{pu_currency,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_rate != null" >
+        #{pu_rate,jdbcType=DOUBLE},
+      </if>
     </trim>
   </insert>
 
@@ -730,4 +742,5 @@
     update saledetail set sd_delivery = (select sa_delivery from sale where sa_id =#{id}  and sa_delivery is not null)
      where  sd_said = #{id}  and sd_delivery is null and exists (select 1 from sale where sa_id =#{id}  and sa_delivery is not null)
   </update>
+
 </mapper>

+ 2 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml

@@ -7,6 +7,8 @@
     <result column="sa_sellercode" property="sa_sellercode" jdbcType="VARCHAR" />
     <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
     <result column="sa_date" property="sa_date" jdbcType="TIMESTAMP" />
+    <result column="pi_currency" property="pi_currency" jdbcType="VARCHAR" />
+    <result column="pi_rate" property="pi_rate" jdbcType="DOUBLE" />
     <result column="pi_date" property="pi_date" jdbcType="TIMESTAMP" />
     <result column="pd_inoutno" property="pd_inoutno" jdbcType="VARCHAR" />
     <result column="pd_piclass" property="pd_piclass" jdbcType="VARCHAR" />

+ 4 - 1
framework/core/pom.xml

@@ -65,7 +65,10 @@
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>transmittable-thread-local</artifactId>
-            <version>2.10.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>

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

@@ -0,0 +1,222 @@
+/**
+ * Copyright 2013 Netflix, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.netflix.hystrix.strategy.concurrency;
+
+import java.util.concurrent.*;
+
+import com.alibaba.ttl.TtlRunnable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import rx.*;
+import rx.functions.Action0;
+import rx.functions.Func0;
+import rx.internal.schedulers.ScheduledAction;
+import rx.subscriptions.*;
+
+import com.netflix.hystrix.HystrixThreadPool;
+import com.netflix.hystrix.strategy.HystrixPlugins;
+
+/**
+ * 处理Hystrix线程隔离导致ThreadLocal数据丢失问题
+ * @author: guq
+ * @create: 2019-01-10 11:05
+ */
+public class HystrixContextScheduler extends Scheduler {
+
+    private final HystrixConcurrencyStrategy concurrencyStrategy;
+    private final Scheduler actualScheduler;
+    private final HystrixThreadPool threadPool;
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HystrixContextScheduler.class);
+
+    public HystrixContextScheduler(Scheduler scheduler) {
+        this.actualScheduler = scheduler;
+        this.concurrencyStrategy = HystrixPlugins.getInstance().getConcurrencyStrategy();
+        this.threadPool = null;
+    }
+
+    public HystrixContextScheduler(HystrixConcurrencyStrategy concurrencyStrategy, Scheduler scheduler) {
+        this.actualScheduler = scheduler;
+        this.concurrencyStrategy = concurrencyStrategy;
+        this.threadPool = null;
+    }
+
+    public HystrixContextScheduler(HystrixConcurrencyStrategy concurrencyStrategy, HystrixThreadPool threadPool) {
+        this(concurrencyStrategy, threadPool, new Func0<Boolean>() {
+            @Override
+            public Boolean call() {
+                return true;
+            }
+        });
+    }
+
+    public HystrixContextScheduler(HystrixConcurrencyStrategy concurrencyStrategy, HystrixThreadPool threadPool, Func0<Boolean> shouldInterruptThread) {
+        this.concurrencyStrategy = concurrencyStrategy;
+        this.threadPool = threadPool;
+        this.actualScheduler = new ThreadPoolScheduler(threadPool, shouldInterruptThread);
+    }
+
+    @Override
+    public Worker createWorker() {
+        return new HystrixContextSchedulerWorker(actualScheduler.createWorker());
+    }
+
+    private class HystrixContextSchedulerWorker extends Worker {
+
+        private final Worker worker;
+
+        private HystrixContextSchedulerWorker(Worker actualWorker) {
+            this.worker = actualWorker;
+        }
+
+        @Override
+        public void unsubscribe() {
+            worker.unsubscribe();
+        }
+
+        @Override
+        public boolean isUnsubscribed() {
+            return worker.isUnsubscribed();
+        }
+
+        @Override
+        public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
+            if (threadPool != null) {
+                if (!threadPool.isQueueSpaceAvailable()) {
+                    throw new RejectedExecutionException("Rejected command because thread-pool queueSize is at rejection threshold.");
+                }
+            }
+            return worker.schedule(new HystrixContexSchedulerAction(concurrencyStrategy, action), delayTime, unit);
+        }
+
+        @Override
+        public Subscription schedule(Action0 action) {
+            if (threadPool != null) {
+                if (!threadPool.isQueueSpaceAvailable()) {
+                    throw new RejectedExecutionException("Rejected command because thread-pool queueSize is at rejection threshold.");
+                }
+            }
+            return worker.schedule(new HystrixContexSchedulerAction(concurrencyStrategy, action));
+        }
+
+    }
+
+    private static class ThreadPoolScheduler extends Scheduler {
+
+        private final HystrixThreadPool threadPool;
+        private final Func0<Boolean> shouldInterruptThread;
+
+        public ThreadPoolScheduler(HystrixThreadPool threadPool, Func0<Boolean> shouldInterruptThread) {
+            this.threadPool = threadPool;
+            this.shouldInterruptThread = shouldInterruptThread;
+        }
+
+        @Override
+        public Worker createWorker() {
+            return new ThreadPoolWorker(threadPool, shouldInterruptThread);
+        }
+
+    }
+
+    /**
+     * Purely for scheduling work on a thread-pool.
+     * <p>
+     * This is not natively supported by RxJava as of 0.18.0 because thread-pools
+     * are contrary to sequential execution.
+     * <p>
+     * For the Hystrix case, each Command invocation has a single action so the concurrency
+     * issue is not a problem.
+     */
+    private static class ThreadPoolWorker extends Worker {
+
+        private final HystrixThreadPool threadPool;
+        private final CompositeSubscription subscription = new CompositeSubscription();
+        private final Func0<Boolean> shouldInterruptThread;
+
+        public ThreadPoolWorker(HystrixThreadPool threadPool, Func0<Boolean> shouldInterruptThread) {
+            this.threadPool = threadPool;
+            this.shouldInterruptThread = shouldInterruptThread;
+        }
+
+        @Override
+        public void unsubscribe() {
+            subscription.unsubscribe();
+        }
+
+        @Override
+        public boolean isUnsubscribed() {
+            return subscription.isUnsubscribed();
+        }
+
+        @Override
+        public Subscription schedule(final Action0 action) {
+            if (subscription.isUnsubscribed()) {
+                // don't schedule, we are unsubscribed
+                return Subscriptions.unsubscribed();
+            }
+
+            // This is internal RxJava API but it is too useful.
+            ScheduledAction sa = new ScheduledAction(action);
+
+            subscription.add(sa);
+            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));
+
+            return sa;
+        }
+
+        @Override
+        public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
+            throw new IllegalStateException("Hystrix does not support delayed scheduling");
+        }
+    }
+
+    /**
+     * Very similar to rx.internal.schedulers.ScheduledAction.FutureCompleter, but with configurable interrupt behavior
+     */
+    private static class FutureCompleterWithConfigurableInterrupt implements Subscription {
+        private final FutureTask<?> f;
+        private final Func0<Boolean> shouldInterruptThread;
+        private final ThreadPoolExecutor executor;
+
+        private FutureCompleterWithConfigurableInterrupt(FutureTask<?> f, Func0<Boolean> shouldInterruptThread, ThreadPoolExecutor executor) {
+            this.f = f;
+            this.shouldInterruptThread = shouldInterruptThread;
+            this.executor = executor;
+        }
+
+        @Override
+        public void unsubscribe() {
+            executor.remove(f);
+            if (shouldInterruptThread.call()) {
+                f.cancel(true);
+            } else {
+                f.cancel(false);
+            }
+        }
+
+        @Override
+        public boolean isUnsubscribed() {
+            return f.isCancelled();
+        }
+    }
+
+}

+ 3 - 0
frontend/operation-web/app/view/statistical/CompanyAnalysis.js

@@ -32,6 +32,9 @@ Ext.define('saas.view.statistical.CompanyAnalysis', {
                     text: '企业名称',
                     dataIndex: 'ca_company',
                     width: 200,
+                    renderer: function(v, m, r) {
+                        return '<span style="cursor: pointer; color: #3e80f6;">' + v + '</span>';
+                    },
                     listeners: {
                         click: function(tableView, td, rowIdx, colIdx, e, model, tr) {
                             var data = model.data;

+ 26 - 0
frontend/operation-web/app/view/statistical/PersonRegInfo.js

@@ -14,6 +14,32 @@ Ext.define('saas.view.statistical.PersonRegInfo', {
                 getCondition: function (v) {
                     return "(upper(CONCAT(username, '#', mobile) like '%" + v.toUpperCase() + "%'))";
                 },
+            }, {
+                xtype: 'combobox',
+                name: 'bind',
+                fieldLabel: '绑定企业',
+                queryMode: 'local',
+                displayField: 'name',
+                valueField: 'value',
+                emptyText :'全部',
+                editable:false,
+                store: Ext.create('Ext.data.ArrayStore', {
+                fields: ['value', 'name'],
+                data: [
+                    ["ALL", "全部"],
+                    ["Y", "是"],
+                    ["N", "否"]
+                ]
+                }),
+                getCondition: function(value) {
+                    if(value == 'ALL') {
+                        return '1=1';
+                    }else if(value == 'Y') {
+                        return 'bind > 0';
+                    }else if(value == 'N') {
+                        return 'bind = 0';
+                    }
+                }
             }],
 
             gridConfig: {

+ 21 - 0
frontend/saas-web/app/model/report/PayDetail.js

@@ -0,0 +1,21 @@
+Ext.define('saas.model.report.PayDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'pd_date', type: 'string' },
+        { name: 'pd_code', type: 'string' },
+        { name: 'pd_kind', type: 'date' },
+        { name: 'pd_buyername', type: 'string' },
+        { name: 'pd_currency', type: 'string' },
+        { name: 'pd_addpay', type: 'float' },
+        { name: 'pd_addpre', type: 'float' },
+        { name: 'pd_remain', type: 'float' },
+        { name: 'pd_vendname', type: 'string' },
+        { name: 'groupfield', type: 'string',
+            convert: function(v, rec) {
+                return rec.get('pd_vendname') + rec.get('pd_currency');
+            },
+            depends: ['pd_vendname', 'pd_currency']
+        }
+    ],
+});

+ 4 - 1
frontend/saas-web/app/model/report/Purchase.js

@@ -21,6 +21,9 @@ Ext.define('saas.model.report.Purchase', {
         },
         { name: 'pd_total', type: 'float' }, // 价税合计
         { name: 'pd_pdacceptqty', type: 'float' }, // 收货数量
-        { name: 'pd_remark', type: 'string' }, // 备注
+        { name: 'pu_currency', type:'string'},//币别
+        { name: 'pu_rate', type:'float'},//汇率
+        { name: 'pd_remark', type: 'string' } // 备注
+        
     ],
 });

+ 21 - 0
frontend/saas-web/app/model/report/RecDetail.js

@@ -0,0 +1,21 @@
+Ext.define('saas.model.report.RecDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'rd_date', type: 'string' },
+        { name: 'rd_code', type: 'string' },
+        { name: 'rd_kind', type: 'date' },
+        { name: 'rd_sellername', type: 'string' },
+        { name: 'rd_currency', type: 'string' },
+        { name: 'rd_addrec', type: 'float' },
+        { name: 'rd_addpre', type: 'float' },
+        { name: 'rd_remain', type: 'float' },
+        { name: 'rd_custname', type: 'string' },
+        { name: 'groupfield', type: 'string',
+            convert: function(v, rec) {
+                return rec.get('rd_custname') + rec.get('rd_currency');
+            },
+            depends: ['rd_custname', 'rd_currency']
+        }
+    ],
+});

+ 4 - 1
frontend/saas-web/app/model/report/Sale.js

@@ -29,6 +29,9 @@ Ext.define('saas.model.report.Sale', {
         },
         { name: 'sd_total', type: 'float' },
         { name: 'sd_pdsendqty', type: 'float' },
-        { name: 'sd_remark', type: 'string' },
+        { name: 'sa_currency', type: 'string' },//币别
+        { name: 'sa_rate', type: 'float' },//税率
+        { name: 'sd_remark', type: 'string' },//备注
+
     ],
 });

+ 3 - 1
frontend/saas-web/app/model/report/SaleProfit.js

@@ -30,6 +30,8 @@ Ext.define('saas.model.report.SaleProfit', {
         { name: 'pd_total', type: 'float' },
         { name: 'pd_profit', type: 'float' },
         { name: 'pd_profitpresent', type: 'float' },
-        { name: 'pd_remark', type: 'string' }
+        { name: 'pd_remark', type: 'string' },
+        { name: 'pi_currency', type: 'string' },
+        { name: 'pi_rate', type: 'float' }
     ],
 });

+ 1 - 0
frontend/saas-web/app/model/report/TotalPayDetail.js

@@ -4,6 +4,7 @@ Ext.define('saas.model.report.TotalPayDetail', {
     fields: [
         { name: 'vm_yearmonth', type: 'string' }, // 期间
         { name: 'vm_vendname', type: 'string' }, // 供应商名称
+        { name: 'vm_currency', type:'string' }, //币别
         { name: 'vm_beginpreamount', type: 'float' }, // 期初预付
         { name: 'vm_beginamount', type: 'float' }, // 期初应付
         { name: 'vm_nowpreamount', type: 'float' }, // 本期预付

+ 1 - 0
frontend/saas-web/app/model/report/TotalRecDetail.js

@@ -4,6 +4,7 @@ Ext.define('saas.model.report.TotalRecDetail', {
     fields: [
         { name: 'cm_yearmonth', type: 'string' }, // 期间
         { name: 'cm_custname', type: 'string' }, // 客户名称
+        { name: 'cm_currency', type:'string' }, //币别
         { name: 'cm_beginpreamount', type: 'float' }, // 期初预收
         { name: 'cm_beginamount', type: 'float' }, // 期初应收
         { name: 'cm_nowpreamount', type: 'float' }, // 本期预收

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

@@ -98,6 +98,6 @@ Ext.define('saas.view.core.form.field.ConDbfindTrigger', {
     },
 
     isDirty: function() {
-        return this.items.items[0].isDirty() && this.items.items[1].isDirty();
+        return this.items.items[0].isDirty() || this.items.items[1].isDirty();
     }
 });

+ 5 - 4
frontend/saas-web/app/view/core/dbfind/types/CurrencyDbfindTrigger.js

@@ -1,5 +1,5 @@
 /**
- * BOM资料放大镜
+ * 币别放大镜
  */
 Ext.define('saas.view.core.dbfind.types.CurrencyDbfindTrigger', {
     extend: 'saas.view.core.dbfind.DbfindTrigger',
@@ -12,10 +12,10 @@ Ext.define('saas.view.core.dbfind.types.CurrencyDbfindTrigger', {
     //联想设置
     dbtpls: [{
         field: 'cr_name',
-        width: 150
+        width: 65
     }, {
         field: 'cr_rate',
-        width: 200
+        width: 110
     }],
     
     //defaultCondition: "bo_statuscode='ENABLE'",
@@ -39,7 +39,8 @@ Ext.define('saas.view.core.dbfind.types.CurrencyDbfindTrigger', {
     }, {
         text: "币别",
         dataIndex: "cr_name",
-        width: 150,
+        align:'center',
+        width: 65,
     }, {
         text: "汇率",
         width: 150,

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

@@ -57,6 +57,16 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
             return saas.util.BaseUtil.numberFormat(v, 2, false);
         }
     }, {
+        text: "币别",
+        dataIndex: "cu_currency",
+        width:65,
+        align:'center'
+    }, {
+        text: "汇率",
+        xtype:'numbercolumn',
+        dataIndex: "cr_rate",
+        width:80
+    },, {
         text: "业务员编号",
         dataIndex: "cu_sellercode",
         width:150,

+ 10 - 0
frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js

@@ -58,6 +58,16 @@ Ext.define('saas.view.core.dbfind.types.VendorDbfindTrigger', {
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, false);
         }
+    }, {
+        text: "币别",
+        dataIndex: "ve_currency",
+        width:65,
+        align:'center'
+    }, {
+        text: "汇率",
+        xtype:'numbercolumn',
+        dataIndex: "cr_rate",
+        width:80
     }, {
         text: "采购员编号",
         dataIndex: "ve_buyercode",

+ 2 - 1
frontend/saas-web/app/view/document/bankinformation/DataList.js

@@ -37,7 +37,8 @@ Ext.define('saas.view.document.bankinformation.DataList', {
             },{
                 text: '币别',
                 dataIndex: 'bk_currency',
-                width: 100
+                align:'center',
+                width: 65
             },{
                 text: '期初金额(元)',
                 dataIndex: 'bk_beginamount',

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

@@ -76,10 +76,10 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 }, {
                     from: 'cr_rate', to: 'pb_rate'
                 }],
-                defaultValue: {
-                    pb_currency: 'RMB',
-                    pb_rate: 1
-                },
+                // defaultValue: {
+                //     pb_currency: 'RMB',
+                //     pb_rate: 1
+                // },
                 supFieldConfig: {
                     xtype: 'numberfield',
                     readOnly: false,

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

@@ -85,10 +85,10 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 }, {
                     from: 'cr_rate', to: 'rb_rate'
                 }],
-                defaultValue: {
-                    rb_currency: 'RMB',
-                    rb_rate: 1
-                },
+                // defaultValue: {
+                //     rb_currency: 'RMB',
+                //     rb_rate: 1
+                // },
                 supFieldConfig: {
                     xtype: 'numberfield',
                     readOnly: false,

+ 6 - 1
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -84,7 +84,12 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             from:'cu_name', to:'rb_custname'
                         },{
                             from:'cu_leftamount', to:'cu_leftamount'
-                        }],
+                        },{
+                            from:'cu_currency',to:'rb_currency'
+                        },{
+                            from:'cr_rate',to:'rb_rate'
+                        }
+                        ],
                     }) ;   
                 }
             },

+ 10 - 0
frontend/saas-web/app/view/money/report/AccountDetails.js

@@ -95,6 +95,16 @@ Ext.define('saas.view.money.report.AccountDetails', {
         renderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
+    }, {
+        text: '币别',
+        dataIndex: 'currency',
+        align:'center',
+        width: 65
+    }, {
+        text: '汇率',
+        dataIndex: 'rate',
+        xtype: 'numbercolumn',
+        width: 80
     }, {
         dataIndex: '',
         flex: 1

+ 6 - 3
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -6,8 +6,8 @@ Ext.define('saas.view.money.report.PayDetail', {
     viewModel: 'money-report-paydetail',
     viewName: 'money-report-paydetail',
 
-    groupField:'pd_vendname',
-    groupHeaderTpl: '供应商名称: {[values.rows[0].data.pd_vendname]}',
+    groupField: 'groupfield',
+    groupHeaderTpl: '{[values.rows[0].data.pd_vendname]} ({[values.rows[0].data.pd_currency]})',
     listUrl: '/api/money/report/payDetail',
     defaultCondition: null,
     reportTitle: '应付账款明细表',
@@ -27,6 +27,8 @@ Ext.define('saas.view.money.report.PayDetail', {
         columnWidth: 0.5
     }],
 
+    reportModel: 'saas.model.report.PayDetail',
+
     reportColumns: [{
         text: '单据日期',
         xtype: 'datecolumn',
@@ -47,7 +49,8 @@ Ext.define('saas.view.money.report.PayDetail', {
     }, {
         text: '币别',
         dataIndex: 'pd_currency',
-        width: 80
+        align:'center',
+        width: 65
     },{
         text: '增加应付(元)',
         xtype: 'numbercolumn',

+ 9 - 5
frontend/saas-web/app/view/money/report/ProfitDetail.js

@@ -54,7 +54,7 @@ Ext.define('saas.view.money.report.ProfitDetail', {
         dataIndex: 'netamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 120,
+        width: 0,
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
@@ -63,12 +63,12 @@ Ext.define('saas.view.money.report.ProfitDetail', {
         dataIndex: 'saamount-netamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 120,
+        width: 0,
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
     }, {
-        text: '价税合计(元)',
+        text: '销售金额(元)',
         dataIndex: 'saamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
@@ -77,7 +77,7 @@ Ext.define('saas.view.money.report.ProfitDetail', {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
         summaryType: 'sum',
-        summaryLabel: '价税合计',
+        summaryLabel: '销售金额',
         summaryRenderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
@@ -87,10 +87,14 @@ Ext.define('saas.view.money.report.ProfitDetail', {
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
         width: 120,
-        summaryLabel: '成本金额',
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
+        summaryType: 'sum',
+        summaryLabel: '成本金额',
+        summaryRenderer: function(v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        }
     }, {
         text: '毛利润(元)',
         dataIndex: 'profit',

+ 6 - 3
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -7,8 +7,8 @@ Ext.define('saas.view.money.report.RecDetail', {
 
     viewName: 'money-report-recdetail',
 
-    groupField: 'rd_custname',
-    groupHeaderTpl: '客户名称: {[values.rows[0].data.rd_custname]}',
+    groupField: 'groupfield',
+    groupHeaderTpl: '{[values.rows[0].data.rd_custname]} ({[values.rows[0].data.rd_currency]})',
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,
     reportTitle: '应收账款明细',
@@ -28,6 +28,8 @@ Ext.define('saas.view.money.report.RecDetail', {
         columnWidth: 0.5
     }],
 
+    reportModel: 'saas.model.report.RecDetail',
+
     reportColumns: [{
         text: '单据日期',
         xtype: 'datecolumn',
@@ -48,7 +50,8 @@ Ext.define('saas.view.money.report.RecDetail', {
     }, {
         text: '币别',
         dataIndex: 'rd_currency',
-        width: 80
+        align:'center',
+        width: 65
     }, {
         text: '增加应收(元)',
         dataIndex: 'rd_addrec',

+ 5 - 0
frontend/saas-web/app/view/money/report/TotalPayDetail.js

@@ -39,6 +39,11 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
         text: '供应商名称',
         dataIndex: 'vm_vendname',
         width: 200,
+    }, {
+        text: '币别',
+        dataIndex: 'vm_currency',
+        align:'center',
+        width: 65,
     }, {
         text: '期初',
         columns: [{

+ 5 - 0
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -39,6 +39,11 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
         text: '客户名称',
         dataIndex: 'cm_custname',
         width: 200,
+    }, {
+        text: '币别',
+        dataIndex: 'cm_currency',
+        align:'center',
+        width: 65,
     }, {
         text: '期初',
         columns: [{

+ 37 - 16
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -526,6 +526,27 @@ 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: 'hidden',
                         name: 'vc_amount1',
                         thousandSeparator: ',',
@@ -575,10 +596,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        defaultValue: {
-                            vc_currency: 'RMB',
-                            vc_rate: 1
-                        },
+                        // defaultValue: {
+                        //     vc_currency: 'RMB',
+                        //     vc_rate: 1
+                        // },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,
@@ -653,10 +674,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             }, {
                                 from: 'cr_rate', to: 'vc_rate'
                             }],
-                            defaultValue: {
-                                vc_currency: 'RMB',
-                                vc_rate: 1
-                            },
+                            // defaultValue: {
+                            //     vc_currency: 'RMB',
+                            //     vc_rate: 1
+                            // },
                             supFieldConfig: {
                                 xtype: 'numberfield',
                                 readOnly: false,
@@ -730,10 +751,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        defaultValue: {
-                            vc_currency: 'RMB',
-                            vc_rate: 1
-                        },
+                        // defaultValue: {
+                        //     vc_currency: 'RMB',
+                        //     vc_rate: 1
+                        // },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,
@@ -807,10 +828,10 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        defaultValue: {
-                            vc_currency: 'RMB',
-                            vc_rate: 1
-                        },
+                        // defaultValue: {
+                        //     vc_currency: 'RMB',
+                        //     vc_rate: 1
+                        // },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,

+ 12 - 2
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -82,7 +82,12 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                             from:'cu_code', to:'vc_custcode'
                         },{
                             from:'cu_name', to:'vc_custname'
-                        }],
+                        },{
+                            from:'cu_currency',to:'vc_currency'
+                        },{
+                            from:'cr_rate',to:'vc_rate'
+                        }
+                        ],
                     }) ;   
 
                 }
@@ -239,7 +244,12 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                         }, {
                             from: 've_name',
                             to: 'vc_vendname'
-                        }],
+                        },{
+                            from:'cu_currency',to:'vc_currency'
+                        },{
+                            from:'cr_rate',to:'vc_rate'
+                        }
+                        ],
                     });
 
                 }

+ 10 - 8
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -104,10 +104,6 @@ Ext.define('saas.view.purchase.report.Purchase', {
         xtype: 'numbercolumn',
         renderer: function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 3, true);
-        },
-        summaryType: 'sum',
-        summaryRenderer: function(v, d, f, m) {
-            return saas.util.BaseUtil.numberFormat(v, 3, true);
         }
     }, {
         text: '采购数量',
@@ -115,12 +111,8 @@ Ext.define('saas.view.purchase.report.Purchase', {
         xtype: 'numbercolumn',
         exportFormat: 'Quantity',
         width: 110,
-        summaryType: 'sum',
         renderer: function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 3, false);
-        },
-        summaryRenderer: function(v, d, f, m) {
-            return saas.util.BaseUtil.numberFormat(v, 3, false);
         }
     }, {
         text: '单位',
@@ -197,6 +189,16 @@ Ext.define('saas.view.purchase.report.Purchase', {
         summaryRenderer: function(v, d, f, m) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
+    }, {
+        text: '币别',
+        dataIndex: 'pu_currency',
+        align:'center',
+        width: 65
+    }, {
+        text: '汇率',
+        xtype: 'numbercolumn',
+        dataIndex: 'pu_rate',
+        width: 80
     }, {
         text: '备注',
         dataIndex: 'pd_remark',

+ 2 - 1
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -92,7 +92,8 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
     }, {
         text: '币别',
         dataIndex: 'pi_currency',
-        width: 80
+        align:'center',
+        width: 65
     }, {
         text: '付款比例(%)',
         dataIndex: 'pb_payrate',

+ 158 - 0
frontend/saas-web/app/view/sale/business/Product.js

@@ -0,0 +1,158 @@
+/**
+ * 产品库
+ */
+Ext.define('saas.view.sale.business.Product', {
+    extend: 'saas.view.core.base.BasePanel',
+    xtype: 'sale-business-product',
+
+    controller: 'sale-business-Product',
+    viewModel: 'sale-business-Product',
+    viewName: 'sale-business-Product',
+
+
+    // dataUrl: 'http://10.1.80.23:8560/api/sale/sale/enterprise/businessChance',
+    dataUrl: '/api/sale/sale/enterprise/businessChance',
+    initComponent: function() {
+        var me = this;
+        Ext.apply(this, {
+            searchField: [{
+                xtype: 'textfield',
+                name: 'keyword',
+                columnWidth: 0.15,
+                emptyText:'请输入物料编号/名称/型号/品牌'
+            }, {
+                xtype: 'combobox',
+                name: 'uploaded',
+                fieldLabel: '上传状态',
+                queryMode: 'local',
+                displayField: 'name',
+                valueField: 'value',
+                emptyText :'全部',
+                editable:false,
+                labelWidth: 80,
+                columnWidth: 0.2,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['name', 'value'],
+                    data: [
+                        ["全部", "all"],
+                        ["未上传", "0"],
+                        ["已上传", "1"]
+                    ]
+                })
+            }, {
+                xtype: 'checkbox',
+                name: 'self',
+                fieldLabel: '我的产品库'
+            }],
+        
+            gridConfig: {
+                dataUrl: me.dataUrl,
+                rootProperty: 'data.content',
+                totalProperty: 'data.totalElements',
+                actionColumn: [],
+                selModel: {
+                    type: 'cellmodel'
+                },
+                hiddenTools: true,
+                data: [{
+
+                }],
+                columns : [{
+                    text: '物料编号',
+                    dataIndex: 'custName',
+                    width: 120
+                }, {
+                    text: '品牌',
+                    dataIndex: 'prodBrand',
+                    width: 100
+                }, {
+                    text: '名称',
+                    dataIndex: 'prodName',
+                    width: 120
+                }, {
+                    text: '型号',
+                    dataIndex: 'prodOrispeccode',
+                    width: 120
+                }, {
+                    text: '规格',
+                    dataIndex: 'prodSpec',
+                    width: 120
+                }, {
+                    text: '单位',
+                    dataIndex: 'prodUnit'
+                }, {
+                    text: '上传状态',
+                    dataIndex: 'needQty'
+                }, {
+                    text: '我的产品',
+                    dataIndex: 'startDate'
+                }]
+            },
+        });
+        this.callParent(arguments);
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function (field, value) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = from + ',' + to;
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
+                return v.value;
+            }).join(',') : '';
+        } else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    getExtraParams: function(store, op, condition) {
+        var temp = {};
+
+        for(let x = 0; x < condition.length; x++) {
+            let c = condition[x];
+            if(c.field == 'keyword') {
+                temp.keyword = c.value;
+            }else if(c.field == 'date') {
+                temp.fromDate = new Date(c.value.split(',')[0]).getTime();
+                temp.endDate = new Date(c.value.split(',')[1]).getTime();
+            }else if(c.field == 'quoted') {
+                temp.quoted = c.value == 'all' ? null : c.value;
+            }else if(c.field == 'closed') {
+                // temp.endDate = c.value == 'all' ? null : (
+                //     c.value == '0' ? 
+                // );
+            }
+        }
+        let obj = {
+            pageNumber: store.exportNumber?store.exportNumber:op._page,
+            pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
+        };
+        for(let k in temp) {
+            if(!!temp[k]) {
+                obj[k] = temp[k];
+            }
+        }
+        return obj;
+     },
+});

+ 10 - 10
frontend/saas-web/app/view/sale/report/Sale.js

@@ -104,11 +104,6 @@ Ext.define('saas.view.sale.report.Sale', {
         width: 110,
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 3, false);
-        },
-        summaryType: 'sum',
-        summaryLabel: '出货数量',
-        summaryRenderer: function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 3, false);
         }
     }, {
         text: '销售数量',
@@ -118,11 +113,6 @@ Ext.define('saas.view.sale.report.Sale', {
         width: 110,
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 3, false);
-        },
-        summaryType: 'sum',
-        summaryLabel: '销售数量',
-        summaryRenderer: function(v) {
-            return saas.util.BaseUtil.numberFormat(v, 3, false);
         }
     }, {
         text: '单位',
@@ -197,6 +187,16 @@ Ext.define('saas.view.sale.report.Sale', {
         summaryRenderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
+    }, {
+        text: '币别',
+        dataIndex: 'sa_currency',
+        align:'center',
+        width: 65
+    }, {
+        text: '汇率',
+        xtype: 'numbercolumn',
+        dataIndex: 'sa_rate',
+        width: 80
     },  {
         text : "备注", 
         dataIndex : "sd_remark",

+ 9 - 0
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -91,6 +91,15 @@ Ext.define('saas.view.sale.report.SaleProfit', {
         text: '单位',
         dataIndex: 'pr_unit',
         width: 65
+    }, {
+        text: '币别',
+        dataIndex: 'pi_currency',
+        align:'center',
+        width: 65
+    }, {
+        text: '汇率',
+        dataIndex: 'pi_rate',
+        width: 80
     }, {
         text: '单价(元)',
         dataIndex: 'pd_netprice',

+ 2 - 1
frontend/saas-web/app/view/sale/report/SaleRec.js

@@ -95,7 +95,8 @@ Ext.define('saas.view.sale.report.SaleRec', {
     }, {
         text: '币别',
         dataIndex: 'pi_currency',
-        width: 80
+        align:'center',
+        width: 65
     }, {
         text: '回款比例(%)',
         dataIndex: 'rb_backrate',

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

@@ -29,7 +29,12 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                             to: 'sa_seller'
                         }, {
                             from:'cu_sellerid',to:'cu_sellerid'
-                        }],
+                        },{
+                            from:'cu_currency',to:'sa_currency'
+                        },{
+                            from:'cr_rate',to:'sa_rate'
+                        }
+                        ],
                     });
 
                 }

+ 4 - 6
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -133,10 +133,9 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
                     }
                 },{
                     text: '币别',
-                    align: 'center',
                     dataIndex: "sa_currency",
-                    defaultValue: 'RMB',
-                    width:80
+                    align:'center',
+                    width: 65
                 } ,{
                     text: '审核状态',
                     align: 'center',
@@ -177,10 +176,9 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
                     width: 200
                 }, {
                     text: '币别',
-                    align: 'center',
                     dataIndex: "sa_currency",
-                    defaultValue: 'RMB',
-                    width:80
+                    align:'center',
+                    width: 65
                 },{
                     text: '审核状态',
                     align: 'center',

+ 4 - 6
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -136,10 +136,9 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
                     }
                 }, {
                     text: '币别',
-                    align: 'center',
                     dataIndex: "pi_currency",
-                    defaultValue: 'RMB',
-                    width: 80
+                    align:'center',
+                    width: 65
                 }, {
                     text: '审核状态',
                     align: 'center',
@@ -179,10 +178,9 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
                     width: 200
                 }, {
                     text: '币别',
-                    align: 'center',
                     dataIndex: "pi_currency",
-                    defaultValue: 'RMB',
-                    width: 80
+                    align:'center',
+                    width: 65
                 }, {
                     text: '审核状态',
                     align: 'center',

+ 0 - 12
frontend/saas-web/app/view/sale/saleOut/FormPanel.js

@@ -134,18 +134,6 @@ Ext.define('saas.view.sale.saleout.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'
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 4 - 6
frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

@@ -136,10 +136,9 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
                     }
                 }, {
                     text: '币别',
-                    align: 'center',
                     dataIndex: "pi_currency",
-                    defaultValue: 'RMB',
-                    width: 80,
+                    align:'center',
+                    width: 65
                 }, {
                     text: '审核状态',
                     align: 'center',
@@ -179,10 +178,9 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
                     width: 200
                 }, {
                     text: '币别',
-                    align: 'center',
                     dataIndex: "pi_currency",
-                    defaultValue: 'RMB',
-                    width: 80
+                    align:'center',
+                    width: 65
                 }, {
                     text: '审核状态',
                     align: 'center',

+ 6 - 0
pom.xml

@@ -45,6 +45,7 @@
         <fastdfs.client.version>1.26.3</fastdfs.client.version>
         <poi.version>3.17</poi.version>
         <zxing.version>3.3.0</zxing.version>
+        <threadloacl.version>2.10.2</threadloacl.version>
     </properties>
 
     <repositories>
@@ -394,6 +395,11 @@
                 <artifactId>javase</artifactId>
                 <version>${zxing.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>transmittable-thread-local</artifactId>
+                <version>${threadloacl.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>