Browse Source

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

# Conflicts:
#	pom.xml
yingp 7 years ago
parent
commit
11ad67534f
100 changed files with 901 additions and 171 deletions
  1. 5 5
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ListReqDTO.java
  2. 5 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java
  3. 10 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/HomePageController.java
  4. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/HomePageMapper.java
  5. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/HomePageService.java
  6. 42 14
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java
  7. 7 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/HomePageServiceImpl.java
  8. 32 0
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  9. 2 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorDTO.java
  10. 10 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Address.java
  11. 2 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendor.java
  12. 2 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java
  13. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java
  14. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java
  15. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java
  16. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/AddressService.java
  17. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  18. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  19. 2 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  20. 7 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  21. 2 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  22. 4 2
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  23. 2 2
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  24. 3 3
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  25. 16 4
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  26. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/PaybalanceController.java
  27. 11 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ProfitdetailMapper.java
  28. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationMapper.java
  29. 37 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java
  30. 109 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Profitpresent.java
  31. 36 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java
  32. 7 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java
  33. 21 13
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  34. 4 1
      applications/money/money-server/src/main/resources/application.yml
  35. 5 1
      applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml
  36. 139 0
      applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml
  37. 5 1
      applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml
  38. 3 3
      applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml
  39. 4 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdIODetailDTO.java
  40. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdIODetail.java
  41. 5 5
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  42. 1 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  43. 1 1
      applications/purchase/purchase-server/src/main/resources/application.yml
  44. 6 2
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  45. 4 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutDTO.java
  46. 4 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutListDTO.java
  47. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  48. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java
  49. 14 5
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  50. 13 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  51. 4 1
      applications/sale/sale-server/src/main/resources/application.yml
  52. 4 0
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  53. 30 6
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml
  54. 3 1
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  55. 2 1
      applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml
  56. 6 6
      applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml
  57. 2 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/ProdInOutDTO.java
  58. 2 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/ProdInOutListDTO.java
  59. 4 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOut.java
  60. 4 1
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java
  61. 1 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/report/ProdiodetailView.java
  62. 4 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java
  63. 1 1
      applications/storage/storage-server/src/main/resources/application.yml
  64. 18 0
      applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml
  65. 1 1
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutReportMapper.xml
  66. 12 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/RoleDTO.java
  67. 1 1
      base-servers/account/account-server/src/main/resources/application.yml
  68. 3 3
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  69. 1 1
      base-servers/auth/sso-api/src/test/resources/application.yml
  70. 0 2
      base-servers/sms/sms-server/pom.xml
  71. 1 1
      base-servers/sms/sms-server/src/main/resources/application.yml
  72. 19 0
      base-servers/sms/sms-server/src/main/resources/config/application-docker-prod.yml
  73. 12 0
      base-servers/sms/sms-server/src/main/resources/config/application-docker-test.yml
  74. 10 0
      base-servers/sms/sms-server/src/main/resources/config/application-docker.yml
  75. 17 2
      framework/core/src/main/java/com/usoftchina/saas/utils/RegexpUtils.java
  76. 1 1
      frontend/saas-portal-web/config/dev.env.js
  77. 1 1
      frontend/saas-portal-web/config/test.env.js
  78. 21 7
      frontend/saas-portal-web/src/components/conenter/addenterprise.vue
  79. 3 3
      frontend/saas-portal-web/src/components/conenter/company.vue
  80. 11 13
      frontend/saas-portal-web/src/components/conenter/details.vue
  81. 9 7
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  82. 18 21
      frontend/saas-portal-web/src/components/conenter/home.vue
  83. 8 0
      frontend/saas-portal-web/src/pages/index/index.js
  84. 28 2
      frontend/saas-portal-web/src/pages/index/index.vue
  85. 2 2
      frontend/saas-portal-web/src/router/index.js
  86. 1 1
      frontend/saas-portal-web/src/store/index.js
  87. 23 12
      frontend/saas-portal-web/static/css/main.css
  88. BIN
      frontend/saas-portal-web/static/img/banner.png
  89. BIN
      frontend/saas-portal-web/static/img/banner@2x@2x.png
  90. BIN
      frontend/saas-portal-web/static/img/feature/blue1@2x.png
  91. BIN
      frontend/saas-portal-web/static/img/feature/blue3@2x.png
  92. BIN
      frontend/saas-portal-web/static/img/feature/for2x.png
  93. BIN
      frontend/saas-portal-web/static/img/feature/formin2x.png
  94. BIN
      frontend/saas-portal-web/static/img/feature/mix1x.png
  95. BIN
      frontend/saas-portal-web/static/img/feature/mix2x.png
  96. BIN
      frontend/saas-portal-web/static/img/feature/mix3x.png
  97. BIN
      frontend/saas-portal-web/static/img/feature/mix4x.png
  98. BIN
      frontend/saas-portal-web/static/img/feature/one2x.png
  99. BIN
      frontend/saas-portal-web/static/img/feature/onemin2x.png
  100. BIN
      frontend/saas-portal-web/static/img/feature/three2x.png

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

@@ -112,22 +112,22 @@ public class ListReqDTO implements Serializable {
                     }
                     if ("between".equals(operation)) {
                         String[] vals = value.toString().split(",");
-                        con = " " + field + " " + operation + " '" + vals[0] + "' and '" + vals[1] + "' and";
+                        con = " ( " + field + " " + operation + " '" + vals[0] + "' and '" + vals[1] + "' ) and";
                     } else if ("startsWith".equals(operation)) {
                         con = " " + field + "  like '" + value + "%' and";
                     } else if ("endsWith".equals(operation)) {
                         con = " " + field + " like '%" + value + "' and";
                     } else if ("in".equals(operation) || "not in".equals(operation)) {
-                        con = " " + field + " " + operation + " (" + value + ") and";
+                        con = " ( " + field + " " + operation + " (" + value + ") ) and";
                     } else {
                         //字符串默认是模糊查询
                         if ("string".equals(type)) {
-                            con = " " + field + " like '%" + value + "%' and";
+                            con = " (" + field + " like '%" + value + "%') and";
                         } else if ("condition".equals(type)) {
                             //type为condition为前端拼的条件
-                            con = " " + value + " and";
+                            con = " (" + value + ") and";
                         } else {
-                            con = " " + field + " " + operation + " '" + value + "' and";
+                            con = " (" + field + " " + operation + " '" + value + "') and";
                         }
 
                     }

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

@@ -19,6 +19,11 @@ public class CommonController {
         return Result.success();
     }
 
+    @GetMapping("/{caller}/import")
+    public Result importExcel(){
+        return Result.success();
+    }
+
     @GetMapping("/{caller}/print")
     public Result print() {
         return Result.success();

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

@@ -104,4 +104,14 @@ public class HomePageController {
         return homePageService.keyData();
     }
 
+    /**
+     * @Description 本月毛利润
+     * @return: com.usoftchina.saas.base.Result
+     * @Author: guq
+     * @Date: 2018/12/10
+     */
+    @GetMapping("/monthProfit")
+    public Result monthProfit() {
+        return homePageService.monthProfit();
+    }
 }

+ 2 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/HomePageMapper.java

@@ -19,4 +19,6 @@ public interface HomePageMapper {
     String getSaleFutureData(Long componyId);
 
     String getKeyData(Long companyId);
+
+    String monthProfit(Long companyId);
 }

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

@@ -51,4 +51,6 @@ public interface HomePageService {
     Result saleFutureData();
 
     Result keyData();
+
+    Result monthProfit();
 }

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

@@ -14,6 +14,7 @@ import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.utils.CollectionUtils;
 import com.usoftchina.saas.utils.DateUtils;
+import com.usoftchina.saas.utils.RegexpUtils;
 import com.usoftchina.saas.utils.StringUtils;
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.*;
@@ -163,27 +164,28 @@ public class ExcelServiceImpl implements ExcelService{
                        List<TempletSet> main = columns.get(position);
                        for (TempletSet set : main) {
                            //取excel值
-                           if ("true".equals(set.getNecessary())) {
+                           value = data.get(set.getDescription());
+                          /* if ("true".equals(set.getNecessary())) {
                                value = data.get("*" + set.getDescription());
                            } else {
                                value = data.get(set.getDescription());
-                           }
+                           }*/
                            //取编号字段
-                           if (set.isCodefield() && !data.get("*" + set.getDescription()).equals("")) {
+                           if (set.isCodefield() && !"".equals(value)) {
                                mainData = new JSONObject();
                                codeValue = value;
                                difference = true;
                                validateCode.add(codeValue);
                            }
                            //检查是否是同一单
-                           if (set.isCodefield() && data.get("*" + set.getDescription()).equals("")) {
+                           if (set.isCodefield() && "".equals(value)) {
                                difference = false;
                                break;
                            }
                            //检查主表必填字段是否完整
                            if (difference) {
                                dd.setDd_codevalue(codeValue);
-                               if ("true".equals(set.getNecessary()) && data.get("*" + set.getDescription()).equals("")) {
+                               if ("true".equals(set.getNecessary()) && "".equals(value)) {
                                    err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
                                    break;
                                }
@@ -196,9 +198,18 @@ public class ExcelServiceImpl implements ExcelService{
                                    break;
                                }
                            }
-                           //如果为数字类型且为空默认赋值0
-                           if ("number".equals(set.getType()) && StringUtils.isEmpty(value)) {
-                                value = "0";
+                           //如果为数字类型且为空默认赋值0,检测是否为数字类型
+                           if ("number".equals(set.getType())) {
+                               if (StringUtils.isEmpty(value)) {
+                                   value = "0";
+                               } else {
+                                   Boolean numner = isNumner(value);
+                                   if (!numner) {
+                                       err.append("第" + (i + 3) + "行 " + set.getDescription() + " 数字格式不正确!<br/> ");
+                                       break;
+                                   }
+                               }
+
                            }
                            //插入主表数据
                            if (null != mainData) {
@@ -216,11 +227,12 @@ public class ExcelServiceImpl implements ExcelService{
                        detailData = new JSONObject();
                        for (TempletSet set : detail) {
                            //取excel值
-                           if ("true".equals(set.getNecessary())) {
+                           value = data.get(set.getDescription());
+                          /* if ("true".equals(set.getNecessary())) {
                                value = data.get("*" + set.getDescription());
                            } else {
                                value = data.get(set.getDescription());
-                           }
+                           }*/
                            if ("true".equals(set.getNecessary()) && value.equals("")) {
                                detailData = null;
                                //err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
@@ -284,6 +296,19 @@ public class ExcelServiceImpl implements ExcelService{
     }
 
 
+    private Boolean isNumner(String str) {
+        for(int i=str.length() - 1; i>=0; i--){
+            int chr=str.charAt(i);
+            if(chr < 48 || chr >  57) {
+                if (chr == 46) {
+                    continue;
+                }
+                return false;
+            }
+
+        }
+        return true;
+    }
 
 
     private boolean validateDateFormat(String date) {
@@ -333,6 +358,7 @@ public class ExcelServiceImpl implements ExcelService{
             switch(cell.getCellType()){
                 case Cell.CELL_TYPE_NUMERIC:{
                     cellValue = String.valueOf(cell.getNumericCellValue());
+                    cellValue = RegexpUtils.replaceSpecialCharacter(cellValue);
                     //判断是否为INT类型
                     if (Double.valueOf(cellValue.toString()).intValue() - Double.valueOf(cellValue.toString()) == 0) {
                         return cellValue.toString().substring(0, cellValue.toString().indexOf("."));
@@ -344,14 +370,17 @@ public class ExcelServiceImpl implements ExcelService{
                     if(DateUtil.isCellDateFormatted(cell)){
                         //转换为日期格式YYYY-mm-dd
                         cellValue = cell.getDateCellValue();
+                        cellValue = RegexpUtils.replaceSpecialCharacter(cellValue);
                     }else{
                         //数字
                         cellValue = String.valueOf(cell.getNumericCellValue());
+                        cellValue = RegexpUtils.replaceSpecialCharacter(cellValue);
                     }
                     break;
                 }
                 case Cell.CELL_TYPE_STRING:{
                     cellValue = cell.getRichStringCellValue().getString();
+                    cellValue = RegexpUtils.replaceSpecialCharacter(cellValue);
                     break;
                 }
                 default:
@@ -464,16 +493,15 @@ public class ExcelServiceImpl implements ExcelService{
 
     private CellStyle getCellStyle(SXSSFWorkbook workbook, boolean main) {
         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.setBold(true);
         font.setColor((short)64);// 颜色
         style.setFont(font);
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
         style.setAlignment(HorizontalAlignment.CENTER);
-        style.setFillForegroundColor(HSSFColor.GREEN.index);
-        style.setFillBackgroundColor(main ? HSSFColor.LIGHT_YELLOW.index : HSSFColor.PALE_BLUE.index);
+        style.setFillForegroundColor(main ? HSSFColor.LIGHT_YELLOW.index : HSSFColor.PALE_BLUE.index);
         style.setBorderBottom(BorderStyle.MEDIUM);
         style.setBorderLeft(BorderStyle.MEDIUM);
         style.setBorderRight(BorderStyle.MEDIUM);

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

@@ -86,6 +86,13 @@ public class HomePageServiceImpl implements HomePageService{
         return Result.success(data);
     }
 
+    @Override
+    public Result monthProfit() {
+        Long companyId = BaseContextHolder.getCompanyId();
+        Object data = parseJson(homePageMapper.monthProfit(companyId));
+        return Result.success(data);
+    }
+
     private Object parseJson(String text) {
         Object json = null;
         if (null != text) {

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

@@ -116,4 +116,36 @@
             )d1
             );
     </select>
+
+    <select id="monthProfit" parameterType="long" resultType="string">
+        select concat('[',five_profit,',',other_profit,']') from (
+      (
+        #前5数据
+        select group_concat('{"x":"',custname,'","y":',profit/10000,',"z":"',shortname,'"}') five_profit   from (
+        select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) profit,
+        pi_custcode,max(pi_custname) custname,max(ifnull(cu_shortname,'')) shortname  from prodinout left join prodiodetail on pi_id=pd_piid left join customer on cu_id=pi_custid
+        where
+        pi_class in('出货单', '销售退货单') and pi_statuscode='AUDITED' and DATE_FORMAT(pi_date,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and prodinout.companyid=#{componyId}
+        GROUP BY pi_custcode,prodinout.companyid order by profit desc  limit 0,5) t
+        )five_profit_,
+	  (
+	    #其它的数据
+		select concat('{"z":"其它","x":"其它","y":',(all_profit - five_profit)/10000,'}') other_profit from (
+        #总共
+        (
+        select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) all_profit
+        from prodinout left join prodiodetail on pi_id=pd_piid
+        where
+        pi_class in('出货单', '销售退货单') and pi_statuscode='AUDITED' and DATE_FORMAT(pi_date,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and prodinout.companyid=#{componyId} )a1_,
+        #前5总和
+        (
+        select sum(profit) five_profit from (select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) profit,
+        pi_custcode,max(pi_custname) custname,prodinout.companyid from prodinout left join prodiodetail on pi_id=pd_piid left join customer on cu_id=pi_custid
+         where
+        pi_class in('出货单', '销售退货单') and pi_statuscode='AUDITED' and DATE_FORMAT(pi_date,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and prodinout.companyid=#{componyId}
+        GROUP BY pi_custcode,prodinout.companyid order by profit desc  limit 0,5) b)a2_
+       )
+       ) other_profit_
+      )
+    </select>
 </mapper>

+ 2 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorDTO.java

@@ -27,4 +27,6 @@ public class VendorDTO extends CommonBaseDTO implements Serializable{
 
     private String ve_buyername;
 
+    private String ve_address;
+
 }

+ 10 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Address.java

@@ -19,6 +19,16 @@ public class Address extends CommonBaseEntity implements Serializable {
 
     private String ad_address;
 
+    private Long ad_default;
+
+    public Long getAd_default() {
+        return ad_default;
+    }
+
+    public void setAd_default(Long ad_default) {
+        this.ad_default = ad_default;
+    }
+
     public String getAd_text1() {
         return ad_text1;
     }

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

@@ -113,4 +113,6 @@ public class Vendor extends CommonBaseEntity implements Serializable{
 
     private String ve_buyername;
 
+    private String ve_address;
+
 }

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

@@ -104,6 +104,8 @@ public class VendorList implements Serializable {
 
     private String ve_buyername;
 
+    private String ve_address;
+
     /* 从表字段 */
 
     private Integer vc_veid;

+ 4 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java

@@ -33,6 +33,10 @@ public class AddressController {
         return Result.success();
     }
 
+    @GetMapping("/getDefault")
+    public Result getDefault(){
+        return Result.success(addressService.getDefault());
+    }
 
 
     @PostMapping("/batchDelete")

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

@@ -34,4 +34,6 @@ public interface AddressMapper extends CommonBaseMapper<Address> {
     int getCountFromPurchase(@Param("id") Long id, @Param("companyId") Long companyId);
 
     void setDefault(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    Address getDefault(@Param("companyId") Long companyId);
 }

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

@@ -3,6 +3,7 @@ package com.usoftchina.saas.document.mapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Bankinformation;
+import com.usoftchina.saas.page.PageDefault;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -25,7 +26,7 @@ public interface BankinformationMapper extends CommonBaseMapper<Bankinformation>
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
     String selectBankcode(@Param("bk_bankcode") String bk_bankcode, @Param("companyId") Long companyId);
-    Long selectBankId(String bk_bankcode);
+    Long selectBankId(@Param("bk_bankcode") String bk_bankcode, @Param("companyId") Long companyId);
 
     void check(Map<String, Object> map);
 

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/AddressService.java

@@ -19,4 +19,6 @@ public interface AddressService extends CommonBaseService<AddressMapper, Address
     DocBaseDTO saveData(Address address);
 
     void setDefault(Long id);
+
+    Address getDefault();
 }

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

@@ -63,6 +63,11 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
         getMapper().setDefault(id,BaseContextHolder.getCompanyId());
     }
 
+    @Override
+    public Address getDefault(){
+        return getMapper().getDefault(BaseContextHolder.getCompanyId());
+    }
+
     /**
      * 通过主键删除
      * @param id

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

@@ -95,7 +95,7 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
                 }
             }
 
-            Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode());
+            Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode(), BaseContextHolder.getCompanyId());
             if (bktion != null){
                 if (id.equals(bankinformation.getId())){
                     bankinformationMapper.updateByPrimaryKeySelective(bankinformation);

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

@@ -524,8 +524,8 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
                     customerDTO.setCu_sellercode(employees.get(0).getEm_code());
                     customerDTO.setCu_sellername(employees.get(0).getEm_name());
                 }
-                customerDTO.setCu_status(Status.OPEN.getDisplay());
-                customerDTO.setCu_statuscode(Status.OPEN.name());
+                customerDTO.setCu_status(Status.ENABLE.getDisplay());
+                customerDTO.setCu_statuscode(Status.ENABLE.name());
                 //编号不存在
                 if (i == 0) {
                     customerDTO.setId(0l);

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

@@ -30,6 +30,7 @@ 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.DateUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -241,7 +242,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             String inoutCode = maxnumberService.getMaxnumber("StorageInit", true).getData();
             prodInOut.setPi_inoutno(inoutCode);     //出入库单号
             prodInOut.setPi_class("库存初始化");
-            prodInOut.setPi_date(new Date());
+
+            Calendar calendar = Calendar.getInstance();
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            prodInOut.setPi_date(calendar.getTime());   //赋值为当月第一天
             //prodInOut.setPi_total();            //含税金额
             prodInOut.setPi_status(Status.UNAUDITED.getDisplay());
             prodInOut.setPi_statuscode(Status.UNAUDITED.name());
@@ -584,8 +588,8 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
                         break;
                     }
                     product.setPr_whid(warehouse.getId());
-                    product.setPr_status(Status.OPEN.getDisplay());
-                    product.setPr_statuscode(Status.OPEN.name());
+                    product.setPr_status(Status.ENABLE.getDisplay());
+                    product.setPr_statuscode(Status.ENABLE.name());
                 }
                 //编号不存在
                 if (i == 0) {

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

@@ -453,8 +453,8 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
                 List<DataImportDetail> data = datas.get(code);
                 DataImportDetail main = dataImportMapper.selectMainBycode(code, id, companyId);
                 Vendor vendor = JSONObject.parseObject(main.getDd_maindata(), Vendor.class);
-                vendor.setVe_status(Status.OPEN.getDisplay());
-                vendor.setVe_statuscode(Status.OPEN.name());
+                vendor.setVe_status(Status.ENABLE.getDisplay());
+                vendor.setVe_statuscode(Status.ENABLE.name());
                 //编号不存在
                 if (i == 0) {
                     vendor.setId(0l);

+ 4 - 2
applications/document/document-server/src/main/resources/mapper/AddressMapper.xml

@@ -11,6 +11,7 @@
     <result column="ad_text3" jdbcType="VARCHAR" property="ad_text3" />
     <result column="ad_text4" jdbcType="VARCHAR" property="ad_text4" />
     <result column="ad_text5" jdbcType="VARCHAR" property="ad_text5" />
+    <result column="ad_default" jdbcType="INTEGER" property="ad_default" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Address">
     <result column="ad_address" jdbcType="LONGVARCHAR" property="ad_address" />
@@ -215,7 +216,8 @@
     update address set ad_default = 1 where ad_id=#{id} and companyId=#{companyId};
     update address set ad_default = 0 where ad_id!=#{id} and companyId=#{companyId};
   </update>
-
-
+  <select id="getDefault" parameterType="long" resultType="com.usoftchina.saas.document.entities.Address">
+      SELECT * FROM ADDRESS WHERE AD_DEFAULT = 1 AND COMPANYID = #{companyId}
+  </select>
 
 </mapper>

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

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

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

@@ -464,7 +464,7 @@
         <result column="pw_amount" property="rc_amount" jdbcType="DOUBLE"/>
     </resultMap>
     <select id="selectReserveCost" resultMap="ProdReserveCostResultMap">
-        select * from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
+        select * from productWH tab left join Product on pw_prodid=pr_id left join warehouse on pw_whid=wh_id
         <where>
             <if test="con!=null">
                 ${con}
@@ -478,7 +478,7 @@
     </select>
     <select id="selectReserveCostByIgnoreWarehouse" resultMap="ProdReserveCostResultMap">
         select pr_code,pr_spec,pr_detail,pr_unit,sum(pw_onhand) pw_onhand,sum(pw_amount) pw_amount
-        from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
+        from productWH tab left join Product on pw_prodid=pr_id left join warehouse on pw_whid=wh_id
         <where>
             <if test="con!=null">
                 ${con}
@@ -493,7 +493,7 @@
     </select>
     <select id="selectCalculateFields" resultType="string">
         select   ${fields}
-        from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whid=wh_id
+        from productWH tab left join Product on pw_prodid=pr_id left join warehouse on pw_whid=wh_id
         <where>
             <if test="con != null">
                 ${con}

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

@@ -31,6 +31,7 @@
         <result column="ve_beginym" property="ve_beginym" jdbcType="INTEGER" />
         <result column="ve_preamount" property="ve_preamount" jdbcType="DOUBLE" />
         <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
+        <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
     </resultMap>
     <resultMap id="VendorDTOResultMapper" type="com.usoftchina.saas.document.dto.VendorDTO">
         <id column="ve_id" property="id" jdbcType="INTEGER" />
@@ -40,6 +41,7 @@
         <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
         <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
         <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
+        <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
     </resultMap>
 
     <select id="getVendorsByCondition" resultMap="VendorDTOResultMapper">
@@ -73,6 +75,7 @@
         <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
         <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
         <result column="ve_leftamount" property="ve_leftamount" jdbcType="INTEGER" />
+        <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
         <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
         <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
         <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
@@ -112,7 +115,7 @@
         ve_promisedays, ve_taxrate, ve_nsrzh, ve_bankaccount, ve_bankcode, ve_status, ve_statuscode,
         companyId, updaterId, updateTime, ve_text1,
         ve_text2, ve_text3, ve_text4, ve_text5, ve_payamount, ve_leftamount, ve_beginym, ve_preamount,ve_remark,
-        ve_buyerid,ve_buyercode,ve_buyername
+        ve_buyerid,ve_buyercode,ve_buyername,ve_address
     </sql>
     <select id="selectByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Long" >
         select
@@ -230,7 +233,10 @@
                 ve_buyercode,
             </if>
             <if test="ve_buyername!=null">
-                ve_buyername
+                ve_buyername,
+            </if>
+            <if test="ve_address!=null">
+                ve_address
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -334,7 +340,10 @@
                 #{ve_buyercode,jdbcType=VARCHAR},
             </if>
             <if test="ve_buyername != null">
-                #{ve_buyername,jdbcType=VARCHAR}
+                #{ve_buyername,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_address != null">
+                #{ve_address,jdbcType=VARCHAR}
             </if>
         </trim>
     </insert>
@@ -432,7 +441,10 @@
                 ve_buyercode = #{ve_buyercode,jdbcType=VARCHAR},
             </if>
             <if test="ve_buyername != null" >
-                ve_buyername = #{ve_buyername,jdbcType=VARCHAR}
+                ve_buyername = #{ve_buyername,jdbcType=VARCHAR},
+            </if>
+            <if test="ve_address != null">
+                ve_address = #{ve_address,jdbcType=VARCHAR}
             </if>
         </set>
         where ve_id = #{id}

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

@@ -38,7 +38,7 @@ public class PaybalanceController {
     }
 
     @Transactional
-    @PostMapping("/deleteDetail/{id}")
+    @PostMapping("/deleteDetail1/{id}")
     public Result deleteItem(@PathVariable("id") int id){
         paybalanceService.deleteItem(id);
         return Result.success();

+ 11 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ProfitdetailMapper.java

@@ -0,0 +1,11 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Profitpresent;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ProfitdetailMapper {
+    List<Profitpresent> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
+}

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VerificationMapper.java

@@ -40,4 +40,6 @@ public interface VerificationMapper extends CommonBaseMapper<Verification> {
     String validateResAudit(@Param("id") Long id);
 
     int validateSetAcount(@Param("detno") int detno,@Param("companyid")Long companyid);
+
+    void updateAuditMsg (@Param("id") Long id,@Param("userName")String userName);
 }

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

@@ -21,6 +21,43 @@ public class Custmonth {
 
     private Integer companyid;
 
+    private Double cm_beginpreamount;
+    private Double cm_nowpayamount;
+    private Double cm_nowprepayamount;
+    private Double cm_endpreamount;
+
+    public Double getCm_beginpreamount() {
+        return cm_beginpreamount;
+    }
+
+    public void setCm_beginpreamount(Double cm_beginpreamount) {
+        this.cm_beginpreamount = cm_beginpreamount;
+    }
+
+    public Double getCm_nowpayamount() {
+        return cm_nowpayamount;
+    }
+
+    public void setCm_nowpayamount(Double cm_nowpayamount) {
+        this.cm_nowpayamount = cm_nowpayamount;
+    }
+
+    public Double getCm_nowprepayamount() {
+        return cm_nowprepayamount;
+    }
+
+    public void setCm_nowprepayamount(Double cm_nowprepayamount) {
+        this.cm_nowprepayamount = cm_nowprepayamount;
+    }
+
+    public Double getCm_endpreamount() {
+        return cm_endpreamount;
+    }
+
+    public void setCm_endpreamount(Double cm_endpreamount) {
+        this.cm_endpreamount = cm_endpreamount;
+    }
+
     public Integer getCm_id() {
         return cm_id;
     }

+ 109 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Profitpresent.java

@@ -0,0 +1,109 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+/**
+ * @author heqw
+ * @date 2018/12/10 10:45
+ **/
+public class Profitpresent {
+    private Date pi_date;
+    private Integer pi_ym;
+    private String pi_custcode;
+    private String pi_custname;
+    private String cu_sellername;
+    private Double saamount;
+    private Double netamount;
+    private Double costamount;
+    private Double profit;
+    private Double profitpresent;
+    private String cu_type;
+
+    public String getCu_type() {
+        return cu_type;
+    }
+
+    public void setCu_type(String cu_type) {
+        this.cu_type = cu_type;
+    }
+
+    public Date getPi_date() {
+        return pi_date;
+    }
+
+    public void setPi_date(Date pi_date) {
+        this.pi_date = pi_date;
+    }
+
+    public Integer getPi_ym() {
+        return pi_ym;
+    }
+
+    public void setPi_ym(Integer pi_ym) {
+        this.pi_ym = pi_ym;
+    }
+
+    public String getPi_custcode() {
+        return pi_custcode;
+    }
+
+    public void setPi_custcode(String pi_custcode) {
+        this.pi_custcode = pi_custcode;
+    }
+
+    public String getPi_custname() {
+        return pi_custname;
+    }
+
+    public void setPi_custname(String pi_custname) {
+        this.pi_custname = pi_custname;
+    }
+
+    public String getCu_sellername() {
+        return cu_sellername;
+    }
+
+    public void setCu_sellername(String cu_sellername) {
+        this.cu_sellername = cu_sellername;
+    }
+
+    public Double getSaamount() {
+        return saamount;
+    }
+
+    public void setSaamount(Double saamount) {
+        this.saamount = saamount;
+    }
+
+    public Double getNetamount() {
+        return netamount;
+    }
+
+    public void setNetamount(Double netamount) {
+        this.netamount = netamount;
+    }
+
+    public Double getCostamount() {
+        return costamount;
+    }
+
+    public void setCostamount(Double costamount) {
+        this.costamount = costamount;
+    }
+
+    public Double getProfit() {
+        return profit;
+    }
+
+    public void setProfit(Double profit) {
+        this.profit = profit;
+    }
+
+    public Double getProfitpresent() {
+        return profitpresent;
+    }
+
+    public void setProfitpresent(Double profitpresent) {
+        this.profitpresent = profitpresent;
+    }
+}

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

@@ -20,6 +20,42 @@ public class Vendmonth {
     private Double vm_endamount;
 
     private Integer companyid;
+    private Double vm_beginpreamount;
+    private Double vm_nowpayamount;
+    private Double vm_nowprepayamount;
+    private Double vm_endpreamount;
+
+    public Double getVm_beginpreamount() {
+        return vm_beginpreamount;
+    }
+
+    public void setVm_beginpreamount(Double vm_beginpreamount) {
+        this.vm_beginpreamount = vm_beginpreamount;
+    }
+
+    public Double getVm_nowpayamount() {
+        return vm_nowpayamount;
+    }
+
+    public void setVm_nowpayamount(Double vm_nowpayamount) {
+        this.vm_nowpayamount = vm_nowpayamount;
+    }
+
+    public Double getVm_nowprepayamount() {
+        return vm_nowprepayamount;
+    }
+
+    public void setVm_nowprepayamount(Double vm_nowprepayamount) {
+        this.vm_nowprepayamount = vm_nowprepayamount;
+    }
+
+    public Double getVm_endpreamount() {
+        return vm_endpreamount;
+    }
+
+    public void setVm_endpreamount(Double vm_endpreamount) {
+        this.vm_endpreamount = vm_endpreamount;
+    }
 
     public Integer getVm_id() {
         return vm_id;

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

@@ -43,6 +43,8 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     private CustmonthMapper custmonthMapper;
     @Autowired
     private BanksubledgerMapper banksubledgerMapper;
+    @Autowired
+    private ProfitdetailMapper profitdetailMapper;
 
     @Override
     public Map<String, Object> vendorCheck(PageRequest page, ListReqDTO req) {
@@ -278,6 +280,11 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
                 res = banksubledgerMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
+        }else if("profitdetails".equals(type)){
+            list = profitdetailMapper.selectByCondition(con, companyId);
+            if (!StringUtils.isEmpty(calculateFieldsSql)) {
+                res = profitdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+            }
         }
 
         try {

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

@@ -226,8 +226,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                     throw new BizException(code, error);
                 }
                 if(amount.doubleValue()<0 && nowbalanceDet.doubleValue()>0){
-                    String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
-                    int code = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getCode();
+                    String msg = BizExceptionCode.MONEY_NOWAMOUNT_NEGATIVE.getMessage();
+                    int code = BizExceptionCode.MONEY_NOWAMOUNT_NEGATIVE.getCode();
                     String error = String.format(msg, det.getVd_slkind());
                     throw new BizException(code, error);
                 }
@@ -247,8 +247,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                     throw new BizException(code, error);
                 }
                 if(amount.doubleValue()<0 && nowbalanceDet.doubleValue()>0){
-                    String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
-                    int code = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getCode();
+                    String msg = BizExceptionCode.MONEY_NOWAMOUNT_NEGATIVE.getMessage();
+                    int code = BizExceptionCode.MONEY_NOWAMOUNT_NEGATIVE.getCode();
                     String error = String.format(msg, detail.getVcd_slkind());
                     throw new BizException(code, error);
                 }
@@ -274,10 +274,17 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         String kind = verification.getVc_kind();
         subledger.setCompanyId(BaseContextHolder.getCompanyId());
         subledger.setSl_code(verification.getVc_code());
-        kind = transferKind(kind);
-        subledger.setSl_kind(kind);
+
         if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable") ||
                 kind.equals("receivable_offset_payable")){
+
+            /*
+             ['receipts_offset_receivable', '预收冲应收'],
+                ['prepaid_offset_payable', '预付冲应付'],
+                ['receivable_offset_payable', '应收冲应付'],
+                ['receivable_to_receivable', '应收转应收'],
+                ['payable_to_payable', '应付转应付']
+             */
             subledger.setSl_custid(0);
             subledger.setSl_vendid(verification.getVc_vendid());
         }else{
@@ -297,8 +304,10 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable")){
             subledger.setSl_preamount(-amount1);
         }else{
-            subledger.setSl_preamount(amount1);
+            subledger.setSl_preamount(new Double(0));
         }
+        kind = transferKind(kind);
+        subledger.setSl_kind(kind);
         return subledger;
     }
     /**
@@ -521,9 +530,9 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     @Override
     public void deleteDetail2(Long id) {
         if (null != id) {
-            verificationdetailMapper.deleteByParentPrimaryKey(id);
             Verificationdetail verificationdetail = verificationdetailMapper.selectByPrimaryKey(Integer.valueOf(String.valueOf(id)));
-            Verification verification = verificationMapper.selectByPrimaryKey(verificationdetail.getVcd_vcid());
+            Verification verification = verificationMapper.selectByPrimaryKey(verificationdetail.getVcd_vcid().intValue());
+            verificationdetailMapper.deleteByParentPrimaryKey(id);
             DocBaseDTO baseDTO = new DocBaseDTO();
             baseDTO.setId(id);
             baseDTO.setCode(verification.getVc_code());
@@ -543,8 +552,6 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         formData.getMain().setVc_auditdate(new Date());
         baseDTO = this.saveFormData(formData);
         Long id = baseDTO.getId();
-
-
             VerificationDTO verificationDTO = formData.getMain();
             Subledger subledger = changSubledgerUntil(verificationDTO);
             subledgerMapper.insertSelective(subledger);
@@ -573,7 +580,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
 
         //更新出入库状态
         this.updateProdInoutStatus(id);
-
+        //更新审核人和审核日期
+        verificationMapper.updateAuditMsg(id,BaseContextHolder.getUserName());
         baseDTO.setId(id);
         baseDTO.setName(BillCodeSeq.VERIFICATION.getCaller());
         baseDTO.setCode(formData.getMain().getVc_code());
@@ -801,7 +809,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
 
         DocBaseDTO baseDTO = new DocBaseDTO();
         baseDTO.setId(id);
-        baseDTO.setCode(code);
+        baseDTO.setCode(nowverification.getVc_code());
         baseDTO.setName("Verification");
         //日志
         messageLogService.unAudit(baseDTO);

+ 4 - 1
applications/money/money-server/src/main/resources/application.yml

@@ -73,4 +73,7 @@ logging:
   level:
      com.usoftchina.saas.money.mapper : debug
 auth:
-  public-key: auth/pub.key
+  public-key: auth/pub.key
+ribbon:
+  ReadTimeout: 6000
+  ConnectTimeout: 6000

+ 5 - 1
applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml

@@ -12,10 +12,14 @@
     <result column="cm_nowpreamount" property="cm_nowpreamount" jdbcType="DOUBLE" />
     <result column="cm_endamount" property="cm_endamount" jdbcType="DOUBLE" />
     <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="cm_beginpreamount" property="cm_beginpreamount" jdbcType="DOUBLE" />
+    <result column="cm_nowpayamount" property="cm_nowpayamount" jdbcType="DOUBLE" />
+    <result column="cm_nowprepayamount" property="cm_nowprepayamount" jdbcType="DOUBLE" />
+    <result column="cm_endpreamount" property="cm_endpreamount" jdbcType="DOUBLE" />
   </resultMap>
   <sql id="Base_Column_List" >
     cm_id, cm_yearmonth, cm_custid, cm_custcode, cm_custname, CM_BEGINAMOUNT, CM_NOWAMOUNT, 
-    CM_NOWPREAMOUNT, CM_ENDAMOUNT, companyid
+    CM_NOWPREAMOUNT, CM_ENDAMOUNT, companyid,cm_endpreamount,cm_nowprepayamount,cm_nowpayamount,cm_beginpreamount
   </sql>
 
   <select id="selectByCondition" resultMap="BaseResultMap">

+ 139 - 0
applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml

@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.ProfitdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Profitpresent" >
+    <result column="pi_ym" property="pi_ym" jdbcType="INTEGER" />
+    <result column="pi_custcode" property="pi_custcode" jdbcType="VARCHAR" />
+    <result column="pi_custname" property="pi_custname" jdbcType="VARCHAR" />
+	  <result column="cu_type" property="cu_type" jdbcType="VARCHAR" />
+    <result column="cu_sellername" property="cu_sellername" jdbcType="VARCHAR" />
+    <result column="saamount" property="saamount" jdbcType="DOUBLE" />
+    <result column="netamount" property="netamount" jdbcType="DOUBLE" />
+    <result column="costamount" property="costamount" jdbcType="DOUBLE" />
+    <result column="profit" property="profit" jdbcType="DOUBLE" />
+    <result column="profitpresent" property="profitpresent" jdbcType="DOUBLE" />
+    <result column="pi_date" property="pi_date" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    cu_type, pi_custcode, pi_custname, cu_sellername, saamount, netamount, costamount, profit,
+    profitpresent
+  </sql>
+
+  <select id="selectByCondition" parameterType="java.lang.Long" resultMap="BaseResultMap">
+   SELECT
+	a.pi_custcode,
+	a.pi_custname,
+	a.cu_type,
+	a.cu_sellername,
+	  IFNULL(a.saamount,0) as saamount,
+	  IFNULL(a.netamount,0) as netamount,
+	  IFNULL(a.costamount,0) as costamount,
+	  IFNULL(SUM(a.netamount - a.costamount),0) as profit,
+	  IFNULL((SUM(a.netamount - a.costamount)/IFNULL(a.netamount,SUM(a.netamount - a.costamount))),0) as profitpresent
+
+FROM
+	(
+		SELECT
+			pi_custcode,
+			pi_custname,
+	        cu_type,
+			cu_sellername,
+	  SUM(
+	  IFNULL(pd_sendprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
+	  ) AS saamount,
+	  SUM(
+	  IFNULL(pd_netprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
+	  ) AS netamount,
+	  SUM(
+	  IFNULL(pd_price,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
+	  ) AS costamount
+		FROM
+			prodinout,
+			prodiodetail,
+			customer
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  prodinout.companyid = #{companyId}
+      </if>
+    </where>
+		and	pi_id = pd_piid
+		AND pi_custid = cu_id and pi_status = '已审核' and
+prodinout.companyid= prodiodetail.companyid
+		GROUP BY
+			pi_custcode,
+			pi_custname,
+	        cu_type,
+			cu_sellername
+	) a
+	  where saamount + netamount + costamount != 0
+	  GROUP BY
+			a.pi_custcode,
+			a.pi_custname,
+	        a.cu_type,
+			a.cu_sellername
+	  ORDER BY a.pi_custname asc,a.pi_custname desc
+  </select>
+
+	<select id="selectCalculateFields" resultType="string">
+		SELECT ${fields}
+		FROM
+		(
+		SELECT
+		a.pi_custcode,
+		a.pi_custname,
+		a.cu_type,
+		a.cu_sellername,
+		IFNULL(a.saamount,0) as saamount,
+		IFNULL(a.netamount,0) as netamount,
+		IFNULL(a.costamount,0) as costamount,
+		IFNULL(SUM(a.netamount - a.costamount),0) as profit,
+		IFNULL((SUM(a.netamount - a.costamount)/IFNULL(a.netamount,SUM(a.netamount - a.costamount))),0) as profitpresent
+
+		FROM
+		(
+		SELECT
+		pi_custcode,
+		pi_custname,
+		cu_type,
+		cu_sellername,
+		SUM(
+		IFNULL(pd_sendprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
+		) AS saamount,
+		SUM(
+		IFNULL(pd_netprice,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
+		) AS netamount,
+		SUM(
+		IFNULL(pd_price,0) * (IFNULL(pd_outqty,0) - IFNULL(pd_inqty,0))
+		) AS costamount
+		FROM
+		prodinout,
+		prodiodetail,
+		customer
+		<where>
+			<if test="con != null">
+				${con}
+			</if>
+			<if test="companyId != null">
+				and  prodinout.companyid = #{companyId}
+			</if>
+		</where>
+		and	pi_id = pd_piid
+		AND pi_custid = cu_id and pi_status = '已审核' and
+		prodinout.companyid= prodiodetail.companyid and prodiodetail.companyid = prodinout.companyid
+		GROUP BY
+		pi_custcode,
+		pi_custname,
+		cu_type,
+		cu_sellername
+		) a
+		GROUP BY
+		a.pi_custcode,
+		a.pi_custname,
+		a.cu_type,
+		a.cu_sellername)b
+	</select>
+
+</mapper>

+ 5 - 1
applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml

@@ -12,10 +12,14 @@
     <result column="vm_nowpreamount" property="vm_nowpreamount" jdbcType="DOUBLE" />
     <result column="vm_endamount" property="vm_endamount" jdbcType="DOUBLE" />
     <result column="companyid" property="companyid" jdbcType="INTEGER" />
+    <result column="vm_beginpreamount" property="vm_beginpreamount" jdbcType="DOUBLE" />
+    <result column="vm_nowpayamount" property="vm_nowpayamount" jdbcType="DOUBLE" />
+    <result column="vm_nowprepayamount" property="vm_nowprepayamount" jdbcType="DOUBLE" />
+    <result column="vm_endpreamount" property="vm_endpreamount" jdbcType="DOUBLE" />
   </resultMap>
   <sql id="Base_Column_List" >
     vm_id, vm_yearmonth, vm_vendid, VM_VENDCODE, VM_VENDNAME, VM_BEGINAMOUNT, VM_NOWAMOUNT, 
-    VM_NOWPREAMOUNT, VM_ENDAMOUNT, companyid
+    VM_NOWPREAMOUNT, VM_ENDAMOUNT, companyid,vm_endpreamount,vm_nowprepayamount,vm_nowpayamount,vm_beginpreamount
   </sql>
 
   <select id="selectByCondition" resultMap="BaseResultMap">

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

@@ -619,7 +619,7 @@
     select count(1) from periodsdetail where pd_detno = #{detno} and IFNULL(pd_status,0)=99
     and companyid= #{companyid}
   </select>
-  <select id="checkStatus" resultType="int">
-    select count(1) from Verification where ifnull(vc_statuscode,'')='AUDITED' and vc_id= #{id,jdbcType=INTEGER}
-  </select>
+  <update id="updateAuditMsg">
+    update verification set vc_auditman  = #{userName},vc_auditdate = NOW() where vc_id = #{id}
+  </update>
 </mapper>

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

@@ -87,6 +87,10 @@ public class ProdIODetailDTO extends CommonBaseDTO implements Serializable {
 
     private Long pd_ioid;
 
+    private String iocode;
+
+    private Integer iodetno;
+
     private ProductDTO productDTO;
 
 }

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

@@ -82,6 +82,10 @@ public class ProdIODetail extends CommonBaseEntity implements Serializable {
 
     private Long pd_ioid;
 
+    private String iocode;
+
+    private Integer iodetno;
+
     private ProductDTO productDTO;
 
 }

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

@@ -425,14 +425,14 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     public Result turnProdOut(Long id) {
         ProdInOut sourcePi = getMapper().selectByPrimaryKey(id);
         Integer count=0;
-        double pdInqty=0, pdYqty=0;
+        double pdInqty=0.0, pdYqty=0.0;
         Long userId = BaseContextHolder.getUserId();
         String userName = BaseContextHolder.getUserName();
         List<ProdIODetail> sourcePids =prodIODetailMapper.selectByFK(id);
         //检查从表
         for (ProdIODetail prodIODetail : sourcePids) {
-            pdInqty = prodIODetail.getPd_inqty();
-            pdYqty = prodIODetail.getPd_yqty();
+            pdInqty = prodIODetail.getPd_inqty() == null ? 0.0 : prodIODetail.getPd_inqty();
+            pdYqty = prodIODetail.getPd_yqty() == null ? 0.0 : prodIODetail.getPd_yqty();
             if (pdInqty-pdYqty>0){
                 count++;
             }
@@ -458,8 +458,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_ioid(sourcePi.getId());
         targetPi.setPi_iocode(sourcePi.getPi_inoutno());
         //设置付款状态
-        targetPi.setPi_prstatus(Status.RECNONE.getDisplay());
-        targetPi.setPi_prstatuscode(Status.RECNONE.name());
+        targetPi.setPi_prstatus(Status.PAYNONE.getDisplay());
+        targetPi.setPi_prstatuscode(Status.PAYNONE.name());
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());

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

@@ -475,6 +475,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 prodIODetail.setUpdaterId(userId);
                 prodIODetail.setUpdateTime(new Date());
                 prodIODetail.setUpdaterName(userName);
+                prodIODetail.setPd_yqty(0.0);
                 //本次转单数
                 prodIODetail.setPd_inqty(pdQty-pdYqty);
                 prodIODetailMapper.insertSelective(prodIODetail);

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

@@ -76,4 +76,4 @@ auth:
   public-key: auth/pub.key
 ribbon:
   ReadTimeout: 6000
-  ConnectTimeout: 2000
+  ConnectTimeout: 6000

+ 6 - 2
applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -43,6 +43,8 @@
     <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="iocode" jdbcType="VARCHAR" property="iocode" />
+    <result column="iodetno" jdbcType="INTEGER" property="iodetno" />
     <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
       <id column="pr_id" property="id"/>
       <result column="pr_code" property="pr_code"/>
@@ -644,8 +646,10 @@
 
 
   <select id="selectByFK" parameterType="long" resultMap="BaseResultMap">
-    select * from prodiodetail a left join product b on b.pr_id= a.pd_prodid and a.companyid = b.companyid
-    where pd_piid=#{id} order by pd_pdno
+    select pd.*,prod.*,iopd.pd_inoutno iocode,iopd.pd_pdno iodetno from prodiodetail pd
+     left join product prod on prod.pr_id= pd.pd_prodid and pd.companyid = prod.companyid
+     left join prodiodetail iopd on iopd.pd_id = pd.pd_ioid and iopd.companyid = pd.companyid
+    where pd.pd_piid=#{id} order by pd.pd_pdno
   </select>
 
   <delete id="deleteByFK" parameterType="java.lang.Long">

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

@@ -72,4 +72,8 @@ public class ProdInOutDTO extends CommonBaseDTO implements Serializable {
     private String pi_auditman;
 
     private Date pi_auditdate;
+
+    private String pi_prstatuscode;
+
+    private String pi_prstatus;
 }

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

@@ -132,4 +132,8 @@ public class ProdInOutListDTO extends CommonBaseDTO implements Serializable {
     private String pd_remark;
 
     private String pi_remark;
+
+    private String pi_prstatus;
+
+    private String pi_prstatuscode;
 }

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

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

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

@@ -58,4 +58,6 @@ public class SaleProfitView {
     private Double pd_profitpresent;
 
     private Double pw_costprice;
+
+    private Date pi_date;
 }

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

@@ -109,8 +109,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         prodInOut.setPi_class(main.getPi_class());
         prodInOut.setPi_said(main.getPi_said());
         prodInOut.setPi_sacode(main.getPi_sacode());
-
         prodInOut.setPi_remark(main.getPi_remark());
+
+        prodInOut.setPi_prstatus(prodInOut.getPi_prstatus()==null?Status.RECNONE.getDisplay():prodInOut.getPi_prstatus() );
+        prodInOut.setPi_prstatuscode(prodInOut.getPi_printstatuscode()==null?Status.RECNONE.name():prodInOut.getPi_printstatuscode());
         //判断更新与保存动作
         if (StringUtils.isEmpty(pi_id) || "0".equals(pi_id.toString())){
             //插入操作
@@ -412,7 +414,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (null == con) {
             con = "1=1";
         }
-        if (null == req || StringUtils.isEmpty(req.getMode()) || "Main".equals(req.getMode())) {
+        if (null == req || StringUtils.isEmpty(req.getMode()) || "MAIN".equals(req.getMode())) {
             list = prodInOutListMapper.selectProdInOutListByCondition(con, companyId);
         } else {
             list = prodInOutListMapper.selectProdInOutBycondition(con, companyId);
@@ -423,8 +425,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     @Override
     public DocBaseDTO turnProdin(Long id) {
         Integer count=0;
-        double pdOutqty=0;
-        double pdYqty=0;
+        double pdOutqty=0.0;
+        double pdYqty=0.0;
         double pdSendPrice = 0.0;
         double pdTaxrate = 0.0;
         DocBaseDTO baseDTO = new DocBaseDTO();
@@ -462,7 +464,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());
-        targetPi.setCreatorId(BaseContextHolder.getUserId());
+
         targetPi.setPi_ioid(id);
         targetPi.setPi_inoutno(piInoutno);
         targetPi.setPi_class(BillCodeSeq.SALEIN.getName());
@@ -476,10 +478,17 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_said(sourcePi.getPi_said());
         targetPi.setPi_sacode(sourcePi.getPi_sacode());
         targetPi.setPi_address(sourcePi.getPi_address());
+        //收款状态
+        targetPi.setPi_prstatus(Status.PAYNONE.getDisplay());
+        targetPi.setPi_prstatuscode(Status.PAYNONE.name());
+        //来源的单号
+        targetPi.setPi_ioid(sourcePi.getId());
+        targetPi.setPi_iocode(sourcePi.getPi_inoutno());
         //保存数据
         getMapper().insertSelective(targetPi);
         //插入销售退货单从表
         long pi_id = targetPi.getId();
+        getMapper().updateCreator(BaseContextHolder.getUserId(), BaseContextHolder.getUserName(),pi_id);
         for (int i = 0;i<sourceDetails.size();i++){
             ProdIODetail sourcePid = sourceDetails.get(i);
             ProdIODetail targetPid = new ProdIODetail();

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

@@ -163,6 +163,7 @@ public class SaleServiceImpl implements SaleService{
                 detail.setCreatorId(userId);
                 detail.setCreatorName(BaseContextHolder.getUserName());
                 detail.setCreateTime(new Date());
+                detail.setSd_yqty(0.0);
                 insertDetails.add(detail);
             } else {
                 updateDetails.add(detail);
@@ -286,6 +287,11 @@ public class SaleServiceImpl implements SaleService{
         if (null != code) {
             throw new BizException(BizExceptionCode.SALE_ALREADY_UNAUDIT);
         }
+        //单据状态为已关闭,无法审核
+        code = saleMapper.validateCloseStatus(id);
+        if (null != code) {
+            throw new BizException(BizExceptionCode.SALE_CLOSE.getCode(),String.format(BizExceptionCode.SALE_CLOSE.getMessage(),"反审核"));
+        }
         //检测出货状态为未出货
         Integer num = saleMapper.checkSendStatus(id);
         if (num > 0) {
@@ -432,7 +438,7 @@ public class SaleServiceImpl implements SaleService{
 
         //检查从表
         for (SaleDetail detail : details) {
-            pdQty = detail.getSd_qty();
+            pdQty = detail.getSd_qty()==null?0.0:detail.getSd_qty();
             pdYqty = detail.getSd_yqty() == null ? 0 : detail.getSd_yqty();
             if (pdQty - pdYqty > 0){
                 count++;
@@ -463,6 +469,8 @@ public class SaleServiceImpl implements SaleService{
         prodInOut.setCompanyId(companyId);
         prodInOut.setPi_address(sale.getSa_toplace());
 
+        prodInOut.setPi_prstatus(Status.RECNONE.getDisplay());
+        prodInOut.setPi_prstatuscode(Status.RECNONE.name());
         prodInOutMapper.insertSelective(prodInOut);
         //插入出货单从表
         long pi_id = prodInOut.getId();
@@ -483,6 +491,10 @@ public class SaleServiceImpl implements SaleService{
             prodIODetail.setPd_taxrate(saleDetail.getSd_taxrate());
             //公司id
             prodIODetail.setCompanyId(companyId);
+            //如果已转数等于转单数量 不处理该单据
+            if (saleDetail.getSd_qty() - (saleDetail.getSd_yqty() == null ? 0 : saleDetail.getSd_yqty()) == 0) {
+                continue;
+            }
             //本次转单数
             prodIODetail.setPd_outqty(saleDetail.getSd_qty() - (saleDetail.getSd_yqty() == null ? 0 : saleDetail.getSd_yqty()));
             //获取物料默认仓库

+ 4 - 1
applications/sale/sale-server/src/main/resources/application.yml

@@ -68,4 +68,7 @@ mybatis:
   type-aliases-package: com.usoftchina.saas.commons.po
   mapper-locations: classpath:mapper/*.xml
 auth:
-  public-key: auth/pub.key
+  public-key: auth/pub.key
+ribbon:
+  ReadTimeout: 6000
+  ConnectTimeout: 6000

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

@@ -72,6 +72,8 @@
     <result column="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
     <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
     <result column="pd_ordertotal" jdbcType="DOUBLE" property="pd_ordertotal" />
+    <result column="pi_ioid" jdbcType="INTEGER" property="pi_ioid" />
+    <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
   </resultMap>
 
   <resultMap id="homePageList" type="com.usoftchina.saas.sale.po.ProdHomePageList">
@@ -103,6 +105,8 @@
     <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="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
+    <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
     <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" />

+ 30 - 6
applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -35,6 +35,8 @@
     <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
     <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
       <result column="pi_ioid" jdbcType="INTEGER" property="pi_ioid" />
+    <result column="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
+    <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.storage.po.ProdInOut">
     <result column="pi_address" jdbcType="LONGVARCHAR" property="pi_address" />
@@ -100,7 +102,7 @@
   <sql id="Base_Column_List">
     pi_id, pi_inoutno, pi_class, pi_date, pi_vendid, pi_vendcode, pi_vendname, pi_custid, 
     pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode,
-    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5
+    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5,pi_prstatus,pi_prstatuscode
   </sql>
   <sql id="Blob_Column_List">
     pi_address,pi_remark
@@ -125,7 +127,7 @@
       pi_printstatuscode, companyid, updaterid, 
       updatetime, pi_text1, pi_text2, 
       pi_text3, pi_text4, pi_text5,
-      pi_address,pi_remark)
+      pi_address,pi_remark,pi_prstatus,pi_prstatuscode)
     values (#{pi_id,jdbcType=INTEGER}, #{pi_inoutno,jdbcType=VARCHAR}, #{pi_class,jdbcType=VARCHAR}, 
       #{pi_date,jdbcType=TIMESTAMP}, #{pi_vendid,jdbcType=INTEGER}, #{pi_vendcode,jdbcType=VARCHAR}, 
       #{pi_vendname,jdbcType=VARCHAR}, #{pi_custid,jdbcType=INTEGER}, #{pi_custcode,jdbcType=VARCHAR}, 
@@ -136,7 +138,7 @@
       #{updatetime,jdbcType=TIMESTAMP}, #{pi_text1,jdbcType=VARCHAR}, #{pi_text2,jdbcType=VARCHAR}, 
       #{pi_text3,jdbcType=VARCHAR}, #{pi_text4,jdbcType=VARCHAR}, #{pi_text5,jdbcType=VARCHAR}, 
       #{pi_address,jdbcType=LONGVARCHAR},
-      #{pi_remark,jdbcType=LONGVARCHAR})
+      #{pi_remark,jdbcType=LONGVARCHAR}, #{pi_prstatus,jdbcType=VARCHAR}, #{pi_prstatuscode,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
     <selectKey resultType="java.lang.Long" keyProperty="id">
@@ -235,6 +237,12 @@
         <if test="pi_ioid != null">
             pi_ioid,
         </if>
+      <if test="pi_prstatus!=null">
+        pi_prstatus,
+      </if>
+      <if test="pi_prstatuscode!=null">
+        pi_prstatuscode,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -323,11 +331,17 @@
         #{pi_remark,jdbcType=LONGVARCHAR},
       </if>
       <if test="pi_iocode != null">
-        #{pi_iocode,jdbcType=LONGVARCHAR},
+        #{pi_iocode,jdbcType=VARCHAR},
       </if>
         <if test="pi_ioid != null">
             #{pi_ioid},
         </if>
+      <if test="pi_prstatus!=null">
+        #{pi_prstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_prstatuscode!=null">
+        #{pi_prstatuscode,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
@@ -417,6 +431,12 @@
       <if test="pi_remark != null">
         pi_remark = #{pi_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pi_prstatus!=null">
+        pi_prstatus = #{pi_prstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_prstatuscode!=null">
+        pi_prstatuscode = #{pi_prstatuscode,jdbcType=VARCHAR},
+      </if>
     </set>
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
@@ -449,7 +469,9 @@
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
       pi_text5 = #{pi_text5,jdbcType=VARCHAR},
       pi_address = #{pi_address,jdbcType=LONGVARCHAR},
-      pi_remark = #{pi_remark,jdbcType=LONGVARCHAR}
+      pi_remark = #{pi_remark,jdbcType=LONGVARCHAR},
+      pi_prstatus= #{pi_prstatus,jdbcType=VARCHAR},
+      pi_prstatuscode= #{pi_prstatuscode,jdbcType=VARCHAR}
     where pi_id = #{pi_id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
@@ -481,7 +503,9 @@
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
       pi_text5 = #{pi_text5,jdbcType=VARCHAR},
       pi_address = #{pi_address,jdbcType=LONGVARCHAR},
-      pi_remark = #{pi_remark,jdbcType=LONGVARCHAR}
+      pi_remark = #{pi_remark,jdbcType=LONGVARCHAR},
+      pi_prstatus= #{pi_prstatus,jdbcType=VARCHAR},
+      pi_prstatuscode= #{pi_prstatuscode,jdbcType=VARCHAR}
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectCodeById" resultType="string" parameterType="long">

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

@@ -28,6 +28,7 @@
         <result column="sa_text3" property="sa_text3" jdbcType="VARCHAR" />
         <result column="sa_text4" property="sa_text4" jdbcType="VARCHAR" />
         <result column="sa_text5" property="sa_text5" jdbcType="VARCHAR" />
+        <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
         <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
         <result column="sd_id" property="sd_id" jdbcType="INTEGER" />
         <result column="sd_said" property="sd_said" jdbcType="INTEGER" />
@@ -81,8 +82,9 @@
         select  *  from sale left join saledetail on sa_id=sd_said left join product
         on sd_prodid = pr_id and sale.companyId = product.companyid
         <where>
+            sa_statuscode='AUDITED'
             <if test="con != null">
-                ${con}
+               and  ${con}
             </if>
             <if test="companyId != null">
                 and   sale.companyId = #{companyId}

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

@@ -7,6 +7,7 @@
     <result column="sa_sellercode" property="sa_sellercode" jdbcType="VARCHAR" />
     <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
     <result column="sa_date" property="sa_date" jdbcType="TIMESTAMP" />
+    <result column="pi_date" property="pi_date" jdbcType="TIMESTAMP" />
     <result column="pd_inoutno" property="pd_inoutno" jdbcType="VARCHAR" />
     <result column="pd_piclass" property="pd_piclass" jdbcType="VARCHAR" />
     <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR" />
@@ -37,7 +38,7 @@
         and  companyId = #{companyId}
       </if>
     </where>
-    order by sa_date desc
+    order by pi_date desc
   </select>
 
   <select id="selectCalculateFields" resultType="string">

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

@@ -309,27 +309,27 @@
     where sd_id = #{id,jdbcType=INTEGER}
   </update>
   <insert id="batchInsert" parameterType="java.util.List" >
-    insert into saledetail (sd_said, sd_detno,
+    insert into saledetail (sd_said, sd_detno,sd_code,
     sd_prodid, sd_prodcode, sd_qty,
     sd_price, sd_total, sd_taxrate,
     sd_netprice, sd_nettotal, sd_delivery,
-    sd_sendqty, sd_pdqty, sd_remark,
+    sd_sendqty, sd_pdqty, sd_yqty,sd_remark,
     companyId, updaterId, updateTime,
     sd_text1, sd_text2, sd_text3,
     sd_text4, sd_text5,
-    creatorId,createTime,creatorName, sd_yqty)
+    creatorId,createTime,creatorName)
     values
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
-      #{item.sd_said,jdbcType=INTEGER}, #{item.sd_detno,jdbcType=INTEGER},
+      #{item.sd_said,jdbcType=INTEGER}, #{item.sd_detno,jdbcType=INTEGER},#{item.sd_code,jdbcType=VARCHAR},
       #{item.sd_prodid,jdbcType=INTEGER}, #{item.sd_prodcode,jdbcType=VARCHAR}, #{item.sd_qty,jdbcType=DOUBLE},
       #{item.sd_price,jdbcType=DOUBLE}, #{item.sd_total,jdbcType=DOUBLE}, #{item.sd_taxrate,jdbcType=DOUBLE},
       #{item.sd_netprice,jdbcType=DOUBLE}, #{item.sd_nettotal,jdbcType=DOUBLE}, #{item.sd_delivery,jdbcType=TIMESTAMP},
-      #{item.sd_sendqty,jdbcType=DOUBLE}, #{item.sd_pdqty,jdbcType=DOUBLE}, #{item.sd_remark,jdbcType=VARCHAR},
+      #{item.sd_sendqty,jdbcType=DOUBLE}, #{item.sd_pdqty,jdbcType=DOUBLE}, #{item.sd_yqty,jdbcType=DOUBLE}, #{item.sd_remark,jdbcType=VARCHAR},
       #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
       #{item.sd_text1,jdbcType=VARCHAR}, #{item.sd_text2,jdbcType=VARCHAR}, #{item.sd_text3,jdbcType=VARCHAR},
       #{item.sd_text4,jdbcType=VARCHAR}, #{item.sd_text5,jdbcType=VARCHAR},
-      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR},#{item.sd_yqty,jdbcType=DOUBLE}
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

+ 2 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/ProdInOutDTO.java

@@ -72,4 +72,6 @@ public class ProdInOutDTO extends CommonBaseDTO implements Serializable {
     private String pi_remark;
 
     private Long pi_ioid;
+
+    private String pi_iocode;
 }

+ 2 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/ProdInOutListDTO.java

@@ -137,4 +137,6 @@ public class ProdInOutListDTO extends CommonBaseEntity implements Serializable {
     private String pd_remark;
 
     private String pi_remark;
+
+    private String pi_iocode;
 }

+ 4 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOut.java

@@ -72,4 +72,8 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
     private Long pi_maid;
 
     private String pi_iocode;
+
+    private String pi_prstatuscode;
+
+    private String pi_prstatus;
 }

+ 4 - 1
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java

@@ -132,7 +132,6 @@ public class ProdInOutList extends CommonBaseEntity{
 
     private String pd_remark;
 
-
     private Long pd_ioid;
 
     private Date pi_auditdate;
@@ -143,6 +142,10 @@ public class ProdInOutList extends CommonBaseEntity{
 
     private String pi_remark;
 
+    private Long pi_ioid;
+
+    private String pi_iocode;
+
     //private ProductDTO productDTO;
     private Long pr_id;
     private String pr_code;

+ 1 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/report/ProdiodetailView.java

@@ -30,5 +30,6 @@ public class ProdiodetailView implements Serializable{
     private String pd_remark;
     private Integer companyid;
 
+    private String pd_whname;
 
 }

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

@@ -103,6 +103,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
             prodIn.setPi_status("未审核");
             prodIn.setPi_statuscode("UNAUDITED");
             prodIn.setCompanyId(companyId);
+            prodIn.setCreateTime(new Date());
             prodIn.setPi_remark("盘盈单");
             prodInOutMapper.insertSelective(prodIn);
             long inid = prodIn.getId();
@@ -128,6 +129,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
                 prodInDetail.setCompanyId(companyId);
                 prodInDetail.setCreateTime(new Date());
                 prodInDetail.setCreatorId(userId);
+                prodInDetail.setCreatorName(userName);
                 prodInDetail.setPd_remark("盘盈单");
                 prodIODetailMapper.insertSelective(prodInDetail);
             }
@@ -147,6 +149,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
             prodOut.setPi_statuscode("UNAUDITED");
             prodOut.setCompanyId(companyId);
             prodOut.setPi_remark("盘亏单");
+            prodOut.setCreateTime(new Date());
             prodInOutMapper.insertSelective(prodOut);
             long outid = prodOut.getId();
             //更新录入人
@@ -168,6 +171,7 @@ public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMap
                 prodOutDetail.setCompanyId(companyId);
                 prodOutDetail.setCreateTime(new Date());
                 prodOutDetail.setCreatorId(userId);
+                prodOutDetail.setCreatorName(userName);
                 prodOutDetail.setPd_remark("盘亏单");
                 prodIODetailMapper.insertSelective(prodOutDetail);
             }

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

@@ -73,4 +73,4 @@ auth:
   public-key: auth/pub.key
 ribbon:
   ReadTimeout: 6000
-  ConnectTimeout: 2000
+  ConnectTimeout: 6000

+ 18 - 0
applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -219,6 +219,15 @@
       <if test="pd_ioid != null">
         pd_ioid,
       </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="pd_piid != null">
@@ -338,6 +347,15 @@
       <if test="pd_ioid != null">
         #{pd_ioid,jdbcType=INTEGER},
       </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="creatorName != null">
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP}
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">

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

@@ -20,6 +20,7 @@
     <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
     <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
     <result column="companyid" jdbcType="INTEGER" property="companyid" />
+    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
   </resultMap>
 
 
@@ -55,7 +56,6 @@
         and  companyid = #{companyId}
       </if>
     </where>
-    order by pi_date desc
   </select>
 
 

+ 12 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/RoleDTO.java

@@ -25,6 +25,18 @@ public class RoleDTO extends CommonBaseDTO implements Serializable{
      * 描述
      */
     private String description;
+    /**
+     * 角色
+     */
+    private Integer type;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
 
     public Long getCompanyId() {
         return companyId;

+ 1 - 1
base-servers/account/account-server/src/main/resources/application.yml

@@ -83,7 +83,7 @@ auth:
   public-key: auth/pub.key
 sso:
 #  base-url: https://sso.ubtob.com
-  base-url: https://tsso.usoftchina.com/
+  base-url: https://test-sso.uuzcc.cn
 ribbon:
   ReadTimeout: 6000
   ConnectTimeout: 2000

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

@@ -231,7 +231,7 @@ public class AuthController {
                     accountDTO = createAccountByCookieInfo(info);
                 } else {
                     logger.error(result.getMessage());
-                    ServletUtils.writeJsonPMessage(response, callback, false);
+                    //ServletUtils.writeJsonPMessage(response, callback, false);
                     return "successCallback({success:'0'})";
                 }
             } else {
@@ -242,7 +242,7 @@ public class AuthController {
                     Result updateResult = accountApi.update(BeanMapper.map(accountDTO, AccountUpdateDTO.class));
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
-                        ServletUtils.writeJsonPMessage(response, callback, false);
+                        //ServletUtils.writeJsonPMessage(response, callback, false);
                         return "successCallback({success:'0'})";
                     }
                 }
@@ -265,7 +265,7 @@ public class AuthController {
                 socketMessageApi.sendToClient(clientId, "/sso/callback",
                         JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
             }
-            ServletUtils.writeJsonPMessage(response, callback, true);
+            //ServletUtils.writeJsonPMessage(response, callback, true);
             return "successCallback({success:'1'})";
         }
         return "successCallback({success:'0'})";

+ 1 - 1
base-servers/auth/sso-api/src/test/resources/application.yml

@@ -1,3 +1,3 @@
 sso:
-  base-url: https://tsso.usoftchina.com
+  base-url: https://test-sso.uuzcc.cn
 #  base-url: https://sso.ubtob.com

+ 0 - 2
base-servers/sms/sms-server/pom.xml

@@ -27,12 +27,10 @@
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>sms-dto</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>sms-api</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 1 - 1
base-servers/sms/sms-server/src/main/resources/application.yml

@@ -60,7 +60,7 @@ management:
     health:
       show-details: always
 server:
-  port: 8680
+  port: 8700
   tomcat:
     uri-encoding: UTF-8
 info:

+ 19 - 0
base-servers/sms/sms-server/src/main/resources/config/application-docker-prod.yml

@@ -0,0 +1,19 @@
+eureka:
+  instance:
+    hostname: saas-sms-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    host: 10.10.100.103
+    port: 5672
+    virtual-host: docker
+    username: saas
+    password: select123***
+  redis:
+    host: 10.10.100.173
+    port: 6379
+logging:
+  destination: 10.10.100.160:5000

+ 12 - 0
base-servers/sms/sms-server/src/main/resources/config/application-docker-test.yml

@@ -0,0 +1,12 @@
+eureka:
+  instance:
+    hostname: saas-sms-server-test
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server-test:8515/eureka/
+spring:
+  rabbitmq:
+    virtual-host: test
+server:
+  port: 8700

+ 10 - 0
base-servers/sms/sms-server/src/main/resources/config/application-docker.yml

@@ -0,0 +1,10 @@
+eureka:
+  instance:
+    hostname: saas-sms-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    virtual-host: docker

+ 17 - 2
framework/core/src/main/java/com/usoftchina/saas/utils/RegexpUtils.java

@@ -12,7 +12,7 @@ public class RegexpUtils {
     private static final String HK_MOBILE_EXP = "^(5|6|8|9)\\d{7}$";
     private static final String EMAIL_EXP = "^\\w+([-.]\\w+)*@\\w+([-]\\w+)*\\.(\\w+([-]\\w+)*\\.)*[a-z]{2,4}$";
     private static final String SPECCHARACTER_EXP = "[\\\\s~·`!!@#¥$%^……&*(())\\\\-——\\\\-_=+【\\\\[\\\\]】{{}}\\\\|、\\\\\\\\;;::‘'“”\\\",,《<。.》>、/??]";
-
+    private static final String SPECIALCHARACTER_EXP = "[`~!@#$%^&*()+=|{}':;',\\[\\]<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
     /**
      * 匹配手机号码
      *
@@ -57,7 +57,7 @@ public class RegexpUtils {
     }
 
     /**
-     * 特殊字符替换
+     * 特殊字符替换含小写字母
      * @param str
      * @return
      */
@@ -66,4 +66,19 @@ public class RegexpUtils {
         Matcher m = p.matcher(str);
         return m.replaceAll("");
     }
+
+
+    /**
+     * 特殊字符替换
+     * @param obj
+     * @return
+     */
+    public static String replaceSpecialCharacter(Object obj){
+        if (StringUtils.isEmpty(obj)) {
+            return "";
+        }
+        Pattern p = Pattern.compile(SPECIALCHARACTER_EXP);
+        Matcher m = p.matcher(obj.toString());
+        return m.replaceAll("");
+    }
 }

+ 1 - 1
frontend/saas-portal-web/config/dev.env.js

@@ -10,6 +10,6 @@ module.exports = merge(prodEnv, {
     // 后端接口网关
     api: '"https://saas-api-dev.usoftchina.com:5443"',
     // 账户中心接口
-    sso: '"https://tsso.usoftchina.com"'
+    sso: '"https://test-sso.uuzcc.cn"'
   }
 })

+ 1 - 1
frontend/saas-portal-web/config/test.env.js

@@ -10,6 +10,6 @@ module.exports = merge(devEnv, {
     // 后端接口网关
     api: '"https://saas-api-test.usoftchina.com:5443"',
     // 账户中心接口
-    sso: '"https://tsso.usoftchina.com"'
+    sso: '"https://test-sso.uuzcc.cn"'
   }
 })

+ 21 - 7
frontend/saas-portal-web/src/components/conenter/addgongsi.vue → frontend/saas-portal-web/src/components/conenter/addenterprise.vue

@@ -18,7 +18,7 @@
                     <ul>
                         <li style="margin: 0">
                             <span class="qy-biaoti"><span class="xingxing">*</span>公司名称</span>
-                            <input class="inpind" ref="qyname" @change= "spaceName" type="text">
+                            <input class="inpind" ref="qyname" @change= "spaceName" type="text" placeholder="请填写公司全称">
                             <dir class="qy-Tips"><span ref="qyno" style="color:red"></span></dir>
                         </li>
                         <li>
@@ -48,7 +48,7 @@
                             <span class="qy-biaoti left"><span class="xingxing">*</span>公司地址</span>
                             <div class="addbiaoqian">
                                 <!-- <v-distpicker @province= 'qyprovince' @city= 'qycity' @area= 'qyarea'></v-distpicker> -->
-                                <v-distpicker @selected= 'selected'></v-distpicker>
+                                <v-distpicker @selected= 'selected' province="广东省" city="广州市" area="荔湾区" placeholders= '{}'></v-distpicker>
                                 <input ref="address" @change="address" :disabled="disabled" class="qy-xiangxi" type="text" placeholder="输入企业详细地址">
                                 
                             </div>
@@ -104,6 +104,7 @@ import { setTimeout } from 'timers';
                 isemail: true,//验证邮箱
                 disabled: true,
                 isadd: false,//添加成功弹窗
+                placeholder:{province:"省", city:"市", area:"区"}
             }
         },
         components:{
@@ -123,7 +124,7 @@ import { setTimeout } from 'timers';
             spaceName(){
                 let qyname = this.$refs.qyname.value.replace(/\s+/g, "");//公司名字过滤空格
                 if(qyname == ''){
-                    this.$refs.qyno.innerHTML = '企业名不能为空';
+                    this.$refs.qyno.innerHTML = '企业名不能为空';
                 } else {
                     if (this.reg.test(qyname)) {
                         this.$refs.qyno.innerHTML = '不能包含非法字符';
@@ -157,7 +158,7 @@ import { setTimeout } from 'timers';
             yzusername(){
                 let name = this.$refs.name.value.replace(/\s+/g, "");//姓名过滤空格
                 if (name == '') {
-                    this.$refs.usname.innerHTML = '姓名不能为空'
+                    this.$refs.usname.innerHTML = '个人姓名不能为空'
                 } else {
                     if (this.reg.test(name)) {
                         this.$refs.usname.innerHTML = '不能包含非法字符'
@@ -172,7 +173,7 @@ import { setTimeout } from 'timers';
             address(){
                 let address = this.$refs.address.value.replace(/\s+/g, "");//过滤空格
                 if (address == '') {
-                    this.$refs.ress.innerHTML = '地址不能为空'
+                    this.$refs.ress.innerHTML = '企业地址不能为空'
                     this.isaddressname = false
                 } else {
                     this.isaddressname = true
@@ -223,8 +224,10 @@ import { setTimeout } from 'timers';
                 // console.log('邮箱',this.isemail)//邮箱正则
                 if (name == '') {
                     this.$refs.tjtishi.innerHTML = '个人姓名不能为空';
+                    this.remotxt()
                 } else if (qyname == '') {
                     this.$refs.tjtishi.innerHTML = '企业名字不能为空';
+                    this.remotxt()
                 } else {
                     switch (this.qymingzi && this.isaddress && this.isname && this.isspaceName && this.isemail && this.isaddressname) {
                         case this.qymingzi:
@@ -257,27 +260,38 @@ import { setTimeout } from 'timers';
                             })
                             this.$refs.tjtishi.innerHTML = '';
                         } else {
-                            this.$refs.tjtishi.innerHTML = '企业名字已在优软云注册';
+                            this.$refs.tjtishi.innerHTML = '该企业已在优软云注册';
+                            this.remotxt()
                         }
                         break;
                         case this.isaddressname:
                         this.$refs.tjtishi.innerHTML = '企业地址不能为空';
+                        this.remotxt()
                         break;
                         case this.isaddress:
                         this.$refs.tjtishi.innerHTML = '企业地址不能包含非法字符';
+                        this.remotxt()
                         break;
                         case this.isname:
                         this.$refs.tjtishi.innerHTML = '个人姓名不能包含非法字符';
+                        this.remotxt()
                         break;
                         case this.isspaceName:
                         this.$refs.tjtishi.innerHTML = '企业名字不能包含非法字符';
+                        this.remotxt()
                         break;
                         case this.isemail:
-                        this.$refs.tjtishi.innerHTML = '请输入正确邮箱';
+                        this.$refs.tjtishi.innerHTML = '请填写正确的邮箱';
+                        this.remotxt()
                         break;
                     }
                 }
             },
+            remotxt(){
+                setTimeout(()=>{
+                    this.$refs.tjtishi.innerHTML = ' ';
+                },3000)
+            },
             //获取省市区
             selected(data){
                 this.province = data.province.value;

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

@@ -73,7 +73,7 @@
                     </div>
                     <div>
                         <span v-if = "d.default_" class="gs-btn2 gs-btn3">默认企业</span>
-                        <span v-if="d.saas_" @click="showDefaultWin(i)" class="gs-btn2 xs">设为默认</span>
+                        <span v-else @click="showDefaultWin(i)" class="gs-btn2 xs">设为默认</span>
                     </div>
                 </div>
             </div>
@@ -103,7 +103,7 @@
                 isAutoLogin: this.$store.state.isAutoLogin,
                 mytoken: JSON.parse(localStorage.getItem('app-state-session')),//本地储存的用户信息
                 arr: [],//企业列表信息
-                isheigh:true,//是否添加默认高度
+                isheigh:false,//是否添加默认高度
                 admin: '',
                 adminMobile: ''
             }
@@ -309,7 +309,7 @@
             //没有内容也要有一定的高度
             boxheight(){
                 let H = this.$refs.qiyebox.offsetHeight;
-                if (H < 400) {
+                if (H < 500) {
                     this.isheigh = true
                 } else {
                     this.isheigh = false

+ 11 - 13
frontend/saas-portal-web/src/components/conenter/qiyexiangxi.vue → frontend/saas-portal-web/src/components/conenter/details.vue

@@ -2,12 +2,12 @@
     <div>
         <span class="Tips" ref="Tips"></span>
         <!-- 企业详细信息 -->
-        <div v-if="xiugai">
+        <div v-if="modify">
             <div class="gs-worp qy-worp" style="width:100%">
                 <div class="qy-title">
                     <span><img @click= "gobick" style="float: left;padding: 20px; cursor:pointer" src="/static/img/fanhui.png" alt=""></span>
                     <span>企业基本信息</span>
-                    <span v-if="isxiugaiId" @click="xiugaiqiye" class="qy-xiugai dianji">修改</span>
+                    <span v-if="ismodifyId" @click="xiugaiqiye" class="qy-xiugai dianji">修改</span>
                 </div>
                 <div class="qy-conent">
                     <ul>
@@ -87,7 +87,7 @@
                         <li>
                             <span class="qy-biaoti">邮箱</span>
                             <input @change="email" ref="email" type="text" value="">
-                            <dir class="qy-Tips"><span style="color:red">{{Email}}</span></dir>
+                            <div class="qy-Tips"><span style="color:red">{{Email}}</span></div>
                         </li>
                     </ul>
                 </div>
@@ -101,21 +101,21 @@
     export default {
         data(){
             return {
-                xiugai:true,
+                modify:true,
                 content: JSON.parse(window.sessionStorage.getItem("content")),
                 Email: '',
                 mytoken: JSON.parse(localStorage.getItem('app-state-session')),//本地储存的用户信息
                 isId: false,
                 isemail: true,//正则邮箱
-                isxiugaiId: false
+                ismodifyId: false
             }
         },
         mounted(){
             //不是管理员隐藏修改按钮
             if (this.content.adminId == this.mytoken.account.id) {
-                this.isxiugaiId = true;
+                this.ismodifyId = true;
             } else {
-                this.isxiugaiId = false
+                this.ismodifyId = false
             }
         },
         methods: {
@@ -133,7 +133,7 @@
             //修改企业信息
             xiugaiqiye(){
                 document.documentElement.scrollTop = 0;
-                this.xiugai = false;
+                this.modify = false;
                 setTimeout(()=>{
                     this.selects()
                 },10)
@@ -157,7 +157,7 @@
             // 取消修改
             quxiaoxiugai(){
                 document.documentElement.scrollTop = 0;
-                this.xiugai = true;
+                this.modify = true;
             },
             // 保存修改
             baocunxiugai(){
@@ -188,7 +188,7 @@
                         // console.log("请求成功",res)
                         if (res.data.success) {
                             document.documentElement.scrollTop = 0;
-                            this.xiugai = true;
+                            this.modify = true;
                             this.content.type = qyindustry;
                             this.content.adminEmail = email
                         };
@@ -233,9 +233,7 @@
     height: 20px;
 }
 .qy-Tips {
-    margin: 0;
-    text-align: left;
     height: 26px;
-    margin-left: 16%;
+    margin-left: 21%;
 }
 </style>

+ 9 - 7
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -19,12 +19,12 @@
                 <ul id="nav" class="nav navbar-nav menu">
                     <li><router-link to="/home"><a href="#"><span style="color: white">首页</span></a></router-link></li>
                     <li><a href="https://uas.usoftchina.com/about" target="_blank"><span>关于我们</span></a></li>
-                    <li style="margin-left:30px">
+                    <li style="margin-left:30px;    margin-top: 13px;    cursor: pointer;">
                         <span style="color:#fff;font-size: 16px;">
                             <img style="width: 20px;" src="/static/img/assets/denglu3x.png" alt="">
                             {{mytoken.realname}}
                         </span>
-                        <a href=""><span @click="loginout">【退出】</span></a>
+                        <span style="color:#fff;" @click="loginout">【退出】</span>
                     </li>
                 </ul>
             </div>
@@ -36,7 +36,7 @@
             <!-- 顶部tab -->
             <div class="gs-tab">
                 <ul>
-                    <li class="xs" v-for="(btn , index) in tab" :key='index' :class= "{gsactive:nowindex == index}" @click= "qiehuan(index)">{{btn.name}}</li>
+                    <li class="xs" v-for="(btn , index) in tab" :key='index' :class= "{gsactive:nowindex == index}" @click= "tabswitch(index)">{{btn.name}}</li>
                 </ul>
             </div>
             <div class="gs-none">
@@ -55,7 +55,9 @@
                         <div class="left gr-right">
                             <ul>
                                 <li>
-                                    <span>姓名</span><span>{{mytoken.realname}}</span>
+                                    <span>姓名</span>
+                                    <span>{{mytoken.realname}}</span>
+                                    <!-- <input type="text" :value="mytoken.realname"> -->
                                 </li>
                                 <li>
                                     <span>UU号</span><span>{{mytoken.uu}}</span>
@@ -122,7 +124,7 @@ import { setTimeout } from 'timers';
         },
         methods: {
             // tab切换
-            qiehuan(index){
+            tabswitch(index){
                 this.nowindex = index;
             },
             //退出
@@ -135,11 +137,11 @@ import { setTimeout } from 'timers';
             },
             //修改密码
             changpasd(){
-                window.location.href = 'https://sso.ubtob.com/reset/forgetPasswordValidationAccount?returnURL='+this.$url.web+'&appId=sp'
+                window.location.href = this.$url.sso+'/reset/forgetPasswordValidationAccount?returnURL='+this.$url.web+'&appId=sp'
             },
             //修改手机号
             changphone(){
-                window.location.href = 'https://sso.ubtob.com/validation/phoneValidation?returnURL='+this.$url.web+'&appId=sp'
+                window.location.href = this.$url.sso+'/validation/phoneValidation?returnURL='+this.$url.web+'&appId=sp'
             }
         },
     }

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

@@ -85,51 +85,51 @@
       <!-- 特色 -->
       <section id="feature">
         <div class="container ts-worp">
-          <div class="section-title text-center">
+          <div class="section-title text-center" style="margin-bottom: 50px">
             <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>
+              <img class="left" src="/static/img/feature/for2x.png" alt="">
             </div>
             <div>
-              <img class="ts-img" src="/static/img/feature/blue1@2x.png" alt="">
+              <img class="right" src="/static/img/feature/onemin2x.png" alt="">
             </div>
           </div>
           <!-- 2 -->
-          <div class="ts-box">
+          <div class="ts-box ts-boxtow">
             <div>
-              <img class="ts-img" src="/static/img/feature/yellow2@2x.png" alt="">
+              <img class="left" src="/static/img/feature/towmin2x.png" alt="">
             </div>
-            <div class="ts-boximg">
-              <img style="float: right;" src="/static/img/feature/mix2x.png" alt="">
+            <div>
+              <img class="right" style="margin-right:20px; width:80%" src="/static/img/feature/three2x.png" alt="">
             </div>
           </div>
           <!-- 3 -->
-          <div class="ts-box">
-            <div class="ts-boximg">
-              <img src="/static/img/feature/mix3x.png" alt="">
+          <div class="ts-box" style="padding-bottom:0px">
+            <div>
+              <img class="left" style="width:88%" src="/static/img/feature/one2x.png" alt="">
             </div>
             <div>
-              <img class="ts-img" src="/static/img/feature/blue3@2x.png" alt="">
+              <img class="right" style="margin-top:-30%;" src="/static/img/feature/threemin2x.png" alt="">
             </div>
           </div>
           <!-- 4 -->
-          <div class="ts-box">
+          <div class="ts-box ts-boxtow ts-forbox" style="padding-bottom:0px">
             <div>
-              <img style="width:94%" class="ts-img" src="/static/img/feature/yellow4@2x.png" alt="">
+              <img class="left" style="margin-top:-39%;" src="/static/img/feature/formin2x.png" alt="">
             </div>
-            <div class="ts-boximg">
-              <img style="float: right;" src="/static/img/feature/mix4x.png" alt="">
+            <div>
+              <img class="right" style="margin-right:30px;" src="/static/img/feature/tow2x.png" alt="">
             </div>
           </div>
         </div>
       </section>
 
       <!-- Service section 功能-->
-      <section id="service">
+      <section id="service" style="padding-top: 0">
         <div class="container" style="position: relative;">
           <img class="gn-beijing" src="/static/img/gongneng/xu xian@3x.png" alt="">
           <div class="row">
@@ -275,9 +275,6 @@
         Session.set(session);
         this.account = Session.getAccount();
       })
-      .catch(err=>{
-        // console.log("请求失败",err)
-      })
     },
     mounted() {
       this.clientId = Math.random().toString(36).substr(2)
@@ -346,7 +343,7 @@
         frame.postMessage('', '*')
         Session.remove()
         window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL='+window.location.origin
-        //this.$router.go(0);
+        // this.$router.go(0);
       },
       // 关闭窗口
       closeModal() {

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

@@ -6,6 +6,14 @@ import Axios from 'axios'
 import store from '../../store'
 
 Axios.defaults.withCredentials=true;
+Axios.interceptors.request.use(function (config) {
+  store.state.isloading = true
+  return config;
+})
+Axios.interceptors.response.use(function (config) {
+  store.state.isloading = false
+  return config;
+})
 Vue.prototype.$ajax = Axios;
 Vue.config.productionTip = false
 

+ 28 - 2
frontend/saas-portal-web/src/pages/index/index.vue

@@ -1,20 +1,46 @@
 <template>
   <div id="app">
+    <div v-if="isloading" class="loading">
+      <div class="loadingtxt">加载中...</div>
+    </div>
     <router-view/>
     <footers></footers>
   </div>
 </template>
 <script>
-// import footers from './components/footer/footer.vue';
 import footers from '../../components/footer/footer.vue';
 export default {
   name: 'App',
+  data(){
+    return {
+
+    }
+  },
   components: {
       footers
   },
+  computed:{
+    isloading:function(){
+      return this.$store.state.isloading
+    }
+  }
 }
 </script>
 
 <style>
-
+.loading {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(0, 0, 0, 0.7);
+  text-align: center;
+}
+.loadingtxt {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
 </style>

+ 2 - 2
frontend/saas-portal-web/src/router/index.js

@@ -3,8 +3,8 @@ import Router from 'vue-router'
 import Home from '../components/conenter/home.vue'
 import enterprise from '../components/conenter/enterprise.vue'//企业设置首页
 import company from '../components/conenter/company.vue'//企业列表
-import addenterprise from '../components/conenter/addgongsi.vue'//添加公司
-import details from '../components/conenter/qiyexiangxi.vue'//企业详细
+import addenterprise from '../components/conenter/addenterprise.vue'//添加公司
+import details from '../components/conenter/details.vue'//企业详细
 
 Vue.use(Router)
 

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

@@ -4,10 +4,10 @@ Vue.use(Vuex)
 
 export default new Vuex.Store({
     state:{
-        data: [],
         email:'',
         isAutoLogin: false,
         isproblem: '',//常见问题
+        isloading:false,
     },
     mutations:{
          Logintrue(state) {

+ 23 - 12
frontend/saas-portal-web/static/css/main.css

@@ -151,17 +151,32 @@ main > section {
 }
 .ts-box {
     overflow: hidden;
-    position: relative;
-    padding: 150px 0;
-    width: 98%;
+    /* position: relative; */
+    padding: 100px 50px 100px 20px;
+    width: 100%;
+    display: table;
+    background: #F8FAFD;
 }
-.ts-boximg {
-    position: absolute;
-    top: 50px;
+.ts-boxtow {
+    padding: 100px 20px 100px 50px;
+    background: white;
+}
+.ts-box div {
+    display: table-cell;
+    vertical-align: middle;
+}
+.ts-box img {
+    width: 95%;
 }
-.ts-boximg img {
-    width: 65%;
+.ts-forbox img {
+    width: 100%;
 }
+/* .ts-imgmax {
+    width: 100%;
+}
+.ts-imgmin {
+    width: 100%;
+} */
 .ts-title {
     font-family: PingFangSC-Regular !important;
     color: #0D253E !important;
@@ -175,10 +190,6 @@ main > section {
 .right {
     float: right;
 }
-.ts-img {
-    width: 98%;
-    margin-left: 2%;
-}
 .right-text {
     text-align: right;
 }

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/feature/blue1@2x.png


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


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


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


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


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


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


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


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


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


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


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