Helius
2021-01-22 f81300462deff06ab6c90b24ecb9f0ba5031a766
modify
1 files added
7 files modified
155 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java 29 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/dto/LabelDto.java 34 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/dto/VipInfoListDto.java 24 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabel.java 30 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipLabelDao.java 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml 3 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml 27 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java
@@ -2,6 +2,7 @@
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.EncrypUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
@@ -78,6 +79,11 @@
        if (StringUtils.isBlank(vipInfoListDto.getOrder())) {
            vipInfoListDto.setOrder("asc");
        }
        int offset = (vipInfoListDto.getPageNum() - 1) * vipInfoListDto.getPageSize();
        int limit = vipInfoListDto.getPageSize();
        vipInfoListDto.setOffset(offset);
        vipInfoListDto.setLimit(limit);
        return AjaxResult.buildSuccessInstance(sysVipInfoService.findVipAddressBook(vipInfoListDto));
    }
zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java
@@ -1,19 +1,26 @@
package com.matrix.system.app.action;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.app.dto.LabelDto;
import com.matrix.system.hive.action.BaseController;
import com.matrix.system.hive.bean.SysVipLabel;
import com.matrix.system.hive.dao.SysVipLabelDao;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * @author wzy
 * @date 2020-12-22
 **/
//@Api(value = "ApiVipLabelAction", tags = "客户标签接口类")
@Api(value = "ApiVipLabelAction", tags = "客户标签接口类")
@RestController
@RequestMapping(value = "/api/label")
public class ApiVipLabelAction {
public class ApiVipLabelAction extends BaseController {
    @Autowired
    private SysVipLabelDao sysVipLabelDao;
    @ApiOperation(value = "获取客户标签列表", notes = "获取客户标签列表")
    @GetMapping(value = "/findLabelByVipId/{vipId}")
@@ -22,10 +29,22 @@
    }
    @ApiOperation(value = "添加客户标签", notes = "添加客户标签")
    @ApiOperation(value = "添加标签", notes = "添加标签")
    @PostMapping(value = "/addLabel")
    public AjaxResult addLabel() {
        return null;
    public AjaxResult addLabel(@RequestBody LabelDto labelDto) {
        SysVipLabel sysVipLabel = new SysVipLabel();
        sysVipLabel.setLabel(labelDto.getLabel());
        sysVipLabel.setColor(labelDto.getColor());
        sysVipLabel.setShopId(getMe().getShopId());
        sysVipLabel.setCompanyId(getMe().getCompanyId());
        sysVipLabel.setUserId(getMe().getSuId());
        sysVipLabel.setIsAll(2);
        int i = sysVipLabelDao.insert(sysVipLabel);
        if (i > 0) {
            return AjaxResult.buildSuccessInstance("添加成功");
        } else {
            return AjaxResult.buildFailInstance("添加失败");
        }
    }
    @ApiOperation(value = "删除标签", notes = "删除标签")
zq-erp/src/main/java/com/matrix/system/app/dto/LabelDto.java
New file
@@ -0,0 +1,34 @@
package com.matrix.system.app.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * @author wzy
 * @date 2021-01-22
 **/
@ApiModel(value = "LabelDto", description = "添加标签接收参数接收类")
public class LabelDto {
    @ApiModelProperty(value = "标签内容", example = "123")
    private String label;
    @ApiModelProperty(value = "颜色", example = "#FFFFFF")
    private String color;
    public String getLabel() {
        return label;
    }
    public void setLabel(String label) {
        this.label = label;
    }
    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }
}
zq-erp/src/main/java/com/matrix/system/app/dto/VipInfoListDto.java
@@ -8,7 +8,7 @@
 * @date 2020-12-21
 **/
@ApiModel(value = "VipInfoListDto", description = "获取会员列表参数类")
public class VipInfoListDto {
public class VipInfoListDto extends BasePageDto {
    @ApiModelProperty(value = "查询参数(客户姓名/手机/会员编号/拼音)", example = "")
    private String queryKey;
@@ -34,6 +34,28 @@
    @ApiModelProperty(hidden = true)
    private Long companyId;
    @ApiModelProperty(hidden = true)
    private int offset;
    @ApiModelProperty(hidden = true)
    private int limit;
    public int getOffset() {
        return offset;
    }
    public void setOffset(int offset) {
        this.offset = offset;
    }
    public int getLimit() {
        return limit;
    }
    public void setLimit(int limit) {
        this.limit = limit;
    }
    public Long getCompanyId() {
        return companyId;
    }
zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabel.java
@@ -37,6 +37,36 @@
    private Long companyId;
    private Long userId;
    private Integer isAll;
    private String color;
    public Long getUserId() {
        return userId;
    }
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    public Integer getIsAll() {
        return isAll;
    }
    public void setIsAll(Integer isAll) {
        this.isAll = isAll;
    }
    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }
    public Long getShopId() {
        return shopId;
    }
zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipLabelDao.java
@@ -9,6 +9,8 @@
    int insert(SysVipLabel sysVipLabel);
    int update(SysVipLabel sysVipLabel);
    int deleteById(@Param("id") Long id);
    List<SysVipLabel> selectByVipId(@Param("vipId") Long vipId);
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
@@ -1345,6 +1345,9 @@
        <if test="record.sort != 'monthArrived' and record.sort != 'yearArrived'">
            order by ${record.sort} ${record.order}
        </if>
        <if test="record.offset >=0  and record.limit >0">
            limit #{record.offset},#{record.limit}
        </if>
    </select>
    <select id="selectVipInfoById" resultType="com.matrix.system.app.vo.VipInfoVo">
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml
@@ -10,16 +10,39 @@
            create_by,
            id,
            vip_id,
            label
            label,
            shop_id,
            company_id,
            is_all,
            user_id,
            color
        ) values (
            #{createTime},
            #{createBy},
            #{id},
            #{vipId},
            #{label}
            #{label},
            #{shopId},
            #{companyId},
            #{isAll},
            #{userId},
            #{color}
        )
    </insert>
    <update id="update">
        update sys_vip_label
        <set>
            <if test="label != null and label !='' ">
                label = #{label},
            </if>
            <if test="color != null and color !='' ">
                color = #{color},
            </if>
        </set>
        WHERE ID=#{id}
    </update>
    <delete id="deleteById">
        delete from sys_vip_label
        where id=#{id}