Browse Source

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

rainco 7 years ago
parent
commit
7cc1cd411d
64 changed files with 1124 additions and 267 deletions
  1. 209 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Customer.java
  2. 2 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/CustomerList.java
  3. 16 6
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendor.java
  4. 2 2
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java
  5. 1 0
      applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml
  6. 13 3
      applications/document/document-server/src/main/resources/mapper/CustomerMapper.xml
  7. 27 15
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  8. 10 0
      applications/money/money-server/pom.xml
  9. 10 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransferdetail.java
  10. 9 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othreceiptsdetail.java
  11. 10 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendingsdetail.java
  12. 7 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  13. 11 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  14. 14 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  15. 69 7
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  16. 76 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  17. 1 5
      applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml
  18. 4 5
      applications/money/money-server/src/main/resources/mapper/FundtransferdetailMapper.xml
  19. 1 3
      applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml
  20. 3 2
      applications/money/money-server/src/main/resources/mapper/OthreceiptsdetailMapper.xml
  21. 1 3
      applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml
  22. 3 2
      applications/money/money-server/src/main/resources/mapper/OthspendingsdetailMapper.xml
  23. 1 3
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  24. 1 3
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  25. 2 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  26. 9 9
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml
  27. 36 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleReportController.java
  28. 3 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleListMapper.java
  29. 11 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleProfitViewMapper.java
  30. 11 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SalerecViewMapper.java
  31. 3 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  32. 53 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java
  33. 38 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SalerecView.java
  34. 12 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleReportService.java
  35. 67 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleReportServiceImpl.java
  36. 3 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  37. 32 2
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  38. 38 0
      applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml
  39. 31 0
      applications/sale/sale-server/src/main/resources/mapper/SalerecViewMapper.xml
  40. 1 1
      frontend/saas-web/app/view/core/base/GridPanel.js
  41. 1 0
      frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js
  42. 7 2
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  43. 2 2
      frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js
  44. 16 1
      frontend/saas-web/app/view/document/bom/BasePanel.js
  45. 2 1
      frontend/saas-web/app/view/document/product/FormController.js
  46. 1 1
      frontend/saas-web/app/view/document/product/FormPanel.js
  47. 1 0
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  48. 11 21
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  49. 2 2
      frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js
  50. 2 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  51. 6 22
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  52. 7 7
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js
  53. 14 22
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  54. 9 9
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelController.js
  55. 4 2
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  56. 0 20
      frontend/saas-web/app/view/stock/otherIn/QueryPanel.js
  57. 4 2
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  58. 0 20
      frontend/saas-web/app/view/stock/otherOut/QueryPanel.js
  59. 3 3
      frontend/saas-web/app/view/stock/stockamount/DataList.js
  60. 1 1
      frontend/saas-web/app/view/sys/messagelog/DataList.js
  61. 1 1
      frontend/saas-web/app/view/sys/power/FormPanel.js
  62. 146 0
      frontend/saas-web/app/view/sys/power/GroupGrid.js
  63. 33 0
      frontend/saas-web/app/view/sys/power/OtherField.js
  64. 0 41
      frontend/saas-web/app/view/sys/power/TreeGrid.js

+ 209 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Customer.java

@@ -58,4 +58,213 @@ public class Customer extends CommonBaseEntity implements Serializable {
 
     private Double cu_recamount;
 
+    private Double cu_preamount;
+
+    public String getCu_code() {
+        return cu_code;
+    }
+
+    public void setCu_code(String cu_code) {
+        this.cu_code = cu_code;
+    }
+
+    public String getCu_name() {
+        return cu_name;
+    }
+
+    public void setCu_name(String cu_name) {
+        this.cu_name = cu_name;
+    }
+
+    public String getCu_uu() {
+        return cu_uu;
+    }
+
+    public void setCu_uu(String cu_uu) {
+        this.cu_uu = cu_uu;
+    }
+
+    public String getCu_type() {
+        return cu_type;
+    }
+
+    public void setCu_type(String cu_type) {
+        this.cu_type = cu_type;
+    }
+
+    public Date getCu_begindate() {
+        return cu_begindate;
+    }
+
+    public void setCu_begindate(Date cu_begindate) {
+        this.cu_begindate = cu_begindate;
+    }
+
+    public Double getCu_beginaramount() {
+        return cu_beginaramount;
+    }
+
+    public void setCu_beginaramount(Double cu_beginaramount) {
+        this.cu_beginaramount = cu_beginaramount;
+    }
+
+    public Double getCu_beginprerecamount() {
+        return cu_beginprerecamount;
+    }
+
+    public void setCu_beginprerecamount(Double cu_beginprerecamount) {
+        this.cu_beginprerecamount = cu_beginprerecamount;
+    }
+
+    public Double getCu_promisedays() {
+        return cu_promisedays;
+    }
+
+    public void setCu_promisedays(Double cu_promisedays) {
+        this.cu_promisedays = cu_promisedays;
+    }
+
+    public Double getCu_taxrate() {
+        return cu_taxrate;
+    }
+
+    public void setCu_taxrate(Double cu_taxrate) {
+        this.cu_taxrate = cu_taxrate;
+    }
+
+    public Integer getCu_sellerid() {
+        return cu_sellerid;
+    }
+
+    public void setCu_sellerid(Integer cu_sellerid) {
+        this.cu_sellerid = cu_sellerid;
+    }
+
+    public String getCu_sellercode() {
+        return cu_sellercode;
+    }
+
+    public void setCu_sellercode(String cu_sellercode) {
+        this.cu_sellercode = cu_sellercode;
+    }
+
+    public String getCu_sellername() {
+        return cu_sellername;
+    }
+
+    public void setCu_sellername(String cu_sellername) {
+        this.cu_sellername = cu_sellername;
+    }
+
+    public Double getCu_credit() {
+        return cu_credit;
+    }
+
+    public void setCu_credit(Double cu_credit) {
+        this.cu_credit = cu_credit;
+    }
+
+    public String getCu_status() {
+        return cu_status;
+    }
+
+    public void setCu_status(String cu_status) {
+        this.cu_status = cu_status;
+    }
+
+    public String getCu_statuscode() {
+        return cu_statuscode;
+    }
+
+    public void setCu_statuscode(String cu_statuscode) {
+        this.cu_statuscode = cu_statuscode;
+    }
+
+    public Integer getCu_recordmanid() {
+        return cu_recordmanid;
+    }
+
+    public void setCu_recordmanid(Integer cu_recordmanid) {
+        this.cu_recordmanid = cu_recordmanid;
+    }
+
+    public String getCu_recordman() {
+        return cu_recordman;
+    }
+
+    public void setCu_recordman(String cu_recordman) {
+        this.cu_recordman = cu_recordman;
+    }
+
+    public Date getCu_recorddate() {
+        return cu_recorddate;
+    }
+
+    public void setCu_recorddate(Date cu_recorddate) {
+        this.cu_recorddate = cu_recorddate;
+    }
+
+    public String getCu_text1() {
+        return cu_text1;
+    }
+
+    public void setCu_text1(String cu_text1) {
+        this.cu_text1 = cu_text1;
+    }
+
+    public String getCu_text2() {
+        return cu_text2;
+    }
+
+    public void setCu_text2(String cu_text2) {
+        this.cu_text2 = cu_text2;
+    }
+
+    public String getCu_text3() {
+        return cu_text3;
+    }
+
+    public void setCu_text3(String cu_text3) {
+        this.cu_text3 = cu_text3;
+    }
+
+    public String getCu_text4() {
+        return cu_text4;
+    }
+
+    public void setCu_text4(String cu_text4) {
+        this.cu_text4 = cu_text4;
+    }
+
+    public String getCu_text5() {
+        return cu_text5;
+    }
+
+    public void setCu_text5(String cu_text5) {
+        this.cu_text5 = cu_text5;
+    }
+
+    public Double getCu_leftamount() {
+        return cu_leftamount;
+    }
+
+    public void setCu_leftamount(Double cu_leftamount) {
+        this.cu_leftamount = cu_leftamount;
+    }
+
+    public Double getCu_recamount() {
+        return cu_recamount;
+    }
+
+    public void setCu_recamount(Double cu_recamount) {
+        this.cu_recamount = cu_recamount;
+    }
+
+    public Double getCu_preamount() {
+        return cu_preamount;
+    }
+
+    public void setCu_preamount(Double cu_preamount) {
+        this.cu_preamount = cu_preamount;
+    }
 }

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

@@ -62,6 +62,8 @@ public class CustomerList extends CommonBaseEntity{
     private Double cu_leftamount;
 
     private Double cu_recamount;
+
+    private Double cu_preamount;
 //customeraddress
 
     private Long ca_cuid;

+ 16 - 6
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendor.java

@@ -35,11 +35,11 @@ public class Vendor extends CommonBaseEntity implements Serializable{
     /**
      * 期初应付
      */
-    private Long ve_beginapamount;
+    private double ve_beginapamount;
     /**
      * 期初预付
      */
-    private Long ve_beginprepayamount;
+    private double ve_beginprepayamount;
     /**
      * 承付天数
      */
@@ -107,6 +107,8 @@ public class Vendor extends CommonBaseEntity implements Serializable{
 
     private Integer ve_beginym;
 
+    private Double ve_preamount;
+
     public Double getVe_payamount() {
         return ve_payamount;
     }
@@ -171,19 +173,19 @@ public class Vendor extends CommonBaseEntity implements Serializable{
         this.ve_begindate = ve_begindate;
     }
 
-    public Long getVe_beginapamount() {
+    public double getVe_beginapamount() {
         return ve_beginapamount;
     }
 
-    public void setVe_beginapamount(Long ve_beginapamount) {
+    public void setVe_beginapamount(double ve_beginapamount) {
         this.ve_beginapamount = ve_beginapamount;
     }
 
-    public Long getVe_beginprepayamount() {
+    public double getVe_beginprepayamount() {
         return ve_beginprepayamount;
     }
 
-    public void setVe_beginprepayamount(Long ve_beginprepayamount) {
+    public void setVe_beginprepayamount(double ve_beginprepayamount) {
         this.ve_beginprepayamount = ve_beginprepayamount;
     }
 
@@ -306,4 +308,12 @@ public class Vendor extends CommonBaseEntity implements Serializable{
     public void setVe_text5(String ve_text5) {
         this.ve_text5 = ve_text5;
     }
+
+    public Double getVe_preamount() {
+        return ve_preamount;
+    }
+
+    public void setVe_preamount(Double ve_preamount) {
+        this.ve_preamount = ve_preamount;
+    }
 }

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

@@ -33,11 +33,11 @@ public class VendorList implements Serializable {
     /**
      * 期初应付
      */
-    private long ve_beginapamount;
+    private double ve_beginapamount;
     /**
      * 期初预付
      */
-    private long ve_beginprepayamount;
+    private double ve_beginprepayamount;
     /**
      * 承付天数
      */

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

@@ -23,6 +23,7 @@
     <result column="cu_recorddate" jdbcType="TIMESTAMP" property="cu_recorddate" />
     <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="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" />

+ 13 - 3
applications/document/document-server/src/main/resources/mapper/CustomerMapper.xml

@@ -37,7 +37,7 @@
     cu_promisedays, cu_taxrate, cu_sellerid, cu_sellercode, cu_sellername, cu_credit, 
     cu_status, cu_statuscode, cu_recordmanid, cu_recordman, cu_recorddate, companyid, 
     updaterid, updatetime, cu_text1, cu_text2, cu_text3, cu_text4, cu_text5, cu_leftamount, 
-    cu_recamount
+    cu_recamount,cu_preamount
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select 
@@ -140,6 +140,9 @@
       <if test="cu_recamount != null">
         cu_recamount,
       </if>
+      <if test="cu_preamount != null">
+        cu_preamount,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -227,6 +230,9 @@
       <if test="cu_recamount != null">
         #{cu_recamount,jdbcType=DOUBLE},
       </if>
+      <if test="cu_preamount != null">
+        #{cu_preamount,jdbcType=DOUBLE},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Customer">
@@ -316,6 +322,9 @@
       <if test="cu_recamount != null">
         cu_recamount = #{cu_recamount,jdbcType=DOUBLE},
       </if>
+      <if test="cu_preamount != null">
+        cu_preamount = #{cu_preamount,jdbcType=DOUBLE},
+      </if>
     </set>
     where cu_id = #{id,jdbcType=INTEGER}
   </update>
@@ -348,7 +357,8 @@
       cu_text4 = #{cu_text4,jdbcType=VARCHAR},
       cu_text5 = #{cu_text5,jdbcType=VARCHAR},
       cu_leftamount = #{cu_leftamount,jdbcType=DOUBLE},
-      cu_recamount = #{cu_recamount,jdbcType=DOUBLE}
+      cu_recamount = #{cu_recamount,jdbcType=DOUBLE},
+      cu_preamount = #{cu_preamount,jdbcType=DOUBLE}
     where cu_id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -364,7 +374,7 @@
   </select>
 
   <select id="validNameAndCodeWhenUpdate" parameterType="com.usoftchina.saas.document.entities.Customer" resultType="int">
-    select count(1) from customer where cu_code = #{cu_code,jdbcType=VARCHAR} or cu_name = #{cu_name,jdbcType=VARCHAR}
+    select count(1) from customer where (cu_code = #{cu_code,jdbcType=VARCHAR} or cu_name = #{cu_name,jdbcType=VARCHAR})
     and cu_id != #{id}
   </select>
 

+ 27 - 15
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -8,8 +8,8 @@
         <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
         <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
         <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
-        <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="INTEGER" />
-        <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="INTEGER" />
+        <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="DOUBLE" />
+        <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="DOUBLE" />
         <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
         <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
         <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
@@ -31,6 +31,7 @@
         <result column="ve_payamount" property="ve_payamount" jdbcType="DOUBLE" />
         <result column="ve_leftamount" property="ve_leftamount" jdbcType="DOUBLE" />
         <result column="ve_beginym" property="ve_beginym" jdbcType="INTEGER" />
+        <result column="ve_preamount" property="ve_preamount" jdbcType="DOUBLE" />
     </resultMap>
     <resultMap id="VendorDTOResultMapper" type="com.usoftchina.saas.document.dto.VendorDTO">
         <id column="ve_id" property="id" jdbcType="INTEGER" />
@@ -60,8 +61,8 @@
         <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
         <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
         <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
-        <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="INTEGER" />
-        <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="INTEGER" />
+        <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="DOUBLE" />
+        <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="DOUBLE" />
         <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
         <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
         <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
@@ -107,7 +108,7 @@
         ve_id, ve_code, ve_name, ve_uu, ve_type, ve_begindate, ve_beginapamount, ve_beginprepayamount,
         ve_promisedays, ve_taxrate, ve_nsrzh, ve_bankaccount, ve_bankcode, ve_status, ve_statuscode,
         ve_recordid, ve_recordname, ve_initdate, companyId, updaterId, updateTime, ve_text1,
-        ve_text2, ve_text3, ve_text4, ve_text5, ve_payamount, ve_leftamount, ve_beginym
+        ve_text2, ve_text3, ve_text4, ve_text5, ve_payamount, ve_leftamount, ve_beginym, ve_preamount
     </sql>
     <select id="selectByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Long" >
         select
@@ -129,18 +130,19 @@
         ve_initdate, companyId, updaterId,
         updateTime, ve_text1, ve_text2,
         ve_text3, ve_text4, ve_text5,
-        ve_payamount, ve_leftamount, ve_beginym
+        ve_payamount, ve_leftamount, ve_beginym ,ve_preamount
         )
         values (#{ve_code,jdbcType=VARCHAR}, #{ve_name,jdbcType=VARCHAR},
         #{ve_uu,jdbcType=VARCHAR}, #{ve_type,jdbcType=VARCHAR}, #{ve_begindate,jdbcType=TIMESTAMP},
-        #{ve_beginapamount,jdbcType=DECIMAL}, #{ve_beginprepayamount,jdbcType=DECIMAL},
+        #{ve_beginapamount,jdbcType=DOUBLE}, #{ve_beginprepayamount,jdbcType=DOUBLE},
         #{ve_promisedays,jdbcType=DECIMAL}, #{ve_taxrate,jdbcType=DOUBLE}, #{ve_nsrzh,jdbcType=VARCHAR},
         #{ve_bankaccount,jdbcType=VARCHAR}, #{ve_bankcode,jdbcType=VARCHAR}, #{ve_status,jdbcType=VARCHAR},
         #{ve_statuscode,jdbcType=VARCHAR}, #{ve_recordid,jdbcType=DECIMAL}, #{ve_recordname,jdbcType=VARCHAR},
         #{ve_initdate,jdbcType=TIMESTAMP}, #{companyId,jdbcType=DECIMAL}, #{updaterId,jdbcType=DECIMAL},
         #{updateTime,jdbcType=TIMESTAMP}, #{ve_text1,jdbcType=VARCHAR}, #{ve_text2,jdbcType=VARCHAR},
         #{ve_text3,jdbcType=VARCHAR}, #{ve_text4,jdbcType=VARCHAR}, #{ve_text5,jdbcType=VARCHAR},
-        #{ve_payamount,jdbcType=DOUBLE}, #{ve_leftamount,jdbcType=DOUBLE}, #{ve_beginym,jdbcType=INTEGER}
+        #{ve_payamount,jdbcType=DOUBLE}, #{ve_leftamount,jdbcType=DOUBLE}, #{ve_beginym,jdbcType=INTEGER},
+        #{ve_preamount,jdbcTyp=DOUBLE}
         )
     </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
@@ -233,6 +235,9 @@
             <if test="ve_beginym != null" >
                 ve_beginym,
             </if>
+            <if test="ve_preamount !=null" >
+                ve_preamount,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
             <if test="ve_code != null" >
@@ -251,10 +256,10 @@
                 #{ve_begindate,jdbcType=TIMESTAMP},
             </if>
             <if test="ve_beginapamount != null" >
-                #{ve_beginapamount,jdbcType=DECIMAL},
+                #{ve_beginapamount,jdbcType=DOUBLE},
             </if>
             <if test="ve_beginprepayamount != null" >
-                #{ve_beginprepayamount,jdbcType=DECIMAL},
+                #{ve_beginprepayamount,jdbcType=DOUBLE},
             </if>
             <if test="ve_promisedays != null" >
                 #{ve_promisedays,jdbcType=DECIMAL},
@@ -319,6 +324,9 @@
             <if test="ve_beginym != null" >
                 #{ve_beginym,jdbcType=INTEGER},
             </if>
+            <if test="ve_preamount !=null" >
+                #{ve_preamount,jdbcType=DOUBLE},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
@@ -340,10 +348,10 @@
                 ve_begindate = #{ve_begindate,jdbcType=TIMESTAMP},
             </if>
             <if test="ve_beginapamount != null" >
-                ve_beginapamount = #{ve_beginapamount,jdbcType=DECIMAL},
+                ve_beginapamount = #{ve_beginapamount,jdbcType=DOUBLE},
             </if>
             <if test="ve_beginprepayamount != null" >
-                ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DECIMAL},
+                ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DOUBLE},
             </if>
             <if test="ve_promisedays != null" >
                 ve_promisedays = #{ve_promisedays,jdbcType=DECIMAL},
@@ -408,6 +416,9 @@
             <if test="ve_beginym != null" >
                 ve_beginym = #{ve_beginym,jdbcType=INTEGER},
             </if>
+            <if test="ve_preamount !=null" >
+                #{ve_preamount,jdbcType=DOUBLE},
+            </if>
         </set>
         where ve_id = #{id}
     </update>
@@ -418,8 +429,8 @@
         ve_uu = #{ve_uu,jdbcType=VARCHAR},
         ve_type = #{ve_type,jdbcType=VARCHAR},
         ve_begindate = #{ve_begindate,jdbcType=TIMESTAMP},
-        ve_beginapamount = #{ve_beginapamount,jdbcType=DECIMAL},
-        ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DECIMAL},
+        ve_beginapamount = #{ve_beginapamount,jdbcType=DOUBLE},
+        ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DOUBLE},
         ve_promisedays = #{ve_promisedays,jdbcType=DECIMAL},
         ve_taxrate = #{ve_taxrate,jdbcType=DOUBLE},
         ve_nsrzh = #{ve_nsrzh,jdbcType=VARCHAR},
@@ -440,7 +451,8 @@
         ve_text5 = #{ve_text5,jdbcType=VARCHAR},
         ve_payamount = #{ve_payamount,jdbcType=DOUBLE},
         ve_leftamount = #{ve_leftamount,jdbcType=DOUBLE},
-        ve_beginym = #{ve_beginym,jdbcType=INTEGER}
+        ve_beginym = #{ve_beginym,jdbcType=INTEGER},
+        ve_preamount =#{ve_preamount,jdbcType=DOUBLE}
         where ve_id = #{id}
     </update>
 

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

@@ -97,6 +97,16 @@
             <version>1.0.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>document-dto</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>document-server</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>

+ 10 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransferdetail.java

@@ -13,6 +13,8 @@ public class Fundtransferdetail extends CommonBaseEntity implements Serializable
 
     private Integer ftd_ym;
 
+    private Date ft_date;
+
     private Integer ftd_bankid;
 
     private String ftd_bankcode;
@@ -45,6 +47,14 @@ public class Fundtransferdetail extends CommonBaseEntity implements Serializable
 
     private String ftd_text5;
 
+    public Date getFt_date() {
+        return ft_date;
+    }
+
+    public void setFt_date(Date ft_date) {
+        this.ft_date = ft_date;
+    }
+
     public Integer getFtd_ftid() {
         return ftd_ftid;
     }

+ 9 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othreceiptsdetail.java

@@ -12,6 +12,7 @@ public class Othreceiptsdetail extends CommonBaseEntity implements Serializable
     private Integer ord_detno;
 
     private Integer ord_ym;
+    private Date or_date;
 
     private String ord_type;
 
@@ -31,6 +32,14 @@ public class Othreceiptsdetail extends CommonBaseEntity implements Serializable
 
     private String ord_text5;
 
+    public Date getOr_date() {
+        return or_date;
+    }
+
+    public void setOr_date(Date or_date) {
+        this.or_date = or_date;
+    }
+
     public Integer getOrd_orid() {
         return ord_orid;
     }

+ 10 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendingsdetail.java

@@ -13,6 +13,8 @@ public class Othspendingsdetail extends CommonBaseEntity implements Serializable
 
     private Integer osd_ym;
 
+    private Date os_date;
+
     private String osd_type;
 
     private Double osd_nowbalance;
@@ -31,6 +33,14 @@ public class Othspendingsdetail extends CommonBaseEntity implements Serializable
 
     private String osd_text5;
 
+    public Date getOs_date() {
+        return os_date;
+    }
+
+    public void setOs_date(Date os_date) {
+        this.os_date = os_date;
+    }
+
     public Integer getOsd_orid() {
         return osd_orid;
     }

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

@@ -92,9 +92,15 @@ public class FundtransferServiceImpl implements FundtransferService {
             this.insert(fundtran);
         }else {
             fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
+            List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
+            Iterator isList = fundtransferdetailList.iterator();
+            while (isList.hasNext()){
+                Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
+                fundtransferdetail.setFt_date(fundtransfer.getFt_date());
+                fundtransferdetailMapper.updateByPrimaryKeySelective(fundtransferdetail);
+            }
         }
 
-
         //取从表金额
         List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
         Iterator isList = fundtransferdetailList.iterator();

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

@@ -14,7 +14,10 @@ import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.money.mapper.BanksubledgerMapper;
 import com.usoftchina.saas.money.mapper.OthreceiptsMapper;
 import com.usoftchina.saas.money.mapper.OthreceiptsdetailMapper;
-import com.usoftchina.saas.money.po.*;
+import com.usoftchina.saas.money.po.Banksubledger;
+import com.usoftchina.saas.money.po.Othreceipts;
+import com.usoftchina.saas.money.po.Othreceiptsdetail;
+import com.usoftchina.saas.money.po.Othte;
 import com.usoftchina.saas.money.service.OthreceiptsService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -93,6 +96,13 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
             this.insert(othte);
         }else {
             othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
+            List<Othreceiptsdetail> othreceiptsdetailList = othte.getItems();
+            Iterator isList = othreceiptsdetailList.iterator();
+            while (isList.hasNext()){
+                Othreceiptsdetail fundtransferdetail = (Othreceiptsdetail) isList.next();
+                fundtransferdetail.setOr_date(othreceipts.getOr_date());
+                othreceiptsdetailMapper.updateByPrimaryKeySelective(fundtransferdetail);
+            }
         }
 
         Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode());

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

@@ -11,8 +11,13 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
-import com.usoftchina.saas.money.mapper.*;
-import com.usoftchina.saas.money.po.*;
+import com.usoftchina.saas.money.mapper.BanksubledgerMapper;
+import com.usoftchina.saas.money.mapper.OthspendingsMapper;
+import com.usoftchina.saas.money.mapper.OthspendingsdetailMapper;
+import com.usoftchina.saas.money.po.Banksubledger;
+import com.usoftchina.saas.money.po.Othsp;
+import com.usoftchina.saas.money.po.Othspendings;
+import com.usoftchina.saas.money.po.Othspendingsdetail;
 import com.usoftchina.saas.money.service.OthspendingsService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -121,6 +126,13 @@ public class OthspendingsServiceImpl implements OthspendingsService {
             this.insert(othsp);
         }else {
             othspendingsMapper.updateByPrimaryKeySelective(othspendings);
+            List<Othspendingsdetail> othspendingsdetailList = othsp.getItems();
+            Iterator isList = othspendingsdetailList.iterator();
+            while (isList.hasNext()){
+                Othspendingsdetail othspendingsdetail = (Othspendingsdetail) isList.next();
+                othspendingsdetail.setOs_date(othspendings.getOs_date());
+                othspendingsdetailMapper.updateByPrimaryKeySelective(othspendingsdetail);
+            }
         }
 
         Double amount = banksubledgerMapper.selectThisamount(othspendings.getOs_bankcode());

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

@@ -10,6 +10,10 @@ import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.entities.Bankinformation;
+import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.mapper.BankinformationMapper;
+import com.usoftchina.saas.document.mapper.VendorMapper;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
@@ -42,6 +46,10 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     private SubledgerMapper subledgerMapper;
     @Autowired
     private BanksubledgerMapper banksubledgerMapper;
+    @Autowired
+    private VendorMapper vendorMapper;
+    @Autowired
+    private BankinformationMapper bankinformationMapper;
 
     public DocBaseDTO insert(Pay pay) {
         Paybalance paybalance = pay.getMain();
@@ -184,15 +192,74 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         Double amountTotal = new Double(0);
         for (Paybalancedet det: paybalancedet) {
             amountTotal = amountTotal + det.getPd_amount();
+            //更新账户资料金额
+            Bankinformation bankinformation = new Bankinformation();
+            Bankinformation nowBankInformation = bankinformationMapper.selectByPrimaryKey(det.getPd_bankid());
+            bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()+det.getPd_amount());
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+        }
+        //更新主表pb_pbdamount=从表二金额合计
+        Double amountTotal2 = new Double(0);
+        for (Paybalancedetail detail : paybalancedetail){
+            amountTotal2 = amountTotal2 + detail.getPbd_amount();
         }
         updatePay.setId(pay.getMain().getId());
         updatePay.setPb_pdamount(amountTotal);
+        updatePay.setPb_pbdamount(amountTotal2);
+        paybalanceMapper.updateByPrimaryKeySelective(updatePay);
         //updateByPrimaryKeySelective
-
+        /**
+         * ve_preamount=nvl(ve_preamount,0)+pb_preamount,
+         * ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
+         * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
+         */
+        Vendor vendorData = vendorMapper.selectByPrimaryKey(Long.valueOf(String.valueOf(paybalance.getPb_vendid())));
+        Double preamount = vendorData.getVe_preamount();
+        Double beginapamount = vendorData.getVe_beginapamount();
+        Double beginprepayamount= vendorData.getVe_beginprepayamount();
+        Double payamount = vendorData.getVe_payamount();
+
+        Vendor vendor = new Vendor();
+        vendor.setId(Long.valueOf(String.valueOf(paybalance.getPb_vendid())));
+        vendor.setVe_preamount(preamount+amountTotal);
+        vendor.setVe_payamount(payamount-amountTotal2);
+        vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount-amountTotal2-preamount-amountTotal);
+        vendorMapper.updateByPrimaryKeySelective(vendor);
     }
 
     @Override
     public void unAudit(int id) {
+        //更新供应商资料
+        /**
+         * ve_preamount=nvl(ve_preamount,0)-pb_preamount,
+         * ve_payamount=nvl(ve_payamount,0)+pb_pbdamount,
+         * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
+         */
+        Paybalance pay = paybalanceMapper.selectByPrimaryKey(Long.valueOf(id));
+        Double pay_preamount = pay.getPb_preamount();
+        Double pay_pbdamount = pay.getPb_pbdamount();
+        Vendor vendorData = vendorMapper.selectByPrimaryKey(Long.valueOf(String.valueOf(pay.getPb_vendid())));
+        Double preamount = vendorData.getVe_preamount();
+        Double beginapamount = vendorData.getVe_beginapamount();
+        Double beginprepayamount= vendorData.getVe_beginprepayamount();
+        Double payamount = vendorData.getVe_payamount();
+        Vendor vendor = new Vendor();
+        vendor.setId(Long.valueOf(String.valueOf(pay.getPb_vendid())));
+        vendor.setVe_preamount(preamount-pay_preamount);
+        vendor.setVe_payamount(payamount+pay_pbdamount);
+        vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+pay_pbdamount-preamount+pay_preamount);
+        vendorMapper.updateByPrimaryKeySelective(vendor);
+
+        //更新账户资料金额
+        List<Paybalancedet> paybalancedet = paybalancedetMapper.selectByPrimaryKey(id);
+        for (Paybalancedet det:paybalancedet) {
+            Bankinformation bankinformation = new Bankinformation();
+            Bankinformation nowBankInformation = bankinformationMapper.selectByPrimaryKey(det.getPd_bankid());
+            bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()-det.getPd_amount());
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+        }
+
+
         Paybalance paybalance = new Paybalance();
         paybalance.setId(Long.valueOf(id));
         paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
@@ -204,12 +271,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         subledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
         banksubledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
 
-        //更新供应商资料
-        /**
-         * ve_preamount=nvl(ve_preamount,0)-pb_preamount,
-         * ve_payamount=nvl(ve_payamount,0)+pb_pbdamount,
-         * ve_leftamount=ve_beginapamount-e_beginprepayamount+ve_payamount-ve_preamount;
-         */
+
     }
 
 

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

@@ -10,11 +10,18 @@ import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.entities.Bankinformation;
+import com.usoftchina.saas.document.entities.Customer;
+import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.mapper.BankinformationMapper;
+import com.usoftchina.saas.document.mapper.CustomerMapper;
+import com.usoftchina.saas.document.mapper.VendorMapper;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.RecbalanceService;
 import com.usoftchina.saas.page.PageRequest;
+import io.netty.util.internal.MathUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -40,6 +47,10 @@ public class RecbalanceServiceImpl implements RecbalanceService {
     private BanksubledgerMapper banksubledgerMapper;
     @Autowired
     private SubledgerMapper subledgerMapper;
+    @Autowired
+    private CustomerMapper customerMapper;
+    @Autowired
+    private BankinformationMapper bankinformationMapper;
 
     @Override
     public DocBaseDTO insert(Rec rec) {
@@ -203,21 +214,81 @@ public class RecbalanceServiceImpl implements RecbalanceService {
             recbalanceMapper.updateByPrimaryKeySelective(recbalance);
         }
 
-        Recbalance updatePay = new Recbalance();
+        Recbalance updateRay = new Recbalance();
         List<Recbalancedet> recbalancedet = rec.getItems1();
         List<Recbalancedetail> recbalancedetail = rec.getItems2();
-        //更新主表付款金额:pb_pdamount=从表一金额合计
+        //更新主表付款金额:rb_rdamount=从表一金额合计
         Double amountTotal = new Double(0);
         for (Recbalancedet det: recbalancedet) {
             amountTotal = amountTotal + det.getRd_amount();
+            //更新账户资料金额
+            Bankinformation bankinformation = new Bankinformation();
+            Bankinformation nowBankInformation = bankinformationMapper.selectByPrimaryKey(det.getRd_bankid());
+            bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()+det.getRd_amount());
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+        }
+        //更新主表pb_pbdamount=从表二金额合计
+        Double amountTotal2 = new Double(0);
+        for (Recbalancedetail detail : recbalancedetail){
+            amountTotal2 = amountTotal2 + detail.getRbd_amount();
         }
-        updatePay.setId(rec.getMain().getId());
-        updatePay.setRb_rdamount(amountTotal);
-        //updateByPrimaryKeySelective
+        updateRay.setId(rec.getMain().getId());
+        updateRay.setRb_rdamount(amountTotal);
+        updateRay.setRb_rbdamount(amountTotal2);
+        recbalanceMapper.updateByPrimaryKeySelective(updateRay);
+        /**
+         * 更新客户资料
+         * cu_preamount=nvl(cu_preamount,0)+rb_preamount,
+         * cu_recamount=nvl(cu_recamount,0)-rb_rbdamount,
+         * cu_leftamount=cu_beginaramount-cu_beginprerecamount+cu_recamount-cu_preamount;
+         */
+        Customer customerData = customerMapper.selectByPrimaryKey(Long.valueOf(String.valueOf(recbalance.getRb_custid())));
+        Double preamount = customerData.getCu_preamount();
+        Double beginapamount = customerData.getCu_beginaramount();
+        Double beginprepayamount= customerData.getCu_beginprerecamount();
+        Double recamount = customerData.getCu_recamount();
+
+        Customer customer = new Customer();
+        customer.setId(Long.valueOf(String.valueOf(recbalance.getRb_custid())));
+        customer.setCu_preamount(preamount+amountTotal);
+        customer.setCu_recamount(recamount-amountTotal2);
+        customer.setCu_leftamount(beginapamount-beginprepayamount+recamount-amountTotal2-preamount-amountTotal);
+        customerMapper.updateByPrimaryKeySelective(customer);
     }
 
     @Override
     public void unAudit(Long id) {
+        //更新供应商资料
+        /**
+         * ve_preamount=nvl(ve_preamount,0)-pb_preamount,
+         * ve_payamount=nvl(ve_payamount,0)+pb_pbdamount,
+         * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
+         */
+        Recbalance rec = recbalanceMapper.selectByPrimaryKey(Long.valueOf(id));
+        Double pay_preamount = rec.getRb_preamount();
+        Double pay_pbdamount = rec.getRb_rbdamount();
+        Customer customerData = customerMapper.selectByPrimaryKey(Long.valueOf(String.valueOf(rec.getRb_custid())));
+        Double preamount = customerData.getCu_preamount();
+        Double beginapamount = customerData.getCu_beginaramount();
+        Double beginprepayamount= customerData.getCu_beginprerecamount();
+        Double recamount = customerData.getCu_recamount();
+        Customer customer = new Customer();
+        customer.setId(Long.valueOf(String.valueOf(rec.getRb_custid())));
+        customer.setCu_preamount(preamount-pay_preamount);
+        customer.setCu_recamount(recamount+pay_pbdamount);
+        customer.setCu_leftamount(beginapamount-beginprepayamount+recamount+pay_pbdamount-preamount+pay_preamount);
+        customerMapper.updateByPrimaryKeySelective(customer);
+
+        //更新账户资料金额
+        List<Recbalancedet> recbalancedet = recbalancedetMapper.selectByPrimaryKey(Math.toIntExact(id));
+        for (Recbalancedet det:recbalancedet) {
+            Bankinformation bankinformation = new Bankinformation();
+            Bankinformation nowBankInformation = bankinformationMapper.selectByPrimaryKey(det.getRd_bankid());
+            bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()-det.getRd_amount());
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+        }
+
+
         Recbalance recbalance = new Recbalance();
         recbalance.setId(id);
         recbalance.setRb_status(Status.UNAUDITED.getDisplay());

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

@@ -88,7 +88,6 @@
       <if test="updaterId != null" >
         updaterId,
       </if>
-        updatedate,
       <if test="ft_text1 != null" >
         ft_text1,
       </if>
@@ -136,7 +135,6 @@
       <if test="updaterId != null" >
         #{updaterId,jdbcType=INTEGER},
       </if>
-        #{now(),jdbcType=TIMESTAMP},
       <if test="ft_text1 != null" >
         #{ft_text1,jdbcType=VARCHAR},
       </if>
@@ -190,9 +188,7 @@
       <if test="updaterId != null" >
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updatedate != null" >
-        updatedate = #{updatedate,jdbcType=TIMESTAMP},
-      </if>
+      updatedate = now(),
       <if test="ft_text1 != null" >
         ft_text1 = #{ft_text1,jdbcType=VARCHAR},
       </if>

+ 4 - 5
applications/money/money-server/src/main/resources/mapper/FundtransferdetailMapper.xml

@@ -6,6 +6,7 @@
     <result column="ftd_ftid" property="ftd_ftid" jdbcType="INTEGER" />
     <result column="ftd_detno" property="ftd_detno" jdbcType="INTEGER" />
     <result column="ftd_ym" property="ftd_ym" jdbcType="INTEGER" />
+      <result column="ft_date" property="ft_date" jdbcType="TIMESTAMP" />
     <result column="ftd_bankid" property="ftd_bankid" jdbcType="INTEGER" />
     <result column="ftd_bankcode" property="ftd_bankcode" jdbcType="VARCHAR" />
     <result column="ftd_bankname" property="ftd_bankname" jdbcType="VARCHAR" />
@@ -207,8 +208,8 @@
       <if test="ftd_detno != null" >
         ftd_detno = #{ftd_detno,jdbcType=INTEGER},
       </if>
-      <if test="ftd_ym != null" >
-        ftd_ym = to_char(#{ftd_ym,jdbcType=INTEGER},'yyyymm'),
+      <if test="ft_date != null" >
+        ftd_ym = CONVERT(date_format(#{ft_date,jdbcType=TIMESTAMP},'%Y%m'),SIGNED),
       </if>
       <if test="ftd_bankid != null" >
         ftd_bankid = #{ftd_bankid,jdbcType=INTEGER},
@@ -246,9 +247,7 @@
       <if test="updaterId != null" >
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updatedate != null" >
-        updatedate = #{updatedate,jdbcType=TIMESTAMP},
-      </if>
+        updatedate = now(),
       <if test="ftd_text1 != null" >
         ftd_text1 = #{ftd_text1,jdbcType=VARCHAR},
       </if>

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

@@ -272,9 +272,7 @@
       <if test="updaterId != null" >
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updatedate != null" >
-        updatedate = #{updatedate,jdbcType=TIMESTAMP},
-      </if>
+      updatedate = now(),
       <if test="or_text1 != null" >
         or_text1 = #{or_text1,jdbcType=VARCHAR},
       </if>

+ 3 - 2
applications/money/money-server/src/main/resources/mapper/OthreceiptsdetailMapper.xml

@@ -6,6 +6,7 @@
     <result column="ord_orid" property="ord_orid" jdbcType="INTEGER" />
     <result column="ord_detno" property="ord_detno" jdbcType="INTEGER" />
     <result column="ord_ym" property="ord_ym" jdbcType="INTEGER" />
+    <result column="or_date" property="or_date" jdbcType="TIMESTAMP" />
     <result column="ord_type" property="ord_type" jdbcType="VARCHAR" />
     <result column="ord_nowbalance" property="ord_nowbalance" jdbcType="DOUBLE" />
     <result column="ord_remark" property="ord_remark" jdbcType="VARCHAR" />
@@ -149,8 +150,8 @@
       <if test="ord_detno != null" >
         ord_detno = #{ord_detno,jdbcType=INTEGER},
       </if>
-      <if test="ord_ym != null" >
-        ord_ym = to_char(#{ord_ym,jdbcType=INTEGER},'yyyymm'),
+      <if test="or_date != null" >
+        ord_ym = CONVERT(date_format(#{or_date,jdbcType=TIMESTAMP},'%Y%m'),SIGNED),
       </if>
       <if test="ord_type != null" >
         ord_type = #{ord_type,jdbcType=VARCHAR},

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

@@ -266,9 +266,7 @@
       <if test="updaterId != null" >
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updatedate != null" >
-        updatedate = #{updatedate,jdbcType=TIMESTAMP},
-      </if>
+      updatedate = now(),
       <if test="os_text1 != null" >
         os_text1 = #{os_text1,jdbcType=VARCHAR},
       </if>

+ 3 - 2
applications/money/money-server/src/main/resources/mapper/OthspendingsdetailMapper.xml

@@ -6,6 +6,7 @@
     <result column="osd_orid" property="osd_orid" jdbcType="INTEGER" />
     <result column="osd_detno" property="osd_detno" jdbcType="INTEGER" />
     <result column="osd_ym" property="osd_ym" jdbcType="INTEGER" />
+    <result column="os_date" property="os_date" jdbcType="TIMESTAMP" />
     <result column="osd_type" property="osd_type" jdbcType="VARCHAR" />
     <result column="osd_nowbalance" property="osd_nowbalance" jdbcType="DOUBLE" />
     <result column="osd_remark" property="osd_remark" jdbcType="VARCHAR" />
@@ -155,8 +156,8 @@
       <if test="osd_detno != null" >
         osd_detno = #{osd_detno,jdbcType=INTEGER},
       </if>
-      <if test="osd_ym != null" >
-        osd_ym = to_char(#{osd_ym,jdbcType=INTEGER}, 'yyyymm'),
+      <if test="os_date != null" >
+        osd_ym = CONVERT(date_format(#{os_date,jdbcType=TIMESTAMP},'%Y%m'),SIGNED),
       </if>
       <if test="osd_type != null" >
         osd_type = #{osd_type,jdbcType=VARCHAR},

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

@@ -374,9 +374,7 @@
       <if test="updaterId != null">
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updateTime != null">
-        updatedate = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
+      updatedate = now(),
       <if test="pb_text1 != null">
         pb_text1 = #{pb_text1,jdbcType=VARCHAR},
       </if>

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

@@ -536,9 +536,7 @@
       <if test="updaterId != null">
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updateTime != null">
-        updatedate = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
+      updatedate = now(),
       <if test="rb_text1 != null">
         rb_text1 = #{rb_text1,jdbcType=VARCHAR},
       </if>

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

@@ -83,9 +83,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             con = "1=1";
         }
         if (null == req || StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
-              list = prodInOutListMapper.selectProdInOutListByCondition(con,companyId);
+                list = prodInOutListMapper.selectProdInOutBycondition(con,companyId);
         } else {
-              list = prodInOutListMapper.selectProdInOutBycondition(con,companyId);
+            list = prodInOutListMapper.selectProdInOutListByCondition(con,companyId);
         }
         return list;
     }

+ 9 - 9
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -73,30 +73,30 @@
 
   </resultMap>
 
-
-  <select id="selectProdInOutListByCondition"  resultMap="BaseResultMap">
-    select  *  from prodinout left join prodiodetail on pi_id = pd_piid
+  <select id="selectProdInOutBycondition"  resultMap="BaseResultMap">
+    select  *  from prodinout
     <where>
       <if test="con != null">
         ${con}
       </if>
       <if test="companyId != null">
-        and   prodinout.companyid = #{companyId}
+        and   companyid = #{companyId}
       </if>
-    </where>  order by pi_id,pd_pdno
+    </where>  order by pi_id
   </select>
 
-  <select id="selectProdInOutBycondition"  resultMap="BaseResultMap">
-    select  *  from prodinout
+  <select id="selectProdInOutListByCondition"  resultMap="BaseResultMap">
+    select  *  from prodinout left join prodiodetail on pi_id = pd_piid
+    left join product on pd_prodcode=pr_code
     <where>
       <if test="con != null">
         ${con}
       </if>
       <if test="companyId != null">
-        and  companyid = #{companyId}
+        and  prodinout.companyid = #{companyId}
       </if>
     </where>
-    order by pi_id
+    order by pi_id,pd_pdno
   </select>
 
 

+ 36 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleReportController.java

@@ -0,0 +1,36 @@
+package com.usoftchina.saas.sale.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.service.SaleReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author: guq
+ * @create: 2018-11-09 11:23
+ **/
+@RestController
+@RequestMapping("/report")
+public class SaleReportController {
+
+    @Autowired
+    private SaleReportService saleReportService;
+
+    @GetMapping("/SaleProfit")
+    public Result SaleProfit(PageRequest page, ListReqDTO req) {
+        PageInfo listData = saleReportService.getSaleProfitData(page, req);
+        return Result.success(listData);
+    }
+
+    @GetMapping("/SaleRec")
+    public Result SaleRec(PageRequest page, ListReqDTO req) {
+        PageInfo listData = saleReportService.getSaleRecData(page, req);
+        return Result.success(listData);
+    }
+
+}

+ 3 - 2
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleListMapper.java

@@ -8,7 +8,8 @@ import java.util.List;
 
 public interface SaleListMapper {
 
-    List<SaleList> selectPurchaseBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+    List<SaleList> selectSaleListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+
+    List<SaleList> selectSaleByCondition(@Param("con") String con, @Param("companyId") Long companyId);
 
-    List<SaleList> selectPurchaseListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 11 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleProfitViewMapper.java

@@ -0,0 +1,11 @@
+package com.usoftchina.saas.sale.mapper;
+
+import com.usoftchina.saas.sale.po.report.SaleProfitView;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SaleProfitViewMapper {
+
+    List<SaleProfitView> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+}

+ 11 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SalerecViewMapper.java

@@ -0,0 +1,11 @@
+package com.usoftchina.saas.sale.mapper;
+
+import com.usoftchina.saas.sale.po.report.SalerecView;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SalerecViewMapper {
+
+    List<SalerecView> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+}

+ 3 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.sale.po;
 
+import com.usoftchina.saas.document.dto.ProductDTO;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -102,4 +103,6 @@ public class SaleList implements Serializable{
     private String sd_text4;
 
     private String sd_text5;
+
+    private ProductDTO productDTO;
 }

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

@@ -0,0 +1,53 @@
+package com.usoftchina.saas.sale.po.report;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2018-11-09 10:55
+ **/
+@Data
+public class SaleProfitView {
+
+    private Integer companyid;
+
+    private String sa_custcode;
+
+    private String sa_custname;
+
+    private String sa_sellercode;
+
+    private String sa_seller;
+
+    private Date sa_date;
+
+    private String pd_inoutno;
+
+    private String pd_piclass;
+
+    private String pr_kind;
+
+    private String pr_code;
+
+    private String pr_detail;
+
+    private String pr_spec;
+
+    private String pr_unit;
+
+    private Double pd_outqty;
+
+    private Double pd_sendprice;
+
+    private Double pd_taxrate;
+
+    private Double pd_ordertotal;
+
+    private Double pd_total;
+
+    private Double pd_profit;
+
+    private Double pd_profitpresent;
+}

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

@@ -0,0 +1,38 @@
+package com.usoftchina.saas.sale.po.report;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2018-11-09 11:16
+ **/
+@Data
+public class SalerecView {
+    private Integer rb_id;
+
+    private String rb_code;
+
+    private String rb_custcode;
+
+    private String rb_custname;
+
+    private String rb_manname;
+
+    private Date rb_date;
+
+    private String rbd_slcode;
+
+    private String rbd_slkind;
+
+    private Double rbd_nowbalance;
+
+    private Double rb_rbdamount;
+
+    private Double rb_backrate;
+
+    private String rb_remark;
+
+    private Integer companyid;
+}

+ 12 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleReportService.java

@@ -0,0 +1,12 @@
+package com.usoftchina.saas.sale.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.po.report.SalerecView;
+
+public interface SaleReportService {
+    PageInfo getSaleProfitData(PageRequest page, ListReqDTO req);
+
+    PageInfo getSaleRecData(PageRequest page, ListReqDTO req);
+}

+ 67 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleReportServiceImpl.java

@@ -0,0 +1,67 @@
+package com.usoftchina.saas.sale.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.mapper.SaleProfitViewMapper;
+import com.usoftchina.saas.sale.mapper.SalerecViewMapper;
+import com.usoftchina.saas.sale.service.SaleReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2018-11-09 11:43
+ **/
+@Service
+public class SaleReportServiceImpl implements SaleReportService{
+
+    @Autowired
+    private SaleProfitViewMapper saleProfitViewMapper;
+    @Autowired
+    private SalerecViewMapper salerecViewMapper;
+
+    @Override
+    public PageInfo getSaleProfitData(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "SaleProfit");
+    }
+
+    @Override
+    public PageInfo getSaleRecData(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "SaleRec");
+    }
+
+    private PageInfo getListDATA(PageRequest page, ListReqDTO req, String type) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //查询数据
+        List lists = getListByType(req, type);
+        //取分页信息
+        PageInfo pageInfo = new PageInfo(lists);
+        return pageInfo;
+    }
+
+    private List getListByType(ListReqDTO req, String type) {
+        List list = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        if ("SaleProfit".equals(type)) {
+            list = saleProfitViewMapper.selectByCondition(con, companyId);
+        } else if ("SaleRec".equals(type)){
+            list = salerecViewMapper.selectByCondition(con, companyId);
+        }
+        return list;
+    }
+}

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

@@ -334,10 +334,11 @@ public class SaleServiceImpl implements SaleService{
         if (null == con) {
             con = "1=1";
         }
+
         if (null == req || StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
-            list = saleListMapper.selectPurchaseBycondition(con, companyId);
+            list = saleListMapper.selectSaleByCondition(con, companyId);
         } else {
-            list = saleListMapper.selectPurchaseListByCondition(con, companyId);
+            list = saleListMapper.selectSaleListByCondition(con, companyId);
         }
         return list;
     }

+ 32 - 2
applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml

@@ -48,9 +48,39 @@
         <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" />
+        <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
+            <id column="pr_id" property="id"/>
+            <result column="pr_code" property="pr_code"/>
+            <result column="pr_detail" property="pr_detail"/>
+            <result column="pr_spec" property="pr_spec"/>
+            <result column="pr_unit" property="pr_unit"/>
+            <result column="pr_kind" property="pr_kind"/>
+            <result column="pr_orispeccode" property="pr_orispeccode"/>
+            <result column="pr_whid" property="pr_whid"/>
+            <result column="pr_whcode" property="pr_whcode"/>
+            <result column="pr_whname" property="pr_whname"/>
+            <result column="pr_zxbzs" property="pr_zxbzs"/>
+            <result column="pr_leadtime" property="pr_leadtime"/>
+            <result column="pr_brand" property="pr_brand"/>
+            <result column="pr_standardprice" property="pr_standardprice"/>
+            <result column="pr_purcprice" property="pr_purcprice"/>
+            <result column="pr_saleprice" property="pr_saleprice"/>
+            <result column="pr_vendid" property="pr_vendid"/>
+            <result column="pr_vendname" property="pr_vendname"/>
+            <result column="pr_vendcode" property="pr_vendcode"/>
+            <result column="pr_docdate" property="pr_docdate"/>
+            <result column="pr_recordmanid" property="pr_recordmanid"/>
+            <result column="pr_recordman" property="pr_recordman"/>
+            <result column="pr_status" property="pr_status"/>
+            <result column="pr_statuscode" property="pr_statuscode"/>
+            <result column="pr_text1" property="pr_text1"/>
+            <result column="pr_text2" property="pr_text2"/>
+            <result column="pr_text3" property="pr_text3"/>
+            <result column="pr_text4" property="pr_text4"/>
+        </association>
     </resultMap>
 
-    <select id="selectPurchaseListByCondition" resultMap="BaseResultMap">
+    <select id="selectSaleListByCondition" resultMap="BaseResultMap">
         select  *  from sale left join saledetail on sa_id=sd_said left join product
         on sd_prodid = pr_id and sale.companyId = product.companyid
         <where>
@@ -63,7 +93,7 @@
         </where>  order by sd_detno desc
     </select>
 
-    <select id="selectPurchaseBycondition" resultMap="BaseResultMap">
+    <select id="selectSaleByCondition" resultMap="BaseResultMap">
         select  *  from sale
         <where>
             <if test="con != null">

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

@@ -0,0 +1,38 @@
+<?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.sale.mapper.SaleProfitViewMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.sale.po.report.SaleProfitView" >
+    <result column="sa_custcode" property="sa_custcode" jdbcType="VARCHAR" />
+    <result column="sa_custname" property="sa_custname" jdbcType="VARCHAR" />
+    <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="pd_inoutno" property="pd_inoutno" jdbcType="VARCHAR" />
+    <result column="pd_piclass" property="pd_piclass" jdbcType="VARCHAR" />
+    <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR" />
+    <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
+    <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
+    <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
+    <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR" />
+    <result column="pd_outqty" property="pd_outqty" jdbcType="DOUBLE" />
+    <result column="pd_sendprice" property="pd_sendprice" jdbcType="DOUBLE" />
+    <result column="pd_taxrate" property="pd_taxrate" jdbcType="DOUBLE" />
+    <result column="pd_ordertotal" property="pd_ordertotal" jdbcType="DOUBLE" />
+    <result column="pd_total" property="pd_total" jdbcType="DOUBLE" />
+    <result column="pd_profit" property="pd_profit" jdbcType="DOUBLE" />
+    <result column="pd_profitpresent" property="pd_profitpresent" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+  </resultMap>
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from Sale_Profit_View
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by sa_date desc
+  </select>
+ </mapper>

+ 31 - 0
applications/sale/sale-server/src/main/resources/mapper/SalerecViewMapper.xml

@@ -0,0 +1,31 @@
+<?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.sale.mapper.SalerecViewMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.sale.po.report.SalerecView" >
+    <result column="rb_id" property="rb_id" jdbcType="INTEGER" />
+    <result column="rb_code" property="rb_code" jdbcType="VARCHAR" />
+    <result column="rb_custcode" property="rb_custcode" jdbcType="VARCHAR" />
+    <result column="rb_custname" property="rb_custname" jdbcType="VARCHAR" />
+    <result column="rb_manname" property="rb_manname" jdbcType="VARCHAR" />
+    <result column="rb_date" property="rb_date" jdbcType="TIMESTAMP" />
+    <result column="rbd_slcode" property="rbd_slcode" jdbcType="VARCHAR" />
+    <result column="rbd_slkind" property="rbd_slkind" jdbcType="VARCHAR" />
+    <result column="rbd_nowbalance" property="rbd_nowbalance" jdbcType="DOUBLE" />
+    <result column="rb_rbdamount" property="rb_rbdamount" jdbcType="DOUBLE" />
+    <result column="rb_backrate" property="rb_backrate" jdbcType="DOUBLE" />
+    <result column="rb_remark" property="rb_remark" jdbcType="VARCHAR" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+  </resultMap>
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from Salerec_View
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by rb_date desc
+  </select>
+</mapper>

+ 1 - 1
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -138,7 +138,7 @@ Ext.define('saas.view.core.base.GridPanel', {
     },
 
     onLoad:function(){
-        this.store.load();
+        this.ownerCt.ownerCt.store.load();
     },
 
     onVastDeal:function(url,type){

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

@@ -120,6 +120,7 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                         }
                     }
                 }
+                me.ownerCt.trigger.aftertrigger(me.ownerCt.trigger,record);
             }
             me.ownerCt.close();
         }

+ 7 - 2
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -179,7 +179,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
             var count = f.store.getCount();
             var searchCount = false;//校验数据库是否有该字段
             var dbfinds = me.dbfinds;
-            if(count>0){
+            if(f.value&&f.value!=''){
                 //添加默认条件
                 var searchField = null;
                 var dbCondition = [];
@@ -221,7 +221,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                     failure: function(response, opts) {}
                 }); 
             }
-            if(!f.value||f.value==''||count==0||!searchCount){
+            if(!f.value||f.value==''||!searchCount){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {
@@ -283,10 +283,15 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                         }
                     }
                 }
+                me.aftertrigger(me,record);
             }
         }
     },
 
+    aftertrigger:function(f){
+        return true;
+    },
+
     getValue: function(f) {
         var me = this,val = me.rawToValue(me.processRawValue(me.getRawValue()));
         me.value = val;

+ 2 - 2
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -173,7 +173,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
             var count = f.store.getCount();
             var searchCount = false;//校验数据库是否有该字段
             var dbfinds = me.dbfinds;
-            if(count>0){
+            if(f.value&&f.value!=''){
                 //添加默认条件
                 var searchField = null;
                 var dbCondition = [];
@@ -215,7 +215,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                     failure: function(response, opts) {}
                 }); 
             }
-            if(!f.value||f.value==''||count==0||!searchCount){
+            if(!f.value||f.value==''||!searchCount){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {

+ 16 - 1
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -5,7 +5,22 @@ Ext.define('saas.view.document.bom.BasePanel', {
     controller: 'document-bom-basepanel',
     viewModel: 'document-bom-basepanel',
 
-    searchField:[],
+    searchField:[{ 
+        xtype : "textfield", 
+        name : "bo_mothercode", 
+        emptyText : "母件编号", 
+        width:120
+    },{
+        xtype : "textfield", 
+        name : "bo_mothername", 
+        emptyText : "母件名称", 
+        width:120
+    },{
+        xtype : "textfield", 
+        name : "bo_status", 
+        emptyText : "BOM状态",    
+        width:100
+    }],
 
     //字段属性
     _formXtype:'document-bom-formpanel',

+ 2 - 1
frontend/saas-web/app/view/document/product/FormController.js

@@ -102,7 +102,8 @@ Ext.define('saas.view.document.product.FormController', {
                             allowBlank : true, 
                             width:260,
                             getCondition:function(v){
-                                return "((wh_code) like '%"+v.toUpperCase()+"%' or (wh_description) like '%"+v.toUpperCase()+"%')";
+                                return "((wh_code) like '%"+v.toUpperCase()+"%' or (wh_description) like '%"+v.toUpperCase()+"%'"+
+                                " or (wh_type) like '%"+v.toUpperCase()+"%')";
                             }
                         }],
                         //窗口列设置

+ 1 - 1
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -175,7 +175,7 @@ Ext.define('saas.view.document.product.FormPanel', {
         name : "pr_whcode", 
         bind : "{pr_whcode}", 
         fieldLabel : "仓库编号", 
-        allowBlank : false, 
+        allowBlank : true, 
         columnWidth : 0.25, 
     }, {
         xtype : "textfield", 

+ 1 - 0
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -165,6 +165,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 text : "已转数", 
                 dataIndex : "pd_yqty", 
                 width : 120.0,
+                hidden:true,
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 8,

+ 11 - 21
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -22,27 +22,31 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
     }, {
         xtype: 'condatefield',
         name: 'pu_date',
-        fieldLabel: '采购日期',
+        fieldLabel: '单据日期',
         columnWidth: 0.5,
         operation: 'between'
     }, {
         xtype: 'dbfindtrigger',
         name: 'pu_vendcode',
-        fieldLabel: '供应商编号'
+        fieldLabel: '供应商编号',
+        hidden:true
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pu_vendname',
-        fieldLabel: '供应商名称'
+        fieldLabel: '供应商名称',
+        emptyText:'输入供应商编号或名称'
     }, {
         xtype: 'dbfindtrigger',
         name: 'pd_prodcode',
         fieldLabel: '物料编号',
-        showDetail: true
+        showDetail: true,
+        hidden:true
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pr_detail',
         fieldLabel: '物料名称',
-        showDetail: true
+        showDetail: true,
+        emptyText:'输入物料编号或名称',
     }, {
         xtype: 'combobox',
         name: 'pu_statuscode',
@@ -77,20 +81,6 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
             ["CLOSE", "已关闭"]
         ]
     }],
-    moreQueryFormItems: [{
-        xtype: 'textfield',
-        name: 'pu_buyername',
-        fieldLabel: '采购员'
-    }, {
-        xtype: 'textfield',
-        name: 'pu_total',
-        fieldLabel: '金额'
-    }, {
-        xtype: 'condatefield',
-        name: 'pu_delivery',
-        fieldLabel: '交货日期',
-        columnWidth: 1
-    }],
     queryGridConfig: {
         idField: 'pu_id',
         codeField: 'pu_code',

+ 2 - 2
frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js

@@ -6,7 +6,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanelController', {
         var me = this;
         this.control({
             // 供应商编号
-            'dbfindtrigger[name=pu_vendcode]':{
+            'dbfindtrigger[name=pu_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/vendor/list',
@@ -78,7 +78,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanelController', {
                 }
             },
             // 放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            'dbfindtrigger[name=pr_detail]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         conditionCode:'pr_code',

+ 2 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -187,7 +187,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 }
             },            {
                 text : "已转数", 
-                dataIndex : "pd_yqty", 
+                dataIndex : "pd_yqty",
+                hidden:true, 
                 width : 120.0,
                 editor : {
                     xtype : "numberfield",

+ 6 - 22
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -37,10 +37,11 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         hidden:true,
         columnWidth: 0.25
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pi_vendname',
         bind: '{pi_vendname}',
         fieldLabel: '供应商名称',
+        emptyText:'输入供应商编号或名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
@@ -48,12 +49,14 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         name: 'pd_prodcode',
         bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
+        hidden:true,
         showDetail: true
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pr_detail',
         bind: '{pr_detail}',
         fieldLabel: '物料名称',
+        emptyText:'输入物料编号或名称',
         showDetail: true
     }, {
         xtype: 'combobox',
@@ -61,6 +64,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         bind: '{pi_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
+        editable:false,
         columnWidth: 0.25,
         queryMode: 'local',
         displayField: 'pi_status',
@@ -81,26 +85,6 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             }
         }
     }],
-    moreQueryFormItems: [{
-        xtype: 'textfield',
-        name: 'pu_buyername',
-        bind: '{pu_buyername}',
-        fieldLabel: '采购员',
-        allowBlank: true
-    }, {
-        xtype: 'textfield',
-        name: 'pu_total',
-        bind: '{pu_total}',
-        fieldLabel: '金额',
-        allowBlank: true
-    }, {
-        xtype: 'condatefield',
-        name: 'pu_delivery',
-        bind: '{pu_delivery}',
-        fieldLabel: '交货日期',
-        allowBlank: true,
-        columnWidth: 1
-    }],
     queryGridConfig: {
         idField:'id',
         codeField:'pi_inoutno',

+ 7 - 7
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js

@@ -6,16 +6,16 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
         var me = this;
         this.control({
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pu_vendname]':{
+            'dbfindtrigger[name=pi_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/vendor/list',
                         addXtype: 'document-vendor-formpanel',
                         addTitle: '供应商资料',
                         dbfinds:[{
-                            from:'ve_code',to:'pu_vendcode'
+                            from:'ve_code',to:'pi_vendcode'
                         },{
-                            from:'ve_name',to:'pu_vendname'
+                            from:'ve_name',to:'pi_vendname'
                         }],
                         dbtpls:[{
                             field:'ve_code',width:100
@@ -78,7 +78,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            'dbfindtrigger[name=pr_detail]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         conditionCode:'pr_code',
@@ -89,8 +89,8 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
                             from:'pr_detail',to:'pr_detail',
                         },{
                             from:'pr_code',to:'pd_prodcode',
-                        },{
-                            from:'pr_unit',to:'pd_unit'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100
@@ -99,7 +99,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
                         }],
                         defaultCondition: "pr_statuscode='OPEN'",
                         dbSearchFields:[{
-                            emptyText:'输入物料编号、名称或规格',
+                            emptyText:'输入物料编号或名称',
                             xtype : "textfield", 
                             name : "search", 
                             width: 200,

+ 14 - 22
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -36,11 +36,20 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
         allowBlank: true,
         hidden:true,
         columnWidth: 0.25
-    }, {
+    },{
         xtype: 'textfield',
+        name: 'pi_vendcode',
+        bind: '{pi_vendcode}',
+        fieldLabel: '供应商编号',
+        allowBlank: true,
+        hidden:true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
         name: 'pi_vendname',
         bind: '{pi_vendname}',
         fieldLabel: '供应商名称',
+        emptyText:'输入供应商编号或名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
@@ -48,12 +57,14 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
         name: 'pd_prodcode',
         bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
+        hidden:true,
         showDetail: true
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pr_detail',
         bind: '{pr_detail}',
         fieldLabel: '物料名称',
+        emptyText:'输入物料编号或名称',
         showDetail: true
     }, {
         xtype: 'combobox',
@@ -61,6 +72,7 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
         bind: '{pi_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
+        editable:false,
         columnWidth: 0.25,
         queryMode: 'local',
         displayField: 'pi_status',
@@ -81,26 +93,6 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
             }
         }
     }],
-    moreQueryFormItems: [{
-        xtype: 'textfield',
-        name: 'pu_buyername',
-        bind: '{pu_buyername}',
-        fieldLabel: '采购员',
-        allowBlank: true
-    }, {
-        xtype: 'textfield',
-        name: 'pu_total',
-        bind: '{pu_total}',
-        fieldLabel: '金额',
-        allowBlank: true
-    }, {
-        xtype: 'condatefield',
-        name: 'pu_delivery',
-        bind: '{pu_delivery}',
-        fieldLabel: '交货日期',
-        allowBlank: true,
-        columnWidth: 1
-    }],
     queryGridConfig: {
         idField:'id',
         codeField:'pi_inoutno',

+ 9 - 9
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelController.js

@@ -6,16 +6,16 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
         var me = this;
         this.control({
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pu_vendname]':{
+            'dbfindtrigger[name=pi_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/vendor/list',
                         addXtype: 'document-vendor-formpanel',
                         addTitle: '供应商资料',
                         dbfinds:[{
-                            from:'ve_code',to:'pu_vendcode'
+                            from:'ve_code',to:'pi_vendcode'
                         },{
-                            from:'ve_name',to:'pu_vendname'
+                            from:'ve_name',to:'pi_vendname'
                         }],
                         dbtpls:[{
                             field:'ve_code',width:100
@@ -78,16 +78,16 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            'dbfindtrigger[name=pr_detail]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/product/list',
                         addXtype: 'document-product-formpanel',
                         addTitle: '物料资料',
                         dbfinds:[{
-                            from:'pr_code',to:'pd_prodcode'
-                        },{
-                            from:'pr_unit',to:'pd_unit'
+                            from:'pr_code',to:'pd_prodcode',
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100
@@ -96,7 +96,7 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
                         }],
                         defaultCondition: "pr_statuscode='OPEN'",
                         dbSearchFields:[{
-                            emptyText:'输入物料编号、名称或规格',
+                            emptyText:'输入物料编号或名称',
                             xtype : "textfield", 
                             name : "search", 
                             width: 200,
@@ -166,7 +166,7 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
                             "text": "L/T",
                             "dataIndex": "pr_leadtime",
                             "width": 100,
-                        }]
+                        }]   
                     }) ;   
 
                 }

+ 4 - 2
frontend/saas-web/app/view/stock/otherIn/FormPanel.js

@@ -230,7 +230,8 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
                 width : 120.0,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 2,
+                    editable:false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
@@ -260,7 +261,8 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
                 dataIndex : "pd_nettotal", 
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 2,
+                    editable:false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');

+ 0 - 20
frontend/saas-web/app/view/stock/otherIn/QueryPanel.js

@@ -81,26 +81,6 @@ Ext.define('saas.view.stock.otherIn.QueryPanel', {
             }
         }
     }],
-    moreQueryFormItems: [{
-        xtype: 'textfield',
-        name: 'pu_buyername',
-        bind: '{pu_buyername}',
-        fieldLabel: '采购员',
-        allowBlank: true
-    }, {
-        xtype: 'textfield',
-        name: 'pu_total',
-        bind: '{pu_total}',
-        fieldLabel: '金额',
-        allowBlank: true
-    }, {
-        xtype: 'condatefield',
-        name: 'pu_delivery',
-        bind: '{pu_delivery}',
-        fieldLabel: '交货日期',
-        allowBlank: true,
-        columnWidth: 1
-    }],
     queryGridConfig: {
         idField:'id',
         codeField:'pi_inoutno',

+ 4 - 2
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -232,7 +232,8 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                 width: 120.0,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 2,
+                    editable:false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
@@ -262,7 +263,8 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                 dataIndex: "pd_nettotal",
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 2,
+                    editable:false
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');

+ 0 - 20
frontend/saas-web/app/view/stock/otherOut/QueryPanel.js

@@ -81,26 +81,6 @@ Ext.define('saas.view.stock.otherOut.QueryPanel', {
             }
         }
     }],
-    moreQueryFormItems: [{
-        xtype: 'textfield',
-        name: 'pu_buyername',
-        bind: '{pu_buyername}',
-        fieldLabel: '采购员',
-        allowBlank: true
-    }, {
-        xtype: 'textfield',
-        name: 'pu_total',
-        bind: '{pu_total}',
-        fieldLabel: '金额',
-        allowBlank: true
-    }, {
-        xtype: 'condatefield',
-        name: 'pu_delivery',
-        bind: '{pu_delivery}',
-        fieldLabel: '交货日期',
-        allowBlank: true,
-        columnWidth: 1
-    }],
     queryGridConfig: {
         idField:'id',
         codeField:'pi_inoutno',

+ 3 - 3
frontend/saas-web/app/view/stock/stockamount/DataList.js

@@ -64,7 +64,7 @@ Ext.define('saas.view.stock.stockamount.DataList', {
         xtype : "", 
     },{
         text : "物料名称", 
-        width : 200.0, 
+        width : 150.0, 
         dataIndex : "rc_prodDetail", 
     }, 
     {
@@ -75,12 +75,12 @@ Ext.define('saas.view.stock.stockamount.DataList', {
     {
         text : "单位", 
         dataIndex : "rc_prodUnit", 
-        width : 120.0, 
+        width : 80.0, 
     }, 
     {
         text : "仓库编号", 
         dataIndex : "rc_whCode", 
-        width : 0, 
+        width : 100, 
     }, 
     {
         text : "仓库名称", 

+ 1 - 1
frontend/saas-web/app/view/sys/messagelog/DataList.js

@@ -21,7 +21,7 @@ Ext.define('saas.view.sys.messagelog.DataList', {
         width: 150,
         name: 'ml_man',
         xtype: 'textfield',
-        emptyText : '处理人'
+        emptyText : '操作人员'
     },{
         cls:'x-formpanel-btn-orange',
         xtype:'button',

+ 1 - 1
frontend/saas-web/app/view/sys/power/FormPanel.js

@@ -43,7 +43,7 @@ Ext.define('saas.view.sys.power.FormPanel', {
         layout:'fit',
         height:'100%',
         width: '85%',
-        xtype:'sys-power-treegrid'
+        xtype:'power-grid'
     }],
 
     initComponent: function () {

+ 146 - 0
frontend/saas-web/app/view/sys/power/GroupGrid.js

@@ -0,0 +1,146 @@
+/**
+ * Created by zhouy on 2018/11/8.
+ */
+Ext.define('saas.view.sys.power.GroupGrid', {
+    extend: 'Ext.grid.Panel',
+    requires: [
+      //  'Ext.selection.CellModel',
+        'saas.view.sys.power.OtherField'
+    ],
+    xtype: 'power-grid',
+    plugins: {
+        cellediting: {
+            clicksToEdit: 1
+        }
+    },
+    store:Ext.create('Ext.data.Store',{
+        fields:[
+            {name: 'query',type:'bool'},
+            {name: 'add', type: 'bool'},
+            {name: 'save', type: 'bool'},
+            {name: 'delete', type: 'bool'},
+            {name: 'audit', type: 'bool'},
+            {name: 'resAudit', type: 'bool'},
+            {name: 'import', type: 'bool'},
+            {name: 'export', type: 'bool'},
+            {name: 'others', calculate: function(data) {
+                var others = data['others'];
+                return others;
+            }}
+        ],
+        data: [{"query":true,"add":false,"delete":false,"audit":true,"resAudit":true,"import":true,"export":true},{"query":true,"add":false,"delete":false,"audit":true,"resAudit":true,"import":true,"export":true,"others":[{'resouceId':1,'text':'权限1','value':'true'}]},
+            {"query":true,"add":false,"delete":false,"audit":true,"resAudit":true,"import":true,"export":true,"others":[{'resouceId':100,'text':'权限2','value':true},{'resouceId':101,'text':'权限2.1','value':true}]},
+            {"query":true,"add":false,"delete":false,"audit":true,"resAudit":true,"import":true,"export":true,"others":[{'resouceId':1000,text:'权限3','value':true},{'resouceId':1001,'text':'权限3.1','value':true},{'resouceId':1002,'text':'权限1','value':true},{'resouceId':100,'text':'权限3.2','value':true}]}]
+}),
+    selModel:Ext.create('Ext.selection.CheckboxModel', {
+        checkOnly: true,
+        listeners: {
+            'select': function (selModel, record) {
+                selModel.view.ownerCt.selectAllPower(record);
+            },
+            'deselect': function (selModel, record) {
+                selModel.view.ownerCt.deselectAllPower(record);
+            }
+        }
+    }),
+    height: 350,
+    viewConfig: {
+     stripeRows: false,
+     enableTextSelection: false,
+     markDirty: false
+    },
+    trackMouseOver: false,
+    //disableSelection: true,
+    columns: [{
+        header: '查询',
+        dataIndex: 'query',
+        xtype: 'checkcolumn',
+        headerCheckbox: true,
+        width: 90,
+        stopSelection: false
+    }, {
+        header: '新增',
+        dataIndex: 'add',
+        xtype: 'checkcolumn',
+        headerCheckbox: true,
+        width: 90,
+        stopSelection: false
+    }, {
+        header: '修改',
+        dataIndex: 'save',
+        xtype: 'checkcolumn',
+        headerCheckbox: true,
+        width: 90,
+        stopSelection: false
+    }, {
+        header: '删除',
+        dataIndex: 'delete',
+        xtype: 'checkcolumn',
+        headerCheckbox: true,
+        width: 90,
+        stopSelection: false
+    }, {
+        header: '审核',
+        dataIndex: 'audit',
+        xtype: 'checkcolumn',
+        headerCheckbox: true,
+        width: 90,
+        stopSelection: false
+    }, {
+        header: '反审核',
+        dataIndex: 'resAudit',
+        xtype: 'checkcolumn',
+        headerCheckbox: true,
+        width: 90,
+        stopSelection: false
+    }, {
+        header: '导入',
+        dataIndex: 'import',
+        xtype: 'checkcolumn',
+        headerCheckbox: true,
+        width: 90,
+        stopSelection: false
+    }, {
+        header: '导出',
+        dataIndex: 'export',
+        xtype: 'checkcolumn',
+        headerCheckbox: true,
+        width: 90,
+        stopSelection: false
+    }, {
+        text: '其它',
+        width: 160,
+        dataIndex:'others',
+        xtype: 'widgetcolumn',
+        producesHTML: false,
+        widget: {
+            xtype: 'powerotherfield',
+            bind:'{record.others}'
+        }
+    }],
+
+    // Dispatch named listener and handler methods to this instance
+    defaultListenerScope: true,
+
+    listeners: {
+        columnshow: 'onColumnToggle',
+        columnhide: 'onColumnToggle'
+    },
+    selectAllPower: function(record){
+        var me = this;data={"query":true,"add":true,"save":true,"delete":true,"audit":true,"resAudit":true,"import":true,"export":true};
+        me.setAllOthers(record,true,data);
+
+    },
+    deselectAllPower:function(record){
+        var me = this;data={"query":false,"add":false,"save":false,"delete":false,"audit":false,"resAudit":false,"import":false,"export":false};
+        me.setAllOthers(record,false,data);
+    },
+    setAllOthers:function(record,bool,data){
+        var others=record.get('others');
+        Ext.Array.each(others,function(o){
+            o.value=bool;
+        })
+        data.others = others
+        record.set(data);
+    }
+});

+ 33 - 0
frontend/saas-web/app/view/sys/power/OtherField.js

@@ -0,0 +1,33 @@
+/**
+ * Created by zhouy on 2018/11/8.
+ */
+Ext.define('saas.view.sys.power.OtherField', {
+    extend: 'Ext.form.FieldContainer',
+    //extend: 'Ext.form.field.Text',
+    alias: 'widget.powerotherfield',
+    layout: 'column',
+    defaults:{
+       xtype:'checkbox',
+       columnWidth:0.5
+    },
+    initComponent:function(){
+        var me=this;
+        me.callParent(arguments);
+    },
+    setHtml:function(v){
+        this.setItems(v);
+    },
+    setItems:function(v){
+        if(v){
+            var len = v.length,items=[];
+            if(this.items.length>0)this.removeAll(true);
+            for (i = 0; i < len; i++) {
+                items.push({
+                   boxLabel:v[i].text,
+                   checked:v[i].value
+                });
+            }
+            this.add(items);
+        }
+    }
+});

+ 0 - 41
frontend/saas-web/app/view/sys/power/TreeGrid.js

@@ -1,41 +0,0 @@
-Ext.define('saas.view.sys.power.TreeGrid', {
-    extend: 'Ext.tree.Panel',
-    xtype: 'sys-power-treegrid',
-
-    multiSelect: true,
-    singleExpand: true,
-
-    store: {
-        type: 'tree',
-        folderSort: true,
-    },
-
-    columns: [{
-        xtype: 'treecolumn', //this is so we know which column will show the tree
-        header: '模块',
-        dataIndex: 'task',
-        flex: 1,
-        sortable: true
-    }, {
-        header: '保存',
-        dataIndex: 'duration',
-        flex: 1,
-        sortable: true,
-        align: 'center',
-        xtype: 'checkcolumn',
-        formatter: 'this.formatHours'
-    },{
-        header: '提交',
-        dataIndex: 'user',
-        flex: 1,
-        xtype: 'checkcolumn',
-        sortable: true
-    }, {
-        xtype: 'checkcolumn',
-        header: '其他',
-        dataIndex: 'done',
-        width: 155,
-        stopSelection: false,
-        menuDisabled: true
-    }]
-});