zhoudw 8 years ago
parent
commit
f3c4598bb2
100 changed files with 3855 additions and 2267 deletions
  1. 1 1
      applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MaxnumberService.java
  2. 7 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java
  3. 6 4
      applications/document/document-api/src/main/java/com/usoftchina/saas/document/api/WarehouseApi.java
  4. 18 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductListDTO.java
  5. 30 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendor.java
  6. 1 1
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java
  7. 3 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  8. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java
  9. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BankinformationController.java
  10. 40 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java
  11. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java
  12. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/FundinouttypeController.java
  13. 41 13
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  14. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductbrandController.java
  15. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProducttypeController.java
  16. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductunitController.java
  17. 40 5
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java
  18. 6 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorkindController.java
  19. 68 7
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java
  20. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BomDetailMapper.java
  21. 7 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  22. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  23. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorkindMapper.java
  24. 6 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  25. 43 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/BomService.java
  26. 44 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  27. 31 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java
  28. 4 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorkindService.java
  29. 24 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/WarehouseService.java
  30. 144 15
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  31. 90 11
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  32. 126 14
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  33. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  34. 110 8
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  35. 3 0
      applications/document/document-server/src/main/resources/mapper/BomDetailMapper.xml
  36. 3 0
      applications/document/document-server/src/main/resources/mapper/BomMapper.xml
  37. 387 8
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  38. 357 4
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  39. 60 57
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml
  40. 3 0
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  41. 9 30
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  42. 4 1
      applications/money/money-server/pom.xml
  43. 20 18
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthreceiptsController.java
  44. 21 19
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthspengdingsController.java
  45. 11 10
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java
  46. 16 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/RecbalanceContorller.java
  47. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java
  48. 10 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthreceiptsMapper.java
  49. 3 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthreceiptsdetailMapper.java
  50. 10 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthspendingsMapper.java
  51. 3 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthspendingsdetailMapper.java
  52. 10 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalanceMapper.java
  53. 3 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalancedetMapper.java
  54. 9 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalanceMapper.java
  55. 1 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalancedetMapper.java
  56. 2 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalancedetailMapper.java
  57. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationMapper.java
  58. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationdetMapper.java
  59. 1 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationdetailMapper.java
  60. 104 130
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othreceipts.java
  61. 59 85
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othreceiptsdetail.java
  62. 104 129
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendings.java
  63. 59 85
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendingsdetail.java
  64. 5 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Paybalance.java
  65. 75 123
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Paybalancedet.java
  66. 75 123
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Paybalancedetail.java
  67. 6 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Recbalance.java
  68. 6 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Recbalancedet.java
  69. 104 122
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Recbalancedetail.java
  70. 7 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthreceiptsService.java
  71. 7 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthspendingsService.java
  72. 4 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/PaybalanceService.java
  73. 10 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/RecbalanceService.java
  74. 85 27
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  75. 77 22
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  76. 76 10
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  77. 89 19
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  78. 177 144
      applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml
  79. 80 95
      applications/money/money-server/src/main/resources/mapper/OthreceiptsdetailMapper.xml
  80. 69 39
      applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml
  81. 85 91
      applications/money/money-server/src/main/resources/mapper/OthspendingsdetailMapper.xml
  82. 51 139
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  83. 119 97
      applications/money/money-server/src/main/resources/mapper/PaybalancedetMapper.xml
  84. 119 147
      applications/money/money-server/src/main/resources/mapper/PaybalancedetailMapper.xml
  85. 42 12
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  86. 8 152
      applications/money/money-server/src/main/resources/mapper/RecbalancedetMapper.xml
  87. 114 142
      applications/money/money-server/src/main/resources/mapper/RecbalancedetailMapper.xml
  88. 4 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java
  89. 5 6
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  90. 37 4
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  91. 11 0
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  92. 1 1
      framework/core/src/main/java/com/usoftchina/saas/base/entity/BaseEntity.java
  93. 6 6
      framework/core/src/main/java/com/usoftchina/saas/base/entity/CommonBaseEntity.java
  94. 10 2
      frontend/saas-web/Readme.md
  95. 17 0
      frontend/saas-web/app/model/money/Othreceipts.js
  96. 17 0
      frontend/saas-web/app/model/money/Othspendings.js
  97. 25 0
      frontend/saas-web/app/model/money/PayBalance1.js
  98. 25 0
      frontend/saas-web/app/model/money/PayBalance2.js
  99. 6 2
      frontend/saas-web/app/model/money/RecBalance1.js
  100. 7 6
      frontend/saas-web/app/model/money/RecBalance2.js

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

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

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

@@ -38,7 +38,13 @@ public enum  BillCodeSeq {
 
     RECBALANCE("收款单", "RecBalance"),
 
-    VERIFICATION("核价单", "Verification");
+    VERIFICATION("核价单", "Verification"),
+
+    OTHRECEIPTS("其他收入单", "Otherceipts"),
+
+    OTHSPENDINGS("其他收入单", "Otherceipts"),
+
+    BOM("BOM资料", "Bom");
 
     BillCodeSeq(String name, String caller) {
         this.name = name;

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

@@ -3,16 +3,18 @@ package com.usoftchina.saas.document.api;
 import com.usoftchina.saas.base.Result;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.Map;
 
 @FeignClient(name = "document-server")
 public interface WarehouseApi {
 
-    @GetMapping("/warehouse/post")
-    public Result post(Map<String, Object> param);
+    @PostMapping("/warehouse/post")
+    public Result post(@RequestBody Map<String, Object> map);
 
-    @GetMapping("/warehouse/unPost")
-    public Result unPost(Map<String, Object> param);
+    @PostMapping("/warehouse/unPost")
+    public Result unPost(@RequestBody Map<String, Object> map);
 
 }

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

@@ -0,0 +1,18 @@
+package com.usoftchina.saas.document.dto;
+
+import com.usoftchina.saas.document.entities.Product;
+
+import java.io.Serializable;
+
+public class ProductListDTO implements Serializable {
+
+    private Product main;
+
+    public Product getMain() {
+        return main;
+    }
+
+    public void setMain(Product main) {
+        this.main = main;
+    }
+}

+ 30 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendor.java

@@ -101,6 +101,36 @@ public class Vendor extends CommonBaseEntity implements Serializable{
      */
     private String ve_text5;
 
+    private Double ve_payamount;
+
+    private Double ve_leftamount;
+
+    private Integer ve_beginym;
+
+    public Double getVe_payamount() {
+        return ve_payamount;
+    }
+
+    public void setVe_payamount(Double ve_payamount) {
+        this.ve_payamount = ve_payamount;
+    }
+
+    public Double getVe_leftamount() {
+        return ve_leftamount;
+    }
+
+    public void setVe_leftamount(Double ve_leftamount) {
+        this.ve_leftamount = ve_leftamount;
+    }
+
+    public Integer getVe_beginym() {
+        return ve_beginym;
+    }
+
+    public void setVe_beginym(Integer ve_beginym) {
+        this.ve_beginym = ve_beginym;
+    }
+
     public String getVe_code() {
         return ve_code;
     }

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

@@ -9,7 +9,7 @@ import java.util.Date;
 public class VendorList implements Serializable {
 
     /* 主表字段 */
-    private Long ve_id;
+    private Long id;
     /**
      * 供应商编号
      */

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

@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
 @SpringBootApplication
 @EnableEurekaClient
@@ -13,9 +14,10 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableTransactionManagement
 @EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.document.mapper")
-public class DocumentApplication {
+public class DocumentApplication{
 
     public static void main(String[] args) {
         SpringApplication.run(DocumentApplication.class);
     }
+
 }

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

@@ -33,7 +33,7 @@ public class AddressController {
         return Result.success();
     }
 
-    @GetMapping("/getAll")
+    @GetMapping("/list")
     public Result<List<Address>> getAll(){
         List<Address> addresseList = addressService.findAll();
         return Result.success(addresseList);

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

@@ -30,7 +30,7 @@ public class BankinformationController {
         return Result.success();
     }
 
-    @GetMapping("/getAll")
+    @GetMapping("/list")
     public Result getAll(){
         List<Bankinformation> bankinformationList = bankinformationService.findAll();
         return Result.success(bankinformationList);

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

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.document.controller;
 
 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.ListReqDTO;
 import com.usoftchina.saas.document.entities.BomList;
 import com.usoftchina.saas.document.service.BomService;
@@ -10,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.print.Doc;
 
+@CrossOrigin
 @RestController
 @RequestMapping("/bom")
 public class BomController {
@@ -33,9 +36,45 @@ public class BomController {
         return Result.success(bomService.getListDataByCondition(page, listReqDTO));
     }
 
-    @GetMapping("/getDataById")
+    @GetMapping("/read/{id}")
     public Result getDataByCondition(@PathVariable("id") Long id){
         return Result.success(bomService.getDataById(id));
     }
 
+    @PostMapping("/batchDelete")
+    public Result batchDelete(@RequestBody BatchDealBaseDTO baseDTOs){
+        bomService.batchDelete(baseDTOs);
+        return Result.success();
+    }
+
+    @PostMapping("/close/{id}")
+    public Result close(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = bomService.close(id);
+        return Result.success(docBaseDTO);
+    }
+
+    @PostMapping("/open/{id}")
+    public Result open(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = bomService.open(id);
+        return Result.success(docBaseDTO);
+    }
+
+    @PostMapping("/batchClose")
+    public Result batchClose(@RequestBody BatchDealBaseDTO baseDTOs){
+        bomService.batchClose(baseDTOs);
+        return Result.success();
+    }
+
+    @PostMapping("/batchOpen")
+    public Result batchOpen(@RequestBody BatchDealBaseDTO baseDTOs){
+        bomService.batchOpen(baseDTOs);
+        return Result.success();
+    }
+
+    @PostMapping("/deleteDetail/{id}")
+    public Result deleteDetail(@PathVariable("id") Long id){
+        bomService.deleteBomDetail(id);
+        return Result.success();
+    }
+
 }

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

@@ -28,7 +28,7 @@ public class CustomerkindController {
         return Result.success();
     }
 
-    @GetMapping("/getAll")
+    @GetMapping("/list")
     public Result getAll(){
         List<Customerkind> customerkindList = customerkindService.findAll();
         return Result.success(customerkindList);

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

@@ -27,7 +27,7 @@ public class FundinouttypeController {
         return Result.success();
     }
 
-    @GetMapping("/getAll")
+    @GetMapping("/list")
     public Result getAll(){
         List<Fundinouttype> fundinouttypeList = fundinouttypeService.findAll();
         return Result.success(fundinouttypeList);

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

@@ -4,18 +4,21 @@ import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 
 
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 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.dto.ProductListDTO;
 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.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/product")
@@ -24,13 +27,7 @@ public class ProductController {
     @Autowired
     private ProductService productService;
 
-    /**
-     * 通过条件查找物料
-     * @param page      分页对象
-     * @param listReqDTO    条件对象
-     * @return  Result<List<ProductDTO>>
-     */
-    @RequestMapping("/getProductsByCondition")
+    @RequestMapping("/list")
     public Result<List<ProductDTO>> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO){
         PageInfo<ProductDTO> productList = productService.getProductsByCondition(page, listReqDTO);
         return Result.success(productList);
@@ -53,9 +50,9 @@ public class ProductController {
     }
 
     @PostMapping("/save")
-    public Result save(@RequestBody Product product){
-        productService.save(product);
-        return Result.success();
+    public Result save(@RequestBody ProductListDTO productListDTO){
+        DocBaseDTO docBaseDTO = productService.saveData(productListDTO.getMain());
+        return Result.success(docBaseDTO);
     }
 
     @PostMapping("/delete/{id}")
@@ -66,8 +63,39 @@ public class ProductController {
 
     @PostMapping("/close/{id}")
     public Result close(@PathVariable("id") Long id){
-        productService.close(id);
+        DocBaseDTO docBaseDTO = productService.close(id);
+        return Result.success(docBaseDTO);
+    }
+
+    @PostMapping("/open/{id}")
+    public Result open(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = productService.open(id);
+        return Result.success(docBaseDTO);
+    }
+
+    @PostMapping("/batchDelete")
+    public Result batchDelete(@RequestBody BatchDealBaseDTO baseDTOs){
+        productService.batchDelete(baseDTOs);
         return Result.success();
     }
 
+    @PostMapping("/batchClose")
+    public Result batchClose(@RequestBody BatchDealBaseDTO baseDTOs){
+        productService.batchClose(baseDTOs);
+        return Result.success();
+    }
+
+    @PostMapping("/batchOpen")
+    public Result batchOpen(@RequestBody BatchDealBaseDTO baseDTOs){
+        productService.batchOpen(baseDTOs);
+        return Result.success();
+    }
+
+    @GetMapping("/read/{id}")
+    public Result getDataById(@PathVariable("id") Long id){
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("main", productService.getDataById(id));
+        return Result.success(map);
+    }
+
 }

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

@@ -41,7 +41,7 @@ public class ProductbrandController {
      * 查询所有
      * @return
      */
-    @GetMapping("/getAll")
+    @GetMapping("/list")
     public Result getAll(){
         List<Productbrand> productbrandList = productbrandService.findAll();
         return Result.success(productbrandList);

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

@@ -15,7 +15,7 @@ public class ProducttypeController {
     @Autowired
     private ProducttypeService producttypeService;
 
-    @GetMapping("/getAll")
+    @GetMapping("/list")
     public Result<List<Producttype>> getAll(){
         List<Producttype> producttypeList = producttypeService.findAll();
         return Result.success(producttypeList);

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

@@ -28,7 +28,7 @@ public class ProductunitController {
         return Result.success();
     }
 
-    @GetMapping("/getAll")
+    @GetMapping("/list")
     public Result getAll(){
         List<Productunit> productunitList = productunitService.findAll();
         return Result.success(productunitList);

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

@@ -2,6 +2,8 @@ package com.usoftchina.saas.document.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.ListReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
@@ -14,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-@CrossOrigin
 @RestController
 @RequestMapping("/vendor")
 public class VendorController {
@@ -39,7 +40,7 @@ public class VendorController {
      * @param id
      * @return
      */
-    @GetMapping("/getDataById/{id}")
+    @GetMapping("/read/{id}")
     public Result<VendorListDTO> getDataById(@PathVariable("id") Long id){
         VendorListDTO vendorListDTO = vendorService.getListById(id);
         return Result.success(vendorListDTO);
@@ -84,8 +85,8 @@ public class VendorController {
      */
     @PostMapping("/close/{id}")
     public Result close(@PathVariable("id") Long id){
-        vendorService.close(id);
-        return Result.success();
+        DocBaseDTO docBaseDTO = vendorService.close(id);
+        return Result.success(docBaseDTO);
     }
 
     /**
@@ -95,7 +96,41 @@ public class VendorController {
      */
     @PostMapping("/open/{id}")
     public Result open(@PathVariable("id") Long id){
-        vendorService.open(id);
+        DocBaseDTO docBaseDTO = vendorService.open(id);
+        return Result.success(docBaseDTO);
+    }
+
+    /**
+     * 批量关闭
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchClose")
+    public Result batchClose(@RequestBody BatchDealBaseDTO baseDTOs){
+        String msg = vendorService.batchClose(baseDTOs);
+        return Result.success(msg);
+    }
+
+    /**
+     * 批量开启
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchOpen")
+    public Result batchOpen(@RequestBody BatchDealBaseDTO baseDTOs){
+        String msg = vendorService.batchOpen(baseDTOs);
+        return Result.success(msg);
+    }
+
+    @PostMapping("/deleteContact/{id}")
+    public Result deleteContact(@PathVariable("id") Long id){
+        vendorService.deleteContact(id);
+        return Result.success();
+    }
+
+    @PostMapping("/batchDelete")
+    public Result batchDelete(@RequestBody BatchDealBaseDTO baseDTOs){
+        vendorService.batchDelete(baseDTOs);
         return Result.success();
     }
 

+ 6 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorkindController.java

@@ -27,10 +27,15 @@ public class VendorkindController {
         return Result.success();
     }
 
-    @GetMapping("/getAll")
+    @GetMapping("/list")
     public Result<Vendorkind> getAll(){
         List<Vendorkind> vendorkindList = vendorkindService.findAll();
         return Result.success(vendorkindList);
     }
 
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        return Result.success(vendorkindService.getCombo());
+    }
+
 }

+ 68 - 7
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java

@@ -2,7 +2,8 @@ package com.usoftchina.saas.document.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
-import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.document.entities.Warehouse;
 import com.usoftchina.saas.document.service.WarehouseService;
 import com.usoftchina.saas.page.PageRequest;
@@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
+@CrossOrigin
 @RestController
 @RequestMapping("/warehouse")
 public class WarehouseController {
@@ -39,8 +41,8 @@ public class WarehouseController {
      * 过账
      * @return
      */
-    @GetMapping("/post")
-    public Result post(Map<String, Object> map){
+    @PostMapping("/post")
+    public Result post(@RequestBody Map<String, Object> map){
         warehouseService.post(map);
         return Result.success(map.get("result"));
     }
@@ -50,8 +52,8 @@ public class WarehouseController {
      * @param map
      * @return
      */
-    @GetMapping("/unPost")
-    public Result unPost(Map<String, Object> map){
+    @PostMapping("/unPost")
+    public Result unPost(@RequestBody Map<String, Object> map){
         warehouseService.unPost(map);
         return Result.success();
     }
@@ -63,8 +65,8 @@ public class WarehouseController {
      */
     @PostMapping("/save")
     public Result saveFormData(@RequestBody Warehouse data){
-        warehouseService.insertSelective(data);
-        return Result.success();
+        DocBaseDTO docBaseDTO = warehouseService.insertSelective(data);
+        return Result.success(docBaseDTO);
     }
 
     /**
@@ -77,4 +79,63 @@ public class WarehouseController {
         boolean result = warehouseService.validPeriod(period);
         return Result.success(result);
     }
+
+    /**
+     * 获取列表
+     * @return
+     */
+    @GetMapping("/list")
+    public Result getList(){
+        return Result.success(warehouseService.selectAll());
+    }
+
+    /**
+     * 关闭
+     * @param id
+     * @return
+     */
+    @PostMapping("/close/{id}")
+    public Result close(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = warehouseService.close(id);
+        return Result.success(docBaseDTO);
+    }
+
+    /**
+     * 开启
+     * @param id
+     * @return
+     */
+    @PostMapping("/open/{id}")
+    public Result open(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = warehouseService.open(id);
+        return Result.success(docBaseDTO);
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        warehouseService.removeByPrimaryKey(id);
+        return Result.success();
+    }
+
+    /**
+     * 批量删除
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchDelete")
+    public Result batchDelete(@RequestBody BatchDealBaseDTO baseDTOs){
+        warehouseService.batchDelete(baseDTOs);
+        return Result.success();
+    }
+
+    @GetMapping("/read/{id}")
+    public Result getDataById(@PathVariable("id") Long id){
+        Warehouse warehouse = warehouseService.findByPrimaryKey(id);
+        return Result.success(warehouse);
+    }
 }

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

@@ -23,4 +23,6 @@ public interface BomDetailMapper extends CommonBaseMapper<BomDetail> {
     void batchUpdate(List<BomDetail> bomDetailList);
 
     void deleteByFK(Long id);
+
+    List<BomDetail> selectByFK(Long id);
 }

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

@@ -13,7 +13,14 @@ import java.util.List;
 public interface ProductMapper extends CommonBaseMapper<Product> {
 
     List<ProductDTO> getProductsByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
+
     List<ComboDTO> getProdUnit();
+
     void updateLatestPurchasePrice(Long pu_id);
 
+    int validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
+
+    String getCodeById(@Param("id") Long id);
 }

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

@@ -16,4 +16,10 @@ 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);
+
+    int validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
+
+    String getCodeById(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -1,7 +1,11 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Vendorkind;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface VendorkindMapper extends CommonBaseMapper<Vendorkind> {
 
@@ -16,4 +20,6 @@ public interface VendorkindMapper extends CommonBaseMapper<Vendorkind> {
     int updateByPrimaryKeySelective(Vendorkind record);
 
     int updateByPrimaryKey(Vendorkind record);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

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

@@ -27,5 +27,10 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
 
     void unPost(Map<String, Object> map);
 
-    List<Warehouse> selectCustomerListByCondition(@Param("con") String con,@Param("companyId") Long companyId);
+    List<Warehouse> selectAll(@Param("companyId") Long companyId);
+
+    int validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
+
 }

+ 43 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/BomService.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service;
 
 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.ListReqDTO;
 import com.usoftchina.saas.document.entities.Bom;
@@ -45,4 +46,46 @@ public interface BomService extends CommonBaseService<BomMapper, Bom> {
      * @return
      */
     BomList getDataById(Long id);
+
+    /**
+     * 批量删除
+     * @param baseDTOs
+     * @return
+     */
+    boolean batchDelete(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 关闭
+     * @param id
+     * @return  boolean
+     */
+    DocBaseDTO close(Long id);
+
+    /**
+     * 开启
+     * @param id
+     * @return  boolean
+     */
+    DocBaseDTO open(Long id);
+
+    /**
+     * 批量关闭
+     * @param baseDTOs
+     * @return
+     */
+    String batchClose(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 批量开启
+     * @param baseDTOs
+     * @return
+     */
+    String batchOpen(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 删除明细
+     * @param id
+     * @return
+     */
+    boolean deleteBomDetail(Long id);
 }

+ 44 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 
 
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
@@ -25,10 +26,23 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
      */
     PageInfo<ProductDTO> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO);
 
+    /**
+     * 获取物料单位
+     * @return
+     */
     List<ComboDTO> getProdUnit();
 
+    /**
+     * 更新最后采购单价
+     * @param pu_id
+     */
     void updateLatestPurchasePrice(Long pu_id);
 
+    /**
+     * 通过主键查询物料
+     * @param id
+     * @return
+     */
     Product getProductsByPK(Long id);
 
     /**
@@ -43,12 +57,40 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
      * @param id
      * @return
      */
-    boolean close(Long id);
+    DocBaseDTO close(Long id);
 
     /**
      * 开启
      * @param id
      * @return
      */
-    boolean open(Long id);
+    DocBaseDTO open(Long id);
+
+    /**
+     * 批量关闭
+     * @param baseDTOs
+     * @return
+     */
+    String batchClose(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 批量开启
+     * @param baseDTOs
+     * @return
+     */
+    String batchOpen(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 批量删除
+     * @param baseDTOs
+     * @return
+     */
+    boolean batchDelete(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 通过ID获取物料信息
+     * @param id
+     * @return
+     */
+    Product getDataById(Long id);
 }

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

@@ -3,6 +3,7 @@ package com.usoftchina.saas.document.service;
 import com.github.pagehelper.PageInfo;
 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.ListReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
@@ -58,12 +59,40 @@ public interface VendorService extends CommonBaseService<VendorMapper, Vendor>{
      * @param id
      * @return  boolean
      */
-    boolean close(Long id);
+    DocBaseDTO close(Long id);
 
     /**
      * 开启
      * @param id
      * @return  boolean
      */
-    boolean open(Long id);
+    DocBaseDTO open(Long id);
+
+    /**
+     * 批量关闭
+     * @param baseDTOs
+     * @return
+     */
+    String batchClose(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 批量开启
+     * @param baseDTOs
+     * @return
+     */
+    String batchOpen(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 删除明细
+     * @param id
+     * @return
+     */
+    boolean deleteContact(Long id);
+
+    /**
+     * 批量删除
+     * @param baseDTOs
+     * @return
+     */
+    boolean batchDelete(BatchDealBaseDTO baseDTOs);
 }

+ 4 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorkindService.java

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

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

@@ -7,6 +7,7 @@ import com.usoftchina.saas.document.entities.Warehouse;
 import com.usoftchina.saas.document.mapper.WarehouseMapper;
 import com.usoftchina.saas.page.PageRequest;
 
+import java.util.List;
 import java.util.Map;
 
 public interface WarehouseService extends CommonBaseService<WarehouseMapper, Warehouse> {
@@ -17,8 +18,30 @@ public interface WarehouseService extends CommonBaseService<WarehouseMapper, War
 
     boolean validPeriod(String periods);
 
-    int insertSelective(Warehouse record);
+    DocBaseDTO insertSelective(Warehouse record);
 
     void unPost(Map<String, Object> map);
 
+    List<Warehouse> selectAll();
+
+    /**
+     * 关闭
+     * @param id
+     * @return  boolean
+     */
+    DocBaseDTO close(Long id);
+
+    /**
+     * 开启
+     * @param id
+     * @return  boolean
+     */
+    DocBaseDTO open(Long id);
+
+    /**
+     * 批量删除
+     * @param baseDTOs
+     * @return
+     */
+    boolean batchDelete(BatchDealBaseDTO baseDTOs);
 }

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

@@ -3,10 +3,12 @@ package com.usoftchina.saas.document.service.impl;
 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.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.entities.Bom;
 import com.usoftchina.saas.document.entities.BomDetail;
@@ -19,6 +21,8 @@ import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -47,13 +51,17 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 bom.setCompanyId(companyId);
                 //保存BOM
                 getMapper().insertSelective(bom);
-                //赋值BD_BOMID
-                for (BomDetail bomDetail : bomDetailList){
-                    bomDetail.setBd_bomid(bom.getId());
-                    bomDetail.setCompanyId(companyId);
+                if (bomDetailList.size() > 0) {
+                    //赋值BD_BOMID
+                    for (BomDetail bomDetail : bomDetailList) {
+                        bomDetail.setBd_bomid(bom.getId());
+                        bomDetail.setCompanyId(companyId);
+                        bomDetail.setCreatorId(BaseContextHolder.getUserId());
+                        bomDetail.setCreateTime(new Date());
+                    }
+                    bomDetailMapper.batchInsert(bomDetailList);
                 }
-                bomDetailMapper.batchInsert(bomDetailList);
-                docBaseDTO = generateMsgObj(bom.getId());
+                docBaseDTO = generateMsgObj(bom.getId(), code);
                 //记录LOG
                 messageLogService.save(docBaseDTO);
             }else{
@@ -64,10 +72,32 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
             int count = getMapper().validCodeAndVersion(bom.getBo_mothercode(), bom.getBo_version(), companyId);
             //更新主表
             getMapper().updateByPrimaryKeySelective(bom);
-            //更新从表
-            bomDetailMapper.batchUpdate(bomDetailList);
+            if (bomDetailList.size() > 0) {
+                List<BomDetail> insertItems = new ArrayList<BomDetail>();
+                List<BomDetail> updateItems = new ArrayList<BomDetail>();
+                for(BomDetail bomDetail : bomDetailList){
+                    if (bomDetail.getId() == 0){
+                        bomDetail.setCreateTime(new Date());
+                        bomDetail.setCompanyId(BaseContextHolder.getCompanyId());
+                        bomDetail.setCreatorId(BaseContextHolder.getUserId());
+                        bomDetail.setBd_bomid(bom.getId());
+                        insertItems.add(bomDetail);
+                    }else{
+                        bomDetail.setUpdaterId(BaseContextHolder.getUserId());
+                        bomDetail.setUpdateTime(new Date());
+                        updateItems.add(bomDetail);
+                    }
+                }
+                //更新从表
+                if (insertItems.size() > 0){
+                    bomDetailMapper.batchInsert(insertItems);
+                }
+                if (updateItems.size() > 0){
+                    bomDetailMapper.batchUpdate(updateItems);
+                }
+            }
             //记录LOG
-            messageLogService.update(generateMsgObj(bom.getId()));
+            messageLogService.update(generateMsgObj(bom.getId(), bom.getBo_mothercode()));
         }
         return docBaseDTO;
     }
@@ -93,7 +123,106 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
 
     @Override
     public BomList getDataById(Long id) {
-        return null;
+        BomList bomList = new BomList();
+        Bom main = getMapper().selectByPrimaryKey(id);
+        List<BomDetail> items = bomDetailMapper.selectByFK(id);
+        bomList.setMain(main);
+        bomList.setItems(items);
+        return bomList;
+    }
+
+    @Override
+    public boolean batchDelete(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return false;
+        }
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            delete(base.getId());
+        }
+        return true;
+    }
+
+    @Override
+    public DocBaseDTO close(Long id) {
+        if(id != null && id > 0){
+            Bom bom = new Bom();
+            bom.setId(id);
+            bom.setBo_status(Status.CLOSE.getDisplay());
+            bom.setBo_statuscode(Status.CLOSE.name());
+            bom.setUpdaterId(BaseContextHolder.getUserId());
+            bom.setUpdateTime(new Date());
+
+            String code = getMapper().selectByPrimaryKey(id).getBo_mothercode();
+            getMapper().updateByPrimaryKeySelective(bom);
+            //记录LOG
+            DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+            messageLogService.close(docBaseDTO);
+            return docBaseDTO;
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public DocBaseDTO open(Long id) {
+        if (id != null && id > 0){
+            Bom bom = getMapper().selectByPrimaryKey(id);
+            if(bom == null){
+                throw new BizException(BizExceptionCode.NO_DATA);
+            }
+            if (Status.CLOSE.name().equals(bom.getBo_statuscode())){
+                String code = bom.getBo_mothercode();
+                bom = new Bom();
+                bom.setId(id);
+                bom.setBo_statuscode(Status.OPEN.name());
+                bom.setBo_status(Status.OPEN.getDisplay());
+                bom.setUpdateTime(new Date());
+                bom.setUpdaterId(BaseContextHolder.getUserId());
+
+                getMapper().updateByPrimaryKeySelective(bom);
+                //记录LOG
+                DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+                messageLogService.open(docBaseDTO);
+                return docBaseDTO;
+            }else {
+                throw new BizException(BizExceptionCode.BIZ_OPEN);
+            }
+        }else {
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public String batchClose(BatchDealBaseDTO baseDTOs) {
+        StringBuilder errorMsg = new StringBuilder();
+        for (DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
+            try{
+                close(docBaseDTO.getId());
+            }catch (Exception e){
+                errorMsg.append("编号:" + docBaseDTO.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
+    }
+
+    @Override
+    public String batchOpen(BatchDealBaseDTO baseDTOs) {
+        StringBuilder errorMsg = new StringBuilder();
+        for (DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
+            try{
+                open(docBaseDTO.getId());
+            }catch (Exception e){
+                errorMsg.append("编号:" + docBaseDTO.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
+    }
+
+    @Override
+    public boolean deleteBomDetail(Long id) {
+        bomDetailMapper.deleteByPrimaryKey(id);
+        return false;
     }
 
     /**
@@ -101,16 +230,16 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
      * @param id
      * @return
      */
-    private DocBaseDTO generateMsgObj(Long id){
-        return new DocBaseDTO(id, "", "Bom");
+    private DocBaseDTO generateMsgObj(Long id, String code){
+        return new DocBaseDTO(id, code, "Bom");
     }
 
     /**
      * @Description: 检验获取并更新单号
      * @Param: [code, id]
      * @return: java.lang.String
-     * @Author: guq
-     * @Date: 2018/10/19
+     * @Author: chenwei
+     * @Date: 2018/10/26
      */
     private String pushMaxnubmer(String code, Long id) {
         if (null == code) {
@@ -119,6 +248,6 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
         Long companyId = BaseContextHolder.getCompanyId();
         Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
                 getMapper().validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.PURCHASE.getCaller()).getData();
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.BOM.getCaller()).getData();
     }
 }

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

@@ -3,11 +3,14 @@ package com.usoftchina.saas.document.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.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.dto.ProductDTO;
@@ -19,6 +22,8 @@ import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.print.Doc;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -26,6 +31,8 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
 
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private MaxnumberService maxnumberService;
 
     @Override
     public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO) {
@@ -50,7 +57,8 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     @Override
     public void updateLatestPurchasePrice(Long pu_id) {
         getMapper().updateLatestPurchasePrice(pu_id);
-        messageLogService.update(generateMsgObj(pu_id));
+        Product product = getMapper().selectByPrimaryKey(pu_id);
+        messageLogService.update(generateMsgObj(pu_id, product.getPr_code()));
     }
 
     @Override
@@ -65,14 +73,19 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     public DocBaseDTO saveData(Product product){
         DocBaseDTO docBaseDTO = null;
         if(product.getId() == 0){
+            String code = pushMaxnubmer(product.getPr_code(), product.getId());
             product.setCompanyId(BaseContextHolder.getCompanyId());
+            product.setCreatorId(BaseContextHolder.getUserId());
+            product.setCreateTime(new Date());
             getMapper().insertSelective(product);
-            docBaseDTO = generateMsgObj(product.getId());
+            docBaseDTO = generateMsgObj(product.getId(), code);
             //记录LOG
             messageLogService.save(docBaseDTO);
         }else{
+            product.setUpdaterId(BaseContextHolder.getUserId());
+            product.setUpdateTime(new Date());
             getMapper().updateByPrimaryKeySelective(product);
-            docBaseDTO = generateMsgObj(product.getId());
+            docBaseDTO = generateMsgObj(product.getId(), product.getPr_code());
             //记录LOG
             messageLogService.update(docBaseDTO);
         }
@@ -80,25 +93,32 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     }
 
     @Override
-    public boolean close(Long id) {
+    public DocBaseDTO close(Long id) {
+        DocBaseDTO docBaseDTO = null;
         if(id != null && id > 0){
+            String code = getMapper().getCodeById(id);
             Product product = new Product();
             product.setId(id);
             product.setPr_status(Status.CLOSE.getDisplay());
             product.setPr_statuscode(Status.CLOSE.name());
+            product.setUpdaterId(BaseContextHolder.getUserId());
+            product.setUpdateTime(new Date());
             getMapper().updateByPrimaryKeySelective(product);
             //记录LOG
-            messageLogService.close(generateMsgObj(id));
-            return true;
+            docBaseDTO = generateMsgObj(id, code);
+            messageLogService.close(docBaseDTO);
+            return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
         }
     }
 
     @Override
-    public boolean open(Long id) {
+    public DocBaseDTO open(Long id) {
+        DocBaseDTO docBaseDTO = null;
         if(id != null && id > 0){
             Product product = getMapper().selectByPrimaryKey(id);
+            String code = product.getPr_code();
             if (product == null) {
                 throw new BizException(BizExceptionCode.NO_DATA);
             }
@@ -108,16 +128,58 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
                 product.setId(id);
                 product.setPr_statuscode(Status.OPEN.name());
                 product.setPr_status(Status.OPEN.getDisplay());
+                product.setUpdaterId(BaseContextHolder.getUserId());
+                product.setUpdateTime(new Date());
                 getMapper().updateByPrimaryKeySelective(product);
                 //记录LOG
-                messageLogService.open(generateMsgObj(id));
-                return true;
+                docBaseDTO = generateMsgObj(id, code);
+                messageLogService.open(docBaseDTO);
+                return docBaseDTO;
             }
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
         }
     }
 
+    @Override
+    public String batchClose(BatchDealBaseDTO baseDTOs) {
+        StringBuilder errorMsg = new StringBuilder();
+        for (DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
+            try{
+                close(docBaseDTO.getId());
+            }catch (Exception e){
+                errorMsg.append("编号:" + docBaseDTO.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
+    }
+
+    @Override
+    public String batchOpen(BatchDealBaseDTO baseDTOs) {
+        StringBuilder errorMsg = new StringBuilder();
+        for (DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
+            try{
+                open(docBaseDTO.getId());
+            }catch (Exception e){
+                errorMsg.append("编号:" + docBaseDTO.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
+    }
+
+    @Override
+    public boolean batchDelete(BatchDealBaseDTO baseDTOs) {
+        for(DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
+            getMapper().deleteByPrimaryKey(docBaseDTO.getId());
+        }
+        return true;
+    }
+
+    @Override
+    public Product getDataById(Long id) {
+        return getMapper().selectByPrimaryKey(id);
+    }
+
     private List<ProductDTO> getList(ListReqDTO listReqDTO){
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();
@@ -133,7 +195,24 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
      * @param id
      * @return
      */
-    private DocBaseDTO generateMsgObj(Long id){
-        return new DocBaseDTO(id, "", "Product");
+    private DocBaseDTO generateMsgObj(Long id, String code){
+        return new DocBaseDTO(id, code, "Product");
+    }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: chenwei
+     * @Date: 2018/10/26
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
+                getMapper().validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.VENDOR.getCaller()).getData();
     }
 }

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

@@ -3,10 +3,13 @@ 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.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.document.dto.VendorDTO;
@@ -21,7 +24,10 @@ import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -35,6 +41,8 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
     private VendorcontactMapper vendorcontactMapper;
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private MaxnumberService maxnumberService;
 
     @Override
     public PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO) {
@@ -91,33 +99,65 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
      * @param vendorListDTO
      */
     @Override
+    @Transactional
     public DocBaseDTO saveFormData(VendorListDTO vendorListDTO) {
         if (null == vendorListDTO || null == vendorListDTO.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
         }
         Vendor main = vendorListDTO.getMain();
+        String code = null;
         main.setCompanyId(BaseContextHolder.getCompanyId());
         List<Vendorcontact> items = vendorListDTO.getItems();
         if(main.getId() == 0){
+            code = pushMaxnubmer(main.getVe_code(), main.getId());
             //保存主表信息
+            main.setVe_code(code);
             getMapper().insertSelective(main);
             Long mainId = main.getId();
             //更新明细表vc_veid
             for(Vendorcontact item : items){
                 item.setVc_veid(mainId);
                 item.setCompanyId(BaseContextHolder.getCompanyId());
+                item.setCreatorId(BaseContextHolder.getUserId());
+                item.setCreateTime(new Date());
             }
             //保存明细表信息
-            vendorcontactMapper.batchInsert(items);
+            if (items.size() > 0){
+                vendorcontactMapper.batchInsert(items);
+            }
             //记录LOG
-            messageLogService.save(generateMsgObj(mainId));
+            messageLogService.save(generateMsgObj(mainId, code));
         }else{
+            code = main.getVe_code();
             getMapper().updateByPrimaryKeySelective(main);
-            vendorcontactMapper.batchUpdate(items);
+            if (items.size() > 0) {
+                List<Vendorcontact> updateItems = new ArrayList<Vendorcontact>();
+                List<Vendorcontact> insertItems = new ArrayList<Vendorcontact>();
+                //获取执行更新、插入的明细数据
+                for(Vendorcontact vendorcontact : items){
+                    if(vendorcontact.getId() == 0){
+                        vendorcontact.setCompanyId(BaseContextHolder.getCompanyId());
+                        vendorcontact.setCreateTime(new Date());
+                        vendorcontact.setCreatorId(BaseContextHolder.getUserId());
+                        vendorcontact.setVc_veid(main.getId());
+                        insertItems.add(vendorcontact);
+                    }else{
+                        vendorcontact.setUpdaterId(BaseContextHolder.getUserId());
+                        vendorcontact.setUpdateTime(new Date());
+                        updateItems.add(vendorcontact);
+                    }
+                }
+                if (insertItems.size() > 0){
+                    vendorcontactMapper.batchInsert(insertItems);
+                }
+                if (updateItems.size() > 0){
+                    vendorcontactMapper.batchUpdate(items);
+                }
+            }
             //记录LOG
-            messageLogService.update(generateMsgObj(main.getId()));
+            messageLogService.update(generateMsgObj(main.getId(), code));
         }
-        return generateMsgObj(main.getId());
+        return generateMsgObj(main.getId(), code);
     }
 
     /**
@@ -129,8 +169,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         if(id != null && id > 0){
             getMapper().deleteByPrimaryKey(id);
             vendorcontactMapper.deleteByFK(id);
+            String code = getMapper().getCodeById(id, BaseContextHolder.getCompanyId());
             //记录LOG
-            messageLogService.delete(generateMsgObj(id));
+            messageLogService.delete(generateMsgObj(id, code));
         }
     }
 
@@ -140,16 +181,21 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
      * @return
      */
     @Override
-    public boolean close(Long id){
+    public DocBaseDTO 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());
+            vendor.setUpdaterId(BaseContextHolder.getUserId());
+            vendor.setUpdateTime(new Date());
+
+            String code = getMapper().getCodeById(id, BaseContextHolder.getCompanyId());
             getMapper().updateByPrimaryKeySelective(vendor);
             //记录LOG
-            messageLogService.close(generateMsgObj(id));
-            return true;
+            DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+            messageLogService.close(docBaseDTO);
+            return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
         }
@@ -161,21 +207,23 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
      * @return
      */
     @Override
-    public boolean open(Long id){
+    public DocBaseDTO 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())){
+                String code = vendor.getVe_code();
                 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;
+                DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+                messageLogService.open(docBaseDTO);
+                return docBaseDTO;
             }else {
                 throw new BizException(BizExceptionCode.BIZ_OPEN);
             }
@@ -184,6 +232,54 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         }
     }
 
+    @Override
+    public String batchClose(BatchDealBaseDTO baseDTOs) {
+        StringBuilder errorMsg = new StringBuilder();
+        for (DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
+            try{
+                close(docBaseDTO.getId());
+            }catch (Exception e){
+                errorMsg.append("编号:" + docBaseDTO.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
+    }
+
+    @Override
+    public String batchOpen(BatchDealBaseDTO baseDTOs) {
+        StringBuilder errorMsg = new StringBuilder();
+        for (DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
+            try{
+                open(docBaseDTO.getId());
+            }catch (Exception e){
+                errorMsg.append("编号:" + docBaseDTO.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
+    }
+
+    @Override
+    public boolean deleteContact(Long id) {
+        vendorcontactMapper.deleteByPrimaryKey(id);
+        Long ve_id = vendorcontactMapper.selectByPrimaryKey(id).getVc_veid();
+        String code = getMapper().getCodeById(ve_id, BaseContextHolder.getCompanyId());
+        //记录LOG
+        messageLogService.deleteDetail(generateMsgObj(id, code));
+        return true;
+    }
+
+    @Override
+    public boolean batchDelete(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return false;
+        }
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            deleteById(base.getId());
+        }
+        return true;
+    }
+
     private List<VendorDTO> getList(ListReqDTO listReqDTO){
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();
@@ -199,8 +295,24 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
      * @param id
      * @return
      */
-    private DocBaseDTO generateMsgObj(Long id){
-        return new DocBaseDTO(id, "", "Vendor");
+    private DocBaseDTO generateMsgObj(Long id, String code){
+        return new DocBaseDTO(id, code, "Vendor");
     }
 
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: chenwei
+     * @Date: 2018/10/26
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
+                getMapper().validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.VENDOR.getCaller()).getData();
+    }
 }

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

@@ -2,6 +2,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.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Vendorkind;
@@ -10,6 +11,8 @@ import com.usoftchina.saas.document.service.VendorkindService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMapper, Vendorkind> implements VendorkindService {
 
@@ -51,4 +54,9 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
     private DocBaseDTO generateMsgObj(Long id){
         return new DocBaseDTO(id, "", "VendorKind");
     }
+
+    @Override
+    public List<ComboDTO> getCombo() {
+        return getMapper().getCombo(BaseContextHolder.getCompanyId());
+    }
 }

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

@@ -3,17 +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.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.document.entities.Warehouse;
 import com.usoftchina.saas.document.mapper.WarehouseMapper;
 import com.usoftchina.saas.document.service.WarehouseService;
-import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.print.Doc;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -23,6 +29,8 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
 
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private MaxnumberService maxnumberService;
 
     @Override
     public PageInfo<Warehouse> getListData(PageRequest page, ListReqDTO req) {
@@ -86,18 +94,28 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
      * @return
      */
     @Override
-    public int insertSelective(Warehouse record) {
+    public DocBaseDTO insertSelective(Warehouse record) {
         int count = 0;
+        DocBaseDTO docBaseDTO = null;
         if(record.getId() == 0){
+            String code = pushMaxnubmer(record.getWh_code(), record.getId());
             count = getMapper().insertSelective(record);
+            record.setCompanyId(BaseContextHolder.getCompanyId());
+            record.setCreatorId(BaseContextHolder.getUserId());
+            record.setCreateTime(new Date());
             //记录LOG
-            messageLogService.save(generateMsgObj(record.getId()));
+            docBaseDTO = generateMsgObj(record.getId(), code);
+            messageLogService.save(docBaseDTO);
         }else{
+            record.setUpdateTime(new Date());
+            record.setUpdaterId(BaseContextHolder.getUserId());
+
             getMapper().updateByPrimaryKeySelective(record);
             //记录LOG
-            messageLogService.update(generateMsgObj(record.getId()));
+            docBaseDTO = generateMsgObj(record.getId(), record.getWh_code());
+            messageLogService.update(docBaseDTO);
         }
-        return count;
+        return docBaseDTO;
     }
 
     /**
@@ -109,12 +127,96 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         getMapper().unPost(map);
     }
 
+    @Override
+    public List<Warehouse> selectAll() {
+        return getMapper().selectAll(BaseContextHolder.getCompanyId());
+    }
+
+    @Override
+    public DocBaseDTO close(Long id) {
+        if(id != null && id > 0){
+            Warehouse warehouse = new Warehouse();
+            warehouse.setId(id);
+            warehouse.setWh_status(Status.CLOSE.getDisplay());
+            warehouse.setWh_statuscode(Status.CLOSE.name());
+            warehouse.setUpdaterId(BaseContextHolder.getUserId());
+            warehouse.setUpdateTime(new Date());
+
+            String code = getMapper().selectByPrimaryKey(id).getWh_code();
+            getMapper().updateByPrimaryKeySelective(warehouse);
+            //记录LOG
+            DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+            messageLogService.close(docBaseDTO);
+            return docBaseDTO;
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public DocBaseDTO open(Long id) {
+        if (id != null && id > 0){
+            Warehouse warehouse = getMapper().selectByPrimaryKey(id);
+            if(warehouse == null){
+                throw new BizException(BizExceptionCode.NO_DATA);
+            }
+            if (Status.CLOSE.name().equals(warehouse.getWh_statuscode())){
+                String code = warehouse.getWh_code();
+                warehouse = new Warehouse();
+                warehouse.setId(id);
+                warehouse.setWh_statuscode(Status.OPEN.name());
+                warehouse.setWh_status(Status.OPEN.getDisplay());
+                warehouse.setUpdaterId(BaseContextHolder.getUserId());
+                warehouse.setUpdateTime(new Date());
+
+                getMapper().updateByPrimaryKeySelective(warehouse);
+                //记录LOG
+                DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+                messageLogService.open(docBaseDTO);
+                return docBaseDTO;
+            }else {
+                throw new BizException(BizExceptionCode.BIZ_OPEN);
+            }
+        }else {
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public boolean batchDelete(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return false;
+        }
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            getMapper().deleteByPrimaryKey(base.getId());
+        }
+        return true;
+    }
+
     /**
      * 构造 记录日志对象
      * @param id
      * @return
      */
-    private DocBaseDTO generateMsgObj(Long id){
-        return new DocBaseDTO(id, "", "Warehouse");
+    private DocBaseDTO generateMsgObj(Long id, String code){
+        return new DocBaseDTO(id, code, "Warehouse");
+    }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: chenwei
+     * @Date: 2018/10/26
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
+                getMapper().validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.VENDOR.getCaller()).getData();
     }
 }

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

@@ -393,4 +393,7 @@
     DELETE FROM BOMDETAIL
     WHERE BD_BOMID=#{id}
   </delete>
+  <select id="selectByFK" resultMap="BaseResultMap">
+    SELECT * FROM BOMDETAIL WHERE BD_BOMID = #{id}
+  </select>
 </mapper>

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

@@ -248,4 +248,7 @@
   <select id="validCodeAndVersion" resultType="int">
       SELECT COUNT(*) FROM BOM WHERE BO_MOTHERCODE = #{code} and BO_VERSION=#{version} and COMPANYID=#{companyId}
   </select>
+  <select id="getCodeById" resultType="string">
+      SELECT BO_MOTHERCODE FROM BOM WHERE BO_ID = #{id} and COMPANYID = #{companyId}
+  </select>
 </mapper>

+ 387 - 8
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.usoftchina.saas.document.mapper.ProductMapper">
-    <resultMap id="ProductResultMapper" type="com.usoftchina.saas.document.entities.Product">
+    <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Product">
         <id column="pr_id" property="id" jdbcType="INTEGER" />
         <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
         <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
@@ -26,9 +26,9 @@
         <result column="pr_recordman" property="pr_recordman" jdbcType="VARCHAR" />
         <result column="pr_status" property="pr_status" jdbcType="VARCHAR" />
         <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR" />
-        <result column="companyid" property="companyId" jdbcType="INTEGER" />
-        <result column="updatemanid" property="updaterId" jdbcType="INTEGER" />
-        <result column="updatetime" property="updateTime" jdbcType="TIMESTAMP" />
+        <result column="companyId" property="companyId" jdbcType="INTEGER" />
+        <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+        <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
         <result column="pr_text1" property="pr_text1" jdbcType="VARCHAR" />
         <result column="pr_text2" property="pr_text2" jdbcType="VARCHAR" />
         <result column="pr_text3" property="pr_text3" jdbcType="VARCHAR" />
@@ -43,6 +43,8 @@
         <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR" />
         <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
         <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+        <result column="pr_status" property="pr_status" jdbcType="VARCHAR" />
+        <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR" />
     </resultMap>
     <!--查询所有物料信息-->
     <select id="getProductsByCondition" resultMap="ProductDTOResultMapper" parameterType="com.usoftchina.saas.commons.dto.DocReqDTO">
@@ -54,10 +56,6 @@
         </where>
     </select>
 
-    <select id="selectByPrimaryKey" resultMap="ProductResultMapper" parameterType="long">
-        SELECT * FROM PRODUCT where pr_id = #{pr_id}
-    </select>
-
     <select id="getProdUnit" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT PR_UNIT as display, pr_unit as value FROM PRODUCT
     </select>
@@ -65,5 +63,386 @@
         update product a set pr_purcprice=(select pd_price from purchasedetail WHERE
         a.pr_code = pd_prodcode and pd_puid = #{id}) where pr_code in (select pd_prodcode from purchasedetail where pd_puid=#{id})
     </update>
+    <select id="selectAll" resultMap="BaseResultMap">
+        SELECT * FROM PRODUCT
+    </select>
+    <select id="validateCodeWhenInsert" resultType="int">
+        select count(*) from PRODUCT where PR_CODE = #{code} and companyId =#{companyId}
+    </select>
+    <select id="validateCodeWhenUpdate" resultType="int" >
+        select count(*) from PRODUCT where PR_CODE = #{code} and PR_ID != #{id} and companyId =#{companyId}
+    </select>
+    <select id="getCodeById" resultType="string">
+        SELECT PR_CODE FROM PRODUCT WHERE PR_ID=#{id}
+    </select>
+
+    <sql id="Base_Column_List" >
+        pr_id, pr_code, pr_detail, pr_spec, pr_unit, pr_kind, pr_orispeccode, pr_whid, pr_whcode,
+        pr_whname, pr_zxbzs, pr_leadtime, pr_brand, pr_standardprice, pr_purcprice, pr_saleprice,
+        pr_vendid, pr_vendcode, pr_vendname, pr_docdate, pr_recordmanid, pr_recordman, pr_status,
+        pr_statuscode, companyId, updaterId, updateTime, pr_text1, pr_text2, pr_text3,
+        pr_text4, pr_text5
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+        select
+        <include refid="Base_Column_List" />
+        from product
+        where pr_id = #{id}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+        delete from product
+        where pr_id = #{id}
+    </delete>
+    <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Product" >
+        insert into product (pr_code, pr_detail,
+        pr_spec, pr_unit, pr_kind,
+        pr_orispeccode, pr_whid, pr_whcode,
+        pr_whname, pr_zxbzs, pr_leadtime,
+        pr_brand, pr_standardprice, pr_purcprice,
+        pr_saleprice, pr_vendid, pr_vendcode,
+        pr_vendname, pr_docdate, pr_recordmanid,
+        pr_recordman, pr_status, pr_statuscode,
+        companyId, updaterId, updateTime,
+        pr_text1, pr_text2, pr_text3,
+        pr_text4, pr_text5)
+        values (#{pr_code,jdbcType=VARCHAR}, #{pr_detail,jdbcType=VARCHAR},
+        #{pr_spec,jdbcType=VARCHAR}, #{pr_unit,jdbcType=VARCHAR}, #{pr_kind,jdbcType=VARCHAR},
+        #{pr_orispeccode,jdbcType=VARCHAR}, #{pr_whid,jdbcType=DECIMAL}, #{pr_whcode,jdbcType=VARCHAR},
+        #{pr_whname,jdbcType=VARCHAR}, #{pr_zxbzs,jdbcType=DECIMAL}, #{pr_leadtime,jdbcType=DECIMAL},
+        #{pr_brand,jdbcType=VARCHAR}, #{pr_standardprice,jdbcType=DECIMAL}, #{pr_purcprice,jdbcType=DECIMAL},
+        #{pr_saleprice,jdbcType=DECIMAL}, #{pr_vendid,jdbcType=DECIMAL}, #{pr_vendcode,jdbcType=VARCHAR},
+        #{pr_vendname,jdbcType=VARCHAR}, #{pr_docdate,jdbcType=TIMESTAMP}, #{pr_recordmanid,jdbcType=DECIMAL},
+        #{pr_recordman,jdbcType=VARCHAR}, #{pr_status,jdbcType=VARCHAR}, #{pr_statuscode,jdbcType=VARCHAR},
+        #{companyId,jdbcType=DECIMAL}, #{updaterId,jdbcType=DECIMAL}, #{updateTime,jdbcType=TIMESTAMP},
+        #{pr_text1,jdbcType=VARCHAR}, #{pr_text2,jdbcType=VARCHAR}, #{pr_text3,jdbcType=VARCHAR},
+        #{pr_text4,jdbcType=VARCHAR}, #{pr_text5,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Product" >
+        insert into product
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="pr_code != null" >
+                pr_code,
+            </if>
+            <if test="pr_detail != null" >
+                pr_detail,
+            </if>
+            <if test="pr_spec != null" >
+                pr_spec,
+            </if>
+            <if test="pr_unit != null" >
+                pr_unit,
+            </if>
+            <if test="pr_kind != null" >
+                pr_kind,
+            </if>
+            <if test="pr_orispeccode != null" >
+                pr_orispeccode,
+            </if>
+            <if test="pr_whid != null" >
+                pr_whid,
+            </if>
+            <if test="pr_whcode != null" >
+                pr_whcode,
+            </if>
+            <if test="pr_whname != null" >
+                pr_whname,
+            </if>
+            <if test="pr_zxbzs != null" >
+                pr_zxbzs,
+            </if>
+            <if test="pr_leadtime != null" >
+                pr_leadtime,
+            </if>
+            <if test="pr_brand != null" >
+                pr_brand,
+            </if>
+            <if test="pr_standardprice != null" >
+                pr_standardprice,
+            </if>
+            <if test="pr_purcprice != null" >
+                pr_purcprice,
+            </if>
+            <if test="pr_saleprice != null" >
+                pr_saleprice,
+            </if>
+            <if test="pr_vendid != null" >
+                pr_vendid,
+            </if>
+            <if test="pr_vendcode != null" >
+                pr_vendcode,
+            </if>
+            <if test="pr_vendname != null" >
+                pr_vendname,
+            </if>
+            <if test="pr_docdate != null" >
+                pr_docdate,
+            </if>
+            <if test="pr_recordmanid != null" >
+                pr_recordmanid,
+            </if>
+            <if test="pr_recordman != null" >
+                pr_recordman,
+            </if>
+            <if test="pr_status != null" >
+                pr_status,
+            </if>
+            <if test="pr_statuscode != null" >
+                pr_statuscode,
+            </if>
+            <if test="companyId != null" >
+                companyId,
+            </if>
+            <if test="updaterId != null" >
+                updaterId,
+            </if>
+            <if test="updateTime != null" >
+                updateTime,
+            </if>
+            <if test="pr_text1 != null" >
+                pr_text1,
+            </if>
+            <if test="pr_text2 != null" >
+                pr_text2,
+            </if>
+            <if test="pr_text3 != null" >
+                pr_text3,
+            </if>
+            <if test="pr_text4 != null" >
+                pr_text4,
+            </if>
+            <if test="pr_text5 != null" >
+                pr_text5,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="pr_code != null" >
+                #{pr_code,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_detail != null" >
+                #{pr_detail,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_spec != null" >
+                #{pr_spec,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_unit != null" >
+                #{pr_unit,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_kind != null" >
+                #{pr_kind,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_orispeccode != null" >
+                #{pr_orispeccode,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_whid != null" >
+                #{pr_whid,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_whcode != null" >
+                #{pr_whcode,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_whname != null" >
+                #{pr_whname,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_zxbzs != null" >
+                #{pr_zxbzs,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_leadtime != null" >
+                #{pr_leadtime,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_brand != null" >
+                #{pr_brand,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_standardprice != null" >
+                #{pr_standardprice,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_purcprice != null" >
+                #{pr_purcprice,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_saleprice != null" >
+                #{pr_saleprice,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_vendid != null" >
+                #{pr_vendid,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_vendcode != null" >
+                #{pr_vendcode,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_vendname != null" >
+                #{pr_vendname,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_docdate != null" >
+                #{pr_docdate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="pr_recordmanid != null" >
+                #{pr_recordmanid,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_recordman != null" >
+                #{pr_recordman,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_status != null" >
+                #{pr_status,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_statuscode != null" >
+                #{pr_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="companyId != null" >
+                #{companyId,jdbcType=DECIMAL},
+            </if>
+            <if test="updaterId != null" >
+                #{updaterId,jdbcType=DECIMAL},
+            </if>
+            <if test="updateTime != null" >
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="pr_text1 != null" >
+                #{pr_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_text2 != null" >
+                #{pr_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_text3 != null" >
+                #{pr_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_text4 != null" >
+                #{pr_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_text5 != null" >
+                #{pr_text5,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Product" >
+        update product
+        <set >
+            <if test="pr_code != null" >
+                pr_code = #{pr_code,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_detail != null" >
+                pr_detail = #{pr_detail,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_spec != null" >
+                pr_spec = #{pr_spec,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_unit != null" >
+                pr_unit = #{pr_unit,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_kind != null" >
+                pr_kind = #{pr_kind,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_orispeccode != null" >
+                pr_orispeccode = #{pr_orispeccode,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_whid != null" >
+                pr_whid = #{pr_whid,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_whcode != null" >
+                pr_whcode = #{pr_whcode,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_whname != null" >
+                pr_whname = #{pr_whname,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_zxbzs != null" >
+                pr_zxbzs = #{pr_zxbzs,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_leadtime != null" >
+                pr_leadtime = #{pr_leadtime,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_brand != null" >
+                pr_brand = #{pr_brand,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_standardprice != null" >
+                pr_standardprice = #{pr_standardprice,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_purcprice != null" >
+                pr_purcprice = #{pr_purcprice,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_saleprice != null" >
+                pr_saleprice = #{pr_saleprice,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_vendid != null" >
+                pr_vendid = #{pr_vendid,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_vendcode != null" >
+                pr_vendcode = #{pr_vendcode,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_vendname != null" >
+                pr_vendname = #{pr_vendname,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_docdate != null" >
+                pr_docdate = #{pr_docdate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="pr_recordmanid != null" >
+                pr_recordmanid = #{pr_recordmanid,jdbcType=DECIMAL},
+            </if>
+            <if test="pr_recordman != null" >
+                pr_recordman = #{pr_recordman,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_status != null" >
+                pr_status = #{pr_status,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_statuscode != null" >
+                pr_statuscode = #{pr_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="companyId != null" >
+                companyId = #{companyId,jdbcType=DECIMAL},
+            </if>
+            <if test="updaterId != null" >
+                updaterId = #{updaterId,jdbcType=DECIMAL},
+            </if>
+            <if test="updateTime != null" >
+                updateTime = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="pr_text1 != null" >
+                pr_text1 = #{pr_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_text2 != null" >
+                pr_text2 = #{pr_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_text3 != null" >
+                pr_text3 = #{pr_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_text4 != null" >
+                pr_text4 = #{pr_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="pr_text5 != null" >
+                pr_text5 = #{pr_text5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where pr_id = #{id}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Product" >
+        update product
+        set pr_code = #{pr_code,jdbcType=VARCHAR},
+        pr_detail = #{pr_detail,jdbcType=VARCHAR},
+        pr_spec = #{pr_spec,jdbcType=VARCHAR},
+        pr_unit = #{pr_unit,jdbcType=VARCHAR},
+        pr_kind = #{pr_kind,jdbcType=VARCHAR},
+        pr_orispeccode = #{pr_orispeccode,jdbcType=VARCHAR},
+        pr_whid = #{pr_whid,jdbcType=DECIMAL},
+        pr_whcode = #{pr_whcode,jdbcType=VARCHAR},
+        pr_whname = #{pr_whname,jdbcType=VARCHAR},
+        pr_zxbzs = #{pr_zxbzs,jdbcType=DECIMAL},
+        pr_leadtime = #{pr_leadtime,jdbcType=DECIMAL},
+        pr_brand = #{pr_brand,jdbcType=VARCHAR},
+        pr_standardprice = #{pr_standardprice,jdbcType=DECIMAL},
+        pr_purcprice = #{pr_purcprice,jdbcType=DECIMAL},
+        pr_saleprice = #{pr_saleprice,jdbcType=DECIMAL},
+        pr_vendid = #{pr_vendid,jdbcType=DECIMAL},
+        pr_vendcode = #{pr_vendcode,jdbcType=VARCHAR},
+        pr_vendname = #{pr_vendname,jdbcType=VARCHAR},
+        pr_docdate = #{pr_docdate,jdbcType=TIMESTAMP},
+        pr_recordmanid = #{pr_recordmanid,jdbcType=DECIMAL},
+        pr_recordman = #{pr_recordman,jdbcType=VARCHAR},
+        pr_status = #{pr_status,jdbcType=VARCHAR},
+        pr_statuscode = #{pr_statuscode,jdbcType=VARCHAR},
+        companyId = #{companyId,jdbcType=DECIMAL},
+        updaterId = #{updaterId,jdbcType=DECIMAL},
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+        pr_text1 = #{pr_text1,jdbcType=VARCHAR},
+        pr_text2 = #{pr_text2,jdbcType=VARCHAR},
+        pr_text3 = #{pr_text3,jdbcType=VARCHAR},
+        pr_text4 = #{pr_text4,jdbcType=VARCHAR},
+        pr_text5 = #{pr_text5,jdbcType=VARCHAR}
+        where pr_id = #{id}
+    </update>
 </mapper>
 

+ 357 - 4
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -20,14 +20,17 @@
         <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="companyid" property="companyId" jdbcType="INTEGER" />
-        <result column="updatemanid" property="updaterId" jdbcType="INTEGER" />
-        <result column="updatedate" property="updateTime" jdbcType="TIMESTAMP" />
+        <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="ve_payamount" property="ve_payamount" jdbcType="DOUBLE" />
+        <result column="ve_leftamount" property="ve_leftamount" jdbcType="DOUBLE" />
+        <result column="ve_beginym" property="ve_beginym" jdbcType="INTEGER" />
     </resultMap>
     <resultMap id="VendorDTOResultMapper" type="com.usoftchina.saas.document.dto.VendorDTO">
         <id column="ve_id" property="id" jdbcType="INTEGER" />
@@ -51,7 +54,7 @@
     </select>
 
     <resultMap id="VendorListResultMapper" type="com.usoftchina.saas.document.entities.VendorList">
-        <id column="ve_id" property="ve_id" jdbcType="INTEGER" />
+        <id column="ve_id" property="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" />
@@ -99,5 +102,355 @@
         order by VE_ID,VC_DETNO
     </select>
 
+    <sql id="Base_Column_List" >
+        ve_id, ve_code, ve_name, ve_uu, ve_type, ve_begindate, ve_beginapamount, ve_beginprepayamount,
+        ve_promisedays, ve_taxrate, ve_nsrzh, ve_bankaccount, ve_bankcode, ve_status, ve_statuscode,
+        ve_recordid, ve_recordname, ve_initdate, companyId, updaterId, updateTime, ve_text1,
+        ve_text2, ve_text3, ve_text4, ve_text5, ve_payamount, ve_leftamount, ve_beginym
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Long" >
+        select
+        <include refid="Base_Column_List" />
+        from vendor
+        where ve_id = #{id}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+        delete from vendor
+        where ve_id = #{id}
+    </delete>
+    <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Vendor" >
+        insert into vendor (ve_code, ve_name,
+        ve_uu, ve_type, ve_begindate,
+        ve_beginapamount, ve_beginprepayamount,
+        ve_promisedays, ve_taxrate, ve_nsrzh,
+        ve_bankaccount, ve_bankcode, ve_status,
+        ve_statuscode, ve_recordid, ve_recordname,
+        ve_initdate, companyId, updaterId,
+        updateTime, ve_text1, ve_text2,
+        ve_text3, ve_text4, ve_text5,
+        ve_payamount, ve_leftamount, ve_beginym
+        )
+        values (#{ve_code,jdbcType=VARCHAR}, #{ve_name,jdbcType=VARCHAR},
+        #{ve_uu,jdbcType=VARCHAR}, #{ve_type,jdbcType=VARCHAR}, #{ve_begindate,jdbcType=TIMESTAMP},
+        #{ve_beginapamount,jdbcType=DECIMAL}, #{ve_beginprepayamount,jdbcType=DECIMAL},
+        #{ve_promisedays,jdbcType=DECIMAL}, #{ve_taxrate,jdbcType=DOUBLE}, #{ve_nsrzh,jdbcType=VARCHAR},
+        #{ve_bankaccount,jdbcType=VARCHAR}, #{ve_bankcode,jdbcType=VARCHAR}, #{ve_status,jdbcType=VARCHAR},
+        #{ve_statuscode,jdbcType=VARCHAR}, #{ve_recordid,jdbcType=DECIMAL}, #{ve_recordname,jdbcType=VARCHAR},
+        #{ve_initdate,jdbcType=TIMESTAMP}, #{companyId,jdbcType=DECIMAL}, #{updaterId,jdbcType=DECIMAL},
+        #{updateTime,jdbcType=TIMESTAMP}, #{ve_text1,jdbcType=VARCHAR}, #{ve_text2,jdbcType=VARCHAR},
+        #{ve_text3,jdbcType=VARCHAR}, #{ve_text4,jdbcType=VARCHAR}, #{ve_text5,jdbcType=VARCHAR},
+        #{ve_payamount,jdbcType=DOUBLE}, #{ve_leftamount,jdbcType=DOUBLE}, #{ve_beginym,jdbcType=INTEGER}
+        )
+    </insert>
+    <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
+        insert into vendor
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="ve_code != null" >
+                ve_code,
+            </if>
+            <if test="ve_name != null" >
+                ve_name,
+            </if>
+            <if test="ve_uu != null" >
+                ve_uu,
+            </if>
+            <if test="ve_type != null" >
+                ve_type,
+            </if>
+            <if test="ve_begindate != null" >
+                ve_begindate,
+            </if>
+            <if test="ve_beginapamount != null" >
+                ve_beginapamount,
+            </if>
+            <if test="ve_beginprepayamount != null" >
+                ve_beginprepayamount,
+            </if>
+            <if test="ve_promisedays != null" >
+                ve_promisedays,
+            </if>
+            <if test="ve_taxrate != null" >
+                ve_taxrate,
+            </if>
+            <if test="ve_nsrzh != null" >
+                ve_nsrzh,
+            </if>
+            <if test="ve_bankaccount != null" >
+                ve_bankaccount,
+            </if>
+            <if test="ve_bankcode != null" >
+                ve_bankcode,
+            </if>
+            <if test="ve_status != null" >
+                ve_status,
+            </if>
+            <if test="ve_statuscode != null" >
+                ve_statuscode,
+            </if>
+            <if test="ve_recordid != null" >
+                ve_recordid,
+            </if>
+            <if test="ve_recordname != null" >
+                ve_recordname,
+            </if>
+            <if test="ve_initdate != null" >
+                ve_initdate,
+            </if>
+            <if test="companyId != null" >
+                companyId,
+            </if>
+            <if test="updaterId != null" >
+                updaterId,
+            </if>
+            <if test="updateTime != null" >
+                updateTime,
+            </if>
+            <if test="ve_text1 != null" >
+                ve_text1,
+            </if>
+            <if test="ve_text2 != null" >
+                ve_text2,
+            </if>
+            <if test="ve_text3 != null" >
+                ve_text3,
+            </if>
+            <if test="ve_text4 != null" >
+                ve_text4,
+            </if>
+            <if test="ve_text5 != null" >
+                ve_text5,
+            </if>
+            <if test="ve_payamount != null" >
+                ve_payamount,
+            </if>
+            <if test="ve_leftamount != null" >
+                ve_leftamount,
+            </if>
+            <if test="ve_beginym != null" >
+                ve_beginym,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="ve_code != null" >
+                #{ve_code,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_name != null" >
+                #{ve_name,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_uu != null" >
+                #{ve_uu,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_type != null" >
+                #{ve_type,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_begindate != null" >
+                #{ve_begindate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="ve_beginapamount != null" >
+                #{ve_beginapamount,jdbcType=DECIMAL},
+            </if>
+            <if test="ve_beginprepayamount != null" >
+                #{ve_beginprepayamount,jdbcType=DECIMAL},
+            </if>
+            <if test="ve_promisedays != null" >
+                #{ve_promisedays,jdbcType=DECIMAL},
+            </if>
+            <if test="ve_taxrate != null" >
+                #{ve_taxrate,jdbcType=DOUBLE},
+            </if>
+            <if test="ve_nsrzh != null" >
+                #{ve_nsrzh,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_bankaccount != null" >
+                #{ve_bankaccount,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_bankcode != null" >
+                #{ve_bankcode,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_status != null" >
+                #{ve_status,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_statuscode != null" >
+                #{ve_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_recordid != null" >
+                #{ve_recordid,jdbcType=DECIMAL},
+            </if>
+            <if test="ve_recordname != null" >
+                #{ve_recordname,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_initdate != null" >
+                #{ve_initdate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyId != null" >
+                #{companyId,jdbcType=DECIMAL},
+            </if>
+            <if test="updaterId != null" >
+                #{updaterId,jdbcType=DECIMAL},
+            </if>
+            <if test="updateTime != null" >
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="ve_text1 != null" >
+                #{ve_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_text2 != null" >
+                #{ve_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_text3 != null" >
+                #{ve_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_text4 != null" >
+                #{ve_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_text5 != null" >
+                #{ve_text5,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_payamount != null" >
+                #{ve_payamount,jdbcType=DOUBLE},
+            </if>
+            <if test="ve_leftamount != null" >
+                #{ve_leftamount,jdbcType=DOUBLE},
+            </if>
+            <if test="ve_beginym != null" >
+                #{ve_beginym,jdbcType=INTEGER},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
+        update vendor
+        <set >
+            <if test="ve_code != null" >
+                ve_code = #{ve_code,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_name != null" >
+                ve_name = #{ve_name,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_uu != null" >
+                ve_uu = #{ve_uu,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_type != null" >
+                ve_type = #{ve_type,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_begindate != null" >
+                ve_begindate = #{ve_begindate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="ve_beginapamount != null" >
+                ve_beginapamount = #{ve_beginapamount,jdbcType=DECIMAL},
+            </if>
+            <if test="ve_beginprepayamount != null" >
+                ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DECIMAL},
+            </if>
+            <if test="ve_promisedays != null" >
+                ve_promisedays = #{ve_promisedays,jdbcType=DECIMAL},
+            </if>
+            <if test="ve_taxrate != null" >
+                ve_taxrate = #{ve_taxrate,jdbcType=DOUBLE},
+            </if>
+            <if test="ve_nsrzh != null" >
+                ve_nsrzh = #{ve_nsrzh,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_bankaccount != null" >
+                ve_bankaccount = #{ve_bankaccount,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_bankcode != null" >
+                ve_bankcode = #{ve_bankcode,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_status != null" >
+                ve_status = #{ve_status,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_statuscode != null" >
+                ve_statuscode = #{ve_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_recordid != null" >
+                ve_recordid = #{ve_recordid,jdbcType=DECIMAL},
+            </if>
+            <if test="ve_recordname != null" >
+                ve_recordname = #{ve_recordname,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_initdate != null" >
+                ve_initdate = #{ve_initdate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyId != null" >
+                companyId = #{companyId,jdbcType=DECIMAL},
+            </if>
+            <if test="updaterId != null" >
+                updaterId = #{updaterId,jdbcType=DECIMAL},
+            </if>
+            <if test="updateTime != null" >
+                updateTime = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="ve_text1 != null" >
+                ve_text1 = #{ve_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_text2 != null" >
+                ve_text2 = #{ve_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_text3 != null" >
+                ve_text3 = #{ve_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_text4 != null" >
+                ve_text4 = #{ve_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_text5 != null" >
+                ve_text5 = #{ve_text5,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_payamount != null" >
+                ve_payamount = #{ve_payamount,jdbcType=DOUBLE},
+            </if>
+            <if test="ve_leftamount != null" >
+                ve_leftamount = #{ve_leftamount,jdbcType=DOUBLE},
+            </if>
+            <if test="ve_beginym != null" >
+                ve_beginym = #{ve_beginym,jdbcType=INTEGER},
+            </if>
+        </set>
+        where ve_id = #{id}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Vendor" >
+        update vendor
+        set ve_code = #{ve_code,jdbcType=VARCHAR},
+        ve_name = #{ve_name,jdbcType=VARCHAR},
+        ve_uu = #{ve_uu,jdbcType=VARCHAR},
+        ve_type = #{ve_type,jdbcType=VARCHAR},
+        ve_begindate = #{ve_begindate,jdbcType=TIMESTAMP},
+        ve_beginapamount = #{ve_beginapamount,jdbcType=DECIMAL},
+        ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DECIMAL},
+        ve_promisedays = #{ve_promisedays,jdbcType=DECIMAL},
+        ve_taxrate = #{ve_taxrate,jdbcType=DOUBLE},
+        ve_nsrzh = #{ve_nsrzh,jdbcType=VARCHAR},
+        ve_bankaccount = #{ve_bankaccount,jdbcType=VARCHAR},
+        ve_bankcode = #{ve_bankcode,jdbcType=VARCHAR},
+        ve_status = #{ve_status,jdbcType=VARCHAR},
+        ve_statuscode = #{ve_statuscode,jdbcType=VARCHAR},
+        ve_recordid = #{ve_recordid,jdbcType=DECIMAL},
+        ve_recordname = #{ve_recordname,jdbcType=VARCHAR},
+        ve_initdate = #{ve_initdate,jdbcType=TIMESTAMP},
+        companyId = #{companyId,jdbcType=DECIMAL},
+        updaterId = #{updaterId,jdbcType=DECIMAL},
+        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},
+        ve_payamount = #{ve_payamount,jdbcType=DOUBLE},
+        ve_leftamount = #{ve_leftamount,jdbcType=DOUBLE},
+        ve_beginym = #{ve_beginym,jdbcType=INTEGER}
+        where ve_id = #{id}
+    </update>
+
+    <select id="validateCodeWhenInsert" resultType="int">
+        select count(*) from VENDOR where VE_CODE = #{code} and companyId =#{companyId}
+    </select>
+    <select id="validateCodeWhenUpdate" resultType="int" >
+        select count(*) from VENDOR where VE_CODE = #{code} and VE_ID != #{id} and companyId =#{companyId}
+    </select>
+    <select id="getCodeById" resultType="string">
+        SELECT VE_CODE FROM VENDOR WHERE VE_ID = #{id} and COMPANYID = #{companyId}
+    </select>
 </mapper>
 

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

@@ -21,7 +21,7 @@
   </resultMap>
   <sql id="Base_Column_List" >
     vc_id, vc_veid, vc_detno, vc_name, vc_tel, vc_qq, vc_email, companyId, updaterId, 
-    updateTime, vc_text1, vc_text2, vc_text3, vc_text4, vc_text5, ve_default
+    updateTime, vc_text1, vc_text2, vc_text3, vc_text4, vc_text5, vc_default
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
@@ -48,14 +48,14 @@
       vc_name, vc_tel, vc_qq, 
       vc_email, companyId, updaterId, 
       updateTime, vc_text1, vc_text2, 
-      vc_text3, vc_text4, vc_text5, ve_default
+      vc_text3, vc_text4, vc_text5, vc_default
       )
     values (#{vc_veid}, #{vc_detno,jdbcType=INTEGER},
       #{vc_name,jdbcType=VARCHAR}, #{vc_tel,jdbcType=INTEGER}, #{vc_qq,jdbcType=VARCHAR}, 
       #{vc_email,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
       #{updateTime,jdbcType=TIMESTAMP}, #{vc_text1,jdbcType=VARCHAR}, #{vc_text2,jdbcType=VARCHAR}, 
       #{vc_text3,jdbcType=VARCHAR}, #{vc_text4,jdbcType=VARCHAR}, #{vc_text5,jdbcType=VARCHAR},
-      #{ve_default,jdbcType=VARCHAR}
+      #{vc_default,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
@@ -103,8 +103,8 @@
       <if test="vc_text5 != null" >
         vc_text5,
       </if>
-      <if test="ve_default != null" >
-        ve_default,
+      <if test="vc_default != null" >
+        vc_default,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -150,8 +150,8 @@
       <if test="vc_text5 != null" >
         #{vc_text5,jdbcType=VARCHAR},
       </if>
-      <if test="ve_default != null" >
-        #{ve_default,jdbcType=VARCHAR},
+      <if test="vc_default != null" >
+        #{vc_default,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
@@ -200,8 +200,8 @@
       <if test="vc_text5 != null" >
         vc_text5 = #{vc_text5,jdbcType=VARCHAR},
       </if>
-      <if test="ve_default != null" >
-        ve_default = #{ve_default,jdbcType=VARCHAR},
+      <if test="vc_default != null" >
+        vc_default = #{vc_default,jdbcType=VARCHAR},
       </if>
     </set>
     where vc_id = #{id}
@@ -222,7 +222,7 @@
       vc_text3 = #{vc_text3,jdbcType=VARCHAR},
       vc_text4 = #{vc_text4,jdbcType=VARCHAR},
       vc_text5 = #{vc_text5,jdbcType=VARCHAR},
-      ve_default = #{ve_default,jdbcType=VARCHAR}
+      vc_default = #{vc_default,jdbcType=VARCHAR}
     where vc_id = #{id}
   </update>
   <insert id="batchInsert" parameterType="java.util.List">
@@ -271,11 +271,12 @@
         <if test="item.vc_text5 != null" >
           vc_text5,
         </if>
-        <if test="item.ve_default != null" >
-          ve_default,
+        <if test="item.vc_default != null" >
+          vc_default,
         </if>
       </trim>
-      <trim prefix="(" suffix=")" suffixOverrides=",">
+
+      <trim prefix="values(" suffix=")" suffixOverrides=",">
         <if test="item.vc_veid != null" >
           #{item.vc_veid},
         </if>
@@ -318,8 +319,8 @@
         <if test="item.vc_text5 != null" >
           #{item.vc_text5,jdbcType=VARCHAR},
         </if>
-        <if test="item.ve_default != null" >
-          #{item.ve_default,jdbcType=VARCHAR},
+        <if test="item.vc_default != null" >
+          #{item.vc_default,jdbcType=VARCHAR},
         </if>
       </trim>
     </foreach>
@@ -327,48 +328,50 @@
   <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>
+      <set>
+        <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.vc_default != null" >
+          vc_default = #{item.vc_default,jdbcType=VARCHAR},
+        </if>
+      </set>
       WHERE VC_ID= #{item.id,jdbcType=INTEGER}
     </foreach>
   </update>

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

@@ -122,4 +122,7 @@
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM VENDORKIND
   </select>
+  <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+    SELECT VK_NAME display, VK_NAME value FROM VENDORKIND WHERE COMPANYID=#{companyId}
+  </select>
 </mapper>

+ 9 - 30
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -100,7 +100,7 @@
         wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
         wh_text4, wh_text5
     </sql>
-    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="WarehouseResultMapper">
         select
         <include refid="Base_Column_List" />
         from warehouse
@@ -308,37 +308,16 @@
         wh_text5 = #{wh_text5,jdbcType=VARCHAR}
         where wh_id = #{wh_id,jdbcType=INTEGER}
     </update>
-    <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Warehouse">
-        <id column="wh_id" jdbcType="INTEGER" property="id" />
-        <result column="wh_code" jdbcType="VARCHAR" property="wh_code" />
-        <result column="wh_type" jdbcType="VARCHAR" property="wh_type" />
-        <result column="wh_description" jdbcType="VARCHAR" property="wh_description" />
-        <result column="wh_statuscode" jdbcType="VARCHAR" property="wh_statuscode" />
-        <result column="wh_status" jdbcType="VARCHAR" property="wh_status" />
-        <result column="wh_recorderid" jdbcType="VARCHAR" property="wh_recordid" />
-        <result column="wh_recorder" jdbcType="VARCHAR" property="wh_recorder" />
-        <result column="wh_date" jdbcType="TIMESTAMP" property="wh_date" />
-        <result column="companyid" jdbcType="INTEGER" property="companyId" />
-        <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
-        <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
-        <result column="wh_text1" jdbcType="VARCHAR" property="wh_text1" />
-        <result column="wh_text2" jdbcType="VARCHAR" property="wh_text2" />
-        <result column="wh_text3" jdbcType="VARCHAR" property="wh_text3" />
-        <result column="wh_text4" jdbcType="VARCHAR" property="wh_text4" />
-        <result column="wh_text5" jdbcType="VARCHAR" property="wh_text5" />
-    </resultMap>
 
-    <select id="selectCustomerListByCondition"  resultMap="BaseResultMap">
-        select  *  from Warehouse
-        <where>
-            <if test="con != null">
-                ${con}
-            </if>
-            <if test="companyId != null">
-                and   companyid = #{companyId}
-            </if>
-        </where>  order by wh_id
+    <select id="selectAll" resultType="com.usoftchina.saas.document.entities.Warehouse">
+        SELECT * FROM WAREHOUSE WHERE COMPANYID = #{companyId}
     </select>
 
+    <select id="validateCodeWhenInsert" resultType="int">
+        select count(*) from WAREHOUSE where WH_CODE = #{code} and companyId =#{companyId}
+    </select>
+    <select id="validateCodeWhenUpdate" resultType="int" >
+        select count(*) from WAREHOUSE where WH_CODE = #{code} and WH_ID != #{id} and companyId =#{companyId}
+    </select>
 </mapper>
 

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

@@ -11,7 +11,10 @@
 
     <artifactId>money-server</artifactId>
     <dependencies>
-
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>server-starter</artifactId>
+        </dependency>
         <!--test-->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 20 - 18
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthreceiptsController.java

@@ -2,6 +2,8 @@ package com.usoftchina.saas.money.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Othreceipts;
 import com.usoftchina.saas.money.po.Othte;
 import com.usoftchina.saas.money.service.OthreceiptsService;
@@ -21,8 +23,8 @@ public class OthreceiptsController {
 
     @RequestMapping("/save")
     public Result insert(@RequestBody Othte body) {
-        int id = othreceiptsService.insert(body);
-        return Result.success(id);
+        DocBaseDTO docBaseDTO = othreceiptsService.insert(body);
+        return Result.success(docBaseDTO);
     }
 
 
@@ -33,26 +35,26 @@ public class OthreceiptsController {
     }
 
 
-    @GetMapping("/read")
-    public Result getPaybalance(int id){
+    @GetMapping("/read/{id}")
+    public Result getPaybalance(@PathVariable("id")int id){
         return Result.success(othreceiptsService.select(id));
     }
 
-    @GetMapping("/List")
-    public Result getPaybalanceList(PageRequest page){
-        PageInfo<Othreceipts> list = othreceiptsService.selectList(page);
+    @GetMapping("/list")
+    public Result getPaybalanceList(PageRequest page, ListReqDTO condition){
+        PageInfo<Othreceipts> list = othreceiptsService.selectList(page, condition);
         return Result.success(list);
     }
 
-    @RequestMapping("/audit")
-    public Result audit(@RequestBody Othte body){
-        othreceiptsService.audit(body);
-        return Result.success();
-    }
-
-    @PostMapping("/unAudit")
-    public Result unAudit(@RequestBody int id){
-        othreceiptsService.unAudit(id);
-        return Result.success();
-    }
+//    @RequestMapping("/audit")
+//    public Result audit(@RequestBody Othte body){
+//        othreceiptsService.audit(body);
+//        return Result.success();
+//    }
+//
+//    @PostMapping("/unAudit")
+//    public Result unAudit(@RequestBody int id){
+//        othreceiptsService.unAudit(id);
+//        return Result.success();
+//    }
 }

+ 21 - 19
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/OthspengdingsController.java

@@ -2,6 +2,8 @@ package com.usoftchina.saas.money.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Othreceipts;
 import com.usoftchina.saas.money.po.Othsp;
 import com.usoftchina.saas.money.po.Othspendings;
@@ -24,8 +26,8 @@ public class OthspengdingsController {
 
     @RequestMapping("/save")
     public Result insert(@RequestBody Othsp body) {
-        int id = othspendingsService.insert(body);
-        return Result.success(id);
+        DocBaseDTO docBaseDTO = othspendingsService.insert(body);
+        return Result.success(docBaseDTO);
     }
 
 
@@ -35,32 +37,32 @@ public class OthspengdingsController {
         return Result.success();
     }
 
-    @PostMapping("/deleteItem/")
+    @PostMapping("/deleteItem")
     public Result deleteItem(@RequestBody int id){
         othspendingsService.deleteItem(id);
         return Result.success();
     }
 
-    @GetMapping("/read")
-    public Result getPaybalance(int id){
+    @GetMapping("/read/{id}")
+    public Result getPaybalance(@PathVariable("id")int id){
         return Result.success(othspendingsService.select(id));
     }
 
-    @GetMapping("/List")
-    public Result getPaybalanceList(PageRequest page){
-        PageInfo<Othspendings> list = othspendingsService.selectList(page);
+    @GetMapping("/list")
+    public Result getPaybalanceList(PageRequest page, ListReqDTO condition){
+        PageInfo<Othspendings> list = othspendingsService.selectList(page, condition);
         return Result.success(list);
     }
 
-    @RequestMapping("/audit")
-    public Result audit(@RequestBody Othsp body){
-        othspendingsService.audit(body);
-        return Result.success();
-    }
-
-    @PostMapping("/unAudit")
-    public Result unAudit(@RequestBody int id){
-        othspendingsService.unAudit(id);
-        return Result.success();
-    }
+//    @RequestMapping("/audit")
+//    public Result audit(@RequestBody Othsp body){
+//        othspendingsService.audit(body);
+//        return Result.success();
+//    }
+//
+//    @PostMapping("/unAudit")
+//    public Result unAudit(@RequestBody int id){
+//        othspendingsService.unAudit(id);
+//        return Result.success();
+//    }
 }

+ 11 - 10
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java

@@ -1,8 +1,9 @@
 package com.usoftchina.saas.money.controller;
 
-import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Pay;
 import com.usoftchina.saas.money.po.Paybalance;
 import com.usoftchina.saas.money.service.PaybalanceService;
@@ -15,15 +16,15 @@ import org.springframework.web.bind.annotation.*;
  * @date 2018/10/22 15:03
  **/
 @RestController
-@RequestMapping("/money/Paybalance")
+@RequestMapping("/money/paybalance")
 public class PaybalanceController {
     @Autowired
     private PaybalanceService paybalanceService;
 
     @RequestMapping("/save")
-    public Result insert(@RequestBody Pay body) {
-        int id = paybalanceService.insert(body);
-        return Result.success(id);
+    public Result saveFormData(@RequestBody Pay body) {
+        DocBaseDTO docBaseDTO = paybalanceService.insert(body);
+        return Result.success(docBaseDTO);
     }
 
 
@@ -39,14 +40,14 @@ public class PaybalanceController {
         return Result.success();
     }
 
-    @GetMapping("/read")
-    public Result getPaybalance(int id){
+    @GetMapping("/read/{id}")
+    public Result getPaybalance(@PathVariable("id")int id){
         return Result.success(paybalanceService.select(id));
     }
 
-    @GetMapping("/List")
-    public Result getPaybalanceList(PageRequest page){
-        PageInfo<Paybalance> list = paybalanceService.selectList(page);
+    @GetMapping("/list")
+    public Result getPaybalanceList(PageRequest page, ListReqDTO condition){
+        PageInfo<Paybalance> list = paybalanceService.selectList(page, condition);
         return Result.success(list);
     }
 

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

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.money.controller;
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Rec;
 import com.usoftchina.saas.money.service.RecbalanceService;
 import com.usoftchina.saas.page.PageRequest;
@@ -18,9 +20,9 @@ public class RecbalanceContorller {
     private RecbalanceService recbalanceService;
 
     @RequestMapping("/save")
-    public Result insert(@RequestBody Rec body){
-        recbalanceService.insert(body);
-        return Result.success();
+    public Result saveFormData(@RequestBody Rec body){
+        DocBaseDTO docBaseDTO = recbalanceService.insert(body);
+        return Result.success(docBaseDTO);
     }
 
     @PostMapping("/delete")
@@ -29,20 +31,26 @@ public class RecbalanceContorller {
         return Result.success();
     }
 
-    @PostMapping("/deleteItem/")
+    @PostMapping("/deleteItems1")
     public Result deleteItem(@RequestBody int id){
         recbalanceService.deleteItem(id);
         return Result.success();
     }
 
+    @PostMapping("/deleteItems2")
+    public Result deleteItems(@RequestBody int id){
+        recbalanceService.deleteItems(id);
+        return Result.success();
+    }
+
     @GetMapping("/read/{id}")
-    public Result selectRecbalance(@PathVariable int id){
+    public Result getFormData(@PathVariable("id")int id){
         return Result.success(recbalanceService.select(id));
     }
 
     @GetMapping("/list")
-    public Result selectRecbalanceList(PageRequest page){
-        return Result.success(recbalanceService.selectList(page));
+    public Result getListData(PageRequest page, ListReqDTO condition){
+        return Result.success(recbalanceService.selectList(page, condition));
     }
 
     @RequestMapping("/audit")
@@ -52,7 +60,7 @@ public class RecbalanceContorller {
     }
 
     @PostMapping("/unAudit")
-    public Result unAudit(@RequestBody int id){
+    public Result unAudit(@RequestBody Long id){
         recbalanceService.unAudit(id);
         return Result.success();
     }

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java

@@ -19,7 +19,7 @@ public interface BanksubledgerMapper extends CommonBaseMapper<Banksubledger> {
 
     int deleteByPrimaryKey(Integer bl_id);
 
-    int insert(Banksubledger record);
+    Long insert(Banksubledger record);
 
     int insertSelective(Banksubledger record);
 

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

@@ -1,7 +1,9 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.money.po.Othreceipts;
+import com.usoftchina.saas.money.po.Recbalance;
 import com.usoftchina.saas.page.PageRequest;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -18,4 +20,12 @@ public interface OthreceiptsMapper {
     int updateByPrimaryKeySelective(Othreceipts record);
 
     int updateByPrimaryKey(Othreceipts record);
+
+    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id,
+                                   @Param("companyId") Long companyId);
+
+    List<Othreceipts> selectOthreceiptsBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+    List<Othreceipts> selectOthreceiptsListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 3 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthreceiptsdetailMapper.java

@@ -2,6 +2,8 @@ package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.money.po.Othreceiptsdetail;
 
+import java.util.List;
+
 public interface OthreceiptsdetailMapper {
     int deleteByPrimaryKey(Integer ordId);
     int deleteItem(int id);
@@ -10,7 +12,7 @@ public interface OthreceiptsdetailMapper {
 
     int insertSelective(Othreceiptsdetail record);
 
-    Othreceiptsdetail selectByPrimaryKey(Integer ordId);
+    List<Othreceiptsdetail> selectByPrimaryKey(Integer ordId);
 
     int updateByPrimaryKeySelective(Othreceiptsdetail record);
 

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

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.money.mapper;
 
+import com.usoftchina.saas.money.po.Othreceipts;
 import com.usoftchina.saas.money.po.Othspendings;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -18,4 +20,12 @@ public interface OthspendingsMapper {
     int updateByPrimaryKeySelective(Othspendings record);
 
     int updateByPrimaryKey(Othspendings record);
+
+    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id,
+                                   @Param("companyId") Long companyId);
+
+    List<Othspendings> selectOthspendingsBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+    List<Othspendings> selectOthspendingsListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 3 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/OthspendingsdetailMapper.java

@@ -2,6 +2,8 @@ package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.money.po.Othspendingsdetail;
 
+import java.util.List;
+
 public interface OthspendingsdetailMapper {
     int deleteByPrimaryKey(Integer osdId);
     int deleteItem(int id);
@@ -10,7 +12,7 @@ public interface OthspendingsdetailMapper {
 
     int insertSelective(Othspendingsdetail record);
 
-    Othspendingsdetail selectByPrimaryKey(Integer osdId);
+    List<Othspendingsdetail> selectByPrimaryKey(Integer osdId);
 
     int updateByPrimaryKeySelective(Othspendingsdetail record);
 

+ 10 - 4
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalanceMapper.java

@@ -2,24 +2,30 @@ package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.money.po.Paybalance;
+import com.usoftchina.saas.money.po.Recbalance;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
-import org.apache.ibatis.annotations.Param;
-
 public interface PaybalanceMapper extends CommonBaseMapper<Paybalance> {
 
     int deleteByPrimaryKey(Integer pb_id);
 
-    int insert(Paybalance record);
+    Long insert(Paybalance record);
 
     int insertSelective(Paybalance record);
 
-    List<Paybalance> selectList();
+    List<Paybalance> selectPaybalanceBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+    List<Paybalance> selectPaybalanceListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
 
     Paybalance selectByPrimaryKey(Integer pb_id);
 
     int updateByPrimaryKeySelective(Paybalance record);
 
     int updateByPrimaryKey(Paybalance record);
+
+    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id,
+                                   @Param("companyId") Long companyId);
 }

+ 3 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalancedetMapper.java

@@ -1,11 +1,12 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.money.po.Paybalancedet;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 public interface PaybalancedetMapper {
-    int deleteByPrimaryKey(Integer pdId);
+    int deleteByPrimaryKey(Integer id);
 
     int deleteItem(int id);
 
@@ -18,4 +19,5 @@ public interface PaybalancedetMapper {
     int updateByPrimaryKeySelective(List<Paybalancedet> record);
 
     int updateByPrimaryKey(Paybalancedet record);
+
 }

+ 9 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalanceMapper.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Recbalance;
 
 import java.util.List;
@@ -20,11 +21,12 @@ public interface RecbalanceMapper extends CommonBaseMapper<Recbalance> {
 
     int deleteByPrimaryKey(Integer rb_id);
 
-    int insert(Recbalance record);
+    Long insert(Recbalance record);
 
     int insertSelective(Recbalance record);
 
-    List<Recbalance> selectList();
+    List<Recbalance> selectRecbalanceBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+    List<Recbalance> selectRecbalanceListByCondition(@Param("con") String con, @Param("companyId") Long companyId);
 
     Recbalance selectByPrimaryKey(Integer rb_id);
 
@@ -35,4 +37,9 @@ public interface RecbalanceMapper extends CommonBaseMapper<Recbalance> {
     int updateByPrimaryKeySelective(Recbalance record);
 
     int updateByPrimaryKey(Recbalance record);
+
+    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id,
+                                   @Param("companyId") Long companyId);
 }

+ 1 - 8
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalancedetMapper.java

@@ -9,7 +9,6 @@ import com.usoftchina.saas.money.po.RecbalancedetExample;
 import org.apache.ibatis.annotations.Param;
 
 public interface RecbalancedetMapper extends CommonBaseMapper<Recbalancedet> {
-    int countByExample(RecbalancedetExample example);
 
     int deleteItem(int id);
 
@@ -19,13 +18,7 @@ public interface RecbalancedetMapper extends CommonBaseMapper<Recbalancedet> {
 
     int insertSelective(Recbalancedet record);
 
-    List<Recbalancedet> selectByExample(RecbalancedetExample example);
-
-    Recbalancedet selectByPrimaryKey(Integer rd_id);
-
-    int updateByExampleSelective(@Param("record") Recbalancedet record, @Param("example") RecbalancedetExample example);
-
-    int updateByExample(@Param("record") Recbalancedet record, @Param("example") RecbalancedetExample example);
+    List<Recbalancedet> selectByPrimaryKey(Integer rd_id);
 
     int updateByPrimaryKeySelective(Recbalancedet record);
 

+ 2 - 3
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalancedetailMapper.java

@@ -5,16 +5,15 @@ import com.usoftchina.saas.money.po.Recbalancedetail;
 import java.util.List;
 
 public interface RecbalancedetailMapper {
-    int deleteByPrimaryKey(Integer rbdId);
     int deleteItem(Integer rbdId);
 
     int insert(List<Recbalancedetail> record);
 
     int insertSelective(Recbalancedetail record);
 
-    Recbalancedetail selectByPrimaryKey(Integer rbdId);
+    List<Recbalancedetail> selectByPrimaryKey(Integer rbdId);
 
     int updateByPrimaryKeySelective(Recbalancedetail record);
+    void deleteByPrimaryKey(Integer id);
 
-    int updateByPrimaryKey(Recbalancedetail record);
 }

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationMapper.java

@@ -17,7 +17,7 @@ public interface VerificationMapper extends CommonBaseMapper<Verification> {
 
     int deleteByPrimaryKey(Integer vc_id);
 
-    int insert(Verification record);
+    Long insert(Verification record);
 
     int insertSelective(Verification record);
 

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationdetMapper.java

@@ -17,7 +17,7 @@ public interface VerificationdetMapper extends CommonBaseMapper<Verificationdet>
 
     int deleteByPrimaryKey(Integer vd_id);
 
-    int insert(Verificationdet record);
+    Long insert(Verificationdet record);
 
     int insertSelective(Verificationdet record);
 

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

@@ -1,7 +1,6 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
-import com.usoftchina.saas.money.po.Verificationdet;
 import com.usoftchina.saas.money.po.Verificationdetail;
 import java.util.List;
 
@@ -19,7 +18,7 @@ public interface VerificationdetailMapper extends CommonBaseMapper<Verificationd
 
     int deleteByPrimaryKey(Integer vcd_id);
 
-    int insert(Verificationdetail record);
+    Long insert(Verificationdetail record);
 
     int insertSelective(Verificationdetail record);
 

+ 104 - 130
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othreceipts.java

@@ -1,198 +1,172 @@
 package com.usoftchina.saas.money.po;
 
-import java.util.Date;
-
-public class Othreceipts {
-    private Integer orId;
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
 
-    private String orCode;
+import java.io.Serializable;
+import java.util.Date;
 
-    private Date orDate;
+public class Othreceipts extends CommonBaseEntity implements Serializable {
 
-    private Integer orCustid;
+    private String or_code;
 
-    private String orCustcode;
+    private Date or_date;
 
-    private String orCustname;
+    private Integer or_custid;
 
-    private String orBankcode;
+    private String or_custcode;
 
-    private Integer orBankid;
+    private String or_custname;
 
-    private String orBankname;
+    private String or_bankcode;
 
-    private Double orAmount;
+    private Integer or_bankid;
 
-    private Integer orRecorderid;
+    private String or_bankname;
 
-    private String orRecorder;
+    private Double or_amount;
 
-    private Date orRecorddate;
+    private Integer or_recorderid;
 
-    private String orStatus;
+    private String or_recorder;
 
-    private String orStatuscode;
+    private Date or_recorddate;
 
-    private String orRemark;
+    private String or_status;
 
-    private Integer companyid;
+    private String or_statuscode;
 
-    private Integer updaterid;
+    private String or_remark;
 
     private Date updatedate;
 
-    private String orText1;
-
-    private String orText2;
+    private String or_text1;
 
-    private String orText3;
+    private String or_text2;
 
-    private String orText4;
+    private String or_text3;
 
-    private String orText5;
-
-    public Integer getOrId() {
-        return orId;
-    }
-
-    public void setOrId(Integer orId) {
-        this.orId = orId;
-    }
+    private String or_text4;
 
-    public String getOrCode() {
-        return orCode;
-    }
-
-    public void setOrCode(String orCode) {
-        this.orCode = orCode == null ? null : orCode.trim();
-    }
-
-    public Date getOrDate() {
-        return orDate;
-    }
-
-    public void setOrDate(Date orDate) {
-        this.orDate = orDate;
-    }
+    private String or_text5;
 
-    public Integer getOrCustid() {
-        return orCustid;
+    public String getOr_code() {
+        return or_code;
     }
 
-    public void setOrCustid(Integer orCustid) {
-        this.orCustid = orCustid;
+    public void setOr_code(String or_code) {
+        this.or_code = or_code;
     }
 
-    public String getOrCustcode() {
-        return orCustcode;
+    public Date getOr_date() {
+        return or_date;
     }
 
-    public void setOrCustcode(String orCustcode) {
-        this.orCustcode = orCustcode == null ? null : orCustcode.trim();
+    public void setOr_date(Date or_date) {
+        this.or_date = or_date;
     }
 
-    public String getOrCustname() {
-        return orCustname;
+    public Integer getOr_custid() {
+        return or_custid;
     }
 
-    public void setOrCustname(String orCustname) {
-        this.orCustname = orCustname == null ? null : orCustname.trim();
+    public void setOr_custid(Integer or_custid) {
+        this.or_custid = or_custid;
     }
 
-    public String getOrBankcode() {
-        return orBankcode;
+    public String getOr_custcode() {
+        return or_custcode;
     }
 
-    public void setOrBankcode(String orBankcode) {
-        this.orBankcode = orBankcode == null ? null : orBankcode.trim();
+    public void setOr_custcode(String or_custcode) {
+        this.or_custcode = or_custcode;
     }
 
-    public Integer getOrBankid() {
-        return orBankid;
+    public String getOr_custname() {
+        return or_custname;
     }
 
-    public void setOrBankid(Integer orBankid) {
-        this.orBankid = orBankid;
+    public void setOr_custname(String or_custname) {
+        this.or_custname = or_custname;
     }
 
-    public String getOrBankname() {
-        return orBankname;
+    public String getOr_bankcode() {
+        return or_bankcode;
     }
 
-    public void setOrBankname(String orBankname) {
-        this.orBankname = orBankname == null ? null : orBankname.trim();
+    public void setOr_bankcode(String or_bankcode) {
+        this.or_bankcode = or_bankcode;
     }
 
-    public Double getOrAmount() {
-        return orAmount;
+    public Integer getOr_bankid() {
+        return or_bankid;
     }
 
-    public void setOrAmount(Double orAmount) {
-        this.orAmount = orAmount;
+    public void setOr_bankid(Integer or_bankid) {
+        this.or_bankid = or_bankid;
     }
 
-    public Integer getOrRecorderid() {
-        return orRecorderid;
+    public String getOr_bankname() {
+        return or_bankname;
     }
 
-    public void setOrRecorderid(Integer orRecorderid) {
-        this.orRecorderid = orRecorderid;
+    public void setOr_bankname(String or_bankname) {
+        this.or_bankname = or_bankname;
     }
 
-    public String getOrRecorder() {
-        return orRecorder;
+    public Double getOr_amount() {
+        return or_amount;
     }
 
-    public void setOrRecorder(String orRecorder) {
-        this.orRecorder = orRecorder == null ? null : orRecorder.trim();
+    public void setOr_amount(Double or_amount) {
+        this.or_amount = or_amount;
     }
 
-    public Date getOrRecorddate() {
-        return orRecorddate;
+    public Integer getOr_recorderid() {
+        return or_recorderid;
     }
 
-    public void setOrRecorddate(Date orRecorddate) {
-        this.orRecorddate = orRecorddate;
+    public void setOr_recorderid(Integer or_recorderid) {
+        this.or_recorderid = or_recorderid;
     }
 
-    public String getOrStatus() {
-        return orStatus;
+    public String getOr_recorder() {
+        return or_recorder;
     }
 
-    public void setOrStatus(String orStatus) {
-        this.orStatus = orStatus;
+    public void setOr_recorder(String or_recorder) {
+        this.or_recorder = or_recorder;
     }
 
-    public String getOrStatuscode() {
-        return orStatuscode;
+    public Date getOr_recorddate() {
+        return or_recorddate;
     }
 
-    public void setOrStatuscode(String orStatuscode) {
-        this.orStatuscode = orStatuscode;
+    public void setOr_recorddate(Date or_recorddate) {
+        this.or_recorddate = or_recorddate;
     }
 
-    public String getOrRemark() {
-        return orRemark;
+    public String getOr_status() {
+        return or_status;
     }
 
-    public void setOrRemark(String orRemark) {
-        this.orRemark = orRemark == null ? null : orRemark.trim();
+    public void setOr_status(String or_status) {
+        this.or_status = or_status;
     }
 
-    public Integer getCompanyid() {
-        return companyid;
+    public String getOr_statuscode() {
+        return or_statuscode;
     }
 
-    public void setCompanyid(Integer companyid) {
-        this.companyid = companyid;
+    public void setOr_statuscode(String or_statuscode) {
+        this.or_statuscode = or_statuscode;
     }
 
-    public Integer getUpdaterid() {
-        return updaterid;
+    public String getOr_remark() {
+        return or_remark;
     }
 
-    public void setUpdaterid(Integer updaterid) {
-        this.updaterid = updaterid;
+    public void setOr_remark(String or_remark) {
+        this.or_remark = or_remark;
     }
 
     public Date getUpdatedate() {
@@ -203,43 +177,43 @@ public class Othreceipts {
         this.updatedate = updatedate;
     }
 
-    public String getOrText1() {
-        return orText1;
+    public String getOr_text1() {
+        return or_text1;
     }
 
-    public void setOrText1(String orText1) {
-        this.orText1 = orText1 == null ? null : orText1.trim();
+    public void setOr_text1(String or_text1) {
+        this.or_text1 = or_text1;
     }
 
-    public String getOrText2() {
-        return orText2;
+    public String getOr_text2() {
+        return or_text2;
     }
 
-    public void setOrText2(String orText2) {
-        this.orText2 = orText2 == null ? null : orText2.trim();
+    public void setOr_text2(String or_text2) {
+        this.or_text2 = or_text2;
     }
 
-    public String getOrText3() {
-        return orText3;
+    public String getOr_text3() {
+        return or_text3;
     }
 
-    public void setOrText3(String orText3) {
-        this.orText3 = orText3 == null ? null : orText3.trim();
+    public void setOr_text3(String or_text3) {
+        this.or_text3 = or_text3;
     }
 
-    public String getOrText4() {
-        return orText4;
+    public String getOr_text4() {
+        return or_text4;
     }
 
-    public void setOrText4(String orText4) {
-        this.orText4 = orText4 == null ? null : orText4.trim();
+    public void setOr_text4(String or_text4) {
+        this.or_text4 = or_text4;
     }
 
-    public String getOrText5() {
-        return orText5;
+    public String getOr_text5() {
+        return or_text5;
     }
 
-    public void setOrText5(String orText5) {
-        this.orText5 = orText5 == null ? null : orText5.trim();
+    public void setOr_text5(String or_text5) {
+        this.or_text5 = or_text5;
     }
 }

+ 59 - 85
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othreceiptsdetail.java

@@ -1,108 +1,82 @@
 package com.usoftchina.saas.money.po;
 
-import java.util.Date;
-
-public class Othreceiptsdetail {
-    private Integer ordId;
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
 
-    private Integer ordOrid;
+import java.io.Serializable;
+import java.util.Date;
 
-    private Integer ordDetno;
+public class Othreceiptsdetail extends CommonBaseEntity implements Serializable {
 
-    private Integer ordYm;
+    private Integer ord_orid;
 
-    private String ordType;
+    private Integer ord_detno;
 
-    private Double ordNowbalance;
+    private Integer ord_ym;
 
-    private String ordRemark;
+    private String ord_type;
 
-    private Integer companyid;
+    private Double ord_nowbalance;
 
-    private Integer updaterid;
+    private String ord_remark;
 
     private Date updatedate;
 
-    private String ordText1;
-
-    private String ordText2;
+    private String ord_text1;
 
-    private String ordText3;
+    private String ord_text2;
 
-    private String ordText4;
+    private String ord_text3;
 
-    private String ordText5;
-
-    public Integer getOrdId() {
-        return ordId;
-    }
-
-    public void setOrdId(Integer ordId) {
-        this.ordId = ordId;
-    }
+    private String ord_text4;
 
-    public Integer getOrdOrid() {
-        return ordOrid;
-    }
-
-    public void setOrdOrid(Integer ordOrid) {
-        this.ordOrid = ordOrid;
-    }
-
-    public Integer getOrdDetno() {
-        return ordDetno;
-    }
-
-    public void setOrdDetno(Integer ordDetno) {
-        this.ordDetno = ordDetno;
-    }
+    private String ord_text5;
 
-    public Integer getOrdYm() {
-        return ordYm;
+    public Integer getOrd_orid() {
+        return ord_orid;
     }
 
-    public void setOrdYm(Integer ordYm) {
-        this.ordYm = ordYm;
+    public void setOrd_orid(Integer ord_orid) {
+        this.ord_orid = ord_orid;
     }
 
-    public String getOrdType() {
-        return ordType;
+    public Integer getOrd_detno() {
+        return ord_detno;
     }
 
-    public void setOrdType(String ordType) {
-        this.ordType = ordType == null ? null : ordType.trim();
+    public void setOrd_detno(Integer ord_detno) {
+        this.ord_detno = ord_detno;
     }
 
-    public Double getOrdNowbalance() {
-        return ordNowbalance;
+    public Integer getOrd_ym() {
+        return ord_ym;
     }
 
-    public void setOrdNowbalance(Double ordNowbalance) {
-        this.ordNowbalance = ordNowbalance;
+    public void setOrd_ym(Integer ord_ym) {
+        this.ord_ym = ord_ym;
     }
 
-    public String getOrdRemark() {
-        return ordRemark;
+    public String getOrd_type() {
+        return ord_type;
     }
 
-    public void setOrdRemark(String ordRemark) {
-        this.ordRemark = ordRemark == null ? null : ordRemark.trim();
+    public void setOrd_type(String ord_type) {
+        this.ord_type = ord_type;
     }
 
-    public Integer getCompanyid() {
-        return companyid;
+    public Double getOrd_nowbalance() {
+        return ord_nowbalance;
     }
 
-    public void setCompanyid(Integer companyid) {
-        this.companyid = companyid;
+    public void setOrd_nowbalance(Double ord_nowbalance) {
+        this.ord_nowbalance = ord_nowbalance;
     }
 
-    public Integer getUpdaterid() {
-        return updaterid;
+    public String getOrd_remark() {
+        return ord_remark;
     }
 
-    public void setUpdaterid(Integer updaterid) {
-        this.updaterid = updaterid;
+    public void setOrd_remark(String ord_remark) {
+        this.ord_remark = ord_remark;
     }
 
     public Date getUpdatedate() {
@@ -113,43 +87,43 @@ public class Othreceiptsdetail {
         this.updatedate = updatedate;
     }
 
-    public String getOrdText1() {
-        return ordText1;
+    public String getOrd_text1() {
+        return ord_text1;
     }
 
-    public void setOrdText1(String ordText1) {
-        this.ordText1 = ordText1 == null ? null : ordText1.trim();
+    public void setOrd_text1(String ord_text1) {
+        this.ord_text1 = ord_text1;
     }
 
-    public String getOrdText2() {
-        return ordText2;
+    public String getOrd_text2() {
+        return ord_text2;
     }
 
-    public void setOrdText2(String ordText2) {
-        this.ordText2 = ordText2 == null ? null : ordText2.trim();
+    public void setOrd_text2(String ord_text2) {
+        this.ord_text2 = ord_text2;
     }
 
-    public String getOrdText3() {
-        return ordText3;
+    public String getOrd_text3() {
+        return ord_text3;
     }
 
-    public void setOrdText3(String ordText3) {
-        this.ordText3 = ordText3 == null ? null : ordText3.trim();
+    public void setOrd_text3(String ord_text3) {
+        this.ord_text3 = ord_text3;
     }
 
-    public String getOrdText4() {
-        return ordText4;
+    public String getOrd_text4() {
+        return ord_text4;
     }
 
-    public void setOrdText4(String ordText4) {
-        this.ordText4 = ordText4 == null ? null : ordText4.trim();
+    public void setOrd_text4(String ord_text4) {
+        this.ord_text4 = ord_text4;
     }
 
-    public String getOrdText5() {
-        return ordText5;
+    public String getOrd_text5() {
+        return ord_text5;
     }
 
-    public void setOrdText5(String ordText5) {
-        this.ordText5 = ordText5 == null ? null : ordText5.trim();
+    public void setOrd_text5(String ord_text5) {
+        this.ord_text5 = ord_text5;
     }
 }

+ 104 - 129
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendings.java

@@ -1,198 +1,173 @@
 package com.usoftchina.saas.money.po;
 
-import java.util.Date;
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
 
-public class Othspendings {
-    private Integer osId;
+import java.io.Serializable;
+import java.util.Date;
 
-    private String osCode;
+public class Othspendings extends CommonBaseEntity implements Serializable {
 
-    private Date osDate;
+    private String os_code;
 
-    private Integer osVendid;
+    private Date os_date;
 
-    private String osVendcode;
+    private Integer os_vendid;
 
-    private String osVendname;
+    private String os_vendcode;
 
-    private Integer osBankid;
+    private String os_vendname;
 
-    private String osBankcode;
+    private Integer os_bankid;
 
-    private String osBankname;
+    private String os_bankcode;
 
-    private Double osAmount;
+    private String os_bankname;
 
-    private Integer osRecorderid;
+    private Double os_amount;
 
-    private String osRecorder;
+    private Integer os_recorderid;
 
-    private Date osRecorddate;
+    private String os_recorder;
 
-    private String osStatus;
+    private Date os_recorddate;
 
-    private String osStatuscode;
+    private String os_status;
 
-    private String osRemark;
+    private String os_statuscode;
 
-    private Integer companyid;
+    private String os_remark;
 
-    private Integer updaterid;
 
     private Date updatedate;
 
-    private String osText1;
-
-    private String osText2;
-
-    private String osText3;
-
-    private String osText4;
-
-    private String osText5;
-
-    public Integer getOsId() {
-        return osId;
-    }
+    private String os_text1;
 
-    public void setOsId(Integer osId) {
-        this.osId = osId;
-    }
+    private String os_text2;
 
-    public String getOsCode() {
-        return osCode;
-    }
+    private String os_text3;
 
-    public void setOsCode(String osCode) {
-        this.osCode = osCode == null ? null : osCode.trim();
-    }
+    private String os_text4;
 
-    public Date getOsDate() {
-        return osDate;
-    }
-
-    public void setOsDate(Date osDate) {
-        this.osDate = osDate;
-    }
+    private String os_text5;
 
-    public Integer getOsVendid() {
-        return osVendid;
+    public String getOs_code() {
+        return os_code;
     }
 
-    public void setOsVendid(Integer osVendid) {
-        this.osVendid = osVendid;
+    public void setOs_code(String os_code) {
+        this.os_code = os_code;
     }
 
-    public String getOsVendcode() {
-        return osVendcode;
+    public Date getOs_date() {
+        return os_date;
     }
 
-    public void setOsVendcode(String osVendcode) {
-        this.osVendcode = osVendcode == null ? null : osVendcode.trim();
+    public void setOs_date(Date os_date) {
+        this.os_date = os_date;
     }
 
-    public String getOsVendname() {
-        return osVendname;
+    public Integer getOs_vendid() {
+        return os_vendid;
     }
 
-    public void setOsVendname(String osVendname) {
-        this.osVendname = osVendname == null ? null : osVendname.trim();
+    public void setOs_vendid(Integer os_vendid) {
+        this.os_vendid = os_vendid;
     }
 
-    public Integer getOsBankid() {
-        return osBankid;
+    public String getOs_vendcode() {
+        return os_vendcode;
     }
 
-    public void setOsBankid(Integer osBankid) {
-        this.osBankid = osBankid;
+    public void setOs_vendcode(String os_vendcode) {
+        this.os_vendcode = os_vendcode;
     }
 
-    public String getOsBankcode() {
-        return osBankcode;
+    public String getOs_vendname() {
+        return os_vendname;
     }
 
-    public void setOsBankcode(String osBankcode) {
-        this.osBankcode = osBankcode == null ? null : osBankcode.trim();
+    public void setOs_vendname(String os_vendname) {
+        this.os_vendname = os_vendname;
     }
 
-    public String getOsBankname() {
-        return osBankname;
+    public Integer getOs_bankid() {
+        return os_bankid;
     }
 
-    public void setOsBankname(String osBankname) {
-        this.osBankname = osBankname == null ? null : osBankname.trim();
+    public void setOs_bankid(Integer os_bankid) {
+        this.os_bankid = os_bankid;
     }
 
-    public Double getOsAmount() {
-        return osAmount;
+    public String getOs_bankcode() {
+        return os_bankcode;
     }
 
-    public void setOsAmount(Double osAmount) {
-        this.osAmount = osAmount;
+    public void setOs_bankcode(String os_bankcode) {
+        this.os_bankcode = os_bankcode;
     }
 
-    public Integer getOsRecorderid() {
-        return osRecorderid;
+    public String getOs_bankname() {
+        return os_bankname;
     }
 
-    public void setOsRecorderid(Integer osRecorderid) {
-        this.osRecorderid = osRecorderid;
+    public void setOs_bankname(String os_bankname) {
+        this.os_bankname = os_bankname;
     }
 
-    public String getOsRecorder() {
-        return osRecorder;
+    public Double getOs_amount() {
+        return os_amount;
     }
 
-    public void setOsRecorder(String osRecorder) {
-        this.osRecorder = osRecorder == null ? null : osRecorder.trim();
+    public void setOs_amount(Double os_amount) {
+        this.os_amount = os_amount;
     }
 
-    public Date getOsRecorddate() {
-        return osRecorddate;
+    public Integer getOs_recorderid() {
+        return os_recorderid;
     }
 
-    public void setOsRecorddate(Date osRecorddate) {
-        this.osRecorddate = osRecorddate;
+    public void setOs_recorderid(Integer os_recorderid) {
+        this.os_recorderid = os_recorderid;
     }
 
-    public String getOsStatus() {
-        return osStatus;
+    public String getOs_recorder() {
+        return os_recorder;
     }
 
-    public void setOsStatus(String osStatus) {
-        this.osStatus = osStatus;
+    public void setOs_recorder(String os_recorder) {
+        this.os_recorder = os_recorder;
     }
 
-    public String getOsStatuscode() {
-        return osStatuscode;
+    public Date getOs_recorddate() {
+        return os_recorddate;
     }
 
-    public void setOsStatuscode(String osStatuscode) {
-        this.osStatuscode = osStatuscode;
+    public void setOs_recorddate(Date os_recorddate) {
+        this.os_recorddate = os_recorddate;
     }
 
-    public String getOsRemark() {
-        return osRemark;
+    public String getOs_status() {
+        return os_status;
     }
 
-    public void setOsRemark(String osRemark) {
-        this.osRemark = osRemark == null ? null : osRemark.trim();
+    public void setOs_status(String os_status) {
+        this.os_status = os_status;
     }
 
-    public Integer getCompanyid() {
-        return companyid;
+    public String getOs_statuscode() {
+        return os_statuscode;
     }
 
-    public void setCompanyid(Integer companyid) {
-        this.companyid = companyid;
+    public void setOs_statuscode(String os_statuscode) {
+        this.os_statuscode = os_statuscode;
     }
 
-    public Integer getUpdaterid() {
-        return updaterid;
+    public String getOs_remark() {
+        return os_remark;
     }
 
-    public void setUpdaterid(Integer updaterid) {
-        this.updaterid = updaterid;
+    public void setOs_remark(String os_remark) {
+        this.os_remark = os_remark;
     }
 
     public Date getUpdatedate() {
@@ -203,43 +178,43 @@ public class Othspendings {
         this.updatedate = updatedate;
     }
 
-    public String getOsText1() {
-        return osText1;
+    public String getOs_text1() {
+        return os_text1;
     }
 
-    public void setOsText1(String osText1) {
-        this.osText1 = osText1 == null ? null : osText1.trim();
+    public void setOs_text1(String os_text1) {
+        this.os_text1 = os_text1;
     }
 
-    public String getOsText2() {
-        return osText2;
+    public String getOs_text2() {
+        return os_text2;
     }
 
-    public void setOsText2(String osText2) {
-        this.osText2 = osText2 == null ? null : osText2.trim();
+    public void setOs_text2(String os_text2) {
+        this.os_text2 = os_text2;
     }
 
-    public String getOsText3() {
-        return osText3;
+    public String getOs_text3() {
+        return os_text3;
     }
 
-    public void setOsText3(String osText3) {
-        this.osText3 = osText3 == null ? null : osText3.trim();
+    public void setOs_text3(String os_text3) {
+        this.os_text3 = os_text3;
     }
 
-    public String getOsText4() {
-        return osText4;
+    public String getOs_text4() {
+        return os_text4;
     }
 
-    public void setOsText4(String osText4) {
-        this.osText4 = osText4 == null ? null : osText4.trim();
+    public void setOs_text4(String os_text4) {
+        this.os_text4 = os_text4;
     }
 
-    public String getOsText5() {
-        return osText5;
+    public String getOs_text5() {
+        return os_text5;
     }
 
-    public void setOsText5(String osText5) {
-        this.osText5 = osText5 == null ? null : osText5.trim();
+    public void setOs_text5(String os_text5) {
+        this.os_text5 = os_text5;
     }
 }

+ 59 - 85
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendingsdetail.java

@@ -1,108 +1,82 @@
 package com.usoftchina.saas.money.po;
 
-import java.util.Date;
-
-public class Othspendingsdetail {
-    private Integer osdId;
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
 
-    private Integer osdOrid;
+import java.io.Serializable;
+import java.util.Date;
 
-    private Integer osdDetno;
+public class Othspendingsdetail extends CommonBaseEntity implements Serializable {
 
-    private Integer osdYm;
+    private Integer osd_orid;
 
-    private String osdType;
+    private Integer osd_detno;
 
-    private Double osdNowbalance;
+    private Integer osd_ym;
 
-    private String osdRemark;
+    private String osd_type;
 
-    private Integer companyid;
+    private Double osd_nowbalance;
 
-    private Integer updaterid;
+    private String osd_remark;
 
     private Date updatedate;
 
-    private String osdText1;
-
-    private String osdText2;
+    private String osd_text1;
 
-    private String osdText3;
+    private String osd_text2;
 
-    private String osdText4;
+    private String osd_text3;
 
-    private String osdText5;
-
-    public Integer getOsdId() {
-        return osdId;
-    }
-
-    public void setOsdId(Integer osdId) {
-        this.osdId = osdId;
-    }
+    private String osd_text4;
 
-    public Integer getOsdOrid() {
-        return osdOrid;
-    }
-
-    public void setOsdOrid(Integer osdOrid) {
-        this.osdOrid = osdOrid;
-    }
-
-    public Integer getOsdDetno() {
-        return osdDetno;
-    }
-
-    public void setOsdDetno(Integer osdDetno) {
-        this.osdDetno = osdDetno;
-    }
+    private String osd_text5;
 
-    public Integer getOsdYm() {
-        return osdYm;
+    public Integer getOsd_orid() {
+        return osd_orid;
     }
 
-    public void setOsdYm(Integer osdYm) {
-        this.osdYm = osdYm;
+    public void setOsd_orid(Integer osd_orid) {
+        this.osd_orid = osd_orid;
     }
 
-    public String getOsdType() {
-        return osdType;
+    public Integer getOsd_detno() {
+        return osd_detno;
     }
 
-    public void setOsdType(String osdType) {
-        this.osdType = osdType == null ? null : osdType.trim();
+    public void setOsd_detno(Integer osd_detno) {
+        this.osd_detno = osd_detno;
     }
 
-    public Double getOsdNowbalance() {
-        return osdNowbalance;
+    public Integer getOsd_ym() {
+        return osd_ym;
     }
 
-    public void setOsdNowbalance(Double osdNowbalance) {
-        this.osdNowbalance = osdNowbalance;
+    public void setOsd_ym(Integer osd_ym) {
+        this.osd_ym = osd_ym;
     }
 
-    public String getOsdRemark() {
-        return osdRemark;
+    public String getOsd_type() {
+        return osd_type;
     }
 
-    public void setOsdRemark(String osdRemark) {
-        this.osdRemark = osdRemark == null ? null : osdRemark.trim();
+    public void setOsd_type(String osd_type) {
+        this.osd_type = osd_type;
     }
 
-    public Integer getCompanyid() {
-        return companyid;
+    public Double getOsd_nowbalance() {
+        return osd_nowbalance;
     }
 
-    public void setCompanyid(Integer companyid) {
-        this.companyid = companyid;
+    public void setOsd_nowbalance(Double osd_nowbalance) {
+        this.osd_nowbalance = osd_nowbalance;
     }
 
-    public Integer getUpdaterid() {
-        return updaterid;
+    public String getOsd_remark() {
+        return osd_remark;
     }
 
-    public void setUpdaterid(Integer updaterid) {
-        this.updaterid = updaterid;
+    public void setOsd_remark(String osd_remark) {
+        this.osd_remark = osd_remark;
     }
 
     public Date getUpdatedate() {
@@ -113,43 +87,43 @@ public class Othspendingsdetail {
         this.updatedate = updatedate;
     }
 
-    public String getOsdText1() {
-        return osdText1;
+    public String getOsd_text1() {
+        return osd_text1;
     }
 
-    public void setOsdText1(String osdText1) {
-        this.osdText1 = osdText1 == null ? null : osdText1.trim();
+    public void setOsd_text1(String osd_text1) {
+        this.osd_text1 = osd_text1;
     }
 
-    public String getOsdText2() {
-        return osdText2;
+    public String getOsd_text2() {
+        return osd_text2;
     }
 
-    public void setOsdText2(String osdText2) {
-        this.osdText2 = osdText2 == null ? null : osdText2.trim();
+    public void setOsd_text2(String osd_text2) {
+        this.osd_text2 = osd_text2;
     }
 
-    public String getOsdText3() {
-        return osdText3;
+    public String getOsd_text3() {
+        return osd_text3;
     }
 
-    public void setOsdText3(String osdText3) {
-        this.osdText3 = osdText3 == null ? null : osdText3.trim();
+    public void setOsd_text3(String osd_text3) {
+        this.osd_text3 = osd_text3;
     }
 
-    public String getOsdText4() {
-        return osdText4;
+    public String getOsd_text4() {
+        return osd_text4;
     }
 
-    public void setOsdText4(String osdText4) {
-        this.osdText4 = osdText4 == null ? null : osdText4.trim();
+    public void setOsd_text4(String osd_text4) {
+        this.osd_text4 = osd_text4;
     }
 
-    public String getOsdText5() {
-        return osdText5;
+    public String getOsd_text5() {
+        return osd_text5;
     }
 
-    public void setOsdText5(String osdText5) {
-        this.osdText5 = osdText5 == null ? null : osdText5.trim();
+    public void setOsd_text5(String osd_text5) {
+        this.osd_text5 = osd_text5;
     }
 }

+ 5 - 5
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Paybalance.java

@@ -13,7 +13,6 @@ import java.util.Date;
  */
 @Data
 public class Paybalance extends CommonBaseEntity implements Serializable {
-    private Integer pb_id;
 
     private String pb_code;
 
@@ -50,6 +49,7 @@ public class Paybalance extends CommonBaseEntity implements Serializable {
     private String pb_statuscode;
 
     private String pb_remark;
+    private Date updatedate;
 
     private String pb_text1;
 
@@ -61,12 +61,12 @@ public class Paybalance extends CommonBaseEntity implements Serializable {
 
     private String pb_text5;
 
-    public Integer getPb_id() {
-        return pb_id;
+    public Date getUpdatedate() {
+        return updatedate;
     }
 
-    public void setPb_id(Integer pb_id) {
-        this.pb_id = pb_id;
+    public void setUpdatedate(Date updatedate) {
+        this.updatedate = updatedate;
     }
 
     public String getPb_code() {

+ 75 - 123
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Paybalancedet.java

@@ -6,146 +6,117 @@ import java.io.Serializable;
 import java.util.Date;
 
 public class Paybalancedet extends CommonBaseEntity implements Serializable {
-    private Integer pdId;
 
-    private Integer pdRbid;
+    private Integer pd_rbid;
 
-    private Integer pdDetno;
+    private Integer pd_detno;
 
-    private Integer pdYm;
+    private Integer pd_ym;
 
-    private Integer pdBankid;
+    private Integer pd_bankid;
 
-    private String pdBankcode;
+    private String pd_bankcode;
 
-    private String pdBankname;
+    private String pd_bankname;
 
-    private Double pdAmount;
+    private Double pd_amount;
 
-    private String pdPaymethod;
+    private String pd_paymethod;
 
-    private String pdPaycode;
+    private String pd_paycode;
 
-    private String pdRemark;
-
-    private Integer companyid;
-
-    private Integer updaterid;
+    private String pd_remark;
 
     private Date updatedate;
 
-    private String pdText1;
-
-    private String pdText2;
-
-    private String pdText3;
-
-    private String pdText4;
-
-    private String pdText5;
+    private String pd_text1;
 
-    public Integer getPdId() {
-        return pdId;
-    }
-
-    public void setPdId(Integer pdId) {
-        this.pdId = pdId;
-    }
+    private String pd_text2;
 
-    public Integer getPdRbid() {
-        return pdRbid;
-    }
-
-    public void setPdRbid(Integer pdRbid) {
-        this.pdRbid = pdRbid;
-    }
+    private String pd_text3;
 
-    public Integer getPdDetno() {
-        return pdDetno;
-    }
+    private String pd_text4;
 
-    public void setPdDetno(Integer pdDetno) {
-        this.pdDetno = pdDetno;
-    }
+    private String pd_text5;
 
-    public Integer getPdYm() {
-        return pdYm;
+    public Integer getPd_rbid() {
+        return pd_rbid;
     }
 
-    public void setPdYm(Integer pdYm) {
-        this.pdYm = pdYm;
+    public void setPd_rbid(Integer pd_rbid) {
+        this.pd_rbid = pd_rbid;
     }
 
-    public Integer getPdBankid() {
-        return pdBankid;
+    public Integer getPd_detno() {
+        return pd_detno;
     }
 
-    public void setPdBankid(Integer pdBankid) {
-        this.pdBankid = pdBankid;
+    public void setPd_detno(Integer pd_detno) {
+        this.pd_detno = pd_detno;
     }
 
-    public String getPdBankcode() {
-        return pdBankcode;
+    public Integer getPd_ym() {
+        return pd_ym;
     }
 
-    public void setPdBankcode(String pdBankcode) {
-        this.pdBankcode = pdBankcode == null ? null : pdBankcode.trim();
+    public void setPd_ym(Integer pd_ym) {
+        this.pd_ym = pd_ym;
     }
 
-    public String getPdBankname() {
-        return pdBankname;
+    public Integer getPd_bankid() {
+        return pd_bankid;
     }
 
-    public void setPdBankname(String pdBankname) {
-        this.pdBankname = pdBankname == null ? null : pdBankname.trim();
+    public void setPd_bankid(Integer pd_bankid) {
+        this.pd_bankid = pd_bankid;
     }
 
-    public Double getPdAmount() {
-        return pdAmount;
+    public String getPd_bankcode() {
+        return pd_bankcode;
     }
 
-    public void setPdAmount(Double pdAmount) {
-        this.pdAmount = pdAmount;
+    public void setPd_bankcode(String pd_bankcode) {
+        this.pd_bankcode = pd_bankcode;
     }
 
-    public String getPdPaymethod() {
-        return pdPaymethod;
+    public String getPd_bankname() {
+        return pd_bankname;
     }
 
-    public void setPdPaymethod(String pdPaymethod) {
-        this.pdPaymethod = pdPaymethod == null ? null : pdPaymethod.trim();
+    public void setPd_bankname(String pd_bankname) {
+        this.pd_bankname = pd_bankname;
     }
 
-    public String getPdPaycode() {
-        return pdPaycode;
+    public Double getPd_amount() {
+        return pd_amount;
     }
 
-    public void setPdPaycode(String pdPaycode) {
-        this.pdPaycode = pdPaycode == null ? null : pdPaycode.trim();
+    public void setPd_amount(Double pd_amount) {
+        this.pd_amount = pd_amount;
     }
 
-    public String getPdRemark() {
-        return pdRemark;
+    public String getPd_paymethod() {
+        return pd_paymethod;
     }
 
-    public void setPdRemark(String pdRemark) {
-        this.pdRemark = pdRemark == null ? null : pdRemark.trim();
+    public void setPd_paymethod(String pd_paymethod) {
+        this.pd_paymethod = pd_paymethod;
     }
 
-    public Integer getCompanyid() {
-        return companyid;
+    public String getPd_paycode() {
+        return pd_paycode;
     }
 
-    public void setCompanyid(Integer companyid) {
-        this.companyid = companyid;
+    public void setPd_paycode(String pd_paycode) {
+        this.pd_paycode = pd_paycode;
     }
 
-    public Integer getUpdaterid() {
-        return updaterid;
+    public String getPd_remark() {
+        return pd_remark;
     }
 
-    public void setUpdaterid(Integer updaterid) {
-        this.updaterid = updaterid;
+    public void setPd_remark(String pd_remark) {
+        this.pd_remark = pd_remark;
     }
 
     public Date getUpdatedate() {
@@ -156,62 +127,43 @@ public class Paybalancedet extends CommonBaseEntity implements Serializable {
         this.updatedate = updatedate;
     }
 
-    public String getPdText1() {
-        return pdText1;
-    }
-
-    public void setPdText1(String pdText1) {
-        this.pdText1 = pdText1 == null ? null : pdText1.trim();
-    }
-
-    public String getPdText2() {
-        return pdText2;
+    public String getPd_text1() {
+        return pd_text1;
     }
 
-    public void setPdText2(String pdText2) {
-        this.pdText2 = pdText2 == null ? null : pdText2.trim();
+    public void setPd_text1(String pd_text1) {
+        this.pd_text1 = pd_text1;
     }
 
-    public String getPdText3() {
-        return pdText3;
+    public String getPd_text2() {
+        return pd_text2;
     }
 
-    public void setPdText3(String pdText3) {
-        this.pdText3 = pdText3 == null ? null : pdText3.trim();
+    public void setPd_text2(String pd_text2) {
+        this.pd_text2 = pd_text2;
     }
 
-    public String getPdText4() {
-        return pdText4;
+    public String getPd_text3() {
+        return pd_text3;
     }
 
-    public void setPdText4(String pdText4) {
-        this.pdText4 = pdText4 == null ? null : pdText4.trim();
+    public void setPd_text3(String pd_text3) {
+        this.pd_text3 = pd_text3;
     }
 
-    public String getPdText5() {
-        return pdText5;
+    public String getPd_text4() {
+        return pd_text4;
     }
 
-    public void setPdText5(String pdText5) {
-        this.pdText5 = pdText5 == null ? null : pdText5.trim();
+    public void setPd_text4(String pd_text4) {
+        this.pd_text4 = pd_text4;
     }
-    @Override
-    public void setCreatorId(long creatorId) {
 
+    public String getPd_text5() {
+        return pd_text5;
     }
 
-    @Override
-    public void setUpdaterId(long updaterId) {
-
-    }
-
-    @Override
-    public long getCompanyId() {
-        return 0;
-    }
-
-    @Override
-    public void setCompanyId(long companyId) {
-
+    public void setPd_text5(String pd_text5) {
+        this.pd_text5 = pd_text5;
     }
 }

+ 75 - 123
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Paybalancedetail.java

@@ -6,146 +6,117 @@ import java.io.Serializable;
 import java.util.Date;
 
 public class Paybalancedetail extends CommonBaseEntity implements Serializable {
-    private Integer pbdId;
 
-    private Integer pbdPbid;
+    private Integer pbd_pbid;
 
-    private Integer pbdDetno;
+    private Integer pbd_detno;
 
-    private Integer pbdYm;
+    private Integer pbd_ym;
 
-    private Integer pbdSild;
+    private Integer pbd_sild;
 
-    private String pbdSlcode;
+    private String pbd_slcode;
 
-    private String pbdSlkind;
+    private String pbd_slkind;
 
-    private Date pbdSldate;
+    private Date pbd_sldate;
 
-    private Double pbdAmount;
+    private Double pbd_amount;
 
-    private Double pbdNowbalance;
+    private Double pbd_nowbalance;
 
-    private String pbdRemark;
-
-    private Integer companyid;
-
-    private Integer updaterid;
+    private String pbd_remark;
 
     private Date updatedate;
 
-    private String pbdText1;
-
-    private String pbdText2;
-
-    private String pbdText3;
-
-    private String pbdText4;
-
-    private String pbdText5;
+    private String pbd_text1;
 
-    public Integer getPbdId() {
-        return pbdId;
-    }
-
-    public void setPbdId(Integer pbdId) {
-        this.pbdId = pbdId;
-    }
+    private String pbd_text2;
 
-    public Integer getPbdPbid() {
-        return pbdPbid;
-    }
-
-    public void setPbdPbid(Integer pbdPbid) {
-        this.pbdPbid = pbdPbid;
-    }
+    private String pbd_text3;
 
-    public Integer getPbdDetno() {
-        return pbdDetno;
-    }
+    private String pbd_text4;
 
-    public void setPbdDetno(Integer pbdDetno) {
-        this.pbdDetno = pbdDetno;
-    }
+    private String pbd_text5;
 
-    public Integer getPbdYm() {
-        return pbdYm;
+    public Integer getPbd_pbid() {
+        return pbd_pbid;
     }
 
-    public void setPbdYm(Integer pbdYm) {
-        this.pbdYm = pbdYm;
+    public void setPbd_pbid(Integer pbd_pbid) {
+        this.pbd_pbid = pbd_pbid;
     }
 
-    public Integer getPbdSild() {
-        return pbdSild;
+    public Integer getPbd_detno() {
+        return pbd_detno;
     }
 
-    public void setPbdSild(Integer pbdSild) {
-        this.pbdSild = pbdSild;
+    public void setPbd_detno(Integer pbd_detno) {
+        this.pbd_detno = pbd_detno;
     }
 
-    public String getPbdSlcode() {
-        return pbdSlcode;
+    public Integer getPbd_ym() {
+        return pbd_ym;
     }
 
-    public void setPbdSlcode(String pbdSlcode) {
-        this.pbdSlcode = pbdSlcode == null ? null : pbdSlcode.trim();
+    public void setPbd_ym(Integer pbd_ym) {
+        this.pbd_ym = pbd_ym;
     }
 
-    public String getPbdSlkind() {
-        return pbdSlkind;
+    public Integer getPbd_sild() {
+        return pbd_sild;
     }
 
-    public void setPbdSlkind(String pbdSlkind) {
-        this.pbdSlkind = pbdSlkind == null ? null : pbdSlkind.trim();
+    public void setPbd_sild(Integer pbd_sild) {
+        this.pbd_sild = pbd_sild;
     }
 
-    public Date getPbdSldate() {
-        return pbdSldate;
+    public String getPbd_slcode() {
+        return pbd_slcode;
     }
 
-    public void setPbdSldate(Date pbdSldate) {
-        this.pbdSldate = pbdSldate;
+    public void setPbd_slcode(String pbd_slcode) {
+        this.pbd_slcode = pbd_slcode;
     }
 
-    public Double getPbdAmount() {
-        return pbdAmount;
+    public String getPbd_slkind() {
+        return pbd_slkind;
     }
 
-    public void setPbdAmount(Double pbdAmount) {
-        this.pbdAmount = pbdAmount;
+    public void setPbd_slkind(String pbd_slkind) {
+        this.pbd_slkind = pbd_slkind;
     }
 
-    public Double getPbdNowbalance() {
-        return pbdNowbalance;
+    public Date getPbd_sldate() {
+        return pbd_sldate;
     }
 
-    public void setPbdNowbalance(Double pbdNowbalance) {
-        this.pbdNowbalance = pbdNowbalance;
+    public void setPbd_sldate(Date pbd_sldate) {
+        this.pbd_sldate = pbd_sldate;
     }
 
-    public String getPbdRemark() {
-        return pbdRemark;
+    public Double getPbd_amount() {
+        return pbd_amount;
     }
 
-    public void setPbdRemark(String pbdRemark) {
-        this.pbdRemark = pbdRemark == null ? null : pbdRemark.trim();
+    public void setPbd_amount(Double pbd_amount) {
+        this.pbd_amount = pbd_amount;
     }
 
-    public Integer getCompanyid() {
-        return companyid;
+    public Double getPbd_nowbalance() {
+        return pbd_nowbalance;
     }
 
-    public void setCompanyid(Integer companyid) {
-        this.companyid = companyid;
+    public void setPbd_nowbalance(Double pbd_nowbalance) {
+        this.pbd_nowbalance = pbd_nowbalance;
     }
 
-    public Integer getUpdaterid() {
-        return updaterid;
+    public String getPbd_remark() {
+        return pbd_remark;
     }
 
-    public void setUpdaterid(Integer updaterid) {
-        this.updaterid = updaterid;
+    public void setPbd_remark(String pbd_remark) {
+        this.pbd_remark = pbd_remark;
     }
 
     public Date getUpdatedate() {
@@ -156,62 +127,43 @@ public class Paybalancedetail extends CommonBaseEntity implements Serializable {
         this.updatedate = updatedate;
     }
 
-    public String getPbdText1() {
-        return pbdText1;
-    }
-
-    public void setPbdText1(String pbdText1) {
-        this.pbdText1 = pbdText1 == null ? null : pbdText1.trim();
-    }
-
-    public String getPbdText2() {
-        return pbdText2;
+    public String getPbd_text1() {
+        return pbd_text1;
     }
 
-    public void setPbdText2(String pbdText2) {
-        this.pbdText2 = pbdText2 == null ? null : pbdText2.trim();
+    public void setPbd_text1(String pbd_text1) {
+        this.pbd_text1 = pbd_text1;
     }
 
-    public String getPbdText3() {
-        return pbdText3;
+    public String getPbd_text2() {
+        return pbd_text2;
     }
 
-    public void setPbdText3(String pbdText3) {
-        this.pbdText3 = pbdText3 == null ? null : pbdText3.trim();
+    public void setPbd_text2(String pbd_text2) {
+        this.pbd_text2 = pbd_text2;
     }
 
-    public String getPbdText4() {
-        return pbdText4;
+    public String getPbd_text3() {
+        return pbd_text3;
     }
 
-    public void setPbdText4(String pbdText4) {
-        this.pbdText4 = pbdText4 == null ? null : pbdText4.trim();
+    public void setPbd_text3(String pbd_text3) {
+        this.pbd_text3 = pbd_text3;
     }
 
-    public String getPbdText5() {
-        return pbdText5;
+    public String getPbd_text4() {
+        return pbd_text4;
     }
 
-    public void setPbdText5(String pbdText5) {
-        this.pbdText5 = pbdText5 == null ? null : pbdText5.trim();
+    public void setPbd_text4(String pbd_text4) {
+        this.pbd_text4 = pbd_text4;
     }
-    @Override
-    public void setCreatorId(long creatorId) {
 
+    public String getPbd_text5() {
+        return pbd_text5;
     }
 
-    @Override
-    public void setUpdaterId(long updaterId) {
-
-    }
-
-    @Override
-    public long getCompanyId() {
-        return 0;
-    }
-
-    @Override
-    public void setCompanyId(long companyId) {
-
+    public void setPbd_text5(String pbd_text5) {
+        this.pbd_text5 = pbd_text5;
     }
 }

+ 6 - 5
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Recbalance.java

@@ -12,7 +12,6 @@ import java.util.Date;
  */
 @Data
 public class Recbalance extends CommonBaseEntity implements Serializable {
-    private Integer rb_id;
 
     private String rb_code;
 
@@ -50,6 +49,8 @@ public class Recbalance extends CommonBaseEntity implements Serializable {
 
     private String rb_remark;
 
+    private Date updatedate;
+
     private String rb_text1;
 
     private String rb_text2;
@@ -60,12 +61,12 @@ public class Recbalance extends CommonBaseEntity implements Serializable {
 
     private String rb_text5;
 
-    public Integer getRb_id() {
-        return rb_id;
+    public Date getUpdatedate() {
+        return updatedate;
     }
 
-    public void setRb_id(Integer rb_id) {
-        this.rb_id = rb_id;
+    public void setUpdatedate(Date updatedate) {
+        this.updatedate = updatedate;
     }
 
     public String getRb_code() {

+ 6 - 5
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Recbalancedet.java

@@ -12,7 +12,6 @@ import java.util.Date;
  */
 @Data
 public class Recbalancedet extends CommonBaseEntity implements Serializable{
-    private Integer rd_id;
 
     private Integer rd_rbid;
 
@@ -34,6 +33,8 @@ public class Recbalancedet extends CommonBaseEntity implements Serializable{
 
     private String rd_remark;
 
+    private Date updatedate;
+
     private String rd_text1;
 
     private String rd_text2;
@@ -44,12 +45,12 @@ public class Recbalancedet extends CommonBaseEntity implements Serializable{
 
     private String rd_text5;
 
-    public Integer getRd_id() {
-        return rd_id;
+    public Date getUpdatedate() {
+        return updatedate;
     }
 
-    public void setRd_id(Integer rd_id) {
-        this.rd_id = rd_id;
+    public void setUpdatedate(Date updatedate) {
+        this.updatedate = updatedate;
     }
 
     public Integer getRd_rbid() {

+ 104 - 122
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Recbalancedetail.java

@@ -6,209 +6,191 @@ import java.io.Serializable;
 import java.util.Date;
 
 public class Recbalancedetail extends CommonBaseEntity implements Serializable {
-    private Integer rbdId;
 
-    private Integer rbdRbid;
+    private Integer rbd_rbid;
 
-    private Integer rbdDetno;
+    private Integer rbd_detno;
 
-    private Integer rbdYm;
+    private Integer rbd_ym;
 
-    private Integer rbdSlid;
+    private Integer rbd_slid;
 
-    private String rbdSlcode;
+    private String rbd_slcode;
 
-    private String rbdSlkind;
+    private String rbd_slkind;
 
-    private Date rbdSldate;
+    private Date rbd_sldate;
 
-    private Double rbdAmount;
+    private Double rbd_amount;
 
-    private Double rbdNowbalance;
-
-    private String rbdRemark;
-
-    private Integer companyId;
-
-    private Integer updaterid;
+    private Double rbd_nowbalance;
 
+    private String rbd_remark;
     private Date updatedate;
 
-    private String rbdText1;
+    private String rbd_text1;
 
-    private String rbdText2;
+    private String rbd_text2;
 
-    private String rbdText3;
+    private String rbd_text3;
 
-    private String rbdText4;
+    private String rbd_text4;
 
-    private String rbdText5;
-
-    public Integer getRbdId() {
-        return rbdId;
-    }
-
-    public void setRbdId(Integer rbdId) {
-        this.rbdId = rbdId;
-    }
-
-    public Integer getRbdRbid() {
-        return rbdRbid;
-    }
+    private String rbd_text5;
 
-    public void setRbdRbid(Integer rbdRbid) {
-        this.rbdRbid = rbdRbid;
+    public Integer getRbd_rbid() {
+        return rbd_rbid;
     }
 
-    public Integer getRbdDetno() {
-        return rbdDetno;
+    public void setRbd_rbid(Integer rbd_rbid) {
+        this.rbd_rbid = rbd_rbid;
     }
 
-    public void setRbdDetno(Integer rbdDetno) {
-        this.rbdDetno = rbdDetno;
+    public Integer getRbd_detno() {
+        return rbd_detno;
     }
 
-    public Integer getRbdYm() {
-        return rbdYm;
+    public void setRbd_detno(Integer rbd_detno) {
+        this.rbd_detno = rbd_detno;
     }
 
-    public void setRbdYm(Integer rbdYm) {
-        this.rbdYm = rbdYm;
+    public Integer getRbd_ym() {
+        return rbd_ym;
     }
 
-    public Integer getRbdSlid() {
-        return rbdSlid;
+    public void setRbd_ym(Integer rbd_ym) {
+        this.rbd_ym = rbd_ym;
     }
 
-    public void setRbdSlid(Integer rbdSlid) {
-        this.rbdSlid = rbdSlid;
+    public Integer getRbd_slid() {
+        return rbd_slid;
     }
 
-    public String getRbdSlcode() {
-        return rbdSlcode;
+    public void setRbd_slid(Integer rbd_slid) {
+        this.rbd_slid = rbd_slid;
     }
 
-    public void setRbdSlcode(String rbdSlcode) {
-        this.rbdSlcode = rbdSlcode == null ? null : rbdSlcode.trim();
+    public String getRbd_slcode() {
+        return rbd_slcode;
     }
 
-    public String getRbdSlkind() {
-        return rbdSlkind;
+    public void setRbd_slcode(String rbd_slcode) {
+        this.rbd_slcode = rbd_slcode;
     }
 
-    public void setRbdSlkind(String rbdSlkind) {
-        this.rbdSlkind = rbdSlkind == null ? null : rbdSlkind.trim();
+    public String getRbd_slkind() {
+        return rbd_slkind;
     }
 
-    public Date getRbdSldate() {
-        return rbdSldate;
+    public void setRbd_slkind(String rbd_slkind) {
+        this.rbd_slkind = rbd_slkind;
     }
 
-    public void setRbdSldate(Date rbdSldate) {
-        this.rbdSldate = rbdSldate;
+    public Date getRbd_sldate() {
+        return rbd_sldate;
     }
 
-    public Double getRbdAmount() {
-        return rbdAmount;
+    public void setRbd_sldate(Date rbd_sldate) {
+        this.rbd_sldate = rbd_sldate;
     }
 
-    public void setRbdAmount(Double rbdAmount) {
-        this.rbdAmount = rbdAmount;
+    public Double getRbd_amount() {
+        return rbd_amount;
     }
 
-    public Double getRbdNowbalance() {
-        return rbdNowbalance;
+    public void setRbd_amount(Double rbd_amount) {
+        this.rbd_amount = rbd_amount;
     }
 
-    public void setRbdNowbalance(Double rbdNowbalance) {
-        this.rbdNowbalance = rbdNowbalance;
+    public Double getRbd_nowbalance() {
+        return rbd_nowbalance;
     }
 
-    public String getRbdRemark() {
-        return rbdRemark;
+    public void setRbd_nowbalance(Double rbd_nowbalance) {
+        this.rbd_nowbalance = rbd_nowbalance;
     }
 
-    public void setRbdRemark(String rbdRemark) {
-        this.rbdRemark = rbdRemark == null ? null : rbdRemark.trim();
+    public String getRbd_remark() {
+        return rbd_remark;
     }
 
-    public void setCompanyId(Integer companyId) {
-        this.companyId = companyId;
+    public void setRbd_remark(String rbd_remark) {
+        this.rbd_remark = rbd_remark;
     }
 
-    public Integer getUpdaterid() {
-        return updaterid;
+    public String getRbd_text1() {
+        return rbd_text1;
     }
 
-    public void setUpdaterid(Integer updaterid) {
-        this.updaterid = updaterid;
-    }
-
-    public Date getUpdatedate() {
-        return updatedate;
-    }
-
-    public void setUpdatedate(Date updatedate) {
-        this.updatedate = updatedate;
+    public void setRbd_text1(String rbd_text1) {
+        this.rbd_text1 = rbd_text1;
     }
 
-    public String getRbdText1() {
-        return rbdText1;
+    public String getRbd_text2() {
+        return rbd_text2;
     }
 
-    public void setRbdText1(String rbdText1) {
-        this.rbdText1 = rbdText1 == null ? null : rbdText1.trim();
+    public void setRbd_text2(String rbd_text2) {
+        this.rbd_text2 = rbd_text2;
     }
 
-    public String getRbdText2() {
-        return rbdText2;
+    public String getRbd_text3() {
+        return rbd_text3;
     }
 
-    public void setRbdText2(String rbdText2) {
-        this.rbdText2 = rbdText2 == null ? null : rbdText2.trim();
+    public void setRbd_text3(String rbd_text3) {
+        this.rbd_text3 = rbd_text3;
     }
 
-    public String getRbdText3() {
-        return rbdText3;
+    public String getRbd_text4() {
+        return rbd_text4;
     }
 
-    public void setRbdText3(String rbdText3) {
-        this.rbdText3 = rbdText3 == null ? null : rbdText3.trim();
+    public void setRbd_text4(String rbd_text4) {
+        this.rbd_text4 = rbd_text4;
     }
 
-    public String getRbdText4() {
-        return rbdText4;
+    public String getRbd_text5() {
+        return rbd_text5;
     }
 
-    public void setRbdText4(String rbdText4) {
-        this.rbdText4 = rbdText4 == null ? null : rbdText4.trim();
+    public void setRbd_text5(String rbd_text5) {
+        this.rbd_text5 = rbd_text5;
     }
 
-    public String getRbdText5() {
-        return rbdText5;
-    }
-
-    public void setRbdText5(String rbdText5) {
-        this.rbdText5 = rbdText5 == null ? null : rbdText5.trim();
-    }
-
-    @Override
-    public void setCreatorId(long creatorId) {
-
-    }
-
-    @Override
-    public void setUpdaterId(long updaterId) {
-
+    public Date getUpdatedate() {
+        return updatedate;
     }
 
-    @Override
-    public long getCompanyId() {
-        return 0;
+    public void setUpdatedate(Date updatedate) {
+        this.updatedate = updatedate;
     }
 
     @Override
-    public void setCompanyId(long companyId) {
-
+    public String toString() {
+        return "Recbalancedetail{" +
+                "rbd_rbid=" + rbd_rbid +
+                ", rbd_detno=" + rbd_detno +
+                ", rbd_ym=" + rbd_ym +
+                ", rbd_slid=" + rbd_slid +
+                ", rbd_slcode='" + rbd_slcode + '\'' +
+                ", rbd_slkind='" + rbd_slkind + '\'' +
+                ", rbd_sldate=" + rbd_sldate +
+                ", rbd_amount=" + rbd_amount +
+                ", rbd_nowbalance=" + rbd_nowbalance +
+                ", rbd_remark='" + rbd_remark + '\'' +
+                ", updatedate=" + updatedate +
+                ", rbd_text1='" + rbd_text1 + '\'' +
+                ", rbd_text2='" + rbd_text2 + '\'' +
+                ", rbd_text3='" + rbd_text3 + '\'' +
+                ", rbd_text4='" + rbd_text4 + '\'' +
+                ", rbd_text5='" + rbd_text5 + '\'' +
+                ", id=" + id +
+                ", companyId=" + companyId +
+                ", createTime=" + createTime +
+                ", creatorId=" + creatorId +
+                ", updateTime=" + updateTime +
+                ", updaterId=" + updaterId +
+                '}';
     }
 }

+ 7 - 5
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/OthreceiptsService.java

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.money.service;
 
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Othreceipts;
 import com.usoftchina.saas.money.po.Othte;
 import com.usoftchina.saas.money.po.Pay;
@@ -12,11 +14,11 @@ import com.usoftchina.saas.page.PageRequest;
  * @date 2018/10/24 17:30
  **/
 public interface OthreceiptsService {
-    int insert(Othte othte);
+    DocBaseDTO insert(Othte othte);
 
-    void audit(Othte othte);
-
-    void unAudit(int id);
+//    void audit(Othte othte);
+//
+//    void unAudit(int id);
 
     void delete(int id);
 
@@ -24,5 +26,5 @@ public interface OthreceiptsService {
 
     Othte select(int id);
 
-    PageInfo<Othreceipts> selectList(PageRequest page);
+    PageInfo<Othreceipts> selectList(PageRequest page, ListReqDTO reqDTO);
 }

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

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.money.service;
 
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Othreceipts;
 import com.usoftchina.saas.money.po.Othsp;
 import com.usoftchina.saas.money.po.Othspendings;
@@ -13,7 +15,7 @@ import com.usoftchina.saas.page.PageRequest;
  **/
 public interface OthspendingsService {
 
-    int insert(Othsp othsp);
+    DocBaseDTO insert(Othsp othsp);
 
     void delete(int id);
 
@@ -21,9 +23,9 @@ public interface OthspendingsService {
 
     Othsp select(int id);
 
-    PageInfo<Othspendings> selectList(PageRequest page);
+    PageInfo<Othspendings> selectList(PageRequest page, ListReqDTO reqDTO);
 
-    void audit(Othsp othsp);
-
-    void unAudit(int id);
+//    void audit(Othsp othsp);
+//
+//    void unAudit(int id);
 }

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

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.money.service;
 
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Pay;
 import com.usoftchina.saas.money.po.Paybalance;
 import com.usoftchina.saas.page.PageRequest;
@@ -11,7 +13,7 @@ import com.usoftchina.saas.page.PageRequest;
  * @date 2018/10/22 14:25
  **/
 public interface PaybalanceService {
-    int insert(Pay pay);
+    DocBaseDTO insert(Pay pay);
 
     void audit(Pay pay);
 
@@ -23,5 +25,5 @@ public interface PaybalanceService {
 
     Pay select(int id);
 
-    PageInfo<Paybalance> selectList(PageRequest page);
+    PageInfo<Paybalance> selectList(PageRequest page, ListReqDTO reqDTO);
 }

+ 10 - 3
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/RecbalanceService.java

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.money.service;
 
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.po.Rec;
 import com.usoftchina.saas.money.po.Recbalance;
 import com.usoftchina.saas.page.PageRequest;
@@ -11,7 +13,7 @@ import com.usoftchina.saas.page.PageRequest;
  * @date 2018/10/23 16:02
  **/
 public interface RecbalanceService {
-    int insert(Rec rec);
+    DocBaseDTO insert(Rec rec);
     void delect(int id);
 
     void deleteItem(int id);
@@ -19,9 +21,14 @@ public interface RecbalanceService {
     Rec select(int id);
 
 
+    void deleteItems(int id);
+
     void audit(Rec rec);
 
-    void unAudit(int id);
 
-    PageInfo<Recbalance> selectList(PageRequest page);
+    void unAudit(Long id);
+
+    PageInfo<Recbalance> selectList(PageRequest page, ListReqDTO reqDTO);
+
+
 }

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

@@ -2,7 +2,14 @@ package com.usoftchina.saas.money.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+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;
 import com.usoftchina.saas.money.mapper.OthreceiptsMapper;
 import com.usoftchina.saas.money.mapper.OthreceiptsdetailMapper;
 import com.usoftchina.saas.money.po.*;
@@ -10,6 +17,7 @@ import com.usoftchina.saas.money.service.OthreceiptsService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import java.util.Iterator;
 import java.util.List;
@@ -25,49 +33,64 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
     private OthreceiptsMapper othreceiptsMapper;
     @Autowired
     private OthreceiptsdetailMapper othreceiptsdetailMapper;
+    @Autowired
+    private MaxnumberService maxnumberService;
 
     @Override
-    public int insert(Othte othte) {
+    public DocBaseDTO insert(Othte othte) {
         Othreceipts othreceipts = othte.getMain();
         List<Othreceiptsdetail> othreceiptsdetail = othte.getItems();
 
-        if (othreceipts.getOrId() > 0){
+        String or_code = othreceipts.getOr_code();
+
+        //编号校验
+        or_code = pushMaxnubmer(or_code, othreceipts.getId());
+        //单号赋值
+        othreceipts.setOr_code(or_code);
+
+        Long id = othreceipts.getId();
+
+        if (othreceipts.getId() > 0){
             othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
         }else {
-            othreceiptsMapper.insert(othreceipts);
+            othreceipts.setCompanyId(BaseContextHolder.getCompanyId());
+            othreceiptsMapper.insertSelective(othreceipts);
+            id = othreceipts.getId();
         }
 
         Iterator isdet = othreceiptsdetail.iterator();
         while (isdet.hasNext()){
             Othreceiptsdetail othreceiptsdetail1 = (Othreceiptsdetail) isdet.next();
-            if (othreceiptsdetail1.getOrdId() > 0 ){
+            othreceiptsdetail1.setOrd_orid(Math.toIntExact(id));
+            othreceiptsdetail1.setCompanyId(BaseContextHolder.getCompanyId());
+            if (othreceiptsdetail1.getId() > 0 ){
                 othreceiptsdetailMapper.updateByPrimaryKey(othreceiptsdetail1);
             }else {
                 othreceiptsdetailMapper.insertSelective(othreceiptsdetail1);
             }
         }
-        return 0;
+        return new DocBaseDTO(id, or_code, BillCodeSeq.OTHERIN.getCaller());
     }
 
-    @Override
-    public void audit(Othte othte) {
-        int id = othte.getMain().getOrId();
-        Othreceipts othreceipts = othreceiptsMapper.selectByPrimaryKey(id);
-        if ( othreceipts == null || "".equals(othreceipts)){
-            this.insert(othte);
-        }else {
-            othreceiptsMapper.updateByPrimaryKey(othreceipts);
-        }
-    }
-
-    @Override
-    public void unAudit(int id) {
-        Othreceipts othreceipts = new Othreceipts();
-        othreceipts.setOrId(id);
-        othreceipts.setOrStatus(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
-        othreceipts.setOrStatuscode(Status.UNAUDITED.name());
-        othreceiptsMapper.updateByPrimaryKey(othreceipts);
-    }
+//    @Override
+//    public void audit(Othte othte) {
+//        int id = Math.toIntExact(othte.getMain().getId());
+//        Othreceipts othreceipts = othreceiptsMapper.selectByPrimaryKey(id);
+//        if ( othreceipts == null || "".equals(othreceipts)){
+//            this.insert(othte);
+//        }else {
+//            othreceiptsMapper.updateByPrimaryKey(othreceipts);
+//        }
+//    }
+//
+//    @Override
+//    public void unAudit(int id) {
+//        Othreceipts othreceipts = new Othreceipts();
+//        othreceipts.set(id);
+//        othreceipts.setOrStatus(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
+//        othreceipts.setOrStatuscode(Status.UNAUDITED.name());
+//        othreceiptsMapper.updateByPrimaryKey(othreceipts);
+//    }
 
 
     @Override
@@ -84,12 +107,12 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
     public Othte select(int id) {
         Othte othte = new Othte();
         othte.setMain(othreceiptsMapper.selectByPrimaryKey(id));
-        othte.setItems((List<Othreceiptsdetail>) othreceiptsdetailMapper.selectByPrimaryKey(id));
+        othte.setItems(othreceiptsdetailMapper.selectByPrimaryKey(id));
         return othte;
     }
 
     @Override
-    public PageInfo<Othreceipts> selectList(PageRequest page) {
+    public PageInfo<Othreceipts> selectList(PageRequest page, ListReqDTO reqDTO) {
         //设置默认分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -97,9 +120,44 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<Othreceipts> othreceipts = othreceiptsMapper.selectList();
+        List<Othreceipts> othreceipts = this.getListByMode(reqDTO);
         //取分页信息
         PageInfo<Othreceipts> pageInfo = new PageInfo<>(othreceipts);
         return pageInfo;
     }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: guq
+     * @Date: 2018/10/19
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? othreceiptsMapper.validateCodeWhenInsert(code, companyId) :
+                othreceiptsMapper.validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.OTHRECEIPTS.getCaller()).getData();
+    }
+
+    private List<Othreceipts> getListByMode(ListReqDTO req) {
+        List<Othreceipts> othreceiptsList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        if (StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
+            othreceiptsList = othreceiptsMapper.selectOthreceiptsBycondition(con, companyId);
+        } else {
+            othreceiptsList = othreceiptsMapper.selectOthreceiptsListByCondition(con, companyId);
+        }
+        return othreceiptsList;
+    }
 }

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

@@ -2,7 +2,14 @@ package com.usoftchina.saas.money.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+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;
 import com.usoftchina.saas.money.mapper.OthreceiptsMapper;
 import com.usoftchina.saas.money.mapper.OthreceiptsdetailMapper;
 import com.usoftchina.saas.money.mapper.OthspendingsMapper;
@@ -12,6 +19,7 @@ import com.usoftchina.saas.money.service.OthspendingsService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import java.util.Iterator;
 import java.util.List;
@@ -26,13 +34,25 @@ public class OthspendingsServiceImpl implements OthspendingsService {
     private OthspendingsMapper othspendingsMapper;
     @Autowired
     private OthspendingsdetailMapper othspendingsdetailMapper;
+    @Autowired
+    private MaxnumberService maxnumberService;
 
     @Override
-    public int insert(Othsp othsp) {
+    public DocBaseDTO insert(Othsp othsp) {
         Othspendings othspendings = othsp.getMain();
         List<Othspendingsdetail> othspendingsdetails = othsp.getItems();
 
-        if (othspendings.getOsId() > 0){
+        String os_code = othspendings.getOs_code();
+
+        //编号校验
+        os_code = pushMaxnubmer(os_code, othspendings.getId());
+        //单号赋值
+        othspendings.setOs_code(os_code);
+
+        Long id = othspendings.getId();
+
+
+        if (othspendings.getId() > 0){
             othspendingsMapper.updateByPrimaryKeySelective(othspendings);
         }else {
             othspendingsMapper.insert(othspendings);
@@ -41,13 +61,13 @@ public class OthspendingsServiceImpl implements OthspendingsService {
         Iterator isdet = othspendingsdetails.iterator();
         while (isdet.hasNext()){
             Othspendingsdetail othspendingsdetail = (Othspendingsdetail) isdet.next();
-            if (othspendingsdetail.getOsdId() > 0 ){
+            if (othspendingsdetail.getOsd_orid() > 0 ){
                 othspendingsdetailMapper.updateByPrimaryKey(othspendingsdetail);
             }else {
                 othspendingsdetailMapper.insertSelective(othspendingsdetail);
             }
         }
-        return 0;
+        return new DocBaseDTO(id, os_code, BillCodeSeq.OTHSPENDINGS.getCaller());
     }
 
     @Override
@@ -65,12 +85,12 @@ public class OthspendingsServiceImpl implements OthspendingsService {
     public Othsp select(int id) {
         Othsp othsp = new Othsp();
         othsp.setMain(othspendingsMapper.selectByPrimaryKey(id));
-        othsp.setItems((List<Othspendingsdetail>) othspendingsdetailMapper.selectByPrimaryKey(id));
+        othsp.setItems(othspendingsdetailMapper.selectByPrimaryKey(id));
         return othsp;
     }
 
     @Override
-    public PageInfo<Othspendings> selectList(PageRequest page) {
+    public PageInfo<Othspendings> selectList(PageRequest page, ListReqDTO reqDTO) {
         //设置默认分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -78,29 +98,64 @@ public class OthspendingsServiceImpl implements OthspendingsService {
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<Othspendings> othspendings = othspendingsMapper.selectList();
+        List<Othspendings> othspendings = this.getListByMode(reqDTO);
         //取分页信息
         PageInfo<Othspendings> pageInfo = new PageInfo<>(othspendings);
         return pageInfo;
     }
 
-    @Override
-    public void audit(Othsp othsp) {
-        int id = othsp.getMain().getOsId();
-        Othspendings othspendings = othspendingsMapper.selectByPrimaryKey(id);
-        if ( othspendings == null || "".equals(othspendings)){
-            this.insert(othsp);
-        }else {
-            othspendingsMapper.updateByPrimaryKey(othspendings);
+//    @Override
+//    public void audit(Othsp othsp) {
+//        int id = othsp.getMain().getOsId();
+//        Othspendings othspendings = othspendingsMapper.selectByPrimaryKey(id);
+//        if ( othspendings == null || "".equals(othspendings)){
+//            this.insert(othsp);
+//        }else {
+//            othspendingsMapper.updateByPrimaryKey(othspendings);
+//        }
+//    }
+//
+//    @Override
+//    public void unAudit(int id) {
+//        Othspendings othspendings = new Othspendings();
+//        othspendings.setOsId(id);
+//        othspendings.setOsStatus(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
+//        othspendings.setOsStatuscode(Status.UNAUDITED.name());
+//        othspendingsMapper.updateByPrimaryKey(othspendings);
+//    }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: guq
+     * @Date: 2018/10/19
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
         }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? othspendingsMapper.validateCodeWhenInsert(code, companyId) :
+                othspendingsMapper.validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.OTHRECEIPTS.getCaller()).getData();
     }
 
-    @Override
-    public void unAudit(int id) {
-        Othspendings othspendings = new Othspendings();
-        othspendings.setOsId(id);
-        othspendings.setOsStatus(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
-        othspendings.setOsStatuscode(Status.UNAUDITED.name());
-        othspendingsMapper.updateByPrimaryKey(othspendings);
+    private List<Othspendings> getListByMode(ListReqDTO req) {
+        List<Othspendings> othspendingsList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        if (StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
+            othspendingsList = othspendingsMapper.selectOthspendingsBycondition(con, companyId);
+        } else {
+            othspendingsList = othspendingsMapper.selectOthspendingsListByCondition(con, companyId);
+        }
+        return othspendingsList;
     }
 }

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

@@ -2,7 +2,14 @@ package com.usoftchina.saas.money.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+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;
 import com.usoftchina.saas.money.mapper.PaybalanceMapper;
 import com.usoftchina.saas.money.mapper.PaybalancedetMapper;
 import com.usoftchina.saas.money.mapper.PaybalancedetailMapper;
@@ -11,6 +18,7 @@ import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import java.util.Iterator;
 import java.util.List;
@@ -27,21 +35,38 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     private PaybalancedetMapper paybalancedetMapper;
     @Autowired
     private PaybalancedetailMapper paybalancedetailMapper;
+    @Autowired
+    private MaxnumberService maxnumberService;
 
-    public int insert(Pay pay) {
+    public DocBaseDTO insert(Pay pay) {
         Paybalance paybalance = pay.getMain();
         List<Paybalancedet> paybalancedet = pay.getItems1();
         List<Paybalancedetail> paybalancedetail = pay.getItems2();
-        if (paybalance.getPb_id() > 0){
+
+        System.out.println("paybal:"+paybalance);
+        String pb_code = paybalance.getPb_code();
+        //编号校验
+        pb_code = pushMaxnubmer(pb_code, paybalance.getId());
+        //单号赋值
+        paybalance.setPb_code(pb_code);
+
+        Long rbId = paybalance.getId();
+
+        if (paybalance.getId() > 0){
             paybalanceMapper.updateByPrimaryKeySelective(paybalance);
         }else {
-            paybalanceMapper.insert(paybalance);
+            paybalance.setCompanyId(BaseContextHolder.getCompanyId());
+            paybalanceMapper.insertSelective(paybalance);
+            rbId = paybalance.getId();
+            System.out.println("rbid:" + rbId);
         }
 
         Iterator isdet = paybalancedet.iterator();
         while (isdet.hasNext()){
             Paybalancedet paybalancedet1 = (Paybalancedet) isdet.next();
-            if (paybalancedet1.getPdId() > 0 ){
+            paybalancedet1.setPd_rbid(Math.toIntExact(rbId));
+            paybalancedet1.setCompanyId(BaseContextHolder.getCompanyId());
+            if (paybalancedet1.getId() > 0 ){
                 paybalancedetMapper.updateByPrimaryKey(paybalancedet1);
             }else {
                 paybalancedetMapper.insertSelective(paybalancedet1);
@@ -51,20 +76,26 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         Iterator isdetl = paybalancedetail.iterator();
         while (isdetl.hasNext()){
             Paybalancedetail paybalancedetail1 = (Paybalancedetail) isdetl.next();
-            if (paybalancedetail1.getPbdId() > 0 ){
+            paybalancedetail1.setPbd_pbid(Math.toIntExact(rbId));
+            paybalancedetail1.setCompanyId(BaseContextHolder.getCompanyId());
+            if (paybalancedetail1.getId() > 0 ){
                 paybalancedetailMapper.updateByPrimaryKeySelective(paybalancedetail1);
             }else {
                 paybalancedetailMapper.insertSelective(paybalancedetail1);
             }
         }
-        return 0;
+        return new DocBaseDTO(rbId, pb_code, BillCodeSeq.PAYBALANCE.getCaller());
     }
 
 
     @Override
     public void audit(Pay pay) {
-        int id = pay.getMain().getPb_id();
+        Long companyId = BaseContextHolder.getCompanyId();
+        int id = Math.toIntExact(pay.getMain().getId());
         Paybalance paybalance = paybalanceMapper.selectByPrimaryKey(id);
+        paybalance.setPb_status(Status.AUDITED.getDisplay());
+        paybalance.setPb_statuscode(Status.AUDITED.name());
+        paybalance.setCompanyId(companyId);
         if ( paybalance == null || "".equals(paybalance)){
             this.insert(pay);
         }else {
@@ -75,7 +106,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     @Override
     public void unAudit(int id) {
         Paybalance paybalance = new Paybalance();
-        paybalance.setPb_id(id);
+        paybalance.setId(Long.valueOf(id));
         paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.UNAUDITED.name());
         paybalanceMapper.updateByPrimaryKey(paybalance);
@@ -102,7 +133,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         return pay;
     }
 
-    public PageInfo<Paybalance> selectList(PageRequest page){
+    public PageInfo<Paybalance> selectList(PageRequest page, ListReqDTO reqDTO){
         //设置默认分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -110,9 +141,44 @@ public class PaybalanceServiceImpl implements PaybalanceService {
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<Paybalance> paybalances = paybalanceMapper.selectList();
+        List<Paybalance> paybalances = this.getListByMode(reqDTO);
         //取分页信息
         PageInfo<Paybalance> pageInfo = new PageInfo<Paybalance>(paybalances);
         return pageInfo;
     }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: guq
+     * @Date: 2018/10/19
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? paybalanceMapper.validateCodeWhenInsert(code, companyId) :
+                paybalanceMapper.validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.RECBALANCE.getCaller()).getData();
+    }
+
+    private List<Paybalance> getListByMode(ListReqDTO req) {
+        List<Paybalance> paybalanceList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        if (StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
+            paybalanceList = paybalanceMapper.selectPaybalanceBycondition(con, companyId);
+        } else {
+            paybalanceList = paybalanceMapper.selectPaybalanceListByCondition(con, companyId);
+        }
+        return paybalanceList;
+    }
 }

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

@@ -2,7 +2,14 @@ package com.usoftchina.saas.money.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+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;
 import com.usoftchina.saas.money.mapper.RecbalanceMapper;
 import com.usoftchina.saas.money.mapper.RecbalancedetMapper;
 import com.usoftchina.saas.money.mapper.RecbalancedetailMapper;
@@ -11,6 +18,7 @@ import com.usoftchina.saas.money.service.RecbalanceService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import java.util.Iterator;
 import java.util.List;
@@ -27,24 +35,40 @@ public class RecbalanceServiceImpl implements RecbalanceService {
     RecbalancedetMapper recbalancedetMapper;
     @Autowired
     RecbalancedetailMapper recbalancedetailMapper;
+    @Autowired
+    private MaxnumberService maxnumberService;
 
     @Override
-    public int insert(Rec rec) {
+    public DocBaseDTO insert(Rec rec) {
         Recbalance recbalance = rec.getMain();
         List<Recbalancedet> recbalancedet = rec.getItems1();
         List<Recbalancedetail> recbalancedetail = rec.getItems2();
         System.out.println("recbalance:" + recbalance);
 
-        if (recbalance.getRb_id() > 0){
+
+        String pu_code = recbalance.getRb_code();
+
+        //编号校验
+        pu_code = pushMaxnubmer(pu_code, recbalance.getId());
+        //单号赋值
+        recbalance.setRb_code(pu_code);
+
+        Long rbId = recbalance.getId();
+        if (rbId > 0){
             recbalanceMapper.updateByPrimaryKey(recbalance);
         }else {
-            recbalanceMapper.insert(recbalance);
+            recbalance.setCompanyId(BaseContextHolder.getCompanyId());
+            recbalanceMapper.insertSelective(recbalance);
+            rbId = recbalance.getId();
+            System.out.println("rbid:" + rbId);
         }
 
         Iterator isdet = recbalancedet.iterator();
         while (isdet.hasNext()){
             Recbalancedet recbalancedet1 = (Recbalancedet) isdet.next();
-            if (recbalancedet1.getRd_id() > 0 ){
+            recbalancedet1.setRd_rbid(Math.toIntExact(rbId));
+            recbalancedet1.setCompanyId(BaseContextHolder.getCompanyId());
+            if (recbalancedet1.getId() > 0 ){
                 recbalancedetMapper.updateByPrimaryKey(recbalancedet1);
             }else {
                 recbalancedetMapper.insertSelective(recbalancedet1);
@@ -54,13 +78,16 @@ public class RecbalanceServiceImpl implements RecbalanceService {
         Iterator isdetl = recbalancedetail.iterator();
         while (isdetl.hasNext()){
             Recbalancedetail recbalancedetail1 = (Recbalancedetail) isdetl.next();
-            if (recbalancedetail1.getRbdId() > 0 ){
-                recbalancedetailMapper.updateByPrimaryKey(recbalancedetail1);
+            recbalancedetail1.setRbd_rbid(Math.toIntExact(rbId));
+            recbalancedetail1.setCompanyId(BaseContextHolder.getCompanyId());
+            System.out.println("rectail:" + recbalancedetail1);
+            if (recbalancedetail1.getId() > 0 ){
+                recbalancedetailMapper.updateByPrimaryKeySelective(recbalancedetail1);
             }else {
                 recbalancedetailMapper.insertSelective(recbalancedetail1);
             }
         }
-        return 0;
+        return new DocBaseDTO(rbId, pu_code, BillCodeSeq.RECBALANCE.getCaller());
     }
 
     @Override
@@ -73,42 +100,50 @@ public class RecbalanceServiceImpl implements RecbalanceService {
     @Override
     public Rec select(int id) {
         Recbalance recbalance = recbalanceMapper.selectByPrimaryKey(id);
-        Recbalancedet recbalancedet = recbalancedetMapper.selectByPrimaryKey(id);
-        Recbalancedetail recbalancedetail = recbalancedetailMapper.selectByPrimaryKey(id);
+        List<Recbalancedet> recbalancedet = recbalancedetMapper.selectByPrimaryKey(id);
+        List<Recbalancedetail> recbalancedetail = recbalancedetailMapper.selectByPrimaryKey(id);
         Rec rec = new Rec();
         rec.setMain(recbalance);
-        rec.setItems1((List<Recbalancedet>) recbalancedet);
-        rec.setItems2((List<Recbalancedetail>) recbalancedetail);
+        rec.setItems1( recbalancedet);
+        rec.setItems2(recbalancedetail);
         return rec;
     }
 
     @Override
     public void deleteItem(int id) {
-        recbalancedetailMapper.deleteItem(id);
         recbalancedetMapper.deleteItem(id);
     }
 
+    @Override
+    public void deleteItems(int id) {
+        recbalancedetailMapper.deleteItem(id);
+    }
+
     @Override
     public void audit(Rec rec) {
-        int id = rec.getMain().getRb_id();
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer id = Math.toIntExact(rec.getMain().getId());
         Recbalance recbalance = recbalanceMapper.selectByPrimaryKey(id);
+        recbalance.setRb_status(Status.AUDITED.getDisplay());
+        recbalance.setRb_statuscode(Status.AUDITED.name());
+        recbalance.setCompanyId(companyId);
         if ( recbalance == null || "".equals(recbalance)){
             this.insert(rec);
         }else {
-            recbalanceMapper.updateByPrimaryKey(recbalance);
+            recbalanceMapper.updateByPrimaryKeySelective(recbalance);
         }
     }
 
     @Override
-    public void unAudit(int id) {
+    public void unAudit(Long id) {
         Recbalance recbalance = new Recbalance();
-        recbalance.setRb_id(id);
+        recbalance.setId(id);
         recbalance.setRb_status(Status.UNAUDITED.getDisplay());
         recbalance.setRb_statuscode(Status.UNAUDITED.name());
-        recbalanceMapper.updateByPrimaryKey(recbalance);
+        recbalanceMapper.updateByPrimaryKeySelective(recbalance);
     }
 
-    public PageInfo<Recbalance> selectList(PageRequest page) {
+    public PageInfo<Recbalance> selectList(PageRequest page, ListReqDTO reqDTO) {
         //设置默认分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -116,9 +151,44 @@ public class RecbalanceServiceImpl implements RecbalanceService {
             page.setSize(10);
         }
         PageHelper.startPage(page.getNumber(), page.getSize());
-        List<Recbalance> recbalancesList = recbalanceMapper.selectList();
+        List<Recbalance> recbalancesList = this.getListByMode(reqDTO);
         //取分页信息
         PageInfo<Recbalance> pageInfo = new PageInfo<Recbalance>(recbalancesList);
         return pageInfo;
     }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: guq
+     * @Date: 2018/10/19
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? recbalanceMapper.validateCodeWhenInsert(code, companyId) :
+                recbalanceMapper.validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.RECBALANCE.getCaller()).getData();
+    }
+
+    private List<Recbalance> getListByMode(ListReqDTO req) {
+        List<Recbalance> recbalancesList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        if (StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
+            recbalancesList = recbalanceMapper.selectRecbalanceBycondition(con, companyId);
+        } else {
+            recbalancesList = recbalanceMapper.selectRecbalanceListByCondition(con, companyId);
+        }
+        return recbalancesList;
+    }
 }

+ 177 - 144
applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml

@@ -2,30 +2,30 @@
 <!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.OthreceiptsMapper" >
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Othreceipts" >
-    <id column="or_id" property="orId" jdbcType="INTEGER" />
-    <result column="or_code" property="orCode" jdbcType="VARCHAR" />
-    <result column="or_date" property="orDate" jdbcType="TIMESTAMP" />
-    <result column="or_custid" property="orCustid" jdbcType="INTEGER" />
-    <result column="or_custcode" property="orCustcode" jdbcType="VARCHAR" />
-    <result column="or_custname" property="orCustname" jdbcType="VARCHAR" />
-    <result column="or_bankcode" property="orBankcode" jdbcType="VARCHAR" />
-    <result column="or_bankid" property="orBankid" jdbcType="INTEGER" />
-    <result column="or_bankname" property="orBankname" jdbcType="VARCHAR" />
-    <result column="or_amount" property="orAmount" jdbcType="DOUBLE" />
-    <result column="or_recorderid" property="orRecorderid" jdbcType="INTEGER" />
-    <result column="or_recorder" property="orRecorder" jdbcType="VARCHAR" />
-    <result column="or_recorddate" property="orRecorddate" jdbcType="TIMESTAMP" />
-    <result column="or_status" property="orStatus" jdbcType="VARCHAR" />
-    <result column="or_statuscode" property="orStatuscode" jdbcType="VARCHAR" />
-    <result column="or_remark" property="orRemark" jdbcType="VARCHAR" />
-    <result column="companyId" property="companyid" jdbcType="INTEGER" />
-    <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
+    <id column="or_id" property="id" jdbcType="INTEGER" />
+    <result column="or_code" property="or_code" jdbcType="VARCHAR" />
+    <result column="or_date" property="or_date" jdbcType="TIMESTAMP" />
+    <result column="or_custid" property="or_custid" jdbcType="INTEGER" />
+    <result column="or_custcode" property="or_custcode" jdbcType="VARCHAR" />
+    <result column="or_custname" property="or_custname" jdbcType="VARCHAR" />
+    <result column="or_bankcode" property="or_bankcode" jdbcType="VARCHAR" />
+    <result column="or_bankid" property="or_bankid" jdbcType="INTEGER" />
+    <result column="or_bankname" property="or_bankname" jdbcType="VARCHAR" />
+    <result column="or_amount" property="or_amount" jdbcType="DOUBLE" />
+    <result column="or_recorderid" property="or_recorderid" jdbcType="INTEGER" />
+    <result column="or_recorder" property="or_recorder" jdbcType="VARCHAR" />
+    <result column="or_recorddate" property="or_recorddate" jdbcType="TIMESTAMP" />
+    <result column="or_status" property="or_status" jdbcType="VARCHAR" />
+    <result column="or_statuscode" property="or_statuscode" jdbcType="VARCHAR" />
+    <result column="or_remark" property="or_remark" 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="or_text1" property="orText1" jdbcType="VARCHAR" />
-    <result column="or_text2" property="orText2" jdbcType="VARCHAR" />
-    <result column="or_text3" property="orText3" jdbcType="VARCHAR" />
-    <result column="or_text4" property="orText4" jdbcType="VARCHAR" />
-    <result column="or_text5" property="orText5" jdbcType="VARCHAR" />
+    <result column="or_text1" property="or_text1" jdbcType="VARCHAR" />
+    <result column="or_text2" property="or_text2" jdbcType="VARCHAR" />
+    <result column="or_text3" property="or_text3" jdbcType="VARCHAR" />
+    <result column="or_text4" property="or_text4" jdbcType="VARCHAR" />
+    <result column="or_text5" property="or_text5" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     or_id, or_code, or_date, or_custid, or_custcode, or_custname, or_bankcode, or_bankid, 
@@ -37,7 +37,7 @@
     select 
     <include refid="Base_Column_List" />
     from othreceipts
-    where or_id = #{orId,jdbcType=INTEGER}
+    where or_id = #{id,jdbcType=INTEGER}
   </select>
 
   <select id="selectList" resultMap="BaseResultMap">
@@ -48,7 +48,7 @@
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from othreceipts
-    where or_id = #{orId,jdbcType=INTEGER}
+    where or_id = #{id,jdbcType=INTEGER}
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Othreceipts" >
     insert into othreceipts (or_id, or_code, or_date, 
@@ -65,7 +65,7 @@
       #{orBankcode,jdbcType=VARCHAR}, #{orBankid,jdbcType=INTEGER}, #{orBankname,jdbcType=VARCHAR}, 
       #{orAmount,jdbcType=DOUBLE}, #{orRecorderid,jdbcType=INTEGER}, #{orRecorder,jdbcType=VARCHAR}, 
       #{orRecorddate,jdbcType=TIMESTAMP}, #{orStatus,jdbcType=INTEGER}, #{orStatuscode,jdbcType=DECIMAL}, 
-      #{orRemark,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
+      #{orRemark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
       #{updatedate,jdbcType=TIMESTAMP}, #{orText1,jdbcType=VARCHAR}, #{orText2,jdbcType=VARCHAR}, 
       #{orText3,jdbcType=VARCHAR}, #{orText4,jdbcType=VARCHAR}, #{orText5,jdbcType=VARCHAR}
       )
@@ -73,228 +73,225 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Othreceipts" >
     insert into othreceipts
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="orId != null" >
-        or_id,
-      </if>
-      <if test="orCode != null" >
+      <if test="or_code != null" >
         or_code,
       </if>
-      <if test="orDate != null" >
+      <if test="or_date != null" >
         or_date,
       </if>
-      <if test="orCustid != null" >
+      <if test="or_custid != null" >
         or_custid,
       </if>
-      <if test="orCustcode != null" >
+      <if test="or_custcode != null" >
         or_custcode,
       </if>
-      <if test="orCustname != null" >
+      <if test="or_custname != null" >
         or_custname,
       </if>
-      <if test="orBankcode != null" >
+      <if test="or_bankcode != null" >
         or_bankcode,
       </if>
-      <if test="orBankid != null" >
+      <if test="or_bankid != null" >
         or_bankid,
       </if>
-      <if test="orBankname != null" >
+      <if test="or_bankname != null" >
         or_bankname,
       </if>
-      <if test="orAmount != null" >
+      <if test="or_amount != null" >
         or_amount,
       </if>
-      <if test="orRecorderid != null" >
+      <if test="or_recorderid != null" >
         or_recorderid,
       </if>
-      <if test="orRecorder != null" >
+      <if test="or_recorder != null" >
         or_recorder,
       </if>
-      <if test="orRecorddate != null" >
+      <if test="or_recorddate != null" >
         or_recorddate,
       </if>
-      <if test="orStatus != null" >
+      <if test="or_status != null" >
         or_status,
       </if>
-      <if test="orStatuscode != null" >
+      <if test="or_statuscode != null" >
         or_statuscode,
       </if>
-      <if test="orRemark != null" >
+      <if test="or_remark != null" >
         or_remark,
       </if>
-      <if test="companyid != null" >
+      <if test="companyId != null" >
         companyId,
       </if>
-      <if test="updaterid != null" >
+      <if test="updaterId != null" >
         updaterId,
       </if>
       <if test="updatedate != null" >
         updatedate,
       </if>
-      <if test="orText1 != null" >
+      <if test="or_text1 != null" >
         or_text1,
       </if>
-      <if test="orText2 != null" >
+      <if test="or_text2 != null" >
         or_text2,
       </if>
-      <if test="orText3 != null" >
+      <if test="or_text3 != null" >
         or_text3,
       </if>
-      <if test="orText4 != null" >
+      <if test="or_text4 != null" >
         or_text4,
       </if>
-      <if test="orText5 != null" >
+      <if test="or_text5 != null" >
         or_text5,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="orId != null" >
-        #{orId,jdbcType=INTEGER},
+      <if test="or_code != null" >
+        #{or_code,jdbcType=VARCHAR},
       </if>
-      <if test="orCode != null" >
-        #{orCode,jdbcType=VARCHAR},
+      <if test="or_date != null" >
+        #{or_date,jdbcType=TIMESTAMP},
       </if>
-      <if test="orDate != null" >
-        #{orDate,jdbcType=TIMESTAMP},
+      <if test="or_custid != null" >
+        #{or_custid,jdbcType=INTEGER},
       </if>
-      <if test="orCustid != null" >
-        #{orCustid,jdbcType=INTEGER},
+      <if test="or_custcode != null" >
+        #{or_custcode,jdbcType=VARCHAR},
       </if>
-      <if test="orCustcode != null" >
-        #{orCustcode,jdbcType=VARCHAR},
+      <if test="or_custname != null" >
+        #{or_custname,jdbcType=VARCHAR},
       </if>
-      <if test="orCustname != null" >
-        #{orCustname,jdbcType=VARCHAR},
+      <if test="or_bankcode != null" >
+        #{or_bankcode,jdbcType=VARCHAR},
       </if>
-      <if test="orBankcode != null" >
-        #{orBankcode,jdbcType=VARCHAR},
+      <if test="or_bankid != null" >
+        #{or_bankid,jdbcType=INTEGER},
       </if>
-      <if test="orBankid != null" >
-        #{orBankid,jdbcType=INTEGER},
+      <if test="or_bankname != null" >
+        #{or_bankname,jdbcType=VARCHAR},
       </if>
-      <if test="orBankname != null" >
-        #{orBankname,jdbcType=VARCHAR},
+      <if test="or_amount != null" >
+        #{or_amount,jdbcType=DOUBLE},
       </if>
-      <if test="orAmount != null" >
-        #{orAmount,jdbcType=DOUBLE},
+      <if test="or_recorderid != null" >
+        #{or_recorderid,jdbcType=INTEGER},
       </if>
-      <if test="orRecorderid != null" >
-        #{orRecorderid,jdbcType=INTEGER},
+      <if test="or_recorder != null" >
+        #{or_recorder,jdbcType=VARCHAR},
       </if>
-      <if test="orRecorder != null" >
-        #{orRecorder,jdbcType=VARCHAR},
+      <if test="or_recorddate != null" >
+        #{or_recorddate,jdbcType=TIMESTAMP},
       </if>
-      <if test="orRecorddate != null" >
-        #{orRecorddate,jdbcType=TIMESTAMP},
+      <if test="or_status != null" >
+        #{or_status,jdbcType=VARCHAR},
       </if>
-      <if test="orStatus != null" >
-        #{orStatus,jdbcType=INTEGER},
+      <if test="or_statuscode != null" >
+        #{or_statuscode,jdbcType=VARCHAR},
       </if>
-      <if test="orStatuscode != null" >
-        #{orStatuscode,jdbcType=DECIMAL},
+      <if test="or_remark != null" >
+        #{or_remark,jdbcType=VARCHAR},
       </if>
-      <if test="orRemark != null" >
-        #{orRemark,jdbcType=VARCHAR},
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="companyid != null" >
-        #{companyid,jdbcType=INTEGER},
-      </if>
-      <if test="updaterid != null" >
-        #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="orText1 != null" >
-        #{orText1,jdbcType=VARCHAR},
+      <if test="or_text1 != null" >
+        #{or_text1,jdbcType=VARCHAR},
       </if>
-      <if test="orText2 != null" >
-        #{orText2,jdbcType=VARCHAR},
+      <if test="or_text2 != null" >
+        #{or_text2,jdbcType=VARCHAR},
       </if>
-      <if test="orText3 != null" >
-        #{orText3,jdbcType=VARCHAR},
+      <if test="or_text3 != null" >
+        #{or_text3,jdbcType=VARCHAR},
       </if>
-      <if test="orText4 != null" >
-        #{orText4,jdbcType=VARCHAR},
+      <if test="or_text4 != null" >
+        #{or_text4,jdbcType=VARCHAR},
       </if>
-      <if test="orText5 != null" >
-        #{orText5,jdbcType=VARCHAR},
+      <if test="or_text5 != null" >
+        #{or_text5,jdbcType=VARCHAR},
       </if>
     </trim>
+    <selectKey resultType="Long" keyProperty="id" order="AFTER">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Othreceipts" >
     update othreceipts
     <set >
-      <if test="orCode != null" >
-        or_code = #{orCode,jdbcType=VARCHAR},
+      <if test="or_code != null" >
+        or_code = #{or_code,jdbcType=VARCHAR},
       </if>
-      <if test="orDate != null" >
-        or_date = #{orDate,jdbcType=TIMESTAMP},
+      <if test="or_date != null" >
+        or_date = #{or_date,jdbcType=TIMESTAMP},
       </if>
-      <if test="orCustid != null" >
-        or_custid = #{orCustid,jdbcType=INTEGER},
+      <if test="or_custid != null" >
+        or_custid = #{or_custid,jdbcType=INTEGER},
       </if>
-      <if test="orCustcode != null" >
-        or_custcode = #{orCustcode,jdbcType=VARCHAR},
+      <if test="or_custcode != null" >
+        or_custcode = #{or_custcode,jdbcType=VARCHAR},
       </if>
-      <if test="orCustname != null" >
-        or_custname = #{orCustname,jdbcType=VARCHAR},
+      <if test="or_custname != null" >
+        or_custname = #{or_custname,jdbcType=VARCHAR},
       </if>
-      <if test="orBankcode != null" >
-        or_bankcode = #{orBankcode,jdbcType=VARCHAR},
+      <if test="or_bankcode != null" >
+        or_bankcode = #{or_bankcode,jdbcType=VARCHAR},
       </if>
-      <if test="orBankid != null" >
-        or_bankid = #{orBankid,jdbcType=INTEGER},
+      <if test="or_bankid != null" >
+        or_bankid = #{or_bankid,jdbcType=INTEGER},
       </if>
-      <if test="orBankname != null" >
-        or_bankname = #{orBankname,jdbcType=VARCHAR},
+      <if test="or_bankname != null" >
+        or_bankname = #{or_bankname,jdbcType=VARCHAR},
       </if>
-      <if test="orAmount != null" >
-        or_amount = #{orAmount,jdbcType=DOUBLE},
+      <if test="or_amount != null" >
+        or_amount = #{or_amount,jdbcType=DOUBLE},
       </if>
-      <if test="orRecorderid != null" >
-        or_recorderid = #{orRecorderid,jdbcType=INTEGER},
+      <if test="or_recorderid != null" >
+        or_recorderid = #{or_recorderid,jdbcType=INTEGER},
       </if>
-      <if test="orRecorder != null" >
-        or_recorder = #{orRecorder,jdbcType=VARCHAR},
+      <if test="or_recorder != null" >
+        or_recorder = #{or_recorder,jdbcType=VARCHAR},
       </if>
-      <if test="orRecorddate != null" >
-        or_recorddate = #{orRecorddate,jdbcType=TIMESTAMP},
+      <if test="or_recorddate != null" >
+        or_recorddate = #{or_recorddate,jdbcType=TIMESTAMP},
       </if>
-      <if test="orStatus != null" >
-        or_status = #{orStatus,jdbcType=INTEGER},
+      <if test="or_status != null" >
+        or_status = #{or_status,jdbcType=VARCHAR},
       </if>
-      <if test="orStatuscode != null" >
-        or_statuscode = #{orStatuscode,jdbcType=DECIMAL},
+      <if test="or_statuscode != null" >
+        or_statuscode = #{or_statuscode,jdbcType=VARCHAR},
       </if>
-      <if test="orRemark != null" >
-        or_remark = #{orRemark,jdbcType=VARCHAR},
+      <if test="or_remark != null" >
+        or_remark = #{or_remark,jdbcType=VARCHAR},
       </if>
-      <if test="companyid != null" >
-        companyId = #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null" >
-        updaterId = #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         updatedate = #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="orText1 != null" >
-        or_text1 = #{orText1,jdbcType=VARCHAR},
+      <if test="or_text1 != null" >
+        or_text1 = #{or_text1,jdbcType=VARCHAR},
       </if>
-      <if test="orText2 != null" >
-        or_text2 = #{orText2,jdbcType=VARCHAR},
+      <if test="or_text2 != null" >
+        or_text2 = #{or_text2,jdbcType=VARCHAR},
       </if>
-      <if test="orText3 != null" >
-        or_text3 = #{orText3,jdbcType=VARCHAR},
+      <if test="or_text3 != null" >
+        or_text3 = #{or_text3,jdbcType=VARCHAR},
       </if>
-      <if test="orText4 != null" >
-        or_text4 = #{orText4,jdbcType=VARCHAR},
+      <if test="or_text4 != null" >
+        or_text4 = #{or_text4,jdbcType=VARCHAR},
       </if>
-      <if test="orText5 != null" >
-        or_text5 = #{orText5,jdbcType=VARCHAR},
+      <if test="or_text5 != null" >
+        or_text5 = #{or_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where or_id = #{orId,jdbcType=INTEGER}
+    where or_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Othreceipts" >
     update othreceipts
@@ -313,7 +310,7 @@
       or_status = #{orStatus,jdbcType=INTEGER},
       or_statuscode = #{orStatuscode,jdbcType=DECIMAL},
       or_remark = #{orRemark,jdbcType=VARCHAR},
-      companyId = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterid,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP},
       or_text1 = #{orText1,jdbcType=VARCHAR},
@@ -323,4 +320,40 @@
       or_text5 = #{orText5,jdbcType=VARCHAR}
     where or_id = #{orId,jdbcType=INTEGER}
   </update>
+
+  <select id="validateCodeWhenInsert" resultType="int">
+    select count(1) from othreceipts where or_code = #{code} and companyId =#{companyId}
+  </select>
+  <select id="validateCodeWhenUpdate" resultType="int" >
+    select count(1) from othreceipts where or_code = #{code} and or_id != #{id} and companyId =#{companyId}
+  </select>
+
+  <select id="selectOthreceiptsBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from Othreceipts
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   othreceipts.companyId = #{companyId}
+      </if>
+    </where>  order by or_id
+  </select>
+
+  <select id="selectOthreceiptsListByCondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from Othreceipts
+    left join othreceiptsdetail on or_id=ord_orid 
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   othreceipts.companyId = #{companyId}
+      </if>
+    </where>  order by or_id
+  </select>
 </mapper>

+ 80 - 95
applications/money/money-server/src/main/resources/mapper/OthreceiptsdetailMapper.xml

@@ -2,21 +2,21 @@
 <!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.OthreceiptsdetailMapper" >
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Othreceiptsdetail" >
-    <id column="ord_id" property="ordId" jdbcType="INTEGER" />
-    <result column="ord_orid" property="ordOrid" jdbcType="INTEGER" />
-    <result column="ord_detno" property="ordDetno" jdbcType="INTEGER" />
-    <result column="ord_ym" property="ordYm" jdbcType="INTEGER" />
-    <result column="ord_type" property="ordType" jdbcType="VARCHAR" />
-    <result column="ord_nowbalance" property="ordNowbalance" jdbcType="DOUBLE" />
-    <result column="ord_remark" property="ordRemark" jdbcType="VARCHAR" />
-    <result column="companyId" property="companyid" jdbcType="INTEGER" />
-    <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
+    <id column="ord_id" property="id" jdbcType="INTEGER" />
+    <result column="ord_orid" property="ord_orid" jdbcType="INTEGER" />
+    <result column="ord_detno" property="ord_detno" jdbcType="INTEGER" />
+    <result column="ord_ym" property="ord_ym" jdbcType="INTEGER" />
+    <result column="ord_type" property="ord_type" jdbcType="VARCHAR" />
+    <result column="ord_nowbalance" property="ord_nowbalance" jdbcType="DOUBLE" />
+    <result column="ord_remark" property="ord_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updatedate" property="updatedate" jdbcType="TIMESTAMP" />
-    <result column="ord_text1" property="ordText1" jdbcType="VARCHAR" />
-    <result column="ord_text2" property="ordText2" jdbcType="VARCHAR" />
-    <result column="ord_text3" property="ordText3" jdbcType="VARCHAR" />
-    <result column="ord_text4" property="ordText4" jdbcType="VARCHAR" />
-    <result column="ord_text5" property="ordText5" jdbcType="VARCHAR" />
+    <result column="ord_text1" property="ord_text1" jdbcType="VARCHAR" />
+    <result column="ord_text2" property="ord_text2" jdbcType="VARCHAR" />
+    <result column="ord_text3" property="ord_text3" jdbcType="VARCHAR" />
+    <result column="ord_text4" property="ord_text4" jdbcType="VARCHAR" />
+    <result column="ord_text5" property="ord_text5" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     ord_id, ord_orid, ord_detno, ord_ym, ord_type, ord_nowbalance, ord_remark, companyId, 
@@ -26,16 +26,16 @@
     select 
     <include refid="Base_Column_List" />
     from othreceiptsdetail
-    where ord_id = #{ordId,jdbcType=INTEGER}
+    where ord_id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from othreceiptsdetail
-    where ord_orid = #{ordOrid,jdbcType=INTEGER}
+    where ord_orid = #{id,jdbcType=INTEGER}
   </delete>
 
   <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from othreceiptsdetail
-    where ord_orid = #{ordOrid,jdbcType=INTEGER}
+    where ord_id = #{id,jdbcType=INTEGER}
   </delete>
 
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Othreceiptsdetail" >
@@ -47,7 +47,7 @@
       )
     values (#{ordId,jdbcType=INTEGER}, #{ordOrid,jdbcType=INTEGER}, #{ordDetno,jdbcType=INTEGER}, 
       #{ordYm,jdbcType=INTEGER}, #{ordType,jdbcType=VARCHAR}, #{ordNowbalance,jdbcType=DOUBLE}, 
-      #{ordRemark,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
+      #{ordRemark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
       #{updatedate,jdbcType=TIMESTAMP}, #{ordText1,jdbcType=VARCHAR}, #{ordText2,jdbcType=VARCHAR}, 
       #{ordText3,jdbcType=VARCHAR}, #{ordText4,jdbcType=VARCHAR}, #{ordText5,jdbcType=VARCHAR}
       )
@@ -55,147 +55,132 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Othreceiptsdetail" >
     insert into othreceiptsdetail
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="ordId != null" >
-        ord_id,
-      </if>
-      <if test="ordOrid != null" >
-        ord_orid,
-      </if>
-      <if test="ordDetno != null" >
+      <if test="ord_detno != null" >
         ord_detno,
       </if>
-      <if test="ordYm != null" >
+      <if test="ord_ym != null" >
         ord_ym,
       </if>
-      <if test="ordType != null" >
+      <if test="ord_type != null" >
         ord_type,
       </if>
-      <if test="ordNowbalance != null" >
+      <if test="ord_nowbalance != null" >
         ord_nowbalance,
       </if>
-      <if test="ordRemark != null" >
+      <if test="ord_remark != null" >
         ord_remark,
       </if>
-      <if test="companyid != null" >
+      <if test="companyId != null" >
         companyId,
       </if>
-      <if test="updaterid != null" >
+      <if test="updaterId != null" >
         updaterId,
       </if>
       <if test="updatedate != null" >
         updatedate,
       </if>
-      <if test="ordText1 != null" >
+      <if test="ord_text1 != null" >
         ord_text1,
       </if>
-      <if test="ordText2 != null" >
+      <if test="ord_text2 != null" >
         ord_text2,
       </if>
-      <if test="ordText3 != null" >
+      <if test="ord_text3 != null" >
         ord_text3,
       </if>
-      <if test="ordText4 != null" >
+      <if test="ord_text4 != null" >
         ord_text4,
       </if>
-      <if test="ordText5 != null" >
+      <if test="ord_text5 != null" >
         ord_text5,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="ordId != null" >
-        #{ordId,jdbcType=INTEGER},
-      </if>
-      <if test="ordOrid != null" >
-        #{ordOrid,jdbcType=INTEGER},
+      <if test="ord_detno != null" >
+        #{ord_detno,jdbcType=INTEGER},
       </if>
-      <if test="ordDetno != null" >
-        #{ordDetno,jdbcType=INTEGER},
+      <if test="ord_ym != null" >
+        #{ord_ym,jdbcType=INTEGER},
       </if>
-      <if test="ordYm != null" >
-        #{ordYm,jdbcType=INTEGER},
+      <if test="ord_type != null" >
+        #{ord_type,jdbcType=VARCHAR},
       </if>
-      <if test="ordType != null" >
-        #{ordType,jdbcType=VARCHAR},
+      <if test="ord_nowbalance != null" >
+        #{ord_nowbalance,jdbcType=DOUBLE},
       </if>
-      <if test="ordNowbalance != null" >
-        #{ordNowbalance,jdbcType=DOUBLE},
+      <if test="ord_remark != null" >
+        #{ord_remark,jdbcType=VARCHAR},
       </if>
-      <if test="ordRemark != null" >
-        #{ordRemark,jdbcType=VARCHAR},
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="companyid != null" >
-        #{companyid,jdbcType=INTEGER},
-      </if>
-      <if test="updaterid != null" >
-        #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="ordText1 != null" >
-        #{ordText1,jdbcType=VARCHAR},
+      <if test="ord_text1 != null" >
+        #{ord_text1,jdbcType=VARCHAR},
       </if>
-      <if test="ordText2 != null" >
-        #{ordText2,jdbcType=VARCHAR},
+      <if test="ord_text2 != null" >
+        #{ord_text2,jdbcType=VARCHAR},
       </if>
-      <if test="ordText3 != null" >
-        #{ordText3,jdbcType=VARCHAR},
+      <if test="ord_text3 != null" >
+        #{ord_text3,jdbcType=VARCHAR},
       </if>
-      <if test="ordText4 != null" >
-        #{ordText4,jdbcType=VARCHAR},
+      <if test="ord_text4 != null" >
+        #{ord_text4,jdbcType=VARCHAR},
       </if>
-      <if test="ordText5 != null" >
-        #{ordText5,jdbcType=VARCHAR},
+      <if test="ord_text5 != null" >
+        #{ord_text5,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Othreceiptsdetail" >
     update othreceiptsdetail
     <set >
-      <if test="ordOrid != null" >
-        ord_orid = #{ordOrid,jdbcType=INTEGER},
-      </if>
-      <if test="ordDetno != null" >
-        ord_detno = #{ordDetno,jdbcType=INTEGER},
+      <if test="ord_detno != null" >
+        ord_detno = #{ord_detno,jdbcType=INTEGER},
       </if>
-      <if test="ordYm != null" >
-        ord_ym = #{ordYm,jdbcType=INTEGER},
+      <if test="ord_ym != null" >
+        ord_ym = #{ord_ym,jdbcType=INTEGER},
       </if>
-      <if test="ordType != null" >
-        ord_type = #{ordType,jdbcType=VARCHAR},
+      <if test="ord_type != null" >
+        ord_type = #{ord_type,jdbcType=VARCHAR},
       </if>
-      <if test="ordNowbalance != null" >
-        ord_nowbalance = #{ordNowbalance,jdbcType=DOUBLE},
+      <if test="ord_nowbalance != null" >
+        ord_nowbalance = #{ord_nowbalance,jdbcType=DOUBLE},
       </if>
-      <if test="ordRemark != null" >
-        ord_remark = #{ordRemark,jdbcType=VARCHAR},
+      <if test="ord_remark != null" >
+        ord_remark = #{ord_remark,jdbcType=VARCHAR},
       </if>
-      <if test="companyid != null" >
-        companyId = #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null" >
-        updaterId = #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         updatedate = #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="ordText1 != null" >
-        ord_text1 = #{ordText1,jdbcType=VARCHAR},
+      <if test="ord_text1 != null" >
+        ord_text1 = #{ord_text1,jdbcType=VARCHAR},
       </if>
-      <if test="ordText2 != null" >
-        ord_text2 = #{ordText2,jdbcType=VARCHAR},
+      <if test="ord_text2 != null" >
+        ord_text2 = #{ord_text2,jdbcType=VARCHAR},
       </if>
-      <if test="ordText3 != null" >
-        ord_text3 = #{ordText3,jdbcType=VARCHAR},
+      <if test="ord_text3 != null" >
+        ord_text3 = #{ord_text3,jdbcType=VARCHAR},
       </if>
-      <if test="ordText4 != null" >
-        ord_text4 = #{ordText4,jdbcType=VARCHAR},
+      <if test="ord_text4 != null" >
+        ord_text4 = #{ord_text4,jdbcType=VARCHAR},
       </if>
-      <if test="ordText5 != null" >
-        ord_text5 = #{ordText5,jdbcType=VARCHAR},
+      <if test="ord_text5 != null" >
+        ord_text5 = #{ord_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where ord_id = #{ordId,jdbcType=INTEGER}
+    where ord_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Othreceiptsdetail" >
     update othreceiptsdetail
@@ -205,7 +190,7 @@
       ord_type = #{ordType,jdbcType=VARCHAR},
       ord_nowbalance = #{ordNowbalance,jdbcType=DOUBLE},
       ord_remark = #{ordRemark,jdbcType=VARCHAR},
-      companyId = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterid,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP},
       ord_text1 = #{ordText1,jdbcType=VARCHAR},

+ 69 - 39
applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml

@@ -2,30 +2,30 @@
 <!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.OthspendingsMapper" >
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Othspendings" >
-    <id column="os_id" property="osId" jdbcType="INTEGER" />
-    <result column="os_code" property="osCode" jdbcType="VARCHAR" />
-    <result column="os_date" property="osDate" jdbcType="TIMESTAMP" />
-    <result column="os_vendid" property="osVendid" jdbcType="INTEGER" />
-    <result column="os_vendcode" property="osVendcode" jdbcType="VARCHAR" />
-    <result column="os_vendname" property="osVendname" jdbcType="VARCHAR" />
-    <result column="os_bankid" property="osBankid" jdbcType="INTEGER" />
-    <result column="os_bankcode" property="osBankcode" jdbcType="VARCHAR" />
-    <result column="os_bankname" property="osBankname" jdbcType="VARCHAR" />
-    <result column="os_amount" property="osAmount" jdbcType="DOUBLE" />
-    <result column="os_recorderid" property="osRecorderid" jdbcType="INTEGER" />
-    <result column="os_recorder" property="osRecorder" jdbcType="VARCHAR" />
-    <result column="os_recorddate" property="osRecorddate" jdbcType="TIMESTAMP" />
-    <result column="os_status" property="osStatus" jdbcType="VARCHAR" />
-    <result column="os_statuscode" property="osStatuscode" jdbcType="VARCHAR" />
-    <result column="os_remark" property="osRemark" jdbcType="VARCHAR" />
-    <result column="companyId" property="companyid" jdbcType="INTEGER" />
-    <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
+    <id column="os_id" property="id" jdbcType="INTEGER" />
+    <result column="os_code" property="os_code" jdbcType="VARCHAR" />
+    <result column="os_date" property="os_date" jdbcType="TIMESTAMP" />
+    <result column="os_vendid" property="os_vendid" jdbcType="INTEGER" />
+    <result column="os_vendcode" property="os_vendcode" jdbcType="VARCHAR" />
+    <result column="os_vendname" property="os_vendname" jdbcType="VARCHAR" />
+    <result column="os_bankid" property="os_bankid" jdbcType="INTEGER" />
+    <result column="os_bankcode" property="os_bankcode" jdbcType="VARCHAR" />
+    <result column="os_bankname" property="os_bankname" jdbcType="VARCHAR" />
+    <result column="os_amount" property="os_amount" jdbcType="DOUBLE" />
+    <result column="os_recorderid" property="os_recorderid" jdbcType="INTEGER" />
+    <result column="os_recorder" property="os_recorder" jdbcType="VARCHAR" />
+    <result column="os_recorddate" property="os_recorddate" jdbcType="TIMESTAMP" />
+    <result column="os_status" property="os_status" jdbcType="VARCHAR" />
+    <result column="os_statuscode" property="os_statuscode" jdbcType="VARCHAR" />
+    <result column="os_remark" property="os_remark" 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="os_text1" property="osText1" jdbcType="VARCHAR" />
-    <result column="os_text2" property="osText2" jdbcType="VARCHAR" />
-    <result column="os_text3" property="osText3" jdbcType="VARCHAR" />
-    <result column="os_text4" property="osText4" jdbcType="VARCHAR" />
-    <result column="os_text5" property="osText5" jdbcType="VARCHAR" />
+    <result column="os_text1" property="os_text1" jdbcType="VARCHAR" />
+    <result column="os_text2" property="os_text2" jdbcType="VARCHAR" />
+    <result column="os_text3" property="os_text3" jdbcType="VARCHAR" />
+    <result column="os_text4" property="os_text4" jdbcType="VARCHAR" />
+    <result column="os_text5" property="os_text5" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     os_id, os_code, os_date, os_vendid, os_vendcode, os_vendname, os_bankid, os_bankcode, 
@@ -37,11 +37,11 @@
     select 
     <include refid="Base_Column_List" />
     from othspendings
-    where os_id = #{osId,jdbcType=INTEGER}
+    where os_id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from othspendings
-    where os_id = #{osId,jdbcType=INTEGER}
+    where os_id = #{id,jdbcType=INTEGER}
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Othspendings" >
     insert into othspendings (os_id, os_code, os_date, 
@@ -58,7 +58,7 @@
       #{osBankid,jdbcType=INTEGER}, #{osBankcode,jdbcType=VARCHAR}, #{osBankname,jdbcType=VARCHAR}, 
       #{osAmount,jdbcType=DOUBLE}, #{osRecorderid,jdbcType=INTEGER}, #{osRecorder,jdbcType=VARCHAR}, 
       #{osRecorddate,jdbcType=TIMESTAMP}, #{osStatus,jdbcType=INTEGER}, #{osStatuscode,jdbcType=DECIMAL}, 
-      #{osRemark,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
+      #{osRemark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
       #{updatedate,jdbcType=TIMESTAMP}, #{osText1,jdbcType=VARCHAR}, #{osText2,jdbcType=VARCHAR}, 
       #{osText3,jdbcType=VARCHAR}, #{osText4,jdbcType=VARCHAR}, #{osText5,jdbcType=VARCHAR}
       )
@@ -66,9 +66,6 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Othspendings" >
     insert into othspendings
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="osId != null" >
-        os_id,
-      </if>
       <if test="osCode != null" >
         os_code,
       </if>
@@ -114,7 +111,7 @@
       <if test="osRemark != null" >
         os_remark,
       </if>
-      <if test="companyid != null" >
+      <if test="companyId != null" >
         companyId,
       </if>
       <if test="updaterid != null" >
@@ -140,9 +137,6 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="osId != null" >
-        #{osId,jdbcType=INTEGER},
-      </if>
       <if test="osCode != null" >
         #{osCode,jdbcType=VARCHAR},
       </if>
@@ -188,8 +182,8 @@
       <if test="osRemark != null" >
         #{osRemark,jdbcType=VARCHAR},
       </if>
-      <if test="companyid != null" >
-        #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
       </if>
       <if test="updaterid != null" >
         #{updaterid,jdbcType=INTEGER},
@@ -262,8 +256,8 @@
       <if test="osRemark != null" >
         os_remark = #{osRemark,jdbcType=VARCHAR},
       </if>
-      <if test="companyid != null" >
-        companyId = #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
       </if>
       <if test="updaterid != null" >
         updaterId = #{updaterid,jdbcType=INTEGER},
@@ -287,7 +281,7 @@
         os_text5 = #{osText5,jdbcType=VARCHAR},
       </if>
     </set>
-    where os_id = #{osId,jdbcType=INTEGER}
+    where os_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Othspendings" >
     update othspendings
@@ -306,7 +300,7 @@
       os_status = #{osStatus,jdbcType=INTEGER},
       os_statuscode = #{osStatuscode,jdbcType=DECIMAL},
       os_remark = #{osRemark,jdbcType=VARCHAR},
-      companyId = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterid,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP},
       os_text1 = #{osText1,jdbcType=VARCHAR},
@@ -316,4 +310,40 @@
       os_text5 = #{osText5,jdbcType=VARCHAR}
     where os_id = #{osId,jdbcType=INTEGER}
   </update>
+
+  <select id="validateCodeWhenInsert" resultType="int">
+    select count(1) from othspendings where os_code = #{code} and companyId =#{companyId}
+  </select>
+  <select id="validateCodeWhenUpdate" resultType="int" >
+    select count(1) from othspendings where os_code = #{code} and os_id != #{id} and companyId =#{companyId}
+  </select>
+
+  <select id="selectOthspendingsBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from Othspendings
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   othspendings.companyId = #{companyId}
+      </if>
+    </where>  order by os_id
+  </select>
+
+  <select id="selectOthspendingsListByCondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from Othspendings
+    left join othspendingsdetail on os_id=osd_orid
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   othspendings.companyId = #{companyId}
+      </if>
+    </where>  order by os_id
+  </select>
 </mapper>

+ 85 - 91
applications/money/money-server/src/main/resources/mapper/OthspendingsdetailMapper.xml

@@ -2,21 +2,21 @@
 <!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.OthspendingsdetailMapper" >
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Othspendingsdetail" >
-    <id column="osd_id" property="osdId" jdbcType="INTEGER" />
-    <result column="osd_orid" property="osdOrid" jdbcType="INTEGER" />
-    <result column="osd_detno" property="osdDetno" jdbcType="INTEGER" />
-    <result column="osd_ym" property="osdYm" jdbcType="INTEGER" />
-    <result column="osd_type" property="osdType" jdbcType="VARCHAR" />
-    <result column="osd_nowbalance" property="osdNowbalance" jdbcType="DOUBLE" />
-    <result column="osd_remark" property="osdRemark" jdbcType="VARCHAR" />
-    <result column="companyId" property="companyid" jdbcType="INTEGER" />
-    <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
+    <id column="osd_id" property="id" jdbcType="INTEGER" />
+    <result column="osd_orid" property="osd_orid" jdbcType="INTEGER" />
+    <result column="osd_detno" property="osd_detno" jdbcType="INTEGER" />
+    <result column="osd_ym" property="osd_ym" jdbcType="INTEGER" />
+    <result column="osd_type" property="osd_type" jdbcType="VARCHAR" />
+    <result column="osd_nowbalance" property="osd_nowbalance" jdbcType="DOUBLE" />
+    <result column="osd_remark" property="osd_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updatedate" property="updatedate" jdbcType="TIMESTAMP" />
-    <result column="osd_text1" property="osdText1" jdbcType="VARCHAR" />
-    <result column="osd_text2" property="osdText2" jdbcType="VARCHAR" />
-    <result column="osd_text3" property="osdText3" jdbcType="VARCHAR" />
-    <result column="osd_text4" property="osdText4" jdbcType="VARCHAR" />
-    <result column="osd_text5" property="osdText5" jdbcType="VARCHAR" />
+    <result column="osd_text1" property="osd_text1" jdbcType="VARCHAR" />
+    <result column="osd_text2" property="osd_text2" jdbcType="VARCHAR" />
+    <result column="osd_text3" property="osd_text3" jdbcType="VARCHAR" />
+    <result column="osd_text4" property="osd_text4" jdbcType="VARCHAR" />
+    <result column="osd_text5" property="osd_text5" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     osd_id, osd_orid, osd_detno, osd_ym, osd_type, osd_nowbalance, osd_remark, companyId, 
@@ -26,16 +26,16 @@
     select 
     <include refid="Base_Column_List" />
     from othspendingsdetail
-    where osd_id = #{osdId,jdbcType=INTEGER}
+    where osd_id = #{osd_orid,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from othspendingsdetail
-    where osd_id = #{osdId,jdbcType=INTEGER}
+    where osd_orid = #{id,jdbcType=INTEGER}
   </delete>
 
   <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from othspendingsdetail
-    where osd_orid = #{osdOrid,jdbcType=INTEGER}
+    where osd_id = #{id,jdbcType=INTEGER}
   </delete>
 
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Othspendingsdetail" >
@@ -47,7 +47,7 @@
       )
     values (#{osdOrid,jdbcType=INTEGER}, #{osdDetno,jdbcType=INTEGER},
       #{osdYm,jdbcType=INTEGER}, #{osdType,jdbcType=VARCHAR}, #{osdNowbalance,jdbcType=DOUBLE}, 
-      #{osdRemark,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
+      #{osdRemark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
       #{updatedate,jdbcType=TIMESTAMP}, #{osdText1,jdbcType=VARCHAR}, #{osdText2,jdbcType=VARCHAR}, 
       #{osdText3,jdbcType=VARCHAR}, #{osdText4,jdbcType=VARCHAR}, #{osdText5,jdbcType=VARCHAR}
       )
@@ -55,147 +55,141 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Othspendingsdetail" >
     insert into othspendingsdetail
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="osdId != null" >
-        osd_id,
-      </if>
-      <if test="osdOrid != null" >
+      <if test="osd_orid != null" >
         osd_orid,
       </if>
-      <if test="osdDetno != null" >
+      <if test="osd_detno != null" >
         osd_detno,
       </if>
-      <if test="osdYm != null" >
+      <if test="osd_ym != null" >
         osd_ym,
       </if>
-      <if test="osdType != null" >
+      <if test="osd_type != null" >
         osd_type,
       </if>
-      <if test="osdNowbalance != null" >
+      <if test="osd_nowbalance != null" >
         osd_nowbalance,
       </if>
-      <if test="osdRemark != null" >
+      <if test="osd_remark != null" >
         osd_remark,
       </if>
-      <if test="companyid != null" >
+      <if test="companyId != null" >
         companyId,
       </if>
-      <if test="updaterid != null" >
+      <if test="updaterId != null" >
         updaterId,
       </if>
       <if test="updatedate != null" >
         updatedate,
       </if>
-      <if test="osdText1 != null" >
+      <if test="osd_text1 != null" >
         osd_text1,
       </if>
-      <if test="osdText2 != null" >
+      <if test="osd_text2 != null" >
         osd_text2,
       </if>
-      <if test="osdText3 != null" >
+      <if test="osd_text3 != null" >
         osd_text3,
       </if>
-      <if test="osdText4 != null" >
+      <if test="osd_text4 != null" >
         osd_text4,
       </if>
-      <if test="osdText5 != null" >
+      <if test="osd_text5 != null" >
         osd_text5,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="osdId != null" >
-        #{osdId,jdbcType=INTEGER},
+      <if test="osd_orid != null" >
+        #{osd_orid,jdbcType=INTEGER},
       </if>
-      <if test="osdOrid != null" >
-        #{osdOrid,jdbcType=INTEGER},
+      <if test="osd_detno != null" >
+        #{osd_detno,jdbcType=INTEGER},
       </if>
-      <if test="osdDetno != null" >
-        #{osdDetno,jdbcType=INTEGER},
+      <if test="osd_ym != null" >
+        #{osd_ym,jdbcType=INTEGER},
       </if>
-      <if test="osdYm != null" >
-        #{osdYm,jdbcType=INTEGER},
+      <if test="osd_type != null" >
+        #{osd_type,jdbcType=VARCHAR},
       </if>
-      <if test="osdType != null" >
-        #{osdType,jdbcType=VARCHAR},
+      <if test="osd_nowbalance != null" >
+        #{osd_nowbalance,jdbcType=DOUBLE},
       </if>
-      <if test="osdNowbalance != null" >
-        #{osdNowbalance,jdbcType=DOUBLE},
+      <if test="osd_remark != null" >
+        #{osd_remark,jdbcType=VARCHAR},
       </if>
-      <if test="osdRemark != null" >
-        #{osdRemark,jdbcType=VARCHAR},
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="companyid != null" >
-        #{companyid,jdbcType=INTEGER},
-      </if>
-      <if test="updaterid != null" >
-        #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="osdText1 != null" >
-        #{osdText1,jdbcType=VARCHAR},
+      <if test="osd_text1 != null" >
+        #{osd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="osdText2 != null" >
-        #{osdText2,jdbcType=VARCHAR},
+      <if test="osd_text2 != null" >
+        #{osd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="osdText3 != null" >
-        #{osdText3,jdbcType=VARCHAR},
+      <if test="osd_text3 != null" >
+        #{osd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="osdText4 != null" >
-        #{osdText4,jdbcType=VARCHAR},
+      <if test="osd_text4 != null" >
+        #{osd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="osdText5 != null" >
-        #{osdText5,jdbcType=VARCHAR},
+      <if test="osd_text5 != null" >
+        #{osd_text5,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Othspendingsdetail" >
     update othspendingsdetail
     <set >
-      <if test="osdOrid != null" >
-        osd_orid = #{osdOrid,jdbcType=INTEGER},
+      <if test="osd_orid != null" >
+        osd_orid = #{osd_orid,jdbcType=INTEGER},
       </if>
-      <if test="osdDetno != null" >
-        osd_detno = #{osdDetno,jdbcType=INTEGER},
+      <if test="osd_detno != null" >
+        osd_detno = #{osd_detno,jdbcType=INTEGER},
       </if>
-      <if test="osdYm != null" >
-        osd_ym = #{osdYm,jdbcType=INTEGER},
+      <if test="osd_ym != null" >
+        osd_ym = #{osd_ym,jdbcType=INTEGER},
       </if>
-      <if test="osdType != null" >
-        osd_type = #{osdType,jdbcType=VARCHAR},
+      <if test="osd_type != null" >
+        osd_type = #{osd_type,jdbcType=VARCHAR},
       </if>
-      <if test="osdNowbalance != null" >
-        osd_nowbalance = #{osdNowbalance,jdbcType=DOUBLE},
+      <if test="osd_nowbalance != null" >
+        osd_nowbalance = #{osd_nowbalance,jdbcType=DOUBLE},
       </if>
-      <if test="osdRemark != null" >
-        osd_remark = #{osdRemark,jdbcType=VARCHAR},
+      <if test="osd_remark != null" >
+        osd_remark = #{osd_remark,jdbcType=VARCHAR},
       </if>
-      <if test="companyid != null" >
-        companyId = #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null" >
-        updaterId = #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         updatedate = #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="osdText1 != null" >
-        osd_text1 = #{osdText1,jdbcType=VARCHAR},
+      <if test="osd_text1 != null" >
+        osd_text1 = #{osd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="osdText2 != null" >
-        osd_text2 = #{osdText2,jdbcType=VARCHAR},
+      <if test="osd_text2 != null" >
+        osd_text2 = #{osd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="osdText3 != null" >
-        osd_text3 = #{osdText3,jdbcType=VARCHAR},
+      <if test="osd_text3 != null" >
+        osd_text3 = #{osd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="osdText4 != null" >
-        osd_text4 = #{osdText4,jdbcType=VARCHAR},
+      <if test="osd_text4 != null" >
+        osd_text4 = #{osd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="osdText5 != null" >
-        osd_text5 = #{osdText5,jdbcType=VARCHAR},
+      <if test="osd_text5 != null" >
+        osd_text5 = #{osd_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where osd_id = #{osdId,jdbcType=INTEGER}
+    where osd_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Othspendingsdetail" >
     update othspendingsdetail
@@ -205,7 +199,7 @@
       osd_type = #{osdType,jdbcType=VARCHAR},
       osd_nowbalance = #{osdNowbalance,jdbcType=DOUBLE},
       osd_remark = #{osdRemark,jdbcType=VARCHAR},
-      companyId = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterid,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP},
       osd_text1 = #{osdText1,jdbcType=VARCHAR},

+ 51 - 139
applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml

@@ -2,7 +2,7 @@
 <!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.PaybalanceMapper">
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Paybalance">
-    <id column="pb_id" jdbcType="INTEGER" property="pb_id" />
+    <id column="pb_id" jdbcType="INTEGER" property="id" />
     <result column="pb_code" jdbcType="VARCHAR" property="pb_code" />
     <result column="pb_kind" jdbcType="VARCHAR" property="pb_kind" />
     <result column="pb_date" jdbcType="TIMESTAMP" property="pb_date" />
@@ -21,7 +21,7 @@
     <result column="pb_status" jdbcType="VARCHAR" property="pb_status" />
     <result column="pb_statuscode" jdbcType="VARCHAR" property="pb_statuscode" />
     <result column="pb_remark" jdbcType="VARCHAR" property="pb_remark" />
-    <result column="companyid" jdbcType="INTEGER" property="companyId" />
+    <result column="companyId" jdbcType="INTEGER" property="companyId" />
     <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
     <result column="updatedate" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="pb_text1" jdbcType="VARCHAR" property="pb_text1" />
@@ -104,11 +104,11 @@
     select 
     <include refid="Base_Column_List" />
     from paybalance
-    where pb_id = #{pb_id,jdbcType=INTEGER}
+    where pb_id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from paybalance
-    where pb_id = #{pb_id,jdbcType=INTEGER}
+    where pb_id = #{id,jdbcType=INTEGER}
   </delete>
   <delete id="deleteByExample" parameterType="com.usoftchina.saas.money.po.PaybalanceExample">
     delete from paybalance
@@ -141,9 +141,6 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Paybalance">
     insert into paybalance
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="pb_id != null">
-        pb_id,
-      </if>
       <if test="pb_code != null">
         pb_code,
       </if>
@@ -198,8 +195,8 @@
       <if test="pb_remark != null">
         pb_remark,
       </if>
-      <if test="companyid != null">
-        companyid,
+      <if test="companyId != null">
+        companyId,
       </if>
       <if test="updaterId != null">
         updaterId,
@@ -224,9 +221,6 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="pb_id != null">
-        #{pb_id,jdbcType=INTEGER},
-      </if>
       <if test="pb_code != null">
         #{pb_code,jdbcType=VARCHAR},
       </if>
@@ -281,8 +275,8 @@
       <if test="pb_remark != null">
         #{pb_remark,jdbcType=VARCHAR},
       </if>
-      <if test="companyid != null">
-        #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null">
+        #{companyId,jdbcType=INTEGER},
       </if>
       <if test="updaterId != null">
         #{updaterId,jdbcType=INTEGER},
@@ -306,6 +300,9 @@
         #{pb_text5,jdbcType=VARCHAR},
       </if>
     </trim>
+    <selectKey resultType="Long" keyProperty="id" order="AFTER">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
   </insert>
   <select id="countByExample" parameterType="com.usoftchina.saas.money.po.PaybalanceExample" resultType="java.lang.Integer">
     select count(*) from paybalance
@@ -313,128 +310,7 @@
       <include refid="Example_Where_Clause" />
     </if>
   </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    update paybalance
-    <set>
-      <if test="record.pb_id != null">
-        pb_id = #{record.pb_id,jdbcType=INTEGER},
-      </if>
-      <if test="record.pb_code != null">
-        pb_code = #{record.pb_code,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_kind != null">
-        pb_kind = #{record.pb_kind,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_date != null">
-        pb_date = #{record.pb_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.pb_vendid != null">
-        pb_vendid = #{record.pb_vendid,jdbcType=INTEGER},
-      </if>
-      <if test="record.pb_vendcode != null">
-        pb_vendcode = #{record.pb_vendcode,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_vendname != null">
-        pb_vendname = #{record.pb_vendname,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_manname != null">
-        pb_manname = #{record.pb_manname,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_pdamount != null">
-        pb_pdamount = #{record.pb_pdamount,jdbcType=DOUBLE},
-      </if>
-      <if test="record.pb_pbdamount != null">
-        pb_pbdamount = #{record.pb_pbdamount,jdbcType=DOUBLE},
-      </if>
-      <if test="record.pb_preamount != null">
-        pb_preamount = #{record.pb_preamount,jdbcType=DOUBLE},
-      </if>
-      <if test="record.pb_discounts != null">
-        pb_discounts = #{record.pb_discounts,jdbcType=DOUBLE},
-      </if>
-      <if test="record.pb_havebalance != null">
-        pb_havebalance = #{record.pb_havebalance,jdbcType=DOUBLE},
-      </if>
-      <if test="record.pb_recorderid != null">
-        pb_recorderid = #{record.pb_recorderid,jdbcType=INTEGER},
-      </if>
-      <if test="record.pb_recorder != null">
-        pb_recorder = #{record.pb_recorder,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_recorddate != null">
-        pb_recorddate = #{record.pb_recorddate,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.pb_status != null">
-        pb_status = #{record.pb_status,jdbcType=INTEGER},
-      </if>
-      <if test="record.pb_statuscode != null">
-        pb_statuscode = #{record.pb_statuscode,jdbcType=DECIMAL},
-      </if>
-      <if test="record.pb_remark != null">
-        pb_remark = #{record.pb_remark,jdbcType=VARCHAR},
-      </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.updatedate != null">
-        updatedate = #{record.updatedate,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.pb_text1 != null">
-        pb_text1 = #{record.pb_text1,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_text2 != null">
-        pb_text2 = #{record.pb_text2,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_text3 != null">
-        pb_text3 = #{record.pb_text3,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_text4 != null">
-        pb_text4 = #{record.pb_text4,jdbcType=VARCHAR},
-      </if>
-      <if test="record.pb_text5 != null">
-        pb_text5 = #{record.pb_text5,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    update paybalance
-    set pb_id = #{record.pb_id,jdbcType=INTEGER},
-      pb_code = #{record.pb_code,jdbcType=VARCHAR},
-      pb_kind = #{record.pb_kind,jdbcType=VARCHAR},
-      pb_date = #{record.pb_date,jdbcType=TIMESTAMP},
-      pb_vendid = #{record.pb_vendid,jdbcType=INTEGER},
-      pb_vendcode = #{record.pb_vendcode,jdbcType=VARCHAR},
-      pb_vendname = #{record.pb_vendname,jdbcType=VARCHAR},
-      pb_manname = #{record.pb_manname,jdbcType=VARCHAR},
-      pb_pdamount = #{record.pb_pdamount,jdbcType=DOUBLE},
-      pb_pbdamount = #{record.pb_pbdamount,jdbcType=DOUBLE},
-      pb_preamount = #{record.pb_preamount,jdbcType=DOUBLE},
-      pb_discounts = #{record.pb_discounts,jdbcType=DOUBLE},
-      pb_havebalance = #{record.pb_havebalance,jdbcType=DOUBLE},
-      pb_recorderid = #{record.pb_recorderid,jdbcType=INTEGER},
-      pb_recorder = #{record.pb_recorder,jdbcType=VARCHAR},
-      pb_recorddate = #{record.pb_recorddate,jdbcType=TIMESTAMP},
-      pb_status = #{record.pb_status,jdbcType=INTEGER},
-      pb_statuscode = #{record.pb_statuscode,jdbcType=DECIMAL},
-      pb_remark = #{record.pb_remark,jdbcType=VARCHAR},
-      companyid = #{record.companyid,jdbcType=INTEGER},
-      updaterId = #{record.updaterId,jdbcType=INTEGER},
-      updatedate = #{record.updatedate,jdbcType=TIMESTAMP},
-      pb_text1 = #{record.pb_text1,jdbcType=VARCHAR},
-      pb_text2 = #{record.pb_text2,jdbcType=VARCHAR},
-      pb_text3 = #{record.pb_text3,jdbcType=VARCHAR},
-      pb_text4 = #{record.pb_text4,jdbcType=VARCHAR},
-      pb_text5 = #{record.pb_text5,jdbcType=VARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
+
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Paybalance">
     update paybalance
     <set>
@@ -517,7 +393,7 @@
         pb_text5 = #{pb_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where pb_id = #{pb_id,jdbcType=INTEGER}
+    where pb_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Paybalance">
     update paybalance
@@ -539,7 +415,7 @@
       pb_status = #{pb_status,jdbcType=INTEGER},
       pb_statuscode = #{pb_statuscode,jdbcType=DECIMAL},
       pb_remark = #{pb_remark,jdbcType=VARCHAR},
-      companyid = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP},
       pb_text1 = #{pb_text1,jdbcType=VARCHAR},
@@ -547,7 +423,43 @@
       pb_text3 = #{pb_text3,jdbcType=VARCHAR},
       pb_text4 = #{pb_text4,jdbcType=VARCHAR},
       pb_text5 = #{pb_text5,jdbcType=VARCHAR}
-    where pb_id = #{pb_id,jdbcType=INTEGER}
+    where pb_id = #{id,jdbcType=INTEGER}
   </update>
 
+  <select id="selectPaybalanceBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from Paybalance
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   paybalance.companyId = #{companyId}
+      </if>
+    </where>  order by pb_id
+  </select>
+
+  <select id="selectPaybalanceListByCondition" resultMap="BaseResultMap">
+  select
+  <include refid="Base_Column_List" />
+  from paybalance
+    left join paybalancedet on pb_id=pd_rbid left join paybalancedetail on pb_id=pbd_rbid
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   paybalance.companyId = #{companyId}
+      </if>
+    </where>  order by pb_id
+  </select>
+
+  <select id="validateCodeWhenInsert" resultType="int">
+    select count(1) from paybalance where pb_code = #{code} and companyId =#{companyId}
+  </select>
+  <select id="validateCodeWhenUpdate" resultType="int" >
+    select count(1) from paybalance where pb_code = #{code} and pb_id != #{id} and companyId =#{companyId}
+  </select>
+
 </mapper>

+ 119 - 97
applications/money/money-server/src/main/resources/mapper/PaybalancedetMapper.xml

@@ -13,7 +13,7 @@
     <result column="pd_paymethod" property="pdPaymethod" jdbcType="VARCHAR" />
     <result column="pd_paycode" property="pdPaycode" jdbcType="VARCHAR" />
     <result column="pd_remark" property="pdRemark" jdbcType="VARCHAR" />
-    <result column="companyId" property="companyid" jdbcType="INTEGER" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
     <result column="updatedate" property="updatedate" jdbcType="TIMESTAMP" />
     <result column="pd_text1" property="pdText1" jdbcType="VARCHAR" />
@@ -35,12 +35,12 @@
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from paybalancedet
-    where pd_id = #{pdId,jdbcType=INTEGER}
+    where pd_id = #{id,jdbcType=INTEGER}
   </delete>
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from paybalancedet
-    where pd_rbid = #{pdRbid,jdbcType=INTEGER}
+    where pd_rbid = #{id,jdbcType=INTEGER}
   </delete>
 
   <!--<insert id="insert" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >-->
@@ -55,7 +55,7 @@
     values (#{pdId,jdbcType=INTEGER}, #{pdRbid,jdbcType=INTEGER}, #{pdDetno,jdbcType=INTEGER},
       #{pdYm,jdbcType=INTEGER}, #{pdBankid,jdbcType=INTEGER}, #{pdBankcode,jdbcType=VARCHAR},
       #{pdBankname,jdbcType=VARCHAR}, #{pdAmount,jdbcType=DOUBLE}, #{pdPaymethod,jdbcType=VARCHAR},
-      #{pdPaycode,jdbcType=VARCHAR}, #{pdRemark,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER},
+      #{pdPaycode,jdbcType=VARCHAR}, #{pdRemark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
       #{updaterid,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}, #{pdText1,jdbcType=VARCHAR},
       #{pdText2,jdbcType=VARCHAR}, #{pdText3,jdbcType=VARCHAR}, #{pdText4,jdbcType=VARCHAR},
       #{pdText5,jdbcType=VARCHAR})
@@ -64,183 +64,177 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >
     insert into paybalancedet
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="pdId != null" >
-        pd_id,
-      </if>
-      <if test="pdRbid != null" >
+      <if test="pd_rbid != null" >
         pd_rbid,
       </if>
-      <if test="pdDetno != null" >
+      <if test="pd_detno != null" >
         pd_detno,
       </if>
-      <if test="pdYm != null" >
+      <if test="pd_ym != null" >
         pd_ym,
       </if>
-      <if test="pdBankid != null" >
+      <if test="pd_bankid != null" >
         pd_bankid,
       </if>
-      <if test="pdBankcode != null" >
+      <if test="pd_bankcode != null" >
         pd_bankcode,
       </if>
-      <if test="pdBankname != null" >
+      <if test="pd_bankname != null" >
         pd_bankname,
       </if>
-      <if test="pdAmount != null" >
+      <if test="pd_amount != null" >
         pd_amount,
       </if>
-      <if test="pdPaymethod != null" >
+      <if test="pd_paymethod != null" >
         pd_paymethod,
       </if>
-      <if test="pdPaycode != null" >
+      <if test="pd_paycode != null" >
         pd_paycode,
       </if>
-      <if test="pdRemark != null" >
+      <if test="pd_remark != null" >
         pd_remark,
       </if>
-      <if test="companyid != null" >
+      <if test="companyId != null" >
         companyId,
       </if>
-      <if test="updaterid != null" >
+      <if test="updaterId != null" >
         updaterId,
       </if>
       <if test="updatedate != null" >
         updatedate,
       </if>
-      <if test="pdText1 != null" >
+      <if test="pd_text1 != null" >
         pd_text1,
       </if>
-      <if test="pdText2 != null" >
+      <if test="pd_text2 != null" >
         pd_text2,
       </if>
-      <if test="pdText3 != null" >
+      <if test="pd_text3 != null" >
         pd_text3,
       </if>
-      <if test="pdText4 != null" >
+      <if test="pd_text4 != null" >
         pd_text4,
       </if>
-      <if test="pdText5 != null" >
+      <if test="pd_text5 != null" >
         pd_text5,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="pdId != null" >
-        #{pdId,jdbcType=INTEGER},
+      <if test="pd_rbid != null" >
+        #{pd_rbid,jdbcType=INTEGER},
       </if>
-      <if test="pdRbid != null" >
-        #{pdRbid,jdbcType=INTEGER},
+      <if test="pd_detno != null" >
+        #{pd_detno,jdbcType=INTEGER},
       </if>
-      <if test="pdDetno != null" >
-        #{pdDetno,jdbcType=INTEGER},
+      <if test="pd_ym != null" >
+        #{pd_ym,jdbcType=INTEGER},
       </if>
-      <if test="pdYm != null" >
-        #{pdYm,jdbcType=INTEGER},
+      <if test="pd_bankid != null" >
+        #{pd_bankid,jdbcType=INTEGER},
       </if>
-      <if test="pdBankid != null" >
-        #{pdBankid,jdbcType=INTEGER},
+      <if test="pd_bankcode != null" >
+        #{pd_bankcode,jdbcType=VARCHAR},
       </if>
-      <if test="pdBankcode != null" >
-        #{pdBankcode,jdbcType=VARCHAR},
+      <if test="pd_bankname != null" >
+        #{pd_bankname,jdbcType=VARCHAR},
       </if>
-      <if test="pdBankname != null" >
-        #{pdBankname,jdbcType=VARCHAR},
+      <if test="pd_amount != null" >
+        #{pd_amount,jdbcType=DOUBLE},
       </if>
-      <if test="pdAmount != null" >
-        #{pdAmount,jdbcType=DOUBLE},
+      <if test="pd_paymethod != null" >
+        #{pd_paymethod,jdbcType=VARCHAR},
       </if>
-      <if test="pdPaymethod != null" >
-        #{pdPaymethod,jdbcType=VARCHAR},
+      <if test="pd_paycode != null" >
+        #{pd_paycode,jdbcType=VARCHAR},
       </if>
-      <if test="pdPaycode != null" >
-        #{pdPaycode,jdbcType=VARCHAR},
+      <if test="pd_remark != null" >
+        #{pd_remark,jdbcType=VARCHAR},
       </if>
-      <if test="pdRemark != null" >
-        #{pdRemark,jdbcType=VARCHAR},
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="companyid != null" >
-        #{companyid,jdbcType=INTEGER},
-      </if>
-      <if test="updaterid != null" >
-        #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="pdText1 != null" >
-        #{pdText1,jdbcType=VARCHAR},
+      <if test="pd_text1 != null" >
+        #{pd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="pdText2 != null" >
-        #{pdText2,jdbcType=VARCHAR},
+      <if test="pd_text2 != null" >
+        #{pd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="pdText3 != null" >
-        #{pdText3,jdbcType=VARCHAR},
+      <if test="pd_text3 != null" >
+        #{pd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="pdText4 != null" >
-        #{pdText4,jdbcType=VARCHAR},
+      <if test="pd_text4 != null" >
+        #{pd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="pdText5 != null" >
-        #{pdText5,jdbcType=VARCHAR},
+      <if test="pd_text5 != null" >
+        #{pd_text5,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >
     update paybalancedet
     <set >
-      <if test="pdRbid != null" >
-        pd_rbid = #{pdRbid,jdbcType=INTEGER},
+      <if test="pd_rbid != null" >
+        pd_rbid = #{pd_rbid,jdbcType=INTEGER},
       </if>
-      <if test="pdDetno != null" >
-        pd_detno = #{pdDetno,jdbcType=INTEGER},
+      <if test="pd_detno != null" >
+        pd_detno = #{pd_detno,jdbcType=INTEGER},
       </if>
-      <if test="pdYm != null" >
-        pd_ym = #{pdYm,jdbcType=INTEGER},
+      <if test="pd_ym != null" >
+        pd_ym = #{pd_ym,jdbcType=INTEGER},
       </if>
-      <if test="pdBankid != null" >
-        pd_bankid = #{pdBankid,jdbcType=INTEGER},
+      <if test="pd_bankid != null" >
+        pd_bankid = #{pd_bankid,jdbcType=INTEGER},
       </if>
-      <if test="pdBankcode != null" >
-        pd_bankcode = #{pdBankcode,jdbcType=VARCHAR},
+      <if test="pd_bankcode != null" >
+        pd_bankcode = #{pd_bankcode,jdbcType=VARCHAR},
       </if>
-      <if test="pdBankname != null" >
-        pd_bankname = #{pdBankname,jdbcType=VARCHAR},
+      <if test="pd_bankname != null" >
+        pd_bankname = #{pd_bankname,jdbcType=VARCHAR},
       </if>
-      <if test="pdAmount != null" >
-        pd_amount = #{pdAmount,jdbcType=DOUBLE},
+      <if test="pd_amount != null" >
+        pd_amount = #{pd_amount,jdbcType=DOUBLE},
       </if>
-      <if test="pdPaymethod != null" >
-        pd_paymethod = #{pdPaymethod,jdbcType=VARCHAR},
+      <if test="pd_paymethod != null" >
+        pd_paymethod = #{pd_paymethod,jdbcType=VARCHAR},
       </if>
-      <if test="pdPaycode != null" >
-        pd_paycode = #{pdPaycode,jdbcType=VARCHAR},
+      <if test="pd_paycode != null" >
+        pd_paycode = #{pd_paycode,jdbcType=VARCHAR},
       </if>
-      <if test="pdRemark != null" >
-        pd_remark = #{pdRemark,jdbcType=VARCHAR},
+      <if test="pd_remark != null" >
+        pd_remark = #{pd_remark,jdbcType=VARCHAR},
       </if>
-      <if test="companyid != null" >
-        companyId = #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null" >
-        updaterId = #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         updatedate = #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="pdText1 != null" >
-        pd_text1 = #{pdText1,jdbcType=VARCHAR},
+      <if test="pd_text1 != null" >
+        pd_text1 = #{pd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="pdText2 != null" >
-        pd_text2 = #{pdText2,jdbcType=VARCHAR},
+      <if test="pd_text2 != null" >
+        pd_text2 = #{pd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="pdText3 != null" >
-        pd_text3 = #{pdText3,jdbcType=VARCHAR},
+      <if test="pd_text3 != null" >
+        pd_text3 = #{pd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="pdText4 != null" >
-        pd_text4 = #{pdText4,jdbcType=VARCHAR},
+      <if test="pd_text4 != null" >
+        pd_text4 = #{pd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="pdText5 != null" >
-        pd_text5 = #{pdText5,jdbcType=VARCHAR},
+      <if test="pd_text5 != null" >
+        pd_text5 = #{pd_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where pd_id = #{pdId,jdbcType=INTEGER}
+    where pd_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >
     update paybalancedet
@@ -254,7 +248,7 @@
       pd_paymethod = #{pdPaymethod,jdbcType=VARCHAR},
       pd_paycode = #{pdPaycode,jdbcType=VARCHAR},
       pd_remark = #{pdRemark,jdbcType=VARCHAR},
-      companyId = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterid,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP},
       pd_text1 = #{pdText1,jdbcType=VARCHAR},
@@ -264,4 +258,32 @@
       pd_text5 = #{pdText5,jdbcType=VARCHAR}
     where pd_id = #{pdId,jdbcType=INTEGER}
   </update>
+  <select id="selectPaybalanceBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from paybalance
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   paybalance.companyId = #{companyId}
+      </if>
+    </where>  order by pb_id
+  </select>
+
+  <select id="selectPaybalanceListByCondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from paybalance
+    left join paybalancedet on pb_id=pd_rbid left join paybalancedetail on pb_id=pbd_rbid
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   paybalance.companyId = #{companyId}
+      </if>
+    </where>  order by pb_id
+  </select>
 </mapper>

+ 119 - 147
applications/money/money-server/src/main/resources/mapper/PaybalancedetailMapper.xml

@@ -2,45 +2,45 @@
 <!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.PaybalancedetailMapper" >
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Paybalancedetail" >
-    <id column="pbd_id" property="pbdId" jdbcType="INTEGER" />
-    <result column="pbd_pbid" property="pbdPbid" jdbcType="INTEGER" />
-    <result column="pbd_detno" property="pbdDetno" jdbcType="INTEGER" />
-    <result column="pbd_ym" property="pbdYm" jdbcType="INTEGER" />
-    <result column="pbd_sild" property="pbdSild" jdbcType="INTEGER" />
-    <result column="pbd_slcode" property="pbdSlcode" jdbcType="VARCHAR" />
-    <result column="pbd_slkind" property="pbdSlkind" jdbcType="VARCHAR" />
-    <result column="pbd_sldate" property="pbdSldate" jdbcType="TIMESTAMP" />
-    <result column="pbd_amount" property="pbdAmount" jdbcType="DOUBLE" />
-    <result column="pbd_nowbalance" property="pbdNowbalance" jdbcType="DOUBLE" />
-    <result column="pbd_remark" property="pbdRemark" jdbcType="VARCHAR" />
-    <result column="companyId" property="companyid" jdbcType="INTEGER" />
-    <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
+    <id column="pbd_id" property="id" jdbcType="INTEGER" />
+    <result column="pbd_pbid" property="pbd_pbid" jdbcType="INTEGER" />
+    <result column="pbd_detno" property="pbd_detno" jdbcType="INTEGER" />
+    <result column="pbd_ym" property="pbd_ym" jdbcType="INTEGER" />
+    <result column="pbd_sild" property="pbd_sild" jdbcType="INTEGER" />
+    <result column="pbd_slcode" property="pbd_slcode" jdbcType="VARCHAR" />
+    <result column="pbd_slkind" property="pbd_slkind" jdbcType="VARCHAR" />
+    <result column="pbd_sldate" property="pbd_sldate" jdbcType="TIMESTAMP" />
+    <result column="pbd_amount" property="pbd_amount" jdbcType="DOUBLE" />
+    <result column="pbd_nowbalance" property="pbd_nowbalance" jdbcType="DOUBLE" />
+    <result column="pbd_remark" property="pbd_remark" 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="pbd_text1" property="pbdText1" jdbcType="VARCHAR" />
-    <result column="pbd_text2" property="pbdText2" jdbcType="VARCHAR" />
-    <result column="pbd_text3" property="pbdText3" jdbcType="VARCHAR" />
-    <result column="pbd_text4" property="pbdText4" jdbcType="VARCHAR" />
-    <result column="pbd_text5" property="pbdText5" jdbcType="VARCHAR" />
+    <result column="pbd_text1" property="pbd_text1" jdbcType="VARCHAR" />
+    <result column="pbd_text2" property="pbd_text2" jdbcType="VARCHAR" />
+    <result column="pbd_text3" property="pbd_text3" jdbcType="VARCHAR" />
+    <result column="pbd_text4" property="pbd_text4" jdbcType="VARCHAR" />
+    <result column="pbd_text5" property="pbd_text5" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
-    pbd_id, pbd_pbid, pbd_detno, pbd_ym, pbd_sild, pbd_slcode, pbd_slkind, pbd_sldate, 
-    pbd_amount, pbd_nowbalance, pbd_remark, companyId, updaterId, updatedate, pbd_text1, 
+    pbd_id, pbd_pbid, pbd_detno, pbd_ym, pbd_sild, pbd_slcode, pbd_slkind, pbd_sldate,
+    pbd_amount, pbd_nowbalance, pbd_remark, companyId, updaterId, updatedate, pbd_text1,
     pbd_text2, pbd_text3, pbd_text4, pbd_text5
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-    select 
+    select
     <include refid="Base_Column_List" />
     from paybalancedetail
-    where pbd_id = #{pbdId,jdbcType=INTEGER}
+    where pbd_id = #{id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from paybalancedetail
-    where pbd_pbid = #{pbdPbid,jdbcType=INTEGER}
+    where pbd_id = #{id,jdbcType=INTEGER}
   </delete>
 
-  <delete id="deleteByItem" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from paybalancedetail
-    where pbd_id = #{pdbId,jdbcType=INTEGER}
+    where rbd_rbid = #{id,jdbcType=INTEGER}
   </delete>
 
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Paybalancedetail" >
@@ -51,215 +51,187 @@
       updaterId, updatedate, pbd_text1,
       pbd_text2, pbd_text3, pbd_text4,
       pbd_text5)
-    values (#{pbdId,jdbcType=INTEGER}, #{pbdPbid,jdbcType=INTEGER}, #{pbdDetno,jdbcType=INTEGER},
-      #{pbdYm,jdbcType=INTEGER}, #{pbdSild,jdbcType=INTEGER}, #{pbdSlcode,jdbcType=VARCHAR},
-      #{pbdSlkind,jdbcType=VARCHAR}, #{pbdSldate,jdbcType=TIMESTAMP}, #{pbdAmount,jdbcType=DOUBLE},
-      #{pbdNowbalance,jdbcType=DOUBLE}, #{pbdRemark,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER},
-      #{updaterid,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}, #{pbdText1,jdbcType=VARCHAR},
-      #{pbdText2,jdbcType=VARCHAR}, #{pbdText3,jdbcType=VARCHAR}, #{pbdText4,jdbcType=VARCHAR},
-      #{pbdText5,jdbcType=VARCHAR})
+    values (#{id,jdbcType=INTEGER}, #{pbd_pbid,jdbcType=INTEGER}, #{pbd_detno,jdbcType=INTEGER},
+      #{pbd_ym,jdbcType=INTEGER}, #{pbd_sild,jdbcType=INTEGER}, #{pbd_slcode,jdbcType=VARCHAR},
+      #{pbd_slkind,jdbcType=VARCHAR}, #{pbd_sldate,jdbcType=TIMESTAMP}, #{pbd_amount,jdbcType=DOUBLE},
+      #{pbd_nowbalance,jdbcType=DOUBLE}, #{pbd_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
+      #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}, #{pbd_text1,jdbcType=VARCHAR},
+      #{pbd_text2,jdbcType=VARCHAR}, #{pbd_text3,jdbcType=VARCHAR}, #{pbd_text4,jdbcType=VARCHAR},
+      #{pbd_text5,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Paybalancedetail" >
     insert into paybalancedetail
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="pbdId != null" >
-        pbd_id,
-      </if>
-      <if test="pbdPbid != null" >
+      <if test="pbd_pbid != null" >
         pbd_pbid,
       </if>
-      <if test="pbdDetno != null" >
+      <if test="pbd_detno != null" >
         pbd_detno,
       </if>
-      <if test="pbdYm != null" >
+      <if test="pbd_ym != null" >
         pbd_ym,
       </if>
-      <if test="pbdSild != null" >
+      <if test="pbd_sild != null" >
         pbd_sild,
       </if>
-      <if test="pbdSlcode != null" >
+      <if test="pbd_slcode != null" >
         pbd_slcode,
       </if>
-      <if test="pbdSlkind != null" >
+      <if test="pbd_slkind != null" >
         pbd_slkind,
       </if>
-      <if test="pbdSldate != null" >
+      <if test="pbd_sldate != null" >
         pbd_sldate,
       </if>
-      <if test="pbdAmount != null" >
+      <if test="pbd_amount != null" >
         pbd_amount,
       </if>
-      <if test="pbdNowbalance != null" >
+      <if test="pbd_nowbalance != null" >
         pbd_nowbalance,
       </if>
-      <if test="pbdRemark != null" >
+      <if test="pbd_remark != null" >
         pbd_remark,
       </if>
-      <if test="companyid != null" >
+      <if test="companyId != null" >
         companyId,
       </if>
-      <if test="updaterid != null" >
+      <if test="updaterId != null" >
         updaterId,
       </if>
       <if test="updatedate != null" >
         updatedate,
       </if>
-      <if test="pbdText1 != null" >
+      <if test="pbd_text1 != null" >
         pbd_text1,
       </if>
-      <if test="pbdText2 != null" >
+      <if test="pbd_text2 != null" >
         pbd_text2,
       </if>
-      <if test="pbdText3 != null" >
+      <if test="pbd_text3 != null" >
         pbd_text3,
       </if>
-      <if test="pbdText4 != null" >
+      <if test="pbd_text4 != null" >
         pbd_text4,
       </if>
-      <if test="pbdText5 != null" >
+      <if test="pbd_text5 != null" >
         pbd_text5,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="pbdId != null" >
-        #{pbdId,jdbcType=INTEGER},
+      <if test="pbd_pbid != null" >
+        #{pbd_pbid,jdbcType=INTEGER},
       </if>
-      <if test="pbdPbid != null" >
-        #{pbdPbid,jdbcType=INTEGER},
+      <if test="pbd_detno != null" >
+        #{pbd_detno,jdbcType=INTEGER},
       </if>
-      <if test="pbdDetno != null" >
-        #{pbdDetno,jdbcType=INTEGER},
+      <if test="pbd_ym != null" >
+        #{pbd_ym,jdbcType=INTEGER},
       </if>
-      <if test="pbdYm != null" >
-        #{pbdYm,jdbcType=INTEGER},
+      <if test="pbd_sild != null" >
+        #{pbd_sild,jdbcType=INTEGER},
       </if>
-      <if test="pbdSild != null" >
-        #{pbdSild,jdbcType=INTEGER},
+      <if test="pbd_slcode != null" >
+        #{pbd_slcode,jdbcType=VARCHAR},
       </if>
-      <if test="pbdSlcode != null" >
-        #{pbdSlcode,jdbcType=VARCHAR},
+      <if test="pbd_slkind != null" >
+        #{pbd_slkind,jdbcType=VARCHAR},
       </if>
-      <if test="pbdSlkind != null" >
-        #{pbdSlkind,jdbcType=VARCHAR},
+      <if test="pbd_sldate != null" >
+        #{pbd_sldate,jdbcType=TIMESTAMP},
       </if>
-      <if test="pbdSldate != null" >
-        #{pbdSldate,jdbcType=TIMESTAMP},
+      <if test="pbd_amount != null" >
+        #{pbd_amount,jdbcType=DOUBLE},
       </if>
-      <if test="pbdAmount != null" >
-        #{pbdAmount,jdbcType=DOUBLE},
+      <if test="pbd_nowbalance != null" >
+        #{pbd_nowbalance,jdbcType=DOUBLE},
       </if>
-      <if test="pbdNowbalance != null" >
-        #{pbdNowbalance,jdbcType=DOUBLE},
+      <if test="pbd_remark != null" >
+        #{pbd_remark,jdbcType=VARCHAR},
       </if>
-      <if test="pbdRemark != null" >
-        #{pbdRemark,jdbcType=VARCHAR},
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="companyid != null" >
-        #{companyid,jdbcType=INTEGER},
-      </if>
-      <if test="updaterid != null" >
-        #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="pbdText1 != null" >
-        #{pbdText1,jdbcType=VARCHAR},
+      <if test="pbd_text1 != null" >
+        #{pbd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="pbdText2 != null" >
-        #{pbdText2,jdbcType=VARCHAR},
+      <if test="pbd_text2 != null" >
+        #{pbd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="pbdText3 != null" >
-        #{pbdText3,jdbcType=VARCHAR},
+      <if test="pbd_text3 != null" >
+        #{pbd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="pbdText4 != null" >
-        #{pbdText4,jdbcType=VARCHAR},
+      <if test="pbd_text4 != null" >
+        #{pbd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="pbdText5 != null" >
-        #{pbdText5,jdbcType=VARCHAR},
+      <if test="pbd_text5 != null" >
+        #{pbd_text5,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Paybalancedetail" >
     update paybalancedetail
     <set >
-      <if test="pbdPbid != null" >
-        pbd_pbid = #{pbdPbid,jdbcType=INTEGER},
+      <if test="pbd_pbid != null" >
+        pbd_pbid = #{pbd_pbid,jdbcType=INTEGER},
       </if>
-      <if test="pbdDetno != null" >
-        pbd_detno = #{pbdDetno,jdbcType=INTEGER},
+      <if test="pbd_detno != null" >
+        pbd_detno = #{pbd_detno,jdbcType=INTEGER},
       </if>
-      <if test="pbdYm != null" >
-        pbd_ym = #{pbdYm,jdbcType=INTEGER},
+      <if test="pbd_ym != null" >
+        pbd_ym = #{pbd_ym,jdbcType=INTEGER},
       </if>
-      <if test="pbdSild != null" >
-        pbd_sild = #{pbdSild,jdbcType=INTEGER},
+      <if test="pbd_sild != null" >
+        pbd_sild = #{pbd_sild,jdbcType=INTEGER},
       </if>
-      <if test="pbdSlcode != null" >
-        pbd_slcode = #{pbdSlcode,jdbcType=VARCHAR},
+      <if test="pbd_slcode != null" >
+        pbd_slcode = #{pbd_slcode,jdbcType=VARCHAR},
       </if>
-      <if test="pbdSlkind != null" >
-        pbd_slkind = #{pbdSlkind,jdbcType=VARCHAR},
+      <if test="pbd_slkind != null" >
+        pbd_slkind = #{pbd_slkind,jdbcType=VARCHAR},
       </if>
-      <if test="pbdSldate != null" >
-        pbd_sldate = #{pbdSldate,jdbcType=TIMESTAMP},
+      <if test="pbd_sldate != null" >
+        pbd_sldate = #{pbd_sldate,jdbcType=TIMESTAMP},
       </if>
-      <if test="pbdAmount != null" >
-        pbd_amount = #{pbdAmount,jdbcType=DOUBLE},
+      <if test="pbd_amount != null" >
+        pbd_amount = #{pbd_amount,jdbcType=DOUBLE},
       </if>
-      <if test="pbdNowbalance != null" >
-        pbd_nowbalance = #{pbdNowbalance,jdbcType=DOUBLE},
+      <if test="pbd_nowbalance != null" >
+        pbd_nowbalance = #{pbd_nowbalance,jdbcType=DOUBLE},
       </if>
-      <if test="pbdRemark != null" >
-        pbd_remark = #{pbdRemark,jdbcType=VARCHAR},
+      <if test="pbd_remark != null" >
+        pbd_remark = #{pbd_remark,jdbcType=VARCHAR},
       </if>
-      <if test="companyid != null" >
-        companyId = #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null" >
-        updaterId = #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
       <if test="updatedate != null" >
         updatedate = #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="pbdText1 != null" >
-        pbd_text1 = #{pbdText1,jdbcType=VARCHAR},
+      <if test="pbd_text1 != null" >
+        pbd_text1 = #{pbd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="pbdText2 != null" >
-        pbd_text2 = #{pbdText2,jdbcType=VARCHAR},
+      <if test="pbd_text2 != null" >
+        pbd_text2 = #{pbd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="pbdText3 != null" >
-        pbd_text3 = #{pbdText3,jdbcType=VARCHAR},
+      <if test="pbd_text3 != null" >
+        pbd_text3 = #{pbd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="pbdText4 != null" >
-        pbd_text4 = #{pbdText4,jdbcType=VARCHAR},
+      <if test="pbd_text4 != null" >
+        pbd_text4 = #{pbd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="pbdText5 != null" >
-        pbd_text5 = #{pbdText5,jdbcType=VARCHAR},
+      <if test="pbd_text5 != null" >
+        pbd_text5 = #{pbd_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where pbd_id = #{pbdId,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Paybalancedetail" >
-    update paybalancedetail
-    set pbd_pbid = #{pbdPbid,jdbcType=INTEGER},
-      pbd_detno = #{pbdDetno,jdbcType=INTEGER},
-      pbd_ym = #{pbdYm,jdbcType=INTEGER},
-      pbd_sild = #{pbdSild,jdbcType=INTEGER},
-      pbd_slcode = #{pbdSlcode,jdbcType=VARCHAR},
-      pbd_slkind = #{pbdSlkind,jdbcType=VARCHAR},
-      pbd_sldate = #{pbdSldate,jdbcType=TIMESTAMP},
-      pbd_amount = #{pbdAmount,jdbcType=DOUBLE},
-      pbd_nowbalance = #{pbdNowbalance,jdbcType=DOUBLE},
-      pbd_remark = #{pbdRemark,jdbcType=VARCHAR},
-      companyId = #{companyid,jdbcType=INTEGER},
-      updaterId = #{updaterid,jdbcType=INTEGER},
-      updatedate = #{updatedate,jdbcType=TIMESTAMP},
-      pbd_text1 = #{pbdText1,jdbcType=VARCHAR},
-      pbd_text2 = #{pbdText2,jdbcType=VARCHAR},
-      pbd_text3 = #{pbdText3,jdbcType=VARCHAR},
-      pbd_text4 = #{pbdText4,jdbcType=VARCHAR},
-      pbd_text5 = #{pbdText5,jdbcType=VARCHAR}
-    where pbd_id = #{pbdId,jdbcType=INTEGER}
+    where pbd_id = #{id,jdbcType=INTEGER}
   </update>
 </mapper>

+ 42 - 12
applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml

@@ -2,7 +2,7 @@
 <!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.RecbalanceMapper">
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Recbalance">
-    <id column="rb_id" jdbcType="INTEGER" property="rb_id" />
+    <id column="rb_id" jdbcType="INTEGER" property="id" />
     <result column="rb_code" jdbcType="VARCHAR" property="rb_code" />
     <result column="rb_kind" jdbcType="VARCHAR" property="rb_kind" />
     <result column="rb_date" jdbcType="TIMESTAMP" property="rb_date" />
@@ -112,18 +112,41 @@
     select 
     <include refid="Base_Column_List" />
     from recbalance
-    where rb_id = #{rb_id,jdbcType=INTEGER}
+    where rb_id = #{id,jdbcType=INTEGER}
   </select>
 
-  <select id="selectList" resultMap="BaseResultMap">
+  <select id="selectRecbalanceBycondition" resultMap="BaseResultMap">
     select
     <include refid="Base_Column_List" />
     from recbalance
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   recbalance.companyId = #{companyId}
+      </if>
+    </where>  order by rb_id
+  </select>
+
+  <select id="selectRecbalanceListByCondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from recbalance
+    left join recbalancedet on rb_id=rd_rbid left join recbalancedetail on rb_id=rbd_rbid
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   recbalance.companyId = #{companyId}
+      </if>
+    </where>  order by rb_id
   </select>
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from recbalance
-    where rb_id = #{rb_id,jdbcType=INTEGER}
+    where rb_id = #{id,jdbcType=INTEGER}
   </delete>
   <delete id="deleteByExample" parameterType="com.usoftchina.saas.money.po.RecbalanceExample">
     delete from recbalance
@@ -152,13 +175,13 @@
       #{updateTime,jdbcType=TIMESTAMP}, #{rb_text1,jdbcType=VARCHAR}, #{rb_text2,jdbcType=VARCHAR},
       #{rb_text3,jdbcType=VARCHAR}, #{rb_text4,jdbcType=VARCHAR}, #{rb_text5,jdbcType=VARCHAR}
       )
+    <selectKey resultType="Long" keyProperty="id" order="AFTER">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Recbalance">
     insert into recbalance
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="rb_id != null">
-        rb_id,
-      </if>
       <if test="rb_code != null">
         rb_code,
       </if>
@@ -239,9 +262,6 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="rb_id != null">
-        #{rb_id,jdbcType=INTEGER},
-      </if>
       <if test="rb_code != null">
         #{rb_code,jdbcType=VARCHAR},
       </if>
@@ -321,6 +341,9 @@
         #{rb_text5,jdbcType=VARCHAR},
       </if>
     </trim>
+    <selectKey resultType="Long" keyProperty="id" order="AFTER">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
   </insert>
   <select id="countByExample" parameterType="com.usoftchina.saas.money.po.RecbalanceExample" resultType="java.lang.Integer">
     select count(*) from recbalance
@@ -532,7 +555,7 @@
         rb_text5 = #{rb_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where rb_id = #{rb_id,jdbcType=INTEGER}
+    where rb_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Recbalance">
     update recbalance
@@ -562,7 +585,14 @@
       rb_text3 = #{rb_text3,jdbcType=VARCHAR},
       rb_text4 = #{rb_text4,jdbcType=VARCHAR},
       rb_text5 = #{rb_text5,jdbcType=VARCHAR}
-    where rb_id = #{rb_id,jdbcType=INTEGER}
+    where rb_id = #{id,jdbcType=INTEGER}
   </update>
 
+  <select id="validateCodeWhenInsert" resultType="int">
+    select count(1) from recbalance where rb_code = #{code} and companyId =#{companyId}
+  </select>
+  <select id="validateCodeWhenUpdate" resultType="int" >
+    select count(1) from recbalance where rb_code = #{code} and rb_id != #{id} and companyId =#{companyId}
+  </select>
+
 </mapper>

+ 8 - 152
applications/money/money-server/src/main/resources/mapper/RecbalancedetMapper.xml

@@ -2,7 +2,7 @@
 <!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.RecbalancedetMapper">
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Recbalancedet">
-    <id column="rd_id" jdbcType="INTEGER" property="rd_id" />
+    <id column="rd_id" jdbcType="INTEGER" property="id" />
     <result column="rd_rbid" jdbcType="INTEGER" property="rd_rbid" />
     <result column="rd_detno" jdbcType="INTEGER" property="rd_detno" />
     <result column="rd_ym" jdbcType="INTEGER" property="rd_ym" />
@@ -85,29 +85,15 @@
     rd_paymethod, rd_paycode, rd_remark, companyId, updaterId, updatedate, rd_text1,
     rd_text2, rd_text3, rd_text4, rd_text5
   </sql>
-  <select id="selectByExample" parameterType="com.usoftchina.saas.money.po.RecbalancedetExample" resultMap="BaseResultMap">
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from recbalancedet
-    <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.Integer" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
     from recbalancedet
-    where rd_id = #{rd_id,jdbcType=INTEGER}
+    where rd_id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer">
     delete from recbalancedet
-    where rd_id = #{rd_id,jdbcType=INTEGER}
+    where rd_id = #{id,jdbcType=INTEGER}
   </delete>
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
@@ -115,12 +101,6 @@
     where rd_rbid = #{rd_rbid,jdbcType=INTEGER}
   </delete>
 
-  <delete id="deleteByExample" parameterType="com.usoftchina.saas.money.po.RecbalancedetExample">
-    delete from recbalancedet
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Recbalancedet">
     insert into recbalancedet (rd_id, rd_rbid, rd_detno,
       rd_ym, rd_bankid, rd_bankcode,
@@ -129,7 +109,7 @@
       updaterId, updatedate, rd_text1,
       rd_text2, rd_text3, rd_text4,
       rd_text5)
-    values (#{rd_id,jdbcType=INTEGER}, #{rd_rbid,jdbcType=INTEGER}, #{rd_detno,jdbcType=INTEGER},
+    values (#{id,jdbcType=INTEGER}, #{rd_rbid,jdbcType=INTEGER}, #{rd_detno,jdbcType=INTEGER},
       #{rd_ym,jdbcType=INTEGER}, #{rd_bankid,jdbcType=INTEGER}, #{rd_bankcode,jdbcType=VARCHAR},
       #{rd_bankname,jdbcType=VARCHAR}, #{rd_amount,jdbcType=DOUBLE}, #{rd_paymethod,jdbcType=VARCHAR},
       #{rd_paycode,jdbcType=VARCHAR}, #{rd_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
@@ -140,9 +120,6 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Recbalancedet">
     insert into recbalancedet
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="rd_id != null">
-        rd_id,
-      </if>
       <if test="rd_rbid != null">
         rd_rbid,
       </if>
@@ -180,7 +157,7 @@
         updaterId,
       </if>
       <if test="updateTime != null">
-        updateTime,
+        updatedate,
       </if>
       <if test="rd_text1 != null">
         rd_text1,
@@ -199,9 +176,6 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="rd_id != null">
-        #{rd_id,jdbcType=INTEGER},
-      </if>
       <if test="rd_rbid != null">
         #{rd_rbid,jdbcType=INTEGER},
       </if>
@@ -258,107 +232,11 @@
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.usoftchina.saas.money.po.RecbalancedetExample" resultType="java.lang.Integer">
-    select count(*) from recbalancedet
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    update recbalancedet
-    <set>
-      <if test="record.rd_id != null">
-        rd_id = #{record.rd_id,jdbcType=INTEGER},
-      </if>
-      <if test="record.rd_rbid != null">
-        rd_rbid = #{record.rd_rbid,jdbcType=INTEGER},
-      </if>
-      <if test="record.rd_detno != null">
-        rd_detno = #{record.rd_detno,jdbcType=INTEGER},
-      </if>
-      <if test="record.rd_ym != null">
-        rd_ym = #{record.rd_ym,jdbcType=INTEGER},
-      </if>
-      <if test="record.rd_bankid != null">
-        rd_bankid = #{record.rd_bankid,jdbcType=INTEGER},
-      </if>
-      <if test="record.rd_bankcode != null">
-        rd_bankcode = #{record.rd_bankcode,jdbcType=VARCHAR},
-      </if>
-      <if test="record.rd_bankname != null">
-        rd_bankname = #{record.rd_bankname,jdbcType=VARCHAR},
-      </if>
-      <if test="record.rd_amount != null">
-        rd_amount = #{record.rd_amount,jdbcType=DOUBLE},
-      </if>
-      <if test="record.rd_paymethod != null">
-        rd_paymethod = #{record.rd_paymethod,jdbcType=VARCHAR},
-      </if>
-      <if test="record.rd_paycode != null">
-        rd_paycode = #{record.rd_paycode,jdbcType=VARCHAR},
-      </if>
-      <if test="record.rd_remark != null">
-        rd_remark = #{record.rd_remark,jdbcType=VARCHAR},
-      </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">
-        updatedate = #{record.updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.rd_text1 != null">
-        rd_text1 = #{record.rd_text1,jdbcType=VARCHAR},
-      </if>
-      <if test="record.rd_text2 != null">
-        rd_text2 = #{record.rd_text2,jdbcType=VARCHAR},
-      </if>
-      <if test="record.rd_text3 != null">
-        rd_text3 = #{record.rd_text3,jdbcType=VARCHAR},
-      </if>
-      <if test="record.rd_text4 != null">
-        rd_text4 = #{record.rd_text4,jdbcType=VARCHAR},
-      </if>
-      <if test="record.rd_text5 != null">
-        rd_text5 = #{record.rd_text5,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    update recbalancedet
-    set rd_id = #{record.rd_id,jdbcType=INTEGER},
-      rd_rbid = #{record.rd_rbid,jdbcType=INTEGER},
-      rd_detno = #{record.rd_detno,jdbcType=INTEGER},
-      rd_ym = #{record.rd_ym,jdbcType=INTEGER},
-      rd_bankid = #{record.rd_bankid,jdbcType=INTEGER},
-      rd_bankcode = #{record.rd_bankcode,jdbcType=VARCHAR},
-      rd_bankname = #{record.rd_bankname,jdbcType=VARCHAR},
-      rd_amount = #{record.rd_amount,jdbcType=DOUBLE},
-      rd_paymethod = #{record.rd_paymethod,jdbcType=VARCHAR},
-      rd_paycode = #{record.rd_paycode,jdbcType=VARCHAR},
-      rd_remark = #{record.rd_remark,jdbcType=VARCHAR},
-      companyId = #{record.companyId,jdbcType=INTEGER},
-      updaterId = #{record.updaterId,jdbcType=INTEGER},
-      updatedate = #{record.updateTime,jdbcType=TIMESTAMP},
-      rd_text1 = #{record.rd_text1,jdbcType=VARCHAR},
-      rd_text2 = #{record.rd_text2,jdbcType=VARCHAR},
-      rd_text3 = #{record.rd_text3,jdbcType=VARCHAR},
-      rd_text4 = #{record.rd_text4,jdbcType=VARCHAR},
-      rd_text5 = #{record.rd_text5,jdbcType=VARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Recbalancedet">
     update recbalancedet
     <set>
-      <if test="rd_rbid != null">
-        rd_rbid = #{rd_rbid,jdbcType=INTEGER},
+      <if test="id != null">
+        rd_rbid = #{id,jdbcType=INTEGER},
       </if>
       <if test="rd_detno != null">
         rd_detno = #{rd_detno,jdbcType=INTEGER},
@@ -412,29 +290,7 @@
         rd_text5 = #{rd_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where rd_id = #{rd_id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Recbalancedet">
-    update recbalancedet
-    set rd_rbid = #{rd_rbid,jdbcType=INTEGER},
-      rd_detno = #{rd_detno,jdbcType=INTEGER},
-      rd_ym = #{rd_ym,jdbcType=INTEGER},
-      rd_bankid = #{rd_bankid,jdbcType=INTEGER},
-      rd_bankcode = #{rd_bankcode,jdbcType=VARCHAR},
-      rd_bankname = #{rd_bankname,jdbcType=VARCHAR},
-      rd_amount = #{rd_amount,jdbcType=DOUBLE},
-      rd_paymethod = #{rd_paymethod,jdbcType=VARCHAR},
-      rd_paycode = #{rd_paycode,jdbcType=VARCHAR},
-      rd_remark = #{rd_remark,jdbcType=VARCHAR},
-      companyId = #{companyId,jdbcType=INTEGER},
-      updaterId = #{updaterId,jdbcType=INTEGER},
-      updatedate = #{updateTime,jdbcType=TIMESTAMP},
-      rd_text1 = #{rd_text1,jdbcType=VARCHAR},
-      rd_text2 = #{rd_text2,jdbcType=VARCHAR},
-      rd_text3 = #{rd_text3,jdbcType=VARCHAR},
-      rd_text4 = #{rd_text4,jdbcType=VARCHAR},
-      rd_text5 = #{rd_text5,jdbcType=VARCHAR}
-    where rd_id = #{rd_id,jdbcType=INTEGER}
+    where rd_id = #{id,jdbcType=INTEGER}
   </update>
 
 </mapper>

+ 114 - 142
applications/money/money-server/src/main/resources/mapper/RecbalancedetailMapper.xml

@@ -2,25 +2,25 @@
 <!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.RecbalancedetailMapper" >
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Recbalancedetail" >
-    <id column="rbd_id" property="rbdId" jdbcType="INTEGER" />
-    <result column="rbd_rbid" property="rbdRbid" jdbcType="INTEGER" />
-    <result column="rbd_detno" property="rbdDetno" jdbcType="INTEGER" />
-    <result column="rbd_ym" property="rbdYm" jdbcType="INTEGER" />
-    <result column="rbd_slid" property="rbdSlid" jdbcType="INTEGER" />
-    <result column="rbd_slcode" property="rbdSlcode" jdbcType="VARCHAR" />
-    <result column="rbd_slkind" property="rbdSlkind" jdbcType="VARCHAR" />
-    <result column="rbd_sldate" property="rbdSldate" jdbcType="TIMESTAMP" />
-    <result column="rbd_amount" property="rbdAmount" jdbcType="DOUBLE" />
-    <result column="rbd_nowbalance" property="rbdNowbalance" jdbcType="DOUBLE" />
-    <result column="rbd_remark" property="rbdRemark" jdbcType="VARCHAR" />
-    <result column="companyId" property="companyId" jdbcType="INTEGER" />
-    <result column="updaterId" property="updaterid" jdbcType="INTEGER" />
-    <result column="updatedate" property="updateTime" jdbcType="TIMESTAMP" />
-    <result column="rbd_text1" property="rbdText1" jdbcType="VARCHAR" />
-    <result column="rbd_text2" property="rbdText2" jdbcType="VARCHAR" />
-    <result column="rbd_text3" property="rbdText3" jdbcType="VARCHAR" />
-    <result column="rbd_text4" property="rbdText4" jdbcType="VARCHAR" />
-    <result column="rbd_text5" property="rbdText5" jdbcType="VARCHAR" />
+    <id column="rbd_id" property="id" jdbcType="INTEGER" />
+    <result column="rbd_rbid" property="rbd_rbid" jdbcType="INTEGER" />
+    <result column="rbd_detno" property="rbd_detno" jdbcType="INTEGER" />
+    <result column="rbd_ym" property="rbd_ym" jdbcType="INTEGER" />
+    <result column="rbd_slid" property="rbd_slid" jdbcType="INTEGER" />
+    <result column="rbd_slcode" property="rbd_slcode" jdbcType="VARCHAR" />
+    <result column="rbd_slkind" property="rbd_slkind" jdbcType="VARCHAR" />
+    <result column="rbd_sldate" property="rbd_sldate" jdbcType="TIMESTAMP" />
+    <result column="rbd_amount" property="rbd_amount" jdbcType="DOUBLE" />
+    <result column="rbd_nowbalance" property="rbd_nowbalance" jdbcType="DOUBLE" />
+    <result column="rbd_remark" property="rbd_remark" 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="rbd_text1" property="rbd_text1" jdbcType="VARCHAR" />
+    <result column="rbd_text2" property="rbd_text2" jdbcType="VARCHAR" />
+    <result column="rbd_text3" property="rbd_text3" jdbcType="VARCHAR" />
+    <result column="rbd_text4" property="rbd_text4" jdbcType="VARCHAR" />
+    <result column="rbd_text5" property="rbd_text5" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     rbd_id, rbd_rbid, rbd_detno, rbd_ym, rbd_slid, rbd_slcode, rbd_slkind, rbd_sldate, 
@@ -31,16 +31,16 @@
     select 
     <include refid="Base_Column_List" />
     from recbalancedetail
-    where rbd_id = #{rbdId,jdbcType=INTEGER}
+    where rd_rbid = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from recbalancedetail
-    where rbd_id = #{rbdId,jdbcType=INTEGER}
+    where rbd_id = #{id,jdbcType=INTEGER}
   </delete>
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from recbalancedetail
-    where rbd_rbid = #{rbdRbid,jdbcType=INTEGER}
+    where rbd_rbid = #{id,jdbcType=INTEGER}
   </delete>
 
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Recbalancedetail" >
@@ -51,215 +51,187 @@
       updaterId, updatedate, rbd_text1,
       rbd_text2, rbd_text3, rbd_text4,
       rbd_text5)
-    values (#{rbdId,jdbcType=INTEGER}, #{rbdRbid,jdbcType=INTEGER}, #{rbdDetno,jdbcType=INTEGER},
+    values (#{id,jdbcType=INTEGER}, #{rbdRbid,jdbcType=INTEGER}, #{rbdDetno,jdbcType=INTEGER},
       #{rbdYm,jdbcType=INTEGER}, #{rbdSlid,jdbcType=INTEGER}, #{rbdSlcode,jdbcType=VARCHAR},
       #{rbdSlkind,jdbcType=VARCHAR}, #{rbdSldate,jdbcType=TIMESTAMP}, #{rbdAmount,jdbcType=DOUBLE},
       #{rbdNowbalance,jdbcType=DOUBLE}, #{rbdRemark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
-      #{updaterid,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}, #{rbdText1,jdbcType=VARCHAR},
+      #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}, #{rbdText1,jdbcType=VARCHAR},
       #{rbdText2,jdbcType=VARCHAR}, #{rbdText3,jdbcType=VARCHAR}, #{rbdText4,jdbcType=VARCHAR},
       #{rbdText5,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Recbalancedetail" >
     insert into recbalancedetail
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="rbdId != null" >
-        rbd_id,
-      </if>
-      <if test="rbdRbid != null" >
+      <if test="rbd_rbid != null" >
         rbd_rbid,
       </if>
-      <if test="rbdDetno != null" >
+      <if test="rbd_detno != null" >
         rbd_detno,
       </if>
-      <if test="rbdYm != null" >
+      <if test="rbd_ym != null" >
         rbd_ym,
       </if>
-      <if test="rbdSlid != null" >
+      <if test="rbd_slid != null" >
         rbd_slid,
       </if>
-      <if test="rbdSlcode != null" >
+      <if test="rbd_slcode != null" >
         rbd_slcode,
       </if>
-      <if test="rbdSlkind != null" >
+      <if test="rbd_slkind != null" >
         rbd_slkind,
       </if>
-      <if test="rbdSldate != null" >
+      <if test="rbd_sldate != null" >
         rbd_sldate,
       </if>
-      <if test="rbdAmount != null" >
+      <if test="rbd_amount != null" >
         rbd_amount,
       </if>
-      <if test="rbdNowbalance != null" >
+      <if test="rbd_nowbalance != null" >
         rbd_nowbalance,
       </if>
-      <if test="rbdRemark != null" >
+      <if test="rbd_remark != null" >
         rbd_remark,
       </if>
       <if test="companyId != null" >
-        companyId,
+        companyid,
       </if>
-      <if test="updaterid != null" >
+      <if test="updaterId != null" >
         updaterId,
       </if>
-      <if test="updateTime != null" >
-        updateTime,
+      <if test="updatedate != null" >
+        updatedate,
       </if>
-      <if test="rbdText1 != null" >
+      <if test="rbd_text1 != null" >
         rbd_text1,
       </if>
-      <if test="rbdText2 != null" >
+      <if test="rbd_text2 != null" >
         rbd_text2,
       </if>
-      <if test="rbdText3 != null" >
+      <if test="rbd_text3 != null" >
         rbd_text3,
       </if>
-      <if test="rbdText4 != null" >
+      <if test="rbd_text4 != null" >
         rbd_text4,
       </if>
-      <if test="rbdText5 != null" >
+      <if test="rbd_text5 != null" >
         rbd_text5,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="rbdId != null" >
-        #{rbdId,jdbcType=INTEGER},
-      </if>
-      <if test="rbdRbid != null" >
-        #{rbdRbid,jdbcType=INTEGER},
+      <if test="rbd_rbid != null" >
+        #{rbd_rbid,jdbcType=INTEGER},
       </if>
-      <if test="rbdDetno != null" >
-        #{rbdDetno,jdbcType=INTEGER},
+      <if test="rbd_detno != null" >
+        #{rbd_detno,jdbcType=INTEGER},
       </if>
-      <if test="rbdYm != null" >
-        #{rbdYm,jdbcType=INTEGER},
+      <if test="rbd_ym != null" >
+        #{rbd_ym,jdbcType=INTEGER},
       </if>
-      <if test="rbdSlid != null" >
-        #{rbdSlid,jdbcType=INTEGER},
+      <if test="rbd_slid != null" >
+        #{rbd_slid,jdbcType=INTEGER},
       </if>
-      <if test="rbdSlcode != null" >
-        #{rbdSlcode,jdbcType=VARCHAR},
+      <if test="rbd_slcode != null" >
+        #{rbd_slcode,jdbcType=VARCHAR},
       </if>
-      <if test="rbdSlkind != null" >
-        #{rbdSlkind,jdbcType=VARCHAR},
+      <if test="rbd_slkind != null" >
+        #{rbd_slkind,jdbcType=VARCHAR},
       </if>
-      <if test="rbdSldate != null" >
-        #{rbdSldate,jdbcType=TIMESTAMP},
+      <if test="rbd_sldate != null" >
+        #{rbd_sldate,jdbcType=TIMESTAMP},
       </if>
-      <if test="rbdAmount != null" >
-        #{rbdAmount,jdbcType=DOUBLE},
+      <if test="rbd_amount != null" >
+        #{rbd_amount,jdbcType=DOUBLE},
       </if>
-      <if test="rbdNowbalance != null" >
-        #{rbdNowbalance,jdbcType=DOUBLE},
+      <if test="rbd_nowbalance != null" >
+        #{rbd_nowbalance,jdbcType=DOUBLE},
       </if>
-      <if test="rbdRemark != null" >
-        #{rbdRemark,jdbcType=VARCHAR},
+      <if test="rbd_remark != null" >
+        #{rbd_remark,jdbcType=VARCHAR},
       </if>
       <if test="companyId != null" >
         #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null" >
-        #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updateTime != null" >
-        #{updateTime,jdbcType=TIMESTAMP},
+      <if test="updatedate != null" >
+        #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="rbdText1 != null" >
-        #{rbdText1,jdbcType=VARCHAR},
+      <if test="rbd_text1 != null" >
+        #{rbd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="rbdText2 != null" >
-        #{rbdText2,jdbcType=VARCHAR},
+      <if test="rbd_text2 != null" >
+        #{rbd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="rbdText3 != null" >
-        #{rbdText3,jdbcType=VARCHAR},
+      <if test="rbd_text3 != null" >
+        #{rbd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="rbdText4 != null" >
-        #{rbdText4,jdbcType=VARCHAR},
+      <if test="rbd_text4 != null" >
+        #{rbd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="rbdText5 != null" >
-        #{rbdText5,jdbcType=VARCHAR},
+      <if test="rbd_text5 != null" >
+        #{rbd_text5,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Recbalancedetail" >
     update recbalancedetail
     <set >
-      <if test="rbdRbid != null" >
-        rbd_rbid = #{rbdRbid,jdbcType=INTEGER},
+      <if test="id != null" >
+        rbd_rbid = #{id,jdbcType=INTEGER},
       </if>
-      <if test="rbdDetno != null" >
-        rbd_detno = #{rbdDetno,jdbcType=INTEGER},
+      <if test="rbd_detno != null" >
+        rbd_detno = #{rbd_detno,jdbcType=INTEGER},
       </if>
-      <if test="rbdYm != null" >
-        rbd_ym = #{rbdYm,jdbcType=INTEGER},
+      <if test="rbd_ym != null" >
+        rbd_ym = #{rbd_ym,jdbcType=INTEGER},
       </if>
-      <if test="rbdSlid != null" >
-        rbd_slid = #{rbdSlid,jdbcType=INTEGER},
+      <if test="rbd_slid != null" >
+        rbd_slid = #{rbd_slid,jdbcType=INTEGER},
       </if>
-      <if test="rbdSlcode != null" >
-        rbd_slcode = #{rbdSlcode,jdbcType=VARCHAR},
+      <if test="rbd_slcode != null" >
+        rbd_slcode = #{rbd_slcode,jdbcType=VARCHAR},
       </if>
-      <if test="rbdSlkind != null" >
-        rbd_slkind = #{rbdSlkind,jdbcType=VARCHAR},
+      <if test="rbd_slkind != null" >
+        rbd_slkind = #{rbd_slkind,jdbcType=VARCHAR},
       </if>
-      <if test="rbdSldate != null" >
-        rbd_sldate = #{rbdSldate,jdbcType=TIMESTAMP},
+      <if test="rbd_sldate != null" >
+        rbd_sldate = #{rbd_sldate,jdbcType=TIMESTAMP},
       </if>
-      <if test="rbdAmount != null" >
-        rbd_amount = #{rbdAmount,jdbcType=DOUBLE},
+      <if test="rbd_amount != null" >
+        rbd_amount = #{rbd_amount,jdbcType=DOUBLE},
       </if>
-      <if test="rbdNowbalance != null" >
-        rbd_nowbalance = #{rbdNowbalance,jdbcType=DOUBLE},
+      <if test="rbd_nowbalance != null" >
+        rbd_nowbalance = #{rbd_nowbalance,jdbcType=DOUBLE},
       </if>
-      <if test="rbdRemark != null" >
-        rbd_remark = #{rbdRemark,jdbcType=VARCHAR},
+      <if test="rbd_remark != null" >
+        rbd_remark = #{rbd_remark,jdbcType=VARCHAR},
       </if>
-      <if test="companyId != null" >
-        companyId = #{companyId,jdbcType=INTEGER},
+      <if test="companyid != null" >
+        companyid = #{companyid,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null" >
-        updaterId = #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updateTime != null" >
-        updatedate = #{updateTime,jdbcType=TIMESTAMP},
+      <if test="updatedate != null" >
+        updatedate = #{updatedate,jdbcType=TIMESTAMP},
       </if>
-      <if test="rbdText1 != null" >
-        rbd_text1 = #{rbdText1,jdbcType=VARCHAR},
+      <if test="rbd_text1 != null" >
+        rbd_text1 = #{rbd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="rbdText2 != null" >
-        rbd_text2 = #{rbdText2,jdbcType=VARCHAR},
+      <if test="rbd_text2 != null" >
+        rbd_text2 = #{rbd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="rbdText3 != null" >
-        rbd_text3 = #{rbdText3,jdbcType=VARCHAR},
+      <if test="rbd_text3 != null" >
+        rbd_text3 = #{rbd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="rbdText4 != null" >
-        rbd_text4 = #{rbdText4,jdbcType=VARCHAR},
+      <if test="rbd_text4 != null" >
+        rbd_text4 = #{rbd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="rbdText5 != null" >
-        rbd_text5 = #{rbdText5,jdbcType=VARCHAR},
+      <if test="rbd_text5 != null" >
+        rbd_text5 = #{rbd_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where rbd_id = #{rbdId,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Recbalancedetail" >
-    update recbalancedetail
-    set rbd_rbid = #{rbdRbid,jdbcType=INTEGER},
-      rbd_detno = #{rbdDetno,jdbcType=INTEGER},
-      rbd_ym = #{rbdYm,jdbcType=INTEGER},
-      rbd_slid = #{rbdSlid,jdbcType=INTEGER},
-      rbd_slcode = #{rbdSlcode,jdbcType=VARCHAR},
-      rbd_slkind = #{rbdSlkind,jdbcType=VARCHAR},
-      rbd_sldate = #{rbdSldate,jdbcType=TIMESTAMP},
-      rbd_amount = #{rbdAmount,jdbcType=DOUBLE},
-      rbd_nowbalance = #{rbdNowbalance,jdbcType=DOUBLE},
-      rbd_remark = #{rbdRemark,jdbcType=VARCHAR},
-      companyId = #{companyId,jdbcType=INTEGER},
-      updaterId = #{updaterid,jdbcType=INTEGER},
-      updatedate = #{updateTime,jdbcType=TIMESTAMP},
-      rbd_text1 = #{rbdText1,jdbcType=VARCHAR},
-      rbd_text2 = #{rbdText2,jdbcType=VARCHAR},
-      rbd_text3 = #{rbdText3,jdbcType=VARCHAR},
-      rbd_text4 = #{rbdText4,jdbcType=VARCHAR},
-      rbd_text5 = #{rbdText5,jdbcType=VARCHAR}
-    where rbd_id = #{rbdId,jdbcType=INTEGER}
+    where rbd_id = #{id,jdbcType=INTEGER}
   </update>
 </mapper>

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

@@ -33,4 +33,8 @@ public interface SaleMapper {
     Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long companyId);
 
     void updateTotal(Long id);
+
+    void updateTotalAndNetPrice(Long id);
+
+    void updateNetTotal(Long id);
 }

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

@@ -96,7 +96,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         prodInOut.setPi_date(new Date());
 
         //编号获取
-        pi_inoutno = pushMaxnubmer(pi_inoutno, pi_id,pi_class);
+        pi_inoutno = pushMaxnubmer(prodInOut);
         prodInOut.setPi_inoutno(pi_inoutno);
 
         prodInOut.setPi_class(main.getPi_class());
@@ -549,14 +549,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
      * @Author: guq
      * @Date: 2018/10/19
      */
-    private String pushMaxnubmer(String code, Long id,String pi_class) {
+    private String pushMaxnubmer(ProdInOut prodInOut) {
+        String code = prodInOut.getPi_inoutno();
+        Long id = prodInOut.getId();
+        String pi_class = prodInOut.getPi_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 ="";

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

@@ -137,7 +137,11 @@ public class SaleServiceImpl implements SaleService{
             }
             baseDTO = getBaseDTOById(sa_id);
             //更新销售金额
-            getTotal(sa_id);
+            updateTotal(sa_id);
+            //更新从表总额
+            updateTotalAndNetPrice(sa_id);
+            //更新从表不含税金额
+            updateNetTotal(sa_id);
             //日志记录
             messageLogService.save(baseDTO);
             return baseDTO;
@@ -165,7 +169,11 @@ public class SaleServiceImpl implements SaleService{
         }
         baseDTO = getBaseDTOById(sa_id);
         //更新销售金额
-        getTotal(sa_id);
+        updateTotal(sa_id);
+        //更新从表总额
+        updateTotalAndNetPrice(sa_id);
+        //更新从表不含税金额
+        updateNetTotal(sa_id);
         //日志
         messageLogService.update(baseDTO);
         return baseDTO;
@@ -252,7 +260,12 @@ public class SaleServiceImpl implements SaleService{
         sale.setUpdaterId(BaseContextHolder.getUserId());
         //更新存在字段
         saleMapper.updateByPrimaryKeySelective(sale);
-
+        //更新销售金额
+        updateTotal(id);
+        //更新从表总额
+        updateTotalAndNetPrice(id);
+        //更新从表不含税金额
+        updateNetTotal(id);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
         messageLogService.audit(docBaseDTO);
@@ -489,11 +502,31 @@ public class SaleServiceImpl implements SaleService{
     }
 
     //更新最新销售总额
-    private void getTotal(Long id) {
+    private void updateTotal(Long id) {
         if (null == id) {
             return;
         }
         saleMapper.updateTotal(id);
     }
 
+    /**
+    * @Description: 更新从表总额与不含税单价
+    * @Param: [id]
+    * @return: void
+    * @Author: guq
+    * @Date: 2018/10/27
+    */
+    private void updateTotalAndNetPrice(Long id) {
+        if (null == id) {
+            return;
+        }
+        saleMapper.updateTotalAndNetPrice(id);
+    }
+
+    private void updateNetTotal(Long id) {
+        if (null == id) {
+            return;
+        }
+        saleMapper.updateNetTotal(id);
+    }
 }

+ 11 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -364,4 +364,15 @@
   <update id="updateTotal" parameterType="long">
     	update sale a set sa_total=(select sum(sd_price*sd_qty) from saledetail b where b.sd_said=a.sa_id ) where sa_id=#{id};
   </update>
+
+  <update id="updateTotalAndNetPrice" parameterType="long">
+    update saledetail a set sd_total=sd_qty*sd_price,
+    sd_netprice=round(ifnull(sd_price,0)/(1+ifnull(sd_taxrate,0)/100),6)
+     where sd_said=#{id}
+  </update>
+
+  <update id="updateNetTotal" parameterType="long">
+    update saledetail a set sd_nettotal=round(ifnull(sd_netprice,0)*nvl(sd_qty,0),2)
+    where sd_said=#{id}
+  </update>
 </mapper>

+ 1 - 1
framework/core/src/main/java/com/usoftchina/saas/base/entity/BaseEntity.java

@@ -56,7 +56,7 @@ public abstract class BaseEntity<E extends Serializable> implements Serializable
      *
      * @return
      */
-    public abstract long getCompanyId();
+    public abstract Long getCompanyId();
 
     /**
      * set 公司ID

+ 6 - 6
framework/core/src/main/java/com/usoftchina/saas/base/entity/CommonBaseEntity.java

@@ -11,11 +11,11 @@ public abstract class CommonBaseEntity extends BaseEntity<Long> {
     /**
      * company id
      */
-    protected long companyId;
+    protected Long companyId;
     protected Date createTime;
-    protected long creatorId;
+    protected Long creatorId;
     protected Date updateTime;
-    protected long updaterId;
+    protected Long updaterId;
 
     @Override
     public Long getId() {
@@ -28,7 +28,7 @@ public abstract class CommonBaseEntity extends BaseEntity<Long> {
     }
 
     @Override
-    public long getCompanyId() {
+    public Long getCompanyId() {
         return companyId;
     }
 
@@ -46,7 +46,7 @@ public abstract class CommonBaseEntity extends BaseEntity<Long> {
         this.createTime = createTime;
     }
 
-    public long getCreatorId() {
+    public Long getCreatorId() {
         return creatorId;
     }
 
@@ -64,7 +64,7 @@ public abstract class CommonBaseEntity extends BaseEntity<Long> {
         this.updateTime = updateTime;
     }
 
-    public long getUpdaterId() {
+    public Long getUpdaterId() {
         return updaterId;
     }
 

+ 10 - 2
frontend/saas-web/Readme.md

@@ -90,7 +90,7 @@ viewModel: view.core.form.FormPanelModel
 | 字段 | 说明 | 必填 | 样例 |
 | --- | --- | --- | --- |
 | storeModel | grid model | √ | "saas.model.purchase.purchasedetail" |
-| detnoColumn | 序号列 | √ | "pud_detno" |
+| detnoColumn | 序号列,配置该项后无需再columns定义序号列 | √ | "pud_detno" |
 | columns[i].ignore | 是否忽略,为真时在调用保存方法时不会取到该列值 | x | true |
 | deleteDetailUrl | 删除明细接口 | √ | basePath + "purchase/purchase/deleteItem" |
 - 需要根据columns在models文件夹下添加storeModel对应的Model
@@ -148,5 +148,13 @@ viewModel: view.core.query.QueryPanelModel
 
 ### 前端配置调整日志
 
-2018-10-20 deleteDetailUrl 配置调整 formpanel.form->formpanel.detailGridField
+- 2018-10-20
+
+deleteDetailUrl 配置调整 formpanel.form->formpanel.detailGridField
+
+- 2018-10-27 10:10:33
+
+主从表从表配置detnoColumn属性说明变更
+
+
 

+ 17 - 0
frontend/saas-web/app/model/money/Othreceipts.js

@@ -0,0 +1,17 @@
+Ext.define('saas.model.money.Othreceipts', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'ord_id', type: 'int' },
+        { name: 'ord_orid', type: 'int' },
+        { name: 'ord_detno', type: 'int' },
+        { name: 'ord_ym', type: 'int' },
+        { name: 'ord_type', type: 'string' },
+        { name: 'ord_nowbalance', type: 'float' },
+        { name: 'ord_remark', type: 'string' },
+        { name: 'ord_text1', type: 'string' },
+        { name: 'ord_text2', type: 'string' },
+        { name: 'ord_text3', type: 'string' },
+        { name: 'ord_text4', type: 'string' },
+        { name: 'ord_text5', type: 'string' },
+    ]
+});

+ 17 - 0
frontend/saas-web/app/model/money/Othspendings.js

@@ -0,0 +1,17 @@
+Ext.define('saas.model.money.Othspendings', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'osd_id', type: 'number' },
+        { name: 'osd_orid', type: 'number' },
+        { name: 'osd_detno', type: 'number' },
+        { name: 'osd_ym', type: 'number' },
+        { name: 'osd_type', type: 'string' },
+        { name: 'osd_nowbalance', type: 'number' },
+        { name: 'osd_remark', type: 'string' },
+        { name: 'osd_text1', type: 'string' },
+        { name: 'osd_text2', type: 'string' },
+        { name: 'osd_text3', type: 'string' },
+        { name: 'osd_text4', type: 'string' },
+        { name: 'osd_text5', type: 'string' },
+    ]
+});

+ 25 - 0
frontend/saas-web/app/model/money/PayBalance1.js

@@ -0,0 +1,25 @@
+Ext.define('saas.model.money.PayBalance1', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'id', type: 'int' },
+        { name: 'pd_id', type: 'int' },
+        { name: 'pd_rbid', type: 'int' },
+        { name: 'pd_detno', type: 'int' },
+        { name: 'pd_ym', type: 'int' },
+        { name: 'pd_bankid', type: 'int' },
+        { name: 'pd_bankcode', type: 'string' },
+        { name: 'pd_bankname', type: 'string' },
+        { name: 'pd_amount', type: 'float' },
+        { name: 'pd_paymethod', type: 'string' },
+        { name: 'pd_paycode', type: 'string' },
+        { name: 'pd_remark', type: 'string' },
+        { name: 'companyid', type: 'int' },
+        { name: 'updaterId', type: 'int' },
+        { name: 'updatedate', type: 'date' },
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' }
+    ]
+});

+ 25 - 0
frontend/saas-web/app/model/money/PayBalance2.js

@@ -0,0 +1,25 @@
+Ext.define('saas.model.money.PayBalance2', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'id', type: 'int' },
+        { name: 'pbd_id', type: 'int' },
+        { name: 'pbd_pbid', type: 'int' },
+        { name: 'pbd_detno', type: 'int' },
+        { name: 'pbd_ym', type: 'int' },
+        { name: 'pbd_slid', type: 'int' },
+        { name: 'pbd_slcode', type: 'string' },
+        { name: 'pbd_slkind', type: 'string' },
+        { name: 'pbd_sldate', type: 'date' },
+        { name: 'pbd_amount', type: 'float' },
+        { name: 'pbd_nowbalance', type: 'float' },
+        { name: 'pbd_remark', type: 'string' },
+        { name: 'companyid', type: 'int' },
+        { name: 'updaterId', type: 'int' },
+        { name: 'updatedate', type: 'date' },
+        { name: 'pd_text1', type: 'string' },
+        { name: 'pd_text2', type: 'string' },
+        { name: 'pd_text3', type: 'string' },
+        { name: 'pd_text4', type: 'string' },
+        { name: 'pd_text5', type: 'string' }
+    ]
+});

+ 6 - 2
frontend/saas-web/app/model/money/RecBalance1.js

@@ -1,9 +1,13 @@
 Ext.define('saas.model.money.RecBalance1', {
     extend: 'saas.model.Base',
     fields: [
-        { name: 'rd_detno', type: 'number' },
+        { name: 'id', type: 'int' },
+        { name: 'rd_detno', type: 'int' },
+        { name: 'rd_ym', type: 'int' },
+        { name: 'rd_bankid', type: 'int' },
+        { name: 'rd_bankcode', type: 'string' },
         { name: 'rd_bankname', type: 'string' },
-        { name: 'rd_amount', type: 'number' },
+        { name: 'rd_amount', type: 'float' },
         { name: 'rd_paymethod', type: 'string' },
         { name: 'rd_paycode', type: 'string' },
         { name: 'rd_remark', type: 'string' }

+ 7 - 6
frontend/saas-web/app/model/money/RecBalance2.js

@@ -1,14 +1,15 @@
 Ext.define('saas.model.money.RecBalance2', {
     extend: 'saas.model.Base',
     fields: [
-        { name: 'rbd_detno', type: 'number' },
+        { name: 'id', type: 'int' },
+        { name: 'rbd_detno', type: 'int' },
+        { name: 'rbd_ym', type: 'int' },
+        { name: 'rbd_slid', type: 'int' },
         { name: 'rbd_slcode', type: 'string' },
         { name: 'rbd_slkind', type: 'string' },
         { name: 'rbd_sldate', type: 'date' },
-        { name: 'rbd_amount', type: 'number' },
-        { name: 'rbd_remark', type: 'number' },
-        { name: 'pbd_nowbalance', type: 'number' },
-        { name: 'pbd_nowbalance', type: 'number' },
-        { name: 'pbd_nowbalance', type: 'number' }
+        { name: 'rbd_amount', type: 'float' },
+        { name: 'rbd_nowbalance', type: 'float' },
+        { name: 'rbd_remark', type: 'string' }
     ]
 });

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