Browse Source

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

guq 7 years ago
parent
commit
86f5bab494
74 changed files with 2750 additions and 251 deletions
  1. 3 1
      applications/commons/commons-server/src/main/resources/application.yml
  2. 1 0
      applications/commons/commons-server/src/main/resources/i18n/messages.properties
  3. 19 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bankinformation.java
  4. 3 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  5. 57 60
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  6. 20 0
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  7. 22 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/config/WebMvcConfig.java
  8. 31 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BankinformationMapper.java
  9. 50 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransfer.java
  10. 30 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othreceipts.java
  11. 32 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendings.java
  12. 5 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendingsdetail.java
  13. 45 13
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  14. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  15. 351 0
      applications/money/money-server/src/main/resources/mapper/BankinformationMapper.xml
  16. 18 7
      applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml
  17. 14 8
      applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml
  18. 16 6
      applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml
  19. 13 13
      applications/money/money-server/src/main/resources/mapper/OthspendingsdetailMapper.xml
  20. 1 1
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  21. 2 2
      applications/money/money-server/src/main/resources/mapper/StatsinfoMapper.xml
  22. 0 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  23. 2 1
      applications/purchase/purchase-server/src/main/resources/application.yml
  24. 12 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java
  25. 2 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java
  26. 2 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  27. 0 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  28. 3 6
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  29. 0 2
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  30. 33 5
      base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/api/AccountApi.java
  31. 70 0
      base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/api/CompanyApi.java
  32. 22 7
      base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/cache/AccountCache.java
  33. 104 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountCopyDTO.java
  34. 13 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountDTO.java
  35. 77 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyCopyDTO.java
  36. 10 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyDTO.java
  37. 18 2
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/AccountController.java
  38. 32 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/CompanyController.java
  39. 8 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/AccountMapper.java
  40. 8 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/CompanyMapper.java
  41. 13 4
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/Account.java
  42. 13 4
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/Company.java
  43. 8 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/AccountService.java
  44. 8 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/CompanyService.java
  45. 9 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/AccountServiceImpl.java
  46. 5 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/CompanyServiceImpl.java
  47. 3 0
      base-servers/account/account-server/src/main/resources/mapper/AccountMapper.xml
  48. 13 2
      base-servers/account/account-server/src/main/resources/mapper/CompanyMapper.xml
  49. 74 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/cookie/CookieHelper.java
  50. 277 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/cookie/CookieInfo.java
  51. 115 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/cookie/CookieToken.java
  52. 126 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/cookie/CookieUtils.java
  53. 28 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/crypto/Hex.java
  54. 76 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/crypto/Rc4Utils.java
  55. 104 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/crypto/base64/UrlBase64.java
  56. 276 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/crypto/base64/UrlBase64Encoder.java
  57. 19 0
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/exception/AuthException.java
  58. 2 2
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/jwt/JwtHelper.java
  59. 3 3
      base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/jwt/JwtToken.java
  60. 7 7
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  61. 2 0
      framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java
  62. 1 1
      frontend/saas-web/app/model/money/Othspendings.js
  63. 1 0
      frontend/saas-web/app/model/purchase/purchasedetail.js
  64. 11 3
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  65. 23 2
      frontend/saas-web/app/view/core/query/QueryPanel.js
  66. 27 7
      frontend/saas-web/app/view/home/InfoCard.js
  67. 5 0
      frontend/saas-web/app/view/home/InfoCard.scss
  68. 58 14
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  69. 140 1
      frontend/saas-web/app/view/money/fundtransfer/QueryPanelController.js
  70. 61 13
      frontend/saas-web/app/view/money/othreceipts/QueryPanel.js
  71. 1 1
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  72. 67 11
      frontend/saas-web/app/view/money/othspendings/QueryPanel.js
  73. 14 14
      frontend/saas-web/app/view/money/payBalance/QueryPanel.js
  74. 10 11
      frontend/saas-web/app/view/money/recBalance/QueryPanel.js

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

@@ -44,6 +44,7 @@ management:
       show-details: always
 eureka:
   instance:
+    instance-id: wyx-sale-server
     leaseRenewalIntervalInSeconds: 10
     health-check-url-path: /actuator/health
     status-page-url-path: /actuator/info
@@ -53,7 +54,8 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      ##defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.253.31:8500/eureka/
 server:
   port: 8920
   tomcat:

+ 1 - 0
applications/commons/commons-server/src/main/resources/i18n/messages.properties

@@ -0,0 +1 @@
+msg.nullifySuccess=

+ 19 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bankinformation.java

@@ -43,6 +43,25 @@ public class Bankinformation extends CommonBaseEntity implements Serializable {
 
     private String bk_remark;
 
+    private Double bk_income;
+    private Double bk_spending;
+
+    public Double getBk_income() {
+        return bk_income;
+    }
+
+    public void setBk_income(Double bk_income) {
+        this.bk_income = bk_income;
+    }
+
+    public Double getBk_spending() {
+        return bk_spending;
+    }
+
+    public void setBk_spending(Double bk_spending) {
+        this.bk_spending = bk_spending;
+    }
+
     public String getBk_bankcode() {
         return bk_bankcode;
     }

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

@@ -39,9 +39,9 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
     @Override
     public boolean save(Bankinformation bankinformation){
         bankinformation.setCompanyId(BaseContextHolder.getCompanyId());
-        if (bankinformation.getBk_thisamount() == null || bankinformation.getBk_thisamount() == 0){
-            bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
-        }
+        bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
+        bankinformation.setBk_income(new Double(0));
+        bankinformation.setBk_spending(new Double(0));
 
         //判断编号
         String bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode());

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

@@ -170,71 +170,68 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             if (insertDetail2.size()>0) {
                 customeraddressMapper.batchInsert(insertDetail2);
             }
-            baseDTO = getBaseDTOById(cu_id);
-            //日志记录
-            messageLogService.save(baseDTO);
-            return baseDTO;
-        }
-        //检查名称和编号
-        int count = getMapper().validNameAndCodeWhenUpdate(customer);
-        if (count>0) {
-            throw new BizException(500, "客户名称或编号重复");
-        }
-
-        //检查期初日期是否已结转
-        count = getMapper().validFinish(cu_id,companyId);
-        if (count>0) {
-            Customer cutpl = getMapper().selectByPrimaryKey(cu_id);
-            //期初应收
-            customer.setCu_beginaramount(cutpl.getCu_beginaramount());
-            //期初预收
-            customer.setCu_beginprerecamount(cutpl.getCu_beginprerecamount());
-        }
+        }else {
+            //检查名称和编号
+            int count = getMapper().validNameAndCodeWhenUpdate(customer);
+            if (count > 0) {
+                throw new BizException(500, "客户名称或编号重复");
+            }
 
-        //更新操作
-        getMapper().updateByPrimaryKeySelective(customer);
-        //添加从表传输对象
-        for (CustomercontactDTO item : items1) {
-            Customercontact detail1 = BeanMapper.map(item,Customercontact.class);
-            detail1.setCc_cuid(cu_id);
-            detail1.setCompanyId(companyId);
-            detail1.setCreatorId(userId);
-            detail1.setCreateTime(new Date());
-            if (StringUtils.isEmpty(detail1.getId()) || "0".equals(detail1.getId().toString())) {
-                insertDetail1.add(detail1);
-            } else {
-                updateDetail1.add(detail1);
+            //检查期初日期是否已结转
+            count = getMapper().validFinish(cu_id, companyId);
+            if (count > 0) {
+                Customer cutpl = getMapper().selectByPrimaryKey(cu_id);
+                //期初应收
+                customer.setCu_beginaramount(cutpl.getCu_beginaramount());
+                //期初预收
+                customer.setCu_beginprerecamount(cutpl.getCu_beginprerecamount());
             }
-        }
-        //插入从表
-        if (insertDetail1.size()>0) {
-            customercontactMapper.batchInsert(insertDetail1);
-        }
-        //更新从表
-        if (updateDetail1.size()>0) {
-            customercontactMapper.batchUpdate(updateDetail1);
-        }
 
-        for (CustomeraddressDTO item : items2) {
-            Customeraddress detail2 = BeanMapper.map(item,Customeraddress.class);
-            detail2.setCa_cuid(cu_id);
-            detail2.setCompanyId(companyId);
-            detail2.setCreatorId(userId);
-            detail2.setCreateTime(new Date());
-            if (StringUtils.isEmpty(detail2.getId()) || "0".equals(detail2.getId().toString())) {
-                insertDetail2.add(detail2);
-            } else {
-                updateDetail2.add(detail2);
+            //更新操作
+            getMapper().updateByPrimaryKeySelective(customer);
+            //添加从表传输对象
+            for (CustomercontactDTO item : items1) {
+                Customercontact detail1 = BeanMapper.map(item, Customercontact.class);
+                detail1.setCc_cuid(cu_id);
+                detail1.setCompanyId(companyId);
+                detail1.setCreatorId(userId);
+                detail1.setCreateTime(new Date());
+                if (StringUtils.isEmpty(detail1.getId()) || "0".equals(detail1.getId().toString())) {
+                    insertDetail1.add(detail1);
+                } else {
+                    updateDetail1.add(detail1);
+                }
+            }
+            //插入从表
+            if (insertDetail1.size() > 0) {
+                customercontactMapper.batchInsert(insertDetail1);
+            }
+            //更新从表
+            if (updateDetail1.size() > 0) {
+                customercontactMapper.batchUpdate(updateDetail1);
             }
 
-        }
-        //插入从表
-        if (insertDetail2.size()>0) {
-            customeraddressMapper.batchInsert(insertDetail2);
-        }
-        //更新从表
-        if (updateDetail2.size()>0) {
-            customeraddressMapper.batchUpdate(updateDetail2);
+            for (CustomeraddressDTO item : items2) {
+                Customeraddress detail2 = BeanMapper.map(item, Customeraddress.class);
+                detail2.setCa_cuid(cu_id);
+                detail2.setCompanyId(companyId);
+                detail2.setCreatorId(userId);
+                detail2.setCreateTime(new Date());
+                if (StringUtils.isEmpty(detail2.getId()) || "0".equals(detail2.getId().toString())) {
+                    insertDetail2.add(detail2);
+                } else {
+                    updateDetail2.add(detail2);
+                }
+
+            }
+            //插入从表
+            if (insertDetail2.size() > 0) {
+                customeraddressMapper.batchInsert(insertDetail2);
+            }
+            //更新从表
+            if (updateDetail2.size() > 0) {
+                customeraddressMapper.batchUpdate(updateDetail2);
+            }
         }
 
         //更新应收余额

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

@@ -24,6 +24,8 @@
     <result column="bk_text4" property="bk_text4" jdbcType="VARCHAR" />
     <result column="bk_text5" property="bk_text5" jdbcType="VARCHAR" />
     <result column="bk_remark" property="bk_remark" jdbcType="VARCHAR" />
+    <result column="bk_spending" property="bk_spending" jdbcType="DOUBLE" />
+    <result column="bk_income" property="bk_income" jdbcType="DOUBLE" />
   </resultMap>
   <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Bankinformation" extends="BaseResultMap" >
     <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
@@ -132,6 +134,12 @@
       <if test="bk_remark != null" >
         bk_remark,
       </if>
+      <if test="bk_spending != null" >
+        bk_spending,
+      </if>
+      <if test="bk_income != null" >
+        bk_income,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="bk_bankcode != null" >
@@ -197,6 +205,12 @@
       <if test="bk_remark != null" >
         #{bk_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="bk_spending != null" >
+        #{bk_spending,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_income != null" >
+        #{bk_income,jdbcType=DOUBLE},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
@@ -265,6 +279,12 @@
       <if test="bk_remark != null" >
         bk_remark = #{bk_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="bk_income != null" >
+        bk_income = #{bk_income,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_spending != null" >
+        bk_spending = #{bk_spending,jdbcType=DOUBLE},
+      </if>
     </set>
     where bk_id = #{id,jdbcType=INTEGER}
   </update>

+ 22 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/config/WebMvcConfig.java

@@ -0,0 +1,22 @@
+//package com.usoftchina.saas.money.config;
+//
+//import org.springframework.web.servlet.config.annotation.CorsRegistry;
+//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+//
+///**
+// * @author heqw
+// * @date 2018/11/13 16:58
+// **/
+//public class WebMvcConfig extends WebMvcConfigurerAdapter {
+//    @Override
+//    public void addCorsMappings(CorsRegistry registry) {
+//        registry.addMapping("/**")
+//                .allowedOrigins("*")
+//                .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
+//                .allowedHeaders("Content-Type", "X-Requested-With", "accept", "Origin", "Access-Control-Request-Method",
+//                        "Access-Control-Request-Headers")
+//                .exposedHeaders("Access-Control-Allow-Origin", "Access-Control-Allow-Credentials")
+//                .maxAge(3600)
+//                .allowCredentials(true);
+//    }
+//}

+ 31 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BankinformationMapper.java

@@ -0,0 +1,31 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
+import com.usoftchina.saas.money.po.Bankinformation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface BankinformationMapper extends CommonBaseMapper<Bankinformation> {
+    int deleteByPrimaryKey(Integer bkId);
+
+//    int insert(Bankinformation record);
+
+    int insertSelective(Bankinformation record);
+
+    Bankinformation selectByPrimaryKey(Integer bkId);
+
+    int updateByPrimaryKeySelective(Bankinformation record);
+
+    int updateByPrimaryKeyWithBLOBs(Bankinformation record);
+
+    List<Bankinformation> selectBankinformationBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
+    String selectBankcode(String bk_bankcode);
+
+    void updateBankAmount(@Param("id") Integer id, @Param("bk_thisamount") Double bk_thisamount);
+    Double selectThisamount(Integer id);
+
+}

+ 50 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransfer.java

@@ -35,6 +35,16 @@ public class Fundtransfer extends CommonBaseEntity implements Serializable {
 
     private String ft_text5;
 
+    private String ftd_bankname;
+
+    private String ftd_inbankname;
+
+    private Double ftd_nowbalance;
+
+    private String ftd_paymethod;
+
+    private String ftd_paycode;
+
     public String getFt_code() {
         return ft_code;
     }
@@ -146,4 +156,44 @@ public class Fundtransfer extends CommonBaseEntity implements Serializable {
     public void setFt_text5(String ft_text5) {
         this.ft_text5 = ft_text5;
     }
+
+    public String getFtd_bankname() {
+        return ftd_bankname;
+    }
+
+    public void setFtd_bankname(String ftd_bankname) {
+        this.ftd_bankname = ftd_bankname;
+    }
+
+    public String getFtd_inbankname() {
+        return ftd_inbankname;
+    }
+
+    public void setFtd_inbankname(String ftd_inbankname) {
+        this.ftd_inbankname = ftd_inbankname;
+    }
+
+    public Double getFtd_nowbalance() {
+        return ftd_nowbalance;
+    }
+
+    public void setFtd_nowbalance(Double ftd_nowbalance) {
+        this.ftd_nowbalance = ftd_nowbalance;
+    }
+
+    public String getFtd_paymethod() {
+        return ftd_paymethod;
+    }
+
+    public void setFtd_paymethod(String ftd_paymethod) {
+        this.ftd_paymethod = ftd_paymethod;
+    }
+
+    public String getFtd_paycode() {
+        return ftd_paycode;
+    }
+
+    public void setFtd_paycode(String ftd_paycode) {
+        this.ftd_paycode = ftd_paycode;
+    }
 }

+ 30 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othreceipts.java

@@ -49,6 +49,12 @@ public class Othreceipts extends CommonBaseEntity implements Serializable {
 
     private String or_text5;
 
+    private String ord_type;
+
+    private Double ord_nowbalance;
+
+    private String ord_remark;
+
     public String getOr_code() {
         return or_code;
     }
@@ -217,6 +223,30 @@ public class Othreceipts extends CommonBaseEntity implements Serializable {
         this.or_text5 = or_text5;
     }
 
+    public String getOrd_type() {
+        return ord_type;
+    }
+
+    public void setOrd_type(String ord_type) {
+        this.ord_type = ord_type;
+    }
+
+    public Double getOrd_nowbalance() {
+        return ord_nowbalance;
+    }
+
+    public void setOrd_nowbalance(Double ord_nowbalance) {
+        this.ord_nowbalance = ord_nowbalance;
+    }
+
+    public String getOrd_remark() {
+        return ord_remark;
+    }
+
+    public void setOrd_remark(String ord_remark) {
+        this.ord_remark = ord_remark;
+    }
+
     @Override
     public String toString() {
         return "Othreceipts{" +

+ 32 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendings.java

@@ -50,6 +50,14 @@ public class Othspendings extends CommonBaseEntity implements Serializable {
 
     private String os_text5;
 
+    private String osd_type;
+
+    private Double osd_nowbalance;
+
+    private String osd_remark;
+
+
+
     public String getOs_code() {
         return os_code;
     }
@@ -217,4 +225,28 @@ public class Othspendings extends CommonBaseEntity implements Serializable {
     public void setOs_text5(String os_text5) {
         this.os_text5 = os_text5;
     }
+
+    public String getOsd_type() {
+        return osd_type;
+    }
+
+    public void setOsd_type(String osd_type) {
+        this.osd_type = osd_type;
+    }
+
+    public Double getOsd_nowbalance() {
+        return osd_nowbalance;
+    }
+
+    public void setOsd_nowbalance(Double osd_nowbalance) {
+        this.osd_nowbalance = osd_nowbalance;
+    }
+
+    public String getOsd_remark() {
+        return osd_remark;
+    }
+
+    public void setOsd_remark(String osd_remark) {
+        this.osd_remark = osd_remark;
+    }
 }

+ 5 - 5
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Othspendingsdetail.java

@@ -7,7 +7,7 @@ import java.util.Date;
 
 public class Othspendingsdetail extends CommonBaseEntity implements Serializable {
 
-    private Integer osd_orid;
+    private Integer osd_osid;
 
     private Integer osd_detno;
 
@@ -41,12 +41,12 @@ public class Othspendingsdetail extends CommonBaseEntity implements Serializable
         this.os_date = os_date;
     }
 
-    public Integer getOsd_orid() {
-        return osd_orid;
+    public Integer getOsd_osid() {
+        return osd_osid;
     }
 
-    public void setOsd_orid(Integer osd_orid) {
-        this.osd_orid = osd_orid;
+    public void setOsd_osid(Integer osd_osid) {
+        this.osd_osid = osd_osid;
     }
 
     public Integer getOsd_detno() {

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

@@ -42,6 +42,8 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
     private PaybalanceMapper paybalanceMapper;
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private BankinformationMapper bankinformationMapper;
 
     @Override
     public DocBaseDTO insert(Fundtran fundtran) {
@@ -96,7 +98,6 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         this.changBankUntil(fundtran);
         DocBaseDTO docBaseDTO = this.insert(fundtran);
         Long id = docBaseDTO.getId();
-        String ft_code = docBaseDTO.getCode();
 
         //取从表金额更新中间表、资金账号表
         List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
@@ -115,15 +116,28 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             //资金账号表
             int bk_id = fundtransferdetail.getFtd_bankid();
             int bk_inid = fundtransferdetail.getFtd_inbankid();
-            Double bk_amount = paybalanceMapper.selectThisamount(bk_id) == null ? new Double(0) : paybalanceMapper.selectThisamount(bk_id);
-            Double bk_inamount = paybalanceMapper.selectThisamount(bk_inid) == null ? new Double(0) : paybalanceMapper.selectThisamount(bk_inid);
 
-            Double thisamount = bk_amount - fundtransferdetail.getFtd_nowbalance();
-            if (thisamount < 0){
-                throw new BizException(500, BizExceptionCode.BANK_AMOUNT_NOTENOUGH.getMessage());
-            }
-            paybalanceMapper.updateBankAmount(thisamount, bk_id);
-            paybalanceMapper.updateBankAmount(bk_inamount + fundtransferdetail.getFtd_nowbalance(), bk_inid);
+            Double bk_amount = fundtransferdetail.getFtd_nowbalance();
+            //付款方
+            Bankinformation bankinformation = bankinformationMapper.selectByPrimaryKey(bk_id);
+            Double beginamount = bankinformation.getBk_beginamount();
+            Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
+            Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
+            bankinformation.setBk_thisamount(beginamount + incomme - spending - bk_amount);
+            bankinformation.setBk_income(incomme);
+            bankinformation.setBk_spending(spending + bk_amount);
+
+            //收款方
+            Bankinformation inbankinformation = bankinformationMapper.selectByPrimaryKey(bk_inid);
+            Double inbeginamount = inbankinformation.getBk_beginamount();
+            Double inspending = inbankinformation.getBk_spending() == null ? new Double(0) : inbankinformation.getBk_spending();
+            Double inincomme = inbankinformation.getBk_income() == null ? new Double(0) : inbankinformation.getBk_income();
+            inbankinformation.setBk_thisamount(inbeginamount + inincomme - inspending + bk_amount);
+            inbankinformation.setBk_income(inincomme + bk_amount);
+            inbankinformation.setBk_spending(inspending);
+
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+            bankinformationMapper.updateByPrimaryKeySelective(inbankinformation);
         }
         DocBaseDTO baseDTO = getBaseDTOById(id);
         //日志记录
@@ -159,10 +173,28 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             //资金账号表
             int bk_id = fundtransferdetail.getFtd_bankid();
             int bk_inid = fundtransferdetail.getFtd_inbankid();
-            Double bk_amount = paybalanceMapper.selectThisamount(bk_id) == null ? new Double(0) : paybalanceMapper.selectThisamount(bk_id);
-            Double bk_inamount = paybalanceMapper.selectThisamount(bk_inid) == null ? new Double(0) : paybalanceMapper.selectThisamount(bk_inid);
-            paybalanceMapper.updateBankAmount(bk_amount + fundtransferdetail.getFtd_nowbalance(), bk_id);
-            paybalanceMapper.updateBankAmount(bk_inamount - fundtransferdetail.getFtd_nowbalance(), bk_inid);
+
+            Double bk_amount = fundtransferdetail.getFtd_nowbalance();
+            //付款方
+            Bankinformation bankinformation = bankinformationMapper.selectByPrimaryKey(bk_id);
+            Double beginamount = bankinformation.getBk_beginamount();
+            Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
+            Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
+            bankinformation.setBk_thisamount(beginamount + incomme - spending + bk_amount);
+            bankinformation.setBk_income(incomme);
+            bankinformation.setBk_spending(spending - bk_amount);
+
+            //收款方
+            Bankinformation inbankinformation = bankinformationMapper.selectByPrimaryKey(bk_inid);
+            Double inbeginamount = inbankinformation.getBk_beginamount();
+            Double inspending = inbankinformation.getBk_spending() == null ? new Double(0) : inbankinformation.getBk_spending();
+            Double inincomme = inbankinformation.getBk_income() == null ? new Double(0) : inbankinformation.getBk_income();
+            inbankinformation.setBk_thisamount(inbeginamount + inincomme - inspending - bk_amount);
+            inbankinformation.setBk_income(inincomme - bk_amount);
+            inbankinformation.setBk_spending(inspending);
+
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+            bankinformationMapper.updateByPrimaryKeySelective(inbankinformation);
         }
 
         DocBaseDTO baseDTO = getBaseDTOById(Long.valueOf(id));

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

@@ -73,7 +73,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         Iterator isdet = othspendingsdetails.iterator();
         while (isdet.hasNext()){
             Othspendingsdetail othspendingsdetail = (Othspendingsdetail) isdet.next();
-            othspendingsdetail.setOsd_orid(Math.toIntExact(id));
+            othspendingsdetail.setOsd_osid(Math.toIntExact(id));
             othspendingsdetail.setCompanyId(BaseContextHolder.getCompanyId());
             othspendingsdetail.setOs_date(othspendings.getOs_date());
             if (othspendingsdetail.getId() > 0 ){

+ 351 - 0
applications/money/money-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -0,0 +1,351 @@
+<?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.BankinformationMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Bankinformation" >
+    <id column="bk_id" property="id" jdbcType="INTEGER" />
+    <result column="bk_bankcode" property="bk_bankcode" jdbcType="VARCHAR" />
+    <result column="bk_bankname" property="bk_bankname" jdbcType="VARCHAR" />
+    <result column="bk_date" property="bk_date" jdbcType="TIMESTAMP" />
+    <result column="bk_type" property="bk_type" jdbcType="VARCHAR" />
+    <result column="bk_beginamount" property="bk_beginamount" jdbcType="DOUBLE" />
+    <result column="bk_thisamount" property="bk_thisamount" jdbcType="DOUBLE" />
+    <result column="bk_status" property="bk_status" jdbcType="VARCHAR" />
+    <result column="bk_statuscode" property="bk_statuscode" jdbcType="VARCHAR" />
+    <result column="bk_recorderid" property="bk_recorderid" jdbcType="INTEGER" />
+    <result column="bk_recorder" property="bk_recorder" jdbcType="VARCHAR" />
+    <result column="bk_recorddate" property="bk_recorddate" jdbcType="TIMESTAMP" />
+    <result column="bk_ym" property="bk_ym" jdbcType="INTEGER" />
+    <result column="companyid" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="bk_text1" property="bk_text1" jdbcType="VARCHAR" />
+    <result column="bk_text2" property="bk_text2" jdbcType="VARCHAR" />
+    <result column="bk_text3" property="bk_text3" jdbcType="VARCHAR" />
+    <result column="bk_text4" property="bk_text4" jdbcType="VARCHAR" />
+    <result column="bk_text5" property="bk_text5" jdbcType="VARCHAR" />
+    <result column="bk_remark" property="bk_remark" jdbcType="VARCHAR" />
+    <result column="bk_spending" property="bk_spending" jdbcType="DOUBLE" />
+    <result column="bk_income" property="bk_income" jdbcType="DOUBLE" />
+  </resultMap>
+  <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.money.po.Bankinformation" extends="BaseResultMap" >
+    <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount, 
+    bk_status, bk_statuscode, bk_recorderid, bk_recorder, bk_recorddate, bk_ym, companyid, 
+    updaterId, updateTime, bk_text1, bk_text2, bk_text3, bk_text4, bk_text5, bk_remark
+  </sql>
+  <sql id="Blob_Column_List" >
+    bk_remark
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from bankinformation
+    where bk_id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from bankinformation
+    where bk_id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.money.po.Bankinformation" >
+    insert into bankinformation (bk_id, bk_bankcode, bk_bankname, 
+      bk_date, bk_type, bk_beginamount, 
+      bk_thisamount, bk_status, bk_statuscode, 
+      bk_recorderid, bk_recorder, bk_recorddate, 
+      bk_ym, companyid, updaterId, 
+      updateTime, bk_text1, bk_text2, 
+      bk_text3, bk_text4, bk_text5, 
+      bk_remark)
+    values (#{bk_bankcode,jdbcType=VARCHAR}, #{bk_bankname,jdbcType=VARCHAR},
+      #{bk_date,jdbcType=TIMESTAMP}, #{bk_type,jdbcType=VARCHAR}, #{bk_beginamount,jdbcType=DOUBLE},
+      #{bk_thisamount,jdbcType=DOUBLE}, #{bk_status,jdbcType=VARCHAR}, #{bk_statuscode,jdbcType=VARCHAR},
+      #{bk_recorderid,jdbcType=INTEGER}, #{bk_recorder,jdbcType=VARCHAR}, #{bk_recorddate,jdbcType=TIMESTAMP},
+      #{bk_ym,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
+      #{updateTime,jdbcType=TIMESTAMP}, #{bk_text1,jdbcType=VARCHAR}, #{bk_text2,jdbcType=VARCHAR},
+      #{bk_text3,jdbcType=VARCHAR}, #{bk_text4,jdbcType=VARCHAR}, #{bk_text5,jdbcType=VARCHAR},
+      #{bk_remark,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
+    insert into bankinformation
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="bk_bankcode != null" >
+        bk_bankcode,
+      </if>
+      <if test="bk_bankname != null" >
+        bk_bankname,
+      </if>
+      <if test="bk_date != null" >
+        bk_date,
+      </if>
+      <if test="bk_type != null" >
+        bk_type,
+      </if>
+      <if test="bk_beginamount != null" >
+        bk_beginamount,
+      </if>
+      <if test="bk_thisamount != null" >
+        bk_thisamount,
+      </if>
+      <if test="bk_status != null" >
+        bk_status,
+      </if>
+      <if test="bk_statuscode != null" >
+        bk_statuscode,
+      </if>
+      <if test="bk_recorderid != null" >
+        bk_recorderid,
+      </if>
+      <if test="bk_recorder != null" >
+        bk_recorder,
+      </if>
+      <if test="bk_recorddate != null" >
+        bk_recorddate,
+      </if>
+      <if test="bk_ym != null" >
+        bk_ym,
+      </if>
+      <if test="companyId != null" >
+        companyid,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="bk_text1 != null" >
+        bk_text1,
+      </if>
+      <if test="bk_text2 != null" >
+        bk_text2,
+      </if>
+      <if test="bk_text3 != null" >
+        bk_text3,
+      </if>
+      <if test="bk_text4 != null" >
+        bk_text4,
+      </if>
+      <if test="bk_text5 != null" >
+        bk_text5,
+      </if>
+      <if test="bk_remark != null" >
+        bk_remark,
+      </if>
+      <if test="bk_spending != null" >
+        bk_spending,
+      </if>
+      <if test="bk_income != null" >
+        bk_income,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="bk_bankcode != null" >
+        #{bk_bankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_bankname != null" >
+        #{bk_bankname,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_date != null" >
+        #{bk_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_type != null" >
+        #{bk_type,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_beginamount != null" >
+        #{bk_beginamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_thisamount != null" >
+        #{bk_thisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_status != null" >
+        #{bk_status,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_statuscode != null" >
+        #{bk_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorderid != null" >
+        #{bk_recorderid,jdbcType=INTEGER},
+      </if>
+      <if test="bk_recorder != null" >
+        #{bk_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorddate != null" >
+        #{bk_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_ym != null" >
+        #{bk_ym,jdbcType=INTEGER},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_text1 != null" >
+        #{bk_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text2 != null" >
+        #{bk_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text3 != null" >
+        #{bk_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text4 != null" >
+        #{bk_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text5 != null" >
+        #{bk_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_remark != null" >
+        #{bk_remark,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="bk_spending != null" >
+        #{bk_spending,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_income != null" >
+        #{bk_income,jdbcType=DOUBLE},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
+    update bankinformation
+    <set >
+      <if test="bk_bankcode != null" >
+        bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_bankname != null" >
+        bk_bankname = #{bk_bankname,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_date != null" >
+        bk_date = #{bk_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_type != null" >
+        bk_type = #{bk_type,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_beginamount != null" >
+        bk_beginamount = #{bk_beginamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_thisamount != null" >
+        bk_thisamount = #{bk_thisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_status != null" >
+        bk_status = #{bk_status,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_statuscode != null" >
+        bk_statuscode = #{bk_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorderid != null" >
+        bk_recorderid = #{bk_recorderid,jdbcType=INTEGER},
+      </if>
+      <if test="bk_recorder != null" >
+        bk_recorder = #{bk_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorddate != null" >
+        bk_recorddate = #{bk_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_ym != null" >
+        bk_ym = #{bk_ym,jdbcType=INTEGER},
+      </if>
+      <if test="companyId != null" >
+        companyid = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_text1 != null" >
+        bk_text1 = #{bk_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text2 != null" >
+        bk_text2 = #{bk_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text3 != null" >
+        bk_text3 = #{bk_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text4 != null" >
+        bk_text4 = #{bk_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text5 != null" >
+        bk_text5 = #{bk_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_remark != null" >
+        bk_remark = #{bk_remark,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="bk_income != null" >
+        bk_income = #{bk_income,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_spending != null" >
+        bk_spending = #{bk_spending,jdbcType=DOUBLE},
+      </if>
+    </set>
+    where bk_id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.money.po.Bankinformation" >
+    update bankinformation
+    set bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
+      bk_bankname = #{bkBankname,jdbcType=VARCHAR},
+      bk_date = #{bkDate,jdbcType=TIMESTAMP},
+      bk_type = #{bkType,jdbcType=VARCHAR},
+      bk_beginamount = #{bkBeginamount,jdbcType=DOUBLE},
+      bk_thisamount = #{bkThisamount,jdbcType=DOUBLE},
+      bk_status = #{bkStatus,jdbcType=VARCHAR},
+      bk_statuscode = #{bkStatuscode,jdbcType=VARCHAR},
+      bk_recorderid = #{bkRecorderid,jdbcType=INTEGER},
+      bk_recorder = #{bkRecorder,jdbcType=VARCHAR},
+      bk_recorddate = #{bkRecorddate,jdbcType=TIMESTAMP},
+      bk_ym = #{bkYm,jdbcType=INTEGER},
+      companyid = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      bk_text1 = #{bkText1,jdbcType=VARCHAR},
+      bk_text2 = #{bkText2,jdbcType=VARCHAR},
+      bk_text3 = #{bkText3,jdbcType=VARCHAR},
+      bk_text4 = #{bkText4,jdbcType=VARCHAR},
+      bk_text5 = #{bkText5,jdbcType=VARCHAR},
+      bk_remark = #{bkRemark,jdbcType=LONGVARCHAR}
+    where bk_id = #{bkId,jdbcType=INTEGER}
+  </update>
+
+  <select id="selectAll" resultMap="BaseResultMap">
+    SELECT * FROM bankinformation
+  </select>
+
+  <select id="selectBankinformationBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from bankinformation
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   bankinformation.companyId = #{companyId}
+      </if>
+    </where>  order by bk_id
+  </select>
+  <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+        SELECT CONCAT(bk_bankcode,' ',bk_bankname) display,bk_bankname value FROM bankinformation WHERE COMPANYID=#{companyId}
+    </select>
+
+
+  <select id="selectBankcode" parameterType="java.lang.String" resultType="java.lang.String">
+        select bk_bankcode from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR}
+    </select>
+
+  <update id="updateBankAmount" >
+    update bankinformation set bk_thisamount = #{bk_thisamount,jdbcType=DOUBLE}
+     where bk_id = #{id,jdbcType=INTEGER}
+  </update>
+
+  <select id="selectThisamount" parameterType="java.lang.Integer" resultType="java.lang.Double">
+  select bk_beginamount from bankinformation where bk_id = #{id,jdbcType=INTEGER}
+</select>
+</mapper>

+ 18 - 7
applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml

@@ -19,11 +19,19 @@
     <result column="ft_text3" property="ft_text3" jdbcType="VARCHAR" />
     <result column="ft_text4" property="ft_text4" jdbcType="VARCHAR" />
     <result column="ft_text5" property="ft_text5" jdbcType="VARCHAR" />
+    <result column="ftd_bankname" property="ftd_bankname" jdbcType="VARCHAR" />
+    <result column="ftd_inbankname" property="ftd_inbankname" jdbcType="VARCHAR" />
+    <result column="ftd_nowbalance" property="ftd_nowbalance" jdbcType="DOUBLE" />
+    <result column="ftd_paymethod" property="ftd_paymethod" jdbcType="VARCHAR" />
+    <result column="ftd_paycode" property="ftd_paycode" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     ft_id, ft_code, ft_date, ft_recorderid, ft_recorder, ft_recorddate, ft_status, ft_statuscode, 
-    ft_remark, companyId, updaterId, updatedate, ft_text1, ft_text2, ft_text3, ft_text4, 
-    ft_text5
+    ft_remark, fundtransfer.companyId, fundtransfer.updaterId, fundtransfer.updatedate,
+    ft_text1, ft_text2, ft_text3, ft_text4, ft_text5
+  </sql>
+  <sql id="Detail_Column_List" >
+    ftd_bankname,ftd_inbankname,ftd_nowbalance,ftd_paymethod,ftd_paycode
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
@@ -232,8 +240,10 @@
 
   <select id="selectFundtransferBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />
-    from Fundtransfer
+    <include refid="Base_Column_List" />,
+    <include refid="Detail_Column_List" />
+    from Fundtransfer left join fundtransferdetail on ftd_ftid=ft_id and
+    Fundtransfer.companyId= fundtransferdetail.companyId
     <where>
       <if test="con != null">
         ${con}
@@ -246,9 +256,10 @@
 
   <select id="selectFundtransferListByCondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />
-    from fundtransfer
-    left join fundtransferdetail on ft_id=ftd_ftid
+    <include refid="Base_Column_List" />,
+    <include refid="Detail_Column_List" />
+    from Fundtransfer left join fundtransferdetail on ftd_ftid=ft_id and
+    Fundtransfer.companyId= fundtransferdetail.companyId
     <where>
       <if test="con != null">
         ${con}

+ 14 - 8
applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml

@@ -26,12 +26,18 @@
     <result column="or_text3" property="or_text3" jdbcType="VARCHAR" />
     <result column="or_text4" property="or_text4" jdbcType="VARCHAR" />
     <result column="or_text5" property="or_text5" jdbcType="VARCHAR" />
+    <result column="ord_type" property="ord_type" jdbcType="VARCHAR" />
+    <result column="ord_nowbalance" property="ord_nowbalance" jdbcType="DOUBLE" />
+    <result column="ord_remark" property="ord_remark" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     or_id, or_code, or_date, or_custid, or_custcode, or_custname, or_bankcode, or_bankid, 
     or_bankname, or_amount, or_recorderid, or_recorder, or_recorddate, or_status, or_statuscode, 
-    or_remark, companyId, updaterId, updatedate, or_text1, or_text2, or_text3, or_text4, 
-    or_text5
+    or_remark, Othreceipts.companyId, Othreceipts.updaterId, Othreceipts.updatedate, or_text1,
+    or_text2, or_text3, or_text4, or_text5
+  </sql>
+  <sql id="Detail_Column_List" >
+    ord_type,ord_nowbalance,ord_remark
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
@@ -314,11 +320,11 @@
   <select id="validateCodeWhenUpdate" resultType="int" >
     select count(1) from othreceipts where or_code = #{code} and or_id != #{id} and companyId =#{companyId}
   </select>
-
   <select id="selectOthreceiptsBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />
-    from Othreceipts
+    <include refid="Base_Column_List" />,
+    <include refid="Detail_Column_List" />
+    from Othreceipts left join othreceiptsdetail on ord_orid=or_id and Othreceipts.companyId=othreceiptsdetail.companyId
     <where>
       <if test="con != null">
         ${con}
@@ -331,9 +337,9 @@
 
   <select id="selectOthreceiptsListByCondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />
-    from Othreceipts
-    left join othreceiptsdetail on or_id=ord_orid 
+    <include refid="Base_Column_List" />,
+    <include refid="Detail_Column_List" />
+    from Othreceipts left join othreceiptsdetail on ord_orid=or_id and Othreceipts.companyId=othreceiptsdetail.companyId
     <where>
       <if test="con != null">
         ${con}

+ 16 - 6
applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml

@@ -26,13 +26,20 @@
     <result column="os_text3" property="os_text3" jdbcType="VARCHAR" />
     <result column="os_text4" property="os_text4" jdbcType="VARCHAR" />
     <result column="os_text5" property="os_text5" jdbcType="VARCHAR" />
+    <result column="osd_type" property="osd_type" jdbcType="VARCHAR" />
+    <result column="osd_nowbalance" property="osd_nowbalance" jdbcType="DOUBLE" />
+    <result column="osd_remark" property="osd_remark" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     os_id, os_code, os_date, os_vendid, os_vendcode, os_vendname, os_bankid, os_bankcode, 
     os_bankname, os_amount, os_recorderid, os_recorder, os_recorddate, os_status, os_statuscode, 
-    os_remark, companyId, updaterId, updatedate, os_text1, os_text2, os_text3, os_text4, 
+    os_remark, othspendingsdetail.companyId, othspendingsdetail.updaterId,
+    othspendingsdetail.updatedate, os_text1, os_text2, os_text3, os_text4,
     os_text5
   </sql>
+  <sql id="Detail_Column_List" >
+    osd_type,osd_nowbalance,osd_remark
+  </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
     <include refid="Base_Column_List" />
@@ -312,8 +319,10 @@
 
   <select id="selectOthspendingsBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />
-    from Othspendings
+    <include refid="Base_Column_List" />,
+    <include refid="Detail_Column_List" />
+    from Othspendings left join othspendingsdetail on osd_osid=os_id
+    and Othspendings.companyId=othspendingsdetail.companyId
     <where>
       <if test="con != null">
         ${con}
@@ -326,9 +335,10 @@
 
   <select id="selectOthspendingsListByCondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />
-    from Othspendings
-    left join othspendingsdetail on os_id=osd_orid
+    <include refid="Base_Column_List" />,
+    <include refid="Detail_Column_List" />
+    from Othspendings left join othspendingsdetail on osd_osid=os_id
+    and Othspendings.companyId=othspendingsdetail.companyId
     <where>
       <if test="con != null">
         ${con}

+ 13 - 13
applications/money/money-server/src/main/resources/mapper/OthspendingsdetailMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.usoftchina.saas.money.mapper.OthspendingsdetailMapper" >
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Othspendingsdetail" >
     <id column="osd_id" property="id" jdbcType="INTEGER" />
-    <result column="osd_orid" property="osd_orid" jdbcType="INTEGER" />
+    <result column="osd_osid" property="osd_osid" jdbcType="INTEGER" />
     <result column="osd_detno" property="osd_detno" jdbcType="INTEGER" />
     <result column="osd_ym" property="osd_ym" jdbcType="INTEGER" />
     <result column="os_date" property="os_date" jdbcType="TIMESTAMP" />
@@ -20,18 +20,18 @@
     <result column="osd_text5" property="osd_text5" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
-    osd_id, osd_orid, osd_detno, osd_ym, osd_type, osd_nowbalance, osd_remark, companyId, 
+    osd_id, osd_osid, osd_detno, osd_ym, osd_type, osd_nowbalance, osd_remark, companyId,
     updaterId, updatedate, osd_text1, osd_text2, osd_text3, osd_text4, osd_text5
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
     <include refid="Base_Column_List" />
     from othspendingsdetail
-    where osd_orid = #{id,jdbcType=INTEGER}
+    where osd_osid = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from othspendingsdetail
-    where osd_orid = #{id,jdbcType=INTEGER}
+    where osd_osid = #{id,jdbcType=INTEGER}
   </delete>
 
   <delete id="deleteItem" parameterType="java.lang.Integer" >
@@ -40,7 +40,7 @@
   </delete>
 
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Othspendingsdetail" >
-    insert into othspendingsdetail (osd_orid, osd_detno,
+    insert into othspendingsdetail (osd_osid, osd_detno,
       osd_ym, osd_type, osd_nowbalance, 
       osd_remark, companyId, updaterId, 
       updatedate, osd_text1, osd_text2, 
@@ -56,8 +56,8 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Othspendingsdetail" >
     insert into othspendingsdetail
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="osd_orid != null" >
-        osd_orid,
+      <if test="osd_osid != null" >
+        osd_osid,
       </if>
       <if test="osd_detno != null" >
         osd_detno,
@@ -100,8 +100,8 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="osd_orid != null" >
-        #{osd_orid,jdbcType=INTEGER},
+      <if test="osd_osid != null" >
+        #{osd_osid,jdbcType=INTEGER},
       </if>
       <if test="osd_detno != null" >
         #{osd_detno,jdbcType=INTEGER},
@@ -150,8 +150,8 @@
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Othspendingsdetail" >
     update othspendingsdetail
     <set >
-      <if test="osd_orid != null" >
-        osd_orid = #{osd_orid,jdbcType=INTEGER},
+      <if test="osd_osid != null" >
+        osd_osid = #{osd_osid,jdbcType=INTEGER},
       </if>
       <if test="osd_detno != null" >
         osd_detno = #{osd_detno,jdbcType=INTEGER},
@@ -197,7 +197,7 @@
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Othspendingsdetail" >
     update othspendingsdetail
-    set osd_orid = #{osdOrid,jdbcType=INTEGER},
+    set osd_osid = #{osdOrid,jdbcType=INTEGER},
       osd_detno = #{osdDetno,jdbcType=INTEGER},
       osd_ym = #{osdYm,jdbcType=INTEGER},
       osd_type = #{osdType,jdbcType=VARCHAR},
@@ -215,6 +215,6 @@
   </update>
 
   <select id="selectYm" parameterType="java.lang.Integer" resultType="java.lang.Integer">
-    select osd_ym from othspendingsdetail where osd_orid = #{id,jdbcType=INTEGER}
+    select osd_ym from othspendingsdetail where osd_osid = #{id,jdbcType=INTEGER}
   </select>
 </mapper>

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

@@ -604,7 +604,7 @@
   </update>
 
 <select id="selectThisamount" parameterType="java.lang.Integer" resultType="java.lang.Double">
-  select bk_thisamount from bankinformation where bk_id = #{id,jdbcType=INTEGER}
+  select bk_beginamount from bankinformation where bk_id = #{id,jdbcType=INTEGER}
 </select>
 
 <!-- 供应商-->

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

@@ -44,7 +44,7 @@
                 and pd_ym=#{si_yearmonth,jdbcType=INTEGER} and pb_statuscode='AUDITED',
             </if>
             <if test="si_amount_otherpay != null" >
-                (select sum(os_amount) from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_orid
+                (select sum(os_amount) from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_osid
                 where othspendingsdetail.companyId=#{companyid,jdbcType=INTEGER}
                 and osd_ym=#{si_yearmonth,jdbcType=INTEGER} and os_statuscode='AUDITED'),
             </if>
@@ -76,7 +76,7 @@
             </if>
             <if test="si_amount_otherpay != null" >
                 si_amount_otherpay =
-                (select sum(os_amount) from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_orid
+                (select sum(os_amount) from othspendings RIGHT JOIN othspendingsdetail on os_id = osd_osid
                 where othspendingsdetail.companyId=#{companyid,jdbcType=INTEGER}
                 and osd_ym=#{si_yearmonth,jdbcType=INTEGER} and os_statuscode='AUDITED'),
             </if>

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

@@ -270,7 +270,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("commitUser",BaseContextHolder.getUserName());
         map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
         Result res = warehouseApi.post(map);
@@ -323,7 +322,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("commitUser",BaseContextHolder.getUserName());
         map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
         Result res = warehouseApi.unPost(map);

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

@@ -47,7 +47,8 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      #defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.253.31:8500/eureka/
 management:
   endpoints:
     web:

+ 12 - 2
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java

@@ -6,6 +6,8 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
 
 /**
@@ -16,9 +18,17 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
 @MapperScan("com.usoftchina.saas.sale.mapper")
 @EnableEurekaClient
 @EnableFeignClients("com.usoftchina.saas")
-@EnableAuthClient
-public class SaleApplication{
+//@EnableAuthClient
+public class SaleApplication extends WebMvcConfigurerAdapter {
     public static void main(String[] args) {
         SpringApplication.run(SaleApplication.class, args);
     }
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**")
+                .allowCredentials(true)
+                .allowedHeaders("*")
+                .allowedOrigins("*")
+                .allowedMethods("*");
+    }
 }

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

@@ -1,11 +1,12 @@
 package com.usoftchina.saas.sale.mapper;
 
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.sale.po.Sale;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
-public interface SaleMapper {
+public interface SaleMapper extends CommonBaseMapper<Sale> {
 
     int deleteByPrimaryKey(Long sa_id);
 

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

@@ -1,5 +1,6 @@
 package com.usoftchina.saas.sale.po;
 
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
 import com.usoftchina.saas.document.dto.ProductDTO;
 import lombok.Data;
 
@@ -11,7 +12,7 @@ import java.util.Date;
  * @create: 2018-10-22 14:38
  **/
 @Data
-public class SaleList implements Serializable{
+public class SaleList extends CommonBaseEntity implements Serializable{
     private Integer sa_id;
 
     private String sa_code;

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

@@ -259,7 +259,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("commitUser",BaseContextHolder.getUserName());
         map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
         Result res = warehouseApi.post(map);
@@ -312,7 +311,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         map.put("inoutNo", pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("commitUser",BaseContextHolder.getUserName());
         map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
         Result res = warehouseApi.unPost(map);

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.sale.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.CommonService;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MessageLogService;
@@ -40,7 +41,7 @@ import java.util.*;
  * @create: 2018-10-22 11:29
  **/
 @Service
-public class SaleServiceImpl implements SaleService{
+public class SaleServiceImpl extends CommonBaseServiceImpl<SaleMapper,Sale> implements SaleService{
 
     @Autowired
     private SaleListMapper saleListMapper;
@@ -111,11 +112,6 @@ public class SaleServiceImpl implements SaleService{
         Long sa_id = main.getId();
         String sa_code = main.getSa_code();
         Sale sale = BeanMapper.map(main, Sale.class);
-        sale.setCompanyId(companyId);
-        sale.setCreatorId(userId);
-        sale.setCreateTime(new Date());
-        sale.setSa_recorderid(userId);
-        sale.setSa_recorder("test");
         sale.setSa_sendstatus(Status.UNTURNOUT.getDisplay());
         sale.setSa_sendstatuscode(Status.UNTURNOUT.name());
 
@@ -125,6 +121,7 @@ public class SaleServiceImpl implements SaleService{
         sale.setSa_code(sa_code);
         //判断更新与保存动作
         if (StringUtils.isEmpty(sa_id) || "0".equals(sa_id.toString())) {
+            sale.setCompanyId(companyId);
             //插入操作
             saleMapper.insertSelective(sale);
             sa_id = sale.getId();

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

@@ -245,7 +245,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("commitUser",BaseContextHolder.getUserName());
         map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
         Result res = warehouseApi.post(map);
@@ -298,7 +297,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         map.put("inoutNo",pi_inoutno);
         map.put("class", pi_class);
         map.put("commitid",BaseContextHolder.getUserId());
-        map.put("commitUser",BaseContextHolder.getUserName());
         map.put("companyId",BaseContextHolder.getCompanyId());
         map.put("result","");
         Result res = warehouseApi.unPost(map);

+ 33 - 5
base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/api/AccountApi.java

@@ -1,11 +1,11 @@
 package com.usoftchina.saas.account.api;
 
+import com.usoftchina.saas.account.dto.AccountCopyDTO;
 import com.usoftchina.saas.account.dto.AccountDTO;
+import com.usoftchina.saas.account.dto.AccountRegDTO;
 import com.usoftchina.saas.base.Result;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author yingp
@@ -29,15 +29,43 @@ public interface AccountApi {
      * @param username
      * @return
      */
-    @GetMapping(value = "/account/read")
+    @GetMapping(value = "/account/read", params = "username")
     Result<AccountDTO> getAccount(@RequestParam(value = "username") String username);
 
+    /**
+     * 按用户uu查找账户
+     *
+     * @param uu
+     * @return
+     */
+    @GetMapping(value = "/account/read", params = "uu")
+    Result<AccountDTO> getAccountByUu(@RequestParam(value = "uu") Long uu);
+
     /**
      * 按用户名查找账户
      *
      * @param id
      * @return
      */
-    @GetMapping(value = "/account/{id}")
+    @GetMapping(value = "/account/read/{id}")
     Result<AccountDTO> getAccountById(@PathVariable("id") Long id);
+
+    /**
+     * 注册
+     *
+     * @param accountRegDTO
+     * @return
+     */
+    @PostMapping("/account/register")
+    Result register(@RequestBody AccountRegDTO accountRegDTO);
+
+    /**
+     * 从其他平台同步已注册用户信息
+     * 区别于普通注册:密码已经是加密后的密文
+     *
+     * @param accountSyncDTO
+     * @return
+     */
+    @PostMapping("/account/register/copy")
+    Result copyRegistration(@RequestBody AccountCopyDTO accountSyncDTO);
 }

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

@@ -0,0 +1,70 @@
+package com.usoftchina.saas.account.api;
+
+import com.usoftchina.saas.account.dto.CompanyCopyDTO;
+import com.usoftchina.saas.account.dto.CompanyDTO;
+import com.usoftchina.saas.account.dto.CompanyRegDTO;
+import com.usoftchina.saas.base.Result;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author yingp
+ * @date 2018/11/15
+ */
+@FeignClient(name = "account-server")
+public interface CompanyApi {
+
+    /**
+     * 注册
+     *
+     * @param companyRegDTO
+     * @return
+     */
+    @PostMapping("/company/register")
+    Result register(@RequestBody CompanyRegDTO companyRegDTO);
+
+    /**
+     * 从其他平台复制已注册企业信息
+     *
+     * @param companyCopyDTO
+     * @return
+     */
+    @PostMapping("/company/register/copy")
+    Result copyRegistration(@RequestBody CompanyCopyDTO companyCopyDTO);
+
+    /**
+     * 按名称查找
+     *
+     * @param name
+     * @return
+     */
+    @GetMapping(path = "/company/read", params = "name")
+    Result<CompanyDTO> getCompanyByName(@RequestParam String name);
+
+    /**
+     * 按商业登记证号查找
+     *
+     * @param businessCode
+     * @return
+     */
+    @GetMapping(path = "/company/read", params = "businessCode")
+    Result<CompanyDTO> getCompanyByBusinessCode(@RequestParam String businessCode);
+
+    /**
+     * 按企业uu查找
+     *
+     * @param uu
+     * @return
+     */
+    @GetMapping(path = "/company/read", params = "uu")
+    Result<CompanyDTO> getCompanyByUu(@RequestParam Long uu);
+
+    /**
+     * 按ID查找
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(path = "/company/read/{id}")
+    Result<CompanyDTO> getCompanyById(@PathVariable Long id);
+}

+ 22 - 7
base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/cache/AccountCache.java

@@ -18,18 +18,26 @@ import java.util.function.Supplier;
  * @date 2018/11/1
  */
 public class AccountCache extends RedisHashCache<String, String, String> {
-    private final long id;
+    private Long id;
+    private Long uu;
 
     private static final RedisTemplate<String, String> REDIS_TEMPLATE = SpringContextHolder.getBean("redisTemplate", RedisTemplate.class);
     private AccountApi accountApi;
 
-    private AccountCache(long id) {
+    private AccountCache() {
         super(() -> REDIS_TEMPLATE);
-        this.id = id;
     }
 
     public static AccountCache of(long id) {
-        return new AccountCache(id);
+        AccountCache cache = new AccountCache();
+        cache.id = id;
+        return cache;
+    }
+
+    public static AccountCache uu(long uu) {
+        AccountCache cache = new AccountCache();
+        cache.uu = uu;
+        return cache;
     }
 
     /**
@@ -38,12 +46,12 @@ public class AccountCache extends RedisHashCache<String, String, String> {
      * @return
      */
     public static AccountCache current() {
-        return new AccountCache(BaseContextHolder.getUserId());
+        return of(BaseContextHolder.getUserId());
     }
 
     @Override
     protected String field() {
-        return String.valueOf(id);
+        return String.valueOf(null == id ? ("uu:" + uu) : ("id:" + id));
     }
 
     @Override
@@ -57,7 +65,14 @@ public class AccountCache extends RedisHashCache<String, String, String> {
             if (null == accountApi) {
                 accountApi = SpringContextHolder.getBean(AccountApi.class);
             }
-            Result<AccountDTO> result = accountApi.getAccountById(id);
+            Result<AccountDTO> result = null;
+            if (null != id && id > 0) {
+                result = accountApi.getAccountById(id);
+            } else if (null != uu) {
+                result = accountApi.getAccountByUu(uu);
+            } else {
+                return null;
+            }
             if (result.isSuccess()) {
                 return JsonUtils.toJsonString(result.getData());
             }

+ 104 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountCopyDTO.java

@@ -0,0 +1,104 @@
+package com.usoftchina.saas.account.dto;
+
+import java.io.Serializable;
+
+/**
+ * 用于从其他平台复制已注册用户信息过来的接口
+ *
+ * @author yingp
+ * @date 2018/11/15
+ */
+public class AccountCopyDTO implements Serializable{
+    private String username;
+    /**
+     * 密文密码
+     */
+    private String password;
+    private String salt;
+    private String realname;
+    private String email;
+    private String mobile;
+    /**
+     * 账号类型 0 - 管理员
+     */
+    private Integer type;
+    private Long uu;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getSalt() {
+        return salt;
+    }
+
+    public void setSalt(String salt) {
+        this.salt = salt;
+    }
+
+    public String getRealname() {
+        return realname;
+    }
+
+    public void setRealname(String realname) {
+        this.realname = realname;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
+
+    @Override
+    public String toString() {
+        return "AccountCopyDTO{" +
+                "username='" + username + '\'' +
+                ", password='" + password + '\'' +
+                ", salt='" + salt + '\'' +
+                ", realname='" + realname + '\'' +
+                ", email='" + email + '\'' +
+                ", mobile='" + mobile + '\'' +
+                ", type=" + type +
+                ", uu=" + uu +
+                '}';
+    }
+}

+ 13 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountDTO.java

@@ -29,6 +29,10 @@ public class AccountDTO implements Serializable {
      * 账号类型 0 - 管理员
      */
     private Integer type;
+    /**
+     * uu
+     */
+    private Long uu;
     /**
      * 所有绑定的公司
      */
@@ -104,6 +108,14 @@ public class AccountDTO implements Serializable {
         this.type = type;
     }
 
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
+
     public List<CompanyBaseDTO> getCompanies() {
         return companies;
     }
@@ -165,6 +177,7 @@ public class AccountDTO implements Serializable {
                 ", mobile='" + mobile + '\'' +
                 ", avatarUrl='" + avatarUrl + '\'' +
                 ", type=" + type +
+                ", uu=" + uu +
                 ", companies=" + companies +
                 ", rolesMap=" + rolesMap +
                 ", resourcesTable=" + resourcesTable +

+ 77 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyCopyDTO.java

@@ -0,0 +1,77 @@
+package com.usoftchina.saas.account.dto;
+
+import io.swagger.annotations.ApiModel;
+
+import java.io.Serializable;
+
+/**
+ * 用于从其他平台复制已注册企业信息过来的接口
+ *
+ * @author yingp
+ * @date 2018/11/15
+ */
+@ApiModel(value = "CompanyCopy", description = "公司注册信息")
+public class CompanyCopyDTO implements Serializable{
+    /**
+     * 唯一名称
+     */
+    private String name;
+    /**
+     * 商业登记证号
+     */
+    private String businessCode;
+    private String address;
+    private String logoUrl;
+    private Long uu;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getBusinessCode() {
+        return businessCode;
+    }
+
+    public void setBusinessCode(String businessCode) {
+        this.businessCode = businessCode;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getLogoUrl() {
+        return logoUrl;
+    }
+
+    public void setLogoUrl(String logoUrl) {
+        this.logoUrl = logoUrl;
+    }
+
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
+
+    @Override
+    public String toString() {
+        return "CompanyCopyDTO{" +
+                "name='" + name + '\'' +
+                ", businessCode='" + businessCode + '\'' +
+                ", address='" + address + '\'' +
+                ", logoUrl='" + logoUrl + '\'' +
+                ", uu=" + uu +
+                '}';
+    }
+}

+ 10 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyDTO.java

@@ -21,6 +21,7 @@ public class CompanyDTO implements Serializable{
     private String businessCode;
     private String address;
     private String logoUrl;
+    private Long uu;
 
     public Long getId() {
         return id;
@@ -62,6 +63,14 @@ public class CompanyDTO implements Serializable{
         this.logoUrl = logoUrl;
     }
 
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
+
     @Override
     public String toString() {
         return "CompanyDTO{" +
@@ -70,6 +79,7 @@ public class CompanyDTO implements Serializable{
                 ", businessCode='" + businessCode + '\'' +
                 ", address='" + address + '\'' +
                 ", logoUrl='" + logoUrl + '\'' +
+                ", uu=" + uu +
                 '}';
     }
 }

+ 18 - 2
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/AccountController.java

@@ -168,7 +168,7 @@ public class AccountController {
      * @param username
      * @return
      */
-    @GetMapping("/read")
+    @GetMapping(value = "/read", params = "username")
     public Result<AccountDTO> getAccount(@RequestParam(value = "username") String username) {
         Account account = getAccountByUsername(username);
         if (null == account) {
@@ -178,6 +178,22 @@ public class AccountController {
         return Result.success(getAccountDTO(account));
     }
 
+    /**
+     * 按用户名查找账户
+     *
+     * @param uu
+     * @return
+     */
+    @GetMapping(value = "/read", params = "uu")
+    public Result<AccountDTO> getAccountByUu(@RequestParam(value = "uu") Long uu) {
+        Account account = accountService.findByUu(uu);
+        if (null == account) {
+            return Result.error(ExceptionCode.USER_NOT_EXIST);
+        }
+
+        return Result.success(getAccountDTO(account));
+    }
+
     /**
      * 按当前登录用户查找账户
      *
@@ -199,7 +215,7 @@ public class AccountController {
      * @param id
      * @return
      */
-    @GetMapping("/{id}")
+    @GetMapping("/read/{id}")
     public Result<AccountDTO> getAccountById(@PathVariable Long id) {
         Account account = accountService.findByPrimaryKey(id);
         if (null == account) {

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

@@ -78,6 +78,38 @@ public class CompanyController {
         return Result.error(ExceptionCode.COMPANY_NOT_EXIST);
     }
 
+    /**
+     * 按uu查找
+     *
+     * @param uu
+     * @return
+     */
+    @GetMapping(path = "/read", params = "uu")
+    public Result<CompanyDTO> getByUu(@RequestParam Long uu) {
+        Company company = companyService.findByUu(uu);
+        if (null != company) {
+            CompanyDTO companyDTO = BeanMapper.map(company, CompanyDTO.class);
+            return Result.success(companyDTO);
+        }
+        return Result.error(ExceptionCode.COMPANY_NOT_EXIST);
+    }
+
+    /**
+     * 按ID查找
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(path = "/read/{id}")
+    public Result<CompanyDTO> getCompanyById(@PathVariable Long id) {
+        Company company = companyService.findByPrimaryKey(id);
+        if (null != company) {
+            CompanyDTO companyDTO = BeanMapper.map(company, CompanyDTO.class);
+            return Result.success(companyDTO);
+        }
+        return Result.error(ExceptionCode.COMPANY_NOT_EXIST);
+    }
+
     /**
      * 当前登录的公司的信息
      *

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

@@ -74,6 +74,14 @@ public interface AccountMapper {
      */
     Account selectByEmail(@Param("email") String email);
 
+    /**
+     * 按uu查找
+     *
+     * @param uu
+     * @return
+     */
+    Account selectByUu(@Param("uu") Long uu);
+
     /**
      * 按角色查找
      *

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

@@ -43,6 +43,14 @@ public interface CompanyMapper {
      */
     Company selectByName(@Param("name") String name);
 
+    /**
+     * 按uu查询
+     *
+     * @param uu
+     * @return
+     */
+    Company selectByUu(@Param("uu") Long uu);
+
     /**
      * 按商业登记证号查询
      *

+ 13 - 4
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/Account.java

@@ -26,10 +26,11 @@ public class Account implements Serializable {
      */
     private Integer type;
     private boolean enabled;
-    protected Date createTime;
-    protected long creatorId;
-    protected Date updateTime;
-    protected long updaterId;
+    private Date createTime;
+    private long creatorId;
+    private Date updateTime;
+    private long updaterId;
+    private Long uu;
 
     public String getUsername() {
         return username;
@@ -142,4 +143,12 @@ public class Account implements Serializable {
     public void setUpdaterId(long updaterId) {
         this.updaterId = updaterId;
     }
+
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
 }

+ 13 - 4
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/po/Company.java

@@ -24,10 +24,11 @@ public class Company implements Serializable {
      * 企业logo
      */
     private String logoUrl;
-    protected Date createTime;
-    protected long creatorId;
-    protected Date updateTime;
-    protected long updaterId;
+    private Date createTime;
+    private long creatorId;
+    private Date updateTime;
+    private long updaterId;
+    private Long uu;
 
     public String getName() {
         return name;
@@ -100,4 +101,12 @@ public class Company implements Serializable {
     public void setUpdaterId(long updaterId) {
         this.updaterId = updaterId;
     }
+
+    public Long getUu() {
+        return uu;
+    }
+
+    public void setUu(Long uu) {
+        this.uu = uu;
+    }
 }

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

@@ -51,6 +51,14 @@ public interface AccountService {
      */
     Account findByEmail(String email);
 
+    /**
+     * 按uu查找
+     *
+     * @param uu
+     * @return
+     */
+    Account findByUu(Long uu);
+
     /**
      * 按主键查找
      *

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

@@ -34,6 +34,14 @@ public interface CompanyService {
      */
     Company findByBusinessCode(String businessCode);
 
+    /**
+     * 按uu查找
+     *
+     * @param uu
+     * @return
+     */
+    Company findByUu(Long uu);
+
     /**
      * 按ID查找
      *

+ 9 - 0
base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/AccountServiceImpl.java

@@ -64,6 +64,11 @@ public class AccountServiceImpl implements AccountService {
         return accountMapper.selectByUsername(username);
     }
 
+    @Override
+    public Account findByUu(Long uu) {
+        return accountMapper.selectByUu(uu);
+    }
+
     @Override
     public Account findByMobile(String mobile) {
         return accountMapper.selectByMobile(mobile);
@@ -169,5 +174,9 @@ public class AccountServiceImpl implements AccountService {
     @Override
     public void clearCache(Long accountId) {
         AccountCache.of(accountId).hdel();
+        Account account = accountMapper.selectByPrimaryKey(accountId);
+        if (null != account && null != account.getUu()) {
+            AccountCache.uu(account.getUu()).hdel();
+        }
     }
 }

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

@@ -51,6 +51,11 @@ public class CompanyServiceImpl implements CompanyService{
         return companyMapper.selectByBusinessCode(businessCode);
     }
 
+    @Override
+    public Company findByUu(Long uu) {
+        return companyMapper.selectByUu(uu);
+    }
+
     @Override
     public Company findByPrimaryKey(Long id) {
         return companyMapper.selectByPrimaryKey(id);

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

@@ -178,6 +178,9 @@
     <select id="selectByEmail" parameterType="java.lang.String" resultMap="BaseResultMap">
         select <include refid="baseColumns"/> from ac_account where email=#{email}
     </select>
+    <select id="selectByUu" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select <include refid="baseColumns"/> from ac_account where uu=#{uu}
+    </select>
     <select id="selectByRoleId" parameterType="java.lang.Long" resultMap="BaseResultMap">
         select <include refid="baseColumns"/> from ac_account,ac_account_role where
         ac_account.id=ac_account_role.account_id and ac_account_role.role_id=#{roleId,jdbcType=BIGINT}

+ 13 - 2
base-servers/account/account-server/src/main/resources/mapper/CompanyMapper.xml

@@ -6,6 +6,8 @@
         <result column="name" jdbcType="VARCHAR" property="name"/>
         <result column="business_code" jdbcType="VARCHAR" property="businessCode"/>
         <result column="address" jdbcType="VARCHAR" property="address"/>
+        <result column="logo_url" jdbcType="VARCHAR" property="logoUrl"/>
+        <result column="uu" jdbcType="BIGINT" property="uu"/>
         <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
         <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="updater_id" jdbcType="BIGINT" property="updaterId"/>
@@ -21,9 +23,9 @@
     </sql>
     <insert id="insert" parameterType="com.usoftchina.saas.account.po.Company"
             useGeneratedKeys="true" keyProperty="id">
-        insert into ac_company(name, business_code, address, logo_url, creator_id, create_time, updater_id, update_time)
+        insert into ac_company(name, business_code, address, logo_url, uu, creator_id, create_time, updater_id, update_time)
         values (#{name,jdbcType=VARCHAR}, #{businessCode,jdbcType=VARCHAR},
-        #{address,jdbcType=VARCHAR}, #{logoUrl,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT},
+        #{address,jdbcType=VARCHAR}, #{logoUrl,jdbcType=VARCHAR}, #{uu,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
         #{createTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})
     </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.account.po.Company"
@@ -42,6 +44,9 @@
             <if test="logoUrl != null">
                 logo_url,
             </if>
+            <if test="uu != null">
+                uu,
+            </if>
             <if test="creatorId != null">
                 creator_id,
             </if>
@@ -68,6 +73,9 @@
             <if test="logoUrl != null">
                 #{logoUrl,jdbcType=VARCHAR},
             </if>
+            <if test="uu != null">
+                #{uu,jdbcType=BIGINT},
+            </if>
             <if test="creatorId != null">
                 #{creatorId,jdbcType=BIGINT},
             </if>
@@ -88,6 +96,9 @@
     <select id="selectByName" parameterType="java.lang.String" resultMap="FullResultMap">
         select <include refid="baseColumns"/> from ac_company where name=#{name,jdbcType=VARCHAR}
     </select>
+    <select id="selectByUu" parameterType="java.lang.Long" resultMap="FullResultMap">
+        select <include refid="baseColumns"/> from ac_company where uu=#{uu,jdbcType=BIGINT}
+    </select>
     <select id="selectByBusinessCode" parameterType="java.lang.String" resultMap="FullResultMap">
         select <include refid="baseColumns"/> from ac_company where business_code=#{businessCode,jdbcType=VARCHAR}
     </select>

+ 74 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/cookie/CookieHelper.java

@@ -0,0 +1,74 @@
+package com.usoftchina.saas.auth.common.cookie;
+
+import com.usoftchina.saas.auth.common.crypto.Rc4Utils;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.exception.ExceptionCode;
+import com.usoftchina.saas.utils.JsonUtils;
+import com.usoftchina.saas.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author yingp
+ * @date 2018/11/15
+ */
+public class CookieHelper {
+
+    private static final Logger logger = LoggerFactory.getLogger(CookieHelper.class);
+
+    private static final String CUT_SYMBOL = "#";
+
+    /**
+     * 解析token
+     *
+     * @param token      token
+     * @param secretKey  私钥
+     * @return
+     * @throws BizException
+     */
+    public static CookieToken parseToken(String token, String secretKey) throws BizException {
+        try {
+            String jsonToken = Rc4Utils.decrypt(token, secretKey);
+            return JsonUtils.fromJsonString(jsonToken.split(CUT_SYMBOL)[0], CookieToken.class);
+        } catch (Exception e) {
+            logger.error(e.getMessage());
+            throw new BizException(ExceptionCode.COOKIE_ILLEGAL_ARGUMENT);
+        }
+    }
+
+    /**
+     * 获取token中的用户信息
+     *
+     * @param token
+     * @param secretKey
+     * @return
+     * @throws BizException
+     */
+    public static CookieInfo geInfoFromToken(String token, String secretKey) throws BizException {
+        CookieToken cookieToken = parseToken(token, secretKey);
+        if (!StringUtils.isEmpty(cookieToken.getData())) {
+            return JsonUtils.fromJsonString(cookieToken.getData(), CookieInfo.class);
+        }
+        return null;
+    }
+
+    /**
+     * 获取token中的用户信息
+     *
+     * @param request
+     * @param cookieName
+     * @param secretKey
+     * @return
+     * @throws BizException
+     */
+    public static CookieInfo geInfoFromRequest(HttpServletRequest request, String cookieName, String secretKey) throws BizException {
+        Cookie cookie = CookieUtils.getCookie(request, cookieName);
+        if (null != cookie) {
+            return geInfoFromToken(cookie.getValue(), secretKey);
+        }
+        return null;
+    }
+}

+ 277 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/cookie/CookieInfo.java

@@ -0,0 +1,277 @@
+package com.usoftchina.saas.auth.common.cookie;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author yingp
+ * @date 2018/11/15
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class CookieInfo implements Serializable {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * uu号
+     */
+    private Long userUU;
+
+    /**
+     * 会员名
+     */
+    private String vipName;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 手机号所属区域(continent or Hongkong)
+     */
+    private String mobileArea;
+
+    /**
+     * 手机号认证状态
+     */
+    private Short mobileValidCode;
+
+    /**
+     * 用户密码
+     */
+    private String password;
+
+    /**
+     * 用户erp密码
+     */
+    private String erpPassword;
+
+    /**
+     * 盐值
+     */
+    private String salt;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+
+    /**
+     * 用户邮箱认证状态
+     */
+    private Short emailValidCode;
+
+    /**
+     * 身份认证状态
+     */
+    private Short identityValidCode;
+
+    /**
+     * 账户是否冻结(1、冻结)
+     */
+    private Short lock;
+
+    /**
+     * 企业uu号
+     */
+    private Long spaceUU;
+
+    /**
+     * 企业名称
+     */
+    private String spaceName;
+
+    /**
+     * 营业执照号
+     */
+    private String businessCode;
+
+    /**
+     * 企业域名
+     */
+    private String spaceDomain;
+
+    /**
+     * 应用唯一标志
+     */
+    private String appId;
+
+    /**
+     * 上次登录时间
+     */
+    private Date lastLoginTime;
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public String getVipName() {
+        return vipName;
+    }
+
+    public void setVipName(String vipName) {
+        this.vipName = vipName;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getMobileArea() {
+        return mobileArea;
+    }
+
+    public void setMobileArea(String mobileArea) {
+        this.mobileArea = mobileArea;
+    }
+
+    public Short getMobileValidCode() {
+        return mobileValidCode;
+    }
+
+    public void setMobileValidCode(Short mobileValidCode) {
+        this.mobileValidCode = mobileValidCode;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getErpPassword() {
+        return erpPassword;
+    }
+
+    public void setErpPassword(String erpPassword) {
+        this.erpPassword = erpPassword;
+    }
+
+    public String getSalt() {
+        return salt;
+    }
+
+    public void setSalt(String salt) {
+        this.salt = salt;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public Short getEmailValidCode() {
+        return emailValidCode;
+    }
+
+    public void setEmailValidCode(Short emailValidCode) {
+        this.emailValidCode = emailValidCode;
+    }
+
+    public Short getIdentityValidCode() {
+        return identityValidCode;
+    }
+
+    public void setIdentityValidCode(Short identityValidCode) {
+        this.identityValidCode = identityValidCode;
+    }
+
+    public Short getLock() {
+        return lock;
+    }
+
+    public void setLock(Short lock) {
+        this.lock = lock;
+    }
+
+    public Long getSpaceUU() {
+        return spaceUU;
+    }
+
+    public void setSpaceUU(Long spaceUU) {
+        this.spaceUU = spaceUU;
+    }
+
+    public String getSpaceName() {
+        return spaceName;
+    }
+
+    public void setSpaceName(String spaceName) {
+        this.spaceName = spaceName;
+    }
+
+    public String getBusinessCode() {
+        return businessCode;
+    }
+
+    public void setBusinessCode(String businessCode) {
+        this.businessCode = businessCode;
+    }
+
+    public String getSpaceDomain() {
+        return spaceDomain;
+    }
+
+    public void setSpaceDomain(String spaceDomain) {
+        this.spaceDomain = spaceDomain;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public Date getLastLoginTime() {
+        return lastLoginTime;
+    }
+
+    public void setLastLoginTime(Date lastLoginTime) {
+        this.lastLoginTime = lastLoginTime;
+    }
+
+    @Override
+    public String toString() {
+        return "CookieInfo{" +
+                "userUU=" + userUU +
+                ", vipName='" + vipName + '\'' +
+                ", mobile='" + mobile + '\'' +
+                ", mobileArea='" + mobileArea + '\'' +
+                ", mobileValidCode=" + mobileValidCode +
+                ", password='" + password + '\'' +
+                ", erpPassword='" + erpPassword + '\'' +
+                ", salt='" + salt + '\'' +
+                ", email='" + email + '\'' +
+                ", emailValidCode=" + emailValidCode +
+                ", identityValidCode=" + identityValidCode +
+                ", lock=" + lock +
+                ", spaceUU=" + spaceUU +
+                ", spaceName='" + spaceName + '\'' +
+                ", businessCode='" + businessCode + '\'' +
+                ", spaceDomain='" + spaceDomain + '\'' +
+                ", appId='" + appId + '\'' +
+                ", lastLoginTime=" + lastLoginTime +
+                '}';
+    }
+}

+ 115 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/cookie/CookieToken.java

@@ -0,0 +1,115 @@
+package com.usoftchina.saas.auth.common.cookie;
+
+import java.io.Serializable;
+
+/**
+ * @author yingp
+ * @date 2018/11/15
+ */
+public class CookieToken implements Serializable {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 1L;
+
+    /* 正常 */
+    public final static int FLAG_NORMAL = 0;
+
+    /* 缓存宕机 */
+    public final static int FLAG_CACHE_SHUT = 1;
+
+    /* 系统名称 */
+    private String app;
+
+    /* 登录类型 */
+    private Integer type;
+
+    /* 预留 */
+    private String data;
+
+    /* 用户 ID(长整型) */
+    private Long id;
+
+    /* 用户 ID(字符串类型,默认 fastjson 无值该参数不参与 json 序列化) */
+    private String uid;
+
+    /* 登录 IP */
+    private String ip;
+
+    /* 创建 token 当前系统时间 */
+    private long time = System.currentTimeMillis();
+
+    /**
+     * Token 状态标示
+     * <p>
+     * 默认正常执行
+     * </p>
+     */
+    private int flag = FLAG_NORMAL;
+
+    public String getApp() {
+        return app;
+    }
+
+    public void setApp(String app) {
+        this.app = app;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public int getFlag() {
+        return flag;
+    }
+
+    public void setFlag(int flag) {
+        this.flag = flag;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public void setTime(long time) {
+        this.time = time;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getData() {
+        return data;
+    }
+
+    public void setData(String data) {
+        this.data = data;
+    }
+}
+

+ 126 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/cookie/CookieUtils.java

@@ -0,0 +1,126 @@
+package com.usoftchina.saas.auth.common.cookie;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Optional;
+
+/**
+ * @author yingp
+ * @date 2018/1/25
+ */
+public class CookieUtils {
+
+    /**
+     * get cookie by name
+     *
+     * @param request
+     * @param cookieName
+     * @return
+     */
+    public static Cookie getCookie(HttpServletRequest request, String cookieName) {
+        return Optional.ofNullable(request.getCookies())
+                .map(Arrays::asList)
+                .orElse(Collections.emptyList()).stream()
+                .filter(cookie -> cookie.getName().equals(cookieName))
+                .findFirst().orElse(null);
+    }
+
+    /**
+     * set cookie
+     *
+     * @param request
+     * @param response
+     * @param cookieName
+     * @param cookieValue
+     */
+    public static void setCookie(HttpServletRequest request, HttpServletResponse response,
+                                 String cookieName, String cookieValue) {
+        Cookie cookie = getCookie(request, cookieName);
+        if (null == cookie) {
+            cookie = new Cookie(cookieName, cookieValue);
+            cookie.setPath("/");
+            cookie.setMaxAge(-1);
+        } else if (!cookie.getValue().equals(cookieValue)) {
+            cookie.setValue(cookieValue);
+        } else {
+            return;
+        }
+        addHttpOnlyCookie(response, cookie);
+    }
+
+    /**
+     *
+     * <p>
+     * 解决 servlet 3.0 以下版本不支持 HttpOnly
+     * </p>
+     *
+     * @param response
+     *            HttpServletResponse类型的响应
+     * @param cookie
+     *            要设置httpOnly的cookie对象
+     */
+    public static void addHttpOnlyCookie(HttpServletResponse response, Cookie cookie) {
+        if (cookie == null) {
+            return;
+        }
+        /**
+         * 依次取得cookie中的名称、值、 最大生存时间、路径、域和是否为安全协议信息
+         */
+        String cookieName = cookie.getName();
+        String cookieValue = cookie.getValue();
+        int maxAge = cookie.getMaxAge();
+        String path = cookie.getPath();
+        String domain = cookie.getDomain();
+        boolean isSecure = cookie.getSecure();
+        StringBuffer sf = new StringBuffer();
+        sf.append(cookieName + "=" + cookieValue + ";");
+
+        if (maxAge >= 0) {
+            sf.append("Max-Age=" + cookie.getMaxAge() + ";");
+        }
+
+        if (domain != null) {
+            sf.append("domain=" + domain + ";");
+        }
+
+        if (path != null) {
+            sf.append("path=" + path + ";");
+        }
+
+        if (isSecure) {
+            sf.append("secure;HTTPOnly;");
+        } else {
+            sf.append("HTTPOnly;");
+        }
+
+        response.addHeader("Set-Cookie", sf.toString());
+    }
+
+    /**
+     * 清除指定Cookie
+     *
+     * @param response
+     * @param cookieName
+     *            cookie name
+     * @return boolean
+     */
+    public static void clearCookie(HttpServletRequest request, HttpServletResponse response,
+                                   String cookieName) {
+        Cookie cookie = getCookie(request, cookieName);
+        if (null != cookie) {
+            Cookie newCookie = new Cookie(cookieName, "");
+            newCookie.setMaxAge(0);
+            if (null != cookie.getDomain()) {
+                newCookie.setDomain(cookie.getDomain());
+            }
+            newCookie.setPath(cookie.getPath());
+            newCookie.setSecure(cookie.getSecure());
+            newCookie.setHttpOnly(cookie.isHttpOnly());
+            addHttpOnlyCookie(response, newCookie);
+        }
+    }
+
+}

+ 28 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/crypto/Hex.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.auth.common.crypto;
+
+/**
+ * @author yingp
+ * @date 2018/1/31
+ */
+public final class Hex {
+
+    private static final char[] HEX = {
+            '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
+    };
+
+    public static char[] encode(byte[] bytes) {
+        final int nBytes = bytes.length;
+        char[] result = new char[2*nBytes];
+
+        int j = 0;
+        for (int i=0; i < nBytes; i++) {
+            // Char for top 4 bits
+            result[j++] = HEX[(0xF0 & bytes[i]) >>> 4 ];
+            // Bottom 4
+            result[j++] = HEX[(0x0F & bytes[i])];
+        }
+
+        return result;
+    }
+
+}

+ 76 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/crypto/Rc4Utils.java

@@ -0,0 +1,76 @@
+package com.usoftchina.saas.auth.common.crypto;
+
+import com.usoftchina.saas.auth.common.crypto.base64.UrlBase64;
+import com.usoftchina.saas.auth.common.exception.AuthException;
+import org.springframework.util.DigestUtils;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * @author yingp
+ * @date 2018/1/25
+ */
+public class Rc4Utils {
+
+    final static String ALGORITHM = "RC4";
+
+    final static String defaultCharset = "UTF-8";
+
+    public static String encrypt(String value, String key) throws Exception {
+        byte[] b = UrlBase64.encode(encrypt(value.getBytes(), key));
+        return new String(b, defaultCharset);
+    }
+
+    public static String decrypt(String value, String key) throws Exception {
+        byte[] b = decrypt(UrlBase64.decode(value), key);
+        return new String(b, defaultCharset);
+    }
+
+    /**
+     * generate KEY
+     */
+    private static SecretKey toKey(String strKey) throws Exception {
+		/*
+		 * MD5 处理密钥
+		 */
+        byte[] key = DigestUtils.md5Digest(strKey.getBytes(defaultCharset));
+        return new SecretKeySpec(key, ALGORITHM);
+    }
+
+    /**
+     * 解密
+     *
+     * @param data
+     * @param key
+     * @return
+     */
+    public static byte[] decrypt(byte[] data, String key) {
+        try {
+            Cipher cipher = Cipher.getInstance(ALGORITHM);
+            cipher.init(Cipher.DECRYPT_MODE, toKey(key));
+            return cipher.doFinal(data);
+        } catch (Exception e) {
+            throw new AuthException(e);
+        }
+    }
+
+    /**
+     * 加密
+     *
+     * @param data
+     * @param key
+     * @return
+     */
+    public static byte[] encrypt(byte[] data, String key) {
+        try {
+            Cipher cipher = Cipher.getInstance(ALGORITHM);
+            cipher.init(Cipher.ENCRYPT_MODE, toKey(key));
+            return cipher.doFinal(data);
+        } catch (Exception e) {
+            throw new AuthException(e);
+        }
+    }
+
+}

+ 104 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/crypto/base64/UrlBase64.java

@@ -0,0 +1,104 @@
+package com.usoftchina.saas.auth.common.crypto.base64;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * Convert binary data to and from UrlBase64 encoding. This is identical to
+ * Base64 encoding, except that the padding character is "." and the other
+ * non-alphanumeric characters are "-" and "_" instead of "+" and "/".
+ * <p>
+ * The purpose of UrlBase64 encoding is to provide a compact encoding of binary
+ * data that is safe for use as an URL parameter. Base64 encoding does not
+ * produce encoded values that are safe for use in URLs, since "/" can be
+ * interpreted as a path delimiter; "+" is the encoded form of a space; and "="
+ * is used to separate a name from the corresponding value in an URL parameter.
+ */
+public class UrlBase64 {
+
+	private static final UrlBase64Encoder encoder = new UrlBase64Encoder();
+
+	/**
+	 * Encode the input data producing a URL safe base 64 encoded byte array.
+	 *
+	 * @return a byte array containing the URL safe base 64 encoded data.
+	 */
+	public static byte[] encode(byte[] data) {
+		ByteArrayOutputStream bOut = new ByteArrayOutputStream();
+
+		try {
+			encoder.encode(data, 0, data.length, bOut);
+		} catch (Exception e) {
+			throw new IllegalStateException("exception encoding URL safe base64 data: " + e.getMessage(), e);
+		}
+
+		return bOut.toByteArray();
+	}
+
+	/**
+	 * Encode the byte data writing it to the given output stream.
+	 *
+	 * @return the number of bytes produced.
+	 */
+	public static int encode(byte[] data, OutputStream out) throws IOException {
+		return encoder.encode(data, 0, data.length, out);
+	}
+
+	/**
+	 * Decode the URL safe base 64 encoded input data - white space will be
+	 * ignored.
+	 *
+	 * @return a byte array representing the decoded data.
+	 */
+	public static byte[] decode(byte[] data) {
+		ByteArrayOutputStream bOut = new ByteArrayOutputStream();
+
+		try {
+			encoder.decode(data, 0, data.length, bOut);
+		} catch (Exception e) {
+			throw new IllegalStateException("exception decoding URL safe base64 string: " + e.getMessage(), e);
+		}
+
+		return bOut.toByteArray();
+	}
+
+	/**
+	 * decode the URL safe base 64 encoded byte data writing it to the given
+	 * output stream, whitespace characters will be ignored.
+	 *
+	 * @return the number of bytes produced.
+	 */
+	public static int decode(byte[] data, OutputStream out) throws IOException {
+		return encoder.decode(data, 0, data.length, out);
+	}
+
+	/**
+	 * decode the URL safe base 64 encoded String data - whitespace will be
+	 * ignored.
+	 *
+	 * @return a byte array representing the decoded data.
+	 */
+	public static byte[] decode(String data) {
+		ByteArrayOutputStream bOut = new ByteArrayOutputStream();
+
+		try {
+			encoder.decode(data, bOut);
+		} catch (Exception e) {
+			throw new IllegalStateException("exception decoding URL safe base64 string: " + e.getMessage(), e);
+		}
+
+		return bOut.toByteArray();
+	}
+
+	/**
+	 * Decode the URL safe base 64 encoded String data writing it to the given
+	 * output stream, whitespace characters will be ignored.
+	 *
+	 * @return the number of bytes produced.
+	 */
+	public static int decode(String data, OutputStream out) throws IOException {
+		return encoder.decode(data, out);
+	}
+
+}

+ 276 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/crypto/base64/UrlBase64Encoder.java

@@ -0,0 +1,276 @@
+package com.usoftchina.saas.auth.common.crypto.base64;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * @author yingp
+ * @date 2018/1/26
+ */
+public class UrlBase64Encoder {
+    protected final byte[] encodingTable = { (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G',
+            (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M', (byte) 'N', (byte) 'O', (byte) 'P', (byte) 'Q',
+            (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U', (byte) 'V', (byte) 'W', (byte) 'X', (byte) 'Y', (byte) 'Z', (byte) 'a',
+            (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f', (byte) 'g', (byte) 'h', (byte) 'i', (byte) 'j', (byte) 'k',
+            (byte) 'l', (byte) 'm', (byte) 'n', (byte) 'o', (byte) 'p', (byte) 'q', (byte) 'r', (byte) 's', (byte) 't', (byte) 'u',
+            (byte) 'v', (byte) 'w', (byte) 'x', (byte) 'y', (byte) 'z', (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4',
+            (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) '-', (byte) '_' };
+
+    protected byte padding = (byte) '.';
+
+    /*
+     * set up the decoding table.
+     */
+    protected final byte[] decodingTable = new byte[128];
+
+    protected void initialiseDecodingTable() {
+        for (int i = 0; i < decodingTable.length; i++) {
+            decodingTable[i] = (byte) 0xff;
+        }
+
+        for (int i = 0; i < encodingTable.length; i++) {
+            decodingTable[encodingTable[i]] = (byte) i;
+        }
+    }
+
+    public UrlBase64Encoder() {
+        initialiseDecodingTable();
+    }
+
+    /**
+     * encode the input data producing a base 64 output stream.
+     *
+     * @return the number of bytes produced.
+     */
+    public int encode(byte[] data, int off, int length, OutputStream out) throws IOException {
+        int modulus = length % 3;
+        int dataLength = (length - modulus);
+        int a1, a2, a3;
+
+        for (int i = off; i < off + dataLength; i += 3) {
+            a1 = data[i] & 0xff;
+            a2 = data[i + 1] & 0xff;
+            a3 = data[i + 2] & 0xff;
+
+            out.write(encodingTable[(a1 >>> 2) & 0x3f]);
+            out.write(encodingTable[((a1 << 4) | (a2 >>> 4)) & 0x3f]);
+            out.write(encodingTable[((a2 << 2) | (a3 >>> 6)) & 0x3f]);
+            out.write(encodingTable[a3 & 0x3f]);
+        }
+
+		/*
+		 * process the tail end.
+		 */
+        int b1, b2, b3;
+        int d1, d2;
+
+        switch (modulus) {
+            case 0: /* nothing left to do */
+                break;
+            case 1:
+                d1 = data[off + dataLength] & 0xff;
+                b1 = (d1 >>> 2) & 0x3f;
+                b2 = (d1 << 4) & 0x3f;
+
+                out.write(encodingTable[b1]);
+                out.write(encodingTable[b2]);
+                out.write(padding);
+                out.write(padding);
+                break;
+            case 2:
+                d1 = data[off + dataLength] & 0xff;
+                d2 = data[off + dataLength + 1] & 0xff;
+
+                b1 = (d1 >>> 2) & 0x3f;
+                b2 = ((d1 << 4) | (d2 >>> 4)) & 0x3f;
+                b3 = (d2 << 2) & 0x3f;
+
+                out.write(encodingTable[b1]);
+                out.write(encodingTable[b2]);
+                out.write(encodingTable[b3]);
+                out.write(padding);
+                break;
+        }
+
+        return (dataLength / 3) * 4 + ((modulus == 0) ? 0 : 4);
+    }
+
+    private boolean ignore(char c) {
+        return (c == '\n' || c == '\r' || c == '\t' || c == ' ');
+    }
+
+    /**
+     * decode the base 64 encoded byte data writing it to the given output
+     * stream, whitespace characters will be ignored.
+     *
+     * @return the number of bytes produced.
+     */
+    public int decode(byte[] data, int off, int length, OutputStream out) throws IOException {
+        byte b1, b2, b3, b4;
+        int outLen = 0;
+
+        int end = off + length;
+
+        while (end > off) {
+            if (!ignore((char) data[end - 1])) {
+                break;
+            }
+
+            end--;
+        }
+
+        int i = off;
+        int finish = end - 4;
+
+        i = nextI(data, i, finish);
+
+        while (i < finish) {
+            b1 = decodingTable[data[i++]];
+
+            i = nextI(data, i, finish);
+
+            b2 = decodingTable[data[i++]];
+
+            i = nextI(data, i, finish);
+
+            b3 = decodingTable[data[i++]];
+
+            i = nextI(data, i, finish);
+
+            b4 = decodingTable[data[i++]];
+
+            if ((b1 | b2 | b3 | b4) < 0) {
+                throw new IOException("invalid characters encountered in base64 data");
+            }
+
+            out.write((b1 << 2) | (b2 >> 4));
+            out.write((b2 << 4) | (b3 >> 2));
+            out.write((b3 << 6) | b4);
+
+            outLen += 3;
+
+            i = nextI(data, i, finish);
+        }
+
+        outLen += decodeLastBlock(out, (char) data[end - 4], (char) data[end - 3], (char) data[end - 2], (char) data[end - 1]);
+
+        return outLen;
+    }
+
+    private int nextI(byte[] data, int i, int finish) {
+        while ((i < finish) && ignore((char) data[i])) {
+            i++;
+        }
+        return i;
+    }
+
+    /**
+     * decode the base 64 encoded String data writing it to the given output
+     * stream, whitespace characters will be ignored.
+     *
+     * @return the number of bytes produced.
+     */
+    public int decode(String data, OutputStream out) throws IOException {
+        byte b1, b2, b3, b4;
+        int length = 0;
+
+        int end = data.length();
+
+        while (end > 0) {
+            if (!ignore(data.charAt(end - 1))) {
+                break;
+            }
+
+            end--;
+        }
+
+        int i = 0;
+        int finish = end - 4;
+
+        i = nextI(data, i, finish);
+
+        while (i < finish) {
+            b1 = decodingTable[data.charAt(i++)];
+
+            i = nextI(data, i, finish);
+
+            b2 = decodingTable[data.charAt(i++)];
+
+            i = nextI(data, i, finish);
+
+            b3 = decodingTable[data.charAt(i++)];
+
+            i = nextI(data, i, finish);
+
+            b4 = decodingTable[data.charAt(i++)];
+
+            if ((b1 | b2 | b3 | b4) < 0) {
+                throw new IOException("invalid characters encountered in base64 data");
+            }
+
+            out.write((b1 << 2) | (b2 >> 4));
+            out.write((b2 << 4) | (b3 >> 2));
+            out.write((b3 << 6) | b4);
+
+            length += 3;
+
+            i = nextI(data, i, finish);
+        }
+
+        length += decodeLastBlock(out, data.charAt(end - 4), data.charAt(end - 3), data.charAt(end - 2), data.charAt(end - 1));
+
+        return length;
+    }
+
+    private int decodeLastBlock(OutputStream out, char c1, char c2, char c3, char c4) throws IOException {
+        byte b1, b2, b3, b4;
+
+        if (c3 == padding) {
+            b1 = decodingTable[c1];
+            b2 = decodingTable[c2];
+
+            if ((b1 | b2) < 0) {
+                throw new IOException("invalid characters encountered at end of base64 data");
+            }
+
+            out.write((b1 << 2) | (b2 >> 4));
+
+            return 1;
+        } else if (c4 == padding) {
+            b1 = decodingTable[c1];
+            b2 = decodingTable[c2];
+            b3 = decodingTable[c3];
+
+            if ((b1 | b2 | b3) < 0) {
+                throw new IOException("invalid characters encountered at end of base64 data");
+            }
+
+            out.write((b1 << 2) | (b2 >> 4));
+            out.write((b2 << 4) | (b3 >> 2));
+
+            return 2;
+        } else {
+            b1 = decodingTable[c1];
+            b2 = decodingTable[c2];
+            b3 = decodingTable[c3];
+            b4 = decodingTable[c4];
+
+            if ((b1 | b2 | b3 | b4) < 0) {
+                throw new IOException("invalid characters encountered at end of base64 data");
+            }
+
+            out.write((b1 << 2) | (b2 >> 4));
+            out.write((b2 << 4) | (b3 >> 2));
+            out.write((b3 << 6) | b4);
+
+            return 3;
+        }
+    }
+
+    private int nextI(String data, int i, int finish) {
+        while ((i < finish) && ignore(data.charAt(i))) {
+            i++;
+        }
+        return i;
+    }
+}

+ 19 - 0
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/exception/AuthException.java

@@ -0,0 +1,19 @@
+package com.usoftchina.saas.auth.common.exception;
+
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.exception.ExceptionCode;
+
+/**
+ * @author yingp
+ * @date 2018/11/15
+ */
+public class AuthException extends BizException{
+
+    public AuthException() {
+        super(ExceptionCode.AUTH_FAIL);
+    }
+
+    public AuthException(Exception e) {
+        super(ExceptionCode.AUTH_FAIL.getCode(), e.getMessage());
+    }
+}

+ 2 - 2
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/jwt/JwtHelper.java

@@ -30,7 +30,7 @@ public class JwtHelper {
      * @return
      * @throws Exception
      */
-    public static TokenVO generateToken(JwtInfo jwtInfo, String priKeyPath, int expire) throws BizException {
+    public static JwtToken generateToken(JwtInfo jwtInfo, String priKeyPath, int expire) throws BizException {
         try {
             String compactJws =
                     // 返回的字符串便是我们的jwt串了
@@ -47,7 +47,7 @@ public class JwtHelper {
                             .signWith(SignatureAlgorithm.RS256, RsaUtils.getPrivateKey(priKeyPath))
                             // 这个是全部设置完成后拼成jwt串的方法
                             .compact();
-            return new TokenVO(compactJws, expire);
+            return new JwtToken(compactJws, expire);
         } catch (IOException | NoSuchAlgorithmException | InvalidKeySpecException e) {
             log.error(e.getMessage());
             throw new BizException(ExceptionCode.JWT_GEN_TOKEN_FAIL.getCode(), ExceptionCode.JWT_GEN_TOKEN_FAIL.getMessage());

+ 3 - 3
base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/jwt/TokenVO.java → base-servers/auth/auth-common/src/main/java/com/usoftchina/saas/auth/common/jwt/JwtToken.java

@@ -6,7 +6,7 @@ import java.io.Serializable;
  * @author yingp
  * @date 2018/10/2
  */
-public class TokenVO implements Serializable {
+public class JwtToken implements Serializable {
     /**
      * token
      */
@@ -18,7 +18,7 @@ public class TokenVO implements Serializable {
 
     private Long timestamp;
 
-    public TokenVO(String token, Integer expire) {
+    public JwtToken(String token, Integer expire) {
         this.token = token;
         this.expire = expire;
         this.timestamp = System.currentTimeMillis();
@@ -50,7 +50,7 @@ public class TokenVO implements Serializable {
 
     @Override
     public String toString() {
-        return "TokenVO{" +
+        return "JwtToken{" +
                 "token='" + token + '\'' +
                 ", expire=" + expire +
                 ", timestamp=" + timestamp +

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

@@ -5,7 +5,7 @@ import com.usoftchina.saas.account.api.AccountApi;
 import com.usoftchina.saas.account.dto.AccountDTO;
 import com.usoftchina.saas.auth.common.jwt.JwtHelper;
 import com.usoftchina.saas.auth.common.jwt.JwtInfo;
-import com.usoftchina.saas.auth.common.jwt.TokenVO;
+import com.usoftchina.saas.auth.common.jwt.JwtToken;
 import com.usoftchina.saas.auth.dto.AuthDTO;
 import com.usoftchina.saas.auth.dto.AuthorizeLogDTO;
 import com.usoftchina.saas.auth.dto.TokenDTO;
@@ -83,8 +83,8 @@ public class AuthController {
             String appId = "trade-app";
 
             JwtInfo info = new JwtInfo(appId, companyId, accountDTO.getId(), accountDTO.getUsername(), accountDTO.getRealname());
-            TokenVO tokenVO = JwtHelper.generateToken(info, privateKeyPath, expire);
-            TokenDTO tokenDTO = BeanMapper.map(tokenVO, TokenDTO.class);
+            JwtToken jwtToken = JwtHelper.generateToken(info, privateKeyPath, expire);
+            TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
             // 登录日志
             authorizeLogService.save(AuthorizeLog.from(request)
                     .setAccountId(accountDTO.getId())
@@ -113,8 +113,8 @@ public class AuthController {
         if (isCompanyAvailable(infoFromToken, companyId)) {
             JwtInfo info = new JwtInfo(infoFromToken.getAppId(), companyId, infoFromToken.getUserId(),
                     infoFromToken.getUserName(), infoFromToken.getRealName());
-            TokenVO tokenVO = JwtHelper.generateToken(info, privateKeyPath, expire);
-            return Result.success(BeanMapper.map(tokenVO, TokenDTO.class));
+            JwtToken jwtToken = JwtHelper.generateToken(info, privateKeyPath, expire);
+            return Result.success(BeanMapper.map(jwtToken, TokenDTO.class));
         }
         return Result.error(ExceptionCode.COMPANY_NOT_BIND);
     }
@@ -131,8 +131,8 @@ public class AuthController {
         JwtInfo infoFromToken = JwtHelper.getInfoFromToken(token, publicKeyPath);
         Result<AccountDTO> result = accountApi.getAccount(infoFromToken.getUserName());
         if (result.isSuccess()) {
-            TokenVO tokenVO = JwtHelper.generateToken(infoFromToken, privateKeyPath, expire);
-            TokenDTO tokenDTO = BeanMapper.map(tokenVO, TokenDTO.class);
+            JwtToken jwtToken = JwtHelper.generateToken(infoFromToken, privateKeyPath, expire);
+            TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
             return Result.success(new AuthDTO(tokenDTO, result.getData()));
         }
         return Result.error(result);

+ 2 - 0
framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java

@@ -21,10 +21,12 @@ public enum ExceptionCode implements BaseExceptionCode {
     JWT_PARSER_TOKEN_FAIL(40005, "解析身份信息失败"),
     JWT_APPID_SECRET_INVALID(40006, "获取 access_token 时 AppSecret 错误,或者 AppId 无效!"),
     JWT_APPID_ENABLED(40007, "AppId 已经被禁用!请联系管理员"),
+    COOKIE_ILLEGAL_ARGUMENT(40010, "不合法的cookie"),
 
     // authorize相关
     AUTH_MAX_ERRORS(43001, "超过登录次数限制,账户已被冻结,请30分钟后再尝试"),
     AUTH_FROZEN(43002, "账户已被冻结,请30分钟后再尝试"),
+    AUTH_FAIL(43003, "身份验证失败"),
 
     // 账户管理相关
     COMPANY_NAME_EXIST(52000, "公司名称已注册"),

+ 1 - 1
frontend/saas-web/app/model/money/Othspendings.js

@@ -2,7 +2,7 @@ Ext.define('saas.model.money.Othspendings', {
     extend: 'saas.model.Base',
     fields: [
         { name: 'osd_id', type: 'number' },
-        { name: 'osd_orid', type: 'number' },
+        { name: 'osd_osid', type: 'number' },
         { name: 'osd_detno', type: 'number' },
         { name: 'osd_ym', type: 'number' },
         { name: 'osd_type', type: 'string' },

+ 1 - 0
frontend/saas-web/app/model/purchase/purchasedetail.js

@@ -22,6 +22,7 @@ Ext.define('saas.model.purchase.Purchasedetail', {
         { name: 'pd_salecode', type: 'string' },
         { name: 'pd_saledetno', type: 'int' },
         { name: 'pd_sdid', type: 'int' },
+        { name: 'pd_remark', type: 'string' },
         { name: 'companyid', type: 'int' },
         { name: 'updaterId', type: 'int' },
         { name: 'updatedate', type: 'date' },

+ 11 - 3
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -92,13 +92,20 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                         viewModel = queryPanel.getViewModel(),
                         moreQuery = viewModel.get('moreQuery'),
                         condition = queryPanel.getConditions(moreQuery),
-                        defaultCondition = me.defaultCondition,
+                        defaultCondition1 = queryPanel.defaultCondition,
+                        defaultCondition2 = me.defaultCondition,
                         mode = queryPanel.getQueryMode();
 
-                        if(defaultCondition) {
+                        if(defaultCondition1) {
                             condition.push({
                                 type: 'condition',
-                                value: defaultCondition
+                                value: defaultCondition1
+                            });
+                        }
+                        if(defaultCondition2) {
+                            condition.push({
+                                type: 'condition',
+                                value: defaultCondition2
                             });
                         }
                         Ext.apply(store.proxy.extraParams, {
@@ -124,6 +131,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
+                hidden: !me.showtool,
                 defaults: { // defaults 将会应用所有的子组件上,而不是父容器
                     listeners: {
                         'mouseover':function(){

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

@@ -16,8 +16,9 @@ Ext.define('saas.view.core.query.QueryPanel', {
         reference: 'queryform',
         xtype: 'core-query-queryformpanel',
         width: '100%',
+        margin: '0 0 12 0',
     }, {
-        margin: '12 0 0 0',
+        // margin: '12 0 0 0',
         padding: '8 12 8 12',// padding: 8px 12px 8px 12px;
         reference: 'querygrid',
         xtype: 'core-query-querygridpanel',
@@ -27,11 +28,22 @@ Ext.define('saas.view.core.query.QueryPanel', {
 
     initComponent: function () {
         var me = this;
-        me.setQueryFormItems();
+        me.initQueryPanel();
+        // me.setQueryFormItems();
         me.setQuertGridConfigs();
         me.callParent(arguments);
     },
 
+    initQueryPanel: function() {
+        var me = this;
+        if(me.simpleMode) {
+            me.items[0].hidden = true;
+        }else {
+            me.items[0].hidden = false;
+            me.setQueryFormItems();
+        }
+    },
+
     getQueryForm: function () {
         var me = this,
         queryForm = me.items[0];
@@ -116,6 +128,7 @@ Ext.define('saas.view.core.query.QueryPanel', {
         }
 
         me.queryGridConfig['columns']=columns;
+        me.queryGridConfig['showtool'] = !me.simpleMode;
         Ext.apply(queryGrid,me.queryGridConfig);
     },
 
@@ -133,6 +146,10 @@ Ext.define('saas.view.core.query.QueryPanel', {
         condition,
         conditions = [];
 
+        if(me.simpleMode) {
+            return conditions;
+        }
+
         if(moreQuery) {
             for(k in moreItems) {
                 var item = Ext.Array.findBy(moreQueryFormItems, function(i) {
@@ -274,6 +291,10 @@ Ext.define('saas.view.core.query.QueryPanel', {
         formData = viewModelData['form'],
         detailModel = false;
 
+        if(me.simpleMode) {
+            return 'DETAIL';
+        }
+
         for(var i = 0; i < formItems.length; i++) {
             var item = formItems[i],
             showDetail = item.showDetail,

+ 27 - 7
frontend/saas-web/app/view/home/InfoCard.js

@@ -34,27 +34,39 @@ Ext.define('saas.view.home.InfoCard', {
     cards: {
         unship: {
             title: '七天内待出货销售',
-            color: 'yellow'
+            color: 'yellow',
+            viewType: 'sale-sale-querypanel',
+            condition: '1=1'
         },
         unstorage: {
             title: '七天内待入库采购',
-            color: 'purple'
+            color: 'purple',
+            viewType: 'purchase-purchase-querypanel',
+            condition: '1=1'
         },
         unpay: {
             title: '七天内待付款',
-            color: 'red'
+            color: 'red',
+            viewType: 'money-paybalance-querypanel',
+            condition: '1=1'
         },
         unreceive: {
             title: '七天内待收款',
-            color: 'pink'
+            color: 'pink',
+            viewType: 'money-recbalance-querypanel',
+            condition: '1=1'
         },
         unauditcheck: {
             title: '未审核验收',
-            color: 'blue'
+            color: 'blue',
+            viewType: 'purchase-purchasein-querypanel',
+            condition: '1=1'
         },
         unauditship: {
             title: '未审核出货',
-            color: ''
+            color: 'default',
+            viewType: 'sale-saleout-querypanel',
+            condition: '1=1'
         }
     },
 
@@ -131,7 +143,15 @@ Ext.define('saas.view.home.InfoCard', {
             var view = Ext.create('Ext.view.View', {
                 store: store,
                 tpl: new Ext.XTemplate(me.cardTpl),
-                itemSelector: 'div.x-info-card-body',
+                itemSelector: 'div.x-box',
+                listeners: {
+                    itemclick: function(th, record, item, index, e, eOpts) {
+                        openTab(record.get('viewType'), record.get('title'), record.get('id'), {
+                            simpleMode: true,
+                            defaultCondition: record.get('condition')
+                        });
+                    }
+                }
             });
 
             var item = {

+ 5 - 0
frontend/saas-web/app/view/home/InfoCard.scss

@@ -24,7 +24,12 @@ $max-card-width: 235px;
                         box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
                         position: relative;
                         display: block;
+                        cursor: pointer;
             
+                        &:hover {
+                            opacity: 0.7;
+                        }
+
                         h3 {
                             font-size: 16px;
                         }

+ 58 - 14
frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js

@@ -8,10 +8,54 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
     viewName: 'money-fundtransfer-querypanel',
     
     queryFormItems: [{
-        xtype : "condatefield", 
-        name : "ft_date", 
+        xtype : "textfield",
+        name : "ft_code",
+        fieldLabel : "单号",
+        columnWidth: 0.3
+    },{
+        xtype : "condatefield",
+        name : "ft_date",
         fieldLabel : "单据日期",
-        columnWidth: 0.5
+        columnWidth: 0.6
+    },{
+        xtype: 'multicombo',
+        name: 'ft_status',
+        fieldLabel: '审核状态',
+        columnWidth: 0.3,
+        datas: [
+            ["已审核", "已审核"],
+            ["未审核", "未审核"]
+        ]
+    },{
+        name : "ft_status",
+        fieldLabel : "结算方式",
+        columnWidth: 0.3,
+        xtype:'combo',
+        queryMode: 'local',
+        displayField: 'display',
+        valueField: 'value',
+        store:Ext.create('Ext.data.Store', {
+            fields: ['value', 'display'],
+            data : [
+                {value:"信用卡", display:"信用卡"},
+                {value:"支票", display:"支票"},
+                {value:"汇票", display:"汇票"},
+                {value:"现金", display:"现金"},
+                {value:"银行转账", display:"银行转账"},
+                {value:"支付宝转账", display:"支付宝转账"},
+                {value:"微信转账", display:"微信转账"}
+            ]
+        })
+    },{
+        xtype : "dbfindtrigger",
+        name : "ftd_bankname",
+        fieldLabel : "转出账号",
+        columnWidth: 0.3
+    },{
+        xtype : "dbfindtrigger",
+        name : "ftd_inbankname",
+        fieldLabel : "转入账号",
+        columnWidth: 0.3
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
@@ -21,6 +65,7 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
         addXtype: 'money-fundtransfer-formpanel',
         defaultCondition:'',
         baseVastUrl: '/api/money/fundtransfer/',
+        // baseVastUrl: 'http://192.168.253.35:8880/fundtransfer/',
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
@@ -30,6 +75,11 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
             dataIndex: 'ft_code',
             width: 200
         }, {
+            text: '单据日期',
+            dataIndex: 'ft_date',
+            xtype: 'datecolumn',
+            width: 200
+        },{
             text: '审核状态',
             dataIndex: 'ft_status',
             width: 120
@@ -37,16 +87,6 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
             text: '录入人',
             dataIndex: 'ft_recorder',
             width: 120
-        }, {
-            text: '单据日期',
-            dataIndex: 'ft_date',
-            xtype: 'datecolumn',
-            width: 200
-        }, {
-            text: '期间',
-            dataIndex: 'ftd_ym',
-            xtype : "numbercolumn", 
-            width: 120
         }, {
             text: '转出账户',
             dataIndex: 'ftd_bankname',
@@ -70,9 +110,13 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
             text: '结算方式',
             dataIndex: 'ftd_paymethod',
             width: 120
+        }, {
+            text: '结算编号',
+            dataIndex: 'ftd_paycode',
+            width: 120
         }, {
             text: '备注',
-            dataIndex: 'ft_remark',
+            dataIndex: 'ftd_remark',
             width: 250
         }],
         relativeColumn: []

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

@@ -4,7 +4,146 @@ Ext.define('saas.view.money.fundtransfer.QueryPanelController', {
     init: function (form) {
         var me = this;
         this.control({
-           
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=ftd_bankname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/bankinformation/list',
+                        addXtype: 'other-bankinformation',
+                        addTitle:'资金账户',
+                        dbfinds:[
+                            {
+                                from:'bk_bankcode',to:'ftd_bankcode'
+                            },{
+                                from:'bk_bankname',to:'ftd_bankname'
+                            },{
+                                from:'id',to:'ftd_bankid'
+                            }],
+                        dbtpls:[{
+                            field:'bk_bankcode',width:100
+                        },{
+                            field:'bk_bankname',width:100
+                        }],
+                        dbSearchFields: [{
+                            emptyText: '查找资金账户',
+                            xtype: "textfield",
+                            name: "search",
+                            getCondition: function (v) {
+                                return "(upper(bk_bankcode) like '%"+v.toUpperCase()+"%' or upper(bk_bankname) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank: true,
+                            columnWidth: 0.25
+                        }],
+                        dbColumns: [{
+                            "text": "账户ID",
+                            "flex": 0,
+                            "dataIndex": "id",
+                            "width": 0,
+                            "xtype": ""
+                        }, {
+                            "text": "资金账户",
+                            "flex": 1,
+                            "dataIndex": "bk_bankcode",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "账户名称",
+                            "flex": 1,
+                            "dataIndex": "bk_bankname",
+                            "width": 150,
+                            "xtype": ""
+                        }, {
+                            "text": "账户类别",
+                            "flex": 1,
+                            "dataIndex": "bk_type",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "账户余额",
+                            "flex": 1,
+                            "dataIndex": "bk_thisamount",
+                            "width": 120,
+                            xtype: 'numbercolumn',
+                        }, {
+                            "text": "建帐日期",
+                            "flex": 1,
+                            "dataIndex": "bk_date",
+                            "width": 120,
+                            "xtype": "datecolumn"
+                        }]
+                    }) ;
+                }
+            },
+            'dbfindtrigger[name=ftd_inbankname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/bankinformation/list',
+                        addXtype: 'other-bankinformation',
+                        addTitle:'资金账户',
+                        dbfinds:[
+                            {
+                                from:'bk_bankcode',to:'ftd_inbankcode'
+                            },{
+                                from:'bk_bankname',to:'ftd_inbankname'
+                            },{
+                                from:'id',to:'ftd_inbankid'
+                            }],
+                        dbtpls:[{
+                            field:'bk_bankcode',width:100
+                        },{
+                            field:'bk_bankname',width:100
+                        }],
+                        dbSearchFields: [{
+                            emptyText: '查找资金账户',
+                            xtype: "textfield",
+                            name: "search",
+                            getCondition: function (v) {
+                                return "(upper(bk_bankcode) like '%"+v.toUpperCase()+"%' or upper(bk_bankname) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank: true,
+                            columnWidth: 0.25
+                        }],
+                        dbColumns: [{
+                            "text": "账户ID",
+                            "flex": 0,
+                            "dataIndex": "id",
+                            "width": 0,
+                            "xtype": ""
+                        }, {
+                            "text": "资金账户",
+                            "flex": 1,
+                            "dataIndex": "bk_bankcode",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "账户名称",
+                            "flex": 1,
+                            "dataIndex": "bk_bankname",
+                            "width": 150,
+                            "xtype": ""
+                        }, {
+                            "text": "账户类别",
+                            "flex": 1,
+                            "dataIndex": "bk_type",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "账户余额",
+                            "flex": 1,
+                            "dataIndex": "bk_thisamount",
+                            "width": 120,
+                            xtype: 'numbercolumn',
+                        }, {
+                            "text": "建帐日期",
+                            "flex": 1,
+                            "dataIndex": "bk_date",
+                            "width": 120,
+                            "xtype": "datecolumn"
+                        }]
+                    }) ;
+
+                }
+            }
         });
 
     }

+ 61 - 13
frontend/saas-web/app/view/money/othreceipts/QueryPanel.js

@@ -18,13 +18,19 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
         name : 'or_custid', 
         fieldLabel : '客户ID'
    }, {
+        xtype: 'textfield',
+        name: 'or_code',
+        fieldLabel: '单号',
+        columnWidth: 0.3
+    }, {
         xtype: 'hidden',
         name: 'or_custcode',
         fieldLabel: '客户编号'
     }, {
         xtype: 'dbfindtrigger',
         name: 'or_custname',
-        fieldLabel: '客户名称'
+        fieldLabel: '客户名称',
+        columnWidth: 0.3
     }, {
         xtype : 'hidden',
         name : 'or_bankid', 
@@ -36,7 +42,29 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
     }, {
         xtype: 'dbfindtrigger',
         name: 'or_bankname',
+        columnWidth: 0.3,
         fieldLabel: '账户名称'
+    }, {
+        xtype: 'condatefield',
+        name: 'or_date',
+        fieldLabel: '单据日期',
+        columnWidth: 0.6,
+        operation: 'between'
+    }, {
+        xtype: 'multicombo',
+        name: 'or_status',
+        fieldLabel: '审核状态',
+        columnWidth: 0.3,
+        datas: [
+            ["已审核", "已审核"],
+            ["未审核", "未审核"]
+        ]
+    }, {
+        name: 'ord_type',
+        fieldLabel: '收入类别',
+        columnWidth: 0.3,
+        xtype : "remotecombo",
+        storeUrl:'/api/document/fundinouttype/getCombo?condition=收入',
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
@@ -46,6 +74,7 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
         addXtype: 'money-othreceipts-formpanel',
         defaultCondition:'',
         baseVastUrl: '/api/money/othreceipts/',
+        // baseVastUrl: 'http://192.168.253.35:8880/othreceipts/',
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
@@ -55,24 +84,24 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
             text: '单据编号',
             dataIndex: 'or_code',
             width: 200
-        }, {
-            text: '审核状态',
-            dataIndex: 'or_status',
-            width: 120
-        }, {
-            text: '录入人',
-            dataIndex: 'or_recorder',
-            width: 120
-        }, {
+        },{
             text: '单据日期',
             dataIndex: 'or_date',
             xtype: 'datecolumn',
             width: 200
         }, {
+            text: '审核状态',
+            dataIndex: 'or_status',
+            width: 120
+        },  {
             text: '客户名称',
             dataIndex: 'or_custname',
             width: 120
-        }, {
+        },  {
+            text: '结算账号',
+            dataIndex: 'or_bankname',
+            width: 120
+        },{
             text: '金额',
             xtype: 'numbercolumn',
             dataIndex: 'or_amount',
@@ -82,10 +111,29 @@ Ext.define('saas.view.money.othreceipts.QueryPanel', {
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
                 var format = '0,000.' + xr.join();
                 return Ext.util.Format.number(v, format);
-            },
+            }
+        },{
+            text: '录入人',
+            dataIndex: 'or_recorder',
+            width: 120
+        }, {
+            text: '收入类别',
+            dataIndex: 'ord_type',
+            width: 120
+        }, {
+            text: '明细金额',
+            xtype: 'numbercolumn',
+            dataIndex: 'ord_nowbalance',
+            width: 120,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            }
         }, {
             text: '备注',
-            dataIndex: 'or_remark',
+            dataIndex: 'ord_remark',
             width: 250
         }],
         relativeColumn: []

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

@@ -14,7 +14,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
      _codeField: 'os_code',
      _statusField: 'os_status',
      _statusCodeField: 'os_statuscode',
-     _relationColumn: 'osd_orid',
+     _relationColumn: 'osd_osid',
      _readUrl:'/api/money/othspendings/read/',
      _saveUrl:'/api/money/othspendings/save/',
      _auditUrl:'/api/money/othspendings/audit/',

+ 67 - 11
frontend/saas-web/app/view/money/othspendings/QueryPanel.js

@@ -18,13 +18,20 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         name : 'os_vendid', 
         fieldLabel : '供应商ID'
    }, {
+        xtype : 'textfield',
+        name : 'os_code',
+        fieldLabel : '单号',
+        columnWidth: 0.3,
+    }, {
         xtype: 'hidden',
         name: 'os_vendcode',
-        fieldLabel: '供应商编号'
+        fieldLabel: '供应商编号',
+        columnWidth: 0.3,
     }, {
         xtype: 'dbfindtrigger',
         name: 'os_vendname',
-        fieldLabel: '供应商名称'
+        fieldLabel: '供应商名称',
+        columnWidth: 0.3
     }, {
         xtype : 'hidden',
         name : 'os_bankid', 
@@ -36,7 +43,28 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
     }, {
         xtype: 'dbfindtrigger',
         name: 'os_bankname',
-        fieldLabel: '结算账户名称'
+        fieldLabel: '结算账户',
+        columnWidth: 0.3
+    },{
+        xtype: 'condatefield',
+        name: 'os_date',
+        columnWidth: 0.6,
+        fieldLabel: '单据日期'
+    },{
+        xtype: 'multicombo',
+        name: 'os_status',
+        fieldLabel: '审核状态',
+        columnWidth: 0.3,
+        datas: [
+            ["已审核", "已审核"],
+            ["未审核", "未审核"]
+        ]
+    },{
+        name: 'ord_type',
+        fieldLabel: '支出类别',
+        columnWidth: 0.3,
+        xtype : "remotecombo",
+        storeUrl:'/api/document/fundinouttype/getCombo?condition=支出',
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
@@ -46,6 +74,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         addXtype: 'money-othspendings-formpanel',
         defaultCondition:'',
         baseVastUrl: '/api/money/othspendings/',
+        // baseVastUrl: 'http://192.168.253.35:8880/othspendings/',
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
@@ -56,27 +85,54 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
             dataIndex: 'os_code',
             width: 200
         }, {
+            text: '单据日期',
+            dataIndex: 'os_date',
+            xtype: 'datecolumn',
+            width: 200
+        },{
             text: '审核状态',
             dataIndex: 'os_status',
             width: 120
         }, {
+            text: '供应商',
+            dataIndex: 'os_vendname',
+            width: 120
+        },{
+            text: '结算账户',
+            dataIndex: 'os_bankname',
+            width: 120
+        },{
+            text: '付款金额',
+            dataIndex: 'os_amount',
+            width: 120
+        },{
             text: '录入人',
             dataIndex: 'os_recorder',
             width: 120
         }, {
-            text: '单据日期',
-            dataIndex: 'os_date',
-            xtype: 'datecolumn',
+            text: '支出类别',
+            dataIndex: 'osd_type',
             width: 200
         }, {
-            text: '供应商名称',
-            dataIndex: 'os_vendname',
-            width: 120
+            text: '金额',
+            dataIndex: 'osd_nowbalance',
+            xtype: 'numbercolumn',
+            width: 120,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            }
         }, {
+            text: '备注',
+            dataIndex: 'osd_remark',
+            width: 120
+        },{
             text: '金额',
             xtype: 'numbercolumn',
             dataIndex: 'os_amount',
-            width: 120,
+            width: 0,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -86,7 +142,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         }, {
             text: '备注',
             dataIndex: 'os_remark',
-            width: 250,
+            width: 0
         }],
         relativeColumn: []
     }

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

@@ -42,11 +42,6 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
             ["已审核", "已审核"],
             ["未审核", "未审核"]
         ]
-    },{
-        xtype: 'textfield',
-        name: 'pbd_slcode',
-        fieldLabel: '源单编号',
-        columnWidth: 0.3
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
@@ -54,7 +49,7 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
         codeField: 'pb_code',
         addTitle: '付款单',
         addXtype: 'money-paybalance-formpanel',
-        defaultCondition:'1=1',
+        defaultCondition:'',
         baseVastUrl: '/api/money/paybalance/',
         // baseVastUrl: 'http://192.168.253.35:8880/paybalance/',
         baseColumn: [{
@@ -126,24 +121,24 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
                 var format = '0,000.' + xr.join();
                 return Ext.util.Format.number(v, format);
-            },
+            }
         },{
             text: '源单编号',
             dataIndex: 'pbd_slcode',
-            width: 120,
+            width: 0
         },{
             text: '业务类别',
             dataIndex: 'pbd_slkind',
-            width: 120,
+            width: 0
         },{
             text: '单据日期',
             dataIndex: 'pbd_sldate',
-            width: 120,
+            width: 0,
             xtype:'datecolumn'
         },{
             text: '单据金额',
             dataIndex: 'pbd_amount',
-            width: 120,
+            width: 0,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -153,13 +148,13 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
         },{
             text: '本次核销金额',
             dataIndex: 'pbd_nowbalance',
-            width: 120,
+            width: 0,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
                 var format = '0,000.' + xr.join();
                 return Ext.util.Format.number(v, format);
-            },
+            }
         },{
             text: '本次核销金额',
             xtype: 'numbercolumn',
@@ -182,7 +177,7 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
                 var format = '0,000.' + xr.join();
                 return Ext.util.Format.number(v, format);
-            },
+            }
         }, {
             text: '整单折扣',
             dataIndex: 'pb_discounts',
@@ -202,5 +197,10 @@ Ext.define('saas.view.money.paybalance.QueryPanel', {
             },
         }],
         relativeColumn: []
+    },
+
+    // override
+    getQueryMode: function() {
+        return 'MAIN';
     }
 });

+ 10 - 11
frontend/saas-web/app/view/money/recBalance/QueryPanel.js

@@ -50,11 +50,6 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
             ["已审核", "已审核"],
             ["未审核", "未审核"]
         ]
-    },{
-        xtype: 'textfield',
-        name: 'rbd_slcode',
-        fieldLabel: '源单编号',
-        columnWidth: 0.3,
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
@@ -116,7 +111,6 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
             dataIndex: 'rb_rdamount',
             xtype: 'numbercolumn',
             width: 120,
-            hidden: true,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -126,27 +120,32 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
         },{
             text: '源单编号',
             dataIndex: 'rbd_slcode',
-            width: 120,
+            width: 0
         },{
             text: '业务类别',
             dataIndex: 'rbd_slkind',
-            width: 120,
+            width: 0
         },{
             text: '单据日期',
             dataIndex: 'rbd_sldate',
             xtype: 'datecolumn',
-            width: 120,
+            width: 0
         },{
             text: '单据金额',
             dataIndex: 'rbd_amount',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 0
         },{
             text: '本次核销金额',
             dataIndex: 'rbd_nowbalance',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 0
         },
         ]
+    },
+
+    // override
+    getQueryMode: function() {
+        return 'MAIN';
     }
 });