Browse Source

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

hy 7 years ago
parent
commit
4c92d9069d
42 changed files with 1759 additions and 180 deletions
  1. 3 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java
  2. 18 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java
  3. 18 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductListDTO.java
  4. 30 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendor.java
  5. 1 1
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java
  6. 3 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  7. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java
  8. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BankinformationController.java
  9. 40 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java
  10. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java
  11. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/FundinouttypeController.java
  12. 41 13
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  13. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductbrandController.java
  14. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProducttypeController.java
  15. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductunitController.java
  16. 39 5
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java
  17. 6 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorkindController.java
  18. 64 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java
  19. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BomDetailMapper.java
  20. 7 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  21. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  22. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorkindMapper.java
  23. 9 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  24. 43 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/BomService.java
  25. 44 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  26. 31 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java
  27. 4 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorkindService.java
  28. 27 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/WarehouseService.java
  29. 144 15
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  30. 90 11
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  31. 126 14
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  32. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  33. 111 6
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  34. 3 0
      applications/document/document-server/src/main/resources/mapper/BomDetailMapper.xml
  35. 3 0
      applications/document/document-server/src/main/resources/mapper/BomMapper.xml
  36. 387 8
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  37. 357 4
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  38. 60 57
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml
  39. 3 0
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  40. 11 20
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  41. 1 1
      framework/core/src/main/java/com/usoftchina/saas/base/entity/BaseEntity.java
  42. 6 6
      framework/core/src/main/java/com/usoftchina/saas/base/entity/CommonBaseEntity.java

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

@@ -42,7 +42,9 @@ public enum  BillCodeSeq {
 
     OTHRECEIPTS("其他收入单", "Otherceipts"),
 
-    OTHSPENDINGS("其他收入单", "Otherceipts");
+    OTHSPENDINGS("其他收入单", "Otherceipts"),
+
+    BOM("BOM资料", "Bom");
 
     BillCodeSeq(String name, String caller) {
         this.name = name;

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

@@ -11,6 +11,24 @@ public class ProductDTO implements Serializable {
     private String pr_orispeccode;
     private String pr_brand;
     private String pr_unit;
+    private String pr_status;
+    private String pr_statuscode;
+
+    public String getPr_status() {
+        return pr_status;
+    }
+
+    public void setPr_status(String pr_status) {
+        this.pr_status = pr_status;
+    }
+
+    public String getPr_statuscode() {
+        return pr_statuscode;
+    }
+
+    public void setPr_statuscode(String pr_statuscode) {
+        this.pr_statuscode = pr_statuscode;
+    }
 
     public String getPr_unit() {
         return pr_unit;

+ 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);

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

@@ -3,8 +3,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.DocReqDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.dto.VendorListDTO;
@@ -40,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);
@@ -85,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);
     }
 
     /**
@@ -96,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());
+    }
+
 }

+ 64 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.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.document.entities.Warehouse;
 import com.usoftchina.saas.document.service.WarehouseService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import java.util.Map;
 
+@CrossOrigin
 @RestController
 @RequestMapping("/warehouse")
 public class WarehouseController {
@@ -47,8 +50,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);
     }
 
     /**
@@ -61,4 +64,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);
 }

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

@@ -2,7 +2,9 @@ package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.document.entities.Warehouse;
+import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
 import java.util.Map;
 
 public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
@@ -24,4 +26,11 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
     int updateByPrimaryKey(Warehouse record);
 
     void unPost(Map<String, Object> map);
+
+    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();
 
 }

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

@@ -1,10 +1,13 @@
 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.document.entities.Warehouse;
 import com.usoftchina.saas.document.mapper.WarehouseMapper;
 
 
+import java.util.List;
 import java.util.Map;
 
 public interface WarehouseService extends CommonBaseService<WarehouseMapper, Warehouse> {
@@ -13,7 +16,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());
+    }
 }

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

@@ -1,16 +1,25 @@
 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.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.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;
 
 @Service
@@ -18,6 +27,8 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
 
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private MaxnumberService maxnumberService;
 
     /**
      * 过账
@@ -53,18 +64,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;
     }
 
     /**
@@ -76,12 +97,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>

+ 11 - 20
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,25 +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="whId" />
-        <result column="wh_code" jdbcType="VARCHAR" property="whCode" />
-        <result column="wh_type" jdbcType="VARCHAR" property="whType" />
-        <result column="wh_description" jdbcType="VARCHAR" property="whDescription" />
-        <result column="wh_statuscode" jdbcType="VARCHAR" property="whStatuscode" />
-        <result column="wh_status" jdbcType="VARCHAR" property="whStatus" />
-        <result column="wh_recorderid" jdbcType="VARCHAR" property="whRecorderid" />
-        <result column="wh_recorder" jdbcType="VARCHAR" property="whRecorder" />
-        <result column="wh_date" jdbcType="TIMESTAMP" property="whDate" />
-        <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="whText1" />
-        <result column="wh_text2" jdbcType="VARCHAR" property="whText2" />
-        <result column="wh_text3" jdbcType="VARCHAR" property="whText3" />
-        <result column="wh_text4" jdbcType="VARCHAR" property="whText4" />
-        <result column="wh_text5" jdbcType="VARCHAR" property="whText5" />
-    </resultMap>
 
+    <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>
 

+ 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;
     }