加盟意向
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.request.JoinIntentionRequest;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface JoinIntentionMapper {
|
||||||
|
|
||||||
|
boolean insert(@Param("request") JoinIntentionRequest request);
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<?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.cool.store.mapper.JoinIntentionMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.PartnerBaseInfoDO">
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
|
||||||
|
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
|
||||||
|
<result column="join_type" jdbcType="TINYINT" property="joinType"/>
|
||||||
|
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
|
||||||
|
<result column="sex" jdbcType="TINYINT" property="sex" />
|
||||||
|
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||||
|
<result column="want_shop_area" jdbcType="VARCHAR" property="wantShopArea" />
|
||||||
|
<result column="area_code" jdbcType="VARCHAR" property="areaCode" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="live_area" jdbcType="VARCHAR" property="liveArea"/>
|
||||||
|
<result column="live_address" jdbcType="VARCHAR" property="liveAddress"/>
|
||||||
|
<result column="joining_questionnaire" jdbcType="VARCHAR" property="joiningQuestionnaire"/>
|
||||||
|
<result column="deleted" jdbcType="TINYINT" property="deleted"/>
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id,
|
||||||
|
partner_id,
|
||||||
|
line_id,
|
||||||
|
join_type,
|
||||||
|
mobile,
|
||||||
|
sex,
|
||||||
|
username,
|
||||||
|
want_shop_area,
|
||||||
|
area_code,
|
||||||
|
create_time,
|
||||||
|
update_time,
|
||||||
|
live_area,
|
||||||
|
live_address,
|
||||||
|
joining_questionnaire,
|
||||||
|
deleted
|
||||||
|
</sql>
|
||||||
|
<insert id="insert" parameterType="com.cool.store.request.JoinIntentionRequest" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into xfsg_partner_base_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="request.lineId != null">line_id,</if>
|
||||||
|
<if test="request.partnerId != null">partner_id,</if>
|
||||||
|
<if test="request.joinType != null">join_type,</if>
|
||||||
|
<if test="request.userName != null">username,</if>
|
||||||
|
<if test="request.mobile != null">mobile,</if>
|
||||||
|
<if test="request.sex != null">sex,</if>
|
||||||
|
<if test="request.wantShopArea != null">want_shop_area,</if>
|
||||||
|
<if test="request.areaCode != null">area_code,</if>
|
||||||
|
<if test="request.liveArea != null">live_area,</if>
|
||||||
|
<if test="request.liveAddress != null">live_address,</if>
|
||||||
|
<if test="request.joiningQuestionnaire != null">joining_questionnaire,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="request.lineId != null">#{request.lineId},</if>
|
||||||
|
<if test="request.partnerId != null">#{request.partnerId},</if>
|
||||||
|
<if test="request.joinType != null">#{request.joinType},</if>
|
||||||
|
<if test="request.userName != null">#{request.userName},</if>
|
||||||
|
<if test="request.mobile != null">#{request.mobile},</if>
|
||||||
|
<if test="request.sex != null">#{request.sex},</if>
|
||||||
|
<if test="request.wantShopArea != null">#{request.wantShopArea},</if>
|
||||||
|
<if test="request.areaCode != null">#{request.areaCode},</if>
|
||||||
|
<if test="request.liveArea != null">#{request.liveArea},</if>
|
||||||
|
<if test="request.liveAddress != null">#{request.liveAddress},</if>
|
||||||
|
<if test="request.joiningQuestionnaire != null">#{request.joiningQuestionnaire},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.cool.store.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PartnerBaseInfoDO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String partnerId;
|
||||||
|
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("加盟身份 1个人加盟 2企业加盟")
|
||||||
|
private Integer joinType;
|
||||||
|
@ApiModelProperty("姓名")
|
||||||
|
private String username;
|
||||||
|
@ApiModelProperty("手机号")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("1男 2女")
|
||||||
|
private Integer sex;
|
||||||
|
@ApiModelProperty("意向加盟区域")
|
||||||
|
private String wantShopArea;
|
||||||
|
@ApiModelProperty("意向区域编码")
|
||||||
|
private String areaCode;
|
||||||
|
@ApiModelProperty("常驻区域")
|
||||||
|
private String liveArea;
|
||||||
|
@ApiModelProperty("常驻区域详细地址")
|
||||||
|
private String liveAddress;
|
||||||
|
@ApiModelProperty("加盟问卷长json")
|
||||||
|
private String joiningQuestionnaire;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
private Integer deleted;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.cool.store.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("加盟意向Request")
|
||||||
|
public class JoinIntentionRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("线索信息表-线索id")
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户信息表partnerId")
|
||||||
|
private String partnerId;
|
||||||
|
|
||||||
|
@ApiModelProperty("加盟身份 1个人加盟 2企业加盟")
|
||||||
|
private Integer joinType;
|
||||||
|
@ApiModelProperty("姓名")
|
||||||
|
private String userName;
|
||||||
|
@ApiModelProperty("手机号")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("1男 2女")
|
||||||
|
private Integer sex;
|
||||||
|
@ApiModelProperty("意向加盟区域")
|
||||||
|
private String wantShopArea;
|
||||||
|
@ApiModelProperty("意向区域编码")
|
||||||
|
private String areaCode;
|
||||||
|
@ApiModelProperty("常驻区域")
|
||||||
|
private String liveArea;
|
||||||
|
@ApiModelProperty("常驻区域详细地址")
|
||||||
|
private String liveAddress;
|
||||||
|
@ApiModelProperty("加盟问卷长json")
|
||||||
|
private String joiningQuestionnaire;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.cool.store.service;
|
||||||
|
|
||||||
|
import com.cool.store.request.JoinIntentionRequest;
|
||||||
|
|
||||||
|
public interface JoinIntentionService {
|
||||||
|
/**
|
||||||
|
* 提交意向加盟申请书
|
||||||
|
* @param request
|
||||||
|
*/
|
||||||
|
boolean submit(JoinIntentionRequest request);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.mapper.JoinIntentionMapper;
|
||||||
|
import com.cool.store.request.JoinIntentionRequest;
|
||||||
|
import com.cool.store.service.JoinIntentionService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class JoinIntentionServiceImpl implements JoinIntentionService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
JoinIntentionMapper joinIntentionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean submit(JoinIntentionRequest request) {
|
||||||
|
if (Objects.isNull(request)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
|
}
|
||||||
|
return joinIntentionMapper.insert(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
|
|
||||||
|
import com.cool.store.request.JoinIntentionRequest;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.JoinIntentionService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping({"/mini/JoinIntention"})
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "小程序意向加盟")
|
||||||
|
public class MiniJoinIntentionController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private JoinIntentionService joinIntentionService;
|
||||||
|
|
||||||
|
@PostMapping(path = "/getOpenAreaList")
|
||||||
|
@ApiOperation("填写加盟意向申请书")
|
||||||
|
public ResponseResult submit(JoinIntentionRequest request) {
|
||||||
|
joinIntentionService.submit(request);
|
||||||
|
return ResponseResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user