Commit ab76ffef by 陶光胜

二维码

parent 09601d41
package com.gic.enterprise.dto;
import java.io.Serializable;
public class QrCodeValueDTO implements Serializable {
/**二维码类型,1门店 2导购**/
private Integer qrCodeType;
private String value;
public Integer getQrCodeType() {
return qrCodeType;
}
public void setQrCodeType(Integer qrCodeType) {
this.qrCodeType = qrCodeType;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -17,6 +17,10 @@ public class QrcodeDTO implements Serializable {
private String callBackService;
private String callBackMethod;
private String fileId;
/**
* 二维码类型;1门店, 2导购
*/
private Integer qrCodeType;
public Integer getH5() {
return h5;
......@@ -113,4 +117,12 @@ public class QrcodeDTO implements Serializable {
public void setFileId(String fileId) {
this.fileId = fileId;
}
public Integer getQrCodeType() {
return qrCodeType;
}
public void setQrCodeType(Integer qrCodeType) {
this.qrCodeType = qrCodeType;
}
}
......@@ -2,10 +2,7 @@ package com.gic.enterprise.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.QrcodeDTO;
import com.gic.enterprise.dto.QrcodeScenesClassifyDTO;
import com.gic.enterprise.dto.QrcodeScenesDTO;
import com.gic.enterprise.dto.QrcodeScenesValueDTO;
import com.gic.enterprise.dto.*;
import java.util.List;
......@@ -105,4 +102,8 @@ public interface QrCodeApiService {
ServiceResponse<Integer> deleteQrcodeScenesValue(Integer valueId);
ServiceResponse<Integer> saveQrcodeDownload(QrcodeDTO qrcodeDTO);
ServiceResponse<QrcodeDTO> getQrcodeDownload(Integer id);
ServiceResponse<QrCodeValueDTO> getQrCodeValueById(String id);
}
......@@ -86,6 +86,11 @@ public class TabQrcodeDownload {
*/
private String fileId;
/**
* 二维码类型;1门店, 2导购
*/
private Integer qrCodeType;
public Integer getId() {
return id;
}
......@@ -213,4 +218,12 @@ public class TabQrcodeDownload {
public void setFileId(String fileId) {
this.fileId = fileId;
}
public Integer getQrCodeType() {
return qrCodeType;
}
public void setQrCodeType(Integer qrCodeType) {
this.qrCodeType = qrCodeType;
}
}
\ No newline at end of file
......@@ -37,4 +37,6 @@ public interface QrCodeService {
int deleteQrcodeScenesValue(Integer valueId);
int saveQrcodeDownload(TabQrcodeDownload qrcodeDownload);
TabQrcodeDownload getQrcodeDownload(Integer id);
}
......@@ -125,4 +125,10 @@ public class QrCodeServiceImpl implements QrCodeService {
this.tabQrcodeDownloadMapper.insertSelective(qrcodeDownload);
return qrcodeDownload.getId();
}
@Override
public TabQrcodeDownload getQrcodeDownload(Integer id) {
TabQrcodeDownload tabQrcodeDownload = this.tabQrcodeDownloadMapper.selectByPrimaryKey(id);
return tabQrcodeDownload;
}
}
......@@ -5,10 +5,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.constant.Constants;
import com.gic.enterprise.dto.QrcodeDTO;
import com.gic.enterprise.dto.QrcodeScenesClassifyDTO;
import com.gic.enterprise.dto.QrcodeScenesDTO;
import com.gic.enterprise.dto.QrcodeScenesValueDTO;
import com.gic.enterprise.dto.*;
import com.gic.enterprise.entity.TabQrcodeDownload;
import com.gic.enterprise.entity.TabQrcodeScenes;
import com.gic.enterprise.entity.TabQrcodeScenesClassify;
......@@ -149,4 +146,22 @@ public class QrCodeApiServiceImpl implements QrCodeApiService {
int i = this.qrCodeService.saveQrcodeDownload(EntityUtil.changeEntityByJSON(TabQrcodeDownload.class, qrcodeDTO));
return ServiceResponse.success(i);
}
@Override
public ServiceResponse<QrcodeDTO> getQrcodeDownload(Integer id) {
TabQrcodeDownload qrcodeDownload = this.qrCodeService.getQrcodeDownload(id);
return ServiceResponse.success(EntityUtil.changeEntityByJSON(QrcodeDTO.class, qrcodeDownload));
}
@Override
public ServiceResponse<QrCodeValueDTO> getQrCodeValueById(String id) {
TabQrcodeDownload qrcodeDownload = this.qrCodeService.getQrcodeDownload(Integer.valueOf(id));
if(qrcodeDownload != null){
QrCodeValueDTO qrCodeValueDTO = new QrCodeValueDTO();
qrCodeValueDTO.setQrCodeType(qrcodeDownload.getQrCodeType());
qrCodeValueDTO.setValue(qrcodeDownload.getCustomParams());
return ServiceResponse.success(qrCodeValueDTO);
}
return ServiceResponse.success();
}
}
......@@ -18,14 +18,15 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="file_id" jdbcType="VARCHAR" property="fileId" />
<result column="qr_code_type" jdbcType="INTEGER" property="qrCodeType" />
</resultMap>
<sql id="Base_Column_List">
id, enterprise_id, h5, applet_ids, fwh_ids, scenes_value_ids, type, end_time, content,
custom_params, call_back_service, call_back_method, status, create_time, update_time,
file_id
id, enterprise_id, h5, applet_ids, fwh_ids, scenes_value_ids, type, end_time, content,
custom_params, call_back_service, call_back_method, status, create_time, update_time,
file_id, qr_code_type
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from tab_qrcode_download
where id = #{id,jdbcType=INTEGER}
......@@ -35,26 +36,20 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabQrcodeDownload">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_qrcode_download (id, enterprise_id, h5,
applet_ids, fwh_ids, scenes_value_ids,
type, end_time, content,
custom_params, call_back_service, call_back_method,
status, create_time, update_time,
file_id)
values (#{id,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{h5,jdbcType=INTEGER},
#{appletIds,jdbcType=VARCHAR}, #{fwhIds,jdbcType=VARCHAR}, #{scenesValueIds,jdbcType=VARCHAR},
#{type,jdbcType=INTEGER}, #{endTime,jdbcType=TIMESTAMP}, #{content,jdbcType=VARCHAR},
#{customParams,jdbcType=VARCHAR}, #{callBackService,jdbcType=VARCHAR}, #{callBackMethod,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{fileId,jdbcType=VARCHAR})
insert into tab_qrcode_download (id, enterprise_id, h5,
applet_ids, fwh_ids, scenes_value_ids,
type, end_time, content,
custom_params, call_back_service, call_back_method,
status, create_time, update_time,
file_id, qr_code_type)
values (#{id,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{h5,jdbcType=INTEGER},
#{appletIds,jdbcType=VARCHAR}, #{fwhIds,jdbcType=VARCHAR}, #{scenesValueIds,jdbcType=VARCHAR},
#{type,jdbcType=INTEGER}, #{endTime,jdbcType=TIMESTAMP}, #{content,jdbcType=VARCHAR},
#{customParams,jdbcType=VARCHAR}, #{callBackService,jdbcType=VARCHAR}, #{callBackMethod,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{fileId,jdbcType=VARCHAR}, #{qrCodeType,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabQrcodeDownload">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_qrcode_download
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -105,6 +100,9 @@
<if test="fileId != null">
file_id,
</if>
<if test="qrCodeType != null">
qr_code_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -155,6 +153,9 @@
<if test="fileId != null">
#{fileId,jdbcType=VARCHAR},
</if>
<if test="qrCodeType != null">
#{qrCodeType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabQrcodeDownload">
......@@ -205,6 +206,9 @@
<if test="fileId != null">
file_id = #{fileId,jdbcType=VARCHAR},
</if>
<if test="qrCodeType != null">
qr_code_type = #{qrCodeType,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -224,7 +228,8 @@
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
file_id = #{fileId,jdbcType=VARCHAR}
file_id = #{fileId,jdbcType=VARCHAR},
qr_code_type = #{qrCodeType,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment