Browse Source

Merge remote-tracking branch 'origin/dev' into dev

yingp 7 years ago
parent
commit
7a15b7daad
100 changed files with 2676 additions and 404 deletions
  1. 4 0
      applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/CommonService.java
  2. 4 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  3. 101 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/DataImport.java
  4. 110 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/DataImportDetail.java
  5. 80 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/DataTemplet.java
  6. 72 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/TempletSet.java
  7. 6 0
      applications/commons/commons-server/pom.xml
  8. 10 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java
  9. 81 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/ExcelController.java
  10. 10 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/DataImportDetailMapper.java
  11. 17 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/DataImportMapper.java
  12. 9 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/DataTempletMapper.java
  13. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/CommonService.java
  14. 14 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/ExcelService.java
  15. 33 1
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/CommonServiceImpl.java
  16. 484 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java
  17. 1 1
      applications/commons/commons-server/src/main/resources/config/application-docker-prod.yml
  18. 83 0
      applications/commons/commons-server/src/main/resources/mapper/DataImportDetailMapper.xml
  19. 83 0
      applications/commons/commons-server/src/main/resources/mapper/DataImportMapper.xml
  20. 17 0
      applications/commons/commons-server/src/main/resources/mapper/DataTempletMapper.xml
  21. 7 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  22. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java
  23. 22 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/DataImportMapper.java
  24. 6 6
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/EmployeeMapper.java
  25. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  26. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  27. 4 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  28. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  29. 7 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/EmployeeServiceImpl.java
  30. 95 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  31. 1 1
      applications/document/document-server/src/main/resources/config/application-docker-prod.yml
  32. 3 2
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  33. 105 0
      applications/document/document-server/src/main/resources/mapper/DataImportMapper.xml
  34. 3 2
      applications/document/document-server/src/main/resources/mapper/EmployeeMapper.xml
  35. 4 0
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  36. 3 0
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  37. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java
  38. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  39. 44 41
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java
  40. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  41. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  42. 26 22
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  43. 1 1
      applications/money/money-server/src/main/resources/config/application-docker-prod.yml
  44. 2 2
      applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml
  45. 2 2
      applications/money/money-server/src/main/resources/mapper/StatsinfoMapper.xml
  46. 4 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDTO.java
  47. 5 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  48. 1 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutListMapper.java
  49. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  50. 175 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdHomePageList.java
  51. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/Purchase.java
  52. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java
  53. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java
  54. 19 12
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  55. 16 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  56. 1 1
      applications/purchase/purchase-server/src/main/resources/config/application-docker-prod.yml
  57. 117 4
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml
  58. 1 1
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml
  59. 2 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml
  60. 3 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  61. 3 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDTO.java
  62. 4 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseListDTO.java
  63. 7 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java
  64. 1 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutListMapper.java
  65. 175 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/ProdHomePageList.java
  66. 2 3
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java
  67. 15 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  68. 12 5
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  69. 1 1
      applications/sale/sale-server/src/main/resources/config/application-docker-prod.yml
  70. 117 0
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  71. 13 1
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  72. 2 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java
  73. 1 1
      applications/storage/storage-server/src/main/resources/config/application-docker-prod.yml
  74. 1 1
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml
  75. 1 1
      applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml
  76. 4 4
      base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/api/CompanyApi.java
  77. 12 1
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyRspDTO.java
  78. 2 1
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/AccountCenterServiceImpl.java
  79. 1 1
      base-servers/account/account-server/src/main/resources/mapper/AccountCompanyMapper.xml
  80. 13 0
      base-servers/auth/auth-dto/src/main/java/com/usoftchina/saas/auth/dto/AuthDTO.java
  81. 12 9
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  82. 1 11
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java
  83. 2 0
      base-servers/gateway-server/src/main/resources/application.yml
  84. 58 28
      frontend/saas-portal-web/src/components/conenter/addgongsi.vue
  85. 32 21
      frontend/saas-portal-web/src/components/conenter/company.vue
  86. 5 12
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  87. 87 101
      frontend/saas-portal-web/src/components/conenter/home.vue
  88. 82 0
      frontend/saas-portal-web/src/components/conenter/problem.vue
  89. 4 4
      frontend/saas-portal-web/src/components/conenter/qiyexiangxi.vue
  90. 28 24
      frontend/saas-portal-web/src/components/footer/footer.vue
  91. 1 0
      frontend/saas-portal-web/src/pages/index/index.js
  92. 7 0
      frontend/saas-portal-web/src/store/index.js
  93. 43 50
      frontend/saas-portal-web/static/css/main.css
  94. BIN
      frontend/saas-portal-web/static/img/Triangle Copy 4.png
  95. BIN
      frontend/saas-portal-web/static/img/banner.png
  96. BIN
      frontend/saas-portal-web/static/img/banner@2x@2x.png
  97. BIN
      frontend/saas-portal-web/static/img/banner@3x@2x.png
  98. BIN
      frontend/saas-portal-web/static/img/feature/blue1@2x.png
  99. BIN
      frontend/saas-portal-web/static/img/feature/blue3@2x.png
  100. BIN
      frontend/saas-portal-web/static/img/feature/mix1x.png

+ 4 - 0
applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/CommonService.java

@@ -9,4 +9,8 @@ public interface CommonService {
     @PostMapping("/action/audit")
     public String 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);
+
+    @PostMapping("/action/resAudit")
+    public String 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);
 }

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

@@ -35,6 +35,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BIZ_RELUPDATE_CODEANDNAME(79311,"存在关联单据,不允许更新编号,名称"),
     BIZ_RELUPDATE_AMOUNT(79312,"存在关联单据,不允许更新期初应收,期初预收,期初日期"),
     NO_OPRATIONDATA(79400,"无可操作单据"),
+    NULL_DATA(23232,"无数据"),
 
     BOM_SAVE(79401, "产品编号+版本号已存在"),
     REPEAT_NAME(79501, "名称重复"),
@@ -56,7 +57,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     VENDOR_ISCLOSE(79505, "供应商已关闭"),
     PRODUCT_ISCLOSE(79506, "物料已关闭"),
     CUSTOMER_ISCLOSE(79507, "客户资料已关闭"),
-
+    REQUIREDFIELD_NULL(79508,"存在必填字段未空"),
 
     //采购 70000-71999
     PURCCHECKIN_POST_ERROR(70000,""),
@@ -65,6 +66,8 @@ public enum BizExceptionCode implements BaseExceptionCode {
     PURCHASE_ORDER_HASAUDIT(70002, "存在已审核单据,单据编号:%s"),
     PURCHASE_ORDER_HASUNAUDIT(70003, "存在未审核单据,单据编号:%s"),
 
+
+
     //销售
     SALE_ALL_TURNOUT(72000, "该销售单已全部转出货,无法转出货单"),
     SALE_CLOSE(72001, "单据已关闭,无法进行操作"),

+ 101 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/DataImport.java

@@ -0,0 +1,101 @@
+package com.usoftchina.saas.commons.po;
+
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2018-11-29 15:15
+ **/
+public class DataImport {
+    public Long getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Long companyid) {
+        this.companyid = companyid;
+    }
+
+    private Integer di_id;
+
+    private String di_caller;
+
+    private Long companyid;
+
+    private Date di_date;
+
+    private Integer di_count;
+
+    private String di_result;
+
+    private Integer di_success;
+
+    private String di_man;
+
+    private Integer di_toformal;
+
+    public Integer getDi_id() {
+        return di_id;
+    }
+
+    public void setDi_id(Integer di_id) {
+        this.di_id = di_id;
+    }
+
+    public String getDi_caller() {
+        return di_caller;
+    }
+
+    public void setDi_caller(String di_caller) {
+        this.di_caller = di_caller == null ? null : di_caller.trim();
+    }
+
+
+
+    public Date getDi_date() {
+        return di_date;
+    }
+
+    public void setDi_date(Date di_date) {
+        this.di_date = di_date;
+    }
+
+    public Integer getDi_count() {
+        return di_count;
+    }
+
+    public void setDi_count(Integer di_count) {
+        this.di_count = di_count;
+    }
+
+    public String getDi_result() {
+        return di_result;
+    }
+
+    public void setDi_result(String di_result) {
+        this.di_result = di_result == null ? null : di_result.trim();
+    }
+
+    public Integer getDi_success() {
+        return di_success;
+    }
+
+    public void setDi_success(Integer di_success) {
+        this.di_success = di_success;
+    }
+
+    public String getDi_man() {
+        return di_man;
+    }
+
+    public void setDi_man(String di_man) {
+        this.di_man = di_man == null ? null : di_man.trim();
+    }
+
+    public Integer getDi_toformal() {
+        return di_toformal;
+    }
+
+    public void setDi_toformal(Integer di_toformal) {
+        this.di_toformal = di_toformal;
+    }
+}

+ 110 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/DataImportDetail.java

@@ -0,0 +1,110 @@
+package com.usoftchina.saas.commons.po;
+
+/**
+ * @author: guq
+ * @create: 2018-11-29 15:16
+ **/
+public class DataImportDetail {
+
+    private Integer dd_id;
+
+    private String dd_maindata;
+
+    public Long getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Long companyid) {
+        this.companyid = companyid;
+    }
+
+    private Integer dd_detno;
+
+    private Integer dd_diid;
+
+    private Integer dd_checked;
+
+    private Integer dd_success;
+
+    private Integer dd_toformal;
+
+    private Long companyid;
+
+    private String dd_detaildata;
+
+    private String dd_codevalue;
+
+    public Integer getDd_id() {
+        return dd_id;
+    }
+
+    public void setDd_id(Integer dd_id) {
+        this.dd_id = dd_id;
+    }
+
+    public String getDd_maindata() {
+        return dd_maindata;
+    }
+
+    public void setDd_maindata(String dd_maindata) {
+        this.dd_maindata = dd_maindata == null ? null : dd_maindata.trim();
+    }
+
+    public Integer getDd_detno() {
+        return dd_detno;
+    }
+
+    public void setDd_detno(Integer dd_detno) {
+        this.dd_detno = dd_detno;
+    }
+
+    public Integer getDd_diid() {
+        return dd_diid;
+    }
+
+    public void setDd_diid(Integer dd_diid) {
+        this.dd_diid = dd_diid;
+    }
+
+    public Integer getDd_checked() {
+        return dd_checked;
+    }
+
+    public void setDd_checked(Integer dd_checked) {
+        this.dd_checked = dd_checked;
+    }
+
+    public Integer getDd_success() {
+        return dd_success;
+    }
+
+    public void setDd_success(Integer dd_success) {
+        this.dd_success = dd_success;
+    }
+
+    public Integer getDd_toformal() {
+        return dd_toformal;
+    }
+
+    public void setDd_toformal(Integer dd_toformal) {
+        this.dd_toformal = dd_toformal;
+    }
+
+
+    public String getDd_detaildata() {
+        return dd_detaildata;
+    }
+
+    public void setDd_detaildata(String dd_detaildata) {
+        this.dd_detaildata = dd_detaildata == null ? null : dd_detaildata.trim();
+    }
+
+    public String getDd_codevalue() {
+        return dd_codevalue;
+    }
+
+    public void setDd_codevalue(String dd_codevalue) {
+        this.dd_codevalue = dd_codevalue == null ? null : dd_codevalue.trim();
+    }
+
+}

+ 80 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/DataTemplet.java

@@ -0,0 +1,80 @@
+package com.usoftchina.saas.commons.po;
+
+/**
+ * @author: guq
+ * @create: 2018-11-27 16:20
+ **/
+public class DataTemplet {
+
+    private Integer dt_id;
+
+    private String dt_caller;
+
+    private String dt_description;
+
+    public String getDt_columns() {
+        return dt_columns;
+    }
+
+    public void setDt_columns(String dt_columns) {
+        this.dt_columns = dt_columns;
+    }
+
+    private String dt_title;
+
+    private String dt_columns;
+
+    public Long getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Long companyid) {
+        this.companyid = companyid;
+    }
+
+    private String dt_exampledata;
+
+    private Long companyid;
+
+    public Integer getDt_id() {
+        return dt_id;
+    }
+
+    public void setDt_id(Integer dt_id) {
+        this.dt_id = dt_id;
+    }
+
+    public String getDt_caller() {
+        return dt_caller;
+    }
+
+    public void setDt_caller(String dt_caller) {
+        this.dt_caller = dt_caller == null ? null : dt_caller.trim();
+    }
+
+    public String getDt_description() {
+        return dt_description;
+    }
+
+    public void setDt_description(String dt_description) {
+        this.dt_description = dt_description == null ? null : dt_description.trim();
+    }
+
+    public String getDt_title() {
+        return dt_title;
+    }
+
+    public void setDt_title(String dt_title) {
+        this.dt_title = dt_title == null ? null : dt_title.trim();
+    }
+
+    public String getDt_exampledata() {
+        return dt_exampledata;
+    }
+
+    public void setDt_exampledata(String dt_exampledata) {
+        this.dt_exampledata = dt_exampledata == null ? null : dt_exampledata.trim();
+    }
+
+
+}

+ 72 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/TempletSet.java

@@ -0,0 +1,72 @@
+package com.usoftchina.saas.commons.po;
+
+/**
+ * @author: guq
+ * @create: 2018-11-27 20:52
+ **/
+public class TempletSet {
+    private String description;
+    private int width;
+    private String field;
+    private String necessary;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    private String position;
+    private boolean codefield;
+    private String type;
+
+    public boolean isCodefield() {
+        return codefield;
+    }
+
+    public void setCodefield(boolean codefield) {
+        this.codefield = codefield;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public int getWidth() {
+        return width;
+    }
+
+    public void setWidth(int width) {
+        this.width = width;
+    }
+
+    public String getField() {
+        return field;
+    }
+
+    public void setField(String field) {
+        this.field = field;
+    }
+
+    public String getNecessary() {
+        return necessary;
+    }
+
+    public void setNecessary(String necessary) {
+        this.necessary = necessary;
+    }
+
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+}

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

@@ -65,6 +65,12 @@
             <artifactId>test-starter</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>3.17</version>
+        </dependency>
     </dependencies>
 
     <build>

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

@@ -39,6 +39,16 @@ public class CommonController {
         return deferredResult;
     }
 
+    @PostMapping("/action/resAudit")
+    public DeferredResult 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<>();
+        CompletableFuture.supplyAsync(() -> commonService.commonResAudit(table, keyvalue, status, statuscode, auditdate, auditman))
+                .whenCompleteAsync((result, throwable) -> deferredResult.setResult(result));
+        return deferredResult;
+    }
+
     @GetMapping("/timeout/test")
     public void timeout(@RequestParam("time") Long time){
         try {

+ 81 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/ExcelController.java

@@ -0,0 +1,81 @@
+package com.usoftchina.saas.commons.controller;
+
+import com.usoftchina.saas.auth.client.annotation.IgnoreAuth;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.service.ExcelService;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.util.Map;
+
+/**导入模板下载、解析
+ * @author: guq
+ * @create: 2018-11-26 11:43
+ **/
+@RestController
+@RequestMapping("/excel")
+public class ExcelController {
+
+    @Autowired
+    private ExcelService excelService;
+
+    @RequestMapping("/import/templet")
+    public void CreateTemplet(@RequestParam("caller") String caller, HttpServletResponse response) throws IOException {
+        Map<String, Object> map = excelService.CreateTemplet(caller);
+        SXSSFWorkbook workbook = (SXSSFWorkbook)map.get("workbook");
+        String title = map.get("title").toString();
+        String filename = URLEncoder.encode(title + ".xlsx", "UTF-8");
+        response.setContentType("application/vnd.ms-excel");
+        response.setHeader("Content-Disposition", "attachment;filename=" + filename);
+        OutputStream out;
+        out = response.getOutputStream();
+        workbook.write(out);
+        out.close();
+    }
+
+    @PostMapping(value = "/import/parse", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public Result ParseTemplet(@RequestParam("caller") String caller, @RequestPart(value = "file") MultipartFile file) throws IOException {
+        InputStream is = null;
+        Workbook wb = null;
+        Integer keyvalue = null;
+        long size = file.getSize();
+        if (size > 104857600) {
+            return Result.error(new String(("{error: '文件过大', size:" + size + "}").getBytes("utf-8"), "iso8859-1"));
+        } else {
+            excelService.clearBefore(caller);
+            String ft = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
+            is = file.getInputStream();
+            if (ft.equals("xlsx")) {
+                wb = new XSSFWorkbook(is);
+            } else if(ft.equals("xls")){
+                wb = new HSSFWorkbook(is);
+            } else {
+                return Result.error(new String("{error: 'excel文件的格式不太规范,导入失败<hr>可以尝试将文件另存为.xls文件,或将数据选择性粘贴到excel模板,然后导入'}".getBytes("utf-8"),
+                        "iso8859-1"));
+            }
+            keyvalue = excelService.parseTemplet(wb, caller);
+        }
+        return Result.success(keyvalue);
+    }
+
+    @RequestMapping(value = "/test")
+    public Result ParseTemplet(String caller) throws IOException {
+        InputStream is = null;
+        Workbook wb = null;
+        File file = new File("C:\\Users\\guh-pc\\Desktop\\import.xlsx");
+        is = new FileInputStream(file);
+        wb = new XSSFWorkbook(is);
+        excelService.parseTemplet(wb, caller);
+        return Result.success();
+    }
+
+}

+ 10 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/DataImportDetailMapper.java

@@ -0,0 +1,10 @@
+package com.usoftchina.saas.commons.mapper;
+
+import com.usoftchina.saas.commons.po.DataImportDetail;
+
+public interface DataImportDetailMapper {
+
+    int insertSelective(DataImportDetail record);
+
+    void deleteByIds(String ids);
+}

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

@@ -0,0 +1,17 @@
+package com.usoftchina.saas.commons.mapper;
+
+import com.usoftchina.saas.commons.po.DataImport;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface DataImportMapper {
+    void deleteByCaller(@Param("caller") String caller, @Param("companyid") Long companyid);
+    int insertSelective(DataImport record);
+
+    void updateErr(@Param("err") String err, @Param("id") Integer id);
+
+    String selectByCaller(@Param("caller") String caller, @Param("companyId") Long companyId);
+
+    void deleteByIds(String ids);
+}

+ 9 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/DataTempletMapper.java

@@ -0,0 +1,9 @@
+package com.usoftchina.saas.commons.mapper;
+
+import com.usoftchina.saas.commons.po.DataTemplet;
+import org.apache.ibatis.annotations.Param;
+
+public interface DataTempletMapper {
+
+    DataTemplet selectByCaller(@Param("caller") String caller, @Param("companyid") Long companyid);
+}

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

@@ -11,4 +11,6 @@ public interface CommonService {
     InitStatusDTO initCheck();
 
     String commonAudit(String table, String keyvalue, String status, String statuscode, String auditdate, String auditman);
+
+    String commonResAudit(String table, String keyvalue, String status, String statuscode, String auditdate, String auditman);
 }

+ 14 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/ExcelService.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.commons.service;
+
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+
+import java.util.Map;
+
+public interface ExcelService {
+    Map<String, Object> CreateTemplet(String caller);
+
+    void clearBefore(String caller);
+
+    Integer parseTemplet(Workbook wb, String caller);
+}

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

@@ -61,7 +61,18 @@ public class CommonServiceImpl implements CommonService {
         }
         return "success";
     }
-
+    @Override
+    public String commonResAudit(String table, String keyvalue, String status, String statuscode, String auditdate, String auditman) {
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(table) || StringUtils.isEmpty(keyvalue)) {
+            return null;
+        }
+        String sql = resAuditedSql(table, keyvalue, status, statuscode, auditdate, auditman, companyId);
+        if (null != sql) {
+            commonMapper.commonAudit(sql);
+        }
+        return "success";
+    }
     private String praseSql(String table, String keyvalue, String status, String statuscode, String auditdate, String auditman, Long companyId) {
         String sql = "update " + table + " set ";
         StringBuilder sb = new StringBuilder();
@@ -83,4 +94,25 @@ public class CommonServiceImpl implements CommonService {
         }
         return null;
     }
+    private String resAuditedSql(String table, String keyvalue, String status, String statuscode, String auditdate, String auditman, Long companyId) {
+        String sql = "update " + table + " set ";
+        StringBuilder sb = new StringBuilder();
+        if (!StringUtils.isEmpty(status)) {
+            sb.append(" " + status + " = '" + Status.UNAUDITED.getDisplay() + "',");
+        }
+        if (!StringUtils.isEmpty(statuscode)) {
+            sb.append(" " + statuscode + "='" + Status.UNAUDITED.name() + "',");
+        }
+        if (!StringUtils.isEmpty(auditdate)) {
+            sb.append(" " + auditdate + "= null ,");
+        }
+        if (!StringUtils.isEmpty(auditman)) {
+            sb.append(" " + auditman + "= null ,");
+        }
+        if (sb.length() > 0) {
+            sql =  sql + sb.substring(0, sb.length() - 1) + " where " + keyvalue + " and companyId=" + companyId;
+            return sql;
+        }
+        return null;
+    }
 }

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

@@ -0,0 +1,484 @@
+package com.usoftchina.saas.commons.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.usoftchina.saas.commons.dto.ProductBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.mapper.DataImportDetailMapper;
+import com.usoftchina.saas.commons.mapper.DataImportMapper;
+import com.usoftchina.saas.commons.mapper.DataTempletMapper;
+import com.usoftchina.saas.commons.po.*;
+import com.usoftchina.saas.commons.service.ExcelService;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.saas.utils.StringUtils;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author: guq
+ * @create: 2018-11-26 15:19
+ **/
+@Service
+public class ExcelServiceImpl implements ExcelService{
+
+    @Autowired
+    private DataTempletMapper dataTempletMapper;
+    @Autowired
+    private DataImportMapper dataImportMapper;
+    @Autowired
+    private DataImportDetailMapper dataImportDetailMapper;
+
+    @Override
+    public Map<String, Object> CreateTemplet(String caller) {
+        Long companyId = BaseContextHolder.getCompanyId();
+        Map<String, Object> map = new HashMap<>();
+        SXSSFWorkbook workbook = new SXSSFWorkbook();
+        DataTemplet dataTemplet = dataTempletMapper.selectByCaller(caller, companyId);
+        String cols = dataTemplet.getDt_columns();
+      /*  String cols = "[{\"description\":\"物料编号\",\"necessary\":\"true\"},{\"description\":\"物料名称\",\"necessary\":\"true\"},{\"description\":\"物料类型\",\"necessary\":\"true\"},{\"description\":\"仓库编号\",\"necessary\":\"true\"},{\"description\":\"仓库名称\",\"necessary\":\"true\"}]";
+        cols = "[{\"description\":\"物料编号\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_code\",\"codefield\":true}," +
+                "{\"description\":\"物料名称\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_detail\",\"codefield\":false}," +
+                "{\"description\":\"更新时间\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"updateTime\",\"codefield\":false,\"type\":\"date\"}," +
+                "{\"description\":\"规格\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_spec\",\"codefield\":false}," +
+                "{\"description\":\"类型\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_kind\",\"codefield\":false}," +
+                "{\"description\":\"型号\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_orispeccode\",\"codefield\":false}" +
+                ",{\"description\":\"品牌\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_brand\",\"codefield\":false}," +
+                "{\"description\":\"单位\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_unit\",\"codefield\":false}," +
+                "{\"description\":\"仓库编号\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_whcode\",\"codefield\":false}," +
+                "{\"description\":\"仓库名称\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_whname\",\"codefield\":false}," +
+                "{\"description\":\"最新采购单价\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_purcprice\",\"codefield\":false}" +
+                ",{\"description\":\"最新出货单价\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_saleprice\",\"codefield\":false}," +
+                "{\"description\":\"替代料仓库编号\",\"necessary\":\"true\",\"position\":\"detail\",\"field\":\"pd_whcode\",\"codefield\":false}," +
+                "{\"description\":\"替代料仓库名称\",\"necessary\":\"false\",\"position\":\"detail\",\"field\":\"pd_whname\",\"codefield\":false}," +
+                "{\"description\":\"期初数量\",\"necessary\":\"true\",\"position\":\"detail\",\"field\":\"pd_num\",\"codefield\":false}," +
+                "{\"description\":\"单位成本\",\"necessary\":\"true\",\"position\":\"detail\",\"field\":\"pd_price\",\"codefield\":false}]";
+      */
+        JSONArray array = (JSONArray) JSONArray.parse(cols);
+        String remark = dataTemplet.getDt_description();
+        //String exampledata = dataTemplet.getDt_exampledata();
+        //JSONArray datas = (JSONArray) JSONArray.parse(exampledata);
+        JSONArray datas = new JSONArray();
+        JSONObject data = new JSONObject();
+        data.put("物料编号", "code1");
+        data.put("物料名称", "name1");
+        data.put("规格", "spec1");
+        data.put("型号", "kind1");
+        data.put("品牌", "brand1");
+        data.put("更新时间", "2018-09-08");
+        data.put("单位", "nuit1");
+        data.put("类型", "leixin1");
+        data.put("仓库编号", "whcode1");
+        data.put("仓库名称", "whname1");
+        data.put("最新采购单价", "100");
+        data.put("最新出货单价", "22");
+        data.put("替代料仓库编号", "tcode1");
+        data.put("替代料仓库名称", "tname1");
+        data.put("期初数量", "22");
+        data.put("单位成本", "22");
+        datas.add(data);
+        JSONObject data2 = new JSONObject();
+        data2.put("物料编号", "code2");
+        data2.put("物料名称", "name2");
+        data2.put("规格", "spec2");
+        data2.put("型号", "kind2");
+        data2.put("品牌", "brand2");
+        data2.put("单位", "nuit2");
+        data2.put("类型", "leixin2");
+        data2.put("仓库编号", "whcode2");
+        data2.put("仓库名称", "whname2");
+        data2.put("最新采购单价", "100");
+        data2.put("最新出货单价", "22");
+        data2.put("替代料仓库编号", "tcode2");
+        data2.put("替代料仓库名称", "tname2");
+        data2.put("期初数量", "22");
+        data2.put("单位成本", "22");
+        datas.add(data2);
+        System.out.println(datas.toJSONString());
+        createWorkbook(workbook, 1, array, datas, remark);
+        map.put("workbook", workbook);
+        map.put("title", dataTemplet.getDt_title());
+        return map;
+    }
+
+    @Override
+    public void clearBefore(String caller) {
+        Long companyId = BaseContextHolder.getCompanyId();
+        String ids = dataImportMapper.selectByCaller(caller, companyId);
+        if (!StringUtils.isEmpty(ids)) {
+            dataImportDetailMapper.deleteByIds(ids);
+            dataImportMapper.deleteByIds(ids);
+        };
+
+    }
+
+    @Override
+    @Transactional
+    public Integer parseTemplet(Workbook wb, String caller) {
+        if (wb == null || StringUtils.isEmpty(caller)) {
+            throw new BizException(BizExceptionCode.NULL_DATA);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        DataImport di = new DataImport();
+        di.setCompanyid(companyId);
+        di.setDi_caller(caller);
+        di.setDi_date(new Date());
+        di.setDi_man(BaseContextHolder.getUserName());
+        di.setDi_toformal(0);
+        di.setDi_success(0);
+        List<Map<String,String>> datas = new ArrayList<Map<String,String>>();
+        String cols = "[{\"description\":\"物料编号\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_code\",\"codefield\":true}," +
+                "{\"description\":\"物料名称\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_detail\",\"codefield\":false},{\"description\":\"规格\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_spec\",\"codefield\":false},{\"description\":\"类型\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_kind\",\"codefield\":false},{\"description\":\"型号\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_orispeccode\",\"codefield\":false}" +
+                ",{\"description\":\"品牌\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_brand\",\"codefield\":false},{\"description\":\"单位\",\"necessary\":\"true\",\"position\":\"main\",\"field\":\"pr_unit\",\"codefield\":false},{\"description\":\"仓库编号\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_whcode\",\"codefield\":false},{\"description\":\"仓库名称\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_whname\",\"codefield\":false},{\"description\":\"最新采购单价\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_purcprice\",\"codefield\":false}" +
+                ",{\"description\":\"最新出货单价\",\"necessary\":\"false\",\"position\":\"main\",\"field\":\"pr_saleprice\",\"codefield\":false},{\"description\":\"替代料仓库编号\",\"necessary\":\"true\",\"position\":\"detail\",\"field\":\"pd_whcode\",\"codefield\":false},{\"description\":\"替代料仓库名称\",\"necessary\":\"false\",\"position\":\"detail\",\"field\":\"pd_whname\",\"codefield\":false},{\"description\":\"期初数量\",\"necessary\":\"true\",\"position\":\"detail\",\"field\":\"pd_num\",\"codefield\":false},{\"description\":\"单位成本\",\"necessary\":\"true\",\"position\":\"detail\",\"field\":\"pd_price\",\"codefield\":false}]";
+        //前端列表信息
+        List<TempletSet> templetSets = JSONArray.parseArray(cols, TempletSet.class);
+        Map<String, List<TempletSet>> columns = CollectionUtils.groupBy(templetSets, TempletSet::getPosition);
+        List<String> positions = SetToList(columns.keySet());
+        String cellData = null;
+        String codeValue = null;
+        //读取默认从第2行开始读取
+        List<String> keys = new ArrayList<>();
+        //获取第一个sheet
+        Sheet sheet = wb.getSheetAt(0);
+        //获取最大行数
+        int rownum = sheet.getPhysicalNumberOfRows();
+        if (rownum < 3) {
+            throw new BizException(12324, "请先填写数据");
+        }
+        //获取第2行
+        Row row = sheet.getRow(1);
+        //获取最大列数
+        int colnum = row.getPhysicalNumberOfCells();
+        String key = null;
+        //添加keys
+        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>();
+            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{
+                break;
+            }
+            datas.add(map);
+        }
+        dataImportMapper.insertSelective(di);
+        Integer keyvalue = di.getDi_id();
+        //数据转换成字段
+        if (!CollectionUtils.isEmpty(datas)) {
+            StringBuilder err = new StringBuilder();
+            JSONArray mains = new JSONArray();
+            JSONArray details = new JSONArray();
+            boolean flag = false;
+            //数据行循环
+            for (int i = 0; i < datas.size(); i++) {
+                Map<String,String> data = datas.get(i);
+                DataImportDetail dd = new DataImportDetail();
+                //界面值
+                String value = null;
+                JSONObject mainData = null;
+                JSONObject detailData = null;
+                dd.setCompanyid(companyId);
+                dd.setDd_diid(keyvalue);
+                //主从表循环
+                for (int j = 0; j < positions.size(); j++) {
+                   String position = positions.get(j);
+                    //标识是否一个主表的数据
+                   boolean difference = true;
+                    //依据主从表分类
+                   if ("main".equals(position)) {
+                       List<TempletSet> main = columns.get(position);
+                       for (TempletSet set : main) {
+                           //取excel值
+                           if ("true".equals(set.getNecessary())) {
+                               value = data.get("*" + set.getDescription());
+                           } else {
+                               value = data.get(set.getDescription());
+                           }
+                           //取编号字段
+                           if (set.isCodefield() && !data.get("*" + set.getDescription()).equals("")) {
+                               mainData = new JSONObject();
+                               codeValue = value;
+                               difference = true;
+                           }
+                           //检查是否是同一单
+                           if (set.isCodefield() && data.get("*" + set.getDescription()).equals("")) {
+                               difference = false;
+                               break;
+                           }
+                           //检查主表必填字段是否完整
+                           if (difference) {
+                               dd.setDd_codevalue(codeValue);
+                               if ("true".equals(set.getNecessary()) && data.get("*" + set.getDescription()).equals("")) {
+                                   err.append("第" + (i + 2) + "行 " + set.getDescription() + " 必填字段未填写! ");
+                                   break;
+                               }
+                           }
+                           //检测日期类型是否规范
+                           if ("date".equals(set.getType())) {
+                               flag = validateDateFormat(value);
+                               if (!flag) {
+                                   err.append("第" + (i + 2) + "行 " + set.getDescription() + " 日期格式不正确! ");
+                                   break;
+                               }
+                           }
+                           //插入主表数据
+                           if (null != mainData) {
+                               if ("true".equals(set.getNecessary())) {
+                                   mainData.put(set.getField(), value);
+                               } else {
+                                   mainData.put(set.getField(), value);
+                               }
+                           }
+                       }
+                       //所有主表数据进行分类
+                       if (null != mainData) {
+                           //mains.add(mainData);
+                           dd.setDd_maindata(mainData.toJSONString());
+                       }
+                   } else {
+                       //从表字段
+                       List<TempletSet> detail = columns.get(position);
+                       detailData = new JSONObject();
+                       for (TempletSet set : detail) {
+                           //取excel值
+                           if ("true".equals(set.getNecessary())) {
+                               value = data.get("*" + set.getDescription());
+                           } else {
+                               value = data.get(set.getDescription());
+                           }
+                           //拼从表数据
+                           if ("true".equals(set.getNecessary())) {
+                               detailData.put(set.getField(), data.get("*" + set.getDescription()));
+                           } else {
+                               detailData.put(set.getField(), data.get(set.getDescription()));
+                           }
+                           if ("true".equals(set.getNecessary()) && data.get("*" + set.getDescription()).equals("")) {
+                               err.append("第" + (i + 2) + "行 " + set.getDescription() + " 必填字段未填写! ");
+                               break;
+                           }
+                           //检测日期类型是否规范
+                           if ("date".equals(set.getType())) {
+                               flag = validateDateFormat(value);
+                               if (!flag) {
+                                   err.append("第" + (i + 2) + "行 " + set.getDescription() + " 日期格式不正确! ");
+                                   break;
+                               }
+                           }
+                       }
+                       if (detailData.size() > 0) {
+                           dd.setDd_codevalue(codeValue);
+                           dd.setDd_detaildata(detailData.toJSONString());
+                       }
+                   }
+                }
+                dataImportDetailMapper.insertSelective(dd);
+            }
+            //必填项检查
+            if (err.length() > 0) {
+                dataImportMapper.updateErr(err.toString(), keyvalue);
+                throw new BizException(123456789, err.toString());
+            }
+        }
+        return keyvalue;
+    }
+
+
+
+    private boolean validateDateFormat(String date) {
+        boolean flag = false;
+        if (StringUtils.isEmpty(date)) {
+            return false;
+        }
+        String regEx1 = "[0-9]{8}";
+        String regEX2 = "[0-9]{4}-[0-9]{2}-[0-9]{2}";
+        // 编译正则表达式
+        Pattern pattern1 = Pattern.compile(regEx1);
+        Pattern pattern2 = Pattern.compile(regEX2);
+        Matcher matcher = pattern1.matcher(date);
+        // 字符串是否与正则表达式相匹配
+        flag = matcher.matches();
+        if (!flag) {
+            flag = pattern2.matcher(date).matches();
+        }
+        return flag;
+    }
+
+    //保证先遍历主表
+    private List<String> SetToList(Set<String> sets) {
+        List<String> list = new ArrayList<>();
+        list.add("main");
+        for (String str : sets) {
+            if (!"main".equals(str)) {
+                list.add(str);
+            }
+        }
+        return list;
+    }
+
+    public static Object getCellFormatValue(Cell cell){
+        Object cellValue = null;
+        if(cell!=null){
+            //判断cell类型
+            switch(cell.getCellType()){
+                case Cell.CELL_TYPE_NUMERIC:{
+                    cellValue = String.valueOf(cell.getNumericCellValue());
+                    break;
+                }
+                case Cell.CELL_TYPE_FORMULA:{
+                    //判断cell是否为日期格式
+                    if(DateUtil.isCellDateFormatted(cell)){
+                        //转换为日期格式YYYY-mm-dd
+                        cellValue = cell.getDateCellValue();
+                    }else{
+                        //数字
+                        cellValue = String.valueOf(cell.getNumericCellValue());
+                    }
+                    break;
+                }
+                case Cell.CELL_TYPE_STRING:{
+                    cellValue = cell.getRichStringCellValue().getString();
+                    break;
+                }
+                default:
+                    cellValue = "";
+            }
+        }else{
+            cellValue = "";
+        }
+        return cellValue;
+    }
+
+
+    protected Cell getCell(Sheet sheet, int row, int col) {
+        Row sheetRow = sheet.getRow(row);
+        if (sheetRow == null) {
+            sheetRow = sheet.createRow(row);
+        }
+        Cell cell = sheetRow.getCell(col);
+        if (cell == null) {
+            cell = sheetRow.createCell(col);
+        }
+        return cell;
+    }
+
+    /**
+     * 生成excel工作表
+     *
+     * 数据
+     */
+    private void createWorkbook(SXSSFWorkbook workbook, int sheetIdx, JSONArray cols, JSONArray datas, String remark){
+        Sheet sheet = workbook.createSheet("sheet" + sheetIdx);
+        CellStyle style = getCellStyle(workbook);
+        //sheet.autoSizeColumn((short) 2);
+        sheet.createFreezePane(0, 1);// 固定列
+        Cell cell = null;
+        int rIdx = 0;
+        int cIdx = 0;
+        short width = 0;
+        DataFormat format = workbook.createDataFormat();
+        Row row = null;
+        if (remark != null) {
+            row = sheet.createRow(rIdx);
+            row.setHeightInPoints((short) 100);
+            sheet.setColumnWidth(cIdx, 1000);
+            cell = getCell(sheet, rIdx, cIdx);
+            cell.setCellValue(remark);
+            sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, cols.size() - 1));
+            rIdx++;
+        }
+        row = sheet.createRow(rIdx);
+        row.setHeightInPoints((short) 22);
+        List<String> keys = new ArrayList<String>();
+        if (!CollectionUtils.isEmpty(cols)) {
+            String value = "";
+            //列出主表的列
+            for (int i = 0; i < cols.size(); i++) {
+                JSONObject obj = (JSONObject) cols.get(i);
+                width = (short) (obj.get("width") == null ? 0 : (int)obj.get("width")*35.7);
+                width = width == 0 ? 4000 : width;
+                sheet.setColumnWidth(cIdx, width);
+                sheet.createFreezePane(cols.size() + 1, 2);
+                cell = getCell(sheet, rIdx, cIdx);
+                value = obj.get("description") == null ? value : obj.get("description").toString();
+                if ("true".equals(obj.get("necessary"))) {
+                    value = "*" + value;
+                }
+                cell.setCellValue(value);
+                keys.add(String.valueOf(obj.get("description")));
+                if ("date".equals(obj.get("type"))) {
+                    short df= workbook.createDataFormat().getFormat("yyyy-MM-dd");
+                    style.setDataFormat(df);
+                }
+                cell.setCellStyle(style);
+                cIdx++;
+                value = "";
+            }
+            rIdx++;
+            if (!CollectionUtils.isEmpty(datas)) {
+                for(Object d :datas) {
+                    JSONObject data = (JSONObject)d;
+                    cIdx = 0;
+                    row = sheet.createRow(rIdx);
+                    row.setHeightInPoints((short) 20);
+                    for (String key : keys) {
+                        Cell c = getCell(sheet, rIdx, cIdx);
+                        if (data.get(key) != null) {
+                            String v = String.valueOf(data.get(key));
+                            if ("".equals(v) || "null".equals(v)) {
+                                c.setCellValue(0);
+                            } else if (!v.matches("^-?[0-9]+(.[0-9]+)?")) {
+                                c.setCellValue(v);
+                            } else {
+                                c.setCellValue(Double.parseDouble(v.replace(",", "")));
+                            }
+                        } else {
+                            c.setCellValue("");
+                        }
+                        cIdx++;
+                    }
+                    rIdx++;
+                }
+            }
+        }
+    }
+
+    private CellStyle getCellStyle(SXSSFWorkbook workbook) {
+        CellStyle style = workbook.createCellStyle();
+        style.setFillBackgroundColor((short) 18);
+        style.setFillPattern(FillPatternType.LEAST_DOTS);
+        Font font = workbook.createFont();
+        font.setFontName("仿宋_GB2312");// 字体
+        font.setFontHeightInPoints((short) 12);// 字号
+        font.setColor((short)64);// 颜色
+        style.setFont(font);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setFillForegroundColor(HSSFColor.GREEN.index);
+        style.setFillBackgroundColor(HSSFColor.PALE_BLUE.index);
+        style.setBorderBottom(BorderStyle.MEDIUM);
+        style.setBorderLeft(BorderStyle.MEDIUM);
+        style.setBorderRight(BorderStyle.MEDIUM);
+        style.setBorderTop(BorderStyle.MEDIUM);
+        return style;
+    }
+
+}

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

@@ -13,7 +13,7 @@ spring:
     username: saas
     password: select123***
   datasource:
-    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
     username: saas
     password: select111***
 logging:

+ 83 - 0
applications/commons/commons-server/src/main/resources/mapper/DataImportDetailMapper.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.commons.mapper.DataImportDetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.po.DataImportDetail" >
+    <id column="dd_id" property="dd_id" jdbcType="INTEGER" />
+    <result column="dd_maindata" property="dd_maindata" jdbcType="VARCHAR" />
+    <result column="dd_detno" property="dd_detno" jdbcType="INTEGER" />
+    <result column="dd_diid" property="dd_diid" jdbcType="INTEGER" />
+    <result column="dd_checked" property="dd_checked" jdbcType="INTEGER" />
+    <result column="dd_success" property="dd_success" jdbcType="INTEGER" />
+    <result column="dd_toformal" property="dd_toformal" jdbcType="INTEGER" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="dd_detaildata" property="dd_detaildata" jdbcType="VARCHAR" />
+    <result column="dd_codevalue" property="dd_codevalue" jdbcType="VARCHAR" />
+  </resultMap>
+
+  <delete id="deleteByIds">
+    delete from data_importdetail where dd_diid in (${ids})
+  </delete>
+
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.DataImportDetail" >
+    insert into data_importdetail
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="dd_maindata != null" >
+        dd_maindata,
+      </if>
+      <if test="dd_detno != null" >
+        dd_detno,
+      </if>
+      <if test="dd_diid != null" >
+        dd_diid,
+      </if>
+      <if test="dd_checked != null" >
+        dd_checked,
+      </if>
+      <if test="dd_success != null" >
+        dd_success,
+      </if>
+      <if test="dd_toformal != null" >
+        dd_toformal,
+      </if>
+      <if test="companyid != null" >
+        companyid,
+      </if>
+      <if test="dd_detaildata != null" >
+        dd_detaildata,
+      </if>
+      <if test="dd_codevalue != null" >
+        dd_codevalue,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="dd_maindata != null" >
+        #{dd_maindata,jdbcType=VARCHAR},
+      </if>
+      <if test="dd_detno != null" >
+        #{dd_detno,jdbcType=INTEGER},
+      </if>
+      <if test="dd_diid != null" >
+        #{dd_diid,jdbcType=INTEGER},
+      </if>
+      <if test="dd_checked != null" >
+        #{dd_checked,jdbcType=INTEGER},
+      </if>
+      <if test="dd_success != null" >
+        #{dd_success,jdbcType=INTEGER},
+      </if>
+      <if test="dd_toformal != null" >
+        #{dd_toformal,jdbcType=INTEGER},
+      </if>
+      <if test="companyid != null" >
+        #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="dd_detaildata != null" >
+        #{dd_detaildata,jdbcType=VARCHAR},
+      </if>
+      <if test="dd_codevalue != null" >
+        #{dd_codevalue,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+
+ </mapper>

+ 83 - 0
applications/commons/commons-server/src/main/resources/mapper/DataImportMapper.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.commons.mapper.DataImportMapper" >
+<delete id="deleteByCaller">
+  delete from data_import where di_caller=#{caller} and companyid=#{companyid} and
+  il_toformal=0 and il_result is not null
+</delete>
+  <delete id="deleteByIds">
+    delete from data_import where di_id in (${ids});
+  </delete>
+
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.DataImport" >
+    <selectKey  resultType="java.lang.Integer" keyProperty="di_id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into data_import
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="di_caller != null" >
+        di_caller,
+      </if>
+      <if test="companyid != null" >
+        companyid,
+      </if>
+      <if test="di_date != null" >
+        di_date,
+      </if>
+      <if test="di_count != null" >
+        di_count,
+      </if>
+      <if test="di_result != null" >
+        di_result,
+      </if>
+      <if test="di_success != null" >
+        di_success,
+      </if>
+      <if test="di_man != null" >
+        di_man,
+      </if>
+      <if test="di_toformal != null" >
+        di_toformal,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="di_caller != null" >
+        #{di_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="companyid != null" >
+        #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="di_date != null" >
+        #{di_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="di_count != null" >
+        #{di_count,jdbcType=INTEGER},
+      </if>
+      <if test="di_result != null" >
+        #{di_result,jdbcType=VARCHAR},
+      </if>
+      <if test="di_success != null" >
+        #{di_success,jdbcType=INTEGER},
+      </if>
+      <if test="di_man != null" >
+        #{di_man,jdbcType=VARCHAR},
+      </if>
+      <if test="di_toformal != null" >
+        #{di_toformal,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+
+  <update id="updateErr" >
+    update data_import
+    set
+    di_result = #{err},
+    di_success = 0,
+    where di_id = #{id}
+  </update>
+
+
+  <select id="selectByCaller" resultType="string">
+    select group_concat(di_id) from data_import where di_caller=#{caller} and di_toformal=0 and di_result is not null
+  </select>
+</mapper>

+ 17 - 0
applications/commons/commons-server/src/main/resources/mapper/DataTempletMapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.commons.mapper.DataTempletMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.po.DataTemplet" >
+    <id column="dt_id" property="dt_id" jdbcType="INTEGER" />
+    <result column="dt_caller" property="dt_caller" jdbcType="VARCHAR" />
+    <result column="dt_description" property="dt_description" jdbcType="VARCHAR" />
+    <result column="dt_title" property="dt_title" jdbcType="VARCHAR" />
+    <result column="dt_exampledata" property="dt_exampledata" jdbcType="VARCHAR" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="dt_columns" property="dt_columns" jdbcType="VARCHAR"/>
+  </resultMap>
+
+  <select id="selectByCaller" resultMap="BaseResultMap">
+    select * from data_Templet where dt_caller=#{caller} and companyid = #{companyid}
+  </select>
+</mapper>

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

@@ -16,9 +16,7 @@ import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 @RestController
 @RequestMapping("/product")
@@ -107,4 +105,11 @@ public class ProductController {
         return Result.success(productService.getReserveCost(page, listReqDTO));
     }
 
+    //导入保存至列表
+    @RequestMapping("/saveToFormal")
+    public Result saveToFormal(Integer id, boolean update) {
+        productService.saveToFormal(id, update);
+        return Result.success();
+    }
+
 }

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

@@ -24,7 +24,7 @@ public interface BankinformationMapper extends CommonBaseMapper<Bankinformation>
     List<Bankinformation> selectBankinformationBycondition(@Param("con") String con, @Param("companyId") Long companyId);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
-    String selectBankcode(String bk_bankcode);
+    String selectBankcode(@Param("bk_bankcode") String bk_bankcode, @Param("companyId") Long companyId);
     Long selectBankId(String bk_bankcode);
 
     void check(Map<String, Object> map);

+ 22 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/DataImportMapper.java

@@ -0,0 +1,22 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.commons.po.DataImport;
+import com.usoftchina.saas.commons.po.DataImportDetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface DataImportMapper {
+    void deleteByCaller(@Param("caller") String caller, @Param("companyid") Long companyid);
+    int insertSelective(DataImport record);
+
+    void updateErr(@Param("err") String err, @Param("id") Integer id);
+
+    List<DataImportDetail> selectDataById(Integer id);
+
+    DataImportDetail selectProductBycode(@Param("code") String code, @Param("id") int id, @Param("companyid") Long companyId);
+
+    void updateDataImport(Integer id);
+
+    void updateDataImportError(@Param("err") String err,@Param("id") int id);
+}

+ 6 - 6
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/EmployeeMapper.java

@@ -20,16 +20,16 @@ public interface EmployeeMapper extends CommonBaseMapper<Employee> {
 
     List<EmployeeDTO> selectEmployeeListByCondition(@Param("con") String con,@Param("companyId") Long companyId);
 
-    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+    int validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
 
-    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
+    int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
 
-    Integer validatePhoneWhenInsert(@Param("phone") String phone, @Param("companyId") Long companyId);
+    int validatePhoneWhenInsert(@Param("phone") String phone, @Param("companyId") Long companyId);
 
-    Integer validatePhoneWhenUpdate(@Param("phone") String phone, @Param("id") Long id, @Param("companyId") Long company);
+    int validatePhoneWhenUpdate(@Param("phone") String phone, @Param("id") Long id, @Param("companyId") Long company);
 
 
-    Integer validateNameAndCodeWhenInsert(@Param("code") String code,@Param("name") String em_name,@Param("companyId") Long companyId);
+    int validateNameAndCodeWhenInsert(@Param("code") String code,@Param("name") String em_name,@Param("companyId") Long companyId);
 
-    Integer validateNameAndCodeWhenUpdate(@Param("code") String code,@Param("name") String em_name,@Param("id") Long em_id,@Param("companyId") Long id);
+    int validateNameAndCodeWhenUpdate(@Param("code") String code,@Param("name") String em_name,@Param("id") Long id,@Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java

@@ -48,4 +48,6 @@ public interface ProductMapper extends CommonBaseMapper<Product> {
     boolean deleteProdIOByCode(@Param("code") String code, @Param("companyId") Long companyId);
 
     boolean deleteProdIODetailByCode(@Param("code") String code, @Param("companyId") Long companyId);
+
+    Long selectIdByCode(@Param("code") String code, @Param("companyId") Long companyId);
 }

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

@@ -44,4 +44,6 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
     int selectCountByCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("id") Long id);
 
     int deleteCheckProdIO(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    Warehouse selectWareHouse(@Param("code") String code, @Param("companyId") Long companyId);
 }

+ 4 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java

@@ -17,6 +17,7 @@ import com.usoftchina.saas.document.mapper.ProductMapper;
 import com.usoftchina.saas.page.PageRequest;
 
 import java.util.List;
+import java.util.Map;
 
 public interface ProductService extends CommonBaseService<ProductMapper, Product> {
 
@@ -109,7 +110,7 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
      * @param listReqDTO
      * @return
      */
-    PageInfo<ProductReserveCostDTO> getReserveCost(PageRequest page, ListReqDTO listReqDTO);
+    Map<String, Object> getReserveCost(PageRequest page, ListReqDTO listReqDTO);
 
     /**
      * 通过明细ID删除明细
@@ -117,4 +118,6 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
      * @return
      */
     boolean deleteDetailById(Long id);
+
+    void saveToFormal(Integer id, boolean update);
 }

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

@@ -52,7 +52,7 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
         bankinformation.setCreatorName(BaseContextHolder.getUserName());
         int bid = Math.toIntExact(bankinformation.getId());
 
-        String bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode());
+        String bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode() ,BaseContextHolder.getCompanyId());
         //先判断ID,再判断编号
         if (bankinformation.getId() == 0)
         {

+ 7 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/EmployeeServiceImpl.java

@@ -65,19 +65,22 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
     @Override
     public DocBaseDTO saveFormData(Employee employee) {
         DocBaseDTO docBaseDTO = null;
-        String code = pushMaxnubmer(employee.getEm_code(), employee.getId());
+        Long companyId = BaseContextHolder.getCompanyId();
+        employee.setCompanyId(companyId);
         if(employee.getId() == 0){
+            String code = employee.getEm_code();
             //检查名称和编号
-            int count = getMapper().validateNameAndCodeWhenInsert(code,employee.getEm_name(),BaseContextHolder.getCompanyId());
+            int count = getMapper().validateNameAndCodeWhenInsert(code,employee.getEm_name(),companyId);
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_EMNAMECODE);
             }
+            code = pushMaxnubmer(employee.getEm_code(), employee.getId());
             //检查电话号码
             count = getMapper().validatePhoneWhenInsert(employee.getEm_mobile(),BaseContextHolder.getCompanyId());
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_TEL);
             }
-            employee.setCompanyId(BaseContextHolder.getCompanyId());
+            employee.setEm_code(code);
             employee.setCreatorId(BaseContextHolder.getUserId());
             employee.setCreateTime(new Date());
             employee.setCreatorName(BaseContextHolder.getUserName());
@@ -87,7 +90,7 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
             messageLogService.save(docBaseDTO);
         }else{
             //检查名称和编号
-            int count = getMapper().validateNameAndCodeWhenUpdate(code,employee.getEm_name(),employee.getId(),BaseContextHolder.getCompanyId());
+            int count = getMapper().validateNameAndCodeWhenUpdate(employee.getEm_code(),employee.getEm_name(),employee.getId(),companyId);
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_EMNAMECODE);
             }

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

@@ -1,8 +1,8 @@
 package com.usoftchina.saas.document.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MessageLogService;
@@ -12,6 +12,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.DataImportDetail;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
@@ -19,12 +20,15 @@ import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.dto.ProductListDTO;
 import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
 import com.usoftchina.saas.document.entities.*;
+import com.usoftchina.saas.document.mapper.DataImportMapper;
 import com.usoftchina.saas.document.mapper.ProductDetailMapper;
 import com.usoftchina.saas.document.mapper.ProductMapper;
+import com.usoftchina.saas.document.mapper.WarehouseMapper;
 import com.usoftchina.saas.document.service.ProductService;
 import com.usoftchina.saas.document.service.WarehouseService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.CollectionUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -44,6 +48,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     private WarehouseService warehouseService;
     @Autowired
     private ProductDetailMapper productDetailMapper;
+    @Autowired
+    private DataImportMapper dataImportMapper;
+    @Autowired
+    private WarehouseMapper warehouseMapper;
 
     @Override
     public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO) {
@@ -481,7 +489,8 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     }
 
     @Override
-    public PageInfo<ProductReserveCostDTO> getReserveCost(PageRequest page, ListReqDTO listReqDTO) {
+    public Map<String, Object> getReserveCost(PageRequest page, ListReqDTO listReqDTO) {
+        Map<String, Object> map = new HashMap<String, Object>();
         //设置分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
@@ -492,7 +501,9 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         List<ProductReserveCostDTO> reserveCostList = geReserveCost(listReqDTO);
         //取分页信息
         PageInfo<ProductReserveCostDTO> pageInfo = new PageInfo<ProductReserveCostDTO>(reserveCostList);
-        return pageInfo;
+        map.put("list", pageInfo);
+        map.put("calculate", null);
+        return map;
     }
 
     @Override
@@ -518,6 +529,87 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         return true;
     }
 
+
+
+    @Override
+    public void saveToFormal(Integer id, boolean update) {
+        if (null == id || "0".equals(id)) {
+            return;
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        StringBuilder err = new StringBuilder();
+        List<ProductListDTO> list = new ArrayList<>();
+        ProductListDTO listDTO = null;
+        List<DataImportDetail> details = dataImportMapper.selectDataById(id);
+        if (!CollectionUtils.isEmpty(details)) {
+            Map<String, List<DataImportDetail>> datas = CollectionUtils.groupBy(details, DataImportDetail::getDd_codevalue);
+            Integer detno = null;
+            for (String code : datas.keySet()) {
+                listDTO = new ProductListDTO();
+                List<ProductDetail> productDetails = new ArrayList<>();
+                int i = getMapper().validateCodeWhenInsert(code, companyId);
+                List<DataImportDetail> data = datas.get(code);
+                DataImportDetail main = dataImportMapper.selectProductBycode(code, id, companyId);
+                Product product = JSONObject.parseObject(main.getDd_maindata(), Product.class);
+                Warehouse warehouse = null;
+                //验证仓库
+                if (!StringUtils.isEmpty(product.getPr_whcode())) {
+                    warehouse = warehouseMapper.selectWareHouse(product.getPr_whcode(), companyId);
+                    if (null == warehouse) {
+                        err.append("物料编号为: " + product.getPr_code() + " 的物料仓库: "+ product.getPr_whname() +" 在系统中不存在,请确认数据是否正确");
+                        break;
+                    }
+                    product.setPr_whid(warehouse.getId());
+                    product.setPr_status(Status.OPEN.getDisplay());
+                    product.setPr_statuscode(Status.OPEN.name());
+                }
+                //添加从表
+                if (data.size() > 0) {
+                    detno = 1;
+                    for (DataImportDetail productDetail : data) {
+                        ProductDetail detail = JSONObject.parseObject(productDetail.getDd_detaildata(), ProductDetail.class);
+                        if (null != detail) {
+                            //验证仓库
+                            if (!StringUtils.isEmpty(product.getPr_whcode())) {
+                                warehouse = warehouseMapper.selectWareHouse(detail.getPd_whcode(), companyId);
+                                if (null == warehouse) {
+                                    err.append("物料编号为: " + product.getPr_code() + " 的物料仓库: "+ product.getPr_whname() +" 在系统中不存在,请确认数据是否正确");
+                                    break;
+                                }
+                                detail.setPd_whid(Integer.valueOf(warehouse.getId().toString()));
+                                detail.setPd_detno(detno);
+                                detno++;
+                            }
+                            productDetails.add(detail);
+                        }
+                    }
+                }
+                //编号不存在
+                if (i == 0) {
+                    product.setId(0l);
+                //编号存在、需要更新
+                } else if (update){
+                    Long pr_id = getMapper().selectIdByCode(code, companyId);
+                    product.setId(pr_id);
+                //编号存在、不需要处理
+                } else {
+                    continue;
+                }
+                listDTO.setMain(product);
+                listDTO.setItems(productDetails);
+                list.add(listDTO);
+            }
+            if (err.length() > 0) {
+                dataImportMapper.updateDataImportError(err.toString(), id);
+                throw new BizException(12345, err.toString());
+            }
+            for (ProductListDTO  dto : list) {
+                saveData(dto);
+            }
+            dataImportMapper.updateDataImport(id);
+        }
+    }
+
     private List<ProductReserveCostDTO> geReserveCost(ListReqDTO listReqDTO) {
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();

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

@@ -13,7 +13,7 @@ spring:
     username: saas
     password: select123***
   datasource:
-    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
     username: saas
     password: select111***
   redis:

+ 3 - 2
applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -321,8 +321,9 @@
     </select>
 
 
-  <select id="selectBankcode" parameterType="java.lang.String" resultType="java.lang.String">
-        select bk_bankcode from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR}
+  <select id="selectBankcode" resultType="java.lang.String">
+        select bk_bankcode from bankinformation where
+        bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR} and companyId = #{companyId}
     </select>
 
   <select id="selectBankId" parameterType="java.lang.String" resultType="java.lang.Long">

+ 105 - 0
applications/document/document-server/src/main/resources/mapper/DataImportMapper.xml

@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.document.mapper.DataImportMapper" >
+  <resultMap id="DetailMap" type="com.usoftchina.saas.commons.po.DataImportDetail" >
+    <id column="dd_id" property="dd_id" jdbcType="INTEGER" />
+    <result column="dd_maindata" property="dd_maindata" jdbcType="VARCHAR" />
+    <result column="dd_detno" property="dd_detno" jdbcType="INTEGER" />
+    <result column="dd_diid" property="dd_diid" jdbcType="INTEGER" />
+    <result column="dd_checked" property="dd_checked" jdbcType="INTEGER" />
+    <result column="dd_success" property="dd_success" jdbcType="INTEGER" />
+    <result column="dd_toformal" property="dd_toformal" jdbcType="INTEGER" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="dd_detaildata" property="dd_detaildata" jdbcType="VARCHAR" />
+    <result column="dd_codevalue" property="dd_codevalue" jdbcType="VARCHAR" />
+  </resultMap>
+
+  <delete id="deleteByCaller">
+  delete from data_import where di_caller=#{caller} and companyid=#{companyid} and
+  il_toformal=0 and il_result is not null
+</delete>
+
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.DataImport" >
+    <selectKey  resultType="java.lang.Integer" keyProperty="di_id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into data_import
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="di_caller != null" >
+        di_caller,
+      </if>
+      <if test="companyid != null" >
+        companyid,
+      </if>
+      <if test="di_date != null" >
+        di_date,
+      </if>
+      <if test="di_count != null" >
+        di_count,
+      </if>
+      <if test="di_result != null" >
+        di_result,
+      </if>
+      <if test="di_success != null" >
+        di_success,
+      </if>
+      <if test="di_man != null" >
+        di_man,
+      </if>
+      <if test="di_toformal != null" >
+        di_toformal,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="di_caller != null" >
+        #{di_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="companyid != null" >
+        #{companyid,jdbcType=INTEGER},
+      </if>
+      <if test="di_date != null" >
+        #{di_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="di_count != null" >
+        #{di_count,jdbcType=INTEGER},
+      </if>
+      <if test="di_result != null" >
+        #{di_result,jdbcType=VARCHAR},
+      </if>
+      <if test="di_success != null" >
+        #{di_success,jdbcType=INTEGER},
+      </if>
+      <if test="di_man != null" >
+        #{di_man,jdbcType=VARCHAR},
+      </if>
+      <if test="di_toformal != null" >
+        #{di_toformal,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+
+  <update id="updateErr" >
+  update data_import
+  set
+  di_result = #{err},
+  di_success = 0,
+  where di_id = #{id}
+</update>
+
+<select id="selectDataById" resultMap="DetailMap">
+  select * from  data_importdetail
+  where dd_diid = #{id}
+</select>
+
+  <select id="selectProductBycode" resultMap="DetailMap">
+    select * from  data_importdetail
+    where dd_codevalue = #{code} and dd_diid=#{id} and ifnull(dd_success,0)=0 and dd_maindata is not null and companyid=#{companyid}
+  </select>
+
+  <update id="updateDataImport" parameterType="integer">
+    update data_import set di_toformal=1,di_success=1  where di_id=#{id}
+  </update>
+  <update id="updateDataImportError">
+    update data_import set di_toformal=1,di_result=#{err} where di_id=#{id}
+  </update>
+</mapper>

+ 3 - 2
applications/document/document-server/src/main/resources/mapper/EmployeeMapper.xml

@@ -239,8 +239,9 @@
   <select id="validateNameAndCodeWhenInsert" resultType="int">
     select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and companyId =#{companyId}
   </select>
-  <select id="validateNameAndCodeWhenUpdate" resultType="int" >
-    select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and em_id !=#{id} and companyId =#{companyId}
+  
+  <select id="validateNameAndCodeWhenUpdate" resultType="int">
+    select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and em_id !=#{id}  and companyId =#{companyId}
   </select>
 
 

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

@@ -901,5 +901,9 @@
     <delete id="deleteProdIODetailByCode">
         DELETE FROM PRODIODETAIL WHERE PD_PIID IN (SELECT PI_ID FROM PRODINOUT WHERE PI_INOUTNO=#{code} AND PRODINOUT.COMPANYID = #{companyId}) AND PRODIODETAIL.COMPANYID = #{companyId}
     </delete>
+
+    <select id="selectIdByCode" parameterType="long">
+        select pr_id from product where pr_code=#{code} and companyId=#{companyId}
+    </select>
 </mapper>
 

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

@@ -370,5 +370,8 @@
     <select id="deleteCheckProdIO" resultType="int">
         SELECT COUNT(*) FROM PRODIODETAIL WHERE pd_whid = #{id} and companyid = #{companyId}
     </select>
+    <select id="selectWareHouse" resultMap="WarehouseResultMapper">
+        select * from warehouse where wh_code=#{code} and companyId=#{companyId}
+    </select>
 </mapper>
 

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

@@ -38,5 +38,5 @@ 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(String bankcode);
+    Double selectThisamount(@Param("bankcode") String bankcode, @Param("companyId") Long companyId);
 }

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

@@ -216,8 +216,8 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         Iterator isList = fundtransferdetailList.iterator();
         while (isList.hasNext()){
             Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
-            Double amount = banksubledgerMapper.selectThisamount(fundtransferdetail.getFtd_bankcode());
-            Double inamount = banksubledgerMapper.selectThisamount(fundtransferdetail.getFtd_inbankcode());
+            Double amount = banksubledgerMapper.selectThisamount(fundtransferdetail.getFtd_bankcode(), BaseContextHolder.getCompanyId());
+            Double inamount = banksubledgerMapper.selectThisamount(fundtransferdetail.getFtd_inbankcode(), BaseContextHolder.getCompanyId());
             banksubledgerMapper.updateBankcode(amount, fundtransferdetail.getFtd_nowbalance(),
                     fundtransferdetail.getFtd_bankcode(), "+");
             banksubledgerMapper.updateBankcode(inamount, fundtransferdetail.getFtd_nowbalance(),

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

@@ -98,7 +98,6 @@ public class MoneyReportServiceImpl implements MoneyReportService {
         }
 
         String res = null;
-        VendOrCustAdd vendOrCustAdd = new VendOrCustAdd();
         List<Map<String, Double>> list1 = new ArrayList<>();
         if ("Supplier".equals(type)) {
             list = vendorAcountViewMapper.selectByCondition(con, companyId);
@@ -107,26 +106,28 @@ public class MoneyReportServiceImpl implements MoneyReportService {
                 Integer vid = new Integer(0);
                 vid = vendorAcountViewMapper.getId(vendorAcountView.getPi_vendcode(), Long.valueOf(vendorAcountView.getCompanyId()));
                 Integer ym = Integer.valueOf(req.getYm());
-                vendOrCustAdd = vendorAcountViewMapper.selectVendAdd(vid, ym, Long.valueOf(vendorAcountView.getCompanyId()));
-                vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
-                        + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
-                        - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
-                //封装成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);
+                VendOrCustAdd vendOrCustAdd = vendorAcountViewMapper.selectVendAdd(vid, ym, Long.valueOf(vendorAcountView.getCompanyId()));
+                if (vendOrCustAdd != null) {
+                    vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
+                            + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
+                            - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
+                    //封装成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);
+                }
             }
         } else if("payDetail".equals(type)){
             list = paydetailViewMapper.selectByCondition(con, companyId);
@@ -154,26 +155,28 @@ public class MoneyReportServiceImpl implements MoneyReportService {
 
                 vid = customerCheckViewMapper.getId(customerCheckView.getPi_custcode(), Long.valueOf(customerCheckView.getCompanyId()));
                 Integer ym = Integer.valueOf(req.getYm());
-                vendOrCustAdd = customerCheckViewMapper.selectCustAdd(vid, ym, Long.valueOf(customerCheckView.getCompanyId()));
-                vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
-                        + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
-                        - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
-                //封装成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);
+                VendOrCustAdd vendOrCustAdd = customerCheckViewMapper.selectCustAdd(vid, ym, Long.valueOf(customerCheckView.getCompanyId()));
+                if (vendOrCustAdd != null) {
+                    vendOrCustAdd.setNowbalance((vendOrCustAdd.getBeginamount() == null ? new Double(0) : vendOrCustAdd.getBeginamount())
+                            + (vendOrCustAdd.getNowamount() == null ? new Double(0) : vendOrCustAdd.getNowamount())
+                            - (vendOrCustAdd.getNowpay() == null ? new Double(0) : vendOrCustAdd.getNowpay()));
+                    //封装成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);
+                }
             }
         }else if ("accountdetails".equals(type)){
             list = accountDetailsViewMapper.selectByCondition(con, companyId);

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

@@ -119,7 +119,7 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
         DocBaseDTO docBaseDTO = this.insert(othte);
         Long id = docBaseDTO.getId();
 
-        Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode());
+        Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode(), companyId);
         //取从表金额
         List<Othreceiptsdetail> othreceiptsdetailList = othte.getItems();
         Iterator isList = othreceiptsdetailList.iterator();
@@ -219,7 +219,7 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
 
 
         //更新资金
-        Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode());
+        Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode(), BaseContextHolder.getCompanyId());
         List<Othreceiptsdetail> othreceiptsdetailList = othreceiptsdetailMapper.selectByPrimaryKey(id);
         Iterator isList = othreceiptsdetailList.iterator();
         while (isList.hasNext()){

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

@@ -159,7 +159,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         DocBaseDTO docBaseDTO = this.insert(othsp);
         Long id = docBaseDTO.getId();
 
-        Double amount = banksubledgerMapper.selectThisamount(othspendings.getOs_bankcode());
+        Double amount = banksubledgerMapper.selectThisamount(othspendings.getOs_bankcode(), companyId);
         //取从表金额
         List<Othspendingsdetail> othspendingsdetailList = othsp.getItems();
         Iterator isList = othspendingsdetailList.iterator();
@@ -253,7 +253,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         banksubledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他支出单",BaseContextHolder.getCompanyId());
 
         //资金
-        Double amount = banksubledgerMapper.selectThisamount(othspendings.getOs_bankcode());
+        Double amount = banksubledgerMapper.selectThisamount(othspendings.getOs_bankcode(), BaseContextHolder.getCompanyId());
         //取从表金额
         List<Othspendingsdetail> othspendingsdetailList = othspendingsdetailMapper.selectByPrimaryKey(id);
         Iterator isList = othspendingsdetailList.iterator();

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

@@ -305,17 +305,19 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
      */
     private void updateAuditSubledeger(Long id , Double nowBalance){
         Subledger subledger = subledgerMapper.selectByPrimaryKey(Math.toIntExact(id));
-        Subledger newSubledeger = new Subledger();
-        newSubledeger.setId(id);
-        Double newNamout = subledger.getSl_namount()==null?new Double(0):subledger.getSl_namount()-nowBalance;
-        Double newYamout = subledger.getSl_yamount()==null?new Double(0):subledger.getSl_yamount()+nowBalance;
-        newSubledeger.setSl_yamount(newYamout);
-        newSubledeger.setSl_namount(newNamout);
-        newSubledeger.setCompanyId(BaseContextHolder.getCompanyId());
-        newSubledeger.setUpdaterName(BaseContextHolder.getUserName());
-        newSubledeger.setUpdaterId(BaseContextHolder.getUserId());
-        newSubledeger.setUpdateTime(new Date());
-        subledgerMapper.updateByPrimaryKeySelective(newSubledeger);
+        if (subledger != null) {
+            Subledger newSubledeger = new Subledger();
+            newSubledeger.setId(id);
+            Double newNamout = subledger.getSl_namount() == null ? new Double(0) : subledger.getSl_namount() - nowBalance;
+            Double newYamout = subledger.getSl_yamount() == null ? new Double(0) : subledger.getSl_yamount() + nowBalance;
+            newSubledeger.setSl_yamount(newYamout);
+            newSubledeger.setSl_namount(newNamout);
+            newSubledeger.setCompanyId(BaseContextHolder.getCompanyId());
+            newSubledeger.setUpdaterName(BaseContextHolder.getUserName());
+            newSubledeger.setUpdaterId(BaseContextHolder.getUserId());
+            newSubledeger.setUpdateTime(new Date());
+            subledgerMapper.updateByPrimaryKeySelective(newSubledeger);
+        }
     }
     /**
      * 反审核更新来源单据的已核销,未核销
@@ -324,17 +326,19 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
      */
     private void updateResAuditSubledeger(Long id , Double nowBalance){
         Subledger subledger = subledgerMapper.selectByPrimaryKey(Math.toIntExact(id));
-        Subledger newSubledeger = new Subledger();
-        newSubledeger.setId(Long.valueOf(String.valueOf(id)));
-        Double newNamout = subledger.getSl_namount()==null?new Double(0):subledger.getSl_namount()+nowBalance;
-        Double newYamout = subledger.getSl_yamount()==null?new Double(0):subledger.getSl_yamount()-nowBalance;
-        newSubledeger.setSl_yamount(newYamout);
-        newSubledeger.setSl_namount(newNamout);
-        newSubledeger.setCompanyId(BaseContextHolder.getCompanyId());
-        newSubledeger.setUpdaterName(BaseContextHolder.getUserName());
-        newSubledeger.setUpdaterId(BaseContextHolder.getUserId());
-        newSubledeger.setUpdateTime(new Date());
-        subledgerMapper.updateByPrimaryKeySelective(newSubledeger);
+        if(subledger != null) {
+            Subledger newSubledeger = new Subledger();
+            newSubledeger.setId(Long.valueOf(String.valueOf(id)));
+            Double newNamout = subledger.getSl_namount() == null ? new Double(0) : subledger.getSl_namount() + nowBalance;
+            Double newYamout = subledger.getSl_yamount() == null ? new Double(0) : subledger.getSl_yamount() - nowBalance;
+            newSubledeger.setSl_yamount(newYamout);
+            newSubledeger.setSl_namount(newNamout);
+            newSubledeger.setCompanyId(BaseContextHolder.getCompanyId());
+            newSubledeger.setUpdaterName(BaseContextHolder.getUserName());
+            newSubledeger.setUpdaterId(BaseContextHolder.getUserId());
+            newSubledeger.setUpdateTime(new Date());
+            subledgerMapper.updateByPrimaryKeySelective(newSubledeger);
+        }
     }
     /**
      * 转换核销单类型

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

@@ -13,7 +13,7 @@ spring:
     username: saas
     password: select123***
   datasource:
-    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
     username: saas
     password: select111***
   redis:

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

@@ -443,9 +443,9 @@
     where bk_bankcode = #{bankcode,jdbcType=VARCHAR}
   </update>
 
-    <select id="selectThisamount" resultType="java.lang.Double" parameterType="java.lang.String">
+    <select id="selectThisamount" resultType="java.lang.Double">
    select bk_thisamount from bankinformation
-    where bk_bankcode = #{bankcode,jdbcType=VARCHAR}
+    where bk_bankcode = #{bankcode,jdbcType=VARCHAR} and companyId = #{companyId}
   </select>
 
 </mapper>

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

@@ -39,9 +39,9 @@
                 #{si_yearmonth,jdbcType=INTEGER},
             </if>
             <if test="si_amount_pay != null" >
-                select sum(pd_amount) from paybalancedet left join paybalance on pd_pbid=pb_id
+                (select sum(pd_amount) from paybalancedet left join paybalance on pd_pbid=pb_id
                 where paybalance.companyId= #{companyid,jdbcType=INTEGER}
-                and pd_ym=#{si_yearmonth,jdbcType=INTEGER} and pb_statuscode='AUDITED',
+                and pd_ym=#{si_yearmonth,jdbcType=INTEGER} and pb_statuscode='AUDITED'),
             </if>
             <if test="si_amount_otherpay != null" >
                 (select sum(os_amount) from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_osid

+ 4 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDTO.java

@@ -69,4 +69,8 @@ public class PurchaseDTO extends CommonBaseDTO implements Serializable{
 
     private Date pu_auditdate;
 
+    private Long pu_said;
+
+    private String pu_sacode;
+
 }

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

@@ -210,6 +210,9 @@ public class ProdInOutController {
         return prodInOutService.turnProdOut(id);
     }
 
-
-
+    @GetMapping("/homepageList")
+    public Result homepageList(PageRequest page, ListReqDTO req){
+        PageInfo pageInfo = prodInOutService.homepageList(page, req);
+         return Result.success(pageInfo);
+    }
 }

+ 1 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutListMapper.java

@@ -16,4 +16,5 @@ public interface ProdInOutListMapper {
     List<ProdInOutList> selectProdInOutBycondition(@Param("con") String con,@Param("companyId") Long companyId);
 
 
+    List<ProdInOutList> selectHomePageList(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java

@@ -38,4 +38,8 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
     Integer validateProduct(@Param("id") Long id);
 
     void updateDelivery(@Param("id")Long id);
+
+    Integer checkPurchaseRequiredField(Long id);
+
+
 }

+ 175 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdHomePageList.java

@@ -0,0 +1,175 @@
+package com.usoftchina.saas.purchase.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2018-12-03 15:40
+ **/
+@Data
+public class ProdHomePageList extends CommonBaseEntity {
+    private String pi_inoutno;
+
+    private String pi_class;
+
+    private Date pi_date;
+
+    private Integer pi_vendid;
+
+    private String pi_vendcode;
+
+    private String pi_vendname;
+
+    private Integer pi_custid;
+
+    private String pi_custcode;
+
+    private String pi_custname;
+
+    private Integer pi_puid;
+
+    private String pi_pucode;
+
+    private Integer pi_said;
+
+    private String pi_sacode;
+
+    private Double pi_total;
+
+    private String pi_status;
+
+    private String pi_statuscode;
+
+    private String pi_printstatus;
+
+    private String pi_printstatuscode;
+
+    private String pi_text1;
+
+    private String pi_text2;
+
+    private String pi_text3;
+
+    private String pi_text4;
+
+    private String pi_text5;
+
+    private String pi_address;
+
+    private Date pi_auditdate;
+
+    private String pi_auditman;
+
+    private String pi_remark;
+
+    private Long pd_piid;
+
+    private String pd_inoutno;
+
+    private String pd_piclass;
+
+    private Integer pd_pdno;
+
+    private String pd_ordercode;
+
+    private Integer pd_orderdetno;
+
+    private Integer pd_prodid;
+
+    private String pd_prodcode;
+
+    private String pd_unit;
+
+    private Double pd_inqty;
+
+    private Double pd_outqty;
+
+    private Double pd_orderprice;
+
+    private Double pd_sendprice;
+
+    private Double pd_price;
+
+    private Double pd_total;
+
+    private Double pd_taxrate;
+
+    private Double pd_netprice;
+
+    private Double pd_nettotal;
+
+    private Integer pd_whid;
+
+    private String pd_whcode;
+
+    private String pd_whname;
+
+    private Integer pd_inwhid;
+
+    private String pd_inwhcode;
+
+    private String pd_inwhname;
+
+    private Integer pd_orderid;
+
+    private Integer pd_sdid;
+
+    private Integer pd_status;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Integer pd_ym;
+
+    private Double pd_yqty;
+
+    private String pd_remark;
+
+    private Long pd_ioid;
+
+    private String pi_iocode;
+
+    private String pi_prstatus;
+
+    private String pi_prstatuscode;
+
+    //数量字段一致
+    private Double qty;
+
+    //private ProductDTO productDTO;
+    private Long pr_id;
+    private String pr_code;
+    private String pr_detail;
+    private String pr_spec;
+    private String pr_unit;
+    private String pr_kind;
+    private String pr_orispeccode;
+    private long pr_whid;
+    private String pr_whcode;
+    private String pr_whname;
+    private long pr_zxbzs;
+    private long pr_leadtime;
+    private String pr_brand;
+    private String pr_standardprice;
+    private String pr_purcprice;
+    private String pr_saleprice;
+    private long pr_vendid;
+    private String pr_vendname;
+    private String pr_vendcode;
+    private String pr_status;
+    private String pr_statuscode;
+    private String pr_text1;
+    private String pr_text2;
+    private String pr_text3;
+    private String pr_text4;
+}

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/Purchase.java

@@ -63,4 +63,8 @@ public class Purchase extends CommonBaseEntity implements Serializable {
 
     private Date pu_auditdate;
 
+    private Long pu_said;
+
+    private String pu_sacode;
+
 }

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java

@@ -71,6 +71,10 @@ public class PurchaseList extends CommonBaseEntity implements Serializable {
 
     private String pu_auditman;
 
+    private Long pu_said;
+
+    private String pu_sacode;
+
     //从表字段
     private Long pd_id;
 

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java

@@ -83,4 +83,6 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
     String getMaxnumber(BillCodeSeq bill);
 
     void getDefaultWarehouseByProduct(Long pi_id);
+
+    PageInfo homepageList(PageRequest page, ListReqDTO req);
 }

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

@@ -18,6 +18,7 @@ import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.WarehouseApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.ProdIODetailDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutDTO;
@@ -60,6 +61,20 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     @Autowired
     private CommonService commonService;
 
+    @Override
+    public PageInfo homepageList(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<ProdInOutList> lists = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        lists = prodInOutListMapper.selectHomePageList(con,companyId);
+        //取分页信息
+        PageInfo<ProdInOutList> pageInfo = new PageInfo<ProdInOutList>(lists);
+        return pageInfo;
+    }
 
     @Override
     public PageInfo<ProdInOutList> getListData(PageRequest page, ListReqDTO req) {
@@ -133,7 +148,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         String pi_inoutno = main.getPi_inoutno();
         String pi_class = main.getPi_class();
         ProdInOut prodInOut = BeanMapper.map(main,ProdInOut.class);
-
         //编号获取
         DocBaseDTO baseDTO = new DocBaseDTO();
         baseDTO.setCode(pi_inoutno);
@@ -141,17 +155,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         baseDTO.setName(pi_class);
         pi_inoutno = pushMaxnubmer(baseDTO);
         prodInOut.setPi_inoutno(pi_inoutno);
-
-
-        if ("采购验收单".equals(pi_class)){
-            prodInOut.setPi_prstatus(Status.PAYNONE.getDisplay());
-            prodInOut.setPi_prstatuscode(Status.PAYNONE.name());
-        }else if ("采购验退单".equals(pi_class)){
-            prodInOut.setPi_prstatus(Status.RECNONE.getDisplay());
-            prodInOut.setPi_prstatuscode(Status.RECNONE.name());
-        }
-
-
+        prodInOut.setPi_prstatus(Status.PAYNONE.getDisplay());
+        prodInOut.setPi_prstatuscode(Status.PAYNONE.name());
         //判断更新与保存动作
         if (StringUtils.isEmpty(pi_id) || "0".equals(pi_id.toString())){
             prodInOut.setCompanyId(companyId);
@@ -603,6 +608,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
 
+
+
     private ProdInOut checkAndReturnOrder (Long id){
         if(id == null || id <= 0) {
             throw new BizException(BizExceptionCode.ILLEGAL_ID);

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

@@ -404,7 +404,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         double pdQty=0, pdYqty=0;
         //检查转单状态
         String acceptstatus = purchase.getPu_acceptstatuscode();
-
         if (Status.CLOSE.name().equals(acceptstatus)){
             return Result.error(ExceptionCode.CLOSED_EXIST);
         }
@@ -499,12 +498,18 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     public Result singleAudit(Long id) {
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         Result result = Result.success(docBaseDTO);
+
         //检查供应商是否开启状态
         Integer count =0;
         count = purchaseMapper.validateVendor(id);
         if (count != 0) {
             throw new BizException(BizExceptionCode.VENDOR_ISCLOSE);
         }
+        //检验必填项
+        count = getMapper().checkPurchaseRequiredField(id);
+        if (count>0){
+            throw new BizException(BizExceptionCode.REQUIREDFIELD_NULL);
+        }
         //检查物料是否开启状态
         count = purchaseMapper.validateProduct(id);
         if (count != 0) {
@@ -530,12 +535,19 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
 
     @Transactional
     public void singleUnAudit(Long id) {
-        Purchase purchase = new Purchase();
+        //校验关闭状态
+        Purchase purchase = getMapper().selectByPrimaryKey(id);
+        //检查转单状态
+        String acceptstatus = purchase.getPu_acceptstatuscode();
+        if (Status.CLOSE.name().equals(acceptstatus)){
+            throw new  BizException(ExceptionCode.CLOSED_EXIST);
+        }
         //检查是否已转验收单
         Integer num = getMapper().checkTurnInstatus(id);
         if (num > 0) {
             throw new BizException(BizExceptionCode.PURCHASE_UNAUDIT_ERROR);
         }
+        purchase = new Purchase();
         //生成更新对象
         purchase.setId(id);
         purchase.setPu_status(Status.UNAUDITED.getDisplay());
@@ -543,6 +555,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //setUpdateInfo(purchase);
         //更新存在字段
         purchaseMapper.updateByPrimaryKeySelective(purchase);
+        commonService.commonResAudit("purchase", "pu_id=" + id, "pu_status",
+                "pu_statuscode", "pu_auditdate", "pu_auditman");
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
         messageLogService.unAudit(docBaseDTO);

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

@@ -13,7 +13,7 @@ spring:
     username: saas
     password: select123***
   datasource:
-    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
     username: saas
     password: select111***
 logging:

+ 117 - 4
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -101,6 +101,107 @@
     <result column="pr_text4" property="pr_text4"/>
   </resultMap>
 
+  <resultMap id="homePageList" type="com.usoftchina.saas.purchase.po.ProdHomePageList">
+    <id column="pi_id" jdbcType="INTEGER" property="id" />
+    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
+    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
+    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
+    <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
+    <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
+    <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
+    <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
+    <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
+    <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
+    <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
+    <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
+    <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
+    <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
+    <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
+    <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
+    <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
+    <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
+    <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
+    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
+    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
+    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
+    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
+    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+    <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
+    <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
+    <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
+    <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
+    <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
+    <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
+    <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
+    <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
+    <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
+    <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
+    <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
+    <result column="pd_inqty" jdbcType="DOUBLE" property="pd_inqty" />
+    <result column="pd_outqty" jdbcType="DOUBLE" property="pd_outqty" />
+    <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
+    <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
+    <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
+    <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
+    <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
+    <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
+    <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
+    <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
+    <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
+    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
+    <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
+    <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
+    <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
+    <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
+    <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
+    <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
+    <result column="companyid" property="companyId" jdbcType="BIGINT" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updaterName" jdbcType="VARCHAR" property="updaterName" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER"/>
+    <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
+    <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
+    <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
+    <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
+    <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
+    <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
+    <result column="pd_yqty" jdbcType="DOUBLE" property="pd_yqty" />
+    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
+    <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
+    <result column="pr_id" property="pr_id"/>
+    <result column="pr_code" property="pr_code"/>
+    <result column="pr_detail" property="pr_detail"/>
+    <result column="pr_spec" property="pr_spec"/>
+    <result column="pr_unit" property="pr_unit"/>
+    <result column="pr_kind" property="pr_kind"/>
+    <result column="pr_orispeccode" property="pr_orispeccode"/>
+    <result column="pr_whid" property="pr_whid"/>
+    <result column="pr_whcode" property="pr_whcode"/>
+    <result column="pr_whname" property="pr_whname"/>
+    <result column="pr_zxbzs" property="pr_zxbzs"/>
+    <result column="pr_leadtime" property="pr_leadtime"/>
+    <result column="pr_brand" property="pr_brand"/>
+    <result column="pr_standardprice" property="pr_standardprice"/>
+    <result column="pr_purcprice" property="pr_purcprice"/>
+    <result column="pr_saleprice" property="pr_saleprice"/>
+    <result column="pr_vendid" property="pr_vendid"/>
+    <result column="pr_vendname" property="pr_vendname"/>
+    <result column="pr_vendcode" property="pr_vendcode"/>
+    <result column="pr_status" property="pr_status"/>
+    <result column="pr_statuscode" property="pr_statuscode"/>
+    <result column="pr_text1" property="pr_text1"/>
+    <result column="pr_text2" property="pr_text2"/>
+    <result column="pr_text3" property="pr_text3"/>
+    <result column="pr_text4" property="pr_text4"/>
+    <result column="qty" property="qty"/>
+  </resultMap>
+
   <select id="selectProdInOutBycondition"  resultMap="BaseResultMap">
     select  *  from prodinout
     <where>
@@ -113,6 +214,22 @@
     </where>  order by pi_id desc
   </select>
 
+  <select id="selectHomePageList" resultMap="homePageList">
+    select  *,
+    case WHEN pi_class='采购验收单' then pd_inqty when pi_class='采购验退单' then pd_outqty else 0 end qty
+    from prodinout left join prodiodetail on pi_id = pd_piid left join vendor on pi_vendid=ve_id
+    left join product on pd_prodid=pr_id
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  prodinout.companyid = #{companyId}
+      </if>
+    </where>
+    order by pi_id desc,pd_pdno desc
+  </select>
+
   <select id="selectProdInOutListByCondition"  resultMap="BaseResultMap">
     select  *  from prodinout left join prodiodetail on pi_id = pd_piid left join vendor on pi_vendid=ve_id
     left join product on pd_prodid=pr_id
@@ -126,8 +243,4 @@
     </where>
     order by pi_id desc,pd_pdno desc
   </select>
-
-
-
-
 </mapper>

+ 1 - 1
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -415,7 +415,7 @@
     select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and companyid = #{companyId}
   </select>
   <select id="validateCodeWhenUpdate" resultType="int" >
-    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid != #{companyId}
+    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid = #{companyId}
   </select>
 
   <select id="selectCodeById" resultType="string" parameterType="long">

+ 2 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml

@@ -34,6 +34,8 @@
         <result column="pu_text3" property="pu_text3" jdbcType="VARCHAR" />
         <result column="pu_text4" property="pu_text4" jdbcType="VARCHAR" />
         <result column="pu_text5" property="pu_text5" jdbcType="VARCHAR" />
+        <result column="pu_said" property="pu_said" jdbcType="INTEGER" />
+        <result column="pu_sacode" property="pu_sacode" jdbcType="VARCHAR" />
         <result column="PD_ID" property="pd_id" jdbcType="INTEGER" />
         <result column="PD_PUID" property="pd_puid" jdbcType="INTEGER" />
         <result column="PD_CODE" property="pd_code" jdbcType="VARCHAR" />

+ 3 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -443,5 +443,8 @@
     update purchasedetail set PD_DELIVERY = (select PU_DELIVERY from purchase where pu_id=#{id}) where pd_puid=#{id} and PD_DELIVERY is null
   </update>
 
+  <select id="checkPurchaseRequiredField" resultType="int" parameterType="long">
+    select count(1) from purchase where pu_id = #{id} and (pu_vendid is null or pu_delivery is null or pu_shipaddresscode is null)
+  </select>
 
 </mapper>

+ 3 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseDTO.java

@@ -63,4 +63,7 @@ public class PurchaseDTO extends CommonBaseEntity implements Serializable {
 
     private Date pu_auditdate;
 
+    private Long pu_said;
+
+    private String pu_sacode;
 }

+ 4 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/PurchaseListDTO.java

@@ -71,6 +71,10 @@ public class PurchaseListDTO extends CommonBaseEntity implements Serializable {
 
     private String pu_auditman;
 
+    private Long pu_said;
+
+    private String pu_sacode;
+
     //从表字段
     private Long pd_id;
 

+ 7 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java

@@ -39,6 +39,13 @@ public class ProdInOutController {
         return Result.success(listData);
     }
 
+    @GetMapping("/homepageList")
+    public Result homepageList(PageRequest page, ListReqDTO req){
+        PageInfo pageInfo = prodInOutService.homepageList(page, req);
+        return Result.success(pageInfo);
+    }
+
+
     /**
      * 获取出入库单表单
      *

+ 1 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutListMapper.java

@@ -16,5 +16,5 @@ public interface ProdInOutListMapper {
 
     List<ProdInOutList> selectProdInOutBycondition(@Param("con") String con, @Param("companyId") Long companyId);
 
-
+    List<ProdInOutList> selectHomePageList(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 175 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/ProdHomePageList.java

@@ -0,0 +1,175 @@
+package com.usoftchina.saas.sale.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2018-12-03 15:40
+ **/
+@Data
+public class ProdHomePageList extends CommonBaseEntity {
+    private String pi_inoutno;
+
+    private String pi_class;
+
+    private Date pi_date;
+
+    private Integer pi_vendid;
+
+    private String pi_vendcode;
+
+    private String pi_vendname;
+
+    private Integer pi_custid;
+
+    private String pi_custcode;
+
+    private String pi_custname;
+
+    private Integer pi_puid;
+
+    private String pi_pucode;
+
+    private Integer pi_said;
+
+    private String pi_sacode;
+
+    private Double pi_total;
+
+    private String pi_status;
+
+    private String pi_statuscode;
+
+    private String pi_printstatus;
+
+    private String pi_printstatuscode;
+
+    private String pi_text1;
+
+    private String pi_text2;
+
+    private String pi_text3;
+
+    private String pi_text4;
+
+    private String pi_text5;
+
+    private String pi_address;
+
+    private Date pi_auditdate;
+
+    private String pi_auditman;
+
+    private String pi_remark;
+
+    private Long pd_piid;
+
+    private String pd_inoutno;
+
+    private String pd_piclass;
+
+    private Integer pd_pdno;
+
+    private String pd_ordercode;
+
+    private Integer pd_orderdetno;
+
+    private Integer pd_prodid;
+
+    private String pd_prodcode;
+
+    private String pd_unit;
+
+    private Double pd_inqty;
+
+    private Double pd_outqty;
+
+    private Double pd_orderprice;
+
+    private Double pd_sendprice;
+
+    private Double pd_price;
+
+    private Double pd_total;
+
+    private Double pd_taxrate;
+
+    private Double pd_netprice;
+
+    private Double pd_nettotal;
+
+    private Integer pd_whid;
+
+    private String pd_whcode;
+
+    private String pd_whname;
+
+    private Integer pd_inwhid;
+
+    private String pd_inwhcode;
+
+    private String pd_inwhname;
+
+    private Integer pd_orderid;
+
+    private Integer pd_sdid;
+
+    private Integer pd_status;
+
+    private String pd_text1;
+
+    private String pd_text2;
+
+    private String pd_text3;
+
+    private String pd_text4;
+
+    private String pd_text5;
+
+    private Integer pd_ym;
+
+    private Double pd_yqty;
+
+    private String pd_remark;
+
+    private Long pd_ioid;
+
+    private String pi_iocode;
+
+    private String pi_prstatus;
+
+    private String pi_prstatuscode;
+
+    //数量字段一致
+    private Double qty;
+
+    //private ProductDTO productDTO;
+    private Long pr_id;
+    private String pr_code;
+    private String pr_detail;
+    private String pr_spec;
+    private String pr_unit;
+    private String pr_kind;
+    private String pr_orispeccode;
+    private long pr_whid;
+    private String pr_whcode;
+    private String pr_whname;
+    private long pr_zxbzs;
+    private long pr_leadtime;
+    private String pr_brand;
+    private String pr_standardprice;
+    private String pr_purcprice;
+    private String pr_saleprice;
+    private long pr_vendid;
+    private String pr_vendname;
+    private String pr_vendcode;
+    private String pr_status;
+    private String pr_statuscode;
+    private String pr_text1;
+    private String pr_text2;
+    private String pr_text3;
+    private String pr_text4;
+}

+ 2 - 3
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java

@@ -1,17 +1,14 @@
 package com.usoftchina.saas.sale.service;
 
 import com.github.pagehelper.PageInfo;
-import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.page.PageRequest;
 
 import com.usoftchina.saas.sale.dto.ProdInOutFormDTO;
-import com.usoftchina.saas.sale.dto.ProdInOutReqDTO;
 import com.usoftchina.saas.sale.mapper.ProdInOutMapper;
 import com.usoftchina.saas.storage.po.ProdInOut;
 import com.usoftchina.saas.storage.po.ProdInOutList;
@@ -122,4 +119,6 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
     DocBaseDTO turnProdin(Long id);
 
     String getMaxnumber(BillCodeSeq bill);
+
+    PageInfo homepageList(PageRequest page, ListReqDTO req);
 }

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

@@ -362,6 +362,21 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         return pageInfo;
     }
 
+    @Override
+    public PageInfo homepageList(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<ProdInOutList> lists = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        lists = prodInOutListMapper.selectHomePageList(con,companyId);
+        //取分页信息
+        PageInfo<ProdInOutList> pageInfo = new PageInfo<ProdInOutList>(lists);
+        return pageInfo;
+    }
+
     private List<ProdInOutList> getListByMode(ListReqDTO req) {
         List<ProdInOutList> list = null;
         Long companyId = BaseContextHolder.getCompanyId();

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

@@ -2,8 +2,6 @@ package com.usoftchina.saas.sale.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.usoftchina.saas.base.Result;
-import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.CommonService;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MessageLogService;
@@ -15,7 +13,6 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
@@ -30,7 +27,6 @@ import com.usoftchina.saas.sale.service.SaleService;
 import com.usoftchina.saas.storage.po.ProdIODetail;
 import com.usoftchina.saas.storage.po.ProdInOut;
 import com.usoftchina.saas.utils.BeanMapper;
-import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -319,6 +315,8 @@ public class SaleServiceImpl implements SaleService{
         sale.setUpdaterId(BaseContextHolder.getUserId());
         //更新存在字段
         saleMapper.updateByPrimaryKeySelective(sale);
+        commonService.commonResAudit("sale", "sa_id=" + id, "sa_status",
+                "sa_statuscode", "sa_auditdate", "sa_auditman");
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
         messageLogService.unAudit(docBaseDTO);
@@ -512,6 +510,8 @@ public class SaleServiceImpl implements SaleService{
         saleMapper.updateByPrimaryKeySelective(sale);
         prodIODetailMapper.updatePDSaleOut(pi_id);
         prodInOutMapper.updatePiTotal(pi_id);
+        //更新创建人
+        prodInOutMapper.updateCreator(BaseContextHolder.getUserId(), BaseContextHolder.getUserName(), pi_id);
         //日志记录
         DocBaseDTO log = new DocBaseDTO(id, sale.getSa_code(), BillCodeSeq.SALEOUT.getCaller());
         messageLogService.customizeLog(log, Operation.TURNPRODOUT);
@@ -552,6 +552,11 @@ public class SaleServiceImpl implements SaleService{
     @Override
     public DocBaseDTO saleTurnPurchase(Long id) {
         Sale sale = saleMapper.selectByPrimaryKey(id);
+
+        //检查销售订单是否关闭
+        if(sale.getSa_sendstatuscode().equals("CLOSE")){
+            throw new BizException(BizExceptionCode.SALE_CLOSE.getCode(),BizExceptionCode.SALE_CLOSE.getMessage());
+        }
         List<SaleList> dateilList = saleListMapper.selectSaleListByCondition("sa_id="+id,BaseContextHolder.getCompanyId());
 
         //判断是否已转采购单
@@ -572,12 +577,14 @@ public class SaleServiceImpl implements SaleService{
         purchase.setPu_code(result);
         purchase.setPu_status(Status.UNAUDITED.getDisplay());
         purchase.setPu_statuscode(Status.UNAUDITED.toString());
+        purchase.setPu_date(new Date());
+        purchase.setPu_said(sale.getId());
+        purchase.setPu_sacode(sale.getSa_code());
         purchase.setCompanyId(BaseContextHolder.getCompanyId());
         purchase.setCreatorId(BaseContextHolder.getUserId());
         purchase.setCreateTime(new Date());
         purchase.setCreatorName(BaseContextHolder.getUserName());
         saleMapper.turnPurchase(purchase);
-
         Long purchaseId = purchase.getId();
         for (SaleList detail : dateilList){
             PurchaseDetailDTO purchaseDetail = new PurchaseDetailDTO();

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

@@ -13,7 +13,7 @@ spring:
     username: saas
     password: select123***
   datasource:
-    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
     username: saas
     password: select111***
 logging:

+ 117 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -74,6 +74,107 @@
     <result column="pd_ordertotal" jdbcType="DOUBLE" property="pd_ordertotal" />
   </resultMap>
 
+  <resultMap id="homePageList" type="com.usoftchina.saas.sale.po.ProdHomePageList">
+    <id column="pi_id" jdbcType="INTEGER" property="id" />
+    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
+    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
+    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
+    <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
+    <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
+    <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
+    <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
+    <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
+    <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
+    <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
+    <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
+    <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
+    <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
+    <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
+    <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
+    <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
+    <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
+    <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
+    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
+    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
+    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
+    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
+    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+    <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
+    <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
+    <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
+    <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
+    <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
+    <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
+    <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
+    <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
+    <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
+    <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
+    <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
+    <result column="pd_inqty" jdbcType="DOUBLE" property="pd_inqty" />
+    <result column="pd_outqty" jdbcType="DOUBLE" property="pd_outqty" />
+    <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
+    <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
+    <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
+    <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
+    <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
+    <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
+    <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
+    <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
+    <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
+    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
+    <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
+    <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
+    <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
+    <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
+    <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
+    <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
+    <result column="companyid" property="companyId" jdbcType="BIGINT" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updaterName" jdbcType="VARCHAR" property="updaterName" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER"/>
+    <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
+    <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
+    <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
+    <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
+    <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
+    <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
+    <result column="pd_yqty" jdbcType="DOUBLE" property="pd_yqty" />
+    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
+    <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
+    <result column="pr_id" property="pr_id"/>
+    <result column="pr_code" property="pr_code"/>
+    <result column="pr_detail" property="pr_detail"/>
+    <result column="pr_spec" property="pr_spec"/>
+    <result column="pr_unit" property="pr_unit"/>
+    <result column="pr_kind" property="pr_kind"/>
+    <result column="pr_orispeccode" property="pr_orispeccode"/>
+    <result column="pr_whid" property="pr_whid"/>
+    <result column="pr_whcode" property="pr_whcode"/>
+    <result column="pr_whname" property="pr_whname"/>
+    <result column="pr_zxbzs" property="pr_zxbzs"/>
+    <result column="pr_leadtime" property="pr_leadtime"/>
+    <result column="pr_brand" property="pr_brand"/>
+    <result column="pr_standardprice" property="pr_standardprice"/>
+    <result column="pr_purcprice" property="pr_purcprice"/>
+    <result column="pr_saleprice" property="pr_saleprice"/>
+    <result column="pr_vendid" property="pr_vendid"/>
+    <result column="pr_vendname" property="pr_vendname"/>
+    <result column="pr_vendcode" property="pr_vendcode"/>
+    <result column="pr_status" property="pr_status"/>
+    <result column="pr_statuscode" property="pr_statuscode"/>
+    <result column="pr_text1" property="pr_text1"/>
+    <result column="pr_text2" property="pr_text2"/>
+    <result column="pr_text3" property="pr_text3"/>
+    <result column="pr_text4" property="pr_text4"/>
+    <result column="qty" property="qty"/>
+  </resultMap>
+
 
   <select id="selectProdInOutListByCondition" resultMap="BaseResultMap">
     select  *  from prodinout
@@ -101,4 +202,20 @@
       order by pi_id desc
   </select>
 
+  <select id="selectHomePageList" resultMap="homePageList">
+    select  *,
+    case WHEN pi_class='出货单' then pd_outqty when pi_class='销售退货单' then pd_inqty else 0 end qty
+    from prodinout left join prodiodetail on pi_id = pd_piid left join product on pr_id = pd_prodid
+    left join customer on pi_custid=cu_id
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  prodinout.companyId = #{companyId}
+      </if>
+    </where>
+    order by pi_id desc
+  </select>
+
 </mapper>

+ 13 - 1
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -402,7 +402,7 @@
     and purchasedetail.companyid= #{companyid}
   </select>
   <select id="checkCustomer" parameterType="long" resultType="integer">
-    select count(1) from sale left join  customer on sa_custid=cu_id  where  cu_statuscode='CLOSE' and cu_statuscode='CLOSE'
+    select count(1) from sale left join  customer on sa_custid=cu_id  where  cu_statuscode='CLOSE' and sa_id=#{id}
   </select>
   
   <!-- 销售订单转采购单-->
@@ -508,6 +508,12 @@
       <if test="pu_shipaddresscode != null" >
         PU_SHIPADDRESSCODE,
       </if>
+      <if test="pu_said != null" >
+        pu_said,
+      </if>
+      <if test="pu_sacode != null" >
+        pu_sacode,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="pu_code != null" >
@@ -606,6 +612,12 @@
       <if test="pu_shipaddresscode != null" >
         #{pu_shipaddresscode,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pu_said != null" >
+        #{pu_said,jdbcType=INTEGER},
+      </if>
+      <if test="pu_sacode != null" >
+        #{pu_sacode,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
 

+ 2 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java

@@ -128,6 +128,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
                 prodInDetail.setCompanyId(companyId);
                 prodInDetail.setCreateTime(new Date());
                 prodInDetail.setCreatorId(userId);
+                prodInDetail.setPd_remark("盘盈单");
                 prodIODetailMapper.insertSelective(prodInDetail);
             }
             DocBaseDTO baseDTOIN = new DocBaseDTO(inid,piInno,"其它入库单");
@@ -167,6 +168,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
                 prodOutDetail.setCompanyId(companyId);
                 prodOutDetail.setCreateTime(new Date());
                 prodOutDetail.setCreatorId(userId);
+                prodOutDetail.setPd_remark("盘亏单");
                 prodIODetailMapper.insertSelective(prodOutDetail);
             }
             DocBaseDTO baseDTOOUT = new DocBaseDTO(outid,piOutno,"其它出库单");

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

@@ -13,7 +13,7 @@ spring:
     username: saas
     password: select123***
   datasource:
-    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false
+    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
     username: saas
     password: select111***
 logging:

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -403,7 +403,7 @@
     select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and companyid = #{companyId}
   </select>
   <select id="validateCodeWhenUpdate" resultType="int" >
-    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid != #{companyId}
+    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid = #{companyId}
   </select>
 
   <select id="selectCodeById" resultType="string" parameterType="long">

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml

@@ -266,7 +266,7 @@
     count(a.st_prodid)
     from
     (select pd_prodid,pd_whid from prodiodetail left join prodinout on pd_piid = pi_id
-    where prodinout.companyId=#{companyId,jdbcType=INTEGER} and (pi_remark='盘盈单' or pi_remark='盘亏单')) b
+    where prodinout.companyId=#{companyId,jdbcType=INTEGER} and pi_statuscode!='AUDITED' and (pi_remark='盘盈单' or pi_remark='盘亏单')) b
     left join
     (select st_prodid,st_whid from stocktaking where companyId=#{companyId} ) a
     on a.st_prodid = b.pd_prodid and a.st_whid = b.pd_whid

+ 4 - 4
base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/api/CompanyApi.java

@@ -39,7 +39,7 @@ public interface CompanyApi {
      * @return
      */
     @GetMapping(path = "/company/read", params = "name")
-    Result<CompanyDTO> getCompanyByName(@RequestParam String name);
+    Result<CompanyDTO> getCompanyByName(@RequestParam("name") String name);
 
     /**
      * 按商业登记证号查找
@@ -48,7 +48,7 @@ public interface CompanyApi {
      * @return
      */
     @GetMapping(path = "/company/read", params = "businessCode")
-    Result<CompanyDTO> getCompanyByBusinessCode(@RequestParam String businessCode);
+    Result<CompanyDTO> getCompanyByBusinessCode(@RequestParam("businessCode") String businessCode);
 
     /**
      * 按企业uu查找
@@ -57,7 +57,7 @@ public interface CompanyApi {
      * @return
      */
     @GetMapping(path = "/company/read", params = "uu")
-    Result<CompanyDTO> getCompanyByUu(@RequestParam Long uu);
+    Result<CompanyDTO> getCompanyByUu(@RequestParam("uu") Long uu);
 
     /**
      * 按ID查找
@@ -66,5 +66,5 @@ public interface CompanyApi {
      * @return
      */
     @GetMapping(path = "/company/read/{id}")
-    Result<CompanyDTO> getCompanyById(@PathVariable Long id);
+    Result<CompanyDTO> getCompanyById(@PathVariable("id") Long id);
 }

+ 12 - 1
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyRspDTO.java

@@ -45,6 +45,16 @@ public class CompanyRspDTO implements Serializable {
 
     private String adminEmail;
 
+    private String adminMobile;
+
+    public String getAdminMobile() {
+        return adminMobile;
+    }
+
+    public void setAdminMobile(String adminMobile) {
+        this.adminMobile = adminMobile;
+    }
+
     public String getAdminEmail() {
         return adminEmail;
     }
@@ -149,7 +159,7 @@ public class CompanyRspDTO implements Serializable {
         this.default_ = default_;
     }
 
-    public CompanyRspDTO(String name, String businessCode, String address, boolean default_, boolean saas_, String uu, String admin, Long adminId, String type) {
+    public CompanyRspDTO(String name, String businessCode, String address, boolean default_, boolean saas_, String uu, String admin, Long adminId, String type, String adminMobile) {
         this.name = name;
         this.businessCode = businessCode;
         this.address = address;
@@ -159,6 +169,7 @@ public class CompanyRspDTO implements Serializable {
         this.admin = admin;
         this.adminId = adminId;
         this.type = type;
+        this.adminMobile = adminMobile;
     }
 
     public CompanyRspDTO() {

+ 2 - 1
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/AccountCenterServiceImpl.java

@@ -167,7 +167,8 @@ public class AccountCenterServiceImpl implements AccountCenterService {
                         ssoUserSpace.getSpaceUU()!=null ? ssoUserSpace.getSpaceUU().toString() : "0",
                         ssoUserSpace.getAdmin()!=null ? ssoUserSpace.getAdmin().getVipName() : null,
                         0L,
-                        ssoUserSpace.getProfession()
+                        ssoUserSpace.getProfession(),
+                        ssoUserSpace.getAdmin()!=null ? ssoUserSpace.getAdmin().getMobile() : null
                 );
                 resultList.add(companyRspDTO);
             }

+ 1 - 1
base-servers/account/account-server/src/main/resources/mapper/AccountCompanyMapper.xml

@@ -14,7 +14,7 @@
         delete from ac_account_company where company_id=#{companyId}
     </delete>
     <select id="getCompanyListByAccountMobile" resultType="com.usoftchina.saas.account.dto.CompanyRspDTO">
-        SELECT cmp.id,cmp.name,cmp.uu,cmp.business_code businessCode,cmp.address,accmp.is_default default_,'1' saas_,aci.realname admin,cmp.creator_id adminId,cmp.type,ac.email adminEmail from ac_company cmp
+        SELECT cmp.id,cmp.name,cmp.uu,cmp.business_code businessCode,cmp.address,accmp.is_default default_,'1' saas_,aci.realname admin,cmp.creator_id adminId,cmp.type,ac.email adminEmail,ac.mobile adminMobile from ac_company cmp
         left join ac_account_company accmp on accmp.company_id=cmp.id
         left join ac_account ac on ac.id = accmp.account_id
         left join ac_account aci on aci.id = cmp.creator_id

+ 13 - 0
base-servers/auth/auth-dto/src/main/java/com/usoftchina/saas/auth/dto/AuthDTO.java

@@ -11,6 +11,19 @@ import java.io.Serializable;
 public class AuthDTO implements Serializable{
     private TokenDTO token;
     private AccountDTO account;
+    /**
+     * 用户登录优软云后,直接地址栏上进入saas系统.
+     * 通过cookie中的企业UU判断saas是否已开通,开通则返回companyId给前端直接登录该企业
+     */
+    private Long companyId;
+
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
 
     public AuthDTO() {
     }

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

@@ -2,14 +2,11 @@ package com.usoftchina.saas.auth.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.account.api.AccountApi;
+import com.usoftchina.saas.account.api.CompanyApi;
 import com.usoftchina.saas.account.constant.AccountType;
-import com.usoftchina.saas.account.dto.AccountCopyDTO;
-import com.usoftchina.saas.account.dto.AccountDTO;
-import com.usoftchina.saas.account.dto.AccountUpdateDTO;
-import com.usoftchina.saas.account.dto.CompanyBaseDTO;
+import com.usoftchina.saas.account.dto.*;
 import com.usoftchina.saas.auth.common.cookie.CookieHelper;
 import com.usoftchina.saas.auth.common.cookie.CookieInfo;
-import com.usoftchina.saas.auth.common.cookie.CookieUtils;
 import com.usoftchina.saas.auth.common.jwt.JwtHelper;
 import com.usoftchina.saas.auth.common.jwt.JwtInfo;
 import com.usoftchina.saas.auth.common.jwt.JwtToken;
@@ -34,8 +31,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.http.server.reactive.ServerHttpRequest;
-import org.springframework.http.server.reactive.ServerHttpResponse;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
@@ -57,6 +52,9 @@ public class AuthController {
     @Autowired
     private AccountApi accountApi;
 
+    @Autowired
+    private CompanyApi companyApi;
+
     @Value("${auth.public-key}")
     private String publicKeyPath;
 
@@ -66,7 +64,7 @@ public class AuthController {
     @Value("${auth.header:Authorization}")
     private String authHeader;
 
-    @Value("${auth.expire:18000}")
+    @Value("${auth.expire:1800000}")
     private int expire;
 
     @Value("${auth.max-errors:5}")
@@ -203,7 +201,12 @@ public class AuthController {
             JwtInfo jwtInfo = new JwtInfo(appId, companyId, accountDTO.getId(), accountDTO.getUsername(), accountDTO.getRealname());
             JwtToken jwtToken = JwtHelper.generateToken(jwtInfo, privateKeyPath, expire);
             TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
-            return Result.success(new AuthDTO(tokenDTO, accountDTO));
+            AuthDTO authDTO = new AuthDTO(tokenDTO, accountDTO);
+            CompanyDTO companyDTO = companyApi.getCompanyByUu(info.getSpaceUU()).getData();
+            if (null != companyDTO){
+                authDTO.setCompanyId(companyDTO.getId());
+            }
+            return Result.success(authDTO);
         }
         return Result.error(ExceptionCode.COOKIE_ILLEGAL_ARGUMENT);
     }

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

@@ -18,7 +18,6 @@ import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.gateway.error.PermissionException;
 import com.usoftchina.saas.gateway.util.AntPathRequestMatcher;
 import com.usoftchina.saas.utils.CollectionUtils;
-import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.cloud.gateway.filter.GatewayFilterChain;
@@ -93,20 +92,11 @@ public class AuthFilter implements GlobalFilter, Ordered {
     private void checkPermission(ServerHttpRequest request, JwtInfo jwt, AccountDTO accountDTO) {
         if (!accountDTO.isAdmin(jwt.getCompanyId())) {
             // 非管理账户,需要鉴权
-            ResourceCache.current().hdel();
             List<UrlResourceDTO> resources = ResourceCache.current().getUrlResources();
             if (!CollectionUtils.isEmpty(resources)) {
                 // 本次请求相关的资源
                 List<UrlResourceDTO> permissions = resources.parallelStream().filter(resource -> {
-                    if (StringUtils.isEmpty(resource.getUrl())) {
-                        return false;
-                    }
-                    //处理删除、查询时 url变动无法匹配的问题
-                    String url = resource.getUrl();
-                    if (url.substring(url.length() - 1).equals("/")) {
-                        url += "*";
-                    }
-                    AntPathRequestMatcher matcher = new AntPathRequestMatcher(url, resource.getMethod());
+                    AntPathRequestMatcher matcher = new AntPathRequestMatcher(resource.getUrl(), resource.getMethod());
                     return matcher.matches(request);
                 }).collect(Collectors.toList());
                 if (!CollectionUtils.isEmpty(permissions)) {

+ 2 - 0
base-servers/gateway-server/src/main/resources/application.yml

@@ -185,6 +185,8 @@ auth:
     - /api/auth/info
     - /ws/**
     - /api/file/download
+    - /api/commons/excel/import/templet
+    - /api/account/resource/url/list
   cookie:
     name: uid
     secret-key: 0taQcW073Z7G628g5H

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

@@ -63,7 +63,7 @@
                     <ul>
                         <li style="margin:0">
                             <span class="qy-biaoti"><span class="xingxing">*</span>姓名</span>
-                            <input class="inpind" @change= "yzusername" ref="name" type="text">
+                            <input class="inpind" @change= "yzusername" ref="name" type="text" value="">
                             <div class="qy-Tips Tips-buttom"><span ref="usname" style="color:red"></span></div>
                         </li>
                         <li><span class="qy-biaoti">手机号</span><span>{{mytoken.account.mobile}}</span></li>
@@ -92,7 +92,8 @@ import VDistpicker from 'v-distpicker'
                 mytoken: JSON.parse(localStorage.getItem('app-state-session')),//本地储存的用户信息
                 reg: new RegExp(/[\@\#\$\%\&\*!\¥]/),//非法字符
                 isaddress: false,//公司地址验证
-                isname: false,//姓名验证
+                isaddressname: false,//公司地址是否为空
+                isname: true,//姓名验证
                 isspaceName: false,//公司名验证
                 isemail: true,//验证邮箱
                 disabled: true
@@ -102,7 +103,8 @@ import VDistpicker from 'v-distpicker'
             VDistpicker
         },
         mounted(){
-
+            this.$refs.name.value = this.mytoken.account.realname
+            this.$refs.email.value = this.mytoken.account.email
         },
         methods: {
             //取消添加企业
@@ -164,7 +166,9 @@ import VDistpicker from 'v-distpicker'
                 let address = this.$refs.address.value.replace(/\s+/g, "");//过滤空格
                 if (address == '') {
                     this.$refs.ress.innerHTML = '地址不能为空'
+                    this.isaddressname = false
                 } else {
+                    this.isaddressname = true
                     if (this.reg.test(address)) {
                         this.$refs.ress.innerHTML = '不能包含非法字符'
                         this.isaddress = false
@@ -203,32 +207,58 @@ import VDistpicker from 'v-distpicker'
                 let mobile = mytoken.account.mobile;//手机号
                 let company = {'name':qyname,'address':address,'type':qyindustry};
                 let account = {'realname':name,'email':email,'mobile':mobile, 'uu':uu}
-                if (name != '' && qyname != '' && this.qymingzi && this.isaddress && this.isname && this.isspaceName && this.isemail) {
-                    this.$ajax({
-                        url: this.$url.api+"/api/account/accountCenter/companyAccount/save",//http://192.168.253.31:8560
-                        method: 'post',
-                        data: {
-                            companyRegDTO:company,
-                            accountRegDTO:account,
-                            type: 0
-                        },
-                        headers: {
-                            "Authorization":token,
-                        }
-                    })
-                    .then(res=>{
-                        // console.log("请求成功",res)
-                        document.documentElement.scrollTop = 0;
-                        this.$router.push({name:'company'})
-                    })
-                    .catch(err=>{
-                        // console.log("请求失败",err)
-                    })
+                // console.log('姓名',name)//个人姓名
+                // console.log('企业',qyname)//企业姓名
+                // console.log('企业名字',this.qymingzi)//企业有没有注册
+                // console.log('企业地址',this.isaddress)//企业地址
+                // console.log('姓名',this.isname)//个人姓名正则
+                // console.log('企业名字',this.isspaceName)//企业名字正则
+                // console.log('邮箱',this.isemail)//邮箱正则
+                if (name == '') {
+                    this.$refs.tjtishi.innerHTML = '个人姓名不能为空'
+                } else if (qyname == '') {
+                    this.$refs.tjtishi.innerHTML = '企业名字不能为空'
                 } else {
-                    this.$refs.tjtishi.innerHTML = '企业名称,地址,姓名不能为空或包含有非法字符'
-                    setTimeout(() => {
-                        this.$refs.tjtishi.innerHTML = ''
-                    }, 3000);
+                    switch (this.qymingzi && this.isaddress && this.isname && this.isspaceName && this.isemail && this.isaddressname) {
+                        case this.qymingzi:
+                        if (this.qymingzi) {
+                            this.$ajax({
+                                url: this.$url.api+"/api/account/accountCenter/companyAccount/save",//http://192.168.253.31:8560
+                                method: 'post',
+                                data: {
+                                    companyRegDTO:company,
+                                    accountRegDTO:account,
+                                    type: 0
+                                },
+                                headers: {
+                                    "Authorization":token,
+                                }
+                            })
+                            .then(res=>{
+                                document.documentElement.scrollTop = 0;
+                                this.$router.push({name:'company'})
+                            })
+                            this.$refs.tjtishi.innerHTML = ''
+                        } else {
+                            this.$refs.tjtishi.innerHTML = '企业名字已在优软云注册'
+                        }
+                        break;
+                        case this.isaddressname:
+                        this.$refs.tjtishi.innerHTML = '企业地址不能为空'
+                        break;
+                        case this.isaddress:
+                        this.$refs.tjtishi.innerHTML = '企业地址不能包含非法字符'
+                        break;
+                        case this.isname:
+                        this.$refs.tjtishi.innerHTML = '个人姓名不能包含非法字符'
+                        break;
+                        case this.isspaceName:
+                        this.$refs.tjtishi.innerHTML = '企业名字不能包含非法字符'
+                        break;
+                        case this.isemail:
+                        this.$refs.tjtishi.innerHTML = '请输入正确邮箱'
+                        break;
+                    }
                 }
             },
             //获取省市区

+ 32 - 21
frontend/saas-portal-web/src/components/conenter/company.vue

@@ -38,9 +38,9 @@
       <div>
         <div class="tc-okkaitong"><span>该企业已开通服务,联系管理员邀请加入</span></div>
         <div class="tc-context">
-          <p><span>管理员:</span><span>{{arr[0].admin}}</span></p>
-          <p><span>管理员手机号:</span><span>{{mytoken.account.mobile}}</span></p>
-          <p><span>管理员邮箱:</span><span></span></p>
+          <p><span>saas服务管理员:</span><span>{{admin}}</span></p>
+          <p><span>saas服务管理员手机号:</span><span>{{adminMobile}}</span></p>
+          <p><span>saas服务管理员邮箱:</span><span></span></p>
         </div>
       </div>
     </div>
@@ -56,13 +56,13 @@
       </div>
     </div>
 
-        <div class="gs-qiyebox" ref="qiyebox" style="margin-top: 70px;">
+        <div class="gs-qiyebox" ref="qiyebox" style="margin-top: 70px;" :class="isheigh ? 'heigh' : ''">
             <!-- 点击查看企业详情 -->
             <div v-for="(d , i) in arr " :key="i" class="gs-xiangqing xs">
                 <div class="left gs-xqleft" @click= "getEnterpriseInfo(d)">
                     <div class="gs-lefttext">
                         <p class="gs-qynema"><span>企业名称:</span>{{d.name}}</p>
-                        <p><span>管理员:</span>{{d.admin}}</p>
+                        <p v-if= "d.saas_" ><span>saas服务管理员:</span>{{d.admin}}</p>
                         <p v-if= "d.time"><span>开通日期:</span>{{d.time}}</p>
                     </div>
                 </div>
@@ -102,7 +102,10 @@
                 isDefault: true,//开通默认
                 isAutoLogin: this.$store.state.isAutoLogin,
                 mytoken: JSON.parse(localStorage.getItem('app-state-session')),//本地储存的用户信息
-                arr: []//企业列表信息
+                arr: [],//企业列表信息
+                isheigh:true,//是否添加默认高度
+                admin: '',
+                adminMobile: ''
             }
         },
         computed :{
@@ -117,12 +120,12 @@
                 })
             }
         },
-        mounted(){
+        created(){
             let mytoken = JSON.parse(localStorage.getItem('app-state-session'));
             let token = String(mytoken.token);
             //企业列表
             this.$ajax({
-                    url: this.$url.api+"/api/account/accountCenter/company/list",//http://192.168.253.31:8560
+                    url: this.$url.api+"/api/account/accountCenter/company/list",//http://192.168.253.29:8560
                     method: 'get',
                     params: {
                         mobile: mytoken.account.mobile
@@ -149,12 +152,13 @@
                         }
                     }
                     this.$store.commit('Loginfalse')
-                    // console.log(res.data.data)
-                    this.$store.state.email = this.arr[0].adminEmail
+                    this.$store.state.email = res.data.data.spaces[0].adminEmail
                 })
                 .catch(err=>{
                     // console.log("请求失败",err)
                 })
+        },
+        mounted(){
             this.boxheight();
         },
         methods: {
@@ -257,8 +261,14 @@
                 .then(res=>{
                     // console.log('请求成功',res)
                     if (res.data.success) {
-                        this.ktsass = false;
+                        // this.saasid = res.data.data
+                        // this.ktsass = false;
+                        this.$router.go(0);
                     } else {
+                        let msg = res.data.message
+                        let name = msg.split(" ")[1]
+                        this.admin = name.split('(')[0]
+                        this.adminMobile = name.split('(')[1].split(')')[0]
                         this.isokopensaas = true;
                     }
                 })
@@ -267,12 +277,11 @@
                 })
             },
             //进入saas服务
-            showServeWin(){
-                let id = this.saasid;
-                this.isOpensaas = false;
-                // this.$options.methods.selectServe(id);
-                this.selectServe(id)
-            },
+            // showServeWin(){
+            //     let id = this.saasid;
+            //     this.isOpensaas = false;
+            //     this.selectServe(id)
+            // },
             //查看企业详情
             getEnterpriseInfo(d){
                 document.documentElement.scrollTop = 0;
@@ -293,10 +302,10 @@
             //没有内容也要有一定的高度
             boxheight(){
                 let H = this.$refs.qiyebox.offsetHeight;
-                if (H < 300) {
-                    this.$refs.qiyebox.style.height = 500+'px';
+                if (H < 400) {
+                    this.isheigh = true
                 } else {
-                    this.$refs.qiyebox.style.height = '';
+                    this.isheigh = false
                 }
             },
         }
@@ -304,5 +313,7 @@
 </script>
 
 <style scoped>
-
+.heigh {
+    height: 500px;
+}
 </style>

+ 5 - 12
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -61,7 +61,7 @@
                                     <span>UU号</span><span>{{mytoken.uu}}</span>
                                 </li>
                                 <li>
-                                    <span>邮箱</span><span>{{email}}</span>
+                                    <span>邮箱</span><span>{{mytoken.email}}</span>
                                 </li>
                                 <li>
                                     <span>手机号</span><span>{{mytoken.mobile}}</span>
@@ -71,7 +71,7 @@
                     </div>
                 </div>
     <!-- 安全信息----------------------------------------------------------------------------- -->
-                <!-- <sjld></sjld> -->
+
                 <div :class="{gsqiye:nowindex == 2}">
                     <div class="gs-anquanxinxi">
                         <div class="over aq-title"><span class="left">登录密码</span><button class="right dianji">更换密码</button></div>
@@ -111,7 +111,6 @@ import { setTimeout } from 'timers';
             return{
                 nowindex: 0,//tab切换
                 tianjiaqiye: true,//添加企业切换
-                email: this.$store.state.email,
                 mytoken: JSON.parse(localStorage.getItem('app-state-session')).account,//本地储存的用户信息
                 tab: [
                     {name: '企业信息'},
@@ -123,10 +122,7 @@ import { setTimeout } from 'timers';
         computed :{
             setTokenPage() {
                 return this.$url.web + '/set-token.html'
-            }
-        },
-        mounted(){
-
+            },
         },
         methods: {
             // tab切换
@@ -135,14 +131,11 @@ import { setTimeout } from 'timers';
             },
             //退出
             loginout(){
-                this.$router.push({path:'/name'});
-                this.loginout2()
-            },
-            loginout2(){
                 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
+            }
         },
     }
 </script>

+ 87 - 101
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -16,7 +16,7 @@
                 </h1>
             </div>
             <div class="collapse navbar-collapse navbar-right" role="navigation">
-          <ul id="nav" class="nav navbar-nav menu">
+          <ul @click="gohome" id="nav" class="nav navbar-nav menu">
             <li><a href="#"><span>首页</span></a></li>
             <li><a href="https://www.usoftchina.com/" target="_blank"><span>优软云</span></a></li>
             <li>
@@ -41,17 +41,14 @@
           </ul>
         </div>
         </div>
-        
     </div>
 
     <iframe hidden :src="setTokenPage"></iframe>
-    <main class="site-content" role="main">
-      <!-- 遮罩 -->
+    <!-- 遮罩 -->
       <div class="zhezhao" v-if="isLogin || isRegister || isexperience"></div>
       <div class="box" v-if="isLogin || isRegister">
         <div>
-          <img @click="closeModal" class="tc-on shut"
-               src="/static/img/qiye/chahao.png" alt="">
+          <img @click="closeModal" class="tc-on shut" src="/static/img/qiye/chahao.png" alt="">
         </div>
         <iframe id="iframe" width="430" height="504" :src="ssoPage"></iframe>
         <iframe hidden :src="setTokenPage"></iframe>
@@ -68,7 +65,7 @@
             <span><img style="margin: 6px 8px 10px 15px;" src="/static/img/assets/phone.png" alt=""></span>
             <input ref="typhone" type="text" placeholder="请输入您的11位手机号">
           </div>
-          <div class="left" style="margin-left: 8px;"><button @click="experience1">立即体验</button></div>
+          <div class="left" style="margin-left: 8px;"><button @click="openexperience">立即体验</button></div>
         </div>
         <div style="text-align: left;">
           <span class="Caution" ref="Caution"></span>
@@ -77,22 +74,19 @@
           <span>客服电话:400-830-1818</span>
         </div>
       </div>
-
+    <main v-if="isproblem" class="site-content" role="main">
       <!--Home Slider==================================== -->
-      <section id="home-slider">
+      <!-- <section id="home-slider">
         <div id="slider" class="sl-slider-wrapper">
           <div class="sl-slider">
-
             <div class="sl-slide" data-orientation="horizontal" data-slice1-rotation="-25" data-slice2-rotation="-25"
                  data-slice1-scale="2" data-slice2-scale="2">
               <div class="mask-overly"></div>
               <div class="bg-img slider-1">
                 <img src="/static/img/banner@3x@2x.png" alt="">
               </div>
-              <!-- 首页内容 -->
               <div class="my-text">
                 <button class='my-tiyan' @click="experience">立即体验</button>
-
               </div>
               <div class="slide-caption">
                 <div class="caption-content"></div>
@@ -100,8 +94,15 @@
             </div>
           </div>
         </div>
-      </section>
-
+      </section> -->
+      <div>
+        <div class="bg-img slider-1" style="position: relative;">
+          <img src="/static/img/banner@3x@2x.png" alt="">
+          <div class="my-text" style="top:63%">
+            <button class='my-tiyan' @click="experience">立即体验</button>
+          </div>
+        </div>
+      </div>
       <!-- End Home SliderEnd==================================== -->
 
       <!-- 特色 -->
@@ -111,19 +112,40 @@
             <p class="ts-title">我们的特色</p>
             <p class="ts-text">云端部署 &nbsp;&nbsp; 轻量应用</p>
           </div>
+          <!-- 1 -->
+          <div class="ts-box">
+            <div class="ts-boximg">
+              <img style="margin-left: 18px;" src="/static/img/feature/mix1x.png" alt="">
+            </div>
+            <div>
+              <img class="ts-img" src="/static/img/feature/blue1@2x.png" alt="">
+            </div>
+          </div>
+          <!-- 2 -->
           <div class="ts-box">
             <div>
-              <img class="ts-img" src="/static/img/assets/1@2x.png" alt="">
+              <img class="ts-img" src="/static/img/feature/yellow2@2x.png" alt="">
+            </div>
+            <div class="ts-boximg">
+              <img style="float: right;" src="/static/img/feature/mix2x.png" alt="">
             </div>
           </div>
+          <!-- 3 -->
           <div class="ts-box">
+            <div class="ts-boximg">
+              <img src="/static/img/feature/mix3x.png" alt="">
+            </div>
             <div>
-              <img class="ts-img" src="/static/img/assets/2@3x.png" alt="">
+              <img class="ts-img" src="/static/img/feature/blue3@2x.png" alt="">
             </div>
           </div>
+          <!-- 4 -->
           <div class="ts-box">
             <div>
-              <img class="ts-img" src="/static/img/assets/3@2x.png" alt="">
+              <img style="width:94%" class="ts-img" src="/static/img/feature/yellow4@2x.png" alt="">
+            </div>
+            <div class="ts-boximg">
+              <img style="float: right;" src="/static/img/feature/mix4x.png" alt="">
             </div>
           </div>
         </div>
@@ -136,6 +158,7 @@
           <div class="row">
             <div class="section-title text-center" style="margin-bottom: 80px;">
               <p class="ts-title">我们的功能</p>
+              <p class="ts-text">简易SCM+内部协同+外部连接</p>
             </div>
             <div class="gn-hei">
               <div class="col-md-3 col-sm-6 col-xs-12">
@@ -226,76 +249,8 @@
         </div>
       </section>
       <!-- end Service section -->
-
-      <!-- 帮助中心 -->
-      <!-- <section id="prototype">
-        <div class="container">
-          <div class="row">
-            <div class="section-title text-center">
-              <p class="ts-title">帮助中心</p>
-            </div>
-            <div class="bz-worp">
-              <div class="bz-box">
-                <div class="bz-sskuang">
-                  <span><img class="bz-sousuoimg" src="/static/img/assets/sou.png" alt=""></span>
-                  <input class="bz-sousuo" type="text" placeholder="输入标题搜索"/>
-                </div>
-                <button class="bz-btn">搜索</button>
-              </div>
-              <div class="bz-content">
-                <div class="bz-left">
-                  <ul class="bz-ul">
-                    <li v-for="(d,i) in arr" :key="i" :class= "{active:Nowindex == i}" @click="tab(i)">{{d}}</li>
-                  </ul>
-                </div>
-                <div class="bz-right">
-                  <div class="bz-right-conent">
-                    <div :class= "{shows:Nowindex == 0}">
-                      <ul>
-                        <li>
-                          <span class="left bz-yuandian"></span>
-                          <span class="left">方式不同吧好像是差不多 </span>
-                          <span class="right">2018年10月31日  12:00</span>
-                        </li>
-                        <li>
-                          <span class="left bz-yuandian"></span>
-                          <span class="left">XXXXXXXXXXXXXXX操作文档</span>
-                          <span class="right">2018年10月31日  12:00</span>
-                        </li>
-                        <li>
-                          <span class="left bz-yuandian"></span>
-                          <span class="left">XXXXXXXXXXXXXXX操作文档</span>
-                          <span class="right">2018年10月31日  12:00</span>
-                        </li>
-                      </ul>
-                    </div>
-                    <div :class= "{shows:Nowindex == 1}">
-                      <ul>
-                        <li>
-                          <span class="left bz-yuandian"></span>
-                          <span class="left">方式不同吧好像是差不多哇来访黑哇哦发检测句ID回复开展了好xxxxx常见问题 </span>
-                          <span class="right">2018年11月24日  12:00</span>
-                        </li>
-                        <li>
-                          <span class="left bz-yuandian"></span>
-                          <span class="left">方式不同吧好像是差不多哇来访黑哇哦发检测句ID回复开展了好xxxxx常见问题</span>
-                          <span class="right">2018年11月24日  12:00</span>
-                        </li>
-                        <li>
-                          <span class="left bz-yuandian"></span>
-                          <span class="left">XXXXXXXXXXXXXXX常见问题</span>
-                          <span class="right">2018年11月24日  12:00</span>
-                        </li>
-                      </ul>
-                    </div>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-      </section> -->
     </main>
+    <problem v-else></problem>
   </div>
 </template>
 
@@ -303,6 +258,7 @@
   import {subscribe, disconnect} from '@/api/socket'
   import Session from '@/utils/session'
   import { setTimeout } from 'timers'
+  import problem from '../conenter/problem.vue'
 
   export default {
     data() {
@@ -312,10 +268,40 @@
         clientId: null,
         account: null,
         isexperience: false,
-        arr: ["操作文档","常见手册"],
-        Nowindex: 0,
+        isproblem: true,//常见问题
+      }
+    },
+    components: {
+      problem
+    },
+    watch: {
+      getnewproblem(val){
+          this.isproblem = val
       }
     },
+    created(){
+      if (this.$route.query.isporblem == undefined) {
+        this.isproblem = true
+      } else {
+        this.isproblem = this.$route.query.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)
+        })
+    },
     mounted() {
       this.clientId = Math.random().toString(36).substr(2)
       // 从本地加载已经登录的信息
@@ -334,12 +320,12 @@
           return this.$url.sso + '/sassLogin/register?appId=sp&baseUrl=' +
             encodeURIComponent(this.$url.api + '/api/auth/sso/callback/' + this.clientId)
         }
+      },
+      getnewproblem() {
+        return this.$store.state.isproblem;
       }
     },
     methods: {
-      tab(i){
-        this.Nowindex = i;
-      },
       home() {
         document.documentElement.scrollTop = 0;
       },
@@ -362,7 +348,7 @@
               // 跳转应用页面
               window.location.href = me.$url.web
             }
-           } 
+           }
           }, false)
           frame.postMessage(JSON.stringify(session), '*')
         })
@@ -382,7 +368,8 @@
         const frame = window.frames[window.frames.length - 1]
         frame.postMessage('', '*')
         Session.remove()
-        this.$router.go(0); 
+        window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL=https://'+window.location.host
+        //this.$router.go(0);
       },
       // 关闭窗口
       closeModal() {
@@ -394,6 +381,7 @@
       },
       //体验
       experience(){
+        console.log(123)
         this.isexperience = true;
       },
       //关闭体验
@@ -401,7 +389,7 @@
         this.isexperience = false;
       },
       //进入体验
-      experience1(){
+      openexperience(){
         let me = this
         let phone = this.$refs.typhone.value;
         let reg = new RegExp('^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$')
@@ -438,19 +426,17 @@
                 // console.log("请求失败",err)
             })
           }
-        } 
+        }
       },
+      gohome(e){
+        this.$store.commit('problemtrue')
+        // this.isproblem = true
+      }
     }
   }
 </script>
 
 <style scoped>
-.shows {
-  display: block !important;
-}
-.bz-right-conent div {
-  display: none;
-}
 .shut {
   cursor: pointer;
   position: absolute;

+ 82 - 0
frontend/saas-portal-web/src/components/conenter/problem.vue

@@ -0,0 +1,82 @@
+<template>
+    <div>
+        <div class="bz-container">
+            <div class="bz-title">
+              <span>常见问题</span>
+            </div>
+          <div class="bz-titlebox">
+            <div class="bz-worp">
+              <div class="bz-box">
+                <div class="bz-sskuang">
+                  <span><img class="bz-sousuoimg" src="/static/img/assets/sou.png" alt=""></span>
+                  <input class="bz-sousuo" type="text" placeholder="请输入标题搜索"/>
+                </div>
+                <button class="bz-btn">搜索</button>
+              </div>
+              <div class="bz-content">
+                <div class="bz-right">
+                  <div class="bz-right-conent">
+                    <div class= "shows">
+                      <ul>
+                        <li>
+                          <span class="left bz-yuandian"></span>
+                          <span class="left">方式不同吧好像是差不多 </span>
+                          <img class="right bz-copy" src="/static/img/Triangle Copy 4.png" alt="">
+                        </li>
+                        <li>
+                          <span class="left bz-yuandian"></span>
+                          <span class="left">XXXXXXXXXXXXXXX操作文档</span>
+                          <img class="right bz-copy" src="/static/img/Triangle Copy 4.png" alt="">
+                        </li>
+                        <li>
+                          <span class="left bz-yuandian"></span>
+                          <span class="left">XXXXXXXXXXXXXXX操作文档</span>
+                          <img class="right bz-copy" src="/static/img/Triangle Copy 4.png" alt="">
+                        </li>
+                      </ul>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+    </div>
+</template>
+
+<script>
+    export default {
+        
+    }
+</script>
+
+<style scoped>
+.bz-container {
+    width: 55%;
+    margin: 0 auto;
+    font-size: 14px;
+    margin-top: 180px;
+    margin-bottom: 190px;
+}
+.bz-titlebox {
+    background: #FFFFFF;
+    border: 1px solid rgba(30,136,245,0.32);
+    box-shadow: 0 20px 60px 10px rgba(13,37,62,0.05);
+    border-radius: 4px;
+}
+.bz-title {
+    text-align: left;
+    font-size: 14px;
+    color: white;
+    margin-bottom: 36px;
+}
+.bz-title span {
+    background: #1E88F5;
+    border-radius: 2px;
+    padding: 6px 24px;
+}
+.bz-copy {
+    margin-right: 7px;
+    cursor: pointer;
+}
+</style>

+ 4 - 4
frontend/saas-portal-web/src/components/conenter/qiyexiangxi.vue

@@ -19,12 +19,12 @@
             </div>
             <div class="gs-worp qy-worp" style="width:100%">
                 <div class="qy-title">
-                    <span>管理员信息</span>
+                    <span>saas服务管理员信息</span>
                 </div>
                 <div class="qy-conent">
                     <ul>
                         <li><span class="qy-biaoti">姓名</span><span>{{content.admin}}</span></li>
-                        <li><span class="qy-biaoti">手机号</span><span>{{mytoken.account.mobile}}</span></li>
+                        <li><span class="qy-biaoti">手机号</span><span>{{content.adminMobile}}</span></li>
                         <li><span class="qy-biaoti">邮箱</span><span>{{content.adminEmail}}</span></li>
                     </ul>
                 </div>
@@ -78,12 +78,12 @@
             </div>
             <div class="gs-worp qy-worp" style="width: 100%">
                 <div class="qy-title">
-                    <span>管理员信息</span>
+                    <span>saas服务管理员信息</span>
                 </div>
                 <div class="qy-conent">
                     <ul>
                         <li><span class="qy-biaoti">姓名</span><span>{{content.admin}}</span></li>
-                        <li><span class="qy-biaoti">手机号</span><span>{{mytoken.account.mobile}}</span></li>
+                        <li><span class="qy-biaoti">手机号</span><span>{{content.adminMobile}}</span></li>
                         <li>
                             <span class="qy-biaoti">邮箱</span>
                             <input @change="email" ref="email" type="text" value="">

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

@@ -4,68 +4,72 @@
 			<div class="container">
 				<div class="footer-list">
 					<div class="about">
-						<div class="logo"><img src="../../../static/img/logo_w.png" alt=""/></div>
+						<div class="logo"><img src="/static/img/assets/dalogo@2x_1.png" alt=""/></div>
 						<div class="time">客服热线:400-830-1818</div>
 						<div class="time">工作时间:周一至周五08:30~18:00</div>
 						<!--<div class="time">意见反馈:usoftmall.com</div>-->
 					</div>
 					<div class="link">
+						<ul>
+							<li><span>常用链接</span></li>
+							<li><a href="https://uas.usoftchina.com/" target="_blank">UAS官网</a></li>
+							<li><a href="https://www.usoftchina.com/" target="_blank">U软云</a></li>
+							<li><a href="http://www.yitoa.com/" target="_blank">英唐官网</a></li>
+						</ul>
 						<ul>
 							<li><span>帮助中心</span></li>
-							<li><a href="#">常见问题</a></li>
+							<li><a @click="problem">常见问题</a></li>
 							<li><a href="#">操作手册</a></li>
 						</ul>
 						<ul>
 							<li><span>公司</span></li>
 							<li><a href="https://uas.usoftchina.com/about" target="_blank">关于我们</a></li>
-							<!-- <li><a href="#">企业文化</a></li> -->
+							<li><a >企业文化</a></li>
+							<li><a >联系我们</a></li>
 						</ul>
 						<ul>
 							<li><span>产品</span></li>
-							<li><a href="#">U企云服</a></li>
-							<li><a href="https://mall.usoftchina.com/" target="_blank">U软商城</a></li>
-							<li><a href="https://fin.yitoa-fintech.com/" target="_blank">U智融</a></li>
-							<li><a href="https://zb.usoftchina.com/" target="_blank">U创客</a></li>
+							<li><a href="#">企云服</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>
 						</ul>
 					</div>
 					
 					<div class="qr">
 						<div class="qr-top">
 							<div class="qr-tech qr-code">
-								<img src="../../../static/img/qr-tech.png" alt="">
+								<img src="/static/img/qrusoftchina_1.jpg" alt="">
 								<div class="db-text">
 									<span>科技公众号</span>
 								</div>
 							</div>
-							
-							<!-- <div class="qr-mall qr-code">
-								<img src="./img/qr_mall.jpg" alt="">
-								商城公众号
-							</div> -->
 						</div>
-						<!-- <div class="qr-bottom">
-							粤ICP备15112126号
-							<br/>2018 © 深圳市优软科技有限公司
-						</div> -->
 					</div>
 				</div>
 				
 			</div>
 		</div>
 		<div class="friend-link">
-			<ul>
-				<li><span>常用链接:</span></li>
-				<li><a href="https://uas.usoftchina.com/" target="_blank">UAS官网</a></li>
-				<li><a href="https://www.usoftchina.com/" target="_blank">U软云</a></li>
-				<li><a href="http://www.yitoa.com/" target="_blank">英唐官网</a></li>
-			</ul>
+			<span>版权所有:深圳市优软科技有限公司 Copyright @ 2017 All Rights Reserved</span>
 		</div>
     </div>
 </template>
 
 <script>
     export default {
-        
+        data(){
+			return {
+
+			}
+		},
+		methods:{
+			problem(){
+				this.$router.push({path: '/name', query: {isporblem: false}})
+				this.$store.commit("problemfalse")
+				document.documentElement.scrollTop = 0;
+			}
+		}
     }
 </script>
 

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

@@ -5,6 +5,7 @@ import router from '../../router'
 import Axios from 'axios'
 import store from '../../store'
 
+Axios.defaults.withCredentials=true;
 Vue.prototype.$ajax = Axios;
 Vue.config.productionTip = false
 

+ 7 - 0
frontend/saas-portal-web/src/store/index.js

@@ -7,6 +7,7 @@ export default new Vuex.Store({
         data: [],
         email:'',
         isAutoLogin: false,
+        isproblem: '',//常见问题
     },
     mutations:{
          Logintrue(state) {
@@ -15,5 +16,11 @@ export default new Vuex.Store({
          Loginfalse(state) {
              state.isAutoLogin = false;   
          },
+         problemfalse(state) {
+            state.isproblem = false;
+         },
+         problemtrue(state) {
+            state.isproblem = true;
+         }
     }
 })

+ 43 - 50
frontend/saas-portal-web/static/css/main.css

@@ -308,14 +308,18 @@ main > section {
 /* 首页内容 ..........................................*/
 .my-text {
     position: absolute;
+    width: 13%;
+    height: 6%;
     top: 64%;
-    left: 7%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    z-index: 1000;
 }
 .my-tiyan {
-    background: #5172DD;
+    background: #1E88F5;
     border-radius: 4px;
-    width: 100px;
-    height: 36px;
+    width: 100%;
+    height: 100%;
     font-family: PingFangSC-Regular;
     font-size: 14px;
     color: #FFFFFF;
@@ -332,36 +336,15 @@ main > section {
     overflow: hidden;
     /* margin-top: 50px; */
     position: relative;
+    padding: 150px 0;
+    width: 98%;
 }
-.ts-minimg {
-    width: 773px;
-    height: 615px;
+.ts-boximg {
     position: absolute;
-    top: -35px;
-    right: 0;
+    top: 50px;
 }
-.ts-mintext {
-    position: absolute;
-    top: 142px;
-    right: 240px;
-    color: white;
-}
-.ts-mintext p {
-    font-size: 26px!important;
-    text-align: left;
-    margin-bottom: 24px;
-}
-.ts-textimg {
-    width: 40px;
-    margin-left: -40px;
-}
-.ts-lefttext {
-    left: 40px;
-    width: 560px;
-}
-.ts-textleftimg {
-    width: 40px;
-    margin-right: -40px;
+.ts-boximg img {
+    width: 65%;
 }
 .ts-lefttext p {
     text-align: right;
@@ -380,7 +363,8 @@ main > section {
     float: right;
 }
 .ts-img {
-    width: 100%;
+    width: 98%;
+    margin-left: 2%;
 }
 .right-text {
     text-align: right;
@@ -450,9 +434,8 @@ main > section {
 /* 帮助 ........................................*/
 .bz-worp {
     background: white;
-    width: 90%;
     margin: 0 auto;
-    padding: 40px;
+    padding: 42px 40px 109px 48px;
 }
 .bz-box {
     border: 1px solid #1E88F5;
@@ -460,12 +443,12 @@ main > section {
     border-right: 0;
 }
 .bz-sskuang {
-    width: 90%;
+    width: 88%;
     float: left;
     line-height: 38px;
 }
 .bz-sousuo {
-    width: 94%;
+    width: 70%;
     margin: 0 -5px;
     border: 0;
     outline: none;
@@ -476,7 +459,7 @@ main > section {
 .bz-btn {
     background: #1E88F5;
     border-radius: 0 5px 5px 0;
-    width: 10%;
+    width: 12%;
     border: 0;
     color: white;
     height: 40px;
@@ -516,15 +499,16 @@ main > section {
     border-radius: 50%;
     margin: 4px 8px 0 0;
 }
-.bz-right-conent div {
-    display: none;
-}
 .bz-right-conent li {
-    margin-bottom: 14px;
+    border-bottom: 1px solid #E8ECEF;
+    padding: 10px 0;
     list-style: none;
     overflow: hidden;
     margin-left: -40px;
 }
+.bz-right-conent li:last-child {
+    border-bottom: 0;
+}
 .bz-right-conent {
     /* margin: 30px; */
 }
@@ -553,7 +537,7 @@ main > section {
 }
 .footer-section ul{
     float: left;
-    margin-right: 70px;
+    margin-right: 45px;
 }
 .footer-section ul:last-child {
     margin-right: 0;
@@ -570,7 +554,7 @@ main > section {
 .footer-section ul>li a{
     display: inline-block;
     margin-bottom: 10px;
-    font-size: 12px;
+    font-size: 14px;
     color: #fff;
     cursor: pointer;
 }
@@ -585,16 +569,16 @@ main > section {
 }
 .footer-section .about{
     float: left;
-    margin-right: 90px;
+    margin-right: 30px;
     width: 245px;
     text-align: left;
 }
 .footer-section .about .logo{
-    margin-bottom: 32px;
+    margin-bottom: 18px;
 }
 .footer-section .about .logo img{
-    width: 156px;
-    height: 44px;
+    width: 150px;
+    /* height: 44px; */
 }
 .footer-section .about .time{
     margin-bottom: 21px;
@@ -639,6 +623,15 @@ main > section {
     background: #000;
     width: 100%;
     line-height: 100px;
+    text-align: center;
+}
+.friend-link span {
+    opacity: 0.56;
+    font-family: PingFangSC-Regular;
+    font-size: 16px;
+    color: #FFFFFF;
+    letter-spacing: 0;
+    text-align: center;
 }
 .friend-link ul{
     overflow: hidden;
@@ -961,13 +954,13 @@ h1.navbar-brand {
 }
 .slider-1 img{
     width: 100%;
-    height: 100%;
+    /* height: 100%; */
 }
 .sl-slider-wrapper {
     width: 100%;
     margin: 0 auto;
     position: relative;
-    overflow: hidden;
+    /* overflow: hidden; */
 }
 
 .sl-slider {
@@ -1004,7 +997,7 @@ h1.navbar-brand {
     text-align: center;
     top: 0;
     width: 60%;
-    z-index: 999999;
+    z-index: 999;
     left: 50%;
     transform: translateX(-50%);
 

BIN
frontend/saas-portal-web/static/img/Triangle Copy 4.png


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


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


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


BIN
frontend/saas-portal-web/static/img/feature/blue1@2x.png


BIN
frontend/saas-portal-web/static/img/feature/blue3@2x.png


BIN
frontend/saas-portal-web/static/img/feature/mix1x.png


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