Bladeren bron

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

guq 7 jaren geleden
bovenliggende
commit
10653bd25d
60 gewijzigde bestanden met toevoegingen van 1220 en 226 verwijderingen
  1. 3 2
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 31 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bom.java
  3. 12 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/BomDetail.java
  4. 2 2
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendor.java
  5. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  6. 6 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  7. 32 1
      applications/document/document-server/src/main/resources/mapper/BomDetailMapper.xml
  8. 5 2
      applications/document/document-server/src/main/resources/mapper/BomMapper.xml
  9. 1 1
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  10. 1 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  11. 1 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  12. 1 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  13. 8 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  14. 9 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  15. 2 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  16. 15 5
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  17. 1 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  18. 15 5
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  19. 34 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/OtherPowerDTO.java
  20. 123 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/PowerDTO.java
  21. 5 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/RoleController.java
  22. 7 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/ResourceMapper.java
  23. 15 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/RoleResourceMapper.java
  24. 43 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/OtherPower.java
  25. 1 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/ResourceService.java
  26. 8 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/RoleService.java
  27. 97 5
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/RoleServiceImpl.java
  28. 3 0
      base-servers/account/account-server/src/main/resources/mapper/ResourceMapper.xml
  29. 18 0
      base-servers/account/account-server/src/main/resources/mapper/RoleResourceMapper.xml
  30. 1 0
      base-servers/auth/auth-client/src/main/java/com/usoftchina/saas/auth/client/interceptor/AuthRestInterceptor.java
  31. 1 0
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java
  32. 5 1
      framework/core/src/main/java/com/usoftchina/saas/constant/CommonConstants.java
  33. 9 0
      framework/core/src/main/java/com/usoftchina/saas/context/BaseContextHolder.java
  34. 4 0
      frontend/saas-web/app/util/FormUtil.js
  35. 1 1
      frontend/saas-web/app/view/core/query/QueryPanel.js
  36. 3 3
      frontend/saas-web/app/view/core/report/ReportPanel.js
  37. 6 0
      frontend/saas-web/app/view/core/report/ReportPanel.scss
  38. 9 9
      frontend/saas-web/app/view/document/bom/BasePanel.js
  39. 12 11
      frontend/saas-web/app/view/document/bom/FormPanel.js
  40. 1 0
      frontend/saas-web/app/view/main/Navigation.js
  41. 1 1
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  42. 8 2
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  43. 6 3
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  44. 9 18
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  45. 17 0
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  46. 18 2
      frontend/saas-web/app/view/money/payBalance/QueryPanel.js
  47. 14 6
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  48. 17 0
      frontend/saas-web/app/view/money/recBalance/FormPanelController.js
  49. 9 0
      frontend/saas-web/app/view/money/recBalance/QueryPanel.js
  50. 1 1
      frontend/saas-web/app/view/purchase/report/PurchasePay.js
  51. 20 91
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  52. 1 29
      frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js
  53. 4 5
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  54. 105 0
      frontend/saas-web/app/view/stock/report/ProdinoutCount.js
  55. 177 0
      frontend/saas-web/app/view/stock/report/ProdinoutCountController.js
  56. 4 0
      frontend/saas-web/app/view/stock/report/ProdinoutCountModel.js
  57. 138 0
      frontend/saas-web/app/view/stock/report/Prodiodetail.js
  58. 107 0
      frontend/saas-web/app/view/stock/report/ProdiodetailController.js
  59. 4 0
      frontend/saas-web/app/view/stock/report/ProdiodetailModel.js
  60. 6 2
      frontend/saas-web/resources/json/navigation.json

+ 3 - 2
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -36,7 +36,8 @@ public enum BizExceptionCode implements BaseExceptionCode {
 
 
 
-    //采购
+    //采购 70000-71999
+    PURCCHECKIN_POST_ERROR(70000,""),
 
     //销售
     SALE_ALL_TURNOUT(72000, "该销售单已全部转出货,无法转出货单"),
@@ -58,7 +59,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
 
     //库存
     EMPTY_DATA(76100,"数据为空,请填写后再保存"),
-
+    STORAGE_POST_ERROR(76200,""),
     ;
     private int code;
     private String message;

+ 31 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bom.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.entities;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.dto.ProductDTO;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -34,6 +35,36 @@ public class Bom extends CommonBaseEntity implements Serializable {
 
     private String bo_text5;
 
+    private String pr_spec;
+
+    private String pr_brand;
+
+    private String pr_orispeccode;
+
+    public String getPr_spec() {
+        return pr_spec;
+    }
+
+    public void setPr_spec(String pr_spec) {
+        this.pr_spec = pr_spec;
+    }
+
+    public String getPr_brand() {
+        return pr_brand;
+    }
+
+    public void setPr_brand(String pr_brand) {
+        this.pr_brand = pr_brand;
+    }
+
+    public String getPr_orispeccode() {
+        return pr_orispeccode;
+    }
+
+    public void setPr_orispeccode(String pr_orispeccode) {
+        this.pr_orispeccode = pr_orispeccode;
+    }
+
     public Integer getBo_motherid() {
         return bo_motherid;
     }

+ 12 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/BomDetail.java

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.document.entities;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.dto.ProductDTO;
+
 import java.io.Serializable;
 
 public class BomDetail extends CommonBaseEntity implements Serializable {
@@ -30,6 +32,16 @@ public class BomDetail extends CommonBaseEntity implements Serializable {
 
     private String bd_text5;
 
+    private ProductDTO productDTO;
+
+    public ProductDTO getProductDTO() {
+        return productDTO;
+    }
+
+    public void setProductDTO(ProductDTO productDTO) {
+        this.productDTO = productDTO;
+    }
+
     public Long getBd_bomid() {
         return bd_bomid;
     }

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

@@ -197,11 +197,11 @@ public class Vendor extends CommonBaseEntity implements Serializable{
         this.ve_promisedays = ve_promisedays;
     }
 
-    public double getVe_taxrate() {
+    public Double getVe_taxrate() {
         return ve_taxrate;
     }
 
-    public void setVe_taxrate(double ve_taxrate) {
+    public void setVe_taxrate(Double ve_taxrate) {
         this.ve_taxrate = ve_taxrate;
     }
 

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

@@ -112,8 +112,11 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
         if(id == null || id <= 0){
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
         }
+        String code = getMapper().selectByPrimaryKey(id).getBo_mothercode();
         getMapper().deleteByPrimaryKey(id);
         bomDetailMapper.deleteByFK(id);
+        //记录LOG
+        messageLogService.delete(generateMsgObj(id, code));
     }
 
     @Override

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

@@ -170,7 +170,12 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     public boolean deleteByPrimaryKey(Long id) {
         //校验物料是否已经在使用状态(采购单、销售单、BOM、出入库单)
         validEnableDel(id);
-        return false;
+        String code = getMapper().getCodeById(id);
+        getMapper().deleteByPrimaryKey(id);
+        DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+        //记录LOG
+        messageLogService.delete(docBaseDTO);
+        return true;
     }
 
     private void validEnableDel(Long id) {

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

@@ -19,6 +19,37 @@
     <result column="bd_text3" property="bd_text3" jdbcType="VARCHAR" />
     <result column="bd_text4" property="bd_text4" jdbcType="VARCHAR" />
     <result column="bd_text5" property="bd_text5" jdbcType="VARCHAR" />
+    <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
+        <id column="pr_id" property="id" jdbcType="INTEGER" />
+        <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
+        <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
+        <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
+        <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR" />
+        <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR" />
+        <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
+        <result column="pr_whid" property="pr_whid" jdbcType="INTEGER" />
+        <result column="pr_whcode" property="pr_whcode" jdbcType="VARCHAR" />
+        <result column="pr_whname" property="pr_whname" jdbcType="VARCHAR" />
+        <result column="pr_zxbzs" property="pr_zxbzs" jdbcType="INTEGER" />
+        <result column="pr_leadtime" property="pr_leadtime" jdbcType="INTEGER" />
+        <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+        <result column="pr_standardprice" property="pr_standardprice" jdbcType="DOUBLE" />
+        <result column="pr_purcprice" property="pr_purcprice" jdbcType="DOUBLE" />
+        <result column="pr_saleprice" property="pr_saleprice" jdbcType="DOUBLE" />
+        <result column="pr_vendid" property="pr_vendid" jdbcType="INTEGER" />
+        <result column="pr_vendcode" property="pr_vendcode" jdbcType="VARCHAR" />
+        <result column="pr_vendname" property="pr_vendname" jdbcType="VARCHAR" />
+        <result column="pr_docdate" property="pr_docdate" jdbcType="TIMESTAMP" />
+        <result column="pr_recordmanid" property="pr_recordmanid" jdbcType="INTEGER" />
+        <result column="pr_recordman" property="pr_recordman" jdbcType="VARCHAR" />
+        <result column="pr_status" property="pr_status" jdbcType="VARCHAR" />
+        <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR" />
+        <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+        <result column="pr_text1" property="pr_text1" jdbcType="VARCHAR" />
+        <result column="pr_text2" property="pr_text2" jdbcType="VARCHAR" />
+        <result column="pr_text3" property="pr_text3" jdbcType="VARCHAR" />
+        <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR" />
+    </association>
   </resultMap>
   <sql id="Base_Column_List" >
     bd_id, bd_bomid, bd_detno, bd_sonid, bd_soncode, bd_unit, bd_baseqty, bd_replace, 
@@ -308,6 +339,6 @@
     WHERE BD_BOMID=#{id}
   </delete>
   <select id="selectByFK" resultMap="BaseResultMap">
-    SELECT * FROM BOMDETAIL WHERE BD_BOMID = #{id}
+    SELECT * FROM BOMDETAIL LEFT JOIN PRODUCT ON PR_ID=BD_SONID AND BOMDETAIL.COMPANYID=PRODUCT.COMPANYID WHERE BD_BOMID = #{id}
   </select>
 </mapper>

+ 5 - 2
applications/document/document-server/src/main/resources/mapper/BomMapper.xml

@@ -20,6 +20,9 @@
     <result column="bo_text3" property="bo_text3" jdbcType="VARCHAR" />
     <result column="bo_text4" property="bo_text4" jdbcType="VARCHAR" />
     <result column="bo_text5" property="bo_text5" jdbcType="VARCHAR" />
+    <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+    <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
+    <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     bo_id, bo_motherid, bo_mothercode, bo_mothername, bo_version, bo_status, bo_statuscode, 
@@ -258,13 +261,13 @@
       SELECT BO_MOTHERCODE FROM BOM WHERE BO_ID = #{id} and COMPANYID = #{companyId}
   </select>
   <select id="getListData" resultMap="BaseResultMap">
-    SELECT * FROM BOM
+    SELECT * FROM BOM LEFT JOIN PRODUCT ON PR_ID=BO_MOTHERID
     <where>
       <if test="condition!=null">
         ${condition}
       </if>
       <if test="companyId!=null">
-        AND companyId = #{companyId}
+        AND BOM.companyId = #{companyId}
       </if>
     </where>
     ORDER BY BO_ID DESC

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

@@ -101,7 +101,7 @@
             </if>
             AND VENDOR.COMPANYID = #{companyId}
         </where>
-        order by VE_ID,VC_DETNO
+        order by VE_ID,VC_DETNO DESC
     </select>
 
     <sql id="Base_Column_List" >

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

@@ -44,14 +44,12 @@ public class FundtransferServiceImpl implements FundtransferService {
         Fundtransfer fundtransfer = fundtran.getMain();
         List<Fundtransferdetail> fundtransferdetails = fundtran.getItems();
 
-        System.out.println("fun:"+fundtransferdetails);
 
         String ft_code = fundtransfer.getFt_code();
 
         //编号校验
         ft_code = pushMaxnubmer(ft_code, fundtransfer.getId());
 
-        System.out.println("ft_code" + ft_code);
         //单号赋值
         fundtransfer.setFt_code(ft_code);
 
@@ -61,6 +59,7 @@ public class FundtransferServiceImpl implements FundtransferService {
             fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
         }else {
             fundtransfer.setCompanyId(BaseContextHolder.getCompanyId());
+            fundtransfer.setFt_recorder(BaseContextHolder.getUserName());
             fundtransferMapper.insertSelective(fundtransfer);
             id = fundtransfer.getId();
         }

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

@@ -48,14 +48,12 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
         Othreceipts othreceipts = othte.getMain();
         List<Othreceiptsdetail> othreceiptsdetail = othte.getItems();
 
-        System.out.println("oth:" + othreceipts);
 
         String or_code = othreceipts.getOr_code();
 
         //编号校验
         or_code = pushMaxnubmer(or_code, othreceipts.getId());
 
-        System.out.println("or_code" + or_code);
         //单号赋值
         othreceipts.setOr_code(or_code);
 
@@ -65,6 +63,7 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
             othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
         }else {
             othreceipts.setCompanyId(BaseContextHolder.getCompanyId());
+            othreceipts.setOr_recorder(BaseContextHolder.getUserName());
             othreceiptsMapper.insertSelective(othreceipts);
             id = othreceipts.getId();
         }

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

@@ -61,6 +61,7 @@ public class OthspendingsServiceImpl implements OthspendingsService {
             othspendingsMapper.updateByPrimaryKeySelective(othspendings);
         }else {
             othspendings.setCompanyId(BaseContextHolder.getCompanyId());
+            othspendings.setOs_recorder(BaseContextHolder.getUserName());
             othspendingsMapper.insertSelective(othspendings);
             id = othspendings.getId();
         }

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

@@ -48,14 +48,12 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         List<Paybalancedet> paybalancedet = pay.getItems1();
         List<Paybalancedetail> paybalancedetail = pay.getItems2();
 
-        System.out.println("paybal:"+paybalance);
         String pb_code = paybalance.getPb_code();
         //编号校验
         pb_code = pushMaxnubmer(pb_code, paybalance.getId());
         //单号赋值
         paybalance.setPb_code(pb_code);
 
-        System.out.println("code:"+paybalance.getPb_code());
 
         Long pbId = paybalance.getId();
 
@@ -66,6 +64,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
             paybalanceMapper.updateByPrimaryKeySelective(paybalance);
         }else {
             paybalance.setCompanyId(BaseContextHolder.getCompanyId());
+            paybalance.setPb_recorder(BaseContextHolder.getUserName());
             paybalanceMapper.insertSelective(paybalance);
             pbId = paybalance.getId();
             System.out.println("rbid:" + pbId);
@@ -151,7 +150,13 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         //更新本次预付款金额
         Paybalance updatePay = new Paybalance();
         updatePay.setId(paybalance.getId());
-        updatePay.setPb_preamount(amountTotal+paybalance.getPb_discounts()-nowbalanceTotal);
+
+        //折扣
+        Double discounts = paybalance.getPb_discounts();
+        if(discounts == null){
+            discounts = 0.0;
+        }
+        updatePay.setPb_preamount(amountTotal + discounts - nowbalanceTotal);
         paybalanceMapper.updateByPrimaryKeySelective(updatePay);
     }
 

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

@@ -46,8 +46,6 @@ public class RecbalanceServiceImpl implements RecbalanceService {
         Recbalance recbalance = rec.getMain();
         List<Recbalancedet> recbalancedet = rec.getItems1();
         List<Recbalancedetail> recbalancedetail = rec.getItems2();
-        System.out.println("recbalance:" + recbalance);
-
 
         String pu_code = recbalance.getRb_code();
 
@@ -64,9 +62,9 @@ public class RecbalanceServiceImpl implements RecbalanceService {
             recbalanceMapper.updateByPrimaryKeySelective(recbalance);
         }else {
             recbalance.setCompanyId(BaseContextHolder.getCompanyId());
+            recbalance.setRb_recorder(BaseContextHolder.getUserName());
             recbalanceMapper.insertSelective(recbalance);
             rbId = recbalance.getId();
-            System.out.println("rbid:" + rbId);
         }
 
         Iterator isdet = recbalancedet.iterator();
@@ -98,7 +96,7 @@ public class RecbalanceServiceImpl implements RecbalanceService {
 
     /**
      * 校验数据
-     * @param pay
+     * @param rec
      */
     private void checkRecbalance(Rec rec){
         Recbalance recbalance = rec.getMain();
@@ -149,7 +147,13 @@ public class RecbalanceServiceImpl implements RecbalanceService {
         //更新本次预付款金额
         Recbalance updatePay = new Recbalance();
         updatePay.setId(recbalance.getId());
-        updatePay.setRb_preamount(amountTotal+recbalance.getRb_discounts()-nowbalanceTotal);
+
+        //折扣
+        Double discount = recbalance.getRb_discounts();
+        if (discount == null){
+            discount = 0.0;
+        }
+        updatePay.setRb_preamount(amountTotal + discount - nowbalanceTotal);
         recbalanceMapper.updateByPrimaryKeySelective(updatePay);
     }
 

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

@@ -130,8 +130,7 @@ public class ProdInOutController {
      */
     @PostMapping("/batchAudit")
     public Result batchAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        prodInOutService.batchAudit(baseDTOs);
-        return Result.success();
+        return Result.success(prodInOutService.batchAudit(baseDTOs));
     }
 
     /**
@@ -142,8 +141,7 @@ public class ProdInOutController {
      */
     @PostMapping("/batchUnAudit")
     public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        prodInOutService.batchUnAudit(baseDTOs);
-        return Result.success();
+        return Result.success(prodInOutService.batchUnAudit(baseDTOs));
     }
 
     /**

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

@@ -250,8 +250,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
     private void singleAudit(ProdInOutDTO prodInOutDTO) {
         String pi_class= prodInOutDTO.getPi_class();
+        String pi_inoutno = prodInOutDTO.getPi_inoutno();
+        String pi_statuscode = prodInOutDTO.getPi_statuscode();
+        if(StringUtils.isEmpty(pi_statuscode)||(!StringUtils.isEmpty(pi_statuscode)&&!pi_statuscode.equals(Status.UNAUDITED.name()))){
+            throw  new BizException(BizExceptionCode.BIZ_AUDITED);
+        };
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
+        map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
         map.put("companyId",BaseContextHolder.getCompanyId());
@@ -259,7 +264,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Result res = warehouseApi.post(map);
         Object result =  res.getData();
         if(!StringUtils.isEmpty(result)){
-            throw new BizException(BizExceptionCode.SALEOUT_POST_ERROR.getCode(),result.toString());
+            throw new BizException(BizExceptionCode.PURCCHECKIN_POST_ERROR.getCode(),result.toString());
         }else{
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class,prodInOutDTO.getPi_inoutno());
@@ -296,9 +301,14 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     private void singleUnAudit(ProdInOutDTO prodInOutDTO) {
-        String pi_class= prodInOutDTO.getPi_class();
+        String pi_class = prodInOutDTO.getPi_class();
+        String  pi_inoutno = prodInOutDTO.getPi_inoutno();
+        String pi_statuscode = prodInOutDTO.getPi_statuscode();
+        if(StringUtils.isEmpty(pi_statuscode)||(!StringUtils.isEmpty(pi_statuscode)&&!pi_statuscode.equals(Status.AUDITED.name()))){
+            throw  new BizException(BizExceptionCode.BIZ_UNAUDITED);
+        };
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
+        map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
         map.put("companyId",BaseContextHolder.getCompanyId());
@@ -306,7 +316,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Result res = warehouseApi.unPost(map);
         Object result = res.getData();
         if(!StringUtils.isEmpty(result)){
-            throw new BizException(BizExceptionCode.SALEOUT_POST_ERROR.getCode(),result.toString());
+            throw new BizException(BizExceptionCode.PURCCHECKIN_POST_ERROR.getCode(),result.toString());
         }else{
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class,prodInOutDTO.getPi_inoutno());

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

@@ -158,7 +158,7 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             int i = 0;
             for(MakeMaterial makeMaterial : makeMaterialList){
                 i++;
-                double qty = makeMaterial.getMm_qty() * makeMaterial.getMm_oneuseqty();
+                double qty = makeMaterial.getMm_qty();
                 double onHand = getMapper().getOnHand(makeMaterial.getMm_prodcode(),makeMaterial.getMm_whcode(), BaseContextHolder.getCompanyId());
                 if(onHand < qty){
                     throw new BizException(79402, "行" + i + "库存不足");

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

@@ -235,8 +235,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
     private void singleAudit(ProdInOutDTO prodInOutDTO) {
         String pi_class= prodInOutDTO.getPi_class();
+        String pi_inoutno = prodInOutDTO.getPi_inoutno();
+        String pi_statuscode = prodInOutDTO.getPi_statuscode();
+        if(StringUtils.isEmpty(pi_statuscode)||(!StringUtils.isEmpty(pi_statuscode)&&!pi_statuscode.equals(Status.UNAUDITED.name()))){
+            throw  new BizException(BizExceptionCode.BIZ_AUDITED);
+        };
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
+        map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
         map.put("companyId",BaseContextHolder.getCompanyId());
@@ -244,7 +249,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Result res = warehouseApi.post(map);
         Object result =  res.getData();
         if(!StringUtils.isEmpty(result)){
-            throw new BizException(BizExceptionCode.SALEOUT_POST_ERROR.getCode(),result.toString());
+            throw new BizException(BizExceptionCode.STORAGE_POST_ERROR.getCode(),result.toString());
         }else{
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class,prodInOutDTO.getPi_inoutno());
@@ -281,9 +286,14 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     private void singleUnAudit(ProdInOutDTO prodInOutDTO) {
-        String pi_class= prodInOutDTO.getPi_class();
+        String pi_class = prodInOutDTO.getPi_class();
+        String  pi_inoutno = prodInOutDTO.getPi_inoutno();
+        String pi_statuscode = prodInOutDTO.getPi_statuscode();
+        if(StringUtils.isEmpty(pi_statuscode)||(!StringUtils.isEmpty(pi_statuscode)&&!pi_statuscode.equals(Status.AUDITED.name()))){
+            throw  new BizException(BizExceptionCode.BIZ_UNAUDITED);
+        };
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("inoutNo",prodInOutDTO.getPi_inoutno() );
+        map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
         map.put("companyId",BaseContextHolder.getCompanyId());
@@ -291,7 +301,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Result res = warehouseApi.unPost(map);
         Object result =  res.getData();
         if(!StringUtils.isEmpty(result)){
-            throw new BizException(BizExceptionCode.SALEOUT_POST_ERROR.getCode(),result.toString());
+            throw new BizException(BizExceptionCode.STORAGE_POST_ERROR.getCode(),result.toString());
         }else{
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class,prodInOutDTO.getPi_inoutno());

+ 34 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/OtherPowerDTO.java

@@ -0,0 +1,34 @@
+package com.usoftchina.saas.account.dto;
+
+import java.io.Serializable;
+
+public class OtherPowerDTO implements Serializable {
+
+    private Long resourceId;
+    private String name;
+    private boolean checked;
+
+    public boolean isChecked() {
+        return checked;
+    }
+
+    public void setChecked(boolean checked) {
+        this.checked = checked;
+    }
+
+    public Long getResourceId() {
+        return resourceId;
+    }
+
+    public void setResourceId(Long resourceId) {
+        this.resourceId = resourceId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 123 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/PowerDTO.java

@@ -0,0 +1,123 @@
+package com.usoftchina.saas.account.dto;
+
+import java.util.List;
+
+public class PowerDTO {
+    private Long groupId;
+    private String moduleName;
+    private String groupName;
+    private boolean query;
+    private boolean add;
+    private boolean update;
+    private boolean delete;
+    private boolean audit;
+    private boolean unAudit;
+    private boolean print;
+    private boolean fileExport;
+    private boolean fileImport;
+    private List<OtherPowerDTO> other;
+
+    public Long getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Long groupId) {
+        this.groupId = groupId;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    public String getModuleName() {
+        return moduleName;
+    }
+
+    public void setModuleName(String moduleName) {
+        this.moduleName = moduleName;
+    }
+
+    public boolean getQuery() {
+        return query;
+    }
+
+    public void setQuery(boolean query) {
+        this.query = query;
+    }
+
+    public boolean getAdd() {
+        return add;
+    }
+
+    public void setAdd(boolean add) {
+        this.add = add;
+    }
+
+    public boolean getUpdate() {
+        return update;
+    }
+
+    public void setUpdate(boolean update) {
+        this.update = update;
+    }
+
+    public boolean getDelete() {
+        return delete;
+    }
+
+    public void setDelete(boolean delete) {
+        this.delete = delete;
+    }
+
+    public boolean getAudit() {
+        return audit;
+    }
+
+    public void setAudit(boolean audit) {
+        this.audit = audit;
+    }
+
+    public boolean getUnAudit() {
+        return unAudit;
+    }
+
+    public void setUnAudit(boolean unAudit) {
+        this.unAudit = unAudit;
+    }
+
+    public boolean getPrint() {
+        return print;
+    }
+
+    public void setPrint(boolean print) {
+        this.print = print;
+    }
+
+    public boolean getFileExport() {
+        return fileExport;
+    }
+
+    public void setFileExport(boolean fileExport) {
+        this.fileExport = fileExport;
+    }
+
+    public boolean getFileImport() {
+        return fileImport;
+    }
+
+    public void setFileImport(boolean fileImport) {
+        this.fileImport = fileImport;
+    }
+
+    public List<OtherPowerDTO> getOther() {
+        return other;
+    }
+
+    public void setOther(List<OtherPowerDTO> other) {
+        this.other = other;
+    }
+}

+ 5 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/RoleController.java

@@ -130,6 +130,11 @@ public class RoleController {
         return Result.success();
     }
 
+    @GetMapping("/power/resource")
+    public Result getResourcePower(Long id){
+        return Result.success(roleService.getResourcePowerById(id));
+    }
+
     /**
      * 清除角色相关所有账户的缓存
      *

+ 7 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/ResourceMapper.java

@@ -42,4 +42,11 @@ public interface ResourceMapper {
      * @return
      */
     Resource selectByPrimaryKey(@Param("id") Long id);
+
+    /**
+     * 按资源组查找Classify
+     * @param id
+     * @return
+     */
+    List<String> selectClassifyByGroupId(@Param("id") Long id);
 }

+ 15 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/RoleResourceMapper.java

@@ -1,9 +1,11 @@
 package com.usoftchina.saas.account.mapper;
 
+import com.usoftchina.saas.account.po.OtherPower;
 import com.usoftchina.saas.account.po.RoleResource;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author yingp
@@ -53,4 +55,17 @@ public interface RoleResourceMapper {
      * @return
      */
     List<RoleResource> selectByAccountId(@Param("accountId") Long accountId);
+
+    /**
+     * 按角色ID查找角色绑定的资源Classify
+     * @param id
+     */
+    List<Map<String, Object>> selectClassifyByRoleId(@Param("id") Long id);
+
+    /**
+     * 通过资源groupId和角色ID查询 角色是否具有改资源的权限
+     * @param roleId
+     * @return
+     */
+    List<OtherPower> selectOthersPower(@Param("roleId") Long roleId);
 }

+ 43 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/OtherPower.java

@@ -0,0 +1,43 @@
+package com.usoftchina.saas.account.po;
+
+import java.io.Serializable;
+
+public class OtherPower implements Serializable {
+
+    private Long resourceId;
+    private String name;
+    private boolean checked;
+    private Long groupId;
+
+    public Long getResourceId() {
+        return resourceId;
+    }
+
+    public void setResourceId(Long resourceId) {
+        this.resourceId = resourceId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public boolean isChecked() {
+        return checked;
+    }
+
+    public void setChecked(boolean checked) {
+        this.checked = checked;
+    }
+
+    public Long getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Long groupId) {
+        this.groupId = groupId;
+    }
+}

+ 1 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/ResourceService.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.account.service;
 
+import com.usoftchina.saas.account.dto.ResourceGroupDTO;
 import com.usoftchina.saas.account.dto.ResourceModuleDTO;
 import com.usoftchina.saas.account.dto.UrlResourceDTO;
 import com.usoftchina.saas.account.po.Resource;

+ 8 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/RoleService.java

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.account.service;
 
+import com.usoftchina.saas.account.dto.PowerDTO;
 import com.usoftchina.saas.account.dto.RoleBaseDTO;
 import com.usoftchina.saas.account.mapper.RoleMapper;
 import com.usoftchina.saas.account.po.Role;
@@ -36,4 +37,11 @@ public interface RoleService extends CommonBaseService<RoleMapper, Role> {
      * @return
      */
     List<RoleBaseDTO> findByAccountId(Long accountId);
+
+    /**
+     * 查找用户权限
+     * @param id
+     * @return
+     */
+    List<PowerDTO> getResourcePowerById(Long id);
 }

+ 97 - 5
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/RoleServiceImpl.java

@@ -1,15 +1,15 @@
 package com.usoftchina.saas.account.service.impl;
 
 import com.usoftchina.saas.account.constant.RoleType;
+import com.usoftchina.saas.account.dto.OtherPowerDTO;
+import com.usoftchina.saas.account.dto.PowerDTO;
 import com.usoftchina.saas.account.dto.RoleBaseDTO;
-import com.usoftchina.saas.account.mapper.AccountRoleMapper;
-import com.usoftchina.saas.account.mapper.RoleMapper;
-import com.usoftchina.saas.account.mapper.RoleResourceMapper;
-import com.usoftchina.saas.account.po.Resource;
-import com.usoftchina.saas.account.po.Role;
+import com.usoftchina.saas.account.mapper.*;
+import com.usoftchina.saas.account.po.*;
 import com.usoftchina.saas.account.service.ResourceService;
 import com.usoftchina.saas.account.service.RoleService;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.utils.BeanMapper;
 import com.usoftchina.saas.utils.CollectionUtils;
 import com.usoftchina.saas.utils.StringUtils;
@@ -18,7 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author yingp
@@ -38,6 +40,15 @@ public class RoleServiceImpl extends CommonBaseServiceImpl<RoleMapper, Role> imp
     @Autowired
     private ResourceService resourceService;
 
+    @Autowired
+    private ResourceModuleMapper resourceModuleMapper;
+
+    @Autowired
+    private ResourceGroupMapper resourceGroupMapper;
+
+    @Autowired
+    private ResourceMapper resourceMapper;
+
     @Override
     public boolean save(Role role) {
         if (StringUtils.isEmpty(role.getCode())) {
@@ -78,4 +89,85 @@ public class RoleServiceImpl extends CommonBaseServiceImpl<RoleMapper, Role> imp
         }
         return null;
     }
+
+    @Override
+    public List<PowerDTO> getResourcePowerById(Long id) {
+        List<PowerDTO> powerDTOList = new ArrayList<PowerDTO>();
+        List<Map<String, Object>> classifyList = roleResourceMapper.selectClassifyByRoleId(id);
+        List<OtherPower> otherPowerList = roleResourceMapper.selectOthersPower(id);
+        //查询所有模块
+        List<ResourceModule> modules = resourceModuleMapper.selectByAppId(BaseContextHolder.getAppId());
+        for (ResourceModule module : modules){
+            //查询所有分组
+            List<ResourceGroup> groups = resourceGroupMapper.selectByModuleId(module.getId());
+            for (ResourceGroup group : groups) {
+                PowerDTO powerDTO = new PowerDTO();
+                powerDTO.setGroupId(group.getId());
+                powerDTO.setModuleName(module.getName());
+                powerDTO.setGroupName(group.getName());
+                //赋值权限
+                for (Map<String, Object> map : classifyList){
+                    if (group.getId().equals(map.get("group_id"))){
+                        String classify = String.valueOf(map.get("classify"));
+                        setPowerValue(powerDTO, classify);
+                        if (classify.contains("OTHER")){
+                            setOtherPower(powerDTO, group.getId(), otherPowerList);
+                        }
+                    }
+                }
+                powerDTOList.add(powerDTO);
+            }
+        }
+        return powerDTOList;
+    }
+
+    private void setOtherPower(PowerDTO powerDTO, Long groupId, List<OtherPower> otherPowerList) {
+        List<OtherPower> otherPowers = new ArrayList<OtherPower>();
+        for (OtherPower otherPower : otherPowerList){
+            if (otherPower.getGroupId().equals(groupId)){
+                otherPowers.add(otherPower);
+            }
+        }
+        List<OtherPowerDTO> otherPowerDTOList = BeanMapper.mapList(otherPowers, OtherPowerDTO.class);
+        powerDTO.setOther(otherPowerDTOList);
+    }
+
+    private void setPowerValue(PowerDTO powerDTO, String classify) {
+        String[] array = classify.split(",");
+        for(int i = 0; i < array.length; i++){
+            switch (array[i]){
+                case "QUERY":
+                    powerDTO.setQuery(true);
+                    break;
+                case "ADD":
+                    powerDTO.setAdd(true);
+                    break;
+                case "UPDATE":
+                    powerDTO.setUpdate(true);
+                    break;
+                case "AUDIT":
+                    powerDTO.setAudit(true);
+                    break;
+                case "UNAUDIT":
+                    powerDTO.setUnAudit(true);
+                    break;
+                case "DELETE":
+                    powerDTO.setDelete(true);
+                    break;
+                case "PRINT":
+                    powerDTO.setPrint(true);
+                    break;
+                case "EXPORT":
+                    powerDTO.setFileExport(true);
+                    break;
+                case "IMPORT":
+                    powerDTO.setFileImport(true);
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+
+
 }

+ 3 - 0
base-servers/account/account-server/src/main/resources/mapper/ResourceMapper.xml

@@ -29,4 +29,7 @@
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
         select <include refid="baseColumns"/> from ac_resource where id=#{id,jdbcType=BIGINT}
     </select>
+    <select id="selectClassifyByGroupId" parameterType="java.lang.Long" resultType="string">
+        SELECT DISTINCT CLASSIFY FROM AC_RESOURCE WHERE ID=#{id,jdbcType=BIGINT}
+    </select>
 </mapper>

+ 18 - 0
base-servers/account/account-server/src/main/resources/mapper/RoleResourceMapper.xml

@@ -24,4 +24,22 @@
         where ac_account_role.role_id=ac_role_resource.role_id
         and ac_account_role.account_id=#{accountId,jdbcType=BIGINT}
     </select>
+    <select id="selectClassifyByRoleId" parameterType="java.lang.Long" resultType="java.util.HashMap">
+        SELECT GROUP_CONCAT(classify) classify,group_id FROM (
+          SELECT classify,group_id FROM AC_RESOURCE
+          WHERE ID IN (SELECT RESOURCE_ID FROM AC_ROLE_RESOURCE WHERE ROLE_ID=#{id})
+          GROUP BY GROUP_ID,CLASSIFY) A
+        GROUP BY GROUP_ID
+    </select>
+    <resultMap id="OtherPowerResultMap" type="com.usoftchina.saas.account.po.OtherPower">
+        <result column="name" property="name" jdbcType="VARCHAR" />
+        <result column="id" property="resourceId" jdbcType="BIGINT" />
+        <result column="group_id" property="groupId" jdbcType="BIGINT" />
+        <result column="checked" property="checked" jdbcType="BOOLEAN" />
+    </resultMap>
+    <select id="selectOthersPower" resultMap="OtherPowerResultMap">
+      SELECT name,id,group_id,CASE WHEN ROLE_ID IS NULL THEN false ELSE true end checked FROM AC_RESOURCE
+      LEFT JOIN ac_role_resource ON ID = RESOURCE_ID
+      WHERE CLASSIFY='OTHER' AND ROLE_ID=#{roleId}
+    </select>
 </mapper>

+ 1 - 0
base-servers/auth/auth-client/src/main/java/com/usoftchina/saas/auth/client/interceptor/AuthRestInterceptor.java

@@ -42,6 +42,7 @@ public class AuthRestInterceptor extends HandlerInterceptorAdapter {
                 JwtInfo infoFromToken = JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
                 BaseContextHolder.setAppId(infoFromToken.getAppId());
                 BaseContextHolder.setUserId(infoFromToken.getUserId());
+                BaseContextHolder.setUserName(infoFromToken.getUserName());
                 BaseContextHolder.setCompanyId(infoFromToken.getCompanyId());
                 BaseContextHolder.setToken(token);
                 log.info("request={} token={} \\r\\n userName={}", request.getRequestURI(),

+ 1 - 0
base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java

@@ -49,6 +49,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
                 BaseContextHolder.setAppId(jwt.getAppId());
                 BaseContextHolder.setUserId(jwt.getUserId());
                 BaseContextHolder.setCompanyId(jwt.getCompanyId());
+                BaseContextHolder.setUserName(jwt.getUserName());
                 BaseContextHolder.setToken(token);
                 AccountDTO accountDTO = AccountCache.current().getAccount();
                 if (null == accountDTO) {

+ 5 - 1
framework/core/src/main/java/com/usoftchina/saas/constant/CommonConstants.java

@@ -20,7 +20,11 @@ public class CommonConstants {
      */
     public static final String CONTEXT_KEY_APP_ID = "currentAppId";
     /***
-     * ThreadLocal中的登录用户Id key
+     * ThreadLocal中的登录用户token key
      */
     public static final String CONTEXT_KEY_TOKEN = "currentToken";
+    /**
+     * threadLocal中的登录用户name key
+     */
+    public static final String CONTEXT_KEY_USER_NAME = "currentUserName";
 }

+ 9 - 0
framework/core/src/main/java/com/usoftchina/saas/context/BaseContextHolder.java

@@ -67,6 +67,15 @@ public class BaseContextHolder {
         set(CommonConstants.CONTEXT_KEY_TOKEN, token);
     }
 
+    public static String getUserName(){
+        Object value = get(CommonConstants.CONTEXT_KEY_USER_NAME);
+        return ObjectUtils.getStringValue(value);
+    }
+
+    public static void setUserName(String userName){
+        set(CommonConstants.CONTEXT_KEY_USER_NAME, userName);
+    }
+
     public static void remove() {
         threadLocal.remove();
     }

+ 4 - 0
frontend/saas-web/app/util/FormUtil.js

@@ -50,6 +50,7 @@ Ext.define('saas.util.FormUtil', {
                         
                         if(item.xtype == 'datefield') {
                             Ext.applyIf(item, {
+                                editable: false,
                                 format: 'Y-m-d'
                             });
                         }
@@ -122,6 +123,9 @@ Ext.define('saas.util.FormUtil', {
                                         Ext.apply(editor, {
                                             format: 'Y-m-d'
                                         });
+                                        Ext.applyIf(editor, {
+                                            editable: false
+                                        });
                                     }
                                 }
                             });

+ 1 - 1
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -17,7 +17,7 @@ Ext.define('saas.view.core.query.QueryPanel', {
         xtype: 'core-query-queryformpanel',
         width: '100%',
     }, {
-        margin: '32 0 0 0',
+        margin: '24 0 0 0',
         padding: '24',
         reference: 'querygrid',
         xtype: 'core-query-querygridpanel',

+ 3 - 3
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -13,7 +13,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     layout: 'vbox',
     autoScroll: true,
-    border: 1,
+    bodyBorder:false,
     bodyPadding: 5,
 
     groupField: null, // 分组字段
@@ -49,7 +49,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                         style: {
                             float: 'right'
                         },
-                        text: '导出为...',
+                        text: '导出',
                         menu: {
                             defaults: {
                                 handler: 'exportTo'
@@ -112,7 +112,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 width: '100%',
                 cls: 'x-report-grid',
                 flex: 1,
-                border: 1,
+                border: 0,
                 sortableColumns: false,
                 enableColumnHide: false,
                 rowLines: false,

+ 6 - 0
frontend/saas-web/app/view/core/report/ReportPanel.scss

@@ -34,6 +34,12 @@
                 border-color: #999 !important;
                 border-width: 1px !important;
             }
+            .x-panel-default-outer-border-rl {
+                border-right-color: #999 !important;
+                border-right-width: 1px !important;
+                border-left-color:  #999 !important;
+                border-left-width: 1px !important;
+            }
         }
     }
 }

+ 9 - 9
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -8,17 +8,17 @@ Ext.define('saas.view.document.bom.BasePanel', {
     searchField:[{ 
         xtype : "textfield", 
         name : "bo_mothercode", 
-        emptyText : "母件编号", 
+        emptyText : "产品编号", 
         width:120
     },{
         xtype : "textfield", 
         name : "bo_mothername", 
-        emptyText : "母件名称", 
+        emptyText : "产品名称", 
         width:120
     },{
         xtype : "textfield", 
         name : "bo_status", 
-        emptyText : "BOM状态",    
+        emptyText : "产品状态",    
         width:100
     }],
 
@@ -42,32 +42,32 @@ Ext.define('saas.view.document.bom.BasePanel', {
             dataIndex : "id", 
             xtype : "numbercolumn",   
         },{
-            text : "母件id", 
+            text : "产品id", 
             width : 0, 
             dataIndex : "bo_motherid", 
             xtype : "numbercolumn",   
         },{
-            text : "母件编号", 
+            text : "产品编号", 
             dataIndex : "bo_mothercode",
             width : 200.0,
         }, 
         {
-            text : "母件名称", 
+            text : "产品名称", 
             dataIndex : "bo_mothername", 
             width : 120.0, 
         }, 
         {
-            text : "BOM状态", 
+            text : "产品状态", 
             dataIndex : "bo_status", 
             width : 120.0, 
         }, 
         {
-            text : "BOM状态码", 
+            text : "产品状态码", 
             dataIndex : "bo_statuscode", 
             width : 0, 
         },
         {   
-            text : "BOM版本", 
+            text : "产品版本", 
             dataIndex : "bo_version", 
             width : 120.0, 
         }]

+ 12 - 11
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -63,6 +63,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
         xtype: 'textfield',
         name: 'bo_mothername',
         fieldLabel: '产品名称',
+        reddOnly:true,
         allowBlank: false
     },{
         xtype: 'textfield',
@@ -73,7 +74,9 @@ Ext.define('saas.view.document.bom.FormPanel', {
     },{
         xtype: 'textfield',
         name: 'bo_status',
-        fieldLabel: '产品状态'
+        fieldLabel: '产品状态',
+        reddOnly:true
+
     },{
         xtype: 'hidden',
         name: 'bo_statuscode',
@@ -105,6 +108,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
                 allowBlank:false,
                 text : "物料编号", 
                 dataIndex : "bd_soncode", 
+                width : 160, 
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -148,11 +152,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
                     return v;
                 }
             }, {
-                allowBlank:false,
                 text : "单位", 
-                editor : {
-                    xtype : "textfield"
-                },
                 dataIndex : "bd_unit", 
             },
             {
@@ -195,14 +195,15 @@ Ext.define('saas.view.document.bom.FormPanel', {
                     xtype : "textfield"
                 },
             }]
-    },{
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "创建时间"
     },{  
+        xtype : "textfield", 
+        name : "bo_recorder", 
+        reddOnly:true,
+        fieldLabel : "录入人"
+    },{
         xtype : "datefield", 
-        name : "updateTime", 
-        fieldLabel : "更新时间"
+        name : "bo_recorddate", 
+        fieldLabel : "录入时间"
     }],
 
     auditTexts: {

+ 1 - 0
frontend/saas-web/app/view/main/Navigation.js

@@ -115,6 +115,7 @@ Ext.define('saas.view.main.Navigation', {
                         menu.updateLayout();
 
                         view.el.dom.addEventListener('mouseenter', function (e) {
+                            menu.show();
                             menu.navItem.classList.add(menu.navView.overItemCls);
                         });
 

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

@@ -183,7 +183,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
         readOnly:true
     }, {
         xtype : "datefield", 
-        name : "ft_date",
+        name : "ft_recorddate",
         fieldLabel : "录入日期",
         readOnly:true
     }

+ 8 - 2
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -53,6 +53,10 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
          fieldLabel : "账户名称",
          allowBlank : false
      }, {
+        xtype:'datefield',
+        name : 'or_date',
+        fieldLabel : '单据日期'
+    },{
         name : "detailGridField", 
         xtype : "detailGridField", 
         storeModel:'saas.model.money.Othreceipts',
@@ -69,8 +73,10 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 text : "期间",
                 dataIndex : "ord_ym",
                 editor : {
-                    xtype : "numberfield"
+                    xtype : "numberfield",
+                    readOnly: true
                 },
+                // defaultValue: Ext.Date.format(new Date(), 'Ym'),
                 width : 120.0,
                 hidden: true,
                 items : null
@@ -148,7 +154,7 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
         readOnly:true
     }, {
         xtype : "datefield", 
-        name : "or_date", 
+        name : "or_recorddate",
         fieldLabel : "录入日期",
         readOnly:true
     }

+ 6 - 3
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -73,8 +73,10 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 text : "期间", 
                 dataIndex : "osd_ym", 
                 editor : {
-                    xtype : "numberfield"
+                    xtype : "numberfield",
+                    readOnly:true
                 },
+                // defaultValue: Ext.Date.format(new Date(), 'Ym'),
                 width : 120.0, 
                 hidden: true,
                 items : null
@@ -137,7 +139,8 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
     },{
         xtype : 'numberfield',
         name : 'os_amount',
-        fieldLabel : '付款金额'
+        fieldLabel : '付款金额',
+        readOnly:true
     },{
         xtype : "textfield", 
         name : "os_remark", 
@@ -151,7 +154,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
         readOnly:true
     }, {
         xtype : "datefield", 
-        name : "os_date", 
+        name : "os_recorddate",
         fieldLabel : "录入日期",
         readOnly:true
     }

+ 9 - 18
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -58,15 +58,16 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         xtype:"numberfield",
         name:"ve_leftamount",
         fieldLabel:"总欠款",
-        ignore:true
+        ignore:true,
+        readOnly: true
     },{
         xtype: "datefield",
         name: "pb_date",
         fieldLabel: "日期"
     },{
-        xtype: 'hidden',
+        xtype: 'textfield',
         name: 'pb_manname',
-        fieldLabel: '款人'
+        fieldLabel: '款人'
     }, {
         xtype: 'hidden',
         name: 'pb_pdamount',
@@ -78,7 +79,8 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
     }, {
         xtype: "numberfield",
         name: "pb_preamount",
-        fieldLabel: "本次预付款"
+        fieldLabel: "本次预付款",
+        readOnly: true
     }, {
         xtype: 'numberfield',
         name: 'pb_discounts',
@@ -206,23 +208,11 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             }
         }, {
             text: "业务类型",
-            dataIndex: "pbd_slkind",
-            editor : {
-                xtype:'combo',
-                queryMode: 'local',
-                displayField: 'display',
-                valueField: 'value',
-                store:Ext.create('Ext.data.Store', {
-                    fields: ['value', 'display'],
-                    data : [{value:"应付", display:"应付"},
-                        {value:"应收", display:"应收"}]
-                })
-            }
+            dataIndex: "pbd_slkind"
         }, {
             text: "单据日期",
             dataIndex: "pbd_sldate",
-            xtype: 'datecolumn',
-            defaultValue: new Date()
+            xtype: 'datecolumn'
         }, {
             text: "单据金额",
             dataIndex: "pbd_amount",
@@ -290,6 +280,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
                 xtype : "numberfield",
                 decimalPrecision: 2
             },
+            allowBlank : false,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length)).fill('0');

+ 17 - 0
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -109,6 +109,12 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                         },{
                             from: 'sl_namount',
                             to: 'pb_pbdamount'
+                        },{
+                            from:'sl_date',
+                            to:'pbd_sldate'
+                        },{
+                            from:'sl_kind',
+                            to:'pbd_slkind'
                         }],
                         dbtpls: [{
                             field: 'sl_code',
@@ -136,6 +142,11 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                             "flex": 1,
                             "dataIndex": "sl_code",
                             "width": 100
+                        },{
+                            "text": "源单类型",
+                            "flex": 1,
+                            "dataIndex": "sl_kind",
+                            "width": 100
                         }, {
                             "text": "单据金额",
                             "flex": 1,
@@ -155,6 +166,12 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                             "dataIndex": "sl_namount",
                             "width": 100,
                             align:'right'
+                        },{
+                            "text": "单据日期",
+                            "flex": 1,
+                            "dataIndex": "sl_date",
+                            "width": 100,
+                            align:'right'
                         }]
                     });
 

+ 18 - 2
frontend/saas-web/app/view/money/payBalance/QueryPanel.js

@@ -10,7 +10,23 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
     queryFormItems: [{
         xtype: 'textfield',
         name: 'pb_code',
-        fieldLabel: '单据编号'
+        fieldLabel: '单据编号',
+        columnWidth: 0.2
+    },{
+        xtype: 'condatefield',
+        name: 'pb_date',
+        fieldLabel: '日期',
+        columnWidth: 0.5,
+        operation: 'between'
+    },{
+        xtype: 'multicombo',
+        name: 'pb_status',
+        fieldLabel: '审核状态',
+        columnWidth: 0.2,
+        datas: [
+            ["已审核", "已审核"],
+            ["未审核", "未审核"]
+        ]
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
@@ -20,7 +36,7 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
         addXtype: 'money-paybalance-formpanel',
         defaultCondition:'1=1',
         baseVastUrl: '/api/money/paybalance/',
-        // baseVastUrl: 'http://127.0.0.1:8880/paybalance/',
+        // baseVastUrl: 'http://192.168.253.129:8881/paybalance/',
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',

+ 14 - 6
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -21,6 +21,10 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
     _auditUrl: '/api/money/recbalance/audit/',
     _unAuditUrl: '/api/money/recbalance/unAudit/',
     _deleteUrl: '/api/money/recbalance/delete/',
+
+    // _saveUrl: 'http://192.168.253.35:8880/recbalance/save/',
+
+
     initId: 0,
 
     defaultItems: [{
@@ -49,7 +53,8 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
     }, {
         xtype: "numberfield",
         name: "rb_rdamount",
-        fieldLabel: "总欠款"
+        fieldLabel: "总欠款",
+        readOnly: true
     }, {
         xtype: 'hidden',
         name: 'rb_rbdamount',
@@ -59,7 +64,7 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         name: "rb_date",
         fieldLabel: "日期"
     }, {
-        xtype: "hidden",
+        xtype: "textfield",
         name: "rb_manname",
         fieldLabel: "收款人"
     }, {
@@ -68,13 +73,14 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         fieldLabel: '备注',
         columnWidth: 1
     }, {
-        xtype: "hidden",
+        xtype: "numberfield",
         name: "rb_discounts",
         fieldLabel: "整单折扣"
     }, {
-        xtype: 'hidden',
+        xtype: 'numberfield',
         name: 'rb_preamount',
-        fieldLabel : '本次预收款'
+        fieldLabel : '本次预收款',
+        readOnly: true
     }, {
         xtype: 'hidden',
         name: 'rb_havebalance',
@@ -213,7 +219,8 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
             dataIndex: "rbd_slkind"
         }, {
             text: "单据日期",
-            dataIndex: "rbd_sldate"
+            dataIndex: "rbd_sldate",
+            xtype: 'datecolumn'
         }, {
             text: "单据金额",
             dataIndex: "rbd_amount",
@@ -269,6 +276,7 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 xtype : "numberfield",
                 decimalPrecision: 2
             },
+            allowBlank : false,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length)).fill('0');

+ 17 - 0
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -181,6 +181,12 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                         },{
                             from: 'sl_namount',
                             to: 'rbd_pbdamount'
+                        },{
+                            from:'sl_date',
+                            to:'rbd_sldate'
+                        },{
+                            from:'sl_kind',
+                            to:'rbd_slkind'
                         }],
                         dbtpls: [{
                             field: 'sl_code',
@@ -209,6 +215,11 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             "dataIndex": "sl_code",
                             "width": 100
                         }, {
+                            "text": "源单类型",
+                            "flex": 1,
+                            "dataIndex": "sl_kind",
+                            "width": 100
+                        },{
                             "text": "单据金额",
                             "flex": 1,
                             "dataIndex": "sl_orderamount",
@@ -227,6 +238,12 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
                             "dataIndex": "sl_namount",
                             "width": 100,
                             align:'right'
+                        },{
+                            "text": "单据日期",
+                            "flex": 1,
+                            "dataIndex": "sl_date",
+                            "width": 100,
+                            align:'right'
                         }]
                     });
 

+ 9 - 0
frontend/saas-web/app/view/money/recBalance/QueryPanel.js

@@ -25,6 +25,15 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
         fieldLabel: '日期',
         columnWidth: 0.5,
         operation: 'between'
+    },{
+        xtype: 'multicombo',
+        name: 'rb_status',
+        fieldLabel: '审核状态',
+        columnWidth: 0.2,
+        datas: [
+            ["已审核", "已审核"],
+            ["未审核", "未审核"]
+        ]
     }],
     moreQueryFormItems: [],
     queryGridConfig: {

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

@@ -20,7 +20,7 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         columnWidth: 0.25
     }, {
         xtype: 'condatefield',
-        name: 'pu_date',
+        name: 'pb_recorddate',
         fieldLabel: '单据日期',
         columnWidth: 0.5
     }],

+ 20 - 91
frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

@@ -21,32 +21,18 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
     _auditUrl:'/api/storage/prodinout/audit',
     _unAuditUrl: '/api/storage/prodinout/unAudit/',
     _deleteUrl:'/api/storage/prodinout/delete/',
-
-
-    // _relationColumn: 'pd_piid',
-    // _readUrl:'http://localhost:9000/prodinout/read/',
-    // _saveUrl:'http://localhost:9000/prodinout/save',
-    // _auditUrl:'http://localhost:9000/prodinout/audit',
-    // _deleteUrl:'http://localhost:9000/prodinout/delete/',
-
-
-
-
     initId:0,
 
     toolBtns: [],
-
     defaultItems: [{
         xtype: 'hidden',
         name: 'id',
-        bind: '{id}',
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
     },{
         xtype : "textfield", 
         name : "pi_class", 
-        bind : "{pi_class}", 
         fieldLabel : "单据类型", 
         readOnly:true,
         allowBlank : true, 
@@ -54,61 +40,42 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
     }, {
         xtype : "hidden", 
         name : "pi_vendid", 
-        bind : "{pi_vendid}", 
         fieldLabel : "供应商ID", 
         allowBlank : true, 
         columnWidth : 0.0
     },{
         xtype: 'hidden',
         name: 'pi_vendcode',
-        bind: '{pi_vendcode}',
         fieldLabel: '供应商编号'
     }, {
         xtype: 'dbfindtrigger',
         name: 'pi_vendname',
-        bind: '{pi_vendname}',
         fieldLabel: '供应商名称'
     },{
         xtype : "hidden", 
         name : "pi_custid", 
-        bind : "{pi_custid}", 
         fieldLabel : "客户ID", 
         allowBlank : true, 
         columnWidth : 0.0
     },{
         xtype: 'hidden',
         name: 'pi_custcode',
-        bind: '{pi_custcode}',
         fieldLabel: '客户编号'
     }, {
         xtype: 'dbfindtrigger',
         name: 'pi_custname',
-        bind: '{pi_custname}',
         fieldLabel: '客户名称'
     },{
         xtype : "datefield", 
         name : "pi_date", 
-        bind : "{pi_date}", 
         fieldLabel : "单据日期", 
         allowBlank : false, 
         columnWidth : 0.25,
         defaultValue: new Date()
-    }
-    // ,{
-    //     xtype : "textfield", 
-    //     name : "pi_total", 
-    //     bind : "{pi_total}", 
-    //     fieldLabel : "总额", 
-    //     allowBlank : true,
-    //     readOnly: true,
-    //     columnWidth : 0.25
-    // }
-    ,
-     {
+    }, {
         name : "detailGridField", 
         xtype : "detailGridField",
         storeModel:'saas.model.purchase.ProdIODetail',
-        // deleteDetailUrl:'http://localhost:9000/prodinout/deleteDetail/',
         deleteDetailUrl:'/api/storage/prodinout/deleteDetail/',
         detnoColumn:  'pd_pdno',
         columns : [
@@ -254,69 +221,31 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
                     xtype : "dbfindtrigger"
                 }
             }
-        //     ,
-        //     {
-        //         text : "单价", 
-        //         dataIndex : "pd_orderprice",
-        //         editor : {
-        //             xtype : "numberfield"
-        //         },   
-        //         width : 120.0, 
-        //         xtype : "numbercolumn", 
-        //         items : null
-        //     }, 
-        //    {
-        //         text : "含税金额", 
-        //         dataIndex : "pd_total", 
-        //         width : 120.0, 
-        //         xtype : "numbercolumn"
-        //     }, {
-        //         text : "税率", 
-        //         dataIndex : "pd_taxrate",
-        //         editor : {
-        //             xtype : "numberfield"
-        //         },   
-        //         width : 120.0, 
-        //         xtype : "numbercolumn", 
-        //         items : null
-        //     },
-        //     {
-        //         text : "未税金额", 
-        //         dataIndex : "pd_nettotal", 
-        //         xtype : "numbercolumn"
-        //     }
         ]
     }, {
-        xtype : "datefield", 
-        name : "createTime", 
-        bind : "{createTime}", 
-        fieldLabel : "录入日期", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        xtype : "textfield", 
+        name : "pi_remark", 
+        fieldLabel : "备注", 
+        columnWidth : 0.75
+    }, {
+        xtype : "textfield", 
+        name : "pi_recordman", 
+        fieldLabel : "录入人", 
+        readOnly:true
     }, {
         xtype : "datefield", 
-        name : "updateTime", 
-        bind : "{updateTime}", 
-        fieldLabel : "更新日期", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        name : "pi_recorddate", 
+        fieldLabel : "录入日期",
+        readOnly:true
     }, {
         xtype : "textfield", 
-        readOnly : true, 
-        editable : false, 
-        name : "pi_status", 
-        bind : "{pi_status}", 
-        fieldLabel : "单据状态", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        name : "pi_auditman", 
+        fieldLabel : "审核人", 
+        readOnly:true
     }, {
-        xtype : "hidden", 
-        readOnly : true, 
-        editable : false, 
-        name : "pi_statuscode", 
-        bind : "{pi_statuscode}", 
-        fieldLabel : "单据状态码", 
-        allowBlank : true, 
-        columnWidth : 0.0
+        xtype : "datefield", 
+        name : "pi_auditdate", 
+        fieldLabel : "审核日期",
+        readOnly:true
     }]
 });

+ 1 - 29
frontend/saas-web/app/view/stock/appropriationInOut/QueryPanel.js

@@ -10,28 +10,24 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
     queryFormItems: [{
         xtype: 'hidden',
         name: 'id',
-        bind: '{id}',
         fieldLabel: 'ID',
         allowBlank: true,
         columnWidth: 0
     }, {
         xtype: 'textfield',
         name: 'pi_inoutno',
-        bind: '{pi_inoutno}',
         fieldLabel: '单据编号',
         allowBlank: true,
         columnWidth: 0.25
     }, {
         xtype: 'condatefield',
         name: 'pi_date',
-        bind: '{pi_date}',
         fieldLabel: '单据日期',
         allowBlank: true,
         columnWidth: 0.5
     }, {
         xtype: 'textfield',
         name: 'pi_vendcode',
-        bind: '{pi_vendcode}',
         fieldLabel: '供应商编号',
         allowBlank: true,
         hidden:true,
@@ -39,26 +35,22 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pi_vendname',
-        bind: '{pi_vendname}',
         fieldLabel: '供应商名称',
         allowBlank: true,
         columnWidth: 0.25
     }, {
         xtype: 'dbfindtrigger',
         name: 'pd_prodcode',
-        bind: '{pd_prodcode}',
         fieldLabel: '物料编号',
         showDetail: true
     }, {
         xtype: 'textfield',
         name: 'pr_detail',
-        bind: '{pr_detail}',
         fieldLabel: '物料名称',
         showDetail: true
     }, {
         xtype: 'combobox',
         name: 'pi_statuscode',
-        bind: '{pi_statuscode}',
         fieldLabel: '审核状态',
         allowBlank: true,
         columnWidth: 0.25,
@@ -81,26 +73,7 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
             }
         }
     }],
-    moreQueryFormItems: [{
-        xtype: 'textfield',
-        name: 'pu_buyername',
-        bind: '{pu_buyername}',
-        fieldLabel: '采购员',
-        allowBlank: true
-    }, {
-        xtype: 'textfield',
-        name: 'pu_total',
-        bind: '{pu_total}',
-        fieldLabel: '金额',
-        allowBlank: true
-    }, {
-        xtype: 'condatefield',
-        name: 'pu_delivery',
-        bind: '{pu_delivery}',
-        fieldLabel: '交货日期',
-        allowBlank: true,
-        columnWidth: 1
-    }],
+    moreQueryFormItems: [],
     queryGridConfig: {
         idField:'id',
         codeField:'pi_inoutno',
@@ -108,7 +81,6 @@ Ext.define('saas.view.stock.appropriationInOut.QueryPanel', {
         addXtype:'stock-appropriationinout-formpanel',
         defaultCondition:' pi_class = \'调拨单\'',
         baseVastUrl:'/api/storage/prodinout/',
-        // baseVastUrl:"http://localhost:9000/prodinout/",
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',

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

@@ -499,13 +499,12 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                         mm_prodidid:item.bd_sonid,
                         mm_prodcode:item.bd_soncode,
                         mm_oneuseqty:item.bd_baseqty,
-                        pr_detail:'',
-                        pr_spec:'',
-                        pr_unit:''
+                        pr_detail:item.productDTO.pr_detail,
+                        pr_spec:item.productDTO.pr_spec,
+                        pr_unit:item.productDTO.pr_unit
                     })                
                 });
-                store.loadData(loadData)
-        
+                store.loadData(loadData);
             }
         })
         .catch(function(res) {

+ 105 - 0
frontend/saas-web/app/view/stock/report/ProdinoutCount.js

@@ -0,0 +1,105 @@
+Ext.define('saas.view.stock.report.ProdinoutCount', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'stock-report-prodinoutCount',
+
+    controller: 'stock-report-prodinoutCount',
+    viewModel: 'stock-report-prodinoutCount',
+
+    viewName: 'stock-report-prodinoutCount',
+    //按物料分组
+    groupField: null,
+    listUrl: '/api/stock/report/prodinoutCount',
+    defaultCondition: null,
+    reportTitle: '物料收发汇总表',
+    QueryWidth:0.25,
+    //筛选:仓库、物料、物料类型、时间			
+    searchItems: [{		
+        xtype: 'dbfindtrigger',
+        name: 'pd_whcode',
+        fieldLabel: '仓库编号',
+        columnWidth: 0.25
+    }, {		
+        xtype: 'dbfindtrigger',
+        name: 'pd_prodcode',
+        fieldLabel: '物料编号',
+        columnWidth: 0.25
+    }, {		
+        xtype: 'remotecombo',
+        editable:false,
+        name: 'pd_prodcode',
+        fieldLabel: '物料类型',
+        columnWidth: 0.25,
+        storeUrl:'/api/document/producttype/getCombo',
+        addHandler:function(b){
+            var document = Ext.create('saas.view.document.kind.Kind',{});
+            var form = this.ownerCmp.ownerCt;
+            this.dialog = form.getController().getView().add({
+                xtype: 'document-kind-childwin',
+                bind: {
+                    title: '新增物料类型'
+                },
+                dataKind:'productkind',
+                belong:document.etc['productkind'],
+                _parent:form,
+                _combo:this.ownerCmp,
+                record:null,
+                session: true
+            });
+            this.dialog.show();
+        }
+    }, {
+        xtype: 'condatefield',
+        name: 'pi_date',
+        fieldLabel: '单据日期',
+        columnWidth: 0.5
+    }],
+    reportColumns: [{
+        text: '物料类型',
+        dataIndex: 'pr_kind'
+    }, {
+        text: '物料编号',
+        dataIndex: 'pr_code',
+        width: 200
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec'
+    }, {
+        text: '单位',
+        dataIndex: 'pr_unit'
+    }, {
+        text: '仓库',
+        dataIndex:'pd_whcode'
+    }, {
+        text: '期初',
+        columns: [{
+            text: '数量'
+        },{
+            text: '成本'
+        }]
+    }, {
+        text: '入库合计',
+        columns: [{
+            text: '数量'
+        },{
+            text: '成本'
+        }]
+    }, {
+        text: '出库合计',
+        columns: [{
+            text: '数量'
+        },{
+            text: '成本'
+        }]
+    }, {
+        text: '结存',
+        columns: [{
+            text: '数量'
+        },{
+            text: '成本'
+        }]
+    }]
+});

+ 177 - 0
frontend/saas-web/app/view/stock/report/ProdinoutCountController.js

@@ -0,0 +1,177 @@
+Ext.define('saas.view.stock.report.ProdinoutCountController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'stock-report-prodinoutCount',
+    init: function (form) {
+        this.control({
+           //放大镜赋值关系 以及 tpl模板
+           'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/product/list',
+                        addXtype: 'document-product-formpanel',
+                        addTitle: '物料资料',
+                        dbfinds:[
+                        {
+                            from:'pr_code',to:'pd_prodcode'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
+                        }, {
+                            from:'pr_spec',to:'pr_spec'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        defaultCondition: "pr_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号、名称或规格',
+                            xtype : "textfield", 
+                            name : "search", 
+                            width: 200,
+                            getCondition: function(v) {
+                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                        }, {
+                            "text": "物料编号",       
+                            "dataIndex": "pr_code",
+                            "width": 200,
+                        }, {
+                            "text": "物料名称",
+                            "width": 200,
+                            "dataIndex": "pr_detail",
+                        }, {
+                            "text": "规格",
+                            "dataIndex": "pr_spec",
+                            "width": 100,
+                        }, {
+                            "text": "单位",
+                            "dataIndex": "pr_unit",
+                            "width": 100,
+                        },{
+                            "text": "仓库id",
+                            "dataIndex": "pr_whid",
+                            "hidden": true,
+                        },{
+                            "text": "仓库编号",
+                            "dataIndex": "pr_whcode",
+                            "hidden": true,
+                        },{
+                            "text": "仓库",
+                            "dataIndex": "pr_whname",
+                            "width": 200,
+                        },{
+                            "text": "总库存数",
+                            "dataIndex": "po_onhand",
+                            "width": 100,
+                            align:'right'
+                        },{
+                            "text": "类型",
+                            "dataIndex": "pr_kind",
+                            "width": 100,
+                        },{
+                            "text": "型号",
+                            "dataIndex": "pr_orispeccode",
+                            "width": 100,
+                        },{
+                            "text": "品牌",
+                            "dataIndex": "pr_brand",
+                            "width": 100,
+                        },{
+                            "text": "供应商",
+                            "dataIndex": "pr_vendname",
+                            "width": 100,
+                        },{
+                            "text": "最小包装",
+                            "dataIndex": "pr_zxbzs",
+                            "width": 100,
+                            align:'right'
+                        },{
+                            "text": "L/T",
+                            "dataIndex": "pr_leadtime",
+                            "width": 100,
+                        }]
+                    }) ;   
+
+                }
+            },
+            'dbfindtrigger[name=pd_whcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        conditionCode:'wh_code',
+                        dataUrl:'/api/document/warehouse/list',
+                        addXtype: 'other-storeinformation',
+                        addTitle: '仓库资料',
+                        dbfinds:[{
+                            from:'id',to:'id',ignore:true 
+                        }, { 
+                            from:'wh_code',to:'pd_whcode'
+                        }, {
+                            from:'wh_description',to:'wh_description'
+                        }],
+                        dbtpls:[{
+                            field:'wh_code',width:100
+                        },{
+                            field:'wh_description',width:100
+                        }],
+                        defaultCondition: "wh_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号、名称或规格',
+                            xtype : "textfield", 
+                            name : "search", 
+                            width: 200,
+                            getCondition: function(v) {
+                                return "(upper(wh_code) like '%" + v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[{
+                            "text": "仓库ID",
+                            "flex": 0,
+                            "dataIndex": "id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "仓库编号",
+                            "flex": 1,
+                            "dataIndex": "wh_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "仓库名称",
+                            "flex": 1,
+                            "dataIndex": "wh_description",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "仓库类型",
+                            "flex": 0,
+                            "dataIndex": "wh_type",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "仓库状态",
+                            "flex": 0,
+                            "dataIndex": "wh_status",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            }
+         });
+        }
+});

+ 4 - 0
frontend/saas-web/app/view/stock/report/ProdinoutCountModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.stock.report.ProdinoutCountModel', {
+    extend: 'saas.view.core.report.ReportPanelModel',
+    alias: 'stock-report-prodinoutCount'
+});

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

@@ -0,0 +1,138 @@
+Ext.define('saas.view.stock.report.Prodiodetail', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'stock-report-prodiodetail',
+
+    controller: 'stock-report-prodiodetail',
+    viewModel: 'stock-report-prodiodetail',
+
+    viewName: 'stock-report-prodiodetail',
+  //  按物料分组
+    groupField: 'pd_prodcode',
+    listUrl: '/api/stock/report/prodiodetail',
+    defaultCondition: null,
+    reportTitle: '物料出入库明细表',
+    QueryWidth:0.25,
+    //筛选:单据类型、物料、日期
+    searchItems: [{
+        xtype: 'multicombo',
+        name: 'pi_class',
+        fieldLabel: '单据类型',
+        allowBlank: true,
+        columnWidth: 0.25,
+        datas: [
+            ["采购验收单", "采购验收单"],
+            ["采购验退单", "采购验退单"],
+            ["出货单", "出货单"],
+            ["销售退货单", "销售退货单"],
+            ["完工入库单", "完工入库单"],
+            ["生产领料单", "生产领料单"],
+            ["其它入库单", "其它入库单"],
+            ["其它出库单", "其它出库单"],
+            ["调拨单", "调拨单"],
+            ["库存初始化","库存初始化"]
+        ]
+    }, {		
+        xtype: 'dbfindtrigger',
+        name: 'pd_prodcode',
+        fieldLabel: '物料编号',
+        columnWidth: 0.25
+    }, {
+        xtype: 'condatefield',
+        name: 'pi_date',
+        fieldLabel: '单据日期',
+        columnWidth: 0.5
+    }],
+  //  单号	单据类型	客户/供应商编号	客户/供应商名称	单据日期	序号	
+  //物料类型	物料编号	物料名称	物料规格	单位	入库数量	出库数量	成本单价	备注
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'id',
+        hidden: true
+    }, {
+        text: '单号',
+        dataIndex: 'pi_inoutno',
+        width: 200
+    }, {
+        text: '单据类型',
+        dataIndex: 'pi_class',
+        width: 200
+    }, {
+        text: '客户/供应商编号',
+        dataIndex: 'bizcode',
+        width: 200
+    }, {
+        text: '客户/供应商名称',
+        dataIndex: 'bizname',
+        width: 200
+    }, {
+        text: '日期',
+        dataIndex: 'pi_date',
+        xtype: 'datecolumn'
+    }, {
+        text: '序号',
+        dataIndex: 'pd_pdno'
+    }, {
+        text: '物料类型',
+        dataIndex: 'pr_kind'
+    }, {
+        text: '物料编号',
+        dataIndex: 'pd_prodcode',
+        width: 200
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec'
+    }, {
+        text: '单位',
+        dataIndex: 'pd_unit'
+    }, {
+        text: '入库数量',
+        dataIndex: 'inqty',
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '出库数量',
+        dataIndex: 'outqty',
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '成本单价',
+        dataIndex: 'pd_price',
+        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: '备注',
+        dataIndex: 'pd_remark',
+        width: 250
+    }]
+
+});

+ 107 - 0
frontend/saas-web/app/view/stock/report/ProdiodetailController.js

@@ -0,0 +1,107 @@
+Ext.define('saas.view.stock.report.ProdiodetailController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'stock-report-prodiodetail',
+    init: function (form) {
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/product/list',
+                        addXtype: 'document-product-formpanel',
+                        addTitle: '物料资料',
+                        dbfinds:[
+                        {
+                            from:'pr_code',to:'pd_prodcode'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
+                        }, {
+                            from:'pr_spec',to:'pr_spec'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        defaultCondition: "pr_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号、名称或规格',
+                            xtype : "textfield", 
+                            name : "search", 
+                            width: 200,
+                            getCondition: function(v) {
+                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                        }, {
+                            "text": "物料编号",       
+                            "dataIndex": "pr_code",
+                            "width": 200,
+                        }, {
+                            "text": "物料名称",
+                            "width": 200,
+                            "dataIndex": "pr_detail",
+                        }, {
+                            "text": "规格",
+                            "dataIndex": "pr_spec",
+                            "width": 100,
+                        }, {
+                            "text": "单位",
+                            "dataIndex": "pr_unit",
+                            "width": 100,
+                        },{
+                            "text": "仓库id",
+                            "dataIndex": "pr_whid",
+                            "hidden": true,
+                        },{
+                            "text": "仓库编号",
+                            "dataIndex": "pr_whcode",
+                            "hidden": true,
+                        },{
+                            "text": "仓库",
+                            "dataIndex": "pr_whname",
+                            "width": 200,
+                        },{
+                            "text": "总库存数",
+                            "dataIndex": "po_onhand",
+                            "width": 100,
+                            align:'right'
+                        },{
+                            "text": "类型",
+                            "dataIndex": "pr_kind",
+                            "width": 100,
+                        },{
+                            "text": "型号",
+                            "dataIndex": "pr_orispeccode",
+                            "width": 100,
+                        },{
+                            "text": "品牌",
+                            "dataIndex": "pr_brand",
+                            "width": 100,
+                        },{
+                            "text": "供应商",
+                            "dataIndex": "pr_vendname",
+                            "width": 100,
+                        },{
+                            "text": "最小包装",
+                            "dataIndex": "pr_zxbzs",
+                            "width": 100,
+                            align:'right'
+                        },{
+                            "text": "L/T",
+                            "dataIndex": "pr_leadtime",
+                            "width": 100,
+                        }]
+                    }) ;   
+
+                }
+            }
+         });
+        }
+});

+ 4 - 0
frontend/saas-web/app/view/stock/report/ProdiodetailModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.stock.report.ProdiodetailModel', {
+    extend: 'saas.view.core.report.ReportPanelModel',
+    alias: 'stock-report-prodiodetail'
+});

+ 6 - 2
frontend/saas-web/resources/json/navigation.json

@@ -112,9 +112,13 @@
     }, {
         "text": "报表",
         "items": [{
-            "text": "物料出入库明细表"
+            "text": "物料出入库明细表",
+            "id":"prodiodetail",
+            "viewType": "stock-report-prodiodetail"
         }, {
-            "text": "物料收发汇总表"
+            "text": "物料收发汇总表",
+            "id":"prodinoutCount",
+            "viewType": "stock-report-prodinoutCount"
         }, {
             "text": "物料库存数量金额表",
             "id":"stock-stockamount-datalist",