Browse Source

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

guq 7 years ago
parent
commit
b7cf18da4e
95 changed files with 2165 additions and 266 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. 2 1
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  27. 3 1
      frontend/saas-web/app/view/core/form/FormPanelController.js
  28. 9 5
      frontend/saas-web/app/view/core/form/MseeageLog.js
  29. 4 4
      frontend/saas-web/app/view/document/kind/ChildForm.js
  30. 1 1
      frontend/saas-web/app/view/document/kind/Kind.js
  31. 4 5
      frontend/saas-web/app/view/home/Home.js
  32. 16 17
      frontend/saas-web/app/view/home/Home.scss
  33. 2 38
      frontend/saas-web/app/view/home/HomeModel.js
  34. 46 5
      frontend/saas-web/app/view/home/InfoCard.js
  35. 6 7
      frontend/saas-web/app/view/main/Main.js
  36. 21 0
      frontend/saas-web/app/view/main/Main.scss
  37. 4 1
      frontend/saas-web/app/view/money/othreceipts/FormPanelController.js
  38. 10 1
      frontend/saas-web/app/view/money/othreceipts/QueryPanelController.js
  39. 4 1
      frontend/saas-web/app/view/money/othspendings/QueryPanelController.js
  40. 4 1
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  41. 4 1
      frontend/saas-web/app/view/money/payBalance/QueryPanelController.js
  42. 8 2
      frontend/saas-web/app/view/money/recBalance/FormPanelController.js
  43. 4 1
      frontend/saas-web/app/view/money/recBalance/QueryPanelController.js
  44. 1 1
      frontend/saas-web/app/view/money/report/CustomerCheck.js
  45. 4 1
      frontend/saas-web/app/view/money/report/CustomerCheckController.js
  46. 4 1
      frontend/saas-web/app/view/money/report/PayDetailController.js
  47. 4 1
      frontend/saas-web/app/view/money/report/RecDetailController.js
  48. 4 1
      frontend/saas-web/app/view/money/report/VendorCheckController.js
  49. 4 1
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  50. 4 1
      frontend/saas-web/app/view/purchase/purchase/QueryPanelController.js
  51. 8 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  52. 4 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  53. 4 1
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js
  54. 8 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  55. 4 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  56. 4 1
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanelController.js
  57. 4 1
      frontend/saas-web/app/view/purchase/report/PurchaseController.js
  58. 4 1
      frontend/saas-web/app/view/purchase/report/PurchasePayController.js
  59. 4 1
      frontend/saas-web/app/view/sale/report/SaleController.js
  60. 1 1
      frontend/saas-web/app/view/sale/report/SaleProfit.js
  61. 4 1
      frontend/saas-web/app/view/sale/report/SaleProfitController.js
  62. 1 1
      frontend/saas-web/app/view/sale/report/SaleRec.js
  63. 4 1
      frontend/saas-web/app/view/sale/report/SaleRecController.js
  64. 1 1
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  65. 4 1
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  66. 4 1
      frontend/saas-web/app/view/sale/sale/QueryPanelController.js
  67. 8 0
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  68. 4 1
      frontend/saas-web/app/view/sale/saleIn/FormPanelController.js
  69. 1 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  70. 4 1
      frontend/saas-web/app/view/sale/saleIn/QueryPanelController.js
  71. 8 0
      frontend/saas-web/app/view/sale/saleOut/FormPanel.js
  72. 4 1
      frontend/saas-web/app/view/sale/saleOut/FormPanelController.js
  73. 1 1
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  74. 4 1
      frontend/saas-web/app/view/sale/saleOut/QueryPanelController.js
  75. 10 2
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  76. 41 25
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js
  77. 72 46
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  78. 92 9
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanelController.js
  79. 4 1
      frontend/saas-web/app/view/stock/make/FormPanel.js
  80. 2 2
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  81. 4 1
      frontend/saas-web/app/view/stock/make/QueryPanelController.js
  82. 8 0
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  83. 8 2
      frontend/saas-web/app/view/stock/otherIn/FormPanelController.js
  84. 1 0
      frontend/saas-web/app/view/stock/otherIn/QueryPanel.js
  85. 8 2
      frontend/saas-web/app/view/stock/otherIn/QueryPanelController.js
  86. 8 0
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  87. 8 2
      frontend/saas-web/app/view/stock/otherOut/FormPanelController.js
  88. 1 0
      frontend/saas-web/app/view/stock/otherOut/QueryPanel.js
  89. 8 2
      frontend/saas-web/app/view/stock/otherOut/QueryPanelController.js
  90. 1 1
      frontend/saas-web/app/view/stock/report/Prodiodetail.js
  91. 6 2
      frontend/saas-web/app/view/sys/config/FormPanel.js
  92. 1 1
      frontend/saas-web/app/view/sys/power/GroupGrid.js
  93. 7 3
      frontend/saas-web/ext/packages/modern-locale/overrides/zh_CN/field/Date.js
  94. 6 1
      frontend/saas-web/ext/packages/modern-locale/overrides/zh_CN/picker/Date.js
  95. 0 26
      frontend/saas-web/resources/json/info.json

+ 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

+ 2 - 1
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -276,6 +276,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                             var val = record.get(item.from);
                             if(field.xtype=='dbfindtrigger'){
                                 field.setRawValue(val);
+                                field.setValue(val);
                                 field.value = val;
                                 field.lastTriggerValue=val;
                             }else{
@@ -342,6 +343,6 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
 		trigger.fireEvent('aftertrigger', trigger, data);
 		trigger.lastTriggerId = null;
 		trigger.lastQueryValue='';
-	}
+    }
 
 });

+ 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,

+ 4 - 4
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',

+ 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 - 5
frontend/saas-web/app/view/home/Home.js

@@ -27,15 +27,14 @@ Ext.define('saas.view.home.Home', {
     },
 
     items: [{
-        title: '实时数据',
         xtype: 'infocard'
     }, {
         xtype: 'panel',
         title: '2018年11月经营分析',
-        latyout: 'column',
+        latyout: 'responsivecolumn',
         // items: [{
         //     xtype: 'core-chart-pie',
-        //     columnWidth: 0.33,
+        //     userCls: 'big-33 small-50',
         //     chartConfig: {
         //         captions: {
         //             credits: {
@@ -47,10 +46,10 @@ Ext.define('saas.view.home.Home', {
         //     }
         // }, {
         //     xtype: 'core-chart-bar',
-        //     columnWidth: 0.33
+        //     userCls: 'big-33 small-50',
         // }, {
         //     xtype: 'core-chart-gauge',
-        //     columnWidth: 0.33
+        //     userCls: 'big-33 small-50',
         // }]
     }, {
         title: '2018年11月经营分析',

+ 16 - 17
frontend/saas-web/app/view/home/Home.scss

@@ -134,37 +134,36 @@ $unaudit-purc-container-color: dynamic(#e91e63);
 
 .x-responsivecolumn {
     padding: 0;
-    display: block;
 }
 
 .big-100 {
-    width: 100%;
-    // @include responsivecolumn-item(100%);
+    // width: 100%;
+    @include responsivecolumn-item(100%);
 }
 
 .big-60 {
-    width: 60%;
-    // @include responsivecolumn-item(60%);
+    // width: 60%;
+    @include responsivecolumn-item(60%);
 }
 
 .big-50 {
-    width: 50%;
-    // @include responsivecolumn-item(50%);
+    // width: 50%;
+    @include responsivecolumn-item(50%);
 }
 
 .big-40 {
-    width: 40%;
-    // @include responsivecolumn-item(40%);
+    // width: 40%;
+    @include responsivecolumn-item(40%);
 }
 
 .big-33 {
-    width: 30%;
-    // @include responsivecolumn-item(33.33%);
+    // width: 33.33%;
+    @include responsivecolumn-item(33.33%);
 }
 
 .big-20 {
-    width: 20%;
-    // @include responsivecolumn-item(20%);
+    // width: 20%;
+    @include responsivecolumn-item(20%);
 }
 
 //--------------------------------------------------------
@@ -172,12 +171,12 @@ $unaudit-purc-container-color: dynamic(#e91e63);
 
  .x-responsivecolumn-small {
      > .small-100 {
-        width: 100%;
-        // @include responsivecolumn-item(100%);
+        // width: 100%;
+        @include responsivecolumn-item(100%);
      }
 
      > .small-50 {
-        width: 50%;
-        // @include responsivecolumn-item(50%);
+        // width: 50%;
+        @include responsivecolumn-item(50%);
      }
 }

+ 2 - 38
frontend/saas-web/app/view/home/HomeModel.js

@@ -26,45 +26,9 @@ Ext.define('saas.view.home.HomeModel', {
                 load: function(s, d) {
                     Ext.getCmp('infocard').setLoading(false);
 
-                    var titles = {
-                        unship: {
-                            text: '七天内待出货销售',
-                            color: 'yellow'
-                        },
-                        unstorage: {
-                            text: '七天内待入库采购',
-                            color: 'purple'
-                        },
-                        unpay: {
-                            text: '七天内代付款',
-                            color: 'red'
-                        },
-                        unreceive: {
-                            text: '七天内代收款',
-                            color: 'pink'
-                        },
-                        unauditcheck: {
-                            text: '未审核验收',
-                            color: 'blue'
-                        },
-                        unauditship: {
-                            text: '未审核出货',
-                            color: ''
-                        }
-                    };
-                    var res = d[0].data.data;
-                    var data = [];
-                    if(res) {
-                        for(var k in res) {
-                            data.push({
-                                title: titles[k].text,
-                                content: res[k] + '件',
-                                color: titles[k].color
-                            });
-                        }
-                    }
+                    var res = d[0].data.data || {};
 
-                    Ext.getCmp('infocard').addCardItems(data);
+                    Ext.getCmp('infocard').addCardItems(res);
                 }
             }
         },

+ 46 - 5
frontend/saas-web/app/view/home/InfoCard.js

@@ -29,6 +29,33 @@ Ext.define('saas.view.home.InfoCard', {
         '</div>'
     ],
 
+    cards: {
+        unship: {
+            title: '七天内待出货销售',
+            color: 'yellow'
+        },
+        unstorage: {
+            title: '七天内待入库采购',
+            color: 'purple'
+        },
+        unpay: {
+            title: '七天内代付款',
+            color: 'red'
+        },
+        unreceive: {
+            title: '七天内代收款',
+            color: 'pink'
+        },
+        unauditcheck: {
+            title: '未审核验收',
+            color: 'blue'
+        },
+        unauditship: {
+            title: '未审核出货',
+            color: ''
+        }
+    },
+
     initComponent: function () {
         var me = this;
 
@@ -55,25 +82,39 @@ Ext.define('saas.view.home.InfoCard', {
         me.callParent(arguments);
     },
 
+    listeners: {
+        boforerender: function(m) {
+            m.addCardItems();
+        }
+    },
+
     addCardItems: function(infoData) {
+        infoData = infoData || {};
         var me = this,
         p = me.up('home'),
-        // viewModel = p.getViewModel(),
-        // infoData = viewModel.get('infoData'),
+        cards = me.cards,
         datas = [],
         items = [];
         size = Math.ceil(me.body.el.getBox().width / 235);
 
         me.removeAll();
-        for(var x = 0; x < infoData.length;) {
+
+        var cl = Ext.Object.getAllKeys(cards);
+
+        for(var x = 0; x < cl.length;) {
             var d = [];
-            for(var y = 0; y < size && x < infoData.length; y++) {
-                d.push(infoData[x]);
+            for(var y = 0; y < size && x < cl.length; y++) {
+                var key = cl[x];
+                d.push(Ext.merge(cards[key], {
+                    content: infoData[key] || 0
+                }));
                 x++;
             }
             datas.push(d);
         }
 
+        console.log(datas);
+
         Ext.Array.each(datas, function(d, i) {
 
             var store = Ext.create('Ext.data.Store', {

+ 6 - 7
frontend/saas-web/app/view/main/Main.js

@@ -128,7 +128,7 @@ Ext.define('saas.view.main.Main', {
                     }
                 },
                 {
-                    margin: '0 0 0 8',
+                    margin: '0 0 0 0',
                     xtype: 'tbtext',
                     cls:'nav-realname',
                     bind: {
@@ -143,15 +143,14 @@ Ext.define('saas.view.main.Main', {
                 {
                     ui: 'header',
                     arrowVisible: false,
-                    cls: 'header-right-profile-image',
-                    id:"userImage",
-                    height: 35,
-                    width: 35,
+                    id:"userImage",    
+                    width: 50,
+                    height:50,    
                     bind: {
-                        html:'<img class="x-img x-box-item x-toolbar-item x-img-header" style="width: 35px; height: 35px; margin: 0px;" src="{avatarUrl}" alt="">'
+                        html:'<img class="x-img x-box-item x-toolbar-item x-img-header" style="height:35px;width:35px;margin-top: 6px;margin-left: 14px;" src="{avatarUrl}" alt="">'
                     }, 
                     menu: {
-                        cls:'nav-menu',
+                        cls:'x-main-menu2',
                         items: [ {  
                             text: '账户中心',
                             iconCls:'x-fa x-fa fa-user-o',

+ 21 - 0
frontend/saas-web/app/view/main/Main.scss

@@ -242,3 +242,24 @@ body > .x-mask {
     margin-top: 17px;
     margin-left: 7px;
 }
+.x-main-menu2::before{
+    content: ' ';
+    display: block;
+    border-style: solid;
+    box-shadow: 0px 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(15, 136, 232, 0.6);
+    box-shadow: aliceblue;
+    border-width: 17px;
+    border-color: #cccccc;
+    /* border-color: #cccccc #6e838e #9c9d9e #bdc3c5; */
+    position: fixed;
+    /* left: 100%; */
+    top: 26px;
+    -moz-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
+    -webkit-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
+    -o-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
+    -ms-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
+    -khtml-clip-path: polygon(100% 0px, 0 50%, 100% 100%);
+    clip-path: polygon(0 100%, 50% 0, 100% 100%);
+    margin-top: 25px;
+    margin-left: 47px;
+}

+ 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,

+ 10 - 2
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", 
@@ -235,7 +243,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
         readOnly:true
     }, {
         xtype : "datefield", 
-        name : "pi_recorddate", 
+        name : "createTime", 
         fieldLabel : "录入日期",
         readOnly:true
     }, {

+ 41 - 25
frontend/saas-web/app/view/stock/appropriationInOut/FormPanelController.js

@@ -15,17 +15,20 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
             'dbfindtrigger[name=pi_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
+                        //数据接口
                         dataUrl:'/api/document/vendor/list',
-                        // dataUrl:'http://localhost:9480/vendor/list',
                         addXtype: 'document-vendor-formpanel',
                         addTitle: '供应商资料',
+                        defaultCondition:"ve_statuscode='OPEN'",
+                        //赋值 
                         dbfinds:[{
-                            from:'id',to:'pi_vendid'
+                            from:'id',to:'pi_vendid',ignore:true
                         },{
                             from:'ve_code',to:'pi_vendcode'
                         },{
                             from:'ve_name',to:'pi_vendname'
                         }],
+                        //联想设置
                         dbtpls:[{
                             field:'ve_code',width:100
                         },{
@@ -42,6 +45,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                             allowBlank : true, 
                             columnWidth : 0.25
                         }],
+                        //放大镜窗口列表
                         dbColumns:[{
                             "text": "供应商ID",
                             "hidden": true,
@@ -72,7 +76,14 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                             "dataIndex": "ve_promisedays",
                             "width": 100,
                             xtype: 'numbercolumn',
-                            align:'end'
+<<<<<<< HEAD
+                            align: 'end'
+=======
+                            align:'end', 
+                            renderer : function(v) {
+                                return Ext.util.Format.number(v, '0');
+                            }
+>>>>>>> origin/dev
                         }, {
                             "text": "纳税人识别号",
                             "dataIndex": "ve_bankaccount",
@@ -91,24 +102,26 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pi_custname]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
+            'dbfindtrigger[name=pi_custname]': {
+                beforerender: function (f) {
+                    Ext.apply(f, {
                         addXtype: 'document-customer-formpanel',
                         addTitle: '客户资料',
-                        dataUrl:'/api/document/customer/list',
+                        dataUrl: '/api/document/customer/list',
                         // dataUrl:'http://localhost:9480/customer/list',
-                        dbfinds:[{
-                            from:'id',to:'pi_custid'
-                        },{
-                            from:'cu_code',to:'pi_custcode'
-                        },{
-                            from:'cu_name',to:'pi_custname'
+                        dbfinds: [{
+                            from: 'id',to: 'pi_custid',ignore:true
+                        }, {
+                            from: 'cu_code',to: 'pi_custcode'
+                        }, {
+                            from: 'cu_name',to: 'pi_custname'
                         }],
-                        dbtpls:[{
-                            field:'cu_code',width:100
-                        },{
-                            field:'cu_name',width:100
+                        dbtpls: [{
+                            field: 'cu_code',
+                            width: 100
+                        }, {
+                            field: 'cu_name',
+                            width: 100
                         }],
                         defaultCondition:"cu_statuscode='OPEN'",
                         //放大镜窗口字段
@@ -119,7 +132,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                             allowBlank : true, 
                             columnWidth : 0.25,
                             getCondition:function(v){
-                                return "upper(cu_name) like '%"+v.toUpperCase()+"%' or upper(cu_code) like '%"+v.toUpperCase()+"%'";
+                                return "(upper(cu_name) like '%"+v.toUpperCase()+"%' or upper(cu_code) like '%"+v.toUpperCase()+"%')";
                             }
                         }],
                         dbColumns:[{
@@ -153,7 +166,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",
@@ -161,10 +177,10 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                             xtype: 'numbercolumn',
                             align:'end'
                         }]
-                    }) ;   
+                    });
 
                 }
-            },            
+            },           
             //放大镜赋值关系 以及 tpl模板
             'multidbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){
@@ -292,9 +308,9 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                         from:'wh_description',to:'pd_whname'
                     }],
                     dbtpls:[{
-                        field:'pd_whcode',width:100
+                        field:'wh_code',width:100
                     },{
-                        field:'pd_whname',width:100
+                        field:'wh_description',width:100
                     }],
                     dbSearchFields:[{
                         emptyText:'输入仓库编号或名称',
@@ -353,9 +369,9 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
                         from:'wh_description',to:'pd_inwhname'
                     }],
                     dbtpls:[{
-                        field:'pd_whcode',width:100
+                        field:'wh_code',width:100
                     },{
-                        field:'pd_whname',width:100
+                        field:'wh_description',width:100
                     }],
                     dbSearchFields:[{
                         emptyText:'输入仓库编号或名称',

+ 72 - 46
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js

@@ -26,25 +26,38 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         allowBlank: true,
         columnWidth: 0.5
     }, {
-        xtype: 'textfield',
+        xtype: 'hidden',
         name: 'pi_vendcode',
         fieldLabel: '供应商编号',
         allowBlank: true,
         hidden:true,
         columnWidth: 0.25
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
         allowBlank: true,
         columnWidth: 0.25
+    },{
+        xtype: 'textfield',
+        name: 'pi_custcode',
+        fieldLabel: '客户编号',
+        allowBlank: true,
+        hidden:true,
+        columnWidth: 0.25
     }, {
         xtype: 'dbfindtrigger',
+        name: 'pi_custname',
+        fieldLabel: '客户名称',
+        allowBlank: true,
+        columnWidth: 0.25
+    }, {
+        xtype: 'hidden',
         name: 'pd_prodcode',
         fieldLabel: '物料编号',
         showDetail: true
     }, {
-        xtype: 'textfield',
+        xtype: 'dbfindtrigger',
         name: 'pr_detail',
         fieldLabel: '物料名称',
         showDetail: true
@@ -53,6 +66,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         name: 'pi_statuscode',
         fieldLabel: '审核状态',
         allowBlank: true,
+        editable:false,
         columnWidth: 0.25,
         queryMode: 'local',
         displayField: 'pi_status',
@@ -84,92 +98,99 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
+            hidden:true,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
             dataIndex: 'pi_inoutno',
             width: 200
-        }, {
-            text: '单据状态',
-            dataIndex: 'pi_status',
-            width: 120
-        }, {
+        },{
             text: '单据类型',
             dataIndex: 'pi_class',
             width: 120
-        }, {
+        },{
             text: '单据日期',
             dataIndex: 'pi_date',
             xtype:'datecolumn',
             width: 200
         },{
-            text: '采购单号',
-            dataIndex: 'pi_pucode',
-            width: 200
+            text: '审核状态',
+            dataIndex: 'pi_status',
+            width: 120
         },{
             text: '供应商名称',
             dataIndex: 'pi_vendname',
             width: 120
         },{
-            text: '含税金额',
-            dataIndex: 'pi_total',
-            xtype:'numbercolumn',
+            text: '客户名称',
+            dataIndex: 'pi_custname',
             width: 120
         },{
-            text: '未税金额',
-            dataIndex: 'pi_nettotal',
-            xtype:'numbercolumn',
-            width: 120,
+            text: '制单人',
+            dataIndex: 'pi_recordman',
+            width: 120
+        },{
+            text: '审核人',
+            dataIndex: 'pi_auditman',
+            width: 120
+        },{
+            text: '备注',
+            dataIndex: 'pi_remark',
+            width: 200
         }],
         relativeColumn: [{
             text: 'id',
             dataIndex: 'pu_id',
-            width: 0,
-            xtype: 'numbercolumn'
+            xtype: 'numbercolumn',
+            hidden:true
         }, {
             text: '单据编号',
-            dataIndex: 'pd_inoutno',
+            dataIndex: 'pi_inoutno',
             width: 200
         }, {
-            text: '单据状态',
-            dataIndex: 'pi_status',
-            width: 120
-        }, {
-            text: '单据日期',
-            dataIndex: 'pi_date',
-            xtype:'datecolumn',
+            text: '单据类型',
+            dataIndex: 'pd_piclass',
             width: 200
         },{
-            text: '供应商名称',
-            dataIndex: 'pi_vendname',
+            text: '审核状态',
+            dataIndex: 'pi_status',
             width: 120
         },{
-            text: '采购单号',
-            dataIndex: 'pd_ordercode',
+            text: '客户编号',
+            dataIndex: 'pi_custcode',
             width: 120
         },{
-            text: '采购序号',
-            dataIndex: 'pd_orderdetno',
-            xtype:'numbercolumn',
+            text: '客户名称',
+            dataIndex: 'pi_custname',
             width: 120
         },{
             text: '物料编号',
             dataIndex: 'pd_prodcode',
             width: 120
         },{
-            text: '验收数量',
+            text: '物料名称',
+            dataIndex: 'pr_detail',
+            width: 120
+        },{
+            text: '物料规格',
+            dataIndex: 'pr_spec',
+            width: 120
+        },{
+            text: '单位',
+            dataIndex: 'pr_unit',
+            width: 120
+        },{
+            text: '数量',
             dataIndex: 'pd_inqty',
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '采购单价',
-            dataIndex: 'pd_orderprice',
-            xtype:'numbercolumn',
+            text: '仓库',
+            dataIndex: 'pd_whname',
             width: 120
         },{
-            text: '金额',
-            dataIndex: 'pd_total',
+            text: '单位成本',
+            dataIndex: 'pd_orderprice',
             xtype:'numbercolumn',
             width: 120
         },{
@@ -178,10 +199,15 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             xtype:'numbercolumn',
             width: 120
         },{
-            text: '成本单价',
-            dataIndex: 'pd_price',
+            text: '金额',
+            dataIndex: 'pd_total',
             xtype:'numbercolumn',
-            width: 120,
+            width: 120
+        },{
+            text: '相关单号',
+            dataIndex: 'pd_ordercode',
+            xtype:'numbercolumn',
+            width: 120
         }]
     }
 });

+ 92 - 9
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanelController.js

@@ -6,16 +6,16 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanelController', {
         var me = this;
         this.control({
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pu_vendname]':{
+            'dbfindtrigger[name=pi_vendname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/vendor/list',
                         addXtype: 'document-vendor-formpanel',
                         addTitle: '供应商资料',
                         dbfinds:[{
-                            from:'ve_code',to:'pu_vendcode'
+                            from:'ve_code',to:'pi_vendcode'
                         },{
-                            from:'ve_name',to:'pu_vendname'
+                            from:'ve_name',to:'pi_vendname'
                         }],
                         dbtpls:[{
                             field:'ve_code',width:100
@@ -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",
@@ -82,15 +85,19 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanelController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
+            'dbfindtrigger[name=pr_detail]':{
                 beforerender:function(f){
                     Ext.apply(f,{
+                        conditionCode:'pr_code',
                         dataUrl:'/api/document/product/list',
                         addXtype: 'document-product-formpanel',
                         addTitle: '物料资料',
                         dbfinds:[{
+                            from:'pr_detail',to:'pr_detail',
+                        },{
                             from:'pr_code',to:'pd_prodcode',
-                            from:'pr_unit',to:'pd_unit'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100
@@ -99,7 +106,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanelController', {
                         }],
                         defaultCondition: "pr_statuscode='OPEN'",
                         dbSearchFields:[{
-                            emptyText:'输入物料编号、名称或规格',
+                            emptyText:'输入物料编号或名称',
                             xtype : "textfield", 
                             name : "search", 
                             width: 200,
@@ -173,11 +180,87 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanelController', {
                             "text": "L/T",
                             "dataIndex": "pr_leadtime",
                             "width": 100,
-                        }]
+                        }]   
                     }) ;   
 
                 }
-            }
+            },
+            'dbfindtrigger[name=pi_custname]': {
+                beforerender: function (f) {
+                    Ext.apply(f, {
+                        addXtype: 'document-customer-formpanel',
+                        addTitle: '客户资料',
+                        dataUrl: '/api/document/customer/list',
+                        // dataUrl:'http://localhost:9480/customer/list',
+                        dbfinds: [{
+                            from: 'id',to: 'pi_custid',ignore:true
+                        }, {
+                            from: 'cu_code',to: 'pi_custcode'
+                        }, {
+                            from: 'cu_name',to: 'pi_custname'
+                        }],
+                        dbtpls: [{
+                            field: 'cu_code',
+                            width: 100
+                        }, {
+                            field: 'cu_name',
+                            width: 100
+                        }],
+                        defaultCondition:"cu_statuscode='OPEN'",
+                        //放大镜窗口字段
+                        dbSearchFields:[{
+                            emptyText:'输入客户编号或名称',
+                            xtype : "textfield", 
+                            name : "cu_name", 
+                            allowBlank : true, 
+                            columnWidth : 0.25,
+                            getCondition:function(v){
+                                return "(upper(cu_name) like '%"+v.toUpperCase()+"%' or upper(cu_code) like '%"+v.toUpperCase()+"%')";
+                            }
+                        }],
+                        dbColumns:[{
+                            "text": "客户ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                        },{
+                            "text": "客户编号",
+                            "dataIndex": "cu_code",
+                            "width": 200,
+                        }, {
+                            "text": "客户名称",
+                            "dataIndex": "cu_name",
+                            "width": 200
+                        },{
+                            "text": "客户类型",
+                            "dataIndex": "cu_name",
+                            "width": 100
+                        },{
+                            "text": "业务员",
+                            "dataIndex": "cu_sellername",
+                            "width": 100
+                        },{
+                            "text": "税率",
+                            "dataIndex": "cu_taxrate",
+                            "width": 100,
+                            xtype: 'numbercolumn',
+                            align:'end'
+                        },{
+                            "text": "承付天数",
+                            "dataIndex": "cu_promisedays",
+                            "width": 100,
+                            xtype: 'numbercolumn',
+                            align:'end'
+                        },{
+                            "text": "额度",
+                            "dataIndex": "cu_credit",
+                            "width": 100,
+                            xtype: 'numbercolumn',
+                            align:'end'
+                        }]
+                    });
+
+                }
+            },                
         });
 
     }

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

@@ -195,7 +195,10 @@ Ext.define('saas.view.stock.make.FormPanel', {
                 width : 100.0,
                 ignore:true,
                 renderer: function (v, m, r) {
-                    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:'';
+                    if(!v){
+                        return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
+                    }
+                    return v;
                 }
             },            
             {

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

@@ -83,9 +83,9 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                             from:'wh_description',to:'mm_whname'
                         }],
                         dbtpls:[{
-                            field:'pd_whcode',width:100
+                            field:'wh_code',width:100
                         },{
-                            field:'pd_whname',width:100
+                            field:'wh_description',width:100
                         }],
                         dbSearchFields:[{
                             emptyText:'输入仓库编号或名称',

+ 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",

+ 1 - 0
frontend/saas-web/app/view/stock/otherIn/QueryPanel.js

@@ -58,6 +58,7 @@ Ext.define('saas.view.stock.otherIn.QueryPanel', {
         bind: '{pi_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
+        editable:false,
         columnWidth: 0.25,
         queryMode: 'local',
         displayField: 'pi_status',

+ 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",

+ 1 - 0
frontend/saas-web/app/view/stock/otherOut/QueryPanel.js

@@ -58,6 +58,7 @@ Ext.define('saas.view.stock.otherOut.QueryPanel', {
         bind: '{pi_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
+        editable:false,
         columnWidth: 0.25,
         queryMode: 'local',
         displayField: 'pi_status',

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

+ 6 - 2
frontend/saas-web/app/view/sys/config/FormPanel.js

@@ -62,6 +62,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         xtype: 'textfield',
         name: 'en_address',
         fieldLabel: '公司地址',
+        beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
         allowBlank: false,
         width:600
     },{
@@ -69,6 +70,7 @@ Ext.define('saas.view.sys.config.FormPanel', {
         xtype: 'textfield',
         name: 'en_tel',
         fieldLabel: '电话',
+        beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
         allowBlank: false,
         columnWidth: 0.25
     },{
@@ -98,14 +100,16 @@ Ext.define('saas.view.sys.config.FormPanel', {
         queryMode : "local", 
         valueField : "value", 
         xtype : "combo",
+        value:'WACC',
         store:{
             fields: ['display', 'value'],
             data : [
-                {"display":"加权平均法", "value":'1'},
-                {"display":"先进先出法", "value":'0'}
+                {"display":"加权平均法", "value":'WACC'},
+                {"display":"先进先出法", "value":'FIFO'}
             ]
         },
         name : "en_pricemethod", 
+        beforeLabelTextTpl : "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
         fieldLabel : "库存计算方式", 
         allowBlank : false, 
         columnWidth : 0.25

+ 1 - 1
frontend/saas-web/app/view/sys/power/GroupGrid.js

@@ -31,7 +31,7 @@ Ext.define('saas.view.sys.power.GroupGrid', {
         groupHeaderTpl: '{name}'+'模块'
 	})],
     initId:0,
-    dataUrl:'http://192.168.253.31:8560/api/account/role/power/resource',
+    dataUrl:'/api/account/role/power/resource',
     selModel:Ext.create('Ext.selection.CheckboxModel', {
         checkOnly: true,
         showHeaderCheckbox:false,

+ 7 - 3
frontend/saas-web/ext/packages/modern-locale/overrides/zh_CN/field/Date.js

@@ -5,7 +5,11 @@
 Ext.define('Ext.locale.zh_CN.field.Date', {
     override: 'Ext.form.field.Date',
 
-    formatText: '当前日期格式为 {0}.',
-    minDateMessage: '该输入项的日期必须在 {0} 之后',
-    maxDateMessage: '该输入项的日期必须在 {0} 之前'
+    config: {
+        formatText: '当前日期格式为 {0}.',
+        minDateMessage: '该输入项的日期必须在 {0} 之后',
+        maxDateMessage: '该输入项的日期必须在 {0} 之前',
+        minText: "日期必须大于等于 {0}",
+        maxText: "日期必须小于等于 {0}",
+    },
 });

+ 6 - 1
frontend/saas-web/ext/packages/modern-locale/overrides/zh_CN/picker/Date.js

@@ -10,6 +10,11 @@ Ext.define('Ext.locale.zh_CN.picker.Date', {
         monthText: '月',
         dayText: '日',
         yearText: '年',
-        todayText: '今天'
+        todayText: '今天',
+        todayTip: '{0} (今天)',
+        monthYearText: '选择月 (Ctrl + 上/下增减年)',
+        nextText: '下一个月 (Ctrl + 右)',
+        prevText: '上一个月 (Ctrl + 左)',
+        
     }
 });

+ 0 - 26
frontend/saas-web/resources/json/info.json

@@ -1,26 +0,0 @@
-[{
-    "title": "七天内待出货销售",
-    "content": "168件",
-    "color": "yellow"
-}, {
-    "title": "七天内待入库采购",
-    "content": "168件",
-    "color": "purple"
-}, {
-    "title": "七天内代付款",
-    "content": "168件",
-    "color": "red"
-}, {
-    "title": "七天内代收款",
-    "content": "168件",
-    "color": "yellow"
-}, {
-    "title": "未审核验收",
-    "content": "168件"
-}, {
-    "title": "七天内待出货销售",
-    "content": "168件"
-}, {
-    "title": "未审核出货",
-    "content": "168件"
-}]