Browse Source

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

zhuth 7 years ago
parent
commit
01a8f600b8
78 changed files with 1847 additions and 80 deletions
  1. 70 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/InitStatusDTO.java
  2. 4 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  3. 12 2
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java
  4. 17 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/CommonMapper.java
  5. 13 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/CommonService.java
  6. 46 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/CommonServiceImpl.java
  7. 19 0
      applications/commons/commons-server/src/main/resources/mapper/CommonMapper.xml
  8. 11 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductListDTO.java
  9. 86 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/ProdIODetail.java
  10. 72 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/ProdInOut.java
  11. 148 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/ProductDetail.java
  12. 7 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  13. 28 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductDetailMapper.java
  14. 16 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  15. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  16. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  17. 10 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  18. 220 6
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  19. 23 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  20. 18 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  21. 332 0
      applications/document/document-server/src/main/resources/mapper/ProductDetailMapper.xml
  22. 409 1
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  23. 6 0
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  24. 15 0
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  25. 6 6
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  26. 3 1
      frontend/saas-web/app/view/core/form/FormPanelController.js
  27. 9 5
      frontend/saas-web/app/view/core/form/MseeageLog.js
  28. 5 5
      frontend/saas-web/app/view/document/kind/ChildForm.js
  29. 1 1
      frontend/saas-web/app/view/document/kind/Kind.js
  30. 4 1
      frontend/saas-web/app/view/money/othreceipts/FormPanelController.js
  31. 10 1
      frontend/saas-web/app/view/money/othreceipts/QueryPanelController.js
  32. 4 1
      frontend/saas-web/app/view/money/othspendings/QueryPanelController.js
  33. 4 1
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  34. 4 1
      frontend/saas-web/app/view/money/payBalance/QueryPanelController.js
  35. 8 2
      frontend/saas-web/app/view/money/recBalance/FormPanelController.js
  36. 4 1
      frontend/saas-web/app/view/money/recBalance/QueryPanelController.js
  37. 1 1
      frontend/saas-web/app/view/money/report/CustomerCheck.js
  38. 4 1
      frontend/saas-web/app/view/money/report/CustomerCheckController.js
  39. 4 1
      frontend/saas-web/app/view/money/report/PayDetailController.js
  40. 4 1
      frontend/saas-web/app/view/money/report/RecDetailController.js
  41. 4 1
      frontend/saas-web/app/view/money/report/VendorCheckController.js
  42. 4 1
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  43. 4 1
      frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js
  44. 8 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  45. 4 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  46. 4 1
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js
  47. 8 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  48. 4 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  49. 4 1
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelController.js
  50. 4 1
      frontend/saas-web/app/view/purchase/report/PurchaseController.js
  51. 4 1
      frontend/saas-web/app/view/purchase/report/PurchasePayController.js
  52. 4 1
      frontend/saas-web/app/view/sale/report/SaleController.js
  53. 1 1
      frontend/saas-web/app/view/sale/report/SaleProfit.js
  54. 4 1
      frontend/saas-web/app/view/sale/report/SaleProfitController.js
  55. 1 1
      frontend/saas-web/app/view/sale/report/SaleRec.js
  56. 4 1
      frontend/saas-web/app/view/sale/report/SaleRecController.js
  57. 1 1
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  58. 4 1
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  59. 4 1
      frontend/saas-web/app/view/sale/sale/QueryPanelController.js
  60. 8 0
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  61. 4 1
      frontend/saas-web/app/view/sale/saleIn/FormPanelController.js
  62. 1 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  63. 4 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanelController.js
  64. 8 0
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  65. 4 1
      frontend/saas-web/app/view/sale/saleOut/FormPanelController.js
  66. 1 1
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  67. 4 1
      frontend/saas-web/app/view/sale/saleOut/QueryPanelController.js
  68. 9 1
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  69. 8 2
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js
  70. 4 1
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanelController.js
  71. 4 1
      frontend/saas-web/app/view/stock/make/QueryPanelController.js
  72. 8 0
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  73. 8 2
      frontend/saas-web/app/view/stock/otherIn/FormPanelController.js
  74. 8 2
      frontend/saas-web/app/view/stock/otherIn/QueryPanelController.js
  75. 8 0
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  76. 8 2
      frontend/saas-web/app/view/stock/otherOut/FormPanelController.js
  77. 8 2
      frontend/saas-web/app/view/stock/otherOut/QueryPanelController.js
  78. 1 1
      frontend/saas-web/app/view/stock/report/Prodiodetail.js

+ 70 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/InitStatusDTO.java

@@ -0,0 +1,70 @@
+package com.usoftchina.saas.commons.dto;
+
+import java.io.Serializable;
+
+public class InitStatusDTO implements Serializable {
+
+    private Long companyId;
+    private boolean baseSet;
+    private boolean warehouse;
+    private boolean product;
+    private boolean customer;
+    private boolean vendor;
+    private boolean begin;
+
+    public boolean isBegin() {
+        return begin;
+    }
+
+    public void setBegin(boolean begin) {
+        this.begin = begin;
+    }
+
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
+
+    public boolean isBaseSet() {
+        return baseSet;
+    }
+
+    public void setBaseSet(boolean baseSet) {
+        this.baseSet = baseSet;
+    }
+
+    public boolean isWarehouse() {
+        return warehouse;
+    }
+
+    public void setWarehouse(boolean warehouse) {
+        this.warehouse = warehouse;
+    }
+
+    public boolean isProduct() {
+        return product;
+    }
+
+    public void setProduct(boolean product) {
+        this.product = product;
+    }
+
+    public boolean isCustomer() {
+        return customer;
+    }
+
+    public void setCustomer(boolean customer) {
+        this.customer = customer;
+    }
+
+    public boolean isVendor() {
+        return vendor;
+    }
+
+    public void setVendor(boolean vendor) {
+        this.vendor = vendor;
+    }
+}

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

@@ -26,9 +26,13 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BIZ_UNAUDITED(79304,"只能反审核已审核的单据"),
     BIZ_DELETE(79305,"只能删除未审核的单据"),
     BIZ_RELDELETE(79305,"存在关联单据,不允许删除"),
+    BIZ_RELDELETE_UPDATE(79306,"存在关联单据,不允许更新编号"),
+    BIZ_RELDELETE_UPDATEPROD(79307,"存在关联单据,不允许更新"),
+    BIZ_RELDELETE_DELETEPROD(79308,"存在关联单据,不允许删除"),
     NO_OPRATIONDATA(79400,"无可操作单据"),
     BOM_SAVE(79401, "产品编号+版本号已存在"),
     REPEAT_NAME(79501, "名称重复"),
+    REPEAT_CODE(79502, "编号重复"),
     NO_DATA(79998, "未找到数据"),
     ILLEGAL_ID(79999, "id不正确"),
     PRODUCT_HAS_WAREHOUSE(79502, "存在物料默认仓库资料为该仓库资料,无法删除"),

+ 12 - 2
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java

@@ -1,16 +1,26 @@
 package com.usoftchina.saas.commons.controller;
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.service.CommonService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 @RestController
 public class CommonController {
 
-    @RequestMapping("/{caller}/export")
+    @Autowired
+    private CommonService commonService;
+
+    @GetMapping("/{caller}/export")
     public Result export(@PathVariable("caller") String caller){
         return Result.success();
     }
 
+    @GetMapping("/init/check")
+    public Result checkInitStatus(){
+        return Result.success(commonService.initCheck());
+    }
+
 }

+ 17 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/CommonMapper.java

@@ -0,0 +1,17 @@
+package com.usoftchina.saas.commons.mapper;
+
+import org.apache.ibatis.annotations.Param;
+
+public interface CommonMapper {
+
+    int getCountBaseSet(@Param("companyId") Long companyId);
+
+    int getCountWarehouse(@Param("companyId") Long companyId);
+
+    int getCountProduct(@Param("companyId") Long companyId);
+
+    int getCountCustomer(@Param("companyId") Long companyId);
+
+    int getCountVendor(@Param("companyId") Long companyId);
+
+}

+ 13 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/CommonService.java

@@ -0,0 +1,13 @@
+package com.usoftchina.saas.commons.service;
+
+import com.usoftchina.saas.commons.dto.InitStatusDTO;
+
+public interface CommonService {
+
+    /**
+     * 检查初始化状态
+     * @return
+     */
+    InitStatusDTO initCheck();
+
+}

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

@@ -0,0 +1,46 @@
+package com.usoftchina.saas.commons.service.impl;
+
+import com.usoftchina.saas.commons.dto.InitStatusDTO;
+import com.usoftchina.saas.commons.mapper.CommonMapper;
+import com.usoftchina.saas.commons.service.CommonService;
+import com.usoftchina.saas.context.BaseContextHolder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CommonServiceImpl implements CommonService {
+
+    @Autowired
+    private CommonMapper commonMapper;
+
+    @Override
+    public InitStatusDTO initCheck() {
+        InitStatusDTO result = new InitStatusDTO();
+        int count = 0;
+        Long companyId = BaseContextHolder.getCompanyId();
+        count = commonMapper.getCountBaseSet(companyId);
+        if (count > 0){
+            result.setBaseSet(true);
+        }
+        count = commonMapper.getCountWarehouse(companyId);
+        if (count > 0){
+            result.setWarehouse(true);
+        }
+        count = commonMapper.getCountProduct(companyId);
+        if (count > 0){
+            result.setProduct(true);
+        }
+        count = commonMapper.getCountProduct(companyId);
+        if (count > 0){
+            result.setCustomer(true);
+        }
+        count = commonMapper.getCountVendor(companyId);
+        if (count > 0){
+            result.setVendor(true);
+        }
+        if (result.isBaseSet() && result.isWarehouse() && result.isProduct() && result.isCustomer() && result.isVendor()){
+            result.setBegin(true);
+        }
+        return result;
+    }
+}

+ 19 - 0
applications/commons/commons-server/src/main/resources/mapper/CommonMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.commons.mapper.CommonMapper" >
+    <select id="getCountBaseSet" resultType="int">
+        SELECT COUNT(*) FROM ENTERPRISE WHERE COMPANYID = #{companyId}
+    </select>
+    <select id="getCountWarehouse" resultType="int">
+        SELECT COUNT(*) FROM WAREHOUSE WHERE COMPANYID=#{companyId} AND WH_STATUSCODE = 'OPEN'
+    </select>
+    <select id="getCountProduct" resultType="int">
+        SELECT COUNT(*) FROM PRODUCT WHERE COMPANYID=#{companyId} AND PR_STATUSCODE = 'OPEN'
+    </select>
+    <select id="getCountCustomer" resultType="int">
+        SELECT COUNT(*) FROM CUSTOMER WHERE COMPANYID=#{companyId} AND CU_STATUSCODE = 'OPEN'
+    </select>
+    <select id="getCountVendor" resultType="int">
+        SELECT COUNT(*) FROM VENDOR WHERE COMPANYID=#{companyId} AND VE_STATUSCODE = 'OPEN'
+    </select>
+</mapper>

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

@@ -1,12 +1,23 @@
 package com.usoftchina.saas.document.dto;
 
 import com.usoftchina.saas.document.entities.Product;
+import com.usoftchina.saas.document.entities.ProductDetail;
 
 import java.io.Serializable;
+import java.util.List;
 
 public class ProductListDTO implements Serializable {
 
     private Product main;
+    private List<ProductDetail> items;
+
+    public List<ProductDetail> getItems() {
+        return items;
+    }
+
+    public void setItems(List<ProductDetail> items) {
+        this.items = items;
+    }
 
     public Product getMain() {
         return main;

+ 86 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/ProdIODetail.java

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

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

@@ -0,0 +1,72 @@
+package com.usoftchina.saas.document.entities;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class ProdInOut extends CommonBaseEntity implements Serializable {
+
+    private String pi_inoutno;
+
+    private String pi_class;
+
+    private Date pi_date;
+
+    private Integer pi_vendid;
+
+    private String pi_vendcode;
+
+    private String pi_vendname;
+
+    private Integer pi_custid;
+
+    private String pi_custcode;
+
+    private String pi_custname;
+
+    private Integer pi_puid;
+
+    private String pi_pucode;
+
+    private Integer pi_said;
+
+    private String pi_sacode;
+
+    private Double pi_total;
+
+    private Long pi_recordmanid;
+
+    private String pi_recordman;
+
+    private Date pi_recorddate;
+
+    private String pi_status;
+
+    private String pi_statuscode;
+
+    private String pi_printstatus;
+
+    private String pi_printstatuscode;
+
+    private String pi_text1;
+
+    private String pi_text2;
+
+    private String pi_text3;
+
+    private String pi_text4;
+
+    private String pi_text5;
+
+    private String pi_address;
+
+    private Date pi_auditdate;
+
+    private String pi_auditman;
+
+    private String pi_remark;
+
+}

+ 148 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/ProductDetail.java

@@ -0,0 +1,148 @@
+package com.usoftchina.saas.document.entities;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class ProductDetail extends CommonBaseEntity implements Serializable {
+    private Long pd_prodid;
+
+    private String pd_prodcode;
+
+    private Integer pd_detno;
+
+    private String pd_whcode;
+
+    private String pd_whname;
+
+    private Integer pd_whid;
+
+    private Double pd_price;
+
+    private Double pd_amount;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Double pd_num;
+
+    public Long getPd_prodid() {
+        return pd_prodid;
+    }
+
+    public void setPd_prodid(Long pd_prodid) {
+        this.pd_prodid = pd_prodid;
+    }
+
+    public String getPd_prodcode() {
+        return pd_prodcode;
+    }
+
+    public void setPd_prodcode(String pd_prodcode) {
+        this.pd_prodcode = pd_prodcode == null ? null : pd_prodcode.trim();
+    }
+
+    public Integer getPd_detno() {
+        return pd_detno;
+    }
+
+    public void setPd_detno(Integer pd_detno) {
+        this.pd_detno = pd_detno;
+    }
+
+    public String getPd_whcode() {
+        return pd_whcode;
+    }
+
+    public void setPd_whcode(String pd_whcode) {
+        this.pd_whcode = pd_whcode == null ? null : pd_whcode.trim();
+    }
+
+    public String getPd_whname() {
+        return pd_whname;
+    }
+
+    public void setPd_whname(String pd_whname) {
+        this.pd_whname = pd_whname == null ? null : pd_whname.trim();
+    }
+
+    public Integer getPd_whid() {
+        return pd_whid;
+    }
+
+    public void setPd_whid(Integer pd_whid) {
+        this.pd_whid = pd_whid;
+    }
+
+    public Double getPd_price() {
+        return pd_price;
+    }
+
+    public void setPd_price(Double pd_price) {
+        this.pd_price = pd_price;
+    }
+
+    public Double getPd_amount() {
+        return pd_amount;
+    }
+
+    public void setPd_amount(Double pd_amount) {
+        this.pd_amount = pd_amount;
+    }
+
+    public String getPd_text1() {
+        return pd_text1;
+    }
+
+    public void setPd_text1(String pd_text1) {
+        this.pd_text1 = pd_text1 == null ? null : pd_text1.trim();
+    }
+
+    public String getPd_text2() {
+        return pd_text2;
+    }
+
+    public void setPd_text2(String pd_text2) {
+        this.pd_text2 = pd_text2 == null ? null : pd_text2.trim();
+    }
+
+    public String getPd_text3() {
+        return pd_text3;
+    }
+
+    public void setPd_text3(String pd_text3) {
+        this.pd_text3 = pd_text3 == null ? null : pd_text3.trim();
+    }
+
+    public String getPd_text4() {
+        return pd_text4;
+    }
+
+    public void setPd_text4(String pd_text4) {
+        this.pd_text4 = pd_text4 == null ? null : pd_text4.trim();
+    }
+
+    public String getPd_text5() {
+        return pd_text5;
+    }
+
+    public void setPd_text5(String pd_text5) {
+        this.pd_text5 = pd_text5 == null ? null : pd_text5.trim();
+    }
+
+    public Double getPd_num() {
+        return pd_num;
+    }
+
+    public void setPd_num(Double pd_num) {
+        this.pd_num = pd_num;
+    }
+}

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

@@ -51,7 +51,7 @@ public class ProductController {
 
     @PostMapping("/save")
     public Result save(@RequestBody ProductListDTO productListDTO){
-        DocBaseDTO docBaseDTO = productService.saveData(productListDTO.getMain());
+        DocBaseDTO docBaseDTO = productService.saveData(productListDTO);
         return Result.success(docBaseDTO);
     }
 
@@ -61,6 +61,12 @@ public class ProductController {
         return Result.success();
     }
 
+    @PostMapping("/deleteDetail/{id}")
+    public Result deleteDetail(@PathVariable("id") Long id){
+        productService.deleteDetailById(id);
+        return Result.success();
+    }
+
     @PostMapping("/close/{id}")
     public Result close(@PathVariable("id") Long id){
         DocBaseDTO docBaseDTO = productService.close(id);

+ 28 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductDetailMapper.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.document.entities.ProductDetail;
+
+import java.util.List;
+
+public interface ProductDetailMapper extends CommonBaseMapper<ProductDetail> {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(ProductDetail record);
+
+    int insertSelective(ProductDetail record);
+
+    ProductDetail selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(ProductDetail record);
+
+    int updateByPrimaryKey(ProductDetail record);
+
+    void batchInsert(List<ProductDetail> productDetailList);
+
+    void batchUpdate(List<ProductDetail> productDetailList);
+
+    Long selectProdidByPrimaryKey(Long id);
+
+    List<ProductDetail> selectByProdId(Long id);
+}

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

@@ -4,6 +4,8 @@ import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
+import com.usoftchina.saas.document.entities.ProdIODetail;
+import com.usoftchina.saas.document.entities.ProdInOut;
 import com.usoftchina.saas.document.entities.Product;
 import org.apache.ibatis.annotations.Param;
 
@@ -13,7 +15,7 @@ public interface ProductMapper extends CommonBaseMapper<Product> {
 
     List<ProductDTO> getProductsByCondition(@Param("con") String con, @Param("companyId") Long companyId);
 
-    List<ComboDTO> getProdUnit();
+    List<ComboDTO> getProdUnit(@Param("companyId") Long companyId);
 
     void updateLatestPurchasePrice(Long pu_id);
 
@@ -33,4 +35,17 @@ public interface ProductMapper extends CommonBaseMapper<Product> {
 
     int getCountFromProdIO(@Param("id") Long id, @Param("companyId") Long companyId);
 
+    boolean saveProdInOut(ProdInOut prodInOut);
+
+    boolean batchInsertDetail(List<ProdIODetail> prodIODetailList);
+
+    boolean batchUpdateDetail(List<ProdIODetail> prodIODetailList);
+
+    String selectProdIOCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("type") String type);
+
+    int selectOrderCountByProdCode(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    boolean deleteProdIOByCode(@Param("code") String code, @Param("companyId") Long companyId);
+
+    boolean deleteProdIODetailByCode(@Param("code") String code, @Param("companyId") Long companyId);
 }

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

@@ -22,4 +22,8 @@ public interface VendorMapper extends CommonBaseMapper<Vendor> {
     int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
 
     String getCodeById(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    int getCountByCode(@Param("code") String code, @Param("companyId") Long companyId);
+
+    int getCountByName(@Param("name") String name, @Param("companyId") Long companyId);
 }

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

@@ -40,4 +40,7 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
     Integer deleteCheckProduct(@Param("id") Long id, @Param("companyId") Long companyId);
 
     Integer deleteCheckWH(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    int selectCountByCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("id") Long id);
+
 }

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

@@ -9,6 +9,7 @@ import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.ProductDTO;
+import com.usoftchina.saas.document.dto.ProductListDTO;
 import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.mapper.ProductMapper;
@@ -48,10 +49,10 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
 
     /**
      * 保存/更新
-     * @param product
+     * @param productListDTO
      * @return
      */
-    DocBaseDTO saveData(Product product);
+    DocBaseDTO saveData(ProductListDTO productListDTO);
 
     /**
      * 关闭
@@ -109,4 +110,11 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
      * @return
      */
     PageInfo<ProductReserveCostDTO> getReserveCost(PageRequest page, ListReqDTO listReqDTO);
+
+    /**
+     * 通过明细ID删除明细
+     * @param id
+     * @return
+     */
+    boolean deleteDetailById(Long id);
 }

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

@@ -14,18 +14,20 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.ProductDTO;
+import com.usoftchina.saas.document.dto.ProductListDTO;
 import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
-import com.usoftchina.saas.document.entities.Product;
+import com.usoftchina.saas.document.entities.*;
+import com.usoftchina.saas.document.mapper.ProductDetailMapper;
 import com.usoftchina.saas.document.mapper.ProductMapper;
 import com.usoftchina.saas.document.service.ProductService;
+import com.usoftchina.saas.document.service.WarehouseService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
-import javax.print.Doc;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 @Service
 public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Product> implements ProductService {
@@ -34,6 +36,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     private MessageLogService messageLogService;
     @Autowired
     private MaxnumberService maxnumberService;
+    @Autowired
+    private WarehouseService warehouseService;
+    @Autowired
+    private ProductDetailMapper productDetailMapper;
 
     @Override
     public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO) {
@@ -52,7 +58,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
 
     @Override
     public List<ComboDTO> getProdUnit() {
-        return getMapper().getProdUnit();
+        return getMapper().getProdUnit(BaseContextHolder.getCompanyId());
     }
 
     @Override
@@ -69,18 +75,65 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     }
 
     @Override
-    public DocBaseDTO saveData(Product product){
+    public DocBaseDTO saveData(ProductListDTO productListDTO){
+        Product product = productListDTO.getMain();
+        List<ProductDetail> productDetailList = productListDTO.getItems();
         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);
+            //保存明细表数据
+            productDetailMapper.batchInsert(productDetailList);
+            //生成库存初始化数据并过账
+            generateProdIOPost(product, productDetailList);
+
             docBaseDTO = generateMsgObj(product.getId(), code);
             //记录LOG
             messageLogService.save(docBaseDTO);
         }else{
+            String oldCode = getMapper().getCodeById(product.getId());
+            if (!product.getPr_code().equals(oldCode)){
+                validEnableUpdate(product.getId());
+            }
+            //物料发生过除库存初始化外的出入库单时,不能新增,修改,删除
+            validProductOperation(product.getId(), BizExceptionCode.BIZ_RELDELETE_UPDATEPROD);
+
+            //明细数据有更新/插入动作
+            if (productDetailList.size() > 0){
+                //找到原始单据,反过账并删除
+                String inoutCode = getMapper().selectProdIOCode(product.getPr_code(), BaseContextHolder.getCompanyId(), "库存初始化");
+                post(inoutCode, "反过账");
+                getMapper().deleteProdIOByCode(inoutCode, BaseContextHolder.getCompanyId());
+                getMapper().deleteProdIODetailByCode(inoutCode, BaseContextHolder.getCompanyId());
+                //此种情况不可能发生明细行数量,只会发生明细行数据修改/新增明细行
+                //a.更新明细行数据
+                List<ProductDetail> insertItems = new ArrayList<ProductDetail>();
+                List<ProductDetail> updateItems = new ArrayList<ProductDetail>();
+                for(ProductDetail productDetail : productDetailList){
+                    if (productDetail.getId() == 0){
+                        insertItems.add(productDetail);
+                    }else{
+                        updateItems.add(productDetail);
+                    }
+                }
+                if (insertItems.size() > 0){
+                    productDetailMapper.batchInsert(insertItems);
+                }
+                if (updateItems.size() > 0){
+                    productDetailMapper.batchUpdate(updateItems);
+                }
+
+                //b.获取更新后的明细数据,生成库存初始化数据并过账
+                List<ProductDetail> productDetails = productDetailMapper.selectByProdId(product.getId());
+                generateProdIOPost(product, productDetails);
+
+            }
+
             product.setUpdaterId(BaseContextHolder.getUserId());
             product.setUpdateTime(new Date());
             getMapper().updateByPrimaryKeySelective(product);
@@ -91,8 +144,111 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         return docBaseDTO;
     }
 
+    /**
+     * 物料发生过除库存初始化外的出入库单时,不能新增,修改,删除
+     * @param id
+     */
+    private void validProductOperation(Long id, BizExceptionCode bizExceptionCode) {
+        int count = getMapper().selectOrderCountByProdCode(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(bizExceptionCode);
+        }
+    }
+
+    /**
+     * 生成库存初始化数据并过账
+     * @param product
+     * @param productDetailList
+     */
+    private void generateProdIOPost(Product product, List<ProductDetail> productDetailList) {
+        Long companyId = BaseContextHolder.getCompanyId();
+        Long userId = BaseContextHolder.getUserId();
+        //1.有明细数据变更
+        if (productDetailList.size() > 0){
+            //生成库存初始化单据主表
+            ProdInOut prodInOut = new ProdInOut();
+            String inoutCode = maxnumberService.getMaxnumber("StorageInit", true).getData();
+            prodInOut.setPi_inoutno(inoutCode);     //出入库单号
+            prodInOut.setPi_class("库存初始化");
+            prodInOut.setPi_date(new Date());
+            //prodInOut.setPi_total();            //含税金额
+            prodInOut.setPi_recordman("");
+            prodInOut.setPi_recordmanid(userId);
+            prodInOut.setPi_recorddate(new Date());
+            prodInOut.setPi_status(Status.UNAUDITED.getDisplay());
+            prodInOut.setPi_statuscode(Status.UNAUDITED.name());
+            prodInOut.setPi_text1(product.getPr_code());
+            prodInOut.setCompanyId(companyId);
+
+            //主表插入
+            getMapper().saveProdInOut(prodInOut);
+            Long pi_id = prodInOut.getId();
+            List<ProdIODetail> insertItems = new ArrayList<ProdIODetail>();
+            //生成库存初始化单据明细表
+            for(ProductDetail productDetail : productDetailList){
+                ProdIODetail prodIODetail = generateProdIODetail(product, productDetail);
+                insertItems.add(prodIODetail);
+            }
+            //明细插入
+            getMapper().batchInsertDetail(insertItems);
+
+            //过账
+            post(inoutCode, "过账");
+        }
+    }
+
+    /**
+     * 过账
+     * @param code
+     */
+    private void post(String code, String type){
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("inoutNo", code);
+        map.put("class", "库存初始化");
+        map.put("commitid", BaseContextHolder.getUserId());
+        map.put("companyId", BaseContextHolder.getCompanyId());
+        map.put("result", null);
+        if ("过账".equals(type)) {
+            warehouseService.post(map);
+        }else if ("反过账".equals(type)){
+            warehouseService.unPost(map);
+        }
+        if (StringUtils.isEmpty(map.get("result"))){
+            throw new BizException(76203, map.get("result").toString());
+        }
+    }
+
+    /**
+     * 生成库存初始化明细表
+     * @param product
+     * @param productDetail
+     * @return
+     */
+    private ProdIODetail generateProdIODetail(Product product, ProductDetail productDetail){
+        ProdIODetail prodIODetail = new ProdIODetail();
+        prodIODetail.setPd_piclass("库存初始化");
+        prodIODetail.setPd_inoutno(product.getPr_code());
+        prodIODetail.setPd_piid(product.getId());
+        prodIODetail.setPd_pdno(productDetail.getPd_detno());
+        prodIODetail.setPd_ordercode(product.getPr_code());         //订单号 -> 物料编号
+        prodIODetail.setPd_orderdetno(productDetail.getPd_detno()); //订单序号 -> 物料明细序号
+        prodIODetail.setPd_prodid(product.getId());                 //物料
+        prodIODetail.setPd_prodcode(product.getPr_code());          //物料编号
+        prodIODetail.setPd_unit(product.getPr_unit());              //单位
+        prodIODetail.setPd_inqty(productDetail.getPd_num());        //数量
+        prodIODetail.setPd_price(productDetail.getPd_price());      //成本单价
+        prodIODetail.setPd_total(productDetail.getPd_amount());     //成本金额
+        prodIODetail.setPd_whid(productDetail.getPd_whid());        //仓库库ID
+        prodIODetail.setPd_whcode(productDetail.getPd_whcode());    //仓库编号
+        prodIODetail.setPd_whname(productDetail.getPd_whname());    //仓库名称
+        prodIODetail.setPd_status(0);                               //状态
+        prodIODetail.setCompanyId(BaseContextHolder.getCompanyId());//公司ID
+        return prodIODetail;
+    }
+
     @Override
     public DocBaseDTO close(Long id) {
+        validEnableUpdate(id);
         DocBaseDTO docBaseDTO = null;
         if(id != null && id > 0){
             String code = getMapper().getCodeById(id);
@@ -169,7 +325,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     @Override
     public boolean deleteByPrimaryKey(Long id) {
         //校验物料是否已经在使用状态(采购单、销售单、BOM、出入库单)
+        validProductOperation(id, BizExceptionCode.BIZ_RELDELETE_DELETEPROD);
+        //校验是否存在关联单据
         validEnableDel(id);
+
         String code = getMapper().getCodeById(id);
         getMapper().deleteByPrimaryKey(id);
         DocBaseDTO docBaseDTO = generateMsgObj(id, code);
@@ -178,6 +337,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         return true;
     }
 
+    /**
+     * 校验是否存在关联单据
+     * @param id
+     */
     private void validEnableDel(Long id) {
         int count = 0;
         //采购
@@ -203,6 +366,34 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         //batch
     }
 
+    /**
+     * 校验是否存在关联单据,不存在时才允许更新物料编号
+     * @param id
+     */
+    private void validEnableUpdate(Long id){
+        int count = 0;
+        //采购
+        count = getMapper().getCountFromPurc(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE_UPDATE);
+        }
+        //销售
+        count = getMapper().getCountFromSale(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE_UPDATE);
+        }
+        //BOM
+        count = getMapper().getCountFromBom(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE_UPDATE);
+        }
+        //出入库
+        count = getMapper().getCountFromProdIO(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE_UPDATE);
+        }
+    }
+
     @Override
     public boolean batchDelete(BatchDealBaseDTO baseDTOs) {
         for(DocBaseDTO docBaseDTO : baseDTOs.getBaseDTOs()){
@@ -231,6 +422,29 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         return pageInfo;
     }
 
+    @Override
+    public boolean deleteDetailById(Long id) {
+        Long prodId = productDetailMapper.selectProdidByPrimaryKey(id);
+        validProductOperation(prodId, BizExceptionCode.BIZ_RELDELETE_DELETEPROD);
+        String prCode = getMapper().selectByPrimaryKey(id).getPr_code();
+        //找到原始单据,反过账并删除
+        String inoutCode = getMapper().selectProdIOCode(prCode, BaseContextHolder.getCompanyId(), "库存初始化");
+        if (!StringUtils.isEmpty(inoutCode)) {
+            post(inoutCode, "反过账");
+            getMapper().deleteProdIOByCode(inoutCode, BaseContextHolder.getCompanyId());
+            getMapper().deleteProdIODetailByCode(inoutCode, BaseContextHolder.getCompanyId());
+        }
+
+        productDetailMapper.deleteByPrimaryKey(id);
+
+        Product product = getMapper().selectByPrimaryKey(prodId);
+        List<ProductDetail> productDetailList = productDetailMapper.selectByProdId(prodId);
+
+        generateProdIOPost(product, productDetailList);
+
+        return true;
+    }
+
     private List<ProductReserveCostDTO> geReserveCost(ListReqDTO listReqDTO) {
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();

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

@@ -101,6 +101,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
     @Override
     @Transactional
     public DocBaseDTO saveFormData(VendorListDTO vendorListDTO) {
+        Long companyId = BaseContextHolder.getCompanyId();
         if (null == vendorListDTO || null == vendorListDTO.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
         }
@@ -110,6 +111,14 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         List<Vendorcontact> items = vendorListDTO.getItems();
         if(main.getId() == 0){
             code = pushMaxnubmer(main.getVe_code(), main.getId());
+            int count = getMapper().getCountByCode(code, companyId);
+            if(count > 0){
+                throw new BizException(500, "编号重复!");
+            }
+            count = getMapper().getCountByName(main.getVe_name(), companyId);
+            if (count > 0){
+                throw new BizException(500, "名称重复!");
+            }
             //保存主表信息
             main.setVe_code(code);
             getMapper().insertSelective(main);
@@ -129,6 +138,20 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             messageLogService.save(generateMsgObj(mainId, code));
         }else{
             code = main.getVe_code();
+            Vendor oldVendor = getMapper().selectByPrimaryKey(main.getId());
+            int count = getMapper().getCountByCode(code, companyId);
+            if (!code.equals(oldVendor.getVe_code())){
+                if (count > 0){
+                    throw new BizException(500, "编号重复!");
+                }
+            }
+            if (!main.getVe_name().equals(oldVendor.getVe_name())){
+                count = getMapper().getCountByName(main.getVe_name(), companyId);
+                if (count > 0){
+                    throw new BizException(500, "名称重复!");
+                }
+            }
+
             getMapper().updateByPrimaryKeySelective(main);
             if (items.size() > 0) {
                 List<Vendorcontact> updateItems = new ArrayList<Vendorcontact>();

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

@@ -104,6 +104,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
     public DocBaseDTO insertSelective(Warehouse record) {
         int count = 0;
         DocBaseDTO docBaseDTO = null;
+        Long companyId = BaseContextHolder.getCompanyId();
         if(record.getId() == 0){
             String code = pushMaxnubmer(record.getWh_code(), record.getId());
             record.setCompanyId(BaseContextHolder.getCompanyId());
@@ -112,6 +113,9 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
 
             //验证名称是否重复
             validName(record.getWh_description(), record.getId());
+            //验证编号是否重复
+            validCode(code, record.getId());
+
             count = getMapper().insertSelective(record);
             //记录LOG
             docBaseDTO = generateMsgObj(record.getId(), code);
@@ -121,6 +125,8 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
             record.setUpdaterId(BaseContextHolder.getUserId());
             //验证名称是否重复
             validName(record.getWh_description(), record.getId());
+            //验证编号是否重复
+            validCode(record.getWh_code(), record.getId());
 
             getMapper().updateByPrimaryKeySelective(record);
             //记录LOG
@@ -130,6 +136,18 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         return docBaseDTO;
     }
 
+    /**
+     * 校验code是否存在
+     * @param code
+     * @param id
+     */
+    private void validCode(String code, Long id) {
+        int count = getMapper().selectCountByCode(code, BaseContextHolder.getCompanyId(), id);
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_CODE);
+        }
+    }
+
     /**
      * 反过账
      * @param map

+ 332 - 0
applications/document/document-server/src/main/resources/mapper/ProductDetailMapper.xml

@@ -0,0 +1,332 @@
+<?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.ProductDetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.ProductDetail" >
+    <id column="id" property="id" jdbcType="INTEGER" />
+    <result column="pd_prodid" property="pd_prodid" jdbcType="INTEGER" />
+    <result column="pd_prodcode" property="pd_prodcode" jdbcType="VARCHAR" />
+    <result column="pd_detno" property="pd_detno" jdbcType="INTEGER" />
+    <result column="pd_whcode" property="pd_whcode" jdbcType="VARCHAR" />
+    <result column="pd_whname" property="pd_whname" jdbcType="VARCHAR" />
+    <result column="pd_whid" property="pd_whid" jdbcType="INTEGER" />
+    <result column="pd_price" property="pd_price" jdbcType="DOUBLE" />
+    <result column="pd_amount" property="pd_amount" jdbcType="DOUBLE" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="pd_text1" property="pd_text1" jdbcType="VARCHAR" />
+    <result column="pd_text2" property="pd_text2" jdbcType="VARCHAR" />
+    <result column="pd_text3" property="pd_text3" jdbcType="VARCHAR" />
+    <result column="pd_text4" property="pd_text4" jdbcType="VARCHAR" />
+    <result column="pd_text5" property="pd_text5" jdbcType="VARCHAR" />
+    <result column="pd_num" property="pd_num" jdbcType="DOUBLE" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, pd_prodid, pd_prodcode, pd_detno, pd_whcode, pd_whname, pd_whid, pd_price, pd_amount, 
+    companyId, updaterId, updateTime, pd_text1, pd_text2, pd_text3, pd_text4, pd_text5, 
+    pd_num
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from productdetail
+    where id = #{id}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from productdetail
+    where id = #{id}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.document.entities.ProductDetail" >
+      <selectKey resultType="java.lang.Long" keyProperty="id">
+          SELECT LAST_INSERT_ID() AS ID
+      </selectKey>
+    insert into productdetail ( pd_prodid, pd_prodcode,
+      pd_detno, pd_whcode, pd_whname, 
+      pd_whid, pd_price, pd_amount, 
+      companyId, updaterId, updateTime, 
+      pd_text1, pd_text2, pd_text3, 
+      pd_text4, pd_text5, pd_num
+      )
+    values ( #{pd_prodid,jdbcType=INTEGER}, #{pd_prodcode,jdbcType=VARCHAR},
+      #{pd_detno,jdbcType=INTEGER}, #{pd_whcode,jdbcType=VARCHAR}, #{pd_whname,jdbcType=VARCHAR}, 
+      #{pd_whid,jdbcType=INTEGER}, #{pd_price,jdbcType=DOUBLE}, #{pd_amount,jdbcType=DOUBLE}, 
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{pd_text1,jdbcType=VARCHAR}, #{pd_text2,jdbcType=VARCHAR}, #{pd_text3,jdbcType=VARCHAR}, 
+      #{pd_text4,jdbcType=VARCHAR}, #{pd_text5,jdbcType=VARCHAR}, #{pd_num,jdbcType=DOUBLE}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.ProductDetail" >
+      <selectKey resultType="java.lang.Long" keyProperty="id">
+          SELECT LAST_INSERT_ID() AS ID
+      </selectKey>
+    insert into productdetail
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="pd_prodid != null" >
+        pd_prodid,
+      </if>
+      <if test="pd_prodcode != null" >
+        pd_prodcode,
+      </if>
+      <if test="pd_detno != null" >
+        pd_detno,
+      </if>
+      <if test="pd_whcode != null" >
+        pd_whcode,
+      </if>
+      <if test="pd_whname != null" >
+        pd_whname,
+      </if>
+      <if test="pd_whid != null" >
+        pd_whid,
+      </if>
+      <if test="pd_price != null" >
+        pd_price,
+      </if>
+      <if test="pd_amount != null" >
+        pd_amount,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="pd_text1 != null" >
+        pd_text1,
+      </if>
+      <if test="pd_text2 != null" >
+        pd_text2,
+      </if>
+      <if test="pd_text3 != null" >
+        pd_text3,
+      </if>
+      <if test="pd_text4 != null" >
+        pd_text4,
+      </if>
+      <if test="pd_text5 != null" >
+        pd_text5,
+      </if>
+      <if test="pd_num != null" >
+        pd_num,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="pd_prodid != null" >
+        #{pd_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_prodcode != null" >
+        #{pd_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_detno != null" >
+        #{pd_detno,jdbcType=INTEGER},
+      </if>
+      <if test="pd_whcode != null" >
+        #{pd_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_whname != null" >
+        #{pd_whname,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_whid != null" >
+        #{pd_whid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_price != null" >
+        #{pd_price,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_amount != null" >
+        #{pd_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pd_text1 != null" >
+        #{pd_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text2 != null" >
+        #{pd_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text3 != null" >
+        #{pd_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text4 != null" >
+        #{pd_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text5 != null" >
+        #{pd_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_num != null" >
+        #{pd_num,jdbcType=DOUBLE},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.ProductDetail" >
+    update productdetail
+    <set >
+      <if test="pd_prodid != null" >
+        pd_prodid = #{pd_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_prodcode != null" >
+        pd_prodcode = #{pd_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_detno != null" >
+        pd_detno = #{pd_detno,jdbcType=INTEGER},
+      </if>
+      <if test="pd_whcode != null" >
+        pd_whcode = #{pd_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_whname != null" >
+        pd_whname = #{pd_whname,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_whid != null" >
+        pd_whid = #{pd_whid,jdbcType=INTEGER},
+      </if>
+      <if test="pd_price != null" >
+        pd_price = #{pd_price,jdbcType=DOUBLE},
+      </if>
+      <if test="pd_amount != null" >
+        pd_amount = #{pd_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pd_text1 != null" >
+        pd_text1 = #{pd_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text2 != null" >
+        pd_text2 = #{pd_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text3 != null" >
+        pd_text3 = #{pd_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text4 != null" >
+        pd_text4 = #{pd_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_text5 != null" >
+        pd_text5 = #{pd_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="pd_num != null" >
+        pd_num = #{pd_num,jdbcType=DOUBLE},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.ProductDetail" >
+    update productdetail
+    set pd_prodid = #{pd_prodid,jdbcType=INTEGER},
+      pd_prodcode = #{pd_prodcode,jdbcType=VARCHAR},
+      pd_detno = #{pd_detno,jdbcType=INTEGER},
+      pd_whcode = #{pd_whcode,jdbcType=VARCHAR},
+      pd_whname = #{pd_whname,jdbcType=VARCHAR},
+      pd_whid = #{pd_whid,jdbcType=INTEGER},
+      pd_price = #{pd_price,jdbcType=DOUBLE},
+      pd_amount = #{pd_amount,jdbcType=DOUBLE},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      pd_text1 = #{pd_text1,jdbcType=VARCHAR},
+      pd_text2 = #{pd_text2,jdbcType=VARCHAR},
+      pd_text3 = #{pd_text3,jdbcType=VARCHAR},
+      pd_text4 = #{pd_text4,jdbcType=VARCHAR},
+      pd_text5 = #{pd_text5,jdbcType=VARCHAR},
+      pd_num = #{pd_num,jdbcType=DOUBLE}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+    <insert id="batchInsert" parameterType="java.util.List">
+        insert into productdetail ( pd_prodid, pd_prodcode,
+        pd_detno, pd_whcode, pd_whname,
+        pd_whid, pd_price, pd_amount,
+        companyId, updaterId, updateTime,
+        pd_text1, pd_text2, pd_text3,
+        pd_text4, pd_text5, pd_num
+        )
+        VALUES
+        <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+            values ( #{item.pd_prodid,jdbcType=INTEGER}, #{item.pd_prodcode,jdbcType=VARCHAR},
+            #{item.pd_detno,jdbcType=INTEGER}, #{item.pd_whcode,jdbcType=VARCHAR}, #{item.pd_whname,jdbcType=VARCHAR},
+            #{item.pd_whid,jdbcType=INTEGER}, #{item.pd_price,jdbcType=DOUBLE}, #{item.pd_amount,jdbcType=DOUBLE},
+            #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
+            #{item.pd_text1,jdbcType=VARCHAR}, #{item.pd_text2,jdbcType=VARCHAR}, #{item.pd_text3,jdbcType=VARCHAR},
+            #{item.pd_text4,jdbcType=VARCHAR}, #{item.pd_text5,jdbcType=VARCHAR}, #{item.pd_num,jdbcType=DOUBLE}
+            )
+        </foreach>
+    </insert>
+    <update id="batchUpdate" parameterType="com.usoftchina.saas.document.entities.ProductDetail">
+        <foreach collection="list" item="item" index="index" separator=";">
+            update productdetail
+            <set >
+                <if test="pd_prodid != null" >
+                    pd_prodid = #{pd_prodid,jdbcType=INTEGER},
+                </if>
+                <if test="pd_prodcode != null" >
+                    pd_prodcode = #{pd_prodcode,jdbcType=VARCHAR},
+                </if>
+                <if test="pd_detno != null" >
+                    pd_detno = #{pd_detno,jdbcType=INTEGER},
+                </if>
+                <if test="pd_whcode != null" >
+                    pd_whcode = #{pd_whcode,jdbcType=VARCHAR},
+                </if>
+                <if test="pd_whname != null" >
+                    pd_whname = #{pd_whname,jdbcType=VARCHAR},
+                </if>
+                <if test="pd_whid != null" >
+                    pd_whid = #{pd_whid,jdbcType=INTEGER},
+                </if>
+                <if test="pd_price != null" >
+                    pd_price = #{pd_price,jdbcType=DOUBLE},
+                </if>
+                <if test="pd_amount != null" >
+                    pd_amount = #{pd_amount,jdbcType=DOUBLE},
+                </if>
+                <if test="companyId != null" >
+                    companyId = #{companyId,jdbcType=INTEGER},
+                </if>
+                <if test="updaterId != null" >
+                    updaterId = #{updaterId,jdbcType=INTEGER},
+                </if>
+                <if test="updateTime != null" >
+                    updateTime = #{updateTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="pd_text1 != null" >
+                    pd_text1 = #{pd_text1,jdbcType=VARCHAR},
+                </if>
+                <if test="pd_text2 != null" >
+                    pd_text2 = #{pd_text2,jdbcType=VARCHAR},
+                </if>
+                <if test="pd_text3 != null" >
+                    pd_text3 = #{pd_text3,jdbcType=VARCHAR},
+                </if>
+                <if test="pd_text4 != null" >
+                    pd_text4 = #{pd_text4,jdbcType=VARCHAR},
+                </if>
+                <if test="pd_text5 != null" >
+                    pd_text5 = #{pd_text5,jdbcType=VARCHAR},
+                </if>
+                <if test="pd_num != null" >
+                    pd_num = #{pd_num,jdbcType=DOUBLE},
+                </if>
+            </set>
+            where id = #{id}
+        </foreach>
+    </update>
+    <select id="selectProdidByPrimaryKey" resultType="java.lang.Long">
+        SELECT PD_PRODID FROM PRODUCTDETAIL WHERE PD_ID=#{id}
+    </select>
+    <select id="selectByProdId" resultType="com.usoftchina.saas.document.entities.ProductDetail">
+        SELECT * FROM PRODUCTDETAIL WHERE PD_PRODID=#{id}
+    </select>
+</mapper>

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

@@ -74,7 +74,7 @@
     </select>
 
     <select id="getProdUnit" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
-        SELECT PR_UNIT as display, pr_unit as value FROM PRODUCT
+        SELECT PR_UNIT as display, pr_unit as value FROM PRODUCT where companyId=#{companyId}
     </select>
     <update id="updateLatestPurchasePrice" parameterType="long">
         update product a set pr_purcprice=(select pd_price from purchasedetail WHERE
@@ -506,5 +506,413 @@
     <select id="getCountFromProdIO" resultType="int">
         SELECT COUNT(*) FROM PRODIODETAIL WHERE PD_PRODID=#{id} AND COMPANYID=#{companyId}
     </select>
+
+    <insert id="saveProdInOut" parameterType="com.usoftchina.saas.document.entities.ProdInOut">
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
+        insert into prodinout
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+
+            <if test="pi_inoutno != null">
+                pi_inoutno,
+            </if>
+            <if test="pi_class != null">
+                pi_class,
+            </if>
+            <if test="pi_date != null">
+                pi_date,
+            </if>
+            <if test="pi_vendid != null">
+                pi_vendid,
+            </if>
+            <if test="pi_vendcode != null">
+                pi_vendcode,
+            </if>
+            <if test="pi_vendname != null">
+                pi_vendname,
+            </if>
+            <if test="pi_custid != null">
+                pi_custid,
+            </if>
+            <if test="pi_custcode != null">
+                pi_custcode,
+            </if>
+            <if test="pi_custname != null">
+                pi_custname,
+            </if>
+            <if test="pi_puid != null">
+                pi_puid,
+            </if>
+            <if test="pi_pucode != null">
+                pi_pucode,
+            </if>
+            <if test="pi_said != null">
+                pi_said,
+            </if>
+            <if test="pi_sacode != null">
+                pi_sacode,
+            </if>
+            <if test="pi_total != null">
+                pi_total,
+            </if>
+            <if test="pi_recordmanid != null">
+                pi_recordmanid,
+            </if>
+            <if test="pi_recordman != null">
+                pi_recordman,
+            </if>
+            <if test="createTime != null">
+                pi_recorddate,
+            </if>
+            <if test="pi_status != null">
+                pi_status,
+            </if>
+            <if test="pi_statuscode != null">
+                pi_statuscode,
+            </if>
+            <if test="pi_printstatus != null">
+                pi_printstatus,
+            </if>
+            <if test="pi_printstatuscode != null">
+                pi_printstatuscode,
+            </if>
+            <if test="companyId != null">
+                companyid,
+            </if>
+            <if test="updaterId != null">
+                updaterid,
+            </if>
+            <if test="updateTime != null">
+                updatetime,
+            </if>
+            <if test="pi_text1 != null">
+                pi_text1,
+            </if>
+            <if test="pi_text2 != null">
+                pi_text2,
+            </if>
+            <if test="pi_text3 != null">
+                pi_text3,
+            </if>
+            <if test="pi_text4 != null">
+                pi_text4,
+            </if>
+            <if test="pi_text5 != null">
+                pi_text5,
+            </if>
+            <if test="pi_address != null">
+                pi_address,
+            </if>
+            <if test="pi_auditdate != null">
+                pi_auditdate,
+            </if>
+            <if test="pi_auditman != null">
+                pi_auditman,
+            </if>
+            <if test="pi_remark != null">
+                pi_remark,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+
+            <if test="pi_inoutno != null">
+                #{pi_inoutno,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_class != null">
+                #{pi_class,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_date != null">
+                #{pi_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="pi_vendid != null">
+                #{pi_vendid,jdbcType=INTEGER},
+            </if>
+            <if test="pi_vendcode != null">
+                #{pi_vendcode,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_vendname != null">
+                #{pi_vendname,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_custid != null">
+                #{pi_custid,jdbcType=INTEGER},
+            </if>
+            <if test="pi_custcode != null">
+                #{pi_custcode,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_custname != null">
+                #{pi_custname,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_puid != null">
+                #{pi_puid,jdbcType=INTEGER},
+            </if>
+            <if test="pi_pucode != null">
+                #{pi_pucode,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_said != null">
+                #{pi_said,jdbcType=INTEGER},
+            </if>
+            <if test="pi_sacode != null">
+                #{pi_sacode,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_total != null">
+                #{pi_total,jdbcType=DOUBLE},
+            </if>
+            <if test="pi_recordmanid != null">
+                #{pi_recordmanid,jdbcType=INTEGER},
+            </if>
+            <if test="pi_recordman != null">
+                #{pi_recordman,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="pi_status != null">
+                #{pi_status,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_statuscode != null">
+                #{pi_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_printstatus != null">
+                #{pi_printstatus,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_printstatuscode != null">
+                #{pi_printstatuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="companyId != null">
+                #{companyId,jdbcType=INTEGER},
+            </if>
+            <if test="updaterId != null">
+                #{updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="pi_text1 != null">
+                #{pi_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_text2 != null">
+                #{pi_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_text3 != null">
+                #{pi_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_text4 != null">
+                #{pi_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_text5 != null">
+                #{pi_text5,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_address != null">
+                #{pi_address,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="pi_auditdate != null">
+                #{pi_auditdate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="pi_auditman != null">
+                #{pi_auditman,jdbcType=VARCHAR},
+            </if>
+            <if test="pi_remark != null">
+                #{pi_remark,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+
+    <insert id="batchInsertDetail" parameterType="java.util.List" >
+        insert into prodiodetail (pd_piid, pd_inoutno,
+        pd_piclass, pd_pdno, pd_ordercode,
+        pd_orderdetno, pd_prodid, pd_prodcode,
+        pd_unit, pd_inqty, pd_outqty,
+        pd_orderprice, pd_sendprice, pd_price,
+        pd_total, pd_taxrate, pd_netprice,
+        pd_nettotal, pd_whid, pd_whcode,
+        pd_whname, pd_inwhid, pd_inwhcode,
+        pd_inwhname, pd_orderid, pd_sdid,
+        pd_status, companyid, updaterid,
+        updatetime, pd_text1, pd_text2,
+        pd_text3, pd_text4, pd_text5,
+        pd_ym, pd_yqty, pd_ioid,
+        pd_remark) VALUES
+        <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+            (
+            #{item.pd_piid,jdbcType=INTEGER},
+            #{item.pd_inoutno,jdbcType=VARCHAR},
+            #{item.pd_piclass,jdbcType=VARCHAR},
+            #{item.pd_pdno,jdbcType=INTEGER},
+            #{item.pd_ordercode,jdbcType=VARCHAR},
+            #{item.pd_orderdetno,jdbcType=INTEGER},
+            #{item.pd_prodid,jdbcType=INTEGER},
+            #{item.pd_prodcode,jdbcType=VARCHAR},
+            #{item.pd_unit,jdbcType=VARCHAR},
+            #{item.pd_inqty,jdbcType=DOUBLE},
+            #{item.pd_outqty,jdbcType=DOUBLE},
+            #{item.pd_orderprice,jdbcType=DOUBLE},
+            #{item.pd_sendprice,jdbcType=DOUBLE},
+            #{item.pd_price,jdbcType=DOUBLE},
+            #{item.pd_total,jdbcType=DOUBLE},
+            #{item.pd_taxrate,jdbcType=DOUBLE},
+            #{item.pd_netprice,jdbcType=DOUBLE},
+            #{item.pd_nettotal,jdbcType=DOUBLE},
+            #{item.pd_whid,jdbcType=INTEGER},
+            #{item.pd_whcode,jdbcType=VARCHAR},
+            #{item.pd_whname,jdbcType=VARCHAR},
+            #{item.pd_inwhid,jdbcType=INTEGER},
+            #{item.pd_inwhcode,jdbcType=VARCHAR},
+            #{item.pd_inwhname,jdbcType=VARCHAR},
+            #{item.pd_orderid,jdbcType=INTEGER},
+            #{item.pd_sdid,jdbcType=INTEGER},
+            #{item.pd_status,jdbcType=INTEGER},
+            #{item.companyId,jdbcType=INTEGER},
+            #{item.updaterId,jdbcType=INTEGER},
+            #{item.updateTime,jdbcType=TIMESTAMP},
+            #{item.pd_text1,jdbcType=VARCHAR},
+            #{item.pd_text2,jdbcType=VARCHAR},
+            #{item.pd_text3,jdbcType=VARCHAR},
+            #{item.pd_text4,jdbcType=VARCHAR},
+            #{item.pd_text5,jdbcType=VARCHAR},
+            #{item.pd_ym,jdbcType=INTEGER},
+            #{item.pd_yqty,jdbcType=DOUBLE},
+            #{item.pd_remark,jdbcType=LONGVARCHAR},
+            #{item.pd_ioid,jdbcType=INTEGER})
+        </foreach>
+    </insert>
+
+    <update id="batchUpdateDetail" parameterType="com.usoftchina.saas.document.entities.ProdIODetail" >
+        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+            update prodiodetail <set>
+            <if test="item.pd_piid !=null">
+                pd_piid = #{item.pd_piid},
+            </if>
+            <if test="item.pd_inoutno !=null">
+                pd_inoutno = #{item.pd_inoutno},
+            </if>
+            <if test="item.pd_piclass !=null">
+                pd_piclass = #{item.pd_piclass},
+            </if>
+            <if test="item.pd_pdno !=null">
+                pd_pdno = #{item.pd_pdno},
+            </if>
+            <if test="item.pd_ordercode !=null">
+                pd_ordercode = #{item.pd_ordercode},
+            </if>
+            <if test="item.pd_orderdetno !=null">
+                pd_orderdetno = #{item.pd_orderdetno},
+            </if>
+            <if test="item.pd_prodid !=null">
+                pd_prodid = #{item.pd_prodid},
+            </if>
+            <if test="item.pd_prodcode !=null">
+                pd_prodcode = #{item.pd_prodcode},
+            </if>
+            <if test="item.pd_unit !=null">
+                pd_unit = #{item.pd_unit},
+            </if>
+            <if test="item.pd_inqty !=null">
+                pd_inqty = #{item.pd_inqty},
+            </if>
+            <if test="item.pd_outqty !=null">
+                pd_outqty = #{item.pd_outqty},
+            </if>
+            <if test="item.pd_orderprice !=null">
+                pd_orderprice = #{item.pd_orderprice},
+            </if>
+            <if test="item.pd_sendprice !=null">
+                pd_sendprice = #{item.pd_sendprice},
+            </if>
+            <if test="item.pd_price !=null">
+                pd_price = #{item.pd_price},
+            </if>
+            <if test="item.pd_total !=null">
+                pd_total = #{item.pd_total},
+            </if>
+            <if test="item.pd_taxrate !=null">
+                pd_taxrate = #{item.pd_taxrate},
+            </if>
+            <if test="item.pd_netprice !=null">
+                pd_netprice = #{item.pd_netprice},
+            </if>
+            <if test="item.pd_nettotal !=null">
+                pd_nettotal = #{item.pd_nettotal},
+            </if>
+            <if test="item.pd_whid !=null">
+                pd_whid = #{item.pd_whid},
+            </if>
+            <if test="item.pd_whcode !=null">
+                pd_whcode = #{item.pd_whcode},
+            </if>
+            <if test="item.pd_whname !=null">
+                pd_whname = #{item.pd_whname},
+            </if>
+            <if test="item.pd_inwhid !=null">
+                pd_inwhid = #{item.pd_inwhid},
+            </if>
+            <if test="item.pd_inwhcode !=null">
+                pd_inwhcode = #{item.pd_inwhcode},
+            </if>
+            <if test="item.pd_inwhname !=null">
+                pd_inwhname = #{item.pd_inwhname},
+            </if>
+            <if test="item.pd_orderid !=null">
+                pd_orderid = #{item.pd_orderid},
+            </if>
+            <if test="item.pd_sdid !=null">
+                pd_sdid = #{item.pd_sdid},
+            </if>
+            <if test="item.pd_status !=null">
+                pd_status = #{item.pd_status},
+            </if>
+            <if test="item.pd_remark !=null">
+                pd_remark = #{item.pd_remark},
+            </if>
+            <if test="item.companyId!=null">
+                companyId = #{item.companyId},
+            </if>
+            <if test="item.updaterId!=null">
+                updaterId = #{item.updaterId},
+            </if>
+            <if test="item.updateTime!=null">
+                updateTime = #{item.updateTime},
+            </if>
+            pd_text1 = #{item.pd_text1},
+            pd_text2 = #{item.pd_text2},
+            pd_text3 = #{item.pd_text3},
+            pd_text4 = #{item.pd_text4},
+            pd_text5 = #{item.pd_text5},
+            <if test="item.pd_ym!=null">
+                pd_ym = #{item.pd_ym},
+            </if>
+            <if test="item.pd_yqty!=null">
+                pd_yqty = #{item.pd_yqty},
+            </if>
+        </set>
+            where PD_ID = #{item.id,jdbcType=BIGINT}
+        </foreach>
+    </update>
+    <select id="selectProdIOCode" resultType="java.lang.String">
+        SELECT PI_INOUTNO FROM PRODINOUT
+        <where>
+            <if test="code!=null">
+                AND PI_TEXT1 = #{code}
+            </if>
+            <if test="type!=null">
+                AND PI_CLASS = #{type}
+            </if>
+            <if test="companyId!=null">
+                AND COMPANYID = #{companyId}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectOrderCountByProdCode" resultType="java.lang.Long">
+        SELECT COUNT(*) FROM PRODINOUT LEFT JOIN PRODIODETAIL ON PI_ID=PD_PIID AND PRODINOUT.COMPANYID=PRODIODETAIL.COMPANYID
+        WHERE COMPANYID = #{companyId} AND PD_PRODID = #{id}
+    </select>
+
+    <delete id="deleteProdIOByCode" >
+        DELETE FROM PRODINOUT WHERE PI_TEXT1=#{code} AND COMPANYID = #{companyId}
+    </delete>
+    <delete id="deleteProdIODetailByCode">
+        DELETE FROM PRODIODETAIL WHERE PD_PIID IN (SELECT PI_ID FROM PRODINOUT WHERE PI_TEXT1=#{code} AND PRODINOUT.COMPANYID = #{companyId}) AND PRODIODETAIL.COMPANYID = #{companyId}
+    </delete>
 </mapper>
 

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

@@ -465,5 +465,11 @@
     <select id="getCodeById" resultType="string">
         SELECT VE_CODE FROM VENDOR WHERE VE_ID = #{id} and COMPANYID = #{companyId}
     </select>
+    <select id="getCountByCode" resultType="int">
+        SELECT COUNT(*) FROM VENDOR WHERE COMPANYID = #{companyId} AND VE_CODE=#{code}
+    </select>
+    <select id="getCountByName" resultType="int">
+        SELECT COUNT(*) FROM VENDOR WHERE COMPANYID = #{companyId} AND VE_NAME=#{name}
+    </select>
 </mapper>
 

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

@@ -344,6 +344,21 @@
         </where>
     </select>
 
+    <select id="selectCountByCode" resultType="int">
+        SELECT COUNT(*) FROM warehouse
+        <where>
+            <if test="name!=null">
+                and wh_code=#{code}
+            </if>
+            <if test="companyId!=0 and companyId!=null">
+                and COMPANYID=#{companyId}
+            </if>
+            <if test="id!=0 and id!=null">
+                and wh_id!=#{id}
+            </if>
+        </where>
+    </select>
+
     <select id="selectCodeById" resultType="string" parameterType="long">
         select wh_code from warehouse where wh_id=#{id}
     </select>

+ 6 - 6
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -274,12 +274,12 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         generateProdIO(makeListDTO);
         //4.修改单据状态
         Make updateMake = new Make();
-        make.setMa_status(Status.AUDITED.getDisplay());
-        make.setMa_statuscode(Status.AUDITED.name());
-        make.setUpdateTime(new Date());
-        make.setUpdaterId(BaseContextHolder.getUserId());
-        make.setMa_auditman("");
-        make.setMa_auditdate(new Date());
+        updateMake.setMa_status(Status.AUDITED.getDisplay());
+        updateMake.setMa_statuscode(Status.AUDITED.name());
+        updateMake.setUpdateTime(new Date());
+        updateMake.setUpdaterId(BaseContextHolder.getUserId());
+        updateMake.setMa_auditman("");
+        updateMake.setMa_auditdate(new Date());
         getMapper().updateByPrimaryKeySelective(make);
         DocBaseDTO docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
         //5.记录LOG

+ 3 - 1
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -304,6 +304,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
         form = me.getView(),
         viewModel = me.getViewModel(),
         mlKeyvalue = viewModel.get(form._idField),
+        mlCaller = form.caller,
         win = Ext.getCmp(form.xtype+mlKeyvalue);
         if (!win&&mlKeyvalue!=0) {
             var win = form.add(Ext.create('Ext.window.Window', {
@@ -318,7 +319,8 @@ Ext.define('saas.view.core.form.FormPanelController', {
                 layout: 'fit',
                 items: [{
                     xtype: 'core-form-mseeageLog',
-                    mlKeyvalue:mlKeyvalue
+                    mlKeyvalue:mlKeyvalue,
+                    mlCaller:mlCaller
                 }],
                 listeners:{
                     'close':function(){

+ 9 - 5
frontend/saas-web/app/view/core/form/MseeageLog.js

@@ -74,12 +74,17 @@ Ext.define('saas.view.core.form.MseeageLog', {
     condition:[],
     initComponent: function() {
         var me = this;
-        me.defualtCondition = {
+        me.defualtCondition = [{
             type: 'number',
             field: 'ml_keyvalue',
             operation: '=',
             value: me.mlKeyvalue
-        };
+        },{
+            type: 'string',
+            field: 'ml_caller',
+            operation: '=',
+            value: me.mlCaller
+        }];
         if(me.columns){
             var fields = me.columns.map(column => column.dataIndex);
             me.store = Ext.create('Ext.data.Store',{
@@ -104,7 +109,7 @@ Ext.define('saas.view.core.form.MseeageLog', {
                     beforeload: function (store, op) {
                         var condition = me.condition;
                         if (Ext.isEmpty(condition)) {
-                            condition = [me.defualtCondition];
+                            condition = me.defualtCondition;
                         }
                         
                         Ext.apply(store.proxy.extraParams, {
@@ -133,8 +138,7 @@ Ext.define('saas.view.core.form.MseeageLog', {
      */
     getCondition: function(items) {
         var me = this,
-        conditions = [];
-        conditions.push(this.defualtCondition);
+        conditions = me.defualtCondition;
         for(var i = 0; i < items.length; i++) {
             var item = items[i];
             var field = item.name,

+ 5 - 5
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -94,15 +94,15 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 name:'id'
             },{
                 xtype:'textfield',
-                name:'bk_bankname',
+                name:'bk_bankcode',
                 allowBlank:false,
-                fieldLabel:'账户名称',
+                fieldLabel:'账户编号',
                 maxLength: 20
             },{
                 xtype:'textfield',
-                name:'bk_bankcode',
+                name:'bk_bankname',
                 allowBlank:false,
-                fieldLabel:'账户编号',
+                fieldLabel:'账户名称',
                 maxLength: 20
             },{
                 xtype:'numberfield',
@@ -135,7 +135,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'datefield',
                 name:'bk_date',
                 fieldLabel:'建账日期',
-                format:'Y-m-d H:i:s',
+                format:'Y-m-d',
                 listeners:{
                     beforerender:function(d){
                         d.setValue(new Date())

+ 1 - 1
frontend/saas-web/app/view/document/kind/Kind.js

@@ -137,7 +137,7 @@ Ext.define('saas.view.document.kind.Kind', {
             },{
                 xtype:'datecolumn',
                 text: '建账日期',
-                format:'Y-m-d H:i:s',
+                format:'Y-m-d',
                 dataIndex: 'bk_date',
                 flex: 1
             },{

+ 4 - 1
frontend/saas-web/app/view/money/othreceipts/FormPanelController.js

@@ -93,7 +93,10 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "额度",
                             "flex": 1,

+ 10 - 1
frontend/saas-web/app/view/money/othreceipts/QueryPanelController.js

@@ -77,13 +77,22 @@ Ext.define('saas.view.money.othreceipts.QueryPanelController', {
                                 "dataIndex": "cu_promisedays",
                                 align: 'end',
                                 xtype: 'numbercolumn',
-                                "width": 100
+                                "width": 100, 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,
                                 "dataIndex": "cu_credit",
                                 "width": 100,
                                 xtype: 'numbercolumn',
+                                renderer : function(v) {
+                                    var arr = (v + '.').split('.');
+                                    var xr = (new Array(arr[1].length)).fill('0');
+                                    var format = '0,000.' + xr.join();
+                                    return Ext.util.Format.number(v, format);
+                                }
                             }, {
                                 "text": "客户地址",
                                 "flex": 1,

+ 4 - 1
frontend/saas-web/app/view/money/othspendings/QueryPanelController.js

@@ -69,7 +69,10 @@ Ext.define('saas.view.money.othspendings.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -72,7 +72,10 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                         }, {
                             "text": "承付天数",
                             "dataIndex": "ve_promisedays",
-                            "width": 100
+                            "width": 100, 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/money/payBalance/QueryPanelController.js

@@ -61,7 +61,10 @@ Ext.define('saas.view.money.paybalance.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 8 - 2
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -79,7 +79,10 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",
@@ -156,7 +159,10 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",

+ 4 - 1
frontend/saas-web/app/view/money/recBalance/QueryPanelController.js

@@ -62,7 +62,10 @@ Ext.define('saas.view.money.recBalance.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 1 - 1
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -109,6 +109,6 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
             }
         }, {
             text: '备注',
-            dataIndex: 'pd_remark'
+            dataIndex: 'pd_text1'
         }]
 });

+ 4 - 1
frontend/saas-web/app/view/money/report/CustomerCheckController.js

@@ -69,7 +69,10 @@ Ext.define('saas.view.money.report.CustomerCheckController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",

+ 4 - 1
frontend/saas-web/app/view/money/report/PayDetailController.js

@@ -60,7 +60,10 @@ Ext.define('saas.view.money.report.PayDetailController', {
                                 "dataIndex": "ve_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align: 'end'
+                                align: 'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "纳税人识别号",
                                 "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/money/report/RecDetailController.js

@@ -69,7 +69,10 @@ Ext.define('saas.view.money.report.RecDetailController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",

+ 4 - 1
frontend/saas-web/app/view/money/report/VendorCheckController.js

@@ -60,7 +60,10 @@ Ext.define('saas.view.money.report.VendorCheckController', {
                                 "dataIndex": "ve_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align: 'end'
+                                align: 'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "纳税人识别号",
                                 "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/purchase/purchase/FormPanelController.js

@@ -69,7 +69,10 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js

@@ -61,7 +61,10 @@ Ext.define('saas.view.purchase.purchase.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 8 - 0
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -322,6 +322,14 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 renderer: function(v) {
                     return v ? v : null;
                 }
+            },{
+                text : "备注", 
+                dataIndex : "pd_remark",
+                width : 250, 
+                items : null,
+                editor : {
+                    xtype : "textfield"
+                },
             }
         ]
     },{

+ 4 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js

@@ -74,7 +74,10 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js

@@ -63,7 +63,10 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 8 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -304,6 +304,14 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 renderer: function(v) {
                     return v ? v : null;
                 }
+            },{
+                text : "备注", 
+                dataIndex : "pd_remark",
+                width : 250, 
+                items : null,
+                editor : {
+                    xtype : "textfield"
+                },
             }
         ]
     },{

+ 4 - 1
frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js

@@ -73,7 +73,10 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelController.js

@@ -62,7 +62,10 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/purchase/report/PurchaseController.js

@@ -60,7 +60,10 @@ Ext.define('saas.view.purchase.report.PurchaseController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/purchase/report/PurchasePayController.js

@@ -61,7 +61,10 @@ Ext.define('saas.view.purchase.report.PurchasePayController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/sale/report/SaleController.js

@@ -90,7 +90,10 @@ Ext.define('saas.view.sale.report.SaleController', {
                                 "dataIndex": "cu_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align: 'end'
+                                align: 'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,

+ 1 - 1
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -109,7 +109,7 @@ Ext.define('saas.view.sale.report.SaleProfit', {
         xtype: 'numbercolumn'
     }, {
         text : "备注", 
-        dataIndex : "pd_remark",
+        dataIndex : "pd_text1",
         width : 250 
     }]
 

+ 4 - 1
frontend/saas-web/app/view/sale/report/SaleProfitController.js

@@ -91,7 +91,10 @@ Ext.define('saas.view.sale.report.SaleProfitController', {
                                 "dataIndex": "cu_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align: 'end'
+                                align: 'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,

+ 1 - 1
frontend/saas-web/app/view/sale/report/SaleRec.js

@@ -14,7 +14,7 @@ Ext.define('saas.view.sale.report.SaleRec', {
     QueryWidth:0.25,
     searchItems: [{//筛选:客户、日期	
         xtype: 'dbfindtrigger',
-        name: 'sa_custname',
+        name: 'rb_custname',
         fieldLabel: '客户',
         columnWidth: 0.25
     }, {

+ 4 - 1
frontend/saas-web/app/view/sale/report/SaleRecController.js

@@ -91,7 +91,10 @@ Ext.define('saas.view.sale.report.SaleRecController', {
                                 "dataIndex": "cu_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align: 'end'
+                                align: 'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,

+ 1 - 1
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -253,7 +253,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 ignore:true
             },{
                 text : "备注", 
-                dataIndex : "sd_text1",
+                dataIndex : "sd_remark",
                 width : 250, 
                 items : null,
                 editor : {

+ 4 - 1
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -92,7 +92,10 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                                 "dataIndex": "cu_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align:'end'
+                                align:'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,

+ 4 - 1
frontend/saas-web/app/view/sale/sale/QueryPanelController.js

@@ -88,7 +88,10 @@ Ext.define('saas.view.sale.sale.QueryPanelController', {
                                 "dataIndex": "cu_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align: 'end'
+                                align: 'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,

+ 8 - 0
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -256,6 +256,14 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 renderer: function(v) {
                     return v ? v : null;
                 }
+            },{
+                text : "备注", 
+                dataIndex : "pd_text1",
+                width : 250, 
+                items : null,
+                editor : {
+                    xtype : "textfield"
+                },
             }
         ]
     }, {

+ 4 - 1
frontend/saas-web/app/view/sale/saleIn/FormPanelController.js

@@ -93,7 +93,10 @@ Ext.define('saas.view.sale.saleIn.FormPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "额度",
                             "flex": 1,

+ 1 - 1
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -189,7 +189,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
             align:'right'
         }, {
             text: '备注',
-            dataIndex: 'pd_remark',
+            dataIndex: 'pd_text1',
             width: 250
         }]
     }

+ 4 - 1
frontend/saas-web/app/view/sale/saleIn/QueryPanelController.js

@@ -81,7 +81,10 @@ Ext.define('saas.view.sale.saleIn.QueryPanelController', {
                                 "dataIndex": "cu_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align: 'end'
+                                align: 'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,

+ 8 - 0
frontend/saas-web/app/view/sale/saleOut/FormPanel.js

@@ -261,6 +261,14 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 renderer: function(v) {
                     return v ? v : null;
                 }
+            },{
+                text : "备注", 
+                dataIndex : "pd_text1",
+                width : 250, 
+                items : null,
+                editor : {
+                    xtype : "textfield"
+                },
             }
         ]
     }, {

+ 4 - 1
frontend/saas-web/app/view/sale/saleOut/FormPanelController.js

@@ -90,7 +90,10 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
                                 "dataIndex": "cu_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align:'end'
+                                align:'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,

+ 1 - 1
frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

@@ -184,7 +184,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             width: 120
         }, {
             text: '备注',
-            dataIndex: 'pd_remark',
+            dataIndex: 'pd_text1',
             width: 250
         }]
     }

+ 4 - 1
frontend/saas-web/app/view/sale/saleOut/QueryPanelController.js

@@ -90,7 +90,10 @@ Ext.define('saas.view.sale.saleout.QueryPanelController', {
                                 "dataIndex": "cu_promisedays",
                                 "width": 100,
                                 xtype: 'numbercolumn',
-                                align: 'end'
+                                align: 'end', 
+                                renderer : function(v) {
+                                    return Ext.util.Format.number(v, '0');
+                                }
                             }, {
                                 "text": "额度",
                                 "flex": 1,

+ 9 - 1
frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

@@ -221,13 +221,21 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
                     valueField : "value", 
                     xtype : "dbfindtrigger"
                 }
+            },{
+                text : "备注", 
+                dataIndex : "pd_text1",
+                width : 250, 
+                items : null,
+                editor : {
+                    xtype : "textfield"
+                },
             }
         ]
     }, {
         xtype : "textfield", 
         name : "pi_remark", 
         fieldLabel : "备注", 
-        columnWidth : 0.75
+        columnWidth : 1
     }, {
         xtype : "textfield", 
         name : "pi_recordman", 

+ 8 - 2
frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js

@@ -72,7 +72,10 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",
@@ -153,7 +156,10 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",

+ 4 - 1
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanelController.js

@@ -63,7 +63,10 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 4 - 1
frontend/saas-web/app/view/stock/make/QueryPanelController.js

@@ -63,7 +63,10 @@ Ext.define('saas.view.stock.make.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",

+ 8 - 0
frontend/saas-web/app/view/stock/otherIn/FormPanel.js

@@ -275,6 +275,14 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
                     var format = '0,000.' + xr.join();
                     return Ext.util.Format.number(v, format);
                 }
+            },{
+                text : "备注", 
+                dataIndex : "pd_text1",
+                width : 250, 
+                items : null,
+                editor : {
+                    xtype : "textfield"
+                },
             }
         ]
     },{

+ 8 - 2
frontend/saas-web/app/view/stock/otherIn/FormPanelController.js

@@ -67,7 +67,10 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",
@@ -150,7 +153,10 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",

+ 8 - 2
frontend/saas-web/app/view/stock/otherIn/QueryPanelController.js

@@ -63,7 +63,10 @@ Ext.define('saas.view.stock.otherIn.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",
@@ -246,7 +249,10 @@ Ext.define('saas.view.stock.otherIn.QueryPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",

+ 8 - 0
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -271,6 +271,14 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                     var format = '0,000.' + xr.join();
                     return Ext.util.Format.number(v, format);
                 }
+            },{
+                text : "备注", 
+                dataIndex : "pd_text1",
+                width : 250, 
+                items : null,
+                editor : {
+                    xtype : "textfield"
+                },
             }
         ]
     },{

+ 8 - 2
frontend/saas-web/app/view/stock/otherOut/FormPanelController.js

@@ -67,7 +67,10 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",
@@ -148,7 +151,10 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",

+ 8 - 2
frontend/saas-web/app/view/stock/otherOut/QueryPanelController.js

@@ -63,7 +63,10 @@ Ext.define('saas.view.stock.otherOut.QueryPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align: 'end'
+                            align: 'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",
@@ -246,7 +249,10 @@ Ext.define('saas.view.stock.otherOut.QueryPanelController', {
                             "dataIndex": "cu_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
                         },{
                             "text": "额度",
                             "dataIndex": "cu_credit",

+ 1 - 1
frontend/saas-web/app/view/stock/report/Prodiodetail.js

@@ -120,7 +120,7 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         xtype: 'numbercolumn'
     }, {
         text: '备注',
-        dataIndex: 'pd_remark',
+        dataIndex: 'pd_text1',
         width: 250
     }]