hy 7 years ago
parent
commit
5d27ba49ad
100 changed files with 5099 additions and 368 deletions
  1. 2 2
      applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MaxnumberService.java
  2. 22 16
      applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MessageLogService.java
  3. 5 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  4. 7 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Status.java
  5. 71 16
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java
  6. 11 8
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MessageLogService.java
  7. 26 17
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MessageLogServiceImpl.java
  8. 1 1
      applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/ProductApi.java
  9. 2 2
      applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/WarehouseApi.java
  10. 227 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bankinformation.java
  11. 128 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java
  12. 41 31
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendorcontact.java
  13. 2 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  14. 38 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BankinformationController.java
  15. 29 5
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java
  16. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java
  17. 28 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  18. 69 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java
  19. 20 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java
  20. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerMapper.java
  21. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomeraddressMapper.java
  22. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomercontactMapper.java
  23. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java
  24. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  25. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  26. 10 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorcontactMapper.java
  27. 15 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/BankinformationService.java
  28. 6 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerService.java
  29. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerkindService.java
  30. 30 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  31. 51 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java
  32. 23 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  33. 34 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  34. 69 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  35. 35 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  36. 21 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java
  37. 91 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  38. 7 6
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  39. 24 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java
  40. 25 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java
  41. 144 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  42. 23 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  43. 25 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  44. 329 0
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  45. 1 1
      applications/document/document-server/src/main/resources/mapper/CustomerMapper.xml
  46. 7 2
      applications/document/document-server/src/main/resources/mapper/CustomeraddressMapper.xml
  47. 10 2
      applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml
  48. 3 0
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  49. 49 0
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  50. 219 49
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml
  51. 1 1
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/mapper/CustomeraddressMapperTest.java
  52. 1 5
      applications/document/document-server/src/test/java/com/usoftchina/saas/document/mapper/CustomercontactMapperTest.java
  53. 9 3
      applications/money/money-server/pom.xml
  54. 2 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/MoneyApplicatiion.java
  55. 58 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/FundtransferController.java
  56. 6 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthreceiptsController.java
  57. 11 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthspengdingsController.java
  58. 12 9
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java
  59. 7 7
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/RecbalanceContorller.java
  60. 21 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/FundtransferMapper.java
  61. 18 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/FundtransferdetailMapper.java
  62. 28 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtran.java
  63. 175 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransfer.java
  64. 225 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransferdetail.java
  65. 24 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/FundtransferService.java
  66. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthspendingsService.java
  67. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/PaybalanceService.java
  68. 4 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/RecbalanceService.java
  69. 106 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  70. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  71. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  72. 6 6
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  73. 5 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  74. 241 0
      applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml
  75. 300 0
      applications/money/money-server/src/main/resources/mapper/FundtransferdetailMapper.xml
  76. 4 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  77. 7 6
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  78. 3 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  79. 3 3
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java
  80. 20 19
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  81. 6 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  82. 6 6
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  83. 9 1
      applications/sale/sale-dto/pom.xml
  84. 91 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdIODetailDTO.java
  85. 73 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutDTO.java
  86. 18 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutFormDTO.java
  87. 140 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutListDTO.java
  88. 28 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutReqDTO.java
  89. 4 12
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java
  90. 162 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java
  91. 4 4
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java
  92. 18 7
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdIODetailMapper.java
  93. 20 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutListMapper.java
  94. 36 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutMapper.java
  95. 2 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java
  96. 122 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java
  97. 634 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  98. 23 21
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  99. 297 25
      applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml
  100. 102 0
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

+ 2 - 2
applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MaxnumberService.java

@@ -18,7 +18,7 @@ public interface MaxnumberService {
      * @Author: guq
      * @Date: 2018/10/19 api/commons
      */
-    @PostMapping("/api/commons/number/pushMaxnubmer")
+    @PostMapping("/number/pushMaxnubmer")
     public Result<String> pushMaxnubmer(@RequestParam("count") Integer count,@RequestParam("code") String code,
                                 @RequestParam("caller") String caller);
     /**
@@ -28,6 +28,6 @@ public interface MaxnumberService {
      * @Author: guq
      * @Date: 2018/10/22
      */
-    @PostMapping("/api/commons/numnber/getMaxnumber")
+    @PostMapping("/numnber/getMaxnumber")
     public Result<String> getMaxnumber(@RequestParam("caller") String caller, @RequestParam("update") boolean update);
 }

+ 22 - 16
applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MessageLogService.java

@@ -1,9 +1,12 @@
 package com.usoftchina.saas.commons.api;
 
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.po.Operation;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.context.request.async.DeferredResult;
 
 /**
 * @Description: 日志接口
@@ -13,27 +16,30 @@ import org.springframework.web.bind.annotation.RequestMapping;
 @FeignClient("commons-server")
 public interface MessageLogService {
 
-    @RequestMapping("/api/commons/messagelog/save")
-    public void save(@RequestBody DocBaseDTO baseDTO);
+    @RequestMapping("/messagelog/save")
+    public String save(@RequestBody DocBaseDTO baseDTO);
 
-    @RequestMapping("/api/commons/messagelog/update")
-    public void update(@RequestBody DocBaseDTO baseDTO);
+    @RequestMapping("/messagelog/update")
+    public String update(@RequestBody DocBaseDTO baseDTO);
 
-    @RequestMapping("/api/commons/messagelog/delete")
-    public void delete(@RequestBody DocBaseDTO baseDTO);
+    @RequestMapping("/messagelog/delete")
+    public String delete(@RequestBody DocBaseDTO baseDTO);
 
-    @RequestMapping("/api/commons/messagelog/deleteDetail")
-    public void deleteDetail(@RequestBody DocBaseDTO baseDTO);
+    @RequestMapping("/messagelog/deleteDetail")
+    public String deleteDetail(@RequestBody DocBaseDTO baseDTO);
 
-    @RequestMapping("/api/commons/messagelog/audit")
-    public void audit(@RequestBody DocBaseDTO baseDTO);
+    @RequestMapping("/messagelog/audit")
+    public String audit(@RequestBody DocBaseDTO baseDTO);
 
-    @RequestMapping("/api/commons/messagelog/unAudit")
-    public void unAudit(@RequestBody DocBaseDTO baseDTO);
+    @RequestMapping("/messagelog/unAudit")
+    public String unAudit(@RequestBody DocBaseDTO baseDTO);
 
-    @RequestMapping("/api/commons/messagelog/close")
-    public void close(@RequestBody DocBaseDTO baseDTO);
+    @RequestMapping("/messagelog/close")
+    public String close(@RequestBody DocBaseDTO baseDTO);
 
-    @RequestMapping("/api/commons/messagelog/open")
-    public void open(@RequestBody DocBaseDTO baseDTO);
+    @RequestMapping("/messagelog/open")
+    public String open(@RequestBody DocBaseDTO baseDTO);
+
+    @RequestMapping("/messagelog/customizeLog")
+    public String customizeLog(@RequestBody DocBaseDTO baseDTO, @RequestParam("operation") Operation operation);
 }

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

@@ -22,6 +22,9 @@ public enum BizExceptionCode implements BaseExceptionCode {
     CODE_EXISTS(79200, "单据编号已存在"),
     BIZ_CLOSE(79301, "只能关闭已审核的单据"),
     BIZ_OPEN(79002, "只能打开已关闭的单据"),
+    NO_DATA(79998, "未找到数据"),
+    ILLEGAL_ID(79999, "id不正确"),
+
 
     //采购
 
@@ -30,6 +33,8 @@ public enum BizExceptionCode implements BaseExceptionCode {
     SALE_CLOSE(72001, "单据已关闭,无法进行操作"),
     SALE_YQTYBEYONDQTY(72001, "明细行已转数量大于数量"),
     SALE_NULL_BILL(72002, "单据不存在或者明细为空"),
+    SALEOUT_ALL_TURNIN(72003, "该销售出货单已全部转退货,无法转销售退货单"),
+    SALEOUT_POSTSTATUS_ERROR(72004,"单据状态异常,无法反审核"),
     //资金
 
     //库存

+ 7 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Status.java

@@ -11,6 +11,12 @@ public enum Status {
      */
     CLOSE("已关闭"),
 
+    /**
+     * 已开启
+     */
+    OPEN("已开启"),
+
+
     /**
      * 已审核
      */
@@ -44,7 +50,7 @@ public enum Status {
     /**
      * 未出库
      */
-    UNTURNOUT("未出库")
+    UNTURNOUT("未出库");
 
 
     ;

+ 71 - 16
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java

@@ -1,11 +1,17 @@
 package com.usoftchina.saas.commons.controller;
 
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.service.MessageLogService;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.context.request.async.DeferredResult;
+
+import java.util.concurrent.CompletableFuture;
 
 /**
  * @author: guq
@@ -19,42 +25,91 @@ public class MessageLogController {
     private MessageLogService messageLogService;
 
     @RequestMapping("/save")
-    public void save(@RequestBody DocBaseDTO baseDTO) {
-        messageLogService.save(baseDTO);
+    public DeferredResult<String> save(@RequestBody DocBaseDTO baseDTO) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> messageLogService.save(baseDTO))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
     }
 
     @RequestMapping("/update")
-    public void update(@RequestBody DocBaseDTO baseDTO) {
-        messageLogService.update(baseDTO);
+    public DeferredResult<String> update(@RequestBody DocBaseDTO baseDTO) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> messageLogService.update(baseDTO))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
     }
 
     @RequestMapping("/delete")
-    public void delete(@RequestBody DocBaseDTO baseDTO) {
-        messageLogService.delete(baseDTO);
+    public DeferredResult<String> delete(@RequestBody DocBaseDTO baseDTO) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> messageLogService.delete(baseDTO))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
     }
 
     @RequestMapping("/deleteDetail")
-    public void deleteDetail(@RequestBody DocBaseDTO baseDTO) {
-        messageLogService.deleteDetail(baseDTO);
+    public DeferredResult<String> deleteDetail(@RequestBody DocBaseDTO baseDTO) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> messageLogService.deleteDetail(baseDTO))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
     }
 
     @RequestMapping("/audit")
-    public void audit(@RequestBody DocBaseDTO baseDTO) {
-        messageLogService.audit(baseDTO);
+    public DeferredResult<String> audit(@RequestBody DocBaseDTO baseDTO) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> messageLogService.audit(baseDTO))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
     }
 
     @RequestMapping("/unAudit")
-    public void unAudit(@RequestBody DocBaseDTO baseDTO) {
-        messageLogService.unAudit(baseDTO);
+    public DeferredResult<String> unAudit(@RequestBody DocBaseDTO baseDTO) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> messageLogService.unAudit(baseDTO))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
     }
 
     @RequestMapping("/close")
-    public void close(@RequestBody DocBaseDTO baseDTO) {
-        messageLogService.close(baseDTO);
+    public DeferredResult<String> close(@RequestBody DocBaseDTO baseDTO) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> messageLogService.close(baseDTO))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
     }
 
     @RequestMapping("/open")
-    public void open(@RequestBody DocBaseDTO baseDTO) {
-        messageLogService.open(baseDTO);
+    public DeferredResult<String> open(@RequestBody DocBaseDTO baseDTO) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        CompletableFuture.supplyAsync(() -> messageLogService.open(baseDTO))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
+    }
+
+    /**
+    * @Description 自定义的Log
+    * @Param: [baseDTO]
+    * @return: org.springframework.web.context.request.async.DeferredResult<java.lang.String>
+    * @Author: guq
+    * @Date: 2018/10/25
+    */
+    @RequestMapping("/customizeLog")
+    public DeferredResult<String> customizeLog(@RequestBody DocBaseDTO baseDTO, @RequestParam Operation operation) {
+        // Create the deferredResult and initiate a callback object, task, with it
+        DeferredResult<String> deferredResult = new DeferredResult<>();
+        System.out.println(operation.getTitle() + "  : " + operation.getResult());
+        CompletableFuture.supplyAsync(() -> messageLogService.customizeLog(baseDTO, operation))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
     }
 }

+ 11 - 8
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MessageLogService.java

@@ -4,21 +4,24 @@ import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.mapper.MessagelogMapper;
 import com.usoftchina.saas.commons.po.Messagelog;
+import com.usoftchina.saas.commons.po.Operation;
 
 public interface MessageLogService extends CommonBaseService<MessagelogMapper, Messagelog>{
-    void save(DocBaseDTO baseDTO);
+    String save(DocBaseDTO baseDTO);
 
-    void update(DocBaseDTO baseDTO);
+    String update(DocBaseDTO baseDTO);
 
-    void delete(DocBaseDTO baseDTO);
+    String delete(DocBaseDTO baseDTO);
 
-    void deleteDetail(DocBaseDTO baseDTO);
+    String deleteDetail(DocBaseDTO baseDTO);
 
-    void audit(DocBaseDTO baseDTO);
+    String audit(DocBaseDTO baseDTO);
 
-    void unAudit(DocBaseDTO baseDTO);
+    String unAudit(DocBaseDTO baseDTO);
 
-    void close(DocBaseDTO baseDTO);
+    String close(DocBaseDTO baseDTO);
 
-    void open(DocBaseDTO baseDTO);
+    String open(DocBaseDTO baseDTO);
+
+    String customizeLog(DocBaseDTO baseDTO, Operation operation);
 }

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

@@ -7,6 +7,8 @@ import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.service.MessageLogService;
 import com.usoftchina.saas.context.BaseContextHolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.MessageSource;
 import org.springframework.stereotype.Service;
@@ -25,46 +27,52 @@ public class MessageLogServiceImpl extends CommonBaseServiceImpl<MessagelogMappe
     private MessageSource messageSource;
 
     @Override
-    public void save(DocBaseDTO baseDTO) {
-        log(Operation.SAVE, baseDTO);
+    public String save(DocBaseDTO baseDTO) {
+        return log(Operation.SAVE, baseDTO);
+
+    }
+
+    @Override
+    public String update(DocBaseDTO baseDTO) {
+        return log(Operation.UPDATE, baseDTO);
     }
 
     @Override
-    public void update(DocBaseDTO baseDTO) {
-        log(Operation.UPDATE, baseDTO);
+    public String delete(DocBaseDTO baseDTO) {
+        return log(Operation.DELETE, baseDTO);
     }
 
     @Override
-    public void delete(DocBaseDTO baseDTO) {
-        log(Operation.DELETE, baseDTO);
+    public String deleteDetail(DocBaseDTO baseDTO) {
+        return log(Operation.DELETEDETAIL, baseDTO);
     }
 
     @Override
-    public void deleteDetail(DocBaseDTO baseDTO) {
-        log(Operation.DELETEDETAIL, baseDTO);
+    public String audit(DocBaseDTO baseDTO) {
+        return log(Operation.AUDIT, baseDTO);
     }
 
     @Override
-    public void audit(DocBaseDTO baseDTO) {
-        log(Operation.AUDIT, baseDTO);
+    public String unAudit(DocBaseDTO baseDTO) {
+        return log(Operation.RESAUDIT, baseDTO);
     }
 
     @Override
-    public void unAudit(DocBaseDTO baseDTO) {
-        log(Operation.RESAUDIT, baseDTO);
+    public String close(DocBaseDTO baseDTO) {
+        return log(Operation.CLOSE, baseDTO);
     }
 
     @Override
-    public void close(DocBaseDTO baseDTO) {
-        log(Operation.CLOSE, baseDTO);
+    public String open(DocBaseDTO baseDTO) {
+        return log(Operation.OPEN, baseDTO);
     }
 
     @Override
-    public void open(DocBaseDTO baseDTO) {
-        log(Operation.OPEN, baseDTO);
+    public String customizeLog(DocBaseDTO baseDTO, Operation operation) {
+        return log(operation, baseDTO);
     }
 
-    private void log(Operation operation, DocBaseDTO baseDTO) {
+    private String log(Operation operation, DocBaseDTO baseDTO) {
         String language = "zh_CN";
         Messagelog msg = new Messagelog();
         msg.setMl_caller(baseDTO.getName());
@@ -76,6 +84,7 @@ public class MessageLogServiceImpl extends CommonBaseServiceImpl<MessagelogMappe
         msg.setCreatorId(BaseContextHolder.getUserId());
         msg.setMl_keyvalue(baseDTO.getId());
         getMapper().insert(msg);
+        return "success";
     }
 
     private String getLocalMessage(String msg, String language) {

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

@@ -29,6 +29,6 @@ public interface ProductApi {
     * @Author: guq
     * @Date: 2018/10/16
     */
-    @RequestMapping("/api/document/product/updateLatestPurchasePrice")
+    @RequestMapping("/product/updateLatestPurchasePrice")
     public void updateLatestPurchasePrice(@RequestParam(value = "id") Long pu_id);
 }

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

@@ -9,10 +9,10 @@ import java.util.Map;
 @FeignClient(name = "document-server")
 public interface WarehouseApi {
 
-    @GetMapping("/api/document/warehouse/post")
+    @GetMapping("/warehouse/post")
     public Result post(Map<String, Object> param);
 
-    @GetMapping("/api/document/warehouse/unPost")
+    @GetMapping("/warehouse/unPost")
     public Result unPost(Map<String, Object> param);
 
 }

+ 227 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bankinformation.java

@@ -0,0 +1,227 @@
+package com.usoftchina.saas.document.entities;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.util.Date;
+
+public class Bankinformation extends CommonBaseEntity {
+    private Integer bkId;
+
+    private String bkBankcode;
+
+    private String bkBankname;
+
+    private Date bkDate;
+
+    private String bkType;
+
+    private Double bkBeginamount;
+
+    private Double bkThisamount;
+
+    private String bkStatus;
+
+    private String bkStatuscode;
+
+    private Integer bkRecorderid;
+
+    private String bkRecorder;
+
+    private Date bkRecorddate;
+
+    private Integer bkYm;
+
+    private Integer companyid;
+
+    private Integer updaterid;
+
+    private Date updatetime;
+
+    private String bkText1;
+
+    private String bkText2;
+
+    private String bkText3;
+
+    private String bkText4;
+
+    private String bkText5;
+
+    private String bkRemark;
+
+    public Integer getBkId() {
+        return bkId;
+    }
+
+    public void setBkId(Integer bkId) {
+        this.bkId = bkId;
+    }
+
+    public String getBkBankcode() {
+        return bkBankcode;
+    }
+
+    public void setBkBankcode(String bkBankcode) {
+        this.bkBankcode = bkBankcode == null ? null : bkBankcode.trim();
+    }
+
+    public String getBkBankname() {
+        return bkBankname;
+    }
+
+    public void setBkBankname(String bkBankname) {
+        this.bkBankname = bkBankname == null ? null : bkBankname.trim();
+    }
+
+    public Date getBkDate() {
+        return bkDate;
+    }
+
+    public void setBkDate(Date bkDate) {
+        this.bkDate = bkDate;
+    }
+
+    public String getBkType() {
+        return bkType;
+    }
+
+    public void setBkType(String bkType) {
+        this.bkType = bkType == null ? null : bkType.trim();
+    }
+
+    public Double getBkBeginamount() {
+        return bkBeginamount;
+    }
+
+    public void setBkBeginamount(Double bkBeginamount) {
+        this.bkBeginamount = bkBeginamount;
+    }
+
+    public Double getBkThisamount() {
+        return bkThisamount;
+    }
+
+    public void setBkThisamount(Double bkThisamount) {
+        this.bkThisamount = bkThisamount;
+    }
+
+    public String getBkStatus() {
+        return bkStatus;
+    }
+
+    public void setBkStatus(String bkStatus) {
+        this.bkStatus = bkStatus == null ? null : bkStatus.trim();
+    }
+
+    public String getBkStatuscode() {
+        return bkStatuscode;
+    }
+
+    public void setBkStatuscode(String bkStatuscode) {
+        this.bkStatuscode = bkStatuscode == null ? null : bkStatuscode.trim();
+    }
+
+    public Integer getBkRecorderid() {
+        return bkRecorderid;
+    }
+
+    public void setBkRecorderid(Integer bkRecorderid) {
+        this.bkRecorderid = bkRecorderid;
+    }
+
+    public String getBkRecorder() {
+        return bkRecorder;
+    }
+
+    public void setBkRecorder(String bkRecorder) {
+        this.bkRecorder = bkRecorder == null ? null : bkRecorder.trim();
+    }
+
+    public Date getBkRecorddate() {
+        return bkRecorddate;
+    }
+
+    public void setBkRecorddate(Date bkRecorddate) {
+        this.bkRecorddate = bkRecorddate;
+    }
+
+    public Integer getBkYm() {
+        return bkYm;
+    }
+
+    public void setBkYm(Integer bkYm) {
+        this.bkYm = bkYm;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+
+    public Integer getUpdaterid() {
+        return updaterid;
+    }
+
+    public void setUpdaterid(Integer updaterid) {
+        this.updaterid = updaterid;
+    }
+
+    public Date getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(Date updatetime) {
+        this.updatetime = updatetime;
+    }
+
+    public String getBkText1() {
+        return bkText1;
+    }
+
+    public void setBkText1(String bkText1) {
+        this.bkText1 = bkText1 == null ? null : bkText1.trim();
+    }
+
+    public String getBkText2() {
+        return bkText2;
+    }
+
+    public void setBkText2(String bkText2) {
+        this.bkText2 = bkText2 == null ? null : bkText2.trim();
+    }
+
+    public String getBkText3() {
+        return bkText3;
+    }
+
+    public void setBkText3(String bkText3) {
+        this.bkText3 = bkText3 == null ? null : bkText3.trim();
+    }
+
+    public String getBkText4() {
+        return bkText4;
+    }
+
+    public void setBkText4(String bkText4) {
+        this.bkText4 = bkText4 == null ? null : bkText4.trim();
+    }
+
+    public String getBkText5() {
+        return bkText5;
+    }
+
+    public void setBkText5(String bkText5) {
+        this.bkText5 = bkText5 == null ? null : bkText5.trim();
+    }
+
+    public String getBkRemark() {
+        return bkRemark;
+    }
+
+    public void setBkRemark(String bkRemark) {
+        this.bkRemark = bkRemark == null ? null : bkRemark.trim();
+    }
+}

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

@@ -0,0 +1,128 @@
+package com.usoftchina.saas.document.entities;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class VendorList implements Serializable {
+
+    /* 主表字段 */
+    private Long ve_id;
+    /**
+     * 供应商编号
+     */
+    private String ve_code;
+    /**
+     * 供应商名称
+     */
+    private String ve_name;
+    /**
+     * 供应商UU
+     */
+    private String ve_uu;
+    /**
+     * 供应商类型
+     */
+    private String ve_type;
+    /**
+     * 期初日期
+     */
+    private Date ve_begindate;
+    /**
+     * 期初应付
+     */
+    private long ve_beginapamount;
+    /**
+     * 期初预付
+     */
+    private long ve_beginprepayamount;
+    /**
+     * 承付天数
+     */
+    private long ve_promisedays;
+    /**
+     * 税率
+     */
+    private double ve_taxrate;
+    /**
+     * 纳税人识别号
+     */
+    private String ve_nsrzh;
+    /**
+     * 银行账号
+     */
+    private String ve_bankaccount;
+    /**
+     * 银行行号
+     */
+    private String ve_bankcode;
+    /**
+     * 状态   defualt "启用"
+     */
+    private String ve_status;
+    /**
+     * 状态码
+     */
+    private String ve_statuscode;
+    /**
+     * 录入人ID
+     */
+    private long ve_recordid;
+    /**
+     * 录入人
+     */
+    private String ve_recordname;
+    /**
+     * 建立日期
+     */
+    private Date ve_initdate;
+    /**
+     * 自定义字段
+     */
+    private String ve_text1;
+    /**
+     * 自定义字段
+     */
+    private String ve_text2;
+    /**
+     * 自定义字段
+     */
+    private String ve_text3;
+    /**
+     * 自定义字段
+     */
+    private String ve_text4;
+    /**
+     * 自定义字段
+     */
+    private String ve_text5;
+
+    /* 从表字段 */
+
+    private Integer vc_veid;
+
+    private Integer vc_detno;
+
+    private String vc_name;
+
+    private Integer vc_tel;
+
+    private String vc_qq;
+
+    private String vc_email;
+
+    private String vc_text1;
+
+    private String vc_text2;
+
+    private String vc_text3;
+
+    private String vc_text4;
+
+    private String vc_text5;
+
+    private String vc_default;
+
+}

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

@@ -6,7 +6,7 @@ import java.io.Serializable;
 import java.util.Date;
 
 public class Vendorcontact extends CommonBaseEntity implements Serializable {
-    private Integer vc_veid;
+    private Long vc_veid;
 
     private Integer vc_detno;
 
@@ -18,21 +18,23 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
 
     private String vc_email;
 
-    private String ve_text1;
+    private String vc_text1;
 
-    private String ve_text2;
+    private String vc_text2;
 
-    private String ve_text3;
+    private String vc_text3;
 
-    private String ve_text4;
+    private String vc_text4;
 
-    private String ve_text5;
+    private String vc_text5;
 
-    public Integer getVc_veid() {
+    private String vc_default;
+
+    public Long getVc_veid() {
         return vc_veid;
     }
 
-    public void setVc_veid(Integer vc_veid) {
+    public void setVc_veid(Long vc_veid) {
         this.vc_veid = vc_veid;
     }
 
@@ -49,7 +51,7 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
     }
 
     public void setVc_name(String vc_name) {
-        this.vc_name = vc_name == null ? null : vc_name.trim();
+        this.vc_name = vc_name;
     }
 
     public Integer getVc_tel() {
@@ -65,7 +67,7 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
     }
 
     public void setVc_qq(String vc_qq) {
-        this.vc_qq = vc_qq == null ? null : vc_qq.trim();
+        this.vc_qq = vc_qq;
     }
 
     public String getVc_email() {
@@ -73,46 +75,54 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
     }
 
     public void setVc_email(String vc_email) {
-        this.vc_email = vc_email == null ? null : vc_email.trim();
+        this.vc_email = vc_email;
+    }
+
+    public String getVc_text1() {
+        return vc_text1;
+    }
+
+    public void setVc_text1(String vc_text1) {
+        this.vc_text1 = vc_text1;
     }
 
-    public String getVe_text1() {
-        return ve_text1;
+    public String getVc_text2() {
+        return vc_text2;
     }
 
-    public void setVe_text1(String ve_text1) {
-        this.ve_text1 = ve_text1 == null ? null : ve_text1.trim();
+    public void setVc_text2(String vc_text2) {
+        this.vc_text2 = vc_text2;
     }
 
-    public String getVe_text2() {
-        return ve_text2;
+    public String getVc_text3() {
+        return vc_text3;
     }
 
-    public void setVe_text2(String ve_text2) {
-        this.ve_text2 = ve_text2 == null ? null : ve_text2.trim();
+    public void setVc_text3(String vc_text3) {
+        this.vc_text3 = vc_text3;
     }
 
-    public String getVe_text3() {
-        return ve_text3;
+    public String getVc_text4() {
+        return vc_text4;
     }
 
-    public void setVe_text3(String ve_text3) {
-        this.ve_text3 = ve_text3 == null ? null : ve_text3.trim();
+    public void setVc_text4(String vc_text4) {
+        this.vc_text4 = vc_text4;
     }
 
-    public String getVe_text4() {
-        return ve_text4;
+    public String getVc_text5() {
+        return vc_text5;
     }
 
-    public void setVe_text4(String ve_text4) {
-        this.ve_text4 = ve_text4 == null ? null : ve_text4.trim();
+    public void setVc_text5(String vc_text5) {
+        this.vc_text5 = vc_text5;
     }
 
-    public String getVe_text5() {
-        return ve_text5;
+    public String getVc_default() {
+        return vc_default;
     }
 
-    public void setVe_text5(String ve_text5) {
-        this.ve_text5 = ve_text5 == null ? null : ve_text5.trim();
+    public void setVc_default(String vc_default) {
+        this.vc_default = vc_default;
     }
 }

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

@@ -11,9 +11,9 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableEurekaClient
 //@EnableAuthClient
 @EnableTransactionManagement
-@EnableFeignClients
+@EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.document.mapper")
-public class DocumentApplication {
+public class DocumentApplication  {
 
     public static void main(String[] args) {
         SpringApplication.run(DocumentApplication.class);

+ 38 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BankinformationController.java

@@ -0,0 +1,38 @@
+package com.usoftchina.saas.document.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.document.entities.Bankinformation;
+import com.usoftchina.saas.document.service.BankinformationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author heqw
+ * @date 2018/10/25 15:33
+ **/
+@RestController
+@RequestMapping("/bankinformation")
+public class BankinformationController {
+    @Autowired
+    BankinformationService bankinformationService;
+
+    @PostMapping("/save")
+    public Result save(@RequestBody Bankinformation bankinformation){
+        bankinformationService.save(bankinformation);
+        return Result.success();
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") int id){
+        bankinformationService.removeByPrimaryKey(id);
+        return Result.success();
+    }
+
+    @GetMapping("/getAll")
+    public Result getAll(){
+        List<Bankinformation> bankinformationList = bankinformationService.findAll();
+        return Result.success(bankinformationList);
+    }
+}

+ 29 - 5
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java

@@ -66,12 +66,36 @@ public class CustomerController {
      * @param id
      * @return
      */
-    @GetMapping("/delete/{id}")
+    @PostMapping("/delete/{id}")
     public Result delete(@PathVariable("id") Long id) {
         customerService.delete(id);
         return Result.success();
     }
 
+    /**
+     * 客户联系人删除
+     *
+     * @param id
+     * @return
+     */
+    @PostMapping("/deletecontact/{id}")
+    public Result deletecontact(@PathVariable("id") Long id) {
+        customerService.deletecontact(id);
+        return Result.success();
+    }
+
+    /**
+     * 客户地址删除
+     *
+     * @param id
+     * @return
+     */
+    @PostMapping("/deleteaddress/{id}")
+    public Result deleteaddress(@PathVariable("id") Long id) {
+        customerService.deleteaddress(id);
+        return Result.success();
+    }
+
     /**
      * 采购订单批量删除
      *
@@ -92,8 +116,8 @@ public class CustomerController {
      */
     @PostMapping("/close/{id}")
     public Result close(@PathVariable(value = "id") long id){
-        customerService.close(id);
-        return Result.success();
+        DocBaseDTO close = customerService.close(id);
+        return Result.success(close);
     }
 
     /**
@@ -104,8 +128,8 @@ public class CustomerController {
      */
     @PostMapping("/open/{id}")
     public Result open(@PathVariable(value = "id") long id){
-        customerService.open(id);
-        return Result.success();
+        DocBaseDTO open = customerService.open(id);
+        return Result.success(open);
     }
 
 

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java

@@ -34,4 +34,9 @@ public class CustomerkindController {
         return Result.success(customerkindList);
     }
 
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        List<Customerkind> customerkindList = customerkindService.getCombo();
+        return Result.success(customerkindList);
+    }
 }

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

@@ -6,10 +6,12 @@ import com.usoftchina.saas.base.Result;
 
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocReqDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.service.ProductService;
 import com.usoftchina.saas.page.PageRequest;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -22,9 +24,15 @@ public class ProductController {
     @Autowired
     private ProductService productService;
 
+    /**
+     * 通过条件查找物料
+     * @param page      分页对象
+     * @param listReqDTO    条件对象
+     * @return  Result<List<ProductDTO>>
+     */
     @RequestMapping("/getProductsByCondition")
-    public Result<List<ProductDTO>> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO){
-        PageInfo<ProductDTO> productList = productService.getProductsByCondition(page, docReqDTO);
+    public Result<List<ProductDTO>> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO){
+        PageInfo<ProductDTO> productList = productService.getProductsByCondition(page, listReqDTO);
         return Result.success(productList);
     }
 
@@ -44,4 +52,22 @@ public class ProductController {
         return productService.getProductsByPK(id);
     }
 
+    @PostMapping("/save")
+    public Result save(@RequestBody Product product){
+        productService.save(product);
+        return Result.success();
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        productService.removeByPrimaryKey(id);
+        return Result.success();
+    }
+
+    @PostMapping("/close/{id}")
+    public Result close(@PathVariable("id") Long id){
+        productService.close(id);
+        return Result.success();
+    }
+
 }

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

@@ -3,10 +3,12 @@ package com.usoftchina.saas.document.controller;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.dto.VendorListDTO;
+import com.usoftchina.saas.document.entities.VendorList;
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,16 +23,81 @@ public class VendorController {
     @Autowired
     private VendorService vendorService;
 
+    /**
+     * 获取供应商信息
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
     @GetMapping("/getVendorsByCondition")
     public Result<List<VendorDTO>> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO){
         PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(page, listReqDTO);
         return Result.success(vendorList);
     }
 
+    /**
+     * 通过供应商ID查找  供应商主从表数据
+     * @param id
+     * @return
+     */
     @GetMapping("/getListById/{id}")
     public Result<VendorListDTO> getDataById(@PathVariable("id") Long id){
-//        List<> vendorService.getListById(id);
-        return null;
+        VendorListDTO vendorListDTO = vendorService.getListById(id);
+        return Result.success(vendorListDTO);
+    }
+
+    /**
+     * 获取 供应商列表数据,包含供应商主表、从表数据
+     * @param listReqDTO
+     * @return
+     */
+    @GetMapping("/getListDataByCondition")
+    public Result<List<VendorList>> getListDataByCondition(ListReqDTO listReqDTO){
+        return Result.success(vendorService.getListDataByCondition(listReqDTO));
+    }
+
+    /**
+     * 保存供应商资料, 主从表数据
+     * @param vendorListDTO
+     * @return
+     */
+    @PostMapping("/save")
+    public Result saveFormData(@RequestBody VendorListDTO vendorListDTO){
+        DocBaseDTO docBaseDTO = vendorService.saveFormData(vendorListDTO);
+        return Result.success(docBaseDTO);
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        vendorService.deleteById(id);
+        return Result.success();
+    }
+
+    /**
+     * 关闭
+     * @param id
+     * @return
+     */
+    @PostMapping("/close/{id}")
+    public Result close(@PathVariable("id") Long id){
+        vendorService.close(id);
+        return Result.success();
+    }
+
+    /**
+     * 开启
+     * @param id
+     * @return
+     */
+    @PostMapping("/open/{id}")
+    public Result open(@PathVariable("id") Long id){
+        vendorService.open(id);
+        return Result.success();
     }
 
 }

+ 20 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java

@@ -0,0 +1,20 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.document.entities.Bankinformation;
+
+public interface BankinformationMapper extends CommonBaseMapper<Bankinformation> {
+    int deleteByPrimaryKey(Integer bkId);
+
+    int insert(Bankinformation record);
+
+    int insertSelective(Bankinformation record);
+
+    Bankinformation selectByPrimaryKey(Integer bkId);
+
+    int updateByPrimaryKeySelective(Bankinformation record);
+
+    int updateByPrimaryKeyWithBLOBs(Bankinformation record);
+
+    int updateByPrimaryKey(Bankinformation record);
+}

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

@@ -4,7 +4,7 @@ import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.document.entities.Customer;
 
 public interface CustomerMapper extends CommonBaseMapper<Customer> {
-    int deleteByPrimaryKey(Integer cu_id);
+    int deleteByPrimaryKey(Long cu_id);
 
     int insertSelective(Customer record);
 

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

@@ -22,4 +22,6 @@ public interface CustomeraddressMapper extends CommonBaseMapper<Customer> {
     void batchInsert(List<Customeraddress> list);
 
     void batchUpdate(List<Customeraddress> list);
+
+    void deleteByFK(Long id);
 }

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

@@ -21,4 +21,6 @@ public interface CustomercontactMapper extends CommonBaseMapper<Customercontact>
     void batchInsert(List<Customercontact> insertDetail1);
 
     void batchUpdate(List<Customercontact> updateDetail1);
+
+    void deleteByFK(Long id);
 }

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

@@ -3,6 +3,8 @@ package com.usoftchina.saas.document.mapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.document.entities.Customerkind;
 
+import java.util.List;
+
 public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
     int deleteByPrimaryKey(Long id);
 
@@ -15,4 +17,6 @@ public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
     int updateByPrimaryKeySelective(Customerkind record);
 
     int updateByPrimaryKey(Customerkind record);
+
+    List<Customerkind> getCombo();
 }

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

@@ -6,12 +6,13 @@ import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 public interface ProductMapper extends CommonBaseMapper<Product> {
 
-    List<ProductDTO> getProductsByCondition(DocReqDTO docReqDTO);
+    List<ProductDTO> getProductsByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
     List<ComboDTO> getProdUnit();
     void updateLatestPurchasePrice(Long pu_id);
 

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java

@@ -4,7 +4,9 @@ import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 
 
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.document.dto.VendorListDTO;
 import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.entities.VendorList;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -13,4 +15,5 @@ public interface VendorMapper extends CommonBaseMapper<Vendor> {
 
     List<VendorDTO> getVendorsByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
 
+    List<VendorList> getListDataByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
 }

+ 10 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorcontactMapper.java

@@ -3,6 +3,8 @@ package com.usoftchina.saas.document.mapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.document.entities.Vendorcontact;
 
+import java.util.List;
+
 public interface VendorcontactMapper extends CommonBaseMapper<Vendorcontact> {
     int deleteByPrimaryKey(Long vc_id);
 
@@ -15,4 +17,12 @@ public interface VendorcontactMapper extends CommonBaseMapper<Vendorcontact> {
     int updateByPrimaryKeySelective(Vendorcontact record);
 
     int updateByPrimaryKey(Vendorcontact record);
+
+    List<Vendorcontact> selectByFK(Long id);
+
+    void batchInsert(List<Vendorcontact> vendorcontactList);
+
+    void batchUpdate(List<Vendorcontact> vendorcontactList);
+
+    void deleteByFK(Long id);
 }

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

@@ -0,0 +1,15 @@
+package com.usoftchina.saas.document.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.document.entities.Bankinformation;
+import com.usoftchina.saas.document.mapper.BankinformationMapper;
+
+/**
+ * @author heqw
+ * @date 2018/10/25 15:36
+ **/
+public interface BankinformationService extends CommonBaseService<BankinformationMapper, Bankinformation> {
+    boolean save(Bankinformation bankinformation);
+
+    boolean removeByPrimaryKey(int id);
+}

+ 6 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerService.java

@@ -24,9 +24,13 @@ public interface CustomerService extends CommonBaseService<CustomerMapper, Custo
 
     void delete(Long id);
 
-    void close(long id);
+    DocBaseDTO close(long id);
 
-    void open(long id);
+    DocBaseDTO open(long id);
 
     void batchDelete(BatchDealBaseDTO baseDTOs);
+
+    void deletecontact(Long id);
+
+    void deleteaddress(Long id);
 }

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

@@ -4,6 +4,10 @@ import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 
+import java.util.List;
+
 public interface CustomerkindService extends CommonBaseService<CustomerkindMapper, Customerkind> {
 
+    List<Customerkind> getCombo();
+
 }

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

@@ -5,7 +5,8 @@ import com.usoftchina.saas.base.service.CommonBaseService;
 
 
 import com.usoftchina.saas.commons.dto.ComboDTO;
-import com.usoftchina.saas.commons.dto.DocReqDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
@@ -16,12 +17,38 @@ import java.util.List;
 
 public interface ProductService extends CommonBaseService<ProductMapper, Product> {
 
-
-    PageInfo<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO);
+    /**
+     * 获取物料
+     * @param page      分页对象
+     * @param listReqDTO    条件对象
+     * @return  PageInfo<ProductDTO>
+     */
+    PageInfo<ProductDTO> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO);
 
     List<ComboDTO> getProdUnit();
 
     void updateLatestPurchasePrice(Long pu_id);
 
     Product getProductsByPK(Long id);
+
+    /**
+     * 保存/更新
+     * @param product
+     * @return
+     */
+    DocBaseDTO saveData(Product product);
+
+    /**
+     * 关闭
+     * @param id
+     * @return
+     */
+    boolean close(Long id);
+
+    /**
+     * 开启
+     * @param id
+     * @return
+     */
+    boolean open(Long id);
 }

+ 51 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java

@@ -3,18 +3,67 @@ package com.usoftchina.saas.document.service;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 
-
-import com.usoftchina.saas.commons.dto.DocReqDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.document.dto.VendorListDTO;
 import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.entities.VendorList;
 import com.usoftchina.saas.document.mapper.VendorMapper;
 
 import com.usoftchina.saas.page.PageRequest;
 
+import java.util.List;
+
 
 public interface VendorService extends CommonBaseService<VendorMapper, Vendor>{
 
+    /**
+     * 获取主表数据
+     * @param page      分页对象
+     * @param listReqDTO    条件对象
+     * @return  PageInfo<VendorDTO>
+     */
     PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO);
 
+    /**
+     * 通过ID 获取主从表数据
+     * @param id
+     * @return VendorListDTO
+     */
+    VendorListDTO getListById(Long id);
+
+    /**
+     * 获取供应商资料列表
+     * @param listReqDTO  条件对象
+     * @return List<VendorList>
+     */
+    List<VendorList> getListDataByCondition(ListReqDTO listReqDTO);
+
+    /**
+     * 保存主从表数据
+     * @param vendorListDTO
+     * @return  DocBaseDTO
+     */
+    DocBaseDTO saveFormData(VendorListDTO vendorListDTO);
+
+    /**
+     * 通过主表ID  删除主从表数据
+     * @param id
+     */
+    void deleteById(Long id);
+
+    /**
+     * 关闭
+     * @param id
+     * @return  boolean
+     */
+    boolean close(Long id);
+
+    /**
+     * 开启
+     * @param id
+     * @return  boolean
+     */
+    boolean open(Long id);
 }

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

@@ -1,6 +1,10 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.po.Messagelog;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Address;
 import com.usoftchina.saas.document.mapper.AddressMapper;
 import com.usoftchina.saas.document.service.AddressService;
@@ -12,6 +16,10 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
 
     @Autowired
     private AddressMapper addressMapper;
+    @Autowired
+    private MessageLogService messageLogService;
+
+
 
     /**
      * 保存
@@ -20,7 +28,16 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
      */
     @Override
     public boolean save(Address address){
-        addressMapper.insertSelective(address);
+        if(address.getId() == 0){
+            address.setCompanyId(BaseContextHolder.getCompanyId());
+            addressMapper.insertSelective(address);
+            //记录LOG
+            messageLogService.save(generateMsgObj(address.getId()));
+        }else{
+            addressMapper.updateByPrimaryKeySelective(address);
+            //记录LOG
+            messageLogService.update(generateMsgObj(address.getId()));
+        }
         return true;
     }
 
@@ -33,6 +50,7 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
             addressMapper.deleteByPrimaryKey(id);
+            messageLogService.delete(generateMsgObj(id));
         }
         return true;
     }
@@ -47,4 +65,8 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
             addressMapper.deleteByIds(ids);
         }
     }
+
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "Address");
+    }
 }

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

@@ -0,0 +1,34 @@
+package com.usoftchina.saas.document.service.impl;
+
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.document.entities.Bankinformation;
+import com.usoftchina.saas.document.mapper.BankinformationMapper;
+import com.usoftchina.saas.document.service.BankinformationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author heqw
+ * @date 2018/10/25 15:36
+ **/
+@Service
+public class BankinformationServiceImpl extends CommonBaseServiceImpl<BankinformationMapper, Bankinformation> implements BankinformationService {
+    @Autowired
+    private BankinformationMapper bankinformationMapper;
+
+    @Override
+    public boolean save(Bankinformation bankinformation){
+        if(bankinformation.getBkId() == 0){
+            bankinformationMapper.insertSelective(bankinformation);
+        }else{
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+        }
+        return true;
+    }
+
+    @Override
+    public boolean removeByPrimaryKey(int id){
+        bankinformationMapper.deleteByPrimaryKey(id);
+        return true;
+    }
+}

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

@@ -6,6 +6,8 @@ import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.CustomerDTO;
 import com.usoftchina.saas.document.dto.CustomerFormDTO;
@@ -150,7 +152,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             if (insertDetail2.size()>0) {
                 customeraddressMapper.batchInsert(insertDetail2);
             }
-//            baseDTO = getBaseDTOById(pu_id);
+            baseDTO = getBaseDTOById(cu_id);
             //日志记录
 //            messageLogService.save(baseDTO);
             return baseDTO;
@@ -210,22 +212,81 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
 
     @Override
     public void delete(Long id) {
+        singleDelete(id);
+    }
 
+    private void singleDelete(Long id) {
+        if (null!=id) {
+            //主表删除
+            getMapper().deleteByPrimaryKey(id);
+            //从表删除
+            customercontactMapper.deleteByFK(id);
+            customeraddressMapper.deleteByFK(id);
+            //日志
+//            messageLogService.delete(docBaseDTO);
+        }
     }
 
     @Override
-    public void close(long id) {
+    public void batchDelete(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
 
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            singleDelete(base.getId());
+        }
     }
 
     @Override
-    public void open(long id) {
+    public void deletecontact(Long id) {
+        customercontactMapper.deleteByPrimaryKey(id);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+//        messageLogService.deleteDetail(docBaseDTO);
+    }
 
+    @Override
+    public void deleteaddress(Long id) {
+        customeraddressMapper.deleteByPrimaryKey(id);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+//        messageLogService.deleteDetail(docBaseDTO);
     }
 
     @Override
-    public void batchDelete(BatchDealBaseDTO baseDTOs) {
+    public DocBaseDTO close(long id) {
+        Customer customer = getMapper().selectByPrimaryKey(id);
+        if(Status.CLOSE.name().equals(customer.getCu_statuscode())){
+            throw new BizException(BizExceptionCode.BIZ_CLOSE);
+        }
+        customer = new Customer();
+        customer.setId(id);
+        customer.setCu_statuscode(Status.CLOSE.name());
+        customer.setCu_status(Status.CLOSE.getDisplay());
+        getMapper().updateByPrimaryKeySelective(customer);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+//        messageLogService.close(docBaseDTO);
+        return docBaseDTO;
+    }
 
+    @Override
+    public DocBaseDTO open(long id) {
+        Customer customer = getMapper().selectByPrimaryKey(id);
+        if(Status.OPEN.name().equals(customer.getCu_statuscode())){
+            throw new BizException(BizExceptionCode.BIZ_OPEN);
+        }
+        customer = new Customer();
+        customer.setId(id);
+        customer.setCu_statuscode(Status.OPEN.name());
+        customer.setCu_status(Status.OPEN.getDisplay());
+        getMapper().updateByPrimaryKeySelective(customer);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+//        messageLogService.close(docBaseDTO);
+        return docBaseDTO;
     }
 
     private List<CustomerList> getListByMode(ListReqDTO req) {
@@ -259,4 +320,8 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         return baseDTO;
     }
 
+
+
+
+
 }

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

@@ -1,17 +1,24 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 import com.usoftchina.saas.document.service.CustomerkindService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindMapper, Customerkind> implements CustomerkindService {
 
     @Autowired
     private CustomerkindMapper customerkindMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     /**
      * 保存
@@ -21,17 +28,44 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     @Override
     public boolean save(Customerkind customerkind){
         if(customerkind.getId() == 0){
+            customerkind.setCompanyId(BaseContextHolder.getCompanyId());
             customerkindMapper.insertSelective(customerkind);
+            //记录LOG
+            messageLogService.save(generateMsgObj(customerkind.getId()));
         }else{
             customerkindMapper.updateByPrimaryKeySelective(customerkind);
+            //记录LOG
+            messageLogService.update(generateMsgObj(customerkind.getId()));
         }
         return true;
     }
 
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
     @Override
     public boolean removeByPrimaryKey(Long id){
-        customerkindMapper.deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            customerkindMapper.deleteByPrimaryKey(id);
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "CustomerKind");
+    }
+
+    @Override
+    public List<Customerkind> getCombo() {
+        List<Customerkind> customerkindList = getMapper().getCombo();
+        return customerkindList;
+    }
 }

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

@@ -1,10 +1,14 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Fundinouttype;
 import com.usoftchina.saas.document.mapper.FundinouttypeMapper;
 import com.usoftchina.saas.document.service.FundinouttypeService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -12,6 +16,9 @@ import java.util.List;
 @Service
 public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<FundinouttypeMapper, Fundinouttype> implements FundinouttypeService {
 
+    @Autowired
+    private MessageLogService messageLogService;
+
     /**
      * 保存/更新
      * @param fundinouttype
@@ -19,11 +26,15 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
      */
     @Override
     public boolean save(Fundinouttype fundinouttype){
-        fundinouttype.setCompanyId(BaseContextHolder.getCompanyId());
         if(fundinouttype.getId() == 0){
+            fundinouttype.setCompanyId(BaseContextHolder.getCompanyId());
             getMapper().insertSelective(fundinouttype);
+            //记录LOG
+            messageLogService.save(generateMsgObj(fundinouttype.getId()));
         }else{
             getMapper().updateByPrimaryKeySelective(fundinouttype);
+            //记录LOG
+            messageLogService.update(generateMsgObj(fundinouttype.getId()));
         }
         return true;
     }
@@ -35,8 +46,16 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
      */
     @Override
     public boolean removeByPrimaryKey(Long id){
-        getMapper().deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            getMapper().deleteByPrimaryKey(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, null, "FundInOutType");
+    }
+
 }

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

@@ -3,13 +3,20 @@ package com.usoftchina.saas.document.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.ComboDTO;
-import com.usoftchina.saas.commons.dto.DocReqDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.Status;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
 import com.usoftchina.saas.document.service.ProductService;
+import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -17,8 +24,11 @@ import java.util.List;
 @Service
 public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Product> implements ProductService {
 
+    @Autowired
+    private MessageLogService messageLogService;
+
     @Override
-    public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
+    public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO) {
         //设置分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -26,7 +36,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<ProductDTO> productList = getMapper().getProductsByCondition(docReqDTO);
+        List<ProductDTO> productList = getList(listReqDTO);
         //取分页信息
         PageInfo<ProductDTO> pageInfo = new PageInfo<ProductDTO>(productList);
         return pageInfo;
@@ -40,13 +50,90 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     @Override
     public void updateLatestPurchasePrice(Long pu_id) {
         getMapper().updateLatestPurchasePrice(pu_id);
+        messageLogService.update(generateMsgObj(pu_id));
     }
 
     @Override
     public Product getProductsByPK(Long id) {
-        if (null == id) {
+        if (null != id) {
             return getMapper().selectByPrimaryKey(id);
         }
         return null;
     }
+
+    @Override
+    public DocBaseDTO saveData(Product product){
+        DocBaseDTO docBaseDTO = null;
+        if(product.getId() == 0){
+            product.setCompanyId(BaseContextHolder.getCompanyId());
+            getMapper().insertSelective(product);
+            docBaseDTO = generateMsgObj(product.getId());
+            //记录LOG
+            messageLogService.save(docBaseDTO);
+        }else{
+            getMapper().updateByPrimaryKeySelective(product);
+            docBaseDTO = generateMsgObj(product.getId());
+            //记录LOG
+            messageLogService.update(docBaseDTO);
+        }
+        return docBaseDTO;
+    }
+
+    @Override
+    public boolean close(Long id) {
+        if(id != null && id > 0){
+            Product product = new Product();
+            product.setId(id);
+            product.setPr_status(Status.CLOSE.getDisplay());
+            product.setPr_statuscode(Status.CLOSE.name());
+            getMapper().updateByPrimaryKeySelective(product);
+            //记录LOG
+            messageLogService.close(generateMsgObj(id));
+            return true;
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public boolean open(Long id) {
+        if(id != null && id > 0){
+            Product product = getMapper().selectByPrimaryKey(id);
+            if (product == null) {
+                throw new BizException(BizExceptionCode.NO_DATA);
+            }
+            if (!Status.CLOSE.getDisplay().equals(product.getPr_status())){
+                throw new BizException(BizExceptionCode.BIZ_OPEN);
+            }else{
+                product.setId(id);
+                product.setPr_statuscode(Status.OPEN.name());
+                product.setPr_status(Status.OPEN.getDisplay());
+                getMapper().updateByPrimaryKeySelective(product);
+                //记录LOG
+                messageLogService.open(generateMsgObj(id));
+                return true;
+            }
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    private List<ProductDTO> getList(ListReqDTO listReqDTO){
+        Long companyId = BaseContextHolder.getCompanyId();
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        List<ProductDTO> productDTOList = getMapper().getProductsByCondition(condition, companyId);
+        return productDTOList;
+    }
+
+    /**
+     * 构造日记记录对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "Product");
+    }
 }

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

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Productbrand;
@@ -14,10 +15,10 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
 
     @Autowired
     private ProductbrandMapper productbrandMapper;
-//    @Autowired
-//    private MessageLogService messageLogService;
+    @Autowired
+    private MessageLogService messageLogService;
 
-    private final String LOG_NAME = "物料品牌";
+    private final String LOG_NAME = "ProductBrand";
 
     @Override
     public boolean save(Productbrand productbrand){
@@ -26,12 +27,12 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
             productbrandMapper.insertSelective(productbrand);
             //记录日志
             DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
-//            messageLogService.save(docBaseDTO);
+            messageLogService.save(docBaseDTO);
         }else{
             productbrandMapper.updateByPrimaryKeySelective(productbrand);
             //记录日志
             DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
-//            messageLogService.update(docBaseDTO);
+            messageLogService.update(docBaseDTO);
         }
         return true;
     }
@@ -41,7 +42,7 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
         productbrandMapper.deleteByPrimaryKey(id);
         //记录日志
         DocBaseDTO docBaseDTO = new DocBaseDTO(id, null, LOG_NAME);
-//        messageLogService.delete(docBaseDTO);
+        messageLogService.delete(docBaseDTO);
         return true;
     }
 

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

@@ -1,6 +1,9 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Producttype;
 import com.usoftchina.saas.document.mapper.ProducttypeMapper;
 import com.usoftchina.saas.document.service.ProducttypeService;
@@ -14,6 +17,8 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
 
     @Autowired
     private ProducttypeMapper producttypeMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     /**
      * 保存
@@ -23,9 +28,14 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
     @Override
     public boolean save(Producttype producttype){
         if(producttype.getId() == 0){
+            producttype.setCompanyId(BaseContextHolder.getCompanyId());
             producttypeMapper.insertSelective(producttype);
+            //记录LOG
+            messageLogService.save(generateMsgObj(producttype.getId()));
         }else{
             producttypeMapper.updateByPrimaryKeySelective(producttype);
+            //记录LOG
+            messageLogService.update(generateMsgObj(producttype.getId()));
         }
         return true;
     }
@@ -37,8 +47,21 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
      */
     @Override
     public boolean removeByPrimaryKey(Long id){
-        producttypeMapper.deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            producttypeMapper.deleteByPrimaryKey(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "ProductType");
+    }
+
 }

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

@@ -1,10 +1,13 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Productunit;
 import com.usoftchina.saas.document.mapper.ProductunitMapper;
 import com.usoftchina.saas.document.service.ProductunitService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -12,20 +15,31 @@ import java.util.List;
 @Service
 public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMapper, Productunit> implements ProductunitService {
 
+    @Autowired
+    private MessageLogService messageLogService;
+
     @Override
     public boolean save(Productunit productunit){
-        productunit.setCompanyId(BaseContextHolder.getCompanyId());
         if(productunit.getId() == 0){
+            productunit.setCompanyId(BaseContextHolder.getCompanyId());
             getMapper().insertSelective(productunit);
+            //记录LOG
+            messageLogService.save(generateMsgObj(productunit.getId()));
         }else{
             getMapper().updateByPrimaryKeySelective(productunit);
+            //记录LOG
+            messageLogService.update(generateMsgObj(productunit.getId()));
         }
         return true;
     }
 
     @Override
     public boolean removeByPrimaryKey(Long id){
-        getMapper().deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            getMapper().deleteByPrimaryKey(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
@@ -35,4 +49,13 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
         return productunitList;
     }
 
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "ProductUnit");
+    }
+
 }

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

@@ -3,15 +3,23 @@ package com.usoftchina.saas.document.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
-import com.usoftchina.saas.commons.dto.DocReqDTO;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.document.dto.VendorListDTO;
 import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.entities.VendorList;
+import com.usoftchina.saas.document.entities.Vendorcontact;
 import com.usoftchina.saas.document.mapper.VendorMapper;
+import com.usoftchina.saas.document.mapper.VendorcontactMapper;
 import com.usoftchina.saas.document.service.VendorService;
+import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.utils.BeanMapper;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -23,6 +31,11 @@ import java.util.List;
 @Service
 public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendor> implements VendorService {
 
+    @Autowired
+    private VendorcontactMapper vendorcontactMapper;
+    @Autowired
+    private MessageLogService messageLogService;
+
     @Override
     public PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO) {
         //设置分页
@@ -38,6 +51,126 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         return pageInfo;
     }
 
+    /**
+     * 通过ID查找主从表数据
+     * @param id
+     * @return
+     */
+    @Override
+    public VendorListDTO getListById(Long id) {
+        VendorListDTO vendorListDTO = new VendorListDTO();
+        Vendor vendor = getMapper().selectByPrimaryKey(id);
+        List<Vendorcontact> vendorcontactList = vendorcontactMapper.selectByFK(id);
+        //设置主从表信息
+        vendorListDTO.setMain(vendor);
+        vendorListDTO.setItems(vendorcontactList);
+        return vendorListDTO;
+    }
+
+    /**
+     * 返回列表数据
+     * @return
+     */
+    public List<VendorList> getListDataByCondition(ListReqDTO listReqDTO){
+        String condition = listReqDTO.getFinalCondition();
+        return getMapper().getListDataByCondition(condition, BaseContextHolder.getCompanyId());
+    }
+
+    /**
+     * 保存主从表数据
+     * @param vendorListDTO
+     */
+    @Override
+    public DocBaseDTO saveFormData(VendorListDTO vendorListDTO) {
+        Vendor main = vendorListDTO.getMain();
+        main.setCompanyId(BaseContextHolder.getCompanyId());
+        List<Vendorcontact> items = vendorListDTO.getItems();
+        if(main.getId() == 0){
+            //保存主表信息
+            getMapper().insertSelective(main);
+            Long mainId = main.getId();
+            //更新明细表vc_veid
+            for(Vendorcontact item : items){
+                item.setVc_veid(mainId);
+                item.setCompanyId(BaseContextHolder.getCompanyId());
+            }
+            //保存明细表信息
+            vendorcontactMapper.batchInsert(items);
+            //记录LOG
+            messageLogService.save(generateMsgObj(mainId));
+        }else{
+            getMapper().updateByPrimaryKeySelective(main);
+            vendorcontactMapper.batchUpdate(items);
+            //记录LOG
+            messageLogService.update(generateMsgObj(main.getId()));
+        }
+        return generateMsgObj(main.getId());
+    }
+
+    /**
+     * 删除主从表数据
+     * @param id
+     */
+    @Override
+    public void deleteById(Long id) {
+        if(id != null && id > 0){
+            getMapper().deleteByPrimaryKey(id);
+            vendorcontactMapper.deleteByFK(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
+    }
+
+    /**
+     * 关闭
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean close(Long id){
+        if(id != null && id > 0){
+            Vendor vendor = new Vendor();
+            vendor.setId(id);
+            vendor.setVe_status(Status.CLOSE.getDisplay());
+            vendor.setVe_statuscode(Status.CLOSE.name());
+            getMapper().updateByPrimaryKeySelective(vendor);
+            //记录LOG
+            messageLogService.close(generateMsgObj(id));
+            return true;
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    /**
+     * 开启
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean open(Long id){
+        if (id != null && id > 0){
+            Vendor vendor = getMapper().selectByPrimaryKey(id);
+            if(vendor == null){
+                throw new BizException(BizExceptionCode.NO_DATA);
+            }
+            if (Status.CLOSE.name().equals(vendor.getVe_statuscode())){
+                vendor = new Vendor();
+                vendor.setId(id);
+                vendor.setVe_statuscode(Status.OPEN.name());
+                vendor.setVe_status(Status.OPEN.getDisplay());
+                getMapper().updateByPrimaryKeySelective(vendor);
+                //记录LOG
+                messageLogService.open(generateMsgObj(id));
+                return true;
+            }else {
+                throw new BizException(BizExceptionCode.BIZ_OPEN);
+            }
+        }else {
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
     private List<VendorDTO> getList(ListReqDTO listReqDTO){
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();
@@ -48,4 +181,13 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         return vendorDTOList;
     }
 
+    /**
+     * 构造日记记录对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "Vendor");
+    }
+
 }

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

@@ -1,6 +1,9 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Vendorkind;
 import com.usoftchina.saas.document.mapper.VendorkindMapper;
 import com.usoftchina.saas.document.service.VendorkindService;
@@ -12,21 +15,40 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
 
     @Autowired
     private VendorkindMapper vendorkindMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     @Override
     public boolean save(Vendorkind vendorkind){
         if(vendorkind.getId() == 0){
+            vendorkind.setCompanyId(BaseContextHolder.getCompanyId());
             vendorkindMapper.insertSelective(vendorkind);
+            //记录LOG
+            messageLogService.save(generateMsgObj(vendorkind.getId()));
         }else{
             vendorkindMapper.updateByPrimaryKeySelective(vendorkind);
+            //记录LOG
+            messageLogService.update(generateMsgObj(vendorkind.getId()));
         }
         return true;
     }
 
     @Override
     public boolean removeByPrimaryKey(Long id){
-        vendorkindMapper.deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            vendorkindMapper.deleteByPrimaryKey(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "VendorKind");
+    }
 }

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

@@ -1,10 +1,13 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Warehouse;
 import com.usoftchina.saas.document.mapper.WarehouseMapper;
 import com.usoftchina.saas.document.service.WarehouseService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
@@ -13,6 +16,9 @@ import java.util.Map;
 @Service
 public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper, Warehouse> implements WarehouseService {
 
+    @Autowired
+    private MessageLogService messageLogService;
+
     /**
      * 过账
      * @param map
@@ -48,7 +54,16 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
      */
     @Override
     public int insertSelective(Warehouse record) {
-        int count = getMapper().insertSelective(record);
+        int count = 0;
+        if(record.getId() == 0){
+            count = getMapper().insertSelective(record);
+            //记录LOG
+            messageLogService.save(generateMsgObj(record.getId()));
+        }else{
+            getMapper().updateByPrimaryKeySelective(record);
+            //记录LOG
+            messageLogService.update(generateMsgObj(record.getId()));
+        }
         return count;
     }
 
@@ -60,4 +75,13 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
     public void unPost(Map<String, Object> map) {
         getMapper().unPost(map);
     }
+
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "Warehouse");
+    }
 }

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

@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.document.mapper.BankinformationMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Bankinformation" >
+    <id column="bk_id" property="bkId" jdbcType="INTEGER" />
+    <result column="bk_bankcode" property="bkBankcode" jdbcType="VARCHAR" />
+    <result column="bk_bankname" property="bkBankname" jdbcType="VARCHAR" />
+    <result column="bk_date" property="bkDate" jdbcType="TIMESTAMP" />
+    <result column="bk_type" property="bkType" jdbcType="VARCHAR" />
+    <result column="bk_beginamount" property="bkBeginamount" jdbcType="DOUBLE" />
+    <result column="bk_thisamount" property="bkThisamount" jdbcType="DOUBLE" />
+    <result column="bk_status" property="bkStatus" jdbcType="VARCHAR" />
+    <result column="bk_statuscode" property="bkStatuscode" jdbcType="VARCHAR" />
+    <result column="bk_recorderid" property="bkRecorderid" jdbcType="INTEGER" />
+    <result column="bk_recorder" property="bkRecorder" jdbcType="VARCHAR" />
+    <result column="bk_recorddate" property="bkRecorddate" jdbcType="TIMESTAMP" />
+    <result column="bk_ym" property="bkYm" jdbcType="INTEGER" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="updaterid" property="updaterid" jdbcType="INTEGER" />
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
+    <result column="bk_text1" property="bkText1" jdbcType="VARCHAR" />
+    <result column="bk_text2" property="bkText2" jdbcType="VARCHAR" />
+    <result column="bk_text3" property="bkText3" jdbcType="VARCHAR" />
+    <result column="bk_text4" property="bkText4" jdbcType="VARCHAR" />
+    <result column="bk_text5" property="bkText5" jdbcType="VARCHAR" />
+  </resultMap>
+  <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Bankinformation" extends="BaseResultMap" >
+    <result column="bk_remark" property="bkRemark" jdbcType="LONGVARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount, 
+    bk_status, bk_statuscode, bk_recorderid, bk_recorder, bk_recorddate, bk_ym, companyid, 
+    updaterid, updatetime, bk_text1, bk_text2, bk_text3, bk_text4, bk_text5
+  </sql>
+  <sql id="Blob_Column_List" >
+    bk_remark
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from bankinformation
+    where bk_id = #{bkId,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from bankinformation
+    where bk_id = #{bkId,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
+    insert into bankinformation (bk_id, bk_bankcode, bk_bankname, 
+      bk_date, bk_type, bk_beginamount, 
+      bk_thisamount, bk_status, bk_statuscode, 
+      bk_recorderid, bk_recorder, bk_recorddate, 
+      bk_ym, companyid, updaterid, 
+      updatetime, bk_text1, bk_text2, 
+      bk_text3, bk_text4, bk_text5, 
+      bk_remark)
+    values (#{bkId,jdbcType=INTEGER}, #{bkBankcode,jdbcType=VARCHAR}, #{bkBankname,jdbcType=VARCHAR}, 
+      #{bkDate,jdbcType=TIMESTAMP}, #{bkType,jdbcType=VARCHAR}, #{bkBeginamount,jdbcType=DOUBLE}, 
+      #{bkThisamount,jdbcType=DOUBLE}, #{bkStatus,jdbcType=VARCHAR}, #{bkStatuscode,jdbcType=VARCHAR}, 
+      #{bkRecorderid,jdbcType=INTEGER}, #{bkRecorder,jdbcType=VARCHAR}, #{bkRecorddate,jdbcType=TIMESTAMP}, 
+      #{bkYm,jdbcType=INTEGER}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
+      #{updatetime,jdbcType=TIMESTAMP}, #{bkText1,jdbcType=VARCHAR}, #{bkText2,jdbcType=VARCHAR}, 
+      #{bkText3,jdbcType=VARCHAR}, #{bkText4,jdbcType=VARCHAR}, #{bkText5,jdbcType=VARCHAR}, 
+      #{bkRemark,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
+    insert into bankinformation
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="bkId != null" >
+        bk_id,
+      </if>
+      <if test="bkBankcode != null" >
+        bk_bankcode,
+      </if>
+      <if test="bkBankname != null" >
+        bk_bankname,
+      </if>
+      <if test="bkDate != null" >
+        bk_date,
+      </if>
+      <if test="bkType != null" >
+        bk_type,
+      </if>
+      <if test="bkBeginamount != null" >
+        bk_beginamount,
+      </if>
+      <if test="bkThisamount != null" >
+        bk_thisamount,
+      </if>
+      <if test="bkStatus != null" >
+        bk_status,
+      </if>
+      <if test="bkStatuscode != null" >
+        bk_statuscode,
+      </if>
+      <if test="bkRecorderid != null" >
+        bk_recorderid,
+      </if>
+      <if test="bkRecorder != null" >
+        bk_recorder,
+      </if>
+      <if test="bkRecorddate != null" >
+        bk_recorddate,
+      </if>
+      <if test="bkYm != null" >
+        bk_ym,
+      </if>
+      <if test="companyid != null" >
+        companyid,
+      </if>
+      <if test="updaterid != null" >
+        updaterid,
+      </if>
+      <if test="updatetime != null" >
+        updatetime,
+      </if>
+      <if test="bkText1 != null" >
+        bk_text1,
+      </if>
+      <if test="bkText2 != null" >
+        bk_text2,
+      </if>
+      <if test="bkText3 != null" >
+        bk_text3,
+      </if>
+      <if test="bkText4 != null" >
+        bk_text4,
+      </if>
+      <if test="bkText5 != null" >
+        bk_text5,
+      </if>
+      <if test="bkRemark != null" >
+        bk_remark,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="bkId != null" >
+        #{bkId,jdbcType=INTEGER},
+      </if>
+      <if test="bkBankcode != null" >
+        #{bkBankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="bkBankname != null" >
+        #{bkBankname,jdbcType=VARCHAR},
+      </if>
+      <if test="bkDate != null" >
+        #{bkDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bkType != null" >
+        #{bkType,jdbcType=VARCHAR},
+      </if>
+      <if test="bkBeginamount != null" >
+        #{bkBeginamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bkThisamount != null" >
+        #{bkThisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bkStatus != null" >
+        #{bkStatus,jdbcType=VARCHAR},
+      </if>
+      <if test="bkStatuscode != null" >
+        #{bkStatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="bkRecorderid != null" >
+        #{bkRecorderid,jdbcType=INTEGER},
+      </if>
+      <if test="bkRecorder != null" >
+        #{bkRecorder,jdbcType=VARCHAR},
+      </if>
+      <if test="bkRecorddate != null" >
+        #{bkRecorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bkYm != null" >
+        #{bkYm,jdbcType=INTEGER},
+      </if>
+      <if test="companyid != null" >
+        #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="updaterid != null" >
+        #{updaterid,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null" >
+        #{updatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bkText1 != null" >
+        #{bkText1,jdbcType=VARCHAR},
+      </if>
+      <if test="bkText2 != null" >
+        #{bkText2,jdbcType=VARCHAR},
+      </if>
+      <if test="bkText3 != null" >
+        #{bkText3,jdbcType=VARCHAR},
+      </if>
+      <if test="bkText4 != null" >
+        #{bkText4,jdbcType=VARCHAR},
+      </if>
+      <if test="bkText5 != null" >
+        #{bkText5,jdbcType=VARCHAR},
+      </if>
+      <if test="bkRemark != null" >
+        #{bkRemark,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
+    update bankinformation
+    <set >
+      <if test="bkBankcode != null" >
+        bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="bkBankname != null" >
+        bk_bankname = #{bkBankname,jdbcType=VARCHAR},
+      </if>
+      <if test="bkDate != null" >
+        bk_date = #{bkDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bkType != null" >
+        bk_type = #{bkType,jdbcType=VARCHAR},
+      </if>
+      <if test="bkBeginamount != null" >
+        bk_beginamount = #{bkBeginamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bkThisamount != null" >
+        bk_thisamount = #{bkThisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bkStatus != null" >
+        bk_status = #{bkStatus,jdbcType=VARCHAR},
+      </if>
+      <if test="bkStatuscode != null" >
+        bk_statuscode = #{bkStatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="bkRecorderid != null" >
+        bk_recorderid = #{bkRecorderid,jdbcType=INTEGER},
+      </if>
+      <if test="bkRecorder != null" >
+        bk_recorder = #{bkRecorder,jdbcType=VARCHAR},
+      </if>
+      <if test="bkRecorddate != null" >
+        bk_recorddate = #{bkRecorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bkYm != null" >
+        bk_ym = #{bkYm,jdbcType=INTEGER},
+      </if>
+      <if test="companyid != null" >
+        companyid = #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="updaterid != null" >
+        updaterid = #{updaterid,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null" >
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bkText1 != null" >
+        bk_text1 = #{bkText1,jdbcType=VARCHAR},
+      </if>
+      <if test="bkText2 != null" >
+        bk_text2 = #{bkText2,jdbcType=VARCHAR},
+      </if>
+      <if test="bkText3 != null" >
+        bk_text3 = #{bkText3,jdbcType=VARCHAR},
+      </if>
+      <if test="bkText4 != null" >
+        bk_text4 = #{bkText4,jdbcType=VARCHAR},
+      </if>
+      <if test="bkText5 != null" >
+        bk_text5 = #{bkText5,jdbcType=VARCHAR},
+      </if>
+      <if test="bkRemark != null" >
+        bk_remark = #{bkRemark,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where bk_id = #{bkId,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
+    update bankinformation
+    set bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
+      bk_bankname = #{bkBankname,jdbcType=VARCHAR},
+      bk_date = #{bkDate,jdbcType=TIMESTAMP},
+      bk_type = #{bkType,jdbcType=VARCHAR},
+      bk_beginamount = #{bkBeginamount,jdbcType=DOUBLE},
+      bk_thisamount = #{bkThisamount,jdbcType=DOUBLE},
+      bk_status = #{bkStatus,jdbcType=VARCHAR},
+      bk_statuscode = #{bkStatuscode,jdbcType=VARCHAR},
+      bk_recorderid = #{bkRecorderid,jdbcType=INTEGER},
+      bk_recorder = #{bkRecorder,jdbcType=VARCHAR},
+      bk_recorddate = #{bkRecorddate,jdbcType=TIMESTAMP},
+      bk_ym = #{bkYm,jdbcType=INTEGER},
+      companyid = #{companyid,jdbcType=INTEGER},
+      updaterid = #{updaterid,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      bk_text1 = #{bkText1,jdbcType=VARCHAR},
+      bk_text2 = #{bkText2,jdbcType=VARCHAR},
+      bk_text3 = #{bkText3,jdbcType=VARCHAR},
+      bk_text4 = #{bkText4,jdbcType=VARCHAR},
+      bk_text5 = #{bkText5,jdbcType=VARCHAR},
+      bk_remark = #{bkRemark,jdbcType=LONGVARCHAR}
+    where bk_id = #{bkId,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
+    update bankinformation
+    set bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
+      bk_bankname = #{bkBankname,jdbcType=VARCHAR},
+      bk_date = #{bkDate,jdbcType=TIMESTAMP},
+      bk_type = #{bkType,jdbcType=VARCHAR},
+      bk_beginamount = #{bkBeginamount,jdbcType=DOUBLE},
+      bk_thisamount = #{bkThisamount,jdbcType=DOUBLE},
+      bk_status = #{bkStatus,jdbcType=VARCHAR},
+      bk_statuscode = #{bkStatuscode,jdbcType=VARCHAR},
+      bk_recorderid = #{bkRecorderid,jdbcType=INTEGER},
+      bk_recorder = #{bkRecorder,jdbcType=VARCHAR},
+      bk_recorddate = #{bkRecorddate,jdbcType=TIMESTAMP},
+      bk_ym = #{bkYm,jdbcType=INTEGER},
+      companyid = #{companyid,jdbcType=INTEGER},
+      updaterid = #{updaterid,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      bk_text1 = #{bkText1,jdbcType=VARCHAR},
+      bk_text2 = #{bkText2,jdbcType=VARCHAR},
+      bk_text3 = #{bkText3,jdbcType=VARCHAR},
+      bk_text4 = #{bkText4,jdbcType=VARCHAR},
+      bk_text5 = #{bkText5,jdbcType=VARCHAR}
+    where bk_id = #{bkId,jdbcType=INTEGER}
+  </update>
+
+  <select id="selectAll" resultMap="BaseResultMap">
+    SELECT * FROM bankinformation
+  </select>
+</mapper>

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

@@ -45,7 +45,7 @@
     from customer
     where cu_id = #{cu_id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from customer
     where cu_id = #{cu_id,jdbcType=INTEGER}
   </delete>

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

@@ -33,7 +33,7 @@
     from customeraddress
     where ca_id = #{ca_id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from customeraddress
     where ca_id = #{ca_id,jdbcType=INTEGER}
   </delete>
@@ -207,7 +207,7 @@
     ,
     <include refid="Blob_Column_List" />
     from customeraddress
-    where ca_cuid = #{fk_i,jdbcType=INTEGER} order by ca_detno
+    where ca_cuid = #{fk_i,jdbcType=INTEGER}
   </select>
 
   <insert id="batchInsert" parameterType="java.util.List" >
@@ -355,5 +355,10 @@
     </foreach>
   </update>
 
+  <delete id="deleteByFK" parameterType="java.lang.Long">
+    delete from customeraddress
+    where ca_cuid = #{id,jdbcType=INTEGER}
+  </delete>
+
 
 </mapper>

+ 10 - 2
applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml

@@ -29,7 +29,7 @@
     from customercontact
     where cc_id = #{cc_id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from customercontact
     where cc_id = #{cc_id,jdbcType=INTEGER}
   </delete>
@@ -255,7 +255,7 @@
         <if test="item.updaterId != null">
           #{item.updaterId,jdbcType=INTEGER},
         </if>
-        <if test="item.updatetime != null">
+        <if test="item.updateTime != null">
           #{item.updateTime,jdbcType=TIMESTAMP},
         </if>
         <if test="item.cc_default != null">
@@ -319,4 +319,12 @@
       where cc_id = #{item.id,jdbcType=INTEGER}
     </foreach>
   </update>
+
+  <delete id="deleteByFK" parameterType="java.lang.Long">
+    delete from customercontact
+    where cc_cuid = #{id,jdbcType=INTEGER}
+  </delete>
+
+
+
 </mapper>

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

@@ -122,4 +122,7 @@
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM CUSTOMERKIND
   </select>
+  <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+    SELECT ck_name display,ck_name value FROM CUSTOMERKIND
+  </select>
 </mapper>

+ 49 - 0
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -50,5 +50,54 @@
         ORDER BY VE_ID
     </select>
 
+    <resultMap id="VendorListResultMapper" type="com.usoftchina.saas.document.entities.VendorList">
+        <id column="ve_id" property="ve_id" jdbcType="INTEGER" />
+        <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
+        <result column="ve_uu" property="ve_uu" jdbcType="VARCHAR" />
+        <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
+        <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
+        <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
+        <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="INTEGER" />
+        <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="INTEGER" />
+        <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
+        <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
+        <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
+        <result column="ve_bankaccount" property="ve_bankaccount" jdbcType="VARCHAR" />
+        <result column="ve_bankcode" property="ve_bankcode" jdbcType="VARCHAR" />
+        <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
+        <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
+        <result column="ve_recordid" property="ve_recordid" jdbcType="INTEGER" />
+        <result column="ve_recordname" property="ve_recordname" jdbcType="VARCHAR" />
+        <result column="ve_initdate" property="ve_initdate" jdbcType="TIMESTAMP" />
+        <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
+        <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
+        <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
+        <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
+        <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
+        <result column="vc_veid" property="vc_veid" jdbcType="INTEGER" />
+        <result column="vc_detno" property="vc_detno" jdbcType="INTEGER" />
+        <result column="vc_name" property="vc_name" jdbcType="VARCHAR" />
+        <result column="vc_tel" property="vc_tel" jdbcType="INTEGER" />
+        <result column="vc_qq" property="vc_qq" jdbcType="VARCHAR" />
+        <result column="vc_email" property="vc_email" jdbcType="VARCHAR" />
+        <result column="vc_text1" property="vc_text1" jdbcType="VARCHAR" />
+        <result column="vc_text2" property="vc_text2" jdbcType="VARCHAR" />
+        <result column="vc_text3" property="vc_text3" jdbcType="VARCHAR" />
+        <result column="vc_text4" property="vc_text4" jdbcType="VARCHAR" />
+        <result column="vc_text5" property="vc_text5" jdbcType="VARCHAR" />
+        <result column="vc_default" property="vc_default" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <select id="getListDataByCondition" resultMap="VendorListResultMapper">
+        SELECT * FROM VENDOR LEFT JOIN VENDORCONTACT ON VE_ID = VC_VEID
+        <where>
+            <if test="condition!=null">
+                ${condition}
+            </if>
+            AND VENDOR.COMPANYID = #{companyId}
+        </where>
+        order by VE_ID,VC_DETNO
+    </select>
+
 </mapper>
 

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

@@ -12,15 +12,16 @@
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
-    <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
-    <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
-    <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
-    <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
-    <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
+    <result column="vc_text1" property="vc_text1" jdbcType="VARCHAR" />
+    <result column="vc_text2" property="vc_text2" jdbcType="VARCHAR" />
+    <result column="vc_text3" property="vc_text3" jdbcType="VARCHAR" />
+    <result column="vc_text4" property="vc_text4" jdbcType="VARCHAR" />
+    <result column="vc_text5" property="vc_text5" jdbcType="VARCHAR" />
+    <result column="vc_default" property="vc_default" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     vc_id, vc_veid, vc_detno, vc_name, vc_tel, vc_qq, vc_email, companyId, updaterId, 
-    updateTime, ve_text1, ve_text2, ve_text3, ve_text4, ve_text5
+    updateTime, vc_text1, vc_text2, vc_text3, vc_text4, vc_text5, ve_default
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
@@ -28,22 +29,33 @@
     from vendorcontact
     where vc_id = #{id}
   </select>
+  <select id="selectByFK" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select
+    <include refid="Base_Column_List" />
+    from vendorcontact
+    where vc_veid = #{id}
+  </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from vendorcontact
     where vc_id = #{id}
   </delete>
+  <delete id="deleteByFK" parameterType="java.lang.Long">
+    DELETE FROM VENDORCONTACT
+    WHERE VC_VEID=#{id}
+  </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
     insert into vendorcontact (vc_veid, vc_detno,
       vc_name, vc_tel, vc_qq, 
       vc_email, companyId, updaterId, 
-      updateTime, ve_text1, ve_text2, 
-      ve_text3, ve_text4, ve_text5
+      updateTime, vc_text1, vc_text2, 
+      vc_text3, vc_text4, vc_text5, ve_default
       )
-    values (#{vc_veid,jdbcType=INTEGER}, #{vc_detno,jdbcType=INTEGER},
+    values (#{vc_veid}, #{vc_detno,jdbcType=INTEGER},
       #{vc_name,jdbcType=VARCHAR}, #{vc_tel,jdbcType=INTEGER}, #{vc_qq,jdbcType=VARCHAR}, 
       #{vc_email,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{ve_text1,jdbcType=VARCHAR}, #{ve_text2,jdbcType=VARCHAR}, 
-      #{ve_text3,jdbcType=VARCHAR}, #{ve_text4,jdbcType=VARCHAR}, #{ve_text5,jdbcType=VARCHAR}
+      #{updateTime,jdbcType=TIMESTAMP}, #{vc_text1,jdbcType=VARCHAR}, #{vc_text2,jdbcType=VARCHAR}, 
+      #{vc_text3,jdbcType=VARCHAR}, #{vc_text4,jdbcType=VARCHAR}, #{vc_text5,jdbcType=VARCHAR},
+      #{ve_default,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
@@ -76,25 +88,28 @@
       <if test="updateTime != null" >
         updateTime,
       </if>
-      <if test="ve_text1 != null" >
-        ve_text1,
+      <if test="vc_text1 != null" >
+        vc_text1,
+      </if>
+      <if test="vc_text2 != null" >
+        vc_text2,
       </if>
-      <if test="ve_text2 != null" >
-        ve_text2,
+      <if test="vc_text3 != null" >
+        vc_text3,
       </if>
-      <if test="ve_text3 != null" >
-        ve_text3,
+      <if test="vc_text4 != null" >
+        vc_text4,
       </if>
-      <if test="ve_text4 != null" >
-        ve_text4,
+      <if test="vc_text5 != null" >
+        vc_text5,
       </if>
-      <if test="ve_text5 != null" >
-        ve_text5,
+      <if test="ve_default != null" >
+        ve_default,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="vc_veid != null" >
-        #{vc_veid,jdbcType=INTEGER},
+        #{vc_veid},
       </if>
       <if test="vc_detno != null" >
         #{vc_detno,jdbcType=INTEGER},
@@ -120,20 +135,23 @@
       <if test="updateTime != null" >
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="ve_text1 != null" >
-        #{ve_text1,jdbcType=VARCHAR},
+      <if test="vc_text1 != null" >
+        #{vc_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="vc_text2 != null" >
+        #{vc_text2,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text2 != null" >
-        #{ve_text2,jdbcType=VARCHAR},
+      <if test="vc_text3 != null" >
+        #{vc_text3,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text3 != null" >
-        #{ve_text3,jdbcType=VARCHAR},
+      <if test="vc_text4 != null" >
+        #{vc_text4,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text4 != null" >
-        #{ve_text4,jdbcType=VARCHAR},
+      <if test="vc_text5 != null" >
+        #{vc_text5,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text5 != null" >
-        #{ve_text5,jdbcType=VARCHAR},
+      <if test="ve_default != null" >
+        #{ve_default,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
@@ -141,7 +159,7 @@
     update vendorcontact
     <set >
       <if test="vc_veid != null" >
-        vc_veid = #{vc_veid,jdbcType=INTEGER},
+        vc_veid = #{vc_veid},
       </if>
       <if test="vc_detno != null" >
         vc_detno = #{vc_detno,jdbcType=INTEGER},
@@ -167,27 +185,30 @@
       <if test="updateTime != null" >
         updateTime = #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="ve_text1 != null" >
-        ve_text1 = #{ve_text1,jdbcType=VARCHAR},
+      <if test="vc_text1 != null" >
+        vc_text1 = #{vc_text1,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text2 != null" >
-        ve_text2 = #{ve_text2,jdbcType=VARCHAR},
+      <if test="vc_text2 != null" >
+        vc_text2 = #{vc_text2,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text3 != null" >
-        ve_text3 = #{ve_text3,jdbcType=VARCHAR},
+      <if test="vc_text3 != null" >
+        vc_text3 = #{vc_text3,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text4 != null" >
-        ve_text4 = #{ve_text4,jdbcType=VARCHAR},
+      <if test="vc_text4 != null" >
+        vc_text4 = #{vc_text4,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text5 != null" >
-        ve_text5 = #{ve_text5,jdbcType=VARCHAR},
+      <if test="vc_text5 != null" >
+        vc_text5 = #{vc_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_default != null" >
+        ve_default = #{ve_default,jdbcType=VARCHAR},
       </if>
     </set>
     where vc_id = #{id}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
     update vendorcontact
-    set vc_veid = #{vc_veid,jdbcType=INTEGER},
+    set vc_veid = #{vc_veid},
       vc_detno = #{vc_detno,jdbcType=INTEGER},
       vc_name = #{vc_name,jdbcType=VARCHAR},
       vc_tel = #{vc_tel,jdbcType=INTEGER},
@@ -196,11 +217,160 @@
       companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updateTime = #{updateTime,jdbcType=TIMESTAMP},
-      ve_text1 = #{ve_text1,jdbcType=VARCHAR},
-      ve_text2 = #{ve_text2,jdbcType=VARCHAR},
-      ve_text3 = #{ve_text3,jdbcType=VARCHAR},
-      ve_text4 = #{ve_text4,jdbcType=VARCHAR},
-      ve_text5 = #{ve_text5,jdbcType=VARCHAR}
+      vc_text1 = #{vc_text1,jdbcType=VARCHAR},
+      vc_text2 = #{vc_text2,jdbcType=VARCHAR},
+      vc_text3 = #{vc_text3,jdbcType=VARCHAR},
+      vc_text4 = #{vc_text4,jdbcType=VARCHAR},
+      vc_text5 = #{vc_text5,jdbcType=VARCHAR},
+      ve_default = #{ve_default,jdbcType=VARCHAR}
     where vc_id = #{id}
   </update>
+  <insert id="batchInsert" parameterType="java.util.List">
+    <foreach collection="list" item="item" separator=",">
+      INSERT INTO VENDORCONTACT
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="item.vc_veid != null" >
+          vc_veid,
+        </if>
+        <if test="item.vc_detno != null" >
+          vc_detno,
+        </if>
+        <if test="item.vc_name != null" >
+          vc_name,
+        </if>
+        <if test="item.vc_tel != null" >
+          vc_tel,
+        </if>
+        <if test="item.vc_qq != null" >
+          vc_qq,
+        </if>
+        <if test="item.vc_email != null" >
+          vc_email,
+        </if>
+        <if test="item.companyId != null" >
+          companyId,
+        </if>
+        <if test="item.updaterId != null" >
+          updaterId,
+        </if>
+        <if test="item.updateTime != null" >
+          updateTime,
+        </if>
+        <if test="item.vc_text1 != null" >
+          vc_text1,
+        </if>
+        <if test="item.vc_text2 != null" >
+          vc_text2,
+        </if>
+        <if test="item.vc_text3 != null" >
+          vc_text3,
+        </if>
+        <if test="item.vc_text4 != null" >
+          vc_text4,
+        </if>
+        <if test="item.vc_text5 != null" >
+          vc_text5,
+        </if>
+        <if test="item.ve_default != null" >
+          ve_default,
+        </if>
+      </trim>
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="item.vc_veid != null" >
+          #{item.vc_veid},
+        </if>
+        <if test="item.vc_detno != null" >
+          #{item.vc_detno,jdbcType=INTEGER},
+        </if>
+        <if test="item.vc_name != null" >
+          #{item.vc_name,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_tel != null" >
+          #{item.vc_tel,jdbcType=INTEGER},
+        </if>
+        <if test="item.vc_qq != null" >
+          #{item.vc_qq,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_email != null" >
+          #{item.vc_email,jdbcType=VARCHAR},
+        </if>
+        <if test="item.companyId != null" >
+          #{item.companyId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updaterId != null" >
+          #{item.updaterId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updateTime != null" >
+          #{item.updateTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="item.vc_text1 != null" >
+          #{item.vc_text1,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_text2 != null" >
+          #{item.vc_text2,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_text3 != null" >
+          #{item.vc_text3,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_text4 != null" >
+          #{item.vc_text4,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_text5 != null" >
+          #{item.vc_text5,jdbcType=VARCHAR},
+        </if>
+        <if test="item.ve_default != null" >
+          #{item.ve_default,jdbcType=VARCHAR},
+        </if>
+      </trim>
+    </foreach>
+  </insert>
+  <update id="batchUpdate" parameterType="com.usoftchina.saas.document.entities.Vendorcontact">
+    <foreach collection="list" item="item" index="index" separator=";">
+      UPDATE VENDORCONTACT
+      <if test="item.vc_detno != null" >
+        vc_detno = #{item.vc_detno,jdbcType=INTEGER},
+      </if>
+      <if test="item.vc_name != null" >
+        vc_name = #{item.vc_name,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_tel != null" >
+        vc_tel = #{item.vc_tel,jdbcType=INTEGER},
+      </if>
+      <if test="item.vc_qq != null" >
+        vc_qq = #{item.vc_qq,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_email != null" >
+        vc_email = #{item.vc_email,jdbcType=VARCHAR},
+      </if>
+      <if test="item.companyId != null" >
+        companyId = #{item.companyId,jdbcType=INTEGER},
+      </if>
+      <if test="item.updaterId != null" >
+        updaterId = #{item.updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="item.updateTime != null" >
+        updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="item.vc_text1 != null" >
+        vc_text1 = #{item.vc_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_text2 != null" >
+        vc_text2 = #{item.vc_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_text3 != null" >
+        vc_text3 = #{item.vc_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_text4 != null" >
+        vc_text4 = #{item.vc_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_text5 != null" >
+        vc_text5 = #{item.vc_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="item.ve_default != null" >
+        ve_default = #{item.ve_default,jdbcType=VARCHAR},
+      </if>
+      WHERE VC_ID= #{item.id,jdbcType=INTEGER}
+    </foreach>
+  </update>
+
 </mapper>

+ 1 - 1
applications/document/document-server/src/test/java/com/usoftchina/saas/document/mapper/CustomeraddressMapperTest.java

@@ -58,7 +58,7 @@ public class CustomeraddressMapperTest {
         List<Customeraddress> list = new ArrayList<>();
         Customeraddress customeraddress = new Customeraddress();
         customeraddress.setId(new Long(2));
-        customeraddress.setCa_person("人2");
+        customeraddress.setCa_person("人3");
         list.add(customeraddress);
         customeraddressMapper.batchUpdate(list);
     }

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

@@ -52,11 +52,7 @@ public class CustomercontactMapperTest {
         customercontact.setCc_detno(1);
         customercontact.setCc_name("zdw");
         customercontact.setCc_tel(1881);
-        customercontact.setCc_qq("qq");
-        customercontact.setCc_email("@qq");
-        customercontact.setCompanyId(1);
-        customercontact.setUpdaterId(1);
-        customercontact.setUpdateTime(new Date());
+
         insertDetail1.add(customercontact);
         customercontactMapper.batchInsert(insertDetail1);
     }

+ 9 - 3
applications/money/money-server/pom.xml

@@ -21,6 +21,14 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>auth-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>server-starter</artifactId>
+        </dependency>
 
         <!-- db -->
         <dependency>
@@ -78,9 +86,7 @@
         </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
-            <artifactId>commons-server</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
-            <scope>compile</scope>
+            <artifactId>commons-api</artifactId>
         </dependency>
     </dependencies>
 

+ 2 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/MoneyApplicatiion.java

@@ -4,6 +4,7 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 //import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
@@ -12,7 +13,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
  * @create: 2018-10-20 11:29
  **/
 @SpringBootApplication
-//@EnableEurekaClient
+@EnableEurekaClient
 @EnableTransactionManagement
 @EnableFeignClients("com.usoftchina.saas")
 //@EnableAuthClient

+ 58 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/FundtransferController.java

@@ -0,0 +1,58 @@
+package com.usoftchina.saas.money.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.money.po.Fundtran;
+import com.usoftchina.saas.money.po.Fundtransfer;
+import com.usoftchina.saas.money.service.FundtransferService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author heqw
+ * @date 2018/10/25 19:21
+ **/
+@RestController
+@RequestMapping("/money/fundtransfer")
+public class FundtransferController {
+    @Autowired
+    private FundtransferService fundtransferService;
+
+    @RequestMapping("/save")
+    public Result insert(@RequestBody Fundtran body) {
+        int id = fundtransferService.insert(body);
+        return Result.success(id);
+    }
+
+
+    @PostMapping("/delete")
+    public Result delete(@RequestBody int id){
+        fundtransferService.delete(id);
+        return Result.success();
+    }
+
+
+    @GetMapping("/read")
+    public Result read(int id){
+        return Result.success(fundtransferService.select(id));
+    }
+
+    @GetMapping("/List")
+    public Result getList(PageRequest page){
+        PageInfo<Fundtransfer> list = fundtransferService.selectList(page);
+        return Result.success(list);
+    }
+
+    @RequestMapping("/audit")
+    public Result audit(@RequestBody Fundtran body){
+        fundtransferService.audit(body);
+        return Result.success();
+    }
+
+    @PostMapping("/unAudit")
+    public Result unAudit(@RequestBody int id){
+        fundtransferService.unAudit(id);
+        return Result.success();
+    }
+}

+ 6 - 8
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthreceiptsController.java

@@ -7,10 +7,7 @@ import com.usoftchina.saas.money.po.Othte;
 import com.usoftchina.saas.money.service.OthreceiptsService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author heqw
@@ -29,12 +26,13 @@ public class OthreceiptsController {
     }
 
 
-    @GetMapping("/delete")
-    public Result deletePaybalance(int id){
+    @PostMapping("/delete")
+    public Result deletePaybalance(@RequestBody int id){
         othreceiptsService.delete(id);
         return Result.success();
     }
 
+
     @GetMapping("/read")
     public Result getPaybalance(int id){
         return Result.success(othreceiptsService.select(id));
@@ -52,8 +50,8 @@ public class OthreceiptsController {
         return Result.success();
     }
 
-    @GetMapping("/unAudit")
-    public Result unAudit(int id){
+    @PostMapping("/unAudit")
+    public Result unAudit(@RequestBody int id){
         othreceiptsService.unAudit(id);
         return Result.success();
     }

+ 11 - 8
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthspengdingsController.java

@@ -10,10 +10,7 @@ import com.usoftchina.saas.money.service.OthspendingsService;
 import com.usoftchina.saas.page.PageRequest;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author heqw
@@ -32,12 +29,18 @@ public class OthspengdingsController {
     }
 
 
-    @GetMapping("/delete")
-    public Result deletePaybalance(int id){
+    @PostMapping("/delete")
+    public Result deletePaybalance(@RequestBody int id){
         othspendingsService.delete(id);
         return Result.success();
     }
 
+    @PostMapping("/deleteItem/")
+    public Result deleteItem(@RequestBody int id){
+        othspendingsService.deleteItem(id);
+        return Result.success();
+    }
+
     @GetMapping("/read")
     public Result getPaybalance(int id){
         return Result.success(othspendingsService.select(id));
@@ -55,8 +58,8 @@ public class OthspengdingsController {
         return Result.success();
     }
 
-    @GetMapping("/unAudit")
-    public Result unAudit(int id){
+    @PostMapping("/unAudit")
+    public Result unAudit(@RequestBody int id){
         othspendingsService.unAudit(id);
         return Result.success();
     }

+ 12 - 9
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java

@@ -8,17 +8,14 @@ import com.usoftchina.saas.money.po.Paybalance;
 import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author heqw
  * @date 2018/10/22 15:03
  **/
 @RestController
-@RequestMapping("/money")
+@RequestMapping("/money/Paybalance")
 public class PaybalanceController {
     @Autowired
     private PaybalanceService paybalanceService;
@@ -30,12 +27,18 @@ public class PaybalanceController {
     }
 
 
-    @GetMapping("/delete")
-    public Result deletePaybalance(int id){
+    @PostMapping("/delete")
+    public Result deletePaybalance(@RequestBody int id){
         paybalanceService.delete(id);
         return Result.success();
     }
 
+    @PostMapping("/deleteItem/")
+    public Result deleteItem(@RequestBody int id){
+        paybalanceService.deleteItem(id);
+        return Result.success();
+    }
+
     @GetMapping("/read")
     public Result getPaybalance(int id){
         return Result.success(paybalanceService.select(id));
@@ -53,8 +56,8 @@ public class PaybalanceController {
         return Result.success();
     }
 
-    @GetMapping("/unAudit")
-    public Result unAudit(int id){
+    @PostMapping("/unAudit")
+    public Result unAudit(@RequestBody int id){
         paybalanceService.unAudit(id);
         return Result.success();
     }

+ 7 - 7
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/RecbalanceContorller.java

@@ -23,15 +23,15 @@ public class RecbalanceContorller {
         return Result.success();
     }
 
-    @GetMapping("/delete")
-    public Result delete(int id){
+    @PostMapping("/delete")
+    public Result delete(@RequestBody int id){
         recbalanceService.delect(id);
         return Result.success();
     }
 
-    @GetMapping("/deleteItem/{id}")
-    public Result deleteItem(@PathVariable int id){
-        recbalanceService.delectItem(id);
+    @PostMapping("/deleteItem/")
+    public Result deleteItem(@RequestBody int id){
+        recbalanceService.deleteItem(id);
         return Result.success();
     }
 
@@ -51,8 +51,8 @@ public class RecbalanceContorller {
         return Result.success();
     }
 
-    @GetMapping("/unAudit")
-    public Result unAudit(int id){
+    @PostMapping("/unAudit")
+    public Result unAudit(@RequestBody int id){
         recbalanceService.unAudit(id);
         return Result.success();
     }

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

@@ -0,0 +1,21 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Fundtransfer;
+
+import java.util.List;
+
+public interface FundtransferMapper {
+    int deleteByPrimaryKey(Integer ftId);
+    int deleteItem(int id);
+
+    int insert(Fundtransfer record);
+
+    int insertSelective(Fundtransfer record);
+    List<Fundtransfer> selectList();
+
+    Fundtransfer selectByPrimaryKey(Integer ftId);
+
+    int updateByPrimaryKeySelective(Fundtransfer record);
+
+    int updateByPrimaryKey(Fundtransfer record);
+}

+ 18 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/FundtransferdetailMapper.java

@@ -0,0 +1,18 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Fundtransferdetail;
+
+public interface FundtransferdetailMapper {
+    int deleteByPrimaryKey(Integer ftdId);
+    int deleteItem(int id);
+
+    int insert(Fundtransferdetail record);
+
+    int insertSelective(Fundtransferdetail record);
+
+    Fundtransferdetail selectByPrimaryKey(Integer ftdId);
+
+    int updateByPrimaryKeySelective(Fundtransferdetail record);
+
+    int updateByPrimaryKey(Fundtransferdetail record);
+}

+ 28 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtran.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.List;
+
+/**
+ * @author heqw
+ * @date 2018/10/25 19:28
+ **/
+public class Fundtran {
+    private Fundtransfer main;
+    private List<Fundtransferdetail> items;
+
+    public Fundtransfer getMain() {
+        return main;
+    }
+
+    public void setMain(Fundtransfer main) {
+        this.main = main;
+    }
+
+    public List<Fundtransferdetail> getItems() {
+        return items;
+    }
+
+    public void setItems(List<Fundtransferdetail> items) {
+        this.items = items;
+    }
+}

+ 175 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransfer.java

@@ -0,0 +1,175 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+public class Fundtransfer {
+    private Integer ftId;
+
+    private String ftCode;
+
+    private Date ftDate;
+
+    private Integer ftRecorderid;
+
+    private String ftRecorder;
+
+    private Date ftRecorddate;
+
+    private String ftStatus;
+
+    private String ftStatuscode;
+
+    private String ftRemark;
+
+    private Integer companyid;
+
+    private Integer updaterid;
+
+    private Date updatedate;
+
+    private String ftText1;
+
+    private String ftText2;
+
+    private String ftText3;
+
+    private String ftText4;
+
+    private String ftText5;
+
+    public Integer getFtId() {
+        return ftId;
+    }
+
+    public void setFtId(Integer ftId) {
+        this.ftId = ftId;
+    }
+
+    public String getFtCode() {
+        return ftCode;
+    }
+
+    public void setFtCode(String ftCode) {
+        this.ftCode = ftCode == null ? null : ftCode.trim();
+    }
+
+    public Date getFtDate() {
+        return ftDate;
+    }
+
+    public void setFtDate(Date ftDate) {
+        this.ftDate = ftDate;
+    }
+
+    public Integer getFtRecorderid() {
+        return ftRecorderid;
+    }
+
+    public void setFtRecorderid(Integer ftRecorderid) {
+        this.ftRecorderid = ftRecorderid;
+    }
+
+    public String getFtRecorder() {
+        return ftRecorder;
+    }
+
+    public void setFtRecorder(String ftRecorder) {
+        this.ftRecorder = ftRecorder == null ? null : ftRecorder.trim();
+    }
+
+    public Date getFtRecorddate() {
+        return ftRecorddate;
+    }
+
+    public void setFtRecorddate(Date ftRecorddate) {
+        this.ftRecorddate = ftRecorddate;
+    }
+
+    public String getFtStatus() {
+        return ftStatus;
+    }
+
+    public void setFtStatus(String ftStatus) {
+        this.ftStatus = ftStatus == null ? null : ftStatus.trim();
+    }
+
+    public String getFtStatuscode() {
+        return ftStatuscode;
+    }
+
+    public void setFtStatuscode(String ftStatuscode) {
+        this.ftStatuscode = ftStatuscode == null ? null : ftStatuscode.trim();
+    }
+
+    public String getFtRemark() {
+        return ftRemark;
+    }
+
+    public void setFtRemark(String ftRemark) {
+        this.ftRemark = ftRemark == null ? null : ftRemark.trim();
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+
+    public Integer getUpdaterid() {
+        return updaterid;
+    }
+
+    public void setUpdaterid(Integer updaterid) {
+        this.updaterid = updaterid;
+    }
+
+    public Date getUpdatedate() {
+        return updatedate;
+    }
+
+    public void setUpdatedate(Date updatedate) {
+        this.updatedate = updatedate;
+    }
+
+    public String getFtText1() {
+        return ftText1;
+    }
+
+    public void setFtText1(String ftText1) {
+        this.ftText1 = ftText1 == null ? null : ftText1.trim();
+    }
+
+    public String getFtText2() {
+        return ftText2;
+    }
+
+    public void setFtText2(String ftText2) {
+        this.ftText2 = ftText2 == null ? null : ftText2.trim();
+    }
+
+    public String getFtText3() {
+        return ftText3;
+    }
+
+    public void setFtText3(String ftText3) {
+        this.ftText3 = ftText3 == null ? null : ftText3.trim();
+    }
+
+    public String getFtText4() {
+        return ftText4;
+    }
+
+    public void setFtText4(String ftText4) {
+        this.ftText4 = ftText4 == null ? null : ftText4.trim();
+    }
+
+    public String getFtText5() {
+        return ftText5;
+    }
+
+    public void setFtText5(String ftText5) {
+        this.ftText5 = ftText5 == null ? null : ftText5.trim();
+    }
+}

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

@@ -0,0 +1,225 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+public class Fundtransferdetail {
+    private Integer ftdId;
+
+    private Integer ftdFtid;
+
+    private Integer ftdDetno;
+
+    private Integer ftdYm;
+
+    private Integer ftdBankid;
+
+    private String ftdBankcode;
+
+    private String ftdBankname;
+
+    private Integer ftdInbankid;
+
+    private String ftdInbankcode;
+
+    private String ftdInbankname;
+
+    private Double ftdNowbalance;
+
+    private String ftdPaymethod;
+
+    private String ftdPaycode;
+
+    private String ftdRemark;
+
+    private Integer companyid;
+
+    private Integer updaterid;
+
+    private Date updatedate;
+
+    private String ftdText1;
+
+    private String ftdText2;
+
+    private String ftdText3;
+
+    private String ftdText4;
+
+    private String ftdText5;
+
+    public Integer getFtdId() {
+        return ftdId;
+    }
+
+    public void setFtdId(Integer ftdId) {
+        this.ftdId = ftdId;
+    }
+
+    public Integer getFtdFtid() {
+        return ftdFtid;
+    }
+
+    public void setFtdFtid(Integer ftdFtid) {
+        this.ftdFtid = ftdFtid;
+    }
+
+    public Integer getFtdDetno() {
+        return ftdDetno;
+    }
+
+    public void setFtdDetno(Integer ftdDetno) {
+        this.ftdDetno = ftdDetno;
+    }
+
+    public Integer getFtdYm() {
+        return ftdYm;
+    }
+
+    public void setFtdYm(Integer ftdYm) {
+        this.ftdYm = ftdYm;
+    }
+
+    public Integer getFtdBankid() {
+        return ftdBankid;
+    }
+
+    public void setFtdBankid(Integer ftdBankid) {
+        this.ftdBankid = ftdBankid;
+    }
+
+    public String getFtdBankcode() {
+        return ftdBankcode;
+    }
+
+    public void setFtdBankcode(String ftdBankcode) {
+        this.ftdBankcode = ftdBankcode == null ? null : ftdBankcode.trim();
+    }
+
+    public String getFtdBankname() {
+        return ftdBankname;
+    }
+
+    public void setFtdBankname(String ftdBankname) {
+        this.ftdBankname = ftdBankname == null ? null : ftdBankname.trim();
+    }
+
+    public Integer getFtdInbankid() {
+        return ftdInbankid;
+    }
+
+    public void setFtdInbankid(Integer ftdInbankid) {
+        this.ftdInbankid = ftdInbankid;
+    }
+
+    public String getFtdInbankcode() {
+        return ftdInbankcode;
+    }
+
+    public void setFtdInbankcode(String ftdInbankcode) {
+        this.ftdInbankcode = ftdInbankcode == null ? null : ftdInbankcode.trim();
+    }
+
+    public String getFtdInbankname() {
+        return ftdInbankname;
+    }
+
+    public void setFtdInbankname(String ftdInbankname) {
+        this.ftdInbankname = ftdInbankname == null ? null : ftdInbankname.trim();
+    }
+
+    public Double getFtdNowbalance() {
+        return ftdNowbalance;
+    }
+
+    public void setFtdNowbalance(Double ftdNowbalance) {
+        this.ftdNowbalance = ftdNowbalance;
+    }
+
+    public String getFtdPaymethod() {
+        return ftdPaymethod;
+    }
+
+    public void setFtdPaymethod(String ftdPaymethod) {
+        this.ftdPaymethod = ftdPaymethod == null ? null : ftdPaymethod.trim();
+    }
+
+    public String getFtdPaycode() {
+        return ftdPaycode;
+    }
+
+    public void setFtdPaycode(String ftdPaycode) {
+        this.ftdPaycode = ftdPaycode == null ? null : ftdPaycode.trim();
+    }
+
+    public String getFtdRemark() {
+        return ftdRemark;
+    }
+
+    public void setFtdRemark(String ftdRemark) {
+        this.ftdRemark = ftdRemark == null ? null : ftdRemark.trim();
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+
+    public Integer getUpdaterid() {
+        return updaterid;
+    }
+
+    public void setUpdaterid(Integer updaterid) {
+        this.updaterid = updaterid;
+    }
+
+    public Date getUpdatedate() {
+        return updatedate;
+    }
+
+    public void setUpdatedate(Date updatedate) {
+        this.updatedate = updatedate;
+    }
+
+    public String getFtdText1() {
+        return ftdText1;
+    }
+
+    public void setFtdText1(String ftdText1) {
+        this.ftdText1 = ftdText1 == null ? null : ftdText1.trim();
+    }
+
+    public String getFtdText2() {
+        return ftdText2;
+    }
+
+    public void setFtdText2(String ftdText2) {
+        this.ftdText2 = ftdText2 == null ? null : ftdText2.trim();
+    }
+
+    public String getFtdText3() {
+        return ftdText3;
+    }
+
+    public void setFtdText3(String ftdText3) {
+        this.ftdText3 = ftdText3 == null ? null : ftdText3.trim();
+    }
+
+    public String getFtdText4() {
+        return ftdText4;
+    }
+
+    public void setFtdText4(String ftdText4) {
+        this.ftdText4 = ftdText4 == null ? null : ftdText4.trim();
+    }
+
+    public String getFtdText5() {
+        return ftdText5;
+    }
+
+    public void setFtdText5(String ftdText5) {
+        this.ftdText5 = ftdText5 == null ? null : ftdText5.trim();
+    }
+}

+ 24 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/FundtransferService.java

@@ -0,0 +1,24 @@
+package com.usoftchina.saas.money.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.money.po.Fundtran;
+import com.usoftchina.saas.money.po.Fundtransfer;
+import com.usoftchina.saas.page.PageRequest;
+
+/**
+ * @author heqw
+ * @date 2018/10/25 19:26
+ **/
+public interface FundtransferService {
+    int insert(Fundtran fundtran);
+
+    void audit(Fundtran fundtran);
+
+    void unAudit(int id);
+
+    void delete(int id);
+
+    Fundtran select(int id);
+
+    PageInfo<Fundtransfer> selectList(PageRequest page);
+}

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthspendingsService.java

@@ -17,7 +17,7 @@ public interface OthspendingsService {
 
     void delete(int id);
 
-    void delectItem(int id);
+    void deleteItem(int id);
 
     Othsp select(int id);
 

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/PaybalanceService.java

@@ -19,7 +19,7 @@ public interface PaybalanceService {
 
     void delete(int id);
 
-    void delectItem(int id);
+    void deleteItem(int id);
 
     Pay select(int id);
 

+ 4 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/RecbalanceService.java

@@ -13,9 +13,12 @@ import com.usoftchina.saas.page.PageRequest;
 public interface RecbalanceService {
     int insert(Rec rec);
     void delect(int id);
-    void delectItem(int id);
+
+    void deleteItem(int id);
+
     Rec select(int id);
 
+
     void audit(Rec rec);
 
     void unAudit(int id);

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

@@ -0,0 +1,106 @@
+package com.usoftchina.saas.money.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.po.Status;
+import com.usoftchina.saas.money.mapper.FundtransferMapper;
+import com.usoftchina.saas.money.mapper.FundtransferdetailMapper;
+import com.usoftchina.saas.money.po.Fundtran;
+import com.usoftchina.saas.money.po.Fundtransfer;
+import com.usoftchina.saas.money.po.Fundtransferdetail;
+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 java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author heqw
+ * @date 2018/10/25 19:32
+ **/
+@Service
+public class FundtransferServiceImpl implements FundtransferService {
+    @Autowired
+    private FundtransferMapper fundtransferMapper;
+    @Autowired
+    private FundtransferdetailMapper fundtransferdetailMapper;
+
+    @Override
+    public int insert(Fundtran fundtran) {
+        Fundtransfer fundtransfer = fundtran.getMain();
+        List<Fundtransferdetail> fundtransferdetails = fundtran.getItems();
+
+        if (fundtransfer.getFtId() > 0){
+            fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
+        }else {
+            fundtransferMapper.insert(fundtransfer);
+        }
+
+        Iterator isdet = fundtransferdetails.iterator();
+        while (isdet.hasNext()){
+            Fundtransferdetail fundtransferdetail= (Fundtransferdetail) isdet.next();
+            if (fundtransferdetail.getFtdId() > 0 ){
+                fundtransferdetailMapper.updateByPrimaryKey(fundtransferdetail);
+            }else {
+                fundtransferdetailMapper.insertSelective(fundtransferdetail);
+            }
+        }
+        return 0;
+    }
+
+    @Override
+    public void audit(Fundtran fundtran) {
+        int id = fundtran.getMain().getFtId();
+        Fundtransfer fundtransfer = fundtransferMapper.selectByPrimaryKey(id);
+        if ( fundtransfer == null || "".equals(fundtransfer)){
+            this.insert(fundtran);
+        }else {
+            fundtransferMapper.updateByPrimaryKey(fundtransfer);
+        }
+    }
+
+    @Override
+    public void unAudit(int id) {
+        Fundtransfer fundtransfer = new Fundtransfer();
+        fundtransfer.setFtId(id);
+        fundtransfer.setFtStatus(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
+        fundtransfer.setFtStatuscode(Status.UNAUDITED.name());
+        fundtransferMapper.updateByPrimaryKey(fundtransfer);
+    }
+
+
+    @Override
+    public void delete(int id) {
+        fundtransferMapper.deleteByPrimaryKey(id);
+        fundtransferdetailMapper.deleteByPrimaryKey(id);
+    }
+
+    public void deleteItem(int id) {
+        fundtransferdetailMapper.deleteItem(id);
+    }
+
+    @Override
+    public Fundtran select(int id) {
+        Fundtran fundtran = new Fundtran();
+        fundtran.setMain(fundtransferMapper.selectByPrimaryKey(id));
+        fundtran.setItems((List<Fundtransferdetail>) fundtransferdetailMapper.selectByPrimaryKey(id));
+        return fundtran;
+    }
+
+    @Override
+    public PageInfo<Fundtransfer> selectList(PageRequest page) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<Fundtransfer> fundtransfers = fundtransferMapper.selectList();
+        //取分页信息
+        PageInfo<Fundtransfer> pageInfo = new PageInfo<>(fundtransfers);
+        return pageInfo;
+    }
+}

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

@@ -57,7 +57,7 @@ public class OthspendingsServiceImpl implements OthspendingsService {
     }
 
     @Override
-    public void delectItem(int id) {
+    public void deleteItem(int id) {
         othspendingsdetailMapper.deleteItem(id);
     }
 

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

@@ -89,7 +89,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     }
 
     @Override
-    public void delectItem(int id) {
+    public void deleteItem(int id) {
         paybalancedetailMapper.deleteItem(id);
         paybalancedetMapper.deleteItem(id);
     }

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

@@ -70,12 +70,6 @@ public class RecbalanceServiceImpl implements RecbalanceService {
         recbalancedetailMapper.deleteByPrimaryKey(id);
     }
 
-    @Override
-    public void delectItem(int id) {
-        recbalancedetMapper.deleteItem(id);
-        recbalancedetailMapper.deleteItem(id);
-    }
-
     @Override
     public Rec select(int id) {
         Recbalance recbalance = recbalanceMapper.selectByPrimaryKey(id);
@@ -88,6 +82,12 @@ public class RecbalanceServiceImpl implements RecbalanceService {
         return rec;
     }
 
+    @Override
+    public void deleteItem(int id) {
+        recbalancedetailMapper.deleteItem(id);
+        recbalancedetMapper.deleteItem(id);
+    }
+
     @Override
     public void audit(Rec rec) {
         int id = rec.getMain().getRb_id();

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

@@ -3,13 +3,13 @@ package com.usoftchina.saas.money.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.Operation;
-import com.usoftchina.saas.commons.service.MaxnumberService;
-import com.usoftchina.saas.commons.service.MessageLogService;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.money.dto.*;
@@ -42,7 +42,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     @Autowired
     private VerificationListMapper verificationListMapper;
 //    @Autowired
-//    private MessageLogService messageLogService;
+ //   private MessageLogService messageLogService;
 
 
     @Override
@@ -223,8 +223,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 id = saveDTO.getId();
             }
             Verification verification = new Verification();
-//          verification.setVc_status(Operation.AUDIT.getTitle());
-//          verification.setVc_statuscode(Status.AUDITED.name());
+           // verification.setVc_status(Operation.AUDIT.getTitle());
+           // verification.setVc_statuscode(Status.AUDITED.name());
             verificationMapper.updateByPrimaryKeySelective(verification);
         }
         savedDTO.setId(id);

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

@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.FundtransferMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Fundtransfer" >
+    <id column="ft_id" property="ftId" jdbcType="INTEGER" />
+    <result column="ft_code" property="ftCode" jdbcType="VARCHAR" />
+    <result column="ft_date" property="ftDate" jdbcType="TIMESTAMP" />
+    <result column="ft_recorderid" property="ftRecorderid" jdbcType="INTEGER" />
+    <result column="ft_recorder" property="ftRecorder" jdbcType="VARCHAR" />
+    <result column="ft_recorddate" property="ftRecorddate" jdbcType="TIMESTAMP" />
+    <result column="ft_status" property="ftStatus" jdbcType="VARCHAR" />
+    <result column="ft_statuscode" property="ftStatuscode" jdbcType="VARCHAR" />
+    <result column="ft_remark" property="ftRemark" jdbcType="VARCHAR" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
+    <result column="updatedate" property="updatedate" jdbcType="TIMESTAMP" />
+    <result column="ft_text1" property="ftText1" jdbcType="VARCHAR" />
+    <result column="ft_text2" property="ftText2" jdbcType="VARCHAR" />
+    <result column="ft_text3" property="ftText3" jdbcType="VARCHAR" />
+    <result column="ft_text4" property="ftText4" jdbcType="VARCHAR" />
+    <result column="ft_text5" property="ftText5" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    ft_id, ft_code, ft_date, ft_recorderid, ft_recorder, ft_recorddate, ft_status, ft_statuscode, 
+    ft_remark, companyid, updaterId, updatedate, ft_text1, ft_text2, ft_text3, ft_text4, 
+    ft_text5
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from fundtransfer
+    where ft_id = #{ftId,jdbcType=INTEGER}
+  </select>
+
+  <select id="selectList" resultMap="BaseResultMap" >
+    select
+    <include refid="Base_Column_List" />
+    from fundtransfer
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from fundtransfer
+    where ft_id = #{ftId,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.money.po.Fundtransfer" >
+    insert into fundtransfer (ft_id, ft_code, ft_date, 
+      ft_recorderid, ft_recorder, ft_recorddate, 
+      ft_status, ft_statuscode, ft_remark, 
+      companyid, updaterId, updatedate, 
+      ft_text1, ft_text2, ft_text3, 
+      ft_text4, ft_text5)
+    values (#{ftId,jdbcType=INTEGER}, #{ftCode,jdbcType=VARCHAR}, #{ftDate,jdbcType=TIMESTAMP}, 
+      #{ftRecorderid,jdbcType=INTEGER}, #{ftRecorder,jdbcType=VARCHAR}, #{ftRecorddate,jdbcType=TIMESTAMP}, 
+      #{ftStatus,jdbcType=VARCHAR}, #{ftStatuscode,jdbcType=VARCHAR}, #{ftRemark,jdbcType=VARCHAR}, 
+      #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}, 
+      #{ftText1,jdbcType=VARCHAR}, #{ftText2,jdbcType=VARCHAR}, #{ftText3,jdbcType=VARCHAR}, 
+      #{ftText4,jdbcType=VARCHAR}, #{ftText5,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Fundtransfer" >
+    insert into fundtransfer
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="ftId != null" >
+        ft_id,
+      </if>
+      <if test="ftCode != null" >
+        ft_code,
+      </if>
+      <if test="ftDate != null" >
+        ft_date,
+      </if>
+      <if test="ftRecorderid != null" >
+        ft_recorderid,
+      </if>
+      <if test="ftRecorder != null" >
+        ft_recorder,
+      </if>
+      <if test="ftRecorddate != null" >
+        ft_recorddate,
+      </if>
+      <if test="ftStatus != null" >
+        ft_status,
+      </if>
+      <if test="ftStatuscode != null" >
+        ft_statuscode,
+      </if>
+      <if test="ftRemark != null" >
+        ft_remark,
+      </if>
+      <if test="companyid != null" >
+        companyid,
+      </if>
+      <if test="updaterid != null" >
+        updaterId,
+      </if>
+      <if test="updatedate != null" >
+        updatedate,
+      </if>
+      <if test="ftText1 != null" >
+        ft_text1,
+      </if>
+      <if test="ftText2 != null" >
+        ft_text2,
+      </if>
+      <if test="ftText3 != null" >
+        ft_text3,
+      </if>
+      <if test="ftText4 != null" >
+        ft_text4,
+      </if>
+      <if test="ftText5 != null" >
+        ft_text5,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="ftId != null" >
+        #{ftId,jdbcType=INTEGER},
+      </if>
+      <if test="ftCode != null" >
+        #{ftCode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftDate != null" >
+        #{ftDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ftRecorderid != null" >
+        #{ftRecorderid,jdbcType=INTEGER},
+      </if>
+      <if test="ftRecorder != null" >
+        #{ftRecorder,jdbcType=VARCHAR},
+      </if>
+      <if test="ftRecorddate != null" >
+        #{ftRecorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ftStatus != null" >
+        #{ftStatus,jdbcType=VARCHAR},
+      </if>
+      <if test="ftStatuscode != null" >
+        #{ftStatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftRemark != null" >
+        #{ftRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyid != null" >
+        #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="updaterid != null" >
+        #{updaterid,jdbcType=INTEGER},
+      </if>
+      <if test="updatedate != null" >
+        #{updatedate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ftText1 != null" >
+        #{ftText1,jdbcType=VARCHAR},
+      </if>
+      <if test="ftText2 != null" >
+        #{ftText2,jdbcType=VARCHAR},
+      </if>
+      <if test="ftText3 != null" >
+        #{ftText3,jdbcType=VARCHAR},
+      </if>
+      <if test="ftText4 != null" >
+        #{ftText4,jdbcType=VARCHAR},
+      </if>
+      <if test="ftText5 != null" >
+        #{ftText5,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Fundtransfer" >
+    update fundtransfer
+    <set >
+      <if test="ftCode != null" >
+        ft_code = #{ftCode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftDate != null" >
+        ft_date = #{ftDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ftRecorderid != null" >
+        ft_recorderid = #{ftRecorderid,jdbcType=INTEGER},
+      </if>
+      <if test="ftRecorder != null" >
+        ft_recorder = #{ftRecorder,jdbcType=VARCHAR},
+      </if>
+      <if test="ftRecorddate != null" >
+        ft_recorddate = #{ftRecorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ftStatus != null" >
+        ft_status = #{ftStatus,jdbcType=VARCHAR},
+      </if>
+      <if test="ftStatuscode != null" >
+        ft_statuscode = #{ftStatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftRemark != null" >
+        ft_remark = #{ftRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyid != null" >
+        companyid = #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="updaterid != null" >
+        updaterId = #{updaterid,jdbcType=INTEGER},
+      </if>
+      <if test="updatedate != null" >
+        updatedate = #{updatedate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ftText1 != null" >
+        ft_text1 = #{ftText1,jdbcType=VARCHAR},
+      </if>
+      <if test="ftText2 != null" >
+        ft_text2 = #{ftText2,jdbcType=VARCHAR},
+      </if>
+      <if test="ftText3 != null" >
+        ft_text3 = #{ftText3,jdbcType=VARCHAR},
+      </if>
+      <if test="ftText4 != null" >
+        ft_text4 = #{ftText4,jdbcType=VARCHAR},
+      </if>
+      <if test="ftText5 != null" >
+        ft_text5 = #{ftText5,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where ft_id = #{ftId,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Fundtransfer" >
+    update fundtransfer
+    set ft_code = #{ftCode,jdbcType=VARCHAR},
+      ft_date = #{ftDate,jdbcType=TIMESTAMP},
+      ft_recorderid = #{ftRecorderid,jdbcType=INTEGER},
+      ft_recorder = #{ftRecorder,jdbcType=VARCHAR},
+      ft_recorddate = #{ftRecorddate,jdbcType=TIMESTAMP},
+      ft_status = #{ftStatus,jdbcType=VARCHAR},
+      ft_statuscode = #{ftStatuscode,jdbcType=VARCHAR},
+      ft_remark = #{ftRemark,jdbcType=VARCHAR},
+      companyid = #{companyid,jdbcType=INTEGER},
+      updaterId = #{updaterid,jdbcType=INTEGER},
+      updatedate = #{updatedate,jdbcType=TIMESTAMP},
+      ft_text1 = #{ftText1,jdbcType=VARCHAR},
+      ft_text2 = #{ftText2,jdbcType=VARCHAR},
+      ft_text3 = #{ftText3,jdbcType=VARCHAR},
+      ft_text4 = #{ftText4,jdbcType=VARCHAR},
+      ft_text5 = #{ftText5,jdbcType=VARCHAR}
+    where ft_id = #{ftId,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 300 - 0
applications/money/money-server/src/main/resources/mapper/FundtransferdetailMapper.xml

@@ -0,0 +1,300 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.FundtransferdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Fundtransferdetail" >
+    <id column="ftd_id" property="ftdId" jdbcType="INTEGER" />
+    <result column="ftd_ftid" property="ftdFtid" jdbcType="INTEGER" />
+    <result column="ftd_detno" property="ftdDetno" jdbcType="INTEGER" />
+    <result column="ftd_ym" property="ftdYm" jdbcType="INTEGER" />
+    <result column="ftd_bankid" property="ftdBankid" jdbcType="INTEGER" />
+    <result column="ftd_bankcode" property="ftdBankcode" jdbcType="VARCHAR" />
+    <result column="ftd_bankname" property="ftdBankname" jdbcType="VARCHAR" />
+    <result column="ftd_inbankid" property="ftdInbankid" jdbcType="INTEGER" />
+    <result column="ftd_inbankcode" property="ftdInbankcode" jdbcType="VARCHAR" />
+    <result column="ftd_inbankname" property="ftdInbankname" jdbcType="VARCHAR" />
+    <result column="ftd_nowbalance" property="ftdNowbalance" jdbcType="DOUBLE" />
+    <result column="ftd_paymethod" property="ftdPaymethod" jdbcType="VARCHAR" />
+    <result column="ftd_paycode" property="ftdPaycode" jdbcType="VARCHAR" />
+    <result column="ftd_remark" property="ftdRemark" jdbcType="VARCHAR" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
+    <result column="updatedate" property="updatedate" jdbcType="TIMESTAMP" />
+    <result column="ftd_text1" property="ftdText1" jdbcType="VARCHAR" />
+    <result column="ftd_text2" property="ftdText2" jdbcType="VARCHAR" />
+    <result column="ftd_text3" property="ftdText3" jdbcType="VARCHAR" />
+    <result column="ftd_text4" property="ftdText4" jdbcType="VARCHAR" />
+    <result column="ftd_text5" property="ftdText5" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    ftd_id, ftd_ftid, ftd_detno, ftd_ym, ftd_bankid, ftd_bankcode, ftd_bankname, ftd_inbankid, 
+    ftd_inbankcode, ftd_inbankname, ftd_nowbalance, ftd_paymethod, ftd_paycode, ftd_remark, 
+    companyid, updaterId, updatedate, ftd_text1, ftd_text2, ftd_text3, ftd_text4, ftd_text5
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from fundtransferdetail
+    where ftd_id = #{ftdId,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from fundtransferdetail
+    where ftd_id = #{ftdId,jdbcType=INTEGER}
+  </delete>
+
+  <delete id="deleteItem" parameterType="java.lang.Integer" >
+    delete from fundtransferdetail
+    where ftd_ftid = #{ftdFtid,jdbcType=INTEGER}
+  </delete>
+
+  <insert id="insert" parameterType="com.usoftchina.saas.money.po.Fundtransferdetail" >
+    insert into fundtransferdetail (ftd_id, ftd_ftid, ftd_detno, 
+      ftd_ym, ftd_bankid, ftd_bankcode, 
+      ftd_bankname, ftd_inbankid, ftd_inbankcode, 
+      ftd_inbankname, ftd_nowbalance, ftd_paymethod, 
+      ftd_paycode, ftd_remark, companyid, 
+      updaterId, updatedate, ftd_text1, 
+      ftd_text2, ftd_text3, ftd_text4, 
+      ftd_text5)
+    values (#{ftdId,jdbcType=INTEGER}, #{ftdFtid,jdbcType=INTEGER}, #{ftdDetno,jdbcType=INTEGER}, 
+      #{ftdYm,jdbcType=INTEGER}, #{ftdBankid,jdbcType=INTEGER}, #{ftdBankcode,jdbcType=VARCHAR}, 
+      #{ftdBankname,jdbcType=VARCHAR}, #{ftdInbankid,jdbcType=INTEGER}, #{ftdInbankcode,jdbcType=VARCHAR}, 
+      #{ftdInbankname,jdbcType=VARCHAR}, #{ftdNowbalance,jdbcType=DOUBLE}, #{ftdPaymethod,jdbcType=VARCHAR}, 
+      #{ftdPaycode,jdbcType=VARCHAR}, #{ftdRemark,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, 
+      #{updaterid,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}, #{ftdText1,jdbcType=VARCHAR}, 
+      #{ftdText2,jdbcType=VARCHAR}, #{ftdText3,jdbcType=VARCHAR}, #{ftdText4,jdbcType=VARCHAR}, 
+      #{ftdText5,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Fundtransferdetail" >
+    insert into fundtransferdetail
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="ftdId != null" >
+        ftd_id,
+      </if>
+      <if test="ftdFtid != null" >
+        ftd_ftid,
+      </if>
+      <if test="ftdDetno != null" >
+        ftd_detno,
+      </if>
+      <if test="ftdYm != null" >
+        ftd_ym,
+      </if>
+      <if test="ftdBankid != null" >
+        ftd_bankid,
+      </if>
+      <if test="ftdBankcode != null" >
+        ftd_bankcode,
+      </if>
+      <if test="ftdBankname != null" >
+        ftd_bankname,
+      </if>
+      <if test="ftdInbankid != null" >
+        ftd_inbankid,
+      </if>
+      <if test="ftdInbankcode != null" >
+        ftd_inbankcode,
+      </if>
+      <if test="ftdInbankname != null" >
+        ftd_inbankname,
+      </if>
+      <if test="ftdNowbalance != null" >
+        ftd_nowbalance,
+      </if>
+      <if test="ftdPaymethod != null" >
+        ftd_paymethod,
+      </if>
+      <if test="ftdPaycode != null" >
+        ftd_paycode,
+      </if>
+      <if test="ftdRemark != null" >
+        ftd_remark,
+      </if>
+      <if test="companyid != null" >
+        companyid,
+      </if>
+      <if test="updaterid != null" >
+        updaterId,
+      </if>
+      <if test="updatedate != null" >
+        updatedate,
+      </if>
+      <if test="ftdText1 != null" >
+        ftd_text1,
+      </if>
+      <if test="ftdText2 != null" >
+        ftd_text2,
+      </if>
+      <if test="ftdText3 != null" >
+        ftd_text3,
+      </if>
+      <if test="ftdText4 != null" >
+        ftd_text4,
+      </if>
+      <if test="ftdText5 != null" >
+        ftd_text5,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="ftdId != null" >
+        #{ftdId,jdbcType=INTEGER},
+      </if>
+      <if test="ftdFtid != null" >
+        #{ftdFtid,jdbcType=INTEGER},
+      </if>
+      <if test="ftdDetno != null" >
+        #{ftdDetno,jdbcType=INTEGER},
+      </if>
+      <if test="ftdYm != null" >
+        #{ftdYm,jdbcType=INTEGER},
+      </if>
+      <if test="ftdBankid != null" >
+        #{ftdBankid,jdbcType=INTEGER},
+      </if>
+      <if test="ftdBankcode != null" >
+        #{ftdBankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdBankname != null" >
+        #{ftdBankname,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdInbankid != null" >
+        #{ftdInbankid,jdbcType=INTEGER},
+      </if>
+      <if test="ftdInbankcode != null" >
+        #{ftdInbankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdInbankname != null" >
+        #{ftdInbankname,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdNowbalance != null" >
+        #{ftdNowbalance,jdbcType=DOUBLE},
+      </if>
+      <if test="ftdPaymethod != null" >
+        #{ftdPaymethod,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdPaycode != null" >
+        #{ftdPaycode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdRemark != null" >
+        #{ftdRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyid != null" >
+        #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="updaterid != null" >
+        #{updaterid,jdbcType=INTEGER},
+      </if>
+      <if test="updatedate != null" >
+        #{updatedate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ftdText1 != null" >
+        #{ftdText1,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdText2 != null" >
+        #{ftdText2,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdText3 != null" >
+        #{ftdText3,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdText4 != null" >
+        #{ftdText4,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdText5 != null" >
+        #{ftdText5,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Fundtransferdetail" >
+    update fundtransferdetail
+    <set >
+      <if test="ftdFtid != null" >
+        ftd_ftid = #{ftdFtid,jdbcType=INTEGER},
+      </if>
+      <if test="ftdDetno != null" >
+        ftd_detno = #{ftdDetno,jdbcType=INTEGER},
+      </if>
+      <if test="ftdYm != null" >
+        ftd_ym = #{ftdYm,jdbcType=INTEGER},
+      </if>
+      <if test="ftdBankid != null" >
+        ftd_bankid = #{ftdBankid,jdbcType=INTEGER},
+      </if>
+      <if test="ftdBankcode != null" >
+        ftd_bankcode = #{ftdBankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdBankname != null" >
+        ftd_bankname = #{ftdBankname,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdInbankid != null" >
+        ftd_inbankid = #{ftdInbankid,jdbcType=INTEGER},
+      </if>
+      <if test="ftdInbankcode != null" >
+        ftd_inbankcode = #{ftdInbankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdInbankname != null" >
+        ftd_inbankname = #{ftdInbankname,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdNowbalance != null" >
+        ftd_nowbalance = #{ftdNowbalance,jdbcType=DOUBLE},
+      </if>
+      <if test="ftdPaymethod != null" >
+        ftd_paymethod = #{ftdPaymethod,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdPaycode != null" >
+        ftd_paycode = #{ftdPaycode,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdRemark != null" >
+        ftd_remark = #{ftdRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyid != null" >
+        companyid = #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="updaterid != null" >
+        updaterId = #{updaterid,jdbcType=INTEGER},
+      </if>
+      <if test="updatedate != null" >
+        updatedate = #{updatedate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ftdText1 != null" >
+        ftd_text1 = #{ftdText1,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdText2 != null" >
+        ftd_text2 = #{ftdText2,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdText3 != null" >
+        ftd_text3 = #{ftdText3,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdText4 != null" >
+        ftd_text4 = #{ftdText4,jdbcType=VARCHAR},
+      </if>
+      <if test="ftdText5 != null" >
+        ftd_text5 = #{ftdText5,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where ftd_id = #{ftdId,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Fundtransferdetail" >
+    update fundtransferdetail
+    set ftd_ftid = #{ftdFtid,jdbcType=INTEGER},
+      ftd_detno = #{ftdDetno,jdbcType=INTEGER},
+      ftd_ym = #{ftdYm,jdbcType=INTEGER},
+      ftd_bankid = #{ftdBankid,jdbcType=INTEGER},
+      ftd_bankcode = #{ftdBankcode,jdbcType=VARCHAR},
+      ftd_bankname = #{ftdBankname,jdbcType=VARCHAR},
+      ftd_inbankid = #{ftdInbankid,jdbcType=INTEGER},
+      ftd_inbankcode = #{ftdInbankcode,jdbcType=VARCHAR},
+      ftd_inbankname = #{ftdInbankname,jdbcType=VARCHAR},
+      ftd_nowbalance = #{ftdNowbalance,jdbcType=DOUBLE},
+      ftd_paymethod = #{ftdPaymethod,jdbcType=VARCHAR},
+      ftd_paycode = #{ftdPaycode,jdbcType=VARCHAR},
+      ftd_remark = #{ftdRemark,jdbcType=VARCHAR},
+      companyid = #{companyid,jdbcType=INTEGER},
+      updaterId = #{updaterid,jdbcType=INTEGER},
+      updatedate = #{updatedate,jdbcType=TIMESTAMP},
+      ftd_text1 = #{ftdText1,jdbcType=VARCHAR},
+      ftd_text2 = #{ftdText2,jdbcType=VARCHAR},
+      ftd_text3 = #{ftdText3,jdbcType=VARCHAR},
+      ftd_text4 = #{ftdText4,jdbcType=VARCHAR},
+      ftd_text5 = #{ftdText5,jdbcType=VARCHAR}
+    where ftd_id = #{ftdId,jdbcType=INTEGER}
+  </update>
+</mapper>

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

@@ -3,7 +3,7 @@ package com.usoftchina.saas.purchase.controller;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutReqDTO;
@@ -56,8 +56,8 @@ public class ProdInOutController {
      * @return
      */
     @PostMapping("/save")
-    public Result<DocSavedDTO> saveFormData(@RequestBody ProdInOutFormDTO data) {
-        DocSavedDTO savedDTO = prodInOutService.saveFormData(data,false);
+    public Result<DocBaseDTO> saveFormData(@RequestBody ProdInOutFormDTO data) {
+        DocBaseDTO savedDTO = prodInOutService.saveFormData(data);
         return Result.success(savedDTO);
     }
 
@@ -94,7 +94,7 @@ public class ProdInOutController {
      */
     @PostMapping("/audit")
     public Result audit(@RequestBody ProdInOutFormDTO formData) {
-        DocSavedDTO audit = prodInOutService.audit(formData);
+        DocBaseDTO audit = prodInOutService.audit(formData);
         return Result.success(audit);
     }
 

+ 7 - 6
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -1,8 +1,10 @@
 package com.usoftchina.saas.purchase.controller;
 
 import com.github.pagehelper.PageInfo;
+import com.netflix.discovery.converters.Auto;
 import com.usoftchina.saas.base.Result;
 
+import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
@@ -13,6 +15,7 @@ import com.usoftchina.saas.purchase.service.PurchaseService;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.async.DeferredResult;
 
 
 /**
@@ -69,7 +72,7 @@ public class PurchaseController {
      * @param id
      * @return
      */
-    @GetMapping("/delete/{id}")
+    @PostMapping("/delete/{id}")
     public Result delete(@PathVariable("id") Long id) {
         purchaseService.delete(id);
         return Result.success();
@@ -81,7 +84,7 @@ public class PurchaseController {
      * @param id
      * @return
      */
-    @GetMapping("/deleteDetail/{id}")
+    @PostMapping("/deleteDetail/{id}")
     public Result deleteDetail(@PathVariable("id") Long id) {
         purchaseService.deleteDetail(id);
         return Result.success();
@@ -105,7 +108,7 @@ public class PurchaseController {
      * @param id
      * @return
      */
-    @GetMapping("/unAudit/{id}")
+    @PostMapping("/unAudit/{id}")
     public Result unAudit(@PathVariable("id") Long id) {
         purchaseService.unAudit(id);
         return Result.success();
@@ -159,12 +162,10 @@ public class PurchaseController {
         return Result.success();
     }
 
-    @GetMapping("/turnProdin/{id}")
+    @PostMapping("/turnProdin/{id}")
     public Result turnProdin(@PathVariable("id") Long id){
         purchaseService.turnProdin(id);
         return Result.success();
     }
 
-
-
 }

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

@@ -23,9 +23,10 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
 
     String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
 
-    Integer validateCodeWhenInsert(String code);
+    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
 
-    Integer validateCodeWhenUpdate(@Param("code") String code,@Param("id") Long id);
+    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id,
+                                   @Param("companyId") Long companyId);
 
     String selectCodeById(Long id);
 }

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

@@ -4,7 +4,7 @@ import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutReqDTO;
@@ -32,7 +32,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      * @param formdata
      * @return
      */
-    DocSavedDTO saveFormData(ProdInOutFormDTO formdata,Boolean isbfaudit);
+    DocBaseDTO saveFormData(ProdInOutFormDTO formdata);
 
     /**
      * 删除出入库单
@@ -45,7 +45,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      * @param formData
      * @return
      */
-    DocSavedDTO audit(ProdInOutFormDTO formData);
+    DocBaseDTO audit(ProdInOutFormDTO formData);
 
     /**
      * 反审核出入库单

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

@@ -7,7 +7,6 @@ import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.WarehouseApi;
@@ -19,7 +18,9 @@ import com.usoftchina.saas.purchase.dto.ProdInOutDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutReqDTO;
 import com.usoftchina.saas.purchase.mapper.*;
-import com.usoftchina.saas.purchase.po.*;
+import com.usoftchina.saas.purchase.po.ProdIODetail;
+import com.usoftchina.saas.purchase.po.ProdInOut;
+import com.usoftchina.saas.purchase.po.ProdInOutList;
 import com.usoftchina.saas.purchase.service.ProdInOutService;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -96,7 +97,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     @Override
-    public DocSavedDTO saveFormData(ProdInOutFormDTO formdata,Boolean isbfaudit) {
+    public DocBaseDTO saveFormData(ProdInOutFormDTO formdata) {
         if (null == formdata || null == formdata.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
         }
@@ -111,7 +112,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         List<ProdIODetail> insertDetails = new ArrayList<>();
         //更新从表数据
         List<ProdIODetail> updateDetails = new ArrayList<>();
-        DocSavedDTO saveDTO = new DocSavedDTO();
+        DocBaseDTO baseDTO = new DocBaseDTO();
         Long pi_id = main.getId();
         String pi_inoutno = main.getPi_inoutno();
         ProdInOut prodInOut = BeanMapper.map(main,ProdInOut.class);
@@ -124,7 +125,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //编号获取
         pi_inoutno = pushMaxnubmer(pi_inoutno, pi_id);
         prodInOut.setPi_inoutno(pi_inoutno);
-        saveDTO.setCode(pi_inoutno);
+        baseDTO.setCode(pi_inoutno);
         //判断更新与保存动作
         if (StringUtils.isEmpty(pi_id) || "0".equals(pi_id.toString())){
             //插入操作
@@ -143,8 +144,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             if (insertDetails.size()>0) {
                 prodIODetailMapper.batchInsert(insertDetails);
             }
-            saveDTO.setId(pi_id);
-            return saveDTO;
+            baseDTO.setId(pi_id);
+            return baseDTO;
         }
         //更新操作
         getMapper().updateByPrimaryKeySelective(prodInOut);
@@ -168,11 +169,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (updateDetails.size()>0) {
             prodIODetailMapper.batchUpdate(updateDetails);
         }
-        saveDTO.setId(pi_id);
+        baseDTO.setId(pi_id);
         //更新已转数
-        if (!isbfaudit)
-            updateYqty(prodInOut);
-        return saveDTO;
+        updateYqty(prodInOut);
+        return baseDTO;
     }
 
     @Override
@@ -195,19 +195,19 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
 
     @Override
-    public DocSavedDTO audit(ProdInOutFormDTO formData) {
+    public DocBaseDTO audit(ProdInOutFormDTO formData) {
         Long id = null;
-        DocSavedDTO savedDTO = new DocSavedDTO();
+        DocBaseDTO baseDTO = new DocBaseDTO();
         if (null != formData) {
             id = formData.getMain().getId();
             if (StringUtils.isEmpty(id)) {
-                DocSavedDTO saveDTO = saveFormData(formData,true);
-                id = saveDTO.getId();
+                baseDTO = saveFormData(formData);
+                id = baseDTO.getId();
             }
             singleAudit(formData.getMain());
         }
-        savedDTO.setId(id);
-        return savedDTO;
+        baseDTO.setId(id);
+        return baseDTO;
     }
 
     @Override
@@ -339,8 +339,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
-        Integer count = "0".equals(String.valueOf(id)) ? purchaseMapper.validateCodeWhenInsert(code) :
-                purchaseMapper.validateCodeWhenUpdate(code, id);
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? purchaseMapper.validateCodeWhenInsert(code, companyId) :
+                purchaseMapper.validateCodeWhenUpdate(code, id, companyId);
         return maxnumberService.pushMaxnubmer(count, code, "Purchase").toString();
     }
 

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

@@ -10,6 +10,7 @@ import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
@@ -469,9 +470,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
-        Integer count = "0".equals(String.valueOf(id)) ? purchaseMapper.validateCodeWhenInsert(code) :
-                purchaseMapper.validateCodeWhenUpdate(code, id);
-        return maxnumberService.pushMaxnubmer(count, code, "Purchase").getData();
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? purchaseMapper.validateCodeWhenInsert(code, companyId) :
+                purchaseMapper.validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.PURCHASE.getCaller()).getData();
     }
     
     /** 
@@ -486,7 +488,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             return null;
         }
         String code = purchaseMapper.selectCodeById(id);
-        DocBaseDTO baseDTO = new DocBaseDTO(id, code, "Purchase");
+        DocBaseDTO baseDTO = new DocBaseDTO(id, code, BillCodeSeq.PURCHASE.getCaller());
         return baseDTO;
     }
 }

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

@@ -406,20 +406,20 @@
   <select id="validateUnAudit" parameterType="long" resultType="java.lang.String">
     select pu_code from purchase where pu_id = #{pu_id} and IFNULL(pu_statuscode,'UNAUDITED')='UNAUDITED'
   </select>
-  <select id="selectByTest" resultMap="BaseResultMap" parameterType="string" >
+  <!--<select id="selectByTest" resultMap="BaseResultMap" parameterType="string" >
     select * from purchase <where>
     <if test="_parameter != null">
        ${value}
     </if>
   </where>
-  </select>
-  <select id="validateCodeWhenInsert" resultType="int" parameterType="string" >
-    select count(1) from purchase where pu_code = #{code}
+  </select>-->
+  <select id="validateCodeWhenInsert" resultType="int">
+    select count(1) from purchase where pu_code = #{code} and companyId =#{companyId}
   </select>
   <select id="validateCodeWhenUpdate" resultType="int" >
-    select count(1) from purchase where pu_code = #{code} and pu_id != #{id}
+    select count(1) from purchase where pu_code = #{code} and pu_id != #{id} and companyId =#{companyId}
   </select>
   <select id="selectCodeById" resultType="string" parameterType="long">
-    select pu_code from pu_id=#{id}
+    select pu_code from purchase where pu_id=#{id}
   </select>
 </mapper>

+ 9 - 1
applications/sale/sale-dto/pom.xml

@@ -19,6 +19,14 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>core</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>document-dto</artifactId>
+        </dependency>
     </dependencies>
-
 </project>

+ 91 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdIODetailDTO.java

@@ -0,0 +1,91 @@
+package com.usoftchina.saas.sale.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import com.usoftchina.saas.document.dto.ProductDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Created by wyx
+ * 2018-10-23
+ */
+@Data
+public class ProdIODetailDTO extends CommonBaseEntity implements Serializable {
+
+    private Long pd_piid;
+
+    private String pd_inoutno;
+
+    private String pd_piclass;
+
+    private Integer pd_pdno;
+
+    private String pd_ordercode;
+
+    private Integer pd_orderdetno;
+
+    private Long pd_prodid;
+
+    private String pd_prodcode;
+
+    private String pd_unit;
+
+    private Double pd_inqty;
+
+    private Double pd_outqty;
+
+    private Double pd_orderprice;
+
+    private Double pd_sendprice;
+
+    private Double pd_price;
+
+    private Double pd_total;
+
+    private Double pd_taxrate;
+
+    private Double pd_netprice;
+
+    private Double pd_nettotal;
+
+    private Integer pd_whid;
+
+    private String pd_whcode;
+
+    private String pd_whname;
+
+    private Integer pd_inwhid;
+
+    private String pd_inwhcode;
+
+    private String pd_inwhname;
+
+    private Long pd_orderid;
+
+    private Integer pd_sdid;
+
+    private Integer pd_status;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Integer pd_ym;
+
+    private Double pd_yqty;
+
+    private String pd_remark;
+
+    private Long pd_ioid;
+
+    private ProductDTO product;
+
+}

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

@@ -0,0 +1,73 @@
+package com.usoftchina.saas.sale.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by wyx
+ * 2018-10-23
+ */
+@Data
+public class ProdInOutDTO extends CommonBaseEntity implements Serializable {
+
+    private String pi_inoutno;
+
+    private String pi_class;
+
+    private Date pi_date;
+
+    private Integer pi_vendid;
+
+    private String pi_vendcode;
+
+    private String pi_vendname;
+
+    private Integer pi_custid;
+
+    private String pi_custcode;
+
+    private String pi_custname;
+
+    private Integer pi_puid;
+
+    private String pi_pucode;
+
+    private Long pi_said;
+
+    private String pi_sacode;
+
+    private Double pi_total;
+
+    private Integer pi_recordmanid;
+
+    private String pi_recordman;
+
+    private Date pi_recorddate;
+
+    private String pi_status;
+
+    private String pi_statuscode;
+
+    private String pi_printstatus;
+
+    private String pi_printstatuscode;
+
+    private String pi_text1;
+
+    private String pi_text2;
+
+    private String pi_text3;
+
+    private String pi_text4;
+
+    private String pi_text5;
+
+    private String pi_address;
+
+
+
+}

+ 18 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutFormDTO.java

@@ -0,0 +1,18 @@
+package com.usoftchina.saas.sale.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Created by wyx
+ * 2018-10-23
+ */
+@Data
+public class ProdInOutFormDTO implements Serializable {
+
+    private ProdInOutDTO main;
+    private List<ProdIODetailDTO> items;
+
+}

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

@@ -0,0 +1,140 @@
+package com.usoftchina.saas.sale.dto;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by wyx
+ * 2018-10-23
+ */
+@Data
+public class ProdInOutListDTO extends CommonBaseEntity implements Serializable {
+
+    private String pi_inoutno;
+
+    private String pi_class;
+
+    private Date pi_date;
+
+    private Integer pi_vendid;
+
+    private String pi_vendcode;
+
+    private String pi_vendname;
+
+    private Integer pi_custid;
+
+    private String pi_custcode;
+
+    private String pi_custname;
+
+    private Integer pi_puid;
+
+    private String pi_pucode;
+
+    private Integer pi_said;
+
+    private String pi_sacode;
+
+    private Double pi_total;
+
+    private Integer pi_recordmanid;
+
+    private String pi_recordman;
+
+    private Date pi_recorddate;
+
+    private String pi_status;
+
+    private String pi_statuscode;
+
+    private String pi_printstatus;
+
+    private String pi_printstatuscode;
+
+    private String pi_text1;
+
+    private String pi_text2;
+
+    private String pi_text3;
+
+    private String pi_text4;
+
+    private String pi_text5;
+
+    private String pi_address;
+
+    private Long pd_piid;
+
+    private String pd_inoutno;
+
+    private String pd_piclass;
+
+    private Integer pd_pdno;
+
+    private String pd_ordercode;
+
+    private Integer pd_orderdetno;
+
+    private Integer pd_prodid;
+
+    private String pd_prodcode;
+
+    private String pd_unit;
+
+    private Double pd_inqty;
+
+    private Double pd_outqty;
+
+    private Double pd_orderprice;
+
+    private Double pd_sendprice;
+
+    private Double pd_price;
+
+    private Double pd_total;
+
+    private Double pd_taxrate;
+
+    private Double pd_netprice;
+
+    private Double pd_nettotal;
+
+    private Integer pd_whid;
+
+    private String pd_whcode;
+
+    private String pd_whname;
+
+    private Integer pd_inwhid;
+
+    private String pd_inwhcode;
+
+    private String pd_inwhname;
+
+    private Integer pd_orderid;
+
+    private Integer pd_sdid;
+
+    private Integer pd_status;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Integer pd_ym;
+
+    private Integer pd_yqty;
+
+    private String pd_remark;
+
+}

+ 28 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutReqDTO.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.sale.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by wyx
+ * 2018-10-23
+ */
+@Data
+public class ProdInOutReqDTO implements Serializable {
+    /**
+     * 开始日期
+     */
+    private Date begin;
+    /**
+     * 截止日期
+     */
+    private Date end;
+    private String status;
+    private String keyword;
+    //区分是否为关联列表
+    private String mode;
+
+
+}

+ 4 - 12
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java

@@ -4,8 +4,8 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
 
 /**
  * @author: guq
@@ -14,17 +14,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 @SpringBootApplication
 @MapperScan("com.usoftchina.saas.sale.mapper")
 @EnableEurekaClient
-public class SaleApplication extends WebMvcConfigurerAdapter {
+@EnableFeignClients("com.usoftchina.saas")
+public class SaleApplication{
     public static void main(String[] args) {
         SpringApplication.run(SaleApplication.class, args);
     }
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-
-        registry.addMapping("/**")
-                .allowCredentials(true)
-                .allowedHeaders("*")
-                .allowedOrigins("*")
-                .allowedMethods("*");
-    }
 }

+ 162 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java

@@ -0,0 +1,162 @@
+package com.usoftchina.saas.sale.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.DocSavedDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.dto.ProdInOutFormDTO;
+import com.usoftchina.saas.sale.dto.ProdInOutReqDTO;
+import com.usoftchina.saas.sale.service.ProdInOutService;
+import com.usoftchina.saas.storage.po.ProdInOutList;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * Created by wyx
+ * 2018-10-23.
+ */
+@CrossOrigin
+@RestController
+@RequestMapping("/prodinout")
+public class ProdInOutController {
+
+
+    @Autowired
+    ProdInOutService prodInOutService;
+
+
+    /**
+     * 出入库订单列表
+     *
+     * @param page
+     * @param req
+     * @return
+     */
+    @GetMapping("/list")
+    public Result<PageInfo<ProdInOutList>> getListData(PageRequest page, ListReqDTO req) {
+        PageInfo<ProdInOutList> listData = prodInOutService.getListData(page,req);
+        return Result.success(listData);
+    }
+
+    /**
+     * 获取出入库单表单
+     *
+     * @return
+     */
+    @GetMapping("/read/{id}")
+    public Result<ProdInOutFormDTO> getFormData(@PathVariable("id") Long id) {
+        ProdInOutFormDTO data = prodInOutService.getFormData(id);
+        return Result.success(data);
+    }
+
+    /**
+     * 出入库单表单保存
+     *
+     * @param
+     * @return
+     */
+    @PostMapping("/save")
+    public Result<DocSavedDTO> saveFormData(@RequestBody ProdInOutFormDTO data) {
+        DocBaseDTO savedDTO = prodInOutService.saveFormData(data);
+        return Result.success(savedDTO);
+    }
+
+    /**
+     * 出入库单删除
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id) {
+        prodInOutService.delete(id);
+        return Result.success();
+    }
+
+    /**
+     * 出入库单明细删除
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/deleteItem/{id}")
+    public Result deleteItem(@PathVariable("id") Long id) {
+        prodInOutService.deleteItem(id);
+        return Result.success();
+    }
+
+
+    /**
+     * 出入库单审批
+     *
+     * @param formData
+     * @return
+     */
+    @PostMapping("/audit")
+    public Result audit(@RequestBody ProdInOutFormDTO formData) {
+        DocBaseDTO audit = prodInOutService.audit(formData);
+        return Result.success(audit);
+    }
+
+    /**
+     * 出入库单审批
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/unAudit/{id}")
+    public Result unAudit(@PathVariable("id") Long id) {
+        prodInOutService.unAudit(id);
+        return Result.success();
+    }
+
+    /**
+     * 出入库单批量审核/反审核
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchAudit")
+    public Result batchAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
+        prodInOutService.batchAudit(baseDTOs);
+        return Result.success();
+    }
+
+    /**
+     * 出入库单批量反审核
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchUnAudit")
+    public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
+        prodInOutService.batchAudit(baseDTOs);
+        return Result.success();
+    }
+
+
+    /**
+     * 出入库单批量删除
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchDelete")
+    public Result batchDelete(@RequestBody BatchDealBaseDTO baseDTOs) {
+        prodInOutService.batchDelete(baseDTOs);
+        return Result.success();
+    }
+
+    @GetMapping("/turnProdIn/{id}")
+    public Result turnProdin(@PathVariable("id") Long id){
+        prodInOutService.turnProdin(id);
+        return Result.success();
+    };
+
+
+
+
+}

+ 4 - 4
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java

@@ -67,7 +67,7 @@ public class SaleController {
      * @param id
      * @return
      */
-    @GetMapping("/delete/{id}")
+    @PostMapping("/delete/{id}")
     public Result delete(@PathVariable("id") Long id) {
         saleService.delete(id);
         return Result.success();
@@ -79,7 +79,7 @@ public class SaleController {
      * @param id
      * @return
      */
-    @GetMapping("/deleteDetail/{id}")
+    @PostMapping("/deleteDetail/{id}")
     public Result deleteDetail(@PathVariable("id") Long id) {
         saleService.deleteDetail(id);
         return Result.success();
@@ -103,7 +103,7 @@ public class SaleController {
      * @param id
      * @return
      */
-    @GetMapping("/unAudit/{id}")
+    @PostMapping("/unAudit/{id}")
     public Result unAudit(@PathVariable("id") Long id) {
         saleService.unAudit(id);
         return Result.success();
@@ -157,7 +157,7 @@ public class SaleController {
         return Result.success();
     }
 
-    @GetMapping("/turnProdOut/{id}")
+    @PostMapping("/turnProdOut/{id}")
     public Result turnOut(@PathVariable("id") Long id) {
         saleService.turnOut(id);
         return Result.success();

+ 18 - 7
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdIODetailMapper.java

@@ -1,30 +1,41 @@
 package com.usoftchina.saas.sale.mapper;
 
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.storage.po.ProdIODetail;
+import com.usoftchina.saas.storage.po.ProdIODetailExample;
+
 
 import java.util.List;
 
-public interface ProdIODetailMapper  {
+public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
+
 
-    int deleteByPrimaryKey(Long pd_id);
+    int deleteByExample(ProdIODetailExample example);
 
     int insert(ProdIODetail record);
 
     int insertSelective(ProdIODetail record);
 
-    ProdIODetail selectByPrimaryKey(Integer pd_id);
-
     int updateByPrimaryKeySelective(ProdIODetail record);
 
-    int updateByPrimaryKeyWithBLOBs(ProdIODetail record);
-
     int updateByPrimaryKey(ProdIODetail record);
 
+    int deleteByPrimaryKey(Long id);
+
+    void deleteByForeignKey(Long id);
+
     void batchInsert(List<ProdIODetail> list);
 
     void batchUpdate(List<ProdIODetail> list);
 
-    void updatePurchaseYqty(Integer id);
+    void updateSaleOutYqty(Long id);
 
     List<ProdIODetail> selectByFK(Long id);
+    //销售入库更新计算明细其它字段
+    void updatePDSaleIN(Long id);
+    //销售出库更新计算明细其它字段
+    void updatePDSaleOut(Long id);
+    //更新销售订单已转数
+    void updateSaleYqty(Long id);
+
 }

+ 20 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutListMapper.java

@@ -0,0 +1,20 @@
+package com.usoftchina.saas.sale.mapper;
+
+import com.usoftchina.saas.sale.dto.ProdInOutReqDTO;
+import com.usoftchina.saas.storage.po.ProdInOutList;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Created by wyx
+ * 2018-10-23.
+ */
+public interface ProdInOutListMapper {
+
+    List<ProdInOutList> selectProdInOutListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+
+    List<ProdInOutList> selectProdInOutBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+
+
+}

+ 36 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutMapper.java

@@ -1,10 +1,19 @@
 package com.usoftchina.saas.sale.mapper;
 
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.storage.po.ProdInOut;
+import com.usoftchina.saas.storage.po.ProdInOutExample;
+import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
 
+public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
+    long countByExample(ProdInOutExample example);
 
-public interface ProdInOutMapper {
+    int deleteByExample(ProdInOutExample example);
 
     int deleteByPrimaryKey(Long pi_id);
 
@@ -12,11 +21,37 @@ public interface ProdInOutMapper {
 
     int insertSelective(ProdInOut record);
 
+    List<ProdInOut> selectByExampleWithBLOBs(ProdInOutExample example);
+
+    List<ProdInOut> selectByExample(ProdInOutExample example);
+
     ProdInOut selectByPrimaryKey(Long pi_id);
 
+    int updateByExampleSelective(@Param("record") ProdInOut record, @Param("example") ProdInOutExample example);
+
+    int updateByExampleWithBLOBs(@Param("record") ProdInOut record, @Param("example") ProdInOutExample example);
+
+    int updateByExample(@Param("record") ProdInOut record, @Param("example") ProdInOutExample example);
+
     int updateByPrimaryKeySelective(ProdInOut record);
 
     int updateByPrimaryKeyWithBLOBs(ProdInOut record);
 
     int updateByPrimaryKey(ProdInOut record);
+
+    String selectCodeById(Long pi_id);
+
+    int validateCodeWhenInsert(@Param("code") String code,@Param("pi_class") String pi_class );
+
+    int validateCodeWhenUpdate(@Param("code") String code,@Param("id") Long id );
+
+    String validateUnAudit(Long id);
+
+    String validateAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateBatchClose(List<DocBaseDTO> baseDTOs);
+
+    String validateBatchOpen(List<DocBaseDTO> baseDTOs);
 }

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

@@ -20,7 +20,7 @@ public interface SaleMapper {
 
     int updateByPrimaryKey(Sale record);
 
-    Integer validateCodeWhenInsert(String code);
+    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
 
     String selectCodeById(Long id);
 
@@ -30,7 +30,7 @@ public interface SaleMapper {
 
     String validateAudit(List<DocBaseDTO> baseDTOs);
 
-    Integer validateCodeWhenUpdate(@Param("code") String code,@Param("id") Long id);
+    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long companyId);
 
     void updateTotal(Long id);
 }

+ 122 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java

@@ -0,0 +1,122 @@
+package com.usoftchina.saas.sale.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.DocSavedDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+
+import com.usoftchina.saas.sale.dto.ProdInOutFormDTO;
+import com.usoftchina.saas.sale.dto.ProdInOutReqDTO;
+import com.usoftchina.saas.sale.mapper.ProdInOutMapper;
+import com.usoftchina.saas.storage.po.ProdInOut;
+import com.usoftchina.saas.storage.po.ProdInOutList;
+
+
+/**
+ * Created by wyx
+ * 2018-10-23.
+ */
+public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, ProdInOut>  {
+
+    /**
+     * 获取出入单表单
+     *
+     * @param id
+     * @return
+     */
+    ProdInOutFormDTO getFormData(Long id);
+
+    /**
+     * 保存出入库单
+     *
+     * @param formdata
+     * @return
+     */
+    DocBaseDTO saveFormData(ProdInOutFormDTO formdata);
+
+    /**
+     * 删除出入库单
+     * @param id
+     */
+    void delete(Long id);
+
+    /**
+     * 批量删除出入库单
+     * @param baseDTOs
+     */
+    void batchDelete(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 删除明细
+     * @param id
+     * @return
+     */
+    Integer deleteItem(Long id);
+
+    /**
+     * 审核出入库单
+     * @param formData
+     * @return
+     */
+    DocBaseDTO audit(ProdInOutFormDTO formData);
+
+    /**
+     * 批量审核出入库
+     * @param baseDTOs
+     * @return
+     */
+    void batchAudit(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 反审核出入库单
+     * @param id
+     */
+    Result unAudit(Long id);
+
+    /**
+     * 批量反审核出入库单
+     * @param baseDTOs
+     */
+    void batchUnAudit(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 启用出入库单
+     * @param id
+     */
+    Result open(Long id);
+
+    /**
+     * 关闭出入库单
+     * @param
+     */
+    Result close(Long id);
+
+    /**
+     * 批量启用出入库单
+     * @param baseDTOs
+     */
+    void batchOpen(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 批量关闭出入库单
+     * @param baseDTOs
+     */
+    void batchClose(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 获取列表信息
+     * @param page 分页
+     * @param req
+     */
+    PageInfo<ProdInOutList> getListData(PageRequest page, ListReqDTO req);
+
+    /**
+     * 出库单转退货单
+     * @param id
+     */
+    Result turnProdin(Long id);
+}

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

@@ -0,0 +1,634 @@
+package com.usoftchina.saas.sale.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.DocSavedDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Status;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.api.WarehouseApi;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.exception.ExceptionCode;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.dto.ProdIODetailDTO;
+import com.usoftchina.saas.sale.dto.ProdInOutDTO;
+import com.usoftchina.saas.sale.dto.ProdInOutFormDTO;
+import com.usoftchina.saas.sale.mapper.*;
+import com.usoftchina.saas.sale.service.ProdInOutService;
+import com.usoftchina.saas.storage.po.ProdIODetail;
+import com.usoftchina.saas.storage.po.ProdInOut;
+import com.usoftchina.saas.storage.po.ProdInOutList;
+import com.usoftchina.saas.utils.BeanMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+
+import java.util.*;
+@Service
+public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper, ProdInOut> implements ProdInOutService{
+
+    @Autowired
+    private MaxnumberService maxnumberService;
+
+    @Autowired
+    private ProdInOutListMapper prodInOutListMapper;
+    @Autowired
+    private ProdInOutMapper prodInOutMapper;
+    @Autowired
+    private ProdIODetailMapper prodIODetailMapper;
+    @Autowired
+    private MessageLogService messageLogService;
+    @Autowired
+    private WarehouseApi warehouseApi;
+
+    @Override
+    public ProdInOutFormDTO getFormData(Long id) {
+        ProdInOutFormDTO prodInOutFormDTO = new ProdInOutFormDTO();
+        //查询主表
+        ProdInOut prodInOut = checkAndReturnOrder(id);
+        //将prodInOut实体对象转化为传输对象
+        ProdInOutDTO main = BeanMapper.map(prodInOut,ProdInOutDTO.class);
+        //查询从表
+
+        List<ProdIODetail> prodIODetails = prodIODetailMapper.selectByFK(id);
+        List<ProdIODetailDTO> items = BeanMapper.mapList(prodIODetails,ProdIODetailDTO.class);
+        prodInOutFormDTO.setMain(main);
+        prodInOutFormDTO.setItems(items);
+        return prodInOutFormDTO;
+    }
+
+    @Override
+    @Transactional
+    public DocBaseDTO saveFormData(ProdInOutFormDTO formdata) {
+
+        if (null == formdata || null == formdata.getMain()){
+            throw new BizException(500, "数据为空,请填写后再保存");
+        }
+        //公司ID
+        Long companyId = BaseContextHolder.getCompanyId();
+        //人员Id
+        Long userId = BaseContextHolder.getUserId();
+        //获取主表信息
+        ProdInOutDTO main = formdata.getMain();
+        List<ProdIODetailDTO> items = formdata.getItems();
+        //插入从表数据
+        List<ProdIODetail> insertDetails = new ArrayList<>();
+        //更新从表数据
+        List<ProdIODetail> updateDetails = new ArrayList<>();
+        //返回对象
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        Long pi_id = main.getId();
+        String pi_inoutno = main.getPi_inoutno();
+        String pi_class = main.getPi_class();
+        ProdInOut prodInOut = BeanMapper.map(main,ProdInOut.class);
+        prodInOut.setCompanyId(companyId);
+        prodInOut.setCreatorId(userId);
+        prodInOut.setCreateTime(new Date());
+        prodInOut.setPi_date(new Date());
+
+        //编号获取
+        pi_inoutno = pushMaxnubmer(pi_inoutno, pi_id,pi_class);
+        prodInOut.setPi_inoutno(pi_inoutno);
+
+        prodInOut.setPi_class(main.getPi_class());
+        prodInOut.setPi_said(main.getPi_said());
+        prodInOut.setPi_sacode(main.getPi_sacode());
+
+        //判断更新与保存动作
+        if (StringUtils.isEmpty(pi_id) || "0".equals(pi_id.toString())){
+            //插入操作
+            prodInOutMapper.insertSelective(prodInOut);
+            pi_id = prodInOut.getId();
+            //添加从表传输对象
+            for (ProdIODetailDTO item : items) {
+                ProdIODetail detail = BeanMapper.map(item,ProdIODetail.class);
+                detail.setPd_piid(pi_id);
+                detail.setPd_inoutno(pi_inoutno);
+                detail.setPd_piclass(pi_class);
+                detail.setPd_yqty(0.0);
+                insertDetails.add(detail);
+            }
+
+            //插入从表
+            if (insertDetails.size()>0) {
+                prodIODetailMapper.batchInsert(insertDetails);
+            }
+            baseDTO = getBaseDTOById(pi_id,pi_class);
+            //更新明细金额
+            getTotal(pi_id,pi_class);
+            //日志记录
+            messageLogService.save(baseDTO);
+            return baseDTO;
+        }
+        //更新操作
+        prodInOutMapper.updateByPrimaryKeySelective(prodInOut);
+        //添加从表传输对象
+        for (ProdIODetailDTO item : items) {
+            ProdIODetail detail = BeanMapper.map(item, ProdIODetail.class);
+            detail.setPd_piid(pi_id);
+            detail.setPd_inoutno(pi_inoutno);
+            detail.setPd_piclass(prodInOut.getPi_class());
+            if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
+                insertDetails.add(detail);
+            } else {
+                updateDetails.add(detail);
+            }
+        }
+        //插入从表
+        if (insertDetails.size()>0) {
+            prodIODetailMapper.batchInsert(insertDetails);
+        }
+        //更新从表
+        if (updateDetails.size()>0) {
+            prodIODetailMapper.batchUpdate(updateDetails);
+        }
+        baseDTO = getBaseDTOById(pi_id,pi_class);
+        //更新已转数
+        updateYqty(prodInOut);
+        return baseDTO;
+
+    }
+
+    @Override
+    @Transactional
+    public void delete(Long id) {
+        singleDelete(id);
+    }
+    private void singleDelete(Long id) {
+        ProdInOut prodInOut = checkAndReturnOrder(id);
+        //从表删除
+        prodIODetailMapper.deleteByForeignKey(id);
+        //主表删除
+        prodInOutMapper.deleteByPrimaryKey(id);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id,prodInOut.getPi_class());
+        //更新已转数
+        updateYqty(prodInOut);
+        //日志
+       messageLogService.deleteDetail(docBaseDTO);
+    }
+
+    @Override
+    @Transactional
+    public DocBaseDTO audit(ProdInOutFormDTO formData) {
+        Long id = null;
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        if (null != formData) {
+            id = formData.getMain().getId();
+            if (StringUtils.isEmpty(id)) {
+                baseDTO = saveFormData(formData);
+                id = baseDTO.getId();
+            }
+            String res = singleAudit(formData.getMain());
+            if(res!=null){
+                new BizException(501,res);
+            }
+        }
+        baseDTO.setId(id);
+        return baseDTO;
+    }
+    private String singleAudit(ProdInOutDTO prodInOutDTO) {
+        String pi_class= prodInOutDTO.getPi_class();
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
+        map.put("class", pi_class);
+        map.put("commitid",BaseContextHolder.getUserId());
+        map.put("companyid",BaseContextHolder.getCompanyId());
+        map.put("result","");
+        warehouseApi.post(map);
+        Object result =  map.get("result");
+        if(result!=null){
+            return result.toString();
+        }else{
+            //记录日志
+            DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class);
+            //日志
+            messageLogService.audit(docBaseDTO);
+            return "";
+        }
+    }
+
+    @Override
+    public Result unAudit(Long id) {
+        ProdInOut prodInOut = checkAndReturnOrder(id);
+        String code = prodInOutMapper.validateUnAudit(id);
+        if (!prodInOut.getPi_statuscode().equals(Status.AUDITED.name())) {
+            throw new BizException(BizExceptionCode.SALE_NULL_BILL);
+        }
+        ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut, ProdInOutDTO.class);
+        String res =  singleUnAudit(prodInOutDTO);
+        if(res!=null){
+            return Result.error(res);
+        }else{
+            return Result.success();
+        }
+    }
+    private String singleUnAudit(ProdInOutDTO prodInOutDTO) {
+        String pi_class= prodInOutDTO.getPi_class();
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
+        map.put("class", pi_class);
+        map.put("commitid",BaseContextHolder.getUserId());
+        map.put("companyid",BaseContextHolder.getCompanyId());
+        map.put("result","");
+        warehouseApi.unPost(map);
+        Object result =  map.get("result");
+        if(result!=null){
+            return result.toString();
+        }else{
+            //更新状态为未审核
+            ProdInOut prodInOut = BeanMapper.map(prodInOutDTO, ProdInOut.class);
+            prodInOut.setPi_statuscode(Status.UNAUDITED.name());
+            prodInOut.setPi_status(Status.UNAUDITED.getDisplay());
+            prodInOut.setUpdateTime(new Date());
+            prodInOut.setUpdaterId(BaseContextHolder.getUserId());
+            getMapper().updateByPrimaryKeySelective(prodInOut);
+            //记录日志
+            DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class);
+            //日志
+            messageLogService.unAudit(docBaseDTO);
+            return "";
+        }
+    }
+
+    @Override
+    public void batchAudit(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        String validate = prodInOutMapper.validateAudit(baseDTOs.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)) {
+            throw new BizException(500, "存在已审核单据,单据编号:" + validate);
+        }
+        String error = null;
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            Long id =  base.getId();
+            ProdInOut prodInOut = prodInOutMapper.selectByPrimaryKey(id);
+            ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
+            error+=singleAudit(prodInOutDTO);
+        }
+        if(!StringUtils.isEmpty(error)){
+            new BizException(501,error);
+        }
+    }
+
+    @Override
+    public void batchUnAudit(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+
+        String msg = prodInOutMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
+        if (null != msg) {
+            throw new BizException(500, "存在未审核单据,单据编号:" + msg);
+        }
+        String error = null;
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            Long id =  base.getId();
+            ProdInOut prodInOut = prodInOutMapper.selectByPrimaryKey(id);
+            ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
+            error+=singleUnAudit(prodInOutDTO);
+        }
+        if(!StringUtils.isEmpty(error)){
+            new BizException(501,error);
+        }
+    }
+
+    @Override
+    public Integer deleteItem(Long id) {
+        ProdIODetail prodIODetail = prodIODetailMapper.selectByPrimaryKey(id);
+        ProdInOut prodInOut = checkAndReturnOrder(prodIODetail.getPd_piid());
+        Integer num = prodIODetailMapper.deleteByPrimaryKey(id);
+        //更新已转数
+        updateYqty(prodInOut);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id,prodInOut.getPi_class());
+        //日志
+       messageLogService.deleteDetail(docBaseDTO);
+        return num;
+    }
+
+    @Override
+    public void batchDelete(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            singleDelete(base.getId());
+        }
+    }
+
+    @Override
+    public PageInfo<ProdInOutList> getListData(PageRequest page, ListReqDTO req) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //查询数据
+        List<ProdInOutList> lists = getListByMode(req);
+        //取分页信息
+        PageInfo<ProdInOutList> pageInfo = new PageInfo<ProdInOutList>(lists);
+        return pageInfo;
+    }
+
+    private List<ProdInOutList> getListByMode(ListReqDTO req) {
+        List<ProdInOutList> list = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        if (null == req || StringUtils.isEmpty(req.getMode()) || "Main".equals(req.getMode())) {
+            list = prodInOutListMapper.selectProdInOutListByCondition(con, companyId);
+        } else {
+            list = prodInOutListMapper.selectProdInOutBycondition(con, companyId);
+        }
+        return list;
+    }
+
+    @Override
+    public Result turnProdin(Long id) {
+        Integer count=0;
+        double pdOutqty=0;
+        double pdYqty=0;
+        ProdInOut sourcePi = checkAndReturnOrder(id);
+        List<ProdIODetail> sourceDetails =prodIODetailMapper.selectByFK(id);
+        if (null == sourcePi || StringUtils.isEmpty(sourcePi.getPi_inoutno()) || sourceDetails.size() == 0) {
+            throw new BizException(BizExceptionCode.SALE_NULL_BILL);
+        }
+
+        //检查转单状态
+        String statuscode = sourcePi.getPi_statuscode();
+        if(!Status.UNAUDITED.name().equals(statuscode)){
+            throw new BizException(BizExceptionCode.SALEOUT_POSTSTATUS_ERROR);
+        }
+
+        //检查从表
+        for (ProdIODetail prodIODetail : sourceDetails) {
+            pdOutqty = prodIODetail.getPd_outqty()==null?0.0:prodIODetail.getPd_outqty();
+            pdYqty = prodIODetail.getPd_yqty()==null?0.0:prodIODetail.getPd_yqty();
+            if (pdOutqty-pdYqty>0){
+                count++;
+            }
+        }
+        //判断可转数
+        if (count==0) {
+            return Result.error(ExceptionCode.TURNINNUM_NOT_EXIST);
+        }
+        //插入销售退货单主表
+        ProdInOut targetPi = new ProdInOut();
+        //生成单号
+        String piInoutno =
+                //BillCodeSeq.SALEIN.getCaller() + Math.abs(Math.random()*100);
+                maxnumberService.getMaxnumber(BillCodeSeq.SALEIN.getCaller(),true).getData();
+        targetPi.setPi_inoutno(piInoutno);
+        targetPi.setPi_class(BillCodeSeq.SALEIN.getName());
+        targetPi.setPi_date(new Date());
+        targetPi.setPi_recorddate(new Date());
+        targetPi.setPi_status(Status.UNAUDITED.getDisplay());
+        targetPi.setPi_statuscode(Status.UNAUDITED.name());
+        //客户信息
+        targetPi.setPi_custid(sourcePi.getPi_custid());
+        targetPi.setPi_custcode(sourcePi.getPi_custcode());
+        targetPi.setPi_custname(sourcePi.getPi_custname());
+        targetPi.setPi_said(sourcePi.getPi_said());
+        targetPi.setPi_sacode(sourcePi.getPi_sacode());
+
+        //设置公司id
+        targetPi.setCompanyId(sourcePi.getCompanyId());
+        //保存数据
+        getMapper().insertSelective(targetPi);
+        //插入销售退货单从表
+        long pi_id = targetPi.getId();
+        for (int i = 0;i<sourceDetails.size();i++){
+            ProdIODetail sourcePid = sourceDetails.get(i);
+            ProdIODetail targetPid = new ProdIODetail();
+            pdOutqty = sourcePid.getPd_outqty()==null?0.0:sourcePid.getPd_outqty();
+            pdYqty = sourcePid.getPd_yqty()==null?0.0:sourcePid.getPd_yqty();
+            if(pdOutqty-pdYqty>0){
+                targetPid.setPd_piid(pi_id);
+                targetPid.setPd_inoutno(piInoutno);
+                targetPid.setPd_piclass(BillCodeSeq.SALEIN.getName());
+                targetPid.setPd_pdno(i);
+                targetPid.setPd_orderid(sourcePid.getPd_orderid());
+                targetPid.setPd_ordercode(sourcePid.getPd_ordercode());
+                targetPid.setPd_orderdetno(sourcePid.getPd_orderdetno());
+
+                targetPid.setPd_sdid(sourcePid.getPd_sdid());
+                targetPid.setPd_sendprice(sourcePid.getPd_sendprice());
+
+
+                targetPid.setPd_prodid(sourcePid.getPd_prodid());
+                targetPid.setPd_prodcode(sourcePid.getPd_prodcode());
+                targetPid.setPd_unit(sourcePid.getPd_unit());
+                targetPid.setPd_ioid(sourcePid.getId());
+                targetPid.setPd_status(0);
+                //公司id
+                targetPid.setCompanyId(sourcePid.getCompanyId());
+                //本次转单数
+                targetPid.setPd_inqty(pdOutqty-pdYqty);
+                prodIODetailMapper.insertSelective(targetPid);
+                //更新已转数
+                sourcePid.setPd_yqty(pdOutqty);
+                prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
+            }
+        }
+        return Result.success();
+
+    }
+
+    @Override
+    @Transactional
+    public Result close(Long id) {
+        String res = singleClose(id);
+        if(StringUtils.hasText(res)){
+            return Result.error(res);
+        }else{
+            return Result.success();
+        }
+    }
+
+    private String singleClose(Long id){
+        ProdInOut prodInOut = checkAndReturnOrder(id);
+        //状态校验
+        if(Status.CLOSE.name().equals(prodInOut.getPi_status())){
+            return BizExceptionCode.BIZ_CLOSE.getMessage();
+        }
+        //更新状态
+        prodInOut.setPi_status(Status.CLOSE.getDisplay());
+        prodInOut.setPi_statuscode(Status.CLOSE.name());
+
+        prodInOutMapper.updateByPrimaryKeySelective(prodInOut);
+        //记录日志
+        DocBaseDTO docBaseDTO = getBaseDTOById(prodInOut.getId(),prodInOut.getPi_class());
+       messageLogService.close(docBaseDTO);
+        return "";
+    }
+
+    @Override
+    public  void batchClose(BatchDealBaseDTO baseDTOs){
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        String validate = prodInOutMapper.validateBatchClose(baseDTOs.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)) {
+            throw new BizException(503, "存在非已审核单据,单据编号:" + validate);
+        }
+        String error = null;
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            error+=singleClose(base.getId());
+        }
+        if(!StringUtils.isEmpty(error)){
+            new BizException(501,error);
+        }
+    }
+
+    @Override
+    @Transactional
+    public Result open(Long id){
+        String res = singleOpen(id);
+        if(StringUtils.hasText(res)){
+            return Result.error(res);
+        }else{
+            return Result.success();
+        }
+    }
+
+    private String singleOpen(Long id){
+        ProdInOut prodInOut = checkAndReturnOrder(id);
+        String pi_statuscode = prodInOut.getPi_statuscode();
+        if(!StringUtils.isEmpty(pi_statuscode)&&!pi_statuscode.equals(Status.CLOSE.getDisplay())){
+            return BizExceptionCode.BIZ_OPEN.getMessage();
+        };
+        prodInOut.setPi_status(Status.AUDITED.getDisplay());
+        prodInOut.setPi_statuscode(Status.AUDITED.getDisplay());
+        prodInOutMapper.updateByPrimaryKeySelective(prodInOut);
+        //记录日志
+        DocBaseDTO docBaseDTO = getBaseDTOById(prodInOut.getId(),prodInOut.getPi_class());
+        messageLogService.open(docBaseDTO);
+        return "";
+    }
+
+    @Override
+    public void batchOpen(BatchDealBaseDTO baseDTOs){
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        String validate = prodInOutMapper.validateBatchOpen(baseDTOs.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)) {
+            throw new BizException(503, "存在非已关闭单据,单据编号:" + validate);
+        }
+        String error = null;
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            error+=singleOpen(base.getId());
+        }
+        if(!StringUtils.isEmpty(error)){
+            new BizException(501,error);
+        }
+    }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: guq
+     * @Date: 2018/10/19
+     */
+    private String pushMaxnubmer(String code, Long id,String pi_class) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        ProdInOut prodInOut = prodInOutMapper.selectByPrimaryKey(id);
+        if(prodInOut==null){
+            throw new BizException(BizExceptionCode.NO_DATA);
+        }
+        Integer count = "0".equals(String.valueOf(id)) ? prodInOutMapper.validateCodeWhenInsert(code,pi_class) :
+                prodInOutMapper.validateCodeWhenUpdate(code, id);
+        String caller ="";
+        if(pi_class.equals("销售出货单")){
+            caller = BillCodeSeq.SALEOUT.getCaller();
+        }else {//销售退货单
+            caller = BillCodeSeq.SALEIN.getCaller();
+        }
+        return maxnumberService.pushMaxnubmer(count, code, caller).getData();
+        //return  caller+Math.abs(Math.random()*100);
+    }
+
+    /**
+     * @Description: 更新已转数
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: wuyx
+     * @Date: 2018/10/23
+     */
+    private void updateYqty(ProdInOut prodInOut) {
+        //更新已转数
+        if ("销售出货单".equals(prodInOut.getPi_class())){
+            prodIODetailMapper.updateSaleYqty(prodInOut.getPi_said());
+        }else if ("销售退货单".equals(prodInOut.getPi_class())){
+            prodIODetailMapper.updateSaleOutYqty(prodInOut.getPi_said());
+        }
+    }
+
+    /**
+     * @Description
+     * @Param: [id]
+     * @return: com.usoftchina.saas.commons.dto.DocBaseDTO
+     * @Author: wuyx
+     * @Date: 2018/10/25
+     */
+    private DocBaseDTO getBaseDTOById(Long id,String pi_class) {
+        if (null == id) {
+            return null;
+        }
+        String caller = BillCodeSeq.SALEIN.getName().equals(pi_class)?BillCodeSeq.SALEIN.getCaller():BillCodeSeq.SALEOUT.getCaller();
+        String code = prodInOutMapper.selectCodeById(id);
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        baseDTO.setId(id);
+        baseDTO.setCode(code);
+        baseDTO.setName(caller);
+        return baseDTO;
+    }
+
+    //更新最新明细总额
+    private void getTotal(Long id,String pi_class) {
+        if(BillCodeSeq.SALEOUT.getName().equals(pi_class)){
+            prodIODetailMapper.updatePDSaleOut(id);
+        }else{
+            prodIODetailMapper.updatePDSaleIN(id);
+        }
+    }
+
+    /**
+     * @Description
+     * @Param: [id]
+     * @return: com.usoftchina.saas.commons.dto.DocBaseDTO
+     * @Author: wuyx
+     * @Date: 2018/10/25
+     * */
+    private ProdInOut checkAndReturnOrder (Long id){
+        if(id == null || id <= 0) {
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+        ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
+        if(prodInOut==null){
+            throw new BizException(BizExceptionCode.NO_DATA);
+        }
+        return prodInOut;
+    }
+}

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

@@ -2,10 +2,13 @@ package com.usoftchina.saas.sale.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
@@ -43,10 +46,10 @@ public class SaleServiceImpl implements SaleService{
     private SaleMapper saleMapper;
     @Autowired
     private SaledetailMapper saledetailMapper;
-   /* @Autowired
+    @Autowired
     private MessageLogService messageLogService;
     @Autowired
-    private MaxnumberService maxnumberService;*/
+    private MaxnumberService maxnumberService;
     @Autowired
     private ProdInOutMapper prodInOutMapper;
     @Autowired
@@ -113,7 +116,7 @@ public class SaleServiceImpl implements SaleService{
         sale.setCreateTime(new Date());
 
         //编号校验
-        //sa_code = pushMaxnubmer(sa_code, sa_id);
+        sa_code = pushMaxnubmer(sa_code, sa_id);
         //单号赋值
         sale.setSa_code(sa_code);
         //判断更新与保存动作
@@ -136,7 +139,7 @@ public class SaleServiceImpl implements SaleService{
             //更新销售金额
             getTotal(sa_id);
             //日志记录
-            //messageLogService.save(baseDTO);
+            messageLogService.save(baseDTO);
             return baseDTO;
         }
         //更新操作
@@ -164,7 +167,7 @@ public class SaleServiceImpl implements SaleService{
         //更新销售金额
         getTotal(sa_id);
         //日志
-        //messageLogService.save(baseDTO);
+        messageLogService.update(baseDTO);
         return baseDTO;
     }
 
@@ -179,7 +182,7 @@ public class SaleServiceImpl implements SaleService{
         Integer num = saledetailMapper.deleteByPrimaryKey(id);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
-        //messageLogService.deleteDetail(docBaseDTO);
+        messageLogService.deleteDetail(docBaseDTO);
         return num;
     }
 
@@ -206,7 +209,7 @@ public class SaleServiceImpl implements SaleService{
         }
         String code = saleMapper.validateUnAudit(id);
         if (null != code) {
-            throw new BizException(500, "单据:" + code + " 未审核,无法反审核");
+            throw new BizException(BizExceptionCode.SALE_NULL_BILL);
         }
         singleUnAudit(id);
     }
@@ -252,7 +255,7 @@ public class SaleServiceImpl implements SaleService{
 
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
-        //messageLogService.audit(docBaseDTO);
+        messageLogService.audit(docBaseDTO);
     }
 
     private void singleDelete(Long id) {
@@ -263,7 +266,7 @@ public class SaleServiceImpl implements SaleService{
             saleMapper.deleteByPrimaryKey(id);
             DocBaseDTO docBaseDTO = getBaseDTOById(id);
             //日志
-            //messageLogService.delete(docBaseDTO);
+            messageLogService.delete(docBaseDTO);
         }
     }
 
@@ -290,14 +293,15 @@ public class SaleServiceImpl implements SaleService{
      * @Author: guq
      * @Date: 2018/10/19
      */
-   /* private String pushMaxnubmer(String code, Long id) {
+    private String pushMaxnubmer(String code, Long id) {
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
-        Integer count = "0".equals(String.valueOf(id)) ? saleMapper.validateCodeWhenInsert(code) :
-                saleMapper.validateCodeWhenUpdate(code, id);
-        return maxnumberService.pushMaxnubmer(count, code, "Purchase").getData();
-    }*/
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? saleMapper.validateCodeWhenInsert(code, companyId) :
+                saleMapper.validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.SALE.getCaller()).getData();
+    }
 
     /**
      * @Description
@@ -343,7 +347,7 @@ public class SaleServiceImpl implements SaleService{
         saleMapper.updateByPrimaryKeySelective(sale);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
-        //messageLogService.close(docBaseDTO);
+        messageLogService.close(docBaseDTO);
     }
 
     @Override
@@ -379,7 +383,7 @@ public class SaleServiceImpl implements SaleService{
             saleMapper.updateByPrimaryKeySelective(sale);
             DocBaseDTO docBaseDTO = getBaseDTOById(id);
             //日志
-            //messageLogService.open(docBaseDTO);
+            messageLogService.open(docBaseDTO);
         }
     }
 
@@ -419,10 +423,8 @@ public class SaleServiceImpl implements SaleService{
         //插入验收单主表
         ProdInOut prodInOut = new ProdInOut();
         //生成单号
-        //String pi_inoutno = maxnumberService.getMaxnumber("Sale", true).getData();
-       // Object data =
-        String pi_inoutno = "xxxxx" + (int)(Math.random()*100)+1;;
-
+        String pi_inoutno = maxnumberService.getMaxnumber(BillCodeSeq.SALEOUT.getCaller(),
+                true).getData();
         prodInOut.setPi_inoutno(pi_inoutno);
         prodInOut.setPi_class("出货单");
         prodInOut.setPi_date(new Date());
@@ -483,7 +485,7 @@ public class SaleServiceImpl implements SaleService{
         saleMapper.updateByPrimaryKeySelective(sale);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
-        //messageLogService.unAudit(docBaseDTO);
+        messageLogService.unAudit(docBaseDTO);
     }
 
     //更新最新销售总额

+ 297 - 25
applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -143,6 +143,33 @@
   <sql id="Blob_Column_List">
     pd_remark
   </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.usoftchina.saas.storage.po.ProdIODetailExample" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from prodiodetail
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByExample" parameterType="com.usoftchina.saas.storage.po.ProdIODetailExample" resultMap="BaseResultMap">
+    select
+        *
+    from prodiodetail a left join product b on a.pd_prodid = b.pr_id and a.companyid = b.companyid
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
     select 
     <include refid="Base_Column_List" />
@@ -151,11 +178,19 @@
     from prodiodetail
     where pd_id = #{pd_id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from prodiodetail where pd_id = #{pd_id}
+  </delete>
+  <delete id="deleteByForeignKey" parameterType="java.lang.Long">
+    delete from prodiodetail where pd_piid = #{pd_id}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.usoftchina.saas.storage.po.ProdIODetailExample">
     delete from prodiodetail
-    where pd_id = #{pd_id,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
   </delete>
-  <insert id="insert" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
+  <insert id="insert" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
     insert into prodiodetail (pd_id, pd_piid, pd_inoutno, 
       pd_piclass, pd_pdno, pd_ordercode, 
       pd_orderdetno, pd_prodid, pd_prodcode, 
@@ -186,7 +221,7 @@
       #{pd_ioid,jdbcType=INTEGER}
       )
   </insert>
-  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
     <selectKey resultType="java.lang.Long" keyProperty="id">
       SELECT LAST_INSERT_ID() AS ID
     </selectKey>
@@ -430,7 +465,233 @@
       </if>
     </trim>
   </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
+  <select id="countByExample" parameterType="com.usoftchina.saas.storage.po.ProdIODetailExample" resultType="java.lang.Long">
+    select count(*) from prodiodetail
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update prodiodetail
+    <set>
+      <if test="record.pd_id != null">
+        pd_id = #{record.pd_id,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_piid != null">
+        pd_piid = #{record.pd_piid,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_inoutno != null">
+        pd_inoutno = #{record.pd_inoutno,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_piclass != null">
+        pd_piclass = #{record.pd_piclass,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_pdno != null">
+        pd_pdno = #{record.pd_pdno,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_ordercode != null">
+        pd_ordercode = #{record.pd_ordercode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_orderdetno != null">
+        pd_orderdetno = #{record.pd_orderdetno,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_prodid != null">
+        pd_prodid = #{record.pd_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_prodcode != null">
+        pd_prodcode = #{record.pd_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_unit != null">
+        pd_unit = #{record.pd_unit,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_inqty != null">
+        pd_inqty = #{record.pd_inqty,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_outqty != null">
+        pd_outqty = #{record.pd_outqty,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_orderprice != null">
+        pd_orderprice = #{record.pd_orderprice,jdbcType=DOUBLE},
+      </if>
+      <if test="record.pd_sendprice != null">
+        pd_sendprice = #{record.pd_sendprice,jdbcType=DOUBLE},
+      </if>
+      <if test="record.pd_price != null">
+        pd_price = #{record.pd_price,jdbcType=DOUBLE},
+      </if>
+      <if test="record.pd_total != null">
+        pd_total = #{record.pd_total,jdbcType=DOUBLE},
+      </if>
+      <if test="record.pd_taxrate != null">
+        pd_taxrate = #{record.pd_taxrate,jdbcType=DOUBLE},
+      </if>
+      <if test="record.pd_netprice != null">
+        pd_netprice = #{record.pd_netprice,jdbcType=DOUBLE},
+      </if>
+      <if test="record.pd_nettotal != null">
+        pd_nettotal = #{record.pd_nettotal,jdbcType=DOUBLE},
+      </if>
+      <if test="record.pd_whid != null">
+        pd_whid = #{record.pd_whid,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_whcode != null">
+        pd_whcode = #{record.pd_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_whname != null">
+        pd_whname = #{record.pd_whname,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_inwhid != null">
+        pd_inwhid = #{record.pd_inwhid,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_inwhcode != null">
+        pd_inwhcode = #{record.pd_inwhcode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_inwhname != null">
+        pd_inwhname = #{record.pd_inwhname,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_orderid != null">
+        pd_orderid = #{record.pd_orderid,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_sdid != null">
+        pd_sdid = #{record.pd_sdid,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_status != null">
+        pd_status = #{record.pd_status,jdbcType=INTEGER},
+      </if>
+      <if test="record.companyid != null">
+        companyid = #{record.companyid,jdbcType=INTEGER},
+      </if>
+      <if test="record.updaterid != null">
+        updaterid = #{record.updaterid,jdbcType=INTEGER},
+      </if>
+      <if test="record.updatetime != null">
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.pd_text1 != null">
+        pd_text1 = #{record.pd_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_text2 != null">
+        pd_text2 = #{record.pd_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_text3 != null">
+        pd_text3 = #{record.pd_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_text4 != null">
+        pd_text4 = #{record.pd_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_text5 != null">
+        pd_text5 = #{record.pd_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="record.pd_ym != null">
+        pd_ym = #{record.pd_ym,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_yqty != null">
+        pd_yqty = #{record.pd_yqty,jdbcType=INTEGER},
+      </if>
+      <if test="record.pd_remark != null">
+        pd_remark = #{record.pd_remark,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="record.pd_ioid != null">
+        pd_ioid = #{record.pd_ioid,jdbcType=INTEGER},
+      </if>
+
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update prodiodetail
+    set pd_id = #{record.pd_id,jdbcType=INTEGER},
+      pd_piid = #{record.pd_piid,jdbcType=INTEGER},
+      pd_inoutno = #{record.pd_inoutno,jdbcType=VARCHAR},
+      pd_piclass = #{record.pd_piclass,jdbcType=VARCHAR},
+      pd_pdno = #{record.pd_pdno,jdbcType=INTEGER},
+      pd_ordercode = #{record.pd_ordercode,jdbcType=VARCHAR},
+      pd_orderdetno = #{record.pd_orderdetno,jdbcType=INTEGER},
+      pd_prodid = #{record.pd_prodid,jdbcType=INTEGER},
+      pd_prodcode = #{record.pd_prodcode,jdbcType=VARCHAR},
+      pd_unit = #{record.pd_unit,jdbcType=VARCHAR},
+      pd_inqty = #{record.pd_inqty,jdbcType=INTEGER},
+      pd_outqty = #{record.pd_outqty,jdbcType=INTEGER},
+      pd_orderprice = #{record.pd_orderprice,jdbcType=DOUBLE},
+      pd_sendprice = #{record.pd_sendprice,jdbcType=DOUBLE},
+      pd_price = #{record.pd_price,jdbcType=DOUBLE},
+      pd_total = #{record.pd_total,jdbcType=DOUBLE},
+      pd_taxrate = #{record.pd_taxrate,jdbcType=DOUBLE},
+      pd_netprice = #{record.pd_netprice,jdbcType=DOUBLE},
+      pd_nettotal = #{record.pd_nettotal,jdbcType=DOUBLE},
+      pd_whid = #{record.pd_whid,jdbcType=INTEGER},
+      pd_whcode = #{record.pd_whcode,jdbcType=VARCHAR},
+      pd_whname = #{record.pd_whname,jdbcType=VARCHAR},
+      pd_inwhid = #{record.pd_inwhid,jdbcType=INTEGER},
+      pd_inwhcode = #{record.pd_inwhcode,jdbcType=VARCHAR},
+      pd_inwhname = #{record.pd_inwhname,jdbcType=VARCHAR},
+      pd_orderid = #{record.pd_orderid,jdbcType=INTEGER},
+      pd_sdid = #{record.pd_sdid,jdbcType=INTEGER},
+      pd_status = #{record.pd_status,jdbcType=INTEGER},
+      companyid = #{record.companyid,jdbcType=INTEGER},
+      updaterid = #{record.updaterid,jdbcType=INTEGER},
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+      pd_text1 = #{record.pd_text1,jdbcType=VARCHAR},
+      pd_text2 = #{record.pd_text2,jdbcType=VARCHAR},
+      pd_text3 = #{record.pd_text3,jdbcType=VARCHAR},
+      pd_text4 = #{record.pd_text4,jdbcType=VARCHAR},
+      pd_text5 = #{record.pd_text5,jdbcType=VARCHAR},
+      pd_ym = #{record.pd_ym,jdbcType=INTEGER},
+      pd_yqty = #{record.pd_yqty,jdbcType=INTEGER},
+      pd_remark = #{record.pd_remark,jdbcType=LONGVARCHAR},
+      pd_ioid = #{record.pd_ioid,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update prodiodetail
+    set pd_id = #{record.pd_id,jdbcType=INTEGER},
+      pd_piid = #{record.pd_piid,jdbcType=INTEGER},
+      pd_inoutno = #{record.pd_inoutno,jdbcType=VARCHAR},
+      pd_piclass = #{record.pd_piclass,jdbcType=VARCHAR},
+      pd_pdno = #{record.pd_pdno,jdbcType=INTEGER},
+      pd_ordercode = #{record.pd_ordercode,jdbcType=VARCHAR},
+      pd_orderdetno = #{record.pd_orderdetno,jdbcType=INTEGER},
+      pd_prodid = #{record.pd_prodid,jdbcType=INTEGER},
+      pd_prodcode = #{record.pd_prodcode,jdbcType=VARCHAR},
+      pd_unit = #{record.pd_unit,jdbcType=VARCHAR},
+      pd_inqty = #{record.pd_inqty,jdbcType=INTEGER},
+      pd_outqty = #{record.pd_outqty,jdbcType=INTEGER},
+      pd_orderprice = #{record.pd_orderprice,jdbcType=DOUBLE},
+      pd_sendprice = #{record.pd_sendprice,jdbcType=DOUBLE},
+      pd_price = #{record.pd_price,jdbcType=DOUBLE},
+      pd_total = #{record.pd_total,jdbcType=DOUBLE},
+      pd_taxrate = #{record.pd_taxrate,jdbcType=DOUBLE},
+      pd_netprice = #{record.pd_netprice,jdbcType=DOUBLE},
+      pd_nettotal = #{record.pd_nettotal,jdbcType=DOUBLE},
+      pd_whid = #{record.pd_whid,jdbcType=INTEGER},
+      pd_whcode = #{record.pd_whcode,jdbcType=VARCHAR},
+      pd_whname = #{record.pd_whname,jdbcType=VARCHAR},
+      pd_inwhid = #{record.pd_inwhid,jdbcType=INTEGER},
+      pd_inwhcode = #{record.pd_inwhcode,jdbcType=VARCHAR},
+      pd_inwhname = #{record.pd_inwhname,jdbcType=VARCHAR},
+      pd_orderid = #{record.pd_orderid,jdbcType=INTEGER},
+      pd_sdid = #{record.pd_sdid,jdbcType=INTEGER},
+      pd_status = #{record.pd_status,jdbcType=INTEGER},
+      companyid = #{record.companyid,jdbcType=INTEGER},
+      updaterid = #{record.updaterid,jdbcType=INTEGER},
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+      pd_text1 = #{record.pd_text1,jdbcType=VARCHAR},
+      pd_text2 = #{record.pd_text2,jdbcType=VARCHAR},
+      pd_text3 = #{record.pd_text3,jdbcType=VARCHAR},
+      pd_text4 = #{record.pd_text4,jdbcType=VARCHAR},
+      pd_text5 = #{record.pd_text5,jdbcType=VARCHAR},
+      pd_ym = #{record.pd_ym,jdbcType=INTEGER},
+      pd_yqty = #{record.pd_yqty,jdbcType=INTEGER},
+      pd_ioid = #{record.pd_ioid,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
     update prodiodetail
     <set>
       <if test="pd_piid != null">
@@ -553,7 +814,7 @@
     </set>
     where pd_id = #{id,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
     update prodiodetail
     set pd_piid = #{pd_piid,jdbcType=INTEGER},
       pd_inoutno = #{pd_inoutno,jdbcType=VARCHAR},
@@ -596,7 +857,7 @@
       pd_ioid = #{pd_ioid,jdbcType=INTEGER}
     where pd_id = #{pd_id,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
     update prodiodetail
     set pd_piid = #{pd_piid,jdbcType=INTEGER},
       pd_inoutno = #{pd_inoutno,jdbcType=VARCHAR},
@@ -911,15 +1172,7 @@
     </foreach>
   </insert>
 
-
-
-
-
-
-
-
-
-  <update id="batchUpdate" parameterType="com.usoftchina.saas.storage.po.ProdInOut" >
+  <update id="batchUpdate" parameterType="com.usoftchina.saas.storage.po.ProdIODetail" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
       update prodiodetail <set>
       <if test="item.pd_piid !=null">
@@ -1031,20 +1284,39 @@
     </foreach>
   </update>
 
-  <update id="updatePurchaseYqty" parameterType="java.lang.Integer">
-
-update prodiodetail a
-set a.pd_yqty =ifnull((select  b.pd_outqty  from  (select pd_ioid,sum(pd_outqty) pd_outqty from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='采购验退单'
-and pi_puid=#{id,jdbcType=INTEGER}  GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
-where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEGER} and pi_class='采购验收单')
+  <update id="updateSaleOutYqty" parameterType="long">
+update prodiodetail
+  set a.pd_yqty =ifnull((select  b.pd_inqty  from  (select pi_said,sum(pd_inqty) pd_inqty from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='销售退货单'
+and pi_said=#{id}  GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
+where a.pd_piid = (select pi_id from prodinout where pi_said=#{id} and pi_class='销售出货单')
+  </update>
+  <update id="updateSaleYqty" parameterType="long">
+    update saledtail
+    set a.sd_yqty =ifnull((
+    select  b.pd_ounqty  from  (select pi_said,sum(pd_outqty) pd_outqty
+      from  prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='销售出货单'
+      and pi_said=#{id}  GROUP BY pi_said) b where ifnull(b.pd_ioid ,0)= a.pd_id
+      ),0)
+    where a.sd_said = #{id}
   </update>
-
 
   <select id="selectByFK" parameterType="long" resultMap="BaseResultMap">
     select * from prodiodetail a left join product b on b.pr_id= a.pd_prodid and a.companyid = b.companyid
     where pd_piid=#{id} order by pd_pdno
   </select>
 
-
-
+  <update id="updatePDSaleIN" parameterType="long">
+   update prodiodetail set
+   pd_total=ifnull(pd_inqty,0)*ifnull(pd_orderprice,0),
+   pd_netprice = ifnull(pd_sendprice,0)/(1+ifnull(pd_taxrate,0)/100),
+   pd_nettotal = (ifnull(pd_sendprice,0)/(1+ifnull(pd_taxrate,0)/100))*ifnull(pd_inqty)
+   where pd_piid=#{id}
+  </update>
+  <update id="updatePDSaleOut" parameterType="long">
+    update prodiodetail set
+    pd_total=ifnull(pd_outqty,0)*ifnull(pd_orderprice,0),
+    pd_netprice = ifnull(pd_sendprice,0)/(1+ifnull(pd_taxrate,0)/100),
+    pd_nettotal = (ifnull(pd_sendprice,0)/(1+ifnull(pd_taxrate,0)/100))*ifnull(pd_outqty)
+    where pd_piid=#{id}
+  </update>
 </mapper>

+ 102 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usoftchina.saas.sale.mapper.ProdInOutListMapper">
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.po.ProdInOutList">
+    <id column="pi_id" jdbcType="INTEGER" property="id" />
+    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
+    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
+    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
+    <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
+    <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
+    <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
+    <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
+    <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
+    <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
+    <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
+    <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
+    <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" />
+    <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
+    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
+    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
+    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
+    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
+    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+    <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
+    <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
+    <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
+    <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
+    <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
+    <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
+    <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
+    <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
+    <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
+    <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
+    <result column="pd_inqty" jdbcType="INTEGER" property="pd_inqty" />
+    <result column="pd_outqty" jdbcType="INTEGER" property="pd_outqty" />
+    <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
+    <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
+    <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
+    <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
+    <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
+    <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
+    <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
+    <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
+    <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
+    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
+    <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
+    <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
+    <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
+    <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
+    <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
+    <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
+    <result column="companyid" jdbcType="INTEGER" property="companyId" />
+    <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
+    <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
+    <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
+    <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
+    <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
+    <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
+    <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
+    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <result column="pi_nettotal" jdbcType="DOUBLE" property="pi_nettotal" />
+    <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
+  </resultMap>
+
+
+  <select id="selectProdInOutListByCondition" resultMap="BaseResultMap">
+    select  *  from prodinout left join prodiodetail on pi_id = pd_piid
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   prodinout.companyId = #{companyId}
+      </if> order by pi_date desc,pi_id desc,pd_pdno
+    </where>
+  </select>
+
+  <select id="selectProdInOutBycondition"  resultMap="BaseResultMap">
+    select  *  from prodinout
+      <where>
+        <if test="con != null">
+          ${con}
+        </if>
+        <if test="companyId != null">
+          and  companyId = #{companyId}
+        </if>
+      </where>
+      order by pi_id
+  </select>
+
+</mapper>

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