فهرست منبع

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

hy 7 سال پیش
والد
کامیت
9520e2593b
48فایلهای تغییر یافته به همراه4581 افزوده شده و 382 حذف شده
  1. 4 0
      applications/commons/commons-server/pom.xml
  2. 20 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ConfigsServiceImpl.java
  3. 8 1
      applications/commons/commons-server/src/main/resources/application.yml
  4. 8 1
      applications/commons/commons-server/src/main/resources/config/application-docker-prod.yml
  5. 1 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  6. 44 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  7. 1 0
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  8. 29 3
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  9. 49 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckAmount.java
  10. 102 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckAmountDetail.java
  11. 360 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckInfo.java
  12. 126 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckProdIO.java
  13. 528 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckProdIODetail.java
  14. 152 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/CustApcheckData.java
  15. 725 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/Enterprise.java
  16. 103 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ProductIoGroup.java
  17. 363 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/PurchaseApCheck.java
  18. 429 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/PurchaseApCheckItem.java
  19. 75 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/SPage.java
  20. 120 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/SaveOperationData.java
  21. 200 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/SaveOperationDataDetail.java
  22. 128 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/UserBaseInfo.java
  23. 6 0
      applications/sale/sale-server/pom.xml
  24. 84 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/B2BApCheckController.java
  25. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java
  26. 25 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ApCheckService.java
  27. 6 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleService.java
  28. 252 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ApCheckServiceImpl.java
  29. 4 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  30. 60 0
      applications/sale/sale-server/src/test/java/com/usoftchina/saas/sale/controller/b2bTest.java
  31. 45 0
      applications/sale/sale-server/src/test/java/com/usoftchina/saas/sale/service/ApCheckServiceTest.java
  32. 4 3
      applications/transfers/mall-api/src/main/java/com/usoftchina/saas/inquiry/api/InquiryApi.java
  33. 11 0
      applications/transfers/mall-api/src/main/java/com/usoftchina/saas/inquiry/po/enConfig/AddOrUpdateEnterpriseRequest.java
  34. 27 0
      applications/transfers/mall-api/src/main/java/com/usoftchina/saas/inquiry/po/inquiry/InquiryResult.java
  35. 34 2
      applications/transfers/mall-api/src/test/java/com/usoftchina/saas/inquiry/test/InquiryApiTest.java
  36. 7 0
      frontend/saas-web/app/model/main/NavMenu.js
  37. 1 1
      frontend/saas-web/app/util/BaseUtil.js
  38. 2 2
      frontend/saas-web/app/view/core/tab/Controller.js
  39. 14 10
      frontend/saas-web/app/view/document/kind/Kind.js
  40. 1 0
      frontend/saas-web/app/view/document/kind/KindModel.js
  41. 14 0
      frontend/saas-web/app/view/main/MainModel.js
  42. 121 152
      frontend/saas-web/app/view/main/Navigation.js
  43. 78 75
      frontend/saas-web/app/view/main/Navigation.scss
  44. 125 111
      frontend/saas-web/app/view/purchase/b2b/quotationList/DataList.js
  45. 4 0
      frontend/saas-web/app/view/purchase/b2b/sendQuotation/DataList.js
  46. 1 1
      frontend/saas-web/app/view/sale/b2b/Business.js
  47. 45 13
      frontend/saas-web/app/view/sale/b2b/QuoteWin.js
  48. 33 4
      frontend/saas-web/resources/json/navigation.json

+ 4 - 0
applications/commons/commons-server/pom.xml

@@ -104,6 +104,10 @@
             <groupId>com.google.zxing</groupId>
             <artifactId>javase</artifactId>
         </dependency>
+      <dependency>
+        <groupId>com.usoftchina.saas</groupId>
+        <artifactId>mall-api</artifactId>
+      </dependency>
     </dependencies>
 
     <build>

+ 20 - 1
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ConfigsServiceImpl.java

@@ -2,6 +2,8 @@ package com.usoftchina.saas.commons.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.account.api.CompanyApi;
+import com.usoftchina.saas.account.dto.CompanyDTO;
 import com.usoftchina.saas.commons.cache.ConfigsCache;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
@@ -13,8 +15,11 @@ import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.CurrencyApi;
 import com.usoftchina.saas.document.dto.CurrencyDTO;
 import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.inquiry.api.EnConfigApi;
+import com.usoftchina.saas.inquiry.po.enConfig.AddOrUpdateEnterpriseRequest;
 import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.http.HttpUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -35,7 +40,10 @@ public class ConfigsServiceImpl implements ConfigsService{
     private MessageLogService messageLogService;
     @Autowired
     private CurrencyApi currencyApi;
-
+    @Autowired
+    private EnConfigApi enConfigApi;
+    @Autowired
+    private CompanyApi companyApi;
 
     @Override
     public PageInfo getListData(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
@@ -113,6 +121,17 @@ public class ConfigsServiceImpl implements ConfigsService{
                 currencyApi.setStandard(currencyDTO);
             } else if("enableB2B".equals(con.getCode())){
                 int count = configsMapper.selectByCodeAndCompanyId(con.getCode(), BaseContextHolder.getCompanyId());
+                //将企业信息同步给B2B,用于平台开启数据传输
+                if ("1".equals(con.getData())){
+                    CompanyDTO companyDTO = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData();
+                    enConfigApi.addOrUpdateEnterprise(new AddOrUpdateEnterpriseRequest(
+                            companyDTO.getUu(),
+                            companyDTO.getName(),
+                            true,
+                            true,
+                            companyDTO.getAccessKey()
+                    ));
+                }
                 if (count == 0){
                     //不存在,则插入
                     Configs configs = new Configs();

+ 8 - 1
applications/commons/commons-server/src/main/resources/application.yml

@@ -76,4 +76,11 @@ auth:
   public-key: auth/pub.key
 ribbon:
   ReadTimeout: 5000
-  ConnectTimeout: 5000
+  ConnectTimeout: 5000
+b2b:
+  baseUrl:
+    inquiry: https://test-inquiry.uuzcc.cn
+    Component: https://test-mall.uuzcc.cn
+    product: http://test-product.uuzcc.cn
+    common: http://test-b2b.uuzcc.cn
+    post: https://test-b2b-post.uuzcc.cn

+ 8 - 1
applications/commons/commons-server/src/main/resources/config/application-docker-prod.yml

@@ -20,4 +20,11 @@ spring:
     host: 10.10.100.173
     port: 6379
 logging:
-  destination: 10.10.100.160:5000
+  destination: 10.10.100.160:5000
+b2b:
+  baseUrl:
+    inquiry: https://api-inquiry.usoftchina.com
+    Component: https://mall.usoftchina.com
+    product: http://api-product.usoftchina.com
+    common: https://b2b-api.usoftchina.com
+    post: https://b2b-post.usoftchina.com

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

@@ -132,8 +132,7 @@ public class ProductController {
      */
     @GetMapping("/getByProdCode")
     public Result getByProdCode(@RequestParam("code") String code){
-        productService.getByProdCode(code);
-        return Result.success();
+        return Result.success(productService.getByProdCode(code));
     }
 
     /**

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

@@ -3,6 +3,8 @@ package com.usoftchina.saas.document.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.account.api.CompanyApi;
+import com.usoftchina.saas.account.dto.CompanyDTO;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
@@ -29,8 +31,14 @@ import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.CollectionUtils;
 import com.usoftchina.saas.utils.DateUtils;
+import com.usoftchina.saas.utils.JsonUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
+import com.usoftchina.saas.utils.http.HttpUtil;
+import com.usoftchina.saas.utils.http.HttpUtil.Response;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
@@ -59,6 +67,12 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
     private DataImportMapper dataImportMapper;
     @Autowired
     private VendorkindService vendorkindService;
+    @Autowired
+    private CompanyApi companyApi;
+    @Value("${b2b.baseUrl.common}")
+    private String b2bUrl;
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(VendorServiceImpl.class);
 
     @Override
     public PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO) {
@@ -236,6 +250,15 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
                 main.setVe_beginprepayamount(vendortpl.getVe_beginprepayamount());
             }
 
+            //启用B2B对账
+            if (StringUtils.isEmpty(oldVendor.getVe_uu()) && !StringUtils.isEmpty(main.getVe_uu())){
+                try {
+                    enableApCheck(main.getVe_uu());
+                } catch (Exception e) {
+                    LOGGER.info("请求B2B对账启用接口失败!, time={}", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
+                }
+            }
+
             getMapper().updateByPrimaryKeySelective(main);
             if (items.size() > 0) {
                 List<Vendorcontact> updateItems = new ArrayList<Vendorcontact>();
@@ -312,6 +335,27 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         return generateMsgObj(main.getId(), ve_code);
     }
 
+    /**
+     * 启用B2B对账
+     * @param ve_uu
+     * @throws Exception
+     */
+    private void enableApCheck(String ve_uu) throws Exception {
+        CompanyDTO companyDTO = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData();
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("venduu", ve_uu);
+        map.put("custuu", companyDTO.getUu());
+        map.put("apcheck", 1);
+        Map<String, String> params = new HashMap<String, String>();
+        params.put("data", JsonUtils.toJsonString(map));
+        Response response = HttpUtil.sendPostRequest(b2bUrl + "/erp/vendor/apcheck?access_id=" + companyDTO.getUu(), params, true, companyDTO.getAccessKey());
+        if (response.getStatusCode() == 200){
+            LOGGER.info("供应商UU={},启用B2B对账成功!", ve_uu);
+        }else {
+            LOGGER.info("供应商UU={},启用B2B对账失败!,原因={}", ve_uu, response.getResponseText());
+        }
+    }
+
     /**
      * 删除主从表数据
      * @param id

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

@@ -1002,6 +1002,7 @@
           ${condition}
         </if>
       </where>
+      order by prodId desc
     </select>
     <select id="selectByCode" resultMap="ProductDTOResultMapper">
         select * from product where pr_code = #{code} and companyId = #{companyId}

+ 29 - 3
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -1,8 +1,10 @@
 package com.usoftchina.saas.purchase.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.netflix.discovery.converters.Auto;
+import com.rabbitmq.tools.json.JSONUtil;
 import com.usoftchina.saas.account.dto.CompanyDTO;
 import com.usoftchina.saas.commons.cache.ConfigsCache;
 import com.usoftchina.saas.document.api.AddressApi;
@@ -54,6 +56,7 @@ import com.usoftchina.saas.transfers.dto.MessageInfo;
 import com.usoftchina.saas.utils.BeanMapper;
 import com.usoftchina.saas.utils.CollectionUtils;
 import com.usoftchina.saas.utils.JsonUtils;
+import feign.Response;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -61,6 +64,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
+import java.io.IOException;
+import java.io.Reader;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.concurrent.CountDownLatch;
@@ -895,10 +900,28 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     public void DealInquiry(InquiryDealReqDTO inquiryDealReqDTO) {
         Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
         Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
+        Response response = null;
         if (inquiryDealReqDTO.getStatus() == 1){
-            inquiryApi.adoptQuote(inquiryDealReqDTO.getId(), inquiryDealReqDTO.getStatus(), enUU, userUU);
+            response = inquiryApi.adoptQuote(inquiryDealReqDTO.getId(), inquiryDealReqDTO.getStatus(), enUU, userUU);
         }else{
-            inquiryApi.refuseQuote(inquiryDealReqDTO.getId(), inquiryDealReqDTO.getStatus(), enUU, userUU, inquiryDealReqDTO.getRefusereason());
+            response = inquiryApi.refuseQuote(inquiryDealReqDTO.getId(), inquiryDealReqDTO.getStatus(), enUU, userUU, inquiryDealReqDTO.getRefusereason());
+        }
+        if (response.status() == 500){
+            try {
+                Reader reader = response.body().asReader();
+                int size = response.body().length();
+                char[] ch = new char[size];
+                int temp = 0, len = 0;
+                while ((temp = reader.read()) != -1){
+                    ch[len] = (char) temp;
+                    len++;
+                }
+                reader.close();
+                JSONObject jsonObject = JSONObject.parseObject(new String(ch));
+                throw new BizException(79320, jsonObject.getString("message"));
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
         }
     }
 
@@ -1001,7 +1024,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         for (PurcInquiryItemInfo purcInquiryItemInfo : purcInquiryItemInfoList){
             InquiryRspDTO inquiryRspDTO = new InquiryRspDTO();
             inquiryRspDTO.setProdCode(purcInquiryItemInfo.getProdCode());
-            inquiryRspDTO.setProdUnit(purcInquiryItemInfo.getProduct().getUnit());
+            ProductDTO productDTO = productApi.getByProdCode(purcInquiryItemInfo.getProdCode()).getData();
+            if (productDTO != null) {
+                inquiryRspDTO.setProdUnit(productDTO.getPr_unit());
+            }
             inquiryRspDTO.setProdOrispeccode(purcInquiryItemInfo.getCmpCode());
             inquiryRspDTO.setProdBrand(purcInquiryItemInfo.getProduct().getBrand());
             inquiryRspDTO.setProdName(purcInquiryItemInfo.getProdTitle());

+ 49 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckAmount.java

@@ -0,0 +1,49 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/28
+ */
+public class ApCheckAmount implements Serializable {
+
+    /**
+     * 币别
+     */
+    private String currency;
+
+    /**
+     * 金额(字符串: 防止科学计数法)
+     */
+    private String amount;
+
+    /**
+     * 金额
+     */
+    private Double count;
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public String getAmount() {
+        return amount;
+    }
+
+    public void setAmount(String amount) {
+        this.amount = amount;
+    }
+
+    public Double getCount() {
+        return count;
+    }
+
+    public void setCount(Double count) {
+        this.count = count;
+    }
+}

+ 102 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckAmountDetail.java

@@ -0,0 +1,102 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+
+/**
+ * @Description 客户列表中ApCheckAmountDetail
+ * @Author chenwei
+ * @Date 2019/01/27
+ */
+public class ApCheckAmountDetail implements Serializable {
+
+    /**
+     * 币别
+     */
+    private String currency;
+
+    /**
+     * 本期应收
+     */
+    private String thisPeriodAmount;
+
+    /**
+     * 本期发货
+     */
+    private String thisPeriodSendQty;
+
+    /**
+     * 本期未对
+     */
+    private String thisPeriodTodoAmount;
+
+    /**
+     * 本期已对
+     */
+    private String thisPeriodDoneAmount;
+
+    /**
+     * 本期收款
+     */
+    private String thisPeriodReceipt;
+
+    /**
+     * 应收总额
+     */
+    private String totalAmount;
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public String getThisPeriodAmount() {
+        return thisPeriodAmount;
+    }
+
+    public void setThisPeriodAmount(String thisPeriodAmount) {
+        this.thisPeriodAmount = thisPeriodAmount;
+    }
+
+    public String getThisPeriodSendQty() {
+        return thisPeriodSendQty;
+    }
+
+    public void setThisPeriodSendQty(String thisPeriodSendQty) {
+        this.thisPeriodSendQty = thisPeriodSendQty;
+    }
+
+    public String getThisPeriodTodoAmount() {
+        return thisPeriodTodoAmount;
+    }
+
+    public void setThisPeriodTodoAmount(String thisPeriodTodoAmount) {
+        this.thisPeriodTodoAmount = thisPeriodTodoAmount;
+    }
+
+    public String getThisPeriodDoneAmount() {
+        return thisPeriodDoneAmount;
+    }
+
+    public void setThisPeriodDoneAmount(String thisPeriodDoneAmount) {
+        this.thisPeriodDoneAmount = thisPeriodDoneAmount;
+    }
+
+    public String getThisPeriodReceipt() {
+        return thisPeriodReceipt;
+    }
+
+    public void setThisPeriodReceipt(String thisPeriodReceipt) {
+        this.thisPeriodReceipt = thisPeriodReceipt;
+    }
+
+    public String getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(String totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+}

+ 360 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckInfo.java

@@ -0,0 +1,360 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/27
+ */
+public class ApCheckInfo implements Serializable {
+
+    private Long id;
+
+    /**
+     * 对账起始日期
+     */
+    private Date beginDate;
+
+    /**
+     * 对账截止日期
+     */
+    private Date endDate;
+
+    /**
+     * 录单日期
+     */
+    private Date recordDate;
+
+    /**
+     * 录单人
+     */
+    private String recorder;
+
+    /**
+     * 录单人UU
+     */
+    private Long recorderUU;
+
+    /**
+     * 应收日期
+     */
+    private Date apDate;
+
+    /**
+     * 对账状态
+     */
+    private String checkStatus;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 提交日期
+     */
+    private Date commitDate;
+
+    /**
+     * 作废日期
+     */
+    private Date resDate;
+
+    /**
+     * 作废人
+     */
+    private String resMan;
+
+    /**
+     * 上传状态
+     */
+    private Short status;
+
+    /**
+     * 对账总额
+     */
+    private Double checkAmount;
+
+    /**
+     * 币别
+     */
+    private String currency;
+
+    /**
+     * 汇率
+     */
+    private Double taxrate;
+
+    /**
+     * 汇率
+     */
+    private Double rate;
+
+    /**
+     * 收款方式
+     */
+    private String payments;
+
+    /**
+     * 客户UU
+     */
+    private Long custUu;
+
+    /**
+     * 客户名称
+     */
+    private String custName;
+
+    /**
+     * 供应商UU
+     */
+    private Long enUu;
+
+    /**
+     * 供应商名称
+     */
+    private String vendorName;
+
+    /**
+     * 单据编号
+     */
+    private String code;
+
+    /**
+     * 客户回复原因
+     */
+    private String custreply;
+
+    /**
+     * 打印次数
+     */
+    private Short print;
+
+    /**
+     * 不同意原因
+     */
+    private String reason;
+
+    /**
+     * 对账单明细行
+     */
+    private Set<PurchaseApCheckItem> items;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Date getBeginDate() {
+        return beginDate;
+    }
+
+    public void setBeginDate(Date beginDate) {
+        this.beginDate = beginDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Date getRecordDate() {
+        return recordDate;
+    }
+
+    public void setRecordDate(Date recordDate) {
+        this.recordDate = recordDate;
+    }
+
+    public String getRecorder() {
+        return recorder;
+    }
+
+    public void setRecorder(String recorder) {
+        this.recorder = recorder;
+    }
+
+    public Long getRecorderUU() {
+        return recorderUU;
+    }
+
+    public void setRecorderUU(Long recorderUU) {
+        this.recorderUU = recorderUU;
+    }
+
+    public Date getApDate() {
+        return apDate;
+    }
+
+    public void setApDate(Date apDate) {
+        this.apDate = apDate;
+    }
+
+    public String getCheckStatus() {
+        return checkStatus;
+    }
+
+    public void setCheckStatus(String checkStatus) {
+        this.checkStatus = checkStatus;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getCommitDate() {
+        return commitDate;
+    }
+
+    public void setCommitDate(Date commitDate) {
+        this.commitDate = commitDate;
+    }
+
+    public Date getResDate() {
+        return resDate;
+    }
+
+    public void setResDate(Date resDate) {
+        this.resDate = resDate;
+    }
+
+    public String getResMan() {
+        return resMan;
+    }
+
+    public void setResMan(String resMan) {
+        this.resMan = resMan;
+    }
+
+    public Short getStatus() {
+        return status;
+    }
+
+    public void setStatus(Short status) {
+        this.status = status;
+    }
+
+    public Double getCheckAmount() {
+        return checkAmount;
+    }
+
+    public void setCheckAmount(Double checkAmount) {
+        this.checkAmount = checkAmount;
+    }
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public Double getTaxrate() {
+        return taxrate;
+    }
+
+    public void setTaxrate(Double taxrate) {
+        this.taxrate = taxrate;
+    }
+
+    public Double getRate() {
+        return rate;
+    }
+
+    public void setRate(Double rate) {
+        this.rate = rate;
+    }
+
+    public String getPayments() {
+        return payments;
+    }
+
+    public void setPayments(String payments) {
+        this.payments = payments;
+    }
+
+    public Long getCustUu() {
+        return custUu;
+    }
+
+    public void setCustUu(Long custUu) {
+        this.custUu = custUu;
+    }
+
+    public String getCustName() {
+        return custName;
+    }
+
+    public void setCustName(String custName) {
+        this.custName = custName;
+    }
+
+    public Long getEnUu() {
+        return enUu;
+    }
+
+    public void setEnUu(Long enUu) {
+        this.enUu = enUu;
+    }
+
+    public String getVendorName() {
+        return vendorName;
+    }
+
+    public void setVendorName(String vendorName) {
+        this.vendorName = vendorName;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getCustreply() {
+        return custreply;
+    }
+
+    public void setCustreply(String custreply) {
+        this.custreply = custreply;
+    }
+
+    public Short getPrint() {
+        return print;
+    }
+
+    public void setPrint(Short print) {
+        this.print = print;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public Set<PurchaseApCheckItem> getItems() {
+        return items;
+    }
+
+    public void setItems(Set<PurchaseApCheckItem> items) {
+        this.items = items;
+    }
+}

+ 126 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckProdIO.java

@@ -0,0 +1,126 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description 对账的出入库单
+ * @Date 2019/01/28
+ */
+public class ApCheckProdIO implements Serializable {
+
+    private List<ApCheckProdIODetail> details = new ArrayList<ApCheckProdIODetail>();
+
+    /**
+     * 本期应收(前端传入指定月份)
+     */
+    private List<ApCheckAmount> thisMonthCount;
+
+    /**
+     * 本期已对账(前端传入指定月份)
+     */
+    private List<ApCheckAmount> thisMonthDoneCount;
+
+    /**
+     * 本期未对账(前端传入指定月份)
+     */
+    private List<ApCheckAmount> thisMonthTodoCount;
+
+    /**
+     * 应收总额
+     */
+    private List<ApCheckAmount> totalCount;
+
+    /**
+     * 供应商名称
+     */
+    private String vendorName;
+
+    /**
+     * 应收对账单数据(下方列表数据,按code分组聚合)
+     */
+    List<ProductIoGroup> groupList;
+
+    /**
+     * 本期发货(ERP数据)
+     */
+    List<ApCheckAmount> thisPeriodSendAmount;
+
+    /**
+     * 本期已收(ERP数据)
+     */
+    List<ApCheckAmount> thisPeriodDoneAmount;
+
+    public List<ApCheckProdIODetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<ApCheckProdIODetail> details) {
+        this.details = details;
+    }
+
+    public List<ApCheckAmount> getThisMonthCount() {
+        return thisMonthCount;
+    }
+
+    public void setThisMonthCount(List<ApCheckAmount> thisMonthCount) {
+        this.thisMonthCount = thisMonthCount;
+    }
+
+    public List<ApCheckAmount> getThisMonthDoneCount() {
+        return thisMonthDoneCount;
+    }
+
+    public void setThisMonthDoneCount(List<ApCheckAmount> thisMonthDoneCount) {
+        this.thisMonthDoneCount = thisMonthDoneCount;
+    }
+
+    public List<ApCheckAmount> getThisMonthTodoCount() {
+        return thisMonthTodoCount;
+    }
+
+    public void setThisMonthTodoCount(List<ApCheckAmount> thisMonthTodoCount) {
+        this.thisMonthTodoCount = thisMonthTodoCount;
+    }
+
+    public List<ApCheckAmount> getTotalCount() {
+        return totalCount;
+    }
+
+    public void setTotalCount(List<ApCheckAmount> totalCount) {
+        this.totalCount = totalCount;
+    }
+
+    public String getVendorName() {
+        return vendorName;
+    }
+
+    public void setVendorName(String vendorName) {
+        this.vendorName = vendorName;
+    }
+
+    public List<ProductIoGroup> getGroupList() {
+        return groupList;
+    }
+
+    public void setGroupList(List<ProductIoGroup> groupList) {
+        this.groupList = groupList;
+    }
+
+    public List<ApCheckAmount> getThisPeriodSendAmount() {
+        return thisPeriodSendAmount;
+    }
+
+    public void setThisPeriodSendAmount(List<ApCheckAmount> thisPeriodSendAmount) {
+        this.thisPeriodSendAmount = thisPeriodSendAmount;
+    }
+
+    public List<ApCheckAmount> getThisPeriodDoneAmount() {
+        return thisPeriodDoneAmount;
+    }
+
+    public void setThisPeriodDoneAmount(List<ApCheckAmount> thisPeriodDoneAmount) {
+        this.thisPeriodDoneAmount = thisPeriodDoneAmount;
+    }
+}

+ 528 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ApCheckProdIODetail.java

@@ -0,0 +1,528 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/28
+ */
+public class ApCheckProdIODetail implements Serializable {
+
+    private String id;
+
+    /**
+     * 出入库单号
+     */
+    private String inoutno;
+
+    /**
+     * 出出入库单序号
+     */
+    private Long detno;
+
+    /**
+     * 单据类型
+     */
+    private String piclass;
+
+    /**
+     * 客户采购编号
+     */
+    private String ordercode;
+
+    /**
+     * 客户采购序号
+     */
+    private Long orderdetno;
+
+    /**
+     * 客户采购料号
+     */
+    private String prodcode;
+
+    /**
+     * 客户采购规格
+     */
+    private String prodspec;
+
+    /**
+     * 客户物料描述
+     */
+    private String prodtitle;
+
+    /**
+     * 客户物料描述
+     */
+    private String produnit;
+
+    /**
+     * 客户验收数量
+     */
+    private Double qty;
+
+    /**
+     * 单价
+     */
+    private Double orderprice;
+
+    /**
+     * 币别
+     */
+    private String currency;
+
+    /**
+     * 税率
+     */
+    private Double taxrate;
+
+    /**
+     * 已对账数
+     */
+    private Double ycheckqty;
+
+    /**
+     * 本次对账数
+     */
+    private Double thischeckqty;
+
+    /**
+     * 客户名称
+     */
+    private String custname;
+
+    /**
+     * 客户UU
+     */
+    private Long custuu;
+
+    /**
+     * 客户用户UU
+     */
+    private Long custuseruu;
+
+    /**
+     * sourceid
+     */
+    private Long sourceid;
+
+    /**
+     * 单据来源表
+     */
+    private String sourcetable;
+
+    /**
+     * 单据来源时间
+     */
+    private Date sourceDate;
+
+    /**
+     * 企业UU
+     */
+    private Long enuu;
+
+    /**
+     * 日期
+     */
+    private Date pidate;
+
+    /**
+     * 汇率
+     */
+    private Double rate;
+
+    /**
+     * 应付供应商编号
+     */
+    private String receivecode;
+
+    /**
+     * 应付供应商名称
+     */
+    private String receivename;
+
+    /**
+     * 金额
+     */
+    private Double money;
+
+    /**
+     * 本次对账金额
+     */
+    private Double nowmoney;
+
+    /**
+     * 送货工厂
+     */
+    private String factory;
+
+    /**
+     * 送货单号
+     */
+    private String sendcode;
+
+    /**
+     * 送货单明细id
+     */
+    private Long sendId;
+
+    /**
+     * 发货数量
+     */
+    private Double sendQty;
+
+    /**
+     * 发货价格
+     */
+    private Double sendPrice;
+
+    /**
+     * 仓库
+     */
+    private String whname;
+
+    /**
+     * 对账记录人
+     */
+    private String recorder;
+
+    /**
+     * 对账日期
+     */
+    private Date apCheckDate;
+
+    /**
+     * 是否已对账
+     */
+    private Short haveChecked = 0;
+
+    /**
+     * 对账主表id
+     */
+    private Long apCheckId;
+
+    /**
+     * 付款金额
+     */
+    private Double payment;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getInoutno() {
+        return inoutno;
+    }
+
+    public void setInoutno(String inoutno) {
+        this.inoutno = inoutno;
+    }
+
+    public Long getDetno() {
+        return detno;
+    }
+
+    public void setDetno(Long detno) {
+        this.detno = detno;
+    }
+
+    public String getPiclass() {
+        return piclass;
+    }
+
+    public void setPiclass(String piclass) {
+        this.piclass = piclass;
+    }
+
+    public String getOrdercode() {
+        return ordercode;
+    }
+
+    public void setOrdercode(String ordercode) {
+        this.ordercode = ordercode;
+    }
+
+    public Long getOrderdetno() {
+        return orderdetno;
+    }
+
+    public void setOrderdetno(Long orderdetno) {
+        this.orderdetno = orderdetno;
+    }
+
+    public String getProdcode() {
+        return prodcode;
+    }
+
+    public void setProdcode(String prodcode) {
+        this.prodcode = prodcode;
+    }
+
+    public String getProdspec() {
+        return prodspec;
+    }
+
+    public void setProdspec(String prodspec) {
+        this.prodspec = prodspec;
+    }
+
+    public String getProdtitle() {
+        return prodtitle;
+    }
+
+    public void setProdtitle(String prodtitle) {
+        this.prodtitle = prodtitle;
+    }
+
+    public String getProdunit() {
+        return produnit;
+    }
+
+    public void setProdunit(String produnit) {
+        this.produnit = produnit;
+    }
+
+    public Double getQty() {
+        return qty;
+    }
+
+    public void setQty(Double qty) {
+        this.qty = qty;
+    }
+
+    public Double getOrderprice() {
+        return orderprice;
+    }
+
+    public void setOrderprice(Double orderprice) {
+        this.orderprice = orderprice;
+    }
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public Double getTaxrate() {
+        return taxrate;
+    }
+
+    public void setTaxrate(Double taxrate) {
+        this.taxrate = taxrate;
+    }
+
+    public Double getYcheckqty() {
+        return ycheckqty;
+    }
+
+    public void setYcheckqty(Double ycheckqty) {
+        this.ycheckqty = ycheckqty;
+    }
+
+    public Double getThischeckqty() {
+        return thischeckqty;
+    }
+
+    public void setThischeckqty(Double thischeckqty) {
+        this.thischeckqty = thischeckqty;
+    }
+
+    public String getCustname() {
+        return custname;
+    }
+
+    public void setCustname(String custname) {
+        this.custname = custname;
+    }
+
+    public Long getCustuu() {
+        return custuu;
+    }
+
+    public void setCustuu(Long custuu) {
+        this.custuu = custuu;
+    }
+
+    public Long getCustuseruu() {
+        return custuseruu;
+    }
+
+    public void setCustuseruu(Long custuseruu) {
+        this.custuseruu = custuseruu;
+    }
+
+    public Long getSourceid() {
+        return sourceid;
+    }
+
+    public void setSourceid(Long sourceid) {
+        this.sourceid = sourceid;
+    }
+
+    public String getSourcetable() {
+        return sourcetable;
+    }
+
+    public void setSourcetable(String sourcetable) {
+        this.sourcetable = sourcetable;
+    }
+
+    public Date getSourceDate() {
+        return sourceDate;
+    }
+
+    public void setSourceDate(Date sourceDate) {
+        this.sourceDate = sourceDate;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public Date getPidate() {
+        return pidate;
+    }
+
+    public void setPidate(Date pidate) {
+        this.pidate = pidate;
+    }
+
+    public Double getRate() {
+        return rate;
+    }
+
+    public void setRate(Double rate) {
+        this.rate = rate;
+    }
+
+    public String getReceivecode() {
+        return receivecode;
+    }
+
+    public void setReceivecode(String receivecode) {
+        this.receivecode = receivecode;
+    }
+
+    public String getReceivename() {
+        return receivename;
+    }
+
+    public void setReceivename(String receivename) {
+        this.receivename = receivename;
+    }
+
+    public Double getMoney() {
+        return money;
+    }
+
+    public void setMoney(Double money) {
+        this.money = money;
+    }
+
+    public Double getNowmoney() {
+        return nowmoney;
+    }
+
+    public void setNowmoney(Double nowmoney) {
+        this.nowmoney = nowmoney;
+    }
+
+    public String getFactory() {
+        return factory;
+    }
+
+    public void setFactory(String factory) {
+        this.factory = factory;
+    }
+
+    public String getSendcode() {
+        return sendcode;
+    }
+
+    public void setSendcode(String sendcode) {
+        this.sendcode = sendcode;
+    }
+
+    public Long getSendId() {
+        return sendId;
+    }
+
+    public void setSendId(Long sendId) {
+        this.sendId = sendId;
+    }
+
+    public Double getSendQty() {
+        return sendQty;
+    }
+
+    public void setSendQty(Double sendQty) {
+        this.sendQty = sendQty;
+    }
+
+    public Double getSendPrice() {
+        return sendPrice;
+    }
+
+    public void setSendPrice(Double sendPrice) {
+        this.sendPrice = sendPrice;
+    }
+
+    public String getWhname() {
+        return whname;
+    }
+
+    public void setWhname(String whname) {
+        this.whname = whname;
+    }
+
+    public String getRecorder() {
+        return recorder;
+    }
+
+    public void setRecorder(String recorder) {
+        this.recorder = recorder;
+    }
+
+    public Date getApCheckDate() {
+        return apCheckDate;
+    }
+
+    public void setApCheckDate(Date apCheckDate) {
+        this.apCheckDate = apCheckDate;
+    }
+
+    public Short getHaveChecked() {
+        return haveChecked;
+    }
+
+    public void setHaveChecked(Short haveChecked) {
+        this.haveChecked = haveChecked;
+    }
+
+    public Long getApCheckId() {
+        return apCheckId;
+    }
+
+    public void setApCheckId(Long apCheckId) {
+        this.apCheckId = apCheckId;
+    }
+
+    public Double getPayment() {
+        return payment;
+    }
+
+    public void setPayment(Double payment) {
+        this.payment = payment;
+    }
+}

+ 152 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/CustApcheckData.java

@@ -0,0 +1,152 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description 客户列表数据
+ * @Author chenwei
+ * @Date 2019/01/27
+ */
+public class CustApcheckData implements Serializable {
+
+    private Long id;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 我的企业UU
+     */
+    private Long myEnUU;
+
+    /**
+     * 我的企业
+     */
+    private Enterprise myEnterprise;
+
+    /**
+     * 我的UU
+     */
+    private Long myUserUU;
+
+    /**
+     * 我方联系人
+     */
+    private UserBaseInfo myUser;
+
+    /**
+     * 供应商的企业UU
+     */
+    private Long vendEnUU;
+
+    /**
+     * 供应商的企业
+     */
+    private Enterprise vendorEnterprise;
+
+    /**
+     * 供应商联系人UU
+     */
+    private Long vendUserUU;
+
+    /**
+     * 供应商联系人
+     */
+    private UserBaseInfo vendorUser;
+
+    /**
+     * 对账金额详情
+     */
+    private List<ApCheckAmountDetail> amountDetailList;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Long getMyEnUU() {
+        return myEnUU;
+    }
+
+    public void setMyEnUU(Long myEnUU) {
+        this.myEnUU = myEnUU;
+    }
+
+    public Enterprise getMyEnterprise() {
+        return myEnterprise;
+    }
+
+    public void setMyEnterprise(Enterprise myEnterprise) {
+        this.myEnterprise = myEnterprise;
+    }
+
+    public Long getMyUserUU() {
+        return myUserUU;
+    }
+
+    public void setMyUserUU(Long myUserUU) {
+        this.myUserUU = myUserUU;
+    }
+
+    public UserBaseInfo getMyUser() {
+        return myUser;
+    }
+
+    public void setMyUser(UserBaseInfo myUser) {
+        this.myUser = myUser;
+    }
+
+    public Long getVendEnUU() {
+        return vendEnUU;
+    }
+
+    public void setVendEnUU(Long vendEnUU) {
+        this.vendEnUU = vendEnUU;
+    }
+
+    public Enterprise getVendorEnterprise() {
+        return vendorEnterprise;
+    }
+
+    public void setVendorEnterprise(Enterprise vendorEnterprise) {
+        this.vendorEnterprise = vendorEnterprise;
+    }
+
+    public Long getVendUserUU() {
+        return vendUserUU;
+    }
+
+    public void setVendUserUU(Long vendUserUU) {
+        this.vendUserUU = vendUserUU;
+    }
+
+    public UserBaseInfo getVendorUser() {
+        return vendorUser;
+    }
+
+    public void setVendorUser(UserBaseInfo vendorUser) {
+        this.vendorUser = vendorUser;
+    }
+
+    public List<ApCheckAmountDetail> getAmountDetailList() {
+        return amountDetailList;
+    }
+
+    public void setAmountDetailList(List<ApCheckAmountDetail> amountDetailList) {
+        this.amountDetailList = amountDetailList;
+    }
+}

+ 725 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/Enterprise.java

@@ -0,0 +1,725 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 企业信息
+ *
+ * @author yingp
+ */
+public class Enterprise implements Serializable {
+
+    /**
+     * 序列号
+     */
+    private static final long serialVersionUID = 1L;
+
+    private Long uu;
+
+    /**
+     * 公司名称
+     */
+    private String enName;
+
+    /**
+     * 简称
+     */
+    private String enShortname;
+
+    /**
+     * 公司类型
+     */
+    private String enType;
+
+    /**
+     * 企业注册地区
+     */
+    private String enArea;
+
+    /**
+     * 状态
+     */
+    private Short enStatus;
+
+    /**
+     * 传输到管理平台的状态
+     */
+    private Short enSendStatus;
+
+    /**
+     * 注册地址
+     */
+    private String enAddress;
+
+    /**
+     * 默认送货地址
+     */
+    private String enDeliverAddr;
+
+    /**
+     * 公司电话
+     */
+    private String enTel;
+
+    /**
+     * 传真
+     */
+    private String enFax;
+
+    /**
+     * 公司邮箱
+     */
+    private String enEmail;
+
+    /**
+     * 员工人数
+     */
+    private Integer emcount;
+
+    /**
+     * 开户银行
+     */
+    private String enbank;
+
+    /**
+     * 公司法人
+     */
+    private String enCorporation;
+
+    /**
+     * 商业登记证号
+     */
+    private String enBussinessCode;
+
+    /**
+     * 营业执照号服务器路径,账户中心同步时同步过来
+     */
+    private String businesscodeimg;
+
+    /**
+     * 纳税人识别号
+     */
+    private String enTaxcode;
+
+    /**
+     * 注册资本
+     */
+    private String enRegistercapital;
+
+    /**
+     * 公司主页地址
+     */
+    private String enUrl;
+
+    /**
+     * 注册时间
+     */
+    private Date enDate;
+
+    /**
+     * 管理员UU号
+     */
+    private Long enAdminuu;
+
+    /**
+     * 所属行业
+     */
+    private String enIndustry;
+
+    /**
+     * 优企云服域名
+     */
+    private String enSaasUrl;
+
+    /**
+     * 优企云服状态
+     */
+    private Short enSaasStatus;
+
+    /**
+     * 优企云服传输状态
+     */
+    private Short enSaasSendStatus;
+
+    /**
+     * enIsErp
+     */
+    private Short enIsErp;
+
+    /**
+     * log路径
+     */
+    private String logUrl;
+
+    public Short getEnIsErp() {
+        return enIsErp;
+    }
+
+    /**
+     * en_management 经营模式
+     */
+    private String enManagement;
+
+    /**
+     * en_brands 主营品牌(多个用逗号分隔)
+     */
+    private String enBrands;
+
+    /**
+     * en_products 主营产品
+     */
+    private String enProducts;
+
+    /**
+     * 记录产品的销售状态<br>
+     * 1. 开启<br>
+     * 0. 关闭
+     */
+    private Short prodsale;
+
+    /**
+     * 记录物料的采购状态<br>
+     * 1. 开启<br>
+     * 0. 关闭
+     *
+     * @return
+     */
+    private Short prodpurc;
+
+    /**
+     * 行业
+     */
+    private String profession;
+
+    /**
+     * 主营业务
+     */
+    private String tags;
+
+    /**
+     * 联系人
+     */
+    private String contactMan;
+
+    /**
+     * 联系人电话
+     */
+    private String contactTel;
+
+    /**
+     * 联系人邮箱
+     */
+    private String contactEmail;
+
+    /**
+     * 企业权重 (用于供应商资源库排序) -- 2018年3月29日 17:59:00
+     */
+    private Integer weight;
+
+    /**
+     * 邀请企业UU
+     */
+    private Long inviteUU;
+
+    /**
+     * 邀请用户UU
+     */
+    private Long inviteUserUU;
+
+    /**
+     * 邀请时间
+     */
+    private Long inviteTime;
+
+    /**
+     * 邀请来源
+     */
+    private String inviteSource;
+
+    public String getEnManagement() {
+        return enManagement;
+    }
+
+    public void setEnManagement(String enManagement) {
+        this.enManagement = enManagement;
+    }
+
+    public String getEnProducts() {
+        return enProducts;
+    }
+
+    public void setEnProducts(String enProducts) {
+        this.enProducts = enProducts;
+    }
+
+    public String getEnInfo() {
+        return enInfo;
+    }
+
+    public void setEnInfo(String enInfo) {
+        this.enInfo = enInfo;
+    }
+
+    /**
+     * en_info 公司简介
+     */
+    private String enInfo;
+
+    public void setEnIsErp(Short enIsErp) {
+        this.enIsErp = enIsErp;
+    }
+
+    /**
+     * 管理员密码
+     */
+    private String enAdminPassword;
+
+    private Long enBussinesscodeImg;// 营业执照号附件id(转化传到管理平台)
+
+    private String enAdminName;// 管理员名字(转化传到管理平台)
+
+    private String enAdminTel;// 管理员手机号(转化传到管理平台)
+
+    private String enAdminEmail;// 管理员邮箱(转化传到管理平台)
+
+    private String enAuditRemark;// 审核(从管理平台传过来)
+
+    /**
+     * 私钥
+     */
+    private String accessSecret;
+
+    /**
+     * en_masterId 企业对应管理系统ID
+     */
+    private Long enMasterId;
+
+    public Long getEnMasterId() {
+        return enMasterId;
+    }
+
+    public void setEnMasterId(Long enMasterId) {
+        this.enMasterId = enMasterId;
+    }
+
+    public String getEnAuditRemark() {
+        return enAuditRemark;
+    }
+
+    public void setEnAuditRemark(String enAuditRemark) {
+        this.enAuditRemark = enAuditRemark;
+    }
+
+    public Long getEnAdminuu() {
+        return enAdminuu;
+    }
+
+    public void setEnAdminuu(Long enAdminuu) {
+        this.enAdminuu = enAdminuu;
+    }
+
+    private Short enable;
+
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
+
+    public String getEnName() {
+        return enName;
+    }
+
+    public void setEnName(String enName) {
+        this.enName = enName;
+    }
+
+    public String getEnShortname() {
+        return enShortname;
+    }
+
+    public void setEnShortname(String enShortname) {
+        this.enShortname = enShortname;
+    }
+
+    public String getEnType() {
+        return enType;
+    }
+
+    public void setEnType(String enType) {
+        this.enType = enType;
+    }
+
+    public Short getEnStatus() {
+        return enStatus;
+    }
+
+    public void setEnStatus(Short enStatus) {
+        this.enStatus = enStatus;
+    }
+
+    public String getEnAddress() {
+        return enAddress;
+    }
+
+    public void setEnAddress(String enAddress) {
+        this.enAddress = enAddress;
+    }
+
+    public String getEnDeliverAddr() {
+        return enDeliverAddr;
+    }
+
+    public void setEnDeliverAddr(String enDeliverAddr) {
+        this.enDeliverAddr = enDeliverAddr;
+    }
+
+    public String getEnTel() {
+        return enTel;
+    }
+
+    public void setEnTel(String enTel) {
+        this.enTel = enTel;
+    }
+
+    public String getEnFax() {
+        return enFax;
+    }
+
+    public void setEnFax(String enFax) {
+        this.enFax = enFax;
+    }
+
+    public String getEnCorporation() {
+        return enCorporation;
+    }
+
+    public void setEnCorporation(String enCorporation) {
+        this.enCorporation = enCorporation;
+    }
+
+    public String getEnBussinessCode() {
+        return enBussinessCode;
+    }
+
+    public void setEnBussinessCode(String enBussinessCode) {
+        this.enBussinessCode = enBussinessCode;
+    }
+
+    public String getEnBrands() {
+        return enBrands;
+    }
+
+    public void setEnBrands(String enBrands) {
+        this.enBrands = enBrands;
+    }
+
+    public String getEnTaxcode() {
+        return enTaxcode;
+    }
+
+    public void setEnTaxcode(String enTaxcode) {
+        this.enTaxcode = enTaxcode;
+    }
+
+    public String getEnRegistercapital() {
+        return enRegistercapital;
+    }
+
+    public void setEnRegistercapital(String enRegistercapital) {
+        this.enRegistercapital = enRegistercapital;
+    }
+
+    public String getEnUrl() {
+        return enUrl;
+    }
+
+    public void setEnUrl(String enUrl) {
+        this.enUrl = enUrl;
+    }
+
+    public Date getEnDate() {
+        return enDate;
+    }
+
+    public void setEnDate(Date enDate) {
+        this.enDate = enDate;
+    }
+
+    public Short getEnable() {
+        return enable;
+    }
+
+    public void setEnable(Short enable) {
+        this.enable = enable;
+    }
+
+    public String getEnEmail() {
+        return enEmail;
+    }
+
+    public void setEnEmail(String enEmail) {
+        this.enEmail = enEmail;
+    }
+
+    public String getEnAdminTel() {
+        return enAdminTel;
+    }
+
+    public void setEnAdminTel(String enAdminTel) {
+        this.enAdminTel = enAdminTel;
+    }
+
+    public String getEnAdminEmail() {
+        return enAdminEmail;
+    }
+
+    public void setEnAdminEmail(String enAdminEmail) {
+        this.enAdminEmail = enAdminEmail;
+    }
+
+    public Long getEnBussinesscodeImg() {
+        return enBussinesscodeImg;
+    }
+
+    public void setEnBussinesscodeImg(Long enBussinesscodeImg) {
+        this.enBussinesscodeImg = enBussinesscodeImg;
+    }
+
+    public Short getEnSendStatus() {
+        return enSendStatus;
+    }
+
+    public void setEnSendStatus(Short enSendStatus) {
+        this.enSendStatus = enSendStatus;
+    }
+
+    public String getEnArea() {
+        return enArea;
+    }
+
+    public void setEnArea(String enArea) {
+        this.enArea = enArea;
+    }
+
+    public String getEnAdminName() {
+        return enAdminName;
+    }
+
+    public void setEnAdminName(String enAdminName) {
+        this.enAdminName = enAdminName;
+    }
+
+    public String getEnIndustry() {
+        return enIndustry;
+    }
+
+    public void setEnIndustry(String enIndustry) {
+        this.enIndustry = enIndustry;
+    }
+
+    public String getEnSaasUrl() {
+        return enSaasUrl;
+    }
+
+    public void setEnSaasUrl(String enSaasUrl) {
+        this.enSaasUrl = enSaasUrl;
+    }
+
+    public Short getEnSaasStatus() {
+        return enSaasStatus;
+    }
+
+    public void setEnSaasStatus(Short enSaasStatus) {
+        this.enSaasStatus = enSaasStatus;
+    }
+
+    public Short getEnSaasSendStatus() {
+        return enSaasSendStatus;
+    }
+
+    public void setEnSaasSendStatus(Short enSaasSendStatus) {
+        this.enSaasSendStatus = enSaasSendStatus;
+    }
+
+    public String getEnAdminPassword() {
+        return enAdminPassword;
+    }
+
+    public void setEnAdminPassword(String enAdminPassword) {
+        this.enAdminPassword = enAdminPassword;
+    }
+
+    public String getAccessSecret() {
+        return accessSecret;
+    }
+
+    public void setAccessSecret(String accessSecret) {
+        this.accessSecret = accessSecret;
+    }
+
+    public boolean isEnabled() {
+        return this.getEnable() != null && this.getEnable() == 1;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((uu == null) ? 0 : uu.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        Enterprise other = (Enterprise) obj;
+        if (uu == null) {
+            if (other.uu != null) {
+                return false;
+            }
+        } else if (!uu.equals(other.uu)) {
+            return false;
+        }
+        return true;
+    }
+
+    public String getLogUrl() {
+        return logUrl;
+    }
+
+    public void setLogUrl(String logUrl) {
+        this.logUrl = logUrl;
+    }
+
+    public Integer getEmcount() {
+        return emcount;
+    }
+
+    public void setEmcount(Integer emcount) {
+        this.emcount = emcount;
+    }
+
+    public String getEnbank() {
+        return enbank;
+    }
+
+    public void setEnbank(String enbank) {
+        this.enbank = enbank;
+    }
+
+    public Short getProdsale() {
+        return prodsale;
+    }
+
+    public void setProdsale(Short prodsale) {
+        this.prodsale = prodsale;
+    }
+
+    public Short getProdpurc() {
+        return prodpurc;
+    }
+
+    public void setProdpurc(Short prodpurc) {
+        this.prodpurc = prodpurc;
+    }
+
+    public String getBusinesscodeimg() {
+        return businesscodeimg;
+    }
+
+    public void setBusinesscodeimg(String businesscodeimg) {
+        this.businesscodeimg = businesscodeimg;
+    }
+
+    public String getProfession() {
+        return profession;
+    }
+
+    public void setProfession(String profession) {
+        this.profession = profession;
+    }
+
+    public String getTags() {
+        return tags;
+    }
+
+    public void setTags(String tags) {
+        this.tags = tags;
+    }
+
+    public String getContactMan() {
+        return contactMan;
+    }
+
+    public void setContactMan(String contactMan) {
+        this.contactMan = contactMan;
+    }
+
+    public String getContactTel() {
+        return contactTel;
+    }
+
+    public void setContactTel(String contactTel) {
+        this.contactTel = contactTel;
+    }
+
+    public String getContactEmail() {
+        return contactEmail;
+    }
+
+    public void setContactEmail(String contactEmail) {
+        this.contactEmail = contactEmail;
+    }
+
+    public Integer getWeight() {
+        return weight;
+    }
+
+    public void setWeight(Integer weight) {
+        this.weight = weight;
+    }
+
+    public Long getInviteUU() {
+        return inviteUU;
+    }
+
+    public void setInviteUU(Long inviteUU) {
+        this.inviteUU = inviteUU;
+    }
+
+    public Long getInviteUserUU() {
+        return inviteUserUU;
+    }
+
+    public void setInviteUserUU(Long inviteUserUU) {
+        this.inviteUserUU = inviteUserUU;
+    }
+
+    public Long getInviteTime() {
+        return inviteTime;
+    }
+
+    public void setInviteTime(Long inviteTime) {
+        this.inviteTime = inviteTime;
+    }
+
+    public String getInviteSource() {
+        return inviteSource;
+    }
+
+    public void setInviteSource(String inviteSource) {
+        this.inviteSource = inviteSource;
+    }
+}

+ 103 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/ProductIoGroup.java

@@ -0,0 +1,103 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/28
+ */
+public class ProductIoGroup implements Serializable {
+
+    /**
+     * 采购单号
+     */
+    private String orderCode;
+
+    /**
+     * 发货数量
+     */
+    private Double sendQty;
+
+    /**
+     * 对账数量(页面验收数量)
+     */
+    private Double checkQty;
+
+    /**
+     * 应收金额
+     */
+    private List<ApCheckAmount> checkAmountList;
+
+    /**
+     * 发货金额
+     */
+    private List<ApCheckAmount> sendAmountList;
+
+    /**
+     * 明细
+     */
+    private List<ApCheckProdIODetail> details = new ArrayList<ApCheckProdIODetail>();
+
+    /**
+     * 明细是否全对账(1: 是 0:不是)
+     */
+    private Short allChecked = 1;
+
+    public String getOrderCode() {
+        return orderCode;
+    }
+
+    public void setOrderCode(String orderCode) {
+        this.orderCode = orderCode;
+    }
+
+    public Double getSendQty() {
+        return sendQty;
+    }
+
+    public void setSendQty(Double sendQty) {
+        this.sendQty = sendQty;
+    }
+
+    public Double getCheckQty() {
+        return checkQty;
+    }
+
+    public void setCheckQty(Double checkQty) {
+        this.checkQty = checkQty;
+    }
+
+    public List<ApCheckAmount> getCheckAmountList() {
+        return checkAmountList;
+    }
+
+    public void setCheckAmountList(List<ApCheckAmount> checkAmountList) {
+        this.checkAmountList = checkAmountList;
+    }
+
+    public List<ApCheckAmount> getSendAmountList() {
+        return sendAmountList;
+    }
+
+    public void setSendAmountList(List<ApCheckAmount> sendAmountList) {
+        this.sendAmountList = sendAmountList;
+    }
+
+    public List<ApCheckProdIODetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<ApCheckProdIODetail> details) {
+        this.details = details;
+    }
+
+    public Short getAllChecked() {
+        return allChecked;
+    }
+
+    public void setAllChecked(Short allChecked) {
+        this.allChecked = allChecked;
+    }
+}

+ 363 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/PurchaseApCheck.java

@@ -0,0 +1,363 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/28
+ */
+public class PurchaseApCheck implements Serializable {
+
+    /**
+     * ID
+     */
+    private Long id;
+
+    /**
+     * 对账起始日期
+     */
+    private Date beginDate;
+
+    /**
+     * 对账截止日期
+     */
+    private Date endDate;
+
+    /**
+     * 录单日期
+     */
+    private Date recordDate;
+
+    /**
+     * 录单人
+     */
+    private String recorder;
+
+    /**
+     * 录单人UU
+     */
+    private Long recorderUU;
+
+    /**
+     * 应收日期
+     */
+    private Date apDate;
+
+    /**
+     * 对账状态
+     */
+    private String checkStatus;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 提交日期
+     */
+    private Date commitDate;
+
+    /**
+     * 作废日期
+     */
+    private Date resDate;
+
+    /**
+     * 作废人
+     */
+    private String resMan;
+
+    /**
+     * 上传状态
+     */
+    private Short status;
+
+    /**
+     * 对账总额
+     */
+    private Double checkAmount;
+
+    /**
+     * 币别
+     */
+    private String currency;
+
+    /**
+     * 汇率
+     */
+    private Double taxrate;
+
+    /**
+     * 汇率
+     */
+    private Double rate;
+
+    /**
+     * 收款方式
+     */
+    private String payments;
+
+    /**
+     * 客户UU
+     */
+    private Long custUu;
+
+    /**
+     * 客户名称
+     */
+    private String custName;
+
+    /**
+     * 供应商UU
+     */
+    private Long enUu;
+
+    /**
+     * 供应商名称
+     */
+    private String vendorName;
+
+    /**
+     * 单据编号
+     */
+    private String code;
+
+    /**
+     * 客户回复原因
+     */
+    private String custreply;
+
+    /**
+     * 打印次数
+     */
+    private Short print;
+
+    /**
+     * 不同意原因
+     */
+    private String reason;
+
+    /**
+     * 对账单明细行
+     */
+    private Set<PurchaseApCheckItem> items;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Date getBeginDate() {
+        return beginDate;
+    }
+
+    public void setBeginDate(Date beginDate) {
+        this.beginDate = beginDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Date getRecordDate() {
+        return recordDate;
+    }
+
+    public void setRecordDate(Date recordDate) {
+        this.recordDate = recordDate;
+    }
+
+    public String getRecorder() {
+        return recorder;
+    }
+
+    public void setRecorder(String recorder) {
+        this.recorder = recorder;
+    }
+
+    public Long getRecorderUU() {
+        return recorderUU;
+    }
+
+    public void setRecorderUU(Long recorderUU) {
+        this.recorderUU = recorderUU;
+    }
+
+    public Date getApDate() {
+        return apDate;
+    }
+
+    public void setApDate(Date apDate) {
+        this.apDate = apDate;
+    }
+
+    public String getCheckStatus() {
+        return checkStatus;
+    }
+
+    public void setCheckStatus(String checkStatus) {
+        this.checkStatus = checkStatus;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getCommitDate() {
+        return commitDate;
+    }
+
+    public void setCommitDate(Date commitDate) {
+        this.commitDate = commitDate;
+    }
+
+    public Date getResDate() {
+        return resDate;
+    }
+
+    public void setResDate(Date resDate) {
+        this.resDate = resDate;
+    }
+
+    public String getResMan() {
+        return resMan;
+    }
+
+    public void setResMan(String resMan) {
+        this.resMan = resMan;
+    }
+
+    public Short getStatus() {
+        return status;
+    }
+
+    public void setStatus(Short status) {
+        this.status = status;
+    }
+
+    public Double getCheckAmount() {
+        return checkAmount;
+    }
+
+    public void setCheckAmount(Double checkAmount) {
+        this.checkAmount = checkAmount;
+    }
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public Double getTaxrate() {
+        return taxrate;
+    }
+
+    public void setTaxrate(Double taxrate) {
+        this.taxrate = taxrate;
+    }
+
+    public Double getRate() {
+        return rate;
+    }
+
+    public void setRate(Double rate) {
+        this.rate = rate;
+    }
+
+    public String getPayments() {
+        return payments;
+    }
+
+    public void setPayments(String payments) {
+        this.payments = payments;
+    }
+
+    public Long getCustUu() {
+        return custUu;
+    }
+
+    public void setCustUu(Long custUu) {
+        this.custUu = custUu;
+    }
+
+    public String getCustName() {
+        return custName;
+    }
+
+    public void setCustName(String custName) {
+        this.custName = custName;
+    }
+
+    public Long getEnUu() {
+        return enUu;
+    }
+
+    public void setEnUu(Long enUu) {
+        this.enUu = enUu;
+    }
+
+    public String getVendorName() {
+        return vendorName;
+    }
+
+    public void setVendorName(String vendorName) {
+        this.vendorName = vendorName;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getCustreply() {
+        return custreply;
+    }
+
+    public void setCustreply(String custreply) {
+        this.custreply = custreply;
+    }
+
+    public Short getPrint() {
+        return print;
+    }
+
+    public void setPrint(Short print) {
+        this.print = print;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public Set<PurchaseApCheckItem> getItems() {
+        return items;
+    }
+
+    public void setItems(Set<PurchaseApCheckItem> items) {
+        this.items = items;
+    }
+}

+ 429 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/PurchaseApCheckItem.java

@@ -0,0 +1,429 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/27
+ */
+public class PurchaseApCheckItem implements Serializable {
+
+    private Long id;
+
+    /**
+     * 行号
+     */
+    private Short number;
+
+    /**
+     * 客户用户UU号
+     */
+    private Long custUserUU;
+
+    /**
+     * 客户物料ID
+     */
+    private Long prid;
+
+    /**
+     * 客户订单单号
+     */
+    private String orderCode;
+
+    /**
+     * 客户出入库类型
+     */
+    private String orderClass;
+
+    /**
+     * 客户订单序号
+     */
+    private Long orderDetno;
+
+    /**
+     * 客户出入库单号
+     */
+    private String inoutno;
+
+    /**
+     * 出入库单序号
+     */
+    private Long inoutnodetno;
+
+    /**
+     * 客户料号
+     */
+    private String prodCode;
+
+    /**
+     * 物料名称
+     */
+    private String prodTitle;
+
+    /**
+     * 物料规格
+     */
+    private String prodSpec;
+
+    /**
+     * 物料单位
+     */
+    private String prodUnit;
+
+    /**
+     * 单价
+     */
+    private Double price;
+
+    /**
+     * 税率
+     */
+    private Double taxrate;
+
+    /**
+     * 对账数量
+     */
+    private Double checkQty;
+
+    /**
+     * 对账金额
+     */
+    private Double amount;
+
+    /**
+     * 客户确认数量
+     */
+    private Double custCheckQty;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 对账状态
+     */
+    private Integer status;
+
+    /**
+     * 明细行数据来源表
+     */
+    private String sourceTable;
+
+    /**
+     * 明细行数据来源对应ID
+     */
+    private Long sourceId;
+
+    /**
+     * 明细行数据来源对应时间
+     */
+    private Date sourceDate;
+
+    /**
+     * 此次转账之前的已对账数(用于删除应收对账单时)
+    @Column(name = "pai_oldycheckqty")
+    private Double oldYCheckQty;
+
+    /**
+     * 应付供应商编号
+     */
+    private String receiveCode;
+
+    /**
+     * 应付供应商名称
+     */
+    private String receiveName;
+
+    /**
+     * 送货单号
+     */
+    private String sendcode;
+
+    /**
+     * 送货单明细id
+     */
+    private Long sendId;
+
+    /**
+     * 送货数量
+     */
+    private Double sendQty;
+
+    /**
+     * 送货价格
+     */
+    private Double sendPrice;
+
+    /**
+     * 仓库
+     */
+    private String whname;
+
+    /**
+     * 已开票数量
+     */
+    private Double billed;
+
+    /**
+     * 付款金额
+     */
+    private Double payment;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Short getNumber() {
+        return number;
+    }
+
+    public void setNumber(Short number) {
+        this.number = number;
+    }
+
+    public Long getCustUserUU() {
+        return custUserUU;
+    }
+
+    public void setCustUserUU(Long custUserUU) {
+        this.custUserUU = custUserUU;
+    }
+
+    public Long getPrid() {
+        return prid;
+    }
+
+    public void setPrid(Long prid) {
+        this.prid = prid;
+    }
+
+    public String getOrderCode() {
+        return orderCode;
+    }
+
+    public void setOrderCode(String orderCode) {
+        this.orderCode = orderCode;
+    }
+
+    public String getOrderClass() {
+        return orderClass;
+    }
+
+    public void setOrderClass(String orderClass) {
+        this.orderClass = orderClass;
+    }
+
+    public Long getOrderDetno() {
+        return orderDetno;
+    }
+
+    public void setOrderDetno(Long orderDetno) {
+        this.orderDetno = orderDetno;
+    }
+
+    public String getInoutno() {
+        return inoutno;
+    }
+
+    public void setInoutno(String inoutno) {
+        this.inoutno = inoutno;
+    }
+
+    public Long getInoutnodetno() {
+        return inoutnodetno;
+    }
+
+    public void setInoutnodetno(Long inoutnodetno) {
+        this.inoutnodetno = inoutnodetno;
+    }
+
+    public String getProdCode() {
+        return prodCode;
+    }
+
+    public void setProdCode(String prodCode) {
+        this.prodCode = prodCode;
+    }
+
+    public String getProdTitle() {
+        return prodTitle;
+    }
+
+    public void setProdTitle(String prodTitle) {
+        this.prodTitle = prodTitle;
+    }
+
+    public String getProdSpec() {
+        return prodSpec;
+    }
+
+    public void setProdSpec(String prodSpec) {
+        this.prodSpec = prodSpec;
+    }
+
+    public String getProdUnit() {
+        return prodUnit;
+    }
+
+    public void setProdUnit(String prodUnit) {
+        this.prodUnit = prodUnit;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public Double getTaxrate() {
+        return taxrate;
+    }
+
+    public void setTaxrate(Double taxrate) {
+        this.taxrate = taxrate;
+    }
+
+    public Double getCheckQty() {
+        return checkQty;
+    }
+
+    public void setCheckQty(Double checkQty) {
+        this.checkQty = checkQty;
+    }
+
+    public Double getAmount() {
+        return amount;
+    }
+
+    public void setAmount(Double amount) {
+        this.amount = amount;
+    }
+
+    public Double getCustCheckQty() {
+        return custCheckQty;
+    }
+
+    public void setCustCheckQty(Double custCheckQty) {
+        this.custCheckQty = custCheckQty;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getSourceTable() {
+        return sourceTable;
+    }
+
+    public void setSourceTable(String sourceTable) {
+        this.sourceTable = sourceTable;
+    }
+
+    public Long getSourceId() {
+        return sourceId;
+    }
+
+    public void setSourceId(Long sourceId) {
+        this.sourceId = sourceId;
+    }
+
+    public Date getSourceDate() {
+        return sourceDate;
+    }
+
+    public void setSourceDate(Date sourceDate) {
+        this.sourceDate = sourceDate;
+    }
+
+    public String getReceiveCode() {
+        return receiveCode;
+    }
+
+    public void setReceiveCode(String receiveCode) {
+        this.receiveCode = receiveCode;
+    }
+
+    public String getReceiveName() {
+        return receiveName;
+    }
+
+    public void setReceiveName(String receiveName) {
+        this.receiveName = receiveName;
+    }
+
+    public String getSendcode() {
+        return sendcode;
+    }
+
+    public void setSendcode(String sendcode) {
+        this.sendcode = sendcode;
+    }
+
+    public Long getSendId() {
+        return sendId;
+    }
+
+    public void setSendId(Long sendId) {
+        this.sendId = sendId;
+    }
+
+    public Double getSendQty() {
+        return sendQty;
+    }
+
+    public void setSendQty(Double sendQty) {
+        this.sendQty = sendQty;
+    }
+
+    public Double getSendPrice() {
+        return sendPrice;
+    }
+
+    public void setSendPrice(Double sendPrice) {
+        this.sendPrice = sendPrice;
+    }
+
+    public String getWhname() {
+        return whname;
+    }
+
+    public void setWhname(String whname) {
+        this.whname = whname;
+    }
+
+    public Double getBilled() {
+        return billed;
+    }
+
+    public void setBilled(Double billed) {
+        this.billed = billed;
+    }
+
+    public Double getPayment() {
+        return payment;
+    }
+
+    public void setPayment(Double payment) {
+        this.payment = payment;
+    }
+}

+ 75 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/SPage.java

@@ -0,0 +1,75 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/29
+ */
+public class SPage<T> implements Serializable {
+
+    private int totalElement;
+    private boolean last;
+    private int size;
+    private int totalPage;
+    private int page;
+    private boolean first;
+    private List<T> content;
+
+    public int getTotalElement() {
+        return totalElement;
+    }
+
+    public void setTotalElement(int totalElement) {
+        this.totalElement = totalElement;
+    }
+
+    public boolean isLast() {
+        return last;
+    }
+
+    public void setLast(boolean last) {
+        this.last = last;
+    }
+
+    public int getSize() {
+        return size;
+    }
+
+    public void setSize(int size) {
+        this.size = size;
+    }
+
+    public int getTotalPage() {
+        return totalPage;
+    }
+
+    public void setTotalPage(int totalPage) {
+        this.totalPage = totalPage;
+    }
+
+    public int getPage() {
+        return page;
+    }
+
+    public void setPage(int page) {
+        this.page = page;
+    }
+
+    public boolean isFirst() {
+        return first;
+    }
+
+    public void setFirst(boolean first) {
+        this.first = first;
+    }
+
+    public List<T> getContent() {
+        return content;
+    }
+
+    public void setContent(List<T> content) {
+        this.content = content;
+    }
+}

+ 120 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/SaveOperationData.java

@@ -0,0 +1,120 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/27
+ */
+public class SaveOperationData implements Serializable {
+
+    private Long custUu;
+    private String custName;
+    private Long enUu;
+    private Long apDate;
+    private Long beginDate;
+    private Long endDate;
+    private String checkStatus;
+    private Double checkAmount;
+    private String currency;
+    private Double rate;
+    private String taxrate;
+    private List<SaveOperationDataDetail> items;
+
+    public Long getCustUu() {
+        return custUu;
+    }
+
+    public void setCustUu(Long custUu) {
+        this.custUu = custUu;
+    }
+
+    public String getCustName() {
+        return custName;
+    }
+
+    public void setCustName(String custName) {
+        this.custName = custName;
+    }
+
+    public Long getEnUu() {
+        return enUu;
+    }
+
+    public void setEnUu(Long enUu) {
+        this.enUu = enUu;
+    }
+
+    public Long getApDate() {
+        return apDate;
+    }
+
+    public void setApDate(Long apDate) {
+        this.apDate = apDate;
+    }
+
+    public Long getBeginDate() {
+        return beginDate;
+    }
+
+    public void setBeginDate(Long beginDate) {
+        this.beginDate = beginDate;
+    }
+
+    public Long getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Long endDate) {
+        this.endDate = endDate;
+    }
+
+    public String getCheckStatus() {
+        return checkStatus;
+    }
+
+    public void setCheckStatus(String checkStatus) {
+        this.checkStatus = checkStatus;
+    }
+
+    public Double getCheckAmount() {
+        return checkAmount;
+    }
+
+    public void setCheckAmount(Double checkAmount) {
+        this.checkAmount = checkAmount;
+    }
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public Double getRate() {
+        return rate;
+    }
+
+    public void setRate(Double rate) {
+        this.rate = rate;
+    }
+
+    public String getTaxrate() {
+        return taxrate;
+    }
+
+    public void setTaxrate(String taxrate) {
+        this.taxrate = taxrate;
+    }
+
+    public List<SaveOperationDataDetail> getItems() {
+        return items;
+    }
+
+    public void setItems(List<SaveOperationDataDetail> items) {
+        this.items = items;
+    }
+}

+ 200 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/SaveOperationDataDetail.java

@@ -0,0 +1,200 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/27
+ */
+public class SaveOperationDataDetail implements Serializable {
+
+    private String inoutno;
+    private Long inoutnodetno;
+    private String orderClass;
+    private Long orderDetno;
+    private Double checkQty;
+    private Double amount;
+    private Long sourceId;
+    private String sourceTable;
+    private Short status;
+    private String receiveCode;
+    private String receiveName;
+    private String prodCode;
+    private String prodTitle;
+    private String prodUnit;
+    private String prodSpec;
+    private Double taxrate;
+    private String sendcode;
+    private String whname;
+    private Long custUserUU;
+    private Long pidate;
+    private Long sourceDate;
+
+    public String getInoutno() {
+        return inoutno;
+    }
+
+    public void setInoutno(String inoutno) {
+        this.inoutno = inoutno;
+    }
+
+    public Long getInoutnodetno() {
+        return inoutnodetno;
+    }
+
+    public void setInoutnodetno(Long inoutnodetno) {
+        this.inoutnodetno = inoutnodetno;
+    }
+
+    public String getOrderClass() {
+        return orderClass;
+    }
+
+    public void setOrderClass(String orderClass) {
+        this.orderClass = orderClass;
+    }
+
+    public Long getOrderDetno() {
+        return orderDetno;
+    }
+
+    public void setOrderDetno(Long orderDetno) {
+        this.orderDetno = orderDetno;
+    }
+
+    public Double getCheckQty() {
+        return checkQty;
+    }
+
+    public void setCheckQty(Double checkQty) {
+        this.checkQty = checkQty;
+    }
+
+    public Double getAmount() {
+        return amount;
+    }
+
+    public void setAmount(Double amount) {
+        this.amount = amount;
+    }
+
+    public Long getSourceId() {
+        return sourceId;
+    }
+
+    public void setSourceId(Long sourceId) {
+        this.sourceId = sourceId;
+    }
+
+    public String getSourceTable() {
+        return sourceTable;
+    }
+
+    public void setSourceTable(String sourceTable) {
+        this.sourceTable = sourceTable;
+    }
+
+    public Short getStatus() {
+        return status;
+    }
+
+    public void setStatus(Short status) {
+        this.status = status;
+    }
+
+    public String getReceiveCode() {
+        return receiveCode;
+    }
+
+    public void setReceiveCode(String receiveCode) {
+        this.receiveCode = receiveCode;
+    }
+
+    public String getReceiveName() {
+        return receiveName;
+    }
+
+    public void setReceiveName(String receiveName) {
+        this.receiveName = receiveName;
+    }
+
+    public String getProdCode() {
+        return prodCode;
+    }
+
+    public void setProdCode(String prodCode) {
+        this.prodCode = prodCode;
+    }
+
+    public String getProdTitle() {
+        return prodTitle;
+    }
+
+    public void setProdTitle(String prodTitle) {
+        this.prodTitle = prodTitle;
+    }
+
+    public String getProdUnit() {
+        return prodUnit;
+    }
+
+    public void setProdUnit(String prodUnit) {
+        this.prodUnit = prodUnit;
+    }
+
+    public String getProdSpec() {
+        return prodSpec;
+    }
+
+    public void setProdSpec(String prodSpec) {
+        this.prodSpec = prodSpec;
+    }
+
+    public Double getTaxrate() {
+        return taxrate;
+    }
+
+    public void setTaxrate(Double taxrate) {
+        this.taxrate = taxrate;
+    }
+
+    public String getSendcode() {
+        return sendcode;
+    }
+
+    public void setSendcode(String sendcode) {
+        this.sendcode = sendcode;
+    }
+
+    public String getWhname() {
+        return whname;
+    }
+
+    public void setWhname(String whname) {
+        this.whname = whname;
+    }
+
+    public Long getCustUserUU() {
+        return custUserUU;
+    }
+
+    public void setCustUserUU(Long custUserUU) {
+        this.custUserUU = custUserUU;
+    }
+
+    public Long getPidate() {
+        return pidate;
+    }
+
+    public void setPidate(Long pidate) {
+        this.pidate = pidate;
+    }
+
+    public Long getSourceDate() {
+        return sourceDate;
+    }
+
+    public void setSourceDate(Long sourceDate) {
+        this.sourceDate = sourceDate;
+    }
+}

+ 128 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/apcheck/UserBaseInfo.java

@@ -0,0 +1,128 @@
+package com.usoftchina.saas.sale.dto.apcheck;
+
+import java.io.Serializable;
+
+/**
+ * @Description 只包含最基本的信息,用与跟单据关联展现
+ * @Author chenwei
+ * @Date 2019/01/27
+ */
+public class UserBaseInfo implements Serializable {
+
+    /**
+     * 用户UU
+     */
+    private Long userUU;
+
+    /**
+     * 用户姓名
+     */
+    private String userName;
+
+    /**
+     * 密码
+     */
+    private String userPwd;
+
+    /**
+     * 邮箱
+     */
+    private String userEmail;
+
+    /**
+     * 电话
+     */
+    private String userTel;
+
+    /**
+     * 性别
+     */
+    private String userSex;
+
+    /**
+     * imid
+     */
+    private Long userIMId;
+
+    /**
+     * 判断是否被分配
+     */
+    private boolean distribute;
+
+    /**
+     * 判断是否被转移权限
+     */
+    private boolean transfer;
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getUserPwd() {
+        return userPwd;
+    }
+
+    public void setUserPwd(String userPwd) {
+        this.userPwd = userPwd;
+    }
+
+    public String getUserEmail() {
+        return userEmail;
+    }
+
+    public void setUserEmail(String userEmail) {
+        this.userEmail = userEmail;
+    }
+
+    public String getUserTel() {
+        return userTel;
+    }
+
+    public void setUserTel(String userTel) {
+        this.userTel = userTel;
+    }
+
+    public String getUserSex() {
+        return userSex;
+    }
+
+    public void setUserSex(String userSex) {
+        this.userSex = userSex;
+    }
+
+    public Long getUserIMId() {
+        return userIMId;
+    }
+
+    public void setUserIMId(Long userIMId) {
+        this.userIMId = userIMId;
+    }
+
+    public boolean isDistribute() {
+        return distribute;
+    }
+
+    public void setDistribute(boolean distribute) {
+        this.distribute = distribute;
+    }
+
+    public boolean isTransfer() {
+        return transfer;
+    }
+
+    public void setTransfer(boolean transfer) {
+        this.transfer = transfer;
+    }
+}

+ 6 - 0
applications/sale/sale-server/pom.xml

@@ -46,6 +46,12 @@
           <version>1.0.0-SNAPSHOT</version>
         </dependency>
 
+        <dependency>
+          <groupId>b2b-access</groupId>
+          <artifactId>b2b-access-core</artifactId>
+          <version>1.0-SNAPSHOT</version>
+        </dependency>
+
         <!--test-->
         <dependency>
             <groupId>com.usoftchina.saas</groupId>

+ 84 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/B2BApCheckController.java

@@ -0,0 +1,84 @@
+package com.usoftchina.saas.sale.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.sale.dto.apcheck.SaveOperationData;
+import com.usoftchina.saas.sale.service.ApCheckService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Description B2B应收对账
+ * @Author chenwei
+ * @Date 2019/01/28
+ */
+@RestController
+@RequestMapping("/b2b/apCheck")
+public class B2BApCheckController {
+
+    @Autowired
+    private ApCheckService apCheckService;
+
+    /**
+     * 获取应收对账单客户列表
+     * @param count
+     * @param page
+     * @param searchFilter
+     * @param sorting
+     * @return
+     */
+    @GetMapping("/customer")
+    public Result custApcheck(int count, int page, String searchFilter, String sorting){
+        return Result.success(apCheckService.getCustApcheck(count, page, searchFilter, sorting));
+    }
+
+    /**
+     * 获取单个客户对账明细(客户列表点击明细按钮)
+     * @param fromDate
+     * @param endDate
+     * @param customerUU
+     * @param taxRate
+     * @param factory
+     * @param prodTitle
+     * @param suuorname
+     * @param prodSpec
+     * @return
+     */
+    @GetMapping("/getAllByKeywords")
+    public Result getAllByKeywords(Long fromDate, Long endDate, Long customerUU, Double taxRate, String factory,
+                                   String prodTitle, String suuorname, String prodSpec, String currency){
+        return Result.success(apCheckService.getAllByKeywords(fromDate, endDate, customerUU, taxRate, factory, prodTitle, suuorname, prodSpec, currency));
+    }
+
+    /**
+     * 生成对账
+     * @param saveOperationData
+     * @return
+     */
+    @PostMapping("/operation/save")
+    public Result operationSave(@RequestBody SaveOperationData saveOperationData){
+        return Result.success(apCheckService.operationSave(saveOperationData));
+    }
+
+    /**
+     * 对账单列表
+     * @param count
+     * @param page
+     * @param searchFilter
+     * @param sorting
+     * @return
+     */
+    @GetMapping("/info/list")
+    public Result apCheckList(int count, int page, String searchFilter, String sorting){
+        return Result.success(apCheckService.apCheckList(count, page, searchFilter, sorting));
+    }
+
+    /**
+     * 某张对账单明细:
+     * @param id
+     * @return
+     */
+    @GetMapping("/info/{id}")
+    public Result apCheckInfo(@PathVariable("id") Long id){
+        return Result.success(apCheckService.apCheckInfo(id));
+    }
+}

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java

@@ -11,6 +11,7 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.sale.dto.RemindReqDTO;
 import com.usoftchina.saas.sale.dto.RemindRspDTO;
 import com.usoftchina.saas.sale.dto.SaleFormDTO;
+import com.usoftchina.saas.sale.dto.apcheck.SaveOperationData;
 import com.usoftchina.saas.sale.po.SaleList;
 import com.usoftchina.saas.sale.service.SaleService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -226,4 +227,5 @@ public class SaleController {
     public Result saveQuote(@RequestBody PublicInquiryItem publicInquiryItem){
         return Result.success(saleService.saveQuote(publicInquiryItem));
     }
+
 }

+ 25 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ApCheckService.java

@@ -0,0 +1,25 @@
+package com.usoftchina.saas.sale.service;
+
+import com.usoftchina.saas.sale.dto.apcheck.ApCheckProdIO;
+import com.usoftchina.saas.sale.dto.apcheck.CustApcheckData;
+import com.usoftchina.saas.sale.dto.apcheck.PurchaseApCheck;
+import com.usoftchina.saas.sale.dto.apcheck.SaveOperationData;
+import org.springframework.ui.ModelMap;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/28
+ */
+public interface ApCheckService {
+
+    Object getCustApcheck(int count, int page, String searchFilter, String sorting);
+
+    Object getAllByKeywords(Long fromDate, Long endDate, Long customerUU, Double taxRate, String factory,
+                            String prodTitle, String suuorname, String prodSpec, String currency);
+
+    ModelMap operationSave(SaveOperationData saveOperationData);
+
+    Object apCheckInfo(Long id);
+
+    Object apCheckList(int count, int page, String searchFilter, String sorting);
+}

+ 6 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleService.java

@@ -7,10 +7,15 @@ import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.dto.apcheck.ApCheckProdIO;
+import com.usoftchina.saas.sale.dto.apcheck.CustApcheckData;
 import com.usoftchina.saas.sale.dto.RemindReqDTO;
 import com.usoftchina.saas.sale.dto.RemindRspDTO;
 import com.usoftchina.saas.sale.dto.SaleFormDTO;
+import com.usoftchina.saas.sale.dto.apcheck.PurchaseApCheck;
+import com.usoftchina.saas.sale.dto.apcheck.SaveOperationData;
 import com.usoftchina.saas.sale.po.SaleList;
+import org.springframework.ui.ModelMap;
 
 /**
  * @author: guq
@@ -55,4 +60,5 @@ public interface SaleService {
     IPage<RemindRspDTO> findRemindByUserInfo(RemindReqDTO remindReqDTO);
 
     String saveQuote(PublicInquiryItem publicInquiryItem);
+
 }

+ 252 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ApCheckServiceImpl.java

@@ -0,0 +1,252 @@
+package com.usoftchina.saas.sale.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.usoft.b2b.access.entity.UserAccount;
+import com.usoft.b2b.access.utils.AccessUtils;
+import com.usoftchina.saas.account.api.AccountApi;
+import com.usoftchina.saas.account.api.CompanyApi;
+import com.usoftchina.saas.account.dto.AccountDTO;
+import com.usoftchina.saas.account.dto.CompanyDTO;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.sale.dto.apcheck.*;
+import com.usoftchina.saas.sale.service.ApCheckService;
+import com.usoftchina.saas.utils.JsonUtils;
+import com.usoftchina.saas.utils.ObjectUtils;
+import com.usoftchina.saas.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import java.net.URLEncoder;
+import java.util.*;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/28
+ */
+@Service
+public class ApCheckServiceImpl implements ApCheckService {
+
+    @Value("${b2b.baseUrl.common}")
+    private String b2bUrl;
+
+    private final static String SAVEAPCHECKURL = "/sale/apCheck/operation/save";
+    private final static String CUSTAPCHECKURL = "/sale/apCheck/customer";
+    private final static String GETALLBYKEYWORDSURL = "/sale/apCheck/getAllByKeywords";
+    private final static String APCHECKLISTURL = "/sale/apCheck/info/search";
+
+    @Autowired
+    private AccountApi accountApi;
+    @Autowired
+    private CompanyApi companyApi;
+
+
+    @Override
+    public Object getCustApcheck(int count, int page, String searchFilter, String sorting) {
+        Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
+        Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
+        UserAccount account = new UserAccount();
+        account.setAppId("SAAS");
+        account.setUserUU(userUU);
+        account.setSpaceUU(enUU);
+        JSONObject response = null;
+        JSONArray result = new JSONArray();
+        try {
+            String getUrl = b2bUrl + CUSTAPCHECKURL + "?count=" + count + "&page=" + page + "&searchFilter=" + URLEncoder.encode(searchFilter, "UTF-8");
+            if (!StringUtils.isEmpty(sorting)) {
+                getUrl += "&sorting=" + URLEncoder.encode(sorting, "utf-8");
+            }
+            response = AccessUtils.getForObject(getUrl, account, JSONObject.class);
+            JSONArray content = response.getJSONArray("content");
+            if (!content.isEmpty()){
+                for (int i = 0; i < content.size(); i++) {
+                    JSONArray resultSubList = new JSONArray();
+                    JSONObject custApCheckData = content.getJSONObject(i);
+                    JSONArray amountDetailList = custApCheckData.getJSONArray("amountDetailList");
+                    for (int j = 0; j < amountDetailList.size(); j++) {
+                        JSONObject amountDetail = amountDetailList.getJSONObject(j);
+                        amountDetail.put("apId", custApCheckData.getLongValue("id"));       //ID
+                        amountDetail.put("custName", custApCheckData.getJSONObject("myEnterprise").getString("enName"));
+                        amountDetail.put("custUU", custApCheckData.getJSONObject("myEnterprise").getString("uu"));
+                        amountDetail.put("enUU", custApCheckData.getJSONObject("vendorEnterprise").getString("uu"));
+                        resultSubList.add(amountDetail);
+                    }
+                    result.addAll(resultSubList);
+                }
+                response.put("content", result);
+                response.put("totalElement", result.size());
+            }
+        } catch (Exception e) {
+            throw new BizException(80000, e.getMessage());
+        }
+        return response;
+    }
+
+    @Override
+    public Object getAllByKeywords(Long fromDate, Long endDate, Long customerUU, Double taxRate, String factory, String prodTitle, String suuorname, String prodSpec, String currency) {
+        Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
+        Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
+        UserAccount account = new UserAccount();
+        account.setAppId("SAAS");
+        account.setUserUU(userUU);
+        account.setSpaceUU(enUU);
+        String getUrl = b2bUrl + GETALLBYKEYWORDSURL + "?fromDate=" + fromDate + "&endDate=" + endDate + "&customerUU=" + customerUU + "&suuorname=" + suuorname;
+        if (!ObjectUtils.isEmpty(taxRate)){
+            getUrl += "&taxRate=" + taxRate;
+        }
+        if (!ObjectUtils.isEmpty(factory)){
+            getUrl += "&factory=" + factory;
+        }
+        if (!ObjectUtils.isEmpty(prodTitle)){
+            getUrl += "&prodTitle=" + prodTitle;
+        }
+        if (!ObjectUtils.isEmpty(prodSpec)){
+            getUrl += "&prodSpec=" + prodSpec;
+        }
+        JSONObject result = new JSONObject();
+        ApCheckProdIO apCheckProdIO = null;
+        try {
+            apCheckProdIO = AccessUtils.getForObject(getUrl, account, ApCheckProdIO.class);
+            Set<Map<String, String>> currencySet = new HashSet<Map<String, String>>();
+            apCheckProdIO.getThisMonthCount().forEach(apCheckAmount -> {
+                Map<String, String> map = new HashMap<String, String>();
+                map.put(apCheckAmount.getCurrency(), apCheckAmount.getCurrency());
+                currencySet.add(map);
+            });
+            //币别
+            result.put("currencys", currencySet);
+            /* 主表数据 */
+            result.put("main", generateMainData(apCheckProdIO, currency));
+            /* 明细表数据 */
+            result.put("items", apCheckProdIO.getDetails().stream().filter(apCheckProdIODetail -> currency.equals(apCheckProdIODetail.getCurrency())).collect(Collectors.toList()));
+            result.put("data", apCheckProdIO);
+        } catch (Exception e) {
+            throw new BizException(80000, e.getMessage());
+        }
+        return result;
+    }
+
+    private Map<String, Object> generateMainData(ApCheckProdIO apCheckProdIO, String currency){
+        /* 主表数据 */
+        Map<String, Object> mainMap = new HashMap<String, Object>();
+        Optional<ApCheckAmount> optional = null;
+        //本期应收
+        if (apCheckProdIO.getThisMonthCount().size() > 0) {
+            optional = apCheckProdIO.getThisMonthCount().stream().filter(apCheckAmount -> currency.equals(apCheckAmount.getCurrency())).findFirst();
+            mainMap.put("thisMonthCount", optional.isPresent() ? optional.get() : null);
+        }else {
+            mainMap.put("thisMonthCount", null);
+        }
+        //本期已对账
+        if (apCheckProdIO.getThisMonthDoneCount().size() > 0) {
+            optional = apCheckProdIO.getThisMonthDoneCount().stream().filter(apCheckAmount -> currency.equals(apCheckAmount.getCurrency())).findFirst();
+            mainMap.put("thisMonthDoneCount", optional.isPresent() ? optional.get() : null);
+        }else {
+            mainMap.put("thisMonthDoneCount", null);
+        }
+        //本期未对账
+        if (apCheckProdIO.getThisMonthTodoCount().size() > 0) {
+            optional = apCheckProdIO.getThisMonthTodoCount().stream().filter(apCheckAmount -> currency.equals(apCheckAmount.getCurrency())).findFirst();
+            mainMap.put("thisMonthTodoCount", optional.isPresent() ? optional.get() : null);
+        }else {
+            mainMap.put("thisMonthTodoCount", null);
+        }
+        //应收总额
+        if (apCheckProdIO.getTotalCount().size() > 0) {
+            optional = apCheckProdIO.getTotalCount().stream().filter(apCheckAmount -> currency.equals(apCheckAmount.getCurrency())).findFirst();
+            mainMap.put("totalCount", optional.isPresent() ? optional.get() : null);
+        }else {
+            mainMap.put("totalCount", null);
+        }
+        //本期发货
+        if (apCheckProdIO.getThisPeriodSendAmount().size() > 0) {
+            optional = apCheckProdIO.getThisPeriodSendAmount().stream().filter(apCheckAmount -> currency.equals(apCheckAmount.getCurrency())).findFirst();
+            mainMap.put("thisPeriodSendAmount", optional.isPresent() ? optional.get() : null);
+        }else {
+            mainMap.put("thisPeriodSendAmount", null);
+        }
+        //本期已收
+        if (apCheckProdIO.getThisPeriodDoneAmount().size() > 0) {
+            optional = apCheckProdIO.getThisMonthDoneCount().stream().filter(apCheckAmount -> currency.equals(apCheckAmount.getCurrency())).findFirst();
+            mainMap.put("thisPeriodDoneAmount", optional.isPresent() ? optional.get() : null);
+        }else {
+            mainMap.put("thisPeriodDoneAmount", null);
+        }
+        return mainMap;
+    }
+
+    @Override
+    public ModelMap operationSave(SaveOperationData saveOperationData) {
+        Result<AccountDTO> accountResult = accountApi.getAccountById(BaseContextHolder.getUserId());
+        Result<CompanyDTO> companyResult = companyApi.getCompanyById(BaseContextHolder.getCompanyId());
+        ModelMap result = null;
+        if (accountResult.isSuccess() && companyResult.isSuccess()) {
+            Long userUU = accountResult.getData().getUu();
+            Long enUU = companyResult.getData().getUu();
+            UserAccount account = new UserAccount();
+            account.setAppId("SAAS");
+            account.setUserUU(userUU);
+            account.setSpaceUU(enUU);
+            MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
+            map.add("json", JsonUtils.toJsonString(saveOperationData));
+            String url = b2bUrl + SAVEAPCHECKURL;
+            try {
+                result = AccessUtils.postForObject(url, account, ModelMap.class, map);
+            } catch (Exception e){
+                throw new BizException(80000, e.getMessage());
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public Object apCheckInfo(Long id) {
+        Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
+        Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
+        UserAccount account = new UserAccount();
+        account.setAppId("SAAS");
+        account.setUserUU(userUU);
+        account.setSpaceUU(enUU);
+        String url = b2bUrl + "/sale/apCheck/" + id + "/info";
+        JSONObject response = null;
+        Map<String, Object> result = new HashMap<String, Object>();
+        try {
+            response = AccessUtils.getForObject(url, account, JSONObject.class);
+            result.put("items", response.getJSONArray("items"));
+            response.remove("items");
+            result.put("main", response);
+        } catch (Exception e){
+            throw new BizException(80000, e.getMessage());
+        }
+        return result;
+    }
+
+    @Override
+    public Object apCheckList(int count, int page, String searchFilter, String sorting) {
+        Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
+        Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
+        UserAccount account = new UserAccount();
+        account.setAppId("SAAS");
+        account.setUserUU(userUU);
+        account.setSpaceUU(enUU);
+        SPage<PurchaseApCheck> result = null;
+        try {
+            String url = b2bUrl + APCHECKLISTURL + "?count=" + count + "&page=" + page + "&searchFilter=" + URLEncoder.encode(searchFilter, "UTF-8");
+            if (!StringUtils.isEmpty(sorting)) {
+                url += "&sorting=" + URLEncoder.encode(sorting, "utf-8");
+            }
+            result = AccessUtils.getForObject(url, account, SPage.class);
+        } catch (Exception e) {
+            throw new BizException(80000, e.getMessage());
+        }
+        return result;
+    }
+}

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

@@ -23,6 +23,10 @@ import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.api.PurchaseApi;
 import com.usoftchina.saas.sale.dto.*;
+import com.usoftchina.saas.sale.dto.apcheck.ApCheckProdIO;
+import com.usoftchina.saas.sale.dto.apcheck.CustApcheckData;
+import com.usoftchina.saas.sale.dto.apcheck.PurchaseApCheck;
+import com.usoftchina.saas.sale.dto.apcheck.SaveOperationData;
 import com.usoftchina.saas.sale.mapper.*;
 import com.usoftchina.saas.sale.po.Sale;
 import com.usoftchina.saas.sale.po.SaleDetail;

+ 60 - 0
applications/sale/sale-server/src/test/java/com/usoftchina/saas/sale/controller/b2bTest.java

@@ -0,0 +1,60 @@
+package com.usoftchina.saas.sale.controller;
+
+import ch.qos.logback.core.net.SyslogOutputStream;
+import com.usoft.b2b.access.entity.UserAccount;
+import com.usoft.b2b.access.utils.AccessUtils;
+import com.usoftchina.saas.sale.dto.apcheck.CustApcheckData;
+import com.usoftchina.saas.sale.dto.apcheck.SPage;
+import com.usoftchina.saas.utils.JsonUtils;
+import com.usoftchina.saas.utils.StringUtils;
+import org.junit.Test;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import java.net.URLEncoder;
+
+/**
+ * @Description TODO
+ * @Author chenwei
+ * @Date 2019/01/28
+ */
+public class b2bTest {
+
+    @Test
+    public void cookieVisit() throws Exception {
+        UserAccount account = new UserAccount();
+        account.setAppId("SAAS");
+        account.setUserUU(1000003217L);
+        account.setSpaceUU(10041166L);
+        String result = AccessUtils.getForObject("https://rel-b2b.uuzcc.cn/sale/apCheck/5113/info", account, String.class);
+        System.out.println(result);
+    }
+
+    @Test
+    public void testPost() throws Exception {
+        UserAccount account = new UserAccount();
+        account.setAppId("SAAS");
+        account.setUserUU(1000003217L);
+        account.setSpaceUU(10041166L);
+        MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
+        map.add("json", "this is an json");
+        String result = AccessUtils.postForObject("http://10.1.51.24:8088/platform-b2b//product/kind/test", account, String.class, map);
+        System.out.println(result);
+    }
+
+    @Test
+    public void testGet() throws Exception {
+        UserAccount account = new UserAccount();
+        account.setAppId("SAAS");
+        account.setUserUU(1000003217L);
+        account.setSpaceUU(10041559L);
+        SPage<CustApcheckData> result = null;
+        String getUrl = "http://test-b2b.uuzcc.cn/sale/apCheck/customer?count=9&page=1&searchFilter=%7B%22keyword%22%3A%22%22%2C%22fromDate%22%3A1514764800000%2C%22endDate%22%3A1548864000000%7D";
+        /*if (!StringUtils.isEmpty(sorting)) {
+            getUrl += "&sorting=" + URLEncoder.encode(sorting, "utf-8");
+        }*/
+        result = AccessUtils.getForObject(getUrl, account, SPage.class);
+        System.out.println(JsonUtils.toJsonString(result));
+    }
+
+}

+ 45 - 0
applications/sale/sale-server/src/test/java/com/usoftchina/saas/sale/service/ApCheckServiceTest.java

@@ -0,0 +1,45 @@
+package com.usoftchina.saas.sale.service;
+
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.utils.JsonUtils;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.MethodSorters;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/29
+ */
+@SpringBootTest
+@RunWith(SpringJUnit4ClassRunner.class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class ApCheckServiceTest {
+
+    @Autowired
+    private ApCheckService apCheckService;
+
+    @Test
+    public void testA_getCustApcheck(){
+        int count = 9, page = 1;
+        String searchFilter = "{\"fromDate\":\"1514764800000\",\"endDate\":\"1548864000000\"}";
+        BaseContextHolder.setUserId(65L);
+        BaseContextHolder.setCompanyId(371L);
+        Object result = apCheckService.getCustApcheck(count, page, searchFilter, null);
+        System.out.println(JsonUtils.toJsonString(result));
+    }
+
+    @Test
+    public void testB_getAllByKeywords(){
+        Long fromDate = 1514764800000L, endDate = 1548864000000L, uu = 10050690L;
+        BaseContextHolder.setUserId(65L);
+        BaseContextHolder.setCompanyId(371L);
+        String currency = "RMB", custName = "李剑辉7";
+        Object result = apCheckService.getAllByKeywords(fromDate, endDate, uu, null, null, null, custName, null, currency);
+        System.out.println(JsonUtils.toJsonString(result));
+    }
+
+}

+ 4 - 3
applications/transfers/mall-api/src/main/java/com/usoftchina/saas/inquiry/api/InquiryApi.java

@@ -3,6 +3,7 @@ package com.usoftchina.saas.inquiry.api;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.inquiry.po.inquiry.*;
+import feign.Response;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.stereotype.Component;
 import org.springframework.ui.ModelMap;
@@ -115,7 +116,7 @@ public interface InquiryApi {
      * @param useruu    用户uu
      */
     @PostMapping("/buyer/adopt")
-    void adoptQuote(@RequestParam("id") Long id, @RequestParam("status") Short status,
+    Response adoptQuote(@RequestParam("id") Long id, @RequestParam("status") Short status,
                     @RequestParam("enuu") Long enuu, @RequestParam("useruu") Long useruu);
 
     /**
@@ -127,6 +128,6 @@ public interface InquiryApi {
      * @param refusereason  拒绝理由
      */
     @PostMapping("/buyer/refuse")
-    void refuseQuote(@RequestParam("id") Long id, @RequestParam("status") Short status, @RequestParam("enuu") Long enuu,
-                     @RequestParam("useruu") Long useruu, @RequestParam("refusereason") String refusereason);
+    Response refuseQuote(@RequestParam("id") Long id, @RequestParam("status") Short status, @RequestParam("enuu") Long enuu,
+                         @RequestParam("useruu") Long useruu, @RequestParam("refusereason") String refusereason);
 }

+ 11 - 0
applications/transfers/mall-api/src/main/java/com/usoftchina/saas/inquiry/po/enConfig/AddOrUpdateEnterpriseRequest.java

@@ -67,4 +67,15 @@ public class AddOrUpdateEnterpriseRequest {
     public void setAccessSecret(String accessSecret) {
         this.accessSecret = accessSecret;
     }
+
+    public AddOrUpdateEnterpriseRequest(Long enuu, String name, boolean saas, boolean saasPost, String accessSecret) {
+        this.enuu = enuu;
+        this.name = name;
+        this.saas = saas;
+        this.saasPost = saasPost;
+        this.accessSecret = accessSecret;
+    }
+
+    public AddOrUpdateEnterpriseRequest() {
+    }
 }

+ 27 - 0
applications/transfers/mall-api/src/main/java/com/usoftchina/saas/inquiry/po/inquiry/InquiryResult.java

@@ -0,0 +1,27 @@
+package com.usoftchina.saas.inquiry.po.inquiry;
+
+/**
+ * @Author chenwei
+ * @Date 2019/01/24
+ */
+public class InquiryResult {
+
+    private Boolean success;
+    private String message;
+
+    public Boolean getSuccess() {
+        return success;
+    }
+
+    public void setSuccess(Boolean success) {
+        this.success = success;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+}

+ 34 - 2
applications/transfers/mall-api/src/test/java/com/usoftchina/saas/inquiry/test/InquiryApiTest.java

@@ -3,6 +3,7 @@ package com.usoftchina.saas.inquiry.test;
 import com.usoftchina.saas.inquiry.api.InquiryApi;
 import com.usoftchina.saas.inquiry.po.inquiry.*;
 import com.usoftchina.saas.utils.JsonUtils;
+import feign.Response;
 import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -13,6 +14,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 import org.springframework.ui.ModelMap;
 
 import javax.naming.directory.InvalidSearchFilterException;
+import java.io.*;
 import java.util.*;
 
 /**
@@ -159,7 +161,37 @@ public class InquiryApiTest {
     }
 
     @Test
-    public void testH_refuseQuote(){
-        inquiryApi.refuseQuote(0L, new Short("1"), enUU, userUU, "reason");
+    public void testH_refuseQuote() throws IOException {
+        Response response = inquiryApi.refuseQuote(83950L, new Short("0"), 10050689L, 1000027286L, "测试");
+        if (response.status() == 500){
+            //读取内容方式1
+            InputStream in = response.body().asInputStream();
+            char[] bytes = new char[in.available()];
+            InputStreamReader reader = new InputStreamReader(in);
+            int length = reader.read(bytes);
+            System.out.println("result:" + new String(bytes, 0, length));
+            reader.close();
+            in.close();
+            //读取内容方式2
+            Reader reader2 = response.body().asReader();
+            int size = response.body().length();
+            char[] ch = new char[size];
+            int temp = 0, len = 0;
+            while ((temp = reader2.read()) != -1){
+                ch[len] = (char) temp;
+                len++;
+            }
+            reader2.close();
+            System.out.println("result2: ==========" + new String(ch));
+            //方式3
+            BufferedReader bufferedReader = new BufferedReader(response.body().asReader());
+            StringBuilder sb = new StringBuilder();
+            String line = null;
+            while (bufferedReader.readLine() != null ){
+                sb.append(line);
+            }
+            bufferedReader.close();
+            System.out.println("result3: " + sb);
+        }
     }
 }

+ 7 - 0
frontend/saas-web/app/model/main/NavMenu.js

@@ -0,0 +1,7 @@
+Ext.define('saas.model.main.NavMenu', {
+    extend: 'saas.model.Base',
+    fields: [
+        { name: 'text', type: 'string' },
+        { name: 'iconCls', type: 'string' }
+    ],
+});

+ 1 - 1
frontend/saas-web/app/util/BaseUtil.js

@@ -24,8 +24,8 @@ Ext.define('saas.util.BaseUtil', {
                 mainTab.setActiveTab(mainTab.add(panel));
                 Ext.resumeLayouts(true);
             } else {
-                panel.viewConfig = config;
                 mainTab.setActiveTab(panel);
+                panel.fireEvent('activate', null, null, null, config);
             }
         },
 

+ 2 - 2
frontend/saas-web/app/view/core/tab/Controller.js

@@ -22,12 +22,12 @@ Ext.define('saas.view.core.tab.Controller', {
         }
     },
 
-    onTabActivate: function() {
+    onTabActivate: function(tab1, tab2, eOptes, config) {
         var component = this.getView();
         var tabView = component.down('container');
 
         if(tabView && typeof tabView.refresh == 'function') {
-            tabView.refresh();
+            tabView.refresh(tabView, config);
         }
 
         if(!component.resetCloseClick) {

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

@@ -19,7 +19,7 @@ Ext.define('saas.view.document.kind.Kind', {
         reference: 'dataKind',
         value: 'customerkind',
         name : 'segmentedbutton',
-        bind:'{segmented}',
+        bind:'{kindType}',
         items: [{
             name:'customerkind',
             text: '客户',
@@ -121,16 +121,20 @@ Ext.define('saas.view.document.kind.Kind', {
             delUrl: '/api/document/fundinouttype/delete'
         }
     },
-    refresh:function(){
-        var me = this;
-        var grid = me.items.items[0];
-        var button = grid.ownerCt.dockedItems.items[0].down('[name='+grid.ownerCt.ownerCt.viewConfig+']');
-        
-        if(button&&button.xtype!="tbfill"){
-            button.click();
-            me.ownerCt.setTitle(button.typeText);
+    refresh:function(view, config){
+        var me = this,
+        viewModel = me.getViewModel(),
+        kindType,
+        typeText;
+
+        if(config) {
+            kindType = config.kindType;
+            typeText = config.kindText;
+
+            viewModel.set('kindType', kindType);
+            me.ownerCt.setTitle(typeText);
         }
-    }
+    },
 })
 
 

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

@@ -5,6 +5,7 @@ Ext.define('saas.view.document.kind.KindModel', {
     extend: 'Ext.app.ViewModel',
     alias: 'viewmodel.document-kind',
     data: {
+        kindType: 'customerkind',
         title: '客户类型'
     },
     stores: {

+ 14 - 0
frontend/saas-web/app/view/main/MainModel.js

@@ -9,5 +9,19 @@ Ext.define('saas.view.main.MainModel', {
     data: {
         navWidth: 160,
         smallNavWidth: 64,
+    },
+
+    stores: {
+        navMenu: {
+            model: 'saas.model.main.NavMenu',
+            autoLoad: true,
+            proxy: {
+                type: 'ajax',
+                url: 'resources/json/navigation.json',
+                reader: {
+                    type: 'json'
+                }
+            }
+        }
     }
 });

+ 121 - 152
frontend/saas-web/app/view/main/Navigation.js

@@ -1,8 +1,6 @@
 Ext.define('saas.view.main.Navigation', {
-    extend: 'Ext.panel.Panel',
+    extend: 'Ext.view.View',
     xtype: 'main-navigation',
-    ui: 'nav',
-
     reference: 'navigationTreeList',
 
     width: 180,
@@ -12,37 +10,38 @@ Ext.define('saas.view.main.Navigation', {
 
     menuPadding: 0,
 
+    bind: {
+        store: '{navMenu}'
+    },
+
+    renderTpl: [
+        '<div id="{id}-innerCt" data-ref="innerCt" role="presentation">',
+        '{%this.renderContent(out,values)%}',
+        '</div>'
+    ],
+    tpl: ['<ul class="x-navlist">',
+        '<tpl for=".">',
+        '<li class="x-navitem">',
+        '<div class="x-navitem-body">',
+        '<div class="nav-inner-wrap" style="margin-left: 0px;">',
+        '<div class="nav-inner-icon {iconCls}"></div>',
+        '<div class="nav-inner-text">{text}</div>',
+        '</div>',
+        '</div>',
+        '</li>',
+        '</tpl>',
+        '</ul>'
+    ],
+
+    overItemCls: 'x-navitem-over',
+    selectedItemCls: 'x-navitem-selected',
+    singleSelect: true,
+    itemSelector: '.x-navitem',
+
     initComponent: function () {
         var me = this;
-        var view = new Ext.DataView({
-            store: Ext.create('Ext.data.Store', {
-                autoLoad: true,
-                fields: ['text', 'iconCls'],
-                proxy: {
-                    type: 'ajax',
-                    url: 'resources/json/navigation.json',
-                    reader: {
-                        type: 'json'
-                    }
-                }
-            }),
-            tpl: new Ext.XTemplate('<ul class="x-navlist">',
-                '<tpl for=".">',
-                    '<li class="x-navitem">',
-                        '<div class="x-navitem-body">',
-                            '<div class="nav-inner-wrap" style="margin-left: 0px;">',
-                                '<div class="nav-inner-icon {iconCls}"></div>',
-                                '<div class="nav-inner-text">{text}</div>',
-                            '</div>',
-                        '</div>',
-                    '</li>',
-                '</tpl>',
-            '</ul>'),
-            trackOver: true,
-            overItemCls: 'x-navitem-over',
-            selectedItemCls: 'x-navitem-selected',
-            singleSelect: true,
-            itemSelector: '.x-navitem',
+
+        Ext.apply(me, {
             listeners: {
                 itemmouseenter: function(navView, record, navItem, index, e, eOpts) {
                     window.clearTimeout(me.Timer);
@@ -63,98 +62,108 @@ Ext.define('saas.view.main.Navigation', {
                 scope: me
             }
         });
-
-        Ext.apply(me, {
-            items: [view]
-        });
-
-        me.view = view;
-        me.callParent();
+        me.callParent(arguments);
     },
 
-    // clickNavMenu: function (view, record, item, index, e, eOpts) {
-    //     var me = this;
-    //     this.showNavMenu(view, record, item, index, e, eOpts);
-    // },
-
     showNavMenu: function (navView, record, navItem, index, e, eOpts) {
         var me = this,
             recData = record.data,
             d = recData.items || [],
-            menuItems = JSON.parse( JSON.stringify( d ) ),
+            menuItems = JSON.parse(JSON.stringify(d)),
             itemBox = navItem.getBoundingClientRect(),
             pos = [itemBox.left + itemBox.width, itemBox.top],
-            id = recData.id,
-            menuId = 'navMenu-' + id,
+            menuId = 'navMenu-' + record.get('id'),
             menu = Ext.getCmp(menuId);
 
         //获取b2b权限
         var enableB2B = me.ownerCt.ownerCt.getViewModel().get('enableB2B');
 
-        if(enableB2B==null||enableB2B==0||enableB2B=='0'){
-            Ext.each(menuItems,function(item,index){
-                if(item.items.length>0){
-                    var l = item.items.length;
-                    for(var i = 0;i<l;i++){
-                        if(item.items[i].hasOwnProperty('b2b') && item.items[i].b2b == true){
+        Ext.each(menuItems,function(item,index){
+            if(item.items.length>0){
+                var l = item.items.length;
+                for(var i = 0;i<l;i++){
+                    if(item.items[i].hasOwnProperty('b2b')){
+                        if(((!enableB2B || enableB2B == '0') && item.items[i].b2b == true) || (!!enableB2B && item.items[i].b2b == false)) {
                             item.items.splice(i--,1);
                             l--;
                         }
-                    };
-                }
-            })
-        }else {
-            Ext.each(menuItems,function(item,index){
-                if(item.items.length>0){
-                    var l = item.items.length;
-                    for(var i = 0;i<l;i++){
-                        if(item.items[i].hasOwnProperty('b2b') && item.items[i].b2b == false){
-                            item.items.splice(i--,1);
-                            l--;
-                        }
-                    };
-                }
-            })
-        }
-            
+                    }
+                };
+            }
+        })
+
         if (!menu) {
-            var view = new Ext.DataView({
+            view = new Ext.DataView({
                 store: Ext.create('Ext.data.Store', {
                     fields: ['id', 'text', 'addType', 'viewType'],
                     data: menuItems
                 }),
                 tpl: new Ext.XTemplate('<div class="x-navitem-menu">',
                     '<div class="nav-menu-body">',
-                    '<tpl for=".">',
-                    '<div class="menu">',
-                        '<div class="menu-title">',
-                            '<span class="menu-title-text">{text}</span>',
-                        '</div>',
-                        '<div class="menu-content">',
-                            '<tpl for="items">',
-                            '<div class="menuitem">',
-                                '<div class="item-text" data-config="{config}" data-id="{id}" data-text="{text}" data-type="query" data-viewType="{viewType}">',
-                                    '{text}',
+                        '<tpl for=".">',
+                            '<div class="menu">',
+                                '<div class="menu-title">',
+                                    '<span class="menu-title-text">{text}</span>',
+                                '</div>',
+                                '<div class="menu-content">',
+                                    '<tpl for="items">',
+                                        '<div class="menuitem">',
+                                            '<div class="item-text">',
+                                                '{text}',
+                                            '</div>',
+                                            '<tpl if="this.hasAddType(addType)">',
+                                                '<div class="item-icon">新增</div>',
+                                            '</tpl>',
+                                        '</div>',
+                                    '</tpl>',
                                 '</div>',
-                                '<tpl if="{addType}">',
-                                '<div class="item-icon" data-id="{id}" data-text="{text}" data-type="form" data-viewType="{addType}">新增</div>',
-                                '</tpl>',
                             '</div>',
-                            '</tpl>',
-                        '</div>',
-                    '</div>',
-                    '</tpl>',
+                        '</tpl>',
                     '</div>',
-                    '</div>'),
+                '</div>', {
+                    disableFormats: true,
+                    hasAddType: function(addType) {
+                        return !!addType;
+                    }
+                }),
                 trackOver: true,
                 overItemCls: 'menuitem-over',
                 selectedItemCls: 'menuitem-selected',
                 singleSelect: true,
-                itemSelector: 'menu',
-                listeners: {
-                    // boxready: function (view, width, height, eOpts) {
-                    // },
-                }
+                itemSelector: '.menu',
+                /** override */
+                updateIndexes: function(startIndex, endIndex) {
+                    var self = this,
+                        menu = self.up('menu'),
+                        nodes = self.all.elements,
+                        records = self.getViewRange(),
+                        selModel = self.getSelectionModel(),
+                        myId = self.id,
+                        i, j;
+
+                    startIndex = startIndex || 0;
+                    endIndex = endIndex || ((endIndex === 0) ? 0 : (nodes.length - 1));
+                    for (i = startIndex; i <= endIndex; i++) {
+                        let node = nodes[i];
+                        let record = records[i];
+
+                        
+                        let cnodes = node.children[1].children;
+
+                        for(j = 0; j < cnodes.length; j++) {
+                            let cnode = cnodes[j];
+                            let crecord = record.data.items[j];
+                            !!Ext.get(cnode.children[0]) && Ext.get(cnode.children[0]).on('click', function() {
+                                me.openTab('', crecord);
+                                menu.hide();
+                            });
+                            !!Ext.get(cnode.children[1]) && Ext.get(cnode.children[1]).on('click', function() {
+                                me.openTab('add', crecord);
+                                menu.hide();
+                            });
+                        }
+                    }
+                },
             });
             var menu = Ext.create('Ext.menu.Menu', {
                 navView: navView,
@@ -171,17 +180,28 @@ Ext.define('saas.view.main.Navigation', {
         menu.items.items[0].store.removeAll();
         menu.items.items[0].store.loadData(menuItems);
         menu.showAt(pos);
-        me.refresh(menu.items.items[0],pos)
+        me.refreshMenu(menu.items.items[0], pos)
+    },
+
+    openTab: function(type, data) {
+        var viewType = data.viewType,
+            text = data.text,
+            config = data.config,
+            id = data.id,
+            addType = data.addType;
+
+        saas.util.BaseUtil.openTab(type == 'add' ? addType : viewType, text, 'maintab-' + type + '-' + id, config);
+
     },
 
-    refresh:function(view,pos){
+    refreshMenu: function (view, pos) {
         var me = this;
         var menu = view.up('menu'),
-        menuView = view.el.dom.getElementsByClassName('x-navitem-menu')[0],
-        menuBox = menuView.getBoundingClientRect(),
-        menuViewWidth = menuBox.width + me.menuPadding * 2,
-        menuViewHeight = menuBox.height + me.menuPadding * 2,
-        menuItem = menuView.getElementsByClassName('menuitem');
+            menuView = view.el.dom.getElementsByClassName('x-navitem-menu')[0],
+            menuBox = menuView.getBoundingClientRect(),
+            menuViewWidth = menuBox.width + me.menuPadding * 2,
+            menuViewHeight = menuBox.height + me.menuPadding * 2,
+            menuItem = menuView.getElementsByClassName('menuitem');
 
         menu.setX(pos[0]);
         menu.setWidth(menuViewWidth);
@@ -196,57 +216,6 @@ Ext.define('saas.view.main.Navigation', {
         view.el.dom.addEventListener('mouseleave', function (e) {
             menu.navItem.classList.remove(menu.navView.overItemCls);
             menu.hide();
-            // var ex = e.clientX,
-            //     ey = e.clientY,
-            //     box = menuView.getBoundingClientRect(),
-            //     navItem = menu.navItem,
-            //     navBox = navItem.getBoundingClientRect();
-
-            // if ((ex <= box.left && (ey <= (navBox.top - 5) || ey >= (navBox.top + navBox.height))) || ey <= (box.top - 5) || ex >= (box.left + box.width + 5) || ey >= (box.top + box.height + 5)) {
-            //     menu.navItem.classList.remove(menu.navView.overItemCls);
-            //     menu.hide();
-            // }
-        });
-
-        Ext.Array.each(menuItem, function (mi) {
-            var menuItemText = mi.getElementsByClassName('item-text');
-            var menuItemIcon = mi.getElementsByClassName('item-icon');
-
-            Ext.Array.each(menuItemText, function (item) {
-                item.addEventListener('click', function (e) {
-                    var target = e.target,
-                    dataset = target.dataset,
-                    viewType = dataset.viewtype,
-                    type = dataset.type,
-                    text = dataset.text,
-                    config = dataset.config,
-                    id = dataset.id;
-
-                    var tabTitle = text,
-                    tabId = 'maintab-' + type + '-' + id;
-
-                    menu.navItem.classList.remove(menu.navView.overItemCls);
-                    saas.util.BaseUtil.openTab(viewType, tabTitle, tabId,config);
-                    menu.hide();
-                });
-            });
-            Ext.Array.each(menuItemIcon, function (item) {
-                item.addEventListener('click', function (e) {
-                    var target = e.target,
-                    dataset = target.dataset,
-                    viewType = dataset.viewtype,
-                    type = dataset.type,
-                    text = dataset.text,
-                    id = dataset.id;
-
-                    var tabTitle ='新增' + text,
-                    tabId = viewType + '-add';
-
-                    menu.navItem.classList.remove(menu.navView.overItemCls);
-                    saas.util.BaseUtil.openTab(viewType, tabTitle, tabId);
-                    menu.hide();
-                });
-            });
         });
     },
 

+ 78 - 75
frontend/saas-web/app/view/main/Navigation.scss

@@ -6,6 +6,83 @@ $menu-body-background-color: #65678C;
 
 .x-navpanel {
     overflow: visible;
+    background-color: $nav-body-background-color;
+
+    .x-navlist {
+        position: relative;
+        list-style: none;
+        padding: 0;
+        margin: 0;
+        width: 100%;
+
+        .x-navitem {
+            cursor: default;
+            position: relative;
+            list-style: none;
+            padding: 0;
+            margin: 0;
+            outline: none !important;
+            
+            .x-navitem-body {
+
+                .nav-inner-wrap {
+                    position: relative;
+                    overflow: hidden;
+                    list-style: none;
+                    max-height: 60px;
+                    padding: 0 10px;
+                    display: flex;
+
+                    .nav-inner-icon {
+                        color: $nav-font-color;
+                        font-size: 24px;
+                        text-align: center;
+                        margin-left: 22px;
+                        display: inline;
+                        margin-right: 16px;
+
+                        &:before {
+                            line-height: 60px;
+                        }
+                    }
+
+                    .nav-inner-text {
+                        font-size: $nav-font-size;
+                        color: $nav-font-color;
+                        letter-spacing: 4px;
+                        text-align: left;
+                        line-height: 60px;
+                        height: 60px;
+                    }
+                }
+            }
+        }
+        .x-navitem-over {
+            .x-navitem-body {
+                background: #65678C;
+
+                .nav-inner-wrap {
+
+                    &:before {
+                        content: ' ';
+                        position: absolute;
+                        width: 8px;
+                        height: 60px;
+                        background: #34baf6;
+                        left: 0;
+                    }
+
+                    .nav-inner-icon {
+                        color: $nav-font-color-over;
+                    }
+
+                    .nav-inner-text {
+                        color: $nav-font-color-over;
+                    }
+                }
+            }
+        }
+    }
 
     .x-panel-bodyWrap {
         overflow: visible;
@@ -24,81 +101,6 @@ $menu-body-background-color: #65678C;
     
                 .x-autocontainer-innerCt {
     
-                    .x-navlist {
-                        position: relative;
-                        list-style: none;
-                        padding: 0;
-                        margin: 0;
-                        width: 100%;
-    
-                        .x-navitem {
-                            cursor: default;
-                            position: relative;
-                            list-style: none;
-                            padding: 0;
-                            margin: 0;
-                            outline: none !important;
-                            
-                            .x-navitem-body {
-    
-                                .nav-inner-wrap {
-                                    position: relative;
-                                    overflow: hidden;
-                                    list-style: none;
-                                    max-height: 60px;
-                                    padding: 0 10px;
-                                    display: flex;
-    
-                                    .nav-inner-icon {
-                                        color: $nav-font-color;
-                                        font-size: 24px;
-                                        text-align: center;
-                                        margin-left: 22px;
-                                        display: inline;
-                                        margin-right: 16px;
-    
-                                        &:before {
-                                            line-height: 60px;
-                                        }
-                                    }
-    
-                                    .nav-inner-text {
-                                        font-size: $nav-font-size;
-                                        color: $nav-font-color;
-                                        letter-spacing: 4px;
-                                        text-align: left;
-                                        line-height: 60px;
-                                        height: 60px;
-                                    }
-                                }
-                            }
-                        }
-                        .x-navitem-over {
-                            .x-navitem-body {
-                                background: #65678C;
-
-                                .nav-inner-wrap {
-
-                                    &:before {
-                                        content: ' ';
-                                        position: absolute;
-                                        width: 8px;
-                                        height: 60px;
-                                        background: #34baf6;
-                                        left: 0;
-                                    }
-
-                                    .nav-inner-icon {
-                                        color: $nav-font-color-over;
-                                    }
-
-                                    .nav-inner-text {
-                                        color: $nav-font-color-over;
-                                    }
-                                }
-                            }
-                        }
-                    }
                 }
             }
         }
@@ -128,6 +130,7 @@ $menu-body-background-color: #65678C;
             letter-spacing: 1px;
             display: flex;
             flex-direction: column;
+            outline: none !important;
 
             &:nth-child(2) {
                 .menu-title {

+ 125 - 111
frontend/saas-web/app/view/purchase/b2b/quotationList/DataList.js

@@ -1,5 +1,5 @@
 /**
- * 询价信息查询
+ * 采购询价
  */
 Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
     extend: 'saas.view.core.base.BasePanel',
@@ -183,118 +183,11 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
                             text: '操作',
                             dataIndex: 'agreed',
                             renderer:function(val, meta, record,x,y,store, view){
-                                var id = record.get('id');
-                                window.sendMessage = function(id,status,refusereason){
-                                    var params = {
-                                        id:id,
-                                        status:status,
-                                        refusereason:refusereason
-                                    };
-                                    Ext.Ajax.request({  
-                                        url : '/api/purchase/purchase/inquiry/deal',
-                                        timeout: 8000,  
-                                        headers:{
-                                            'Access-Control-Allow-Origin': '*',
-                                            'Authorization':  saas.util.State.get('session').token,
-                                            "Content-Type": 'application/json;charset=UTF-8'
-                                        },
-                                        method: 'POST',
-                                        params:JSON.stringify(params),
-                                        success: function(response, o){
-                                            var res = Ext.decode(response.responseText);
-                                            if(res.success){
-                                                Ext.getCmp('main-tab-panel').getActiveTab().items.items[0].store.loadPage(1);
-                                                saas.util.BaseUtil.showSuccessToast('操作成功');
-                                            }else{
-                                                saas.util.BaseUtil.showErrorToast('操作失败:'+res.message);
-                                            }
-                                        },
-                                        failure: function (response, opts) {
-                                            saas.util.BaseUtil.showErrorToast('操作失败,请重试');
-                                        }
-                                    });
-                                };
-            
-                                window.checkPrice = function(status,id){
-                                    if(status=='0'){
-                                        var panel = view.ownerCt.ownerCmp.ownerCt;
-                                        var win = Ext.create('Ext.window.Window', {  
-                                            renderTo: panel.getEl(),
-                                            cls:'x-window-dbfind', 
-                                            height: 100,
-                                            width: 450,
-                                            modal:true,
-                                            title: '提示',
-                                            bodyPadding: 10,
-                                            constrain: true,
-                                            closable: true,
-                                            layout: {
-                                                type: 'vbox',
-                                                align: 'center'
-                                            },
-                                            items:[{
-                                                xtype:'panel',
-                                                layout:'hbox',
-                                                items:[{
-                                                    margin:'0 10 0 0',
-                                                    labelWidth:60,
-                                                    xtype : "textfield", 
-                                                    name : "refusereason",
-                                                    fieldLabel : "拒绝信息"
-                                                },{
-                                                    margin:'0 0 0 5',
-                                                    xtype:'button',
-                                                    text:'确认',
-                                                    handler:function(b){
-                                                        var refusereason = b.ownerCt.down('[name=refusereason]').value;
-                                                        window.sendMessage(id,status,refusereason);
-                                                        b.ownerCt.ownerCt.close();
-                                                    }
-                                                }]
-                                            }]
-                                        });
-                                        win.show();
-                                    }else if(status=='1'){
-                                        window.sendMessage(id,status,'');
-                                    }
-                                }
-            
-                                window.showRefuse = function(msg){
-                                    var panel = view.ownerCt.ownerCmp.ownerCt;
-                                    var win = Ext.create('Ext.window.Window', {  
-                                        renderTo: panel.getEl(),
-                                        cls:'x-window-dbfind', 
-                                        height: 100,
-                                        width: 450,
-                                        modal:true,
-                                        title: '查看',
-                                        bodyPadding: 10,
-                                        constrain: true,
-                                        closable: true,
-                                        layout: {
-                                            type: 'vbox',
-                                            align: 'center'
-                                        },
-                                        items:[{
-                                            xtype:'panel',
-                                            layout:'hbox',
-                                            items:[{
-                                                margin:'0 10 0 0',
-                                                labelWidth:60,
-                                                xtype : "displayfield", 
-                                                name : "refusereason",
-                                                fieldLabel : "拒绝信息",
-                                                value:msg
-                                            }]
-                                        }]
-                                    });
-                                    win.show();
-                                }
                                 if((!val||val=='')&&val!=0){
                                     //未采纳状态
                                     return '<div style="width:100%;vertical-align: middle;    text-align: center;">'+
-                                                "<input type='button' value='采纳' name='agree' style='border: 1px solid;color:#34baf6;cursor:pointer;background:#fff;' onClick='window.checkPrice(1,"+id+")'>"+
-                                                "<input type='button' value='拒绝' name='disagree' style='margin:0 0 0 20px;border: 1px solid;color:#ff0000;cursor:pointer;background:#fff;' onClick='window.checkPrice(0,"+id+")'>"+
+                                                "<input type='button' value='采纳' name='agree' style='border: 1px solid;color:#34baf6;cursor:pointer;background:#fff;'>"+
+                                                "<input type='button' value='拒绝' name='disagree' style='margin:0 0 0 20px;border: 1px solid;color:#ff0000;cursor:pointer;background:#fff;'>"+
                                             '</div>';
                                 }else if(val==1||val=='1'){
                                     return '<div style="color:#34baf6;width:100%;vertical-align: middle;    text-align: center;">已采纳</div>'
@@ -304,10 +197,23 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
                                         return '<div style="color:#ff6c00;width:100%;vertical-align: middle;    text-align: center;">已拒绝</div>'
                                     }else{
                                         return  '<div style="width:100%;vertical-align: middle; text-align: center;">'+
-                                                    "<input type='button' value='查看拒绝理由' name='showRefuse' style='border: 1px solid;color:#ff6c00;cursor:pointer;background:#fff;' onClick='window.showRefuse("+refusereason+")'></input>"+
+                                                    "<input type='button' value='查看拒绝理由' name='showRefuse' style='border: 1px solid;color:#ff6c00;cursor:pointer;background:#fff;'></input>"+
                                                 '</div>';
                                     }
                                 }
+                            },
+                            listeners: {
+                                click: function (tableView, td, rowIdx, colIdx, e, model, tr) {
+                                    let name = event.target.name;
+                                    let id = model.data.id;
+                                    if(name == 'agree') {
+                                        me.checkPrice(1, id);
+                                    }else if(name == 'disagree') {
+                                        me.checkPrice(0, id);
+                                    }else if(name == 'showRefuse') {
+                                        me.showRefuse(model.data.refusereason);
+                                    }
+                                },
                             }
                         }]
                     }
@@ -373,6 +279,114 @@ Ext.define('saas.view.purchase.b2b.quotationList.DataList', {
         this.callParent(arguments);
     },
 
+    checkPrice: function(status,id){
+        var me = this;
+        if(status=='0'){
+            var win = Ext.create('Ext.window.Window', {  
+                renderTo: me.getEl(),
+                cls:'x-window-dbfind', 
+                height: 100,
+                width: 450,
+                modal:true,
+                title: '提示',
+                bodyPadding: 10,
+                constrain: true,
+                closable: true,
+                layout: {
+                    type: 'vbox',
+                    align: 'center'
+                },
+                items:[{
+                    xtype:'panel',
+                    layout:'hbox',
+                    items:[{
+                        margin:'0 10 0 0',
+                        labelWidth:60,
+                        xtype : "textfield", 
+                        name : "refusereason",
+                        fieldLabel : "拒绝信息"
+                    },{
+                        margin:'0 0 0 5',
+                        xtype:'button',
+                        text:'确认',
+                        handler:function(b){
+                            var refusereason = b.ownerCt.down('[name=refusereason]').value;
+                            me.sendMessage(id,status,refusereason);
+                            b.ownerCt.ownerCt.close();
+                        }
+                    }]
+                }]
+            });
+            win.show();
+        }else if(status=='1'){
+            me.sendMessage(id,status,'');
+        }
+    },
+
+    showRefuse: function(msg){
+        var me = this;
+        var win = Ext.create('Ext.window.Window', {  
+            renderTo: me.getEl(),
+            cls:'x-window-dbfind', 
+            height: 100,
+            width: 450,
+            modal:true,
+            title: '查看',
+            bodyPadding: 10,
+            constrain: true,
+            closable: true,
+            layout: {
+                type: 'vbox',
+                align: 'center'
+            },
+            items:[{
+                xtype:'panel',
+                layout:'hbox',
+                items:[{
+                    margin:'0 10 0 0',
+                    labelWidth:60,
+                    xtype : "displayfield", 
+                    name : "refusereason",
+                    fieldLabel : "拒绝信息",
+                    value:msg
+                }]
+            }]
+        });
+        win.show();
+    },
+
+    sendMessage: function(id,status,refusereason){
+        var me = this;
+        var params = {
+            id:id,
+            status:status,
+            refusereason:refusereason
+        };
+        Ext.Ajax.request({  
+            url : '/api/purchase/purchase/inquiry/deal',
+            timeout: 8000,  
+            headers:{
+                'Access-Control-Allow-Origin': '*',
+                'Authorization':  saas.util.State.get('session').token,
+                "Content-Type": 'application/json;charset=UTF-8'
+            },
+            method: 'POST',
+            params:JSON.stringify(params),
+            success: function(response, o){
+                var res = Ext.decode(response.responseText);
+                if(res.success){
+                    me.down('grid').store.loadPage(1);
+                    saas.util.BaseUtil.showSuccessToast('操作成功');
+                }else{
+                    saas.util.BaseUtil.showErrorToast('操作失败:'+res.message);
+                }
+            },
+            failure: function (response, opts) {
+                saas.util.BaseUtil.showErrorToast('操作失败,请重试');
+            }
+        });
+    },
+
     /**
      * 处理部分字段值
      */

+ 4 - 0
frontend/saas-web/app/view/purchase/b2b/sendQuotation/DataList.js

@@ -29,12 +29,16 @@ Ext.define('saas.view.purchase.b2b.sendQuotation.DataList', {
                 xtype: 'numberfield',
                 decimalPrecision:0,
                 minValue:0,
+                maxValue: 999,
+                vtype: 'positiveNumber',
                 ignore: true,
+                allowBlank: false,
                 fieldLabel : '报价截至天数'
             },{
                 cls:'x-formpanel-btn-blue',
                 xtype:'button',
                 text:'发起询价',
+                formBind: true,
                 listeners: {
                     click: function(){
                         var p = this.ownerCt.ownerCt;

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

@@ -110,7 +110,7 @@ Ext.define('saas.view.sale.b2b.Business', {
                     dataIndex: 'prodSpec',
                     width: 200
                 }, {
-                    text: '物料单位',
+                    text: '单位',
                     dataIndex: 'prodUnit',
                     width: 65
                 }, {

+ 45 - 13
frontend/saas-web/app/view/sale/b2b/QuoteWin.js

@@ -23,26 +23,54 @@ Ext.define('saas.view.sale.b2b.QuoteWin', {
                     margin: '0 0 10 0',
                     labelAlign: 'right',
                     labelWidth: 90,
-                    columnWidth: 0.25,
+                    columnWidth: 0.5,
                 },
                 isValid: function (values) {
                     var leadtimeField = this.getForm().findField('leadtime');
                     var taxrateField = this.getForm().findField('taxrate');
                     var grid = this.down('grid');
                     var gridData = grid.store.getData().items;
-                    var flag = gridData.length > 0;
+                    var count = gridData.length > 0;
+
+                    if(leadtimeField.getValue() == undefined) {
+                        saas.util.BaseUtil.showErrorToast('交期不可为空');
+                        return false;
+                    }
+
+                    if(leadtimeField.getValue() <= 0) {
+                        saas.util.BaseUtil.showErrorToast('交期必须大于零');
+                        return false;
+                    }
+
+                    if(taxrateField.getValue() == undefined) {
+                        saas.util.BaseUtil.showErrorToast('税率不可为空');
+                        return false;
+                    }
+
+                    if(taxrateField.getValue() <= 0) {
+                        saas.util.BaseUtil.showErrorToast('税率必须大于零');
+                        return false;
+                    }
+
+                    if(!count) {
+                        saas.util.BaseUtil.showErrorToast('梯度单价不可为空');
+                        return false;
+                    }
 
                     for (var x = 0; x < gridData.length; x++) {
                         var d = gridData[x];
-                        if (!d.get('lapQty') || !d.get('price')) {
-                            flag = false
+                        var idx = d.get('no');
+                        if (!d.get('lapQty')) {
+                            saas.util.BaseUtil.showErrorToast('序号为' + idx + '的行梯度有误');
+                            return false;
+                        }
+                        if(!d.get('price')) {
+                            saas.util.BaseUtil.showErrorToast('序号为' + idx + '的行单价有误');
+                            return false;
                         }
                     }
 
-                    if(flag) {
-                        flag = leadtimeField.getValue() && taxrateField.getValue();
-                    }
-                    return flag;
+                    return true;
                 },
                 items: [{
                     xtype: 'textfield',
@@ -73,14 +101,15 @@ Ext.define('saas.view.sale.b2b.QuoteWin', {
                     fieldLabel: '交期(天)',
                     name: 'leadtime',
                     allowBlank: false,
+                    vtype: 'positiveNumber',
                     beforeLabelTextTpl: "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>"
                 }, {
                     xtype: 'numberfield',
                     fieldLabel: '税率',
                     name: 'taxrate',
-                    minValue: 0,
                     maxValue: 100,
                     allowBlank: false,
+                    vtype: 'positiveNumber',
                     beforeLabelTextTpl: "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>"
                 }, {
                     xtype: 'detailGridField',
@@ -137,9 +166,9 @@ Ext.define('saas.view.sale.b2b.QuoteWin', {
             }],
             buttonAlign: 'center',
             buttons: [{
-                text: quoted && record.get('qutations') && record.get('qutations').agreed == 0 ? '重新发起报价' : '确定',
+                text: '确定',
                 handler: function () {
-                    if(quoted && record.get('qutations') && record.get('qutations').agreed != 0) {
+                    if(quoted && record.get('qutations')) {
                         me.close();
                         return;
                     }
@@ -154,8 +183,6 @@ Ext.define('saas.view.sale.b2b.QuoteWin', {
                             return r.data;
                         })
                         me.onQuote(values);
-                    } else {
-                        saas.util.BaseUtil.showErrorToast('表单校验失败,请检查字段是否合法');
                     }
                 }
             }, {
@@ -183,6 +210,11 @@ Ext.define('saas.view.sale.b2b.QuoteWin', {
             storeData = [];
 
             if(quoted) {
+                leadtimeField.setReadOnly(true);
+                taxrateField.setReadOnly(true);
+
+                grid.setGridDisabled();
+
                 leadtimeField.setValue(qutations.leadTime);
                 taxrateField.setValue(qutations.taxRate);
                 storeData = qutations.replies.map(function(r, i) {

+ 33 - 4
frontend/saas-web/resources/json/navigation.json

@@ -1,7 +1,9 @@
 [{
+    "id": "nav-purchase",
     "text": "采购",
     "iconCls": "x-sa sa-purchase",
     "items": [{
+        "id": "nav-purchase-1",
         "text": "制单",
         "items": [{
             "id": "purchase",
@@ -35,6 +37,7 @@
             "viewType": "purchase-b2b-reconciliation-datalist"
         }]
     }, {
+        "id": "nav-purchase-2",
         "text": "报表",
         "items": [{
             "id": "report-purchase",
@@ -52,9 +55,11 @@
         }]
     }]
 }, {
+    "id": "nav-sale",
     "text": "销售",
     "iconCls": "x-sa sa-tag",
     "items": [{
+        "id": "nav-sale-1",
         "text": "制单",
         "items": [{
             "id": "sale",
@@ -98,6 +103,7 @@
             "viewType": "sale-b2b-recdatalist"
         }]
     }, {
+        "id": "nav-sale-2",
         "text": "报表",
         "items": [{
             "id": "report-sale",
@@ -123,9 +129,11 @@
         }]
     }]
 }, {
+    "id": "nav-stock",
     "text": "库存",
     "iconCls": "x-sa sa-bar",
     "items": [{
+        "id": "nav-stock-1",
         "text": "制单",
         "items": [{
             "id": "appropriationInOut",
@@ -153,6 +161,7 @@
             "viewType": "stock-inventory-editdatalist"
         }]
     }, {
+        "id": "nav-stock-2",
         "text": "报表",
         "items": [{
             "text": "物料出入库明细表",
@@ -169,9 +178,11 @@
         }]
     }]
 }, {
+    "id": "nav-money",
     "text": "资金",
     "iconCls": "x-sa sa-money",
     "items": [{
+        "id": "nav-money-1",
         "text": "制单",
         "items": [{
             "id": "recBbalance",
@@ -205,6 +216,7 @@
             "viewType": "money-fundtransfer-querypanel"
         }]
     }, {
+        "id": "nav-money-2",
         "text": "报表",
         "items": [{
             "text": "应收总账",
@@ -237,9 +249,11 @@
         }]
     }]
 }, {
+    "id": "nav-document",
     "text": "资料",
     "iconCls": "x-sa sa-info",
     "items": [{
+        "id": "nav-document-1",
         "text": "基础资料",
         "items": [{
             "id":"vendor-list-formpanel",
@@ -293,9 +307,13 @@
             "leaf": true
         }]
     }, {
+        "id": "nav-document-2",
         "text": "辅助资料",
         "items": [{
-            "config":"vendorkind",
+            "config": {
+                "kindType": "vendorkind",
+                "kindText": "供应商类型"
+            },
             "id":"document-kind",
             "text": "供应商类型",
             "viewType": "document-kind",
@@ -306,7 +324,10 @@
             "viewType": "document-address-datalist",
             "leaf": true
         }, {
-            "config":"customerkind",
+            "config": {
+                "kindType": "customerkind",
+                "kindText": "客户类型"
+            },
             "id":"document-kind",
             "text": "客户类型",
             "viewType": "document-kind",
@@ -317,7 +338,10 @@
             "viewType": "document-productunit-datalist",
             "leaf": true
         }, {
-            "config":"productkind",
+            "config": {
+                "kindType": "productkind",
+                "kindText": "物料类型"
+            },
             "id":"document-kind",
             "text": "物料类型",
             "viewType": "document-kind",
@@ -328,7 +352,10 @@
             "viewType": "document-productbrand-datalist",
             "leaf": true
         }, {
-            "config":"inoutkind",
+            "config": {
+                "kindType": "inoutkind",
+                "kindText": "收支类别"
+            },
             "id":"document-kind",
             "text": "收支类别",
             "viewType": "document-kind",
@@ -336,9 +363,11 @@
         }]
     }]
 }, {
+    "id": "nav-setting",
     "text": "设置",
     "iconCls": "x-sa sa-setting",
     "items": [{
+        "id": "nav-setting-1",
         "text": "系统设置",
         "items": [{  
             "id":"sys-manager-formpanel",