hy 8 gadi atpakaļ
vecāks
revīzija
162540b780
89 mainītis faili ar 4394 papildinājumiem un 746 dzēšanām
  1. 15 0
      applications/commons/commons-api/pom.xml
  2. 21 0
      applications/commons/commons-dto/pom.xml
  3. 1 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/BatchDealBaseDTO.java
  4. 1 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ComboDTO.java
  5. 1 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/DocBaseDTO.java
  6. 1 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/DocReqDTO.java
  7. 1 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/DocSavedDTO.java
  8. 1 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ProductBaseDTO.java
  9. 35 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Maxnumbers.java
  10. 771 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/MaxnumbersExample.java
  11. 47 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Maxnumbersdetail.java
  12. 761 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/MaxnumbersdetailExample.java
  13. 73 0
      applications/commons/commons-server/pom.xml
  14. 23 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/CommonsApplication.java
  15. 19 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonsController.java
  16. 33 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java
  17. 32 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersdetailMapper.java
  18. 61 0
      applications/commons/commons-server/src/main/resources/application.yml
  19. BIN
      applications/commons/commons-server/src/main/resources/auth/pub.key
  20. 64 0
      applications/commons/commons-server/src/main/resources/logback-spring.xml
  21. 276 0
      applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml
  22. 276 0
      applications/commons/commons-server/src/main/resources/mapper/MaxnumbersdetailMapper.xml
  23. 6 7
      applications/commons/pom.xml
  24. 2 1
      applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/WarehouseApi.java
  25. 10 3
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java
  26. 2 11
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorDTO.java
  27. 11 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/WarehouseDTO.java
  28. 2 1
      applications/document/document-server/pom.xml
  29. 0 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  30. 8 8
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  31. 5 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java
  32. 19 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java
  33. 5 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  34. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  35. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  36. 7 9
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/ProductServiceImpl.java
  37. 6 8
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/VendorServiceImpl.java
  38. 18 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/WarehouseServiceImpl.java
  39. 5 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  40. 4 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java
  41. 3 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/WarehouseService.java
  42. 10 1
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  43. 9 1
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  44. 13 6
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  45. 6 5
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorTest.java
  46. 14 3
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/WarehouseTest.java
  47. 2 10
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDTO.java
  48. 2 16
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDetailDTO.java
  49. 3 3
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseFormDTO.java
  50. 2 9
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseListDTO.java
  51. 2 1
      applications/purchase/purchase-server/pom.xml
  52. 41 5
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  53. 5 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  54. 9 9
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasedetailMapper.java
  55. 1 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseDetail.java
  56. 2 9
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java
  57. 1 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/Status.java
  58. 35 3
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java
  59. 91 16
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  60. 3 1
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml
  61. 10 1
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  62. 7 7
      applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml
  63. 10 1
      frontend/saas-web/app/util/FormUtil.js
  64. 18 141
      frontend/saas-web/app/util/QueryUtil.js
  65. 5 4
      frontend/saas-web/app/view/core/form/FormPanel.js
  66. 17 7
      frontend/saas-web/app/view/core/form/FormPanelController.js
  67. 2 1
      frontend/saas-web/app/view/core/form/FormPanelModel.js
  68. 32 8
      frontend/saas-web/app/view/core/form/MultiCombo.js
  69. 21 0
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  70. 4 9
      frontend/saas-web/app/view/core/query/MoreQueryFormPanel.js
  71. 147 28
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  72. 11 1
      frontend/saas-web/app/view/main/MainModel.js
  73. 62 46
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  74. 49 86
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  75. 110 0
      frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js
  76. 1 5
      frontend/saas-web/app/view/purchase/purchase/QueryPanelModel.js
  77. 11 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormController.js
  78. 61 89
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  79. 69 106
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  80. 110 0
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js
  81. 1 5
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelModel.js
  82. 147 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormController.js
  83. 7 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormModel.js
  84. 246 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  85. 219 0
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js
  86. 115 0
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelController.js
  87. 4 0
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelModel.js
  88. 6 3
      frontend/saas-web/app/view/test/order/FormPanel.js
  89. 11 16
      frontend/saas-web/app/view/test/query/QueryPanel.js

+ 15 - 0
applications/commons/commons-api/pom.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>commons</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>commons-api</artifactId>
+
+
+</project>

+ 21 - 0
applications/commons/commons-dto/pom.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>commons</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>commoms-dto</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+    </dependencies>
+
+
+</project>

+ 1 - 1
applications/commons/src/main/java/com/usoftchina/saas/common/dto/BatchDealBaseDTO.java → applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/BatchDealBaseDTO.java

@@ -1,4 +1,4 @@
-package com.usoftchina.saas.common.dto;
+package com.usoftchina.saas.commons.dto;
 
 import java.io.Serializable;
 import java.util.List;

+ 1 - 1
applications/commons/src/main/java/com/usoftchina/saas/common/dto/ComboDTO.java → applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ComboDTO.java

@@ -1,4 +1,4 @@
-package com.usoftchina.saas.common.dto;
+package com.usoftchina.saas.commons.dto;
 
 import java.io.Serializable;
 

+ 1 - 1
applications/commons/src/main/java/com/usoftchina/saas/common/dto/DocBaseDTO.java → applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/DocBaseDTO.java

@@ -1,4 +1,4 @@
-package com.usoftchina.saas.common.dto;
+package com.usoftchina.saas.commons.dto;
 
 import java.io.Serializable;
 

+ 1 - 1
applications/commons/src/main/java/com/usoftchina/saas/common/dto/DocReqDTO.java → applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/DocReqDTO.java

@@ -1,4 +1,4 @@
-package com.usoftchina.saas.common.dto;
+package com.usoftchina.saas.commons.dto;
 
 
 /**

+ 1 - 1
applications/commons/src/main/java/com/usoftchina/saas/common/dto/DocSavedDTO.java → applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/DocSavedDTO.java

@@ -1,4 +1,4 @@
-package com.usoftchina.saas.common.dto;
+package com.usoftchina.saas.commons.dto;
 
 import java.io.Serializable;
 

+ 1 - 1
applications/commons/src/main/java/com/usoftchina/saas/common/dto/ProductBaseDTO.java → applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ProductBaseDTO.java

@@ -1,4 +1,4 @@
-package com.usoftchina.saas.common.dto;
+package com.usoftchina.saas.commons.dto;
 
 import java.io.Serializable;
 

+ 35 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Maxnumbers.java

@@ -0,0 +1,35 @@
+package com.usoftchina.saas.commons.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+public class Maxnumbers extends CommonBaseEntity{
+    private String mn_caller;
+
+    private String mn_leadcode;
+
+    private String mn_number;
+
+    public String getMn_caller() {
+        return mn_caller;
+    }
+
+    public void setMn_caller(String mn_caller) {
+        this.mn_caller = mn_caller == null ? null : mn_caller.trim();
+    }
+
+    public String getMn_leadcode() {
+        return mn_leadcode;
+    }
+
+    public void setMn_leadcode(String mn_leadcode) {
+        this.mn_leadcode = mn_leadcode == null ? null : mn_leadcode.trim();
+    }
+
+    public String getMn_number() {
+        return mn_number;
+    }
+
+    public void setMn_number(String mn_number) {
+        this.mn_number = mn_number == null ? null : mn_number.trim();
+    }
+}

+ 771 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/MaxnumbersExample.java

@@ -0,0 +1,771 @@
+package com.usoftchina.saas.commons.po;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class MaxnumbersExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public MaxnumbersExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andMn_idIsNull() {
+            addCriterion("mn_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idIsNotNull() {
+            addCriterion("mn_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idEqualTo(Integer value) {
+            addCriterion("mn_id =", value, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idNotEqualTo(Integer value) {
+            addCriterion("mn_id <>", value, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idGreaterThan(Integer value) {
+            addCriterion("mn_id >", value, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idGreaterThanOrEqualTo(Integer value) {
+            addCriterion("mn_id >=", value, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idLessThan(Integer value) {
+            addCriterion("mn_id <", value, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idLessThanOrEqualTo(Integer value) {
+            addCriterion("mn_id <=", value, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idIn(List<Integer> values) {
+            addCriterion("mn_id in", values, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idNotIn(List<Integer> values) {
+            addCriterion("mn_id not in", values, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idBetween(Integer value1, Integer value2) {
+            addCriterion("mn_id between", value1, value2, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_idNotBetween(Integer value1, Integer value2) {
+            addCriterion("mn_id not between", value1, value2, "mn_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerIsNull() {
+            addCriterion("mn_caller is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerIsNotNull() {
+            addCriterion("mn_caller is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerEqualTo(String value) {
+            addCriterion("mn_caller =", value, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerNotEqualTo(String value) {
+            addCriterion("mn_caller <>", value, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerGreaterThan(String value) {
+            addCriterion("mn_caller >", value, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerGreaterThanOrEqualTo(String value) {
+            addCriterion("mn_caller >=", value, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerLessThan(String value) {
+            addCriterion("mn_caller <", value, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerLessThanOrEqualTo(String value) {
+            addCriterion("mn_caller <=", value, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerLike(String value) {
+            addCriterion("mn_caller like", value, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerNotLike(String value) {
+            addCriterion("mn_caller not like", value, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerIn(List<String> values) {
+            addCriterion("mn_caller in", values, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerNotIn(List<String> values) {
+            addCriterion("mn_caller not in", values, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerBetween(String value1, String value2) {
+            addCriterion("mn_caller between", value1, value2, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_callerNotBetween(String value1, String value2) {
+            addCriterion("mn_caller not between", value1, value2, "mn_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeIsNull() {
+            addCriterion("mn_leadcode is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeIsNotNull() {
+            addCriterion("mn_leadcode is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeEqualTo(String value) {
+            addCriterion("mn_leadcode =", value, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeNotEqualTo(String value) {
+            addCriterion("mn_leadcode <>", value, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeGreaterThan(String value) {
+            addCriterion("mn_leadcode >", value, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeGreaterThanOrEqualTo(String value) {
+            addCriterion("mn_leadcode >=", value, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeLessThan(String value) {
+            addCriterion("mn_leadcode <", value, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeLessThanOrEqualTo(String value) {
+            addCriterion("mn_leadcode <=", value, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeLike(String value) {
+            addCriterion("mn_leadcode like", value, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeNotLike(String value) {
+            addCriterion("mn_leadcode not like", value, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeIn(List<String> values) {
+            addCriterion("mn_leadcode in", values, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeNotIn(List<String> values) {
+            addCriterion("mn_leadcode not in", values, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeBetween(String value1, String value2) {
+            addCriterion("mn_leadcode between", value1, value2, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_leadcodeNotBetween(String value1, String value2) {
+            addCriterion("mn_leadcode not between", value1, value2, "mn_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberIsNull() {
+            addCriterion("mn_number is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberIsNotNull() {
+            addCriterion("mn_number is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberEqualTo(String value) {
+            addCriterion("mn_number =", value, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberNotEqualTo(String value) {
+            addCriterion("mn_number <>", value, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberGreaterThan(String value) {
+            addCriterion("mn_number >", value, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberGreaterThanOrEqualTo(String value) {
+            addCriterion("mn_number >=", value, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberLessThan(String value) {
+            addCriterion("mn_number <", value, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberLessThanOrEqualTo(String value) {
+            addCriterion("mn_number <=", value, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberLike(String value) {
+            addCriterion("mn_number like", value, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberNotLike(String value) {
+            addCriterion("mn_number not like", value, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberIn(List<String> values) {
+            addCriterion("mn_number in", values, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberNotIn(List<String> values) {
+            addCriterion("mn_number not in", values, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberBetween(String value1, String value2) {
+            addCriterion("mn_number between", value1, value2, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andMn_numberNotBetween(String value1, String value2) {
+            addCriterion("mn_number not between", value1, value2, "mn_number");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIsNull() {
+            addCriterion("companyId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIsNotNull() {
+            addCriterion("companyId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdEqualTo(Integer value) {
+            addCriterion("companyId =", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotEqualTo(Integer value) {
+            addCriterion("companyId <>", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdGreaterThan(Integer value) {
+            addCriterion("companyId >", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("companyId >=", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdLessThan(Integer value) {
+            addCriterion("companyId <", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
+            addCriterion("companyId <=", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIn(List<Integer> values) {
+            addCriterion("companyId in", values, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotIn(List<Integer> values) {
+            addCriterion("companyId not in", values, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
+            addCriterion("companyId between", value1, value2, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("companyId not between", value1, value2, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("createTime is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("createTime is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("createTime =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("createTime <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("createTime >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("createTime >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("createTime <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("createTime <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("createTime in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("createTime not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("createTime between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("createTime not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIsNull() {
+            addCriterion("creatorId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIsNotNull() {
+            addCriterion("creatorId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdEqualTo(Integer value) {
+            addCriterion("creatorId =", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotEqualTo(Integer value) {
+            addCriterion("creatorId <>", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdGreaterThan(Integer value) {
+            addCriterion("creatorId >", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("creatorId >=", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdLessThan(Integer value) {
+            addCriterion("creatorId <", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdLessThanOrEqualTo(Integer value) {
+            addCriterion("creatorId <=", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIn(List<Integer> values) {
+            addCriterion("creatorId in", values, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotIn(List<Integer> values) {
+            addCriterion("creatorId not in", values, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdBetween(Integer value1, Integer value2) {
+            addCriterion("creatorId between", value1, value2, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("creatorId not between", value1, value2, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("updateTime is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("updateTime is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("updateTime =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("updateTime <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("updateTime >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("updateTime >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("updateTime <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("updateTime <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("updateTime in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("updateTime not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("updateTime between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("updateTime not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIsNull() {
+            addCriterion("updaterId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIsNotNull() {
+            addCriterion("updaterId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdEqualTo(Integer value) {
+            addCriterion("updaterId =", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotEqualTo(Integer value) {
+            addCriterion("updaterId <>", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdGreaterThan(Integer value) {
+            addCriterion("updaterId >", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("updaterId >=", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdLessThan(Integer value) {
+            addCriterion("updaterId <", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdLessThanOrEqualTo(Integer value) {
+            addCriterion("updaterId <=", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIn(List<Integer> values) {
+            addCriterion("updaterId in", values, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotIn(List<Integer> values) {
+            addCriterion("updaterId not in", values, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdBetween(Integer value1, Integer value2) {
+            addCriterion("updaterId between", value1, value2, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("updaterId not between", value1, value2, "updaterId");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 47 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Maxnumbersdetail.java

@@ -0,0 +1,47 @@
+package com.usoftchina.saas.commons.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.util.Date;
+
+public class Maxnumbersdetail extends CommonBaseEntity{
+    private String md_caller;
+
+    private String md_leadcode;
+
+    private Integer md_maxno;
+
+    private Integer companyId;
+
+    private Date createTime;
+
+    private Integer creatorId;
+
+    private Date updateTime;
+
+    private Integer updaterId;
+
+    public String getMd_caller() {
+        return md_caller;
+    }
+
+    public void setMd_caller(String md_caller) {
+        this.md_caller = md_caller == null ? null : md_caller.trim();
+    }
+
+    public String getMd_leadcode() {
+        return md_leadcode;
+    }
+
+    public void setMd_leadcode(String md_leadcode) {
+        this.md_leadcode = md_leadcode == null ? null : md_leadcode.trim();
+    }
+
+    public Integer getMd_maxno() {
+        return md_maxno;
+    }
+
+    public void setMd_maxno(Integer md_maxno) {
+        this.md_maxno = md_maxno;
+    }
+}

+ 761 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/MaxnumbersdetailExample.java

@@ -0,0 +1,761 @@
+package com.usoftchina.saas.commons.po;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class MaxnumbersdetailExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public MaxnumbersdetailExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andMd_idIsNull() {
+            addCriterion("md_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idIsNotNull() {
+            addCriterion("md_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idEqualTo(Integer value) {
+            addCriterion("md_id =", value, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idNotEqualTo(Integer value) {
+            addCriterion("md_id <>", value, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idGreaterThan(Integer value) {
+            addCriterion("md_id >", value, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idGreaterThanOrEqualTo(Integer value) {
+            addCriterion("md_id >=", value, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idLessThan(Integer value) {
+            addCriterion("md_id <", value, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idLessThanOrEqualTo(Integer value) {
+            addCriterion("md_id <=", value, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idIn(List<Integer> values) {
+            addCriterion("md_id in", values, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idNotIn(List<Integer> values) {
+            addCriterion("md_id not in", values, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idBetween(Integer value1, Integer value2) {
+            addCriterion("md_id between", value1, value2, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_idNotBetween(Integer value1, Integer value2) {
+            addCriterion("md_id not between", value1, value2, "md_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerIsNull() {
+            addCriterion("md_caller is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerIsNotNull() {
+            addCriterion("md_caller is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerEqualTo(String value) {
+            addCriterion("md_caller =", value, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerNotEqualTo(String value) {
+            addCriterion("md_caller <>", value, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerGreaterThan(String value) {
+            addCriterion("md_caller >", value, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerGreaterThanOrEqualTo(String value) {
+            addCriterion("md_caller >=", value, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerLessThan(String value) {
+            addCriterion("md_caller <", value, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerLessThanOrEqualTo(String value) {
+            addCriterion("md_caller <=", value, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerLike(String value) {
+            addCriterion("md_caller like", value, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerNotLike(String value) {
+            addCriterion("md_caller not like", value, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerIn(List<String> values) {
+            addCriterion("md_caller in", values, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerNotIn(List<String> values) {
+            addCriterion("md_caller not in", values, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerBetween(String value1, String value2) {
+            addCriterion("md_caller between", value1, value2, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_callerNotBetween(String value1, String value2) {
+            addCriterion("md_caller not between", value1, value2, "md_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeIsNull() {
+            addCriterion("md_leadcode is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeIsNotNull() {
+            addCriterion("md_leadcode is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeEqualTo(String value) {
+            addCriterion("md_leadcode =", value, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeNotEqualTo(String value) {
+            addCriterion("md_leadcode <>", value, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeGreaterThan(String value) {
+            addCriterion("md_leadcode >", value, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeGreaterThanOrEqualTo(String value) {
+            addCriterion("md_leadcode >=", value, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeLessThan(String value) {
+            addCriterion("md_leadcode <", value, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeLessThanOrEqualTo(String value) {
+            addCriterion("md_leadcode <=", value, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeLike(String value) {
+            addCriterion("md_leadcode like", value, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeNotLike(String value) {
+            addCriterion("md_leadcode not like", value, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeIn(List<String> values) {
+            addCriterion("md_leadcode in", values, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeNotIn(List<String> values) {
+            addCriterion("md_leadcode not in", values, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeBetween(String value1, String value2) {
+            addCriterion("md_leadcode between", value1, value2, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_leadcodeNotBetween(String value1, String value2) {
+            addCriterion("md_leadcode not between", value1, value2, "md_leadcode");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoIsNull() {
+            addCriterion("md_maxno is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoIsNotNull() {
+            addCriterion("md_maxno is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoEqualTo(Integer value) {
+            addCriterion("md_maxno =", value, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoNotEqualTo(Integer value) {
+            addCriterion("md_maxno <>", value, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoGreaterThan(Integer value) {
+            addCriterion("md_maxno >", value, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoGreaterThanOrEqualTo(Integer value) {
+            addCriterion("md_maxno >=", value, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoLessThan(Integer value) {
+            addCriterion("md_maxno <", value, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoLessThanOrEqualTo(Integer value) {
+            addCriterion("md_maxno <=", value, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoIn(List<Integer> values) {
+            addCriterion("md_maxno in", values, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoNotIn(List<Integer> values) {
+            addCriterion("md_maxno not in", values, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoBetween(Integer value1, Integer value2) {
+            addCriterion("md_maxno between", value1, value2, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andMd_maxnoNotBetween(Integer value1, Integer value2) {
+            addCriterion("md_maxno not between", value1, value2, "md_maxno");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIsNull() {
+            addCriterion("companyId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIsNotNull() {
+            addCriterion("companyId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdEqualTo(Integer value) {
+            addCriterion("companyId =", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotEqualTo(Integer value) {
+            addCriterion("companyId <>", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdGreaterThan(Integer value) {
+            addCriterion("companyId >", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("companyId >=", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdLessThan(Integer value) {
+            addCriterion("companyId <", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
+            addCriterion("companyId <=", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIn(List<Integer> values) {
+            addCriterion("companyId in", values, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotIn(List<Integer> values) {
+            addCriterion("companyId not in", values, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
+            addCriterion("companyId between", value1, value2, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("companyId not between", value1, value2, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("createTime is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("createTime is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("createTime =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("createTime <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("createTime >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("createTime >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("createTime <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("createTime <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("createTime in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("createTime not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("createTime between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("createTime not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIsNull() {
+            addCriterion("creatorId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIsNotNull() {
+            addCriterion("creatorId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdEqualTo(Integer value) {
+            addCriterion("creatorId =", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotEqualTo(Integer value) {
+            addCriterion("creatorId <>", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdGreaterThan(Integer value) {
+            addCriterion("creatorId >", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("creatorId >=", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdLessThan(Integer value) {
+            addCriterion("creatorId <", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdLessThanOrEqualTo(Integer value) {
+            addCriterion("creatorId <=", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIn(List<Integer> values) {
+            addCriterion("creatorId in", values, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotIn(List<Integer> values) {
+            addCriterion("creatorId not in", values, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdBetween(Integer value1, Integer value2) {
+            addCriterion("creatorId between", value1, value2, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("creatorId not between", value1, value2, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("updateTime is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("updateTime is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("updateTime =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("updateTime <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("updateTime >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("updateTime >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("updateTime <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("updateTime <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("updateTime in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("updateTime not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("updateTime between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("updateTime not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIsNull() {
+            addCriterion("updaterId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIsNotNull() {
+            addCriterion("updaterId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdEqualTo(Integer value) {
+            addCriterion("updaterId =", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotEqualTo(Integer value) {
+            addCriterion("updaterId <>", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdGreaterThan(Integer value) {
+            addCriterion("updaterId >", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("updaterId >=", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdLessThan(Integer value) {
+            addCriterion("updaterId <", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdLessThanOrEqualTo(Integer value) {
+            addCriterion("updaterId <=", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIn(List<Integer> values) {
+            addCriterion("updaterId in", values, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotIn(List<Integer> values) {
+            addCriterion("updaterId not in", values, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdBetween(Integer value1, Integer value2) {
+            addCriterion("updaterId between", value1, value2, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("updaterId not between", value1, value2, "updaterId");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 73 - 0
applications/commons/commons-server/pom.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>commons</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>commons-server</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>commoms-dto</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>auth-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>server-starter</artifactId>
+        </dependency>
+        <!-- db -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- sleuth -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-zipkin</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.amqp</groupId>
+            <artifactId>spring-rabbit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- feign -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 23 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/CommonsApplication.java

@@ -0,0 +1,23 @@
+package com.usoftchina.saas.commons;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @author: guq
+ * @create: 2018-10-18 15:47
+ **/
+@SpringBootApplication
+@EnableEurekaClient
+@EnableTransactionManagement
+@EnableFeignClients("com.usoftchina.saas")
+@MapperScan("com.usoftchina.saas.commons.mapper")
+public class CommonsApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(CommonsApplication.class, args);
+    }
+}

+ 19 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonsController.java

@@ -0,0 +1,19 @@
+package com.usoftchina.saas.commons.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author: guq
+ * @create: 2018-10-18 15:53
+ **/
+@RestController
+@RequestMapping("/commons")
+public class CommonsController {
+
+    @RequestMapping("/test")
+    public String test() {
+        return "TEST";
+    }
+
+}

+ 33 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java

@@ -0,0 +1,33 @@
+package com.usoftchina.saas.commons.mapper;
+
+
+
+import com.usoftchina.saas.commons.po.Maxnumbers;
+import com.usoftchina.saas.commons.po.MaxnumbersExample;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MaxnumbersMapper {
+    int countByExample(MaxnumbersExample example);
+
+    int deleteByExample(MaxnumbersExample example);
+
+    int deleteByPrimaryKey(Integer mn_id);
+
+    int insert(Maxnumbers record);
+
+    int insertSelective(Maxnumbers record);
+
+    List<Maxnumbers> selectByExample(MaxnumbersExample example);
+
+    Maxnumbers selectByPrimaryKey(Integer mn_id);
+
+    int updateByExampleSelective(@Param("record") Maxnumbers record, @Param("example") MaxnumbersExample example);
+
+    int updateByExample(@Param("record") Maxnumbers record, @Param("example") MaxnumbersExample example);
+
+    int updateByPrimaryKeySelective(Maxnumbers record);
+
+    int updateByPrimaryKey(Maxnumbers record);
+}

+ 32 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersdetailMapper.java

@@ -0,0 +1,32 @@
+package com.usoftchina.saas.commons.mapper;
+
+
+import com.usoftchina.saas.commons.po.Maxnumbersdetail;
+import com.usoftchina.saas.commons.po.MaxnumbersdetailExample;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MaxnumbersdetailMapper {
+    int countByExample(MaxnumbersdetailExample example);
+
+    int deleteByExample(MaxnumbersdetailExample example);
+
+    int deleteByPrimaryKey(Integer md_id);
+
+    int insert(Maxnumbersdetail record);
+
+    int insertSelective(Maxnumbersdetail record);
+
+    List<Maxnumbersdetail> selectByExample(MaxnumbersdetailExample example);
+
+    Maxnumbersdetail selectByPrimaryKey(Integer md_id);
+
+    int updateByExampleSelective(@Param("record") Maxnumbersdetail record, @Param("example") MaxnumbersdetailExample example);
+
+    int updateByExample(@Param("record") Maxnumbersdetail record, @Param("example") MaxnumbersdetailExample example);
+
+    int updateByPrimaryKeySelective(Maxnumbersdetail record);
+
+    int updateByPrimaryKey(Maxnumbersdetail record);
+}

+ 61 - 0
applications/commons/commons-server/src/main/resources/application.yml

@@ -0,0 +1,61 @@
+spring:
+  application:
+    name: commons-server
+  security:
+    user:
+      name: admin
+      password: select111***
+  datasource:
+    driver-class-name: com.mysql.jdbc.Driver
+    url: jdbc:mysql://192.168.253.12:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
+    username: root
+    password: select111***
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 50
+      idle-timeout: 30000
+      max-lifetime: 1800000
+      connection-timeout: 30000
+  messages:
+    basename: i18n/messages
+  rabbitmq:
+    host: 192.168.0.176
+    port: 5672
+    password: guest
+    username: guest
+  zipkin:
+    sender:
+      type: rabbit
+    locator:
+      discovery:
+        enabled: true
+  sleuth:
+    sampler:
+      probability: 1.0
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8500/eureka/
+server:
+  port: 8900
+  tomcat:
+    uri-encoding: UTF-8
+info:
+  name: '@project.artifactId@'
+  description: '@project.description@'
+  version: '@project.version@'
+  spring-boot-version: '@spring.boot.version@'
+  spring-cloud-version: '@spring.cloud.version@'
+mybatis:
+  type-aliases-package: com.usoftchina.saas.commons.po
+  mapper-locations: classpath:mapper/*.xml
+auth:
+  public-key: auth/pub.key

BIN
applications/commons/commons-server/src/main/resources/auth/pub.key


+ 64 - 0
applications/commons/commons-server/src/main/resources/logback-spring.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/defaults.xml" />
+    <jmxConfigurator/>
+
+    <!--
+    %m
+    输出代码中指定的消息
+    %p
+    输出优先级,即DEBUG,INFO,WARN,ERROR,FATAL
+    %r
+    输出自应用启动到输出该log信息耗费的毫秒数
+    %c
+    输出所属的类目,通常就是所在类的全名
+    %t
+    输出产生该日志事件的线程名
+    %n
+    输出一个回车换行符,Windows平台为“\r\n”,Unix平台为“\n”
+    %d
+    输出日志时间点的日期或时间,默认格式为ISO8601,也可以在其后指定格式,比如:%d{yyy MMM dd HH:mm:ss,SSS},
+    输出类似:2002年10月18日 22:10:28,921
+    %l
+    输出日志事件的发生位置,包括类目名、发生的线程,以及在代码中的行数。举例:Testlog4.main(TestLog4.java:10)
+    -->
+
+    <springProperty scope="context" name="log.path" source="logging.path" defaultValue="/var/log/saas/commons-server"/>
+    <springProperty scope="context" name="spring.application.name" source="spring.application.name" defaultValue="commons-server"/>
+    <springProperty scope="context" name="spring.profiles.active" source="spring.profiles.active" defaultValue="dev"/>
+    <springProperty scope="context" name="common-pattern" source="logging.common-pattern" defaultValue="%d{yyyy-MM-dd HH:mm:ss.SSS}:[%5p] [%t:%r] [%C{1}:%M:%L] --> %m%n"/>
+    <springProperty scope="context" name="log.level.console" source="logging.level.console" defaultValue="INFO"/>
+
+    <contextName>${spring.application.name}-${spring.profiles.active}-logback</contextName>
+
+
+    <appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>${log.level.console}</level>
+        </filter>
+        <encoder>
+            <pattern>${common-pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="ROOT_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/root.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- 每天一归档 -->
+            <fileNamePattern>${log.path}/%d{yyyy-MM}/root-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern>
+            <!-- 单个日志文件最多 100MB, 60天的日志周期,最大不能超过20GB -->
+            <maxFileSize>128MB</maxFileSize>
+            <maxHistory>60</maxHistory>
+            <totalSizeCap>20GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${common-pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <root level="${log.level.console}">
+        <appender-ref ref="CONSOLE_APPENDER"/>
+        <appender-ref ref="ROOT_APPENDER"/>
+    </root>
+
+</configuration>

+ 276 - 0
applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml

@@ -0,0 +1,276 @@
+<?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.commons.mapper.MaxnumbersMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.po.Maxnumbers" >
+    <id column="mn_id" property="id" jdbcType="INTEGER" />
+    <result column="mn_caller" property="mn_caller" jdbcType="VARCHAR" />
+    <result column="mn_leadcode" property="mn_leadcode" jdbcType="VARCHAR" />
+    <result column="mn_number" property="mn_number" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Example_Where_Clause" >
+    <where >
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
+        <if test="criteria.valid" >
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
+            <foreach collection="criteria.criteria" item="criterion" >
+              <choose >
+                <when test="criterion.noValue" >
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue" >
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue" >
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue" >
+                  and ${criterion.condition}
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause" >
+    <where >
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
+        <if test="criteria.valid" >
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
+            <foreach collection="criteria.criteria" item="criterion" >
+              <choose >
+                <when test="criterion.noValue" >
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue" >
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue" >
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue" >
+                  and ${criterion.condition}
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List" >
+    mn_id, mn_caller, mn_leadcode, mn_number, companyId, createTime, creatorId, updateTime, 
+    updaterId
+  </sql>
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" >
+    select
+    <if test="distinct" >
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from maxnumbers
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null" >
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from maxnumbers
+    where mn_id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from maxnumbers
+    where mn_id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" >
+    delete from maxnumbers
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
+    insert into maxnumbers (mn_id, mn_caller, mn_leadcode, 
+      mn_number, companyId, createTime, 
+      creatorId, updateTime, updaterId
+      )
+    values (#{id,jdbcType=INTEGER}, #{mn_caller,jdbcType=VARCHAR}, #{mn_leadcode,jdbcType=VARCHAR},
+      #{mn_number,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{creatorId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
+    insert into maxnumbers
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        mn_id,
+      </if>
+      <if test="mn_caller != null" >
+        mn_caller,
+      </if>
+      <if test="mn_leadcode != null" >
+        mn_leadcode,
+      </if>
+      <if test="mn_number != null" >
+        mn_number,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="mn_caller != null" >
+        #{mn_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="mn_leadcode != null" >
+        #{mn_leadcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mn_number != null" >
+        #{mn_number,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" resultType="java.lang.Integer" >
+    select count(*) from maxnumbers
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map" >
+    update maxnumbers
+    <set >
+      <if test="record.id != null" >
+        mn_id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.mn_caller != null" >
+        mn_caller = #{record.mn_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="record.mn_leadcode != null" >
+        mn_leadcode = #{record.mn_leadcode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.mn_number != null" >
+        mn_number = #{record.mn_number,jdbcType=VARCHAR},
+      </if>
+      <if test="record.companyId != null" >
+        companyId = #{record.companyId,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null" >
+        createTime = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.creatorId != null" >
+        creatorId = #{record.creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="record.updateTime != null" >
+        updateTime = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updaterId != null" >
+        updaterId = #{record.updaterId,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null" >
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map" >
+    update maxnumbers
+    set mn_id = #{record.id,jdbcType=INTEGER},
+      mn_caller = #{record.mn_caller,jdbcType=VARCHAR},
+      mn_leadcode = #{record.mn_leadcode,jdbcType=VARCHAR},
+      mn_number = #{record.mn_number,jdbcType=VARCHAR},
+      companyId = #{record.companyId,jdbcType=INTEGER},
+      createTime = #{record.createTime,jdbcType=TIMESTAMP},
+      creatorId = #{record.creatorId,jdbcType=INTEGER},
+      updateTime = #{record.updateTime,jdbcType=TIMESTAMP},
+      updaterId = #{record.updaterId,jdbcType=INTEGER}
+    <if test="_parameter != null" >
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
+    update maxnumbers
+    <set >
+      <if test="mn_caller != null" >
+        mn_caller = #{mn_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="mn_leadcode != null" >
+        mn_leadcode = #{mn_leadcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mn_number != null" >
+        mn_number = #{mn_number,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        createTime = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        creatorId = #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+    </set>
+    where mn_id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
+    update maxnumbers
+    set mn_caller = #{mn_caller,jdbcType=VARCHAR},
+      mn_leadcode = #{mn_leadcode,jdbcType=VARCHAR},
+      mn_number = #{mn_number,jdbcType=VARCHAR},
+      companyId = #{companyId,jdbcType=INTEGER},
+      createTime = #{createTime,jdbcType=TIMESTAMP},
+      creatorId = #{creatorId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      updaterId = #{updaterId,jdbcType=INTEGER}
+    where mn_id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 276 - 0
applications/commons/commons-server/src/main/resources/mapper/MaxnumbersdetailMapper.xml

@@ -0,0 +1,276 @@
+<?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.commons.mapper.MaxnumbersdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.po.Maxnumbersdetail" >
+    <id column="md_id" property="id" jdbcType="INTEGER" />
+    <result column="md_caller" property="md_caller" jdbcType="VARCHAR" />
+    <result column="md_leadcode" property="md_leadcode" jdbcType="VARCHAR" />
+    <result column="md_maxno" property="md_maxno" jdbcType="INTEGER" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Example_Where_Clause" >
+    <where >
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
+        <if test="criteria.valid" >
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
+            <foreach collection="criteria.criteria" item="criterion" >
+              <choose >
+                <when test="criterion.noValue" >
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue" >
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue" >
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue" >
+                  and ${criterion.condition}
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause" >
+    <where >
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
+        <if test="criteria.valid" >
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
+            <foreach collection="criteria.criteria" item="criterion" >
+              <choose >
+                <when test="criterion.noValue" >
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue" >
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue" >
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue" >
+                  and ${criterion.condition}
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List" >
+    md_id, md_caller, md_leadcode, md_maxno, companyId, createTime, creatorId, updateTime, 
+    updaterId
+  </sql>
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.usoftchina.saas.commons.po.MaxnumbersdetailExample" >
+    select
+    <if test="distinct" >
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from maxnumbersdetail
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null" >
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from maxnumbersdetail
+    where md_id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from maxnumbersdetail
+    where md_id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersdetailExample" >
+    delete from maxnumbersdetail
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.commons.po.Maxnumbersdetail" >
+    insert into maxnumbersdetail (md_id, md_caller, md_leadcode, 
+      md_maxno, companyId, createTime, 
+      creatorId, updateTime, updaterId
+      )
+    values (#{id,jdbcType=INTEGER}, #{md_caller,jdbcType=VARCHAR}, #{md_leadcode,jdbcType=VARCHAR},
+      #{md_maxno,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{creatorId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Maxnumbersdetail" >
+    insert into maxnumbersdetail
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        md_id,
+      </if>
+      <if test="md_caller != null" >
+        md_caller,
+      </if>
+      <if test="md_leadcode != null" >
+        md_leadcode,
+      </if>
+      <if test="md_maxno != null" >
+        md_maxno,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="md_caller != null" >
+        #{md_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="md_leadcode != null" >
+        #{md_leadcode,jdbcType=VARCHAR},
+      </if>
+      <if test="md_maxno != null" >
+        #{md_maxno,jdbcType=INTEGER},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersdetailExample" resultType="java.lang.Integer" >
+    select count(*) from maxnumbersdetail
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map" >
+    update maxnumbersdetail
+    <set >
+      <if test="record.id != null" >
+        md_id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.md_caller != null" >
+        md_caller = #{record.md_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="record.md_leadcode != null" >
+        md_leadcode = #{record.md_leadcode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.md_maxno != null" >
+        md_maxno = #{record.md_maxno,jdbcType=INTEGER},
+      </if>
+      <if test="record.companyId != null" >
+        companyId = #{record.companyId,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null" >
+        createTime = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.creatorId != null" >
+        creatorId = #{record.creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="record.updateTime != null" >
+        updateTime = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updaterId != null" >
+        updaterId = #{record.updaterId,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null" >
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map" >
+    update maxnumbersdetail
+    set md_id = #{record.id,jdbcType=INTEGER},
+      md_caller = #{record.md_caller,jdbcType=VARCHAR},
+      md_leadcode = #{record.md_leadcode,jdbcType=VARCHAR},
+      md_maxno = #{record.md_maxno,jdbcType=INTEGER},
+      companyId = #{record.companyId,jdbcType=INTEGER},
+      createTime = #{record.createTime,jdbcType=TIMESTAMP},
+      creatorId = #{record.creatorId,jdbcType=INTEGER},
+      updateTime = #{record.updateTime,jdbcType=TIMESTAMP},
+      updaterId = #{record.updaterId,jdbcType=INTEGER}
+    <if test="_parameter != null" >
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.commons.po.Maxnumbersdetail" >
+    update maxnumbersdetail
+    <set >
+      <if test="md_caller != null" >
+        md_caller = #{md_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="md_leadcode != null" >
+        md_leadcode = #{md_leadcode,jdbcType=VARCHAR},
+      </if>
+      <if test="md_maxno != null" >
+        md_maxno = #{md_maxno,jdbcType=INTEGER},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        createTime = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        creatorId = #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+    </set>
+    where md_id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.commons.po.Maxnumbersdetail" >
+    update maxnumbersdetail
+    set md_caller = #{md_caller,jdbcType=VARCHAR},
+      md_leadcode = #{md_leadcode,jdbcType=VARCHAR},
+      md_maxno = #{md_maxno,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
+      createTime = #{createTime,jdbcType=TIMESTAMP},
+      creatorId = #{creatorId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      updaterId = #{updaterId,jdbcType=INTEGER}
+    where md_id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 6 - 7
applications/commons/pom.xml

@@ -8,14 +8,13 @@
         <version>1.0.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-
     <artifactId>commons</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>com.usoftchina.saas</groupId>
-            <artifactId>core</artifactId>
-        </dependency>
-    </dependencies>
+    <modules>
+        <module>commons-api</module>
+        <module>commons-dto</module>
+        <module>commons-server</module>
+    </modules>
+    <packaging>pom</packaging>
 
 
 </project>

+ 2 - 1
applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/WarehouseApi.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.document.api;
 
+import com.usoftchina.saas.base.Result;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 
@@ -9,6 +10,6 @@ import java.util.Map;
 public interface WarehouseApi {
 
     @GetMapping("/api/document/warehouse/post")
-    public String callProcedure(Map<String, Object> param);
+    public Result callProcedure(Map<String, Object> param);
 
 }

+ 10 - 3
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java

@@ -9,6 +9,16 @@ public class ProductDTO implements Serializable {
     private String pr_detail;
     private String pr_spec;
     private String pr_orispeccode;
+    private String pr_brand;
+    private String pr_unit;
+
+    public String getPr_unit() {
+        return pr_unit;
+    }
+
+    public void setPr_unit(String pr_unit) {
+        this.pr_unit = pr_unit;
+    }
 
     public long getId() {
         return id;
@@ -18,9 +28,6 @@ public class ProductDTO implements Serializable {
         this.id = id;
     }
 
-    private String pr_brand;
-
-
     public String getPr_code() {
         return pr_code;
     }

+ 2 - 11
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorDTO.java

@@ -1,15 +1,14 @@
 package com.usoftchina.saas.document.dto;
 
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 
 @ApiModel(value = "Vendor", description = "供应商资料")
-public class VendorDTO implements Serializable{
+public class VendorDTO extends CommonBaseDTO implements Serializable{
 
-    @ApiModelProperty(value = "ID")
-    private long ve_id;
     @ApiModelProperty(value = "供应商编号")
     private String ve_code;
     @ApiModelProperty(value = "供应商名称")
@@ -19,14 +18,6 @@ public class VendorDTO implements Serializable{
     @ApiModelProperty(value = "状态")
     private String ve_status;
 
-    public long getVe_id() {
-        return ve_id;
-    }
-
-    public void setVe_id(long ve_id) {
-        this.ve_id = ve_id;
-    }
-
     public String getVe_code() {
         return ve_code;
     }

+ 11 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/WarehouseDTO.java

@@ -0,0 +1,11 @@
+package com.usoftchina.saas.document.dto;
+
+import java.io.Serializable;
+
+public class WarehouseDTO implements Serializable {
+
+    private long wh_id;
+    private String wh_code;
+    private String wh_name;
+
+}

+ 2 - 1
applications/document/document-server/pom.xml

@@ -59,7 +59,8 @@
         </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
-            <artifactId>commons</artifactId>
+            <artifactId>commoms-dto</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
         </dependency>
     </dependencies>
 

+ 0 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java

@@ -1,14 +1,10 @@
 package com.usoftchina.saas.document;
 
-import com.usoftchina.saas.auth.client.EnableAuthClient;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
-import org.springframework.boot.SpringBootConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
 @SpringBootApplication
 @EnableEurekaClient

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

@@ -1,17 +1,17 @@
 package com.usoftchina.saas.document.controller;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 
-import com.usoftchina.saas.common.dto.ComboDTO;
-import com.usoftchina.saas.common.dto.DocReqDTO;
+
+import com.usoftchina.saas.commons.dto.ComboDTO;
+import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.service.ProductService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -24,7 +24,7 @@ public class ProductController {
 
     @RequestMapping("/getProductsByCondition")
     public Result<List<ProductDTO>> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO){
-        List<ProductDTO> productList = productService.getProductsByCondition(page, docReqDTO);
+        PageInfo<ProductDTO> productList = productService.getProductsByCondition(page, docReqDTO);
         return Result.success(productList);
     }
 
@@ -37,11 +37,11 @@ public class ProductController {
     @RequestMapping("/updateLatestPurchasePrice")
     public void updateLatestPurchasePrice(@RequestParam(value = "id") Long pu_id) {
         productService.updateLatestPurchasePrice(pu_id);
-    };
+    }
 
     @RequestMapping("/getProductsByPK")
     public Product getProductsByPK(@RequestParam(value = "pr_id") Long id) {
         return productService.getProductsByPK(id);
-    };
+    }
 
 }

+ 5 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java

@@ -1,11 +1,14 @@
 package com.usoftchina.saas.document.controller;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
-import com.usoftchina.saas.common.dto.DocReqDTO;
+
+import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -20,7 +23,7 @@ public class VendorController {
 
     @RequestMapping("/getVendorsByCondition")
     public Result<List<VendorDTO>> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO){
-        List<VendorDTO> vendorList = vendorService.getVendorsByCondition(page, docReqDTO);
+        PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(page, docReqDTO);
         return Result.success(vendorList);
     }
 }

+ 19 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java

@@ -1,7 +1,11 @@
 package com.usoftchina.saas.document.controller;
 
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.document.entities.Warehouse;
 import com.usoftchina.saas.document.service.WarehouseService;
 import org.springframework.beans.factory.annotation.Autowired;
+
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -9,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
 import java.util.Map;
 
 @RestController
-@RequestMapping("/api/document/warehouse")
+@RequestMapping("/warehouse")
 public class WarehouseController {
 
     @Autowired
@@ -20,9 +24,20 @@ public class WarehouseController {
      * @return
      */
     @GetMapping("/post")
-    public String post(Map<String, Object> map){
-        String result = warehouseService.callProcedure(map);
-        return result;
+    public Result post(Map<String, Object> map){
+        warehouseService.callProcedure(map);
+        return Result.success(map.get("result"));
+    }
+
+    @PostMapping("/save")
+    public Result saveFormData(@RequestBody Warehouse data){
+        boolean result = warehouseService.save(data);
+        return Result.success(result);
     }
 
+    @PostMapping("/valid/period")
+    public Result validPeriod(String period){
+        boolean result = warehouseService.validPeriod(period);
+        return Result.success(result);
+    }
 }

+ 5 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java

@@ -1,15 +1,17 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
-import com.usoftchina.saas.common.dto.ComboDTO;
-import com.usoftchina.saas.common.dto.DocReqDTO;
+
+import com.usoftchina.saas.commons.dto.ComboDTO;
+import com.usoftchina.saas.commons.dto.DocReqDTO;
+import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 
 import java.util.List;
 
 public interface ProductMapper extends CommonBaseMapper<Product> {
 
-    List<Product> getProductsByCondition(DocReqDTO docReqDTO);
+    List<ProductDTO> getProductsByCondition(DocReqDTO docReqDTO);
     List<ComboDTO> getProdUnit();
     void updateLatestPurchasePrice(Long pu_id);
 

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java

@@ -2,7 +2,8 @@ package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 
-import com.usoftchina.saas.common.dto.DocReqDTO;
+
+import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.entities.Vendor;
 
 import java.util.List;

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java

@@ -7,6 +7,7 @@ import java.util.Map;
 
 public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
 
-    String callProcedure(Map<String, Object> map);
+    void callProcedure(Map<String, Object> map);
 
+    Short validPeriod(Map<String, Object> map);
 }

+ 7 - 9
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/ProductServiceImpl.java

@@ -4,14 +4,14 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 
-import com.usoftchina.saas.common.dto.ComboDTO;
-import com.usoftchina.saas.common.dto.DocReqDTO;
+
+import com.usoftchina.saas.commons.dto.ComboDTO;
+import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
 import com.usoftchina.saas.document.service.ProductService;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -24,7 +24,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     private ProductMapper productMapper;
 
     @Override
-    public List<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
+    public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
         //设置分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -32,12 +32,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<Product> productList = productMapper.getProductsByCondition(docReqDTO);
-        //Product To ProductDTO
-        List<ProductDTO> productDTOList = BeanMapper.mapList(productList, ProductDTO.class);
+        List<ProductDTO> productList = productMapper.getProductsByCondition(docReqDTO);
         //取分页信息
-        PageInfo<ProductDTO> pageInfo = new PageInfo<ProductDTO>(productDTOList);
-        return productDTOList;
+        PageInfo<ProductDTO> pageInfo = new PageInfo<ProductDTO>(productList);
+        return pageInfo;
     }
 
     @Override

+ 6 - 8
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/VendorServiceImpl.java

@@ -3,14 +3,14 @@ package com.usoftchina.saas.document.service.Impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
-import com.usoftchina.saas.common.dto.DocReqDTO;
+
+import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.entities.Vendor;
 import com.usoftchina.saas.document.mapper.VendorMapper;
 
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -28,7 +28,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
 
 
     @Override
-    public List<VendorDTO> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO) {
+    public PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO) {
         //设置分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -36,11 +36,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<Vendor> vendorList = vendorMapper.getVendorsByCondition(docReqDTO);
-        //Vendor To VendorDTO
-        List<VendorDTO> vendorDTOList = BeanMapper.mapList(vendorList, VendorDTO.class);
+        List<VendorDTO> vendorList = vendorMapper.getVendorsByCondition(docReqDTO);
         //取分页信息
-        PageInfo<VendorDTO> pageInfo = new PageInfo<VendorDTO>(vendorDTOList);
-        return vendorDTOList;
+        PageInfo<VendorDTO> pageInfo = new PageInfo<VendorDTO>(vendorList);
+        return pageInfo;
     }
 }

+ 18 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/WarehouseServiceImpl.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service.Impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Warehouse;
 import com.usoftchina.saas.document.mapper.WarehouseMapper;
 
@@ -8,6 +9,7 @@ import com.usoftchina.saas.document.service.WarehouseService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.Map;
 
 @Service
@@ -17,9 +19,22 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
     private WarehouseMapper warehouseMapper;
 
     @Override
-    public String callProcedure(Map<String, Object> map){
-        String result = warehouseMapper.callProcedure(map);
-        return result;
+    public void callProcedure(Map<String, Object> map){
+        warehouseMapper.callProcedure(map);
+    }
+
+    @Override
+    public boolean validPeriod(String period) {
+        long companyId = BaseContextHolder.getCompanyId();
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("companyId", companyId);
+        map.put("period", period);
+        Short status = warehouseMapper.validPeriod(map);
+        if(status != null && status == 0){
+            return true;
+        }else{
+            return false;
+        }
     }
 
 }

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

@@ -1,9 +1,11 @@
 package com.usoftchina.saas.document.service;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 
-import com.usoftchina.saas.common.dto.ComboDTO;
-import com.usoftchina.saas.common.dto.DocReqDTO;
+
+import com.usoftchina.saas.commons.dto.ComboDTO;
+import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
@@ -15,7 +17,7 @@ import java.util.List;
 public interface ProductService extends CommonBaseService<ProductMapper, Product> {
 
 
-    List<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO);
+    PageInfo<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO);
 
     List<ComboDTO> getProdUnit();
 

+ 4 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java

@@ -1,18 +1,19 @@
 package com.usoftchina.saas.document.service;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 
-import com.usoftchina.saas.common.dto.DocReqDTO;
+
+import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.entities.Vendor;
 import com.usoftchina.saas.document.mapper.VendorMapper;
 
 import com.usoftchina.saas.page.PageRequest;
 
-import java.util.List;
 
 public interface VendorService extends CommonBaseService<VendorMapper, Vendor>{
 
-    List<VendorDTO> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO);
+    PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, DocReqDTO docReqDTO);
 
 }

+ 3 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/WarehouseService.java

@@ -9,6 +9,8 @@ import java.util.Map;
 
 public interface WarehouseService extends CommonBaseService<WarehouseMapper, Warehouse> {
 
-    String callProcedure(Map<String, Object> map);
+    void callProcedure(Map<String, Object> map);
+
+    boolean validPeriod(String periods);
 
 }

+ 10 - 1
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -35,8 +35,17 @@
         <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR" />
         <result column="pr_text5" property="pr_text5" jdbcType="VARCHAR" />
     </resultMap>
+    <resultMap id="ProductDTOResultMapper" type="com.usoftchina.saas.document.dto.ProductDTO">
+        <id column="pr_id" property="id" jdbcType="INTEGER" />
+        <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="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
+        <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+    </resultMap>
     <!--查询所有物料信息-->
-    <select id="getProductsByCondition" resultMap="ProductResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
+    <select id="getProductsByCondition" resultMap="ProductDTOResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
         SELECT * FROM PRODUCT
         <where>
             <if test="condition!=null">

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

@@ -29,7 +29,15 @@
         <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
         <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
     </resultMap>
-    <select id="getVendorsByCondition" resultMap="VendorResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
+    <resultMap id="VendorDTOResultMapper" type="com.usoftchina.saas.document.dto.VendorDTO">
+        <id column="ve_id" property="id" jdbcType="INTEGER" />
+        <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
+        <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
+        <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
+        <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <select id="getVendorsByCondition" resultMap="VendorDTOResultMapper" parameterType="com.usoftchina.saas.common.dto.DocReqDTO">
         SELECT * FROM VENDOR
         <where>
             <if test="condition!=null">

+ 13 - 6
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -20,13 +20,20 @@
         <result column="wh_text4" property="wh_text4" jdbcType="VARCHAR" />
         <result column="wh_text5" property="wh_text5" jdbcType="VARCHAR" />
     </resultMap>
-    <select id="callProcedure" parameterMap="testParamMap" statementType="CALLABLE">
-        call sp_test(?, ?)
+    <select id="callProcedure" parameterMap="paramMap" statementType="CALLABLE">
+        CALL SP_COMMITPRODINOUT(?, ?, ?, ?, ?)
     </select>
-    <parameterMap id="testParamMap" type="java.util.Map">
-        <parameter property="inParam" jdbcType="VARCHAR" mode="IN" />
-        <parameter property="outParam" jdbcType="VARCHAR" mode="OUT" />
+    <parameterMap id="paramMap" type="java.util.Map">
+        <parameter property="inoutNo" jdbcType="VARCHAR" mode="IN" />
+        <parameter property="class" jdbcType="VARCHAR" mode="IN" />
+        <parameter property="commitid" jdbcType="INTEGER" mode="IN" />
+        <parameter property="companyid" jdbcType="INTEGER" mode="IN" />
+        <parameter property="result" jdbcType="VARCHAR" mode="OUT" />
     </parameterMap>
-    
+
+    <select id="validPeriod" parameterType="map" resultType="java.lang.Short">
+        SELECT IFNULL(PD_STATUS,0) PD_STATUS FROM PERIODSDETAIL WHERE COMPANYID=#{companyId} AND PD_DETNO=#{period}
+    </select>
+
 </mapper>
 

+ 6 - 5
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorTest.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service;
 
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.document.DocumentApplication;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import org.junit.Test;
@@ -22,10 +23,10 @@ public class VendorTest {
 
     @Test
     public void testSelectAll(){
-        List<VendorDTO> vendorList = vendorService.getVendorsByCondition(null, null);
-        System.out.println("vendCode: " + vendorList.get(0).getVe_code());
-        System.out.println("vendName: " + vendorList.get(0).getVe_name());
-        System.out.println("vendType: " + vendorList.get(0).getVe_type());
-        System.out.println("vendBeginDate: " + vendorList.get(0).getVe_status());
+        PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(null, null);
+        System.out.println("vendCode: " + vendorList.getList().get(0).getVe_code());
+        System.out.println("vendName: " + vendorList.getList().get(0).getVe_name());
+        System.out.println("vendType: " + vendorList.getList().get(0).getVe_type());
+        System.out.println("vendBeginDate: " + vendorList.getList().get(0).getVe_status());
     }
 }

+ 14 - 3
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/WarehouseTest.java

@@ -22,12 +22,23 @@ public class WarehouseTest {
     @Test
     public void testCallProcedure(){
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("inParam", "Hello,World!");              //入参
-        map.put("outParam", null);                      //输出结果
+        map.put("inoutNo", "YS20181018");              //入参
+        map.put("class", "采购验收单");
+        map.put("commitid", null);
+        map.put("companyid", null);
+        map.put("result", null);                      //输出结果
         warehouseService.callProcedure(map);
         //输出返回值
-        System.out.println("result:" + map.get("outParam"));
+        System.out.println("result:" + map.get("result"));
     }
 
 
+    @Test
+    public void testPeriod(){
+        long companyId = 12;
+        String period = "201810";
+        boolean valid = warehouseService.validPeriod(period);
+        System.out.println("result: " + valid);
+    }
+
 }

+ 2 - 10
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDTO.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.purchase.dto;
 
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
@@ -12,16 +13,7 @@ import java.util.Date;
  */
 @Data
 @ApiModel(value = "Purchase", description = "采购订单")
-public class PurchaseDTO implements Serializable{
-    protected Long id;
-    /**
-     * company id
-     */
-    protected long companyId;
-    protected Date createTime;
-    protected long creatorId;
-    protected Date updateTime;
-    protected long updaterId;
+public class PurchaseDTO extends CommonBaseDTO implements Serializable{
 
     private String pu_code;
 

+ 2 - 16
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseItemDTO.java → applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDetailDTO.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.purchase.dto;
 
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import com.usoftchina.saas.document.entities.Product;
 import lombok.Data;
 
@@ -11,22 +12,7 @@ import java.util.Date;
  * @date 2018/10/9
  */
 @Data
-public class PurchaseItemDTO implements Serializable{
-    protected Long id;
-
-    /**
-     * company id
-
-     */
-    protected long companyId;
-
-    protected Date createTime;
-
-    protected long creatorId;
-
-    protected Date updateTime;
-
-    protected long updaterId;
+public class PurchaseDetailDTO extends CommonBaseDTO implements Serializable{
 
     private  Long pd_puid;
 

+ 3 - 3
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseFormDTO.java

@@ -11,7 +11,7 @@ import java.util.List;
  */
 public class PurchaseFormDTO implements Serializable{
     private PurchaseDTO main;
-    private List<PurchaseItemDTO> items;
+    private List<PurchaseDetailDTO> items;
 
     public PurchaseDTO getMain() {
         return main;
@@ -21,11 +21,11 @@ public class PurchaseFormDTO implements Serializable{
         this.main = main;
     }
 
-    public List<PurchaseItemDTO> getItems() {
+    public List<PurchaseDetailDTO> getItems() {
         return items;
     }
 
-    public void setItems(List<PurchaseItemDTO> items) {
+    public void setItems(List<PurchaseDetailDTO> items) {
         this.items = items;
     }
 

+ 2 - 9
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseListDTO.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.purchase.dto;
 
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -12,16 +13,8 @@ import java.util.Date;
  * @date 2018/10/9
  */
 @Data
-public class PurchaseListDTO implements Serializable {
+public class PurchaseListDTO extends CommonBaseDTO implements Serializable {
     //主表信息
-    protected long companyId;
-
-    protected Date createTime;
-
-    protected Date updateTime;
-
-    protected long updaterId;
-
     private  Integer pu_id;
 
     private String pu_code;

+ 2 - 1
applications/purchase/purchase-server/pom.xml

@@ -62,7 +62,8 @@
         </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
-            <artifactId>commons</artifactId>
+            <artifactId>commoms-dto</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
         </dependency>
     </dependencies>
 

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

@@ -2,8 +2,9 @@ package com.usoftchina.saas.purchase.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
-import com.usoftchina.saas.common.dto.BatchDealBaseDTO;
-import com.usoftchina.saas.common.dto.DocSavedDTO;
+
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.*;
 import com.usoftchina.saas.purchase.po.PurchaseList;
@@ -80,9 +81,9 @@ public class PurchaseController {
      * @param id
      * @return
      */
-    @GetMapping("/deleteItem/{id}")
-    public Result deleteItem(@PathVariable("id") Long id) {
-        purchaseService.deleteItem(id);
+    @GetMapping("/deleteDetail/{id}")
+    public Result deleteDetail(@PathVariable("id") Long id) {
+        purchaseService.deleteDetail(id);
         return Result.success();
     }
 
@@ -98,6 +99,18 @@ public class PurchaseController {
         return Result.success(audit);
     }
 
+    /**
+     * 采购订单审批
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/unAudit/{id}")
+    public Result unAudit(@PathVariable("id") Long id) {
+        purchaseService.unAudit(id);
+        return Result.success();
+    }
+
     /**
      * 采购订单批量审核
      *
@@ -122,4 +135,27 @@ public class PurchaseController {
         return Result.success();
     }
 
+    /**
+     * 采购订单批量反审核
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchUnAudit")
+    public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
+        purchaseService.batchUnAudit(baseDTOs);
+        return Result.success();
+    }
+
+    @PostMapping("/close/{id}")
+    public Result closePurchase(@PathVariable(value = "id") long id){
+        purchaseService.closePurchase(id);
+        return Result.success();
+    }
+
+    @PostMapping("/open/{id}")
+    public Result openPurchase(@PathVariable(value = "id") long id){
+        purchaseService.openPurchase(id);
+        return Result.success();
+    }
 }

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

@@ -1,7 +1,8 @@
 package com.usoftchina.saas.purchase.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
-import com.usoftchina.saas.common.dto.DocBaseDTO;
+
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.purchase.po.Purchase;
 import java.util.List;
 
@@ -16,5 +17,7 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
 
     String validateAudit(List<DocBaseDTO> list);
 
-    List<Purchase> selectByTest(String con);
+    String validateUnAudit(Long id);
+
+    String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
 }

+ 9 - 9
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasedetailMapper.java

@@ -2,28 +2,28 @@ package com.usoftchina.saas.purchase.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.purchase.po.Purchase;
-import com.usoftchina.saas.purchase.po.PurchaseItem;
+import com.usoftchina.saas.purchase.po.PurchaseDetail;
 import java.util.List;
 
 
 public interface PurchasedetailMapper extends CommonBaseMapper<Purchase> {
     int deleteByPrimaryKey(Integer pdId);
 
-    int insert(PurchaseItem record);
+    int insert(PurchaseDetail record);
 
-    int insertSelective(PurchaseItem record);
+    int insertSelective(PurchaseDetail record);
 
-    PurchaseItem selectByPrimaryKey(Integer pdId);
+    PurchaseDetail selectByPrimaryKey(Integer pdId);
 
-    int updateByPrimaryKeySelective(PurchaseItem record);
+    int updateByPrimaryKeySelective(PurchaseDetail record);
 
-    int updateByPrimaryKey(PurchaseItem record);
+    int updateByPrimaryKey(PurchaseDetail record);
 
-    void batchInsert(List<PurchaseItem> list);
+    void batchInsert(List<PurchaseDetail> list);
 
-    void batchUpdate(List<PurchaseItem> list);
+    void batchUpdate(List<PurchaseDetail> list);
 
     void deleteByForeignKey(Long fk_id);
 
-    List<PurchaseItem> selectByFK(Long fk_i);
+    List<PurchaseDetail> selectByFK(Long fk_i);
 }

+ 1 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseItem.java → applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseDetail.java

@@ -8,7 +8,7 @@ import lombok.Data;
 import java.io.Serializable;
 
 @Data
-public class PurchaseItem extends CommonBaseEntity implements Serializable {
+public class PurchaseDetail extends CommonBaseEntity implements Serializable {
 
     private  Long pd_puid;
 

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

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.purchase.po;
 
 
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -11,17 +12,9 @@ import java.util.Date;
  * @create: 2018-10-10 16:42
  **/
 @Data
-public class PurchaseList implements Serializable {
+public class PurchaseList extends CommonBaseEntity implements Serializable {
 
     //主表信息
-    protected long companyId;
-
-    protected Date createTime;
-
-    protected Date updateTime;
-
-    protected long updaterId;
-
     private  Integer pu_id;
 
     private String pu_code;

+ 1 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/Status.java

@@ -4,7 +4,7 @@ public enum Status {
     /**
      * 在录入
      */
-    ENTERING("在录入"),
+    UNAUDITED("未审核"),
 
     /**
      * 已审核

+ 35 - 3
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java

@@ -3,8 +3,9 @@ package com.usoftchina.saas.purchase.service;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 
-import com.usoftchina.saas.common.dto.BatchDealBaseDTO;
-import com.usoftchina.saas.common.dto.DocSavedDTO;
+
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.PurchaseFormDTO;
 import com.usoftchina.saas.purchase.dto.PurchaseReqDTO;
@@ -63,7 +64,7 @@ public interface PurchaseService extends CommonBaseService<PurchaseMapper, Purch
      * @param id
      * @return
      */
-    int deleteItem(Long id);
+    int deleteDetail(Long id);
 
     /**
      * 删除明细
@@ -90,5 +91,36 @@ public interface PurchaseService extends CommonBaseService<PurchaseMapper, Purch
     * @Date: 2018/10/15
     */
     void batchDelete(BatchDealBaseDTO baseDTOs);
+    /**
+    * @Description
+     * 反审核
+    * @Param: [id]
+    * @return: com.usoftchina.saas.common.dto.DocSavedDTO
+    * @Author: guq
+    * @Date: 2018/10/17
+    */
+    void unAudit(Long id);
+
+    /** 
+    * @Description
+    * @Param: [baseDTOs] 
+    * @return: void 
+    * @Author: guq
+    * @Date: 2018/10/17 
+    */
+    void batchUnAudit(BatchDealBaseDTO baseDTOs);
 
+    /**
+     * 采购单关闭
+     * @param id
+     * @Author: chenwei
+     * @Date: 20181018
+     */
+    void closePurchase(long id);
+
+    /**
+     * 采购单恢复
+     * @param id
+     */
+    void openPurchase(long id);
 }

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

@@ -4,9 +4,10 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
-import com.usoftchina.saas.common.dto.BatchDealBaseDTO;
-import com.usoftchina.saas.common.dto.DocBaseDTO;
-import com.usoftchina.saas.common.dto.DocSavedDTO;
+
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.document.api.ProductApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
@@ -19,7 +20,6 @@ import com.usoftchina.saas.purchase.service.PurchaseService;
 import com.usoftchina.saas.utils.BeanMapper;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
@@ -68,8 +68,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //将purchase实体对象转化成传输对象
         PurchaseDTO main = BeanMapper.map(purchase, PurchaseDTO.class);
         //查询从表
-        List<PurchaseItem> purchaseItems = purchasedetailMapper.selectByFK(id);
-        List<PurchaseItemDTO> items = BeanMapper.mapList(purchaseItems, PurchaseItemDTO.class);
+        List<PurchaseDetail> purchaseDetails = purchasedetailMapper.selectByFK(id);
+        List<PurchaseDetailDTO> items = BeanMapper.mapList(purchaseDetails, PurchaseDetailDTO.class);
         purchaseFormDTO.setMain(main);
         purchaseFormDTO.setItems(items);
         return  purchaseFormDTO;
@@ -83,17 +83,17 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
 
         //获取主表信息
         PurchaseDTO main = formdata.getMain();
-        List<PurchaseItemDTO> items = formdata.getItems();
+        List<PurchaseDetailDTO> items = formdata.getItems();
         //插入从表数据
-        List<PurchaseItem> insertDetails = new ArrayList<>();
+        List<PurchaseDetail> insertDetails = new ArrayList<>();
         //更新从表数据
-        List<PurchaseItem> updateDetails = new ArrayList<>();
+        List<PurchaseDetail> updateDetails = new ArrayList<>();
         DocSavedDTO saveDTO = new DocSavedDTO();
         Long pu_id = main.getId();
         String pu_code = main.getPu_code();
         Purchase purchase = BeanMapper.map(main, Purchase.class);
 
-        //编号获取
+        //编号获取 到时候确定处理
         if (StringUtils.isEmpty(pu_code)) {
             pu_code = "PU" + Math.random() * 1000;
             purchase.setPu_code(pu_code);
@@ -104,8 +104,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             //更新主表
             purchaseMapper.updateByPrimaryKeySelective(purchase);
             //添加从表传输对象
-            for (PurchaseItemDTO item : items) {
-                PurchaseItem detail = BeanMapper.map(item, PurchaseItem.class);
+            for (PurchaseDetailDTO item : items) {
+                PurchaseDetail detail = BeanMapper.map(item, PurchaseDetail.class);
                 detail.setPd_puid(pu_id);
                 detail.setPd_code(pu_code);
                 if (!StringUtils.isEmpty(detail.getId())) {
@@ -130,8 +130,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         purchaseMapper.insertSelective(purchase);
         pu_id = purchase.getId();
         //添加从表传输对象
-        for (PurchaseItemDTO item : items) {
-            PurchaseItem detail = BeanMapper.map(item, PurchaseItem.class);
+        for (PurchaseDetailDTO item : items) {
+            PurchaseDetail detail = BeanMapper.map(item, PurchaseDetail.class);
             detail.setPd_puid(pu_id);
             detail.setPd_code(pu_code);
             insertDetails.add(detail);
@@ -150,7 +150,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     }
 
     @Override
-    public int deleteItem(Long id) {
+    public int deleteDetail(Long id) {
         return purchasedetailMapper.deleteByPrimaryKey(id);
     }
 
@@ -194,6 +194,70 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         }
     }
 
+    @Override
+    public void unAudit(Long id) {
+        if (null == id) {
+            return;
+        }
+        String code = purchaseMapper.validateUnAudit(id);
+        if (null != code) {
+            throw new BizException(500, "单据:" + code + " 未审核,无法反审核");
+        }
+        singleUnAudit(id);
+    }
+
+    @Override
+    public void batchUnAudit(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0)
+            return;
+        String msg = purchaseMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
+        if (null != msg) {
+            throw new BizException(500, "存在未审核单据,单据编号:" + msg);
+        }
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            singleUnAudit(base.getId());
+        }
+    }
+
+    @Override
+    public void closePurchase(long id) {
+        Purchase purchase = new Purchase();
+        purchase.setId(id);
+        purchase.setPu_acceptstatuscode("CLOSED");
+        purchase.setPu_acceptstatus("已关闭");
+        purchaseMapper.updateByPrimaryKeySelective(purchase);
+    }
+
+    @Override
+    public void openPurchase(long id) {
+        List<PurchaseDetail> purchaseDetailList = purchasedetailMapper.selectByFK(id);
+        int partTurnCount = 0,turnCount = 0;            //部分入库、全部入库
+        if(purchaseDetailList != null && purchaseDetailList.size() > 0){
+            for(PurchaseDetail purchaseDetail : purchaseDetailList){
+                if(purchaseDetail.getPd_acceptqty() >= purchaseDetail.getPd_qty()){     //入库数大于等于采购数
+                    turnCount++;
+                }else if(purchaseDetail.getPd_acceptqty() > 0 && purchaseDetail.getPd_acceptqty() < purchaseDetail.getPd_qty()){    //     0 < 入库数 < 采购数
+                    partTurnCount++;
+                }
+            }
+            //构造更新对象
+            Purchase purchase = new Purchase();
+            purchase.setId(id);
+            purchase.setPu_acceptstatuscode("UNTURNIN");
+            purchase.setPu_acceptstatus("未入库");
+            if(partTurnCount > 0){
+                purchase.setPu_acceptstatuscode("PART2IN");
+                purchase.setPu_acceptstatus("部分入库");
+            }
+            if(turnCount == purchaseDetailList.size()){
+                purchase.setPu_acceptstatus("已入库");
+                purchase.setPu_acceptstatuscode("TURNIN");
+            }
+            purchaseMapper.updateByPrimaryKeySelective(purchase);
+        }
+    }
+
     private void singleAudit(Long id) {
         Purchase purchase = new Purchase();
         //生成更新对象
@@ -207,6 +271,17 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         productApi.updateLatestPurchasePrice(id);
     }
 
+    private void singleUnAudit(Long id) {
+        Purchase purchase = new Purchase();
+        //生成更新对象
+        purchase.setId(id);
+        purchase.setPu_status(Status.UNAUDITED.getDisplay());
+        purchase.setPu_statuscode(Status.UNAUDITED.name());
+        purchase.setUpdateTime(new Date());
+        //更新存在字段
+        purchaseMapper.updateByPrimaryKeySelective(purchase);
+    }
+
     private void singleDelete(Long id) {
         if (null != id) {
             //从表删除
@@ -218,7 +293,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
 
     private List<PurchaseList> getListByMode(PurchaseReqDTO req) {
         List<PurchaseList> list = null;
-        if (null == req || StringUtils.isEmpty(req.getMode()) || "Main".equals(req.getMode())) {
+        if (null == req || StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
             list = purchaseListMapper.selectPurchaseBycondition(req);
         } else {
             list = purchaseListMapper.selectPurchaseListByCondition(req);

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

@@ -70,6 +70,7 @@
             <if test="keyword != null">
                 AND ${keyword}
             </if>
+            order by pu_id,pd_detno
         </where>
     </select>
 
@@ -89,6 +90,7 @@
                 AND ${keyword}
             </if>
         </where>
+        order by pu_id
     </select>
     <insert id="batchInsert" parameterType="java.util.List" >
         insert into purchasedetail ( PD_PUID, PD_CODE,
@@ -115,7 +117,7 @@
             )
         </foreach>
     </insert>
-    <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.PurchaseItem" >
+    <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
         <foreach collection="list" item="item" index="index" open="" close="" separator=";">
             update purchasedetail <set>
             PD_PUID = #{item.pdPuid},

+ 10 - 1
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -391,12 +391,21 @@
       pu_text5 = #{pu_text5,jdbcType=VARCHAR}
     where pu_id = #{id,jdbcType=INTEGER}
   </update>
-  <select id="validateAudit" parameterType="com.usoftchina.saas.common.dto.DocBaseDTO" resultType="java.lang.String">
+  <select id="validateAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
     select GROUP_CONCAT(pu_code) from purchase where pu_statuscode='AUDITED' and pu_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>
   </select>
+  <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(pu_code) from purchase where pu_statuscode='UNAUDITED' and pu_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+  <select id="validateUnAudit" parameterType="long" resultType="java.lang.String">
+    select pu_code from purchase where pu_id = #{pu_id} and IFNULL(pu_statuscode,'UNAUDITED')='UNAUDITED'
+  </select>
   <select id="selectByTest" resultMap="BaseResultMap" parameterType="string" >
     select * from purchase <where>
     <if test="_parameter != null">

+ 7 - 7
applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml

@@ -1,7 +1,7 @@
 <?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.purchase.mapper.PurchasedetailMapper" >
-  <resultMap id="BaseResultMap" type="com.usoftchina.saas.purchase.po.PurchaseItem" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     <id column="PD_ID" property="id" jdbcType="INTEGER" />
     <result column="PD_PUID" property="pd_puid" jdbcType="INTEGER" />
     <result column="PD_CODE" property="pd_code" jdbcType="VARCHAR" />
@@ -74,7 +74,7 @@
     delete from purchasedetail
     where PD_ID = #{id}
   </delete>
-  <insert id="insert" parameterType="com.usoftchina.saas.purchase.po.PurchaseItem" >
+  <insert id="insert" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     insert into purchasedetail (PD_PUID, PD_CODE,
     PD_DETNO, PD_PRODID, PD_PRODCODE,
     PD_UNIT, PD_QTY, PD_PRICE,
@@ -94,7 +94,7 @@
     #{pdText3,jdbcType=VARCHAR}, #{pdText4,jdbcType=VARCHAR}, #{pdText5,jdbcType=VARCHAR},
     #{pdYqty,jdbcType=DOUBLE})
   </insert>
-  <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseItem" >
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     insert into purchasedetail
     <trim prefix="(" suffix=")" suffixOverrides="," >
       <if test="pdPuid != null" >
@@ -245,7 +245,7 @@
       </if>
     </trim>
   </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseItem" >
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     update purchasedetail
     <set >
       <if test="pdPuid != null" >
@@ -323,7 +323,7 @@
     </set>
     where PD_ID = #{id,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.purchase.po.PurchaseItem" >
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     update purchasedetail
     set PD_PUID = #{pdPuid,jdbcType=INTEGER},
     PD_CODE = #{pdCode,jdbcType=VARCHAR},
@@ -376,7 +376,7 @@
       )
     </foreach>
   </insert>
-  <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.PurchaseItem" >
+  <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
       update purchasedetail <set>
       PD_PUID = #{item.pd_puid},
@@ -412,6 +412,6 @@
   </delete>
   <select id="selectByFK" parameterType="long" resultMap="BaseResultMap">
     select * from purchasedetail a left join product b on pr_id=pd_prodid and a.companyid = b.companyid
-      where pd_puid=#{pu_id}
+      where pd_puid=#{pu_id} order by pd_detno
   </select>
 </mapper>

+ 10 - 1
frontend/saas-web/app/util/FormUtil.js

@@ -60,9 +60,16 @@ Ext.define('saas.util.FormUtil', {
 
                         // 如果是从表为其绑定store
                         if(item.xtype == 'detailGridField') {
+                            var columns = item.columns,
+                            cnames = columns.filter(function(c) {
+                                return c.dataIndex && !c.ignore;
+                            }).map(function(c) {
+                                return c.dataIndex
+                            });
+                            formModel.set('_detailBindFields', cnames);
                             item.bind = {
                                 store: '{_detailStore}'
-                            };           
+                            };       
                             formModel.set('_detailStore', Ext.create('Ext.data.Store', {
                                 fields: item.columns ? item.columns.filter(function(c) {
                                     return !!c.dataIndex;
@@ -77,6 +84,8 @@ Ext.define('saas.util.FormUtil', {
                                 }) : [],
                                 data: []
                             }));
+
+
                         }
                     });
                 }

+ 18 - 141
frontend/saas-web/app/util/QueryUtil.js

@@ -24,7 +24,6 @@ Ext.define('saas.util.QueryUtil', {
                 me.getStoreMode(queryMoreForm);
             }
         }
-        console.log("Mode:"+Mode);
         if(Mode=="MAIN"){
             grid._Mode = Mode;
             grid.reconfigure(grid.store, grid._baseColumn);
@@ -57,13 +56,12 @@ Ext.define('saas.util.QueryUtil', {
 				} else if (f.xtype == 'condatefield' && f.value != null ){
                     if(f.value.from != null){
                         if(condition == ''){
-                            condition += " date("+f.name+") between '"+f.value.from+"' and '"+f.value.to+"' ";
+                            condition += " ( date("+f.name+") between '"+Ext.Date.format(f.value.from,"Y-m-d H:i:s")+"' and '"+Ext.Date.format(f.value.to,"Y-m-d H:i:s")+"' )";
                         } else {
-                            condition += " AND date("+f.name+") between '"+f.value.from+"' and '"+f.value.to+"' ";
+                            condition += " AND ( date("+f.name+") between '"+Ext.Date.format(f.value.from,"Y-m-d H:i:s")+"' and '"+Ext.Date.format(f.value.to,"Y-m-d H:i:s")+"' )";
                         }
                     }
                 }else if(f.xtype == 'datefield' && f.value != null && f.value != '' ){
-                    debugger;
 					var v = Ext.Date.format(new Date(f.value), 'Y-m-d');
 					if(condition == ''){
 						condition += "date("+f.name+")='"+v+"'";
@@ -72,7 +70,6 @@ Ext.define('saas.util.QueryUtil', {
 					}
 				} else if(f.xtype == 'datetimefield' && f.value != null){
                     var v = Ext.Date.format(new Date(f.value), 'Y-m-d H:i:s');
-                    debugger;
 					if(condition == ''){
 						condition += 'date('+f.name + ")= '" + v + "'";
 					} else {
@@ -85,31 +82,23 @@ Ext.define('saas.util.QueryUtil', {
 					} else {
 						condition += ' AND ' + f.name + endChar + f.value;
 					}
-				} else if(f.xtype == 'combo' && f.value != '$ALL'){
-					if(f.store.data.length > 1) {
-						if(condition == ''){
-							condition += '(';
-						} else {
-							condition += ' AND (';
-						}
-						var _a = '';
-						f.store.each(function(d, idx){
-							if(d.data.value != '$ALL') {
-								if(_a == ''){
-									_a += f.logic + "='" + d.data.value + "'";
-								} else {
-									_a += ' OR ' + f.logic + "='" + d.data.value + "'";
-								}
-							}
-						});
-						condition += _a + ')';
-					}
+				} else if(f.xtype == 'combobox' ){
+                    if(f.value != '$ALL'&& f.value!=null){
+                        if(condition == ''){
+                            condition = f.name+" = '"+f.value+"' ";
+                        } else {
+                            condition += ' AND '+f.name+" = '"+f.value+"' ";
+                        }
+                    }
 				} else if(f.xtype == 'multicombo' ){
-				    if(f.value){
+				    if(f.value && f.value.length > 0){
+                        var text = f.value.map(function(v) {
+                            return '\'' + v.value + '\'';
+                        }).join(',');
                         if(condition == ''){
-                            condition += f.name + " in (" + f.value+")";
+                            condition = f.name + " in (" + text +")";
                         } else {
-                            condition += ' AND ' +  f.name + " in (" + f.value+")";
+                            condition += ' AND ' +  f.name + " in (" + text +")";
                         }
                     }
 
@@ -170,7 +159,7 @@ Ext.define('saas.util.QueryUtil', {
                                             var nameArr = f.name.split("#");
                                             Ext.each(nameArr, function(nameItem,index) {
                                                 if(index==0){
-                                                    condition = ' AND ('+(nameItem+ " like '%" +f.value + "%'");
+                                                    condition += ' AND ('+(nameItem+ " like '%" +f.value + "%'");
                                                 }else{
                                                     condition += " or "+nameItem+ " like '%" +f.value + "%' ";
                                                 }
@@ -207,117 +196,5 @@ Ext.define('saas.util.QueryUtil', {
 			substr = substr.toLowerCase();
 		}
 		return string.indexOf(substr) > -1;
-    },
-    /**
-     * 
-     */
-    queryData: function(grid,condition){
-        // var me = this;
-        //     if(Ext.isEmpty(condition)){
-        //         condition =" 1=1 ";
-        //     }
-        //     var params = { keyword: condition,number:1,size:15 };
-        //     var dataRes = {
-        //         url :grid.listUrl,
-        //         async:false,
-        //         params:params
-        //     };
-        //     me.BaseUtil.request(dataRes)
-        //     .then(function(response) {
-        //         var res = Ext.decode(response.responseText);
-        //         if(res.success) {
-        //             var data = res.data;
-        //             console.log(data);
-        //              grid.getStore().loadData(data.list);
-        //              grid.fireEvent('afterLoadData', grid, data.list);
-        //         }
-        //     })
-        //     .catch(function(response) {
-        //         console.log(response);
-        //         // something...
-        //     });
-    },
-    onQuery: function(parentForm,queryMoreForm){
-        var me = this,
-            grid = parentForm.down('grid'),
-            queryForm = parentForm.down('form'),
-            condition = me.getFormCondition(queryForm),
-            Mode = me.getStoreMode(queryForm);
-        if(queryMoreForm){//更多查询
-            if(!Ext.isEmpty(condition)){
-                condition = " and ( "+me.getStoreMode(queryMoreForm)+" ) ";
-            }else{
-                condition = me.getStoreMode(queryMoreForm);
-            }
-            if(Mode=="MAIN"){
-                me.getStoreMode(queryMoreForm);
-            }
-        }
-        console.log("condition:"+condition);
-        condition = " 1=1 ";
-        if(Mode=="MAIN"){
-            console.log("Mode:"+Mode+",查询当前列表");
-            grid.loadPage(1);
-        }else{
-            console.log("Mode:"+Mode+",查询当前关联列表");
-            //若明细字段含明细字段注意切换数据源 grid.reconfigure(store, columns);
-            //关联viewName = 关联viewName+"-RelativeGrid"
-            grid.loadPage(1);
-        }
-
-    },
-    add10EmptyRow: function(grid) {
-        var store = grid.getStore(),
-            selectedRecord = grid.selModel.lastSelected,
-            datas = [];
-        Ext.Array.each(new Array(10), function() {
-            datas.push({});
-        })
-        store.insert(store.indexOf(selectedRecord) + 1, datas);
-    },
-    /**
-     * 获取grid被选数据
-	 * grid:原始字符串
-	 */
-    getGridSelected:function(grid){
-        var items = grid.selModel.getSelection(),
-        data = new Array();
-		Ext.each(items, function(item, index){
-			if(!Ext.isEmpty(item.data[grid._idField])&&!Ext.isEmpty(item.data[grid._codeField])){
-				var o = new Object();
-				if(grid._idField){
-					o['id'] = item.data[grid._idField];
-                }
-                if(grid._codeField){
-					o['code'] = item.data[grid._codeField];
-                }
-                o['name'] = '';
-				data.push(o);
-            }
-		});
-		return data;
-    },
-    /**
-     * 发起批量操作请求
-	 * grid:原始字符串
-	 */
-    vastRes:function(url,params){
-        console.log("params",params);
-        var me = this,
-        pp ={baseDTOs:params} ;
-        console.log("pp",pp);
-        me.BaseUtil.request({
-                url: url,
-                params: JSON.stringify(pp),
-                method: 'POST',
-            })
-            .then(function() {
-                Ext.Msg.alert('提示','操作成功');
-            })
-            .catch(function(response) {
-                console.log(response);
-                Ext.Msg.alert('提示','操作失败');
-            });
-        }
-    
+    }
 });

+ 5 - 4
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -116,12 +116,13 @@ Ext.define('saas.view.core.form.FormPanel', {
 
     /**
      * 获取form数据
+     * @param all: true:取全部数据,false:排除忽视字段
      */
-    getFormData: function(ignore) {
+    getFormData: function(all) {
         var me = this,
         viewModel = me.getViewModel(),
         allData = viewModel.getData(),
-        bindFields = allData.bindFields,
+        bindFields = allData._bindFields,
         formData = {
             main: {},
             detail: []
@@ -130,7 +131,7 @@ Ext.define('saas.view.core.form.FormPanel', {
         for(k in allData) {
             var d = allData[k];
             // 主表数据
-            if(ignore) {
+            if(all) {
                 formData.main[k] = d;
             }else {
                 if(bindFields.indexOf(k) != -1) {
@@ -182,7 +183,7 @@ Ext.define('saas.view.core.form.FormPanel', {
                 }
             }
         });
-        viewModel.set('bindFields', bindFields);
+        viewModel.set('_bindFields', bindFields);
     },
 
     initFormData: function(formData) {

+ 17 - 7
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -60,8 +60,12 @@ Ext.define('saas.view.core.form.FormPanelController', {
     },
 
     save:function(){
-        var me = this;
-        var form = this.getView();
+        var me = this,
+        form = this.getView(),
+        viewModel = me.getViewModel(),
+        modelData = viewModel.getData(),
+        detailBindFields = modelData._detailBindFields;
+
         if(form.getForm().wasDirty==false){
             Ext.Msg.alert('提示','未修改数据,请修改后保存');
             return false;
@@ -76,15 +80,21 @@ Ext.define('saas.view.core.form.FormPanelController', {
         var dirtyGridData = [];
         if(gridData.length>0){
             Ext.each(gridData, function(item,index){
-                if(item.dirty){
-                    if((typeof item.data.id) != "number" && item.data.id.indexOf('extMode')>-1){
-                        item.data.id = '';
+                var d = Object.assign({}, item.data),
+                dirty = item.dirty;
+                if(dirty){
+                    if((typeof d.id) != "number" && d.id.indexOf('extMode')>-1){
+                        delete d.id;
                     }
-                    dirtyGridData.push(item.data)
+                    for(k in d) {
+                        if(!Ext.Array.contains(detailBindFields, k)) {
+                            delete d[k];
+                        }
+                    }
+                    dirtyGridData.push(d);
                 }
             });
         }  
-        debugger 
         var params = {
             main:formData.main,
             items:dirtyGridData

+ 2 - 1
frontend/saas-web/app/view/core/form/FormPanelModel.js

@@ -4,7 +4,8 @@ Ext.define('saas.view.core.form.FormPanelModel', {
 
     data: {
         id:0,
-        bindFields: [], // 请求绑定字段,绑定到formfield并且未设置ignore为true
+        _bindFields: [], // 主表绑定字段,绑定到formfield并且未设置ignore为true
+        _detailBindeFields: [], // 从表绑定列
         _detailStore: null, // 从表store
     },
 

+ 32 - 8
frontend/saas-web/app/view/core/form/MultiCombo.js

@@ -6,6 +6,7 @@ Ext.define('saas.view.core.form.MultiCombo', {
     alias: 'widget.multicombo',
     editable : false,
     matchFieldWidth: true,
+    value: [],
     cachedConfig: {
         menuAlign: 'tl-bl?',
         destroyMenu: true
@@ -28,9 +29,6 @@ Ext.define('saas.view.core.form.MultiCombo', {
        this.showMenu();
     },
     onMouseLeave:function(a,b,c){
-        console.log(a);
-        console.log(b);
-        console.log(c);
         this.hideMenu(a.parentEvent?a:b);//el光标离开第二个参数为Event对象
     },
     onTriggerClick:function(){
@@ -58,12 +56,16 @@ Ext.define('saas.view.core.form.MultiCombo', {
             item,
             items = me.datas,
             itemsLn = me.datas.length,
-            menuItems = [];
+            menuItems = [],
+            value = me.value;
         for (; i < itemsLn; i++) {
             item = items[i];
+            var checked = !!value.find(function(v) {
+                return v.value = iem[0];
+            });
             menuItem = new Ext.menu.CheckItem({
                 text: item[1],
-                checked: item.checked,
+                checked: checked,
                 checkValue:item[0],
                 hideOnClick: false,
                 checkHandler: this.onCheckChange,
@@ -85,16 +87,39 @@ Ext.define('saas.view.core.form.MultiCombo', {
             }
         });
         this.setValue(checkedItems);
-        this.publishState('value', checkedItems);
     },
 
     setValue: function(items) {
-        var rawV = '';
+        var me = this, rawV = '',
+        datas = me.datas,
+        menu = me.menu;
+        if(!Ext.isArray(items)) {
+            items = [items]
+        }
+        items.map(function(item, index) {
+            if(Ext.isString(item)) {
+                var data = datas.find(function(d) {
+                    return d[0] == item;
+                });
+                items[index] = {
+                    text: data[1],
+                    value: data[0]
+                }
+            }
+        })
         rawV = items.map(function(item) {
             return item.text
         }).join(',');
         this.setRawValue(rawV);
         this.value = items;
+        if(menu) {
+            Ext.Array.each(menu.items.items, function(item) {
+                item.setChecked(!!items.find(function(i) {
+                    return i.value == item.checkValue;
+                }));
+            });
+        }
+        this.publishState('value', items);
     },
 
     showMenu: function (e, menu) {
@@ -121,7 +146,6 @@ Ext.define('saas.view.core.form.MultiCombo', {
         }
     },
     hideMenu: function(b) {
-        console.log(b);
         if (this.hasVisibleMenu()) {
             var target=b.parentEvent.relatedTarget;
             if(!((target.className && target.className.indexOf('x-menu')!=-1) || (target.name && target.name.indexOf(this.name)!=-1))){

+ 21 - 0
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -32,6 +32,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
     initComponent: function() {
         var me = this;
+        me.setSummary();
         Ext.apply(me, {
             dockedItems: [{
                 xtype: 'toolbar',
@@ -81,6 +82,26 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         }
     },
 
+    setSummary: function() {
+        var me = this,
+        columns = me.columns,
+        features = me.features || [];
+
+        var hasSummary = !!columns.find(function(c) {
+            return c.summaryType
+        });
+
+        if(hasSummary) {
+            features.push({
+                ftype: 'summary',
+                dock: 'bottom'
+            });
+        }
+        Ext.apply(me, {
+            features: features
+        });
+    },
+
     add10EmptyRow: function() {
         var me = this,
         form = me.ownerCt,

+ 4 - 9
frontend/saas-web/app/view/core/query/MoreQueryFormPanel.js

@@ -28,7 +28,9 @@ Ext.define('saas.view.core.query.MoreQueryFormPanel', {
                 items: [{
                     xtype: 'button',
                     text: '重置',
-                    handler: me.resetQuery
+                    handler: function(btn){
+                        btn.ownerCt.ownerCt.reset();
+                    }
                 },'->',{
                     xtype: 'button',
                     text: '查询',
@@ -46,18 +48,11 @@ Ext.define('saas.view.core.query.MoreQueryFormPanel', {
         });
         me.callParent(arguments);
     },
-    resetQuery: function(btn){
-        console.log("重置窗口");
-        btn.ownerCt.ownerCt.reset();
-    },
     onQueryMore: function(btn){
-        console.log("更多查询");
         var me = this,
             queryMoreForm = me.up('core-query-queryformpanel'),
             parentForm = queryMoreForm.up('core-query-formpanel')
-            debugger;
-            console.log(parentForm);
-            parentForm.QueryUtil.onQuery(parentForm,queryMoreForm);
+            parentForm.QueryUtil.turnRelativeGrid(grid,queryForm,queryMoreForm);
     }
     
 });

+ 147 - 28
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -5,7 +5,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
     //工具类
     QueryUtil: Ext.create('saas.util.QueryUtil'),
     GridUtil: Ext.create('saas.util.GridUtil'),
-
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     //字段属性
     _baseColumn: [],
     _relativeColumn: [],
@@ -37,7 +37,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                 proxy: {
                     type: 'ajax',
                     url: me._baseVastUrl+'list',
-                    //url: 'http://192.168.253.58:8800/purchase/list',
                     actionMethods: {
                         read: 'GET'
                     },
@@ -56,10 +55,9 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                         if (Ext.isEmpty(condition)) {
                             condition = " 1=1 ";
                         }
-                        if(mode){
+                        if(!mode){
                             mode='MAIN';
                         }
-                        console.log("condition:" + condition);
                         Ext.apply(store.proxy.extraParams, {
                             number: op._page,
                             size: store.pageSize,
@@ -73,18 +71,91 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
+                defaults: { // defaults 将会应用所有的子组件上,而不是父容器
+                    listeners: {
+                        'mouseover':function(){
+                            this.showMenu(); 
+                        },
+                        'mouseout':function(btn,e){
+                            var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
+                            var btnLayout = btn.el.dom.getBoundingClientRect();
+                            if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
+                                btn.hideMenu();
+                            }
+                        }
+                    }
+                },
                 items: ['->', {
                     text: '新增',
                     handler: me.onAddMore
                 }, {
                     text: '审核',
-                    handler: me.onAudit
+                    xtype: 'button',
+                    handler: me.onAudit,
+                    menu: {
+                        items: [{
+                            text:'反审核',
+                            handler:function(){
+                                me.onUnAudit(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
                     text: '打印',
-                    handler: me.onPrint
+                    handler: me.onPrint,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'设置',
+                            handler:function(){
+                                me.onPrintSet(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
-                    text: '导出',
-                    handler: me.onExport
+                    text: '导入',
+                    handler: me.onImport,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'导出',
+                            handler:function(){
+                                me.onExport(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
+                },{
+                    text: '关闭',
+                    handler: me.onCloseOrder,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'启用',
+                            handler:function(){
+                                me.onOpenOrder(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
                     text: '删除',
                     handler: me.onDelete
@@ -102,7 +173,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         });
         me.callParent(arguments);
     },
-
     listeners: {
         itemdblClick: function (tableView, record, item, index, e, eOpts) {
             var grid = tableView.up('grid'),
@@ -122,7 +192,6 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             }
         }
     },
-
     getFields: function() {
         var me = this;
         return me.columns.filter(function(c) {
@@ -131,8 +200,8 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             return c.dataIndex;
         });
     },
-    onAddMore: function (btn) {
-        var grid = btn.ownerCt.ownerCt,
+    onAddMore: function (me) {
+        var grid = me.up('grid'),
             mainTab = Ext.getCmp('main-tab-panel'),
             id = grid.xtype + '_add';
             existingItem = mainTab.down('[id=' + id + ']');
@@ -145,26 +214,76 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             mainTab.setActiveTab(mainTab.add(form));
         }
     },
-    onAudit: function(btn){
-        var grid = btn.ownerCt.ownerCt,
-        vastUrl = grid._baseVastUrl+"batchAudit",
-        selectsd = grid.QueryUtil.getGridSelected(grid),
-        currentPage = grid.getStore().currentPage;
-        grid.QueryUtil.vastRes(vastUrl,selectsd);
-        grid.getStore().loadPage(currentPage);
+    onAudit: function(me){
+        console.log('审核');
+        me.up('grid').vastOperation("batchAudit");
+    },
+    onUnAudit:function(me){
+        console.log('反审核');
+        me.up('grid').vastOperation("batchUnAudit");
     },
-    onPrint: function () {
+    onPrint: function (me) {
         console.log("打印");
     },
-    onExport: function () {
+    onPrintSet:function(me){
+        console.log("打印设置");
+    },
+    onImport:function(me){
+        console.log("导入");
+    },
+    onExport: function (me) {
         console.log("导出");
     },
+    onCloseOrder:function(me){
+        console.log("关闭订单");
+    },onOpenOrder:function(me){
+        console.log("开启订单");
+    },
     onDelete: function (btn) {
-        var grid = btn.ownerCt.ownerCt,
-        vastUrl = grid._baseVastUrl+"batchDelete",
-        selectsd = grid.QueryUtil.getGridSelected(grid),
-        currentPage = grid.getStore().currentPage;;
-        grid.QueryUtil.vastRes(vastUrl,selectsd);
-        grid.getStore().loadPage(currentPage);
-    }
+        btn.up('grid').vastOperation("batchDelete");
+    },
+    vastOperation :function(type){
+        var me = this;
+        var data = me.getGridSelected();
+        if(data&&data.length>0){
+            var params = JSON.stringify({baseDTOs:data});
+            me.BaseUtil.request({
+                    url: me._baseVastUrl+type,
+                    params: params,
+                    method: 'POST',
+                    async:false
+                })
+                .then(function() {
+                    Ext.Msg.alert('提示','操作成功');
+                })
+                .catch(function(response) {
+                    Ext.Msg.alert('提示','操作失败');
+                });
+                me.getStore().loadPage(1);
+        }else{
+            Ext.Msg.alert('提示','请勾选至少一条明细。');
+        }
+    },
+    /**
+     * 获取grid被选数据
+	 * grid:原始字符串
+	 */
+    getGridSelected:function(){
+        var me = this,
+            items = me.selModel.getSelection(),
+            data = new Array() ;
+            Ext.each(items, function(item, index){
+                if(!Ext.isEmpty(item.data[me._idField])&&!Ext.isEmpty(item.data[me._codeField])){
+                    var o = new Object();
+                    if(me._idField){
+                        o['id'] = item.data[me._idField];
+                    }
+                    if(me._codeField){
+                        o['code'] = item.data[me._codeField];
+                    }
+                    data.push(o);
+                }
+            });
+		return data;
+    } 
 });

+ 11 - 1
frontend/saas-web/app/view/main/MainModel.js

@@ -28,7 +28,6 @@ Ext.define('saas.view.main.MainModel', {
                                     {
                                         id: 'purchaseOrder',
                                         text: '采购单(维护界面)',
-                                        //viewType: 'purchase-list-gridpanel',
                                         viewType:'purchase-purchase-formpanel',
                                         leaf: true
                                     },{
@@ -47,6 +46,17 @@ Ext.define('saas.view.main.MainModel', {
                                         viewType:'purchase-purchaseIn-querypanel',
                                         leaf: true
                                     },{
+                                        id: 'purchaseOutOrder',
+                                        text: '采购验退单(维护界面)',
+                                        viewType:'purchase-purchaseOut-formpanel',
+                                        leaf: true
+                                    },{
+                                        id: 'purchaseOutQuery',
+                                        text: '采购验退单查询',
+                                        viewType:'purchase-purchaseOut-querypanel',
+                                        leaf: true
+                                    },
+                                    {
                                         id: 'list1',
                                         text: '列表界面1',
                                         viewType: 'purchase-list-gridpanel1',

+ 62 - 46
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -5,26 +5,28 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     controller: 'purchase-purchase-formcontroller',
     viewModel: 'purchase-purchase-formmodel',
     
-    _title:'采购单',
-    _codeField: 'pu_ode',
-    _statusField: 'pu_status',
-    _statusCodeField: 'pu_statuscode',
-    _idField: 'id',
-    _detnoColumn:  'pd_detno',
-    _dataModelUrl:'http://192.168.253.58:8800/purchase/read/',
-    _saveUrl:'http://192.168.253.58:8800/purchase/save',
-    _auditUrl:'http://192.168.253.58:8800/purchase/audit',
-    _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
-    _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
-    initId:0,
-
-    toolBtns: [{
-        xtype: 'button',
-        text: '转单按钮',
-        handler: function() {
-            console.log('11');
-        }
-    }],
+     //字段属性
+     _title:'采购单',
+     _idField: 'id',
+     _codeField: 'pu_code',
+     _statusField: 'pu_status',
+     _statusCodeField: 'pu_statuscode',
+     _detnoColumn:  'pd_detno',
+     _relationColumn: 'pd_puid',
+     _readUrl:'http://192.168.253.58:8800/purchase/read/',
+     _saveUrl:'http://192.168.253.58:8800/purchase/save',
+     _auditUrl:'http://192.168.253.58:8800/purchase/audit',
+     _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
+     _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
+     initId:0,
+ 
+     toolBtns: [{
+         xtype: 'button',
+         text: '转单按钮',
+         handler: function() {
+             console.log('11');
+         }
+     }],
 
     defaultItems: [{
         xtype: 'hidden',
@@ -108,23 +110,29 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
-        bind: {
-            store:{
-                data:'{detailGridField}'
-            }
-        },
         columns : [
             {
                 text : "序号", 
-                dataIndex : "pdDetno", 
-                width : 80.0, 
-                xtype : "rownumberer"
+                dataIndex : "pd_detno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
             }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"
             },
             {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "pd_prodcode", 
+                xtype : "", 
+                items : null,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -137,39 +145,47 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     store : null, 
                     valueField : "value", 
                     xtype : "dbfindtrigger"
-                }, 
-                text : "物料编号", 
-                width : 200.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null
+                }
             },
             {
-                text : "单位", 
-                editor : {
-                    xtype : "textfield"
-                }, 
-                dataIndex : "pd_unit", 
-                width : 120.0, 
-                xtype : "", 
-                items : null
-            }, 
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
+            },
             {
                 text : "数量", 
                 dataIndex : "pd_yqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 width : 120.0, 
                 xtype : "numbercolumn", 
-                items : null
+                format:'0',
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "单价", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                format:'0,000.00',
                 dataIndex : "pd_price", 
                 width : 120.0, 
-                xtype : "numbercolumn", 
-                items : null
+                xtype : "numbercolumn",
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "税率", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 dataIndex : "pd_taxrate", 
                 width : 120.0, 
                 xtype : "numbercolumn", 

+ 49 - 86
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -2,11 +2,12 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
     extend: 'saas.view.core.query.QueryPanel',
     xtype: 'purchase-purchase-querypanel',
 
+    controller: 'purchase-purchase-querypanel',
     viewModel: 'purchase-purchase-querypanel',
     viewName: 'purchase-purchase-formpanel',
-    _baseVastUrl:'http://192.168.253.58:8800/purchase/',
-    _idField:'pu_id',
-    _codeField:'pu_code',
+    _baseVastUrl: 'http://192.168.253.58:8800/purchase/',
+    _idField: 'pu_id',
+    _codeField: 'pu_code',
     queryFormItems: [{
         xtype: 'hidden',
         name: 'pu_id',
@@ -15,48 +16,12 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         allowBlank: true,
         columnWidth: 0
     }, {
-        xtype: 'dbfindtrigger',
+        xtype: 'textfield',
         name: 'pu_code',
         bind: '{pu_code}',
         fieldLabel: '单据编号',
         allowBlank: true,
-        columnWidth: 0.25,
-        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
-        dbfinds:[{
-            from:'ve_code',to:'pu_code'
-        }],
-        dbColumns:[{
-            conditionCode:'ve_id',
-            "text": "供应商ID",
-            "flex": 0,
-            "dataIndex": "ve_id",
-            "width": 0,
-            "xtype": "",
-            "items": null
-        },{
-            conditionCode:'ve_code',
-            "text": "供应商编号",
-            "flex": 1,
-            "dataIndex": "ve_code",
-            "width": 100,
-            "xtype": "",
-            "items": null
-        }, {
-            conditionCode:'ve_name',
-            "text": "供应商名称",
-            "flex": 1,
-            "dataIndex": "ve_name",
-            "xtype": "",
-            "items": null
-        }, {
-            conditionCode:'ve_type',
-            "text": "供应商类型",
-            "flex": 0,
-            "dataIndex": "ve_type",
-            "width": 200,
-            "xtype": "",
-            "items": null
-        }]
+        columnWidth: 0.25
     }, {
         xtype: 'condatefield',
         name: 'pu_date',
@@ -70,9 +35,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         bind: '{pu_vendcode}',
         fieldLabel: '供应商编号',
         allowBlank: true,
-        columnWidth: 0.25,
-        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
-        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+        columnWidth: 0.25
     }, {
         xtype: 'textfield',
         name: 'pu_vendname',
@@ -83,14 +46,13 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
     }, {
         xtype: 'dbfindtrigger',
         name: 'pd_prodcode#pd_prodcode',
+        //#pr_detail
         bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
         fieldMode: 'DETAIL',
-        queryType:'VAG',
+        queryType: 'VAG',
         allowBlank: true,
-        columnWidth: 0.25,
-        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
-        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+        columnWidth: 0.25
     }, {
         xtype: 'textfield',
         name: 'pr_detail',
@@ -100,34 +62,35 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         columnWidth: 0.25
     }, {
         xtype: 'combobox',
-        name: 'pr_statuscode',
-       // bind: '{pr_statuscode}',
+        name: 'pu_statuscode',
+       // bind: '{pu_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
         columnWidth: 0.25,
         queryMode: 'local',
-            displayField: 'pr_status',
-            valueField: 'pr_statuscode',
-            store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['pr_statuscode', 'pr_status'],
-            data: [
-                ["$ALL", "全部"],
-                ["AUDITED", "已审核"],
-                ["UNAUDITED", "未审核"]
-            ]
+        displayField: 'pu_status',
+        valueField: 'pu_statuscode',
+        editable:false,
+        store: Ext.create('Ext.data.ArrayStore', {
+        fields: ['pu_statuscode', 'pu_status'],
+        data: [
+            ["$ALL", "全部"],
+            ["AUDITED", "已审核"],
+            ["UNAUDITED", "未审核"]
+        ]
         })
     }, {
         xtype: 'multicombo',
         name: 'pu_acceptstatuscode',
-       // bind: '{pu_acceptstatuscode}',
+        bind: '{pu_acceptstatuscode}',
         fieldLabel: '入库状态',
         allowBlank: true,
         columnWidth: 0.25,
         datas: [
-                ["TURNOUT", "已入库"],
-                ["NOOUT", "未入库"],
-                ["PARTOUT", "部分入库"]
-            ]
+            ["TURNIN", "已入库"],
+            ["UNTURNIN", "未入库"],
+            ["PARTIN", "部分入库"]
+        ]
     }],
     moreQueryFormItems: [{
         xtype: 'textfield',
@@ -150,11 +113,11 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         columnWidth: 1
     }],
     queryGridConfig: {
-        _idField:'pu_id',
-        _codeField:'pu_code',
-        _title:'采购单',
-        _addXtype:'test-order-formpanel',
-        _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+        _idField: 'pu_id',
+        _codeField: 'pu_code',
+        _title: '采购单',
+        _addXtype: 'purchase-purchase-formpanel',
+        _baseVastUrl: 'http://192.168.253.58:8800/purchase/',
         _baseColumn: [{
             text: '序号',
             width: 80,
@@ -175,21 +138,21 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         }, {
             text: '下单日期',
             dataIndex: 'pu_indate',
-            xtype:'datecolumn',
+            xtype: 'datecolumn',
             width: 200
-        },{
+        }, {
             text: '供应商名称',
             dataIndex: 'pu_vendname',
             width: 120
-        },{
+        }, {
             text: '含税金额',
             dataIndex: 'pu_taxtotal',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120
-        },{
+        }, {
             text: '金额',
             dataIndex: 'pu_total',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120,
             flex: 1
         }],
@@ -213,35 +176,35 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         }, {
             text: '下单日期',
             dataIndex: 'pu_indate',
-            xtype:'datecolumn',
+            xtype: 'datecolumn',
             width: 200
-        },{
+        }, {
             text: '供应商名称',
             dataIndex: 'pu_vendname',
             width: 120
-        },{
+        }, {
             text: '采购序号',
             dataIndex: 'pd_detno',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120
-        },{
+        }, {
             text: '物料编号',
             dataIndex: 'pd_prodcode',
             width: 120
-        },{
+        }, {
             text: '数量',
             dataIndex: 'pd_qty',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120
-        },{
+        }, {
             text: '单价',
             dataIndex: 'pd_price',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120
-        },{
+        }, {
             text: '已转数',
             dataIndex: 'pd_ytqy',
-            xtype:'numbercolumn',
+            xtype: 'numbercolumn',
             width: 120,
             flex: 1
         }]

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

@@ -1,5 +1,115 @@
 Ext.define('saas.view.purchase.purchase.QueryPanelController', {
     extend: 'saas.view.core.query.QueryPanelController',
     alias: 'controller.purchase-purchase-querypanel',
+    init: function (form) {
+        var me = this;
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
 
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode',
+                            from:'pr_detail',to:'pr_detail'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
 });

+ 1 - 5
frontend/saas-web/app/view/purchase/purchase/QueryPanelModel.js

@@ -1,9 +1,5 @@
 Ext.define('saas.view.purchase.purchase.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.purchase-purchase-querypanel',
+    alias: 'viewmodel.purchase-purchase-querypanel'
 
-    data: {
-       // pu_total: '3333',
-        //pu_code: '4'
-    }
 });

+ 11 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormController.js

@@ -68,12 +68,15 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
                         conditionCode:'pr_code',
                         dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
                         dbfinds:[{
-                            from:'pr_code',to:'pd_prodcode'
+                            from:'pr_code',to:'pd_prodcode',
+                            from:'pr_unit',to:'pd_unit'
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100
                         },{
                             field:'pr_detail',width:100
+                        },{
+                            field:'pr_unit',width:100
                         }],
                         dbColumns:[{
                             "text": "物料ID",
@@ -102,6 +105,13 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
                             "width": 200,
                             "xtype": "",
                             "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
                         }]
                     }) ;   
 

+ 61 - 89
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -6,17 +6,19 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     viewModel: 'purchase-purchaseIn-formmodel',
     
     _title:'采购验收单',
+    _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pu_status',
     _statusCodeField: 'pu_statuscode',
-    _idField: 'id',
     _detnoColumn:  'pd_pdno',
-    _dataModelUrl:'http://192.168.253.58:8800/purchase/read/',
-    _saveUrl:'http://192.168.253.58:8800/purchase/save',
-    _auditUrl:'http://192.168.253.58:8800/purchase/audit',
-    _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
-    _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
-    initId:0,
+    _relationColumn: 'pd_piid',
+    _readUrl:'http://192.168.253.228:8800/prodinout/read/',
+    _saveUrl:'http://192.168.253.228:8800/prodinout/save',
+    _auditUrl:'http://192.168.253.228:8800/prodinout/audit',
+    _deleteUrl:'http://192.168.253.228:8800/prodinout/delete/',
+    _deleteDetailUrl:'http://192.168.253.228:8800/prodinout/deleteItem/',
+   _baseVastUrl:'http://192.168.253.228:8800/prodinout/',
+    initId:11,
 
     toolBtns: [{
         xtype: 'button',
@@ -44,95 +46,80 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "textfield", 
         name : "pi_class", 
         bind : "{pi_class}", 
-        fieldLabel : "类型", 
+        fieldLabel : "单据类型", 
         readOnly:true,
         allowBlank : true, 
         columnWidth : 0.25
     }, {
         xtype : "hidden", 
-        name : "pu_vendid", 
-        bind : "{pu_vendid}", 
+        name : "pi_vendid", 
+        bind : "{pi_vendid}", 
         fieldLabel : "供应商ID", 
         allowBlank : true, 
         columnWidth : 0.0
     }, {
         xtype : "textfield", 
-        name : "pu_vendcode", 
-        bind : "{pu_vendcode}", 
+        name : "pi_vendcode", 
+        bind : "{pi_vendcode}", 
         fieldLabel : "供应商编号", 
         hidden:true,
         allowBlank : true, 
         columnWidth : 0, 
     }, {
         xtype : "dbfindtrigger", 
-        name : "pu_vendname", 
-        bind : "{pu_vendname}", 
+        name : "pi_vendname", 
+        bind : "{pi_vendname}", 
         fieldLabel : "供应商名称", 
         allowBlank : true, 
         columnWidth : 0.25
     },{
         xtype : "datefield", 
-        name : "pu_date", 
-        bind : "{pu_date}", 
-        fieldLabel : "采购日期", 
+        name : "pi_date", 
+        bind : "{pi_date}", 
+        fieldLabel : "单据日期", 
         allowBlank : false, 
         columnWidth : 0.25
-    }, {
-        xtype : "hidden", 
-        name : "pu_buyerid", 
-        bind : "{pu_buyerid}", 
-        fieldLabel : "采购员ID", 
-        allowBlank : true, 
-        columnWidth : 0.0
-    }, {
-        xtype : "textfield", 
-        name : "pu_buyercode", 
-        bind : "{pu_buyercode}", 
-        fieldLabel : "采购员编号", 
-        allowBlank : true, 
-        hidden:true,
-        columnWidth : 0
-    }, {
-        xtype : "dbfindtrigger", 
-        name : "pu_buyername", 
-        bind : "{pu_buyername}", 
-        fieldLabel : "采购员名称", 
-        allowBlank : true, 
-        columnWidth : 0.25
-    }, {
+    },{
         xtype : "textfield", 
-        name : "pu_shipaddresscode", 
-        bind : "{pu_shipaddresscode}", 
-        fieldLabel : "交货地址", 
-        allowBlank : true, 
+        name : "pi_total", 
+        bind : "{pi_total}", 
+        fieldLabel : "总额", 
+        allowBlank : true,
+        readOnly: true,
         columnWidth : 0.25
     }, {
         xtype : "textfield", 
-        name : "pu_total", 
-        bind : "{pu_total}", 
-        fieldLabel : "单据金额", 
+        name : "pi_pucode", 
+        bind : "{pi_pucode}", 
+        fieldLabel : "采购单号", 
         allowBlank : true, 
         columnWidth : 0.25
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
-        bind: {
-            store:{
-                data:'{detailGridField}'
-            }
-        },
         columns : [
             {
                 text : "序号", 
                 dataIndex : "pd_pdno", 
-                width : 80.0, 
-                xtype : "rownumberer"
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
             }, {
                 text : "id", 
                 dataIndex : "id", 
                 xtype : "numbercolumn"
             },
             {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "pd_prodcode", 
+                xtype : "", 
+                items : null,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -145,35 +132,34 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                     store : null, 
                     valueField : "value", 
                     xtype : "dbfindtrigger"
-                }, 
-                text : "物料编号", 
-                width : 200.0, 
-                dataIndex : "pd_prodcode", 
-                xtype : "", 
-                items : null
+                }
             },
             {
-                text : "单位", 
-                editor : {
-                    xtype : "textfield"
-                }, 
-                dataIndex : "pd_unit", 
-                width : 120.0, 
-                xtype : "", 
-                items : null
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
             }, 
             {
                 text : "数量", 
                 dataIndex : "pd_inqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
                 width : 120.0, 
                 xtype : "numbercolumn", 
-                items : null
+                format:'0',
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "仓库", 
                 dataIndex : "pd_whname", 
                 width : 120.0, 
-                xtype : "numbercolumn", 
                 items : null,
                 editor : {
                     displayField : "display", 
@@ -216,21 +202,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
             {
                 text : "采购单号", 
                 dataIndex : "pd_ordercode", 
-                width : 120.0,
-                flex : 1.0,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "dbfindtrigger"
-                }
+                width : 120.0
             },{
                 text : "采购序号", 
                 dataIndex : "pd_orderdetno", 
@@ -257,8 +229,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "textfield", 
         readOnly : true, 
         editable : false, 
-        name : "pu_status", 
-        bind : "{pu_status}", 
+        name : "pi_status", 
+        bind : "{pi_status}", 
         fieldLabel : "单据状态", 
         allowBlank : true, 
         columnWidth : 0.25
@@ -266,8 +238,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         xtype : "hidden", 
         readOnly : true, 
         editable : false, 
-        name : "pu_statuscode", 
-        bind : "{pu_statuscode}", 
+        name : "pi_statuscode", 
+        bind : "{pi_statuscode}", 
         fieldLabel : "单据状态码", 
         allowBlank : true, 
         columnWidth : 0.0

+ 69 - 106
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -15,126 +15,69 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         allowBlank: true,
         columnWidth: 0
     }, {
-        xtype: 'dbfindtrigger',
+        xtype: 'textfield',
         name: 'pi_inoutno',
         bind: '{pi_inoutno}',
         fieldLabel: '单据编号',
         allowBlank: true,
-        columnWidth: 0.25,
-        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
-        dbfinds:[{
-            from:'ve_code',to:'pu_code'
-        }],
-        dbColumns:[{
-            conditionCode:'ve_id',
-            "text": "供应商ID",
-            "flex": 0,
-            "dataIndex": "ve_id",
-            "width": 0,
-            "xtype": "",
-            "items": null
-        },{
-            conditionCode:'ve_code',
-            "text": "供应商编号",
-            "flex": 1,
-            "dataIndex": "ve_code",
-            "width": 100,
-            "xtype": "",
-            "items": null
-        }, {
-            conditionCode:'ve_name',
-            "text": "供应商名称",
-            "flex": 1,
-            "dataIndex": "ve_name",
-            "xtype": "",
-            "items": null
-        }, {
-            conditionCode:'ve_type',
-            "text": "供应商类型",
-            "flex": 0,
-            "dataIndex": "ve_type",
-            "width": 200,
-            "xtype": "",
-            "items": null
-        }]
+        columnWidth: 0.25
     }, {
         xtype: 'condatefield',
-        name: 'pu_date',
-        bind: '{pu_date}',
-        fieldLabel: '采购日期',
+        name: 'pi_date',
+        bind: '{pi_date}',
+        fieldLabel: '单据日期',
         allowBlank: true,
         columnWidth: 0.5
     }, {
-        xtype: 'dbfindtrigger',
-        name: 'pu_vendcode',
-        bind: '{pu_vendcode}',
+        xtype: 'textfield',
+        name: 'pi_vendcode',
+        bind: '{pi_vendcode}',
         fieldLabel: '供应商编号',
         allowBlank: true,
-        columnWidth: 0.25,
-        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
-        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+        hidden:true,
+        columnWidth: 0.25
     }, {
         xtype: 'textfield',
-        name: 'pu_vendname',
-        bind: '{pu_vendname}',
+        name: 'pi_vendname',
+        bind: '{pi_vendname}',
         fieldLabel: '供应商名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
         xtype: 'dbfindtrigger',
-        name: 'pd_prodcode#pd_prodcode',
+        name: 'pd_prodcode',
         bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
         fieldMode: 'DETAIL',
         queryType:'VAG',
+        hidden:true,
         allowBlank: true,
-        columnWidth: 0.25,
-        configUrl: 'resources/json/purchase/vendorColumnsDbfind.json',
-        dataUrl: 'resources/json/purchase/vendorDataDbfind.json'
+        columnWidth: 0.25
     }, {
-        xtype: 'textfield',
-        name: 'pr_detail',
+        xtype: 'dbfindtrigger',
+        name: 'pr_detail#pd_prodcode',
         bind: '{pr_detail}',
         fieldLabel: '物料名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
         xtype: 'combobox',
-        name: 'pr_statuscode',
-       // bind: '{pr_statuscode}',
+        name: 'pi_statuscode',
+        bind: '{pi_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
         columnWidth: 0.25,
         queryMode: 'local',
-            displayField: 'pr_status',
-            valueField: 'pr_statuscode',
+        displayField: 'pi_status',
+        valueField: 'pi_statuscode',
         store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['pr_statuscode', 'pr_status'],
+            fields: ['pi_statuscode', 'pi_status'],
             data: [
                 ["$ALL", "全部"],
                 ["AUDITED", "已审核"],
                 ["UNAUDITED", "未审核"]
             ]
         })
-    }, {
-        xtype: 'combobox',
-        name: 'pu_acceptstatuscode',
-        bind: '{pu_acceptstatuscode}',
-        fieldLabel: '入库状态',
-        allowBlank: true,
-        columnWidth: 0.25,
-        queryMode: 'local',
-        displayField: 'pu_acceptstatus',
-        valueField: 'pu_acceptstatuscode',
-        store: Ext.create('Ext.data.ArrayStore', {
-            fields: ['pu_acceptstatuscode', 'pu_acceptstatus'],
-            data: [
-                ["$ALL", "全部"],
-                ["TURNOUT", "已入库"],
-                ["NOOUT", "未入库"],
-                ["PARTOUT", "部分入库"]
-            ]
-        })
     }],
     moreQueryFormItems: [{
         xtype: 'textfield',
@@ -157,10 +100,10 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         columnWidth: 1
     }],
     queryGridConfig: {
-        _idField:'pu_id',
-        _codeField:'pu_code',
-        _title:'采购单',
-        _addXtype:'test-order-formpanel',
+        _idField:'pi_id',
+        _codeField:'pi_inoutno',
+        _title:'采购验收单',
+        _addXtype:'purchase-purchaseIn-formpanel',
         _baseVastUrl:'http://192.168.253.58:8800/purchase/',
         _baseColumn: [{
             text: '序号',
@@ -168,67 +111,77 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             xtype: 'rownumberer'
         }, {
             text: 'id',
-            dataIndex: 'pu_id',
+            dataIndex: 'pi_id',
             width: 100,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
-            dataIndex: 'pu_code',
+            dataIndex: 'pi_inoutno',
             width: 120
         }, {
             text: '单据状态',
-            dataIndex: 'pu_status',
+            dataIndex: 'pi_status',
             width: 120
         }, {
             text: '下单日期',
-            dataIndex: 'pu_indate',
+            dataIndex: 'pi_date',
             xtype:'datecolumn',
             width: 200
+        },{
+            text: '采购单号',
+            dataIndex: 'pi_pucode',
+            width: 200
         },{
             text: '供应商名称',
-            dataIndex: 'pu_vendname',
+            dataIndex: 'pi_vendname',
             width: 120
         },{
             text: '含税金额',
-            dataIndex: 'pu_taxtotal',
+            dataIndex: 'pi_total',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '金额',
-            dataIndex: 'pu_total',
+            text: '不含税金额',
+            dataIndex: 'pi_nettotal',
             xtype:'numbercolumn',
             width: 120,
             flex: 1
         }],
         _relativeColumn: [{
-            text: '序号',
-            width: 80,
-            xtype: 'rownumberer'
+            text : "序号", 
+            dataIndex : "pd_pdno", 
+            width : 100, 
+            xtype : "numbercolumn",
+            align : 'center'
         }, {
             text: 'id',
             dataIndex: 'pu_id',
-            width: 100,
+            width: 0,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
-            dataIndex: 'pu_code',
+            dataIndex: 'pd_inoutno',
             width: 120
         }, {
             text: '单据状态',
-            dataIndex: 'pu_status',
+            dataIndex: 'pi_status',
             width: 120
         }, {
             text: '下单日期',
-            dataIndex: 'pu_indate',
+            dataIndex: 'pi_date',
             xtype:'datecolumn',
             width: 200
         },{
             text: '供应商名称',
-            dataIndex: 'pu_vendname',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '采购单号',
+            dataIndex: 'pd_ordercode',
             width: 120
         },{
             text: '采购序号',
-            dataIndex: 'pd_detno',
+            dataIndex: 'pd_orderdetno',
             xtype:'numbercolumn',
             width: 120
         },{
@@ -236,18 +189,28 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             dataIndex: 'pd_prodcode',
             width: 120
         },{
-            text: '数量',
-            dataIndex: 'pd_qty',
+            text: '验收数量',
+            dataIndex: 'pd_inqty',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '单价',
-            dataIndex: 'pd_price',
+            text: '采购单价',
+            dataIndex: 'pd_orderprice',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '已转数',
-            dataIndex: 'pd_ytqy',
+            text: '金额',
+            dataIndex: 'pd_total',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '税率',
+            dataIndex: 'pd_taxrate',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '成本单价',
+            dataIndex: 'pd_price',
             xtype:'numbercolumn',
             width: 120,
             flex: 1

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

@@ -1,5 +1,115 @@
 Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
     extend: 'saas.view.core.query.QueryPanelController',
     alias: 'controller.purchase-purchaseIn-queryformcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
 
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode',
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
 });

+ 1 - 5
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelModel.js

@@ -1,9 +1,5 @@
 Ext.define('saas.view.purchase.purchaseIn.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.purchase-purchaseIn-queryformmodel',
+    alias: 'viewmodel.purchase-purchaseIn-queryformmodel'
 
-    data: {
-       // pu_total: '3333',
-        //pu_code: '4'
-    }
 });

+ 147 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormController.js

@@ -0,0 +1,147 @@
+Ext.define('saas.view.purchase.purchaseOut.FormController', {
+    extend: 'saas.view.core.form.FormPanelController',
+    alias: 'controller.purchase-purchaseOut-formcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            /**放大镜新增demo*/
+            "field[name=combo]":{
+                beforerender:function(f){
+                    f.addHandler=me.addCombo;
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode',
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        },{
+                            field:'pr_unit',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    },
+    addCombo:function(){
+        var combo=this.ownerCmp;
+        Ext.create('Ext.window.Window',{
+            layout:'vbox',
+            bodyPadding: 15,
+            width:500,
+            items:[{
+                fieldLabel:'实际值',
+                xtype:'textfield'
+            },{
+                fieldLabel:'显示值',
+                xtype:'textfield'
+            }],
+            buttons:[{
+                text:'确认',
+                handler:function(b){
+                    combo.setValue('ok');
+                    b.up('window').close();
+                }
+            }],
+            renderTo:this.ownerCmp.ownerCt.getEl()
+        }).show();
+
+    }
+});

+ 7 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormModel.js

@@ -0,0 +1,7 @@
+Ext.define('saas.view.purchase.purchaseOut.FormModel', {
+    extend: 'saas.view.core.form.FormPanelModel',
+    alias: 'viewmodel.purchase-purchaseOut-formmodel',
+    data: {
+        pi_class: '采购验退单'
+     }
+});

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

@@ -0,0 +1,246 @@
+Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
+    extend: 'saas.view.core.form.FormPanel',
+    xtype: 'purchase-purchaseOut-formpanel',
+
+    controller: 'purchase-purchaseOut-formcontroller',
+    viewModel: 'purchase-purchaseOut-formmodel',
+    
+    _title:'采购验退单',
+    _idField: 'id',
+    _codeField: 'pi_inoutno',
+    _statusField: 'pu_status',
+    _statusCodeField: 'pu_statuscode',
+    _detnoColumn:  'pd_pdno',
+    _relationColumn: 'pd_piid',
+    _readUrl:'http://192.168.253.58:8800/purchase/read/',
+    _saveUrl:'http://192.168.253.58:8800/purchase/save',
+    _auditUrl:'http://192.168.253.58:8800/purchase/audit',
+    _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
+    _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
+    initId:11,
+
+    toolBtns: [{
+        xtype: 'button',
+        text: '转单按钮',
+        handler: function() {
+            console.log('11');
+        }
+    }],
+
+    defaultItems: [{
+        xtype: 'hidden',
+        name: 'id',
+        bind: '{id}',
+        fieldLabel: 'id',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype : "textfield", 
+        name : "pi_inoutno", 
+        bind : "{pi_inoutno}", 
+        fieldLabel : "验退单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_class", 
+        bind : "{pi_class}", 
+        fieldLabel : "单据类型", 
+        readOnly:true,
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        name : "pi_vendid", 
+        bind : "{pi_vendid}", 
+        fieldLabel : "供应商ID", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }, {
+        xtype : "textfield", 
+        name : "pi_vendcode", 
+        bind : "{pi_vendcode}", 
+        fieldLabel : "供应商编号", 
+        hidden:true,
+        allowBlank : true, 
+        columnWidth : 0, 
+    }, {
+        xtype : "dbfindtrigger", 
+        name : "pi_vendname", 
+        bind : "{pi_vendname}", 
+        fieldLabel : "供应商名称", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "datefield", 
+        name : "pi_date", 
+        bind : "{pi_date}", 
+        fieldLabel : "单据日期", 
+        allowBlank : false, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_total", 
+        bind : "{pi_total}", 
+        fieldLabel : "总额", 
+        allowBlank : true,
+        readOnly: true,
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        name : "pi_pucode", 
+        bind : "{pi_pucode}", 
+        fieldLabel : "采购单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        name : "detailGridField", 
+        xtype : "detailGridField", 
+        columns : [
+            {
+                text : "序号", 
+                dataIndex : "pd_pdno", 
+                width : 100, 
+                xtype : "numbercolumn",
+                align : 'center',
+                format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
+            }, {
+                text : "id", 
+                dataIndex : "id", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "物料编号", 
+                width : 200.0, 
+                dataIndex : "pd_prodcode", 
+                xtype : "", 
+                items : null,
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "dbfindtrigger"
+                }
+            },
+            {
+                text : "名称", 
+                dataIndex : "pr_detail",
+                ignore:true
+            },
+            {
+                text : "规格", 
+                dataIndex : "pr_spec",
+                ignore:true
+            }, 
+            {
+                text : "验退数量", 
+                dataIndex : "pd_outqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            }, 
+            {
+                text : "仓库", 
+                dataIndex : "pd_whname", 
+                width : 120.0, 
+                items : null,
+                editor : {
+                    displayField : "display", 
+                    editable : true, 
+                    format : "", 
+                    hideTrigger : false, 
+                    maxLength : 100.0, 
+                    minValue : null, 
+                    positiveNum : false, 
+                    queryMode : "local", 
+                    store : null, 
+                    valueField : "value", 
+                    xtype : "dbfindtrigger"
+                }
+            },
+            {
+                text : "单价", 
+                dataIndex : "pd_orderprice", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            }, 
+           {
+                text : "含税金额", 
+                dataIndex : "pd_total", 
+                width : 120.0, 
+                xtype : "numbercolumn"
+            }, {
+                text : "税率", 
+                dataIndex : "pd_taxrate", 
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                items : null
+            },
+            {
+                text : "未税金额", 
+                dataIndex : "pd_nettotal", 
+                xtype : "numbercolumn"
+            },
+            {
+                text : "采购单号", 
+                dataIndex : "pd_ordercode", 
+                width : 120.0
+            },{
+                text : "采购序号", 
+                dataIndex : "pd_orderdetno", 
+                xtype : "numbercolumn",
+                flex:1
+            }
+        ]
+    }, {
+        format : "Y-m-d", 
+        xtype : "datefield", 
+        name : "createTime", 
+        bind : "{createTime}", 
+        fieldLabel : "创建时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "datefield", 
+        name : "updateTime", 
+        bind : "{updateTime}", 
+        fieldLabel : "更新时间", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "textfield", 
+        readOnly : true, 
+        editable : false, 
+        name : "pi_status", 
+        bind : "{pi_status}", 
+        fieldLabel : "单据状态", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    }, {
+        xtype : "hidden", 
+        readOnly : true, 
+        editable : false, 
+        name : "pi_statuscode", 
+        bind : "{pi_statuscode}", 
+        fieldLabel : "单据状态码", 
+        allowBlank : true, 
+        columnWidth : 0.0
+    }]
+});

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

@@ -0,0 +1,219 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
+    extend: 'saas.view.core.query.QueryPanel',
+    xtype: 'purchase-purchaseOut-querypanel',
+
+    controller: 'purchase-purchaseOut-queryformcontroller',
+    viewModel: 'purchase-purchaseOut-queryformmodel',
+    _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+    _idField:'pi_id',
+    _codeField:'pi_inoutno',
+    queryFormItems: [{
+        xtype: 'hidden',
+        name: 'pi_id',
+        bind: '{pi_id}',
+        fieldLabel: 'ID',
+        allowBlank: true,
+        columnWidth: 0
+    }, {
+        xtype: 'textfield',
+        name: 'pi_inoutno',
+        bind: '{pi_inoutno}',
+        fieldLabel: '单据编号',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'condatefield',
+        name: 'pi_date',
+        bind: '{pi_date}',
+        fieldLabel: '单据日期',
+        allowBlank: true,
+        columnWidth: 0.5
+    }, {
+        xtype: 'textfield',
+        name: 'pi_vendcode',
+        bind: '{pi_vendcode}',
+        fieldLabel: '供应商编号',
+        allowBlank: true,
+        hidden:true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'textfield',
+        name: 'pi_vendname',
+        bind: '{pi_vendname}',
+        fieldLabel: '供应商名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pd_prodcode',
+        bind: '{pd_prodcode}',
+        fieldLabel: '物料编号',
+        fieldMode: 'DETAIL',
+        queryType:'VAG',
+        hidden:true,
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'pr_detail#pd_prodcode',
+        bind: '{pr_detail}',
+        fieldLabel: '物料名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'combobox',
+        name: 'pi_statuscode',
+        bind: '{pi_statuscode}',
+        fieldLabel: '审核状态',
+        allowBlank: true,
+        columnWidth: 0.25,
+        queryMode: 'local',
+        displayField: 'pi_status',
+        valueField: 'pi_statuscode',
+        store: Ext.create('Ext.data.ArrayStore', {
+            fields: ['pi_statuscode', 'pi_status'],
+            data: [
+                ["$ALL", "全部"],
+                ["AUDITED", "已审核"],
+                ["UNAUDITED", "未审核"]
+            ]
+        })
+    }],
+    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:'pi_id',
+        _codeField:'pi_inoutno',
+        _title:'采购验退单',
+        _addXtype:'purchase-purchaseOut-formpanel',
+        _baseVastUrl:'http://192.168.253.58:8800/purchase/',
+        _baseColumn: [{
+            text: '序号',
+            width: 80,
+            xtype: 'rownumberer'
+        }, {
+            text: 'id',
+            dataIndex: 'pi_id',
+            width: 100,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pi_inoutno',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pi_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pi_date',
+            xtype:'datecolumn',
+            width: 200
+        },{
+            text: '采购单号',
+            dataIndex: 'pi_pucode',
+            width: 200
+        },{
+            text: '供应商名称',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '含税金额',
+            dataIndex: 'pi_total',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '不含税金额',
+            dataIndex: 'pi_nettotal',
+            xtype:'numbercolumn',
+            width: 120,
+            flex: 1
+        }],
+        _relativeColumn: [{
+            text : "序号", 
+            dataIndex : "pd_pdno", 
+            width : 100, 
+            xtype : "numbercolumn",
+            align : 'center'
+        }, {
+            text: 'id',
+            dataIndex: 'pu_id',
+            width: 0,
+            xtype: 'numbercolumn'
+        }, {
+            text: '单据编号',
+            dataIndex: 'pd_inoutno',
+            width: 120
+        }, {
+            text: '单据状态',
+            dataIndex: 'pi_status',
+            width: 120
+        }, {
+            text: '下单日期',
+            dataIndex: 'pi_date',
+            xtype:'datecolumn',
+            width: 200
+        },{
+            text: '供应商名称',
+            dataIndex: 'pi_vendname',
+            width: 120
+        },{
+            text: '采购单号',
+            dataIndex: 'pd_ordercode',
+            width: 120
+        },{
+            text: '采购序号',
+            dataIndex: 'pd_orderdetno',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '物料编号',
+            dataIndex: 'pd_prodcode',
+            width: 120
+        },{
+            text: '验退数量',
+            dataIndex: 'pd_outqty',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '采购单价',
+            dataIndex: 'pd_orderprice',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '金额',
+            dataIndex: 'pd_total',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '税率',
+            dataIndex: 'pd_taxrate',
+            xtype:'numbercolumn',
+            width: 120
+        },{
+            text: '成本单价',
+            dataIndex: 'pd_price',
+            xtype:'numbercolumn',
+            width: 120,
+            flex: 1
+        }]
+    }
+});

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

@@ -0,0 +1,115 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
+    extend: 'saas.view.core.query.QueryPanelController',
+    alias: 'controller.purchase-purchaseOut-queryformcontroller',
+    init: function (form) {
+        var me = this;
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pu_vendname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/vendor/getVendorsByCondition',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        dbColumns:[{
+                            conditionCode:'ve_id',
+                            "text": "供应商ID",
+                            "flex": 0,
+                            "dataIndex": "ve_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            conditionCode:'ve_code',
+                            "text": "供应商编号",
+                            "flex": 1,
+                            "dataIndex": "ve_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_name',
+                            "text": "供应商名称",
+                            "flex": 1,
+                            "dataIndex": "ve_name",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            conditionCode:'ve_type',
+                            "text": "供应商类型",
+                            "flex": 0,
+                            "dataIndex": "ve_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'pr_code',
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode',
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料单位",
+                            "flex": 0,
+                            "dataIndex": "pr_unit",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+
+    }
+});

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

@@ -0,0 +1,4 @@
+Ext.define('saas.view.purchase.purchaseOut.QueryPanelModel', {
+    extend: 'saas.view.core.query.QueryPanelModel',
+    alias: 'viewmodel.purchase-purchaseOut-queryformmodel'
+});

+ 6 - 3
frontend/saas-web/app/view/test/order/FormPanel.js

@@ -128,11 +128,14 @@ Ext.define('saas.view.test.order.FormPanel', {
             {
                 text : "序号", 
                 dataIndex : "pd_detno", 
-                width : 80.0, 
+                width : 100, 
                 xtype : "numbercolumn",
-                summaryType: 'count',
                 align : 'center',
                 format:'0',
+                summaryType: 'count',
+                summaryRenderer: function(value, summaryData, dataIndex) {
+                    return Ext.String.format('合计: {0}条', value);
+                },
             }, 
             {
                 editor : {
@@ -158,7 +161,7 @@ Ext.define('saas.view.test.order.FormPanel', {
                 text : "单位", 
                 editor : {
                     xtype : "textfield"
-                }, 
+                },
                 dataIndex : "pd_unit", 
                 width : 120.0, 
                 xtype : "", 

+ 11 - 16
frontend/saas-web/app/view/test/query/QueryPanel.js

@@ -2,8 +2,9 @@ Ext.define('saas.view.test.query.QueryPanel', {
     extend: 'saas.view.core.query.QueryPanel',
     xtype: 'test-query-querypanel',
 
-    // controller: 'test-query-formcontroller',
+    controller: 'test-query-querypanel',
     viewModel: 'test-query-querypanel',
+    
     viewName: 'test-query-formpanel',
     _baseVastUrl:'http://192.168.253.58:8800/purchase/',
     _idField:'pu_id',
@@ -113,29 +114,23 @@ Ext.define('saas.view.test.query.QueryPanel', {
             fields: ['pr_statuscode', 'pr_status'],
             data: [
                 ["$ALL", "全部"],
-                ["=AUDITED", "已审核"],
-                ["<>AUDITED", "未审核"]
+                ["AUDITED", "已审核"],
+                ["AUDITED", "未审核"]
             ]
         })
     }, {
-        xtype: 'combobox',
+        xtype: 'multicombo',
         name: 'pu_acceptstatuscode',
         bind: '{pu_acceptstatuscode}',
         fieldLabel: '入库状态',
         allowBlank: true,
         columnWidth: 0.25,
-        queryMode: 'local',
-        displayField: 'pu_acceptstatus',
-        valueField: 'pu_acceptstatuscode',
-        store: Ext.create('Ext.data.Store', {
-            fields: ['pu_acceptstatuscode', 'pu_acceptstatus'],
-            data: [
-                ["$ALL", "全部"],
-                ["=TURNOUT", "已入库"],
-                ["=NULL", "未入库"],
-                ["=PARTOUT", "部分入库"]
-            ]
-        })
+        datas: [
+            ["$ALL", "全部"],
+            ["TURNOUT", "已入库"],
+            ["NOOUT", "未入库"],
+            ["PARTOUT", "部分入库"]
+        ]
     }],
     moreQueryFormItems: [{
         xtype: 'textfield',