Prechádzať zdrojové kódy

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

huangx 7 rokov pred
rodič
commit
ac16a78d89
41 zmenil súbory, kde vykonal 2100 pridanie a 550 odobranie
  1. 2 5
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutReportController.java
  2. 4 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdInOutReportMapper.java
  3. 4 3
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/ProdInOutReportService.java
  4. 47 26
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutReportServiceImpl.java
  5. 25 0
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutReportMapper.xml
  6. 9 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountRegDTO.java
  7. 25 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/BindCompanyDTO.java
  8. 42 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyAccountDTO.java
  9. 17 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyListDTO.java
  10. 76 0
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyRspDTO.java
  11. 49 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/controller/AccountCenterController.java
  12. 25 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/mapper/AccountCompanyMapper.java
  13. 33 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/AccountCenterService.java
  14. 126 0
      base-servers/account/account-server/src/main/java/com/usoftchina/saas/account/service/impl/AccountCenterServiceImpl.java
  15. 12 0
      base-servers/account/account-server/src/main/resources/mapper/AccountCompanyMapper.xml
  16. 3 0
      base-servers/account/account-server/src/main/resources/mapper/CompanyMapper.xml
  17. 4 0
      framework/core/pom.xml
  18. 40 0
      framework/core/src/main/java/com/usoftchina/saas/utils/http/Hex.java
  19. 100 0
      framework/core/src/main/java/com/usoftchina/saas/utils/http/HmacEncoder.java
  20. 9 0
      framework/core/src/main/java/com/usoftchina/saas/utils/http/HmacSHA256Encoder.java
  21. 46 0
      framework/core/src/main/java/com/usoftchina/saas/utils/http/HmacUtils.java
  22. 917 0
      framework/core/src/main/java/com/usoftchina/saas/utils/http/HttpUtil.java
  23. 13 0
      frontend/saas-portal-web/package-lock.json
  24. 3 1
      frontend/saas-portal-web/package.json
  25. 159 31
      frontend/saas-portal-web/src/components/conenter/addgongsi.vue
  26. 178 95
      frontend/saas-portal-web/src/components/conenter/company.vue
  27. 13 12
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  28. 31 19
      frontend/saas-portal-web/src/components/conenter/home.vue
  29. 10 17
      frontend/saas-portal-web/src/components/conenter/qiyexiangxi.vue
  30. 0 301
      frontend/saas-portal-web/src/components/conenter/sanjiliandong.vue
  31. 9 16
      frontend/saas-portal-web/src/components/footer/footer.vue
  32. 3 0
      frontend/saas-portal-web/src/main.js
  33. 14 0
      frontend/saas-portal-web/src/store/index.js
  34. 10 6
      frontend/saas-portal-web/static/css/gongsi.css
  35. 6 6
      frontend/saas-portal-web/static/css/main.css
  36. 8 8
      frontend/saas-portal-web/static/js/mains.js
  37. 1 1
      frontend/saas-web/app/view/core/dbfind/types/EmployeeDbfindTrigger.js
  38. 1 1
      frontend/saas-web/app/view/money/recBalance/QueryPanel.js
  39. 0 2
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js
  40. 13 0
      frontend/saas-web/app/view/stock/otherIn/QueryPanelController.js
  41. 13 0
      frontend/saas-web/app/view/stock/otherOut/QueryPanelController.js

+ 2 - 5
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutReportController.java

@@ -1,6 +1,5 @@
 package com.usoftchina.saas.storage.controller;
 
-import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.page.PageRequest;
@@ -25,8 +24,7 @@ public class ProdInOutReportController {
      */
     @GetMapping("/prodioDetail")
     public Result getProdiodetail(PageRequest page, ListReqDTO req){
-        PageInfo listData = prodInOutReportService.getProdiodetail(page, req);
-        return Result.success(listData);
+        return Result.success(prodInOutReportService.getProdiodetail(page, req));
     }
 
     /**
@@ -37,8 +35,7 @@ public class ProdInOutReportController {
      */
     @GetMapping("/prodinoutCount")
     public Result getProdinoutCount(PageRequest page, ListReqDTO req){
-        PageInfo listData = prodInOutReportService.getProdinoutCount(page, req);
-        return Result.success(listData);
+        return Result.success(prodInOutReportService.getProdinoutCount(page, req));
     }
 
 }

+ 4 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdInOutReportMapper.java

@@ -15,4 +15,8 @@ public interface ProdInOutReportMapper {
     List selectProdiodetailByCondition(@Param("con") String con,@Param("companyId") Long companyId);
 
     List selectProdinoutCountByCondition(@Param("con") String con,@Param("companyId") Long companyId);
+
+    String selectProdiodetailCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
+
+    String selectProdinoutCountCalculateFields(String calculateFieldsSql, String con, Long companyId);
 }

+ 4 - 3
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/ProdInOutReportService.java

@@ -1,15 +1,16 @@
 package com.usoftchina.saas.storage.service;
 
-import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.page.PageRequest;
 
+import java.util.Map;
+
 /**
  * Created by zdw
  * 2018-11-09 16:57.
  */
 public interface ProdInOutReportService {
-    PageInfo getProdiodetail(PageRequest page, ListReqDTO req);
+    Map<String, Object> getProdiodetail(PageRequest page, ListReqDTO req);
 
-    PageInfo getProdinoutCount(PageRequest page, ListReqDTO req);
+    Map<String, Object> getProdinoutCount(PageRequest page, ListReqDTO req);
 }

+ 47 - 26
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutReportServiceImpl.java

@@ -1,16 +1,21 @@
 package com.usoftchina.saas.storage.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.storage.mapper.ProdInOutReportMapper;
 import com.usoftchina.saas.storage.service.ProdInOutReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Created by zdw
@@ -22,43 +27,59 @@ public class ProdInOutReportServiceImpl implements ProdInOutReportService{
     private ProdInOutReportMapper prodInOutReportMapper;
 
     @Override
-    public PageInfo getProdiodetail(PageRequest page, ListReqDTO req) {
-        return getListDATA(page, req, "Prodiodetail");
-    }
-
-    @Override
-    public PageInfo getProdinoutCount(PageRequest page, ListReqDTO req) {
-        return getListDATA(page, req, "ProdinoutCount");
-    }
-
-    private PageInfo getListDATA(PageRequest page, ListReqDTO req, String type) {
-        //设置默认分页
-        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
-            page = new PageRequest();
-            page.setNumber(1);
-            page.setSize(10);
-        }
+    public Map<String, Object> getProdiodetail(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
         PageHelper.startPage(page.getNumber(), page.getSize());
-        //查询数据
-        List lists = getListByType(req, type);
+        Map<String,Object> map = new HashMap<>();
+        List list = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = req.getFinalCondition();
+        String calculateFieldsSql = req.getCalculateFieldsSql();
+        JSONArray arr = null;
+        if (null == con) {
+            con = "1=1";
+        }
+        list = prodInOutReportMapper.selectProdiodetailByCondition(con, companyId);
         //取分页信息
-        PageInfo pageInfo = new PageInfo(lists);
-        return pageInfo;
+        PageInfo pageInfo = new PageInfo(list);
+        //取对应计算数据
+        if (!StringUtils.isEmpty(calculateFieldsSql)) {
+            String res = prodInOutReportMapper.selectProdiodetailCalculateFields(calculateFieldsSql, con, companyId);
+            try {
+                arr = JSONArray.parseArray(res);
+            } catch (Exception e) {
+            }
+        }
+        map.put("list", pageInfo);
+        map.put("calculate", arr);
+        return map;
     }
 
-    private List getListByType(ListReqDTO req, String type) {
+    @Override
+    public Map<String, Object> getProdinoutCount(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        Map<String,Object> map = new HashMap<>();
         List list = null;
         Long companyId = BaseContextHolder.getCompanyId();
         String con = req.getFinalCondition();
+        String calculateFieldsSql = req.getCalculateFieldsSql();
+        JSONArray arr = null;
         if (null == con) {
             con = "1=1";
         }
-        if ("Prodiodetail".equals(type)) {
-            list = prodInOutReportMapper.selectProdiodetailByCondition(con, companyId);
-        } else if ("ProdinoutCount".equals(type)){
-            list = prodInOutReportMapper.selectProdinoutCountByCondition(con, companyId);
+        list = prodInOutReportMapper.selectProdinoutCountByCondition(con, companyId);
+        //取分页信息
+        PageInfo pageInfo = new PageInfo(list);
+        //取对应计算数据
+        if (!StringUtils.isEmpty(calculateFieldsSql)) {
+            String res = prodInOutReportMapper.selectProdinoutCountCalculateFields(calculateFieldsSql, con, companyId);
+            try {
+                arr = JSONArray.parseArray(res);
+            } catch (Exception e) {
+            }
         }
-        return list;
+        map.put("list", pageInfo);
+        map.put("calculate", arr);
+        return map;
     }
 
 }

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

@@ -71,6 +71,31 @@
     </where>
   </select>
 
+  <select id="selectProdiodetailCalculateFields" resultType="string">
+    select   ${fields}  from prodiodetail_view
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by pi_inoutno desc
+  </select>
+
+  <select id="selectProdinoutCountCalculateFields" resultType="string">
+    select   ${fields}  from prodinoutcount_view
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by pwm_yearmonth
+  </select>
 
 
 

+ 9 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountRegDTO.java

@@ -15,6 +15,7 @@ public class AccountRegDTO implements Serializable {
     private String realname;
     private String email;
     private String mobile;
+    private String uu;
     /**
      * 账号类型 0 - 管理员
      */
@@ -25,6 +26,14 @@ public class AccountRegDTO implements Serializable {
     private String avatarUrl;
     private Long companyId;
 
+    public String getUu() {
+        return uu;
+    }
+
+    public void setUu(String uu) {
+        this.uu = uu;
+    }
+
     public String getUsername() {
         return username;
     }

+ 25 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/BindCompanyDTO.java

@@ -0,0 +1,25 @@
+package com.usoftchina.saas.account.dto;
+
+import java.io.Serializable;
+
+public class BindCompanyDTO implements Serializable {
+
+    private Long companyId;
+    private Long accountId;
+
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+}

+ 42 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyAccountDTO.java

@@ -0,0 +1,42 @@
+package com.usoftchina.saas.account.dto;
+
+import java.io.Serializable;
+
+/**
+ * 公司+账户 传输对象, 用于开通企业时的企业信息及管理员信息完善
+ */
+public class CompanyAccountDTO implements Serializable {
+
+    private CompanyRegDTO companyRegDTO;
+    private AccountRegDTO accountRegDTO;
+    /**
+     * 操作类型
+     *  0: 创建企业
+     *  1: 开通SAAS
+     */
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public CompanyRegDTO getCompanyRegDTO() {
+        return companyRegDTO;
+    }
+
+    public void setCompanyRegDTO(CompanyRegDTO companyRegDTO) {
+        this.companyRegDTO = companyRegDTO;
+    }
+
+    public AccountRegDTO getAccountRegDTO() {
+        return accountRegDTO;
+    }
+
+    public void setAccountRegDTO(AccountRegDTO accountRegDTO) {
+        this.accountRegDTO = accountRegDTO;
+    }
+}

+ 17 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyListDTO.java

@@ -0,0 +1,17 @@
+package com.usoftchina.saas.account.dto;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class CompanyListDTO implements Serializable {
+
+    private List<CompanyBaseDTO> companies;
+
+    public List<CompanyBaseDTO> getCompanies() {
+        return companies;
+    }
+
+    public void setCompanies(List<CompanyBaseDTO> companies) {
+        this.companies = companies;
+    }
+}

+ 76 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/CompanyRspDTO.java

@@ -0,0 +1,76 @@
+package com.usoftchina.saas.account.dto;
+
+import java.io.Serializable;
+
+public class CompanyRspDTO implements Serializable {
+
+    private Long id;
+    /**
+     * 唯一名称
+     */
+    private String name;
+    /**
+     * 商业登记证号
+     */
+    private String businessCode;
+    private String address;
+    private boolean default_;
+    private boolean saas_;
+    private String uu;
+
+    public String getUu() {
+        return uu;
+    }
+
+    public void setUu(String uu) {
+        this.uu = uu;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public boolean isSaas_() {
+        return saas_;
+    }
+
+    public void setSaas_(boolean saas_) {
+        this.saas_ = saas_;
+    }
+
+    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 boolean isDefault_() {
+        return default_;
+    }
+
+    public void setDefault_(boolean default_) {
+        this.default_ = default_;
+    }
+}

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

@@ -0,0 +1,49 @@
+package com.usoftchina.saas.account.controller;
+
+import com.usoftchina.saas.account.dto.BindCompanyDTO;
+import com.usoftchina.saas.account.dto.CompanyAccountDTO;
+import com.usoftchina.saas.account.dto.CompanyListDTO;
+import com.usoftchina.saas.account.service.AccountCenterService;
+import com.usoftchina.saas.base.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/accountCenter")
+public class AccountCenterController {
+
+    @Autowired
+    private AccountCenterService accountCenterService;
+
+    /**
+     * 信息完善界面   保存接口
+     * @param companyAccountDTO
+     * @return
+     */
+    @PostMapping("/companyAccount/save")
+    public Result saveCompanyAccount(@RequestBody CompanyAccountDTO companyAccountDTO){
+        return Result.success(accountCenterService.saveCompanyAccount(companyAccountDTO));
+    }
+
+    /**
+     * 获取企业信息列表
+     * @param mobile      用户UU号
+     * @return
+     */
+    @GetMapping("/company/list")
+    public Result companyList(@RequestParam("mobile") String mobile){
+        return Result.success(accountCenterService.getCompanyList(mobile));
+    }
+
+    /**
+     * 绑定默认企业
+     * @param bindCompanyDTO
+     * @return
+     */
+    @PostMapping("/bind/defaultCompany")
+    public Result bindDefaultCompany(@RequestBody BindCompanyDTO bindCompanyDTO){
+        accountCenterService.bindDefaultCompany(bindCompanyDTO.getCompanyId(), bindCompanyDTO.getAccountId());
+        return Result.success();
+    }
+
+}

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

@@ -1,7 +1,10 @@
 package com.usoftchina.saas.account.mapper;
 
+import com.usoftchina.saas.account.dto.CompanyRspDTO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @author yingp
  * @date 2018/10/10
@@ -41,4 +44,26 @@ public interface AccountCompanyMapper {
      * @return
      */
     int deleteByCompanyId(@Param("companyId") Long companyId);
+
+    /**
+     * 通过账户UU号查询企业列表
+     * @param mobile
+     * @return
+     */
+    List<CompanyRspDTO> getCompanyListByAccountMobile(@Param("mobile") String mobile);
+
+    /**
+     * 解除账户绑定的默认企业
+     * @param accountId
+     * @return
+     */
+    boolean unBindDefault(@Param("accountId") Long accountId);
+
+    /**
+     *
+     * @param accountId
+     * @param companyId
+     * @return
+     */
+    boolean bindDefault(@Param("accountId") Long accountId, @Param("companyId") Long companyId);
 }

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

@@ -0,0 +1,33 @@
+package com.usoftchina.saas.account.service;
+
+import com.usoftchina.saas.account.dto.CompanyAccountDTO;
+import com.usoftchina.saas.account.dto.CompanyListDTO;
+import com.usoftchina.saas.account.dto.CompanyRspDTO;
+import com.usoftchina.saas.base.Result;
+
+import java.util.List;
+
+public interface AccountCenterService {
+
+    /**
+     * 企业账户信息完善 保存
+     * @param companyAccountDTO
+     * @return
+     */
+    Result saveCompanyAccount(CompanyAccountDTO companyAccountDTO);
+
+    /**
+     * 获取企业信息列表
+     * @param mobile
+     * @return
+     */
+    List<CompanyRspDTO> getCompanyList(String mobile);
+
+    /**
+     * 更新默认企业
+     * @param companyId
+     * @param accountId
+     * @return
+     */
+    boolean bindDefaultCompany(Long companyId, Long accountId);
+}

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

@@ -0,0 +1,126 @@
+package com.usoftchina.saas.account.service.impl;
+
+import com.usoftchina.saas.account.dto.*;
+import com.usoftchina.saas.account.mapper.AccountCompanyMapper;
+import com.usoftchina.saas.account.po.Account;
+import com.usoftchina.saas.account.po.Company;
+import com.usoftchina.saas.account.service.AccountCenterService;
+import com.usoftchina.saas.account.service.AccountService;
+import com.usoftchina.saas.account.service.CompanyService;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.exception.ExceptionCode;
+import com.usoftchina.saas.utils.BeanMapper;
+import com.usoftchina.saas.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class AccountCenterServiceImpl implements AccountCenterService {
+
+    @Autowired
+    private CompanyService companyService;
+    @Autowired
+    private AccountService accountService;
+    @Autowired
+    private AccountCompanyMapper accountCompanyMapper;
+
+    private final String ACCOUNTCNETER_URL_DEV = "http://192.168.253.12:32323";
+    //private final String ACCOUNTCNETER_URL_PROD = "https://sso.ubtob.com";
+
+    @Override
+    @Transactional
+    public Result saveCompanyAccount(CompanyAccountDTO companyAccountDTO) {
+        CompanyRegDTO companyRegDTO = companyAccountDTO.getCompanyRegDTO();
+        AccountRegDTO accountRegDTO = companyAccountDTO.getAccountRegDTO();
+        String type = companyAccountDTO.getType();
+        Long accountId = accountService.findByMobile(accountRegDTO.getMobile()).getId();
+        //1.保存企业信息
+        //a. 判断是否已注册
+        Company company = companyService.findByName(companyRegDTO.getName());
+        if (null != company) {
+            return Result.error(ExceptionCode.COMPANY_NAME_EXIST);
+        }
+        company = companyService.findByBusinessCode(companyRegDTO.getBusinessCode());
+        if (null != company) {
+            return Result.error(ExceptionCode.COMPANY_CODE_EXIST);
+        }
+        company = BeanMapper.map(companyRegDTO, Company.class);
+        //生成随机 营业执照号
+        if (StringUtils.isEmpty(company.getBusinessCode())){
+            company.setBusinessCode(StringUtils.createBusinessCode());
+        }
+        companyService.save(company);
+        //b. 同步企业信息到优软云 ——>  创建企业
+        if ("0".equals(type)) {
+            String result = postToAccount(company.getName(), company.getBusinessCode(), accountRegDTO.getUu());
+            accountCompanyMapper.insert(accountId, company.getId());
+        }
+        //2.更新账户信息
+        Account account = BeanMapper.map(accountRegDTO, Account.class);
+
+        account.setId(accountId);
+        accountService.updateByPrimaryKeySelective(account);
+        return null;
+    }
+
+    /**
+     * 将企业信息同步到优软云
+     * @param spaceName
+     * @param businesscode
+     * @param uu
+     * @return
+     */
+    private String postToAccount(String spaceName, String businesscode, String uu) {
+        String url = "/sso/userspace/register/admin";
+        RestTemplate restTemplate = new RestTemplate();
+        MultiValueMap<String, String> requestEntity = new LinkedMultiValueMap<>();
+        requestEntity.add("spaceName", spaceName);
+        requestEntity.add("businessCode", businesscode);
+        requestEntity.add("userUU", uu);
+        String result = restTemplate.postForObject(ACCOUNTCNETER_URL_DEV + url, requestEntity, String.class);
+        return result;
+    }
+
+    @Override
+    public List<CompanyRspDTO> getCompanyList(String mobile) {
+        List<CompanyRspDTO> result = new ArrayList<CompanyRspDTO>();
+        //1、获取本SAAS系统的企业信息
+        List<CompanyRspDTO> companyRspDTOList = accountCompanyMapper.getCompanyListByAccountMobile(mobile);
+        //如果只有一条记录,将该企业设置为默认企业
+        if (companyRspDTOList.size() == 1 && !companyRspDTOList.get(0).isDefault_()){
+            Long accountId = accountService.findByMobile(mobile).getId();
+            Long companyId = companyRspDTOList.get(0).getId();
+            accountCompanyMapper.bindDefault(accountId, companyId);
+        }
+        result.addAll(companyRspDTOList);
+        //2、优软云返回的企业信息
+        //TODO 通过接口获取优软云的企业信息
+
+        //3、去重复
+        /*for (CompanyRspDTO companyRspDTO : companyRspDTOList){
+            for (CompanyBaseDTO companyBaseDTO : companyBaseDTOList){
+                if (companyRspDTO.getName().equals(companyBaseDTO.getName())){
+                    companyBaseDTOList.remove(companyRspDTO);
+                }
+            }
+        }
+        List<CompanyRspDTO> companyBaseRspDTOList = BeanMapper.mapList(companyBaseDTOList, CompanyRspDTO.class);
+        result.addAll(companyBaseRspDTOList);*/
+        return result;
+    }
+
+    @Override
+    public boolean bindDefaultCompany(Long companyId, Long accountId) {
+        accountCompanyMapper.unBindDefault(accountId);
+        accountCompanyMapper.bindDefault(accountId, companyId);
+        return true;
+    }
+
+}

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

@@ -13,4 +13,16 @@
     <delete id="deleteByCompanyId" parameterType="java.lang.Long">
         delete from ac_account_company where company_id=#{companyId}
     </delete>
+    <select id="getCompanyListByAccountMobile" resultType="com.usoftchina.saas.account.dto.CompanyRspDTO">
+        SELECT cmp.id,cmp.name,cmp.uu,cmp.business_code businessCode,cmp.address,accmp.is_default default_,'1' saas_ from ac_company cmp
+        left join ac_account_company accmp on accmp.company_id=cmp.id
+        left join ac_account ac on ac.id = accmp.account_id
+        where ac.mobile = #{mobile};
+    </select>
+    <update id="unBindDefault" >
+        UPDATE AC_ACCOUNT_COMPANY SET IS_DEFAULT = 0 WHERE ACCOUNT_ID = #{accountId}
+    </update>
+    <update id="bindDefault" >
+        UPDATE AC_ACCOUNT_COMPANY SET IS_DEFAULT = 1 WHERE ACCOUNT_ID = #{accountId} AND COMPANY_ID = #{companyId}
+    </update>
 </mapper>

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

@@ -28,6 +28,9 @@
     </sql>
     <insert id="insert" parameterType="com.usoftchina.saas.account.po.Company"
             useGeneratedKeys="true" keyProperty="id">
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
         insert into ac_company(name, business_code, address, logo_url, creator_id, create_time, updater_id, update_time,
         tel, fax, signet, uu)
         values (#{name,jdbcType=VARCHAR}, #{businessCode,jdbcType=VARCHAR},

+ 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>

+ 40 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/http/Hex.java

@@ -0,0 +1,40 @@
+package com.usoftchina.saas.utils.http;
+
+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) {
+		int nBytes = bytes.length;
+		char[] result = new char[2 * nBytes];
+
+		int j = 0;
+		for (int i = 0; i < nBytes; ++i) {
+			result[(j++)] = HEX[((0xF0 & bytes[i]) >>> 4)];
+
+			result[(j++)] = HEX[(0xF & bytes[i])];
+		}
+
+		return result;
+	}
+
+	public static byte[] decode(CharSequence s) {
+		int nChars = s.length();
+
+		if (nChars % 2 != 0) {
+			throw new IllegalArgumentException("Hex-encoded string must have an even number of characters");
+		}
+
+		byte[] result = new byte[nChars / 2];
+
+		for (int i = 0; i < nChars; i += 2) {
+			int msb = Character.digit(s.charAt(i), 16);
+			int lsb = Character.digit(s.charAt(i + 1), 16);
+
+			if ((msb < 0) || (lsb < 0)) {
+				throw new IllegalArgumentException("Non-hex character in input: " + s);
+			}
+			result[(i / 2)] = (byte) (msb << 4 | lsb);
+		}
+		return result;
+	}
+}

+ 100 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/http/HmacEncoder.java

@@ -0,0 +1,100 @@
+package com.usoftchina.saas.utils.http;
+
+import java.security.InvalidKeyException;
+import java.security.Key;
+import java.security.NoSuchAlgorithmException;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.Mac;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * Hash-based message authentication code,利用哈希算法,以一个密钥和一个消息为输入,生成一个消息摘要作为输出
+ * 
+ * @author yingp
+ *
+ */
+public class HmacEncoder {
+
+	private final String algorithm;
+
+	public HmacEncoder(String algorithm) {
+		this.algorithm = algorithm;
+	}
+
+	/**
+	 * 根据给定密钥生成算法创建密钥
+	 * 
+	 * @param algorithm
+	 *            密钥算法
+	 * @return 密钥
+	 * @throws RuntimeException
+	 *             当 {@link NoSuchAlgorithmException} 发生时
+	 */
+	public byte[] getKey() {
+		// 初始化KeyGenerator
+		KeyGenerator keyGenerator = null;
+		try {
+			keyGenerator = KeyGenerator.getInstance(algorithm);
+		} catch (NoSuchAlgorithmException e) {
+			throw new RuntimeException(e.getMessage());
+		}
+		// 产生密钥
+		SecretKey secretKey = keyGenerator.generateKey();
+		// 获得密钥
+		return secretKey.getEncoded();
+	}
+
+	/**
+	 * 转换密钥
+	 * 
+	 * @param key
+	 *            二进制密钥
+	 * @param algorithm
+	 *            密钥算法
+	 * @return 密钥
+	 */
+	private static Key toKey(byte[] key, String algorithm) {
+		// 生成密钥
+		return new SecretKeySpec(key, algorithm);
+	}
+
+	/**
+	 * 使用指定消息摘要算法计算消息摘要
+	 * 
+	 * @param data
+	 *            做消息摘要的数据
+	 * @param key
+	 *            密钥
+	 * @return 消息摘要(长度为16的字节数组)
+	 */
+	public byte[] encode(byte[] data, Key key) {
+		Mac mac = null;
+		try {
+			mac = Mac.getInstance(algorithm);
+			mac.init(key);
+		} catch (NoSuchAlgorithmException e) {
+			e.printStackTrace();
+			return new byte[0];
+		} catch (InvalidKeyException e) {
+			e.printStackTrace();
+			return new byte[0];
+		}
+		return mac.doFinal(data);
+	}
+
+	/**
+	 * 使用指定消息摘要算法计算消息摘要
+	 * 
+	 * @param data
+	 *            做消息摘要的数据
+	 * @param key
+	 *            密钥
+	 * @return 消息摘要(长度为16的字节数组)
+	 */
+	public byte[] encode(byte[] data, byte[] key) {
+		return encode(data, toKey(key, algorithm));
+	}
+
+}

+ 9 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/http/HmacSHA256Encoder.java

@@ -0,0 +1,9 @@
+package com.usoftchina.saas.utils.http;
+
+public class HmacSHA256Encoder extends HmacEncoder {
+
+	public HmacSHA256Encoder() {
+		super("HmacSHA256");
+	}
+
+}

+ 46 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/http/HmacUtils.java

@@ -0,0 +1,46 @@
+package com.usoftchina.saas.utils.http;
+
+/**
+ * Hmac加密工具
+ * 
+ * @author yingp
+ *
+ */
+public class HmacUtils {
+
+	private static HmacEncoder hmacEncoder;
+
+	// 默认约定密钥
+	private final static byte[] key = { 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 117, 98, 116, 111, 98, 46, 99, 111, 109, 47,
+			101, 114, 112, 47, 115, 97, 108, 101, 47, 111, 114, 100, 101, 114, 115, 63, 115, 111, 109, 101, 116, 104, 105, 110, 103 };
+
+	static {
+		// default algorithm: HmacSHA256
+		hmacEncoder = new HmacSHA256Encoder();
+	}
+
+	/**
+	 * 
+	 * @param message
+	 *            明文
+	 * @return 16进制密文
+	 */
+	public static String encode(Object message) {
+		byte[] encodeData = hmacEncoder.encode(String.valueOf(message).getBytes(), key);
+		return new String(Hex.encode(encodeData));
+	}
+
+	/**
+	 * 
+	 * @param message
+	 *            明文
+	 * @param key
+	 *            密钥
+	 * @return 16进制密文
+	 */
+	public static String encode(Object message, String key) {
+		byte[] encodeData = hmacEncoder.encode(String.valueOf(message).getBytes(), key.getBytes());
+		return new String(Hex.encode(encodeData));
+	}
+
+}

+ 917 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/http/HttpUtil.java

@@ -0,0 +1,917 @@
+package com.usoftchina.saas.utils.http;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import org.apache.http.Consts;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.protocol.HTTP;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+
+/**
+ * HTTP工具类,封装http请求
+ * 
+ * @author suntg
+ * @date 2015年3月5日14:20:40
+ */
+@SuppressWarnings("deprecation")
+public class HttpUtil {
+	
+	/** 
+	 * 绕过验证 
+	 *   
+	 * @return 
+	 * @throws NoSuchAlgorithmException  
+	 * @throws KeyManagementException  
+	 */  
+	public static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException {  
+	    SSLContext sc = SSLContext.getInstance("SSLv3");  
+	  
+	    // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法  
+	    X509TrustManager trustManager = new X509TrustManager() {  
+	        @Override  
+	        public void checkClientTrusted(  
+	                java.security.cert.X509Certificate[] paramArrayOfX509Certificate,  
+	                String paramString) throws CertificateException {  
+	        }  
+	  
+	        @Override  
+	        public void checkServerTrusted(  
+	                java.security.cert.X509Certificate[] paramArrayOfX509Certificate,  
+	                String paramString) throws CertificateException {  
+	        }  
+	  
+	        @Override  
+	        public java.security.cert.X509Certificate[] getAcceptedIssuers() {  
+	            return null;  
+	        }  
+	    };  
+	  
+	    sc.init(null, new TrustManager[] { trustManager }, null);  
+	    return sc;  
+	}  
+	
+	/** 
+	 * 绕过验证 
+	 *   
+	 * @return 
+	 * @throws NoSuchAlgorithmException  
+	 * @throws KeyManagementException  
+	 */  
+	public static SSLContext createIgnoreVerifySSL2() throws NoSuchAlgorithmException, KeyManagementException {  
+	    SSLContext sc = SSLContext.getInstance("SSL");  
+	  
+	    // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法  
+	    X509TrustManager trustManager = new X509TrustManager() {  
+	        @Override  
+	        public void checkClientTrusted(  
+	                java.security.cert.X509Certificate[] paramArrayOfX509Certificate,  
+	                String paramString) throws CertificateException {  
+	        }  
+	  
+	        @Override  
+	        public void checkServerTrusted(  
+	                java.security.cert.X509Certificate[] paramArrayOfX509Certificate,  
+	                String paramString) throws CertificateException {  
+	        }  
+	  
+	        @Override  
+	        public java.security.cert.X509Certificate[] getAcceptedIssuers() {  
+	            return null;  
+	        }  
+	    };  
+	  
+	    sc.init(null, new TrustManager[] { trustManager }, null);  
+	    return sc;  
+	}  
+
+	/**
+	 * 发送GET请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendGetRequest(String url, Map<String, String> params) throws Exception {
+		return sendGetRequest(url, params, false, null);
+	}
+
+	/**
+	 * 发送GET请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendGetRequest(String url, Map<String, String> params, boolean sign, String signKey) throws Exception {
+		return sendRequest(RequestMethod.GET, url, params, sign, signKey);
+	}
+
+	/**
+	 * 发送GET请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendGetRequest(String url, Map<String, String> params, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.GET, url, params, sign, null);
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPostRequest(String url, Map<String, String> params) throws Exception {
+		return sendPostRequest(url, params, false, null);
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * @param url
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPostRequest(String url, List<?> datas) throws Exception {
+		return sendPostRequest(url, datas, false, null);
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPostRequest(String url, Map<String, String> params, boolean sign, String signKey) throws Exception {
+		return sendRequest(RequestMethod.POST, url, params, sign, signKey);
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * @param url
+	 * @param datas
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPostRequest(String url, List<?> datas, boolean sign, String signKey) throws Exception {
+		return sendRequest(RequestMethod.POST, url, datas, sign, signKey);
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * <pre>
+	 * 使用默认密钥
+	 * </pre>
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPostRequest(String url, Map<String, String> params, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.POST, url, params, sign, null);
+	}
+
+	/**
+	 * 发送POST请求
+	 * 
+	 * <pre>
+	 * 使用默认密钥
+	 * </pre>
+	 * 
+	 * @param url
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPostRequest(String url, List<?> datas, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.POST, url, datas, sign, null);
+	}
+	
+	/**
+	 * 发送post请求
+	 * 
+	 * @param postUrl
+	 * @param formData
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response doPost(String postUrl, String formData,  boolean sign, String signKey) throws Exception {
+		//采用绕过验证的方式处理https请求  
+	    SSLContext sslcontext = createIgnoreVerifySSL();  
+	      
+	    // 设置协议http和https对应的处理socket链接工厂的对象  
+	    Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()  
+           .register("http", PlainConnectionSocketFactory.INSTANCE)  
+           .register("https", new SSLConnectionSocketFactory(sslcontext))  
+           .build();  
+       	PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);  
+       	HttpClients.custom().setConnectionManager(connManager);  
+       	
+       	//创建自定义的httpclient对象  
+        CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connManager).build();
+        //CloseableHttpClient httpClient = HttpClients.createDefault();
+        postUrl = getUrl(postUrl, sign, signKey);
+        HttpPost post = new HttpPost(postUrl);
+        StringEntity postingString = new StringEntity(formData, HTTP.UTF_8);
+        post.setEntity(postingString);
+        post.setHeader("Content-type", "application/json");
+        CloseableHttpResponse response = httpClient.execute(post);
+        return Response.getResponse(response);
+    }
+	
+	/**
+	 * 发送post请求
+	 * 
+	 * @param postUrl
+	 * @param formData
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response doPostWithSSL(String postUrl, String formData,  boolean sign, String signKey) throws Exception {
+		//采用绕过验证的方式处理https请求  
+	    SSLContext sslcontext = createIgnoreVerifySSL2();  
+	      
+	    // 设置协议http和https对应的处理socket链接工厂的对象  
+	    Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()  
+           .register("http", PlainConnectionSocketFactory.INSTANCE)  
+           .register("https", new SSLConnectionSocketFactory(sslcontext))  
+           .build();  
+       	PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);  
+       	HttpClients.custom().setConnectionManager(connManager);  
+       	
+       	//创建自定义的httpclient对象  
+        CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connManager).build();
+        //CloseableHttpClient httpClient = HttpClients.createDefault();
+        postUrl = getUrl(postUrl, sign, signKey);
+        HttpPost post = new HttpPost(postUrl);
+        StringEntity postingString = new StringEntity(formData, HTTP.UTF_8);
+        post.setEntity(postingString);
+        post.setHeader("Content-type", "application/json");
+        CloseableHttpResponse response = httpClient.execute(post);
+        return Response.getResponse(response);
+    }
+	
+	public static Response doPost(String postUrl, String formData,  boolean sign, String signKey, int timeout) throws Exception {
+		URL url = new URL(postUrl);
+		HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
+		try {
+			urlConn.setDoOutput(true);
+			urlConn.setDoInput(true);
+			urlConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+			urlConn.setUseCaches(false);
+			urlConn.setInstanceFollowRedirects(true);
+			urlConn.setRequestMethod("POST");
+			urlConn.setConnectTimeout(timeout);
+			urlConn.setReadTimeout(timeout);
+			if (null != formData) {
+				OutputStreamWriter osw = new OutputStreamWriter(urlConn.getOutputStream(), "UTF-8");
+				osw.write(formData);
+				osw.flush();
+				osw.close();
+			}
+			return new Response(urlConn.getResponseCode() == 200, streamToString(urlConn.getInputStream()));
+		} catch (Exception e) {
+			return new Response(false, e.getMessage());
+		} finally {
+			if (urlConn != null) {
+				urlConn.disconnect();
+			}
+		}
+    }
+	
+	public static String streamToString(InputStream in) throws Exception {
+		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+		StringBuilder buf = new StringBuilder();
+
+		try {
+			char[] chars = new char[2048];
+			for (;;) {
+				int len = reader.read(chars, 0, chars.length);
+				if (len < 0) {
+					break;
+				}
+				buf.append(chars, 0, len);
+			}
+		} catch (Exception ex) {
+			throw new Exception("read string from reader error", ex);
+		}
+
+		return buf.toString();
+	}
+
+	/**
+	 * 封装加密
+	 * 
+	 * @param sign
+	 * @param signKey
+	 * @return
+	 */
+	private static String getUrl(String url, boolean sign, String signKey) {
+		StringBuilder buf = new StringBuilder(url);
+		if (url.indexOf("?") == -1)
+			buf.append("?");
+		else if (!url.endsWith("&"))
+			buf.append("&");
+		if (sign) {
+			// 加时间戳,保持相同请求每次签名均不一样
+			buf.append("_timestamp=").append(System.currentTimeMillis());
+			String message = buf.toString();
+			// 对请求串进行签名
+			buf.append("&_signature=").append(HmacUtils.encode(message, signKey));
+		} else
+			buf.deleteCharAt(buf.length() - 1);
+		return buf.toString();
+	}
+
+	/**
+	 * 发送PUT请求
+	 * 
+	 * <pre>
+	 * 使用默认密钥
+	 * </pre>
+	 * 
+	 * @param url
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPutRequest(String url, List<?> datas, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.PUT, url, datas, sign, null);
+	}
+
+	/**
+	 * 发送PUT请求
+	 * 
+	 * <pre>
+	 * 使用默认密钥
+	 * </pre>
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPutRequest(String url, Map<String, String> params, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.PUT, url, params, sign, null);
+	}
+
+	/**
+	 * 发送PUT请求
+	 * 
+	 * @param url
+	 * @param datas
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPutRequest(String url, List<?> datas, boolean sign, String signKey) throws Exception {
+		return sendRequest(RequestMethod.PUT, url, datas, sign, signKey);
+	}
+
+	/**
+	 * 发送PUT请求
+	 * 
+	 * @param url
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendPutRequest(String url, List<?> datas) throws Exception {
+		return sendPutRequest(url, datas, false, null);
+	}
+
+	/**
+	 * 发送DELETE请求
+	 * 
+	 * @param url
+	 * @param params
+	 * 
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendDeleteRequest(String url, Map<String, String> params) throws Exception {
+		return sendDeleteRequest(url, params, false, null);
+	}
+
+	/**
+	 * 发送DELETE请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendDeleteRequest(String url, Map<String, String> params, boolean sign, String signKey) throws Exception {
+		return sendRequest(RequestMethod.DELETE, url, params, sign, signKey);
+	}
+
+	/**
+	 * 发送DELETE请求
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否发送签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendDeleteRequest(String url, Map<String, String> params, boolean sign) throws Exception {
+		return sendRequest(RequestMethod.DELETE, url, params, sign, null);
+	}
+
+	/**
+	 * 发起http请求
+	 * 
+	 * @param method
+	 *            请求方法GET、POST、PUT、DELETE
+	 * @param url
+	 *            请求链接
+	 * @param params
+	 *            参数
+	 * @param sign
+	 *            是否签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendRequest(RequestMethod method, String url, Map<String, String> params, boolean sign, String signKey)
+			throws Exception {
+		switch (method) {
+		case GET:
+			return sendHttpUriRequest(new HttpGet(getRequestUrl(url, params, sign, signKey)));
+		case POST:
+			return sendHttpEntityEnclosingRequest(new HttpPost(getRequestUrl(url, sign, signKey)), params);
+		case PUT:
+			return sendHttpEntityEnclosingRequest(new HttpPut(getRequestUrl(url, sign, signKey)), params);
+		case DELETE:
+			return sendHttpUriRequest(new HttpDelete(getRequestUrl(url, params, sign, signKey)));
+		default:
+			return sendHttpUriRequest(new HttpGet(getRequestUrl(url, params, sign, signKey)));
+		}
+	}
+
+	/**
+	 * 发起http请求
+	 * 
+	 * @param method
+	 *            请求方法POST、PUT
+	 * @param url
+	 *            请求链接
+	 * @param datas
+	 *            参数
+	 * @param sign
+	 *            是否签名
+	 * @return
+	 * @throws Exception
+	 */
+	public static Response sendRequest(RequestMethod method, String url, List<?> datas, boolean sign, String signKey) throws Exception {
+		switch (method) {
+		case POST:
+			return sendHttpEntityEnclosingRequest(new HttpPost(getRequestUrl(url, sign, signKey)), datas);
+		case PUT:
+			return sendHttpEntityEnclosingRequest(new HttpPut(getRequestUrl(url, sign, signKey)), datas);
+		default:
+			return sendHttpEntityEnclosingRequest(new HttpPost(getRequestUrl(url, sign, signKey)), datas);
+		}
+	}
+
+	/**
+	 * 发起GET、DELETE请求
+	 * 
+	 * @param request
+	 * @return
+	 * @throws Exception
+	 */
+	private static Response sendHttpUriRequest(HttpRequestBase request) throws Exception {
+		//采用绕过验证的方式处理https请求  
+	    SSLContext sslcontext = createIgnoreVerifySSL();  
+	      
+	    // 设置协议http和https对应的处理socket链接工厂的对象  
+	    Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()  
+           .register("http", PlainConnectionSocketFactory.INSTANCE)  
+           .register("https", new SSLConnectionSocketFactory(sslcontext))  
+           .build();  
+       	PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);  
+       	HttpClients.custom().setConnectionManager(connManager);  
+       	
+       	//创建自定义的httpclient对象  
+        CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connManager).build();
+		//CloseableHttpClient httpClient = HttpClients.createDefault();
+		CloseableHttpResponse response = null;
+		try {
+			response = httpClient.execute(request);
+			return Response.getResponse(response);
+		} finally {
+			try {
+				httpClient.close();
+			} catch (IOException e) {
+			}
+			if (response != null) {
+				try {
+					response.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+	}
+
+	/**
+	 * 发起POST、PUT请求
+	 * 
+	 * @param request
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 */
+	private static Response sendHttpEntityEnclosingRequest(HttpEntityEnclosingRequestBase request, Map<String, String> params)
+			throws Exception {
+		//采用绕过验证的方式处理https请求  
+	    SSLContext sslcontext = createIgnoreVerifySSL();  
+	      
+	    // 设置协议http和https对应的处理socket链接工厂的对象  
+	    Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()  
+           .register("http", PlainConnectionSocketFactory.INSTANCE)  
+           .register("https", new SSLConnectionSocketFactory(sslcontext))  
+           .build();  
+       	PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);  
+       	HttpClients.custom().setConnectionManager(connManager);  
+       	
+       	//创建自定义的httpclient对象  
+        CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connManager).build();
+		//CloseableHttpClient httpClient = HttpClients.createDefault();
+		CloseableHttpResponse response = null;
+		try {
+			List<NameValuePair> nvps = new ArrayList<NameValuePair>();
+			if (params != null && !params.isEmpty()) {
+				Set<Entry<String, String>> entrys = params.entrySet();
+				for (Entry<String, String> entry : entrys) {
+					nvps.add(new BasicNameValuePair(entry.getKey(), URLEncoder.encode(entry.getValue(), "UTF-8")));
+				}
+			}
+			request.setEntity(new UrlEncodedFormEntity(nvps));
+			response = httpClient.execute(request);
+			System.out.println(request);
+			return Response.getResponse(response);
+		} finally {
+			request.releaseConnection();
+			try {
+				httpClient.close();
+			} catch (IOException e) {
+			}
+			if (response != null) {
+				try {
+					response.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+	}
+
+	/**
+	 * 发起POST、PUT请求
+	 *
+	 * @param request
+	 * @param datas
+	 * @return
+	 * @throws Exception
+	 */
+	private static Response sendHttpEntityEnclosingRequest(HttpEntityEnclosingRequestBase request, List<?> datas) throws Exception {
+		//采用绕过验证的方式处理https请求
+	    SSLContext sslcontext = createIgnoreVerifySSL();
+
+	    // 设置协议http和https对应的处理socket链接工厂的对象
+	    Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
+           .register("http", PlainConnectionSocketFactory.INSTANCE)
+           .register("https", new SSLConnectionSocketFactory(sslcontext))
+           .build();
+       	PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
+       	HttpClients.custom().setConnectionManager(connManager);
+
+       	//创建自定义的httpclient对象
+        CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connManager).build();
+		//CloseableHttpClient httpClient = HttpClients.createDefault();
+		CloseableHttpResponse response = null;
+		try {
+			if (datas != null && !datas.isEmpty()) {
+				//request.setEntity(new StringEntity(FlexJsonUtil.toJsonArrayDeep(datas), ContentType.create("text/plain", Consts.UTF_8)));
+			}
+			response = httpClient.execute(request);
+			return Response.getResponse(response);
+		} finally {
+			request.releaseConnection();
+			try {
+				httpClient.close();
+			} catch (IOException e) {
+			}
+			if (response != null) {
+				try {
+					response.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+	}
+
+	/**
+	 * 将请求参数添加到链接中
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否签名
+	 * @return
+	 * @throws UnsupportedEncodingException
+	 */
+	public static String getRequestUrl(String url, Map<String, String> params, boolean sign) throws UnsupportedEncodingException {
+		StringBuilder buf = new StringBuilder(url);
+		if (url.indexOf("?") == -1)
+			buf.append("?");
+		else if (!url.endsWith("&"))
+			buf.append("&");
+		// 如果是GET请求,则请求参数在URL中
+		if (params != null && !params.isEmpty()) {
+			Set<Entry<String, String>> entrys = params.entrySet();
+			for (Entry<String, String> entry : entrys) {
+				buf.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), "UTF-8")).append("&");
+			}
+		}
+		if (sign) {
+			// 加时间戳,保持相同请求每次签名均不一样
+			buf.append("_timestamp=").append(System.currentTimeMillis());
+			String message = buf.toString();
+			// 对请求串进行签名
+			buf.append("&_signature=").append(HmacUtils.encode(message));
+		} else
+			buf.deleteCharAt(buf.length() - 1);
+		return buf.toString();
+	}
+
+	/**
+	 * 将请求参数添加到链接中
+	 * 
+	 * @param url
+	 * @param params
+	 * @param sign
+	 *            是否签名
+	 * @param signKey
+	 *            签名密钥
+	 * @return
+	 * @throws UnsupportedEncodingException
+	 */
+	public static String getRequestUrl(String url, Map<String, String> params, boolean sign, String signKey)
+			throws UnsupportedEncodingException {
+		if (sign && signKey == null)
+			return getRequestUrl(url, params, sign);
+		StringBuilder buf = new StringBuilder(url);
+		if (url.indexOf("?") == -1)
+			buf.append("?");
+		else if (!url.endsWith("&"))
+			buf.append("&");
+		// 如果是GET请求,则请求参数在URL中
+		if (params != null && !params.isEmpty()) {
+			Set<Entry<String, String>> entrys = params.entrySet();
+			for (Entry<String, String> entry : entrys) {
+				buf.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), "UTF-8")).append("&");
+			}
+		}
+		if (sign) {
+			// 加时间戳,保持相同请求每次签名均不一样
+			buf.append("_timestamp=").append(System.currentTimeMillis());
+			String message = buf.toString();
+			// 对请求串进行签名
+			buf.append("&_signature=").append(HmacUtils.encode(message, signKey));
+		} else
+			buf.deleteCharAt(buf.length() - 1);
+		return buf.toString();
+	}
+
+	/**
+	 * 将签名信息添加到链接中
+	 * 
+	 * @param url
+	 * @param sign
+	 *            是否签名
+	 * @return
+	 * @throws UnsupportedEncodingException
+	 */
+	private static String getRequestUrl(String url, boolean sign, String signKey) throws UnsupportedEncodingException {
+		return getRequestUrl(url, null, sign, signKey);
+	}
+
+	/**
+	 * 将输入流转为字节数组
+	 * 
+	 * @param inStream
+	 * @return
+	 * @throws Exception
+	 */
+	public static byte[] read2Byte(InputStream inStream) throws Exception {
+		ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
+		byte[] buffer = new byte[1024];
+		int len = 0;
+		while ((len = inStream.read(buffer)) != -1) {
+			outSteam.write(buffer, 0, len);
+		}
+		outSteam.close();
+		inStream.close();
+		return outSteam.toByteArray();
+	}
+
+	/**
+	 * 将输入流转为字符串
+	 * 
+	 * @param inStream
+	 * @return
+	 * @throws Exception
+	 */
+	public static String read2String(InputStream inStream) throws Exception {
+		ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
+		byte[] buffer = new byte[1024];
+		int len = 0;
+		while ((len = inStream.read(buffer)) != -1) {
+			outSteam.write(buffer, 0, len);
+		}
+		try {
+			outSteam.close();
+			inStream.close();
+		} catch (Exception e) {
+
+		}
+		return new String(outSteam.toByteArray(), "UTF-8");
+	}
+
+	/**
+	 * 发送xml数据
+	 * 
+	 * @param path
+	 *            请求地址
+	 * @param xml
+	 *            xml数据
+	 * @param encoding
+	 *            编码
+	 * @return
+	 * @throws Exception
+	 */
+	public static byte[] postXml(String path, String xml, String encoding) throws Exception {
+		byte[] data = xml.getBytes(encoding);
+		URL url = new URL(path);
+		HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+		conn.setRequestMethod("POST");
+		conn.setDoOutput(true);
+		conn.setRequestProperty("Content-Type", "text/xml; charset=" + encoding);
+		conn.setRequestProperty("Content-Length", String.valueOf(data.length));
+		conn.setConnectTimeout(5 * 1000);
+		OutputStream outStream = conn.getOutputStream();
+		outStream.write(data);
+		outStream.flush();
+		outStream.close();
+		if (conn.getResponseCode() == HttpStatus.OK.value()) {
+			return read2Byte(conn.getInputStream());
+		}
+		return null;
+	}
+
+
+	/**
+	 * 下载
+	 * 
+	 * @param postUrl
+	 * @return
+	 * @throws ClientProtocolException
+	 * @throws IOException
+	 * @throws NoSuchAlgorithmException 
+	 * @throws KeyManagementException 
+	 */
+	public static InputStream download(String postUrl) throws ClientProtocolException, IOException, KeyManagementException, NoSuchAlgorithmException {
+		//采用绕过验证的方式处理https请求  
+	    SSLContext sslcontext = createIgnoreVerifySSL();  
+	      
+	    // 设置协议http和https对应的处理socket链接工厂的对象  
+	    Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()  
+           .register("http", PlainConnectionSocketFactory.INSTANCE)  
+           .register("https", new SSLConnectionSocketFactory(sslcontext))  
+           .build();  
+       	PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);  
+       	HttpClients.custom().setConnectionManager(connManager);  
+       	
+       	//创建自定义的httpclient对象  
+        CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connManager).build();
+		//CloseableHttpClient httpClient = HttpClients.createDefault();
+		HttpGet httpGet = new HttpGet(postUrl);
+		CloseableHttpResponse response = httpClient.execute(httpGet);
+		return response.getEntity().getContent();
+	}
+
+	public static class Response {
+		private int statusCode;
+		private String responseText;
+
+		public int getStatusCode() {
+			return statusCode;
+		}
+
+		public void setStatusCode(int statusCode) {
+			this.statusCode = statusCode;
+		}
+
+		public String getResponseText() {
+			return responseText;
+		}
+
+		public void setResponseText(String responseText) {
+			this.responseText = responseText;
+		}
+
+		public Response() {
+		}
+
+		public Response(boolean success, String content) {
+			super();
+			this.statusCode = success ? 200 : 404;
+			this.responseText = content;
+		}
+		
+		public Response(HttpResponse response) throws IllegalStateException, IOException, Exception {
+			this.statusCode = response.getStatusLine().getStatusCode();
+			this.responseText = HttpUtil.read2String(response.getEntity().getContent());
+		}
+
+		public static Response getResponse(HttpResponse response) throws IllegalStateException, IOException, Exception {
+			if (response != null)
+				return new Response(response);
+			return null;
+		}
+	}
+}

+ 13 - 0
frontend/saas-portal-web/package-lock.json

@@ -13059,6 +13059,14 @@
       "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==",
       "dev": true
     },
+    "v-distpicker": {
+      "version": "1.0.20",
+      "resolved": "https://registry.npmjs.org/v-distpicker/-/v-distpicker-1.0.20.tgz",
+      "integrity": "sha512-98YB+Kmh+8kuqfnELOuRVabz9KwoM9q9fVdwqbds3uh/mudiKN6f/IThCQLmSiXa7fQajuCs1I2l0meXreeBTA==",
+      "requires": {
+        "vue": "^2.5.17"
+      }
+    },
     "validate-npm-package-license": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -13240,6 +13248,11 @@
       "integrity": "sha512-x3LV3wdmmERhVCYy3quqA57NJW7F3i6faas++pJQWtknWT+n7k30F4TVdHvCLn48peTJFRvCpxs3UuFPqgeELg==",
       "dev": true
     },
+    "vuex": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz",
+      "integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w=="
+    },
     "w3c-hr-time": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz",

+ 3 - 1
frontend/saas-portal-web/package.json

@@ -15,8 +15,10 @@
   },
   "dependencies": {
     "axios": "^0.18.0",
+    "v-distpicker": "^1.0.20",
     "vue": "^2.5.2",
-    "vue-router": "^3.0.1"
+    "vue-router": "^3.0.1",
+    "vuex": "^3.0.1"
   },
   "devDependencies": {
     "autoprefixer": "^7.1.2",

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

@@ -1,9 +1,10 @@
 <template>
     <div>
+        <span class="tjtishi" ref="tjtishi"></span>
         <div>
-            <div class="gs-worp qy-worp" style="width: 100%">
+            <div class="gs-worp qy-worp tj-up">
                 <div class="qy-title" style="position: relative;">
-                    <span>企业基本信息</span>
+                    <span>完善企业信息</span>
                     <div class="qy-anniu">
                         <span @click= "Preservation" class="qy-xiugai dianji" style="left: 0">保存</span>
                         <span @click= "tjquxiao" class="qy-quxiao xs">取消</span>
@@ -13,32 +14,29 @@
                     <ul>
                         <li>
                             <span class="qy-biaoti"><span class="xingxing">*</span>公司名称</span>
-                            <input type="text">
+                            <input ref="qyname" @input= "spaceName" type="text">
+                            <span ref="qyno" style="color:red"></span>
                         </li>
                         <li>
-                            <span class="qy-biaoti"><span class="xingxing">*</span>营业执照</span>
-                            <input type="text">
+                            <span class="qy-biaoti">所属行业</span>
+                            <select ref="qyindustry" style="width:71%" name="selectAge" id="selectAge">   
+                                <option value="飞飞公司">飞飞公司</option>   
+                                <option value="飞飞公司">飞飞公司</option>   
+                                <option value="飞飞公司">飞飞公司</option>   
+                            </select>
                         </li>
                         <li style="height:60px;">
-                            <span class="qy-biaoti"><span class="xingxing">*</span>注册地址</span>
+                            <span class="qy-biaoti">公司地址</span>
                             <div class="addbiaoqian">
-                                <input type="text">
-                                <input class="qy-xiangxi" type="text" placeholder="输入企业详细地址">
+                                <v-distpicker @province= 'qyprovince'
+                                              @city= 'qycity'
+                                              @area= 'qyarea'
+                                >
+                                </v-distpicker>
+                                <input ref="address" class="qy-xiangxi" type="text" placeholder="输入企业详细地址">
                             </div>
                         </li>
-                        <li>
-                            <span class="qy-biaoti">官方地址</span>
-                            <select style="width:71%" name="selectAge" id="selectAge">   
-                                <option value="1">飞飞公司</option>   
-                                <option value="2">飞飞公司</option>   
-                                <option value="3">飞飞公司</option>   
-                            </select>
-                        </li>
-                        <li>
-                            <span class="qy-biaoti">所属行业</span>
-                            <input type="text">
-                        </li>
-                        <li>
+                        <!-- <li>
                             <span class="qy-biaoti">公司标签</span>
                             <div class="addbiaoqian">
                                 <span v-if= "tjbiaoqian" class="tj-biaoqian">暂无标签</span>
@@ -48,19 +46,26 @@
                                 <input type="text" ref="biaoqian" name="" id="biaoqian" placeholder="请输入小于等于10个字符">
                                 <span @click= "addbiaoqian" class="dianji">添加标签</span>
                             </div>
-                        </li>
+                        </li> -->
                     </ul>
                 </div>
             </div>
-            <div class="gs-worp qy-worp" style="width: 100%">
+            <div class="gs-worp qy-worp tj-down">
                 <div class="qy-title">
-                    <span>管理员信息</span>
+                    <span>完善个人信息</span>
                 </div>
                 <div class="qy-conent">
                     <ul>
-                        <li><span class="qy-biaoti">姓名</span><span>飞飞有限公司</span></li>
-                        <li><span class="qy-biaoti">手机号</span><span>飞飞有限公司</span></li>
-                        <li><span class="qy-biaoti">邮箱</span><input type="text"></li>
+                        <li>
+                            <span class="qy-biaoti"><span class="xingxing">*</span>姓名</span>
+                            <input @input= "yzusername" ref="name" type="text">
+                            <span ref="usname" style="color:red"></span>
+                        </li>
+                        <li><span class="qy-biaoti">手机号</span><span>{{mytoken.account.mobile}}</span></li>
+                        <li>
+                            <span class="qy-biaoti">邮箱</span>
+                            <input ref="email" type="email">
+                        </li>
                     </ul>
                 </div>
             </div>
@@ -69,15 +74,30 @@
 </template>
 
 <script>
+import VDistpicker from 'v-distpicker'
     export default {
         data(){
             return {
                 tjbiaoqian:true,//标签切换
                 biaoqian:[],//标签数组
+                province:'',//省
+                city:'',//市
+                area:'',//区
+                qymingzi: '',
+                mytoken: JSON.parse(localStorage.getItem('app-state-session'))//本地储存的用户信息
             }
         },
+        components:{
+            VDistpicker
+        },
         mounted(){
-
+            this.$ajax.get('../../../static/data.json')
+            .then(res=>{
+                // console.log('请求成功',res.data);
+            })
+            .catch(err=>{
+                // console.log('请求失败',err);
+            });
         },
         methods: {
             //取消添加企业
@@ -85,10 +105,89 @@
                 document.documentElement.scrollTop = 0;
                 this.$router.push({name:'company',}); 
             },
+            //测试企业名称
+            spaceName(){
+                let qyname = this.$refs.qyname.value;//公司名字
+                if(qyname == ''){
+                    this.$refs.qyno.innerHTML = '企业名不能为空';
+                } else {
+                    this.$refs.qyno.innerHTML = '';
+                    this.$ajax.get("http://192.168.253.12:32323/"+`?spaceName=${qyname}`)
+                    .then(res=>{
+                        console.log(res);
+                        this.qymingzi = on;
+                        console.log(this.qymingzi)
+                    })
+                    .catch(err=>{
+                        console.log(err);
+                        this.$refs.qyno.innerHTML = '企业已注册';
+                    })
+                }
+            },
+            //验证个人姓名
+            yzusername(){
+                let name = this.$refs.name.value;//个人姓名
+                if (name == '') {
+                    this.$refs.usname.innerHTML = '姓名不能为空'
+                } else {
+                    this.$refs.usname.innerHTML = ''
+                }
+            },
             //保存
             Preservation(){
-                document.documentElement.scrollTop = 0;
-                this.$router.push({name:'company',}); 
+                let qyname = this.$refs.qyname.value;//公司名字
+                let qyindustry = this.$refs.qyindustry.value;//所属行业
+                let address = this.province+this.city+this.area+this.$refs.address.value;//公司详细地址
+                let name = this.$refs.name.value;//个人姓名
+                let email = this.$refs.email.value;//邮箱
+                // let mobile = this.$store.state.data.mobile;//手机号
+                let mytoken = JSON.parse(localStorage.getItem('app-state-session'));
+                let token = String(mytoken.token);
+                let uu = mytoken.account.uu;
+                let mobile = mytoken.account.mobile;//手机号
+                let company = {'name':qyname,'address':address};
+                let account = {'realname':name,'email':email,'mobile':mobile, 'uu':uu}
+                if (name != '' && qyname != '') {
+                    this.$ajax({
+                        url:"http://192.168.253.31:8560/api/account/accountCenter/companyAccount/save",
+                        method: 'post',
+                        data: {
+                            companyRegDTO:company,
+                            accountRegDTO:account,
+                            type: 0
+                        },
+                        headers: {
+                            "Authorization":token,
+                        }
+                    })
+                    .then(res=>{
+                        console.log("请求成功"+res)
+                        document.documentElement.scrollTop = 0;
+                        // this.$router.push({name:'company', params:{company:company,account:account}});
+                        this.$router.push({name:'company'})
+                    })
+                    .catch(err=>{
+                        console.log("请求失败"+err)
+                    })
+                } else {
+                    this.$refs.tjtishi.innerHTML = '企业名称或姓名不能为空'
+                    setTimeout(() => {
+                        this.$refs.tjtishi.innerHTML = ''
+                    }, 2000);
+                }
+                
+            },
+            //获取省
+            qyprovince(sheng){
+                this.province = sheng.value;
+            },
+            //市
+            qycity(shi){
+                this.city = shi.value;
+            },
+            //区
+            qyarea(qu){
+                this.area = qu.value;
             },
             //添加标签
             addbiaoqian(){
@@ -102,5 +201,34 @@
 </script>
 
 <style scoped>
-
+.tjtishi {
+    color: red;
+    display: block;
+    text-align: center;
+    height: 20px;
+}
+.tj-up {
+    width: 100%;
+    margin-bottom: 0px;
+    border-bottom: 0;
+    padding-bottom: 1px;
+    border-radius: 4px 4px 0 0;
+}
+.tj-up li {
+    margin-bottom: 26px;
+}
+.tj-down {
+    width: 100%;
+    border-top: 0;
+    margin-bottom: 100px;
+}
+.tj-down li {
+    margin-bottom: 26px;
+}
+.tj-down div:nth-child(2) {
+    margin-bottom: 100px;
+}
+.addbiaoqian>>>.distpicker-address-wrapper select {
+    height: 30px;
+}
 </style>

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

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- 遮罩 -->
-    <div class="zhezhao" v-if="showModal"></div>
+    <div class="zhezhao"></div>
     <!-- 设置默认弹窗 -->
     <div class="tanchuang szmoren">
       <div class="over"><img @click="guanbitc" class="right xs" src="/static/img/qiye/chahao.png" alt=""></div>
@@ -56,111 +56,194 @@
       </div>
     </div>
 
-    <div class="gs-qiyebox">
-      <!-- 点击查看企业详情 -->
-      <div v-for="(d , i) in arr " :key="i" class="gs-xiangqing xs">
-        <div class="left gs-xqleft" @click="chakanxq">
-          <div class="gs-lefttext">
-            <p class="gs-qynema"><span>企业名称:</span>{{d.name}}</p>
-            <p><span>管理员:</span>飞飞飞飞</p>
-            <p><span>开通日期:</span>{{d.time}}</p>
-          </div>
-        </div>
-        <div class="right gs-xqright">
-          <div class="gs-border">
-            <span v-if="d.kaitong" class="gs-btn1 dianji">进入服务</span>
-            <span v-else @click="kaitong" class="gs-btn1 kaitong xs">开通服务</span>
-          </div>
-          <div>
-            <span v-if="d.moren" class="gs-btn2 gs-btn3">默认企业</span>
-            <span v-else @click="szmoren" class="gs-btn2 xs">设为默认</span>
-          </div>
+        <div class="gs-qiyebox">
+            <!-- 点击查看企业详情 -->
+            <div v-for="(d , i) in arr " :key="i" class="gs-xiangqing xs">
+                <div class="left gs-xqleft" @click= "chakanxq">
+                    <div class="gs-lefttext">
+                        <p class="gs-qynema"><span>企业名称:</span>{{d.address}}</p>
+                        <p><span>管理员:</span>{{d.name}}</p>
+                        <p v-if= "d.time"><span>开通日期:</span>{{d.time}}</p>
+                    </div>
+                </div>
+                <div class="right gs-xqright">
+                    <div class="gs-border">
+                        <span v-if= "d.saas_" class="gs-btn1 dianji" @click="jinru(d.id)">进入服务</span>
+                        <span v-else @click= "kaitong" class="gs-btn1 kaitong xs">开通服务</span>
+                    </div>
+                    <div>
+                        <span v-if = "d.default_" class="gs-btn2 gs-btn3">默认企业</span>
+                        <span v-else @click="szmoren(i)" class="gs-btn2 xs">设为默认</span>
+                        
+                    </div>
+                </div>
+            </div>
+            <div class="gs-xiangqing dotted">
+                <p class="gs-tianja">
+                    <span @click= "tianjia"><router-link to="/addenterprise">+添加企业</router-link></span>
+                </p>
+            </div>
         </div>
       </div>
-      <div class="gs-xiangqing dotted">
+      <!-- <div class="gs-xiangqing dotted">
         <p class="gs-tianja">
           <span @click="tianjia"><router-link to="/addenterprise">+添加企业</router-link></span>
         </p>
-      </div>
-    </div>
-  </div>
+      </div> -->
+    <!-- </div>
+  </div> -->
 </template>
 
 <script>
-  export default {
-    data() {
-      return {
-        showModal: false,
-        biaoqian: [],//标签数组
-        ktsass: true,//开通sass
-        moren: true,//开通默认
-        arr: [
-          {name: "公司", time: "2018年11月20", kaitong: true, moren: true},
-          {name: "df公司", time: "2018年11月23", kaitong: false, moren: false},
-          {name: "fdf公司", time: "2018年11月24", kaitong: true, moren: false},
-        ]
-      }
-    },
-    mounted() {
-      this.boxheight();
-    },
-    methods: {
-      //没有内容也要有一定的高度
-      boxheight() {
-        let H = $(".gs-qiyebox").height();
-        if (H <= 500) {
-          $(".gs-qiyebox").css("height", '500px')
-        } else {
-          $(".gs-qiyebox").css("height", '')
+    export default {
+        data(){
+            return {
+                biaoqian: [],//标签数组
+                index:0,
+                ktsass: true,//开通sass
+                moren: true,//开通默认
+                comdata: this.$store.state.data,//登录成功后的本地数据
+                mytoken: JSON.parse(localStorage.getItem('app-state-session')),//本地储存的用户信息
+                arr: []//企业列表信息
+            }
+        },
+        mounted(){
+            this.boxheight();
+            // console.log("我是子路由的"+this.comdata)
+            this.addqy();
+            let mytoken = JSON.parse(localStorage.getItem('app-state-session'));
+            let token = String(mytoken.token);
+            // console.log(mytoken.account)
+            this.$ajax({
+                    url:"http://192.168.253.31:8560/api/account/accountCenter/company/list",
+                    method: 'get',
+                    params: {
+                        mobile: mytoken.account.mobile
+                    },
+                    headers: {
+                        "Authorization":token,
+                        "Content-Type":"application/x-www-form-urlencoded"
+                    }
+                })
+                .then(res=>{
+                    this.arr = res.data.data
+                    // console.log(res.data.data)
+                })
+                .catch(err=>{
+                    console.log("请求失败",err)
+                })
+        },
+        methods: {
+            //设置默认弹窗
+            szmoren(i){
+                this.index = i;
+                $(".szmoren").css("display","block");
+                $(".zhezhao").css("display","block");
+            },
+            //确认默认
+            addmoren(){
+                let i = this.index;
+                let token = this.mytoken.token;
+                this.$ajax({
+                    url:'http://192.168.253.31:8560/api/account/accountCenter/bind/defaultCompany',
+                    method: 'post',
+                    data:{
+                        companyId: this.arr[i].id,
+                        accountId: this.mytoken.account.id
+                    },
+                    headers: {
+                        "Authorization":token,
+                        // "Content-Type":'application/x-www-form-urlencoded'
+                    }
+                })
+                .then(res=>{
+                    // console.log('请求成功',res);
+                    this.moren = false;
+                })
+                .catch(err=>{
+                    console.log('请求失败',err);
+                });
+                
+            },
+            //进入服务
+            jinru(id){
+                let token = this.mytoken.token;
+                const frame = window.frames[window.frames.length - 1];
+                this.$ajax({
+                    url: 'http://192.168.253.31:8560/api/auth/switch/company?companyId='+id,
+                    method :'get',
+                    headers: {
+                        "Authorization":token,
+                    }
+                })
+                .then(res=>{
+                    let mytoken = res.data.data.token;
+                    let session=JSON.parse(localStorage.getItem('app-state-session'));
+                    session.account.companyId=id;
+                    session.span = session.timestamp - new Date().getTime();
+                    session.token=mytoken;
+                    debugger
+                    localStorage.setItem('app-state-session',JSON.stringify(session));
+                    frame.postMessage(JSON.stringify(session), '*');
+                    // window.location.href = 'http://192.168.0.181';
+                    // console.log('请求成功',res)
+                })
+                .catch(err=>{
+                    console.log('请求失败',err)
+                })
+            
+            },
+            //开通sass
+            kaitong(){
+                $(".ktsass").css('display','block');
+                $(".zhezhao").css("display","block");
+                this.ktsass = true;
+            },
+            addsass(){//确认sass
+                this.ktsass = false;
+            },
+            //进入服务
+            offfuwu(){
+                $(".ktsass").css('display','none');
+                $(".zhezhao").css("display","none");
+            },
+            //查看企业详情
+            chakanxq(){
+                document.documentElement.scrollTop = 0;
+                this.$router.push({name:'details',});
+            },
+             //添加企业
+            tianjia(){
+                document.documentElement.scrollTop = 0;
+            },
+            addqy(){
+
+            },
+             //添加企业标签
+            addbiaoqian(){
+                this.biaoqian.push(this.$refs.biaoqian.value)
+                this.tjbiaoqian = false;
+            },
+            //关闭弹窗
+            guanbitc(){
+                $(".tanchuang").css("display","none");
+                $(".zhezhao").css("display","none");
+            },
+            //没有内容也要有一定的高度
+            boxheight(){
+                let H = $(".gs-qiyebox").height();
+                if (H <= 500) {
+                    $(".gs-qiyebox").css("height",'500px')
+                } else {
+                    $(".gs-qiyebox").css("height",'')
+                }
+            },
         }
-      },
-      //添加企业
-      tianjia() {
-        document.documentElement.scrollTop = 0;
-      },
-      //添加企业标签
-      addbiaoqian() {
-        this.biaoqian.push(this.$refs.biaoqian.value)
-        this.tjbiaoqian = false;
-      },
-      //关闭弹窗
-      guanbitc() {
-        $(".tanchuang").css("display", "none");
-        this.showModal = false
-      },
-      //设置默认弹窗
-      szmoren() {
-        $(".szmoren").css("display", "block");
-        $(".zhezhao").css("display", "block");
-        this.showModal = true
-      },
-      //确认默认
-      addmoren() {
-        this.moren = false;
-      },
-      //开通sass
-      kaitong() {
-        $(".ktsass").css('display', 'block');
-        $(".zhezhao").css("display", "block");
-        this.ktsass = true;
-      },
-      addsass() {//确认sass
-        this.ktsass = false;
-      },
-      //进入服务
-      offfuwu() {
-        $(".ktsass").css('display', 'none');
-        $(".zhezhao").css("display", "none");
-      },
-      //查看企业详情
-      chakanxq() {
-        document.documentElement.scrollTop = 0;
-        this.$router.push({name: 'details',});
-      }
     }
-  }
 </script>
 
 <style scoped>
-
+.zhezhao {
+    display: none;
+}
 </style>

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

@@ -22,12 +22,11 @@
                     <li><a href="#"><span>特色</span></a></li>
                     <!-- <li><router-link to="/enterprise"><a href="#"><span>特色</span></a></router-link></li> -->
                     <li><a href="#"><span>功能</span></a></li>
-                    <li><a href="#"><span>帮助中心</span></a></li>
-                    <li><a href="#"><span>联系我们</span></a></li>
-                    <!-- <li class="login">
-                        <span class="btn1"><img src="../../../static/img/assets/denglu3x.png" alt="">登录  &nbsp;</span>
-                        <span class="register"><img src="../../../static/img/assets/zhuce3x.png" alt="">注册</span>
-                    </li> -->
+                    <li><a href="https://uas.usoftchina.com/about" target="_blank"><span>关于我们</span></a></li>
+                    <li>
+                        <a href="#"><span class="">{{mytoken.realname}}</span></a>
+                        <a href=""><span class="">账户中心</span></a>
+                    </li>
                 </ul>
             </div>
         </div>
@@ -56,16 +55,16 @@
                         <div class="left gr-right">
                             <ul>
                                 <li>
-                                    <span>用户名</span><span>分分分你</span>
+                                    <span>姓名</span><span>{{mytoken.realname}}</span>
                                 </li>
                                 <li>
-                                    <span>UU号</span><span>分分分你</span>
+                                    <span>UU号</span><span>{{mytoken.uu}}</span>
                                 </li>
                                 <li>
-                                    <span>邮箱</span><span>分分分你</span>
+                                    <span>邮箱</span><span>{{mytoken.email}}</span>
                                 </li>
                                 <li>
-                                    <span>手机号</span><span>分分分你</span>
+                                    <span>手机号</span><span>{{mytoken.mobile}}</span>
                                 </li>
                             </ul>
                         </div>
@@ -110,7 +109,8 @@
             return{
                 nowindex: 0,//tab切换
                 tianjiaqiye: true,//添加企业切换
-                mydata: this.$route.query.mydata,
+                mytoken: JSON.parse(localStorage.getItem('app-state-session')).account,//本地储存的用户信息
+                mydata: this.$route.query.mydata,//登录成功传递的数据
                 tab: [
                     {name: '企业信息'},
                     {name: '个人信息'},
@@ -119,7 +119,8 @@
             }
         },
         mounted(){
-            console.log(this.mydata)
+            // console.log("我是父路由的"+this.mydata);
+            // console.log(this.mydata)
         },
         components: {
             

+ 31 - 19
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -1,21 +1,21 @@
 <template>
-  <div>
-    <div id="navigation" class="navbar-inverse navbar-fixed-top animated-header">
-      <div class="container">
-        <div class="navbar-header">
-          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
-            <span class="sr-only">Toggle navigation</span>
-            <span class="icon-bar"></span>
-            <span class="icon-bar"></span>
-            <span class="icon-bar"></span>
-          </button>
-          <h1 class="navbar-brand">
-            <a href="#">
-              <img class="logo-img" src="/static/img/assets/dalogo3x.png" alt="">
-            </a>
-          </h1>
-        </div>
-        <div class="collapse navbar-collapse navbar-right" role="navigation">
+    <div>
+		<div id="navigation" class="navbar-inverse navbar-fixed-top animated-header" style="padding: 3px;">
+        <div class="container">
+            <div class="navbar-header">
+                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+                    <span class="sr-only">Toggle navigation</span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </button>
+                <h1 class="navbar-brand">
+                    <a href="#">
+                        <img class="logo-img" src="/static/img/assets/dalogo3x.png" alt="">
+                    </a>
+                </h1>
+            </div>
+            <div class="collapse navbar-collapse navbar-right" role="navigation">
           <ul id="nav" class="nav navbar-nav menu">
             <li><a href="#"><span>首页</span></a></li>
             <!-- <li><a href="#feature"><span>特色</span></a></li> -->
@@ -38,7 +38,8 @@
             </li>
           </ul>
         </div>
-      </div>
+        </div>
+        
     </div>
 
 
@@ -53,6 +54,7 @@
         <iframe width="430" height="440" :src="ssoPage"></iframe>
         <iframe hidden :src="setTokenPage"></iframe>
       </div>
+
       <!--Home Slider==================================== -->
       <section id="home-slider">
         <div id="slider" class="sl-slider-wrapper">
@@ -67,6 +69,7 @@
               <!-- 首页内容 -->
               <div class="my-text">
                 <button class='my-tiyan'>立即体验</button>
+
               </div>
               <div class="slide-caption">
                 <div class="caption-content"></div>
@@ -385,5 +388,14 @@
 </script>
 
 <style scoped>
-
+.tc-guanbi {
+	cursor: pointer;
+}
+.tiyan {
+	display: none;
+	width: 400px;
+	height: 200px;
+	margin-left: -200px;
+    margin-top: -100px;
+}
 </style>

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

@@ -11,11 +11,9 @@
                 <div class="qy-conent">
                     <ul>
                         <li><span class="qy-biaoti">公司名称</span><span>飞飞有限公司</span></li>
-                        <li><span class="qy-biaoti">营业执照号</span><span>飞飞有限公司</span></li>
-                        <li><span class="qy-biaoti">注册地址</span><span>飞飞有限公司</span></li>
-                        <li><span class="qy-biaoti">官方地址</span><span>飞飞有限公司</span></li>
                         <li><span class="qy-biaoti">所属行业</span><span>飞飞有限公司</span></li>
-                        <li><span class="qy-biaoti">营业范围</span><span class="qy-biaoqian">飞飞标签</span><span class="qy-biaoqian">飞飞标签</span></li>
+                        <li><span class="qy-biaoti">公司地址</span><span>飞飞有限公司</span></li>
+                        <!-- <li><span class="qy-biaoti">营业范围</span><span class="qy-biaoqian">飞飞标签</span><span class="qy-biaoqian">飞飞标签</span></li> -->
                     </ul>
                 </div>
             </div>
@@ -26,7 +24,7 @@
                 <div class="qy-conent">
                     <ul>
                         <li><span class="qy-biaoti">姓名</span><span>飞飞有限公司</span></li>
-                        <li><span class="qy-biaoti">手机号</span><span>飞飞有限公司</span></li>
+                        <li><span class="qy-biaoti">手机号</span><span>1588888888888</span></li>
                         <li><span class="qy-biaoti">邮箱</span><span>飞飞有限公司</span></li>
                     </ul>
                 </div>
@@ -49,16 +47,16 @@
                             <span>飞飞有限公司</span>
                         </li>
                         <li>
-                            <span class="qy-biaoti"><span class="xingxing">*</span>营业执照</span>
+                            <span class="qy-biaoti">所属行业</span>
                             <span>飞飞有限公司</span>
                         </li>
-                        <li style="height:60px;">
-                            <span class="qy-biaoti"><span class="xingxing">*</span>注册地址</span>
+                        <li>
+                            <span class="qy-biaoti">公司地址</span>
                             <span>飞飞有限公司</span>
                         </li>
-                        <li>
-                            <span class="qy-biaoti">官方地址</span>
-                            <input type="text">
+                        <!-- <li style="height:60px;">
+                            <span class="qy-biaoti"><span class="xingxing">*</span>注册地址</span>
+                            <span>飞飞有限公司</span>
                         </li>
                         <li>
                             <span class="qy-biaoti">所属行业</span>
@@ -77,11 +75,7 @@
                                     <input style="100%" type="text" placeholder="飞飞公司" />
                                 </div>
                             </div>
-                            <!-- <div class="tj-gsbiaoqian">
-                                <input type="text" ref="biaoqian" name="" id="biaoqian" placeholder="请输入小于等于10个字符">
-                                <span @click= "addbiaoqian" class="dianji">添加标签</span>
-                            </div> -->
-                        </li>
+                        </li> -->
                     </ul>
                 </div>
             </div>
@@ -121,7 +115,6 @@
             xiugaiqiye(){
                 document.documentElement.scrollTop = 0;
                 this.xiugai = false;
-                // this.$router.push({name:'modify'});
             },
             // 取消修改
             quxiaoxiugai(){

+ 0 - 301
frontend/saas-portal-web/src/components/conenter/sanjiliandong.vue

@@ -1,301 +0,0 @@
-<template>  
-    <div class="submit">      
-        <div class="dialog-mask"></div>      
-        <div class="dialog-box">        
-            <div class="dialog-box__top">          
-                <h5 class="title bg__white">提交</h5>          
-                <span class="el-icon-close button button__close" @click="close_()"></span>        
-            </div>        
-                <div class="dialog-box__content">          
-                    <div class="dialog-box__content_title clearfix">            
-                        <div><span class="gray_font">审批处理人:</span><span class="black_font">{{lastAprOpinion.createdBy}}</span></div>            
-                        <div><span class="gray_font">审批结论:</span><span class="black_font">{{lastAprOpinion.opinionResultCode}}</span></div>            
-                        <div><span class="gray_font">否决原因:</span><span class="black_font">{{lastAprOpinion.rejectReasonCode}}</span></div>            
-                        <div><span class="gray_font ">备注:</span><span class="black_font">{{lastAprOpinion.opinionTxt}}</span></div>            
-                        <div><span class="gray_font">提交时间:</span><span class="black_font margin_right">{{lastAprOpinion.createdDate}}</span><span class="black_font">{{lastAprOpinion.createdDate}}</span></div>          
-                </div>          
-                <div class="product-content-title">            
-                    <div>              
-                        <span class="blue_boder"></span>审批结果            
-                    </div>            
-                    <div>              
-                        <el-radio-group v-model="submitResults">                
-                            <el-radio :label="0">同意</el-radio>                
-                            <el-radio :label="1">否定</el-radio>              
-                            </el-radio-group>            
-                    </div>            
-                    <div class="product-content-title_deny" v-show="submitResults">              
-                        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="top" label-width="100px" class="demo-ruleForm" hide-required-asterisk>                
-                            <el-form-item label="否定类型" prop="region" class="negation">                  
-                                <el-select class="form__select" v-model="ruleForm.region" placeholder="请选择" @change="changeValueB">                    
-                                    <el-option  v-for="item in patchClassCode"                  
-                                    :key="item.configCode"                  
-                                    :label="item.configTitle"                  
-                                    :value="item.configCode">
-                                    </el-option>                  
-                                </el-select>                
-                            </el-form-item>                
-                            <el-form-item label="否决原因" prop="desc" class="cause">                  
-                                <el-select class="form__select" v-model="ruleForm.desc" placeholder="请选择" @change="getRejectReasonCode">                    
-                                    <el-option  v-for="item in patchClassCodeB"                  
-                                    :key="item.configCode"                  
-                                    :label="item.configTitle"                  
-                                    :value="item.configCode">
-                                    </el-option>                  
-                                </el-select>               
-                            </el-form-item>              
-                        </el-form>            
-                    </div>            
-                    <span class="blue_boder"></span>            
-                    备注          
-                </div>          
-                <textarea v-model="lastAprOpinion.opinionTxt" onkeyup="this.value = this.value.substring(0,200)"></textarea>        
-            </div>        
-            <el-button type="primary" @click="alert_submitB()">提交</el-button>      
-        </div>      
-        <!-- 提交否决弹窗 -->      
-        <submitB v-if="alertSubmitB" @clsoe_windowAlert='close_submitB' @close_AB='close_AB' :submitResults="submitResults" :submitOper="submitOper" :opinionTxt="lastAprOpinion.opinionTxt" :rejectReasonCode="rejectReasonCode"/>  
-    </div>
-</template>
-<script>
-    // import submitB from "../submitB"; 
-    // 提交否决弹窗import {aprAudApi} from "../../js/server.js";  
-    export default {    
-        data() {      
-            return {        
-                lastAprOpinion: [],        
-                patchClassCode: [],        
-                patchClassCodeB: [],        
-                rejectReasonCode: [],        
-                valueA: '',        
-                valueB: '',        
-                indexNum: 0,        
-                submitResults: 0,        
-                alertSubmitB: false,        
-                submitOper: [],        
-                ruleForm: {          
-                    region: '',          
-                    desc: ''        
-                },        
-                rules: {          
-                    region: [            
-                        { required: true, 
-                            message: '否定类型不能为空', 
-                            trigger: 'change' 
-                        }          
-                    ],          
-                    desc: [            
-                            { required: true, 
-                            message: '否决原因不能为空', 
-                            trigger: 'change' 
-                            }          
-                        ]        
-                    }      
-                };    
-            },    
-            computed: {      
-                sendOpinionResultCode() {        
-                    if (this.submitResults) {          
-                        return 'D';        
-                    } else {          
-                        return 'P';        
-                    }      
-                }    
-            },    
-            methods: {      
-                getRejectReasonCode() {        
-                    this.rejectReasonCode.splice(0, 1, this.ruleForm.desc);        
-                    console.log(this.rejectReasonCode);      
-                },      
-                changeValueB() {        
-                    this.ruleForm.desc = '';        
-                    for (let i = 0; i < this.patchClassCode.length; i++) {          
-                        if (this.patchClassCode[i].configCode === this.ruleForm.region) {            
-                            this.indexNum = i;            
-                            break;          
-                        }        
-                    }        
-                    this.patchClassCodeB = this.patchClassCode[this.indexNum].childList;      
-                },      
-                getReason(data) {        
-                    return new Promise((resolve, reject) => {          
-                        this.$MyFetch.get(aprAudApi.taskDetail.OperationConfig, data)          
-                        .then((data = {}) => {            
-                            resolve(data);          
-                        })          
-                        .catch(err => {            
-                            console.log(err);          
-                        });        
-                    });      
-                },      
-                getTreeValue() {        
-                    var query = {          
-                        configType: 'reject_reason'        
-                        };        
-                        this.getReason(query)        
-                        .then((data) => {          
-                            this.patchClassCode = data;          
-                            console.log(this.patchClassCode, '联动数据');        
-                        })        
-                        .catch(err => {          
-                            console.log(err);        
-                        });      
-                },      
-                            
-                submitdata() {         
-                    let data = {            
-                        "opinionResultCode": this.sendOpinionResultCode,            
-                        "opinionTxt": this.lastAprOpinion.opinionTxt,            
-                        "rejectReasonCode": this.rejectReasonCode          
-                    };          
-                    this.$MyFetch.post(`${aprAudApi.taskDetail.submitOper}/${this.$route.params.id}`, data)          
-                    .then((data = {}) => {            
-                        this.submitOper = data;            
-                        console.log(this.submitOper, '一次提交成功');          
-                        })          
-                    .catch(err => {            
-                        console.log('提交失败', err);          
-                        });      
-                },      
-                close_AB() {        
-                    this.close_();        
-                    this.alertSubmitB = false;      
-                },      
-                close_() {        
-                    this.$emit("clsoe_windowAlert");      
-                },      
-                alert_submitB() {        
-                    if (this.submitResults) {          
-                        this.$refs['ruleForm'].validate((valid) => {          
-                            if (valid) {            
-                                this.submitdata();            
-                                this.alertSubmitB = true;          
-                            } else {            
-                                console.log('error submit!!');            
-                                return false;          
-                            }        
-                        });                
-                        //  let data = {                
-                            //   "opinionResultCode": 'D',                
-                            //   "opinionTxt": this.lastAprOpinion.opinionTxt,                
-                            //   "rejectReasonCode": [this.lastAprOpinion.rejectReasonCode]               
-                            // };                
-                            // this.$MyFetch.post(`${aprAudApi.taskDetail.submitOper}/${this.$route.params.id}`, data)                
-                            // .then((data = {}) => {                
-                                //   console.log(data, '提交表格数据');                
-                                // })                
-                            // .catch(err => {                
-                                //   console.log('提交失败', err.code);                
-                                // });                
-                                // this.$options.methods.close_();              
-                                // } else {                
-                                //     this.submitdata();                
-                                // let data = {                
-                                    //   "opinionResultCode": 'P',                
-                                    //   "opinionTxt": this.lastAprOpinion.opinionTxt,                
-                                    //   "rejectReasonCode": [this.lastAprOpinion.rejectReasonCode]                
-                                    // };                
-                                    // this.$MyFetch.post(`${aprAudApi.taskDetail.submitOper}/${this.$route.params.id}`, data)                
-                                    // .then((data = {}) => {                
-                                        //   console.log(data, '提交表格数据');                
-                                        // })                
-                                        // .catch(err => {                
-                                            //   console.log('提交失败', err.code);                
-                                            // });                
-                                            this.alertSubmitB = true;              
-                                            }        
-                                            console.log(this.submitResults);      
-                                            },      
-                                            close_submitB() {        
-                                                this.alertSubmitB = false;      
-                                                }    
-                                            },    
-                                            created() {       
-                                                this.$MyFetch.get(`${aprAudApi.taskDetail.submitPage}/${this.$route.params.id}`)        
-                                                .then((data = {}) => {          
-                                                    this.lastAprOpinion = data.lastAprOpinion;          
-                                                    // console.log(data, '进来就有');        
-                                                    })        
-                                                    .catch(err => {          
-                                                        console.log(err);        
-                                                    });        
-                                                    this.getTreeValue();    
-                                                    },    
-                                                    components: {      
-                                                        submitB    
-                                                        }  
-                                                    };
-</script>
-
-<style lang="less" scoped>  
-.submit{    
-    .dialog-box{      
-        font-size: 14px;      
-        line-height: 20px;      
-        width: 946px;      
-        height: 706px;      
-        .el-button {          
-            width: 200px;          
-            height: 40px;        
-        }      
-        .black_font{        
-            color: #151515;      
-        }      
-        .gray_font{        
-            color: #999999;      
-        }      
-        .dialog-box__top{       
-             box-shadow: 0 1px 6px 0 rgba(239,239,239,0.74);        
-             .title{          
-                 font-weight: bold;  
-            }      
-        }     
-        .dialog-box__content{        
-            max-height: 470px;       
-            overflow: auto;        
-            margin: 30px;        
-        .dialog-box__content_title{          
-            border-bottom: 1px solid #E5E5E5;          
-            > div {            
-                float: left;            
-                margin: 0 80px 20px 0;            
-        .margin_right{   
-            margin-right: 10px;            
-            }          
-        }       
-        }       
-        .blue_boder{            
-            border: 1px solid #538BF1;            
-            margin-right: 10px;          
-        }        
-        .product-content-title{          
-            font-size: 14px;          
-            color: #333333;         
-            text-align: left;          
-            line-height: 50px;          
-            .product-content-title_deny{            
-                border: 1px solid #E9E9E9;            
-                box-shadow: 0 2px 6px 0 rgba(0,0,0,0.08);            
-                border-radius: 4px;            
-                padding: 10px;            
-            .negation{             
-                margin-right: 500px;            
-            }            
-            .cause{              
-                .form__select{                
-                    width: 846px;              
-                }            
-            }          
-            }        
-            }        
-            > textarea {          
-                border: 1px solid #E5E5E5;          
-                border-radius: 4px;          
-                resize: none;          
-                width: 850px;          
-                height: 102px;        
-            }      
-            }    
-            }  
-            }
-</style>

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

@@ -17,22 +17,15 @@
 						</ul>
 						<ul>
 							<li><span>公司</span></li>
-							<li><a href="#">关于我们</a></li>
-							<li><a href="#">企业文化</a></li>
-							<li><a href="https://www.usoftchina.com/contact">联系我们</a></li>
+							<li><a href="https://uas.usoftchina.com/about" target="_blank">关于我们</a></li>
+							<!-- <li><a href="#">企业文化</a></li> -->
 						</ul>
-						<!-- <ul>
-							<li><span>闯客网</span></li>
-							<li><a href="https://www.uuzcc.com/article/detail/13260.html">需求发布流程</a></li>
-							<li><a href="https://www.uuzcc.com/article/detail/13457.html">认证流程</a></li>
-							<li><a href="https://www.uuzcc.com/article/detail/13456.html">服务商规则</a></li>
-						</ul> -->
 						<ul>
 							<li><span>产品</span></li>
-							<li><a class="no-link">u企云服</a></li>
-							<li><a class="no-link">u软商城</a></li>
-							<li><a href="#">u智融</a></li>
-							<li><a href="#">u创客</a></li>
+							<li><a href="#">u企云服</a></li>
+							<li><a href="https://mall.usoftchina.com/" target="_blank">u软商城</a></li>
+							<li><a href="https://fin.yitoa-fintech.com/" target="_blank">u智融</a></li>
+							<li><a href="https://zb.usoftchina.com/" target="_blank">u创客</a></li>
 						</ul>
 					</div>
 					
@@ -62,9 +55,9 @@
 		<div class="friend-link">
 			<ul>
 				<li><span>常用链接:</span></li>
-				<li><a href="#">uas官网</a></li>
-				<li><a href="#">u软云</a></li>
-				<li><a href="#">英唐官网</a></li>
+				<li><a href="https://uas.usoftchina.com/" target="_blank">uas官网</a></li>
+				<li><a href="https://www.usoftchina.com/" target="_blank">u软云</a></li>
+				<li><a href="http://www.yitoa.com/" target="_blank">英唐官网</a></li>
 			</ul>
 		</div>
     </div>

+ 3 - 0
frontend/saas-portal-web/src/main.js

@@ -5,7 +5,9 @@ import Vue from 'vue'
 import App from './App'
 import router from './router'
 import Axios from 'axios'
+import store from './store'
 
+Vue.prototype.$ajax = Axios;
 Vue.config.productionTip = false
 
 // 注入url配置
@@ -14,6 +16,7 @@ Vue.prototype.$url = process.env.BASE_URL
 new Vue({
   el: '#app',
   router,
+  store,
   components: { App },
   template: '<App/>'
 })

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

@@ -0,0 +1,14 @@
+import Vue  from 'vue'
+import Vuex from 'vuex'
+Vue.use(Vuex)
+
+export default new Vuex.Store({
+    state:{
+        data: [],
+    },
+    mutations:{
+         setId(state ,  id) {
+             state.id = id   
+         }
+    }
+})

+ 10 - 6
frontend/saas-portal-web/static/css/gongsi.css

@@ -32,7 +32,7 @@
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%); 
-    z-index: 10;
+    z-index: 10001;
     border: 1px solid black;
     padding: 16px;
     text-align: center
@@ -135,9 +135,13 @@
 .gs-xqleft {
     width: 70%;
     height: 100%;
+    position: relative;
 }
 .gs-lefttext {
-    padding: 20px 80px;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-100%,-50%);
 }
 .gs-xqright {
     width: 30%;
@@ -305,8 +309,8 @@
     background: #F4F8FC;
     border-radius: 3px 3px 0 0;
     text-align: center;
-    height: 70px;
-    line-height: 70px;
+    height: 60px;
+    line-height: 60px;
     font-size: 16px;
     font-weight: 600;
 }
@@ -323,11 +327,11 @@
     border-radius: 2px;
 }
 .qy-conent {
-    padding: 50px 0 0 20px;
+    padding: 30px 0 0 20px;
 }
 .qy-conent li{
     list-style: none;
-    margin-bottom: 40px;
+    margin-bottom: 30px;
 }
 .qy-biaoti {
     font-family: PingFangSC-Medium;

+ 6 - 6
frontend/saas-portal-web/static/css/main.css

@@ -80,8 +80,8 @@ main > section {
 }
 .logo-img {
     width: 123px;
-    height: 53px;
-    margin-top: -6px;
+    height: 50px;
+    margin-top: -4px;
 }
 /* 遮罩 */
 .zhezhao {
@@ -92,7 +92,7 @@ main > section {
     width: 100%;
     background: #000;
     opacity: 0.8;
-    z-index: 5;
+    z-index: 10000;
 }
 /* 登录弹窗 */
 /* input {
@@ -137,7 +137,7 @@ main > section {
     left:50%;
     margin-left: -215px;
     margin-top: -220px;
-    z-index: 10;
+    z-index: 10001;
 }
 
 .tc-login {
@@ -322,8 +322,8 @@ main > section {
 /* 首页内容 ..........................................*/
 .my-text {
     position: absolute;
-    top: 448px;
-    left: 100px;
+    top: 70%;
+    left: 7%;
     /* z-index: 5; */
     /* width: 468px;
     height: 300px; */

+ 8 - 8
frontend/saas-portal-web/static/js/mains.js

@@ -144,7 +144,7 @@ $(document).ready(function(){
             $("#navigation").removeClass("animated-header");
         } else {
             $(".navbar-brand a").css("color","inherit");
-            $("#navigation").addClass("animated-header");
+            // $("#navigation").addClass("animated-header");
         }
     });
 
@@ -157,13 +157,13 @@ $(document).ready(function(){
 
     $('#home-slider, #slider, .sl-slider, .sl-content-wrapper').css('height',slideHeight);
 
-    $(window).resize(function(){'use strict',
-        $('#home-slider, #slider, .sl-slider, .sl-content-wrapper').css('height',slideHeight);
-    });
-
-
-
-	$("#works, #testimonial").owlCarousel({
+    // $(window).resize(function(){'use strict',
+    //     $('#home-slider, #slider, .sl-slider, .sl-content-wrapper').css('height',slideHeight);
+    // });
+	
+	
+	
+	$("#works, #testimonial").owlCarousel({	 
 		navigation : true,
 		pagination : false,
 		slideSpeed : 700,

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

@@ -7,7 +7,7 @@ Ext.define('saas.view.core.dbfind.types.EmployeeDbfindTrigger', {
 
     //数据接口
     dataUrl:'/api/document/employee/list',
-    addXtype: 'document-vendor-formpanel',
+    addXtype: 'other-employee',
     addTitle: '人员资料',
     //联想设置
     dbtpls:[{

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

@@ -16,7 +16,7 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
             if(value == 'ALL') {
                 return '1=1';
             }else {
-                return  ' (rd_code like\'%' + value + '%\' '
+                return  ' (rb_code like\'%' + value + '%\' '
                 +' or rb_custcode like \'%'+value+'%\' '
                 +' or rb_custname like \'%'+value+'%\') ';
             }

+ 0 - 2
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanelController.js

@@ -10,8 +10,6 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         dbfinds:[{
-                            from:'pr_detail',to:'pr_detail',
-                        },{
                             from:'pr_code',to:'pd_prodcode',
                         }, {
                             from:'pr_detail',to:'pr_detail'

+ 13 - 0
frontend/saas-web/app/view/stock/otherIn/QueryPanelController.js

@@ -5,6 +5,19 @@ Ext.define('saas.view.stock.otherIn.QueryPanelController', {
     init: function (form) {
         var me = this;
         this.control({
+            // 物料编号
+            'dbfindtrigger[name=pr_detail]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
+                        }],
+                    }) ;   
+
+                }
+            }
         });
     }
 });

+ 13 - 0
frontend/saas-web/app/view/stock/otherOut/QueryPanelController.js

@@ -5,6 +5,19 @@ Ext.define('saas.view.stock.otherOut.QueryPanelController', {
     init: function (form) {
         var me = this;
         this.control({
+            // 物料编号
+            'dbfindtrigger[name=pr_detail]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
+                        }],
+                    }) ;   
+
+                }
+            }
         });
     }
 });