瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	frontend/saas-web/app/view/money/payBalance/FormPanel.js
huangx 7 年之前
父節點
當前提交
d421b19c01
共有 100 個文件被更改,包括 2022 次插入116 次删除
  1. 8 0
      README.md
  2. 34 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/EndProductDTO.java
  3. 87 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/MessagelogDTO.java
  4. 9 2
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  5. 11 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java
  6. 118 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Enterprise.java
  7. 10 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Maxnumbers.java
  8. 10 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Messagelog.java
  9. 20 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java
  10. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/CommonsApplication.java
  11. 51 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/config/WebConfig.java
  12. 37 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/EndProductController.java
  13. 30 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/EnterpriseController.java
  14. 22 4
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MaxnumberController.java
  15. 19 4
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java
  16. 18 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/EndProductMapper.java
  17. 14 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/EnterpriseMapper.java
  18. 3 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java
  19. 3 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MessagelogMapper.java
  20. 15 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/EndProductService.java
  21. 12 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/EnterpriseService.java
  22. 8 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MaxnumberService.java
  23. 5 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MessageLogService.java
  24. 90 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/EndProductServiceImpl.java
  25. 35 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/EnterpriseServiceImpl.java
  26. 66 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MaxnumberServiceImpl.java
  27. 40 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MessageLogServiceImpl.java
  28. 4 1
      applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties
  29. 31 0
      applications/commons/commons-server/src/main/resources/mapper/EndProductMapper.xml
  30. 156 0
      applications/commons/commons-server/src/main/resources/mapper/EnterpriseMapper.xml
  31. 34 15
      applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml
  32. 15 2
      applications/commons/commons-server/src/main/resources/mapper/MessagelogMapper.xml
  33. 1 1
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomeraddressDTO.java
  34. 1 1
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomercontactDTO.java
  35. 10 2
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java
  36. 120 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductReserveCostDTO.java
  37. 2 2
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/CustomerList.java
  38. 1 1
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Customeraddress.java
  39. 1 1
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Customercontact.java
  40. 3 3
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendorcontact.java
  41. 3 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  42. 53 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/config/WebConfig.java
  43. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java
  44. 5 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BankinformationController.java
  45. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java
  46. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java
  47. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java
  48. 7 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/FundinouttypeController.java
  49. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  50. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProducttypeController.java
  51. 8 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductunitController.java
  52. 1 5
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java
  53. 7 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java
  54. 6 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java
  55. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerListMapper.java
  56. 5 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java
  57. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/FundinouttypeMapper.java
  58. 4 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  59. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java
  60. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProducttypeMapper.java
  61. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductunitMapper.java
  62. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorkindMapper.java
  63. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  64. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/AddressService.java
  65. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/BankinformationService.java
  66. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerService.java
  67. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerkindService.java
  68. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/FundinouttypeService.java
  69. 9 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  70. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProducttypeService.java
  71. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductunitService.java
  72. 32 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  73. 38 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  74. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  75. 24 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  76. 27 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  77. 31 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java
  78. 25 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  79. 26 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  80. 29 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java
  81. 30 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java
  82. 24 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  83. 17 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  84. 1 1
      applications/document/document-server/src/main/resources/application.yml
  85. 25 2
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  86. 14 0
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  87. 15 13
      applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml
  88. 6 6
      applications/document/document-server/src/main/resources/mapper/CustomeraddressMapper.xml
  89. 108 5
      applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml
  90. 17 3
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  91. 26 3
      applications/document/document-server/src/main/resources/mapper/FundinouttypeMapper.xml
  92. 48 3
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  93. 22 2
      applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml
  94. 25 2
      applications/document/document-server/src/main/resources/mapper/ProducttypeMapper.xml
  95. 17 0
      applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml
  96. 6 6
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml
  97. 16 2
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  98. 14 0
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  99. 3 3
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/mapper/CustomercontactMapperTest.java
  100. 1 1
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/CustomerServiceTest.java

+ 8 - 0
README.md

@@ -13,12 +13,20 @@
 │  |  |  |─document-dto-----------------------基础资料数据传输对象
 │  |  |  |─document-server--------------------基础资料服务
 │  |  ├─money---------------------------------资金
+│  |  |  |─money-api--------------------------资金服务api
+│  |  |  |─money-dto--------------------------资金服务数据传输对象
+│  |  |  |─money-server-----------------------资金服务
 │  |  ├─purchase------------------------------采购
 │  |  |  |─purchase-api-----------------------采购服务api
 │  |  |  |─purchase-dto-----------------------采购服务数据传输对象
 │  |  |  |─purchase-server--------------------采购服务
 │  |  ├─sale----------------------------------销售
+│  |  |  |─sale-dto---------------------------销售服务数据传输对象
+│  |  |  |─sale-server------------------------销售服务
 │  |  ├─storage-------------------------------库存
+│  |  |  |─storage-api------------------------库存服务api
+│  |  |  |─storage-dto------------------------库存服务数据传输对象
+│  |  |  |─storage-server---------------------库存服务
 │  │ 
 │  ├─base-servers-----------------------------基础服务
 │  |  ├─admin-server--------------------------spring-boot-admin监控中心

+ 34 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/EndProductDTO.java

@@ -0,0 +1,34 @@
+package com.usoftchina.saas.commons.dto;
+
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
+import com.usoftchina.saas.commons.po.Messagelog;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 结账  返回数据
+ * @author chenwei
+ * @date 2018/10/31
+ */
+public class EndProductDTO extends CommonBaseDTO implements Serializable {
+
+    private String main;
+    private List<MessagelogDTO> items;
+
+    public String getMain() {
+        return main;
+    }
+
+    public void setMain(String main) {
+        this.main = main;
+    }
+
+    public List<MessagelogDTO> getItems() {
+        return items;
+    }
+
+    public void setItems(List<MessagelogDTO> items) {
+        this.items = items;
+    }
+}

+ 87 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/MessagelogDTO.java

@@ -0,0 +1,87 @@
+package com.usoftchina.saas.commons.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class MessagelogDTO implements Serializable {
+
+    private String ml_code;
+
+    private String ml_content;
+
+    private String ml_result;
+
+    private String ml_caller;
+
+    private String ml_man;
+
+    private Date createTime;
+
+    private Long companyId;
+
+    private Long ml_keyvalue;
+
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
+
+    public Long getMl_keyvalue() {
+        return ml_keyvalue;
+    }
+
+    public void setMl_keyvalue(Long ml_keyvalue) {
+        this.ml_keyvalue = ml_keyvalue;
+    }
+
+    public String getMl_code() {
+        return ml_code;
+    }
+
+    public void setMl_code(String ml_code) {
+        this.ml_code = ml_code;
+    }
+
+    public String getMl_content() {
+        return ml_content;
+    }
+
+    public void setMl_content(String ml_content) {
+        this.ml_content = ml_content;
+    }
+
+    public String getMl_result() {
+        return ml_result;
+    }
+
+    public void setMl_result(String ml_result) {
+        this.ml_result = ml_result;
+    }
+
+    public String getMl_caller() {
+        return ml_caller;
+    }
+
+    public void setMl_caller(String ml_caller) {
+        this.ml_caller = ml_caller;
+    }
+
+    public String getMl_man() {
+        return ml_man;
+    }
+
+    public void setMl_man(String ml_man) {
+        this.ml_man = ml_man;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 9 - 2
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -22,11 +22,17 @@ public enum BizExceptionCode implements BaseExceptionCode {
     CODE_EXISTS(79200, "单据编号已存在"),
     BIZ_CLOSE(79301, "只能关闭已审核的单据"),
     BIZ_OPEN(79302, "只能打开已关闭的单据"),
+    BIZ_AUDITED(79303,"只能审核未审核的单据"),
+    BIZ_UNAUDITED(79304,"只能反审核已审核的单据"),
+    BIZ_DELETE(79305,"只能删除未审核的单据"),
+    NO_OPRATIONDATA(79400,"无可操作单据"),
     BOM_SAVE(79401, "产品编号+版本号已存在"),
+    REPEAT_NAME(79501, "名称重复"),
     NO_DATA(79998, "未找到数据"),
     ILLEGAL_ID(79999, "id不正确"),
 
 
+
     //采购
 
     //销售
@@ -34,8 +40,9 @@ public enum BizExceptionCode implements BaseExceptionCode {
     SALE_CLOSE(72001, "单据已关闭,无法进行操作"),
     SALE_YQTYBEYONDQTY(72001, "明细行已转数量大于数量"),
     SALE_NULL_BILL(72002, "单据不存在或者明细为空"),
-    SALEOUT_ALL_TURNIN(72003, "该销售出货单已全部转退货,无法转销售退货单"),
-    SALEOUT_POSTSTATUS_ERROR(72004,"单据状态异常,无法反审核"),
+    SALEOUT_ALL_TURNIN(72003, "该出货单已全部转退货,无法转销售退货单"),
+    SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作。"),
+    SALEOUT_POST_ERROR(72005,""),
     //资金
 
     //库存

+ 11 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java

@@ -22,7 +22,7 @@ public enum  BillCodeSeq {
 
     SALE("销售订单", "Sale"),
 
-    SALEOUT("销售出货单", "SaleOut"),
+    SALEOUT("出货单", "SaleOut"),
 
     SALEIN("销售退货单", "SaleIn"),
 
@@ -61,6 +61,16 @@ public enum  BillCodeSeq {
         return name;
     }
 
+    // 根据caller返回名称
+    public static String getName( String caller) {
+        for (BillCodeSeq bill : BillCodeSeq.values()) {
+            if (bill.getCaller().equals(caller)) {
+                return bill.name;
+            }
+        }
+        return null;
+    }
+
     public void setName(String name) {
         this.name = name;
     }

+ 118 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Enterprise.java

@@ -0,0 +1,118 @@
+package com.usoftchina.saas.commons.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Enterprise extends CommonBaseEntity implements Serializable {
+    private String en_name;
+
+    private String en_address;
+
+    private String en_tel;
+
+    private String en_fax;
+
+    private String en_postcodes;
+
+    private Date en_begindate;
+
+    private String en_pricemethod;
+
+    private Integer en_recorderid;
+
+    private String en_recorder;
+
+    private Date en_recorddate;
+
+    private byte[] en_signet;
+
+    public String getEn_name() {
+        return en_name;
+    }
+
+    public void setEn_name(String en_name) {
+        this.en_name = en_name;
+    }
+
+    public String getEn_address() {
+        return en_address;
+    }
+
+    public void setEn_address(String en_address) {
+        this.en_address = en_address;
+    }
+
+    public String getEn_tel() {
+        return en_tel;
+    }
+
+    public void setEn_tel(String en_tel) {
+        this.en_tel = en_tel;
+    }
+
+    public String getEn_fax() {
+        return en_fax;
+    }
+
+    public void setEn_fax(String en_fax) {
+        this.en_fax = en_fax;
+    }
+
+    public String getEn_postcodes() {
+        return en_postcodes;
+    }
+
+    public void setEn_postcodes(String en_postcodes) {
+        this.en_postcodes = en_postcodes;
+    }
+
+    public Date getEn_begindate() {
+        return en_begindate;
+    }
+
+    public void setEn_begindate(Date en_begindate) {
+        this.en_begindate = en_begindate;
+    }
+
+    public String getEn_pricemethod() {
+        return en_pricemethod;
+    }
+
+    public void setEn_pricemethod(String en_pricemethod) {
+        this.en_pricemethod = en_pricemethod;
+    }
+
+    public Integer getEn_recorderid() {
+        return en_recorderid;
+    }
+
+    public void setEn_recorderid(Integer en_recorderid) {
+        this.en_recorderid = en_recorderid;
+    }
+
+    public String getEn_recorder() {
+        return en_recorder;
+    }
+
+    public void setEn_recorder(String en_recorder) {
+        this.en_recorder = en_recorder;
+    }
+
+    public Date getEn_recorddate() {
+        return en_recorddate;
+    }
+
+    public void setEn_recorddate(Date en_recorddate) {
+        this.en_recorddate = en_recorddate;
+    }
+
+    public byte[] getEn_signet() {
+        return en_signet;
+    }
+
+    public void setEn_signet(byte[] en_signet) {
+        this.en_signet = en_signet;
+    }
+}

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

@@ -9,6 +9,16 @@ public class Maxnumbers extends CommonBaseEntity{
 
     private String mn_rule;
 
+    public String getMn_name() {
+        return mn_name;
+    }
+
+    public void setMn_name(String mn_name) {
+        this.mn_name = mn_name;
+    }
+
+    private String mn_name;
+
     public String getMn_rule() {
         return mn_rule;
     }

+ 10 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Messagelog.java

@@ -14,8 +14,18 @@ public class Messagelog extends CommonBaseEntity{
 
     private String ml_caller;
 
+    public String getMl_name() {
+        return ml_name;
+    }
+
+    public void setMl_name(String ml_name) {
+        this.ml_name = ml_name;
+    }
+
     private String ml_man;
 
+    private String ml_name;
+
     public Long getMl_keyvalue() {
         return ml_keyvalue;
     }

+ 20 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java

@@ -49,7 +49,26 @@ public enum Operation {
     /**
      * 禁用操作
      */
-    BANNED("msg.banned", "msg.bannedSuccess");
+    BANNED("msg.banned", "msg.bannedSuccess"),
+
+    /**
+     * 记账
+     */
+    ENDPRODUCT("msg.endProdudct", "msg.endProdudctSuccess"),
+
+    /**
+     * 反记账
+     */
+    UNENDPRODUCT("msg.unEndProduct", "msg.unEndProductSuccess"),
+    /**
+     * 转出货单
+     */
+    TURNPRODOUT("msg.turnProdIO","msg.turnSuccess"),
+
+    /**
+     * 转销售验退单
+     */
+    TURNPRODOUTRETURN("msg.turnProdIOReturn","msg.turnSuccess");
 
     private final String title;
     private final String result;

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

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.commons;
 
+import com.usoftchina.saas.auth.client.EnableAuthClient;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -16,6 +17,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableTransactionManagement
 @EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.commons.mapper")
+@EnableAuthClient
 public class CommonsApplication {
     public static void main(String[] args) {
         SpringApplication.run(CommonsApplication.class, args);

+ 51 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/config/WebConfig.java

@@ -0,0 +1,51 @@
+package com.usoftchina.saas.commons.config;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+
+/**
+ * @author: guq
+ * @create: 2018-10-30 11:20
+ **/
+
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+    @Bean
+    public HttpMessageConverter<String> responseBodyConverter() {
+        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        return converter;
+    }
+
+    @Bean
+    public MappingJackson2HttpMessageConverter MappingJacksonHttpMessageConverter(){
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        converter.setObjectMapper(objectMapper);
+        return converter;
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        converters.add(responseBodyConverter());
+        converters.add(MappingJacksonHttpMessageConverter());
+    }
+
+    @Override
+    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
+        configurer.favorPathExtension(false);
+    }
+}

+ 37 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/EndProductController.java

@@ -0,0 +1,37 @@
+package com.usoftchina.saas.commons.controller;
+
+import com.netflix.discovery.converters.Auto;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.service.EndProductService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 结账
+ */
+@RestController
+@RequestMapping("/endProduct")
+public class EndProductController {
+
+    @Autowired
+    private EndProductService endProductService;
+
+    @GetMapping("/list")
+    public Result getListData(PageRequest page, ListReqDTO listReqDTO){
+        return Result.success(endProductService.getPeriodData(page, listReqDTO));
+    }
+
+    @PostMapping("/endAccount")
+    public Result endAccount(){
+        return Result.success(endProductService.endAccount());
+    }
+
+    @PostMapping("/unEndAccount")
+    public Result unEndAccount(){
+        endProductService.unEndAccount();
+        return Result.success();
+    }
+
+}

+ 30 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/EnterpriseController.java

@@ -0,0 +1,30 @@
+package com.usoftchina.saas.commons.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.po.Enterprise;
+import com.usoftchina.saas.commons.service.EnterpriseService;
+import com.usoftchina.saas.context.BaseContextHolder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/enterprise")
+public class EnterpriseController {
+
+    @Autowired
+    private EnterpriseService enterpriseService;
+
+    @GetMapping("/read")
+    public Result getList(){
+        enterpriseService.findByPrimaryKey(BaseContextHolder.getCompanyId());
+        return Result.success();
+    }
+
+    @PostMapping("/save")
+    public Result save(@RequestBody Enterprise enterprise){
+        DocBaseDTO docBaseDTO = enterpriseService.saveData(enterprise);
+        return Result.success(docBaseDTO);
+    }
+
+}

+ 22 - 4
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MaxnumberController.java

@@ -2,13 +2,15 @@ package com.usoftchina.saas.commons.controller;
 
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.po.Maxnumbers;
 import com.usoftchina.saas.commons.service.MaxnumberService;
 
+import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-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.sql.ResultSet;
 
 /**
  * @author: guq
@@ -31,4 +33,20 @@ public class MaxnumberController {
                                 @RequestParam("caller") String caller) {
         return Result.success(maxnumberService.pushMaxnubmer(count, code, caller));
     }
+
+    @GetMapping("/list")
+    public Result getList(PageRequest page, ListReqDTO listReqDTO){
+        return Result.success(maxnumberService.getListData(page, listReqDTO));
+    }
+
+    @PostMapping("/save")
+    public Result save(@RequestBody Maxnumbers maxnumbers){
+        return Result.success(maxnumberService.saveData(maxnumbers));
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        maxnumberService.removeByPrimaryKey(id);
+        return Result.success();
+    }
 }

+ 19 - 4
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java

@@ -1,14 +1,16 @@
 package com.usoftchina.saas.commons.controller;
 
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.service.MessageLogService;
 
+import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-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 org.springframework.web.context.request.async.DeferredResult;
 
 import java.util.concurrent.CompletableFuture;
@@ -24,6 +26,19 @@ public class MessageLogController {
     @Autowired
     private MessageLogService messageLogService;
 
+    /**
+     * 采购订单列表
+     *
+     * @param page
+     * @param req
+     * @return
+     */
+    @GetMapping("/list")
+    public Result<PageInfo<Messagelog>> getListData(PageRequest page, ListReqDTO req) {
+        PageInfo<Messagelog> listData = messageLogService.getListData(page, req);
+        return Result.success(listData);
+    }
+
     @RequestMapping("/save")
     public DeferredResult<String> save(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it

+ 18 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/EndProductMapper.java

@@ -0,0 +1,18 @@
+package com.usoftchina.saas.commons.mapper;
+
+import com.usoftchina.saas.commons.dto.MessagelogDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface EndProductMapper {
+
+    void endProduct(Map<String, Object> map);
+
+    String selectPeriod(@Param("companyId") Long companyId);
+
+    List<MessagelogDTO> getListData(@Param("condition") String condition, @Param("companyId") Long companyId);
+
+    void updatePeriodStatus(@Param("status") Long status,@Param("period") String period, @Param("companyId") Long companyId);
+}

+ 14 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/EnterpriseMapper.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.commons.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.po.Enterprise;
+
+public interface EnterpriseMapper extends CommonBaseMapper<Enterprise> {
+
+    int insertSelective(Enterprise record);
+
+    Enterprise selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(Enterprise record);
+
+}

+ 3 - 1
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 public interface MaxnumbersMapper extends CommonBaseMapper<Maxnumbers>{
-    int countByExample(MaxnumbersExample example);
+    Long countByExample(MaxnumbersExample example);
 
     int deleteByExample(MaxnumbersExample example);
 
@@ -31,4 +31,6 @@ public interface MaxnumbersMapper extends CommonBaseMapper<Maxnumbers>{
     int updateByPrimaryKeySelective(Maxnumbers record);
 
     int updateByPrimaryKey(Maxnumbers record);
+
+    List<Maxnumbers> getListDataByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
 }

+ 3 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MessagelogMapper.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.commons.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.MessagelogDTO;
 import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.commons.po.MessagelogExample;
 import java.util.List;
@@ -28,4 +29,6 @@ public interface MessagelogMapper extends CommonBaseMapper<Messagelog>{
     int updateByPrimaryKeySelective(Messagelog record);
 
     int updateByPrimaryKey(Messagelog record);
+
+    List<Messagelog> selectMessageLog(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 15 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/EndProductService.java

@@ -0,0 +1,15 @@
+package com.usoftchina.saas.commons.service;
+
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+
+import java.util.Map;
+
+public interface EndProductService{
+
+    Map<String, Object> getPeriodData(PageRequest page, ListReqDTO listReqDTO);
+
+    String endAccount();
+
+    void unEndAccount();
+}

+ 12 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/EnterpriseService.java

@@ -0,0 +1,12 @@
+package com.usoftchina.saas.commons.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.mapper.EnterpriseMapper;
+import com.usoftchina.saas.commons.po.Enterprise;
+
+public interface EnterpriseService extends CommonBaseService<EnterpriseMapper, Enterprise> {
+
+    DocBaseDTO saveData(Enterprise enterprise);
+
+}

+ 8 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MaxnumberService.java

@@ -1,8 +1,12 @@
 package com.usoftchina.saas.commons.service;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.mapper.MaxnumbersMapper;
 import com.usoftchina.saas.commons.po.Maxnumbers;
+import com.usoftchina.saas.page.PageRequest;
 
 /**
  * @author: guq
@@ -12,4 +16,8 @@ public interface MaxnumberService extends CommonBaseService<MaxnumbersMapper, Ma
     String getMaxnumner(String caller, boolean update);
 
     String pushMaxnubmer(Integer count, String code, String caller);
+
+    PageInfo<Maxnumbers> getListData(PageRequest page, ListReqDTO listReqDTO);
+
+    DocBaseDTO saveData(Maxnumbers maxnumbers);
 }

+ 5 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MessageLogService.java

@@ -1,10 +1,13 @@
 package com.usoftchina.saas.commons.service;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.mapper.MessagelogMapper;
 import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.commons.po.Operation;
+import com.usoftchina.saas.page.PageRequest;
 
 public interface MessageLogService extends CommonBaseService<MessagelogMapper, Messagelog>{
     String save(DocBaseDTO baseDTO);
@@ -24,4 +27,6 @@ public interface MessageLogService extends CommonBaseService<MessagelogMapper, M
     String open(DocBaseDTO baseDTO);
 
     String customizeLog(DocBaseDTO baseDTO, Operation operation);
+
+    PageInfo<Messagelog> getListData(PageRequest page, ListReqDTO req);
 }

+ 90 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/EndProductServiceImpl.java

@@ -0,0 +1,90 @@
+package com.usoftchina.saas.commons.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.dto.MessagelogDTO;
+import com.usoftchina.saas.commons.mapper.EndProductMapper;
+import com.usoftchina.saas.commons.mapper.MessagelogMapper;
+import com.usoftchina.saas.commons.po.Operation;
+import com.usoftchina.saas.commons.service.EndProductService;
+import com.usoftchina.saas.commons.service.MessageLogService;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class EndProductServiceImpl implements EndProductService {
+
+    @Autowired
+    private MessageLogService messageLogService;
+    @Autowired
+    private MessagelogMapper messagelogMapper;
+    @Autowired
+    private EndProductMapper endProductMapper;
+
+    @Override
+    public Map<String, Object> getPeriodData(PageRequest page, ListReqDTO listReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        List<MessagelogDTO> messagelogDTOS = endProductMapper.getListData(condition, BaseContextHolder.getCompanyId());
+        //取分页信息
+        PageInfo<MessagelogDTO> pageInfo = new PageInfo<MessagelogDTO>(messagelogDTOS);
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("main", endProductMapper.selectPeriod(BaseContextHolder.getCompanyId()));
+        map.put("item",pageInfo);
+        return map;
+    }
+
+    @Override
+    public String endAccount() {
+        String period = endProductMapper.selectPeriod(BaseContextHolder.getCompanyId());
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("yearMonth", period);
+        map.put("companyId", BaseContextHolder.getCompanyId());
+        map.put("result", null);
+        endProductMapper.endProduct(map);
+        endProductMapper.updatePeriodStatus(99L, period, BaseContextHolder.getCompanyId());
+        DocBaseDTO docBaseDTO = generateMsgObj(Long.parseLong(period));
+        messageLogService.customizeLog(docBaseDTO, Operation.ENDPRODUCT);
+        return String.valueOf(map.get("result"));
+    }
+
+    @Override
+    public void unEndAccount() {
+        String period = endProductMapper.selectPeriod(BaseContextHolder.getCompanyId());
+        if (StringUtils.isEmpty(period)){
+            throw new BizException(79306,"系统还未结账,不能反结账");
+        }else{
+            endProductMapper.updatePeriodStatus(0L, period, BaseContextHolder.getCompanyId());
+            messageLogService.customizeLog(generateMsgObj(Long.parseLong(period)), Operation.UNENDPRODUCT);
+        }
+    }
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, null, "EndProduct");
+    }
+
+}

+ 35 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/EnterpriseServiceImpl.java

@@ -0,0 +1,35 @@
+package com.usoftchina.saas.commons.service.impl;
+
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.mapper.EnterpriseMapper;
+import com.usoftchina.saas.commons.po.Enterprise;
+import com.usoftchina.saas.commons.service.EnterpriseService;
+import com.usoftchina.saas.commons.service.MessageLogService;
+import com.usoftchina.saas.exception.BizException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class EnterpriseServiceImpl extends CommonBaseServiceImpl<EnterpriseMapper, Enterprise> implements EnterpriseService {
+
+    @Autowired
+    private MessageLogService messageLogService;
+
+    @Override
+    public DocBaseDTO saveData(Enterprise enterprise) {
+        if (enterprise.getCompanyId() == 0){
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+        getMapper().updateByPrimaryKeySelective(enterprise);
+        DocBaseDTO docBaseDTO = generateMsgObj(enterprise.getCompanyId());
+        messageLogService.update(docBaseDTO);
+        return docBaseDTO;
+    }
+
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, null, "Enterprise");
+    }
+
+}

+ 66 - 1
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MaxnumberServiceImpl.java

@@ -1,6 +1,10 @@
 package com.usoftchina.saas.commons.service.impl;
 
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.mapper.MaxnumbersMapper;
 import com.usoftchina.saas.commons.mapper.MaxnumbersdetailMapper;
@@ -9,15 +13,18 @@ import com.usoftchina.saas.commons.po.MaxnumbersExample;
 import com.usoftchina.saas.commons.po.Maxnumbersdetail;
 import com.usoftchina.saas.commons.po.MaxnumbersdetailExample;
 import com.usoftchina.saas.commons.service.MaxnumberService;
+import com.usoftchina.saas.commons.service.MessageLogService;
 import com.usoftchina.saas.context.BaseContextHolder;
 
 import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.DateUtils;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Date;
+import java.util.List;
 
 
 /**
@@ -31,6 +38,8 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
     private MaxnumbersMapper maxnumbersMapper;
     @Autowired
     private MaxnumbersdetailMapper maxnumbersdetailMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     /**
     * @Description
@@ -144,6 +153,53 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
         return maxcode;
     }
 
+    @Override
+    public PageInfo<Maxnumbers> getListData(PageRequest page, ListReqDTO listReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+
+        List<Maxnumbers> maxnumbersList = getMapper().getListDataByCondition(condition, BaseContextHolder.getCompanyId());
+        //取分页信息
+        PageInfo<Maxnumbers> pageInfo = new PageInfo<Maxnumbers>(maxnumbersList);
+        return pageInfo;
+    }
+
+    @Override
+    public DocBaseDTO saveData(Maxnumbers maxnumbers) {
+        DocBaseDTO docBaseDTO = null;
+        if(maxnumbers.getId() == 0){
+            //保存
+            maxnumbers.setCompanyId(BaseContextHolder.getCompanyId());
+            maxnumbers.setCreatorId(BaseContextHolder.getUserId());
+            maxnumbers.setCreateTime(new Date());
+
+            getMapper().insertSelective(maxnumbers);
+            //记录LOG
+            docBaseDTO = generateMsgObj(maxnumbers.getId());
+            messageLogService.save(docBaseDTO);
+        }else{
+            //更新
+            maxnumbers.setUpdaterId(BaseContextHolder.getUserId());
+            maxnumbers.setUpdateTime(new Date());
+
+            getMapper().updateByPrimaryKeySelective(maxnumbers);
+            //记录LOG
+            docBaseDTO = generateMsgObj(maxnumbers.getId());
+            messageLogService.update(docBaseDTO);
+        }
+        return docBaseDTO;
+    }
+
     /**
     * @Description
     * 根据长度跳流水号
@@ -222,11 +278,20 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
     */
     private String getRulecode(Maxnumbers maxnumbers) {
         String rulecode = maxnumbers.getMn_leadcode();
-        Integer length = maxnumbers.getMn_number();
         String mn_rule = maxnumbers.getMn_rule();
+        mn_rule = mn_rule == null ? "" : mn_rule.toUpperCase();
         String date = "YYYYMM".equals(mn_rule) ? DateUtils.format(new Date(), "yyyyMM") :
                 DateUtils.format(new Date(), "yyyyMMdd");
         return rulecode += date;
     }
 
+    /**
+     * 构造日记记录对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, null, "Maxnumber");
+    }
+
 }

+ 40 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MessageLogServiceImpl.java

@@ -1,19 +1,26 @@
 package com.usoftchina.saas.commons.service.impl;
 
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.mapper.MessagelogMapper;
+import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.service.MessageLogService;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.page.PageRequest;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.MessageSource;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Locale;
 
 /**
@@ -25,6 +32,8 @@ public class MessageLogServiceImpl extends CommonBaseServiceImpl<MessagelogMappe
 
     @Autowired
     private MessageSource messageSource;
+    @Autowired
+    private MessagelogMapper messagelogMapper;
 
     @Override
     public String save(DocBaseDTO baseDTO) {
@@ -72,10 +81,27 @@ public class MessageLogServiceImpl extends CommonBaseServiceImpl<MessagelogMappe
         return log(operation, baseDTO);
     }
 
+    @Override
+    public PageInfo<Messagelog> getListData(PageRequest page, ListReqDTO req) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //查询数据
+        List<Messagelog> lists = getListByMode(req);
+        //取分页信息
+        PageInfo<Messagelog> pageInfo = new PageInfo<Messagelog>(lists);
+        return pageInfo;
+    }
+
     private String log(Operation operation, DocBaseDTO baseDTO) {
         String language = "zh_CN";
         Messagelog msg = new Messagelog();
         msg.setMl_caller(baseDTO.getName());
+        msg.setMl_name(BillCodeSeq.getName(baseDTO.getName()));
         msg.setMl_content(getLocalMessage(operation.getTitle(), language));
         msg.setMl_result(getLocalMessage(operation.getResult(), language));
         msg.setMl_code(baseDTO.getCode());
@@ -90,4 +116,18 @@ public class MessageLogServiceImpl extends CommonBaseServiceImpl<MessagelogMappe
     private String getLocalMessage(String msg, String language) {
        return messageSource.getMessage(msg, null, Locale.CHINA);
     }
+
+
+    private List<Messagelog> getListByMode(ListReqDTO req) {
+        List<Messagelog> list = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        if (null == req || StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
+            list = messagelogMapper.selectMessageLog(con, companyId);
+        }
+        return list;
+    }
 }

+ 4 - 1
applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties

@@ -92,6 +92,7 @@ msg.turnARBill=\u5f00\u7968\u4f5c\u4e1a
 msg.turnNotify=\u8f6c\u901a\u77e5\u5355\u64cd\u4f5c
 msg.turnStorage=\u8f6c\u5165\u5e93
 msg.turnProdIO=\u8f6c\u51fa\u5e93\u5355\u64cd\u4f5c
+msg.turnProdIOReturn=\u8F6C\u9500\u552E\u9A8C\u9000\u5355
 msg.turnProdIO\!OtherOut=\u8f6c\u5176\u5b83\u51fa\u5e93\u5355\u64cd\u4f5c
 msg.turnProdIO\!OtherPurcOut=\u8f6c\u5176\u5b83\u91c7\u8d2d\u51fa\u5e93\u5355
 msg.turnSendNotify=\u8f6c\u53d1\u8d27\u901a\u77e5\u5355\u64cd\u4f5c
@@ -114,4 +115,6 @@ msg.CopySuccess=\u590d\u5236\u6210\u529f,\u6765\u6e90\u5355\u53f7\uff1a
 msg.getBill=\u83b7\u53d6\u53d1\u7968\u660e\u7ec6
 msg.getARBill=\u83b7\u53d6\u5e94\u6536\u53d1\u7968
 msg.getAPBill=\u83b7\u53d6\u5e94\u4ed8\u53d1\u7968
-msg.getSuccess=\u83b7\u53d6\u6210\u529f
+msg.getSuccess=\u83b7\u53d6\u6210\u529f
+msg.endProdudct=\u8bb0\u8d26\u64cd\u4f5c
+msg.endProdudctSuccess=\u7ed3\u8d26\u6210\u529f

+ 31 - 0
applications/commons/commons-server/src/main/resources/mapper/EndProductMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.commons.mapper.EndProductMapper" >
+    <parameterMap id="spParamMap" type="java.util.Map">
+        <parameter property="yearMonth" jdbcType="VARCHAR" mode="IN" />
+        <parameter property="companyId" jdbcType="VARCHAR" mode="IN" />
+        <parameter property="result" jdbcType="VARCHAR" mode="OUT" />
+    </parameterMap>
+
+    <select id="selectPeriod" resultType="string">
+        select PD_DETNO from periodsdetail where companyid=#{companyId} and pd_status=0 order by PD_DETNO LIMIT 1;
+    </select>
+    <resultMap id="MsgResult" type="com.usoftchina.saas.commons.dto.MessagelogDTO">
+        <result column="ml_content" property="ml_content" jdbcType="VARCHAR" />
+        <result column="ml_result" property="ml_result" jdbcType="VARCHAR" />
+        <result column="ml_man" property="ml_man" jdbcType="VARCHAR" />
+        <result column="companyId" property="companyId" jdbcType="INTEGER" />
+        <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+        <result column="ml_keyvalue" property="ml_keyvalue" jdbcType="INTEGER" />
+    </resultMap>
+    <select id="getListData" resultMap="MsgResult">
+        SELECT * FROM MESSAGELOG WHERE ML_CALLER='EndProduct' AND COMPANYID=#{companyId} AND ml_result='记账成功'
+    </select>
+
+    <select id="endProduct" parameterMap="spParamMap" statementType="CALLABLE">
+        CALL SP_ENDPRODUCT(?, ?, ?)
+    </select>
+    <update id="updatePeriodStatus" >
+        update periodsdetail set pd_status=#{status} where pd_detno=#{period} and companyId=#{companyId}
+    </update>
+</mapper>

+ 156 - 0
applications/commons/commons-server/src/main/resources/mapper/EnterpriseMapper.xml

@@ -0,0 +1,156 @@
+<?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.EnterpriseMapper" >
+    <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.po.Enterprise" >
+        <id column="companyId" property="companyId" jdbcType="INTEGER" />
+        <result column="en_name" property="en_name" jdbcType="VARCHAR" />
+        <result column="en_address" property="en_address" jdbcType="VARCHAR" />
+        <result column="en_tel" property="en_tel" jdbcType="VARCHAR" />
+        <result column="en_fax" property="en_fax" jdbcType="VARCHAR" />
+        <result column="en_postcodes" property="en_postcodes" jdbcType="VARCHAR" />
+        <result column="en_begindate" property="en_begindate" jdbcType="TIMESTAMP" />
+        <result column="en_pricemethod" property="en_pricemethod" jdbcType="VARCHAR" />
+        <result column="en_recorderid" property="en_recorderid" jdbcType="INTEGER" />
+        <result column="en_recorder" property="en_recorder" jdbcType="VARCHAR" />
+        <result column="en_recorddate" property="en_recorddate" jdbcType="TIMESTAMP" />
+        <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+        <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    </resultMap>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap">
+        SELECT * FROM ENTERPRISE WHERE companyId=#{id}
+    </select>
+
+    <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Enterprise" >
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
+        insert into enterprise
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="en_name != null" >
+                en_name,
+            </if>
+            <if test="en_address != null" >
+                en_address,
+            </if>
+            <if test="en_tel != null" >
+                en_tel,
+            </if>
+            <if test="en_fax != null" >
+                en_fax,
+            </if>
+            <if test="en_postcodes != null" >
+                en_postcodes,
+            </if>
+            <if test="en_begindate != null" >
+                en_begindate,
+            </if>
+            <if test="en_pricemethod != null" >
+                en_pricemethod,
+            </if>
+            <if test="en_recorderid != null" >
+                en_recorderid,
+            </if>
+            <if test="en_recorder != null" >
+                en_recorder,
+            </if>
+            <if test="en_recorddate != null" >
+                en_recorddate,
+            </if>
+            <if test="updaterId != null" >
+                updaterId,
+            </if>
+            <if test="updateTime != null" >
+                updateTime,
+            </if>
+            <if test="en_signet != null" >
+                en_signet,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="en_name != null" >
+                #{en_name,jdbcType=VARCHAR},
+            </if>
+            <if test="en_address != null" >
+                #{en_address,jdbcType=VARCHAR},
+            </if>
+            <if test="en_tel != null" >
+                #{en_tel,jdbcType=VARCHAR},
+            </if>
+            <if test="en_fax != null" >
+                #{en_fax,jdbcType=VARCHAR},
+            </if>
+            <if test="en_postcodes != null" >
+                #{en_postcodes,jdbcType=VARCHAR},
+            </if>
+            <if test="en_begindate != null" >
+                #{en_begindate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="en_pricemethod != null" >
+                #{en_pricemethod,jdbcType=VARCHAR},
+            </if>
+            <if test="en_recorderid != null" >
+                #{en_recorderid,jdbcType=INTEGER},
+            </if>
+            <if test="en_recorder != null" >
+                #{en_recorder,jdbcType=VARCHAR},
+            </if>
+            <if test="en_recorddate != null" >
+                #{en_recorddate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updaterId != null" >
+                #{updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="updateTime != null" >
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="en_signet != null" >
+                #{en_signet,jdbcType=LONGVARBINARY},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.commons.po.Enterprise" >
+        update enterprise
+        <set >
+            <if test="en_name != null" >
+                en_name = #{en_name,jdbcType=VARCHAR},
+            </if>
+            <if test="en_address != null" >
+                en_address = #{en_address,jdbcType=VARCHAR},
+            </if>
+            <if test="en_tel != null" >
+                en_tel = #{en_tel,jdbcType=VARCHAR},
+            </if>
+            <if test="en_fax != null" >
+                en_fax = #{en_fax,jdbcType=VARCHAR},
+            </if>
+            <if test="en_postcodes != null" >
+                en_postcodes = #{en_postcodes,jdbcType=VARCHAR},
+            </if>
+            <if test="en_begindate != null" >
+                en_begindate = #{en_begindate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="en_pricemethod != null" >
+                en_pricemethod = #{en_pricemethod,jdbcType=VARCHAR},
+            </if>
+            <if test="en_recorderid != null" >
+                en_recorderid = #{en_recorderid,jdbcType=INTEGER},
+            </if>
+            <if test="en_recorder != null" >
+                en_recorder = #{en_recorder,jdbcType=VARCHAR},
+            </if>
+            <if test="en_recorddate != null" >
+                en_recorddate = #{en_recorddate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updaterId != null" >
+                updaterId = #{updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="updateTime != null" >
+                updateTime = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="en_signet != null" >
+                en_signet = #{en_signet,jdbcType=LONGVARBINARY},
+            </if>
+        </set>
+        where companyId = #{companyId}
+    </update>
+</mapper>

+ 34 - 15
applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml

@@ -6,6 +6,7 @@
     <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="mn_name" property="mn_name" jdbcType="VARCHAR" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
     <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
@@ -88,15 +89,15 @@
       order by ${orderByClause}
     </if>
   </select>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
     <include refid="Base_Column_List" />
     from maxnumbers
-    where mn_id = #{id,jdbcType=INTEGER}
+    where mn_id = #{id}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from maxnumbers
-    where mn_id = #{id,jdbcType=INTEGER}
+    where mn_id = #{id}
   </delete>
   <delete id="deleteByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" >
     delete from maxnumbers
@@ -105,27 +106,30 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
-    insert into maxnumbers (mn_id, mn_caller, mn_leadcode, 
+    insert into maxnumbers (mn_caller, mn_leadcode,
       mn_number, companyId, createTime, 
       creatorId, updateTime, updaterId
       )
-    values (#{id,jdbcType=INTEGER}, #{mn_caller,jdbcType=VARCHAR}, #{mn_leadcode,jdbcType=VARCHAR},
+    values (#{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" >
+      <selectKey resultType="java.lang.Long" keyProperty="id">
+          SELECT LAST_INSERT_ID() AS ID
+      </selectKey>
     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_rule != null" >
+          mn_rule,
+      </if>
       <if test="mn_number != null" >
         mn_number,
       </if>
@@ -146,15 +150,15 @@
       </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_rule != null" >
+        #{mn_rule,jdbcType=VARCHAR},
+      </if>
       <if test="mn_number != null" >
         #{mn_number,jdbcType=VARCHAR},
       </if>
@@ -175,7 +179,7 @@
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" resultType="java.lang.Integer" >
+  <select id="countByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" resultType="java.lang.Long" >
     select count(*) from maxnumbers
     <if test="_parameter != null" >
       <include refid="Example_Where_Clause" />
@@ -240,6 +244,9 @@
       <if test="mn_leadcode != null" >
         mn_leadcode = #{mn_leadcode,jdbcType=VARCHAR},
       </if>
+      <if test="mn_rule != null" >
+        mn_rule = #{mn_rule,jdbcType=VARCHAR},
+      </if>
       <if test="mn_number != null" >
         mn_number = #{mn_number,jdbcType=VARCHAR},
       </if>
@@ -259,7 +266,7 @@
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
     </set>
-    where mn_id = #{id,jdbcType=INTEGER}
+    where mn_id = #{id}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
     update maxnumbers
@@ -271,6 +278,18 @@
       creatorId = #{creatorId,jdbcType=INTEGER},
       updateTime = #{updateTime,jdbcType=TIMESTAMP},
       updaterId = #{updaterId,jdbcType=INTEGER}
-    where mn_id = #{id,jdbcType=INTEGER}
+    where mn_id = #{id}
   </update>
+    <select id="getListDataByCondition" resultMap="BaseResultMap">
+        SELECT * FROM MAXNUMBERS
+        <where>
+            <if test="condition">
+                ${condition}
+            </if>
+            <if test="companyId">
+                and COMPANYID=#{companyId}
+            </if>
+        </where>
+        ORDER BY MN_ID DESC
+    </select>
 </mapper>

+ 15 - 2
applications/commons/commons-server/src/main/resources/mapper/MessagelogMapper.xml

@@ -7,6 +7,7 @@
     <result column="ml_content" property="ml_content" jdbcType="VARCHAR" />
     <result column="ml_result" property="ml_result" jdbcType="VARCHAR" />
     <result column="ml_caller" property="ml_caller" jdbcType="VARCHAR" />
+    <result column="ml_name" property="ml_name" jdbcType="VARCHAR" />
     <result column="ml_man" property="ml_man" jdbcType="VARCHAR" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
@@ -111,11 +112,11 @@
     insert into messagelog ( ml_code, ml_content,
       ml_result, ml_caller, ml_man, 
       companyId, createTime, creatorId, 
-      updateTime, updaterId,ml_keyvalue)
+      updateTime, updaterId,ml_keyvalue,ml_name)
     values (#{ml_code,jdbcType=VARCHAR}, #{ml_content,jdbcType=VARCHAR},
       #{ml_result,jdbcType=VARCHAR}, #{ml_caller,jdbcType=VARCHAR}, #{ml_man,jdbcType=VARCHAR}, 
       #{companyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=INTEGER}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER},#{ml_keyvalue,jdbcType=INTEGER})
+      #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER},#{ml_keyvalue,jdbcType=INTEGER},#{ml_name,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Messagelog" >
     insert into messagelog
@@ -304,4 +305,16 @@
       updaterId = #{updaterId,jdbcType=INTEGER}
     where ml_id = #{id,jdbcType=INTEGER}
   </update>
+  <select id="selectMessageLog" resultMap="BaseResultMap">
+    select  *  from messagelog
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by ml_id
+  </select>
 </mapper>

+ 1 - 1
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomeraddressDTO.java

@@ -14,7 +14,7 @@ public class CustomeraddressDTO extends CommonBaseDTO implements Serializable {
 
     private String ca_person;
 
-    private Integer ca_phone;
+    private String ca_phone;
 
     private Integer ca_default;
 

+ 1 - 1
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomercontactDTO.java

@@ -14,7 +14,7 @@ public class CustomercontactDTO extends CommonBaseDTO implements Serializable {
 
     private String cc_name;
 
-    private Integer cc_tel;
+    private String cc_tel;
 
     private String cc_qq;
 

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

@@ -1,13 +1,13 @@
 package com.usoftchina.saas.document.dto;
 
-import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
 @Data
-public class ProductDTO extends CommonBaseDTO implements Serializable {
+public class ProductDTO implements Serializable {
 
+    private Long id;
     private String pr_code;
     private String pr_detail;
     private String pr_spec;
@@ -35,5 +35,13 @@ public class ProductDTO extends CommonBaseDTO implements Serializable {
     private String pr_text2;
     private String pr_text3;
     private String pr_text4;
+    protected Date createTime;
+    protected String creatorName;
+    protected Date updateTime;
+    protected String updaterName;
+    //productonhand
+    private Long po_onhand;
+
+
 
 }

+ 120 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductReserveCostDTO.java

@@ -0,0 +1,120 @@
+package com.usoftchina.saas.document.dto;
+
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
+
+import java.io.Serializable;
+
+/**
+ * 物料库存数量金额表
+ */
+public class ProductReserveCostDTO extends CommonBaseDTO implements Serializable {
+
+    /**
+     * 物料编号
+     */
+    private String rc_prodCode;
+    /**
+     * 物料名称
+     */
+    private String rc_prodDetail;
+    /**
+     * 物料规格
+     */
+    private String rc_prodSpec;
+    /**
+     * 物料单位
+     */
+    private String rc_prodUnit;
+    /**
+     * 仓库编号
+     */
+    private String rc_whCode;
+    /**
+     * 仓库名称
+     */
+    private String rc_whName;
+    /**
+     * 数量
+     */
+    private String rc_number;
+    /**
+     * 单价
+     */
+    private String rc_price;
+    /**
+     * 金额
+     */
+    private String rc_amount;
+
+    public String getRc_prodCode() {
+        return rc_prodCode;
+    }
+
+    public void setRc_prodCode(String rc_prodCode) {
+        this.rc_prodCode = rc_prodCode;
+    }
+
+    public String getRc_prodDetail() {
+        return rc_prodDetail;
+    }
+
+    public void setRc_prodDetail(String rc_prodDetail) {
+        this.rc_prodDetail = rc_prodDetail;
+    }
+
+    public String getRc_prodSpec() {
+        return rc_prodSpec;
+    }
+
+    public void setRc_prodSpec(String rc_prodSpec) {
+        this.rc_prodSpec = rc_prodSpec;
+    }
+
+    public String getRc_prodUnit() {
+        return rc_prodUnit;
+    }
+
+    public void setRc_prodUnit(String rc_prodUnit) {
+        this.rc_prodUnit = rc_prodUnit;
+    }
+
+    public String getRc_whCode() {
+        return rc_whCode;
+    }
+
+    public void setRc_whCode(String rc_whCode) {
+        this.rc_whCode = rc_whCode;
+    }
+
+    public String getRc_whName() {
+        return rc_whName;
+    }
+
+    public void setRc_whName(String rc_whName) {
+        this.rc_whName = rc_whName;
+    }
+
+    public String getRc_number() {
+        return rc_number;
+    }
+
+    public void setRc_number(String rc_number) {
+        this.rc_number = rc_number;
+    }
+
+    public String getRc_price() {
+        return rc_price;
+    }
+
+    public void setRc_price(String rc_price) {
+        this.rc_price = rc_price;
+    }
+
+    public String getRc_amount() {
+        return rc_amount;
+    }
+
+    public void setRc_amount(String rc_amount) {
+        this.rc_amount = rc_amount;
+    }
+}

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

@@ -70,7 +70,7 @@ public class CustomerList extends CommonBaseEntity{
 
     private String ca_person;
 
-    private Integer ca_phone;
+    private String ca_phone;
 
     private Integer ca_default;
 
@@ -93,7 +93,7 @@ public class CustomerList extends CommonBaseEntity{
 
     private String cc_name;
 
-    private Integer cc_tel;
+    private String cc_tel;
 
     private String cc_qq;
 

+ 1 - 1
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Customeraddress.java

@@ -13,7 +13,7 @@ public class Customeraddress extends CommonBaseEntity implements Serializable {
 
     private String ca_person;
 
-    private Integer ca_phone;
+    private String ca_phone;
 
     private Integer ca_default;
 

+ 1 - 1
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Customercontact.java

@@ -13,7 +13,7 @@ public class Customercontact extends CommonBaseEntity implements Serializable {
 
     private String cc_name;
 
-    private Integer cc_tel;
+    private String cc_tel;
 
     private String cc_qq;
 

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

@@ -12,7 +12,7 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
 
     private String vc_name;
 
-    private Integer vc_tel;
+    private String vc_tel;
 
     private String vc_qq;
 
@@ -54,11 +54,11 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
         this.vc_name = vc_name;
     }
 
-    public Integer getVc_tel() {
+    public String getVc_tel() {
         return vc_tel;
     }
 
-    public void setVc_tel(Integer vc_tel) {
+    public void setVc_tel(String vc_tel) {
         this.vc_tel = vc_tel;
     }
 

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

@@ -1,5 +1,6 @@
 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.autoconfigure.SpringBootApplication;
@@ -9,14 +10,13 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 @SpringBootApplication
 @EnableEurekaClient
-//@EnableAuthClient
+@EnableAuthClient
 @EnableTransactionManagement
 @EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.document.mapper")
-public class DocumentApplication  {
+public class DocumentApplication {
     public static void main(String[] args) {
         SpringApplication.run(DocumentApplication.class, args);
     }
 
-
 }

+ 53 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/config/WebConfig.java

@@ -0,0 +1,53 @@
+package com.usoftchina.saas.document.config;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+
+/**
+ * @author: chenw
+ * @create: 2018-10-30 18:01
+ **/
+
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+    @Bean
+    public HttpMessageConverter<String> responseBodyConverter() {
+        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        return converter;
+    }
+
+    @Bean
+    public MappingJackson2HttpMessageConverter MappingJacksonHttpMessageConverter(){
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        converter.setObjectMapper(objectMapper);
+        return converter;
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        converters.add(responseBodyConverter());
+        converters.add(MappingJacksonHttpMessageConverter());
+    }
+
+    @Override
+    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
+        configurer.favorPathExtension(false);
+    }
+}
+
+

+ 6 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.controller;
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Address;
 import com.usoftchina.saas.document.service.AddressService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,4 +40,9 @@ public class AddressController {
         return Result.success(addresseList);
     }
 
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        List<ComboDTO> comboDTOList = addressService.getCombo();
+        return Result.success(comboDTOList);
+    }
 }

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

@@ -1,8 +1,11 @@
 package com.usoftchina.saas.document.controller;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.entities.Bankinformation;
 import com.usoftchina.saas.document.service.BankinformationService;
+import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -31,8 +34,8 @@ public class BankinformationController {
     }
 
     @GetMapping("/list")
-    public Result getAll(){
-        List<Bankinformation> bankinformationList = bankinformationService.findAll();
+    public Result getAll(PageRequest page, ListReqDTO condition){
+        PageInfo<Bankinformation> bankinformationList = bankinformationService.selectList(page, condition);
         return Result.success(bankinformationList);
     }
 }

+ 0 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java

@@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.print.Doc;
 
-@CrossOrigin
 @RestController
 @RequestMapping("/bom")
 public class BomController {

+ 6 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java

@@ -36,6 +36,12 @@ public class CustomerController {
         return Result.success(listData);
     }
 
+    @GetMapping("/dbfind")
+    public Result getDbfind(PageRequest page, ListReqDTO listReqDTO){
+        PageInfo<CustomerList> dbfindData = customerService.getDbfind(page, listReqDTO);
+        return Result.success(dbfindData);
+    }
+
     /**
      * 获取客户资料表单
      *

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java

@@ -2,6 +2,7 @@ package com.usoftchina.saas.document.controller;
 
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.service.CustomerkindService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +37,7 @@ public class CustomerkindController {
 
     @GetMapping("/getCombo")
     public Result getCombo(){
-        List<Customerkind> customerkindList = customerkindService.getCombo();
+        List<ComboDTO> customerkindList = customerkindService.getCombo();
         return Result.success(customerkindList);
     }
 }

+ 7 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/FundinouttypeController.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.controller;
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Fundinouttype;
 import com.usoftchina.saas.document.service.FundinouttypeService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,4 +33,10 @@ public class FundinouttypeController {
         List<Fundinouttype> fundinouttypeList = fundinouttypeService.findAll();
         return Result.success(fundinouttypeList);
     }
+
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        List<ComboDTO> comboDTOList = fundinouttypeService.getCombo();
+        return Result.success(comboDTOList);
+    }
 }

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

@@ -98,4 +98,10 @@ public class ProductController {
         return Result.success(map);
     }
 
+    @GetMapping("/ReserveCost")
+    public Result getReserveCost(PageRequest page, ListReqDTO listReqDTO){
+        productService.getReserveCost(page, listReqDTO);
+        return Result.success();
+    }
+
 }

+ 6 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProducttypeController.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.controller;
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Producttype;
 import com.usoftchina.saas.document.service.ProducttypeService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,5 +34,10 @@ public class ProducttypeController {
         return Result.success();
     }
 
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        List<ComboDTO> comboDTOList = producttypeService.getCombo();
+        return Result.success(comboDTOList);
+    }
 
 }

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.document.controller;
 
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Productunit;
 import com.usoftchina.saas.document.service.ProductunitService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 
 @RestController
-@RequestMapping("/productUnit")
+@RequestMapping("/productunit")
 public class ProductunitController {
 
     @Autowired
@@ -34,4 +35,10 @@ public class ProductunitController {
         return Result.success(productunitList);
     }
 
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        List<ComboDTO> comboDTOList = productunitService.getCombo();
+        return Result.success(comboDTOList);
+    }
+
 }

+ 1 - 5
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java

@@ -33,10 +33,6 @@ public class WarehouseController {
         return Result.success(listData);
     }
 
-
-
-
-
     /**
      * 过账
      * @return
@@ -55,7 +51,7 @@ public class WarehouseController {
     @PostMapping("/unPost")
     public Result unPost(@RequestBody Map<String, Object> map){
         warehouseService.unPost(map);
-        return Result.success();
+        return Result.success(map.get("result"));
     }
 
     /**

+ 7 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java

@@ -1,7 +1,10 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Address;
+import org.apache.ibatis.annotations.Param;
+
 import java.util.List;
 
 public interface AddressMapper extends CommonBaseMapper<Address> {
@@ -21,4 +24,8 @@ public interface AddressMapper extends CommonBaseMapper<Address> {
     int updateByPrimaryKey(Address record);
 
     int deleteByIds(String ids);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

+ 6 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java

@@ -2,11 +2,14 @@ package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.document.entities.Bankinformation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface BankinformationMapper extends CommonBaseMapper<Bankinformation> {
     int deleteByPrimaryKey(Integer bkId);
 
-    int insert(Bankinformation record);
+//    int insert(Bankinformation record);
 
     int insertSelective(Bankinformation record);
 
@@ -17,4 +20,6 @@ public interface BankinformationMapper extends CommonBaseMapper<Bankinformation>
     int updateByPrimaryKeyWithBLOBs(Bankinformation record);
 
     int updateByPrimaryKey(Bankinformation record);
+
+    List<Bankinformation> selectBankinformationBycondition(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 1 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerListMapper.java

@@ -8,4 +8,5 @@ import java.util.List;
 public interface CustomerListMapper {
     List<CustomerList> selectCustomerListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
     List<CustomerList> selectCustomerBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+    List<CustomerList> selectDbFind(@Param("condition") String condition, @Param("companyId") Long companyId);
 }

+ 5 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java

@@ -1,7 +1,9 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Customerkind;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -18,5 +20,7 @@ public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
 
     int updateByPrimaryKey(Customerkind record);
 
-    List<Customerkind> getCombo();
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 }

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

@@ -2,7 +2,11 @@ package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Fundinouttype;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface FundinouttypeMapper extends CommonBaseMapper<Fundinouttype> {
     int deleteByPrimaryKey(Long ft_id);
@@ -16,4 +20,8 @@ public interface FundinouttypeMapper extends CommonBaseMapper<Fundinouttype> {
     int updateByPrimaryKeySelective(Fundinouttype record);
 
     int updateByPrimaryKey(Fundinouttype record);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

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

@@ -1,10 +1,9 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
-
 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.dto.ProductReserveCostDTO;
 import com.usoftchina.saas.document.entities.Product;
 import org.apache.ibatis.annotations.Param;
 
@@ -12,7 +11,7 @@ import java.util.List;
 
 public interface ProductMapper extends CommonBaseMapper<Product> {
 
-    List<ProductDTO> getProductsByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
+    List<ProductDTO> getProductsByCondition(@Param("con") String con, @Param("companyId") Long companyId);
 
     List<ComboDTO> getProdUnit();
 
@@ -23,4 +22,6 @@ public interface ProductMapper extends CommonBaseMapper<Product> {
     int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
 
     String getCodeById(@Param("id") Long id);
+
+    List<ProductReserveCostDTO> selectReserveCost(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java

@@ -22,4 +22,6 @@ public interface ProductbrandMapper extends CommonBaseMapper<Productbrand> {
     int updateByPrimaryKey(Productbrand record);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 }

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

@@ -1,7 +1,11 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Producttype;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ProducttypeMapper extends CommonBaseMapper<Producttype> {
     int deleteByPrimaryKey(Long id);
@@ -15,4 +19,8 @@ public interface ProducttypeMapper extends CommonBaseMapper<Producttype> {
     int updateByPrimaryKeySelective(Producttype record);
 
     int updateByPrimaryKey(Producttype record);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

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

@@ -1,7 +1,11 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Productunit;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ProductunitMapper extends CommonBaseMapper<Productunit> {
     int deleteByPrimaryKey(Long pu_id);
@@ -15,4 +19,8 @@ public interface ProductunitMapper extends CommonBaseMapper<Productunit> {
     int updateByPrimaryKeySelective(Productunit record);
 
     int updateByPrimaryKey(Productunit record);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorkindMapper.java

@@ -22,4 +22,6 @@ public interface VendorkindMapper extends CommonBaseMapper<Vendorkind> {
     int updateByPrimaryKey(Vendorkind record);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 }

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

@@ -32,4 +32,6 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
     int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
 
     List<Warehouse> selectWarehouseListByCondition(@Param("con") String con,@Param("companyId") Long companyId);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 }

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

@@ -1,11 +1,15 @@
 package com.usoftchina.saas.document.service;
 
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Address;
 import com.usoftchina.saas.document.mapper.AddressMapper;
 
+import java.util.List;
+
 public interface AddressService extends CommonBaseService<AddressMapper, Address>  {
 
     void removeByIds(String ids);
 
+    List<ComboDTO> getCombo();
 }

+ 8 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/BankinformationService.java

@@ -1,8 +1,14 @@
 package com.usoftchina.saas.document.service;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.entities.Bankinformation;
 import com.usoftchina.saas.document.mapper.BankinformationMapper;
+import com.usoftchina.saas.page.PageRequest;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @author heqw
@@ -13,5 +19,7 @@ public interface BankinformationService extends CommonBaseService<Bankinformatio
 
     boolean removeByPrimaryKey(int id);
 
+    PageInfo<Bankinformation> selectList(PageRequest page, ListReqDTO condition);
+
 
 }

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

@@ -11,6 +11,8 @@ import com.usoftchina.saas.document.entities.CustomerList;
 import com.usoftchina.saas.document.mapper.CustomerMapper;
 import com.usoftchina.saas.page.PageRequest;
 
+import java.util.List;
+
 /**
  * Created by zdw
  * 2018-10-23 15:26.
@@ -37,4 +39,6 @@ public interface CustomerService extends CommonBaseService<CustomerMapper, Custo
     void batchClose(BatchDealBaseDTO baseDTOs);
 
     void batchOpen(BatchDealBaseDTO baseDTOs);
+
+    PageInfo<CustomerList> getDbfind(PageRequest page, ListReqDTO listReqDTO);
 }

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerkindService.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service;
 
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 
@@ -8,6 +9,6 @@ import java.util.List;
 
 public interface CustomerkindService extends CommonBaseService<CustomerkindMapper, Customerkind> {
 
-    List<Customerkind> getCombo();
+    List<ComboDTO> getCombo();
 
 }

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/FundinouttypeService.java

@@ -1,9 +1,14 @@
 package com.usoftchina.saas.document.service;
 
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Fundinouttype;
 import com.usoftchina.saas.document.mapper.FundinouttypeMapper;
 
+import java.util.List;
+
 public interface FundinouttypeService extends CommonBaseService<FundinouttypeMapper, Fundinouttype> {
 
+    List<ComboDTO> getCombo();
+
 }

+ 9 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java

@@ -9,6 +9,7 @@ import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
+import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
 
@@ -93,4 +94,12 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
      * @return
      */
     Product getDataById(Long id);
+
+    /**
+     * 物料库存数量金额表
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    PageInfo<ProductReserveCostDTO> getReserveCost(PageRequest page, ListReqDTO listReqDTO);
 }

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProducttypeService.java

@@ -1,9 +1,14 @@
 package com.usoftchina.saas.document.service;
 
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Producttype;
 import com.usoftchina.saas.document.mapper.ProducttypeMapper;
 
+import java.util.List;
+
 public interface ProducttypeService extends CommonBaseService<ProducttypeMapper, Producttype> {
 
+    List<ComboDTO> getCombo();
+
 }

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductunitService.java

@@ -1,9 +1,14 @@
 package com.usoftchina.saas.document.service;
 
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Productunit;
 import com.usoftchina.saas.document.mapper.ProductunitMapper;
 
+import java.util.List;
+
 public interface ProductunitService extends CommonBaseService<ProductunitMapper, Productunit> {
 
+    List<ComboDTO> getCombo();
+
 }

+ 32 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java

@@ -2,14 +2,20 @@ package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Address;
 import com.usoftchina.saas.document.mapper.AddressMapper;
 import com.usoftchina.saas.document.service.AddressService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+import java.util.List;
+
 @Service
 public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Address> implements AddressService {
 
@@ -29,10 +35,18 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
     public boolean save(Address address){
         if(address.getId() == 0){
             address.setCompanyId(BaseContextHolder.getCompanyId());
+            address.setCreateTime(new Date());
+            address.setCreatorId(BaseContextHolder.getUserId());
+            //验证名称是否重复
+            validName(address.getAd_address(), address.getId());
             addressMapper.insertSelective(address);
             //记录LOG
             messageLogService.save(generateMsgObj(address.getId()));
         }else{
+            address.setUpdaterId(BaseContextHolder.getUserId());
+            address.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(address.getAd_address(), address.getId());
             addressMapper.updateByPrimaryKeySelective(address);
             //记录LOG
             messageLogService.update(generateMsgObj(address.getId()));
@@ -65,7 +79,25 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
         }
     }
 
+    @Override
+    public List<ComboDTO> getCombo() {
+       return getMapper().getCombo(BaseContextHolder.getCompanyId());
+    }
+
     private DocBaseDTO generateMsgObj(Long id){
         return new DocBaseDTO(id, "", "Address");
     }
+
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
 }

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

@@ -1,11 +1,19 @@
 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.commons.dto.ListReqDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Bankinformation;
 import com.usoftchina.saas.document.mapper.BankinformationMapper;
 import com.usoftchina.saas.document.service.BankinformationService;
+import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.List;
 
 /**
  * @author heqw
@@ -18,6 +26,7 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
 
     @Override
     public boolean save(Bankinformation bankinformation){
+        bankinformation.setCompanyId(BaseContextHolder.getCompanyId());
         if(bankinformation.getId() == 0){
             bankinformationMapper.insertSelective(bankinformation);
         }else{
@@ -31,4 +40,33 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
         bankinformationMapper.deleteByPrimaryKey(id);
         return true;
     }
+
+    @Override
+    public PageInfo<Bankinformation> selectList(PageRequest page, ListReqDTO condition) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<Bankinformation> recbalancesList = this.getListByMode(condition);
+        //取分页信息
+        PageInfo<Bankinformation> pageInfo = new PageInfo<Bankinformation>(recbalancesList);
+        return pageInfo;
+    }
+
+    private List<Bankinformation> getListByMode(ListReqDTO req) {
+        List<Bankinformation> recbalancesList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        recbalancesList = bankinformationMapper.selectBankinformationBycondition(con, companyId);
+        return recbalancesList;
+    }
 }

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

@@ -101,6 +101,7 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 }
             }
             //记录LOG
+            docBaseDTO = generateMsgObj(bom.getId(), bom.getBo_mothercode());
             messageLogService.update(generateMsgObj(bom.getId(), bom.getBo_mothercode()));
         }
         return docBaseDTO;

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

@@ -30,6 +30,7 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import java.util.ArrayList;
@@ -98,6 +99,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
     }
 
     @Override
+    @Transactional
     public DocBaseDTO saveFormData(CustomerFormDTO data) {
         if (null == data || null == data.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
@@ -154,6 +156,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
                 detail2.setCompanyId(companyId);
                 detail2.setCreatorId(userId);
                 detail2.setCreateTime(new Date());
+                insertDetail2.add(detail2);
             }
             //插入从表
             if (insertDetail2.size()>0) {
@@ -222,6 +225,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         singleDelete(id);
     }
 
+    @Transactional
     private void singleDelete(Long id) {
         if (null!=id) {
             DocBaseDTO docBaseDTO = getBaseDTOById(id);
@@ -248,6 +252,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
     }
 
     @Override
+    @Transactional
     public void deletecontact(Long id) {
         customercontactMapper.deleteByPrimaryKey(id);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
@@ -256,6 +261,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
     }
 
     @Override
+    @Transactional
     public void deleteaddress(Long id) {
         customeraddressMapper.deleteByPrimaryKey(id);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
@@ -263,6 +269,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         messageLogService.deleteDetail(docBaseDTO);
     }
 
+    @Transactional
     private DocBaseDTO singleClose(Long id) {
         DocBaseDTO docBaseDTO = null;
         if (null!=id) {
@@ -297,6 +304,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         }
     }
 
+    @Transactional
     private DocBaseDTO singleOpen(Long id) {
         DocBaseDTO docBaseDTO = null;
         if (null!=id) {
@@ -331,6 +339,22 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         }
     }
 
+    @Override
+    public PageInfo<CustomerList> getDbfind(PageRequest page, ListReqDTO listReqDTO) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //查询数据
+        List<CustomerList> lists = customerListMapper.selectDbFind(listReqDTO.getFinalCondition(), BaseContextHolder.getCompanyId());
+        //取分页信息
+        PageInfo<CustomerList> pageInfo = new PageInfo<CustomerList>(lists);
+        return pageInfo;
+    }
+
 
     private List<CustomerList> getListByMode(ListReqDTO req) {
         List<CustomerList> list = null;

+ 27 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java

@@ -2,14 +2,18 @@ package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 import com.usoftchina.saas.document.service.CustomerkindService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -29,10 +33,18 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     public boolean save(Customerkind customerkind){
         if(customerkind.getId() == 0){
             customerkind.setCompanyId(BaseContextHolder.getCompanyId());
+            customerkind.setCreateTime(new Date());
+            customerkind.setCreatorId(BaseContextHolder.getUserId());
+            //验证名称是否重复
+            validName(customerkind.getCk_name(), customerkind.getId());
             customerkindMapper.insertSelective(customerkind);
             //记录LOG
             messageLogService.save(generateMsgObj(customerkind.getId()));
         }else{
+            customerkind.setUpdaterId(BaseContextHolder.getUserId());
+            customerkind.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(customerkind.getCk_name(), customerkind.getId());
             customerkindMapper.updateByPrimaryKeySelective(customerkind);
             //记录LOG
             messageLogService.update(generateMsgObj(customerkind.getId()));
@@ -64,8 +76,21 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     }
 
     @Override
-    public List<Customerkind> getCombo() {
-        List<Customerkind> customerkindList = getMapper().getCombo();
+    public List<ComboDTO> getCombo() {
+        List<ComboDTO> customerkindList = getMapper().getCombo(BaseContextHolder.getCompanyId());
         return customerkindList;
     }
+
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
 }

+ 31 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java

@@ -2,15 +2,19 @@ package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Fundinouttype;
 import com.usoftchina.saas.document.mapper.FundinouttypeMapper;
 import com.usoftchina.saas.document.service.FundinouttypeService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -28,10 +32,20 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
     public boolean save(Fundinouttype fundinouttype){
         if(fundinouttype.getId() == 0){
             fundinouttype.setCompanyId(BaseContextHolder.getCompanyId());
+            fundinouttype.setCreatorId(BaseContextHolder.getUserId());
+            fundinouttype.setCreateTime(new Date());
+            //验证名称是否重复
+            validName(fundinouttype.getFt_name(), fundinouttype.getId());
+
             getMapper().insertSelective(fundinouttype);
             //记录LOG
             messageLogService.save(generateMsgObj(fundinouttype.getId()));
         }else{
+            fundinouttype.setUpdaterId(BaseContextHolder.getUserId());
+            fundinouttype.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(fundinouttype.getFt_name(), fundinouttype.getId());
+
             getMapper().updateByPrimaryKeySelective(fundinouttype);
             //记录LOG
             messageLogService.update(generateMsgObj(fundinouttype.getId()));
@@ -58,4 +72,21 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
         return new DocBaseDTO(id, null, "FundInOutType");
     }
 
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
+
+    @Override
+    public List<ComboDTO> getCombo() {
+        return getMapper().getCombo(BaseContextHolder.getCompanyId());
+    }
 }

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

@@ -14,6 +14,7 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.ProductDTO;
+import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
 import com.usoftchina.saas.document.service.ProductService;
@@ -180,6 +181,30 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         return getMapper().selectByPrimaryKey(id);
     }
 
+    @Override
+    public PageInfo<ProductReserveCostDTO> getReserveCost(PageRequest page, ListReqDTO listReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<ProductReserveCostDTO> reserveCostList = geReserveCost(listReqDTO);
+        //取分页信息
+        PageInfo<ProductReserveCostDTO> pageInfo = new PageInfo<ProductReserveCostDTO>(reserveCostList);
+        return pageInfo;
+    }
+
+    private List<ProductReserveCostDTO> geReserveCost(ListReqDTO listReqDTO) {
+        Long companyId = BaseContextHolder.getCompanyId();
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        return getMapper().selectReserveCost(condition, companyId);
+    }
+
     private List<ProductDTO> getList(ListReqDTO listReqDTO){
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();

+ 26 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java

@@ -4,13 +4,16 @@ import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Productbrand;
 import com.usoftchina.saas.document.mapper.ProductbrandMapper;
 import com.usoftchina.saas.document.service.ProductbrandService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -27,11 +30,21 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
     public boolean save(Productbrand productbrand){
         productbrand.setCompanyId(BaseContextHolder.getCompanyId());
         if(productbrand.getId() == 0){
+            productbrand.setCompanyId(BaseContextHolder.getCompanyId());
+            productbrand.setCreatorId(BaseContextHolder.getUserId());
+            productbrand.setCreateTime(new Date());
+            //验证名称是否重复
+            validName(productbrand.getPb_name(), productbrand.getId());
+
             productbrandMapper.insertSelective(productbrand);
             //记录日志
             DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
             messageLogService.save(docBaseDTO);
         }else{
+            productbrand.setUpdaterId(BaseContextHolder.getUserId());
+            productbrand.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(productbrand.getPb_name(), productbrand.getId());
             productbrandMapper.updateByPrimaryKeySelective(productbrand);
             //记录日志
             DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
@@ -53,4 +66,17 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
     public List<ComboDTO> getCombo() {
         return getMapper().getCombo(BaseContextHolder.getCompanyId());
     }
+
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
 }

+ 29 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java

@@ -2,14 +2,18 @@ package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Producttype;
 import com.usoftchina.saas.document.mapper.ProducttypeMapper;
 import com.usoftchina.saas.document.service.ProducttypeService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -29,10 +33,18 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
     public boolean save(Producttype producttype){
         if(producttype.getId() == 0){
             producttype.setCompanyId(BaseContextHolder.getCompanyId());
+            producttype.setCreatorId(BaseContextHolder.getUserId());
+            producttype.setCreateTime(new Date());
+            //验证名称是否重复
+            validName(producttype.getPt_name(), producttype.getId());
             producttypeMapper.insertSelective(producttype);
             //记录LOG
             messageLogService.save(generateMsgObj(producttype.getId()));
         }else{
+            producttype.setUpdaterId(BaseContextHolder.getUserId());
+            producttype.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(producttype.getPt_name(), producttype.getId());
             producttypeMapper.updateByPrimaryKeySelective(producttype);
             //记录LOG
             messageLogService.update(generateMsgObj(producttype.getId()));
@@ -64,4 +76,21 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
         return new DocBaseDTO(id, "", "ProductType");
     }
 
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
+
+    @Override
+    public List<ComboDTO> getCombo() {
+        return getMapper().getCombo(BaseContextHolder.getCompanyId());
+    }
 }

+ 30 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java

@@ -2,14 +2,18 @@ package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Productunit;
 import com.usoftchina.saas.document.mapper.ProductunitMapper;
 import com.usoftchina.saas.document.service.ProductunitService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -22,10 +26,19 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
     public boolean save(Productunit productunit){
         if(productunit.getId() == 0){
             productunit.setCompanyId(BaseContextHolder.getCompanyId());
+            productunit.setCreatorId(BaseContextHolder.getUserId());
+            productunit.setCreateTime(new Date());
+            //验证名称是否重复
+            validName(productunit.getPu_name(), productunit.getId());
+
             getMapper().insertSelective(productunit);
             //记录LOG
             messageLogService.save(generateMsgObj(productunit.getId()));
         }else{
+            productunit.setUpdaterId(BaseContextHolder.getUserId());
+            productunit.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(productunit.getPu_name(), productunit.getId());
             getMapper().updateByPrimaryKeySelective(productunit);
             //记录LOG
             messageLogService.update(generateMsgObj(productunit.getId()));
@@ -58,4 +71,21 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
         return new DocBaseDTO(id, "", "ProductUnit");
     }
 
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
+
+    @Override
+    public List<ComboDTO> getCombo() {
+        return getMapper().getCombo(BaseContextHolder.getCompanyId());
+    }
 }

+ 24 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java

@@ -4,13 +4,16 @@ import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Vendorkind;
 import com.usoftchina.saas.document.mapper.VendorkindMapper;
 import com.usoftchina.saas.document.service.VendorkindService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -25,10 +28,18 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
     public boolean save(Vendorkind vendorkind){
         if(vendorkind.getId() == 0){
             vendorkind.setCompanyId(BaseContextHolder.getCompanyId());
+            vendorkind.setCreatorId(BaseContextHolder.getUserId());
+            vendorkind.setCreateTime(new Date());
+            //验证名称是否重复
+            validName(vendorkind.getVk_name(), vendorkind.getId());
             vendorkindMapper.insertSelective(vendorkind);
             //记录LOG
             messageLogService.save(generateMsgObj(vendorkind.getId()));
         }else{
+            vendorkind.setUpdaterId(BaseContextHolder.getUserId());
+            vendorkind.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(vendorkind.getVk_name(), vendorkind.getId());
             vendorkindMapper.updateByPrimaryKeySelective(vendorkind);
             //记录LOG
             messageLogService.update(generateMsgObj(vendorkind.getId()));
@@ -59,4 +70,17 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
     public List<ComboDTO> getCombo() {
         return getMapper().getCombo(BaseContextHolder.getCompanyId());
     }
+
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
 }

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

@@ -107,6 +107,8 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
             record.setCreatorId(BaseContextHolder.getUserId());
             record.setCreateTime(new Date());
 
+            //验证名称是否重复
+            validName(record.getWh_description(), record.getId());
             count = getMapper().insertSelective(record);
             //记录LOG
             docBaseDTO = generateMsgObj(record.getId(), code);
@@ -114,6 +116,8 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         }else{
             record.setUpdateTime(new Date());
             record.setUpdaterId(BaseContextHolder.getUserId());
+            //验证名称是否重复
+            validName(record.getWh_description(), record.getId());
 
             getMapper().updateByPrimaryKeySelective(record);
             //记录LOG
@@ -221,4 +225,17 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
                 getMapper().validateCodeWhenUpdate(code, id, companyId);
         return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.WAREHOUSE.getCaller()).getData();
     }
+
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name, Long id){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
 }

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

@@ -9,7 +9,7 @@ spring:
       password: select111***
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://192.168.253.12:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    url: jdbc:mysql://192.168.253.12:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
     username: root
     password: select111***
     hikari:

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

@@ -25,6 +25,9 @@
   </sql>
 
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Address">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into address (ad_recorddate, companyId,
       updaterId, updateTime, ad_text1, 
       ad_text2, ad_text3, ad_text4, 
@@ -35,6 +38,9 @@
       #{ad_text5,jdbcType=VARCHAR}, #{ad_address,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Address">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into address
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="ad_recorddate != null">
@@ -135,7 +141,7 @@
         ad_address = #{ad_address,jdbcType=LONGVARCHAR},
       </if>
     </set>
-    where ad_id = #{ad_id,jdbcType=INTEGER}
+    where ad_id = #{id}
   </update>
   <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Address">
     update address
@@ -164,7 +170,7 @@
       ad_text5 = #{ad_text5,jdbcType=VARCHAR}
     where ad_id = #{id}
   </update>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from address
     where ad_id = #{id}
   </delete>
@@ -175,4 +181,21 @@
   <select id="selectAll" resultMap="ResultMapWithBLOBs">
     SELECT * FROM ADDRESS
   </select>
+  <select id="selectCountByName" resultType="int">
+    SELECT count(*) FROM ADDRESS
+    <where>
+        <if test="name!=null">
+           and ad_address=#{name}
+        </if>
+        <if test="companyId!=null">
+           and companyId=#{companyId}
+        </if>
+        <if test="id!=null and id!=0">
+            and ad_id!=#{id}
+        </if>
+    </where>
+  </select>
+    <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+        SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}
+    </select>
 </mapper>

+ 14 - 0
applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -320,4 +320,18 @@
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM bankinformation
   </select>
+
+  <select id="selectBankinformationBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from bankinformation
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   bankinformation.companyId = #{companyId}
+      </if>
+    </where>  order by bk_id
+  </select>
 </mapper>

+ 15 - 13
applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml

@@ -26,23 +26,12 @@
     <result column="ca_cuid" jdbcType="INTEGER" property="ca_cuid" />
     <result column="ca_detno" jdbcType="INTEGER" property="ca_detno" />
     <result column="ca_person" jdbcType="VARCHAR" property="ca_person" />
-    <result column="ca_phone" jdbcType="INTEGER" property="ca_phone" />
+    <result column="ca_phone" jdbcType="VARCHAR" property="ca_phone" />
     <result column="ca_default" jdbcType="INTEGER" property="ca_default" />
     <result column="cc_cuid" jdbcType="INTEGER" property="cc_cuid" />
     <result column="cc_detno" jdbcType="INTEGER" property="cc_detno" />
     <result column="cc_name" jdbcType="VARCHAR" property="cc_name" />
-    <result column="cc_tel" jdbcType="INTEGER" property="cc_tel" />
-    <result column="cc_qq" jdbcType="VARCHAR" property="cc_qq" />
-    <result column="cc_email" jdbcType="VARCHAR" property="cc_email" />
-    <result column="ca_cuid" jdbcType="INTEGER" property="ca_cuid" />
-    <result column="ca_detno" jdbcType="INTEGER" property="ca_detno" />
-    <result column="ca_person" jdbcType="VARCHAR" property="ca_person" />
-    <result column="ca_phone" jdbcType="INTEGER" property="ca_phone" />
-    <result column="ca_default" jdbcType="INTEGER" property="ca_default" />
-    <result column="cc_cuid" jdbcType="INTEGER" property="cc_cuid" />
-    <result column="cc_detno" jdbcType="INTEGER" property="cc_detno" />
-    <result column="cc_name" jdbcType="VARCHAR" property="cc_name" />
-    <result column="cc_tel" jdbcType="INTEGER" property="cc_tel" />
+    <result column="cc_tel" jdbcType="VARCHAR" property="cc_tel" />
     <result column="cc_qq" jdbcType="VARCHAR" property="cc_qq" />
     <result column="cc_email" jdbcType="VARCHAR" property="cc_email" />
     <result column="cc_default" jdbcType="INTEGER" property="cc_default" />
@@ -63,6 +52,19 @@
     </where>  order by cu_id
   </select>
 
+  <select id="selectDbFind" resultMap="BaseResultMap">
+    SELECT * FROM CUSTOMER LEFT JOIN CUSTOMERADDRESS ON CU_ID=CA_CUID AND CUSTOMERADDRESS.CA_DEFAULT=1
+    <where>
+      <if test="condition != null">
+        ${condition}
+      </if>
+      <if test="companyId!=null">
+        and customer.companyid = #{companyId}
+      </if>
+    </where>
+    order by cu_id
+  </select>
+
   <select id="selectCustomerBycondition"  resultMap="BaseResultMap">
     select  *  from customer
     <where>

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

@@ -6,7 +6,7 @@
     <result column="ca_cuid" jdbcType="INTEGER" property="ca_cuid" />
     <result column="ca_detno" jdbcType="INTEGER" property="ca_detno" />
     <result column="ca_person" jdbcType="VARCHAR" property="ca_person" />
-    <result column="ca_phone" jdbcType="INTEGER" property="ca_phone" />
+    <result column="ca_phone" jdbcType="VARCHAR" property="ca_phone" />
     <result column="ca_default" jdbcType="INTEGER" property="ca_default" />
     <result column="companyid" jdbcType="INTEGER" property="companyId" />
     <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
@@ -99,7 +99,7 @@
         #{ca_person,jdbcType=VARCHAR},
       </if>
       <if test="ca_phone != null">
-        #{ca_phone,jdbcType=INTEGER},
+        #{ca_phone,jdbcType=VARCHAR},
       </if>
       <if test="ca_default != null">
         #{ca_default,jdbcType=INTEGER},
@@ -146,7 +146,7 @@
         ca_person = #{ca_person,jdbcType=VARCHAR},
       </if>
       <if test="ca_phone != null">
-        ca_phone = #{ca_phone,jdbcType=INTEGER},
+        ca_phone = #{ca_phone,jdbcType=VARCHAR},
       </if>
       <if test="ca_default != null">
         ca_default = #{ca_default,jdbcType=INTEGER},
@@ -186,7 +186,7 @@
     set ca_cuid = #{ca_cuid,jdbcType=INTEGER},
       ca_detno = #{ca_detno,jdbcType=INTEGER},
       ca_person = #{ca_person,jdbcType=VARCHAR},
-      ca_phone = #{ca_phone,jdbcType=INTEGER},
+      ca_phone = #{ca_phone,jdbcType=VARCHAR},
       ca_default = #{ca_default,jdbcType=INTEGER},
       companyid = #{companyId,jdbcType=INTEGER},
       updaterid = #{updaterId,jdbcType=INTEGER},
@@ -222,7 +222,7 @@
       #{item.ca_detno,jdbcType=INTEGER},
       #{item.ca_person,jdbcType=VARCHAR},
       #{item.ca_address,jdbcType=LONGVARCHAR},
-      #{item.ca_phone,jdbcType=INTEGER},
+      #{item.ca_phone,jdbcType=VARCHAR},
       #{item.ca_default,jdbcType=INTEGER},
       #{item.companyId,jdbcType=INTEGER},
       #{item.updaterId,jdbcType=INTEGER},
@@ -247,7 +247,7 @@
           ca_person = #{item.ca_person,jdbcType=VARCHAR},
         </if>
         <if test="item.ca_phone != null">
-          ca_phone = #{item.ca_phone,jdbcType=INTEGER},
+          ca_phone = #{item.ca_phone,jdbcType=VARCHAR},
         </if>
         <if test="item.ca_default != null">
           ca_default = #{item.ca_default,jdbcType=INTEGER},

+ 108 - 5
applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml

@@ -6,7 +6,7 @@
     <result column="cc_cuid" jdbcType="INTEGER" property="cc_cuid" />
     <result column="cc_detno" jdbcType="INTEGER" property="cc_detno" />
     <result column="cc_name" jdbcType="VARCHAR" property="cc_name" />
-    <result column="cc_tel" jdbcType="INTEGER" property="cc_tel" />
+    <result column="cc_tel" jdbcType="VARCHAR" property="cc_tel" />
     <result column="cc_qq" jdbcType="VARCHAR" property="cc_qq" />
     <result column="cc_email" jdbcType="VARCHAR" property="cc_email" />
     <result column="companyid" jdbcType="INTEGER" property="companyId" />
@@ -98,7 +98,7 @@
         #{cc_name,jdbcType=VARCHAR},
       </if>
       <if test="cc_tel != null">
-        #{cc_tel,jdbcType=INTEGER},
+        #{cc_tel,jdbcType=VARCHAR},
       </if>
       <if test="cc_qq != null">
         #{cc_qq,jdbcType=VARCHAR},
@@ -150,7 +150,7 @@
         cc_name = #{cc_name,jdbcType=VARCHAR},
       </if>
       <if test="cc_tel != null">
-        cc_tel = #{cc_tel,jdbcType=INTEGER},
+        cc_tel = #{cc_tel,jdbcType=VARCHAR},
       </if>
       <if test="cc_qq != null">
         cc_qq = #{cc_qq,jdbcType=VARCHAR},
@@ -208,7 +208,7 @@
           #{item.cc_cuid,jdbcType=INTEGER},
           #{item.cc_detno,jdbcType=INTEGER},
           #{item.cc_name,jdbcType=VARCHAR},
-          #{item.cc_tel,jdbcType=INTEGER},
+          #{item.cc_tel,jdbcType=VARCHAR},
           #{item.cc_qq,jdbcType=VARCHAR},
           #{item.cc_email,jdbcType=VARCHAR},
           #{item.companyId,jdbcType=INTEGER},
@@ -224,6 +224,109 @@
     </foreach>
   </insert>
 
+  <insert id="batchInsert1" parameterType="java.util.List" >
+    <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+      insert into customercontact
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+
+        <if test="item.cc_cuid != null">
+          cc_cuid,
+        </if>
+        <if test="item.cc_detno != null">
+          cc_detno,
+        </if>
+        <if test="item.cc_name != null">
+          cc_name,
+        </if>
+        <if test="item.cc_tel != null">
+          cc_tel,
+        </if>
+        <if test="item.cc_qq != null">
+          cc_qq,
+        </if>
+        <if test="item.cc_email != null">
+          cc_email,
+        </if>
+        <if test="item.companyId != null">
+          companyid,
+        </if>
+        <if test="item.updaterId != null">
+          updaterid,
+        </if>
+        <if test="item.updateTime != null">
+          updatetime,
+        </if>
+        <if test="item.cc_text1 != null">
+          cc_text1,
+        </if>
+        <if test="item.cc_text2 != null">
+          cc_text2,
+        </if>
+        <if test="item.cc_text3 != null">
+          cc_text3,
+        </if>
+        <if test="item.cc_text4 != null">
+          cc_text4,
+        </if>
+        <if test="item.cc_text5 != null">
+          cc_text5,
+        </if>
+        <if test="item.cc_default != null">
+          cc_default,
+        </if>
+      </trim>
+      <trim prefix="values (" suffix=")" suffixOverrides=",">
+
+        <if test="item.cc_cuid != null">
+          #{item.cc_cuid,jdbcType=INTEGER},
+        </if>
+        <if test="item.cc_detno != null">
+          #{item.cc_detno,jdbcType=INTEGER},
+        </if>
+        <if test="item.cc_name != null">
+          #{item.cc_name,jdbcType=VARCHAR},
+        </if>
+        <if test="item.cc_tel != null">
+          #{item.cc_tel,jdbcType=VARCHAR},
+        </if>
+        <if test="item.cc_qq != null">
+          #{item.cc_qq,jdbcType=VARCHAR},
+        </if>
+        <if test="item.cc_email != null">
+          #{item.cc_email,jdbcType=VARCHAR},
+        </if>
+        <if test="item.companyId != null">
+          #{item.companyId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updaterId != null">
+          #{item.updaterId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updateTime != null">
+          #{item.updateTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="item.cc_text1 != null">
+          #{item.cc_text1,jdbcType=VARCHAR},
+        </if>
+        <if test="item.cc_text2 != null">
+          #{item.cc_text2,jdbcType=VARCHAR},
+        </if>
+        <if test="item.cc_text3 != null">
+          #{item.cc_text3,jdbcType=VARCHAR},
+        </if>
+        <if test="item.cc_text4 != null">
+          #{item.cc_text4,jdbcType=VARCHAR},
+        </if>
+        <if test="item.cc_text5 != null">
+          #{item.cc_text5,jdbcType=VARCHAR},
+        </if>
+        <if test="item.c_default != null">
+          #{item.cc_default,jdbcType=INTEGER},
+        </if>
+      </trim>
+    </foreach>
+  </insert>
+
+
 
   <update id="batchUpdate" parameterType="com.usoftchina.saas.document.entities.Customercontact" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
@@ -239,7 +342,7 @@
           cc_name = #{item.cc_name,jdbcType=VARCHAR},
         </if>
         <if test="item.cc_tel != null">
-          cc_tel = #{item.cc_tel,jdbcType=INTEGER},
+          cc_tel = #{item.cc_tel,jdbcType=VARCHAR},
         </if>
         <if test="item.cc_qq != null">
           cc_qq = #{item.cc_qq,jdbcType=VARCHAR},

+ 17 - 3
applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml

@@ -11,7 +11,7 @@
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
   </resultMap>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
     <include refid="Base_Column_List" />
     from customerkind
@@ -20,7 +20,7 @@
   <sql id="Base_Column_List" >
     ck_id, ck_name, ck_recordid, ck_recorder, ck_date, companyId, updaterId, updateTime
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from customerkind
     where ck_id = #{id}
   </delete>
@@ -123,6 +123,20 @@
     SELECT * FROM CUSTOMERKIND
   </select>
   <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
-    SELECT ck_name display,ck_name value FROM CUSTOMERKIND
+    SELECT ck_name display,ck_name value FROM CUSTOMERKIND WHERE COMPANYID=#{companyId}
   </select>
+    <select id="selectCountByName" resultType="int">
+        SELECT count(*) FROM CUSTOMERKIND
+        <where>
+            <if test="name!=null">
+                and CK_NAME=#{name}
+            </if>
+            <if test="companyId!=0 and companyId!=null">
+                and companyId=#{companyId}
+            </if>
+            <if test="id!=0 and id != null">
+                and ck_id != #{id}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 26 - 3
applications/document/document-server/src/main/resources/mapper/FundinouttypeMapper.xml

@@ -20,13 +20,16 @@
     select 
     <include refid="Base_Column_List" />
     from fundinouttype
-    where ft_id = #{id,jdbcType=INTEGER}
+    where ft_id = #{id}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from fundinouttype
-    where ft_id = #{id,jdbcType=INTEGER}
+    where ft_id = #{id}
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Fundinouttype" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into fundinouttype (ft_name, ft_kind,
       ft_recordid, ft_recorder, ft_date, 
       companyId, updaterId, updateTime
@@ -37,6 +40,9 @@
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Fundinouttype" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into fundinouttype
     <trim prefix="(" suffix=")" suffixOverrides="," >
       <if test="ft_name != null" >
@@ -131,9 +137,26 @@
       companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updateTime = #{updateTime,jdbcType=TIMESTAMP}
-    where ft_id = #{id,jdbcType=INTEGER}
+    where ft_id = #{id}
   </update>
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM FUNDINOUTTYPE
   </select>
+  <select id="selectCountByName" resultType="int">
+    SELECT COUNT(*) FROM FUNDINOUTTYPE
+    <where>
+        <if test="name!=null">
+            and FT_NAME=#{name}
+        </if>
+        <if test="companyId!=null and companyId!=0">
+            and COMPANYID=#{companyId}
+        </if>
+        <if test="id!=0 and id!=null">
+            and ft_id != #{id}
+        </if>
+    </where>
+  </select>
+    <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+        SELECT FT_NAME display,FT_NAME value FROM FUNDINOUTTYPE
+    </select>
 </mapper>

+ 48 - 3
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -41,17 +41,32 @@
         <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_whid" property="pr_whid" jdbcType="INTEGER" />
+        <result column="pr_whcode" property="pr_whcode" jdbcType="VARCHAR" />
+        <result column="pr_whname" property="pr_whname" jdbcType="VARCHAR" />
+        <!--productonhand-->
+        <result column="po_onhand" property="po_onhand" jdbcType="INTEGER" />
+        <!--productonhand-->
+        <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR" />
         <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
         <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+        <result column="pr_vendname" property="pr_vendname" jdbcType="VARCHAR" />
+        <result column="pr_zxbzs" property="pr_zxbzs" jdbcType="VARCHAR" />
+        <result column="pr_leadtime" property="pr_leadtime" jdbcType="INTEGER" />
         <result column="pr_status" property="pr_status" jdbcType="VARCHAR" />
         <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR" />
     </resultMap>
+
+
     <!--查询所有物料信息-->
     <select id="getProductsByCondition" resultMap="ProductDTOResultMapper" parameterType="com.usoftchina.saas.commons.dto.DocReqDTO">
-        SELECT * FROM PRODUCT
+        SELECT * FROM PRODUCT left join productonhand on pr_id = po_prodid
         <where>
-            <if test="condition!=null">
-                ${condition}
+            <if test="con != null">
+                ${con}
+            </if>
+            <if test="companyId != null">
+                and  PRODUCT.companyid = #{companyId}
             </if>
         </where>
     </select>
@@ -94,6 +109,9 @@
         where pr_id = #{id}
     </delete>
     <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Product" >
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
         insert into product (pr_code, pr_detail,
         pr_spec, pr_unit, pr_kind,
         pr_orispeccode, pr_whid, pr_whcode,
@@ -118,6 +136,9 @@
         #{pr_text4,jdbcType=VARCHAR}, #{pr_text5,jdbcType=VARCHAR})
     </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Product" >
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
         insert into product
         <trim prefix="(" suffix=")" suffixOverrides="," >
             <if test="pr_code != null" >
@@ -444,5 +465,29 @@
         pr_text5 = #{pr_text5,jdbcType=VARCHAR}
         where pr_id = #{id}
     </update>
+
+    <resultMap id="ProdReserveCostResultMap" type="com.usoftchina.saas.document.dto.ProductReserveCostDTO">
+        <result column="pr_code" property="rc_prodCode" jdbcType="VARCHAR" />
+        <result column="pr_spec" property="rc_prodSpec" jdbcType="VARCHAR" />
+        <result column="pr_detail" property="rc_prodDetail" jdbcType="VARCHAR" />
+        <result column="pr_unit" property="rc_prodUnit" jdbcType="VARCHAR" />
+        <result column="wh_code" property="rc_whCode" jdbcType="VARCHAR" />
+        <result column="wh_name" property="rc_whName" jdbcType="VARCHAR" />
+        <result column="pw_onhand" property="rc_number" jdbcType="DOUBLE" />
+        <result column="pw_avprice" property="rc_price" jdbcType="DOUBLE" />
+        <result column="pw_amount" property="rc_amount" jdbcType="DOUBLE" />
+    </resultMap>
+    <select id="selectReserveCost" resultMap="ProdReserveCostResultMap">
+        select * from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whcode=wh_code
+        <where>
+          <if test="con!=null">
+              ${con}
+          </if>
+          <if test="companyId!=null">
+              and tab.companyId=#{companyId} and Product.companyId=#{companyId} and warehouse.companyId=#{companyId}
+          </if>
+        </where>
+        ORDER BY PR_ID DESC
+    </select>
 </mapper>
 

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

@@ -11,7 +11,7 @@
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
   </resultMap>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
     *
     from productbrand
@@ -20,11 +20,14 @@
   <sql id="Base_Column_List" >
     pb_id, pb_name, pb_recordid, pb_recorder, pb_date, companyId, updaterId, updateTime
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from productbrand
     where pb_id = #{id}
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Productbrand" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into productbrand (pb_name, pb_recordid,
       pb_recorder, pb_date, companyId, 
       updaterId, updateTime)
@@ -33,6 +36,9 @@
       #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Productbrand" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into productbrand
     <trim prefix="(" suffix=")" suffixOverrides="," >
       <if test="pb_name != null" >
@@ -126,4 +132,18 @@
   <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
     SELECT PB_NAME display,PB_NAME value FROM PRODUCTBRAND
   </select>
+  <select id="selectCountByName" resultType="int">
+    SELECT COUNT(*) FROM PRODUCTBRAND
+    <where>
+        <if test="name!=null">
+            and PB_NAME=#{name}
+        </if>
+        <if test="companyId!=null and companyId!=0">
+            and  COMPANYID=#{companyId}
+        </if>
+        <if test="id!=0 and id!=null">
+            and pb_id!=#{id}
+        </if>
+    </where>
+  </select>
 </mapper>

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

@@ -14,17 +14,20 @@
   <sql id="Base_Column_List">
     pt_id, pt_name, pt_recordid, pt_recorder, pt_date, companyId, updaterId, updateTime
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
     from producttype
     where pt_id = #{id}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from producttype
     where pt_id = #{id}
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Producttype">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into producttype (pt_name, pt_recordid,
       pt_recorder, pt_date, companyId, 
       updaterId, updateTime)
@@ -33,6 +36,9 @@
       #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Producttype">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into producttype
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="pt_name != null">
@@ -122,4 +128,21 @@
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM PRODUCTTYPE
   </select>
+    <select id="selectCountByName" resultType="int">
+        SELECT COUNT(*) FROM PRODUCTTYPE
+         <where>
+             <if test="name!=null">
+                 and PT_NAME=#{name}
+             </if>
+             <if test="companyId!=null and companyId!=0">
+                 and COMPANYID=#{companyId}
+             </if>
+             <if test="id != null and id != 0">
+                 and pt_id != #{id}
+             </if>
+         </where>
+    </select>
+    <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+        SELECT PT_NAME display,PT_NAME value FROM PRODUCTTYPE WHERE COMPANYID=#{companyId}
+    </select>
 </mapper>

+ 17 - 0
applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml

@@ -122,4 +122,21 @@
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM PRODUCTUNIT
   </select>
+    <select id="selectCountByName" resultType="int">
+        SELECT COUNT(*) FROM productunit
+        <where>
+            <if test="name!=null">
+                and PU_NAME=#{name}
+            </if>
+            <if test="companyId!=0 and companyId!=null">
+                and COMPANYID=#{companyId}
+            </if>
+            <if test="id!=0 and id!=null">
+                and pu_id != #{id}
+            </if>
+        </where>
+    </select>
+    <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+        SELECT PU_NAME display,PU_NAME value FROM PRODUCTUNIT WHERE COMPANYID=#{companyId}
+    </select>
 </mapper>

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

@@ -51,7 +51,7 @@
       vc_text3, vc_text4, vc_text5, vc_default
       )
     values (#{vc_veid}, #{vc_detno,jdbcType=INTEGER},
-      #{vc_name,jdbcType=VARCHAR}, #{vc_tel,jdbcType=INTEGER}, #{vc_qq,jdbcType=VARCHAR}, 
+      #{vc_name,jdbcType=VARCHAR}, #{vc_tel,jdbcType=VARCHAR}, #{vc_qq,jdbcType=VARCHAR},
       #{vc_email,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
       #{updateTime,jdbcType=TIMESTAMP}, #{vc_text1,jdbcType=VARCHAR}, #{vc_text2,jdbcType=VARCHAR}, 
       #{vc_text3,jdbcType=VARCHAR}, #{vc_text4,jdbcType=VARCHAR}, #{vc_text5,jdbcType=VARCHAR},
@@ -118,7 +118,7 @@
         #{vc_name,jdbcType=VARCHAR},
       </if>
       <if test="vc_tel != null" >
-        #{vc_tel,jdbcType=INTEGER},
+        #{vc_tel,jdbcType=VARCHAR},
       </if>
       <if test="vc_qq != null" >
         #{vc_qq,jdbcType=VARCHAR},
@@ -168,7 +168,7 @@
         vc_name = #{vc_name,jdbcType=VARCHAR},
       </if>
       <if test="vc_tel != null" >
-        vc_tel = #{vc_tel,jdbcType=INTEGER},
+        vc_tel = #{vc_tel,jdbcType=VARCHAR},
       </if>
       <if test="vc_qq != null" >
         vc_qq = #{vc_qq,jdbcType=VARCHAR},
@@ -211,7 +211,7 @@
     set vc_veid = #{vc_veid},
       vc_detno = #{vc_detno,jdbcType=INTEGER},
       vc_name = #{vc_name,jdbcType=VARCHAR},
-      vc_tel = #{vc_tel,jdbcType=INTEGER},
+      vc_tel = #{vc_tel,jdbcType=VARCHAR},
       vc_qq = #{vc_qq,jdbcType=VARCHAR},
       vc_email = #{vc_email,jdbcType=VARCHAR},
       companyId = #{companyId,jdbcType=INTEGER},
@@ -236,7 +236,7 @@
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
       #{item.vc_veid}, #{item.vc_detno,jdbcType=INTEGER},
-      #{item.vc_name,jdbcType=VARCHAR}, #{item.vc_tel,jdbcType=INTEGER}, #{item.vc_qq,jdbcType=VARCHAR},
+      #{item.vc_name,jdbcType=VARCHAR}, #{item.vc_tel,jdbcType=VARCHAR}, #{item.vc_qq,jdbcType=VARCHAR},
       #{item.vc_email,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
       #{item.updateTime,jdbcType=TIMESTAMP}, #{item.vc_text1,jdbcType=VARCHAR}, #{item.vc_text2,jdbcType=VARCHAR},
       #{item.vc_text3,jdbcType=VARCHAR}, #{item.vc_text4,jdbcType=VARCHAR}, #{item.vc_text5,jdbcType=VARCHAR},
@@ -255,7 +255,7 @@
           vc_name = #{item.vc_name,jdbcType=VARCHAR},
         </if>
         <if test="item.vc_tel != null" >
-          vc_tel = #{item.vc_tel,jdbcType=INTEGER},
+          vc_tel = #{item.vc_tel,jdbcType=VARCHAR},
         </if>
         <if test="item.vc_qq != null" >
           vc_qq = #{item.vc_qq,jdbcType=VARCHAR},

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

@@ -14,13 +14,13 @@
   <sql id="Base_Column_List">
     vk_id, vk_name, vk_recordid, vk_recorder, vk_date, companyId, updaterId, updateTime
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select
     <include refid="Base_Column_List" />
     from vendorkind
     where vk_id = #{id}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from vendorkind
     where vk_id = #{id}
   </delete>
@@ -131,4 +131,18 @@
   <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
     SELECT VK_NAME display, VK_NAME value FROM VENDORKIND WHERE COMPANYID=#{companyId}
   </select>
+  <select id="selectCountByName" resultType="int">
+    SELECT COUNT(*) FROM VENDORKIND
+    <where>
+        <if test="name!=null">
+            and VK_NAME=#{name}
+        </if>
+        <if test="companyId!=0 and companyId!=null">
+            and COMPANYID=#{companyId}
+        </if>
+        <if test="id!=0 and id!=null">
+            and vk_id != #{id}
+        </if>
+    </where>
+  </select>
 </mapper>

+ 14 - 0
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -329,6 +329,20 @@
         order by wh_id
     </select>
 
+    <select id="selectCountByName" resultType="int">
+        SELECT COUNT(*) FROM warehouse
+        <where>
+            <if test="name!=null">
+                and wh_description=#{name}
+            </if>
+            <if test="companyId!=0 and companyId!=null">
+                and COMPANYID=#{companyId}
+            </if>
+            <if test="id!=0 and id!=null">
+                and wh_id!=#{id}
+            </if>
+        </where>
+    </select>
 
 </mapper>
 

+ 3 - 3
applications/document/document-server/src/test/java/com/usoftchina/saas/document/mapper/CustomercontactMapperTest.java

@@ -51,13 +51,13 @@ public class CustomercontactMapperTest {
         customercontact.setCc_cuid(new Long(1));
         customercontact.setCc_detno(1);
         customercontact.setCc_name("zdw");
-        customercontact.setCc_tel(1881);
+        customercontact.setCc_tel("1881");
 
         Customercontact customercontact1 = new Customercontact();
         customercontact1.setCc_cuid(new Long(1));
         customercontact1.setCc_detno(1);
         customercontact1.setCc_name("zdw");
-        customercontact1.setCc_tel(1881);
+        customercontact1.setCc_tel("1881");
 
         insertDetail1.add(customercontact);
         insertDetail1.add(customercontact1);
@@ -71,7 +71,7 @@ public class CustomercontactMapperTest {
         customercontact.setCc_cuid(new Long(1));
         customercontact.setCc_detno(1);
         customercontact.setCc_name("ssszdw");
-        customercontact.setCc_tel(1881);
+        customercontact.setCc_tel("1881");
         customercontact.setCc_qq("qq");
         customercontact.setCc_email("@qq");
         customercontact.setCompanyId(1);

+ 1 - 1
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/CustomerServiceTest.java

@@ -44,7 +44,7 @@ public class CustomerServiceTest {
         CustomercontactDTO item = new CustomercontactDTO();
         item.setCc_name("联系人1");
         item.setCc_detno(1);
-        item.setCc_tel(112);
+        item.setCc_tel("");
         item.setCc_qq("396996717");
         item.setCc_email("@qq.com");
 

部分文件因文件數量過多而無法顯示