Browse Source

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

chenw 7 years ago
parent
commit
16f4c24125
100 changed files with 2423 additions and 785 deletions
  1. 2 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ListReqDTO.java
  2. 6 3
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  3. 10 8
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java
  4. 36 27
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java
  5. 46 6
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java
  6. 2 2
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  7. 9 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  8. 20 0
      applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationDTO.java
  9. 29 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/MoneyReportColltroller.java
  10. 10 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/VerificationController.java
  11. 4 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java
  12. 12 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustmonthMapper.java
  13. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustomerCheckViewMapper.java
  14. 17 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PayablesdetailMapper.java
  15. 16 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ReceivablesdetailMapper.java
  16. 12 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendmonthMapper.java
  17. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendorAcountViewMapper.java
  18. 0 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/AccountDetailsView.java
  19. 103 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java
  20. 175 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Payablesdetail.java
  21. 175 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Receivablesdetail.java
  22. 103 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java
  23. 20 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verification.java
  24. 4 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/MoneyReportService.java
  25. 202 60
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java
  26. 41 41
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  27. 46 46
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  28. 10 13
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  29. 31 0
      applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml
  30. 45 0
      applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml
  31. 2 1
      applications/money/money-server/src/main/resources/mapper/CustomerCheckViewMapper.xml
  32. 68 0
      applications/money/money-server/src/main/resources/mapper/PayablesdetailMapper.xml
  33. 67 0
      applications/money/money-server/src/main/resources/mapper/ReceivablesdetailMapper.xml
  34. 42 0
      applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml
  35. 3 2
      applications/money/money-server/src/main/resources/mapper/VendorAcountViewMapper.xml
  36. 19 1
      applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml
  37. 2 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java
  38. 6 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java
  39. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java
  40. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  41. 76 43
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  42. 1 0
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  43. 26 6
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  44. 2 2
      applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml
  45. 7 4
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  46. 1 1
      frontend/saas-portal-web/config/index.js
  47. 1 1
      frontend/saas-portal-web/src/components/conenter/addgongsi.vue
  48. 3 2
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  49. 18 35
      frontend/saas-portal-web/src/components/conenter/home.vue
  50. 17 6
      frontend/saas-portal-web/src/components/conenter/problem.vue
  51. 1 1
      frontend/saas-portal-web/src/components/footer/footer.vue
  52. 0 25
      frontend/saas-portal-web/src/pages/cell/cell.html
  53. 0 0
      frontend/saas-portal-web/src/pages/cell/cell.js
  54. 0 15
      frontend/saas-portal-web/src/pages/cell/cell.vue
  55. 1 1
      frontend/saas-portal-web/src/pages/index/index.html
  56. BIN
      frontend/saas-portal-web/static/img/assets/1@2x.png
  57. BIN
      frontend/saas-portal-web/static/img/assets/2@3x.png
  58. BIN
      frontend/saas-portal-web/static/img/assets/3@2x.png
  59. BIN
      frontend/saas-portal-web/static/img/gongneng/Group 32.png
  60. BIN
      frontend/saas-portal-web/static/img/logo_w.png
  61. BIN
      frontend/saas-portal-web/static/img/qr-tech.png
  62. 9 2
      frontend/saas-web/app/Application.scss
  63. 3 0
      frontend/saas-web/app/view/core/base/ImportWindow.js
  64. 4 3
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  65. 4 0
      frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js
  66. 1 0
      frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js
  67. 1 1
      frontend/saas-web/app/view/core/form/FormPanel.js
  68. 7 2
      frontend/saas-web/app/view/core/form/FormPanelController.js
  69. 0 1
      frontend/saas-web/app/view/core/form/MseeageLog.js
  70. 37 24
      frontend/saas-web/app/view/core/form/MultiCombo.js
  71. 2 0
      frontend/saas-web/app/view/core/form/field/ConDateField.js
  72. 81 0
      frontend/saas-web/app/view/core/form/field/ConMonthField.js
  73. 10 14
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  74. 12 9
      frontend/saas-web/app/view/core/form/field/Month.js
  75. 1 1
      frontend/saas-web/app/view/core/query/QueryFormPanel.js
  76. 5 0
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  77. 293 276
      frontend/saas-web/app/view/core/report/ReportPanel.js
  78. 4 4
      frontend/saas-web/app/view/core/report/ReportPanelController.js
  79. 1 0
      frontend/saas-web/app/view/document/bankinformation/Window.js
  80. 4 6
      frontend/saas-web/app/view/document/bom/BasePanel.js
  81. 0 6
      frontend/saas-web/app/view/document/bom/FormController.js
  82. 8 13
      frontend/saas-web/app/view/document/customer/BasePanel.js
  83. 1 0
      frontend/saas-web/app/view/document/employee/Window.js
  84. 11 8
      frontend/saas-web/app/view/document/kind/ChildForm.js
  85. 4 11
      frontend/saas-web/app/view/document/product/BasePanel.js
  86. 2 1
      frontend/saas-web/app/view/document/product/FormController.js
  87. 7 11
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  88. 1 0
      frontend/saas-web/app/view/document/warehouse/Window.js
  89. 5 3
      frontend/saas-web/app/view/home/Home.js
  90. 82 21
      frontend/saas-web/app/view/home/HomeModel.js
  91. 147 0
      frontend/saas-web/app/view/home/charts/KeyData.js
  92. 111 0
      frontend/saas-web/app/view/home/charts/KeyData.scss
  93. 1 1
      frontend/saas-web/app/view/home/charts/MonthPurchase.js
  94. 1 1
      frontend/saas-web/app/view/home/infoCardList/PurchaseIn.js
  95. 1 1
      frontend/saas-web/app/view/home/infoCardList/SaleOut.js
  96. 1 1
      frontend/saas-web/app/view/main/Main.js
  97. 2 2
      frontend/saas-web/app/view/main/Main.scss
  98. 2 2
      frontend/saas-web/app/view/main/MainController.js
  99. 1 1
      frontend/saas-web/app/view/main/MainModel.js
  100. 1 0
      frontend/saas-web/app/view/main/Navigation.scss

+ 2 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ListReqDTO.java

@@ -36,7 +36,8 @@ public class ListReqDTO implements Serializable {
                     JSONObject obj = (JSONObject) jsonArray.get(i);
                     field = obj.get("field");
                     operation = obj.get("operation");
-                    if (null != field && null != operation && !"".equals(field) && !"".equals(operation)) {
+                    //
+                    if (null != field && null != operation && !"".equals(field) && !"".equals(operation) && !operation.toString().startsWith("customize")) {
                         fieldSql = new StringBuilder("'{");
                         fieldSql.append("\"" + field + "\":'");
                         fieldSql.append(",");

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

@@ -74,19 +74,22 @@ public enum BizExceptionCode implements BaseExceptionCode {
 
     //销售
     SALE_ALL_TURNOUT(72000, "该销售单已全部转出货,无法转出货单"),
-    SALE_CLOSE(72001, "单据已关闭,无法进行操作"),
+    SALE_CLOSE(72001, "单据已关闭,无法%s"),
     SALE_YQTYBEYONDQTY(72001, "明细行已转数量大于数量"),
     SALE_NULL_BILL(72002, "单据不存在或者明细为空"),
     SALEOUT_ALL_TURNIN(72003, "该出货单已全部转退货,无法转销售退货单"),
-    SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作"),
+    SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作"),
     SALEOUT_POST_ERROR(72005,"编号:<u>%s</u>处理失败,%s"),
     SALEOUT_UNAUDIT_ERROR(72006,"销售订单已转出货单,无法反审核"),
     SALE_ORDER_HASAUDIT(72003, "存在已审核单据,单据编号:%s"),
     SALE_EXISTS_PURCHASE(72004, "存在已转的采购单据,单据编号:%s"),
-    SALE_ALREADY_UNAUDIT(72007, "单据状态为未审核,无法反审核"),
+    SALE_ALREADY_UNAUDIT(72007, "反审核失败!该单据非审核状态"),
     SALE_CUST_CLOSE(72008, "客户已关闭,无法审核"),
     SALE_ORDER_ISUNAUDIT(72009, "存在未审核单据,单据编号:%s"),
     SALE_ORDER_ISCOLSED(72010, "存在已关闭单据,单据编号:%s"),
+    SALE_ORDER_CUSTBANDED(72011, "存在已禁用客户,无法%s,单据编号:"),
+    SALE_CUSTBANDED(72013, "存在已禁用客户,无法%s"),
+    SALE_AUDITED(72014,"审核失败!该单据已审核"),
     //资金
     PAYBALANCE_OUTNOWBALANCE(74001,"本次核销金额不能大于未核销金额"),
     PAYBALANCE_UNIQUESOURCECODE(74002, "保存失败!不能选择重复的源单"),

+ 10 - 8
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java

@@ -30,26 +30,28 @@ public class CommonController {
     }
 
     @PostMapping("/action/audit")
-    public DeferredResult commonAudit(@RequestParam("table") String table, @RequestParam("keyvalue") String keyvalue, @RequestParam("status") String status,
+    public void commonAudit(@RequestParam("table") String table, @RequestParam("keyvalue") String keyvalue, @RequestParam("status") String status,
                                       @RequestParam("statuscode") String statuscode, @RequestParam("auditdate") String auditdate, @RequestParam("auditman") String auditman) {
 
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> commonService.commonAudit(table, keyvalue, status, statuscode, auditdate, auditman))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        commonService.commonAudit(table, keyvalue, status, statuscode, auditdate, auditman);
     }
 
     @PostMapping("/action/resAudit")
-    public DeferredResult commonResAudit(@RequestParam("table") String table, @RequestParam("keyvalue") String keyvalue, @RequestParam("status") String status,
+    public void commonResAudit(@RequestParam("table") String table, @RequestParam("keyvalue") String keyvalue, @RequestParam("status") String status,
                                       @RequestParam("statuscode") String statuscode, @RequestParam("auditdate") String auditdate, @RequestParam("auditman") String auditman) {
 
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+       /* DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> commonService.commonResAudit(table, keyvalue, status, statuscode, auditdate, auditman))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        commonService.commonResAudit(table, keyvalue, status, statuscode, auditdate, auditman);
     }
 
-    @GetMapping("/timeout/test")
+    /*@GetMapping("/timeout/test")
     public void timeout(@RequestParam("time") Long time){
         try {
             System.out.println("进入时间:" + time);
@@ -58,5 +60,5 @@ public class CommonController {
         }catch (Exception e){
             e.printStackTrace();
         }
-    }
+    }*/
 }

+ 36 - 27
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java

@@ -38,75 +38,83 @@ public class MessageLogController {
     }
 
     @RequestMapping("/save")
-    public DeferredResult<String> save(@RequestBody DocBaseDTO baseDTO) {
+    public void save(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+       /* DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.save(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.save(baseDTO);
     }
 
     @RequestMapping("/update")
-    public DeferredResult<String> update(@RequestBody DocBaseDTO baseDTO) {
+    public void update(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+       /* DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.update(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.update(baseDTO);
     }
 
     @RequestMapping("/delete")
-    public DeferredResult<String> delete(@RequestBody DocBaseDTO baseDTO) {
+    public void delete(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.delete(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.delete(baseDTO);
     }
 
     @RequestMapping("/deleteDetail")
-    public DeferredResult<String> deleteDetail(@RequestBody DocBaseDTO baseDTO) {
+    public void deleteDetail(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.deleteDetail(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.deleteDetail(baseDTO);
     }
 
     @RequestMapping("/audit")
-    public DeferredResult<String> audit(@RequestBody DocBaseDTO baseDTO) {
+    public void audit(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.audit(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.audit(baseDTO);
     }
 
     @RequestMapping("/unAudit")
-    public DeferredResult<String> unAudit(@RequestBody DocBaseDTO baseDTO) {
+    public void unAudit(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.unAudit(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.unAudit(baseDTO);
     }
 
     @RequestMapping("/close")
-    public DeferredResult<String> close(@RequestBody DocBaseDTO baseDTO) {
+    public void close(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.close(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.close(baseDTO);
     }
 
     @RequestMapping("/open")
-    public DeferredResult<String> open(@RequestBody DocBaseDTO baseDTO) {
+    public void open(@RequestBody DocBaseDTO baseDTO) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         CompletableFuture.supplyAsync(() -> messageLogService.open(baseDTO))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.open(baseDTO);
     }
 
     /**
@@ -117,12 +125,13 @@ public class MessageLogController {
     * @Date: 2018/10/25
     */
     @RequestMapping("/customizeLog")
-    public DeferredResult<String> customizeLog(@RequestBody DocBaseDTO baseDTO, @RequestParam Operation operation) {
+    public void customizeLog(@RequestBody DocBaseDTO baseDTO, @RequestParam Operation operation) {
         // Create the deferredResult and initiate a callback object, task, with it
-        DeferredResult<String> deferredResult = new DeferredResult<>();
+        /*DeferredResult<String> deferredResult = new DeferredResult<>();
         System.out.println(operation.getTitle() + "  : " + operation.getResult());
         CompletableFuture.supplyAsync(() -> messageLogService.customizeLog(baseDTO, operation))
                 .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
-        return deferredResult;
+        return deferredResult;*/
+        messageLogService.customizeLog(baseDTO, operation);
     }
 }

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.commons.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
 import com.usoftchina.saas.commons.dto.ProductBaseDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.mapper.DataImportDetailMapper;
@@ -25,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 /**
  * @author: guq
@@ -74,6 +76,7 @@ public class ExcelServiceImpl implements ExcelService{
     }
 
     @Override
+    @Transactional
     public Integer parseTemplet(Workbook wb, String caller) {
         if (wb == null || StringUtils.isEmpty(caller)) {
             throw new BizException(BizExceptionCode.NULL_DATA);
@@ -112,19 +115,19 @@ public class ExcelServiceImpl implements ExcelService{
         //获取最大列数
         int colnum = row.getPhysicalNumberOfCells();
         String key = null;
+        Map<String,String> map = null;
         //添加keys
-        for (int j = 0;j < colnum; j++){
+        for (int j = 0; j < colnum; j++){
             key = (String) getCellFormatValue(row.getCell(j));
             keys.add(key);
         }
         //存储数据
         for (int i = 2; i < rownum; i++) {
-            Map<String,String> map = new LinkedHashMap<String,String>();
+            map = new LinkedHashMap<String,String>();
             row = sheet.getRow(i);
             if(row !=null){
                 for (int j = 0;j < colnum; j++){
                     cellData = (String) getCellFormatValue(row.getCell(j));
-                    //检测字段必填与否
                     map.put(keys.get(j), cellData);
                 }
             }else{
@@ -134,6 +137,7 @@ public class ExcelServiceImpl implements ExcelService{
         }
         dataImportMapper.insertSelective(di);
         Integer keyvalue = di.getDi_id();
+        List<String> validateCode = Lists.newArrayList();
         //数据转换成字段
         if (!CollectionUtils.isEmpty(datas)) {
             StringBuilder err = new StringBuilder();
@@ -169,6 +173,7 @@ public class ExcelServiceImpl implements ExcelService{
                                mainData = new JSONObject();
                                codeValue = value;
                                difference = true;
+                               validateCode.add(codeValue);
                            }
                            //检查是否是同一单
                            if (set.isCodefield() && data.get("*" + set.getDescription()).equals("")) {
@@ -191,6 +196,10 @@ public class ExcelServiceImpl implements ExcelService{
                                    break;
                                }
                            }
+                           //如果为数字类型且为空默认赋值0
+                           if ("number".equals(set.getType()) && StringUtils.isEmpty(value)) {
+                                value = "0";
+                           }
                            //插入主表数据
                            if (null != mainData) {
                                mainData.put(set.getField(), value);
@@ -213,7 +222,8 @@ public class ExcelServiceImpl implements ExcelService{
                                value = data.get(set.getDescription());
                            }
                            if ("true".equals(set.getNecessary()) && value.equals("")) {
-                               err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
+                               detailData = null;
+                               //err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
                                break;
                            }
                            //检测日期类型是否规范
@@ -224,16 +234,28 @@ public class ExcelServiceImpl implements ExcelService{
                                    break;
                                }
                            }
+                           //如果为数字类型且为空默认赋值0
+                           if ("number".equals(set.getType()) && StringUtils.isEmpty(value)) {
+                               value = "0";
+                           }
                            //拼从表数据
                            detailData.put(set.getField(), value);
                        }
-                       if (detailData.size() > 0) {
+                       if (null != detailData && detailData.size() > 0) {
                            dd.setDd_codevalue(codeValue);
                            dd.setDd_detaildata(detailData.toJSONString());
                        }
                    }
                 }
-                dataImportDetailMapper.insertSelective(dd);
+                //排除编号未填写但是其他字段填写的情况
+                if (StringUtils.hasText(codeValue)) {
+                    dataImportDetailMapper.insertSelective(dd);
+                }
+            }
+            //重复编号检测
+            List<String> samecode = getDuplicateElements(validateCode);
+            if (null != samecode && samecode.size() > 0) {
+                err.append("下列编号重复: " + printList(samecode) + " 请确认无误后再上传!");
             }
             //必填项检查
             if (err.length() > 0) {
@@ -244,6 +266,24 @@ public class ExcelServiceImpl implements ExcelService{
         return keyvalue;
     }
 
+    private  <E> List<E> getDuplicateElements(List<E> list) {
+        return list.stream() // list 对应的 Stream
+                .collect(Collectors.toMap(e -> e, e -> 1, (a, b) -> a + b)) // 获得元素出现频率的 Map,键为元素,值为元素出现的次数
+                .entrySet().stream() // 所有 entry 对应的 Stream
+                .filter(entry -> entry.getValue() > 1) // 过滤出元素出现次数大于 1 的 entry
+                .map(entry -> entry.getKey()) // 获得 entry 的键(重复元素)对应的 Stream
+                .collect(Collectors.toList());  // 转化为 List
+    }
+
+    private String printList(List list) {
+        String result = null;
+        if (!StringUtils.isEmpty(list)) {
+            result = list.toString().substring(1, list.toString().length() - 1);
+        }
+        return result;
+    }
+
+
 
 
     private boolean validateDateFormat(String date) {

+ 2 - 2
applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml

@@ -67,11 +67,11 @@
     <select id="getSaleData" parameterType="long" resultType="string">
       select concat('[',five,',',other,']') from ((
 
-    select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),'}')) five from (
+    select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),',"z":"',si_custshortname,'"}')) five from (
     select * from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5
     ) c)d,(
 
-    select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
+    select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),',"z":"其它"}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
     ( select sum(si_amount) five_sum from (select si_amount from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)f)b))e)
     </select>
 

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

@@ -324,8 +324,15 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     public DocBaseDTO close(Long id) {
         DocBaseDTO docBaseDTO = null;
         if(id != null && id > 0){
+            Product product = getMapper().selectByPrimaryKey(id);
+            if (product == null) {
+                throw new BizException(BizExceptionCode.NO_DATA);
+            }
+            if (!Status.ENABLE.getDisplay().equals(product.getPr_status())){
+                throw new BizException(BizExceptionCode.BIZ_BANNED);
+            }
             String code = getMapper().getCodeById(id);
-            Product product = new Product();
+            product = new Product();
             product.setId(id);
             product.setPr_status(Status.BANNED.getDisplay());
             product.setPr_statuscode(Status.BANNED.name());
@@ -350,7 +357,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             if (product == null) {
                 throw new BizException(BizExceptionCode.NO_DATA);
             }
-            if (!Status.ENABLE.getDisplay().equals(product.getPr_status())){
+            if (!Status.BANNED.getDisplay().equals(product.getPr_status())){
                 throw new BizException(BizExceptionCode.BIZ_ENABLE);
             }else{
                 product.setId(id);

+ 20 - 0
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationDTO.java

@@ -68,6 +68,26 @@ public class VerificationDTO extends  CommonBaseDTO implements Serializable {
 
     private String vc_text5;
 
+    private Date vc_auditdate;
+
+    private String vc_auditman;
+
+    public Date getVc_auditdate() {
+        return vc_auditdate;
+    }
+
+    public void setVc_auditdate(Date vc_auditdate) {
+        this.vc_auditdate = vc_auditdate;
+    }
+
+    public String getVc_auditman() {
+        return vc_auditman;
+    }
+
+    public void setVc_auditman(String vc_auditman) {
+        this.vc_auditman = vc_auditman;
+    }
+
     public Integer getVc_id() {
         return vc_id;
     }

+ 29 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/MoneyReportColltroller.java

@@ -58,10 +58,38 @@ public class MoneyReportColltroller {
         return Result.success(listData);
     }
 
-    //冲账明细表
+    //核销明细表
     @GetMapping("/accountdetails")
     public Result accountdetails(PageRequest page, ListReqDTO req) {
         Map<String, Object> listData = moneyReportService.accountdetails(page, req);
         return Result.success(listData);
     }
+
+    //应付总账
+    @GetMapping("/vendormonthdetails")
+    public Result vendormonthdetails(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.vendormonthdetails(page, req);
+        return Result.success(listData);
+    }
+
+    //应收总账
+    @GetMapping("/custormonthdetails")
+    public Result custormonthdetails(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.custormonthdetails(page, req);
+        return Result.success(listData);
+    }
+
+    //其他收支明细表
+    @GetMapping("/otheriodetail")
+    public Result otheriodetail(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.otheriodetail(page, req);
+        return Result.success(listData);
+    }
+
+    //毛利润分析表
+    @GetMapping("/profitdetails")
+    public Result profitdetails(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.profitdetails(page, req);
+        return Result.success(listData);
+    }
 }

+ 10 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/VerificationController.java

@@ -13,6 +13,7 @@ import com.usoftchina.saas.money.po.VerificationList;
 import com.usoftchina.saas.money.service.VerificationService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -58,6 +59,7 @@ public class VerificationController {
      * @param form
      * @return
      */
+    @Transactional
     @RequestMapping("/save")
     public Result<DocSavedDTO> saveFormData(@RequestBody VerificationFormDTO form) {
         DocBaseDTO base = verificationService.saveFormData(form);
@@ -69,6 +71,7 @@ public class VerificationController {
      * @param id
      * @return
      */
+    @Transactional
     @PostMapping("/delete/{id}")
     public Result delete(@PathVariable("id") Long id) {
         verificationService.delete(id);
@@ -80,6 +83,7 @@ public class VerificationController {
      * @param id
      * @return
      */
+    @Transactional
     @PostMapping("/deleteDetail1/{id}")
     public Result deleteDetail1(@PathVariable("id") Long id) {
         verificationService.deleteDetail1(id);
@@ -91,36 +95,42 @@ public class VerificationController {
      * @param id
      * @return
      */
+    @Transactional
     @PostMapping("/deleteDetail2/{id}")
     public Result deleteDetail2(@PathVariable("id") Long id) {
         verificationService.deleteDetail2(id);
         return Result.success();
     }
 
+    @Transactional
     @RequestMapping("/audit")
     public Result audit(@RequestBody VerificationFormDTO formDTO) {
         DocBaseDTO audit = verificationService.audit(formDTO);
         return Result.success(audit);
     }
 
+    @Transactional
     @RequestMapping("/unAudit/{id}")
     public Result resAudit(@PathVariable("id") Long id) {
         verificationService.resAudit(id);
         return Result.success();
     }
 
+    @Transactional
     @RequestMapping("/batchAudit")
     public Result batchAudit(@RequestBody  BatchDealBaseDTO body) {
         verificationService.batchAudit(body);
         return Result.success();
     }
 
+    @Transactional
     @RequestMapping("/batchUnAudit")
     public Result batchUnAudit(@RequestBody BatchDealBaseDTO body) {
         verificationService.batchUnAudit(body);
         return Result.success();
     }
 
+    @Transactional
     @PostMapping("/batchDelete")
     public Result batchDelete(@RequestBody BatchDealBaseDTO body) {
         verificationService.batchDelete(body);

+ 4 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java

@@ -39,4 +39,8 @@ public interface BanksubledgerMapper extends CommonBaseMapper<Banksubledger> {
     int updateBankcode(@Param("bk_thisamount") Double bk_thisamount, @Param("nowbalance") Double nowbalance,
                        @Param("bankcode") String bankcode, @Param("symbol") String symbol);
     Double selectThisamount(@Param("bankcode") String bankcode, @Param("companyId") Long companyId);
+
+
+    List<Banksubledger> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
 }

+ 12 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustmonthMapper.java

@@ -0,0 +1,12 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Custmonth;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface CustmonthMapper {
+    List<Custmonth> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    void callCustm(Map<String, Integer> map);
+}

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustomerCheckViewMapper.java

@@ -10,6 +10,6 @@ import java.util.List;
 public interface CustomerCheckViewMapper {
     List<CustomerCheckView> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
     String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
-    VendOrCustAdd selectCustAdd(@Param("sl_custid") Integer sl_custid, @Param("cons") String cons, @Param("companyId") Long companyId);
+    List<VendOrCustAdd> selectCustAdd(@Param("sl_custid") Integer sl_custid, @Param("cons") String cons, @Param("companyId") Long companyId);
     Integer getId(@Param("code") String code, @Param("companyId") Long companyId);
 }

+ 17 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PayablesdetailMapper.java

@@ -0,0 +1,17 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Payablesdetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface PayablesdetailMapper {
+
+    List<Payablesdetail> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
+
+    Long selectIdByName(@Param("name") String name, @Param("companyId") Long companyId);
+
+    void callvend(Map<String, String> map);
+}

+ 16 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ReceivablesdetailMapper.java

@@ -0,0 +1,16 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Receivablesdetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ReceivablesdetailMapper {
+    List<Receivablesdetail> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
+
+    Long selectIdByName(@Param("name") String name, @Param("companyId") Long companyId);
+
+    void callcust(Map<String, String> map);
+}

+ 12 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendmonthMapper.java

@@ -0,0 +1,12 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Vendmonth;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface VendmonthMapper {
+    List<Vendmonth> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    void callVend(Map<String, Integer> map);
+}

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendorAcountViewMapper.java

@@ -9,6 +9,6 @@ import java.util.List;
 public interface VendorAcountViewMapper {
     List<VendorAcountView> selectByCondition(@Param("con")String con, @Param("companyId")Long companyId);
     String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
-    VendOrCustAdd selectVendAdd(@Param("sl_vendid") Integer sl_vendid, @Param("cons") String cons, @Param("companyId") Long companyId);
+    List<VendOrCustAdd> selectVendAdd(@Param("sl_vendid") Integer sl_vendid, @Param("cons") String cons, @Param("companyId") Long companyId);
     Integer getId(@Param("code") String code, @Param("companyId") Long companyId);
 }

+ 0 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/AccountDetailsView.java

@@ -9,7 +9,6 @@ public class AccountDetailsView {
 
     private String ve_name;
     private String cu_name;
-
     private Double sl_amount;
 
     private Integer pb_id;

+ 103 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java

@@ -0,0 +1,103 @@
+package com.usoftchina.saas.money.po;
+
+public class Custmonth {
+    private Integer cm_id;
+
+    private Integer cm_yearmonth;
+
+    private Integer cm_custid;
+
+    private String cm_custcode;
+
+    private String cm_custname;
+
+    private Double cm_beginamount;
+
+    private Double cm_nowamount;
+
+    private Double cm_nowpreamount;
+
+    private Double cm_endamount;
+
+    private Integer companyid;
+
+    public Integer getCm_id() {
+        return cm_id;
+    }
+
+    public void setCm_id(Integer cm_id) {
+        this.cm_id = cm_id;
+    }
+
+    public Integer getCm_yearmonth() {
+        return cm_yearmonth;
+    }
+
+    public void setCm_yearmonth(Integer cm_yearmonth) {
+        this.cm_yearmonth = cm_yearmonth;
+    }
+
+    public Integer getCm_custid() {
+        return cm_custid;
+    }
+
+    public void setCm_custid(Integer cm_custid) {
+        this.cm_custid = cm_custid;
+    }
+
+    public String getCm_custcode() {
+        return cm_custcode;
+    }
+
+    public void setCm_custcode(String cm_custcode) {
+        this.cm_custcode = cm_custcode == null ? null : cm_custcode.trim();
+    }
+
+    public String getCm_custname() {
+        return cm_custname;
+    }
+
+    public void setCm_custname(String cm_custname) {
+        this.cm_custname = cm_custname == null ? null : cm_custname.trim();
+    }
+
+    public Double getCm_beginamount() {
+        return cm_beginamount;
+    }
+
+    public void setCm_beginamount(Double cm_beginamount) {
+        this.cm_beginamount = cm_beginamount;
+    }
+
+    public Double getCm_nowamount() {
+        return cm_nowamount;
+    }
+
+    public void setCm_nowamount(Double cm_nowamount) {
+        this.cm_nowamount = cm_nowamount;
+    }
+
+    public Double getCm_nowpreamount() {
+        return cm_nowpreamount;
+    }
+
+    public void setCm_nowpreamount(Double cm_nowpreamount) {
+        this.cm_nowpreamount = cm_nowpreamount;
+    }
+
+    public Double getCm_endamount() {
+        return cm_endamount;
+    }
+
+    public void setCm_endamount(Double cm_endamount) {
+        this.cm_endamount = cm_endamount;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+}

+ 175 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Payablesdetail.java

@@ -0,0 +1,175 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+public class Payablesdetail {
+    private Integer pd_id;
+
+    private Integer pd_detno;
+
+    private Integer pd_vendid;
+
+    private String pd_vendcode;
+
+    private String pd_vendname;
+
+    private Date pd_date;
+
+    private String pd_code;
+
+    private String pd_kind;
+
+    private Integer pd_buyerid;
+
+    private String pd_buyername;
+
+    private Double pd_addpay;
+
+    private Double pd_addpre;
+
+    private Double pd_remain;
+
+    private Integer companyid;
+
+    private Integer pd_status;
+
+    private Integer pd_query;
+
+    private Integer pd_ym;
+
+    public Integer getPd_ym() {
+        return pd_ym;
+    }
+
+    public void setPd_ym(Integer pd_ym) {
+        this.pd_ym = pd_ym;
+    }
+
+    public Integer getPd_id() {
+        return pd_id;
+    }
+
+    public void setPd_id(Integer pd_id) {
+        this.pd_id = pd_id;
+    }
+
+    public Integer getPd_detno() {
+        return pd_detno;
+    }
+
+    public void setPd_detno(Integer pd_detno) {
+        this.pd_detno = pd_detno;
+    }
+
+    public Integer getPd_vendid() {
+        return pd_vendid;
+    }
+
+    public void setPd_vendid(Integer pd_vendid) {
+        this.pd_vendid = pd_vendid;
+    }
+
+    public String getPd_vendcode() {
+        return pd_vendcode;
+    }
+
+    public void setPd_vendcode(String pd_vendcode) {
+        this.pd_vendcode = pd_vendcode == null ? null : pd_vendcode.trim();
+    }
+
+    public String getPd_vendname() {
+        return pd_vendname;
+    }
+
+    public void setPd_vendname(String pd_vendname) {
+        this.pd_vendname = pd_vendname == null ? null : pd_vendname.trim();
+    }
+
+    public Date getPd_date() {
+        return pd_date;
+    }
+
+    public void setPd_date(Date pd_date) {
+        this.pd_date = pd_date;
+    }
+
+    public String getPd_code() {
+        return pd_code;
+    }
+
+    public void setPd_code(String pd_code) {
+        this.pd_code = pd_code == null ? null : pd_code.trim();
+    }
+
+    public String getPd_kind() {
+        return pd_kind;
+    }
+
+    public void setPd_kind(String pd_kind) {
+        this.pd_kind = pd_kind == null ? null : pd_kind.trim();
+    }
+
+    public Integer getPd_buyerid() {
+        return pd_buyerid;
+    }
+
+    public void setPd_buyerid(Integer pd_buyerid) {
+        this.pd_buyerid = pd_buyerid;
+    }
+
+    public String getPd_buyername() {
+        return pd_buyername;
+    }
+
+    public void setPd_buyername(String pd_buyername) {
+        this.pd_buyername = pd_buyername == null ? null : pd_buyername.trim();
+    }
+
+    public Double getPd_addpay() {
+        return pd_addpay;
+    }
+
+    public void setPd_addpay(Double pd_addpay) {
+        this.pd_addpay = pd_addpay;
+    }
+
+    public Double getPd_addpre() {
+        return pd_addpre;
+    }
+
+    public void setPd_addpre(Double pd_addpre) {
+        this.pd_addpre = pd_addpre;
+    }
+
+    public Double getPd_remain() {
+        return pd_remain;
+    }
+
+    public void setPd_remain(Double pd_remain) {
+        this.pd_remain = pd_remain;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+
+    public Integer getPd_status() {
+        return pd_status;
+    }
+
+    public void setPd_status(Integer pd_status) {
+        this.pd_status = pd_status;
+    }
+
+    public Integer getPd_query() {
+        return pd_query;
+    }
+
+    public void setPd_query(Integer pd_query) {
+        this.pd_query = pd_query;
+    }
+}

+ 175 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Receivablesdetail.java

@@ -0,0 +1,175 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+public class Receivablesdetail {
+    private Integer rd_id;
+
+    private Integer rd_detno;
+
+    private Integer rd_custid;
+
+    private String rd_custcode;
+
+    private String rd_custname;
+
+    private Date rd_date;
+
+    private String rd_code;
+
+    private String rd_kind;
+
+    private Integer rd_sellerid;
+
+    private String rd_sellername;
+
+    private Double rd_addrec;
+
+    private Double rd_addpre;
+
+    private Double rd_remain;
+
+    private Integer companyid;
+
+    private Integer rd_status;
+
+    private Integer rd_query;
+
+    private Integer rd_ym;
+
+    public Integer getRd_ym() {
+        return rd_ym;
+    }
+
+    public void setRd_ym(Integer rd_ym) {
+        this.rd_ym = rd_ym;
+    }
+
+    public Integer getRd_id() {
+        return rd_id;
+    }
+
+    public void setRd_id(Integer rd_id) {
+        this.rd_id = rd_id;
+    }
+
+    public Integer getRd_detno() {
+        return rd_detno;
+    }
+
+    public void setRd_detno(Integer rd_detno) {
+        this.rd_detno = rd_detno;
+    }
+
+    public Integer getRd_custid() {
+        return rd_custid;
+    }
+
+    public void setRd_custid(Integer rd_custid) {
+        this.rd_custid = rd_custid;
+    }
+
+    public String getRd_custcode() {
+        return rd_custcode;
+    }
+
+    public void setRd_custcode(String rd_custcode) {
+        this.rd_custcode = rd_custcode == null ? null : rd_custcode.trim();
+    }
+
+    public String getRd_custname() {
+        return rd_custname;
+    }
+
+    public void setRd_custname(String rd_custname) {
+        this.rd_custname = rd_custname == null ? null : rd_custname.trim();
+    }
+
+    public Date getRd_date() {
+        return rd_date;
+    }
+
+    public void setRd_date(Date rd_date) {
+        this.rd_date = rd_date;
+    }
+
+    public String getRd_code() {
+        return rd_code;
+    }
+
+    public void setRd_code(String rd_code) {
+        this.rd_code = rd_code == null ? null : rd_code.trim();
+    }
+
+    public String getRd_kind() {
+        return rd_kind;
+    }
+
+    public void setRd_kind(String rd_kind) {
+        this.rd_kind = rd_kind == null ? null : rd_kind.trim();
+    }
+
+    public Integer getRd_sellerid() {
+        return rd_sellerid;
+    }
+
+    public void setRd_sellerid(Integer rd_sellerid) {
+        this.rd_sellerid = rd_sellerid;
+    }
+
+    public String getRd_sellername() {
+        return rd_sellername;
+    }
+
+    public void setRd_sellername(String rd_sellername) {
+        this.rd_sellername = rd_sellername == null ? null : rd_sellername.trim();
+    }
+
+    public Double getRd_addrec() {
+        return rd_addrec;
+    }
+
+    public void setRd_addrec(Double rd_addrec) {
+        this.rd_addrec = rd_addrec;
+    }
+
+    public Double getRd_addpre() {
+        return rd_addpre;
+    }
+
+    public void setRd_addpre(Double rd_addpre) {
+        this.rd_addpre = rd_addpre;
+    }
+
+    public Double getRd_remain() {
+        return rd_remain;
+    }
+
+    public void setRd_remain(Double rd_remain) {
+        this.rd_remain = rd_remain;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+
+    public Integer getRd_status() {
+        return rd_status;
+    }
+
+    public void setRd_status(Integer rd_status) {
+        this.rd_status = rd_status;
+    }
+
+    public Integer getRd_query() {
+        return rd_query;
+    }
+
+    public void setRd_query(Integer rd_query) {
+        this.rd_query = rd_query;
+    }
+}

+ 103 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java

@@ -0,0 +1,103 @@
+package com.usoftchina.saas.money.po;
+
+public class Vendmonth {
+    private Integer vm_id;
+
+    private Integer vm_yearmonth;
+
+    private Integer vm_vendid;
+
+    private String vm_vendcode;
+
+    private String vm_vendname;
+
+    private Double vm_beginamount;
+
+    private Double vm_nowamount;
+
+    private Double vm_nowpreamount;
+
+    private Double vm_endamount;
+
+    private Integer companyid;
+
+    public Integer getVm_id() {
+        return vm_id;
+    }
+
+    public void setVm_id(Integer vm_id) {
+        this.vm_id = vm_id;
+    }
+
+    public Integer getVm_yearmonth() {
+        return vm_yearmonth;
+    }
+
+    public void setVm_yearmonth(Integer vm_yearmonth) {
+        this.vm_yearmonth = vm_yearmonth;
+    }
+
+    public Integer getVm_vendid() {
+        return vm_vendid;
+    }
+
+    public void setVm_vendid(Integer vm_vendid) {
+        this.vm_vendid = vm_vendid;
+    }
+
+    public String getVm_vendcode() {
+        return vm_vendcode;
+    }
+
+    public void setVm_vendcode(String vm_vendcode) {
+        this.vm_vendcode = vm_vendcode;
+    }
+
+    public String getVm_vendname() {
+        return vm_vendname;
+    }
+
+    public void setVm_vendname(String vm_vendname) {
+        this.vm_vendname = vm_vendname;
+    }
+
+    public Double getVm_beginamount() {
+        return vm_beginamount;
+    }
+
+    public void setVm_beginamount(Double vm_beginamount) {
+        this.vm_beginamount = vm_beginamount;
+    }
+
+    public Double getVm_nowamount() {
+        return vm_nowamount;
+    }
+
+    public void setVm_nowamount(Double vm_nowamount) {
+        this.vm_nowamount = vm_nowamount;
+    }
+
+    public Double getVm_nowpreamount() {
+        return vm_nowpreamount;
+    }
+
+    public void setVm_nowpreamount(Double vm_nowpreamount) {
+        this.vm_nowpreamount = vm_nowpreamount;
+    }
+
+    public Double getVm_endamount() {
+        return vm_endamount;
+    }
+
+    public void setVm_endamount(Double vm_endamount) {
+        this.vm_endamount = vm_endamount;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+}

+ 20 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verification.java

@@ -65,6 +65,26 @@ public class Verification extends CommonBaseEntity implements Serializable {
 
     private String vc_text5;
 
+    private Date vc_auditdate;
+
+    private String vc_auditman;
+
+    public Date getVc_auditdate() {
+        return vc_auditdate;
+    }
+
+    public void setVc_auditdate(Date vc_auditdate) {
+        this.vc_auditdate = vc_auditdate;
+    }
+
+    public String getVc_auditman() {
+        return vc_auditman;
+    }
+
+    public void setVc_auditman(String vc_auditman) {
+        this.vc_auditman = vc_auditman;
+    }
+
     public Integer getVc_id() {
         return vc_id;
     }

+ 4 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/MoneyReportService.java

@@ -17,4 +17,8 @@ public interface MoneyReportService {
     Map<String, Object> acountBalance(PageRequest page, ListReqDTO req);
     Map<String, Object> customercheck(PageRequest page, ListReqDTO req);
     Map<String, Object> accountdetails(PageRequest page, ListReqDTO req);
+    Map<String, Object> vendormonthdetails(PageRequest page, ListReqDTO req);
+    Map<String, Object> custormonthdetails(PageRequest page, ListReqDTO req);
+    Map<String, Object> otheriodetail(PageRequest page, ListReqDTO req);
+    Map<String, Object> profitdetails(PageRequest page, ListReqDTO req);
 }

+ 202 - 60
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java

@@ -11,15 +11,13 @@ import com.usoftchina.saas.money.po.CustomerCheckView;
 import com.usoftchina.saas.money.po.VendorAcountView;
 import com.usoftchina.saas.money.po.VendOrCustAdd;
 import com.usoftchina.saas.money.service.MoneyReportService;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @author heqw
@@ -30,15 +28,21 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     @Autowired
     private VendorAcountViewMapper vendorAcountViewMapper;
     @Autowired
-    private PaydetailViewMapper paydetailViewMapper;
+    private PayablesdetailMapper payablesdetailMapper;
     @Autowired
-    private RecdetailViewMapper recdetailViewMapper;
+    private ReceivablesdetailMapper receivablesdetailMapper;
     @Autowired
     private AcountbalanceViewMapper acountbalanceViewMapper;
     @Autowired
     private CustomerCheckViewMapper customerCheckViewMapper;
     @Autowired
     private AccountDetailsViewMapper accountDetailsViewMapper;
+    @Autowired
+    private VendmonthMapper vendmonthMapper;
+    @Autowired
+    private CustmonthMapper custmonthMapper;
+    @Autowired
+    private BanksubledgerMapper banksubledgerMapper;
 
     @Override
     public Map<String, Object> vendorCheck(PageRequest page, ListReqDTO req) {
@@ -70,22 +74,90 @@ public class MoneyReportServiceImpl implements MoneyReportService {
         return getListDATA(page, req, "accountdetails");
     }
 
-    private Map<String, Object> getListDATA(PageRequest page, ListReqDTO req, String type) {
-        //设置默认分页
+    @Override
+    public Map<String, Object> vendormonthdetails(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "vendormonthdetails");
+    }
+
+    @Override
+    public Map<String, Object> custormonthdetails(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "custormonthdetails");
+    }
+
+    @Override
+    public Map<String, Object> otheriodetail(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "otheriodetail");
+    }
+
+    @Override
+    public Map<String, Object> profitdetails(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "profitdetails");
+    }
+
+    private Map<String, Object> getListDATA(@PageDefault(size = 10) PageRequest page, ListReqDTO req, String type) {
+
+        //调用存储过程
+        if ("custormonthdetails".equals(type)){
+            Map map1 = this.getYm(req.getCondition());
+            Map<String, Integer> map = new HashMap();
+            map.put("v_YearMonth", Integer.valueOf((String) map1.get("yearmonth")));
+            map.put("v_YearMonthTo", Integer.valueOf((String) map1.get("yearmonthTo")));
+            map.put("v_companyid", Math.toIntExact(BaseContextHolder.getCompanyId()));
+            custmonthMapper.callCustm(map);
+        }else if ("vendormonthdetails".equals(type)){
+            Map map1 = this.getYm(req.getCondition());
+            Map<String, Integer> map = new HashMap();
+            map.put("v_YearMonth", Integer.valueOf((String) map1.get("yearmonth")));
+            map.put("v_YearMonthTo", Integer.valueOf((String) map1.get("yearmonthTo")));
+            map.put("v_companyid",  Math.toIntExact(BaseContextHolder.getCompanyId()));
+            vendmonthMapper.callVend(map);
+        }else if ("payDetail".equals(type)){
+            Map<String, String> maps = new HashMap<>();
+            Map<String, String> map = this.getIdAndDate(req.getCondition());
+            Long custid = new Long(0);
+            if (map.get("name") == null) {
+                custid = new Long(0);
+            }else {
+                custid = payablesdetailMapper.selectIdByName(map.get("name"), BaseContextHolder.getCompanyId());
+            }
+            maps.put("V_vendid", String.valueOf(custid));
+            maps.put("V_start", map.get("yearmonth"));
+            maps.put("V_end", map.get("yearmonthTo"));
+            maps.put("v_companyid", String.valueOf(BaseContextHolder.getCompanyId()));
+            payablesdetailMapper.callvend(maps);
+
+        }else if("recDetail".equals(type)){
+            Map<String, String> maps = new HashMap<>();
+            Map<String, String> map = this.getIdAndDate(req.getCondition());
+            Long custid = new Long(0);
+            if (map.get("name") == null) {
+                custid = new Long(0);
+            }else {
+                custid = receivablesdetailMapper.selectIdByName(map.get("name"), BaseContextHolder.getCompanyId());
+            }
+            maps.put("V_custid", String.valueOf(custid));
+            maps.put("V_start", map.get("yearmonth"));
+            maps.put("V_end", map.get("yearmonthTo"));
+            maps.put("v_companyid", String.valueOf(BaseContextHolder.getCompanyId()));
+            receivablesdetailMapper.callcust(maps);
+        }
+
+      /*  //设置默认分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
             page.setNumber(1);
             page.setSize(10);
-        }
-        PageHelper.startPage(page.getNumber(), page.getSize());
-
-        //查询数据
-        Map<String, Object> map = getListByType(req, type);
-        //取分页信息
-        PageInfo lists = new PageInfo((List) map.get("list"));
-        map.remove("list");
-        map.put("list", lists);
-        return map;
+        }*/
+
+          PageHelper.startPage(page.getNumber(), page.getSize());
+
+          //查询数据
+          Map<String, Object> map = getListByType(req, type);
+          //取分页信息
+          PageInfo lists = new PageInfo((List) map.get("list"));
+          map.remove("list");
+          map.put("list", lists);
+          return map;
     }
 
     private Map<String, Object> getListByType(ListReqDTO req, String type) {
@@ -109,35 +181,43 @@ public class MoneyReportServiceImpl implements MoneyReportService {
 
                 Integer vid = new Integer(0);
                 vid = vendorAcountViewMapper.getId(vendorAcountView.getPi_vendcode(), Long.valueOf(vendorAcountView.getCompanyId()));
-                VendOrCustAdd vendOrCustAdd = vendorAcountViewMapper.selectVendAdd(vid, cons, Long.valueOf(vendorAcountView.getCompanyId()));
-                if (vendOrCustAdd != null) {
-                    //封装成list
-                    Map<String, Double> map1 = new HashMap<>();
-                    map1.put("beginamount", vendOrCustAdd.getBeginamount());
-                    list1.add(map1);
-
-                    Map<String, Double> map2 = new HashMap<>();
-                    map2.put("nowamount", vendOrCustAdd.getNowamount());
-                    list1.add(map2);
-
-                    Map<String, Double> map3 = new HashMap<>();
-                    map3.put("nowpay", vendOrCustAdd.getNowpay());
-                    list1.add(map3);
-
-                    Map<String, Double> map4 = new HashMap<>();
-                    map4.put("nowbalance", vendOrCustAdd.getNowbalance());
-                    list1.add(map4);
+                List<VendOrCustAdd> vendOrCustAdds = vendorAcountViewMapper.selectVendAdd(vid, cons, Long.valueOf(vendorAcountView.getCompanyId()));
+                //封装成list
+                Map<String, Double> map1 = new HashMap<>();
+                map1.put("beginamount", new Double(0));
+                Map<String, Double> map2 = new HashMap<>();
+                map2.put("nowamount", new Double(0));
+                Map<String, Double> map3 = new HashMap<>();
+                map3.put("nowpay", new Double(0));
+                Map<String, Double> map4 = new HashMap<>();
+                map4.put("nowbalance", new Double(0));
+                if (vendOrCustAdds != null) {
+                    Iterator vlist = vendOrCustAdds.iterator();
+                    while (vlist.hasNext()) {
+                        VendOrCustAdd vendOrCustAdd = (VendOrCustAdd) vlist.next();
+                        map1.put("beginamount", vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount());
+                        list1.add(map1);
+
+                        map2.put("nowamount", vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount() + map2.get("nowamount"));
+                        list1.add(map2);
+
+                        map3.put("nowpay", vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay() + map3.get("nowpay"));
+                        list1.add(map3);
+
+                        map4.put("nowbalance", map1.get("beginamount") +  map2.get("nowamount") - map3.get("nowpay"));
+                        list1.add(map4);
+                    }
                 }
             }
         } else if("payDetail".equals(type)){
-            list = paydetailViewMapper.selectByCondition(con, companyId);
+            list = payablesdetailMapper.selectByCondition(con, companyId);
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
-                res = paydetailViewMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+                res = payablesdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
         }else if("recDetail".equals(type)){
-            list = recdetailViewMapper.selectByCondition(con, companyId);
+            list = receivablesdetailMapper.selectByCondition(con, companyId);
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
-                res = recdetailViewMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+                res = receivablesdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
         }else if ("acountBalance".equals(type)){
             list = acountbalanceViewMapper.selectByCondition(con, companyId);
@@ -154,24 +234,32 @@ public class MoneyReportServiceImpl implements MoneyReportService {
                 Integer vid = new Integer(0);
 
                 vid = customerCheckViewMapper.getId(customerCheckView.getPi_custcode(), Long.valueOf(customerCheckView.getCompanyId()));
-                VendOrCustAdd vendOrCustAdd = customerCheckViewMapper.selectCustAdd(vid, cons, Long.valueOf(customerCheckView.getCompanyId()));
-                if (vendOrCustAdd != null) {
-                    //封装成list
-                    Map<String, Double> map1 = new HashMap<>();
-                    map1.put("beginamount", vendOrCustAdd.getBeginamount());
-                    list1.add(map1);
-
-                    Map<String, Double> map2 = new HashMap<>();
-                    map2.put("nowamount", vendOrCustAdd.getNowamount());
-                    list1.add(map2);
-
-                    Map<String, Double> map3 = new HashMap<>();
-                    map3.put("nowpay", vendOrCustAdd.getNowpay());
-                    list1.add(map3);
-
-                    Map<String, Double> map4 = new HashMap<>();
-                    map4.put("nowbalance", vendOrCustAdd.getNowbalance());
-                    list1.add(map4);
+                List<VendOrCustAdd> vendOrCustAdds = customerCheckViewMapper.selectCustAdd(vid, cons, Long.valueOf(customerCheckView.getCompanyId()));
+                //封装成list
+                Map<String, Double> map1 = new HashMap<>();
+                map1.put("beginamount", new Double(0));
+                Map<String, Double> map2 = new HashMap<>();
+                map2.put("nowamount", new Double(0));
+                Map<String, Double> map3 = new HashMap<>();
+                map3.put("nowpay", new Double(0));
+                Map<String, Double> map4 = new HashMap<>();
+                map4.put("nowbalance", new Double(0));
+                if (vendOrCustAdds != null) {
+                    Iterator vlist = vendOrCustAdds.iterator();
+                    while (vlist.hasNext()) {
+                        VendOrCustAdd vendOrCustAdd = (VendOrCustAdd) vlist.next();
+                        map1.put("beginamount", vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount());
+                        list1.add(map1);
+
+                        map2.put("nowamount", vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount() + map2.get("nowamount"));
+                        list1.add(map2);
+
+                        map3.put("nowpay", vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay() + map3.get("nowpay"));
+                        list1.add(map3);
+
+                        map4.put("nowbalance", map1.get("beginamount") +  map2.get("nowamount") - map3.get("nowpay"));
+                        list1.add(map4);
+                    }
                 }
             }
         }else if ("accountdetails".equals(type)){
@@ -179,6 +267,17 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
                 res = accountDetailsViewMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
+        }else if("vendormonthdetails".equals(type)){
+            list = vendmonthMapper.selectByCondition(con, companyId);
+            res = null;
+        }else if ("custormonthdetails".equals(type)){
+            list = custmonthMapper.selectByCondition(con, companyId);
+            res = null;
+        }else if ("otheriodetail".equals(type)){
+            list = banksubledgerMapper.selectByCondition(con, companyId);
+            if (!StringUtils.isEmpty(calculateFieldsSql)) {
+                res = banksubledgerMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+            }
         }
 
         try {
@@ -207,13 +306,56 @@ public class MoneyReportServiceImpl implements MoneyReportService {
                 Object type = jsonObject.get("type");
                 if ("date".equals(type)){
                     String value = (String) jsonObject.get("value");
-                    System.out.println("value" + value);
                     value = value.replace(",", "' and '");
                     con =  " a.sl_date between '" + value + "'" ;
-                    System.out.println("con"+con);
+                    return con;
                 }
             }
         }
         return con;
     }
+
+    //取两个期间
+    public Map<String, String> getYm(String cons){
+        System.out.println("cons:" + cons);
+        JSONArray jsonArray = JSONArray.parseArray(cons);
+        Map<String, String> map = new HashMap<>();
+        if (null != jsonArray && jsonArray.size() > 0) {
+            StringBuffer finalCondition = new StringBuffer();
+            for (int i = 0; i < jsonArray.size(); i++) {
+                JSONObject jsonObject = (JSONObject) jsonArray.get(i);
+                String type = (String) jsonObject.get("type");
+                if ("date".equals(type)) {
+                    String value = (String) jsonObject.get("value");
+                    String[] arr = value.split(",");
+                    map.put("yearmonth", arr[0]);
+                    map.put("yearmonthTo", arr[1]);
+                }
+            }
+        }
+        System.out.println("map:" + map);
+        return map;
+    }
+
+    public Map<String, String> getIdAndDate(String cons){
+        JSONArray jsonArray = JSONArray.parseArray(cons);
+        Map<String, String> map = new HashMap<>();
+        if (null != jsonArray && jsonArray.size() > 0) {
+            StringBuffer finalCondition = new StringBuffer();
+            for (int i = 0; i < jsonArray.size(); i++) {
+                JSONObject jsonObject = (JSONObject) jsonArray.get(i);
+                String type = (String) jsonObject.get("type");
+                if ("string".equals(type)){
+                    String value = (String) jsonObject.get("value");
+                    map.put("name", value);
+                }else if ("date".equals(type)){
+                    String value = (String) jsonObject.get("value");
+                    String[] arr = value.split(",");
+                    map.put("yearmonth", arr[0]);
+                    map.put("yearmonthTo", arr[1]);
+                }
+            }
+        }
+        return map;
+    }
 }

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

@@ -151,32 +151,32 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
          * cu_recamount=nvl(cu_recamount,0)-rb_rbdamount,
          * cu_leftamount=cu_beginaramount-cu_beginprerecamount+cu_recamount-cu_preamount;
          */
-        if (othreceipts.getOr_custid() != null && othreceipts.getOr_custid() != 0) {
-            Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
-            Double preamount = customerData.getCu_preamount() == null ? new Double(0) : customerData.getCu_preamount();
-            Double beginapamount = customerData.getCu_beginaramount() == null ? new Double(0) : customerData.getCu_beginaramount();
-            Double beginprepayamount = customerData.getCu_beginprerecamount() == null ? new Double(0) : customerData.getCu_beginprerecamount();
-            Double recamount = customerData.getCu_recamount() == null ? new Double(0) : customerData.getCu_recamount();
-
-            Customer customer = new Customer();
-            customer.setId(Long.valueOf(othreceipts.getOr_custid()));
-            customer.setCu_preamount(preamount);
-            customer.setCu_recamount(recamount + or_amount);
-            customer.setCu_leftamount(beginapamount - beginprepayamount + recamount + or_amount - preamount);
-            recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
-
-            //插入subledger中间表
-            Subledger subledger = new Subledger();
-            subledger.setSl_code(othreceipts.getOr_code());
-            subledger.setSl_kind("其他收入单");
-            subledger.setSl_custid(othreceipts.getOr_custid());
-            subledger.setSl_vendid(0);
-            subledger.setSl_date(othreceipts.getOr_date());
-            subledger.setSl_ym(DateUtils.getYm(othreceipts.getOr_date()));
-            subledger.setSl_amount(or_amount);
-            subledger.setCompanyId(BaseContextHolder.getCompanyId());
-            subledgerMapper.insertSelective(subledger);
-        }
+//        if (othreceipts.getOr_custid() != null && othreceipts.getOr_custid() != 0) {
+//            Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
+//            Double preamount = customerData.getCu_preamount() == null ? new Double(0) : customerData.getCu_preamount();
+//            Double beginapamount = customerData.getCu_beginaramount() == null ? new Double(0) : customerData.getCu_beginaramount();
+//            Double beginprepayamount = customerData.getCu_beginprerecamount() == null ? new Double(0) : customerData.getCu_beginprerecamount();
+//            Double recamount = customerData.getCu_recamount() == null ? new Double(0) : customerData.getCu_recamount();
+//
+//            Customer customer = new Customer();
+//            customer.setId(Long.valueOf(othreceipts.getOr_custid()));
+//            customer.setCu_preamount(preamount);
+//            customer.setCu_recamount(recamount + or_amount);
+//            customer.setCu_leftamount(beginapamount - beginprepayamount + recamount + or_amount - preamount);
+//            recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
+//
+//            //插入subledger中间表
+//            Subledger subledger = new Subledger();
+//            subledger.setSl_code(othreceipts.getOr_code());
+//            subledger.setSl_kind("其他收入单");
+//            subledger.setSl_custid(othreceipts.getOr_custid());
+//            subledger.setSl_vendid(0);
+//            subledger.setSl_date(othreceipts.getOr_date());
+//            subledger.setSl_ym(DateUtils.getYm(othreceipts.getOr_date()));
+//            subledger.setSl_amount(or_amount);
+//            subledger.setCompanyId(BaseContextHolder.getCompanyId());
+//            subledgerMapper.insertSelective(subledger);
+//        }
 
 
         //计算期间金额
@@ -249,21 +249,21 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
          * cu_recamount=nvl(cu_recamount,0)-rb_rbdamount,
          * cu_leftamount=cu_beginaramount-cu_beginprerecamount+cu_recamount-cu_preamount;
          */
-        if (othreceipts.getOr_custid() != null && othreceipts.getOr_custid() != 0) {
-            Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
-            Double preamount = customerData.getCu_preamount() == null ? new Double(0) : customerData.getCu_preamount();
-            Double beginapamount = customerData.getCu_beginaramount() == null ? new Double(0) : customerData.getCu_beginaramount();
-            Double beginprepayamount = customerData.getCu_beginprerecamount() == null ? new Double(0) : customerData.getCu_beginprerecamount();
-            Double recamount = customerData.getCu_recamount() == null ? new Double(0) : customerData.getCu_recamount();
-
-            Customer customer = new Customer();
-            customer.setId(Long.valueOf(othreceipts.getOr_custid()));
-            customer.setCu_preamount(preamount);
-            customer.setCu_recamount(recamount - or_amount);
-            customer.setCu_leftamount(beginapamount - beginprepayamount + recamount - or_amount - preamount);
-            recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
-            subledgerMapper.deleteByPrimaryKey(othreceipts.getOr_code(), "其他收入单",BaseContextHolder.getCompanyId());
-        }
+//        if (othreceipts.getOr_custid() != null && othreceipts.getOr_custid() != 0) {
+//            Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
+//            Double preamount = customerData.getCu_preamount() == null ? new Double(0) : customerData.getCu_preamount();
+//            Double beginapamount = customerData.getCu_beginaramount() == null ? new Double(0) : customerData.getCu_beginaramount();
+//            Double beginprepayamount = customerData.getCu_beginprerecamount() == null ? new Double(0) : customerData.getCu_beginprerecamount();
+//            Double recamount = customerData.getCu_recamount() == null ? new Double(0) : customerData.getCu_recamount();
+//
+//            Customer customer = new Customer();
+//            customer.setId(Long.valueOf(othreceipts.getOr_custid()));
+//            customer.setCu_preamount(preamount);
+//            customer.setCu_recamount(recamount - or_amount);
+//            customer.setCu_leftamount(beginapamount - beginprepayamount + recamount - or_amount - preamount);
+//            recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
+//            subledgerMapper.deleteByPrimaryKey(othreceipts.getOr_code(), "其他收入单",BaseContextHolder.getCompanyId());
+//        }
 
 
         //计算期间金额

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

@@ -186,37 +186,37 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         bankinformation.setBk_spending(spending + bk_amount);
         bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
 
-        /**
-         * ve_preamount=nvl(ve_preamount,0)+pb_preamount,
-         * ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
-         * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
-         */
-        if (othspendings.getOs_vendid() != null && othspendings.getOs_vendid() != 0) {
-            Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(othspendings.getOs_vendid());
-            Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
-            Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
-            Double beginprepayamount = vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
-            Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount();
-
-            Vendor vendor = new Vendor();
-            vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
-            vendor.setVe_preamount(preamount);
-            vendor.setVe_payamount(payamount - bk_amount);
-            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount - bk_amount - preamount);
-            paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
+//        /**
+//         * ve_preamount=nvl(ve_preamount,0)+pb_preamount,
+//         * ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
+//         * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
+//         */
+//        if (othspendings.getOs_vendid() != null && othspendings.getOs_vendid() != 0) {
+//            Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(othspendings.getOs_vendid());
+//            Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
+//            Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
+//            Double beginprepayamount = vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
+//            Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount();
+//
+//            Vendor vendor = new Vendor();
+//            vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
+//            vendor.setVe_preamount(preamount);
+//            vendor.setVe_payamount(payamount - bk_amount);
+//            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount - bk_amount - preamount);
+//            paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
 
             //插入subledger中间表
-            Subledger subledger = new Subledger();
-            subledger.setSl_code(othspendings.getOs_code());
-            subledger.setSl_kind("其他支出单");
-            subledger.setSl_custid(0);
-            subledger.setSl_vendid(othspendings.getOs_vendid());
-            subledger.setSl_date(othspendings.getOs_date());
-            subledger.setSl_ym(DateUtils.getYm(othspendings.getOs_date()));
-            subledger.setSl_amount(bk_amount);
-            subledger.setCompanyId(BaseContextHolder.getCompanyId());
-            subledgerMapper.insertSelective(subledger);
-        }
+//            Subledger subledger = new Subledger();
+//            subledger.setSl_code(othspendings.getOs_code());
+//            subledger.setSl_kind("其他支出单");
+//            subledger.setSl_custid(0);
+//            subledger.setSl_vendid(othspendings.getOs_vendid());
+//            subledger.setSl_date(othspendings.getOs_date());
+//            subledger.setSl_ym(DateUtils.getYm(othspendings.getOs_date()));
+//            subledger.setSl_amount(bk_amount);
+//            subledger.setCompanyId(BaseContextHolder.getCompanyId());
+//            subledgerMapper.insertSelective(subledger);
+//        }
 
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
@@ -282,22 +282,22 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
          * ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
          * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
          */
-        if (othspendings.getOs_vendid() != null && othspendings.getOs_vendid() != 0) {
-            Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(othspendings.getOs_vendid());
-            Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
-            Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
-            Double beginprepayamount = vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
-            Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount();
-
-            Vendor vendor = new Vendor();
-            vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
-            vendor.setVe_preamount(preamount);
-            vendor.setVe_payamount(payamount + bk_amount);
-            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount + bk_amount - preamount);
-            paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
-
-            subledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他支出单",BaseContextHolder.getCompanyId());
-        }
+//        if (othspendings.getOs_vendid() != null && othspendings.getOs_vendid() != 0) {
+//            Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(othspendings.getOs_vendid());
+//            Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
+//            Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
+//            Double beginprepayamount = vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
+//            Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount();
+//
+//            Vendor vendor = new Vendor();
+//            vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
+//            vendor.setVe_preamount(preamount);
+//            vendor.setVe_payamount(payamount + bk_amount);
+//            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount + bk_amount - preamount);
+//            paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
+//
+//            subledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他支出单",BaseContextHolder.getCompanyId());
+//        }
 
 
         //计算期间金额
@@ -425,7 +425,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             banksubledger.setBl_assid(othspendings.getOs_vendid());
             banksubledger.setBl_asscode(othspendings.getOs_vendcode());
             banksubledger.setBl_assname(othspendings.getOs_vendname());
-            banksubledger.setBl_income(othspendingsdetail.getOsd_nowbalance());
+            banksubledger.setBl_spending(othspendingsdetail.getOsd_nowbalance());
             banksubledger.setBl_remark(othspendingsdetail.getOsd_remark());
             banksubledger.setBl_orderamount(othspendingsdetail.getOsd_nowbalance() * -1);
             banksubledger.setBl_item(othspendingsdetail.getOsd_type());

+ 10 - 13
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java

@@ -535,19 +535,14 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
 
     @Override
     public DocBaseDTO audit(VerificationFormDTO formData) {
-        Long id = null;
+
         DocBaseDTO baseDTO = new DocBaseDTO();
-        if (null != formData) {
-            id = formData.getMain().getId();
-            if (StringUtils.isEmpty(id)) {
-                baseDTO = saveFormData(formData);
-                id = baseDTO.getId();
-            }
-            Verification verification = new Verification();
-            verification.setVc_status(Status.AUDITED.getDisplay());
-            verification.setVc_statuscode(Status.AUDITED.name());
-            verification.setVc_id(Integer.valueOf(String.valueOf(id)));
-            verificationMapper.updateByPrimaryKeySelective(verification);
+        formData.getMain().setVc_status(Status.AUDITED.getDisplay());
+        formData.getMain().setVc_statuscode(Status.AUDITED.name());
+        formData.getMain().setVc_auditman(BaseContextHolder.getUserName());
+        formData.getMain().setVc_auditdate(new Date());
+        baseDTO = this.saveFormData(formData);
+        Long id = baseDTO.getId();
 
 
             VerificationDTO verificationDTO = formData.getMain();
@@ -575,7 +570,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                     updateAuditSubledeger(detail.getVcd_slid(),nowbalanceDet);
                 }
             }
-        }
+
         //更新出入库状态
         this.updateProdInoutStatus(id);
 
@@ -793,6 +788,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         verification.setVc_statuscode(Status.UNAUDITED.name());
         verification.setUpdateTime(new Date());
         verification.setUpdaterId(BaseContextHolder.getUserId());
+        verification.setVc_auditdate(null);
+        verification.setVc_auditman(null);
         //更新存在字段
         verificationMapper.updateByPrimaryKeySelective(verification);
 

+ 31 - 0
applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml

@@ -454,5 +454,36 @@
     </select>
 
 
+    <select id="selectByCondition" resultMap="BaseResultMap">
+        select *
+        from
+        (select  bl_date, bl_code, bl_kind,bl_bankcode,bl_bankid, bl_bankname, bl_income, bl_spending, bl_assname, bl_remark, companyid
+        from banksubledger where bl_kind in ('其他收入单', '其他支出单'))a
+        <where>
+            <if test="con != null">
+            ${con}
+            </if>
+            <if test="companyId != null">
+            and  companyId = #{companyId}
+            </if>
+        </where>
+        order by bl_bankname asc, bl_date desc,bl_bankcode desc
+    </select>
+
+    <select id="selectCalculateFields" resultType="string">
+--         select   ${fields}  from banksubledger
+        select ${fields}
+        from
+        (select  bl_date, bl_code, bl_kind,bl_bankcode,bl_bankid, bl_bankname, bl_income, bl_spending, bl_assname, bl_remark, companyid
+        from banksubledger where bl_kind in ('其他收入单', '其他支出单'))a
+        <where>
+            <if test="con != null">
+                ${con}
+            </if>
+            <if test="companyId != null">
+                and  companyId = #{companyId}
+            </if>
+        </where>
+    </select>
 
 </mapper>

+ 45 - 0
applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.CustmonthMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Custmonth" >
+    <id column="cm_id" property="cm_id" jdbcType="INTEGER" />
+    <result column="cm_yearmonth" property="cm_yearmonth" jdbcType="INTEGER" />
+    <result column="cm_custid" property="cm_custid" jdbcType="INTEGER" />
+    <result column="cm_custcode" property="cm_custcode" jdbcType="VARCHAR" />
+    <result column="cm_custname" property="cm_custname" jdbcType="VARCHAR" />
+    <result column="cm_beginamount" property="cm_beginamount" jdbcType="DOUBLE" />
+   <result column="cm_nowamount" property="cm_nowamount" jdbcType="DOUBLE" />
+    <result column="cm_nowpreamount" property="cm_nowpreamount" jdbcType="DOUBLE" />
+    <result column="cm_endamount" property="cm_endamount" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    cm_id, cm_yearmonth, cm_custid, cm_custcode, cm_custname, CM_BEGINAMOUNT, CM_NOWAMOUNT, 
+    CM_NOWPREAMOUNT, CM_ENDAMOUNT, companyid
+  </sql>
+
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from custmonth
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId} and (cm_endamount +cm_nowamount+ cm_nowpreamount + cm_beginamount) != 0
+      </if>
+    </where>
+    order by cm_id desc, cm_yearmonth desc
+  </select>
+
+
+  <parameterMap id="ymParamMap" type="java.util.Map">
+    <parameter property="v_YearMonth" jdbcType="INTEGER" mode="IN" />
+    <parameter property="v_YearMonthTo" jdbcType="INTEGER" mode="IN" />
+    <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
+  </parameterMap>
+
+  <select id="callCustm" parameterMap="ymParamMap" statementType="CALLABLE" >
+        CALL SP_REFRESHCUSTMONTHNEW(?, ?, ?)
+   </select>
+
+</mapper>

+ 2 - 1
applications/money/money-server/src/main/resources/mapper/CustomerCheckViewMapper.xml

@@ -50,6 +50,7 @@
         <result column="beginamount" property="beginamount" jdbcType="DOUBLE" />
         <result column="nowamount" property="nowamount" jdbcType="DOUBLE" />
         <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
+        <result column="nowbalance" property="nowbalance" jdbcType="DOUBLE" />
     </resultMap>
     <select id="selectCustAdd" resultMap="BaseAddMap">
     select a.sl_orderamount as beginamount, b.nowamount, b.nowpay,(a.sl_orderamount +b.nowamount-b.nowpay) as nowbalance FROM
@@ -57,7 +58,7 @@
     left join (select sum(sl_amount) as nowamount,sum(sl_preamount) as nowpay,sl_custid,sl_date from subledger where sl_kind !='期初余额'
     group by sl_custid,sl_date) b
     on a.sl_custid=b.sl_custid
-    where a.sl_custid=#{sl_custid} and ${cons} and a.companyid = #{companyId} limit 1
+    where a.sl_custid=#{sl_custid} and ${cons} and a.companyid = #{companyId}
   </select>
 
     <select id="getId" resultType="java.lang.Integer">

+ 68 - 0
applications/money/money-server/src/main/resources/mapper/PayablesdetailMapper.xml

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.PayablesdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Payablesdetail" >
+    <id column="pd_id" property="pd_id" jdbcType="INTEGER" />
+    <result column="pd_detno" property="pd_detno" jdbcType="INTEGER" />
+    <result column="pd_vendid" property="pd_vendid" jdbcType="INTEGER" />
+    <result column="pd_vendcode" property="pd_vendcode" jdbcType="VARCHAR" />
+    <result column="pd_vendname" property="pd_vendname" jdbcType="VARCHAR" />
+    <result column="pd_date" property="pd_date" jdbcType="DATE" />
+    <result column="pd_code" property="pd_code" jdbcType="VARCHAR" />
+    <result column="pd_kind" property="pd_kind" jdbcType="VARCHAR" />
+    <result column="pd_buyerid" property="pd_buyerid" jdbcType="INTEGER" />
+    <result column="pd_buyername" property="pd_buyername" jdbcType="VARCHAR" />
+    <result column="pd_addpay" property="pd_addpay" jdbcType="DOUBLE" />
+    <result column="pd_addpre" property="pd_addpre" jdbcType="DOUBLE" />
+    <result column="pd_remain" property="pd_remain" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="pd_status" property="pd_status" jdbcType="INTEGER" />
+    <result column="pd_query" property="pd_query" jdbcType="INTEGER" />
+    <result column="pd_ym" property="pd_ym" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    pd_id, pd_detno, pd_vendid, pd_vendcode, pd_vendname, pd_date, pd_code, pd_kind, 
+    pd_buyerid, pd_buyername, pd_addpay, pd_addpre, pd_remain, companyid, pd_status, 
+    pd_query,pd_ym
+  </sql>
+
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from payablesdetail
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId} and pd_query =1 and (pd_addpay + pd_addpre + pd_remain) != 0
+      </if>
+    </where>
+    order by pd_vendname asc, pd_detno asc, pd_date desc
+  </select>
+
+  <select id="selectCalculateFields" resultType="string">
+    select   ${fields}  from payablesdetail
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+  </select>
+
+  <select id="selectIdByName" resultType="long">
+    select ve_id from vendor where ve_name=#{name} and companyId=#{companyId}
+  </select>
+
+  <parameterMap id="ymParamMap" type="java.util.Map">
+    <parameter property="V_vendid" jdbcType="INTEGER" mode="IN" />
+    <parameter property="V_start" jdbcType="VARCHAR" mode="IN" />
+    <parameter property="V_end" jdbcType="VARCHAR" mode="IN" />
+    <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
+  </parameterMap>
+  <select id="callvend" parameterMap="ymParamMap" statementType="CALLABLE">
+        CALL SP_PAYABLESDETAIL_QUERY(?, ?, ?, ?)
+    </select>
+
+</mapper>

+ 67 - 0
applications/money/money-server/src/main/resources/mapper/ReceivablesdetailMapper.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.ReceivablesdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Receivablesdetail" >
+    <id column="rd_id" property="rd_id" jdbcType="INTEGER" />
+    <result column="rd_detno" property="rd_detno" jdbcType="INTEGER" />
+    <result column="rd_custid" property="rd_custid" jdbcType="INTEGER" />
+    <result column="rd_custcode" property="rd_custcode" jdbcType="VARCHAR" />
+    <result column="rd_custname" property="rd_custname" jdbcType="VARCHAR" />
+    <result column="rd_date" property="rd_date" jdbcType="DATE" />
+    <result column="rd_code" property="rd_code" jdbcType="VARCHAR" />
+    <result column="rd_kind" property="rd_kind" jdbcType="VARCHAR" />
+    <result column="rd_sellerid" property="rd_sellerid" jdbcType="INTEGER" />
+    <result column="rd_sellername" property="rd_sellername" jdbcType="VARCHAR" />
+    <result column="rd_addrec" property="rd_addrec" jdbcType="DOUBLE" />
+    <result column="rd_addpre" property="rd_addpre" jdbcType="DOUBLE" />
+    <result column="rd_remain" property="rd_remain" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="rd_status" property="rd_status" jdbcType="INTEGER" />
+    <result column="rd_query" property="rd_query" jdbcType="INTEGER" />
+    <result column="rd_ym" property="rd_ym" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    rd_id, rd_detno, rd_custid, rd_custcode, rd_custname, rd_date, rd_code, rd_kind, 
+    rd_sellerid, rd_sellername, rd_addrec, rd_addpre, rd_remain, companyid, rd_status, 
+    rd_query,rd_ym
+  </sql>
+
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from receivablesdetail
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId} and rd_query = 1 and (rd_addrec + rd_addpre + rd_remain) != 0
+      </if>
+    </where>
+    order by rd_custname asc, rd_detno asc, rd_date desc
+  </select>
+
+  <select id="selectCalculateFields" resultType="string">
+    select   ${fields}  from receivablesdetail
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+  </select>
+
+  <select id="selectIdByName" resultType="long">
+    select cu_id from customer where cu_name=#{name} and companyId=#{companyId}
+  </select>
+
+  <parameterMap id="ymParamMap" type="java.util.Map">
+    <parameter property="V_custid" jdbcType="INTEGER" mode="IN" />
+    <parameter property="V_start" jdbcType="VARCHAR" mode="IN" />
+    <parameter property="V_end" jdbcType="VARCHAR" mode="IN" />
+    <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
+  </parameterMap>
+  <select id="callcust" parameterMap="ymParamMap" statementType="CALLABLE">
+        CALL SP_RECEIVABLESDETAIL_QUERY(?, ?, ?, ?)
+    </select>
+</mapper>

+ 42 - 0
applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.VendmonthMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Vendmonth" >
+    <id column="vm_id" property="vm_id" jdbcType="INTEGER" />
+    <result column="vm_yearmonth" property="vm_yearmonth" jdbcType="INTEGER" />
+    <result column="vm_vendid" property="vm_vendid" jdbcType="INTEGER" />
+    <result column="vm_vendcode" property="vm_vendcode" jdbcType="VARCHAR" />
+    <result column="vm_vendname" property="vm_vendname" jdbcType="VARCHAR" />
+    <result column="vm_beginamount" property="vm_beginamount" jdbcType="DOUBLE" />
+    <result column="vm_nowamount" property="vm_nowamount" jdbcType="DOUBLE" />
+    <result column="vm_nowpreamount" property="vm_nowpreamount" jdbcType="DOUBLE" />
+    <result column="vm_endamount" property="vm_endamount" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    vm_id, vm_yearmonth, vm_vendid, VM_VENDCODE, VM_VENDNAME, VM_BEGINAMOUNT, VM_NOWAMOUNT, 
+    VM_NOWPREAMOUNT, VM_ENDAMOUNT, companyid
+  </sql>
+
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from vendmonth
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyid = #{companyId} and (vm_endamount+ vm_nowamount+vm_nowpreamount+vm_beginamount) != 0
+      </if>
+    </where>
+    order by vm_id desc, vm_yearmonth desc
+  </select>
+
+  <parameterMap id="ymParamMap" type="java.util.Map">
+    <parameter property="v_YearMonth" jdbcType="INTEGER" mode="IN" />
+    <parameter property="v_YearMonthTo" jdbcType="INTEGER" mode="IN" />
+    <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
+  </parameterMap>
+  <select id="callVend" parameterMap="ymParamMap" statementType="CALLABLE">
+        CALL SP_REFRESHVENDMONTHNEW(?, ?, ?)
+    </select>
+</mapper>

+ 3 - 2
applications/money/money-server/src/main/resources/mapper/VendorAcountViewMapper.xml

@@ -52,7 +52,8 @@
   <resultMap id="BaseAddMap" type="com.usoftchina.saas.money.po.VendOrCustAdd" >
     <result column="beginamount" property="beginamount" jdbcType="DOUBLE" />
     <result column="nowamount" property="nowamount" jdbcType="DOUBLE" />
-    <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
+    <result column="nowpay" property="nowpay" jdbcType="DOUBLE" />
+    <result column="nowbalance" property="nowbalance" jdbcType="DOUBLE" />
   </resultMap>
   <select id="selectVendAdd" resultMap="BaseAddMap">
     select a.sl_orderamount as beginamount, b.nowamount, b.nowpay,(a.sl_orderamount +b.nowamount-b.nowpay) as nowbalance FROM
@@ -60,7 +61,7 @@
     left join (select sum(sl_amount) as nowamount,sum(sl_preamount) as nowpay,sl_vendid,sl_date from subledger where sl_kind !='期初余额'
     group by sl_vendid,sl_date) b
     on a.sl_vendid=b.sl_vendid
-    where a.sl_vendid=#{sl_vendid} and ${cons} and a.companyid = #{companyId} limit 1
+    where a.sl_vendid=#{sl_vendid} and ${cons} and a.companyid = #{companyId}
   </select>
 
   <select id="getId" resultType="java.lang.Integer">

+ 19 - 1
applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml

@@ -31,6 +31,10 @@
     <result column="vc_text3" property="vc_text3" jdbcType="VARCHAR" />
     <result column="vc_text4" property="vc_text4" jdbcType="VARCHAR" />
     <result column="vc_text5" property="vc_text5" jdbcType="VARCHAR" />
+    <result column="vc_auditman" property="vc_auditman" jdbcType="VARCHAR" />
+    <result column="vc_auditdate" property="vc_auditdate" jdbcType="TIMESTAMP" />
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
   </resultMap>
   <sql id="Example_Where_Clause" >
     <where >
@@ -94,7 +98,7 @@
     vc_id, vc_code, vc_kind, vc_date, vc_vendid, vc_vendcode, vc_vendname, vc_custid, 
     vc_custcode, vc_custname, vc_turnvendid, vc_turnvendcode, vc_turnvendname, vc_turncustid, 
     vc_turncustcode, vc_turncustname, vc_amount1, vc_amount2, vc_status, vc_statuscode, vc_remark, companyId, updaterId, updateTime,
-    vc_text1, vc_text2, vc_text3, vc_text4, vc_text5
+    vc_text1, vc_text2, vc_text3, vc_text4, vc_text5, vc_auditman, vc_auditdate, createTime, creatorName
   </sql>
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.usoftchina.saas.money.po.VerificationExample" >
     select
@@ -235,6 +239,12 @@
       <if test="vc_text5 != null" >
         vc_text5,
       </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="vc_code != null" >
@@ -321,6 +331,12 @@
       <if test="vc_text5 != null" >
         #{vc_text5,jdbcType=VARCHAR},
       </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
     <selectKey resultType="Long" keyProperty="id" order="AFTER">
       SELECT LAST_INSERT_ID()
@@ -549,6 +565,8 @@
       <if test="vc_text5 != null" >
         vc_text5 = #{vc_text5,jdbcType=VARCHAR},
       </if>
+        vc_auditman = #{vc_auditman,jdbcType=VARCHAR},
+        vc_auditdate = #{vc_auditdate,jdbcType=TIMESTAMP}
     </set>
     where vc_id = #{vc_id,jdbcType=INTEGER}
   </update>

+ 2 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java

@@ -59,4 +59,6 @@ public class SaleDTO extends CommonBaseDTO{
     private String sa_seller;
 
     private String sa_sellercode;
+
+    private Integer sa_sellerid;
 }

+ 6 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java

@@ -31,8 +31,12 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
 
     String validateUnAudit(Long id);
 
+    String validateCloseStatus(Long id);
+
     String validateAudit(List<DocBaseDTO> baseDTOs);
 
+    String validateAuditStatus(Long id);
+
     Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long companyId);
 
     void updateTotal(Long id);
@@ -57,5 +61,7 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
 
     String validateCustAudit(List<DocBaseDTO> baseDTOs);
 
+    String validateCustStatus(Long id);
+
     String validateClose(List<DocBaseDTO> baseDTOs);
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java

@@ -58,4 +58,6 @@ public class Sale extends CommonBaseEntity{
     private String sa_seller;
 
     private String sa_sellercode;
+
+    private Integer sa_sellerid;
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java

@@ -65,6 +65,8 @@ public class SaleList implements Serializable {
 
     private String sa_auditman;
 
+    private Integer sa_sellerid;
+
     private Integer sd_id;
 
     private Integer sd_said;

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

@@ -225,24 +225,28 @@ public class SaleServiceImpl implements SaleService{
                 baseDTO = saveFormData(formData);
                 id = baseDTO.getId();
             }
+            //审核失败!该单据已审核
+            String code = saleMapper.validateAuditStatus(id);
+            if (null != code) {
+                throw new BizException(BizExceptionCode.SALE_AUDITED);
+            }
+            //存在已禁用客户,无法审核:
+            code = saleMapper.validateCustStatus(id);
+            if (null != code) {
+                throw new BizException(BizExceptionCode.SALE_CUSTBANDED.getCode(),String.format(BizExceptionCode.SALE_CUSTBANDED.getMessage(),"审核"));
+            }
+            //单据状态为已关闭,无法审核
+            code = saleMapper.validateCloseStatus(id);
+            if (null != code) {
+                throw new BizException(BizExceptionCode.SALE_CLOSE.getCode(),String.format(BizExceptionCode.SALE_CLOSE.getMessage(),"审核"));
+            }
             singleAudit(id);
         }
         return baseDTO;
     }
 
     @Transactional
-    private void singleAudit(Long id) {
-        /*Sale sale = new Sale();
-        //生成更新对象
-        sale.setId(id);
-        sale.setSa_status(Status.AUDITED.getDisplay());
-        sale.setSa_statuscode(Status.AUDITED.name());
-        sale.setUpdateTime(new Date());
-        sale.setUpdaterId(BaseContextHolder.getUserId());
-        sale.setSa_auditman("TESTADMIN");
-        sale.setSa_auditdate(new Date());
-        //更新存在字段
-        saleMapper.updateByPrimaryKeySelective(sale);*/
+    public void singleAudit(Long id) {
         Integer integer = saleMapper.checkCustomer(id);
         if (integer > 0) {
             throw new BizException(BizExceptionCode.SALE_CUST_CLOSE);
@@ -266,17 +270,7 @@ public class SaleServiceImpl implements SaleService{
                 baseDTOs.getBaseDTOs().size() == 0) {
             return;
         }
-
-        String validate = saleMapper.validateAudit(baseDTOs.getBaseDTOs());
-        if (!StringUtils.isEmpty(validate)) {
-            String message = BizExceptionCode.SALE_ORDER_HASAUDIT.getMessage();
-            int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
-            throw new BizException(code, String.format(message, validate));
-        }
-        String custAudit = saleMapper.validateCustAudit(baseDTOs.getBaseDTOs());
-        if (!StringUtils.isEmpty(custAudit)) {
-            throw new BizException(72009, "客户已关闭,无法审核, 单号:" + custAudit);
-        }
+        checkBatchAuditStatus(baseDTOs,"batchAudit");
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
             singleAudit(base.getId());
         }
@@ -287,6 +281,7 @@ public class SaleServiceImpl implements SaleService{
         if (null == id) {
             return;
         }
+        //单据状态为未审核,无法反审核
         String code = saleMapper.validateUnAudit(id);
         if (null != code) {
             throw new BizException(BizExceptionCode.SALE_ALREADY_UNAUDIT);
@@ -328,20 +323,7 @@ public class SaleServiceImpl implements SaleService{
                 baseDTOs.getBaseDTOs().size() == 0) {
             return;
         }
-        //存在未审核单据,单据编号:XXXX
-        String msg = saleMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
-        if (null != msg) {
-            String message = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getMessage();
-            int code = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getCode();
-            throw new BizException(code, String.format(message, msg));
-        }
-        //存在已关闭单据,单据编号:XXXX
-        msg = saleMapper.validateClose(baseDTOs.getBaseDTOs());
-        if (null != msg) {
-            String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
-            int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
-            throw new BizException(code, String.format(message, msg));
-        }
+        checkBatchAuditStatus(baseDTOs,"batchUnAudit");
         //saleMapper.BatchcheckSendStatus();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
             unAudit(base.getId());
@@ -395,12 +377,13 @@ public class SaleServiceImpl implements SaleService{
         //部分入库、全部入库
         int partTurnCount = 0,turnCount = 0;
         if(saleDetailList != null && saleDetailList.size() > 0){
+            Double yqty = 0.0;
             for(SaleDetail saleDetail : saleDetailList){
-                //
-                if(saleDetail.getSd_yqty() >= saleDetail.getSd_qty()){
+                yqty = saleDetail.getSd_yqty() == null ? 0.0 : saleDetail.getSd_yqty();
+                if(yqty >= saleDetail.getSd_qty()){
                     turnCount++;
 
-                }else if(saleDetail.getSd_yqty() > 0 && saleDetail.getSd_yqty() < saleDetail.getSd_qty()){
+                }else if(yqty > 0 && yqty < saleDetail.getSd_qty()){
                     //     0 < 入库数 < 采购数
                     partTurnCount++;
                 }
@@ -444,13 +427,13 @@ public class SaleServiceImpl implements SaleService{
             throw new BizException(BizExceptionCode.SALE_ALL_TURNOUT);
         }
         if (Status.CLOSE.name().equals(statuscode)){
-            throw new BizException(BizExceptionCode.SALE_CLOSE);
+            throw new BizException(BizExceptionCode.SALE_CLOSE.getCode(),String.format(BizExceptionCode.SALE_CLOSE.getMessage(),"转出货单"));
         }
 
         //检查从表
         for (SaleDetail detail : details) {
             pdQty = detail.getSd_qty();
-            pdYqty = detail.getSd_yqty();
+            pdYqty = detail.getSd_yqty() == null ? 0 : detail.getSd_yqty();
             if (pdQty - pdYqty > 0){
                 count++;
             }
@@ -501,7 +484,7 @@ public class SaleServiceImpl implements SaleService{
             //公司id
             prodIODetail.setCompanyId(companyId);
             //本次转单数
-            prodIODetail.setPd_outqty(saleDetail.getSd_qty() - saleDetail.getSd_yqty());
+            prodIODetail.setPd_outqty(saleDetail.getSd_qty() - (saleDetail.getSd_yqty() == null ? 0 : saleDetail.getSd_yqty()));
             //获取物料默认仓库
             Map<String, Object> warehouse = getWareHouseByCode(saleDetail.getSd_prodcode());
             if (null != warehouse) {
@@ -710,4 +693,54 @@ public class SaleServiceImpl implements SaleService{
         return null;
     }
 
+    /**
+     * 批量审核、反审核状态校验
+     * */
+    private void checkBatchAuditStatus(BatchDealBaseDTO baseDTOs,String opation){
+        if(opation.equals("batchAudit")){
+            //存在已审核单据,单据编号:XXX
+            String validate = saleMapper.validateAudit(baseDTOs.getBaseDTOs());
+            if (!StringUtils.isEmpty(validate)) {
+                String message = BizExceptionCode.SALE_ORDER_HASAUDIT.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
+                throw new BizException(code, String.format(message, validate));
+            }
+            //存在已关闭单据,单据编号:XXXX
+            validate = saleMapper.validateClose(baseDTOs.getBaseDTOs());
+            if (null != validate) {
+                String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
+                throw new BizException(code, String.format(message, validate));
+            }
+            //存在已禁用客户,无法审核,单据编号:XXX
+            String custAudit = saleMapper.validateCustAudit(baseDTOs.getBaseDTOs());
+            if (!StringUtils.isEmpty(custAudit)) {
+                String message = BizExceptionCode.SALE_ORDER_CUSTBANDED.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_CUSTBANDED.getCode();
+                throw new BizException(code, String.format(message, "反审核")+custAudit);
+            }
+        }else{
+            //存在未审核单据,单据编号:XXXX
+            String msg = saleMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
+            if (null != msg) {
+                String message = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getCode();
+                throw new BizException(code, String.format(message, msg));
+            }
+            //存在已关闭单据,单据编号:XXXX
+            msg = saleMapper.validateClose(baseDTOs.getBaseDTOs());
+            if (null != msg) {
+                String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
+                throw new BizException(code, String.format(message, msg));
+            }
+            //存在已禁用客户,无法审核,单据编号:XXX
+            msg = saleMapper.validateCustAudit(baseDTOs.getBaseDTOs());
+            if (!StringUtils.isEmpty(msg)) {
+                String message = BizExceptionCode.SALE_ORDER_CUSTBANDED.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_CUSTBANDED.getCode();
+                throw new BizException(code, String.format(message, "反审核")+msg);
+            }
+        }
+    }
 }

+ 1 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml

@@ -28,6 +28,7 @@
         <result column="sa_text3" property="sa_text3" jdbcType="VARCHAR" />
         <result column="sa_text4" property="sa_text4" jdbcType="VARCHAR" />
         <result column="sa_text5" property="sa_text5" jdbcType="VARCHAR" />
+        <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
         <result column="sd_id" property="sd_id" jdbcType="INTEGER" />
         <result column="sd_said" property="sd_said" jdbcType="INTEGER" />
         <result column="sd_detno" property="sd_detno" jdbcType="INTEGER" />

+ 26 - 6
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -33,13 +33,14 @@
     <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
     <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
     <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
+    <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
     sa_remark, sa_status, sa_statuscode, sa_sendstatuscode, sa_sendstatus, sa_printstatus, 
     sa_printstatuscode,companyId, updaterId,
     updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5,sa_auditman,sa_auditdate,
-    sa_seller,sa_sellercode,sa_date
+    sa_seller,sa_sellercode,sa_date,sa_sellerid
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select * from sale where sa_id = #{id}
@@ -56,7 +57,7 @@
       sa_sendstatus, sa_printstatus, sa_printstatuscode, 
       companyId, updaterId, updateTime,
       sa_text1, sa_text2, sa_text3, 
-      sa_text4, sa_text5)
+      sa_text4, sa_text5,sa_sellerid)
     values (#{sa_id,jdbcType=INTEGER}, #{sa_code,jdbcType=VARCHAR}, #{sa_custid,jdbcType=INTEGER}, 
       #{sa_custcode,jdbcType=VARCHAR}, #{sa_custname,jdbcType=VARCHAR}, #{sa_toplace,jdbcType=VARCHAR}, 
       #{sa_total,jdbcType=DOUBLE}, #{sa_totalupper,jdbcType=VARCHAR}, #{sa_remark,jdbcType=VARCHAR}, 
@@ -64,7 +65,7 @@
       #{sa_sendstatus,jdbcType=VARCHAR}, #{sa_printstatus,jdbcType=VARCHAR}, #{sa_printstatuscode,jdbcType=VARCHAR}, 
       #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
       #{sa_text1,jdbcType=VARCHAR}, #{sa_text2,jdbcType=VARCHAR}, #{sa_text3,jdbcType=VARCHAR}, 
-      #{sa_text4,jdbcType=VARCHAR}, #{sa_text5,jdbcType=VARCHAR})
+      #{sa_text4,jdbcType=VARCHAR}, #{sa_text5,jdbcType=VARCHAR},#{sa_sellerid,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
     <selectKey  resultType="java.lang.Long" keyProperty="id">
@@ -147,6 +148,9 @@
       <if test="sa_date != null" >
         sa_date,
       </if>
+      <if test="sa_sellerid != null">
+        sa_sellerid,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="sa_code != null" >
@@ -224,6 +228,9 @@
       <if test="sa_date != null" >
         #{sa_date,jdbcType=TIMESTAMP},
       </if>
+      <if test="sa_sellerid != null" >
+        #{sa_sellerid,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
@@ -310,6 +317,9 @@
       <if test="sa_date != null" >
         sa_date = #{sa_date,jdbcType=TIMESTAMP},
       </if>
+      <if test="sa_sellerid != null" >
+        sa_sellerid = #{sa_sellerid,jdbcType=INTEGER},
+      </if>
     </set>
     where sa_id = #{id,jdbcType=INTEGER}
   </update>
@@ -336,7 +346,8 @@
       sa_text2 = #{sa_text2,jdbcType=VARCHAR},
       sa_text3 = #{sa_text3,jdbcType=VARCHAR},
       sa_text4 = #{sa_text4,jdbcType=VARCHAR},
-      sa_text5 = #{sa_text5,jdbcType=VARCHAR}
+      sa_text5 = #{sa_text5,jdbcType=VARCHAR},
+      sa_sellerid = #{sa_sellerid,jdbcType=INTEGER}
     where sa_id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -356,20 +367,29 @@
       #{item.id}
     </foreach>
   </select>
+  <select id="validateAuditStatus" resultType="string" parameterType="long">
+    select sa_code from sale where IFNULL(sa_statuscode,' ')='AUDITED' and sa_id=#{id}
+  </select>
   <select id="validateClose" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
       select GROUP_CONCAT(sa_code) from sale where IFNULL(sa_sendstatuscode,' ')='CLOSE' and sa_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>
   </select>
+  <select id="validateCloseStatus" resultType="string" parameterType="long">
+    select sa_code from sale where IFNULL(sa_sendstatuscode,' ')='CLOSE' and sa_id=#{id}
+  </select>
   <select id="validateCustAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(sa_code) from sale left join customer on cu_id=sa_custid  where sa_statuscode='AUDITED' and sa_id in
+    select GROUP_CONCAT(sa_code) from sale left join customer on cu_id=sa_custid  where IFNULL(sa_statuscode,' ')='AUDITED' and IFNULL(cu_statuscode,' ')='BANNED' and sa_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>
   </select>
+  <select id="validateCustStatus" resultType="string" parameterType="long">
+    select sa_code from sale left join customer on cu_id=sa_custid  where IFNULL(cu_statuscode,' ')='BANNED' and sa_id=#{id}
+  </select>
   <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(sa_code) from sale where IFNULL(sa_statuscode,'UNAUDITED') = 'UNAUDITED' and sa_id in
+    select GROUP_CONCAT(sa_code) from sale where IFNULL(sa_statuscode,' ') = 'UNAUDITED' and sa_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>

+ 2 - 2
applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml

@@ -317,7 +317,7 @@
     companyId, updaterId, updateTime,
     sd_text1, sd_text2, sd_text3,
     sd_text4, sd_text5,
-    creatorId,createTime,creatorName)
+    creatorId,createTime,creatorName, sd_yqty)
     values
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
@@ -329,7 +329,7 @@
       #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
       #{item.sd_text1,jdbcType=VARCHAR}, #{item.sd_text2,jdbcType=VARCHAR}, #{item.sd_text3,jdbcType=VARCHAR},
       #{item.sd_text4,jdbcType=VARCHAR}, #{item.sd_text5,jdbcType=VARCHAR},
-      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR},#{item.sd_yqty,jdbcType=DOUBLE}
       )
     </foreach>
   </insert>

+ 7 - 4
base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java

@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -218,8 +219,8 @@ public class AuthController {
      * @param info
      * @return
      */
-    @GetMapping("/sso/callback/{clientId}")
-    public void ssoCallback(HttpServletRequest request, HttpServletResponse response,
+    @GetMapping(value = "/sso/callback/{clientId}", produces = {"application/javascript"})
+    public String ssoCallback(HttpServletRequest request, HttpServletResponse response,
                             @PathVariable(required = false) String clientId, CookieInfo info, String callback) throws IOException{
         if (null != info && null != info.getMobile()) {
             AccountDTO accountDTO = null;
@@ -231,7 +232,7 @@ public class AuthController {
                 } else {
                     logger.error(result.getMessage());
                     ServletUtils.writeJsonPMessage(response, callback, false);
-                    return;
+                    return "successCallback({success:'0'})";
                 }
             } else {
                 accountDTO = result.getData();
@@ -242,7 +243,7 @@ public class AuthController {
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
                         ServletUtils.writeJsonPMessage(response, callback, false);
-                        return;
+                        return "successCallback({success:'0'})";
                     }
                 }
             }
@@ -263,9 +264,11 @@ public class AuthController {
                 TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
                 socketMessageApi.sendToClient(clientId, "/sso/callback",
                         JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
+                return "successCallback({success:'1'})";
             }
             ServletUtils.writeJsonPMessage(response, callback, true);
         }
+        return "successCallback({success:'0'})";
     }
 
     /**

+ 1 - 1
frontend/saas-portal-web/config/index.js

@@ -10,7 +10,7 @@ module.exports = {
     // Paths
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
-    proxyTable: {}, 
+    proxyTable: {},  
 
     // Various Dev Server settings
     // host: 'localhost', // can be overwritten by process.env.HOST

+ 1 - 1
frontend/saas-portal-web/src/components/conenter/addgongsi.vue

@@ -110,7 +110,7 @@ import { setTimeout } from 'timers';
             VDistpicker
         },
         mounted(){
-            this.$refs.name.value = this.mytoken.account.realname
+            this.$refs.name.value = this.mytoken.account.realname == this.mytoken.account.mobile ? '' : this.mytoken.account.realname
             this.$refs.email.value = this.mytoken.account.email
         },
         methods: {

+ 3 - 2
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -1,6 +1,5 @@
 <template>
     <div class="div">
-        
         <div id="navigation" class="navbar-inverse navbar-fixed-top animated-header">
         <div class="container">
             <div class="navbar-header">
@@ -31,6 +30,7 @@
             </div>
         </div>
         </div>
+
         <iframe hidden :src="setTokenPage"></iframe>
         <div class="gs-worp">
             <!-- 顶部tab -->
@@ -130,7 +130,8 @@ import { setTimeout } from 'timers';
                 const frame = window.frames[window.frames.length - 1]
                 frame.postMessage('', '*')
                 Session.remove()
-                window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL=https://'+window.location.host
+                window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL='+window.location.origin
+                // this.$router.puth({path:'/home'})
             },
             //修改密码
             changpasd(){

+ 18 - 35
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -21,10 +21,8 @@
             <li><a href="https://www.usoftchina.com/" target="_blank"><span>优软云</span></a></li>
             <li>
               <a href="#feature"><span>特色</span></a>
-              <!-- <router-link to="/enterprise"><a href="#"><span>特色</span></a></router-link> -->
             </li>
             <li><a href="#service"><span>功能</span></a></li>
-            <!-- <li><a href="#prototype"><span>帮助中心</span></a></li> -->
             <li><a href="https://uas.usoftchina.com/about" target="_blank"><span>关于我们</span></a></li>
             <li class="login" v-if="!account" style="margin-left: 30px;">
               <span @click="login"><img src="/static/img/assets/denglu3x.png" alt="">登录  &nbsp;</span>
@@ -58,8 +56,6 @@
       <div class="tiyan" v-if="isexperience">
         <img @click="Closeexperience" class="tc-on ty-out" src="/static/img/qiye/x.png" alt="" />
         <div><img class="ty-logo" src="/static/img/assets/dalogo@2x.png" alt=""></div>
-        <!-- <div><p class="ty-logotxt">欢迎你访问U企云服</p></div> -->
-        <!-- <div class="ty-title"><span>填写手机号后,即刻体验电子行业贸易版所有功能</span></div> -->
         <div class="ty-phone over">
           <div class="left ty-input">
             <span><img style="margin: 6px 8px 10px 15px;" src="/static/img/assets/phone.png" alt=""></span>
@@ -265,23 +261,23 @@
         this.isproblem = true
       } else {
         this.isproblem = this.$route.params.isporblem
-      }
-        this.$ajax({
-          url: this.$url.api+'/api/auth/info',
-          method: 'get',
-          async:false,
-          withCredentials:true
-        })
-        .then(res=>{
-          const data=res.data.data,session = data.token, account = data.account
-          account.companies = account.companies || []
-          session.account = account
-          Session.set(session);
-          this.account = Session.getAccount();
-        })
-        .catch(err=>{
-          // console.log("请求失败",err)
-        })
+      };
+      this.$ajax({
+        url: this.$url.api+'/api/auth/info',
+        method: 'get',
+        async:false,
+        withCredentials:true
+      })
+      .then(res=>{
+        const data=res.data.data,session = data.token, account = data.account
+        account.companies = account.companies || []
+        session.account = account
+        Session.set(session);
+        this.account = Session.getAccount();
+      })
+      .catch(err=>{
+        // console.log("请求失败",err)
+      })
     },
     mounted() {
       this.clientId = Math.random().toString(36).substr(2)
@@ -349,7 +345,7 @@
         const frame = window.frames[window.frames.length - 1]
         frame.postMessage('', '*')
         Session.remove()
-        window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL=https://'+window.location.host
+        window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL='+window.location.origin
         //this.$router.go(0);
       },
       // 关闭窗口
@@ -362,7 +358,6 @@
       },
       //体验
       experience(){
-        console.log(123)
         this.isexperience = true;
       },
       //关闭体验
@@ -451,18 +446,6 @@
   width: 140px;
   margin: 15px 0 50px 13px;
 }
-.ty-logotxt {
-  font-family: PingFangSC-Regular;
-  font-size: 22px !important;
-  color: #059FFE;
-}
-.ty-title {
-  margin-top: 30px;
-  font-family: PingFangSC-Regular;
-  font-size: 14px;
-  color: #059FFE;
-  text-align: center;
-}
 .ty-input {
   width: 330px;
   height: 40px;

+ 17 - 6
frontend/saas-portal-web/src/components/conenter/problem.vue

@@ -18,7 +18,8 @@
                   <li v-for="(d , i) in list" :key="i">
                     <div class="over Text-title" @click="shows(d,i)">
                       <span class="left bz-yuandian"></span>
-                      <span ref="txttitle" class="left bz-txttitle">{{d.title}}</span>
+                      <!-- <span class="left bz-txttitle">{{d.title}}</span> -->
+                      <span class="left bz-txttitle" v-html="keyword(d.title,searchVal)"></span>
                       <img  class="right bz-copy" :class="d.isshow ? 'rotates' : 'norotate'" src="/static/img/Triangle Copy 4.png" alt="">
                     </div>
                     <div ref="title" class="Text-content" :class="d.isshow ? 'dispays' : 'hides'">
@@ -38,7 +39,7 @@
         data(){
           return {
             arr:[
-              {isshow: true, title:'1、如何注册开通优企云服?',centent:'警方圣诞快乐JFK的实力积分积分累积角度考虑实际疯狂的世界佛教埃及空军看见反抗类毒素解放就'},
+              {isshow: true, title:'1、如何注册开通U企云服?',centent:'答:首先进入【U企云服】(http://saas.usoftchina.com) 进行注册;已是优软云的企业用户,进入【U企云服】登陆后,在【账户中心】 选择企业点击【开通服务】即可开通。'},
               {isshow: false, title:'2、实际送货数量大于采购单数量如何操作?',centent:'答:若超出部份正好是贵司所需, 按实际收货数量修改采购验收数量(应付款是按已审核的采购验收单金额记账的'},
               {isshow: false, title:'3、为什么新增采购单据时有的物料可自动带出单价, 有的不能?',centent:'答:因为采购单中的单价取的是物料资料中的最新采购单价, 而最新采购单价是采购验收单审核后自动更新至物料资料中的。'},
               {isshow: false, title:'4、采购单分批次交货时,如何操作? 采购单界面点“转验收单”按钮时会将采购单中的所有都转过去。',centent:'答:采购验收单中可修改数量, 也可删除明细行。 删除后再次收货时在采购单界面点“转验收单”按钮时生成的采购验收单会显示之前删除的那行数据(即所有未交部份均可再显示)'},
@@ -64,18 +65,28 @@
             let textH =  this.$refs.text[i].offsetHeight;
             this.$refs.title[i].style.height = textH + 'px';
           },
+          //搜索文字高亮
+          keyword(val,word){
+            val = val + '';
+            if (val.indexOf(word) !== -1 && word !== '') {
+              return val.replace(word, '<font color="#409EFF">' + word + '</font>')
+            } else {
+              return val
+            }
+          },
         },
         //通过计算属性过滤数据
         computed:{
             list: function(){
-                var arrByZM = [];
+                let list = [];
+                let val = this.searchVal.replace(/\s+/g, "")//去除空格
                 for (var i=0;i<this.arr.length;i++){
-                    if(this.arr[i].title.search(this.searchVal) != -1){
+                    if(this.arr[i].title.search(val) != -1){
                         //判断输入框中的值是否可以匹配到数据,如果匹配成功添加到数组
-                        arrByZM.push(this.arr[i]);
+                      list.push(this.arr[i]);
                     }
                 }
-                return arrByZM;
+                return list;
             }
         }
     }

+ 1 - 1
frontend/saas-portal-web/src/components/footer/footer.vue

@@ -29,7 +29,7 @@
 						</ul>
 						<ul>
 							<li><span>产品</span></li>
-							<li><a href="#">企云服</a></li>
+							<li><a href="#">U企云服</a></li>
 							<li><a href="https://mall.usoftchina.com/" target="_blank">优软商城</a></li>
 							<li><a href="https://fin.yitoa-fintech.com/" target="_blank">优智融</a></li>
 							<li><a href="https://zb.usoftchina.com/" target="_blank">闯客网</a></li>

+ 0 - 25
frontend/saas-portal-web/src/pages/cell/cell.html

@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <title>Document</title>
-</head>
-<body>
-    <div id="app">hello</div>
-    <script>
-        // iframe接收消息
-        window.addEventListener('message', function(e) {
-            if (e.data == 'removeToken') {
-                if (e.source != window.parent) {
-                    return;
-                }
-                var storeKey = 'app-state-session';
-                localStorage.removeItem(storeKey);
-                window.parent.postMessage("success", "*");
-            }
-        });
-    </script>
-</body>
-</html>

+ 0 - 0
frontend/saas-portal-web/src/pages/cell/cell.js


+ 0 - 15
frontend/saas-portal-web/src/pages/cell/cell.vue

@@ -1,15 +0,0 @@
-<template>
-    <div>
-
-    </div>
-</template>
-
-<script>
-    export default {
-        
-    }
-</script>
-
-<style scoped>
-
-</style>

+ 1 - 1
frontend/saas-portal-web/src/pages/index/index.html

@@ -32,7 +32,7 @@
 
         <script src="./static/js/sockjs.min.js"></script>
         <script src="./static/js/stomp.min.js"></script>
-    <title>企云服</title>
+    <title>U企云服</title>
   </head>
   <body>
     <div id="app"></div>

BIN
frontend/saas-portal-web/static/img/assets/1@2x.png


BIN
frontend/saas-portal-web/static/img/assets/2@3x.png


BIN
frontend/saas-portal-web/static/img/assets/3@2x.png


BIN
frontend/saas-portal-web/static/img/gongneng/Group 32.png


BIN
frontend/saas-portal-web/static/img/logo_w.png


BIN
frontend/saas-portal-web/static/img/qr-tech.png


+ 9 - 2
frontend/saas-web/app/Application.scss

@@ -421,8 +421,8 @@ div::-webkit-scrollbar-track {
   border-left: 1px solid #D2D6E5;
   
   &:before {
-    content: "\e80f";
-    font-family: font-saas;
+    // content: "\e80f";
+    // font-family: font-saas;
     color: #5AC6F8;
   }
 }
@@ -484,4 +484,11 @@ div::-webkit-scrollbar-track {
 /** tab **/
 .x-tab-default.x-tab-active .x-tab-close-btn {
   color: #34BAF6;
+}
+
+/** tabclosemenu **/
+.x-menu.x-tab-close-menu {
+  & > div > div > div.x-box-inner.x-box-scroller-body-vertical.x-scroller > div > div > a > span {
+    margin-left: 28px;
+  }
 }

+ 3 - 0
frontend/saas-web/app/view/core/base/ImportWindow.js

@@ -98,6 +98,9 @@ Ext.define('saas.view.core.base.ImportWindow', {
                         if(!res.success){
                             saas.util.BaseUtil.showErrorToast('导入数据失败:' + res.message);
                         }else{
+                            //刷新界面
+                            var g = form.ownerCt.down('grid');
+                            g.store.loadPage(g.store.currentPage);
                             form.close();
                         }
                     },

+ 4 - 3
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

@@ -28,20 +28,21 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
         width:300
     }],
     dbColumns: [{
-        conditionCode: 'id',
         text: "客户ID",
         dataIndex: "id",
         hidden:true
     }, {
-        conditionCode: 'cu_code',
         text: "客户编号",
         dataIndex: "cu_code",
         width: 150
     }, {
-        conditionCode: 'cu_name',
         text: "客户名称",
         dataIndex: "cu_name",
         width: 200
+    }, {
+        text: "客户简称",
+        dataIndex: "cu_shortname",
+        width: 150
     }, {
         conditionCode: 'cu_type',
         text: "客户类型",

+ 4 - 0
frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js

@@ -41,6 +41,10 @@ Ext.define('saas.view.core.dbfind.types.VendorDbfindTrigger', {
         text: "供应商名称",
         dataIndex: "ve_name",
         width: 200
+    }, {
+        text: "供应商简称",
+        dataIndex: "ve_shortname",
+        width: 150
     }, {
         text: "供应商类型",
         dataIndex: "ve_type",

+ 1 - 0
frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js

@@ -55,6 +55,7 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
             bind: {
                 title: '新增仓库资料'
             },
+            _parent:this,
             caller:'WareHouse',
             session: true
         });

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

@@ -317,7 +317,7 @@ Ext.define('saas.view.core.form.FormPanel', {
 
         var detailGrids = me.query('detailGridField');
 
-        for (var i = 0; i < detailCount; i++) {
+        for (var i = 0; i < detailGrids.length; i++) {
             var detailData = formData['detail' + i] || [],
                 detail = viewData['detail' + i],
                 grid = detailGrids[i],

+ 7 - 2
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -387,11 +387,16 @@ Ext.define('saas.view.core.form.FormPanelController', {
         mlCaller = form.caller,
         win = Ext.getCmp(form.xtype+mlKeyvalue);
         if (!win&&mlKeyvalue!=0) {
+            var panel = form.up('core-tab-panel'),panelEl;panelEl = panel.getEl()
+            var box = panelEl.getBox();
+            var height = box.height;
+            var width = box.width;
             var win = form.add(Ext.create('Ext.window.Window', {
                 modal: true,
                 id:me.xtype+mlKeyvalue,
-                height: '60%',
-                width: '80%',
+                cls:'x-window-dbfind',
+                height: height*0.8,
+                width: width*0.8,
                 title: '操作日志('+viewModel.get(form._codeField)+')',
                 scrollable: true,
                 constrain: true,

+ 0 - 1
frontend/saas-web/app/view/core/form/MseeageLog.js

@@ -3,7 +3,6 @@ Ext.define('saas.view.core.form.MseeageLog', {
     xtype: 'core-form-mseeageLog',
 
     autoScroll: true,
-    frame:true,
     layout:'fit',
     dataUrl:'/api/commons/messagelog/list',
 

+ 37 - 24
frontend/saas-web/app/view/core/form/MultiCombo.js

@@ -16,21 +16,24 @@ Ext.define('saas.view.core.form.MultiCombo', {
         me.callParent(arguments);
     },
     listeners:{
-        afterrender:function(f){
-            this.mon(f.el,{
-                mouseover: this.onMouseOver,
-                mouseleave:this.onMouseLeave,
-                scope:this
-            });
-        }
+        focus: function() {
+            this.showMenu();
+        },
+        // afterrender:function(f){
+        //     this.mon(f.el,{
+        //         mouseover: this.onMouseOver,
+        //         mouseleave:this.onMouseLeave,
+        //         scope:this
+        //     });
+        // }
 
     },
-    onMouseOver:function(){
-       this.showMenu();
-    },
-    onMouseLeave:function(a,b,c){
-        this.hideMenu(a.parentEvent?a:b);//el光标离开第二个参数为Event对象
-    },
+    // onMouseOver:function(){
+    //    this.showMenu();
+    // },
+    // onMouseLeave:function(a,b,c){
+    //     this.hideMenu(a.parentEvent?a:b);//el光标离开第二个参数为Event对象
+    // },
     onTriggerClick:function(){
         this.showMenu();
     },
@@ -42,10 +45,10 @@ Ext.define('saas.view.core.form.MultiCombo', {
             me.menu = Ext.create('Ext.menu.Menu',{
                 hideOnParentHide: false,
                 items: me.getMenuItems(),
-                listeners:{
-                    mouseleave:me.onMouseLeave,
-                    scope:me
-                }
+                // listeners:{
+                //     mouseleave:me.onMouseLeave,
+                //     scope:me
+                // }
             });
         }
         return me.menu;
@@ -93,17 +96,27 @@ Ext.define('saas.view.core.form.MultiCombo', {
         var me = this, rawV = '',
         datas = me.datas,
         menu = me.menu;
-        if(!Ext.isArray(items)) {
-            items = [items]
+        if(Ext.isString(items)) {
+            items = items.split(',');
         }
         items.map(function(item, index) {
             if(Ext.isString(item)) {
-                var data = datas.find(function(d) {
-                    return d[0] == item;
+                // var data = datas.find(function(d) {
+                //     return d[0] == item;
+                // });
+                var data = Ext.Array.findBy(datas, function(d) {
+                    return d[0] == item || d[1] == item;
                 });
-                items[index] = {
-                    text: data[1],
-                    value: data[0]
+                if(data) {
+                    items[index] = {
+                        text: data[1],
+                        value: data[0]
+                    }
+                }else {
+                    items[index] = {
+                        text: item,
+                        value: item
+                    }
                 }
             }
         })

+ 2 - 0
frontend/saas-web/app/view/core/form/field/ConDateField.js

@@ -60,6 +60,7 @@ Ext.define('saas.view.core.form.field.ConDateField', {
             formatText: '',
             allowBlank: allowBlank,
             flex: 1,
+            editable:false,
             fieldStyle: me.fieldStyle,
             emptyText: '起始时间',
             //matchFieldWidth:true,
@@ -95,6 +96,7 @@ Ext.define('saas.view.core.form.field.ConDateField', {
             format: 'Y-m-d',
             formatText: '',
             flex: 1,
+            editable:false,
             fieldStyle: me.fieldStyle,
             emptyText: '结束时间',
             listeners: {

+ 81 - 0
frontend/saas-web/app/view/core/form/field/ConMonthField.js

@@ -0,0 +1,81 @@
+Ext.define('saas.view.core.form.field.ConMonthField', {
+    extend: 'Ext.form.FieldContainer',
+    alias: 'widget.conmonthfield',
+
+    layout: 'hbox',
+    items: [],
+    defaults: {
+        margin: '0 0 0 0'
+    },
+    columnWidth: 0.5,
+    defaultBindProperty: 'value',
+
+    combineErrors: true,
+
+    cls: 'x-conmonthfield',
+
+    initComponent : function(){
+        this.callParent(arguments);
+        var me = this, allowBlank = (Ext.isDefined(me.allowBlank) ? me.allowBlank : true);
+        me.from = me.insert(0, {
+            xtype: 'monthdatefield',
+            listeners: {
+                beforeChange: me.beforeFromChange,
+                change: me.fromChange
+            }
+        });
+        me.to = me.insert(1, {
+            xtype: 'monthdatefield',
+            listeners: {
+                beforeChange: me.beforeToChange,
+                change: me.toChange
+            }
+        });
+    },
+
+    setValue: function(value) {
+        this.value = value;
+        this.publishState('value', this.value);
+    },
+
+    beforeFromChange: function(picker, value) {
+        var container = picker.ownerCt,
+        toField = container.to,
+        toValue = toField.value;
+
+        if(Number(value) > Number(toValue)) {
+            toField.setValue('');
+        }
+        return true;
+    },
+
+    fromChange: function(picker, newValue, oldValue) {
+        var container = picker.ownerCt,
+        toField = container.to;
+        container.setValue({
+            from: newValue,
+            to: toField.value
+        });
+    },
+
+    beforeToChange: function(picker, value) {
+        var container = picker.ownerCt,
+        fromField = container.from,
+        fromValue = fromField.value;
+
+        if(Number(value) < Number(fromValue)) {
+            return false;
+        }else {
+            return true;
+        }
+    },
+
+    toChange: function(picker, newValue, oldValue) {
+        var container = picker.ownerCt,
+        fromField = container.from;
+        container.setValue({
+            from: fromField.value,
+            to: newValue
+        });
+    }
+});

+ 10 - 14
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -217,25 +217,20 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         store.each(function(s) {
             var itemFields = s.fields,
             itemData = s.getData(),
+            detno = itemData[detnoColumn],
+            id = itemData.id,
             dirtyFields = [];
 
-            for(var x = 0; x < itemFields.length; x++) {
-                var field = itemFields[x],
-                name = field.name,
-                type = field.type;
-
-                if(type == 'int' && itemData[name] == 0) {
-                }else if(type == 'string' && itemData[name] == '') {
-                }else if(type == 'float' && itemData[name] == 0) {
-                }else if(type == 'date' && itemData[name] == null) {
-                }else {
-                    dirtyFields.push(name);
-                }
+            if(s.isDirty()) {
+                var modified = s.modified;
+                var dirtyFields = Ext.Object.getAllKeys(modified);
             }
 
-            // 如果有有效数据(非ID和序号列)才算dirty,否则直接commit
+            // 如果有有效数据才算dirty,否则直接commit
             if(dirtyFields.length == 2 && Ext.Array.contains(dirtyFields, 'id') && Ext.Array.contains(dirtyFields, detnoColumn)) {
-                s.commit()
+                s.commit();
+            }else if(!Ext.isNumber(id) && dirtyFields.length == 1 && dirtyFields[0] == detnoColumn) {
+                s.commit();
             }
         });
 
@@ -287,6 +282,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             store.remove(selectedRecord);
             me.fireEvent('validChange');
         }
+        store.getAt(0) ? store.afterEdit(store.getAt(0), ['']) : null;
     },
 
     swapUp: function() {

+ 12 - 9
frontend/saas-web/app/view/core/form/field/Month.js

@@ -80,25 +80,32 @@ Ext.define('saas.view.core.form.field.Month', {
             month = Number(month) + 1;
             month = month < 10 ? '0' + month : month;
             year = year == null ? new Date().getFullYear() : year;
+
+            var v = year + '' + month;
             if (this.minValue) {
-                if (Number(year + '' + month) < this.minYearMonth) {
+                if (Number(v) < this.minYearMonth) {
                     return;
                 }
             }
             if (this.maxValue) {
-                if (Number(year + '' + month) > this.maxYearMonth) {
+                if (Number(v) > this.maxYearMonth) {
                     return;
                 }
             }
-            this.setValue(year + '' + month);
+            if(!this.fireEvent('beforeChange', this, v)) {
+                this.monthPicker.hide();
+                return;
+            }
+            this.setValue(v);
+            this.fireEvent('select', this, v);
         }
-        me.onSelect();
+        this.monthPicker.hide();
     },
     getCurrentVal:function(){
         return Ext.Date.format(new Date(),this.format);
     },
     onCancelClick: function() {
-        this.onSelect();
+        this.monthPicker.hide();
     },
     getPickerValues:function() {
         var val = this.value, year, month;
@@ -118,8 +125,4 @@ Ext.define('saas.view.core.form.field.Month', {
         }
         this.callParent(arguments);
     },
-    onSelect: function() {
-        this.monthPicker.hide();
-    }
-
 });

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

@@ -77,7 +77,7 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
     listeners: {
         boxReady:function(form){
             if(window.innerHeight - 110 >= 800){
-                form.setHeight(112);
+                form.setHeight(96);
             }
         },
         beforerender: function(form) {

+ 5 - 0
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -162,6 +162,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     text: '新增',
                     cls:'x-formpanel-btn-blue',
                     handler: 'onAddClick',
+                    hidden: true,
                     bind: {
                         hidden: '{!addEnable}'
                     }
@@ -184,12 +185,14 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                             } 
                         }
                     },
+                    hidden: true,
                     bind: {
                         hidden: '{!auditEnable}'
                     }
                 },  {
                     text: '导出',
                     handler: me.onExport,
+                    hidden: true,
                     bind: {
                         hidden: '{!importEnable}'
                     }
@@ -211,12 +214,14 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                             } 
                         }
                     },
+                    hidden: true,
                     bind: {
                         hidden: '{!closeEnable}'
                     }
                 }, {
                     text: '删除',
                     handler: me.onDelete,
+                    hidden: true,
                     bind: {
                         hidden: '{!deleteEnable}',
                         disabled: '{deleteDisable}'

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

@@ -13,7 +13,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     layout: 'vbox',
     autoScroll: true,
-    bodyBorder:false,
+    bodyBorder: false,
     bodyPadding: 5,
 
     groupField: null, // 分组字段
@@ -21,191 +21,164 @@ Ext.define('saas.view.core.report.ReportPanel', {
     defaultCondition: null, // 默认查询条件
     searchItems: [], // 查询字段
     reportTitle: '报表',
-    autoLoad:true,
+    autoLoad: true,
+    allowPaging: true,
     printAble: true,
     exportAble: true,
+    showMySummary: true,
     queryMode: 'DETAIL',
 
-    initComponent: function() {
+    initComponent: function () {
         var me = this;
         var printAble = me.printAble;
         var exportAble = me.exportAble;
         var store = me.initStore();
         columnWidth: 0.25,
-        Ext.apply(me, {
-            items: [{
-                xtype: 'form',
-                width: '100%',
-                layout: 'column',
-                defaults:{
-                    margin: '0 5 5 0',
-                    labelAlign: 'right',
-                    labelWidth: 90,
-                    columnWidth: 0.25,
-                },
-                items: me.initSearchItems().concat([{
-                    xtype: 'container',
-                    columnWidth: me.QueryWidth || 0.5,
-                    items: [{
-                        xtype: 'button',
-                        text: '查询',
-                        handler: 'onQuery',
-                        formBind:true
-                    },{
-                        xtype:'button',
-                        text:'打印',
-                        hidden: !printAble,
-                        style: {
-                            float: 'right'
-                        },
-                        handler: 'exportTo',
-                        cfg: {
-                            type: 'html',
-                            includeGroups: true,
-                            includeSummary: true,
-                            isPrint:true
-                        }
-                    },{
-                        xtype: 'button',
-                        style: {
-                            float: 'right'
-                        },
-                        text: '导出',
-                        hidden: !exportAble,
-                        menu: {
-                            defaults: {
-                                handler: 'exportTo'
+            Ext.apply(me, {
+                items: [{
+                    xtype: 'form',
+                    width: '100%',
+                    layout: 'column',
+                    defaults: {
+                        margin: '0 5 5 0',
+                        labelAlign: 'right',
+                        labelWidth: 90,
+                        columnWidth: 0.25,
+                    },
+                    items: me.initSearchItems().concat([{
+                        xtype: 'container',
+                        columnWidth: me.QueryWidth || 0.5,
+                        items: [{
+                            xtype: 'button',
+                            text: '查询',
+                            handler: 'onQuery',
+                            formBind: true
+                        }, {
+                            xtype: 'button',
+                            text: '打印',
+                            hidden: !printAble,
+                            style: {
+                                float: 'right'
                             },
-                            items: [{
-                                text: 'Excel xlsx',
-                                cfg: {
-                                    type: 'excel07',
-                                    ext: 'xlsx'
-                                }
-                            }, {
-                                text: 'Excel xlsx (包含分组合计)',
-                                cfg: {
-                                    type: 'excel07',
-                                    ext: 'xlsx',
-                                    includeGroups: true,
-                                    includeSummary: true
-                                }
-                            }, {
-                            //     text: 'Excel xml',
-                            //     cfg: {
-                            //         type: 'excel03',
-                            //         ext: 'xml'
-                            //     }
-                            // }, {
-                            //     text: 'Excel xml (包含分组合计)',
-                            //     cfg: {
-                            //         type: 'excel03',
-                            //         ext: 'xml',
-                            //         includeGroups: true,
-                            //         includeSummary: true
-                            //     }
-                            // }, {
-                                text: 'CSV',
-                                cfg: {
-                                    type: 'csv'
-                                }
-                            }, {
-                                text: 'CSV (包含分组合计)',
-                                cfg: {
-                                    type: 'csv',
-                                    includeGroups: true,
-                                    includeSummary: true
-                                }
-                            //     text: 'TSV',
-                            //     cfg: {
-                            //         type: 'tsv',
-                            //         ext: 'csv'
-                            //     }
-                            // }, {
-                            //     text: 'HTML',
-                            //     cfg: {
-                            //         type: 'html'
-                            //     }
-                            // }, {
-                            //     text: 'HTML (包含分组合计)',
-                            //     cfg: {
-                            //         type: 'html',
-                            //         includeGroups: true,
-                            //         includeSummary: true
-                            //     }
-                            }]
-                        }
-                    }]
-                }])
-            }, {
-                xtype: 'grid',
-                width: '100%',
-                cls: 'x-report-grid',
-                flex: 1,
-                border: 0,
-                sortableColumns: false,
-                enableColumnHide: false,
-                rowLines: false,
-                plugins: [{
-                    ptype: 'gridexporter',
-                }, {
-                    ptype: 'menuclipboard'
-                }],
-                features: [{
-                    ftype: 'groupingsummary',
-                    hideGroupedHeader: false,
-                    enableGroupingMenu: false,
-                    collapsible: false
+                            handler: 'exportTo',
+                            cfg: {
+                                type: 'html',
+                                includeGroups: true,
+                                includeSummary: true,
+                                isPrint: true
+                            }
+                        }, {
+                            xtype: 'button',
+                            style: {
+                                float: 'right'
+                            },
+                            text: '导出',
+                            hidden: !exportAble,
+                            menu: {
+                                defaults: {
+                                    handler: 'exportTo'
+                                },
+                                items: [{
+                                    text: 'Excel xlsx',
+                                    cfg: {
+                                        type: 'excel07',
+                                        ext: 'xlsx'
+                                    }
+                                }, {
+                                    text: 'Excel xlsx (包含分组合计)',
+                                    cfg: {
+                                        type: 'excel07',
+                                        ext: 'xlsx',
+                                        includeGroups: true,
+                                        includeSummary: true
+                                    }
+                                }, {
+                                    text: 'CSV',
+                                    cfg: {
+                                        type: 'csv'
+                                    }
+                                }, {
+                                    text: 'CSV (包含分组合计)',
+                                    cfg: {
+                                        type: 'csv',
+                                        includeGroups: true,
+                                        includeSummary: true
+                                    }
+                                }]
+                            }
+                        }]
+                    }])
                 }, {
-                    ftype: 'mysummary',
-                    dock: 'bottom'
-                }],
-                store: store,
-                columns: me.initColumns(),
-                dockedItems: [{
-                    xtype: 'pagingtoolbar',
-                    dock: 'bottom',
-                    displayInfo: true,
-                    store: store
-                }],
-                viewConfig: {
-                    deferEmptyText: false,
-                    listeners: {
-                        itemcontextmenu: function(view, rec, node, index, e) {
-                            e.stopEvent();
-                            me.getContextMenu().show().setLocalXY(e.getXY());
-                            me.selectedData = e.target.innerText;
-                            return false;
-                        }
-                    }
-                },
-            }]
-        });
+                    xtype: 'grid',
+                    width: '100%',
+                    cls: 'x-report-grid',
+                    flex: 1,
+                    border: 0,
+                    sortableColumns: false,
+                    enableColumnHide: false,
+                    rowLines: false,
+                    plugins: [{
+                        ptype: 'gridexporter',
+                    }, {
+                        ptype: 'menuclipboard'
+                    }],
+                    features: me.initFeatures(),
+                    store: store,
+                    columns: me.initColumns(),
+                    dockedItems: [me.allowPaging ? {
+                        xtype: 'pagingtoolbar',
+                        dock: 'bottom',
+                        displayInfo: true,
+                        store: store
+                    } : null],
+                }]
+            });
 
         me.callParent(arguments);
     },
 
     listeners: {
-        boxready: function(p) {
+        boxready: function (p) {
+            var allowPaging = p.allowPaging;
             var grid = p.down('grid');
             var store = grid.getStore();
             var gridBodyBox = grid.body.dom.getBoundingClientRect();
             var gridBodyBoxHeight = gridBodyBox.height;
 
-            var pageSize = Math.floor(gridBodyBoxHeight / 32);
+            var pageSize = allowPaging ? Math.floor(gridBodyBoxHeight / 32) : 99999;
 
             store.setPageSize(pageSize);
         }
     },
 
-    getListGrid: function() {
+    getListGrid: function () {
         var me = this,
-        grid = me.items.items[1];
+            grid = me.items.items[1];
 
         return grid;
     },
 
-    initStore: function() {
+    initFeatures: function () {
+        var me = this;
+        var f = [{
+            ftype: 'groupingsummary',
+            hideGroupedHeader: false,
+            enableGroupingMenu: false,
+            collapsible: false
+        }];
+
+        if (me.showMySummary) {
+            f.push({
+                ftype: 'mysummary',
+                dock: 'bottom',
+                hidden: !me.showMySummary
+            });
+        }
+
+        return f;
+    },
+
+    initStore: function () {
         var me = this;
         var store = Ext.create('Ext.data.Store', {
             fields: me.getFields(),
@@ -216,57 +189,67 @@ Ext.define('saas.view.core.report.ReportPanel', {
             proxy: {
                 type: 'ajax',
                 url: me.listUrl,
-                timeout: 8000,
+                timeout: 30000,
                 actionMethods: {
                     read: 'GET'
                 },
                 reader: {
                     type: 'json',
                     // rootProperty: 'data.list',
-                    rootProperty: function(data) {
+                    rootProperty: function (data) {
                         try {
                             var grid = me.items.items[1],
-                            columns = grid.columns,
-                            summaryData = data.data ? (data.data.calculate || []) : [];
-    
-                            Ext.Array.each(columns, function(c) {
+                                store = grid.store,
+                                columns = grid.columns,
+                                summaryData = data.data ? (data.data.calculate || []) : [],
+                                datas = data.data ? (data.data.list ? data.data.list.list : []) : [];
+
+                            Ext.Array.each(columns, function (c) {
                                 var type = c.summaryType,
-                                name = c.dataIndex;
-    
-                                var d = Ext.Array.findBy(summaryData, function(s) {
+                                    name = c.dataIndex;
+
+                                var d = Ext.Array.findBy(summaryData, function (s) {
                                     return s.hasOwnProperty(name);
                                 })
-                                if(type && d) {
-                                    if(type == 'count') {
+                                if (type && d) {
+                                    if(typeof c.mySummaryRenderer == 'function') {
+                                        c.summaryValue = c.mySummaryRenderer(grid, datas);
+                                    }else if (type == 'count') {
                                         c.summaryValue = Ext.util.Format.number(d[name], c.format || '0');
-                                    }else if(typeof c.summaryRenderer == 'function') {
+                                    } else if (typeof c.summaryRenderer == 'function') {
                                         c.summaryValue = c.summaryRenderer(d[name]);
-                                    }else if(typeof c.renderer == 'function') {
+                                    } else if (typeof c.renderer == 'function') {
                                         c.summaryValue = c.renderer(d[name]);
-                                    }else {
+                                    } else {
                                         c.summaryValue = Ext.util.Format.number(d[name], c.format || '0.00');
                                     }
-                                }else {
-                                    c.summaryValue = 0;
+                                } else if(type && !d) {
+                                    if(typeof c.mySummaryRenderer == 'function') {
+                                        c.summaryValue = c.mySummaryRenderer(grid, c, datas);
+                                    }else {
+                                        c.summaryValue = me.getSummaryValue(datas, c);
+                                    }
+                                } else {
+                                    c.summaryValue = null;
                                 }
                             });
-                            return data.data ? (data.data.list ? data.data.list.list : []) : [];
-                        }catch(e) {
+                            return datas;
+                        } catch (e) {
                             saas.util.BaseUtil.showErrorToast(e.message);
                         }
                     },
                     totalProperty: 'data.list.total',
                 },
                 listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        if(operation.success) {
-                            if(response.timedout) {
+                    exception: function (proxy, response, operation, eOpts) {
+                        if (operation.success) {
+                            if (response.timedout) {
                                 saas.util.BaseUtil.showErrorToast('请求超时');
                             }
-                        }else {
-                            if(response.timedout) {
+                        } else {
+                            if (response.timedout) {
                                 saas.util.BaseUtil.showErrorToast('请求超时');
-                            }else{
+                            } else {
                                 saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
                             }
                         }
@@ -276,10 +259,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
             listeners: {
                 beforeload: function (store, op) {
                     var condition = me.getConditions(),
-                    defaultCondition = me.defaultCondition,
-                    summarys = me.summarys;
-    
-                    if(defaultCondition) {
+                        defaultCondition = me.defaultCondition,
+                        summarys = me.summarys;
+
+                    if (defaultCondition) {
                         condition.push({
                             type: 'condition',
                             value: defaultCondition
@@ -287,19 +270,19 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     }
 
                     var params = me.applyParams({
-                        number: store.exportNumber?store.exportNumber:op._page,
-                        size: store.exportPageSize?store.exportPageSize:store.pageSize,
+                        number: store.exportNumber ? store.exportNumber : op._page,
+                        size: store.exportPageSize ? store.exportPageSize : store.pageSize,
                         mode: me.queryMode || 'DETAIL',
                         condition: JSON.stringify(condition),
                         calculateFields: JSON.stringify(summarys)
                     });
                     Ext.apply(store.proxy.extraParams, params);
-    
+
                 }
             }
         });
 
-        if(me.groupField) {
+        if (me.groupField) {
             store.setGrouper({
                 property: me.groupField
             });
@@ -308,26 +291,26 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return store;
     },
 
-    getFields: function() {
+    getFields: function () {
         var me = this;
-        return me.reportColumns.filter(function(c) {
+        return me.reportColumns.filter(function (c) {
             return !!c.dataIndex;
-        }).map(function(c) {
+        }).map(function (c) {
             return c.dataIndex;
         });
     },
 
-    initColumns: function() {
+    initColumns: function () {
         var me = this,
-        columns = me.reportColumns,
-        summarys = [];
+            columns = me.reportColumns,
+            summarys = [];
 
-        Ext.Array.each(columns, function(c) {
+        Ext.Array.each(columns, function (c) {
             c.columns || Ext.applyIf(c, {
                 width: 110
             });
 
-            if(c.xtype == 'datecolumn') {
+            if (c.xtype == 'datecolumn') {
                 Ext.applyIf(c, {
                     // 这两个都要写上,才能控制到不同类型的导出格式,原因不明- -!
                     format: 'Y-m-d',
@@ -339,14 +322,14 @@ Ext.define('saas.view.core.report.ReportPanel', {
                         return Ext.Date.format(new Date(value), 'Y-m-d');
                     },
                     // 下面这个方法不写会造成日期列求和,原因不明- -!
-                    exportSummaryRenderer: function(v) {
+                    exportSummaryRenderer: function (v) {
                         return v;
                     }
                 })
-            }else if(c.xtype == 'numbercolumn') {
+            } else if (c.xtype == 'numbercolumn') {
                 Ext.applyIf(c, {
                     align: 'end', // 数字右对齐
-                    renderer : function(v) {
+                    renderer: function (v) {
                         var arr = (v + '.').split('.');
                         var xr = (new Array(arr[1].length)).fill('0');
                         var format = '0.' + xr.join();
@@ -355,11 +338,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 });
             }
 
-            if(c.summaryType) {
+            if (c.summaryType) {
                 me.initSummaryType(c);
                 summarys.push({
                     field: c.dataIndex,
-                    operation: c.summaryTypeName,
+                    operation: c.summaryType == 'last' ? 'sum' : c.summaryType,
                 });
             }
         })
@@ -369,64 +352,69 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return columns;
     },
 
-    initSummaryType: function(column) {
+    initSummaryType: function (column) {
         var summaryType = column.summaryType;
-        if(Ext.isString(summaryType)) {
+        if (Ext.isString(summaryType)) {
             column.summaryTypeName = summaryType;
         }
-        if(summaryType == 'sum') {
+        if (summaryType == 'sum') {
             column._summaryType = 'sum';
             // 原生的求和方法使用的是Store.sum,在数据存在null时计算结果为NaN,这里重写一下
-            column.summaryType = function(records, values) {
+            column.summaryType = function (records, values) {
                 return Ext.Array.sum(values);
             }
+        } else if(summaryType == 'last') {
+            column._summaryType = 'last';
+            column.summaryType = function (records, values) {
+                return values[values.length - 1];
+            }
         }
     },
 
-    initSearchItems: function() {
+    initSearchItems: function () {
         var me = this,
-        queryItems = [],
-        items = me.searchItems,
-        viewModel = me.getViewModel();
+            queryItems = [],
+            items = me.searchItems,
+            viewModel = me.getViewModel();
 
-        Ext.Array.each(items, function(item) {
+        Ext.Array.each(items, function (item) {
             var bind = item.bind,
-            name = item.name,
-            ignore = item.ignore,
-            defaultValue = item.defaultValue;
+                name = item.name,
+                ignore = item.ignore,
+                defaultValue = item.defaultValue;
 
-            if(item.allowBlank==false){
+            if (item.allowBlank == false) {
                 // TODO 需要判断类型
                 item.beforeLabelTextTpl = "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>";
             }
 
-            if(!ignore) {
+            if (!ignore) {
                 queryItems.push(name);
             }
 
-            if(item.xtype == 'numberfield') {
+            if (item.xtype == 'numberfield') {
                 Ext.applyIf(item, {
                     hideTrigger: true, // 隐藏trigger
                     mouseWheelEnabled: false // 取消滚轮事件
                 });
             }
             // 设置model绑定
-            if(bind) {
-                if(!Ext.isString(bind)) {
+            if (bind) {
+                if (!Ext.isString(bind)) {
                     bind = name;
                     Ext.apply(bind, {
                         value: '{form.' + bind + '}'
                     });
-                }else {
+                } else {
                     bind = name;
                     item.bind = '{form.' + bind + '}';
                 }
-            }else {
+            } else {
                 bind = name;
                 item.bind = '{form.' + bind + '}';
             }
             // 设置默认值
-            if(defaultValue) {
+            if (defaultValue) {
                 viewModel.set('form.' + bind, defaultValue);
             }
 
@@ -434,11 +422,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
             item.listeners = item.listeners || {};
             Ext.applyIf(item.listeners, {
                 keydown: {
-                    fn: function(th, e, eOpts) {
-                        if(e.keyCode == 13) {
-                            if(!th.fireEvent('beforequery', th)) {
+                    fn: function (th, e, eOpts) {
+                        if (e.keyCode == 13) {
+                            if (!th.fireEvent('beforequery', th)) {
                                 return;
-                            }else {
+                            } else {
                                 var p = this.up('core-report-reportpanel');
                                 p.getController().onQuery()
                             }
@@ -453,42 +441,60 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return items;
     },
 
-    getConditions: function() {
+    getSummaryValue: function(datas, c) {
+        var dataIndex = c.dataIndex,
+        type = c.summaryType,
+        values = datas.map(function(d) {
+            return d[c.dataIndex];
+        }),
+        sum = Ext.Array.sum(values);
+        if (type == 'count') {
+            return Ext.util.Format.number(values.length, '0');
+        } else if (typeof c.summaryRenderer == 'function') {
+            return c.summaryRenderer(sum);
+        } else if (typeof c.renderer == 'function') {
+            return c.renderer(sum);
+        } else {
+            return Ext.util.Format.number(sum, c.format || '0.00');
+        }
+    },
+
+    getConditions: function () {
         var me = this,
-        form = me.down('form'),
-        formItems = form.items.items,
-        viewModel = me.getViewModel(),
-        viewModelData = viewModel.getData(),
-        formData = viewModelData['form'] || {},
-        queryItems = me.queryItems,
-        condition,
-        conditions = [];
-
-        for(var i = 0; i < queryItems.length; i++) {
+            form = me.down('form'),
+            formItems = form.items.items,
+            viewModel = me.getViewModel(),
+            viewModelData = viewModel.getData(),
+            formData = viewModelData['form'] || {},
+            queryItems = me.queryItems,
+            condition,
+            conditions = [];
+
+        for (var i = 0; i < queryItems.length; i++) {
             var n = queryItems[i];
-            var item = Ext.Array.findBy(formItems, function(i) {
+            var item = Ext.Array.findBy(formItems, function (i) {
                 return i.name == n;
             });
             var field = item.name,
-            func = item.getCondition,
-            value = formData[n],
-            condition;
+                func = item.getCondition,
+                value = formData[n],
+                condition;
 
-            if(!value) {
+            if (!value) {
                 continue;
             }
 
-            if(typeof func == 'function') {
+            if (typeof func == 'function') {
                 condition = {
                     type: 'condition',
                     value: func(value)
                 }
-            }else {
+            } else {
                 type = item.fieldType || me.getDefaultFieldType(item),
-                operation = item.operation || me.getDefaultFieldOperation(item),
-                conditionValue = me.getConditionValue(item, value);
-    
-                if(!conditionValue) {
+                    operation = item.operation || me.getDefaultFieldOperation(item),
+                    conditionValue = me.getConditionValue(item, value);
+
+                if (!conditionValue) {
                     continue;
                 }
                 condition = {
@@ -501,23 +507,27 @@ Ext.define('saas.view.core.report.ReportPanel', {
             conditions.push(condition);
         }
 
+        return me.myGetConditions(conditions);
+    },
+
+    myGetConditions: function (conditions) {
         return conditions;
     },
 
-    getDefaultFieldType: function(field) {
+    getDefaultFieldType: function (field) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        type;
+            xtypes = field.getXTypes().split('/'),
+            type;
 
-        if(me.isContainsAny(xtypes, ['numberfield'])) {
+        if (me.isContainsAny(xtypes, ['numberfield'])) {
             type = 'number';
-        }else if(me.isContainsAny(xtypes, ['datefield', 'condatefield'])) {
+        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
             type = 'date';
-        }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
             type = 'string';
-        }else if(me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
+        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
-        }else {
+        } else {
             type = 'string';
         }
 
@@ -527,28 +537,30 @@ Ext.define('saas.view.core.report.ReportPanel', {
     /**
      * 只要arr1和arr2中存在相同项即返回真
      */
-    isContainsAny: function(arr1, arr2) {
-        for(var i = 0; i < arr2.length; i++) {
+    isContainsAny: function (arr1, arr2) {
+        for (var i = 0; i < arr2.length; i++) {
             var a2 = arr2[i];
-            if(!!arr1.find(function(a1) {return a1==a2})) {
+            if (!!arr1.find(function (a1) {
+                    return a1 == a2
+                })) {
                 return true;
             }
         }
         return false;
     },
 
-    getDefaultFieldOperation: function(field) {
+    getDefaultFieldOperation: function (field) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        operation;
+            xtypes = field.getXTypes().split('/'),
+            operation;
 
-        if(me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
+        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
             operation = '=';
-        }else if(me.isContainsAny(xtypes, ['condatefield'])) {
+        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
             operation = 'between';
-        }else if(me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
+        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
             operation = 'in';
-        }else {
+        } else {
             operation = 'like';
         }
 
@@ -558,33 +570,38 @@ Ext.define('saas.view.core.report.ReportPanel', {
     /**
      * 处理部分字段值
      */
-    getConditionValue: function(field, value) {
+    getConditionValue: function (field, value) {
         var me = this,
-        xtypes = field.getXTypes().split('/'),
-        conditionValue;
-        if(me.isContainsAny(xtypes, ['datefield'])) {
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        }else if(me.isContainsAny(xtypes, ['condatefield'])) {
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = from + ',' + to;
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
             var from = value.from,
-            to = value.to;
+                to = value.to;
 
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
             conditionValue = value;
-        }else if(me.isContainsAny(xtypes, ['combobox', 'combo'])) {
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
             conditionValue = '\'' + value + '\'';
-        }else if(me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function(v) {
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
                 return '\'' + v.value + '\'';
             }).join(',') : '';
-        }else {
+        } else {
             conditionValue = value;
         }
 
         return conditionValue;
     },
 
-    applyParams: function(p) {
+    applyParams: function (p) {
         return p;
     }
 });

+ 4 - 4
frontend/saas-web/app/view/core/report/ReportPanelController.js

@@ -52,11 +52,11 @@ Ext.define('saas.view.core.report.ReportPanelController', {
             iframe.setAttribute("id", "saas-print-iframe");
             iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
             document.body.appendChild(iframe);
-            doc = iframe.contentWindow.document;
-            doc.write(html);
-            doc.close();
-            iframe.contentWindow.focus();
         }
+        var doc = iframe.contentWindow.document;
+        doc.write(html);
+        doc.close();
+        iframe.contentWindow.focus();
         iframe.contentWindow.print();
         if (navigator.userAgent.indexOf("MSIE") > 0){
             document.body.removeChild(iframe);

+ 1 - 0
frontend/saas-web/app/view/document/bankinformation/Window.js

@@ -5,6 +5,7 @@ Ext.define('saas.view.document.bankinformation.Window', {
     extend: 'saas.view.document.kind.ChildForm',
     xtype: 'document-bankinformation-window',
     dataKind:'bankinformation',//类型标识
+    caller:'BankInformation',
     belong:{
         columns: [{
             text: '账户编号',

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

@@ -10,8 +10,8 @@ Ext.define('saas.view.document.bom.BasePanel', {
     searchField:[{
         xtype : "textfield", 
         name : "bo_mothercode", 
-        width:150, 
-        emptyText:'产品',
+        width:200, 
+        emptyText:'请输入产品编号或名称',
         getCondition: function(value) {
            return  ' (bo_mothername like\'%' + value + '%\'' 
                 +' or bo_mothercode like \'%'+value+'%\' ) ';
@@ -19,17 +19,15 @@ Ext.define('saas.view.document.bom.BasePanel', {
     },{
         xtype : "textfield", 
         name : "bo_version", 
-        width:110, 
-        emptyText:'版本'
+        fieldLabel:'版本'
     },{
         xtype: 'combobox',
         name: 'bo_statuscode',
         queryMode: 'local',
         displayField: 'bo_status',
         valueField: 'bo_statuscode',
-        emptyText :'状态',
+        fieldLabel :'状态',
         editable:false,
-        width:110,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['bo_statuscode', 'bo_status'],
         data: [

+ 0 - 6
frontend/saas-web/app/view/document/bom/FormController.js

@@ -49,12 +49,6 @@ Ext.define('saas.view.document.bom.FormController', {
                         dbfinds:[
                         {
                             from:'pr_code',to:'bd_replace'                          
-                        },{
-                            from:'pr_detail',to:'pr_detail'
-                        },{
-                            from:'pr_spec',to:'pr_spec'
-                        },{
-                            from:'pr_unit',to:'pr_unit'
                         }],
                     }) ;   
                 }

+ 8 - 13
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -11,34 +11,29 @@ Ext.define('saas.view.document.customer.BasePanel', {
     searchField:[{
         xtype : "textfield", 
         name : "cu_code", 
-        width:150, 
-        emptyText:'编号'
+        width:200, 
+        emptyText:'请输入客户编号或名称',
+        getCondition: function (v) {
+            return "(upper(CONCAT(cu_code,'#',cu_name)) like '%" + v.toUpperCase() + "%' )";
+        }
     }, {
-        xtype : "textfield", 
-        name : "cu_name", 
-        width:150, 
-        emptyText:'名称'
-    },{
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
-        emptyText : "客户类型", 
-        width:110,
+        fieldLabel : "客户类型", 
         hiddenBtn:true
     }, {
         xtype : "employeeDbfindTrigger", 
         name : "cu_sellername", 
-        width:150, 
-        emptyText:'业务员'
+        fieldLabel:'业务员'
     },{
         xtype: 'combobox',
         name: 'cu_statuscode',
         queryMode: 'local',
         displayField: 'cu_status',
         valueField: 'cu_statuscode',
-        emptyText :'状态',
+        fieldLabel :'状态',
         editable:false,
-        width:110,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['cu_statuscode', 'cu_status'],
         data: [

+ 1 - 0
frontend/saas-web/app/view/document/employee/Window.js

@@ -5,6 +5,7 @@ Ext.define('saas.view.document.employee.Window', {
     extend: 'saas.view.document.kind.ChildForm',
     xtype: 'document-employee-window',
     dataKind:'employee',//类型标识
+    caller:'Employee',
     belong:{
         columns: [{
             text: '人员编号',

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

@@ -24,7 +24,7 @@ Ext.define('saas.view.document.kind.ChildForm', {
                 codeField = item.name
             }
           });
-          if(count!=0&&count<4){
+          if(count!=0&&count<6){
             w.setHeight(114+40*count)
           }
           if(w.record){
@@ -147,13 +147,12 @@ Ext.define('saas.view.document.kind.ChildForm', {
             border: false,
             autoScroll:true,
             modelValidation: true,
-            layout: {
-                type: 'vbox',
-                align: 'stretch'
-            },
+            layout: 'column',
             defaults: {
+                margin:'0 0 10 0',
                 beforeLabelTextTpl: "<font color=\"red\" style=\"position:relative; top:2px;right:2px; font-weight: bolder;\">*</font>",
-                xtype: 'textfield'
+                xtype: 'textfield',
+                columnWidth:1
             },
             buttonAlign:'center',
             buttons: [{
@@ -209,9 +208,13 @@ Ext.define('saas.view.document.kind.ChildForm', {
         .then(function(localJson) {
             me.setLoading(false);
             if(localJson.success){
-                var grid = form.ownerCt._parent ? form.ownerCt._parent.lookup('document-kind-Grid') : null;
+                var grid = form.ownerCt._parent;
                 if(grid){
-                    grid.store.load();
+                    if(form.ownerCt._parent.lookup('document-kind-Grid')!=null){
+                        form.ownerCt._parent.lookup('document-kind-Grid').store.load()
+                    }else{
+                        grid.store.load();
+                    }
                 }
                 if(relativeField&&relativeValue&&form.ownerCt._parent){
                     var grid = form.ownerCt._parent.down('grid');

+ 4 - 11
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -12,9 +12,9 @@ Ext.define('saas.view.document.product.BasePanel', {
         xtype : "textfield", 
         name : "pr_code", 
         width:300, 
-        emptyText:'输入物料编号、名称、型号或规格',
+        emptyText:'输入物料编号、名称、型号、规格或品牌',
         getCondition: function (v) {
-            return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_spec,''),'#',ifnull(pr_orispeccode,''))) like '%" + v.toUpperCase() + "%')";
+            return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_spec,''),'#',ifnull(pr_orispeccode,''),'#',ifnull(pr_brand,''))) like '%" + v.toUpperCase() + "%' )";
         },
     },{
         editable:true,
@@ -22,21 +22,14 @@ Ext.define('saas.view.document.product.BasePanel', {
         xtype : "remotecombo", 
         storeUrl: '/api/document/producttype/getCombo',
         name : "pr_kind", 
-        emptyText : "物料类型",
-        width:120
-    }, {
-        xtype : "textfield", 
-        name : "pr_brand", 
-        emptyText : "品牌", 
-        width:110
+        fieldLabel : '物料类型'
     }, {
         xtype: 'combobox',
         name: 'pr_statuscode',
         queryMode: 'local',
         displayField: 'pr_status',
         valueField: 'pr_statuscode',
-        emptyText :'状态',
-        width:110,
+        fieldLabel : '状态',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['pr_statuscode', 'pr_status'],

+ 2 - 1
frontend/saas-web/app/view/document/product/FormController.js

@@ -163,7 +163,8 @@ Ext.define('saas.view.document.product.FormController', {
         Ext.Array.each(items, function(item, i) {
            var pd_num = item.get('pd_num') || 0 ;
            var pd_price = item.get('pd_price') || 0 ;
-           item.set('pd_amount', pd_num*pd_price);               
+           var m = Ext.util.Format.number(pd_num*pd_price, '0,000.00');
+           item.set('pd_amount', m);               
         });
     }
 });

+ 7 - 11
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -11,19 +11,16 @@ Ext.define('saas.view.document.vendor.BasePanel', {
     {
         xtype : "textfield", 
         name : "ve_code", 
-        width:150, 
-        emptyText:'编号'
-    }, {
-        xtype : "textfield", 
-        name : "ve_name", 
-        width:150, 
-        emptyText:'名称'
+        width:200, 
+        emptyText:'请输入供应商编号或名称',
+        getCondition: function (v) {
+            return "(upper(CONCAT(ve_code,'#',ve_name)) like '%" + v.toUpperCase() + "%' )";
+        }
     },{
         xtype : "remotecombo", 
         storeUrl:'/api/document/vendorkind/getCombo',
         name : "ve_type", 
-        emptyText : "供应商类型", 
-        width:110,
+        fieldLabel : '供应商类型',
         hiddenBtn:true
     },{
         xtype: 'combobox',
@@ -31,8 +28,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
         queryMode: 'local',
         displayField: 've_status',
         valueField: 've_statuscode',
-        emptyText :'状态',
-        width:110,
+        fieldLabel : '状态',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['ve_statuscode', 've_status'],

+ 1 - 0
frontend/saas-web/app/view/document/warehouse/Window.js

@@ -5,6 +5,7 @@ Ext.define('saas.view.document.warehouse.Window', {
     extend: 'saas.view.document.kind.ChildForm',
     xtype: 'document-warehouse-window',
     dataKind:'warehouse',//类型标识
+    caller:'WareHouse',
     belong:{
         columns: [{
             text: '编号',

+ 5 - 3
frontend/saas-web/app/view/home/Home.js

@@ -50,7 +50,7 @@ Ext.define('saas.view.home.Home', {
         }, {
             xtype: 'month-purchase',
         }, {
-            xtype: 'month-io',
+            xtype: 'key-data',
         }]
     }, {
         xtype: 'panel',
@@ -65,10 +65,12 @@ Ext.define('saas.view.home.Home', {
             userCls: 'big-33 small-50',
         },
         items: [{
-            xtype: 'sale-trend',
+            xtype: 'month-io',
         }, {
-            xtype: 'purchase-trend'
+            xtype: 'sale-trend',
         }, {
+        //     xtype: 'purchase-trend'
+        // }, {
             xtype: 'stock-amount'
         }]
     }],

+ 82 - 21
frontend/saas-web/app/view/home/HomeModel.js

@@ -29,16 +29,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('infocard').setLoading(false);
+                        var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('infocard').setLoading(true);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('infocard').setLoading(false);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
 
                     if(!d) return;
                     var res = d[0].data.data || {};
@@ -65,16 +68,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month_sale').setLoading(false);
+                        var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month_sale').setLoading(true);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month_sale').setLoading(false);
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
                     var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
                     Ext.getCmp('home').getViewModel().set('month_sale_amount', sum)
                 }
@@ -98,16 +104,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month-purchase').setLoading(false);
+                        var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month-purchase').setLoading(true);
+                    var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month-purchase').setLoading(false);
+                    var p = Ext.getCmp('month_purchase');
+                        p && p.setLoading(false);
                     var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
                     Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
                 }
@@ -131,16 +140,19 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('month_io').setLoading(false);
+                        var p = Ext.getCmp('month_io');
+                        p && p.setLoading(false);
                     }
                 }
             },
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('month_io').setLoading(true);
+                    var p = Ext.getCmp('month_io');
+                    p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('month_io').setLoading(false);
+                    var p = Ext.getCmp('month_io');
+                    p && p.setLoading(false);
                     s.each(function(r) {
                         var sum = Ext.util.Format.number(r.get('main') + r.get('other'), '0.00') || 0;
                         if(r.get('x') == '收入') {
@@ -170,7 +182,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('sale_trend').setLoading(false);
+                        var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -179,10 +192,12 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('sale_trend').setLoading(true);
+                    var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('sale_trend').setLoading(false);
+                    var p = Ext.getCmp('sale_trend');
+                        p && p.setLoading(false);
                 }
             } 
         },
@@ -204,7 +219,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('purchase_trend').setLoading(false);
+                        var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -213,10 +229,12 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('purchase_trend').setLoading(true);
+                    var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('purchase_trend').setLoading(false);
+                    var p = Ext.getCmp('purchase_trend');
+                        p && p.setLoading(false);
                 }
             } 
         },
@@ -238,7 +256,8 @@ Ext.define('saas.view.home.HomeModel', {
                 },
                 listeners: {
                     exception: function(proxy, response, operation, eOpts) {
-                        Ext.getCmp('stock_amount').setLoading(false);
+                        var p = Ext.getCmp('stock_amount');
+                        p && p.setLoading(false);
                     }
                 }
             },
@@ -247,10 +266,52 @@ Ext.define('saas.view.home.HomeModel', {
             ],
             listeners: {
                 beforeload: function() {
-                    Ext.getCmp('stock_amount').setLoading(true);
+                    var p = Ext.getCmp('stock_amount');
+                    p && p.setLoading(true);
                 },
                 load: function(s, d) {
-                    Ext.getCmp('stock_amount').setLoading(false);
+                    var p = Ext.getCmp('stock_amount');
+                    p && p.setLoading(false);
+                }
+            } 
+        },
+
+        key_data: {
+            fields: ['name', 'value'],
+            autoLoad: true,
+            proxy: {
+                type: 'ajax',
+                // url: 'http://192.168.253.58:8920/homePage/keyData',
+                url: '/api/commons/homePage/keyData',
+                timeout: 8000,
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data',
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        var p = Ext.getCmp('key_data');
+                        p && p.setLoading(false);
+                    }
+                }
+            },
+            listeners: {
+                beforeload: function() {
+                    var p = Ext.getCmp('key_data');
+                        p && p.setLoading(true);
+                },
+                load: function(s, d) {
+                    var p = Ext.getCmp('key_data');
+                        p && p.setLoading(false),
+                        data = s.getAt(0) ? s.getAt(0).data : null;
+                    if(data) {
+                        delete data.id;
+                        p.updateValue(data);
+                        // Ext.getCmp('home').getViewModel().set('keydata', data);
+                    }
                 }
             } 
         },

+ 147 - 0
frontend/saas-web/app/view/home/charts/KeyData.js

@@ -0,0 +1,147 @@
+Ext.define('saas.view.home.charts.KeyData', {
+    extend: 'Ext.panel.Panel',
+
+    xtype: 'key-data',
+    id: 'key_data',
+    cls: 'quick-graph-panel',
+
+    title: '关键数据',
+
+    layout: 'fit',
+    height: 300,
+
+    cardTpl: [
+        '<div class="x-container">',
+            '<tpl for=".">',
+                '<div class="x-box x-box-{color}">',
+                    '<div class="x-box-content">',
+                        '<tpl if="showIcon">',
+                            '<div class="x-icon x-icon-{icon}"></div>',
+                        '</tpl>',
+                        '<div class="x-text',
+                            // '<tpl if="!showIcon">',
+                            //     ' x-text-small',
+                            // '</tpl>',
+                        '">',
+                            // '<tpl if="!showIcon">',
+                            //     '<div class="x-icon-small x-icon-{icon}"></div>',
+                            // '</tpl>',
+                            '<div class="x-key"><span>{label}</span></div>',
+                            '<div class="x-value"><span>{value}</span></div>',
+                        '</div>',
+                    '</div>',
+                '</div>',
+            '</tpl>',
+        '</div>'
+    ],
+
+    cards: [{
+        color: 'green',
+        showIcon: true,
+        icon: 'storageTotal',
+        name: 'storageTotal',
+        label: '库存总额',
+        value: '0',
+        viewType: 'stock-report-datalist',
+        title: '物料库存数量金额表查询',
+        id: 'stock-report-datalist',
+    }, {
+        color: 'yellow',
+        showIcon: true,
+        icon: 'receiveTotal',
+        name: 'receiveTotal',
+        label: '应收总额',
+        value: '0',
+        viewType: 'monry-report-totalrecdetail',
+        title: '应收总账查询',
+        id: 'monry-report-totalrecdetail',
+    }, {
+        color: 'red',
+        showIcon: true,
+        icon: 'payTotal',
+        name: 'payTotal',
+        label: '应付总额',
+        value: '0',
+        viewType: 'monry-report-totalpaydetail',
+        title: '应付总账查询',
+        id: 'monry-report-totalpaydetail',
+    }, {
+        color: 'blue',
+        showIcon: true,
+        icon: 'balanceTotal',
+        name: 'balanceTotal',
+        label: '账户余额',
+        value: '0',
+        viewType: 'document-bankinformation-datalist',
+        title: '资金账户查询',
+        id: 'document-bankinformation-datalist',
+    }],
+
+    initComponent: function () {
+        var me = this;
+
+        var store = Ext.create('Ext.data.Store', {
+            fields: ['color', 'showIcon', 'icon', 'label', 'value'],
+            data: me.cards,
+            updateValue: function(datas) {
+                this.each(function(r, index) {
+                    // var v = datas[r.get('name')];
+                    // var d = saas.util.BaseUtil.formatAmount(v);
+                    var d = Ext.util.Format.number(datas[r.get('name')], '0,000.00');
+                    r.set('value', d);
+                });
+            },
+            // updateShowIcon: function(show) {
+            //     this.each(function(r) {
+            //         r.set('showIcon', show);
+            //     });
+            // }
+        });
+        var view = Ext.create('Ext.view.View', {
+            store: store,
+            tpl: new Ext.XTemplate(me.cardTpl),
+            itemSelector: 'div.x-box',
+            listeners: {
+                itemclick: function(th, record, item, index, e, eOpts) {
+                    saas.util.BaseUtil.openTab(record.get('viewType'), record.get('title'), record.get('id'));
+                }
+            }
+        });
+
+        Ext.apply(me, {
+            items: [view]
+        });
+
+        me.view = view;
+
+        me.callParent(arguments);
+    },
+
+    listeners: {
+        // afterlayout: function() {
+        //     var me = this,
+        //     box = me.getBox(),
+        //     view = me.view,
+        //     width = box.width,
+        //     store = view.store;
+
+        //     store.updateShowIcon(width >= 450);
+        // },
+    },
+
+    updateValue: function(datas) {
+        var me = this,
+        view = me.view,
+        store = view.store;
+
+        store.updateValue(datas);
+    },
+
+    // updateShowIcon: function(showIcon) {
+    //     var me = this,
+    //     view = me.view,
+    //     store = view.store;
+
+    //     store.updateShowIcon(showIcon);
+    // }
+});

+ 111 - 0
frontend/saas-web/app/view/home/charts/KeyData.scss

@@ -0,0 +1,111 @@
+#key_data {
+    .key_data-body {
+        padding: 0;
+    }
+    .x-container {
+        height: 100%;
+        display: flex;
+        flex-wrap: wrap;
+
+        .x-box {
+            width: calc(50% - 16px);
+            border-width: 5px 1px 1px;
+            border-style: solid;
+            border-color: #1EC09F;
+            cursor: pointer;
+
+            &:nth-of-type(odd) {
+                margin: 8px 8px 8px 0;
+            }
+
+            &:nth-of-type(even) {
+                margin: 8px 0 8px 8px;
+            }
+
+            .x-box-content {
+                display: flex;
+                height: 100%;
+                padding: 16px;
+
+                .x-icon {
+                    flex: 4;
+                    max-width: 48px;
+                    background-repeat: no-repeat;
+                    background-size: contain;
+                    background-position: center;
+
+                    &-small {
+                        width: 36px;
+                        height: 36px;
+                        position: relative;
+                        background-repeat: no-repeat;
+                        background-size: contain; 
+                    }
+
+                    &-storageTotal {
+                        background-image: url(/resources/images/home/storageTotal.png);
+                    }
+                    &-receiveTotal {
+                        background-image: url(/resources/images/home/receiveTotal.png);
+                    }
+                    &-payTotal {
+                        background-image: url(/resources/images/home/payTotal.png);
+                    }
+                    &-balanceTotal {
+                        background-image: url(/resources/images/home/balanceTotal.png);
+                    }
+                }
+
+                .x-text {
+                    flex: 6;
+                    display: flex;
+                    color: #485465;
+                    flex-direction: column;
+                    align-items: flex-end;
+                    overflow: hidden;
+
+                    .x-key {
+                        flex: 1;
+                        display: flex;
+                        align-items: flex-end;
+                        margin-bottom: 5px;
+                        font-size: 14px;
+                        color: #485465;
+                    }
+                
+                    .x-value {
+                        flex: 1;
+                        display: flex;
+                        align-items: flex-start;
+                        font-size: 16px;
+                        color: #1E2429;
+                    }
+
+                    &-small {
+                        display: block;
+
+                        .x-key {
+                            display: block;
+                            padding-left: 54px;
+                            margin-top: -17px;
+                            margin-bottom: 14px;
+                        }
+                    }
+                }
+            }
+        }
+
+        .x-box-green {
+            border-color: #1EC09F;
+        }
+        .x-box-yellow {
+            border-color: #FDC200;
+        }
+        .x-box-red {
+            border-color: #FB6A83;
+        }
+        .x-box-blue {
+            border-color: #62A3DF;
+        }
+    }
+}

+ 1 - 1
frontend/saas-web/app/view/home/charts/MonthPurchase.js

@@ -2,7 +2,7 @@ Ext.define('saas.view.home.charts.MonthPurchase', {
     extend: 'saas.view.core.chart.ChartBase',
     xtype: 'month-purchase',
 
-    id: 'month-purchase',
+    id: 'month_purchase',
 
     bind: {
         title: '本月采购额(万元):{month_purchase_amount}'

+ 1 - 1
frontend/saas-web/app/view/home/infoCardList/PurchaseIn.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.PurchaseIn', {
     codeField: 'pu_code',
     detailTitle: '采购订单',
     detailXType: 'purchase-purchase-formpanel',
-    condition: 'purchase.companyId=#{companyId} and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <= 7)',
+    condition: 'purchase.companyId=#{companyId} and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pu_acceptstatus,\' \') <> \'已入库\')',
     listColumns: [{
         text: 'id',
         dataIndex: 'pu_id',

+ 1 - 1
frontend/saas-web/app/view/home/infoCardList/SaleOut.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.SaleOut', {
     codeField: 'sa_code',
     detailTitle: '销售订单',
     detailXType: 'sale-sale-formpanel',
-    condition: 'sale.companyid=#{companyId} and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now())<= 7)',
+    condition: 'sale.companyid=#{companyId} and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sa_sendstatus,\' \') <> \'已出库\' ',
     listColumns: [{
         text: 'id',
         dataIndex: 'sa_id',

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

@@ -31,7 +31,7 @@ Ext.define('saas.view.main.Main', {
                     reference: 'mainLogo',
                     width: 180,
                     cls: 'main-logo-wrap',
-                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">U企云服</div></div>',
+                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">企云服</div></div>',
                     bind: {
                         width: '{navWidth}'
                     }

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

@@ -69,7 +69,7 @@ $treelist-nav-ui: (
             width: 32px;
             height: 32px;
             top: 16px;
-            left: 42px;
+            left: 28px;
             position: relative;
         }
 
@@ -80,7 +80,7 @@ $treelist-nav-ui: (
             text-align: left;
             top: 30px;
             position: absolute;
-            left: 76px;
+            left: 64px;
         }
     }
 }

+ 2 - 2
frontend/saas-web/app/view/main/MainController.js

@@ -35,13 +35,13 @@ Ext.define('saas.view.main.MainController', {
         navigationList = refs.navigationTreeList,
         navCollapsed = !navigationList.navCollapsed,
         new_width = navCollapsed ? viewModel.get('smallNavWidth') : viewModel.get('navWidth'),
-        newLogoImgStyle = navCollapsed ? { width: 36, height: 36, top: 12, left: 12 } : { width: 32, height: 32, top: 16, left: 42 },
+        newLogoImgStyle = navCollapsed ? { width: 36, height: 36, top: 12, left: 12 } : { width: 32, height: 32, top: 16, left: 28 },
         newLogoTextStyle = navCollapsed ? {
             5: { opacity: 0 },
             10: { opacity: 0 },
             100: { opacity: 0, display: 'none' }
         } : {
-            25: { opacity: 0 },
+            10: { opacity: 0 },
             50: { opacity: 1 }
         },
         newNavIconStyle = navCollapsed ? { marginLeft: 6, fontSize: 28 } : { marginLeft: 22, fontSize: 24 },

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

@@ -7,7 +7,7 @@ Ext.define('saas.view.main.MainModel', {
     alias: 'viewmodel.main',
 
     data: {
-        navWidth: 180,
+        navWidth: 160,
         smallNavWidth: 64,
     }
 });

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

@@ -146,6 +146,7 @@ $nav-font-color-over: #fff;
                     height: 40px;
                     line-height: 40px;
                     font-size: 16px;
+                    font-weight: bold;
                     color: #4F5170;
                     letter-spacing: 0.64px;
                     text-align: left;

Some files were not shown because too many files changed in this diff