Browse Source

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

jinsy 7 years ago
parent
commit
c78fc805f0
100 changed files with 1251 additions and 1337 deletions
  1. 1 0
      README.md
  2. 4 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  3. 3 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java
  4. 2 2
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  5. 0 6
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/ProdInOut.java
  6. 0 18
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Warehouse.java
  7. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  8. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  9. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  10. 10 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  11. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  12. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  13. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/EmployeeServiceImpl.java
  14. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java
  15. 21 6
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  16. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  17. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java
  18. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java
  19. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  20. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  21. 6 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  22. 21 2
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  23. 22 2
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  24. 23 3
      applications/document/document-server/src/main/resources/mapper/BanksubledgerMapper.xml
  25. 26 4
      applications/document/document-server/src/main/resources/mapper/BomDetailMapper.xml
  26. 17 9
      applications/document/document-server/src/main/resources/mapper/BomMapper.xml
  27. 3 1
      applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml
  28. 18 0
      applications/document/document-server/src/main/resources/mapper/CustomerMapper.xml
  29. 22 2
      applications/document/document-server/src/main/resources/mapper/CustomeraddressMapper.xml
  30. 40 4
      applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml
  31. 22 2
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  32. 18 0
      applications/document/document-server/src/main/resources/mapper/EmployeeMapper.xml
  33. 22 2
      applications/document/document-server/src/main/resources/mapper/FundinouttypeMapper.xml
  34. 8 4
      applications/document/document-server/src/main/resources/mapper/ProductDetailMapper.xml
  35. 313 291
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  36. 22 2
      applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml
  37. 22 2
      applications/document/document-server/src/main/resources/mapper/ProducttypeMapper.xml
  38. 18 0
      applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml
  39. 22 2
      applications/document/document-server/src/main/resources/mapper/SubledgerMapper.xml
  40. 22 2
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  41. 26 4
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml
  42. 22 2
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  43. 28 29
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  44. 0 30
      applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationDTO.java
  45. 0 6
      applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationListDTO.java
  46. 4 0
      applications/money/money-server/pom.xml
  47. 7 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/FundtransferMapper.java
  48. 5 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthreceiptsMapper.java
  49. 5 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthspendingsMapper.java
  50. 5 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalanceMapper.java
  51. 5 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalanceMapper.java
  52. 0 190
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/PaybalanceExample.java
  53. 0 190
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/RecbalanceExample.java
  54. 0 30
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verification.java
  55. 0 190
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VerificationExample.java
  56. 0 6
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VerificationList.java
  57. 23 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  58. 11 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  59. 12 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  60. 22 34
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  61. 15 11
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  62. 0 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  63. 28 0
      applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml
  64. 16 3
      applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml
  65. 15 4
      applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml
  66. 15 3
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  67. 15 3
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  68. 0 3
      applications/money/money-server/src/main/resources/mapper/VerificationListMapper.xml
  69. 2 50
      applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml
  70. 13 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  71. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  72. 0 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/report/PurchasePay.java
  73. 4 6
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  74. 1 1
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml
  75. 3 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  76. 0 6
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutDTO.java
  77. 0 6
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutListDTO.java
  78. 0 6
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java
  79. 0 6
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java
  80. 0 6
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  81. 3 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  82. 2 3
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  83. 3 42
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml
  84. 0 3
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  85. 3 38
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  86. 4 2
      applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml
  87. 2 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java
  88. 13 4
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java
  89. 0 1
      applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml
  90. 1 1
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutListMapper.xml
  91. 1 1
      applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml
  92. 112 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountAddDTO.java
  93. 17 18
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/AccountController.java
  94. 9 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/AccountMapper.java
  95. 1 1
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/AccountRoleMapper.java
  96. 9 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/AccountService.java
  97. 6 1
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/AccountServiceImpl.java
  98. 2 1
      base-servers/account/account-server/src/main/resources/application.yml
  99. 4 0
      base-servers/account/account-server/src/main/resources/mapper/AccountMapper.xml
  100. 2 2
      base-servers/account/account-server/src/main/resources/mapper/AccountRoleMapper.xml

+ 1 - 0
README.md

@@ -160,6 +160,7 @@
 | --------   | :----:  | :----: | :------:  | :------:  |
 | 10.10.100.103 |  centos  | mykey.key |  CentOS6, RabbitMQ  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.123 |  centos  | mykey.key |  CentOS6, MongoDB  | Cpu: 8, Mem: 8G, Disk: 60G |
+| 10.10.100.127 |  centos  | mykey.key |  CentOS6, Nginx  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.160 |  centos  | mykey.key |  CentOS6, ELK  | Cpu: 8, Mem: 8G, Disk: 60G |
 | 10.10.100.173 |  centos  | mykey.key |  CentOS6, Redis  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.23 |  root  | 62cddbcc624b1b072d84117cc0e5a4db |  CentOS7, Docker  | Cpu: 40, Mem: 128G, Disk: 800G |

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

@@ -86,8 +86,11 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BANK_AMOUNT_NOTENOUGH(74004, "资金账号不足"),
     SUBLEDGER_NOT_EXIS(74005,"来源单据不存在"),
     CHECK_SETACOUNT_EXIS(74006, "不能删除单据日期小于等于结账期间<u>%s</u>的单据"),
-    VERIFICATION_CHECK_BALANCE(74007,"核销金额不能大于未核销金额"),
+    VERIFICATION_CHECK_BALANCE(74007,"保存失败,本次核销金额不相等!"),
     DELETE_NOT_EXIS(74008,"删除失败,当前单据不存在!"),
+    DOCUMENTS_AUDITED(74009,"存在已审核单据:%S"),
+    DOCUMENTS_UNAUDITED(74010,"存在未审核单据:%S"),
+    BANK_AMOUNT_NOTENOUGHS(74011, "资金账号不足:%S"),
 
 
 

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

@@ -40,7 +40,7 @@ public enum  BillCodeSeq {
 
     RECBALANCE("收款单", "RecBalance"),
 
-    VERIFICATION("核单", "Verification"),
+    VERIFICATION("核单", "Verification"),
 
     OTHRECEIPTS("其它收入单","OthReceipts"),
 
@@ -50,6 +50,8 @@ public enum  BillCodeSeq {
 
     BOM("BOM资料", "Bom");
 
+
+
     BillCodeSeq(String name, String caller) {
         this.name = name;
         this.caller = caller;

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

@@ -17,7 +17,7 @@
       (
 	  select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from (
 		(select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='PURC')a,
-        (select sum(si_amount) five_sum from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='PURC' ORDER BY si_amount desc limit 0,5) b)
+        (select sum(si_amount) five_sum from (select si_amount from  statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='PURC' ORDER BY si_amount desc limit 0,5)e) b)
 	  ) b1
     </select>
 
@@ -72,7 +72,7 @@
     ) c)d,(
 
     select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
-    (select sum(si_amount) five_sum from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)b))e)
+    ( select sum(si_amount) five_sum from (select si_amount from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)f)b))e)
     </select>
 
     <select id="getSaleFutureData" parameterType="long" resultType="string">

+ 0 - 6
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/ProdInOut.java

@@ -37,12 +37,6 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
 
     private Double pi_total;
 
-    private Long pi_recordmanid;
-
-    private String pi_recordman;
-
-    private Date pi_recorddate;
-
     private String pi_status;
 
     private String pi_statuscode;

+ 0 - 18
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Warehouse.java

@@ -17,8 +17,6 @@ public class Warehouse extends CommonBaseEntity implements Serializable {
     private String wh_description;
     private String wh_statuscode;
     private String wh_status;
-    private long wh_recorderid;
-    private String wh_recorder;
     /**
      * 录入日期
      */
@@ -69,22 +67,6 @@ public class Warehouse extends CommonBaseEntity implements Serializable {
         this.wh_status = wh_status;
     }
 
-    public long getWh_recorderid() {
-        return wh_recorderid;
-    }
-
-    public void setWh_recorderid(long wh_recorderid) {
-        this.wh_recorderid = wh_recorderid;
-    }
-
-    public String getWh_recorder() {
-        return wh_recorder;
-    }
-
-    public void setWh_recorder(String wh_recorder) {
-        this.wh_recorder = wh_recorder;
-    }
-
     public Date getWh_date() {
         return wh_date;
     }

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

@@ -43,4 +43,5 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
 
     int selectCountByCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("id") Long id);
 
+    int deleteCheckProdIO(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -38,6 +38,7 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
             address.setCompanyId(BaseContextHolder.getCompanyId());
             address.setCreateTime(new Date());
             address.setCreatorId(BaseContextHolder.getUserId());
+            address.setCreatorName(BaseContextHolder.getUserName());
             //验证名称是否重复
             validName(address.getAd_address(), address.getId());
             addressMapper.insertSelective(address);

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

@@ -47,6 +47,9 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
         bankinformation.setCompanyId(BaseContextHolder.getCompanyId());
         bankinformation.setBk_income(new Double(0));
         bankinformation.setBk_spending(new Double(0));
+        bankinformation.setCreateTime(new Date());
+        bankinformation.setCreatorId(BaseContextHolder.getUserId());
+        bankinformation.setCreatorName(BaseContextHolder.getUserName());
         int bid = Math.toIntExact(bankinformation.getId());
 
         String bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode());
@@ -59,6 +62,9 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
             bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
             bankinformationMapper.insertSelective(bankinformation);
         }else {
+            bankinformation.setUpdaterId(BaseContextHolder.getUserId());
+            bankinformation.setUpdaterName(BaseContextHolder.getUserName());
+            bankinformation.setUpdateTime(new Date());
             //判断是否能修改期初金额
             Double beginamount = bankinformationMapper.selectamount(bankinformation.getId());
             Double fbeginamount = bankinformation.getBk_beginamount();

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

@@ -57,6 +57,9 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 String code = bom.getBo_mothercode();
                 bom.setBo_mothercode(code);
                 bom.setCompanyId(companyId);
+                bom.setCreatorId(userId);
+                bom.setCreatorName(userName);
+                bom.setCreateTime(new Date());
                 //保存BOM
                 getMapper().insertSelective(bom);
                 id = bom.getId();
@@ -67,8 +70,9 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                     for (BomDetail bomDetail : bomDetailList) {
                         bomDetail.setBd_bomid(bom.getId());
                         bomDetail.setCompanyId(companyId);
-                        bomDetail.setCreatorId(BaseContextHolder.getUserId());
+                        bomDetail.setCreatorId(userId);
                         bomDetail.setCreateTime(new Date());
+                        bomDetail.setCreatorName(userName);
                     }
                     bomDetailMapper.batchInsert(bomDetailList);
                 }
@@ -92,13 +96,15 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 for(BomDetail bomDetail : bomDetailList){
                     if (bomDetail.getId() == 0){
                         bomDetail.setCreateTime(new Date());
-                        bomDetail.setCompanyId(BaseContextHolder.getCompanyId());
-                        bomDetail.setCreatorId(BaseContextHolder.getUserId());
+                        bomDetail.setCompanyId(companyId);
+                        bomDetail.setCreatorId(userId);
+                        bomDetail.setCreatorName(userName);
                         bomDetail.setBd_bomid(bom.getId());
                         insertItems.add(bomDetail);
                     }else{
-                        bomDetail.setUpdaterId(BaseContextHolder.getUserId());
+                        bomDetail.setUpdaterId(companyId);
                         bomDetail.setUpdateTime(new Date());
+                        bomDetail.setUpdaterName(userName);
                         updateItems.add(bomDetail);
                     }
                 }

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

@@ -108,6 +108,8 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         Long companyId = BaseContextHolder.getCompanyId();
         //人员Id
         Long userId = BaseContextHolder.getUserId();
+        //人员名
+        String userName = BaseContextHolder.getUserName();
         //获取主表信息
         CustomerDTO main = data.getMain();
         //更新从表数据
@@ -127,6 +129,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         customer.setCompanyId(companyId);
         customer.setCreatorId(userId);
         customer.setCreateTime(new Date());
+        customer.setCreatorName(userName);
         //应付款余额
         Double beginapamount = main.getCu_beginaramount()==null?new Double(0):main.getCu_beginaramount();
         Double beginprepayamount = main.getCu_beginprerecamount()==null?new Double(0):main.getCu_beginprerecamount();
@@ -170,6 +173,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
                 detail1.setCompanyId(companyId);
                 detail1.setCreatorId(userId);
                 detail1.setCreateTime(new Date());
+                detail1.setCreatorName(userName);
                 insertDetail1.add(detail1);
             }
             //插入从表
@@ -183,6 +187,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
                 detail2.setCompanyId(companyId);
                 detail2.setCreatorId(userId);
                 detail2.setCreateTime(new Date());
+                detail2.setCreatorName(userName);
                 insertDetail2.add(detail2);
             }
             //插入从表

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

@@ -35,6 +35,7 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
             customerkind.setCompanyId(BaseContextHolder.getCompanyId());
             customerkind.setCreateTime(new Date());
             customerkind.setCreatorId(BaseContextHolder.getUserId());
+            customerkind.setCreatorName(BaseContextHolder.getUserName());
             //验证名称是否重复
             validName(customerkind.getCk_name(), customerkind.getId());
             customerkindMapper.insertSelective(customerkind);

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

@@ -70,6 +70,7 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
             employee.setCompanyId(BaseContextHolder.getCompanyId());
             employee.setCreatorId(BaseContextHolder.getUserId());
             employee.setCreateTime(new Date());
+            employee.setCreatorName(BaseContextHolder.getUserName());
             //检查电话号码
             int count = getMapper().validatePhoneWhenInsert(employee.getEm_mobile(),BaseContextHolder.getCompanyId());
             if (count>0) {

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

@@ -41,6 +41,7 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
             fundinouttype.setCompanyId(BaseContextHolder.getCompanyId());
             fundinouttype.setCreatorId(BaseContextHolder.getUserId());
             fundinouttype.setCreateTime(new Date());
+            fundinouttype.setCreatorName(BaseContextHolder.getUserName());
             //验证名称是否重复
             validName(fundinouttype.getFt_name(), fundinouttype.getId());
 

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

@@ -86,7 +86,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         DocBaseDTO docBaseDTO = null;
         Long companyId = BaseContextHolder.getCompanyId();
         Long userId = BaseContextHolder.getUserId();
-
+        String userName = BaseContextHolder.getUserName();
         //校验明细仓库是否重复
         validRepeatWarehouse(productDetailList);
 
@@ -98,6 +98,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             product.setCompanyId(companyId);
             product.setCreatorId(userId);
             product.setCreateTime(new Date());
+            product.setCreatorName(userName);
             product.setPr_code(code);
             //保存主表
             getMapper().insertSelective(product);
@@ -106,6 +107,9 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
                 for (ProductDetail productDetail : productDetailList){
                     productDetail.setPd_prodid(product.getId());
                     productDetail.setCompanyId(companyId);
+                    productDetail.setCreatorId(userId);
+                    productDetail.setCreatorName(userName);
+                    productDetail.setCreateTime(new Date());
                 }
 
                 productDetailMapper.batchInsert(productDetailList);
@@ -141,12 +145,18 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
                 for(ProductDetail productDetail : productDetailList){
                     if (productDetail.getId() == 0){
                         productDetail.setPd_prodid(product.getId());
+                        productDetail.setCompanyId(companyId);
+                        productDetail.setCreatorId(userId);
+                        productDetail.setCreateTime(new Date());
+                        productDetail.setCreatorName(userName);
                         productDetail.setUpdaterId(userId);
                         productDetail.setUpdateTime(new Date());
+                        productDetail.setUpdaterName(userName);
                         insertItems.add(productDetail);
                     }else{
                         productDetail.setUpdaterId(userId);
                         productDetail.setUpdateTime(new Date());
+                        productDetail.setUpdaterName(userName);
                         updateItems.add(productDetail);
                     }
                 }
@@ -214,6 +224,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     private void generateProdIOPost(Product product, List<ProductDetail> productDetailList) {
         Long companyId = BaseContextHolder.getCompanyId();
         Long userId = BaseContextHolder.getUserId();
+        String userName = BaseContextHolder.getUserName();
         //1.有明细数据变更
         if (productDetailList.size() > 0){
             //生成库存初始化单据主表
@@ -223,14 +234,14 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             prodInOut.setPi_class("库存初始化");
             prodInOut.setPi_date(new Date());
             //prodInOut.setPi_total();            //含税金额
-            prodInOut.setPi_recordman("");
-            prodInOut.setPi_recordmanid(userId);
-            prodInOut.setPi_recorddate(new Date());
             prodInOut.setPi_status(Status.UNAUDITED.getDisplay());
             prodInOut.setPi_statuscode(Status.UNAUDITED.name());
             prodInOut.setPi_text1(product.getPr_code());
             prodInOut.setCompanyId(companyId);
-
+            //创建时间创建人
+            prodInOut.setCreatorId(userId);
+            prodInOut.setCreatorName(userName);
+            prodInOut.setCreateTime(new Date());
             //主表插入
             getMapper().saveProdInOut(prodInOut);
             Long pi_id = prodInOut.getId();
@@ -294,6 +305,9 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         prodIODetail.setPd_whname(productDetail.getPd_whname());    //仓库名称
         prodIODetail.setPd_status(0);                               //状态
         prodIODetail.setCompanyId(BaseContextHolder.getCompanyId());//公司ID
+        prodIODetail.setCreatorId(BaseContextHolder.getUserId());
+        prodIODetail.setCreatorName(BaseContextHolder.getUserName());
+        prodIODetail.setCreateTime(new Date());
         return prodIODetail;
     }
 
@@ -448,9 +462,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     }
 
     @Override
+    @Transactional
     public boolean batchDelete(BatchDealBaseDTO baseDTOs) {
         for(DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
-            getMapper().deleteByPrimaryKey(docBaseDTO.getId());
+            deleteByPrimaryKey(docBaseDTO.getId());
         }
         return true;
     }

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

@@ -34,6 +34,7 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
             productbrand.setCompanyId(BaseContextHolder.getCompanyId());
             productbrand.setCreatorId(BaseContextHolder.getUserId());
             productbrand.setCreateTime(new Date());
+            productbrand.setCreatorName(BaseContextHolder.getUserName());
             //验证名称是否重复
             validName(productbrand.getPb_name(), productbrand.getId());
 

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

@@ -37,6 +37,7 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
             producttype.setCompanyId(BaseContextHolder.getCompanyId());
             producttype.setCreatorId(BaseContextHolder.getUserId());
             producttype.setCreateTime(new Date());
+            producttype.setCreatorName(BaseContextHolder.getUserName());
             //验证名称是否重复
             validName(producttype.getPt_name(), producttype.getId());
             producttypeMapper.insertSelective(producttype);

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

@@ -29,6 +29,7 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
             productunit.setCompanyId(BaseContextHolder.getCompanyId());
             productunit.setCreatorId(BaseContextHolder.getUserId());
             productunit.setCreateTime(new Date());
+            productunit.setCreatorName(BaseContextHolder.getUserName());
             //验证名称是否重复
             validName(productunit.getPu_name(), productunit.getId());
 

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

@@ -112,6 +112,8 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
     @Transactional
     public DocBaseDTO saveFormData(VendorListDTO vendorListDTO) {
         Long companyId = BaseContextHolder.getCompanyId();
+        String userName= BaseContextHolder.getUserName();
+        Long userId = BaseContextHolder.getUserId();
         if (null == vendorListDTO || null == vendorListDTO.getMain()){
             throw new BizException(BizExceptionCode.EMPTY_DATA);
         }
@@ -154,6 +156,8 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             Double payamount = main.getVe_payamount()==null? new Double(0):main.getVe_payamount();
             Double preamount = main.getVe_preamount()==null? new Double(0):main.getVe_preamount();
             main.setVe_leftamount(beginapamount-beginprepayamount+payamount-preamount);
+            //更新录入人录入时间ID
+            main.setCreatorId(BaseContextHolder.getUserId());
             getMapper().insertSelective(main);
             Long mainId = main.getId();
             //更新明细表vc_veid
@@ -162,6 +166,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
                 item.setCompanyId(BaseContextHolder.getCompanyId());
                 item.setCreatorId(BaseContextHolder.getUserId());
                 item.setCreateTime(new Date());
+
             }
             //保存明细表信息
             if (items.size() > 0){

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

@@ -32,6 +32,7 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
             vendorkind.setCompanyId(BaseContextHolder.getCompanyId());
             vendorkind.setCreatorId(BaseContextHolder.getUserId());
             vendorkind.setCreateTime(new Date());
+            vendorkind.setCreatorName(BaseContextHolder.getUserName());
             //验证名称是否重复
             validName(vendorkind.getVk_name(), vendorkind.getId());
             vendorkindMapper.insertSelective(vendorkind);

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

@@ -114,7 +114,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
             record.setCompanyId(BaseContextHolder.getCompanyId());
             record.setCreatorId(BaseContextHolder.getUserId());
             record.setCreateTime(new Date());
-
+            record.setCreatorName(BaseContextHolder.getUserName());
             //验证名称是否重复
             validName(record.getWh_description(), record.getId());
             //验证编号是否重复
@@ -244,6 +244,11 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         if (num > 0) {
             throw new BizException(BizExceptionCode.PRODUCTWH_HAS_WAREHOUSE);
         }
+        //校验出入库单据
+        num = warehouseMapper.deleteCheckProdIO(id, companyId);
+        if (num > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
         singleDelete(id);
     }
 

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

@@ -30,11 +30,13 @@
     insert into address ( companyId,
       updaterId, updateTime, ad_text1, 
       ad_text2, ad_text3, ad_text4, 
-      ad_text5, ad_address)
+      ad_text5, ad_address,
+    creatorId,createTime,creatorName)
     values (#{companyId,jdbcType=INTEGER},
       #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{ad_text1,jdbcType=VARCHAR}, 
       #{ad_text2,jdbcType=VARCHAR}, #{ad_text3,jdbcType=VARCHAR}, #{ad_text4,jdbcType=VARCHAR}, 
-      #{ad_text5,jdbcType=VARCHAR}, #{ad_address,jdbcType=LONGVARCHAR})
+      #{ad_text5,jdbcType=VARCHAR}, #{ad_address,jdbcType=LONGVARCHAR},
+    #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Address">
     <selectKey resultType="java.lang.Long" keyProperty="id">
@@ -69,6 +71,15 @@
       <if test="ad_address != null">
         ad_address,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="companyId != null">
@@ -97,6 +108,14 @@
       </if>
       <if test="ad_address != null">
         #{ad_address,jdbcType=LONGVARCHAR},
+      </if><if test="creatorId != null" >
+      #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>

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

@@ -54,14 +54,16 @@
       bk_ym, companyid, updaterId, 
       updateTime, bk_text1, bk_text2, 
       bk_text3, bk_text4, bk_text5, 
-      bk_remark)
+      bk_remark,
+      creatorId,createTime,creatorName)
     values (#{bk_bankcode,jdbcType=VARCHAR}, #{bk_bankname,jdbcType=VARCHAR},
       #{bk_date,jdbcType=TIMESTAMP}, #{bk_type,jdbcType=VARCHAR}, #{bk_beginamount,jdbcType=DOUBLE},
       #{bk_thisamount,jdbcType=DOUBLE}, #{bk_status,jdbcType=VARCHAR}, #{bk_statuscode,jdbcType=VARCHAR},
       #{bk_ym,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
       #{updateTime,jdbcType=TIMESTAMP}, #{bk_text1,jdbcType=VARCHAR}, #{bk_text2,jdbcType=VARCHAR},
       #{bk_text3,jdbcType=VARCHAR}, #{bk_text4,jdbcType=VARCHAR}, #{bk_text5,jdbcType=VARCHAR},
-      #{bk_remark,jdbcType=LONGVARCHAR})
+      #{bk_remark,jdbcType=LONGVARCHAR},
+     #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
     insert into bankinformation
@@ -126,6 +128,15 @@
       <if test="bk_income != null" >
         bk_income,
       </if>
+      <if test="creatorId != null" >
+      creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="bk_bankcode != null" >
@@ -188,6 +199,15 @@
       <if test="bk_income != null" >
         #{bk_income,jdbcType=DOUBLE},
       </if>
+      <if test="creatorId != null" >
+      #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >

+ 23 - 3
applications/document/document-server/src/main/resources/mapper/BanksubledgerMapper.xml

@@ -19,7 +19,7 @@
         <result column="bl_remark" jdbcType="VARCHAR" property="bl_remark" />
         <result column="companyId" jdbcType="INTEGER" property="companyId" />
         <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
-        <result column="updatedate" jdbcType="TIMESTAMP" property="updatedate" />
+        <result column="updatedate" jdbcType="TIMESTAMP" property="updateTime" />
         <result column="bl_orderamount" property="bl_orderamount" jdbcType="DOUBLE" />
         <result column="bl_assid" property="bl_assid" jdbcType="INTEGER" />
         <result column="bl_item" property="bl_item" jdbcType="VARCHAR" />
@@ -110,14 +110,16 @@
       bl_kind, bl_date, bl_asstype, 
       bl_asscode, bl_assname, bl_income, 
       bl_spending, bl_manname, bl_remark, 
-      companyId, updaterId, updatedate
+      companyId, updaterId, updatedate,
+      creatorId,createTime,creatorName
       )
     values (#{bl_id,jdbcType=INTEGER}, #{bl_ym,jdbcType=INTEGER}, #{bl_bankid,jdbcType=INTEGER}, 
       #{bl_bankcode,jdbcType=VARCHAR}, #{bl_bankname,jdbcType=VARCHAR}, #{bl_code,jdbcType=VARCHAR}, 
       #{bl_kind,jdbcType=VARCHAR}, #{bl_date,jdbcType=TIMESTAMP}, #{bl_asstype,jdbcType=VARCHAR}, 
       #{bl_asscode,jdbcType=VARCHAR}, #{bl_assname,jdbcType=VARCHAR}, #{bl_income,jdbcType=DOUBLE}, 
       #{bl_spending,jdbcType=DOUBLE}, #{bl_manname,jdbcType=VARCHAR}, #{bl_remark,jdbcType=VARCHAR}, 
-      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP},
+      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
       )
   </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Banksubledger">
@@ -183,6 +185,15 @@
             <if test="bl_item != null" >
                 bl_item,
             </if>
+            <if test="creatorId != null" >
+                creatorId,
+            </if>
+            <if test="createTime != null" >
+                createTime,
+            </if>
+            <if test="creatorName != null" >
+                creatorName,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="bl_ym != null">
@@ -245,6 +256,15 @@
             <if test="bl_item != null" >
                 #{bl_item,jdbcType=VARCHAR},
             </if>
+            <if test="creatorId != null" >
+                #{creatorId,jdbcType=INTEGER},
+            </if>
+            <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="creatorName != null" >
+                #{creatorName,jdbcType=VARCHAR},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Banksubledger">

+ 26 - 4
applications/document/document-server/src/main/resources/mapper/BomDetailMapper.xml

@@ -69,13 +69,15 @@
       bd_baseqty, bd_replace, bd_remark, 
       companyId, updaterId, updateTime, 
       bd_text1, bd_text2, bd_text3, 
-      bd_text4, bd_text5)
+      bd_text4, bd_text5,
+      creatorId,createTime,creatorName)
     values ( #{bd_bomid,jdbcType=INTEGER}, #{bd_detno,jdbcType=INTEGER},
       #{bd_sonid,jdbcType=INTEGER}, #{bd_soncode,jdbcType=VARCHAR}, #{bd_unit,jdbcType=VARCHAR}, 
       #{bd_baseqty,jdbcType=INTEGER}, #{bd_replace,jdbcType=VARCHAR}, #{bd_remark,jdbcType=VARCHAR}, 
       #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{bd_text1,jdbcType=VARCHAR}, #{bd_text2,jdbcType=VARCHAR}, #{bd_text3,jdbcType=VARCHAR}, 
-      #{bd_text4,jdbcType=VARCHAR}, #{bd_text5,jdbcType=VARCHAR})
+      #{bd_text4,jdbcType=VARCHAR}, #{bd_text5,jdbcType=VARCHAR},
+      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
     insert into bomdetail
@@ -128,6 +130,15 @@
       <if test="bd_text5 != null" >
         bd_text5,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="bd_bomid != null" >
@@ -178,6 +189,15 @@
       <if test="bd_text5 != null" >
         #{bd_text5,jdbcType=VARCHAR},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
@@ -260,7 +280,8 @@
     bd_baseqty, bd_replace, bd_remark,
     companyId, updaterId, updateTime,
     bd_text1, bd_text2, bd_text3,
-    bd_text4, bd_text5)
+    bd_text4, bd_text5,
+    creatorId,createTime,creatorName)
     values
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
@@ -269,7 +290,8 @@
       #{item.bd_baseqty,jdbcType=INTEGER}, #{item.bd_replace,jdbcType=VARCHAR}, #{item.bd_remark,jdbcType=VARCHAR},
       #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
       #{item.bd_text1,jdbcType=VARCHAR}, #{item.bd_text2,jdbcType=VARCHAR}, #{item.bd_text3,jdbcType=VARCHAR},
-      #{item.bd_text4,jdbcType=VARCHAR}, #{item.bd_text5,jdbcType=VARCHAR}
+      #{item.bd_text4,jdbcType=VARCHAR}, #{item.bd_text5,jdbcType=VARCHAR},
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

+ 17 - 9
applications/document/document-server/src/main/resources/mapper/BomMapper.xml

@@ -16,9 +16,6 @@
     <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
     <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
-
-
-
     <result column="bo_text1" property="bo_text1" jdbcType="VARCHAR" />
     <result column="bo_text2" property="bo_text2" jdbcType="VARCHAR" />
     <result column="bo_text3" property="bo_text3" jdbcType="VARCHAR" />
@@ -52,13 +49,15 @@
       bo_mothername, bo_version, bo_status, 
       bo_statuscode, companyId, updaterId,
       updateTime, bo_text1, bo_text2, 
-      bo_text3, bo_text4, bo_text5
+      bo_text3, bo_text4, bo_text5,
+      creatorId,createTime,creatorName
       )
     values (#{bo_motherid,jdbcType=INTEGER}, #{bo_mothercode,jdbcType=VARCHAR},
       #{bo_mothername,jdbcType=VARCHAR}, #{bo_version,jdbcType=VARCHAR}, #{bo_status,jdbcType=VARCHAR}, 
       #{bo_statuscode,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
       #{updateTime,jdbcType=TIMESTAMP}, #{bo_text1,jdbcType=VARCHAR}, #{bo_text2,jdbcType=VARCHAR}, 
-      #{bo_text3,jdbcType=VARCHAR}, #{bo_text4,jdbcType=VARCHAR}, #{bo_text5,jdbcType=VARCHAR}
+      #{bo_text3,jdbcType=VARCHAR}, #{bo_text4,jdbcType=VARCHAR}, #{bo_text5,jdbcType=VARCHAR},
+      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Bom" >
@@ -109,12 +108,15 @@
       <if test="bo_text5 != null" >
         bo_text5,
       </if>
-      <if test="bo_text5 != null" >
-        bo_text5,
-      </if>
       <if test="createTime != null" >
         createTime,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="bo_motherid != null" >
@@ -160,7 +162,13 @@
         #{bo_text5,jdbcType=VARCHAR},
       </if>
       <if test="createTime != null" >
-        #{createTime,jdbcType=TIMESTAMP}
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR}
       </if>
     </trim>
   </insert>

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

@@ -33,7 +33,9 @@
     <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" />
-
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+    <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
   </resultMap>
 
 

+ 18 - 0
applications/document/document-server/src/main/resources/mapper/CustomerMapper.xml

@@ -132,6 +132,15 @@
       <if test="cu_preamount != null">
         cu_preamount,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -213,6 +222,15 @@
       <if test="cu_preamount != null">
         #{cu_preamount,jdbcType=DOUBLE},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Customer">

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

@@ -86,6 +86,15 @@
       <if test="ca_address != null">
         ca_address,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -131,6 +140,15 @@
       <if test="ca_address != null">
         #{ca_address,jdbcType=LONGVARCHAR},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Customeraddress">
@@ -215,7 +233,8 @@
     insert into customeraddress
     (ca_cuid,ca_detno,ca_person,ca_address,ca_phone,
     ca_default,companyid,updaterid,updatetime,ca_text1,
-    ca_text2,ca_text3,ca_text4,ca_text5) VALUES
+    ca_text2,ca_text3,ca_text4,ca_text5,
+    creatorId,createTime,creatorName) VALUES
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
       #{item.ca_cuid,jdbcType=INTEGER},
@@ -231,7 +250,8 @@
       #{item.ca_text2,jdbcType=VARCHAR},
       #{item.ca_text3,jdbcType=VARCHAR},
       #{item.ca_text4,jdbcType=VARCHAR},
-      #{item.ca_text5,jdbcType=VARCHAR}
+      #{item.ca_text5,jdbcType=VARCHAR},
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
        )
     </foreach>
   </insert>

+ 40 - 4
applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml

@@ -85,6 +85,15 @@
       <if test="cc_default != null">
         cc_default,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -133,8 +142,15 @@
       <if test="cc_default != null">
         #{cc_default,jdbcType=INTEGER},
       </if>
-
-
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Customercontact">
@@ -200,7 +216,8 @@
     cc_name, cc_tel, cc_qq,
     cc_email, companyid, updaterid,
     updatetime, cc_text1, cc_text2,
-    cc_text3, cc_text4, cc_text5,cc_default
+    cc_text3, cc_text4, cc_text5,cc_default,
+    creatorId,createTime,creatorName
     )
     values
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
@@ -219,7 +236,8 @@
           #{item.cc_text3,jdbcType=VARCHAR},
           #{item.cc_text4,jdbcType=VARCHAR},
           #{item.cc_text5,jdbcType=VARCHAR},
-          #{item.cc_default,jdbcType=INTEGER}
+          #{item.cc_default,jdbcType=INTEGER},
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>
@@ -274,6 +292,15 @@
         <if test="item.cc_default != null">
           cc_default,
         </if>
+        <if test="creatorId != null" >
+          creatorId,
+        </if>
+        <if test="createTime != null" >
+          createTime,
+        </if>
+        <if test="creatorName != null" >
+          creatorName,
+        </if>
       </trim>
       <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -322,6 +349,15 @@
         <if test="item.c_default != null">
           #{item.cc_default,jdbcType=INTEGER},
         </if>
+        <if test="creatorId != null" >
+          #{creatorId,jdbcType=INTEGER},
+        </if>
+        <if test="createTime != null" >
+          #{createTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="creatorName != null" >
+          #{creatorName,jdbcType=VARCHAR},
+        </if>
       </trim>
     </foreach>
   </insert>

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

@@ -23,9 +23,11 @@
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Customerkind" >
     insert into customerkind (ck_name, companyId,
-      updaterId, updateTime)
+      updaterId, updateTime,
+    creatorId,createTime,creatorName)
     values (#{ck_name,jdbcType=VARCHAR},#{companyId,jdbcType=INTEGER},
-      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
+    #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Customerkind" >
     insert into customerkind
@@ -42,6 +44,15 @@
       <if test="updateTime != null" >
         updateTime,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="ck_name != null" >
@@ -56,6 +67,15 @@
       <if test="updateTime != null" >
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Customerkind" >

+ 18 - 0
applications/document/document-server/src/main/resources/mapper/EmployeeMapper.xml

@@ -92,6 +92,15 @@
       <if test="em_text5 != null">
         em_text5,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -137,6 +146,15 @@
       <if test="em_text5 != null">
         #{em_text5,jdbcType=VARCHAR},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Employee">

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

@@ -28,10 +28,12 @@
       SELECT LAST_INSERT_ID() AS ID
     </selectKey>
     insert into fundinouttype (ft_name, ft_kind,
-      companyId, updaterId, updateTime
+      companyId, updaterId, updateTime,
+    creatorId,createTime,creatorName
       )
     values (#{ft_name,jdbcType=VARCHAR}, #{ft_kind,jdbcType=VARCHAR},
-      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
+      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Fundinouttype" >
@@ -55,6 +57,15 @@
       <if test="updateTime != null" >
         updateTime,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="ft_name != null" >
@@ -72,6 +83,15 @@
       <if test="updateTime != null" >
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Fundinouttype" >

+ 8 - 4
applications/document/document-server/src/main/resources/mapper/ProductDetailMapper.xml

@@ -45,14 +45,16 @@
       pd_whid, pd_price, pd_amount, 
       companyId, updaterId, updateTime, 
       pd_text1, pd_text2, pd_text3, 
-      pd_text4, pd_text5, pd_num
+      pd_text4, pd_text5, pd_num,
+      creatorId,createTime,creatorName
       )
     values ( #{pd_prodid,jdbcType=INTEGER}, #{pd_prodcode,jdbcType=VARCHAR},
       #{pd_detno,jdbcType=INTEGER}, #{pd_whcode,jdbcType=VARCHAR}, #{pd_whname,jdbcType=VARCHAR}, 
       #{pd_whid,jdbcType=INTEGER}, #{pd_price,jdbcType=DOUBLE}, #{pd_amount,jdbcType=DOUBLE}, 
       #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{pd_text1,jdbcType=VARCHAR}, #{pd_text2,jdbcType=VARCHAR}, #{pd_text3,jdbcType=VARCHAR}, 
-      #{pd_text4,jdbcType=VARCHAR}, #{pd_text5,jdbcType=VARCHAR}, #{pd_num,jdbcType=DOUBLE}
+      #{pd_text4,jdbcType=VARCHAR}, #{pd_text5,jdbcType=VARCHAR}, #{pd_num,jdbcType=DOUBLE},
+      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.ProductDetail" >
@@ -251,7 +253,8 @@
         pd_whid, pd_price, pd_amount,
         companyId, updaterId, updateTime,
         pd_text1, pd_text2, pd_text3,
-        pd_text4, pd_text5, pd_num
+        pd_text4, pd_text5, pd_num,
+        creatorId,createTime,creatorName
         )
         VALUES
         <foreach collection="list" item="item" index="index" open="" close="" separator=",">
@@ -260,7 +263,8 @@
             #{item.pd_whid,jdbcType=INTEGER}, #{item.pd_price,jdbcType=DOUBLE}, #{item.pd_amount,jdbcType=DOUBLE},
             #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
             #{item.pd_text1,jdbcType=VARCHAR}, #{item.pd_text2,jdbcType=VARCHAR}, #{item.pd_text3,jdbcType=VARCHAR},
-            #{item.pd_text4,jdbcType=VARCHAR}, #{item.pd_text5,jdbcType=VARCHAR}, #{item.pd_num,jdbcType=DOUBLE}
+            #{item.pd_text4,jdbcType=VARCHAR}, #{item.pd_text5,jdbcType=VARCHAR}, #{item.pd_num,jdbcType=DOUBLE},
+            #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
             )
         </foreach>
     </insert>

+ 313 - 291
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -2,69 +2,70 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.usoftchina.saas.document.mapper.ProductMapper">
     <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Product">
-        <id column="pr_id" property="id" jdbcType="INTEGER" />
-        <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
-        <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
-        <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
-        <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR" />
-        <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR" />
-        <result column="pr_orispeccode" property="pr_orispeccode" 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" />
-        <result column="pr_zxbzs" property="pr_zxbzs" jdbcType="INTEGER" />
-        <result column="pr_leadtime" property="pr_leadtime" jdbcType="INTEGER" />
-        <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
-        <result column="pr_standardprice" property="pr_standardprice" jdbcType="DOUBLE" />
-        <result column="pr_purcprice" property="pr_purcprice" jdbcType="DOUBLE" />
-        <result column="pr_saleprice" property="pr_saleprice" jdbcType="DOUBLE" />
-        <result column="pr_vendid" property="pr_vendid" jdbcType="INTEGER" />
-        <result column="pr_vendcode" property="pr_vendcode" jdbcType="VARCHAR" />
-        <result column="pr_vendname" property="pr_vendname" jdbcType="VARCHAR" />
-        <result column="pr_status" property="pr_status" jdbcType="VARCHAR" />
-        <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR" />
-        <result column="companyId" property="companyId" jdbcType="INTEGER" />
-        <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
-        <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
-        <result column="pr_text1" property="pr_text1" jdbcType="VARCHAR" />
-        <result column="pr_text2" property="pr_text2" jdbcType="VARCHAR" />
-        <result column="pr_text3" property="pr_text3" jdbcType="VARCHAR" />
-        <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR" />
-        <result column="pr_text5" property="pr_text5" jdbcType="VARCHAR" />
+        <id column="pr_id" property="id" jdbcType="INTEGER"/>
+        <result column="pr_code" property="pr_code" jdbcType="VARCHAR"/>
+        <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR"/>
+        <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR"/>
+        <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR"/>
+        <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR"/>
+        <result column="pr_orispeccode" property="pr_orispeccode" 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"/>
+        <result column="pr_zxbzs" property="pr_zxbzs" jdbcType="INTEGER"/>
+        <result column="pr_leadtime" property="pr_leadtime" jdbcType="INTEGER"/>
+        <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR"/>
+        <result column="pr_standardprice" property="pr_standardprice" jdbcType="DOUBLE"/>
+        <result column="pr_purcprice" property="pr_purcprice" jdbcType="DOUBLE"/>
+        <result column="pr_saleprice" property="pr_saleprice" jdbcType="DOUBLE"/>
+        <result column="pr_vendid" property="pr_vendid" jdbcType="INTEGER"/>
+        <result column="pr_vendcode" property="pr_vendcode" jdbcType="VARCHAR"/>
+        <result column="pr_vendname" property="pr_vendname" jdbcType="VARCHAR"/>
+        <result column="pr_status" property="pr_status" jdbcType="VARCHAR"/>
+        <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR"/>
+        <result column="companyId" property="companyId" jdbcType="INTEGER"/>
+        <result column="updaterId" property="updaterId" jdbcType="INTEGER"/>
+        <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP"/>
+        <result column="pr_text1" property="pr_text1" jdbcType="VARCHAR"/>
+        <result column="pr_text2" property="pr_text2" jdbcType="VARCHAR"/>
+        <result column="pr_text3" property="pr_text3" jdbcType="VARCHAR"/>
+        <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR"/>
+        <result column="pr_text5" property="pr_text5" jdbcType="VARCHAR"/>
     </resultMap>
     <resultMap id="ProductDTOResultMapper" type="com.usoftchina.saas.document.dto.ProductDTO">
-        <id column="pr_id" property="id" jdbcType="INTEGER" />
-        <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
-        <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
-        <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
-        <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR" />
-        <result column="pr_whid" property="pr_whid" jdbcType="INTEGER" />
-        <result column="pr_whcode" property="pr_whcode" jdbcType="VARCHAR" />
-        <result column="pr_whname" property="pr_whname" jdbcType="VARCHAR" />
+        <id column="pr_id" property="id" jdbcType="INTEGER"/>
+        <result column="pr_code" property="pr_code" jdbcType="VARCHAR"/>
+        <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR"/>
+        <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR"/>
+        <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR"/>
+        <result column="pr_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="DOUBLE" />
+        <result column="po_onhand" property="po_onhand" jdbcType="DOUBLE"/>
         <!--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" />
+        <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 id="getProductsByCondition" resultMap="ProductDTOResultMapper"
+            parameterType="com.usoftchina.saas.commons.dto.DocReqDTO">
         SELECT * FROM PRODUCT left join productonhand on pr_id = po_prodid
-        and  PRODUCT.companyid =  productonhand.companyid
+        and PRODUCT.companyid = productonhand.companyid
         <where>
             <if test="con != null">
                 ${con}
             </if>
             <if test="companyId != null">
-                and  PRODUCT.companyid = #{companyId}
+                and PRODUCT.companyid = #{companyId}
             </if>
         </where>
         ORDER BY PR_ID DESC
@@ -83,31 +84,31 @@
     <select id="validateCodeWhenInsert" resultType="int">
         select count(*) from PRODUCT where PR_CODE = #{code} and companyId =#{companyId}
     </select>
-    <select id="validateCodeWhenUpdate" resultType="int" >
+    <select id="validateCodeWhenUpdate" resultType="int">
         select count(*) from PRODUCT where PR_CODE = #{code} and PR_ID != #{id} and companyId =#{companyId}
     </select>
     <select id="getCodeById" resultType="string">
         SELECT PR_CODE FROM PRODUCT WHERE PR_ID=#{id}
     </select>
 
-    <sql id="Base_Column_List" >
+    <sql id="Base_Column_List">
         pr_id, pr_code, pr_detail, pr_spec, pr_unit, pr_kind, pr_orispeccode, pr_whid, pr_whcode,
         pr_whname, pr_zxbzs, pr_leadtime, pr_brand, pr_standardprice, pr_purcprice, pr_saleprice,
         pr_vendid, pr_vendcode, pr_vendname, pr_status,
         pr_statuscode, companyId, updaterId, updateTime, pr_text1, pr_text2, pr_text3,
         pr_text4, pr_text5
     </sql>
-    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
         select
-        <include refid="Base_Column_List" />
+        <include refid="Base_Column_List"/>
         from product
         where pr_id = #{id}
     </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from product
         where pr_id = #{id}
     </delete>
-    <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Product" >
+    <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Product">
         <selectKey resultType="java.lang.Long" keyProperty="id">
             SELECT LAST_INSERT_ID() AS ID
         </selectKey>
@@ -132,275 +133,293 @@
         #{pr_text1,jdbcType=VARCHAR}, #{pr_text2,jdbcType=VARCHAR}, #{pr_text3,jdbcType=VARCHAR},
         #{pr_text4,jdbcType=VARCHAR}, #{pr_text5,jdbcType=VARCHAR})
     </insert>
-    <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Product" >
+    <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" >
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="pr_code != null">
                 pr_code,
             </if>
-            <if test="pr_detail != null" >
+            <if test="pr_detail != null">
                 pr_detail,
             </if>
-            <if test="pr_spec != null" >
+            <if test="pr_spec != null">
                 pr_spec,
             </if>
-            <if test="pr_unit != null" >
+            <if test="pr_unit != null">
                 pr_unit,
             </if>
-            <if test="pr_kind != null" >
+            <if test="pr_kind != null">
                 pr_kind,
             </if>
-            <if test="pr_orispeccode != null" >
+            <if test="pr_orispeccode != null">
                 pr_orispeccode,
             </if>
-            <if test="pr_whid != null" >
+            <if test="pr_whid != null">
                 pr_whid,
             </if>
-            <if test="pr_whcode != null" >
+            <if test="pr_whcode != null">
                 pr_whcode,
             </if>
-            <if test="pr_whname != null" >
+            <if test="pr_whname != null">
                 pr_whname,
             </if>
-            <if test="pr_zxbzs != null" >
+            <if test="pr_zxbzs != null">
                 pr_zxbzs,
             </if>
-            <if test="pr_leadtime != null" >
+            <if test="pr_leadtime != null">
                 pr_leadtime,
             </if>
-            <if test="pr_brand != null" >
+            <if test="pr_brand != null">
                 pr_brand,
             </if>
-            <if test="pr_standardprice != null" >
+            <if test="pr_standardprice != null">
                 pr_standardprice,
             </if>
-            <if test="pr_purcprice != null" >
+            <if test="pr_purcprice != null">
                 pr_purcprice,
             </if>
-            <if test="pr_saleprice != null" >
+            <if test="pr_saleprice != null">
                 pr_saleprice,
             </if>
-            <if test="pr_vendid != null" >
+            <if test="pr_vendid != null">
                 pr_vendid,
             </if>
-            <if test="pr_vendcode != null" >
+            <if test="pr_vendcode != null">
                 pr_vendcode,
             </if>
-            <if test="pr_vendname != null" >
+            <if test="pr_vendname != null">
                 pr_vendname,
             </if>
-            <if test="pr_status != null" >
+            <if test="pr_status != null">
                 pr_status,
             </if>
-            <if test="pr_statuscode != null" >
+            <if test="pr_statuscode != null">
                 pr_statuscode,
             </if>
-            <if test="companyId != null" >
+            <if test="companyId != null">
                 companyId,
             </if>
-            <if test="updaterId != null" >
+            <if test="updaterId != null">
                 updaterId,
             </if>
-            <if test="updateTime != null" >
+            <if test="updateTime != null">
                 updateTime,
             </if>
-            <if test="pr_text1 != null" >
+            <if test="pr_text1 != null">
                 pr_text1,
             </if>
-            <if test="pr_text2 != null" >
+            <if test="pr_text2 != null">
                 pr_text2,
             </if>
-            <if test="pr_text3 != null" >
+            <if test="pr_text3 != null">
                 pr_text3,
             </if>
-            <if test="pr_text4 != null" >
+            <if test="pr_text4 != null">
                 pr_text4,
             </if>
-            <if test="pr_text5 != null" >
+            <if test="pr_text5 != null">
                 pr_text5,
             </if>
+            <if test="creatorId != null" >
+                creatorId,
+            </if>
+            <if test="createTime != null" >
+                createTime,
+            </if>
+            <if test="creatorName != null" >
+                creatorName,
+            </if>
         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides="," >
-            <if test="pr_code != null" >
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="pr_code != null">
                 #{pr_code,jdbcType=VARCHAR},
             </if>
-            <if test="pr_detail != null" >
+            <if test="pr_detail != null">
                 #{pr_detail,jdbcType=VARCHAR},
             </if>
-            <if test="pr_spec != null" >
+            <if test="pr_spec != null">
                 #{pr_spec,jdbcType=VARCHAR},
             </if>
-            <if test="pr_unit != null" >
+            <if test="pr_unit != null">
                 #{pr_unit,jdbcType=VARCHAR},
             </if>
-            <if test="pr_kind != null" >
+            <if test="pr_kind != null">
                 #{pr_kind,jdbcType=VARCHAR},
             </if>
-            <if test="pr_orispeccode != null" >
+            <if test="pr_orispeccode != null">
                 #{pr_orispeccode,jdbcType=VARCHAR},
             </if>
-            <if test="pr_whid != null" >
+            <if test="pr_whid != null">
                 #{pr_whid,jdbcType=DECIMAL},
             </if>
-            <if test="pr_whcode != null" >
+            <if test="pr_whcode != null">
                 #{pr_whcode,jdbcType=VARCHAR},
             </if>
-            <if test="pr_whname != null" >
+            <if test="pr_whname != null">
                 #{pr_whname,jdbcType=VARCHAR},
             </if>
-            <if test="pr_zxbzs != null" >
+            <if test="pr_zxbzs != null">
                 #{pr_zxbzs,jdbcType=DECIMAL},
             </if>
-            <if test="pr_leadtime != null" >
+            <if test="pr_leadtime != null">
                 #{pr_leadtime,jdbcType=DECIMAL},
             </if>
-            <if test="pr_brand != null" >
+            <if test="pr_brand != null">
                 #{pr_brand,jdbcType=VARCHAR},
             </if>
-            <if test="pr_standardprice != null" >
+            <if test="pr_standardprice != null">
                 #{pr_standardprice,jdbcType=DECIMAL},
             </if>
-            <if test="pr_purcprice != null" >
+            <if test="pr_purcprice != null">
                 #{pr_purcprice,jdbcType=DECIMAL},
             </if>
-            <if test="pr_saleprice != null" >
+            <if test="pr_saleprice != null">
                 #{pr_saleprice,jdbcType=DECIMAL},
             </if>
-            <if test="pr_vendid != null" >
+            <if test="pr_vendid != null">
                 #{pr_vendid,jdbcType=DECIMAL},
             </if>
-            <if test="pr_vendcode != null" >
+            <if test="pr_vendcode != null">
                 #{pr_vendcode,jdbcType=VARCHAR},
             </if>
-            <if test="pr_vendname != null" >
+            <if test="pr_vendname != null">
                 #{pr_vendname,jdbcType=VARCHAR},
             </if>
-            <if test="pr_status != null" >
+            <if test="pr_status != null">
                 #{pr_status,jdbcType=VARCHAR},
             </if>
-            <if test="pr_statuscode != null" >
+            <if test="pr_statuscode != null">
                 #{pr_statuscode,jdbcType=VARCHAR},
             </if>
-            <if test="companyId != null" >
+            <if test="companyId != null">
                 #{companyId,jdbcType=DECIMAL},
             </if>
-            <if test="updaterId != null" >
+            <if test="updaterId != null">
                 #{updaterId,jdbcType=DECIMAL},
             </if>
-            <if test="updateTime != null" >
+            <if test="updateTime != null">
                 #{updateTime,jdbcType=TIMESTAMP},
             </if>
-            <if test="pr_text1 != null" >
+            <if test="pr_text1 != null">
                 #{pr_text1,jdbcType=VARCHAR},
             </if>
-            <if test="pr_text2 != null" >
+            <if test="pr_text2 != null">
                 #{pr_text2,jdbcType=VARCHAR},
             </if>
-            <if test="pr_text3 != null" >
+            <if test="pr_text3 != null">
                 #{pr_text3,jdbcType=VARCHAR},
             </if>
-            <if test="pr_text4 != null" >
+            <if test="pr_text4 != null">
                 #{pr_text4,jdbcType=VARCHAR},
             </if>
-            <if test="pr_text5 != null" >
+            <if test="pr_text5 != null">
                 #{pr_text5,jdbcType=VARCHAR},
             </if>
+            <if test="creatorId != null" >
+                #{creatorId,jdbcType=INTEGER},
+            </if>
+            <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="creatorName != null" >
+                #{creatorName,jdbcType=VARCHAR},
+            </if>
         </trim>
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Product" >
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Product">
         update product
-        <set >
-            <if test="pr_code != null" >
+        <set>
+            <if test="pr_code != null">
                 pr_code = #{pr_code,jdbcType=VARCHAR},
             </if>
-            <if test="pr_detail != null" >
+            <if test="pr_detail != null">
                 pr_detail = #{pr_detail,jdbcType=VARCHAR},
             </if>
-            <if test="pr_spec != null" >
+            <if test="pr_spec != null">
                 pr_spec = #{pr_spec,jdbcType=VARCHAR},
             </if>
-            <if test="pr_unit != null" >
+            <if test="pr_unit != null">
                 pr_unit = #{pr_unit,jdbcType=VARCHAR},
             </if>
-            <if test="pr_kind != null" >
+            <if test="pr_kind != null">
                 pr_kind = #{pr_kind,jdbcType=VARCHAR},
             </if>
-            <if test="pr_orispeccode != null" >
+            <if test="pr_orispeccode != null">
                 pr_orispeccode = #{pr_orispeccode,jdbcType=VARCHAR},
             </if>
-            <if test="pr_whid != null" >
+            <if test="pr_whid != null">
                 pr_whid = #{pr_whid,jdbcType=DECIMAL},
             </if>
-            <if test="pr_whcode != null" >
+            <if test="pr_whcode != null">
                 pr_whcode = #{pr_whcode,jdbcType=VARCHAR},
             </if>
-            <if test="pr_whname != null" >
+            <if test="pr_whname != null">
                 pr_whname = #{pr_whname,jdbcType=VARCHAR},
             </if>
-            <if test="pr_zxbzs != null" >
+            <if test="pr_zxbzs != null">
                 pr_zxbzs = #{pr_zxbzs,jdbcType=DECIMAL},
             </if>
-            <if test="pr_leadtime != null" >
+            <if test="pr_leadtime != null">
                 pr_leadtime = #{pr_leadtime,jdbcType=DECIMAL},
             </if>
-            <if test="pr_brand != null" >
+            <if test="pr_brand != null">
                 pr_brand = #{pr_brand,jdbcType=VARCHAR},
             </if>
-            <if test="pr_standardprice != null" >
+            <if test="pr_standardprice != null">
                 pr_standardprice = #{pr_standardprice,jdbcType=DECIMAL},
             </if>
-            <if test="pr_purcprice != null" >
+            <if test="pr_purcprice != null">
                 pr_purcprice = #{pr_purcprice,jdbcType=DECIMAL},
             </if>
-            <if test="pr_saleprice != null" >
+            <if test="pr_saleprice != null">
                 pr_saleprice = #{pr_saleprice,jdbcType=DECIMAL},
             </if>
-            <if test="pr_vendid != null" >
+            <if test="pr_vendid != null">
                 pr_vendid = #{pr_vendid,jdbcType=DECIMAL},
             </if>
-            <if test="pr_vendcode != null" >
+            <if test="pr_vendcode != null">
                 pr_vendcode = #{pr_vendcode,jdbcType=VARCHAR},
             </if>
-            <if test="pr_vendname != null" >
+            <if test="pr_vendname != null">
                 pr_vendname = #{pr_vendname,jdbcType=VARCHAR},
             </if>
-            <if test="pr_status != null" >
+            <if test="pr_status != null">
                 pr_status = #{pr_status,jdbcType=VARCHAR},
             </if>
-            <if test="pr_statuscode != null" >
+            <if test="pr_statuscode != null">
                 pr_statuscode = #{pr_statuscode,jdbcType=VARCHAR},
             </if>
-            <if test="companyId != null" >
+            <if test="companyId != null">
                 companyId = #{companyId,jdbcType=DECIMAL},
             </if>
-            <if test="updaterId != null" >
+            <if test="updaterId != null">
                 updaterId = #{updaterId,jdbcType=DECIMAL},
             </if>
-            <if test="updateTime != null" >
+            <if test="updateTime != null">
                 updateTime = #{updateTime,jdbcType=TIMESTAMP},
             </if>
-            <if test="pr_text1 != null" >
+            <if test="pr_text1 != null">
                 pr_text1 = #{pr_text1,jdbcType=VARCHAR},
             </if>
-            <if test="pr_text2 != null" >
+            <if test="pr_text2 != null">
                 pr_text2 = #{pr_text2,jdbcType=VARCHAR},
             </if>
-            <if test="pr_text3 != null" >
+            <if test="pr_text3 != null">
                 pr_text3 = #{pr_text3,jdbcType=VARCHAR},
             </if>
-            <if test="pr_text4 != null" >
+            <if test="pr_text4 != null">
                 pr_text4 = #{pr_text4,jdbcType=VARCHAR},
             </if>
-            <if test="pr_text5 != null" >
+            <if test="pr_text5 != null">
                 pr_text5 = #{pr_text5,jdbcType=VARCHAR},
             </if>
         </set>
         where pr_id = #{id}
     </update>
-    <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Product" >
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Product">
         update product
         set pr_code = #{pr_code,jdbcType=VARCHAR},
         pr_detail = #{pr_detail,jdbcType=VARCHAR},
@@ -434,26 +453,26 @@
     </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_description" 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" />
+        <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_description" 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
+        select * from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
         <where>
-          <if test="con!=null">
-              ${con}
-          </if>
-          <if test="companyId!=null">
-              and tab.companyId=#{companyId} and Product.companyId=#{companyId} and warehouse.companyId=#{companyId}
-              and pw_onhand!=0
-          </if>
+            <if test="con!=null">
+                ${con}
+            </if>
+            <if test="companyId!=null">
+                and tab.companyId=#{companyId} and Product.companyId=#{companyId} and warehouse.companyId=#{companyId}
+                and pw_onhand!=0
+            </if>
         </where>
         ORDER BY PR_ID DESC
     </select>
@@ -521,15 +540,6 @@
             <if test="pi_total != null">
                 pi_total,
             </if>
-            <if test="pi_recordmanid != null">
-                pi_recordmanid,
-            </if>
-            <if test="pi_recordman != null">
-                pi_recordman,
-            </if>
-            <if test="createTime != null">
-                pi_recorddate,
-            </if>
             <if test="pi_status != null">
                 pi_status,
             </if>
@@ -578,6 +588,15 @@
             <if test="pi_remark != null">
                 pi_remark,
             </if>
+            <if test="creatorId != null" >
+                creatorId,
+            </if>
+            <if test="createTime != null" >
+                createTime,
+            </if>
+            <if test="creatorName != null" >
+                creatorName,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -623,15 +642,6 @@
             <if test="pi_total != null">
                 #{pi_total,jdbcType=DOUBLE},
             </if>
-            <if test="pi_recordmanid != null">
-                #{pi_recordmanid,jdbcType=INTEGER},
-            </if>
-            <if test="pi_recordman != null">
-                #{pi_recordman,jdbcType=VARCHAR},
-            </if>
-            <if test="createTime != null">
-                #{createTime,jdbcType=TIMESTAMP},
-            </if>
             <if test="pi_status != null">
                 #{pi_status,jdbcType=VARCHAR},
             </if>
@@ -680,10 +690,19 @@
             <if test="pi_remark != null">
                 #{pi_remark,jdbcType=VARCHAR},
             </if>
+            <if test="creatorId != null" >
+                #{creatorId,jdbcType=INTEGER},
+            </if>
+            <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="creatorName != null" >
+                #{creatorName,jdbcType=VARCHAR},
+            </if>
         </trim>
     </insert>
 
-    <insert id="batchInsertDetail" parameterType="java.util.List" >
+    <insert id="batchInsertDetail" parameterType="java.util.List">
         insert into prodiodetail (pd_piid, pd_inoutno,
         pd_piclass, pd_pdno, pd_ordercode,
         pd_orderdetno, pd_prodid, pd_prodcode,
@@ -697,7 +716,8 @@
         updatetime, pd_text1, pd_text2,
         pd_text3, pd_text4, pd_text5,
         pd_ym, pd_yqty, pd_ioid,
-        pd_remark) VALUES
+        pd_remark,
+        creatorId,createTime,creatorName) VALUES
         <foreach collection="list" item="item" index="index" open="" close="" separator=",">
             (
             #{item.pd_piid,jdbcType=INTEGER},
@@ -738,118 +758,120 @@
             #{item.pd_ym,jdbcType=INTEGER},
             #{item.pd_yqty,jdbcType=DOUBLE},
             #{item.pd_remark,jdbcType=LONGVARCHAR},
-            #{item.pd_ioid,jdbcType=INTEGER})
+            #{item.pd_ioid,jdbcType=INTEGER},
+            #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR})
         </foreach>
     </insert>
 
-    <update id="batchUpdateDetail" parameterType="com.usoftchina.saas.document.entities.ProdIODetail" >
+    <update id="batchUpdateDetail" parameterType="com.usoftchina.saas.document.entities.ProdIODetail">
         <foreach collection="list" item="item" index="index" open="" close="" separator=";">
-            update prodiodetail <set>
-            <if test="item.pd_piid !=null">
-                pd_piid = #{item.pd_piid},
-            </if>
-            <if test="item.pd_inoutno !=null">
-                pd_inoutno = #{item.pd_inoutno},
-            </if>
-            <if test="item.pd_piclass !=null">
-                pd_piclass = #{item.pd_piclass},
-            </if>
-            <if test="item.pd_pdno !=null">
-                pd_pdno = #{item.pd_pdno},
-            </if>
-            <if test="item.pd_ordercode !=null">
-                pd_ordercode = #{item.pd_ordercode},
-            </if>
-            <if test="item.pd_orderdetno !=null">
-                pd_orderdetno = #{item.pd_orderdetno},
-            </if>
-            <if test="item.pd_prodid !=null">
-                pd_prodid = #{item.pd_prodid},
-            </if>
-            <if test="item.pd_prodcode !=null">
-                pd_prodcode = #{item.pd_prodcode},
-            </if>
-            <if test="item.pd_unit !=null">
-                pd_unit = #{item.pd_unit},
-            </if>
-            <if test="item.pd_inqty !=null">
-                pd_inqty = #{item.pd_inqty},
-            </if>
-            <if test="item.pd_outqty !=null">
-                pd_outqty = #{item.pd_outqty},
-            </if>
-            <if test="item.pd_orderprice !=null">
-                pd_orderprice = #{item.pd_orderprice},
-            </if>
-            <if test="item.pd_sendprice !=null">
-                pd_sendprice = #{item.pd_sendprice},
-            </if>
-            <if test="item.pd_price !=null">
-                pd_price = #{item.pd_price},
-            </if>
-            <if test="item.pd_total !=null">
-                pd_total = #{item.pd_total},
-            </if>
-            <if test="item.pd_taxrate !=null">
-                pd_taxrate = #{item.pd_taxrate},
-            </if>
-            <if test="item.pd_netprice !=null">
-                pd_netprice = #{item.pd_netprice},
-            </if>
-            <if test="item.pd_nettotal !=null">
-                pd_nettotal = #{item.pd_nettotal},
-            </if>
-            <if test="item.pd_whid !=null">
-                pd_whid = #{item.pd_whid},
-            </if>
-            <if test="item.pd_whcode !=null">
-                pd_whcode = #{item.pd_whcode},
-            </if>
-            <if test="item.pd_whname !=null">
-                pd_whname = #{item.pd_whname},
-            </if>
-            <if test="item.pd_inwhid !=null">
-                pd_inwhid = #{item.pd_inwhid},
-            </if>
-            <if test="item.pd_inwhcode !=null">
-                pd_inwhcode = #{item.pd_inwhcode},
-            </if>
-            <if test="item.pd_inwhname !=null">
-                pd_inwhname = #{item.pd_inwhname},
-            </if>
-            <if test="item.pd_orderid !=null">
-                pd_orderid = #{item.pd_orderid},
-            </if>
-            <if test="item.pd_sdid !=null">
-                pd_sdid = #{item.pd_sdid},
-            </if>
-            <if test="item.pd_status !=null">
-                pd_status = #{item.pd_status},
-            </if>
-            <if test="item.pd_remark !=null">
-                pd_remark = #{item.pd_remark},
-            </if>
-            <if test="item.companyId!=null">
-                companyId = #{item.companyId},
-            </if>
-            <if test="item.updaterId!=null">
-                updaterId = #{item.updaterId},
-            </if>
-            <if test="item.updateTime!=null">
-                updateTime = #{item.updateTime},
-            </if>
-            pd_text1 = #{item.pd_text1},
-            pd_text2 = #{item.pd_text2},
-            pd_text3 = #{item.pd_text3},
-            pd_text4 = #{item.pd_text4},
-            pd_text5 = #{item.pd_text5},
-            <if test="item.pd_ym!=null">
-                pd_ym = #{item.pd_ym},
-            </if>
-            <if test="item.pd_yqty!=null">
-                pd_yqty = #{item.pd_yqty},
-            </if>
-        </set>
+            update prodiodetail
+            <set>
+                <if test="item.pd_piid !=null">
+                    pd_piid = #{item.pd_piid},
+                </if>
+                <if test="item.pd_inoutno !=null">
+                    pd_inoutno = #{item.pd_inoutno},
+                </if>
+                <if test="item.pd_piclass !=null">
+                    pd_piclass = #{item.pd_piclass},
+                </if>
+                <if test="item.pd_pdno !=null">
+                    pd_pdno = #{item.pd_pdno},
+                </if>
+                <if test="item.pd_ordercode !=null">
+                    pd_ordercode = #{item.pd_ordercode},
+                </if>
+                <if test="item.pd_orderdetno !=null">
+                    pd_orderdetno = #{item.pd_orderdetno},
+                </if>
+                <if test="item.pd_prodid !=null">
+                    pd_prodid = #{item.pd_prodid},
+                </if>
+                <if test="item.pd_prodcode !=null">
+                    pd_prodcode = #{item.pd_prodcode},
+                </if>
+                <if test="item.pd_unit !=null">
+                    pd_unit = #{item.pd_unit},
+                </if>
+                <if test="item.pd_inqty !=null">
+                    pd_inqty = #{item.pd_inqty},
+                </if>
+                <if test="item.pd_outqty !=null">
+                    pd_outqty = #{item.pd_outqty},
+                </if>
+                <if test="item.pd_orderprice !=null">
+                    pd_orderprice = #{item.pd_orderprice},
+                </if>
+                <if test="item.pd_sendprice !=null">
+                    pd_sendprice = #{item.pd_sendprice},
+                </if>
+                <if test="item.pd_price !=null">
+                    pd_price = #{item.pd_price},
+                </if>
+                <if test="item.pd_total !=null">
+                    pd_total = #{item.pd_total},
+                </if>
+                <if test="item.pd_taxrate !=null">
+                    pd_taxrate = #{item.pd_taxrate},
+                </if>
+                <if test="item.pd_netprice !=null">
+                    pd_netprice = #{item.pd_netprice},
+                </if>
+                <if test="item.pd_nettotal !=null">
+                    pd_nettotal = #{item.pd_nettotal},
+                </if>
+                <if test="item.pd_whid !=null">
+                    pd_whid = #{item.pd_whid},
+                </if>
+                <if test="item.pd_whcode !=null">
+                    pd_whcode = #{item.pd_whcode},
+                </if>
+                <if test="item.pd_whname !=null">
+                    pd_whname = #{item.pd_whname},
+                </if>
+                <if test="item.pd_inwhid !=null">
+                    pd_inwhid = #{item.pd_inwhid},
+                </if>
+                <if test="item.pd_inwhcode !=null">
+                    pd_inwhcode = #{item.pd_inwhcode},
+                </if>
+                <if test="item.pd_inwhname !=null">
+                    pd_inwhname = #{item.pd_inwhname},
+                </if>
+                <if test="item.pd_orderid !=null">
+                    pd_orderid = #{item.pd_orderid},
+                </if>
+                <if test="item.pd_sdid !=null">
+                    pd_sdid = #{item.pd_sdid},
+                </if>
+                <if test="item.pd_status !=null">
+                    pd_status = #{item.pd_status},
+                </if>
+                <if test="item.pd_remark !=null">
+                    pd_remark = #{item.pd_remark},
+                </if>
+                <if test="item.companyId!=null">
+                    companyId = #{item.companyId},
+                </if>
+                <if test="item.updaterId!=null">
+                    updaterId = #{item.updaterId},
+                </if>
+                <if test="item.updateTime!=null">
+                    updateTime = #{item.updateTime},
+                </if>
+                pd_text1 = #{item.pd_text1},
+                pd_text2 = #{item.pd_text2},
+                pd_text3 = #{item.pd_text3},
+                pd_text4 = #{item.pd_text4},
+                pd_text5 = #{item.pd_text5},
+                <if test="item.pd_ym!=null">
+                    pd_ym = #{item.pd_ym},
+                </if>
+                <if test="item.pd_yqty!=null">
+                    pd_yqty = #{item.pd_yqty},
+                </if>
+            </set>
             where PD_ID = #{item.id,jdbcType=BIGINT}
         </foreach>
     </update>
@@ -873,7 +895,7 @@
         WHERE PRODIODETAIL.COMPANYID = #{companyId} AND PD_PRODID = #{id} and pd_piclass != '库存初始化';
     </select>
 
-    <delete id="deleteProdIOByCode" >
+    <delete id="deleteProdIOByCode">
         DELETE FROM PRODINOUT WHERE PI_INOUTNO=#{code} AND COMPANYID = #{companyId}
     </delete>
     <delete id="deleteProdIODetailByCode">

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

@@ -26,9 +26,11 @@
       SELECT LAST_INSERT_ID() AS ID
     </selectKey>
     insert into productbrand (pb_name,companyId,
-      updaterId, updateTime)
+      updaterId, updateTime,
+    creatorId,createTime,creatorName)
     values (#{pb_name,jdbcType=VARCHAR},#{companyId,jdbcType=INTEGER},
-      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
+    #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Productbrand" >
     <selectKey resultType="java.lang.Long" keyProperty="id">
@@ -48,6 +50,15 @@
       <if test="updateTime != null" >
         updateTime,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="pb_name != null" >
@@ -62,6 +73,15 @@
       <if test="updateTime != null" >
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Productbrand" >

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

@@ -26,9 +26,11 @@
       SELECT LAST_INSERT_ID() AS ID
     </selectKey>
     insert into producttype (pt_name, companyId,
-      updaterId, updateTime)
+      updaterId, updateTime,
+      creatorId,createTime,creatorName)
     values (#{pt_name,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
-      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
+      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Producttype">
     <selectKey resultType="java.lang.Long" keyProperty="id">
@@ -48,6 +50,15 @@
       <if test="updateTime != null">
         updateTime,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="pt_name != null">
@@ -62,6 +73,15 @@
       <if test="updateTime != null">
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Producttype">

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

@@ -42,6 +42,15 @@
       <if test="updateTime != null" >
         updateTime,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="pu_name != null" >
@@ -56,6 +65,15 @@
       <if test="updateTime != null" >
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Productunit" >

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

@@ -41,13 +41,15 @@
       sl_amount, sl_preamount, sl_yamount, 
       sl_namount, sl_remark, companyId, 
       updaterId, updateTime, sl_orderamount, 
-      sl_discount, sl_ym)
+      sl_discount, sl_ym,
+      creatorId,createTime,creatorName)
     values (#{sl_id,jdbcType=INTEGER}, #{sl_code,jdbcType=VARCHAR}, #{sl_kind,jdbcType=VARCHAR}, 
       #{sl_custid,jdbcType=INTEGER}, #{sl_vendid,jdbcType=INTEGER}, #{sl_date,jdbcType=TIMESTAMP}, 
       #{sl_amount,jdbcType=DOUBLE}, #{sl_preamount,jdbcType=DOUBLE}, #{sl_yamount,jdbcType=DOUBLE}, 
       #{sl_namount,jdbcType=DOUBLE}, #{sl_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, 
       #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{sl_orderamount,jdbcType=DOUBLE}, 
-      #{sl_discount,jdbcType=DOUBLE}, #{sl_ym,jdbcType=INTEGER})
+      #{sl_discount,jdbcType=DOUBLE}, #{sl_ym,jdbcType=INTEGER},
+      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Subledger" >
     insert into subledger
@@ -100,6 +102,15 @@
       <if test="sl_ym != null" >
         sl_ym,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="sl_code != null" >
@@ -150,6 +161,15 @@
       <if test="sl_ym != null" >
         #{sl_ym,jdbcType=INTEGER},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Subledger" >

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

@@ -123,7 +123,8 @@
         ve_statuscode, companyId, updaterId,
         updateTime, ve_text1, ve_text2,
         ve_text3, ve_text4, ve_text5,
-        ve_payamount, ve_leftamount, ve_beginym ,ve_preamount
+        ve_payamount, ve_leftamount, ve_beginym ,ve_preamount,
+        creatorId,createTime,creatorName
         )
         values (#{ve_code,jdbcType=VARCHAR}, #{ve_name,jdbcType=VARCHAR},
         #{ve_uu,jdbcType=VARCHAR}, #{ve_type,jdbcType=VARCHAR}, #{ve_begindate,jdbcType=TIMESTAMP},
@@ -134,7 +135,8 @@
         #{updateTime,jdbcType=TIMESTAMP}, #{ve_text1,jdbcType=VARCHAR}, #{ve_text2,jdbcType=VARCHAR},
         #{ve_text3,jdbcType=VARCHAR}, #{ve_text4,jdbcType=VARCHAR}, #{ve_text5,jdbcType=VARCHAR},
         #{ve_payamount,jdbcType=DOUBLE}, #{ve_leftamount,jdbcType=DOUBLE}, #{ve_beginym,jdbcType=INTEGER},
-        #{ve_preamount,jdbcType=DOUBLE}
+        #{ve_preamount,jdbcType=DOUBLE},
+        #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
         )
     </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
@@ -221,6 +223,15 @@
             <if test="ve_preamount !=null" >
                 ve_preamount,
             </if>
+            <if test="creatorId != null" >
+                creatorId,
+            </if>
+            <if test="createTime != null" >
+                createTime,
+            </if>
+            <if test="creatorName != null" >
+                creatorName,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
             <if test="ve_code != null" >
@@ -301,6 +312,15 @@
             <if test="ve_preamount !=null" >
                 #{ve_preamount,jdbcType=DOUBLE},
             </if>
+            <if test="creatorId != null" >
+                #{creatorId,jdbcType=INTEGER},
+            </if>
+            <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="creatorName != null" >
+                #{creatorName,jdbcType=VARCHAR},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >

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

@@ -48,14 +48,16 @@
       vc_name, vc_tel, vc_qq, 
       vc_email, companyId, updaterId, 
       updateTime, vc_text1, vc_text2, 
-      vc_text3, vc_text4, vc_text5, vc_default
+      vc_text3, vc_text4, vc_text5, vc_default,
+    creatorId,createTime,creatorName
       )
     values (#{vc_veid}, #{vc_detno,jdbcType=INTEGER},
       #{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},
-      #{vc_default,jdbcType=VARCHAR}
+      #{vc_default,jdbcType=VARCHAR},
+    #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
@@ -106,6 +108,15 @@
       <if test="vc_default != null" >
         vc_default,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="vc_veid != null" >
@@ -153,6 +164,15 @@
       <if test="vc_default != null" >
         #{vc_default,jdbcType=VARCHAR},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
@@ -230,7 +250,8 @@
         vc_name, vc_tel, vc_qq,
         vc_email, companyId, updaterId,
         updateTime, vc_text1, vc_text2,
-        vc_text3, vc_text4, vc_text5, vc_default
+        vc_text3, vc_text4, vc_text5, vc_default,
+        creatorId,createTime,creatorName
         )
         values
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
@@ -240,7 +261,8 @@
       #{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},
-      #{item.vc_default,jdbcType=VARCHAR}
+      #{item.vc_default,jdbcType=VARCHAR},
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

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

@@ -26,9 +26,11 @@
       SELECT LAST_INSERT_ID() AS ID
     </selectKey>
     insert into vendorkind (vk_name, companyId,
-    updaterId, updateTime)
+    updaterId, updateTime,
+    creatorId,createTime,creatorName)
     values (#{vk_name,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
-    #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
+    #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
+    #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendorkind">
     <selectKey resultType="java.lang.Long" keyProperty="id">
@@ -48,6 +50,15 @@
       <if test="updateTime != null">
         updateTime,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="vk_name != null">
@@ -62,6 +73,15 @@
       <if test="updateTime != null">
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Vendorkind">

+ 28 - 29
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -8,8 +8,6 @@
         <result column="wh_description" property="wh_description" jdbcType="VARCHAR" />
         <result column="wh_statuscode" property="wh_statuscode" jdbcType="VARCHAR" />
         <result column="wh_status" property="wh_status" jdbcType="TIMESTAMP" />
-        <result column="wh_recordid" property="wh_recorderid" jdbcType="INTEGER" />
-        <result column="wh_recorder" property="wh_recorder" jdbcType="INTEGER" />
         <result column="wh_date" property="wh_date" jdbcType="INTEGER" />
         <result column="companyId" property="companyId" jdbcType="INTEGER" />
         <result column="updatemanid" property="updaterId" jdbcType="INTEGER" />
@@ -96,8 +94,7 @@
         </where>
     </sql>
     <sql id="Base_Column_List">
-        wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_recorderid,
-        wh_recorder, wh_date, companyId, updaterId, updateTime, wh_text1, wh_text2, wh_text3,
+        wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_date, companyId, updaterId, updateTime, wh_text1, wh_text2, wh_text3,
         wh_text4, wh_text5
     </sql>
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="WarehouseResultMapper">
@@ -116,17 +113,18 @@
             SELECT LAST_INSERT_ID() AS ID
         </selectKey>
         insert into warehouse (wh_code, wh_type,
-        wh_description, wh_statuscode, wh_status,
-        wh_recorderid, wh_recorder, wh_date,
+        wh_description, wh_statuscode, wh_status, wh_date,
         companyId, updaterId, updateTime,
         wh_text1, wh_text2, wh_text3,
-        wh_text4, wh_text5)
+        wh_text4, wh_text5,
+        creatorId,createTime,creatorName)
         values (#{wh_code,jdbcType=VARCHAR}, #{wh_type,jdbcType=VARCHAR},
         #{wh_description,jdbcType=VARCHAR}, #{wh_statuscode,jdbcType=VARCHAR}, #{wh_status,jdbcType=VARCHAR},
-        #{wh_recorderid,jdbcType=VARCHAR}, #{wh_recorder,jdbcType=VARCHAR}, #{wh_date,jdbcType=TIMESTAMP},
+         #{wh_date,jdbcType=TIMESTAMP},
         #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
         #{wh_text1,jdbcType=VARCHAR}, #{wh_text2,jdbcType=VARCHAR}, #{wh_text3,jdbcType=VARCHAR},
-        #{wh_text4,jdbcType=VARCHAR}, #{wh_text5,jdbcType=VARCHAR})
+        #{wh_text4,jdbcType=VARCHAR}, #{wh_text5,jdbcType=VARCHAR},
+        #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
     </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
         <selectKey resultType="java.lang.Long" keyProperty="id">
@@ -149,12 +147,6 @@
             <if test="wh_status != null">
                 wh_status,
             </if>
-            <if test="wh_recorderid != null">
-                wh_recorderid,
-            </if>
-            <if test="wh_recorder != null">
-                wh_recorder,
-            </if>
             <if test="wh_date != null">
                 wh_date,
             </if>
@@ -182,6 +174,15 @@
             <if test="wh_text5 != null">
                 wh_text5,
             </if>
+            <if test="creatorId != null" >
+                creatorId,
+            </if>
+            <if test="createTime != null" >
+                createTime,
+            </if>
+            <if test="creatorName != null" >
+                creatorName,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="wh_code != null">
@@ -199,12 +200,6 @@
             <if test="wh_status != null">
                 #{wh_status,jdbcType=VARCHAR},
             </if>
-            <if test="wh_recorderid != null">
-                #{wh_recorderid,jdbcType=VARCHAR},
-            </if>
-            <if test="wh_recorder != null">
-                #{wh_recorder,jdbcType=VARCHAR},
-            </if>
             <if test="wh_date != null">
                 #{wh_date,jdbcType=TIMESTAMP},
             </if>
@@ -232,6 +227,15 @@
             <if test="wh_text5 != null">
                 #{wh_text5,jdbcType=VARCHAR},
             </if>
+            <if test="creatorId != null" >
+                #{creatorId,jdbcType=INTEGER},
+            </if>
+            <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="creatorName != null" >
+                #{creatorName,jdbcType=VARCHAR},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
@@ -252,12 +256,6 @@
             <if test="wh_status != null">
                 wh_status = #{wh_status,jdbcType=VARCHAR},
             </if>
-            <if test="wh_recorderid != null">
-                wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
-            </if>
-            <if test="wh_recorder != null">
-                wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
-            </if>
             <if test="wh_date != null">
                 wh_date = #{wh_date,jdbcType=TIMESTAMP},
             </if>
@@ -295,8 +293,6 @@
         wh_description = #{wh_description,jdbcType=VARCHAR},
         wh_statuscode = #{wh_statuscode,jdbcType=VARCHAR},
         wh_status = #{wh_status,jdbcType=VARCHAR},
-        wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
-        wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
         wh_date = #{wh_date,jdbcType=TIMESTAMP},
         companyId = #{companyId,jdbcType=INTEGER},
         updaterId = #{updaterId,jdbcType=INTEGER},
@@ -371,5 +367,8 @@
         select count(1) from productwh where pw_whid = #{id} and pw_onhand > 0
         and companyId = #{companyId}
     </select>
+    <select id="deleteCheckProdIO" resultType="int">
+        SELECT COUNT(*) FROM PRODIODETAIL WHERE pd_whid = #{id} and companyid = #{companyId}
+    </select>
 </mapper>
 

+ 0 - 30
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationDTO.java

@@ -52,12 +52,6 @@ public class VerificationDTO extends  CommonBaseDTO implements Serializable {
 
     private Double vc_amount2;
 
-    private Integer vc_recorderid;
-
-    private String vc_recorder;
-
-    private Date vc_recorddate;
-
     private String vc_status;
 
     private String vc_statuscode;
@@ -218,30 +212,6 @@ public class VerificationDTO extends  CommonBaseDTO implements Serializable {
         this.vc_amount2 = vc_amount2;
     }
 
-    public Integer getVc_recorderid() {
-        return vc_recorderid;
-    }
-
-    public void setVc_recorderid(Integer vc_recorderid) {
-        this.vc_recorderid = vc_recorderid;
-    }
-
-    public String getVc_recorder() {
-        return vc_recorder;
-    }
-
-    public void setVc_recorder(String vc_recorder) {
-        this.vc_recorder = vc_recorder == null ? null : vc_recorder.trim();
-    }
-
-    public Date getVc_recorddate() {
-        return vc_recorddate;
-    }
-
-    public void setVc_recorddate(Date vc_recorddate) {
-        this.vc_recorddate = vc_recorddate;
-    }
-
     public String getVc_status() {
         return vc_status;
     }

+ 0 - 6
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationListDTO.java

@@ -49,12 +49,6 @@ public class VerificationListDTO implements Serializable {
 
     private Double vc_amount2;
 
-    private Integer vc_recorderid;
-
-    private String vc_recorder;
-
-    private Date vc_recorddate;
-
     private Integer vc_status;
 
     private BigDecimal vc_statuscode;

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

@@ -107,6 +107,10 @@
             <version>1.0.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 7 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/FundtransferMapper.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.money.po.Fundtransfer;
 import com.usoftchina.saas.money.po.Othreceipts;
 import org.apache.ibatis.annotations.Param;
@@ -30,4 +31,10 @@ public interface FundtransferMapper extends CommonBaseMapper<Fundtransfer> {
 
     List<Fundtransfer> selectFundtransferBycondition(@Param("con") String con, @Param("companyId") Long companyId);
     List<Fundtransfer> selectFundtransferListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+
+    String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateAudit(List<DocBaseDTO> baseDTOs);
+
+    List<String> checkAmount(@Param("companyId") Long companyId, @Param("id") Long id);
 }

+ 5 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthreceiptsMapper.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.money.po.Othreceipts;
 import com.usoftchina.saas.money.po.Recbalance;
 import com.usoftchina.saas.page.PageRequest;
@@ -31,4 +32,8 @@ public interface OthreceiptsMapper extends CommonBaseMapper<Othreceipts> {
 
     List<Othreceipts> selectOthreceiptsBycondition(@Param("con") String con, @Param("companyId") Long companyId);
     List<Othreceipts> selectOthreceiptsListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+
+    String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateAudit(List<DocBaseDTO> baseDTOs);
 }

+ 5 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthspendingsMapper.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.money.po.Othreceipts;
 import com.usoftchina.saas.money.po.Othspendings;
 import org.apache.ibatis.annotations.Param;
@@ -30,4 +31,8 @@ public interface OthspendingsMapper extends CommonBaseMapper<Othspendings> {
 
     List<Othspendings> selectOthspendingsBycondition(@Param("con") String con, @Param("companyId") Long companyId);
     List<Othspendings> selectOthspendingsListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+
+    String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateAudit(List<DocBaseDTO> baseDTOs);
 }

+ 5 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalanceMapper.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.money.po.Bankinformation;
 import com.usoftchina.saas.money.po.Paybalance;
 import com.usoftchina.saas.money.po.Recbalance;
@@ -45,4 +46,8 @@ public interface PaybalanceMapper extends CommonBaseMapper<Paybalance> {
     void updateBankAmount(@Param("bk_thisamount") Double bk_thisamount, @Param("id") Integer id);
 
     int checkStatus(@Param("id") Long id);
+
+    String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateAudit(List<DocBaseDTO> baseDTOs);
 }

+ 5 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalanceMapper.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.*;
 
@@ -52,4 +53,8 @@ public interface RecbalanceMapper extends CommonBaseMapper<Recbalance> {
     int updateCustomerByPrimaryKeySelective(Customer record);
 
     int checkStatus(@Param("id") Long id);
+
+    String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateAudit(List<DocBaseDTO> baseDTOs);
 }

+ 0 - 190
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/PaybalanceExample.java

@@ -940,196 +940,6 @@ public class PaybalanceExample {
             return (Criteria) this;
         }
 
-        public Criteria andPb_recorderidIsNull() {
-            addCriterion("pb_recorderid is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidIsNotNull() {
-            addCriterion("pb_recorderid is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidEqualTo(Integer value) {
-            addCriterion("pb_recorderid =", value, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidNotEqualTo(Integer value) {
-            addCriterion("pb_recorderid <>", value, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidGreaterThan(Integer value) {
-            addCriterion("pb_recorderid >", value, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidGreaterThanOrEqualTo(Integer value) {
-            addCriterion("pb_recorderid >=", value, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidLessThan(Integer value) {
-            addCriterion("pb_recorderid <", value, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidLessThanOrEqualTo(Integer value) {
-            addCriterion("pb_recorderid <=", value, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidIn(List<Integer> values) {
-            addCriterion("pb_recorderid in", values, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidNotIn(List<Integer> values) {
-            addCriterion("pb_recorderid not in", values, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidBetween(Integer value1, Integer value2) {
-            addCriterion("pb_recorderid between", value1, value2, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderidNotBetween(Integer value1, Integer value2) {
-            addCriterion("pb_recorderid not between", value1, value2, "pb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderIsNull() {
-            addCriterion("pb_recorder is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderIsNotNull() {
-            addCriterion("pb_recorder is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderEqualTo(String value) {
-            addCriterion("pb_recorder =", value, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderNotEqualTo(String value) {
-            addCriterion("pb_recorder <>", value, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderGreaterThan(String value) {
-            addCriterion("pb_recorder >", value, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderGreaterThanOrEqualTo(String value) {
-            addCriterion("pb_recorder >=", value, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderLessThan(String value) {
-            addCriterion("pb_recorder <", value, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderLessThanOrEqualTo(String value) {
-            addCriterion("pb_recorder <=", value, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderLike(String value) {
-            addCriterion("pb_recorder like", value, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderNotLike(String value) {
-            addCriterion("pb_recorder not like", value, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderIn(List<String> values) {
-            addCriterion("pb_recorder in", values, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderNotIn(List<String> values) {
-            addCriterion("pb_recorder not in", values, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderBetween(String value1, String value2) {
-            addCriterion("pb_recorder between", value1, value2, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorderNotBetween(String value1, String value2) {
-            addCriterion("pb_recorder not between", value1, value2, "pb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateIsNull() {
-            addCriterion("pb_recorddate is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateIsNotNull() {
-            addCriterion("pb_recorddate is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateEqualTo(Date value) {
-            addCriterion("pb_recorddate =", value, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateNotEqualTo(Date value) {
-            addCriterion("pb_recorddate <>", value, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateGreaterThan(Date value) {
-            addCriterion("pb_recorddate >", value, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateGreaterThanOrEqualTo(Date value) {
-            addCriterion("pb_recorddate >=", value, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateLessThan(Date value) {
-            addCriterion("pb_recorddate <", value, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateLessThanOrEqualTo(Date value) {
-            addCriterion("pb_recorddate <=", value, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateIn(List<Date> values) {
-            addCriterion("pb_recorddate in", values, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateNotIn(List<Date> values) {
-            addCriterion("pb_recorddate not in", values, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateBetween(Date value1, Date value2) {
-            addCriterion("pb_recorddate between", value1, value2, "pb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andPb_recorddateNotBetween(Date value1, Date value2) {
-            addCriterion("pb_recorddate not between", value1, value2, "pb_recorddate");
-            return (Criteria) this;
-        }
-
         public Criteria andPb_statusIsNull() {
             addCriterion("pb_status is null");
             return (Criteria) this;

+ 0 - 190
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/RecbalanceExample.java

@@ -939,196 +939,6 @@ public class RecbalanceExample {
             return (Criteria) this;
         }
 
-        public Criteria andRb_recorderidIsNull() {
-            addCriterion("rb_recorderid is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidIsNotNull() {
-            addCriterion("rb_recorderid is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidEqualTo(Integer value) {
-            addCriterion("rb_recorderid =", value, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidNotEqualTo(Integer value) {
-            addCriterion("rb_recorderid <>", value, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidGreaterThan(Integer value) {
-            addCriterion("rb_recorderid >", value, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidGreaterThanOrEqualTo(Integer value) {
-            addCriterion("rb_recorderid >=", value, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidLessThan(Integer value) {
-            addCriterion("rb_recorderid <", value, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidLessThanOrEqualTo(Integer value) {
-            addCriterion("rb_recorderid <=", value, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidIn(List<Integer> values) {
-            addCriterion("rb_recorderid in", values, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidNotIn(List<Integer> values) {
-            addCriterion("rb_recorderid not in", values, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidBetween(Integer value1, Integer value2) {
-            addCriterion("rb_recorderid between", value1, value2, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderidNotBetween(Integer value1, Integer value2) {
-            addCriterion("rb_recorderid not between", value1, value2, "rb_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderIsNull() {
-            addCriterion("rb_recorder is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderIsNotNull() {
-            addCriterion("rb_recorder is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderEqualTo(String value) {
-            addCriterion("rb_recorder =", value, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderNotEqualTo(String value) {
-            addCriterion("rb_recorder <>", value, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderGreaterThan(String value) {
-            addCriterion("rb_recorder >", value, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderGreaterThanOrEqualTo(String value) {
-            addCriterion("rb_recorder >=", value, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderLessThan(String value) {
-            addCriterion("rb_recorder <", value, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderLessThanOrEqualTo(String value) {
-            addCriterion("rb_recorder <=", value, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderLike(String value) {
-            addCriterion("rb_recorder like", value, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderNotLike(String value) {
-            addCriterion("rb_recorder not like", value, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderIn(List<String> values) {
-            addCriterion("rb_recorder in", values, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderNotIn(List<String> values) {
-            addCriterion("rb_recorder not in", values, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderBetween(String value1, String value2) {
-            addCriterion("rb_recorder between", value1, value2, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorderNotBetween(String value1, String value2) {
-            addCriterion("rb_recorder not between", value1, value2, "rb_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateIsNull() {
-            addCriterion("rb_recorddate is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateIsNotNull() {
-            addCriterion("rb_recorddate is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateEqualTo(Date value) {
-            addCriterion("rb_recorddate =", value, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateNotEqualTo(Date value) {
-            addCriterion("rb_recorddate <>", value, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateGreaterThan(Date value) {
-            addCriterion("rb_recorddate >", value, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateGreaterThanOrEqualTo(Date value) {
-            addCriterion("rb_recorddate >=", value, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateLessThan(Date value) {
-            addCriterion("rb_recorddate <", value, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateLessThanOrEqualTo(Date value) {
-            addCriterion("rb_recorddate <=", value, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateIn(List<Date> values) {
-            addCriterion("rb_recorddate in", values, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateNotIn(List<Date> values) {
-            addCriterion("rb_recorddate not in", values, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateBetween(Date value1, Date value2) {
-            addCriterion("rb_recorddate between", value1, value2, "rb_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andRb_recorddateNotBetween(Date value1, Date value2) {
-            addCriterion("rb_recorddate not between", value1, value2, "rb_recorddate");
-            return (Criteria) this;
-        }
-
         public Criteria andRb_statusIsNull() {
             addCriterion("rb_status is null");
             return (Criteria) this;

+ 0 - 30
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verification.java

@@ -49,12 +49,6 @@ public class Verification extends CommonBaseEntity implements Serializable {
 
     private Double vc_amount2;
 
-    private Integer vc_recorderid;
-
-    private String vc_recorder;
-
-    private Date vc_recorddate;
-
     private String vc_status;
 
     private String vc_statuscode;
@@ -215,30 +209,6 @@ public class Verification extends CommonBaseEntity implements Serializable {
         this.vc_amount2 = vc_amount2;
     }
 
-    public Integer getVc_recorderid() {
-        return vc_recorderid;
-    }
-
-    public void setVc_recorderid(Integer vc_recorderid) {
-        this.vc_recorderid = vc_recorderid;
-    }
-
-    public String getVc_recorder() {
-        return vc_recorder;
-    }
-
-    public void setVc_recorder(String vc_recorder) {
-        this.vc_recorder = vc_recorder == null ? null : vc_recorder.trim();
-    }
-
-    public Date getVc_recorddate() {
-        return vc_recorddate;
-    }
-
-    public void setVc_recorddate(Date vc_recorddate) {
-        this.vc_recorddate = vc_recorddate;
-    }
-
     public String getVc_status() {
         return vc_status;
     }

+ 0 - 190
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VerificationExample.java

@@ -1290,196 +1290,6 @@ public class VerificationExample {
             return (Criteria) this;
         }
 
-        public Criteria andVc_recorderidIsNull() {
-            addCriterion("vc_recorderid is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidIsNotNull() {
-            addCriterion("vc_recorderid is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidEqualTo(Integer value) {
-            addCriterion("vc_recorderid =", value, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidNotEqualTo(Integer value) {
-            addCriterion("vc_recorderid <>", value, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidGreaterThan(Integer value) {
-            addCriterion("vc_recorderid >", value, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidGreaterThanOrEqualTo(Integer value) {
-            addCriterion("vc_recorderid >=", value, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidLessThan(Integer value) {
-            addCriterion("vc_recorderid <", value, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidLessThanOrEqualTo(Integer value) {
-            addCriterion("vc_recorderid <=", value, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidIn(List<Integer> values) {
-            addCriterion("vc_recorderid in", values, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidNotIn(List<Integer> values) {
-            addCriterion("vc_recorderid not in", values, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidBetween(Integer value1, Integer value2) {
-            addCriterion("vc_recorderid between", value1, value2, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderidNotBetween(Integer value1, Integer value2) {
-            addCriterion("vc_recorderid not between", value1, value2, "vc_recorderid");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderIsNull() {
-            addCriterion("vc_recorder is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderIsNotNull() {
-            addCriterion("vc_recorder is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderEqualTo(String value) {
-            addCriterion("vc_recorder =", value, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderNotEqualTo(String value) {
-            addCriterion("vc_recorder <>", value, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderGreaterThan(String value) {
-            addCriterion("vc_recorder >", value, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderGreaterThanOrEqualTo(String value) {
-            addCriterion("vc_recorder >=", value, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderLessThan(String value) {
-            addCriterion("vc_recorder <", value, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderLessThanOrEqualTo(String value) {
-            addCriterion("vc_recorder <=", value, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderLike(String value) {
-            addCriterion("vc_recorder like", value, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderNotLike(String value) {
-            addCriterion("vc_recorder not like", value, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderIn(List<String> values) {
-            addCriterion("vc_recorder in", values, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderNotIn(List<String> values) {
-            addCriterion("vc_recorder not in", values, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderBetween(String value1, String value2) {
-            addCriterion("vc_recorder between", value1, value2, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorderNotBetween(String value1, String value2) {
-            addCriterion("vc_recorder not between", value1, value2, "vc_recorder");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateIsNull() {
-            addCriterion("vc_recorddate is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateIsNotNull() {
-            addCriterion("vc_recorddate is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateEqualTo(Date value) {
-            addCriterion("vc_recorddate =", value, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateNotEqualTo(Date value) {
-            addCriterion("vc_recorddate <>", value, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateGreaterThan(Date value) {
-            addCriterion("vc_recorddate >", value, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateGreaterThanOrEqualTo(Date value) {
-            addCriterion("vc_recorddate >=", value, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateLessThan(Date value) {
-            addCriterion("vc_recorddate <", value, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateLessThanOrEqualTo(Date value) {
-            addCriterion("vc_recorddate <=", value, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateIn(List<Date> values) {
-            addCriterion("vc_recorddate in", values, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateNotIn(List<Date> values) {
-            addCriterion("vc_recorddate not in", values, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateBetween(Date value1, Date value2) {
-            addCriterion("vc_recorddate between", value1, value2, "vc_recorddate");
-            return (Criteria) this;
-        }
-
-        public Criteria andVc_recorddateNotBetween(Date value1, Date value2) {
-            addCriterion("vc_recorddate not between", value1, value2, "vc_recorddate");
-            return (Criteria) this;
-        }
-
         public Criteria andVc_statusIsNull() {
             addCriterion("vc_status is null");
             return (Criteria) this;

+ 0 - 6
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VerificationList.java

@@ -49,12 +49,6 @@ public class VerificationList extends CommonBaseEntity implements Serializable {
 
     private Double vc_amount2;
 
-    private Integer vc_recorderid;
-
-    private String vc_recorder;
-
-    private Date vc_recorddate;
-
     private String vc_status;
 
     private String vc_statuscode;

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

@@ -19,6 +19,7 @@ import com.usoftchina.saas.money.service.FundtransferService;
 import com.usoftchina.saas.page.PageRequest;
 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.Date;
@@ -47,11 +48,11 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
     private BankinformationMapper bankinformationMapper;
 
     @Override
+    @Transactional
     public DocBaseDTO insert(Fundtran fundtran) {
         Fundtransfer fundtransfer = fundtran.getMain();
         List<Fundtransferdetail> fundtransferdetails = fundtran.getItems();
 
-
         String ft_code = fundtransfer.getFt_code();
 
         //编号校验
@@ -111,6 +112,13 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         DocBaseDTO docBaseDTO = this.insert(fundtran);
         Long id = docBaseDTO.getId();
 
+        List<String> bankName = fundtransferMapper.checkAmount(BaseContextHolder.getCompanyId(), id);
+        if (bankName.size() > 0){
+            String name = org.apache.commons.lang3.StringUtils.join(bankName, ",");
+            String message = BizExceptionCode.BANK_AMOUNT_NOTENOUGHS.getMessage();
+            throw new BizException(500, String.format(message, name));
+        }
+
 
         //取从表金额更新中间表、资金账号表
         List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
@@ -126,6 +134,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             banksubledger.setBl_bankcode(fundtransferdetail.getFtd_inbankcode());
             banksubledger.setBl_bankname(fundtransferdetail.getFtd_inbankname());
             banksubledger.setBl_code(fundtransfer.getFt_code());
+
             banksubledger.setBl_kind("资金转账");
             banksubledger.setBl_date(fundtransfer.getFt_date());
             banksubledger.setBl_income(fundtransferdetail.getFtd_nowbalance());
@@ -282,23 +291,32 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
 
     @Override
     public void fundtransferBatchAudit(BatchDealBaseDTO baseDTO){
+        String validate = fundtransferMapper.validateAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
+
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();
             Fundtransfer fundtransfer = new Fundtransfer();
             fundtransfer.setId(Long.valueOf(docBaseDTO.getId()));
-            fundtransfer.setFt_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
-            fundtransfer.setFt_statuscode(Status.AUDITED.name());
             Fundtran fundtran = this.select(Math.toIntExact(fundtransfer.getId()));
-//            this.changBankUntil(fundtran);
             this.audit(fundtran);
-//            fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
         }
     }
 
     @Override
     public void fundtransferBatchUnAudit(BatchDealBaseDTO baseDTO){
         Iterator isList = baseDTO.getBaseDTOs().iterator();
+
+        String validate = fundtransferMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_UNAUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
+
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();
             this.unAudit(Math.toIntExact(docBaseDTO.getId()));

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

@@ -336,22 +336,29 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
 
     @Override
     public void othreceiptsBatchAudit(BatchDealBaseDTO baseDTO){
+        String validate = othreceiptsMapper.validateAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
+
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();
             Othreceipts othreceipts = new Othreceipts();
             othreceipts.setId(Long.valueOf(docBaseDTO.getId()));
-            othreceipts.setOr_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
-            othreceipts.setOr_statuscode(Status.AUDITED.name());
             Othte othte = this.select(Math.toIntExact(othreceipts.getId()));
-//            this.changBankUntil(othte);
             this.audit(othte);
-//            othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
         }
     }
 
     @Override
     public void othreceiptsBatchUnAudit(BatchDealBaseDTO baseDTO){
+        String validate = othreceiptsMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_UNAUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();

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

@@ -293,7 +293,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
             vendor.setVe_preamount(preamount);
             vendor.setVe_payamount(payamount + bk_amount);
-            vendor.setVe_leftamount(beginapamount + beginprepayamount - payamount + bk_amount + preamount);
+            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount + bk_amount - preamount);
             paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
 
             subledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他支出单",BaseContextHolder.getCompanyId());
@@ -331,22 +331,29 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
 
     @Override
     public void othspendingBatchAudit(BatchDealBaseDTO baseDTO){
+
+        String validate = othspendingsMapper.validateAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();
             Othspendings othspendings = new Othspendings();
             othspendings.setId(Long.valueOf(docBaseDTO.getId()));
-            othspendings.setOs_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
-            othspendings.setOs_statuscode(Status.AUDITED.name());
             Othsp othsp = this.select(Math.toIntExact(othspendings.getId()));
-//            this.changBankUntil(othsp);
             this.audit(othsp);
-//            othspendingsMapper.updateByPrimaryKeySelective(othspendings);
         }
     }
 
     @Override
     public void othspendingBatchUnAudit(BatchDealBaseDTO baseDTO){
+        String validate = othspendingsMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_UNAUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();

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

@@ -436,28 +436,28 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
 
     @Override
     public void paybalanceBatchAudit(BatchDealBaseDTO baseDTO){
+        String validate = paybalanceMapper.validateAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();
             Paybalance paybalance = new Paybalance();
             paybalance.setId(Long.valueOf(docBaseDTO.getId()));
-            paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
-            paybalance.setPb_statuscode(Status.AUDITED.name());
             Pay pay = this.select(Math.toIntExact(paybalance.getId()));
             this.audit(pay);
-//            Subledger subledger = this.changSubledgerUntil(pay.getMain());
-//            if (subledger.getSl_code() == null){
-//                subledgerMapper.insertSelective(subledger);
-//            }else {
-//                subledgerMapper.updateByPrimaryKeySelective(subledger);
-//            }
-//            this.changBankUntil(pay);
-//            paybalanceMapper.updateByPrimaryKeySelective(paybalance);
         }
     }
 
     @Override
     public void paybalanceBatchUnAudit(BatchDealBaseDTO baseDTO){
+        String validate = paybalanceMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_UNAUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();
@@ -515,32 +515,20 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         subledger.setSl_vendid(paybalance.getPb_vendid());
         subledger.setSl_date(paybalance.getPb_date());
         subledger.setSl_ym(DateUtils.getYm(paybalance.getPb_date()));
-        if (paybalance.getPb_pdamount() == null){
-            subledger.setSl_amount((double) 0);
-        }else {
-            subledger.setSl_amount(paybalance.getPb_pdamount() * -1);
+        Double pdamount = paybalance.getPb_pdamount()==null?new Double(0):paybalance.getPb_pdamount();
+        Double preamount = paybalance.getPb_preamount()==null?new Double(0):paybalance.getPb_preamount();
+        Double pbdamount = new Double(0);
+        subledger.setSl_amount(-pdamount);
+        subledger.setSl_yamount(preamount);
+        subledger.setSl_orderamount(pdamount);
+
+        if(preamount!=0){
+            pbdamount = paybalance.getPb_pbdamount()==null?new Double(0):paybalance.getPb_pbdamount();
         }
-        subledger.setSl_orderamount(paybalance.getPb_pdamount());
-
-        Double yamount = paybalance.getPb_preamount();
-        if (yamount == null){
-            yamount = Double.valueOf(0);
-        }
-        if (yamount > 0 || yamount < 0){
-            subledger.setSl_yamount(yamount);
-        }else {
-            subledger.setSl_yamount((double) 0);
-        }
-        if (subledger.getSl_orderamount() == null){
-            subledger.setSl_orderamount((double) 0);
-        }
-
-        if (subledger.getSl_discount() == null){
-            subledger.setSl_discount((double) 0);
-        }
-        subledger.setSl_namount(subledger.getSl_orderamount() + subledger.getSl_discount() - subledger.getSl_yamount());
+        subledger.setSl_namount(pdamount-pbdamount);
         subledger.setSl_remark(subledger.getSl_remark());
-        subledger.setSl_preamount(subledger.getSl_preamount());
+        subledger.setSl_preamount(preamount);
+
 
         subledgerMapper.insertSelective(subledger);
     }

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

@@ -441,28 +441,28 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
 
     @Override
     public void recbalanceBatchAudit(BatchDealBaseDTO baseDTO){
+        String validate = recbalanceMapper.validateAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();
             Recbalance recbalance = new Recbalance();
             recbalance.setId(Long.valueOf(docBaseDTO.getId()));
-            recbalance.setRb_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
-            recbalance.setRb_statuscode(Status.AUDITED.name());
             Rec rec = this.select(Math.toIntExact(recbalance.getId()));
             this.audit(rec);
-//            Subledger subledger = this.changSubledgerUntil(rec.getMain());
-//            if (subledger.getSl_code() == null){
-//                subledgerMapper.insertSelective(subledger);
-//            }else {
-//                subledgerMapper.updateByPrimaryKeySelective(subledger);
-//            }
-//            this.changBankUntil(rec);
-//            recbalanceMapper.updateByPrimaryKeySelective(recbalance);
         }
     }
 
     @Override
     public void recbalanceBatchUnAudit(BatchDealBaseDTO baseDTO){
+        String validate = recbalanceMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)){
+            String message = BizExceptionCode.DOCUMENTS_UNAUDITED.getMessage();
+            throw new BizException(500, String.format(message, validate));
+        }
         Iterator isList = baseDTO.getBaseDTOs().iterator();
         while (isList.hasNext()){
             DocBaseDTO docBaseDTO = (DocBaseDTO) isList.next();
@@ -521,11 +521,15 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         subledger.setSl_ym(DateUtils.getYm(recbalance.getRb_date()));
         Double rdamount = recbalance.getRb_rdamount()==null?new Double(0):recbalance.getRb_rdamount();
         Double preamount = recbalance.getRb_preamount()==null?new Double(0):recbalance.getRb_preamount();
+        Double pbdamount = new Double(0);
         subledger.setSl_amount(-rdamount);
         subledger.setSl_yamount(preamount);
         subledger.setSl_orderamount(rdamount);
 
-        subledger.setSl_namount(rdamount-preamount);
+        if(preamount!=0){
+            pbdamount = recbalance.getRb_rbdamount()==null?new Double(0):recbalance.getRb_rbdamount();
+        }
+        subledger.setSl_namount(rdamount-pbdamount);
         subledger.setSl_remark(subledger.getSl_remark());
         subledger.setSl_preamount(preamount);
 

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

@@ -147,7 +147,6 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             }
         }else{
             verification.setCompanyId(companyId);
-            verification.setVc_recorder(BaseContextHolder.getUserName());
             verification.setCreateTime(new Date());
             verification.setCreatorId(userId);
             verification.setCreatorName(BaseContextHolder.getUserName());

+ 28 - 0
applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml

@@ -270,4 +270,32 @@
   <select id="checkStatus" resultType="int">
     select count(1) from fundtransfer where ifnull(ft_statuscode,'')='AUDITED' and ft_id= #{id,jdbcType=INTEGER}
   </select>
+
+
+  <select id="validateAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(ft_code) from fundtransfer where ft_statuscode='AUDITED' and ft_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+  <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(ft_code) from fundtransfer where ft_statuscode='UNAUDITED' and ft_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+
+  <select id="checkAmount" resultType="java.lang.String">
+    select b.ftd_bankname from
+    (select a.ft_id,a.ft_code,a.companyid,a.ftd_bankid,a.ftd_bankcode,a.ftd_bankname,sum(a.ftd_nowbalance) ftd_nowbalance from
+    (SELECT ft_id,ft_code,fundtransfer.companyid,ftd_bankid,ftd_bankcode,ftd_bankname,-1*ftd_nowbalance ftd_nowbalance
+    FROM fundtransfer,fundtransferdetail
+    WHERE ft_id=ftd_ftid
+    UNION ALL select ft_id,ft_code,fundtransfer.companyid,ftd_inbankid,ftd_inbankcode,ftd_inbankname,ftd_nowbalance
+    FROM fundtransfer,fundtransferdetail
+    WHERE ft_id=ftd_ftid) a group by a.ft_id,a.ft_code,a.companyid,a.ftd_bankid,a.ftd_bankcode,a.ftd_bankname) b,
+    BANKINFORMATION
+    where b.ftd_bankid=BK_ID and 0 > ftd_nowbalance and abs(ftd_nowbalance)>bk_thisamount and b.companyid = #{companyId}
+     and b.ft_id = #{id}
+  </select>
 </mapper>

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

@@ -310,9 +310,8 @@
   </select>
   <select id="selectOthreceiptsBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="Detail_Column_List" />
-    from Othreceipts left join othreceiptsdetail on ord_orid=or_id and Othreceipts.companyId=othreceiptsdetail.companyId
+    <include refid="Base_Column_List" />
+    from Othreceipts
     <where>
       <if test="con != null">
         ${con}
@@ -348,4 +347,18 @@
   <select id="checkStatus" resultType="int">
     select count(1) from othreceipts where ifnull(or_statuscode,'')='AUDITED' and or_id= #{id,jdbcType=INTEGER}
   </select>
+
+
+  <select id="validateAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(or_code) from othreceipts where or_statuscode='AUDITED' and or_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+  <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(or_code) from othreceipts where or_statuscode='UNAUDITED' and or_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
 </mapper>

+ 15 - 4
applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml

@@ -306,10 +306,8 @@
 
   <select id="selectOthspendingsBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="Detail_Column_List" />
-    from Othspendings left join othspendingsdetail on osd_osid=os_id
-    and Othspendings.companyId=othspendingsdetail.companyId
+    <include refid="Base_Column_List" />
+    from Othspendings
     <where>
       <if test="con != null">
         ${con}
@@ -345,4 +343,17 @@
   <select id="checkStatus" resultType="int">
     select count(1) from othspendings where ifnull(os_statuscode,'')='AUDITED' and os_id= #{id,jdbcType=INTEGER}
   </select>
+
+  <select id="validateAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(os_code) from othspendings where os_statuscode='AUDITED' and os_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+  <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(os_code) from othspendings where os_statuscode='UNAUDITED' and os_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
 </mapper>

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

@@ -424,9 +424,8 @@
 
   <select id="selectPaybalanceBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="detail_Column_List" />
-    from paybalance left join paybalancedet on pd_pbid=pb_id and paybalance.companyId=paybalancedet.companyId
+    <include refid="Base_Column_List" />
+    from paybalance
     <where>
       <if test="con != null">
         ${con}
@@ -466,6 +465,19 @@
     where pb_id = #{id,jdbcType=INTEGER}
   </select>
 
+  <select id="validateAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(pb_code) from paybalance where pb_statuscode='AUDITED' and pb_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+  <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(pb_code) from paybalance where pb_statuscode='UNAUDITED' and pb_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+
   <!-- 银行账户-->
   <sql id="Bank_Column_List" >
     bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount,

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

@@ -138,9 +138,8 @@
 
   <select id="selectRecbalanceBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="detail_Column_List" />
-    from recbalance left join recbalancedet on rd_rbid=rb_id and recbalance.companyId=recbalancedet.companyId
+    <include refid="Base_Column_List" />
+    from recbalance
     <where>
       <if test="con != null">
         ${con}
@@ -589,6 +588,19 @@
     where rb_id = #{id,jdbcType=INTEGER}
   </select>
 
+  <select id="validateAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(rb_code) from recbalance where rb_statuscode='AUDITED' and rb_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+  <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(rb_code) from recbalance where rb_statuscode='UNAUDITED' and rb_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+
   <!-- 银行账户-->
   <sql id="Bank_Column_List" >
     bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount,

+ 0 - 3
applications/money/money-server/src/main/resources/mapper/VerificationListMapper.xml

@@ -19,9 +19,6 @@
         <result column="vc_turncustname" property="vc_turncustname" jdbcType="VARCHAR" />
         <result column="vc_amount1" property="vc_amount1" jdbcType="DOUBLE" />
         <result column="vc_amount2" property="vc_amount2" jdbcType="DOUBLE" />
-        <result column="vc_recorderid" property="vc_recorderid" jdbcType="INTEGER" />
-        <result column="vc_recorder" property="vc_recorder" jdbcType="VARCHAR" />
-        <result column="vc_recorddate" property="vc_recorddate" jdbcType="TIMESTAMP" />
         <result column="vc_status" property="vc_status" jdbcType="VARCHAR" />
         <result column="vc_statuscode" property="vc_statuscode" jdbcType="VARCHAR" />
         <result column="vc_remark" property="vc_remark" jdbcType="VARCHAR" />

+ 2 - 50
applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml

@@ -20,9 +20,6 @@
     <result column="vc_turncustname" property="vc_turncustname" jdbcType="VARCHAR" />
     <result column="vc_amount1" property="vc_amount1" jdbcType="DOUBLE" />
     <result column="vc_amount2" property="vc_amount2" jdbcType="DOUBLE" />
-    <result column="vc_recorderid" property="vc_recorderid" jdbcType="INTEGER" />
-    <result column="vc_recorder" property="vc_recorder" jdbcType="VARCHAR" />
-    <result column="vc_recorddate" property="vc_recorddate" jdbcType="TIMESTAMP" />
     <result column="vc_status" property="vc_status" jdbcType="VARCHAR" />
     <result column="vc_statuscode" property="vc_statuscode" jdbcType="VARCHAR" />
     <result column="vc_remark" property="vc_remark" jdbcType="VARCHAR" />
@@ -96,8 +93,7 @@
   <sql id="Base_Column_List" >
     vc_id, vc_code, vc_kind, vc_date, vc_vendid, vc_vendcode, vc_vendname, vc_custid, 
     vc_custcode, vc_custname, vc_turnvendid, vc_turnvendcode, vc_turnvendname, vc_turncustid, 
-    vc_turncustcode, vc_turncustname, vc_amount1, vc_amount2, vc_recorderid, vc_recorder, 
-    vc_recorddate, vc_status, vc_statuscode, vc_remark, companyId, updaterId, updateTime,
+    vc_turncustcode, vc_turncustname, vc_amount1, vc_amount2, vc_status, vc_statuscode, vc_remark, companyId, updaterId, updateTime,
     vc_text1, vc_text2, vc_text3, vc_text4, vc_text5
   </sql>
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.usoftchina.saas.money.po.VerificationExample" >
@@ -137,8 +133,7 @@
       vc_custname, vc_turnvendid, vc_turnvendcode, 
       vc_turnvendname, vc_turncustid, vc_turncustcode, 
       vc_turncustname, vc_amount1, vc_amount2, 
-      vc_recorderid, vc_recorder, vc_recorddate, 
-      vc_status, vc_statuscode, vc_remark, 
+      vc_status, vc_statuscode, vc_remark,
       companyId, updaterId, updateTime,
       vc_text1, vc_text2, vc_text3, 
       vc_text4, vc_text5)
@@ -148,7 +143,6 @@
       #{vc_custname,jdbcType=VARCHAR}, #{vc_turnvendid,jdbcType=INTEGER}, #{vc_turnvendcode,jdbcType=VARCHAR}, 
       #{vc_turnvendname,jdbcType=VARCHAR}, #{vc_turncustid,jdbcType=INTEGER}, #{vc_turncustcode,jdbcType=VARCHAR}, 
       #{vc_turncustname,jdbcType=VARCHAR}, #{vc_amount1,jdbcType=DOUBLE}, #{vc_amount2,jdbcType=DOUBLE}, 
-      #{vc_recorderid,jdbcType=INTEGER}, #{vc_recorder,jdbcType=VARCHAR}, #{vc_recorddate,jdbcType=TIMESTAMP}, 
       #{vc_status,jdbcType=VARCHAR}, #{vc_statuscode,jdbcType=VARCHAR}, #{vc_remark,jdbcType=VARCHAR},
       #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
       #{vc_text1,jdbcType=VARCHAR}, #{vc_text2,jdbcType=VARCHAR}, #{vc_text3,jdbcType=VARCHAR}, 
@@ -208,15 +202,6 @@
       <if test="vc_amount2 != null" >
         vc_amount2,
       </if>
-      <if test="vc_recorderid != null" >
-        vc_recorderid,
-      </if>
-      <if test="vc_recorder != null" >
-        vc_recorder,
-      </if>
-      <if test="vc_recorddate != null" >
-        vc_recorddate,
-      </if>
       <if test="vc_status != null" >
         vc_status,
       </if>
@@ -303,15 +288,6 @@
       <if test="vc_amount2 != null" >
         #{vc_amount2,jdbcType=DOUBLE},
       </if>
-      <if test="vc_recorderid != null" >
-        #{vc_recorderid,jdbcType=INTEGER},
-      </if>
-      <if test="vc_recorder != null" >
-        #{vc_recorder,jdbcType=VARCHAR},
-      </if>
-      <if test="vc_recorddate != null" >
-        #{vc_recorddate,jdbcType=TIMESTAMP},
-      </if>
       <if test="vc_status != null" >
         #{vc_status,jdbcType=VARCHAR},
       </if>
@@ -413,15 +389,6 @@
       <if test="record.vc_amount2 != null" >
         vc_amount2 = #{record.vc_amount2,jdbcType=DOUBLE},
       </if>
-      <if test="record.vc_recorderid != null" >
-        vc_recorderid = #{record.vc_recorderid,jdbcType=INTEGER},
-      </if>
-      <if test="record.vc_recorder != null" >
-        vc_recorder = #{record.vc_recorder,jdbcType=VARCHAR},
-      </if>
-      <if test="record.vc_recorddate != null" >
-        vc_recorddate = #{record.vc_recorddate,jdbcType=TIMESTAMP},
-      </if>
       <if test="record.vc_status != null" >
         vc_status = #{record.vc_status,jdbcType=VARCHAR},
       </if>
@@ -480,9 +447,6 @@
       vc_turncustname = #{record.vc_turncustname,jdbcType=VARCHAR},
       vc_amount1 = #{record.vc_amount1,jdbcType=DOUBLE},
       vc_amount2 = #{record.vc_amount2,jdbcType=DOUBLE},
-      vc_recorderid = #{record.vc_recorderid,jdbcType=INTEGER},
-      vc_recorder = #{record.vc_recorder,jdbcType=VARCHAR},
-      vc_recorddate = #{record.vc_recorddate,jdbcType=TIMESTAMP},
       vc_status = #{record.vc_status,jdbcType=VARCHAR},
       vc_statuscode = #{record.vc_statuscode,jdbcType=VARCHAR},
       vc_remark = #{record.vc_remark,jdbcType=VARCHAR},
@@ -552,15 +516,6 @@
       <if test="vc_amount2 != null" >
         vc_amount2 = #{vc_amount2,jdbcType=DOUBLE},
       </if>
-      <if test="vc_recorderid != null" >
-        vc_recorderid = #{vc_recorderid,jdbcType=INTEGER},
-      </if>
-      <if test="vc_recorder != null" >
-        vc_recorder = #{vc_recorder,jdbcType=VARCHAR},
-      </if>
-      <if test="vc_recorddate != null" >
-        vc_recorddate = #{vc_recorddate,jdbcType=TIMESTAMP},
-      </if>
       <if test="vc_status != null" >
         vc_status = #{vc_status,jdbcType=VARCHAR},
       </if>
@@ -616,9 +571,6 @@
       vc_turncustname = #{vc_turncustname,jdbcType=VARCHAR},
       vc_amount1 = #{vc_amount1,jdbcType=DOUBLE},
       vc_amount2 = #{vc_amount2,jdbcType=DOUBLE},
-      vc_recorderid = #{vc_recorderid,jdbcType=INTEGER},
-      vc_recorder = #{vc_recorder,jdbcType=VARCHAR},
-      vc_recorddate = #{vc_recorddate,jdbcType=TIMESTAMP},
       vc_status = #{vc_status,jdbcType=VARCHAR},
       vc_statuscode = #{vc_statuscode,jdbcType=VARCHAR},
       vc_remark = #{vc_remark,jdbcType=VARCHAR},

+ 13 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java

@@ -9,6 +9,7 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.purchase.po.ProdInOutList;
 import com.usoftchina.saas.purchase.service.ProdInOutService;
+import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -130,7 +131,12 @@ public class ProdInOutController {
      */
     @PostMapping("/batchAudit")
     public Result batchAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        return Result.success(prodInOutService.batchAudit(baseDTOs));
+        String mess = prodInOutService.batchAudit(baseDTOs);
+        if (StringUtils.hasLength(mess)){
+            return Result.error(mess);
+        }else {
+            return Result.success(mess);
+        }
     }
 
     /**
@@ -141,7 +147,12 @@ public class ProdInOutController {
      */
     @PostMapping("/batchUnAudit")
     public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        return Result.success(prodInOutService.batchUnAudit(baseDTOs));
+        String mess = prodInOutService.batchUnAudit(baseDTOs);
+        if (StringUtils.hasText(mess)){
+            return Result.error(mess);
+        }else {
+            return Result.success(mess);
+        }
     }
 
     /**

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

@@ -36,4 +36,6 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
     Integer validateVendor(@Param("id") Long id);
 
     Integer validateProduct(@Param("id") Long id);
+
+    void updateDelivery(@Param("id")Long id);
 }

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

@@ -20,10 +20,6 @@ public class PurchasePay  extends CommonBaseEntity implements Serializable {
 
     private String pu_vendname;
 
-    private String pb_recorder;
-
-    private Date pb_recorddate;
-
     private String pbd_slcode;
 
     private String pbd_slkind;

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

@@ -15,7 +15,6 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.api.ProductApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.page.PageRequest;
@@ -51,8 +50,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     @Autowired
     private PurchaseListMapper purchaseListMapper;
     @Autowired
-    private ProductApi productApi;
-    @Autowired
     private MaxnumberService maxnumberService;
     @Autowired
     private ProdInOutMapper prodInOutMapper;
@@ -143,7 +140,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 detail.setPd_puid(pu_id);
                 detail.setPd_code(pu_code);
                 detail.setPd_yqty(new Double(0));
-                detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
+//                detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
                 detail.setCompanyId(companyId);
                 detail.setCreatorId(userId);
                 detail.setCreateTime(new Date());
@@ -169,7 +166,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             PurchaseDetail detail = BeanMapper.map(item, PurchaseDetail.class);
             detail.setPd_puid(pu_id);
             detail.setPd_code(pu_code);
-            detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
+//            detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
             detail.setUpdaterId(userId);
             detail.setUpdateTime(new Date());
             if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
@@ -190,7 +187,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             purchasedetailMapper.batchUpdate(updateDetails);
         }
         baseDTO = getBaseDTOById(pu_id);
-
+        //明细需求日期为空时==主表交货日期
+        getMapper().updateDelivery(pu_id);
         //计算金额,未税单价,未税金额等
         calcPurchase(pu_id);
         //日志

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

@@ -115,7 +115,7 @@
 
   <select id="selectProdInOutListByCondition"  resultMap="BaseResultMap">
     select  *  from prodinout left join prodiodetail on pi_id = pd_piid left join vendor on pi_vendid=ve_id
-    left join product on pd_prodcode=pr_code
+    left join product on pd_prodid=pr_id
     <where>
       <if test="con != null">
         ${con}

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

@@ -439,6 +439,9 @@
     select count(1) from purchasedetail left join product on PD_PRODID=pr_id where  pd_puid=#{id} and pr_statuscode='CLOSE';
   </select>
 
+  <update id="updateDelivery" parameterType="long">
+    update purchasedetail set PD_DELIVERY = (select PU_DELIVERY from purchase where pu_id=#{id}) where pd_puid=#{id} and PD_DELIVERY is null
+  </update>
 
 
 </mapper>

+ 0 - 6
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutDTO.java

@@ -45,12 +45,6 @@ public class ProdInOutDTO extends CommonBaseDTO implements Serializable {
 
     private Double pi_total;
 
-    private Integer pi_recordmanid;
-
-    private String pi_recordman;
-
-    private Date pi_recorddate;
-
     private String pi_status;
 
     private String pi_statuscode;

+ 0 - 6
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutListDTO.java

@@ -41,12 +41,6 @@ public class ProdInOutListDTO extends CommonBaseDTO implements Serializable {
 
     private Double pi_total;
 
-    private Integer pi_recordmanid;
-
-    private String pi_recordman;
-
-    private Date pi_recorddate;
-
     private String pi_status;
 
     private String pi_statuscode;

+ 0 - 6
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java

@@ -38,12 +38,6 @@ public class SaleDTO extends CommonBaseDTO{
 
     private String sa_printstatuscode;
 
-    private Integer sa_recorderid;
-
-    private String sa_recorder;
-
-    private Date sa_recorddate;
-
     private String sa_remark;
 
     private String sa_text1;

+ 0 - 6
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java

@@ -39,12 +39,6 @@ public class Sale extends CommonBaseEntity{
 
     private String sa_printstatuscode;
 
-    private Long sa_recorderid;
-
-    private String sa_recorder;
-
-    private Date sa_recorddate;
-
     private String sa_text1;
 
     private String sa_text2;

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

@@ -43,12 +43,6 @@ public class SaleList implements Serializable {
 
     private String sa_printstatuscode;
 
-    private Integer sa_recorderid;
-
-    private String sa_recorder;
-
-    private Date sa_recorddate;
-
     private Date sa_date;
 
     private Integer companyid;

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

@@ -164,6 +164,9 @@ public class SaleServiceImpl implements SaleService{
             detail.setSd_code(sa_code);
             detail.setCompanyId(companyId);
             if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
+                detail.setCreatorId(userId);
+                detail.setCreatorName(BaseContextHolder.getUserName());
+                detail.setCreateTime(new Date());
                 insertDetails.add(detail);
             } else {
                 updateDetails.add(detail);

+ 2 - 3
applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -17,9 +17,6 @@
     <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
     <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
     <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
-    <result column="pi_recordmanid" jdbcType="INTEGER" property="pi_recordmanid" />
-    <result column="pi_recordman" jdbcType="VARCHAR" property="pi_recordman" />
-    <result column="pi_recorddate" jdbcType="TIMESTAMP" property="pi_recorddate" />
     <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
     <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
     <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
@@ -72,6 +69,8 @@
     <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
     <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
     <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
+    <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
   </resultMap>
 
 

+ 3 - 42
applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -17,9 +17,6 @@
     <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
     <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
     <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
-    <result column="pi_recordmanid" jdbcType="INTEGER" property="pi_recordmanid" />
-    <result column="pi_recordman" jdbcType="VARCHAR" property="pi_recordman" />
-    <result column="pi_recorddate" jdbcType="TIMESTAMP" property="pi_recorddate" />
     <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
     <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
     <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
@@ -102,8 +99,7 @@
   </sql>
   <sql id="Base_Column_List">
     pi_id, pi_inoutno, pi_class, pi_date, pi_vendid, pi_vendcode, pi_vendname, pi_custid, 
-    pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_recordmanid, 
-    pi_recordman, pi_recorddate, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode, 
+    pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode,
     companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5
   </sql>
   <sql id="Blob_Column_List">
@@ -125,8 +121,7 @@
       pi_vendname, pi_custid, pi_custcode, 
       pi_custname, pi_puid, pi_pucode, 
       pi_said, pi_sacode, pi_total, 
-      pi_recordmanid, pi_recordman, pi_recorddate, 
-      pi_status, pi_statuscode, pi_printstatus, 
+      pi_status, pi_statuscode, pi_printstatus,
       pi_printstatuscode, companyid, updaterid, 
       updatetime, pi_text1, pi_text2, 
       pi_text3, pi_text4, pi_text5,
@@ -136,8 +131,7 @@
       #{pi_vendname,jdbcType=VARCHAR}, #{pi_custid,jdbcType=INTEGER}, #{pi_custcode,jdbcType=VARCHAR}, 
       #{pi_custname,jdbcType=VARCHAR}, #{pi_puid,jdbcType=INTEGER}, #{pi_pucode,jdbcType=VARCHAR}, 
       #{pi_said}, #{pi_sacode,jdbcType=VARCHAR}, #{pi_total,jdbcType=DOUBLE},
-      #{pi_recordmanid,jdbcType=INTEGER}, #{pi_recordman,jdbcType=VARCHAR}, #{pi_recorddate,jdbcType=TIMESTAMP}, 
-      #{pi_status,jdbcType=VARCHAR}, #{pi_statuscode,jdbcType=VARCHAR}, #{pi_printstatus,jdbcType=VARCHAR}, 
+      #{pi_status,jdbcType=VARCHAR}, #{pi_statuscode,jdbcType=VARCHAR}, #{pi_printstatus,jdbcType=VARCHAR},
       #{pi_printstatuscode,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
       #{updatetime,jdbcType=TIMESTAMP}, #{pi_text1,jdbcType=VARCHAR}, #{pi_text2,jdbcType=VARCHAR}, 
       #{pi_text3,jdbcType=VARCHAR}, #{pi_text4,jdbcType=VARCHAR}, #{pi_text5,jdbcType=VARCHAR}, 
@@ -193,15 +187,6 @@
       <if test="pi_total != null">
         pi_total,
       </if>
-      <if test="pi_recordmanid != null">
-        pi_recordmanid,
-      </if>
-      <if test="pi_recordman != null">
-        pi_recordman,
-      </if>
-      <if test="pi_recorddate != null">
-        pi_recorddate,
-      </if>
       <if test="pi_status != null">
         pi_status,
       </if>
@@ -295,15 +280,6 @@
       <if test="pi_total != null">
         #{pi_total,jdbcType=DOUBLE},
       </if>
-      <if test="pi_recordmanid != null">
-        #{pi_recordmanid,jdbcType=INTEGER},
-      </if>
-      <if test="pi_recordman != null">
-        #{pi_recordman,jdbcType=VARCHAR},
-      </if>
-      <if test="pi_recorddate != null">
-        #{pi_recorddate,jdbcType=TIMESTAMP},
-      </if>
       <if test="pi_status != null">
         #{pi_status,jdbcType=VARCHAR},
       </if>
@@ -399,15 +375,6 @@
       <if test="pi_total != null">
         pi_total = #{pi_total,jdbcType=DOUBLE},
       </if>
-      <if test="pi_recordmanid != null">
-        pi_recordmanid = #{pi_recordmanid,jdbcType=INTEGER},
-      </if>
-      <if test="pi_recordman != null">
-        pi_recordman = #{pi_recordman,jdbcType=VARCHAR},
-      </if>
-      <if test="pi_recorddate != null">
-        pi_recorddate = #{pi_recorddate,jdbcType=TIMESTAMP},
-      </if>
       <if test="pi_status != null">
         pi_status = #{pi_status,jdbcType=VARCHAR},
       </if>
@@ -469,9 +436,6 @@
       pi_said = #{pi_said},
       pi_sacode = #{pi_sacode,jdbcType=VARCHAR},
       pi_total = #{pi_total,jdbcType=DOUBLE},
-      pi_recordmanid = #{pi_recordmanid,jdbcType=INTEGER},
-      pi_recordman = #{pi_recordman,jdbcType=VARCHAR},
-      pi_recorddate = #{pi_recorddate,jdbcType=TIMESTAMP},
       pi_status = #{pi_status,jdbcType=VARCHAR},
       pi_statuscode = #{pi_statuscode,jdbcType=VARCHAR},
       pi_printstatus = #{pi_printstatus,jdbcType=VARCHAR},
@@ -504,9 +468,6 @@
       pi_said = #{pi_said},
       pi_sacode = #{pi_sacode,jdbcType=VARCHAR},
       pi_total = #{pi_total,jdbcType=DOUBLE},
-      pi_recordmanid = #{pi_recordmanid,jdbcType=INTEGER},
-      pi_recordman = #{pi_recordman,jdbcType=VARCHAR},
-      pi_recorddate = #{pi_recorddate,jdbcType=TIMESTAMP},
       pi_status = #{pi_status,jdbcType=VARCHAR},
       pi_statuscode = #{pi_statuscode,jdbcType=VARCHAR},
       pi_printstatus = #{pi_printstatus,jdbcType=VARCHAR},

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

@@ -17,11 +17,8 @@
         <result column="sa_sendstatus" property="sa_sendstatus" jdbcType="VARCHAR" />
         <result column="sa_printstatus" property="sa_printstatus" jdbcType="VARCHAR" />
         <result column="sa_printstatuscode" property="sa_printstatuscode" jdbcType="VARCHAR" />
-        <result column="sa_recorderid" property="sa_recorderid" jdbcType="INTEGER" />
-        <result column="sa_recorder" property="sa_recorder" jdbcType="VARCHAR" />
         <result column="creatorname" property="creatorname" jdbcType="VARCHAR" />
         <result column="sa_auditman" property="sa_auditman" jdbcType="VARCHAR" />
-        <result column="sa_recorddate" property="sa_recorddate" jdbcType="TIMESTAMP" />
         <result column="companyid" property="companyid" jdbcType="INTEGER" />
         <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
         <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />

+ 3 - 38
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -17,9 +17,6 @@
     <result column="sa_sendstatus" property="sa_sendstatus" jdbcType="VARCHAR" />
     <result column="sa_printstatus" property="sa_printstatus" jdbcType="VARCHAR" />
     <result column="sa_printstatuscode" property="sa_printstatuscode" jdbcType="VARCHAR" />
-    <result column="sa_recorderid" property="sa_recorderid" jdbcType="INTEGER" />
-    <result column="sa_recorder" property="sa_recorder" jdbcType="VARCHAR" />
-    <result column="sa_recorddate" property="sa_recorddate" jdbcType="TIMESTAMP" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
@@ -40,7 +37,7 @@
   <sql id="Base_Column_List" >
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
     sa_remark, sa_status, sa_statuscode, sa_sendstatuscode, sa_sendstatus, sa_printstatus, 
-    sa_printstatuscode, sa_recorderid, sa_recorder, sa_recorddate, companyId, updaterId, 
+    sa_printstatuscode,companyId, updaterId,
     updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5,sa_auditman,sa_auditdate,
     sa_seller,sa_sellercode,sa_date
   </sql>
@@ -57,8 +54,7 @@
       sa_total, sa_totalupper, sa_remark, 
       sa_status, sa_statuscode, sa_sendstatuscode, 
       sa_sendstatus, sa_printstatus, sa_printstatuscode, 
-      sa_recorderid, sa_recorder, sa_recorddate, 
-      companyId, updaterId, updateTime, 
+      companyId, updaterId, updateTime,
       sa_text1, sa_text2, sa_text3, 
       sa_text4, sa_text5)
     values (#{sa_id,jdbcType=INTEGER}, #{sa_code,jdbcType=VARCHAR}, #{sa_custid,jdbcType=INTEGER}, 
@@ -66,8 +62,7 @@
       #{sa_total,jdbcType=DOUBLE}, #{sa_totalupper,jdbcType=VARCHAR}, #{sa_remark,jdbcType=VARCHAR}, 
       #{sa_status,jdbcType=VARCHAR}, #{sa_statuscode,jdbcType=VARCHAR}, #{sa_sendstatuscode,jdbcType=VARCHAR}, 
       #{sa_sendstatus,jdbcType=VARCHAR}, #{sa_printstatus,jdbcType=VARCHAR}, #{sa_printstatuscode,jdbcType=VARCHAR}, 
-      #{sa_recorderid,jdbcType=INTEGER}, #{sa_recorder,jdbcType=VARCHAR}, #{sa_recorddate,jdbcType=TIMESTAMP}, 
-      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
       #{sa_text1,jdbcType=VARCHAR}, #{sa_text2,jdbcType=VARCHAR}, #{sa_text3,jdbcType=VARCHAR}, 
       #{sa_text4,jdbcType=VARCHAR}, #{sa_text5,jdbcType=VARCHAR})
   </insert>
@@ -119,15 +114,6 @@
       <if test="sa_printstatuscode != null" >
         sa_printstatuscode,
       </if>
-      <if test="sa_recorderid != null" >
-        sa_recorderid,
-      </if>
-      <if test="sa_recorder != null" >
-        sa_recorder,
-      </if>
-      <if test="sa_recorddate != null" >
-        sa_recorddate,
-      </if>
       <if test="companyId != null" >
         companyId,
       </if>
@@ -205,15 +191,6 @@
       <if test="sa_printstatuscode != null" >
         #{sa_printstatuscode,jdbcType=VARCHAR},
       </if>
-      <if test="sa_recorderid != null" >
-        #{sa_recorderid,jdbcType=INTEGER},
-      </if>
-      <if test="sa_recorder != null" >
-        #{sa_recorder,jdbcType=VARCHAR},
-      </if>
-      <if test="sa_recorddate != null" >
-        #{sa_recorddate,jdbcType=TIMESTAMP},
-      </if>
       <if test="companyId != null" >
         #{companyId,jdbcType=INTEGER},
       </if>
@@ -294,15 +271,6 @@
       <if test="sa_printstatuscode != null" >
         sa_printstatuscode = #{sa_printstatuscode,jdbcType=VARCHAR},
       </if>
-      <if test="sa_recorderid != null" >
-        sa_recorderid = #{sa_recorderid,jdbcType=INTEGER},
-      </if>
-      <if test="sa_recorder != null" >
-        sa_recorder = #{sa_recorder,jdbcType=VARCHAR},
-      </if>
-      <if test="sa_recorddate != null" >
-        sa_recorddate = #{sa_recorddate,jdbcType=TIMESTAMP},
-      </if>
       <if test="companyId != null" >
         companyId = #{companyId,jdbcType=INTEGER},
       </if>
@@ -361,9 +329,6 @@
       sa_sendstatus = #{sa_sendstatus,jdbcType=VARCHAR},
       sa_printstatus = #{sa_printstatus,jdbcType=VARCHAR},
       sa_printstatuscode = #{sa_printstatuscode,jdbcType=VARCHAR},
-      sa_recorderid = #{sa_recorderid,jdbcType=INTEGER},
-      sa_recorder = #{sa_recorder,jdbcType=VARCHAR},
-      sa_recorddate = #{sa_recorddate,jdbcType=TIMESTAMP},
       companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updateTime = #{updateTime,jdbcType=TIMESTAMP},

+ 4 - 2
applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml

@@ -316,7 +316,8 @@
     sd_sendqty, sd_pdqty, sd_remark,
     companyId, updaterId, updateTime,
     sd_text1, sd_text2, sd_text3,
-    sd_text4, sd_text5)
+    sd_text4, sd_text5,
+    creatorId,createTime,creatorName)
     values
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
@@ -327,7 +328,8 @@
       #{item.sd_sendqty,jdbcType=DOUBLE}, #{item.sd_pdqty,jdbcType=DOUBLE}, #{item.sd_remark,jdbcType=VARCHAR},
       #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
       #{item.sd_text1,jdbcType=VARCHAR}, #{item.sd_text2,jdbcType=VARCHAR}, #{item.sd_text3,jdbcType=VARCHAR},
-      #{item.sd_text4,jdbcType=VARCHAR}, #{item.sd_text5,jdbcType=VARCHAR}
+      #{item.sd_text4,jdbcType=VARCHAR}, #{item.sd_text5,jdbcType=VARCHAR},
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

+ 2 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java

@@ -166,4 +166,6 @@ public class ProdInOutList extends CommonBaseEntity{
     private String pr_text2;
     private String pr_text3;
     private String pr_text4;
+    private String pi_prstatus;
+    private String pi_prstatuscode;
 }

+ 13 - 4
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java

@@ -9,6 +9,7 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.storage.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.storage.po.ProdInOutList;
 import com.usoftchina.saas.storage.service.ProdInOutService;
+import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -131,8 +132,12 @@ public class ProdInOutController {
      */
     @PostMapping("/batchAudit")
     public Result batchAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        String res = prodInOutService.batchAudit(baseDTOs);
-        return Result.success(res);
+        String mess = prodInOutService.batchAudit(baseDTOs);
+        if (StringUtils.hasLength(mess)){
+            return Result.error(mess);
+        }else {
+            return Result.success(mess);
+        }
     }
 
     /**
@@ -143,8 +148,12 @@ public class ProdInOutController {
      */
     @PostMapping("/batchUnAudit")
     public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        String res = prodInOutService.batchUnAudit(baseDTOs);
-        return Result.success(res);
+        String mess = prodInOutService.batchUnAudit(baseDTOs);
+        if (StringUtils.hasText(mess)){
+            return Result.error(mess);
+        }else {
+            return Result.success(mess);
+        }
     }
 
     /**

+ 0 - 1
applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml

@@ -53,7 +53,6 @@
     <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
     <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
     <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
-    <result column="pi_recorddate" jdbcType="TIMESTAMP" property="createTime" />
     <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
     <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
     <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -103,7 +103,7 @@
 
   <select id="selectProdInOutListByCondition"  resultMap="BaseResultMap">
     select  *  from prodinout left join prodiodetail on pi_id = pd_piid
-    left join product on pd_prodcode=pr_code
+    left join product on pd_prodid=pr_id
     <where>
       <if test="con != null">
         ${con}

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml

@@ -263,7 +263,7 @@
 
   <select id="checkUnPostStockProfit" resultType="int">
     select
-    count(*)
+    count(a.st_prodid)
     from
     (select pd_prodid,pd_whid from prodiodetail left join prodinout on pd_piid = pi_id
     where prodinout.companyId=#{companyId,jdbcType=INTEGER} and (pi_remark='盘盈单' or pi_remark='盘亏单')) b

+ 112 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountAddDTO.java

@@ -0,0 +1,112 @@
+package com.usoftchina.saas.account.dto;
+
+import java.io.Serializable;
+
+/**
+ * @author chenw
+ * @date 2018/11/27
+ */
+public class AccountAddDTO implements Serializable {
+
+    private String username;
+    /**
+     * 密文密码
+     */
+    private String password;
+    private String salt;
+    private String realname;
+    private String email;
+    private String mobile;
+    /**
+     * 账号类型 0 - 管理员
+     */
+    private Integer type;
+    private Long uu;
+    private String roleIds;
+
+    public String getRoleIds() {
+        return roleIds;
+    }
+
+    public void setRoleIds(String roleIds) {
+        this.roleIds = roleIds;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getSalt() {
+        return salt;
+    }
+
+    public void setSalt(String salt) {
+        this.salt = salt;
+    }
+
+    public String getRealname() {
+        return realname;
+    }
+
+    public void setRealname(String realname) {
+        this.realname = realname;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
+
+    @Override
+    public String toString() {
+        return "AccountCopyDTO{" +
+                "username='" + username + '\'' +
+                ", password='" + password + '\'' +
+                ", salt='" + salt + '\'' +
+                ", realname='" + realname + '\'' +
+                ", email='" + email + '\'' +
+                ", mobile='" + mobile + '\'' +
+                ", type=" + type +
+                ", uu=" + uu +
+                '}';
+    }
+}

+ 17 - 18
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/AccountController.java

@@ -108,30 +108,25 @@ public class AccountController {
     /**
      * SAAS手动添加账户,并默认绑定当前公司
      *
-     * @param accountCopyDTO
+     * @param accountAddDTO
      * @return
      */
     @PostMapping("/register/add")
-    public Result AddAccount(@RequestBody AccountCopyDTO accountCopyDTO) {
-        // 判断是否已注册
-        Account account = accountService.findByUsername(accountCopyDTO.getUsername());
-        if (null != account) {
-            return Result.error(ExceptionCode.USER_NAME_EXIST);
-        }
-        account = accountService.findByMobile(accountCopyDTO.getMobile());
-        if (null != account) {
-            return Result.error(ExceptionCode.USER_MOBILE_EXIST);
-        }
-        account = accountService.findByEmail(accountCopyDTO.getEmail());
-        if (null != account) {
-            return Result.error(ExceptionCode.USER_EMAIL_EXIST);
+    public Result AddAccount(@RequestBody AccountAddDTO accountAddDTO) {
+        Account account = null;
+        // 根据手机号、邮箱、用户名片段判断是否已注册
+        boolean checked = accountService.findByUsernameOrMobileOrEmail(accountAddDTO.getUsername(), accountAddDTO.getMobile(), accountAddDTO.getEmail());
+        if (!checked) {
+            account = BeanMapper.map(accountAddDTO, Account.class);
+            account.setEnabled(true);
+            accountService.save(account);
         }
-
-        account = BeanMapper.map(accountCopyDTO, Account.class);
-        account.setEnabled(true);
-        accountService.save(account);
+        account = accountService.findByMobile(accountAddDTO.getMobile());
         //绑定企业
         accountService.bindCompany(account.getId(), BaseContextHolder.getCompanyId());
+        //绑定角色
+        accountService.bindRoles(account.getId(), accountAddDTO.getRoleIds());
+        accountService.clearCache(account.getId());
         return Result.success();
     }
 
@@ -418,6 +413,10 @@ public class AccountController {
     @PostMapping("/enable")
     public Result enableAccount(@RequestParam long accountId) {
         accountService.enable(accountId);
+        //同步到优软云
+//        Long userUU = accountService.findByPrimaryKey(accountId).getUu();
+//        Long companyUU = companyService.findByPrimaryKey(BaseContextHolder.getCompanyId()).getUu();
+//        String result = ssoUserApi.bind("bind", "trade-app", userUU, companyUU);
         accountService.clearCache(accountId);
         return Result.success();
     }

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

@@ -113,4 +113,13 @@ public interface AccountMapper {
      * @return
      */
     int checkEmail(@Param("email") String email, @Param("companyId") Long companyId);
+
+    /**
+     * 查询用户是否已存在
+     * @param username
+     * @param mobile
+     * @param email
+     * @return
+     */
+    int findByUsernameOrMobileOrEmail(@Param("username") String username, @Param("mobile") String mobile, @Param("email") String email);
 }

+ 1 - 1
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/AccountRoleMapper.java

@@ -55,5 +55,5 @@ public interface AccountRoleMapper {
      * 解除账户绑定的所有角色
      * @param id
      */
-    void unBindRolesById(Long id);
+    void unBindRolesById(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -185,4 +185,13 @@ public interface AccountService {
      * @return
      */
     boolean checkEmail(String email);
+
+    /**
+     * 通过手机号、邮箱、用户名校验是否存在此用户
+     * @param username
+     * @param mobile
+     * @param email
+     * @return
+     */
+    boolean findByUsernameOrMobileOrEmail(String username, String mobile, String email);
 }

+ 6 - 1
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/AccountServiceImpl.java

@@ -125,7 +125,7 @@ public class AccountServiceImpl implements AccountService {
 
     @Override
     public void bindRoles(Long accountId, String roleIds) {
-        accountRoleMapper.unBindRolesById(accountId);
+        accountRoleMapper.unBindRolesById(accountId, BaseContextHolder.getCompanyId());
         String[] array = roleIds.split(",");
         for (int i = 0; i < array.length; i++){
             bindRole(accountId, Long.parseLong(array[i]));
@@ -204,4 +204,9 @@ public class AccountServiceImpl implements AccountService {
         return accountMapper.checkEmail(email, BaseContextHolder.getCompanyId()) > 0;
     }
 
+    @Override
+    public boolean findByUsernameOrMobileOrEmail(String username, String mobile, String email) {
+        return accountMapper.findByUsernameOrMobileOrEmail(username, mobile, email) > 0;
+    }
+
 }

+ 2 - 1
base-servers/account/account-server/src/main/resources/application.yml

@@ -53,7 +53,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
 server:
   port: 8580
   tomcat:
@@ -82,6 +82,7 @@ mybatis:
 auth:
   public-key: auth/pub.key
 sso:
+#  base-url: https://sso.ubtob.com
   base-url: http://192.168.253.12:32323
 ribbon:
   ReadTimeout: 6000

+ 4 - 0
base-servers/account/account-server/src/main/resources/mapper/AccountMapper.xml

@@ -206,4 +206,8 @@
         SELECT COUNT(*) FROM AC_ACCOUNT AA LEFT JOIN AC_ACCOUNT_COMPANY AAC ON AAC.ACCOUNT_ID = AA.ID
         WHERE AAC.COMPANY_ID = #{companyId} AND AA.EMAIL = #{email};
     </select>
+    <select id="findByUsernameOrMobileOrEmail" resultType="int">
+        SELECT COUNT(*) FROM AC_ACCOUNT
+        WHERE USERNAME = #{username} OR MOBILE = #{mobile} OR EMAIL = #{email};
+    </select>
 </mapper>

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

@@ -32,7 +32,7 @@
         </where>
         group by a.id,a.username,a.realname,a.email,a.mobile,a.enabled
     </select>
-    <delete id="unBindRolesById" parameterType="java.lang.Long">
-        DELETE FROM AC_ACCOUNT_ROLE WHERE ACCOUNT_ID = #{id}
+    <delete id="unBindRolesById" >
+        DELETE FROM AC_ACCOUNT_ROLE WHERE ACCOUNT_ID = #{id} and company_id = #{companyId}
     </delete>
 </mapper>

Some files were not shown because too many files changed in this diff