LAPTOP-FO2T5SIU\35838 1 year ago
parent
commit
6a80586fc0

+ 11 - 3
pro-base/src/main/java/com/idea/buyingMore/controller/BuyingMoreController.java

@@ -1,6 +1,7 @@
 package com.idea.buyingMore.controller;
 
 import com.github.pagehelper.PageInfo;
+import com.idea.buyingMore.dto.BuyingMoreDto;
 import com.idea.buyingMore.model.BuyingMore;
 import com.idea.buyingMore.service.BuyingMoreService;
 import com.rockstar.common.base.BaseController;
@@ -55,9 +56,9 @@ public class BuyingMoreController extends BaseController {
 
     @PostMapping(value = "list", produces = {"application/json;charset=UTF-8"})
     @ResponseBody
-    public Object list(Tablepar tablepar, BuyingMore model, DateTrans dt) {
-        PageInfo<BuyingMore> page = modelService.list(tablepar, model, dt);
-        TableSplitResult<BuyingMore> result = new TableSplitResult<BuyingMore>(page.getPageNum(), page.getTotal(), page.getList());
+    public Object list(Tablepar tablepar, BuyingMoreDto model, DateTrans dt) {
+        PageInfo<BuyingMoreDto> page = modelService.list(tablepar, model, dt);
+        TableSplitResult<BuyingMoreDto> result = new TableSplitResult<BuyingMoreDto>(page.getPageNum(), page.getTotal(), page.getList());
         return result;
     }
 
@@ -69,4 +70,11 @@ public class BuyingMoreController extends BaseController {
     }
 
 
+    @ApiOperation(value = "获取合同信息")
+    @PostMapping(value = "getByContractId", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object getByContractId(String contractId){
+        return modelService.getByContractId(contractId);
+    }
+
 }

+ 26 - 0
pro-base/src/main/java/com/idea/buyingMore/dto/BuyingMoreDto.java

@@ -0,0 +1,26 @@
+package com.idea.buyingMore.dto;
+
+import com.idea.buyingMore.model.BuyingMore;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class BuyingMoreDto extends BuyingMore {
+
+    private String createdName;
+
+    /**
+     * 转让前份额
+     */
+    private String transferProportionBeforeStr;
+
+    /**
+     * 转让后份额
+     */
+    private String transferProportionAfterStr;
+
+
+}

+ 18 - 0
pro-base/src/main/java/com/idea/buyingMore/mapper/BuyingMoreExtendMapper.java

@@ -0,0 +1,18 @@
+package com.idea.buyingMore.mapper;
+
+import com.idea.buyingMore.dto.BuyingMoreDto;
+import com.idea.buyingMore.model.BuyingMore;
+import com.idea.buyingMore.model.BuyingMoreExample;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface BuyingMoreExtendMapper {
+
+    List<BuyingMoreDto> listByModel(BuyingMoreDto record);
+
+    String getAllBuyerProportion(String houseId);
+
+
+
+}

+ 17 - 10
pro-base/src/main/java/com/idea/buyingMore/model/BuyingMore.java

@@ -1,5 +1,8 @@
 package com.idea.buyingMore.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
@@ -21,6 +24,8 @@ public class BuyingMore implements Serializable {
 
     private Double actualBuildArea;
 
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date signingDate;
 
     private BigDecimal housePrice;
@@ -29,9 +34,9 @@ public class BuyingMore implements Serializable {
 
     private Double transferProportion;
 
-    private Double transferBuyerProportion;
+    private Double transferBuyerProportionAfter;
 
-    private Double transferCompanyProportion;
+    private Double transferCompanyProportionAfter;
 
     private Double transferPrice;
 
@@ -41,6 +46,8 @@ public class BuyingMore implements Serializable {
 
     private String createdId;
 
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date createdAt;
 
     private Date updatedAt;
@@ -149,20 +156,20 @@ public class BuyingMore implements Serializable {
         this.transferProportion = transferProportion;
     }
 
-    public Double getTransferBuyerProportion() {
-        return transferBuyerProportion;
+    public Double getTransferBuyerProportionAfter() {
+        return transferBuyerProportionAfter;
     }
 
-    public void setTransferBuyerProportion(Double transferBuyerProportion) {
-        this.transferBuyerProportion = transferBuyerProportion;
+    public void setTransferBuyerProportionAfter(Double transferBuyerProportionAfter) {
+        this.transferBuyerProportionAfter = transferBuyerProportionAfter;
     }
 
-    public Double getTransferCompanyProportion() {
-        return transferCompanyProportion;
+    public Double getTransferCompanyProportionAfter() {
+        return transferCompanyProportionAfter;
     }
 
-    public void setTransferCompanyProportion(Double transferCompanyProportion) {
-        this.transferCompanyProportion = transferCompanyProportion;
+    public void setTransferCompanyProportionAfter(Double transferCompanyProportionAfter) {
+        this.transferCompanyProportionAfter = transferCompanyProportionAfter;
     }
 
     public Double getTransferPrice() {

+ 48 - 48
pro-base/src/main/java/com/idea/buyingMore/model/BuyingMoreExample.java

@@ -886,123 +886,123 @@ public class BuyingMoreExample {
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionIsNull() {
-            addCriterion("transfer_buyer_proportion is null");
+        public Criteria andTransferBuyerProportionAfterIsNull() {
+            addCriterion("transfer_buyer_proportion_after is null");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionIsNotNull() {
-            addCriterion("transfer_buyer_proportion is not null");
+        public Criteria andTransferBuyerProportionAfterIsNotNull() {
+            addCriterion("transfer_buyer_proportion_after is not null");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionEqualTo(Double value) {
-            addCriterion("transfer_buyer_proportion =", value, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterEqualTo(Double value) {
+            addCriterion("transfer_buyer_proportion_after =", value, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionNotEqualTo(Double value) {
-            addCriterion("transfer_buyer_proportion <>", value, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterNotEqualTo(Double value) {
+            addCriterion("transfer_buyer_proportion_after <>", value, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionGreaterThan(Double value) {
-            addCriterion("transfer_buyer_proportion >", value, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterGreaterThan(Double value) {
+            addCriterion("transfer_buyer_proportion_after >", value, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionGreaterThanOrEqualTo(Double value) {
-            addCriterion("transfer_buyer_proportion >=", value, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterGreaterThanOrEqualTo(Double value) {
+            addCriterion("transfer_buyer_proportion_after >=", value, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionLessThan(Double value) {
-            addCriterion("transfer_buyer_proportion <", value, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterLessThan(Double value) {
+            addCriterion("transfer_buyer_proportion_after <", value, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionLessThanOrEqualTo(Double value) {
-            addCriterion("transfer_buyer_proportion <=", value, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterLessThanOrEqualTo(Double value) {
+            addCriterion("transfer_buyer_proportion_after <=", value, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionIn(List<Double> values) {
-            addCriterion("transfer_buyer_proportion in", values, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterIn(List<Double> values) {
+            addCriterion("transfer_buyer_proportion_after in", values, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionNotIn(List<Double> values) {
-            addCriterion("transfer_buyer_proportion not in", values, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterNotIn(List<Double> values) {
+            addCriterion("transfer_buyer_proportion_after not in", values, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionBetween(Double value1, Double value2) {
-            addCriterion("transfer_buyer_proportion between", value1, value2, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterBetween(Double value1, Double value2) {
+            addCriterion("transfer_buyer_proportion_after between", value1, value2, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferBuyerProportionNotBetween(Double value1, Double value2) {
-            addCriterion("transfer_buyer_proportion not between", value1, value2, "transferBuyerProportion");
+        public Criteria andTransferBuyerProportionAfterNotBetween(Double value1, Double value2) {
+            addCriterion("transfer_buyer_proportion_after not between", value1, value2, "transferBuyerProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionIsNull() {
-            addCriterion("transfer_company_proportion is null");
+        public Criteria andTransferCompanyProportionAfterIsNull() {
+            addCriterion("transfer_company_proportion_after is null");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionIsNotNull() {
-            addCriterion("transfer_company_proportion is not null");
+        public Criteria andTransferCompanyProportionAfterIsNotNull() {
+            addCriterion("transfer_company_proportion_after is not null");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionEqualTo(Double value) {
-            addCriterion("transfer_company_proportion =", value, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterEqualTo(Double value) {
+            addCriterion("transfer_company_proportion_after =", value, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionNotEqualTo(Double value) {
-            addCriterion("transfer_company_proportion <>", value, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterNotEqualTo(Double value) {
+            addCriterion("transfer_company_proportion_after <>", value, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionGreaterThan(Double value) {
-            addCriterion("transfer_company_proportion >", value, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterGreaterThan(Double value) {
+            addCriterion("transfer_company_proportion_after >", value, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionGreaterThanOrEqualTo(Double value) {
-            addCriterion("transfer_company_proportion >=", value, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterGreaterThanOrEqualTo(Double value) {
+            addCriterion("transfer_company_proportion_after >=", value, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionLessThan(Double value) {
-            addCriterion("transfer_company_proportion <", value, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterLessThan(Double value) {
+            addCriterion("transfer_company_proportion_after <", value, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionLessThanOrEqualTo(Double value) {
-            addCriterion("transfer_company_proportion <=", value, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterLessThanOrEqualTo(Double value) {
+            addCriterion("transfer_company_proportion_after <=", value, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionIn(List<Double> values) {
-            addCriterion("transfer_company_proportion in", values, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterIn(List<Double> values) {
+            addCriterion("transfer_company_proportion_after in", values, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionNotIn(List<Double> values) {
-            addCriterion("transfer_company_proportion not in", values, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterNotIn(List<Double> values) {
+            addCriterion("transfer_company_proportion_after not in", values, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionBetween(Double value1, Double value2) {
-            addCriterion("transfer_company_proportion between", value1, value2, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterBetween(Double value1, Double value2) {
+            addCriterion("transfer_company_proportion_after between", value1, value2, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 
-        public Criteria andTransferCompanyProportionNotBetween(Double value1, Double value2) {
-            addCriterion("transfer_company_proportion not between", value1, value2, "transferCompanyProportion");
+        public Criteria andTransferCompanyProportionAfterNotBetween(Double value1, Double value2) {
+            addCriterion("transfer_company_proportion_after not between", value1, value2, "transferCompanyProportionAfter");
             return (Criteria) this;
         }
 

+ 78 - 7
pro-base/src/main/java/com/idea/buyingMore/service/BuyingMoreService.java

@@ -1,27 +1,45 @@
 package com.idea.buyingMore.service;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.idea.buyingMore.dto.BuyingMoreDto;
+import com.idea.buyingMore.mapper.BuyingMoreExtendMapper;
 import com.idea.buyingMore.mapper.BuyingMoreMapper;
 import com.idea.buyingMore.model.BuyingMore;
 import com.idea.buyingMore.model.BuyingMoreExample;
+import com.idea.customerManagement.dto.ContractManageDto;
+import com.idea.customerManagement.mapper.ContractManageMapper;
+import com.idea.customerManagement.model.ContractManage;
 import com.idea.util.DateUtils;
 import com.rockstar.common.base.BaseService;
+import com.rockstar.frame.model.FrameUser;
+import com.rockstar.frame.model.FrameUserExample;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.Tablepar;
+import com.rockstar.frame.service.FrameUserService;
 import com.rockstar.shiro.util.ShiroUtils;
 import com.rockstar.util.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
 @Service
 public class BuyingMoreService implements BaseService<BuyingMore, BuyingMoreExample> {
 
+    @Autowired
     private BuyingMoreMapper modelMapper;
+    @Autowired
+    private ContractManageMapper contractManageMapper;
+    @Autowired
+    private FrameUserService frameUserService;
+    @Autowired
+    private BuyingMoreExtendMapper extendMapper;
 
 
     @Override
@@ -87,7 +105,7 @@ public class BuyingMoreService implements BaseService<BuyingMore, BuyingMoreExam
         model.setSerialNumber(serialNumber);
         model.setCreatedId(ShiroUtils.getUserId());
         model.setCreatedAt(new Date());
-        int result = modelMapper.insertSelective(model);
+        int result = insertSelective(model);
         return result;
     }
 
@@ -135,10 +153,10 @@ public class BuyingMoreService implements BaseService<BuyingMore, BuyingMoreExam
         String year = DateUtils.getYear(new Date(), 0);
         String serialNumber = "";
         if (type == 1) {
-            serialNumber = "ZG-" + year + "-" + number;
+            serialNumber = "ZG-" + year + number;
         }
         if (type == 2) {
-            serialNumber = "HG-" + year + "-" + number;
+            serialNumber = "HG-" + year + number;
         }
         return serialNumber;
     }
@@ -148,10 +166,25 @@ public class BuyingMoreService implements BaseService<BuyingMore, BuyingMoreExam
      *
      * @return
      */
-    public PageInfo<BuyingMore> list(Tablepar tablepar, BuyingMore model, DateTrans dt) {
+    public PageInfo<BuyingMoreDto> list(Tablepar tablepar, BuyingMoreDto model, DateTrans dt) {
         PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
-        List<BuyingMore> list = modelMapper.selectByExample(getCondition(model, dt));
-        PageInfo<BuyingMore> pageInfo = new PageInfo<>(list);
+        List<BuyingMoreDto> list = extendMapper.listByModel(model);
+        for(BuyingMoreDto buyingMore : list){
+            // 转让前 买受人占比
+            BigDecimal buyerProportion = new BigDecimal(buyingMore.getBuyerProportion().toString());
+            // 转让前 安居公司占比 100-买房人占比
+            BigDecimal companyProportion = new BigDecimal("100").subtract(buyerProportion);
+            // 转让后 买受人占比
+            Double buyerProportionAfter = buyingMore.getTransferBuyerProportionAfter();
+            // 转让后 安居公司占比
+            Double companyProportionAfter = buyingMore.getTransferCompanyProportionAfter();
+
+            String transferProportionBefore = "买受人" + buyerProportion + "%;" + "安居公司" + companyProportion + "%";
+            String transferProportionAfter = "买受人" + buyerProportionAfter + "%;" + "安居公司" + companyProportionAfter + "%";
+            buyingMore.setTransferProportionBeforeStr(transferProportionBefore);
+            buyingMore.setTransferProportionAfterStr(transferProportionAfter);
+        }
+        PageInfo<BuyingMoreDto> pageInfo = new PageInfo<>(list);
         return pageInfo;
     }
 
@@ -166,7 +199,6 @@ public class BuyingMoreService implements BaseService<BuyingMore, BuyingMoreExam
 
     private BuyingMoreExample getCondition(BuyingMore model, DateTrans dt) {
         BuyingMoreExample ex = new BuyingMoreExample();
-        ex.setOrderByClause("order_num asc");
         BuyingMoreExample.Criteria criteria = ex.createCriteria();
         criteria.andDelFlagEqualTo(0);
         if (StringUtils.isNotEmpty(model.getBuyerName())) {
@@ -178,5 +210,44 @@ public class BuyingMoreService implements BaseService<BuyingMore, BuyingMoreExam
         return ex;
     }
 
+    /**
+     * 根据合同id 查询
+     * @param contractId
+     * @return
+     */
+    public BuyingMoreDto getByContractId(String contractId) {
+
+        ContractManage contractManage = contractManageMapper.selectByPrimaryKey(contractId);
+        BuyingMoreDto result = new BuyingMoreDto();
+        result.setContractId(contractId);
+        result.setHouseId(contractManage.getHouseId());
+        result.setBuyerName(contractManage.getBuyerName());
+        result.setHouseName(contractManage.getHouseName());
+        result.setActualBuildArea(contractManage.getActualBuildArea());
+        result.setSigningDate(contractManage.getSigningDate());
+        result.setHousePrice(contractManage.getHousePrice());
+        // 买受人最新份额占比 = 合同中买受人产权份额占比+已增购的历史记录份额-已回购的历史份额
+        String allBuyerProportion = extendMapper.getAllBuyerProportion(contractManage.getHouseId());
+        BigDecimal baseBuyerProportion = new BigDecimal(contractManage.getBuyerProportion().toString());
+        BigDecimal buyerProportion = baseBuyerProportion.add(new BigDecimal(allBuyerProportion));
+        result.setBuyerProportion(buyerProportion.doubleValue());
+        return result;
+
+    }
+
+    public BuyingMoreDto getById(String id) {
+
+        BuyingMore buyingMore = selectByPrimaryKey(id);
+        String truename = "";
+        FrameUser frameUser = frameUserService.selectByPrimaryKey(buyingMore.getCreatedId());
+        if(ObjectUtil.isNotNull(frameUser)){
+            truename = frameUser.getTruename();
+        }
+        BuyingMoreDto result = new BuyingMoreDto();
+        BeanUtil.copyProperties(buyingMore, result);
+        result.setCreatedName(truename);
+        return result;
+    }
+
 
 }

+ 40 - 0
pro-base/src/main/resources/mybatis/buyingMore/BuyingMoreExtendMapper.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.idea.buyingMore.mapper.BuyingMoreExtendMapper">
+
+  <select id="listByModel" resultType="com.idea.buyingMore.dto.BuyingMoreDto">
+    select b.*,u.truename createdName from buying_more b
+    left join frame_user u on u.id = b.created_id
+    <where>
+        and b.del_flag = 0
+      <if test="buyerName != null and buyerName != ''">
+        and buyer_name like concat('%',#{buyerName},'%')
+      </if>
+      <if test="houseName != null and houseName != ''">
+        and house_name like concat('%',#{houseName},'%')
+      </if>
+      <if test="type != null and type != ''">
+        and type = #{type}
+      </if>
+    </where>
+  </select>
+
+  <select id="getAllBuyerProportion" resultType="java.lang.String">
+    SELECT
+      ( buyingMore - buyingBack )
+    FROM
+      (
+        SELECT
+          IF
+          ( type = 1, sum( buyer_proportion ), 0 ) buyingMore,
+          IF
+          ( type = 2, sum( buyer_proportion ), 0 ) buyingBack
+        FROM
+          buying_more
+        WHERE house_id = #{houseId} and del_flag = 0
+      ) t
+  </select>
+
+
+</mapper>
+

+ 31 - 31
pro-base/src/main/resources/mybatis/buyingMore/BuyingMoreMapper.xml

@@ -14,8 +14,8 @@
     <result column="house_price" jdbcType="DECIMAL" property="housePrice" />
     <result column="buyer_proportion" jdbcType="DOUBLE" property="buyerProportion" />
     <result column="transfer_proportion" jdbcType="DOUBLE" property="transferProportion" />
-    <result column="transfer_buyer_proportion" jdbcType="DOUBLE" property="transferBuyerProportion" />
-    <result column="transfer_company_proportion" jdbcType="DOUBLE" property="transferCompanyProportion" />
+    <result column="transfer_buyer_proportion_after" jdbcType="DOUBLE" property="transferBuyerProportionAfter" />
+    <result column="transfer_company_proportion_after" jdbcType="DOUBLE" property="transferCompanyProportionAfter" />
     <result column="transfer_price" jdbcType="DOUBLE" property="transferPrice" />
     <result column="transfer_money" jdbcType="DECIMAL" property="transferMoney" />
     <result column="registration_date" jdbcType="TIMESTAMP" property="registrationDate" />
@@ -88,9 +88,9 @@
   </sql>
   <sql id="Base_Column_List">
     id, type, serial_number, contract_id, buyer_name, house_id, house_name, actual_build_area,
-    signing_date, house_price, buyer_proportion, transfer_proportion, transfer_buyer_proportion,
-    transfer_company_proportion, transfer_price, transfer_money, registration_date, created_id,
-    created_at, updated_at, updated_id, del_flag
+    signing_date, house_price, buyer_proportion, transfer_proportion, transfer_buyer_proportion_after,
+    transfer_company_proportion_after, transfer_price, transfer_money, registration_date,
+    created_id, created_at, updated_at, updated_id, del_flag
   </sql>
   <sql id="Blob_Column_List">
     file_list
@@ -148,7 +148,7 @@
                              contract_id, buyer_name, house_id,
                              house_name, actual_build_area, signing_date,
                              house_price, buyer_proportion, transfer_proportion,
-                             transfer_buyer_proportion, transfer_company_proportion,
+                             transfer_buyer_proportion_after, transfer_company_proportion_after,
                              transfer_price, transfer_money, registration_date,
                              created_id, created_at, updated_at,
                              updated_id, del_flag, file_list
@@ -157,7 +157,7 @@
             #{contractId,jdbcType=VARCHAR}, #{buyerName,jdbcType=VARCHAR}, #{houseId,jdbcType=VARCHAR},
             #{houseName,jdbcType=VARCHAR}, #{actualBuildArea,jdbcType=DOUBLE}, #{signingDate,jdbcType=TIMESTAMP},
             #{housePrice,jdbcType=DECIMAL}, #{buyerProportion,jdbcType=DOUBLE}, #{transferProportion,jdbcType=DOUBLE},
-            #{transferBuyerProportion,jdbcType=DOUBLE}, #{transferCompanyProportion,jdbcType=DOUBLE},
+            #{transferBuyerProportionAfter,jdbcType=DOUBLE}, #{transferCompanyProportionAfter,jdbcType=DOUBLE},
             #{transferPrice,jdbcType=DOUBLE}, #{transferMoney,jdbcType=DECIMAL}, #{registrationDate,jdbcType=TIMESTAMP},
             #{createdId,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
             #{updatedId,jdbcType=VARCHAR}, #{delFlag,jdbcType=INTEGER}, #{fileList,jdbcType=LONGVARCHAR}
@@ -202,11 +202,11 @@
       <if test="transferProportion != null">
         transfer_proportion,
       </if>
-      <if test="transferBuyerProportion != null">
-        transfer_buyer_proportion,
+      <if test="transferBuyerProportionAfter != null">
+        transfer_buyer_proportion_after,
       </if>
-      <if test="transferCompanyProportion != null">
-        transfer_company_proportion,
+      <if test="transferCompanyProportionAfter != null">
+        transfer_company_proportion_after,
       </if>
       <if test="transferPrice != null">
         transfer_price,
@@ -273,11 +273,11 @@
       <if test="transferProportion != null">
         #{transferProportion,jdbcType=DOUBLE},
       </if>
-      <if test="transferBuyerProportion != null">
-        #{transferBuyerProportion,jdbcType=DOUBLE},
+      <if test="transferBuyerProportionAfter != null">
+        #{transferBuyerProportionAfter,jdbcType=DOUBLE},
       </if>
-      <if test="transferCompanyProportion != null">
-        #{transferCompanyProportion,jdbcType=DOUBLE},
+      <if test="transferCompanyProportionAfter != null">
+        #{transferCompanyProportionAfter,jdbcType=DOUBLE},
       </if>
       <if test="transferPrice != null">
         #{transferPrice,jdbcType=DOUBLE},
@@ -353,11 +353,11 @@
       <if test="record.transferProportion != null">
         transfer_proportion = #{record.transferProportion,jdbcType=DOUBLE},
       </if>
-      <if test="record.transferBuyerProportion != null">
-        transfer_buyer_proportion = #{record.transferBuyerProportion,jdbcType=DOUBLE},
+      <if test="record.transferBuyerProportionAfter != null">
+        transfer_buyer_proportion_after = #{record.transferBuyerProportionAfter,jdbcType=DOUBLE},
       </if>
-      <if test="record.transferCompanyProportion != null">
-        transfer_company_proportion = #{record.transferCompanyProportion,jdbcType=DOUBLE},
+      <if test="record.transferCompanyProportionAfter != null">
+        transfer_company_proportion_after = #{record.transferCompanyProportionAfter,jdbcType=DOUBLE},
       </if>
       <if test="record.transferPrice != null">
         transfer_price = #{record.transferPrice,jdbcType=DOUBLE},
@@ -405,8 +405,8 @@
     house_price = #{record.housePrice,jdbcType=DECIMAL},
     buyer_proportion = #{record.buyerProportion,jdbcType=DOUBLE},
     transfer_proportion = #{record.transferProportion,jdbcType=DOUBLE},
-    transfer_buyer_proportion = #{record.transferBuyerProportion,jdbcType=DOUBLE},
-    transfer_company_proportion = #{record.transferCompanyProportion,jdbcType=DOUBLE},
+    transfer_buyer_proportion_after = #{record.transferBuyerProportionAfter,jdbcType=DOUBLE},
+    transfer_company_proportion_after = #{record.transferCompanyProportionAfter,jdbcType=DOUBLE},
     transfer_price = #{record.transferPrice,jdbcType=DOUBLE},
     transfer_money = #{record.transferMoney,jdbcType=DECIMAL},
     registration_date = #{record.registrationDate,jdbcType=TIMESTAMP},
@@ -434,8 +434,8 @@
     house_price = #{record.housePrice,jdbcType=DECIMAL},
     buyer_proportion = #{record.buyerProportion,jdbcType=DOUBLE},
     transfer_proportion = #{record.transferProportion,jdbcType=DOUBLE},
-    transfer_buyer_proportion = #{record.transferBuyerProportion,jdbcType=DOUBLE},
-    transfer_company_proportion = #{record.transferCompanyProportion,jdbcType=DOUBLE},
+    transfer_buyer_proportion_after = #{record.transferBuyerProportionAfter,jdbcType=DOUBLE},
+    transfer_company_proportion_after = #{record.transferCompanyProportionAfter,jdbcType=DOUBLE},
     transfer_price = #{record.transferPrice,jdbcType=DOUBLE},
     transfer_money = #{record.transferMoney,jdbcType=DECIMAL},
     registration_date = #{record.registrationDate,jdbcType=TIMESTAMP},
@@ -484,11 +484,11 @@
       <if test="transferProportion != null">
         transfer_proportion = #{transferProportion,jdbcType=DOUBLE},
       </if>
-      <if test="transferBuyerProportion != null">
-        transfer_buyer_proportion = #{transferBuyerProportion,jdbcType=DOUBLE},
+      <if test="transferBuyerProportionAfter != null">
+        transfer_buyer_proportion_after = #{transferBuyerProportionAfter,jdbcType=DOUBLE},
       </if>
-      <if test="transferCompanyProportion != null">
-        transfer_company_proportion = #{transferCompanyProportion,jdbcType=DOUBLE},
+      <if test="transferCompanyProportionAfter != null">
+        transfer_company_proportion_after = #{transferCompanyProportionAfter,jdbcType=DOUBLE},
       </if>
       <if test="transferPrice != null">
         transfer_price = #{transferPrice,jdbcType=DOUBLE},
@@ -533,8 +533,8 @@
         house_price = #{housePrice,jdbcType=DECIMAL},
         buyer_proportion = #{buyerProportion,jdbcType=DOUBLE},
         transfer_proportion = #{transferProportion,jdbcType=DOUBLE},
-        transfer_buyer_proportion = #{transferBuyerProportion,jdbcType=DOUBLE},
-        transfer_company_proportion = #{transferCompanyProportion,jdbcType=DOUBLE},
+        transfer_buyer_proportion_after = #{transferBuyerProportionAfter,jdbcType=DOUBLE},
+        transfer_company_proportion_after = #{transferCompanyProportionAfter,jdbcType=DOUBLE},
         transfer_price = #{transferPrice,jdbcType=DOUBLE},
         transfer_money = #{transferMoney,jdbcType=DECIMAL},
         registration_date = #{registrationDate,jdbcType=TIMESTAMP},
@@ -559,8 +559,8 @@
         house_price = #{housePrice,jdbcType=DECIMAL},
         buyer_proportion = #{buyerProportion,jdbcType=DOUBLE},
         transfer_proportion = #{transferProportion,jdbcType=DOUBLE},
-        transfer_buyer_proportion = #{transferBuyerProportion,jdbcType=DOUBLE},
-        transfer_company_proportion = #{transferCompanyProportion,jdbcType=DOUBLE},
+        transfer_buyer_proportion_after = #{transferBuyerProportionAfter,jdbcType=DOUBLE},
+        transfer_company_proportion_after = #{transferCompanyProportionAfter,jdbcType=DOUBLE},
         transfer_price = #{transferPrice,jdbcType=DOUBLE},
         transfer_money = #{transferMoney,jdbcType=DECIMAL},
         registration_date = #{registrationDate,jdbcType=TIMESTAMP},

+ 3 - 3
pro-base/src/main/resources/mybatis/customerManagement/CustomerManagementExtendMapper.xml

@@ -14,13 +14,13 @@
     left join park_floor_disc on park_floor_disc.id = customer_management.disc_id
     <where>
       <if test="buyerName != null and buyerName != ''">
-        and buyer_name like concat ('%',#{buyerName},'%')
+        and customer_management.buyer_name like concat ('%',#{buyerName},'%')
       </if>
       <if test="status != null and status != ''">
-        and status = #{status}
+        and customer_management.status = #{status}
       </if>
       <if test="statusStr != null and statusStr != ''">
-        and status in (${statusStr})
+        and customer_management.status in (${statusStr})
       </if>
       <if test="groupIdList != null">
         and customer_management.group_id in

+ 21 - 0
pro-wx/src/main/java/com/idea/pro/wx/jwt/CaptureException.java

@@ -0,0 +1,21 @@
+package com.idea.pro.wx.jwt;
+
+import com.rockstar.util.ResponseUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+/**
+ * 统一异常处理
+ */
+@Slf4j
+@RestControllerAdvice
+public class CaptureException {
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    @ExceptionHandler(value = LoginCheckException.class)
+    public Object handler(LoginCheckException e) {
+        return ResponseUtil.fail(303, e.getMessage());
+    }
+}

+ 9 - 0
pro-wx/src/main/java/com/idea/pro/wx/jwt/LoginCheck.java

@@ -0,0 +1,9 @@
+package com.idea.pro.wx.jwt;
+
+import java.lang.annotation.*;
+
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface LoginCheck {
+}

+ 12 - 0
pro-wx/src/main/java/com/idea/pro/wx/jwt/LoginCheckException.java

@@ -0,0 +1,12 @@
+package com.idea.pro.wx.jwt;
+
+public class LoginCheckException extends RuntimeException {
+
+    public LoginCheckException(String message) {
+        super(message);
+    }
+
+    public LoginCheckException() {
+        super();
+    }
+}

+ 46 - 0
pro-wx/src/main/java/com/idea/pro/wx/jwt/WxLoginAopVerify.java

@@ -0,0 +1,46 @@
+package com.idea.pro.wx.jwt;
+
+import com.rockstar.util.StringUtils;
+import com.rockstar.wx.util.JwtHelper;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Aspect
+@Component
+public class WxLoginAopVerify {
+
+    @Pointcut("@annotation(com.idea.pro.wx.jwt.LoginCheck)")
+    public void ouAspect() {
+    }
+
+    @Before("ouAspect()")
+    public void beforeMethod(JoinPoint joinPoint) {
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        HttpServletRequest request = attributes.getRequest();
+        String token = request.getHeader("Authorization");
+        System.err.println("tol_:"+token);
+        if(StringUtils.isNotEmpty(token)){
+            if(!token.contains("Bearer"))
+                throw new LoginCheckException("请求令牌不能为空!");
+//            token = token.substring(token.lastIndexOf("Bearer "));
+            token = token.replace("Bearer ", "");
+            System.err.println("token_:"+token);
+            JwtHelper jwtHelper = new JwtHelper();
+            String userId = jwtHelper.verifyTokenAndGetUserId(token);
+            if(!StringUtils.isNotEmpty(userId)){
+                throw new LoginCheckException("您的令牌已过期!");
+            }
+        }else{
+            throw new LoginCheckException("请求令牌不能为空!");
+        }
+
+    }
+
+}

+ 20 - 0
pro-wx/src/main/java/com/idea/pro/wx/pojo/MyInfo.java

@@ -0,0 +1,20 @@
+package com.idea.pro.wx.pojo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class MyInfo {
+
+    @ApiModelProperty(value = "所属部门")
+    private String deptName;
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+    @ApiModelProperty(value = "所属角色")
+    private String roleName;
+    @ApiModelProperty(value = "电话")
+    private String phone;
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+}

+ 16 - 0
pro-wx/src/main/java/com/idea/pro/wx/pojo/PasswordModel.java

@@ -0,0 +1,16 @@
+package com.idea.pro.wx.pojo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class PasswordModel {
+
+    @ApiModelProperty(value = "用户id")
+    private String userId;
+    @ApiModelProperty(value = "原密码")
+    private String oldPassword;
+    @ApiModelProperty(value = "新密码")
+    private String newPassword;
+
+}

+ 12 - 0
pro-wx/src/main/java/com/idea/pro/wx/vo/TreeUserModel.java

@@ -0,0 +1,12 @@
+package com.idea.pro.wx.vo;
+
+import lombok.Data;
+
+@Data
+public class TreeUserModel {
+    private String type;
+    private String id;
+    private String parentid;
+    private String name;
+    private String username;
+}

+ 340 - 0
pro-wx/src/main/java/com/idea/pro/wx/web/WxFrameUserController.java

@@ -0,0 +1,340 @@
+package com.idea.pro.wx.web;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.idea.pro.wx.jwt.LoginCheck;
+import com.idea.pro.wx.pojo.MyInfo;
+import com.idea.pro.wx.pojo.PasswordModel;
+import com.idea.pro.wx.vo.TreeUserModel;
+import com.rockstar.frame.model.FrameRole;
+import com.rockstar.frame.model.FrameUser;
+import com.rockstar.frame.model.FrameUserExample;
+import com.rockstar.frame.service.FrameRoleService;
+import com.rockstar.frame.service.FrameUserService;
+import com.rockstar.system.model.SysDept;
+import com.rockstar.system.model.SysDeptExample;
+import com.rockstar.system.service.SysDeptService;
+import com.rockstar.user.model.UserAccount;
+import com.rockstar.user.model.UserAccountExample;
+import com.rockstar.user.service.UserAccountService;
+import com.rockstar.util.MD5Util;
+import com.rockstar.util.ResponseUtil;
+import com.rockstar.util.SnowflakeIdWorker;
+import com.rockstar.util.StringUtils;
+import io.swagger.annotations.Api;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping(value = "/wx/frameUser")
+@Api(tags = "用户")
+public class WxFrameUserController {
+
+    @Autowired
+    private FrameUserService frameUserService;
+    @Autowired
+    private SysDeptService sysDeptService;
+    @Autowired
+    private FrameRoleService frameRoleService;
+    @Autowired
+    private UserAccountService userAccountService;
+
+    /**
+     * 修改登录密码
+     * @param
+     * @return
+     */
+    @RequestMapping(value="/editPassword", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+    @LoginCheck
+    public Object editPassword(PasswordModel model){
+        FrameUser frameUser = frameUserService.selectByPrimaryKey(model.getUserId());
+        if (!StringUtils.equals(frameUser.getPassword(), MD5Util.encode(MD5Util.encode(model.getOldPassword().trim())))) {
+            return ResponseUtil.fail(202,"原密码输入不正确");
+        }
+        frameUser.setPassword(MD5Util.encode(MD5Util.encode(model.getNewPassword().trim())));
+        frameUser.setUpdatedat(new Date());
+        int userHome =  frameUserService.updateByPrimaryKeySelective(frameUser);
+        if(userHome ==0){
+            return ResponseUtil.fail(203,"修改失败");
+        }
+        return ResponseUtil.ok("修改成功");
+    }
+
+    @RequestMapping(value="/getMyInfo", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+    @LoginCheck
+    public Object getMyInfo(String userId){
+        if(StringUtils.isEmpty(userId)){
+            return ResponseUtil.fail(202,"参数有误");
+        }
+        FrameUser frameUser = frameUserService.selectByPrimaryKey(userId);
+        if (null==frameUser) {
+            return ResponseUtil.fail(202,"用户不存在");
+        }
+        MyInfo myInfo = new MyInfo();
+        myInfo.setUserName(frameUser.getUsername());
+        myInfo.setPhone(frameUser.getPhone());
+        myInfo.setEmail(frameUser.getEmail());
+        if(StringUtils.isNotEmpty(frameUser.getDepartment())){
+            SysDept sysDept = sysDeptService.selectByPrimaryKey(frameUser.getDepartment());
+            myInfo.setDeptName(null!=sysDept?sysDept.getDeptName():"");
+        }
+        List<FrameRole> roleList = frameRoleService.queryUserRole(userId);
+        if(CollectionUtils.isNotEmpty(roleList)){
+            myInfo.setRoleName(roleList.stream().map(FrameRole::getName).collect(Collectors.joining(",")));
+        }
+        return ResponseUtil.ok(myInfo);
+    }
+
+    @RequestMapping(value="/getSelectUser", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+    @LoginCheck
+    public Object getSelectUser(String searchName){
+        JSONObject jsonObject = new JSONObject();
+        SysDept sysDept = sysDeptService.selectByPrimaryKey("0");
+        if(null!=sysDept){
+            jsonObject.put("id", sysDept.getId());
+            jsonObject.put("name", sysDept.getDeptName());
+            FrameUserExample frameUserExample = new FrameUserExample();
+            FrameUserExample.Criteria criteria = frameUserExample.createCriteria();
+            criteria.andDepartmentEqualTo(sysDept.getId()).andStatusEqualTo("1")
+                    .andIdNotEqualTo("1");
+            if(StringUtils.isNotEmpty(searchName)){
+                criteria.andTruenameLike("%"+searchName+"%");
+            }
+            List<FrameUser> frameUserList = frameUserService.selectByExample(frameUserExample);
+            if(CollectionUtils.isNotEmpty(frameUserList)){
+                JSONArray objects = new JSONArray();
+                for (FrameUser frameUser : frameUserList) {
+                    JSONObject jsonObject1 = new JSONObject();
+                    jsonObject1.put("id", frameUser.getId());
+                    jsonObject1.put("name", frameUser.getTruename());
+                    objects.add(jsonObject1);
+                }
+                jsonObject.put("deptUser", objects);
+            }else{
+                jsonObject.put("deptUser", new JSONArray());
+            }
+            jsonObject.put("children", getChildDeptAndUser(sysDept.getId(), searchName));
+        }
+        return ResponseUtil.ok(jsonObject);
+    }
+
+    @RequestMapping(value="/getSelectUserTwo", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+//    @LoginCheck
+    public Object getSelectUserTwo(String searchName){
+        List<SysDept> deptList = sysDeptService.listAll(new SysDept());
+        FrameUserExample userExample = new FrameUserExample();
+        FrameUserExample.Criteria criteria = userExample.createCriteria();
+//        andDelFlagEqualTo("0")
+        criteria.andStatusEqualTo("1").andDepartmentIsNotNull();
+        if(StringUtils.isNotEmpty(searchName))
+            criteria.andTruenameLike("%"+searchName+"%");
+        List<FrameUser> userList = frameUserService.selectByExample(userExample);
+        List<TreeUserModel> resltList = new ArrayList<>();
+        deptList.stream().forEach(dept -> {
+            TreeUserModel dtree = new TreeUserModel();
+            dtree.setType("d");
+            dtree.setId(dept.getId());
+            dtree.setParentid(dept.getParentId());
+            dtree.setName(dept.getDeptName());
+            dtree.setUsername(dept.getDeptName());
+            resltList.add(dtree);
+        });
+        userList.stream().forEach(user -> {
+            TreeUserModel utree = new TreeUserModel();
+            utree.setType("u");
+            utree.setId(user.getId());
+            utree.setParentid(user.getDepartment());
+            utree.setName(user.getTruename());
+            utree.setUsername(user.getTruename());
+            resltList.add(utree);
+        });
+        return ResponseUtil.ok(resltList);
+    }
+
+    private JSONArray getChildDeptAndUser(String id, String searchName) {
+        JSONArray jsonArray = new JSONArray();
+        SysDeptExample sysDeptExample = new SysDeptExample();
+        sysDeptExample.createCriteria().andParentIdEqualTo(id);
+        List<SysDept> sysDeptList = sysDeptService.selectByExample(sysDeptExample);
+        if(CollectionUtils.isNotEmpty(sysDeptList)){
+            for (SysDept sysDept : sysDeptList) {
+                JSONObject jsonObject = new JSONObject();
+                jsonObject.put("id", sysDept.getId());
+                jsonObject.put("name", sysDept.getDeptName());
+                FrameUserExample frameUserExample = new FrameUserExample();
+                FrameUserExample.Criteria criteria = frameUserExample.createCriteria();
+                criteria.andDepartmentEqualTo(sysDept.getId()).andStatusEqualTo("1")
+                        .andIdNotEqualTo("1");
+                if(StringUtils.isNotEmpty(searchName)){
+                    criteria.andTruenameLike("%"+searchName+"%");
+                }
+                List<FrameUser> frameUserList = frameUserService.selectByExample(frameUserExample);
+                if(CollectionUtils.isNotEmpty(frameUserList)){
+                    JSONArray objects = new JSONArray();
+                    for (FrameUser frameUser : frameUserList) {
+                        JSONObject jsonObject1 = new JSONObject();
+                        jsonObject1.put("id", frameUser.getId());
+                        jsonObject1.put("name", frameUser.getTruename());
+                        objects.add(jsonObject1);
+                    }
+                    jsonObject.put("deptUser", objects);
+                }else{
+                    jsonObject.put("deptUser", new JSONArray());
+                }
+                jsonObject.put("children", getChildDeptAndUser(sysDept.getId(), searchName));
+                jsonArray.add(jsonObject);
+            }
+        }
+        return jsonArray;
+    }
+
+    @RequestMapping(value="/getSelectDept", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+    @LoginCheck
+    public Object getSelectDept(String deptName){
+        JSONArray jsonArray = new JSONArray();
+        SysDeptExample example = new SysDeptExample();
+        SysDeptExample.Criteria criteria = example.createCriteria();
+        if(StringUtils.isNotEmpty(deptName)){
+            criteria.andDeptNameLike("%"+deptName+"%");
+        }
+        List<SysDept> sysDeptList = sysDeptService.selectByExample(example);
+        if(CollectionUtils.isNotEmpty(sysDeptList)){
+            for (SysDept sysDept : sysDeptList) {
+                JSONObject jsonObject = new JSONObject();
+                jsonObject.put("id", sysDept.getId());
+                jsonObject.put("name", sysDept.getDeptName());
+                jsonArray.add(jsonObject);
+            }
+        }
+        return ResponseUtil.ok(jsonArray);
+    }
+
+    @RequestMapping(value="/getSelectDeptTwo", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+//    @LoginCheck
+    public Object getSelectDeptTwo(String deptName){
+        List<TreeUserModel> resltList = new ArrayList<>();
+        SysDeptExample example = new SysDeptExample();
+        SysDeptExample.Criteria criteria = example.createCriteria();
+        if(StringUtils.isNotEmpty(deptName)){
+            criteria.andDeptNameLike("%"+deptName+"%");
+        }
+        List<SysDept> sysDeptList = sysDeptService.selectByExample(example);
+        sysDeptList.stream().forEach(dept -> {
+            TreeUserModel dtree = new TreeUserModel();
+            dtree.setType("d");
+            dtree.setId(dept.getId());
+            dtree.setParentid(dept.getParentId());
+            dtree.setName(dept.getDeptName());
+            dtree.setUsername(dept.getDeptName());
+            resltList.add(dtree);
+        });
+        return ResponseUtil.ok(resltList);
+    }
+
+    @RequestMapping(value="/userList", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+    public Object getSelectDeptTwo(FrameUser user){
+        FrameUserExample example = new FrameUserExample();
+        FrameUserExample.Criteria criteria = example.createCriteria();
+        criteria.andIdNotEqualTo("1");
+        if(null!=user&&StringUtils.isNotEmpty(user.getTruename())){
+            criteria.andTruenameLike("%"+user.getTruename()+"%");
+        }
+        if(null!=user&&StringUtils.isNotEmpty(user.getDepartment())){
+            criteria.andDepartmentEqualTo(user.getDepartment());
+        }
+        List<FrameUser> frameUsers = frameUserService.selectByExample(example);
+        return frameUsers;
+    }
+
+//    /**
+//     * 微信用户绑定山水城用户
+//     * @param code
+//     * @param userId
+//     * @return
+//     */
+//    @RequestMapping(value="/bindWxOpenId", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+//    public Object bindWxOpenId(String code, String userId) {
+//
+//        // 获取openId
+//        String openId = WeixinPushUtool.getWeixinUserOpenId(code);
+//
+//        // 判断用户是否已绑定
+//        UserAccountExample userAccountExample = new UserAccountExample();
+//        userAccountExample.createCriteria().andUserIdEqualTo(userId);
+//        List<UserAccount> userAccounts = userAccountService.selectByExample(userAccountExample);
+//        if(CollectionUtils.isNotEmpty(userAccounts)){
+//            return ResponseUtil.fail(-1,"此账号已绑定,请勿重复操作");
+//        }
+//        // 判断openId是否已绑定
+//        userAccountExample = new UserAccountExample();
+//        userAccountExample.createCriteria().andOpenIdEqualTo(openId);
+//        userAccounts = userAccountService.selectByExample(userAccountExample);
+//        if(CollectionUtils.isNotEmpty(userAccounts)){
+//            return ResponseUtil.fail(-1,"此微信号已绑定,请勿重复操作");
+//        }
+//
+//        FrameUser frameUser = frameUserService.selectByPrimaryKey(userId);
+//
+//        UserAccount userAccount = new UserAccount();
+//        userAccount.setId(SnowflakeIdWorker.getUUID());
+//        userAccount.setUserId(userId);
+//        userAccount.setOpenId(openId);
+//        userAccount.setAccount(frameUser.getUsername());
+//        userAccount.setCreatedAt(new Date());
+//
+//        userAccountService.insert(userAccount);
+//        return ResponseUtil.ok();
+//
+//    }
+//
+//    /**
+//     * 微信用户解绑山水城用户
+//     * @param userId
+//     * @return
+//     */
+//    @RequestMapping(value="/unbindWxOpenId", method= RequestMethod.POST,produces = {MediaType.APPLICATION_JSON_VALUE})
+//    public Object unbindWxOpenId(String userId) {
+//
+//        UserAccountExample userAccountExample = new UserAccountExample();
+//        userAccountExample.createCriteria().andUserIdEqualTo(userId);
+//        List<UserAccount> userAccounts = userAccountService.selectByExample(userAccountExample);
+//        if(CollectionUtils.isEmpty(userAccounts)){
+//            return ResponseUtil.fail(-1,"此账号未绑定,无需解绑");
+//        }
+//        UserAccount userAccount = userAccounts.get(0);
+//        userAccountService.deleteByPrimaryKey(userAccount.getId());
+//        return ResponseUtil.ok();
+//
+//    }
+
+
+    /**
+     * 根据用户id获取用户
+     * @param userId
+     * @return
+     */
+    @RequestMapping(value="/getWxUserById", method= RequestMethod.GET,produces = {MediaType.APPLICATION_JSON_VALUE})
+    public Object getWxUserById(String userId) {
+
+        FrameUser frameUser = frameUserService.selectByPrimaryKey(userId);
+        JSONObject newJSONObject = JSONObject.parseObject(JSONObject.toJSONString(frameUser));
+        UserAccountExample userAccountExample = new UserAccountExample();
+        userAccountExample.createCriteria().andUserIdEqualTo(frameUser.getId());
+        List<UserAccount> userAccounts = userAccountService.selectByExample(userAccountExample);
+        if(CollectionUtils.isNotEmpty(userAccounts)){
+            newJSONObject.put("bindFlag","1");
+        }
+        return ResponseUtil.ok(newJSONObject);
+    }
+
+
+}