Browse Source

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

jinsy 7 years ago
parent
commit
34b09237aa
35 changed files with 944 additions and 144 deletions
  1. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BomMapper.java
  2. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  3. 27 5
      applications/document/document-server/src/main/resources/mapper/BomMapper.xml
  4. 1 1
      applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationdetDTO.java
  5. 1 1
      applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationdetailDTO.java
  6. 4 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/VerificationController.java
  7. 9 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Subledger.java
  8. 3 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verificationdet.java
  9. 3 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verificationdetail.java
  10. 3 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/VerificationService.java
  11. 97 113
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  12. 2 3
      applications/money/money-server/src/main/resources/mapper/VerificationListMapper.xml
  13. 1 1
      applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml
  14. 4 1
      applications/money/money-server/src/main/resources/mapper/VerificationdetMapper.xml
  15. 5 2
      applications/money/money-server/src/main/resources/mapper/VerificationdetailMapper.xml
  16. 1 1
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/ProdIODetailDTO.java
  17. 23 0
      base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/api/AccountCacheTest.java
  18. 18 0
      base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/service/AccountServiceTest.java
  19. 1 0
      base-servers/auth/pom.xml
  20. 32 0
      base-servers/auth/sso-api/pom.xml
  21. 51 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/api/SsoUserApi.java
  22. 8 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/api/SsoUserSpaceApi.java
  23. 85 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoResult.java
  24. 251 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUser.java
  25. 191 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUserSpace.java
  26. 20 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUserSpaceList.java
  27. 18 0
      base-servers/auth/sso-api/src/test/java/com/usoftchina/sso/test/SsoTest.java
  28. 47 0
      base-servers/auth/sso-api/src/test/java/com/usoftchina/sso/test/SsoUserApiTest.java
  29. 3 0
      base-servers/auth/sso-api/src/test/resources/application.yml
  30. 4 0
      framework/core/pom.xml
  31. 7 0
      framework/core/src/main/java/com/usoftchina/saas/cache/RedisHashCache.java
  32. 9 1
      frontend/saas-web/app/view/money/verification/FormPanel.js
  33. 0 1
      frontend/saas-web/app/view/money/verification/FormPanelController.js
  34. 6 1
      frontend/saas-web/app/view/money/verification/QueryPanel.js
  35. 2 2
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

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

@@ -28,4 +28,6 @@ public interface BomMapper extends CommonBaseMapper<Bom> {
     List<Bom> getListData(@Param("condition") String condition, @Param("companyId") Long companyId);
 
     int getCountFromMake(Long id);
+
+    void updateCreator(@Param("userId") Long userId,@Param("userName") String userName,@Param("id") Long id);
 }

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

@@ -44,6 +44,8 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
     public DocBaseDTO saveData(BomList bomList) {
         Long id = bomList.getMain().getId();
         Long companyId = BaseContextHolder.getCompanyId();
+        Long userId = BaseContextHolder.getUserId();
+        String userName = BaseContextHolder.getUserName();
         Bom bom = bomList.getMain();
         List<BomDetail> bomDetailList = bomList.getItems();
         DocBaseDTO docBaseDTO = null;
@@ -56,6 +58,9 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 bom.setCompanyId(companyId);
                 //保存BOM
                 getMapper().insertSelective(bom);
+                id = bom.getId();
+                //录入人
+                getMapper().updateCreator(userId, userName, id);
                 if (bomDetailList.size() > 0) {
                     //赋值BD_BOMID
                     for (BomDetail bomDetail : bomDetailList) {

+ 27 - 5
applications/document/document-server/src/main/resources/mapper/BomMapper.xml

@@ -14,7 +14,14 @@
     <result column="bo_recorddate" property="bo_recorddate" jdbcType="TIMESTAMP" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+
+
+
     <result column="bo_text1" property="bo_text1" jdbcType="VARCHAR" />
     <result column="bo_text2" property="bo_text2" jdbcType="VARCHAR" />
     <result column="bo_text3" property="bo_text3" jdbcType="VARCHAR" />
@@ -27,8 +34,8 @@
   </resultMap>
   <sql id="Base_Column_List" >
     bo_id, bo_motherid, bo_mothercode, bo_mothername, bo_version, bo_status, bo_statuscode, 
-    bo_recorderid, bo_recorder, bo_recorddate, companyId, updaterId, updateTime, bo_text1, 
-    bo_text2, bo_text3, bo_text4, bo_text5
+    bo_recorderid, bo_recorder, bo_recorddate, companyId, updaterId,updaterName,updateTime, bo_text1,
+    bo_text2, bo_text3, bo_text4, bo_text5,creatorName,creatorId,createTime
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
@@ -116,6 +123,12 @@
       <if test="bo_text5 != null" >
         bo_text5,
       </if>
+      <if test="bo_text5 != null" >
+        bo_text5,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="bo_motherid != null" >
@@ -169,6 +182,9 @@
       <if test="bo_text5 != null" >
         #{bo_text5,jdbcType=VARCHAR},
       </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP}
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bom" >
@@ -273,7 +289,13 @@
     </where>
     ORDER BY BO_ID DESC
   </select>
-    <select id="getCountFromMake" parameterType="java.lang.Long" resultType="int">
-        SELECT COUNT(*) FROM MAKE WHERE MA_PRODID = #{id}
-    </select>
+  <select id="getCountFromMake" parameterType="java.lang.Long" resultType="int">
+      SELECT COUNT(*) FROM MAKE WHERE MA_PRODID = #{id}
+  </select>
+
+  <update id="updateCreator">
+    update bom set creatorId = #{userId} , creatorName=#{userName} where bo_id=#{id}
+  </update>
+
+
 </mapper>

+ 1 - 1
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationdetDTO.java

@@ -23,7 +23,7 @@ public class VerificationdetDTO  extends  CommonBaseDTO implements Serializable
 
     private Integer vd_ym;
 
-    private Integer vd_slid;
+    private Long vd_slid;
 
     private String vd_slcode;
 

+ 1 - 1
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationdetailDTO.java

@@ -23,7 +23,7 @@ public class VerificationdetailDTO extends  CommonBaseDTO implements Serializabl
 
     private Integer vcd_ym;
 
-    private Integer vcd_slid;
+    private Long vcd_slid;
 
     private String vcd_slcode;
 

+ 4 - 3
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/VerificationController.java

@@ -3,6 +3,7 @@ package com.usoftchina.saas.money.controller;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.dto.VerificationFormDTO;
@@ -59,7 +60,7 @@ public class VerificationController {
      */
     @RequestMapping("/save")
     public Result<DocSavedDTO> saveFormData(@RequestBody VerificationFormDTO form) {
-        DocSavedDTO base = verificationService.saveFormData(form);
+        DocBaseDTO base = verificationService.saveFormData(form);
         return Result.success(base);
     }
 
@@ -98,11 +99,11 @@ public class VerificationController {
 
     @RequestMapping("/audit")
     public Result audit(@RequestBody VerificationFormDTO formDTO) {
-        DocSavedDTO audit = verificationService.audit(formDTO);
+        DocBaseDTO audit = verificationService.audit(formDTO);
         return Result.success(audit);
     }
 
-    @RequestMapping("/resAudit/{id}")
+    @RequestMapping("/unAudit/{id}")
     public Result resAudit(@PathVariable("id") Long id) {
         verificationService.resAudit(id);
         return Result.success();

+ 9 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Subledger.java

@@ -7,6 +7,7 @@ import java.util.Date;
 
 //中间表
 public class Subledger extends CommonBaseEntity implements Serializable {
+    private Long sl_id;
 
     private String sl_code;
 
@@ -138,4 +139,12 @@ public class Subledger extends CommonBaseEntity implements Serializable {
     public void setSl_ym(Integer sl_ym) {
         this.sl_ym = sl_ym;
     }
+
+    public Long getSl_id() {
+        return sl_id;
+    }
+
+    public void setSl_id(Long sl_id) {
+        this.sl_id = sl_id;
+    }
 }

+ 3 - 3
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verificationdet.java

@@ -20,7 +20,7 @@ public class Verificationdet extends CommonBaseEntity implements Serializable {
 
     private Integer vd_ym;
 
-    private Integer vd_slid;
+    private Long vd_slid;
 
     private String vd_slcode;
 
@@ -80,11 +80,11 @@ public class Verificationdet extends CommonBaseEntity implements Serializable {
         this.vd_ym = vd_ym;
     }
 
-    public Integer getVd_slid() {
+    public Long getVd_slid() {
         return vd_slid;
     }
 
-    public void setVd_slid(Integer vd_slid) {
+    public void setVd_slid(Long vd_slid) {
         this.vd_slid = vd_slid;
     }
 

+ 3 - 3
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verificationdetail.java

@@ -20,7 +20,7 @@ public class Verificationdetail extends CommonBaseEntity implements Serializable
 
     private Integer vcd_ym;
 
-    private Integer vcd_slid;
+    private Long vcd_slid;
 
     private String vcd_slcode;
 
@@ -80,11 +80,11 @@ public class Verificationdetail extends CommonBaseEntity implements Serializable
         this.vcd_ym = vcd_ym;
     }
 
-    public Integer getVcd_slid() {
+    public Long getVcd_slid() {
         return vcd_slid;
     }
 
-    public void setVcd_slid(Integer vcd_slid) {
+    public void setVcd_slid(Long vcd_slid) {
         this.vcd_slid = vcd_slid;
     }
 

+ 3 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/VerificationService.java

@@ -2,6 +2,7 @@ package com.usoftchina.saas.money.service;
 
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.money.dto.VerificationFormDTO;
@@ -37,7 +38,7 @@ public interface VerificationService {
      * @param formdata
      * @return
      */
-    DocSavedDTO saveFormData(VerificationFormDTO formdata);
+    DocBaseDTO saveFormData(VerificationFormDTO formdata);
 
     /**
      * 删除核销单
@@ -62,7 +63,7 @@ public interface VerificationService {
      * @param formData
      * @return
      */
-    DocSavedDTO audit(VerificationFormDTO formData);
+    DocBaseDTO audit(VerificationFormDTO formData);
 
     /**
      * 反审核核销单

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

@@ -108,10 +108,11 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     }
 
     @Override
-    public DocSavedDTO saveFormData(VerificationFormDTO formdata) {
+    public DocBaseDTO saveFormData(VerificationFormDTO formdata) {
         if (null == formdata || null == formdata.getMain()){
             throw new BizException(BizExceptionCode.EMPTY_DATA);
         }
+
         //公司ID
         Long companyId = BaseContextHolder.getCompanyId();
         //人员Id
@@ -122,100 +123,71 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         List<VerificationdetDTO> items1 = formdata.getItems1();
         //获取从表2
         List<VerificationdetailDTO> items2 = formdata.getItems2();
-        //插入从表数据
-        List<Verificationdet> insertDetails1 = new ArrayList<>();
-        List<Verificationdetail> insertDetails2 = new ArrayList<>();
-        //更新从表数据
-        List<Verificationdet> updateDetails1 = new ArrayList<>();
-        List<Verificationdetail> updateDetails2 = new ArrayList<>();
-        DocSavedDTO saveDTO = new DocSavedDTO();
+
+        DocBaseDTO baseDTO = null;
         Long id = main.getId();
         String code = main.getVc_code();
-        Verification verification = BeanMapper.map(main,Verification.class);
-        verification.setCompanyId(companyId);
-        verification.setCreatorId(userId);
-        verification.setCreateTime(new Date());
-        String kind = verification.getVc_kind();
-        verification.setVc_kind(transferKind(kind));
+        //编号校验
+        code = pushMaxnubmer(code, id);
+        main.setVc_code(code);
 
-        //编号获取
-        code = pushMaxnubmer(code,id);
-        verification.setVc_code(code);
-        saveDTO.setCode(code);
+        Verification verification = BeanMapper.map(main,Verification.class);
+        if(id.longValue() > 0 ){
+            String kind = verification.getVc_kind();
+            verification.setVc_kind(transferKind(kind));
+            verificationMapper.updateByPrimaryKey(verification);
+            baseDTO = new DocBaseDTO(id, code, BillCodeSeq.VERIFICATION.getCaller());
+            if (!("AUDITED".equals(verification.getVc_statuscode()))) {
+                //日志记录
+                messageLogService.update(baseDTO);
+            }
+        }else{
+            verification.setCompanyId(companyId);
+            verification.setVc_recorder(BaseContextHolder.getUserName());
+            verification.setCreateTime(new Date());
+            verification.setCreatorId(userId);
+            verification.setCreatorName(BaseContextHolder.getUserName());
+            String kind = verification.getVc_kind();
+            verification.setVc_kind(transferKind(kind));
+            verificationMapper.insertSelective(verification);
+            id = verification.getId();
+            baseDTO = new DocBaseDTO(id, code, BillCodeSeq.VERIFICATION.getCaller());
+            if (!("AUDITED".equals(verification.getVc_statuscode()))) {
+                //日志记录
+                messageLogService.save(baseDTO);
+            }
+        }
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYYMM");
         String dateYM = simpleDateFormat.format(verification.getVc_date());
         Integer numberYM = Integer.valueOf(dateYM);
         //判断更新与保存动作
-        if (StringUtils.isEmpty(id) || "0".equals(id.toString())){
-            //插入操作
-            getMapper().insertSelective(verification);
-            id = verification.getId();
-
-            //添加从表传输对象
-            for (VerificationdetDTO item : items1) {
-                Verificationdet detail = BeanMapper.map(item,Verificationdet.class);
-                detail.setVd_vcid(id);
-                detail.setCompanyId(companyId);
-                detail.setVd_ym(numberYM);
-                insertDetails1.add(detail);
-            }
-            for (VerificationdetailDTO item : items2) {
-                Verificationdetail detail = BeanMapper.map(item,Verificationdetail.class);
-                detail.setVcd_vcid(id);
-                detail.setVcd_ym(numberYM);
-                detail.setCompanyId(companyId);
-                insertDetails2.add(detail);
-            }
-            //插入从表
-            if (insertDetails1.size()>0) {
-                verificationdetMapper.batchInsert(insertDetails1);
-            }
-            if (insertDetails2.size()>0) {
-                verificationdetailMapper.batchInsert(insertDetails2);
-            }
-        }
-        //更新操作
-        getMapper().updateByPrimaryKeySelective(verification);
         //添加从表传输对象
         for (VerificationdetDTO item : items1) {
-            Verificationdet detail = BeanMapper.map(item, Verificationdet.class);
+            Verificationdet detail = BeanMapper.map(item,Verificationdet.class);
+            Long vd_id = detail.getId();
             detail.setVd_vcid(id);
-            detail.setVd_ym(numberYM);
             detail.setCompanyId(companyId);
-            if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
-                insertDetails1.add(detail);
-            } else {
-                updateDetails1.add(detail);
+            detail.setVd_ym(numberYM);
+            if (vd_id>0){
+                verificationdetMapper.updateByPrimaryKey(detail);
+            }else{
+                verificationdetMapper.insertSelective(detail);
             }
         }
         for (VerificationdetailDTO item : items2) {
-            Verificationdetail detail = BeanMapper.map(item, Verificationdetail.class);
+            Verificationdetail detail = BeanMapper.map(item,Verificationdetail.class);
             detail.setVcd_vcid(id);
             detail.setVcd_ym(numberYM);
             detail.setCompanyId(companyId);
-            if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
-                insertDetails2.add(detail);
-            } else {
-                updateDetails2.add(detail);
+            Long vcd_id = detail.getId();
+            if(vcd_id>0){
+                verificationdetailMapper.updateByPrimaryKey(detail);
+            }else{
+                verificationdetailMapper.insertSelective(detail);
             }
         }
-        //插入从表
-        if (insertDetails1.size()>0) {
-            verificationdetMapper.batchInsert(insertDetails1);
-        }
-        if (insertDetails2.size()>0) {
-            verificationdetailMapper.batchInsert(insertDetails2);
-        }
-        //更新从表
-        if (updateDetails1.size()>0) {
-            verificationdetMapper.batchUpdate(updateDetails1);
-        }
-        if (updateDetails2.size()>0) {
-            verificationdetailMapper.batchUpdate(updateDetails2);
-        }
         updateCorrespondingData(formdata);
-        saveDTO.setId(id);
-        return saveDTO;
+        return baseDTO;
     }
 
     private void updateCorrespondingData(VerificationFormDTO formdata) {
@@ -292,6 +264,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         String kind = verification.getVc_kind();
         subledger.setCompanyId(BaseContextHolder.getCompanyId());
         subledger.setSl_code(verification.getVc_code());
+        kind = transferKind(kind);
         subledger.setSl_kind(kind);
         if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable") ||
                 kind.equals("receivable_offset_payable")){
@@ -301,17 +274,18 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             subledger.setSl_custid(verification.getVc_custid());
             subledger.setSl_vendid(0);
         }
-
+        Double amount1 = verification.getVc_amount1()==null?new Double(0):verification.getVc_amount1();
+        Double amount2 = verification.getVc_amount2()==null?new Double(0):verification.getVc_amount2();
         subledger.setSl_date(verification.getVc_date());
-        subledger.setSl_amount(-verification.getVc_amount2());
+        subledger.setSl_amount(-amount2);
         subledger.setSl_orderamount(new Double(0));
         subledger.setSl_yamount(new Double(0));
         subledger.setSl_remark(verification.getVc_remark());
         subledger.setSl_discount(new Double(0));
         if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable")){
-            subledger.setSl_preamount(-verification.getVc_amount1());
+            subledger.setSl_preamount(-amount1);
         }else{
-            subledger.setSl_preamount(new Double(0));
+            subledger.setSl_preamount(amount1);
         }
         return subledger;
     }
@@ -320,10 +294,10 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
      * @param id
      * @param nowBalance
      */
-    private void updateAuditSubledeger(int id , Double nowBalance){
-        Subledger subledger = subledgerMapper.selectByPrimaryKey(id);
+    private void updateAuditSubledeger(Long id , Double nowBalance){
+        Subledger subledger = subledgerMapper.selectByPrimaryKey(Math.toIntExact(id));
         Subledger newSubledeger = new Subledger();
-        newSubledeger.setId(Long.valueOf(String.valueOf(id)));
+        newSubledeger.setId(id);
         Double newNamout = subledger.getSl_namount()==null?new Double(0):subledger.getSl_namount()-nowBalance;
         Double newYamout = subledger.getSl_yamount()==null?new Double(0):subledger.getSl_yamount()+nowBalance;
         newSubledeger.setSl_yamount(newYamout);
@@ -332,15 +306,15 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         newSubledeger.setUpdaterName(BaseContextHolder.getUserName());
         newSubledeger.setUpdaterId(BaseContextHolder.getUserId());
         newSubledeger.setUpdateTime(new Date());
-        subledgerMapper.updateByPrimaryKey(newSubledeger);
+        subledgerMapper.updateByPrimaryKeySelective(newSubledeger);
     }
     /**
      * 反审核更新来源单据的已核销,未核销
      * @param id
      * @param nowBalance
      */
-    private void updateResAuditSubledeger(int id , Double nowBalance){
-        Subledger subledger = subledgerMapper.selectByPrimaryKey(id);
+    private void updateResAuditSubledeger(Long id , Double nowBalance){
+        Subledger subledger = subledgerMapper.selectByPrimaryKey(Math.toIntExact(id));
         Subledger newSubledeger = new Subledger();
         newSubledeger.setId(Long.valueOf(String.valueOf(id)));
         Double newNamout = subledger.getSl_namount()==null?new Double(0):subledger.getSl_namount()+nowBalance;
@@ -351,7 +325,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         newSubledeger.setUpdaterName(BaseContextHolder.getUserName());
         newSubledeger.setUpdaterId(BaseContextHolder.getUserId());
         newSubledeger.setUpdateTime(new Date());
-        subledgerMapper.updateByPrimaryKey(newSubledeger);
+        subledgerMapper.updateByPrimaryKeySelective(newSubledeger);
     }
     /**
      * 转换核销单类型
@@ -370,7 +344,17 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 return "应收转应收";
             case "payable_to_payable":
                 return "应付转应付";
-                default:return "";
+            case "预收冲应收":
+                return "receipts_offset_receivable";
+            case "预付冲应付":
+                return "prepaid_offset_payable";
+            case "应收冲应付":
+                return "receivable_offset_payable";
+            case "应收转应收":
+                return "receivable_to_receivable";
+            case "应付转应付":
+                return "payable_to_payable";
+                default: return "";
         }
     }
 
@@ -405,7 +389,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
 
     /**
      *
-     * @param id
+     * @param detno
      */
     private boolean checkSetAcount(Integer detno){
         boolean isSetAcount = false;
@@ -418,13 +402,13 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     @Override
     public void deleteDetail1(Long id) {
         if (null != id) {
-            verificationdetMapper.deleteByParentPrimaryKey(Long.valueOf(String.valueOf(id)));
             Verificationdet verificationdet = verificationdetMapper.selectByPrimaryKey(Integer.valueOf(String.valueOf(id)));
             Verification verification = verificationMapper.selectByPrimaryKey(verificationdet.getVd_vcid());
             DocBaseDTO baseDTO = new DocBaseDTO();
             baseDTO.setId(id);
             baseDTO.setCode(verification.getVc_code());
             baseDTO.setName(BillCodeSeq.VERIFICATION.getName());
+            verificationdetMapper.deleteByParentPrimaryKey(Long.valueOf(String.valueOf(id)));
             //日志
             messageLogService.deleteDetail(baseDTO);
         }
@@ -446,14 +430,14 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     }
 
     @Override
-    public DocSavedDTO audit(VerificationFormDTO formData) {
+    public DocBaseDTO audit(VerificationFormDTO formData) {
         Long id = null;
-        DocSavedDTO savedDTO = new DocSavedDTO();
+        DocBaseDTO baseDTO = new DocBaseDTO();
         if (null != formData) {
-            id = Long.valueOf(String.valueOf(formData.getMain().getVc_id()));
+            id = formData.getMain().getId();
             if (StringUtils.isEmpty(id)) {
-                DocSavedDTO saveDTO = saveFormData(formData);
-                id = saveDTO.getId();
+                baseDTO = saveFormData(formData);
+                id = baseDTO.getId();
             }
             Verification verification = new Verification();
             verification.setVc_status(Status.AUDITED.getDisplay());
@@ -484,8 +468,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 updateAuditSubledeger(detail.getVcd_slid(),nowbalanceDet);
             }
         }
-        savedDTO.setId(id);
-        return savedDTO;
+        baseDTO.setId(id);
+        return baseDTO;
     }
 
     /**
@@ -510,9 +494,9 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             customer.setUpdaterId(BaseContextHolder.getUserId());
             customer.setUpdaterName(BaseContextHolder.getUserName());
             customer.setUpdateTime(new Date());
-            customer.setCu_preamount(preamount+amount1);
+            customer.setCu_preamount(preamount-amount1);
             customer.setCu_recamount(recamount-amount2);
-            customer.setCu_leftamount(beginapamount-beginprepayamount+recamount-amount2-preamount-amount1);
+            customer.setCu_leftamount(beginapamount-beginprepayamount+recamount-amount2-(preamount-amount1));
             recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
         }else if(kind.equals("receivable_offset_payable")){
             Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(verificationDTO.getVc_custid());
@@ -557,8 +541,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             newCustomerIn.setUpdaterId(BaseContextHolder.getUserId());
             newCustomerIn.setUpdaterName(BaseContextHolder.getUserName());
             newCustomerIn.setUpdateTime(new Date());
-            newCustomerIn.setCu_recamount(recamountIn-amount1);
-            newCustomerIn.setCu_leftamount(beginapamountIn-beginprepayamountIn+recamountIn-amount1-preamountIn);
+            newCustomerIn.setCu_recamount(recamountIn+amount1);
+            newCustomerIn.setCu_leftamount(beginapamountIn-beginprepayamountIn+recamountIn+amount1-preamountIn);
             recbalanceMapper.updateCustomerByPrimaryKeySelective(newCustomerIn);
 
             Customer newCustomerOut = new Customer();
@@ -596,8 +580,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             vendor.setUpdaterName(BaseContextHolder.getUserName());
             vendor.setUpdateTime(new Date());
             vendor.setVe_preamount(preamount-amount1);
-            vendor.setVe_payamount(payamount+amount2);
-            vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+amount2-preamount+amount1);
+            vendor.setVe_payamount(payamount-amount2);
+            vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount-amount2-(preamount-amount1));
             paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
         }else if(kind.equals("receivable_offset_payable")){
             Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(verificationDTO.getVc_vendid());
@@ -610,11 +594,11 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             Double amount1 = verificationDTO.getVc_amount1()==null?new Double(0):verificationDTO.getVc_amount1();
             Double amount2 = verificationDTO.getVc_amount2()==null?new Double(0):verificationDTO.getVc_amount2();
             vendor.setId(Long.valueOf(String.valueOf(verificationDTO.getVc_vendid())));
-            vendor.setVe_payamount(payamount+amount2);
+            vendor.setVe_payamount(payamount-amount2);
             vendor.setUpdaterId(BaseContextHolder.getUserId());
             vendor.setUpdaterName(BaseContextHolder.getUserName());
             vendor.setUpdateTime(new Date());
-            vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+amount2-preamount);
+            vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount-amount2-preamount);
             paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
         }else if(kind.equals("payable_to_payable")){
             //转入供应商
@@ -669,7 +653,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         }
 
         //更新客户或者供应商的金额
-        Verification nowverification = verificationMapper.selectByPrimaryKey(id);
+        Verification nowverification = verificationMapper.selectByPrimaryKey(Math.toIntExact(id));
         VerificationDTO verificationDTO = BeanMapper.map(nowverification,VerificationDTO.class);
         updateResAuditCustomer(verificationDTO);
         updateResAuditVendor(verificationDTO);
@@ -681,11 +665,11 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         List<Verificationdetail> items2 = verificationdetailMapper.selectByFK(id);
         for(Verificationdet det : items1){
             Double nowbalanceDet = det.getVd_nowbalance()==null?new Double(0):det.getVd_nowbalance();
-            updateAuditSubledeger(det.getVd_slid(),nowbalanceDet);
+            updateResAuditSubledeger(det.getVd_slid(),nowbalanceDet);
         }
         for(Verificationdetail detail : items2){
             Double nowbalanceDet = detail.getVcd_nowbalance()==null?new Double(0):detail.getVcd_nowbalance();
-            updateAuditSubledeger(detail.getVcd_slid(),nowbalanceDet);
+            updateResAuditSubledeger(detail.getVcd_slid(),nowbalanceDet);
         }
 
         Verification verification = new Verification();
@@ -726,9 +710,9 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             customer.setUpdaterId(BaseContextHolder.getUserId());
             customer.setUpdaterName(BaseContextHolder.getUserName());
             customer.setUpdateTime(new Date());
-            customer.setCu_preamount(preamount-amount1);
+            customer.setCu_preamount(preamount+amount1);
             customer.setCu_recamount(recamount+amount2);
-            customer.setCu_leftamount(beginapamount-beginprepayamount+recamount+amount2-preamount+amount1);
+            customer.setCu_leftamount(beginapamount-beginprepayamount+recamount+amount2-preamount-amount1);
             recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
         }else if(kind.equals("receivable_offset_payable")){
             Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(verificationDTO.getVc_custid());
@@ -812,8 +796,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             vendor.setUpdaterName(BaseContextHolder.getUserName());
             vendor.setUpdateTime(new Date());
             vendor.setVe_preamount(preamount+amount1);
-            vendor.setVe_payamount(payamount-amount2);
-            vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount-amount2-preamount-amount1);
+            vendor.setVe_payamount(payamount+amount2);
+            vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+amount2-preamount-amount1);
             paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
         }else if(kind.equals("receivable_offset_payable")){
             Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(verificationDTO.getVc_vendid());
@@ -857,8 +841,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             newVendorIn.setUpdaterId(BaseContextHolder.getUserId());
             newVendorIn.setUpdaterName(BaseContextHolder.getUserName());
             newVendorIn.setUpdateTime(new Date());
-            newVendorIn.setVe_payamount(payamountIn+amount1);
-            newVendorIn.setVe_leftamount(beginapamountIn-beginprepayamountIn+payamountIn+amount1-preamountIn);
+            newVendorIn.setVe_payamount(payamountIn-amount1);
+            newVendorIn.setVe_leftamount(beginapamountIn-beginprepayamountIn+payamountIn-amount1-preamountIn);
             paybalanceMapper.updateVendorByPrimaryKeySelective(newVendorIn);
 
             Vendor newVendorOut = new Vendor();

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

@@ -51,8 +51,7 @@
     <select id="selectVerificationListByCondition"  resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List" />
-        from verification left join verificationdet on vc_id=vd_vcid
-        and verification.companyid=verificationdet.companyid
+        from verification
         <where>
             <if test="con != null">
                 ${con}
@@ -76,6 +75,6 @@
                 and  verification.companyId = #{companyId}
             </if>
         </where>
-        order by vc_id
+        order by vc_date desc,vc_id desc
     </select>
 </mapper>

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

@@ -595,7 +595,7 @@
         vc_text5 = #{vc_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where vc_id = #{id,jdbcType=INTEGER}
+    where vc_id = #{vc_id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Verification" >
     update verification

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

@@ -246,6 +246,9 @@
         #{vd_text5,jdbcType=VARCHAR},
       </if>
     </trim>
+    <selectKey resultType="Long" keyProperty="id" order="AFTER">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
   </insert>
   <select id="countByExample" parameterType="com.usoftchina.saas.money.po.VerificationdetExample" resultType="java.lang.Integer" >
     select count(*) from verificationdet
@@ -401,7 +404,7 @@
         vd_text5 = #{vd_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where vd_id = #{vd_id,jdbcType=INTEGER}
+    where vd_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Verificationdet" >
     update verificationdet

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

@@ -190,7 +190,7 @@
         vcd_text5,
       </if>
     </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >-0--0
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="vcd_vcid != null" >
         #{vcd_vcid,jdbcType=INTEGER},
       </if>
@@ -246,6 +246,9 @@
         #{vcd_text5,jdbcType=VARCHAR},
       </if>
     </trim>
+    <selectKey resultType="Long" keyProperty="id" order="AFTER">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
   </insert>
   <select id="countByExample" parameterType="com.usoftchina.saas.money.po.VerificationdetailExample" resultType="java.lang.Integer" >
     select count(*) from verificationdetail
@@ -401,7 +404,7 @@
         vcd_text5 = #{vcd_text5,jdbcType=VARCHAR},
       </if>
     </set>
-    where vcd_id = #{vcd_id,jdbcType=INTEGER}
+    where vcd_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Verificationdetail" >
     update verificationdetail

+ 1 - 1
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/ProdIODetailDTO.java

@@ -55,7 +55,7 @@ public class ProdIODetailDTO extends CommonBaseDTO implements Serializable {
 
     private String pd_whname;
 
-    private Integer pd_inwhid;
+    private Long pd_inwhid;
 
     private String pd_inwhcode;
 

+ 23 - 0
base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/api/AccountCacheTest.java

@@ -0,0 +1,23 @@
+package com.usoftchina.saas.account.api;
+
+import com.usoftchina.saas.account.cache.AccountCache;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class AccountCacheTest {
+
+    @Test
+    public void hdel() {
+        AccountCache.of(43).hdel();
+        System.out.println(AccountCache.of(43).exists());
+    }
+}

+ 18 - 0
base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/service/AccountServiceTest.java

@@ -1,13 +1,19 @@
 package com.usoftchina.saas.account.service;
 
+import com.usoftchina.saas.account.cache.AccountCache;
 import com.usoftchina.saas.account.constant.AccountType;
+import com.usoftchina.saas.account.dto.AccountDTO;
 import com.usoftchina.saas.account.po.Account;
+import com.usoftchina.saas.utils.CollectionUtils;
 import org.junit.*;
 import org.junit.runner.RunWith;
 import org.junit.runners.MethodSorters;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+import java.util.Set;
 //import org.springframework.transaction.annotation.Transactional;
 
 @RunWith(SpringRunner.class)
@@ -54,4 +60,16 @@ public class AccountServiceTest {
         Assert.assertTrue(removed);
     }
 
+    @Test
+    public void testD_clearAccountCacheByRoleId() {
+        long roleId = 25;
+        List<Account> accounts = accountService.findByRoleId(roleId);
+        if (!CollectionUtils.isEmpty(accounts)) {
+            accounts.forEach(account -> accountService.clearCache(account.getId()));
+        }
+        AccountCache.current().keys().forEach(System.out::println);
+
+        AccountCache.of(43).getAccount();
+    }
+
 }

+ 1 - 0
base-servers/auth/pom.xml

@@ -18,6 +18,7 @@
         <module>auth-server</module>
         <module>auth-client</module>
         <module>auth-common</module>
+        <module>sso-api</module>
     </modules>
 
 </project>

+ 32 - 0
base-servers/auth/sso-api/pom.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>auth</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sso-api</artifactId>
+    <description>account center api</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+        <!-- test -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

+ 51 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/api/SsoUserApi.java

@@ -0,0 +1,51 @@
+package com.usoftchina.sso.api;
+
+import com.usoftchina.sso.dto.SsoResult;
+import com.usoftchina.sso.dto.SsoUser;
+import com.usoftchina.sso.dto.SsoUserSpaceList;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@FeignClient(url = "${sso.base-url}", name = "sso-server", fallback = SsoUserApi.DefaultFallback.class)
+@RequestMapping("/api/user")
+public interface SsoUserApi {
+
+    /**
+     * 手机号查找用户
+     *
+     * @param userUU
+     * @return
+     */
+    @GetMapping("/info")
+    SsoResult<SsoUser> getUserByUu(@RequestParam("userUU") Long userUU);
+
+    /**
+     * 手机号查找绑定企业
+     *
+     * @param mobile
+     * @return
+     */
+    @GetMapping("/getSpace")
+    @Deprecated
+    SsoUserSpaceList getUserSpacesByMobile(@RequestParam("mobile") String mobile);
+
+    @Component
+    class DefaultFallback implements SsoUserApi{
+        @Override
+        public SsoResult<SsoUser> getUserByUu(Long userUU) {
+            return SsoResult.fallback();
+        }
+
+        @Override
+        public SsoUserSpaceList getUserSpacesByMobile(String mobile) {
+            return null;
+        }
+    }
+}

+ 8 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/api/SsoUserSpaceApi.java

@@ -0,0 +1,8 @@
+package com.usoftchina.sso.api;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+public interface SsoUserSpaceApi {
+}

+ 85 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoResult.java

@@ -0,0 +1,85 @@
+package com.usoftchina.sso.dto;
+
+import com.usoftchina.saas.exception.ExceptionCode;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+public class SsoResult<T> {
+    private boolean success;
+
+    private boolean error;
+
+    private String errCode;
+
+    private String errMsg;
+
+    private String errDetail;
+
+    private T content;
+
+    public SsoResult() {
+    }
+
+    /**
+     * 异常返回
+     *
+     * @return
+     */
+    public static SsoResult fallback() {
+        SsoResult result = new SsoResult();
+        result.setError(true);
+        result.setErrCode(String.valueOf(ExceptionCode.SYSTEM_BUSY.getCode()));
+        result.setErrMsg(ExceptionCode.SYSTEM_BUSY.getMessage());
+        return result;
+    }
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public boolean isError() {
+        return error;
+    }
+
+    public void setError(boolean error) {
+        this.error = error;
+    }
+
+    public String getErrMsg() {
+        return errMsg;
+    }
+
+    public void setErrMsg(String errMsg) {
+        this.errMsg = errMsg;
+    }
+
+    public String getErrCode() {
+        return errCode;
+    }
+
+    public void setErrCode(String errCode) {
+        this.errCode = errCode;
+    }
+
+    public String getErrDetail() {
+        return errDetail;
+    }
+
+    public void setErrDetail(String errDetail) {
+        this.errDetail = errDetail;
+    }
+
+    public T getContent() {
+        return content;
+    }
+
+    public void setContent(T content) {
+        this.content = content;
+    }
+}

+ 251 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUser.java

@@ -0,0 +1,251 @@
+package com.usoftchina.sso.dto;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SsoUser 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 Long 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 Long getLastLoginTime() {
+        return lastLoginTime;
+    }
+
+    public void setLastLoginTime(Long lastLoginTime) {
+        this.lastLoginTime = lastLoginTime;
+    }
+}

+ 191 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUserSpace.java

@@ -0,0 +1,191 @@
+package com.usoftchina.sso.dto;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SsoUserSpace implements Serializable{
+    /**
+     * 企业uu号
+     */
+    private Long spaceUU;
+
+    /**
+     * 企业名称
+     */
+    private String spaceName;
+
+    /**
+     * 法定代表人
+     */
+    private String corporation;
+
+    /**
+     * 注册日期
+     */
+    private Long registerDate;
+
+    /**
+     * 管理员
+     */
+    private SsoUser admin;
+
+    /**
+     * 营业执照号
+     */
+    private String businessCode;
+
+    /**
+     * 营业执照
+     */
+    private String businessCodeImage;
+
+    /**
+     * 注册地址
+     */
+    private String regAddress;
+
+    /**
+     * 企业信息认证状态
+     */
+    private Short validCode;
+
+    /**
+     * logo图片
+     */
+    private String logoImage;
+
+    /**
+     * 企业联系电话
+     */
+    private String telephone;
+
+    /**
+     * 行业
+     */
+    private String profession;
+
+    /**
+     * 经营范围标签,逗号分隔
+     */
+    private String tags;
+
+    private String accessSecret;
+
+    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 getCorporation() {
+        return corporation;
+    }
+
+    public void setCorporation(String corporation) {
+        this.corporation = corporation;
+    }
+
+    public Long getRegisterDate() {
+        return registerDate;
+    }
+
+    public void setRegisterDate(Long registerDate) {
+        this.registerDate = registerDate;
+    }
+
+    public SsoUser getAdmin() {
+        return admin;
+    }
+
+    public void setAdmin(SsoUser admin) {
+        this.admin = admin;
+    }
+
+    public String getBusinessCode() {
+        return businessCode;
+    }
+
+    public void setBusinessCode(String businessCode) {
+        this.businessCode = businessCode;
+    }
+
+    public String getBusinessCodeImage() {
+        return businessCodeImage;
+    }
+
+    public void setBusinessCodeImage(String businessCodeImage) {
+        this.businessCodeImage = businessCodeImage;
+    }
+
+    public String getRegAddress() {
+        return regAddress;
+    }
+
+    public void setRegAddress(String regAddress) {
+        this.regAddress = regAddress;
+    }
+
+    public Short getValidCode() {
+        return validCode;
+    }
+
+    public void setValidCode(Short validCode) {
+        this.validCode = validCode;
+    }
+
+    public String getLogoImage() {
+        return logoImage;
+    }
+
+    public void setLogoImage(String logoImage) {
+        this.logoImage = logoImage;
+    }
+
+    public String getTelephone() {
+        return telephone;
+    }
+
+    public void setTelephone(String telephone) {
+        this.telephone = telephone;
+    }
+
+    public String getProfession() {
+        return profession;
+    }
+
+    public void setProfession(String profession) {
+        this.profession = profession;
+    }
+
+    public String getTags() {
+        return tags;
+    }
+
+    public void setTags(String tags) {
+        this.tags = tags;
+    }
+
+    public String getAccessSecret() {
+        return accessSecret;
+    }
+
+    public void setAccessSecret(String accessSecret) {
+        this.accessSecret = accessSecret;
+    }
+}

+ 20 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUserSpaceList.java

@@ -0,0 +1,20 @@
+package com.usoftchina.sso.dto;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+public class SsoUserSpaceList implements Serializable{
+    private List<SsoUserSpace> spaces;
+
+    public List<SsoUserSpace> getSpaces() {
+        return spaces;
+    }
+
+    public void setSpaces(List<SsoUserSpace> spaces) {
+        this.spaces = spaces;
+    }
+}

+ 18 - 0
base-servers/auth/sso-api/src/test/java/com/usoftchina/sso/test/SsoTest.java

@@ -0,0 +1,18 @@
+package com.usoftchina.sso.test;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@SpringBootApplication(scanBasePackages = "com.usoftchina")
+@EnableFeignClients("com.usoftchina.sso")
+public class SsoTest {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SsoTest.class, args);
+    }
+}

+ 47 - 0
base-servers/auth/sso-api/src/test/java/com/usoftchina/sso/test/SsoUserApiTest.java

@@ -0,0 +1,47 @@
+package com.usoftchina.sso.test;
+
+import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.sso.api.SsoUserApi;
+import com.usoftchina.sso.dto.SsoResult;
+import com.usoftchina.sso.dto.SsoUser;
+import com.usoftchina.sso.dto.SsoUserSpaceList;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.MethodSorters;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class SsoUserApiTest {
+
+    @Autowired
+    private SsoUserApi ssoUserApi;
+
+    final static long userUU = 200040149;
+
+    final static String mobile = "13798490565";
+
+    @Test
+    public void testA_getUserByUu() {
+        SsoResult<SsoUser> result = ssoUserApi.getUserByUu(userUU);
+        if (result.isSuccess()) {
+            System.out.println(result.getContent().getVipName());
+        }
+    }
+
+    @Test
+    public void testB_getUserSpacesByMobile() {
+        SsoUserSpaceList list = ssoUserApi.getUserSpacesByMobile(mobile);
+        if (null != list && !CollectionUtils.isEmpty(list.getSpaces())) {
+            list.getSpaces().forEach(space -> System.out.println(space.getSpaceName()));
+        }
+    }
+}

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

@@ -0,0 +1,3 @@
+sso:
+  base-url: http://192.168.253.12:32323
+#  base-url: https://sso.ubtob.com

+ 4 - 0
framework/core/pom.xml

@@ -62,6 +62,10 @@
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 7 - 0
framework/core/src/main/java/com/usoftchina/saas/cache/RedisHashCache.java

@@ -4,6 +4,7 @@ import org.springframework.data.redis.core.BoundHashOperations;
 import org.springframework.data.redis.core.RedisTemplate;
 
 import java.util.Optional;
+import java.util.Set;
 import java.util.function.Supplier;
 
 /**
@@ -27,6 +28,10 @@ public abstract class RedisHashCache<K, F, V> extends BaseRedisCache<K, V> {
         return super.getRedisTemplate().boundHashOps(key());
     }
 
+    public Set<F> keys() {
+        return this.getBoundHashOperations().keys();
+    }
+
     /**
      * 获取
      *
@@ -89,4 +94,6 @@ public abstract class RedisHashCache<K, F, V> extends BaseRedisCache<K, V> {
     public void hdel() {
         this.getBoundHashOperations().delete(this.field());
     }
+
+
 }

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

@@ -321,7 +321,15 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 defaultValue: new Date(),
                 allowBlank : false,
                 name: 'vc_date'
-            }],
+            }, {
+                xtype: 'hidden',
+                name: 'vc_amount1',
+                fieldLabel: '核销金额'
+            }, {
+                xtype: "hidden",
+                name: "vc_amount2",
+                fieldLabel: "未核销金额"
+            },],
             details: ['detail1', 'detail2']
         },
 

+ 0 - 1
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -301,7 +301,6 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             saas.util.BaseUtil.showErrorToast(form.invalidText);
             return false;
         }
-
         var sum_detail1 = store1.sum('vd_nowbalance'); // 从表1核销合计
         var sum_detail2 = store2.sum('vcd_nowbalance'); // 从表2核销合计
 

+ 6 - 1
frontend/saas-web/app/view/money/verification/QueryPanel.js

@@ -126,7 +126,12 @@ Ext.define('saas.view.money.verification.QueryPanel', {
             xtype: 'numbercolumn',
             width: 120,
             flex: 1,
-            hidden: true
+            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);
+            }
         }]
     }
 });

+ 2 - 2
frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

@@ -48,7 +48,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
         name: 'pi_vendcode',
         fieldLabel: '供应商编号'
     }, {
-        xtype: 'vendorDbfindTrigger',
+        xtype: 'hidden',
         name: 'pi_vendname',
         fieldLabel: '供应商名称'
     },{
@@ -62,7 +62,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
         name: 'pi_custcode',
         fieldLabel: '客户编号'
     }, {
-        xtype: 'customerDbfindTrigger',
+        xtype: 'hidden',
         name: 'pi_custname',
         fieldLabel: '客户名称'
     },{