Ver código fonte

经纪人管理

by su 4 anos atrás
pai
commit
239f2be8ad

+ 34 - 0
house-biz/src/main/java/com/ljq/house/biz/dao/TmBuyingpointDao.java

@@ -0,0 +1,34 @@
+package com.ljq.house.biz.dao;
+
+import com.ljq.house.biz.model.TmBuyingpoint;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ljq.house.biz.model.TmEstate;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 物业特色 Mapper 接口
+ * </p>
+ *
+ * @author anthor
+ * @since 2021-06-03
+ */
+public interface TmBuyingpointDao extends BaseMapper<TmBuyingpoint> {
+
+    public List<TmBuyingpoint> getList(@Param("id") String id);
+
+    public Long countAll();
+
+    public int insert(@Param("cm") TmBuyingpoint tmBuyingpoint);
+
+    public int update(@Param("cm") TmBuyingpoint tmBuyingpoint);
+
+    public int del(@Param("buyingpointId") String buyingpointId);
+
+    public int delEstateId(@Param("estateId") String estateId);
+
+
+
+}

+ 34 - 0
house-biz/src/main/java/com/ljq/house/biz/dao/TmEstateDao.java

@@ -0,0 +1,34 @@
+package com.ljq.house.biz.dao;
+
+import com.ljq.house.biz.model.TmEstate;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ljq.house.biz.vo.request.TmEstateReqVo;
+import com.ljq.house.biz.vo.response.TmEstateRspVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 房源管理 Mapper 接口
+ * </p>
+ *
+ * @author anthor
+ * @since 2021-06-03
+ */
+public interface TmEstateDao extends BaseMapper<TmEstate> {
+
+    public List<TmEstateRspVo> getList(@Param("cm") TmEstateReqVo tmEstateReqVo);
+    public Long countAll();
+
+    public int insert(@Param("cm") TmEstate tmEstate);
+
+    public int update(@Param("cm") TmEstate tmEstate);
+
+    public int del(@Param("estateId") String estateId);
+
+    List<TmEstate> findAgencyEstate(@Param("agencyUserId") String agencyUserId);
+
+    Integer findAgencyNum(@Param("agencyUserId") String agencyUserId);
+
+}

+ 70 - 0
house-biz/src/main/java/com/ljq/house/biz/model/TmBuyingpoint.java

@@ -0,0 +1,70 @@
+package com.ljq.house.biz.model;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 物业特色
+ * </p>
+ *
+ * @author anthor
+ * @since 2021-06-03
+ */
+@Data
+public class TmBuyingpoint extends Model<TmBuyingpoint> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 物业特色id
+     */
+    private String buyingpointId;
+
+    /**
+     * 房源id
+     */
+    private String estateId;
+
+    /**
+     * 房源名称
+     */
+    private String title;
+
+    /**
+     * 物业编号
+     */
+    private String content;
+
+    private String rec_status;
+
+    /**
+     * 创建者id
+     */
+    private String createUserId;
+
+    /**
+     * 创建者部门id
+     */
+    private Long createUserDeptId;
+
+    /**
+     * 创建日期
+     */
+    private Date createTime;
+
+    /**
+     * 更新者id
+     */
+    private String updateUserId;
+
+    /**
+     * 创建日期
+     */
+    private Date updateTime;
+
+
+
+}

+ 190 - 0
house-biz/src/main/java/com/ljq/house/biz/model/TmEstate.java

@@ -0,0 +1,190 @@
+package com.ljq.house.biz.model;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 房源管理
+ * </p>
+ *
+ * @author anthor
+ * @since 2021-06-03
+ */
+@Data
+@Table(name = "tm_estate")
+public class TmEstate extends Model<TmEstate> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 房源id
+     */
+    @Column(name = "estate_id")
+    private String estateId;
+
+    /**
+     * 房源名称
+     */
+    private String estateName;
+
+    /**
+     * 物业编号
+     */
+    private String propertyNumber;
+
+    /**
+     * 总售价
+     */
+    private String totalPrice;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 卧室数量
+     */
+    private String bedroomAmount;
+
+    /**
+     * 浴室
+     */
+    private String showerroomAmount;
+
+    /**
+     * 建筑面积
+     */
+    private BigDecimal buildingArea;
+
+    /**
+     * 占地面积
+     */
+    private BigDecimal floorSpace;
+
+    /**
+     * 建设年份
+     */
+    private String constructionYear;
+
+    /**
+     * 单位价格
+     */
+    private BigDecimal unitPrice;
+
+    /**
+     * 房源标签  0:云看房 1:随时可看
+     */
+    private String houseLabel;
+
+    /**
+     * 配套设施
+     */
+    private String ancillaryFacility;
+
+    /**
+     * 是否关联经纪人  1:关联  0:不关联
+     */
+    private String isAgentRelation;
+
+    /**
+     * 经纪人 id
+     */
+    private String agencyUserId;
+
+    /**
+     * 售卖状态  1:在售  0:停售
+     */
+    private String sellType;
+
+    /**
+     * 场景地址
+     */
+    private String sceneAddress;
+
+    /**
+     * 附加信息图地址
+     */
+    @TableField("ADDITIONS_IMAGES")
+    private String additionsImages;
+
+    /**
+     * 房源封面照片地址
+     */
+    private String coverImage;
+
+    /**
+     * 房源照片地址
+     */
+    private String hourseImage;
+
+    /**
+     * 视频简介封面照片地址
+     */
+    private String videoCoverImage;
+
+    /**
+     * 视频简介地址
+     */
+    private String introduceVideo;
+
+    /**
+     * 视频简介描述
+     */
+    private String introduceVideoDesc;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 内容介绍
+     */
+    private String contentIntroduce;
+
+    private String recStatus;
+
+    /**
+     * 创建者id
+     */
+    private String createUserId;
+
+    /**
+     * 创建者部门id
+     */
+    private Long createUserDeptId;
+
+    /**
+     * 创建日期
+     */
+    private Date createTime;
+
+    /**
+     * 更新者id
+     */
+    private String updateUserId;
+
+    /**
+     * 创建日期
+     */
+    private Date updateTime;
+
+    /**
+     * 卖点
+     */
+    private List<TmBuyingpoint> tmBuyingpoint;
+
+
+
+}

+ 33 - 0
house-biz/src/main/java/com/ljq/house/biz/service/ITmBuyingpointService.java

@@ -0,0 +1,33 @@
+package com.ljq.house.biz.service;
+
+import com.ljq.house.biz.model.TmBuyingpoint;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ljq.house.biz.model.TmEstate;
+import com.ljq.house.biz.vo.request.TmEstateReqVo;
+import com.ljq.house.biz.vo.response.TmBuyingpointRspVo;
+import com.ljq.house.biz.vo.response.TmEstateRspVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 物业特色 服务类
+ * </p>
+ *
+ * @author anthor
+ * @since 2021-06-03
+ */
+public interface ITmBuyingpointService extends IService<TmBuyingpoint> {
+
+    public List<TmBuyingpoint> getList(@Param("id") String id);
+
+    public int insert(TmBuyingpoint tmBuyingpoint);
+
+    public int update(TmBuyingpoint tmBuyingpoint);
+
+    public int del(String buyingpointId);
+
+    public int delEstateId(String estateId);
+
+}

+ 34 - 0
house-biz/src/main/java/com/ljq/house/biz/service/ITmEstateService.java

@@ -0,0 +1,34 @@
+package com.ljq.house.biz.service;
+
+import com.ljq.house.biz.model.TmEstate;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ljq.house.biz.vo.request.TmEstateReqVo;
+import com.ljq.house.biz.vo.response.TmEstateRspVo;
+import com.ljq.house.biz.vo.util.Page;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 房源管理 服务类
+ * </p>
+ *
+ * @author anthor
+ * @since 2021-06-03
+ */
+public interface ITmEstateService extends IService<TmEstate> {
+
+    public Page<TmEstateRspVo> getList(TmEstateReqVo tmEstateReqVo);
+
+    public int insert(TmEstate tmEstate);
+
+    public int update(TmEstate tmEstate);
+
+    public int del(String agencyUserId);
+
+    List<TmEstate> findAgencyEstate(@Param("agencyUserId") String agencyUserId);
+
+    Integer findAgencyNum(@Param("agencyUserId") String agencyUserId);
+
+}

+ 58 - 0
house-biz/src/main/java/com/ljq/house/biz/service/impl/TmBuyingpointServiceImpl.java

@@ -0,0 +1,58 @@
+package com.ljq.house.biz.service.impl;
+
+import com.ljq.house.biz.model.TmBuyingpoint;
+import com.ljq.house.biz.dao.TmBuyingpointDao;
+import com.ljq.house.biz.service.ITmBuyingpointService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ljq.house.biz.vo.util.IdStarterEnum2;
+import com.ljq.house.biz.vo.util.UUidGenerator2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 物业特色 服务实现类
+ * </p>
+ *
+ * @author anthor
+ * @since 2021-06-03
+ */
+@Service
+public class TmBuyingpointServiceImpl extends ServiceImpl<TmBuyingpointDao, TmBuyingpoint> implements ITmBuyingpointService {
+
+    @Autowired
+    private TmBuyingpointDao tmBuyingpointDao;
+
+    @Override
+    public List<TmBuyingpoint> getList(String id) {
+        return tmBuyingpointDao.getList(id);
+    }
+
+    @Override
+    public int insert(TmBuyingpoint tmBuyingpoint) {
+        tmBuyingpoint.setBuyingpointId(UUidGenerator2.generatorUuid(IdStarterEnum2.AGENCY.getStarter()));
+        tmBuyingpoint.setCreateTime(new Date());
+        tmBuyingpoint.setUpdateTime(new Date());
+        return tmBuyingpointDao.insert(tmBuyingpoint);
+    }
+
+    @Override
+    public int update(TmBuyingpoint tmBuyingpoint) {
+        return tmBuyingpointDao.update(tmBuyingpoint);
+    }
+
+    @Override
+    public int del(String buyingpointId) {
+        return tmBuyingpointDao.del(buyingpointId);
+    }
+
+    @Override
+    public int delEstateId(String estateId) {
+        return tmBuyingpointDao.delEstateId(estateId);
+    }
+
+
+}

+ 119 - 0
house-biz/src/main/java/com/ljq/house/biz/service/impl/TmEstateServiceImpl.java

@@ -0,0 +1,119 @@
+package com.ljq.house.biz.service.impl;
+
+import com.ljq.house.biz.dao.TmBuyingpointDao;
+import com.ljq.house.biz.model.TmBuyingpoint;
+import com.ljq.house.biz.model.TmEstate;
+import com.ljq.house.biz.dao.TmEstateDao;
+import com.ljq.house.biz.service.ITmBuyingpointService;
+import com.ljq.house.biz.service.ITmEstateService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ljq.house.biz.vo.request.TmEstateReqVo;
+import com.ljq.house.biz.vo.response.TmEstateRspVo;
+import com.ljq.house.biz.vo.util.Page;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 房源管理 服务实现类
+ * </p>
+ *
+ * @author anthor
+ * @since 2021-06-03
+ */
+@Service
+public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> implements ITmEstateService {
+
+    @Autowired
+    private TmEstateDao tmEstateDao;
+
+    @Autowired
+    private TmBuyingpointDao tmBuyingpointDao;
+
+    @Autowired
+    private ITmBuyingpointService iTmBuyingpointService;
+
+
+    @Override
+    public Page<TmEstateRspVo> getList(TmEstateReqVo tmEstateReqVo) {
+
+        tmEstateReqVo.setLimit(tmEstateReqVo.getPageSize());
+        tmEstateReqVo.setOffset((tmEstateReqVo.getCurrPage() - 1) * tmEstateReqVo.getPageSize());
+
+        List<TmEstateRspVo> tmEstateRspVoList = tmEstateDao.getList(tmEstateReqVo);
+        List<TmBuyingpoint> tmBuyingpointList = new ArrayList<>();
+        if(tmEstateRspVoList!=null && tmEstateRspVoList.size()>0){
+            for(TmEstateRspVo ter:tmEstateRspVoList){
+                tmBuyingpointList = new ArrayList<>();
+                tmBuyingpointList = tmBuyingpointDao.getList(ter.getEstateId());
+                if(tmBuyingpointList !=null && tmBuyingpointList.size()>0){
+                    ter.setTmBuyingpoint(tmBuyingpointList);
+                }
+
+
+
+
+            }
+        }
+
+        Long total = tmEstateDao.countAll();
+        Page<TmEstateRspVo> tmEstateRspVoPage = new Page<>();
+        tmEstateRspVoPage.setCurrentPage(tmEstateReqVo.getCurrPage());
+        tmEstateRspVoPage.setCurrentCount(tmEstateReqVo.getPageSize());
+        tmEstateRspVoPage.setTotalCount(total);
+        tmEstateRspVoPage.setProductList(tmEstateRspVoList);
+
+        return tmEstateRspVoPage;
+    }
+
+    @Override
+    public int insert(TmEstate tmEstate) {
+
+        tmEstateDao.insert(tmEstate);
+
+        List<TmBuyingpoint> tmBuyingpointList = tmEstate.getTmBuyingpoint();
+        if(tmBuyingpointList!=null && tmBuyingpointList.size()>0){
+            for(TmBuyingpoint tbp:tmBuyingpointList){
+                tbp.setEstateId(tmEstate.getEstateId());
+                iTmBuyingpointService.insert(tbp);
+            }
+        }
+        return 0;
+    }
+
+    @Override
+    public int update(TmEstate tmEstate) {
+
+        if(tmEstate!=null && tmEstate.getTmBuyingpoint()!=null && tmEstate.getTmBuyingpoint().size()>0){
+            List<TmBuyingpoint> tmBuyingpointList = tmEstate.getTmBuyingpoint();
+            for(TmBuyingpoint tbp:tmBuyingpointList){
+                iTmBuyingpointService.update(tbp);
+            }
+        }
+        return tmEstateDao.update(tmEstate);
+    }
+
+    @Override
+    public int del(String estateId) {
+        iTmBuyingpointService.delEstateId(estateId);
+        return tmEstateDao.del(estateId);
+    }
+
+    @Override
+    public List<TmEstate> findAgencyEstate(String agencyUserId) {
+        return tmEstateDao.findAgencyEstate(agencyUserId);
+    }
+
+    @Override
+    public Integer findAgencyNum(String agencyUserId) {
+        Integer num = tmEstateDao.findAgencyNum(agencyUserId);
+        if(num == null ){
+            num = 0;
+        }
+        return num;
+    }
+}

+ 99 - 0
house-biz/src/main/resources/mapper/TmBuyingpointDao.xml

@@ -0,0 +1,99 @@
+<?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.ljq.house.biz.dao.TmBuyingpointDao">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.ljq.house.biz.model.TmBuyingpoint">
+        <id column="buyingpoint_id" property="buyingpointId" />
+        <result column="estate_id" property="estateId" />
+        <result column="title" property="title" />
+        <result column="content" property="content" />
+        <result column="create_user_id" property="createUserId" />
+        <result column="create_user_dept_id" property="createUserDeptId" />
+        <result column="create_time" property="createTime" />
+        <result column="update_user_id" property="updateUserId" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        buyingpoint_id, estate_id, title, content, create_user_id, create_user_dept_id, create_time, update_user_id, update_time
+    </sql>
+
+    <select id="getList" resultType="com.ljq.house.biz.model.TmBuyingpoint">
+        select *
+        from tm_buyingpoint
+        where rec_status = 'A'
+          and estate_id = #{id}
+        order by create_time desc
+    </select>
+
+    <select id="countAll" resultType="java.lang.Long">
+        select count(*)
+        from tm_buyingpoint
+        where rec_status = 'A'
+    </select>
+
+    <insert id="insert" parameterType="com.ljq.house.biz.model.TmBuyingpoint">
+
+        INSERT INTO tm_buyingpoint
+        (
+         buyingpoint_id
+        ,estate_id
+        ,title
+        ,content
+        ,rec_status
+        ,create_user_id
+        ,create_user_dept_id
+        ,create_time
+        ,update_user_id
+        ,update_time
+        )
+        VALUES
+        (
+         #{cm.buyingpointId}
+        ,#{cm.estateId}
+        ,#{cm.title}
+        ,#{cm.content}
+        ,'A'
+        ,#{cm.createUserId}
+        ,#{cm.createUserDeptId}
+        ,now()
+        ,#{cm.updateUserId}
+        ,now()
+        )
+    </insert>
+
+
+    <update id="update" parameterType="com.ljq.house.biz.model.TmBuyingpoint">
+        update tm_buyingpoint
+        <set>
+            <if test="cm.title != null and cm.title.trim() != ''"> title = #{cm.title},</if>
+            <if test="cm.content != null and cm.content.trim() != ''"> content = #{cm.content},</if>
+            <if test="cm.cm.updateUserId != null and cm.cm.updateUserId.trim() != ''"> update_user_id = #{cm.updateUserId},</if>
+            update_time = now()
+        </set>
+        where `buyingpoint_id` = #{cm.buyingpointId}
+        limit 1
+    </update>
+
+    <update id="del">
+        update tm_buyingpoint
+        <set>
+            rec_status = 'I',
+            update_time = now()
+        </set>
+        where `buyingpoint_id` = #{buyingpointId}
+        limit 1
+    </update>
+
+    <update id="delEstateId">
+        update tm_buyingpoint
+        <set>
+            rec_status = 'I',
+            update_time = now()
+        </set>
+        where `estate_id` = #{estateId}
+        limit 1
+    </update>
+</mapper>