姜友瑶
2022-05-05 d122f3323cea1953ea443653f13ece07f94fb05b
Merge branch 'developer' into alpha
4 files added
2 files renamed
6 files modified
498 ■■■■ changed files
zq-erp/src/main/java/com/matrix/beauty/followup/dao/SysFollowupDao.java 12 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/beauty/followup/entry/SysFollowup.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/beauty/followup/service/SysFollowupService.java 89 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java 62 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/FollowuController.java 40 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java 11 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dto/FollowuListDto.java 36 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/application.properties 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml 30 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive-erp/vip/vipInfo-list.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/vip/followu-list.html 206 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/beauty/followup/dao/SysFollowupDao.java
File was renamed from zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java
@@ -1,11 +1,13 @@
package com.matrix.system.hive.dao;
package com.matrix.beauty.followup.dao;
import com.matrix.beauty.followup.entry.SysFollowup;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.system.app.dto.FollowupListDto;
import com.matrix.system.hive.dto.FollowuListDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.system.hive.bean.SysFollowup;
/**
 * @description 跟进
@@ -15,7 +17,7 @@
public interface SysFollowupDao{
    public int insert(@Param("item") SysFollowup sysFollowup);
       public int batchInsert(@Param("list") List<SysFollowup> sysFollowupList);
       
    public int updateByMap(Map<String, Object> modifyMap);
@@ -41,4 +43,6 @@
    void updateZan(@Param("id")Long id, @Param("zans")String zans);
    List<SysFollowup> selectByAppDto(FollowupListDto followupListDto);
    List<SysFollowup> findVipFollowuByPage(FollowuListDto followuListDto);
}
zq-erp/src/main/java/com/matrix/beauty/followup/entry/SysFollowup.java
File was renamed from zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java
@@ -1,13 +1,13 @@
package com.matrix.system.hive.bean;
package com.matrix.beauty.followup.entry;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.matrix.core.pojo.EntityDTO;
import com.matrix.core.anotations.Extend;
import com.matrix.core.tools.DateUtil;
import com.matrix.system.common.bean.EntityDTOExt;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.hive.bean.SysFollowupComment;
import com.matrix.system.hive.bean.SysVipAlbum;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.util.Date;
zq-erp/src/main/java/com/matrix/beauty/followup/service/SysFollowupService.java
New file
@@ -0,0 +1,89 @@
package com.matrix.beauty.followup.service;
import com.matrix.beauty.followup.dao.SysFollowupDao;
import com.matrix.beauty.followup.entry.SysFollowup;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.hive.bean.SysBeauticianState;
import com.matrix.system.hive.bean.SysOrderItem;
import com.matrix.system.hive.bean.SysVipAlbum;
import com.matrix.system.hive.dao.SysBeauticianStateDao;
import com.matrix.system.hive.dao.SysOrderItemDao;
import com.matrix.system.hive.dao.SysVipAlbumDao;
import com.matrix.system.hive.dto.FollowuListDto;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class SysFollowupService {
    @Autowired
    SysFollowupDao followupDao;
    @Autowired
    SysOrderItemDao orderItemDao;
    @Autowired
    private SysVipAlbumDao vipAlbumDao;
    @Autowired
    private SysBeauticianStateDao beauticianStateDao;
    public void save(SysFollowup followup){
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        followup.setCreateBy(user.getSuName());
        followup.setUpdateBy(user.getSuName());
        followup.setStaffId(user.getSuId());
        followup.setCompanyId(user.getCompanyId());
        followup.setShopId(user.getShopId());
        //处理订单摘要
        if(followup.getOrderId()!=null){
            List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(followup.getOrderId());
            String abs="";
            if(sysOrderItems.size()>1){
                abs= sysOrderItems.get(0).getShoppingGoods().getName()+"等"+sysOrderItems.size()+"件商品";
            }else{
                abs= sysOrderItems.get(0).getShoppingGoods().getName();
            }
            followup.setOrderAbstract(abs);
        }
        //服务单摘要
        if(followup.getServiceId()!=null){
            List<SysBeauticianState> sysBeauticianStates = beauticianStateDao.selectBySerIds(followup.getServiceId());
            String abs="";
            if(sysBeauticianStates.size()>1){
                abs= sysBeauticianStates.get(0).getProjInfo().getName()+"等"+sysBeauticianStates.size()+"项服务";
            }else{
                abs= sysBeauticianStates.get(0).getProjInfo().getName();
            }
            followup.setOrderAbstract(abs);
        }
        followupDao.insert(followup);
        //插入图片
        List<SysVipAlbum> albums=followup.getAlbums();
        if(CollectionUtils.isNotEmpty(albums)){
            for (SysVipAlbum vipAlbum:albums){
                if(StringUtils.isNotBlank(vipAlbum.getImg())){
                    vipAlbum.setCreateBy(user.getSuName());
                    vipAlbum.setUpdateBy(user.getSuName());
                    vipAlbum.setSource(SysVipAlbum.SOURCE_FOLLOW);
                    vipAlbum.setVipId(followup.getVipId());
                    vipAlbum.setSourceId(followup.getId());
                    vipAlbumDao.insert(vipAlbum);
                }
            }
        }
    }
    public List<SysFollowup> findVipFollowuByPage(FollowuListDto followuListDto) {
        //todo 等订单改造版本合并后用验证工具加参数校验
      return   followupDao.findVipFollowuByPage(followuListDto);
    }
}
zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java
@@ -1,5 +1,8 @@
package com.matrix.system.app.action;
import com.matrix.beauty.followup.dao.SysFollowupDao;
import com.matrix.beauty.followup.entry.SysFollowup;
import com.matrix.beauty.followup.service.SysFollowupService;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
@@ -7,7 +10,6 @@
import com.matrix.system.app.dto.*;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.dao.*;
import com.matrix.system.hive.plugin.util.CollectionUtils;
@@ -35,21 +37,11 @@
    private SysFollowupDao followupDao;
    @Autowired
    private SysVipAlbumDao vipAlbumDao;
    @Autowired
    private SysVipInfoDao vipInfoDao;
    @Autowired
    private SysFollowupCommentDao followupCommentDao;
    @Autowired
    private SysOrderItemDao orderItemDao;
    @Autowired
    private SysBeauticianStateDao beauticianStateDao;
    private SysFollowupService followupService;
    @ApiOperation(value = "新增跟进记录", notes = "新增跟进记录")
@@ -58,51 +50,7 @@
    })
    @PostMapping(value = "/addFollowup")
    public AjaxResult addFollowup(@RequestBody @Validated SysFollowup followup) {
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        followup.setCreateBy(user.getSuName());
        followup.setUpdateBy(user.getSuName());
        followup.setStaffId(user.getSuId());
        followup.setCompanyId(user.getCompanyId());
        followup.setShopId(user.getShopId());
        //处理订单摘要
        if(followup.getOrderId()!=null){
            List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(followup.getOrderId());
            String abs="";
            if(sysOrderItems.size()>1){
                abs= sysOrderItems.get(0).getShoppingGoods().getName()+"等"+sysOrderItems.size()+"件商品";
            }else{
                abs= sysOrderItems.get(0).getShoppingGoods().getName();
            }
           followup.setOrderAbstract(abs);
        }
        //服务单摘要
        if(followup.getServiceId()!=null){
            List<SysBeauticianState> sysBeauticianStates = beauticianStateDao.selectBySerIds(followup.getServiceId());
            String abs="";
            if(sysBeauticianStates.size()>1){
                abs= sysBeauticianStates.get(0).getProjInfo().getName()+"等"+sysBeauticianStates.size()+"项服务";
            }else{
                abs= sysBeauticianStates.get(0).getProjInfo().getName();
            }
            followup.setOrderAbstract(abs);
        }
        followupDao.insert(followup);
        //插入图片
        List<SysVipAlbum> albums=followup.getAlbums();
        if(CollectionUtils.isNotEmpty(albums)){
            for (SysVipAlbum vipAlbum:albums){
                if(StringUtils.isNotBlank(vipAlbum.getImg())){
                    vipAlbum.setCreateBy(user.getSuName());
                    vipAlbum.setUpdateBy(user.getSuName());
                    vipAlbum.setSource(SysVipAlbum.SOURCE_FOLLOW);
                    vipAlbum.setVipId(followup.getVipId());
                    vipAlbum.setSourceId(followup.getId());
                    vipAlbumDao.insert(vipAlbum);
                }
            }
        }
        followupService.save(followup);
        return AjaxResult.buildSuccessInstance("保存成功");
    }
zq-erp/src/main/java/com/matrix/system/hive/action/FollowuController.java
New file
@@ -0,0 +1,40 @@
package com.matrix.system.hive.action;
import com.matrix.beauty.followup.entry.SysFollowup;
import com.matrix.beauty.followup.service.SysFollowupService;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.hive.dto.FollowuListDto;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
 * @description 跟进记录
 */
@RestController
@RequestMapping(value = "admin/followu")
public class FollowuController extends BaseController{
    @Resource
    private SysFollowupService followupService;
    /**
     * 显示所有的会员卡等级信息
     */
    @RequestMapping(value = "/showList")
    public  AjaxResult showList(@RequestBody @Validated FollowuListDto followuListDto) {
        SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        followuListDto.setCompanyId(users.getCompanyId());
        followuListDto.setSelfStaff(users.getSuId());
        List<SysFollowup> list= followupService.findVipFollowuByPage(followuListDto);
        return  AjaxResult.buildSuccessInstance(list);
    }
}
zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java
@@ -1,10 +1,13 @@
package com.matrix.system.hive.dao;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import com.matrix.beauty.followup.entry.SysFollowup;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.system.hive.bean.SysVipAlbum;
import com.matrix.system.hive.dto.FollowuListDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * @description 客户相册
@@ -38,5 +41,5 @@
    public SysVipAlbum  selectById(Long id);
    
    public SysVipAlbum  selectForUpdate(Long id);
}
zq-erp/src/main/java/com/matrix/system/hive/dto/FollowuListDto.java
New file
@@ -0,0 +1,36 @@
package com.matrix.system.hive.dto;
import com.matrix.core.pojo.PaginationDto;
import lombok.Data;
import javax.validation.constraints.NotNull;
/** 查询客户跟进记录
 * @author jyy
 * @date 2021-01-27
 **/
@Data
public class FollowuListDto extends PaginationDto {
    /**
     * 客户id
     */
    @NotNull
    private Long vipId;
    /**
     * 员工id
     */
    private Long staffId;
    /**
     * 当前查询人
     */
    private Long selfStaff;
    /**
     * 公司id
     */
    private Long companyId;
}
zq-erp/src/main/resources/config/application.properties
@@ -1,5 +1,5 @@
spring.profiles.active=local
spring.profiles.active=alpha
evn=dev
server.port=8080
zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml
@@ -2,9 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.matrix.system.hive.dao.SysFollowupDao" >
<mapper namespace="com.matrix.beauty.followup.dao.SysFollowupDao" >
    <!-- 定义SysFollowup 的复杂关联map -->
    <resultMap type="com.matrix.system.hive.bean.SysFollowup" id="SysFollowupMap">
    <resultMap type="com.matrix.beauty.followup.entry.SysFollowup" id="SysFollowupMap">
        <id property="id" column="id" />
        <result property="createBy" column="create_by" />
        <result property="createTime" column="create_time" />
@@ -40,7 +40,7 @@
    </select>
    
    <!-- 定义SysFollowup 的简单map  ,本map不添加其他的关联属性 -->
    <resultMap type="com.matrix.system.hive.bean.SysFollowup" id="SysFollowupSimpleMap">
    <resultMap type="com.matrix.beauty.followup.entry.SysFollowup" id="SysFollowupSimpleMap">
        <id property="id" column="id" />
        <result property="createBy" column="create_by" />
        <result property="createTime" column="create_time" />
@@ -142,9 +142,9 @@
        </if>
         
    </sql>
    <!--  插入方法   -->
    <insert id="insert" parameterType="com.matrix.system.hive.bean.SysFollowup"
    <insert id="insert" parameterType="com.matrix.beauty.followup.entry.SysFollowup"
        useGeneratedKeys="true" keyProperty="item.id">
        INSERT INTO sys_followup (
             <include refid="columns"></include>
@@ -275,7 +275,7 @@
    </delete>
    
    <!-- 根据对象删除-->
    <delete id="deleteByModel" parameterType="com.matrix.system.hive.bean.SysFollowup">
    <delete id="deleteByModel" parameterType="com.matrix.beauty.followup.entry.SysFollowup">
        DELETE FROM sys_followup
        <where>
        <include refid="where_sql" ></include>
@@ -401,5 +401,23 @@
          limit ${offset},${limit}
    </select>
<select id="findVipFollowuByPage" resultMap="SysFollowupMap">
        select a.*,
         b.su_photo as staffPhoto,
         b.su_name as staffName,
         c.vip_name as vipName
         from sys_followup  a
         left join  sys_users b on a.staff_id= b.su_id
         left join  sys_vip_info c on a.vip_id=c.id
        <where>
            and a.company_id=#{companyId}
            and (visible=1 or ( visible!=1 and a.staff_id=#{selfStaff}))
            <if test="vipId!=null">
                and    a.vip_id = #{vipId}
            </if>
        </where>
        order by a.create_time desc
          limit ${offset},${limit}
    </select>
</mapper>
zq-erp/src/main/resources/templates/views/admin/hive-erp/vip/vipInfo-list.html
@@ -193,7 +193,7 @@
            title : "会员跟进记录",
            area :  MUI.SIZE_M,
            maxmin : true,
            content : [ basePath+'/admin/serviceRecord/toServicefollowListForZd?id=' + id ]
            content : [ basePath+'/admin/redirect/hive/vip/followu-list?vipId=' + id ]
        });
    }
zq-erp/src/main/resources/templates/views/admin/hive/vip/followu-list.html
New file
@@ -0,0 +1,206 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <LINK rel="Bookmark" href="../images/favicon.ico">
    <!-- 本框架基本脚本和样式 -->
    <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
    <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
    <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
    <title></title>
    <style>
        .panel-body{
            overflow: hidden;
        }
        .buttonPanel{
            background: #ffffff;
            padding: 10px 10px ;
            margin: 0px 0px 10px 0px;
        }
        .rowPanel{
            background: #ffffff;
            padding: 0px 10px ;
            padding-top: 10px;
            margin: 0px 0px 10px 0px;
        }
        .paginationStyle{
            background: #ffffff;
            padding: 10px 10px;
            margin: 0px 0px 10px 0px;
            text-align: right;
        }
    </style>
</head>
<body>
<div class="panel-body" id="app">
    <el-row class="table-style"  >
        <el-table id="proj" :data="table.rows"  :height="height" stripe @sort-change="sortChange">
            <el-table-column
                    prop="vipName"
                    label="客户名称"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="staffName"
                    label="员工名称">
            </el-table-column>
            <el-table-column
                    prop="orderAbstract"
                    label="订单摘要信息"
                    show-overflow-tooltip
                    width="240">
            </el-table-column>
            <el-table-column
                    prop="content"
                    label="跟进内容"
                    show-overflow-tooltip
                    width="340">
            </el-table-column>
            <el-table-column
                    prop="createTime"
                    label="填写时间"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="nextNotifyTime"
                    label="下次跟进时间">
            </el-table-column>
            <el-table-column label="效果图片">
                <template slot-scope="scope">
                    <el-image
                            style="width: 100px; height: 100px"
                            :src="scope.row.showImg"
                            :preview-src-list="scope.row.imgList">
                    </el-image>
                </template>
            </el-table-column>
        </el-table>
    </el-row>
    <el-row class="paginationStyle"  >
        <el-pagination background
                       @size-change="changePageSize"
                       @current-change="changeCurrentPage"
                       :current-page="table.currentPage"
                       :page-sizes="[10, 20, 30, 50]"
                       :page-size="table.pageSize"
                       layout="total, sizes, prev, pager, next, jumper"
                       :total="table.total">
        </el-pagination>
    </el-row>
</div>
</body>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<script type="text/javascript" th:inline="javascript">
    var vipId = $.query.get('vipId');
    var vue = new Vue({
        el: '#app',
        data: {
            table:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
            form:{
                vipId:vipId,
                order:'',
                sort:''
            },
            height:'calc(100vh - 240px)',
        },
        created: function () {
            let _this=this;
           this.loadData();
            window.addEventListener("keydown", this.keydown);
        },
        methods: {
            changePageSize(val) {
                this.table.pageSize = val;
                this.loadData();
            },
            changeCurrentPage(val) {
                this.table.currentPage = val;
                this.loadData();
            },
            resetForm(formName) {
                this.$refs[formName].resetFields();
            },
            sortChange:function (column){
                if(column.order){
                    if(column.order.indexOf("desc")){
                        this.form.order="desc";
                    }else{
                        this.form.order="asc";
                    }
                    this.form.sort=column.prop;
                    this.loadData();
                }
            },
            loadData:function(){
                let _this = this;
                let data=_this.getRequestParam();
                data.limit=_this.table.pageSize;
                data.offset=_this.table.pageSize*(_this.table.currentPage-1);
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/admin/followu/showList',
                    callback: function (data) {
                        data.rows.forEach(e=>{
                           e.showImg= e.albums[0].img;
                           e.imgList=[];
                           e.albums.forEach(album=>{
                               e.imgList.push(album.img);
                           })
                        })
                        _this.table.rows = data.rows;
                        _this.table.total=data.total;
                    }
                });
            },
            getRequestParam(){
                let _this = this;
                return   {
                    vipId:_this.form.vipId,
                    order:_this.form.order,
                    sort:_this.form.sort
                }
            },
            search:function(){
                this.table.currentPage=1;
                this.loadData();
            },
            keydown(evt){
                if(evt.keyCode==13) {
                    this.search();
                }
            },
        }
    });
</script>
</body>
</html>
zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html
@@ -315,7 +315,7 @@
            title : "会员跟进记录",
            area :  MUI.SIZE_M,
            maxmin : true,
            content : [ basePath+'/admin/serviceRecord/toServicefollowList?id=' + id ]
            content : [ basePath+'/admin/redirect/hive/vip/followu-list?vipId=' + id ]
        });
    }
    function createDateDictionary() {