Commit e036339e authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-10-30

parent da00827e
......@@ -61,8 +61,8 @@
<sql id="sqlColumns">
a.id,
a.consult_id,
CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8) user_name,
CONVERT(AES_DECRYPT(a.number_id,'aideakey') USING UTF8) number_id,
CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8) userName,
CONVERT(AES_DECRYPT(a.number_id,'aideakey') USING UTF8) numberId,
a.sex,
CONVERT(AES_DECRYPT(a.phone,'aideakey') USING UTF8) phone,
a.past_records,
......@@ -193,7 +193,7 @@
LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id
<include refid="sqlWhere"/>
<if test="id!=null">and (a.doctor_id = ${id} or a.a.service_id =${id} )</if>
<if test="id!=null">and (a.doctor_id = ${id} or a.service_id =${id} )</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
......
......@@ -61,8 +61,8 @@
<sql id="sqlColumns">
a.id,
a.consult_id,
CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8) user_name,
CONVERT(AES_DECRYPT(a.number_id,'aideakey') USING UTF8) number_id,
CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8) userName,
CONVERT(AES_DECRYPT(a.number_id,'aideakey') USING UTF8) numberId,
a.sex,
CONVERT(AES_DECRYPT(a.phone,'aideakey') USING UTF8) phone,
a.past_records,
......@@ -88,7 +88,23 @@
b.`name` pharmaName,
c.`name` customerName
</sql>
<sql id="sqlCol">
id,
CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8) userName,
sex,
CONVERT(AES_DECRYPT(phone,'aideakey') USING UTF8) phone,
past_records,
prescription,
illness,
accounts_id,
STATUS,
create_time,
description,
allergy,
symptom,
open_id
</sql>
<insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true"
keyProperty="id">
......@@ -181,6 +197,18 @@
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
<select id="consultSheetList" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT
<include refid="sqlCol"/>
from t_aidea_consult_sheet
where del_flag = 0
<if test="name!=null">
and user_name like concat('%',#{name},'%')
</if>
<if test="id!=null">
and id = #{id}
</if>
</select>
<update id="update" parameterType="com.cftech.consultsheet.model.ConsultSheet">
update t_aidea_consult_sheet
......@@ -279,7 +307,7 @@
description = #{description}
</if>
</set>
where id = #{consultId}
where consult_id = #{consultId}
</update>
<update id="updateStatus">
......@@ -290,7 +318,7 @@
</if>
</set>
where id = #{consultId}
where consult_id = #{consultId}
</update>
......
......@@ -85,10 +85,10 @@
class="form-control"
data-placeholder="请选择二维码类型">
<option value="">全部</option>
<option value="0">客服二维码</option>
<option value="1">药师二维码</option>
<option value="2">医生二维码</option>
<option value="3">组织二维码</option>
<option value="2">客服二维码</option>
<option value="3">医生二维码</option>
<option value="4">组织二维码</option>
</select>
</div>
<div class="col-xs-5">
......@@ -105,8 +105,10 @@
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<td hidden="true">Id</td
><th>粉丝openid</th>
<td hidden="true">Id
</td
>
<th>粉丝openid</th>
<th>二维码类型</th>
<th>二维码</th>
<th>扫码时间</th>
......@@ -154,8 +156,8 @@
<script src="common/js/cfapp.js"></script>
<script>
var csrfheader = {name:'_csrf_header',value:'${_csrf.headerName}'};
var csrftoken = {name:'_csrf',value:'${_csrf.token}'};
var csrfheader = {name: '_csrf_header', value: '${_csrf.headerName}'};
var csrftoken = {name: '_csrf', value: '${_csrf.token}'};
</script>
<script>
function formatDates(now) {
......@@ -239,15 +241,15 @@
"aTargets": [2],
"mData": "type",
"mRender": function (a, b, c, d) {
if (a=='0'){
return "客服二维码";
}else if (a=='1'){
if (a == '1') {
return "药师二维码";
}else if (a=='2'){
} else if (a == '2') {
return "客服二维码";
} else if (a == '3') {
return "医生二维码";
}else if (a=='3'){
} else if (a == '4') {
return "组织二维码";
}else{
} else {
return "";
}
......@@ -257,7 +259,7 @@
"aTargets": [3],
"mData": "openid",
"mRender": function (a, b, c, d) {
return "<img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+a+"' style='width: 80px;height: 80px;'>";
return "<img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + a + "' style='width: 80px;height: 80px;'>";
}
},
{
......@@ -309,7 +311,7 @@
$.ajax({
type: "POST",
url: "#springUrl('/a/qrcodeRecord/delete')",
data: {id: data,_csrf_header:csrfheader.value,_csrf:csrftoken.value},
data: {id: data, _csrf_header: csrfheader.value, _csrf: csrftoken.value},
dataType: "json",
success: function (data) {
if (data.errorNo == 0) {
......
......@@ -99,10 +99,10 @@
<label>二维码类别</label>
<select class="form-control select2" name="typeselect"
id="typeselect" style="width: 100%;">
<option value="0">客服二维码</option>
<option value="1">药师二维码</option>
<option value="2">医生二维码</option>
<option value="3">组织二维码</option>
<option value="2">客服二维码</option>
<option value="3">医生二维码</option>
<option value="4">组织二维码</option>
</select>
</div>
......
......@@ -110,10 +110,10 @@
<label>二维码类别</label>
<select class="form-control select2" name="typeselect"
id="typeselect" style="width: 100%;">
<option value="0">客服二维码</option>
<option value="1">药师二维码</option>
<option value="2">医生二维码</option>
<option value="3">组织二维码</option>
<option value="2">客服二维码</option>
<option value="3">医生二维码</option>
<option value="4">组织二维码</option>
</select>
</div>
......
......@@ -310,21 +310,19 @@
"aTargets": [4],
"mData": "type",
"mRender": function (a, b, c, d) {
if (a == '0') {
return '客服二维码';
} else if (a == '1') {
return '药师二位码';
}else if(a == '2'){
if (a == '1') {
return '药师二维码';
} else if (a == '2') {
return '客服二位码';
}else if(a == '3'){
return '医生二维码';
}else if(a=="3"){
}else if(a == "4"){
return '组织二维码';
}else{
return "";
}
}
},
{
"aTargets": [5],
"mData": "createTime",
......
......@@ -24,7 +24,7 @@ public class WxQrcode implements Serializable {
private String number;
/* 场景值 */
private String sceneId;
/* 二维码类别 */
/* 二维码类别 1:药师;2:客服;3:医生;4:组织*/
private String type;
/* 二维码的Ticket */
private String ticket;
......@@ -46,8 +46,9 @@ public class WxQrcode implements Serializable {
private Long createBy;
/* 更新人 */
private Long updateBy;
/* 绑定对象 */
private String qrcodeNames;
/* 绑定对象 */
private String qrcodeNames;
public WxQrcode() {
this.delFlag = false;
this.status = "0";
......
......@@ -13,6 +13,7 @@ import java.util.Date;
*/
@Data
public class MemberVO {
private Long id;
/*姓名*/
private String memberName;
......@@ -32,5 +33,5 @@ public class MemberVO {
/*accountsID*/
private Long accountsID;
private String birthdayStr;
}
......@@ -8,6 +8,7 @@ import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Cond;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.DateFormatUtils;
import com.cftech.core.util.StringUtils;
import com.cftech.member.dao.MemberMapper;
import com.cftech.member.model.Member;
......@@ -90,7 +91,7 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
if (org.springframework.util.StringUtils.isEmpty(id)) {
rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg", "id不能为空");
return rtnJson;
}
List<MemberVO> memberVOS = memberMapper.memberFormation(id);
Log.info("返回值" + memberVOS);
......@@ -108,10 +109,8 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
public JSONObject updateMember(MemberVO memberVO) {
JSONObject rtnJson = new JSONObject();
try {
SimpleDateFormat sdf1 = new SimpleDateFormat("yy-MM-dd", Locale.CHINA);
String format = sdf1.format(memberVO.getBirthday());
Date date = sdf1.parse(format);
memberVO.setBirthday(date);
Date birthday = DateFormatUtils.formatDate(memberVO.getBirthdayStr(), "yyyy-MM-dd");
memberVO.setBirthday(birthday);
if (StringUtils.isEmpty(memberVO.getMemberName())) {
rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg", "姓名不能为空");
......
......@@ -19,29 +19,31 @@ import org.springframework.web.bind.annotation.*;
@CrossOrigin
@RequestMapping("mobile/auth/member")
public class MobileMemberController {
@Autowired
private MemberService memberService;
/**
* @return
* @Author Licc
* @Description 个人信息数据回填
* @Date 14:27 2020/10/19
* @Param
* @return
**/
@RequestMapping(value = "/memberFormation",method = {RequestMethod.GET,RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject memberFormation(Long id){
@RequestMapping(value = "/memberFormation", method = {RequestMethod.GET, RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject memberFormation(Long id) {
return memberService.memberFormation(id);
}
/**
* @return
* @Author Licc
* @Description 个人信息修改
* @Date 14:27 2020/10/19
* @Param
* @return
**/
@RequestMapping(value = "/updateMember",method = {RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject updateMember(@RequestBody MemberVO memberVO){
@RequestMapping(value = "/updateMember", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject updateMember(MemberVO memberVO) {
return memberService.updateMember(memberVO);
}
}
......@@ -176,8 +176,8 @@ select
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid
and t.del_flag=0
WHERE t.open_id = #{openId}
and t.del_flag=0
</select>
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap">
......
......@@ -159,7 +159,7 @@
name="source" style="width: 100%;" tabindex="-1"
aria-hidden="true">
<option selected="selected" value="">粉丝来源</option>
<option value="1">导购二维码</option>
<option value="1">药师二维码</option>
<option value="2">门店二维码</option>
<option value="3">普通关注</option>
<option value="4">普通二维码</option>
......@@ -195,10 +195,10 @@
href="javascript:void(0)" onclick="syn(this)"
class="btn bg-olive">同步粉丝</a>
#end
<!-- #if($shiro.hasPermission("mp:fanss:edit")) <a id="batchFanssTag"-->
<!-- href="javascript:void(0)"-->
<!-- class="btn bg-olive">批量打标签</a>-->
<!-- #end-->
<!-- #if($shiro.hasPermission("mp:fanss:edit")) <a id="batchFanssTag"-->
<!-- href="javascript:void(0)"-->
<!-- class="btn bg-olive">批量打标签</a>-->
<!-- #end-->
<button style="width: 100px;" type="submit"
class="btn btn-primary" id="export">导出
</button>
......@@ -217,10 +217,10 @@
<th>省份</th>
<th>城市</th>
<th>昵称</th>
<!-- <th>标签</th>-->
<!-- <th>标签</th>-->
<th>粉丝来源</th>
<th>关注日期</th>
<!-- <th>操作</th>-->
<!-- <th>操作</th>-->
</tr>
</thead>
<tbody>
......@@ -550,17 +550,17 @@
"aTargets": [7],
"mData": "source",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
if (a==1){
if (a == 0) {
return "普通关注";
}else if (a==2){
return "师二维码";
}else if (a==3){
} else if (a == 1) {
return "药师师二维码";
} else if (a == 2) {
return "客服二维码";
}else if(a==4){
} else if (a == 3) {
return "医生二维码";
}else if(a==5){
} else if (a == 4) {
return "组织二维码";
}else{
} else {
return "";
}
......
......@@ -2,17 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cftech.mp.fans.dao.MpFanssMapper">
<resultMap id="BaseResultMap" type="com.cftech.mp.fans.model.MpFanssEntity">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="openid" property="openid" jdbcType="VARCHAR" />
<result column="nickname" property="nickname" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="CHAR" />
<result column="city" property="city" jdbcType="VARCHAR" />
<result column="province" property="province" jdbcType="VARCHAR" />
<result column="country" property="country" jdbcType="VARCHAR" />
<result column="headimgurl" property="headimgurl" jdbcType="VARCHAR" />
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="openid" property="openid" jdbcType="VARCHAR"/>
<result column="nickname" property="nickname" jdbcType="VARCHAR"/>
<result column="sex" property="sex" jdbcType="CHAR"/>
<result column="city" property="city" jdbcType="VARCHAR"/>
<result column="province" property="province" jdbcType="VARCHAR"/>
<result column="country" property="country" jdbcType="VARCHAR"/>
<result column="headimgurl" property="headimgurl" jdbcType="VARCHAR"/>
<result column="subscribetime" property="subscribetime"
jdbcType="TIMESTAMP" />
<result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
jdbcType="TIMESTAMP"/>
<result column="createtime" property="createtime" jdbcType="TIMESTAMP"/>
<result column="status" property="status"/>
<result column="source" property="source"/>
<result column="recommender" property="recommender"/>
......@@ -24,17 +24,17 @@
</resultMap>
<resultMap id="BaseResultMapStore" type="com.cftech.mp.fans.model.MpFanssEntity">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="openid" property="openid" jdbcType="VARCHAR" />
<result column="nickname" property="nickname" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="CHAR" />
<result column="city" property="city" jdbcType="VARCHAR" />
<result column="province" property="province" jdbcType="VARCHAR" />
<result column="country" property="country" jdbcType="VARCHAR" />
<result column="headimgurl" property="headimgurl" jdbcType="VARCHAR" />
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="openid" property="openid" jdbcType="VARCHAR"/>
<result column="nickname" property="nickname" jdbcType="VARCHAR"/>
<result column="sex" property="sex" jdbcType="CHAR"/>
<result column="city" property="city" jdbcType="VARCHAR"/>
<result column="province" property="province" jdbcType="VARCHAR"/>
<result column="country" property="country" jdbcType="VARCHAR"/>
<result column="headimgurl" property="headimgurl" jdbcType="VARCHAR"/>
<result column="subscribetime" property="subscribetime"
jdbcType="TIMESTAMP" />
<result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
jdbcType="TIMESTAMP"/>
<result column="createtime" property="createtime" jdbcType="TIMESTAMP"/>
<result column="status" property="status"/>
<result column="source" property="source"/>
<result column="recommender" property="recommender"/>
......@@ -49,12 +49,12 @@
<sql id="Base_Column_List_Store">
t.id, t.openid,t.canceltime,
CONVERT(AES_DECRYPT(t.nickname,'aideakey') USING UTF8),t.sex, CONVERT(AES_DECRYPT(t.city,'aideakey') USING UTF8),CONVERT(AES_DECRYPT(t.province,'aideakey') USING UTF8),t.country,t.headimgurl,t.createtime,t.subscribetime,
CONVERT(AES_DECRYPT(t.nickname,'aideakey') USING UTF8) nickname,t.sex, CONVERT(AES_DECRYPT(t.city,'aideakey') USING UTF8) city,CONVERT(AES_DECRYPT(t.province,'aideakey') USING UTF8) province,t.country,t.headimgurl,t.createtime,t.subscribetime,
t.delflag,t.status,t.source
</sql>
<sql id="Base_Column_List">
id, openid,canceltime,CONVERT(AES_DECRYPT(nickname,'aideakey') USING UTF8), sex,CONVERT(AES_DECRYPT(city,'aideakey') USING UTF8) ,CONVERT(AES_DECRYPT(province,'aideakey') USING UTF8),country,country,headimgurl,createtime,subscribetime,delflag,status,source,recommender,store,taglist
id, openid,canceltime,CONVERT(AES_DECRYPT(nickname,'aideakey') USING UTF8) nickname, sex,CONVERT(AES_DECRYPT(city,'aideakey') USING UTF8) city,CONVERT(AES_DECRYPT(province,'aideakey') USING UTF8) province,country,country,headimgurl,createtime,subscribetime,delflag,status,source,recommender,store,taglist
</sql>
......@@ -70,7 +70,8 @@
<if test="cond.condType == 'LESSEQUAL'">${cond.param} &lt;= #{cond.value}</if>
<if test="cond.condType == 'LESSTHAN'">${cond.param} &lt; #{cond.value}</if>
<if test="cond.condType == 'BETWEEN'">${cond.param} BETWEEN #{cond.startValue} AND
#{cond.endValue}</if>
#{cond.endValue}
</if>
<if test="cond.condType == 'ISNULL'">${cond.param} IS NULL</if>
<if test="cond.condType == 'NOTNULL'">${cond.param} IS NOT NULL</if>
<if test="cond.condType == 'LIKE'">${cond.param} LIKE #{cond.value}</if>
......@@ -87,8 +88,6 @@
</sql>
<!-- 插入用户服务号 -->
<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.cftech.mp.fans.model.MpFanssEntity">
insert into wx_mp_fanss ( openid, nickname,
......@@ -131,12 +130,12 @@
<select id="getMpFans" resultMap="BaseResultMap"
parameterType="java.lang.Long">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from wx_mp_fanss where mpaccountid = #{userid,jdbcType=BIGINT} and delflag=0 order by
delflag asc,createtime desc
</select>
<select id="selectFannscounts" resultType="Long" >
<select id="selectFannscounts" resultType="Long">
select
count(1)
from wx_mp_fanss where mpaccountid = #{userid,jdbcType=BIGINT} and delflag=0
......@@ -146,7 +145,7 @@
<!-- 分页条件查询 -->
<select id="getMpFansAndPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from wx_mp_fanss where mpaccountid = #{userid,jdbcType=BIGINT} and delflag=0 order by
delflag asc,createtime desc
</select>
......@@ -154,7 +153,7 @@
<select id="getDetail" resultMap="BaseResultMap" parameterType="java.lang.Long">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from wx_mp_fanss where id = #{id,jdbcType=BIGINT} and delflag=0
</select>
......@@ -313,8 +312,8 @@
<select id="fetchSearchByPage" parameterType="java.util.Map"
resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
,(
<include refid="Base_Column_List"/>
,(
SELECT
GROUP_CONCAT(NAME SEPARATOR ',')
FROM
......@@ -323,7 +322,7 @@
FIND_IN_SET(groupid,SUBSTRING_INDEX(t.taglist,',',20))
) tags
FROM wx_mp_fanss t
<include refid="sqlWhere" />
<include refid="sqlWhere"/>
<if test="areaname!=null">
AND (t.city like #{areaname} or t.province like #{areaname})
</if>
......@@ -333,7 +332,7 @@
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM wx_mp_fanss t
<include refid="sqlWhere" />
<include refid="sqlWhere"/>
<if test="areaname!=null">
AND (t.city like #{areaname} or t.province like #{areaname})
</if>
......@@ -369,7 +368,7 @@
<select id="fetchSearchByPageStore" parameterType="java.util.Map"
resultMap="BaseResultMapStore">
SELECT
<include refid="Base_Column_List_Store" />
<include refid="Base_Column_List_Store"/>
,(
SELECT
GROUP_CONCAT(NAME SEPARATOR ',')
......@@ -380,7 +379,7 @@
) tags
from wx_mp_fanss t
<include refid="sqlWhere" />
<include refid="sqlWhere"/>
<if test="areaname!=null">
AND (t.city like #{areaname} or t.province like #{areaname})
</if>
......
......@@ -7,29 +7,42 @@ import lombok.Data;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import java.util.Date;
/**
* 服务号粉丝账户信息
* @author lisw
*
* @author lisw
*/
@JsonSerialize
@Data
@JsonNaming(PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy.class)
public class MpFanssEntity extends BasicEntity{
public class MpFanssEntity extends BasicEntity {
private static final long serialVersionUID = -2537256381609738771L;
private String openid; //公众号OPENID
private String nickname; //粉丝姓名
private String sex; //粉丝性别
private String city; //粉丝来源城市
private String province; //粉丝来源省会
private String country; //粉丝国家
private String headimgurl;//粉丝头像
private Date subscribetime; //关注事件
private String unionid;//UNIONID
private Long mpaccountid;// 来源服务号ID
private String taglist; //标签列表
private String source;//来源 1.导购二维码 2.门店二维码 3.普通关注
private String source;//来源 0.普通关注; 1:药师;2:客服;3:医生;4:组织
private String recommender;//推荐人
......@@ -41,49 +54,54 @@ public class MpFanssEntity extends BasicEntity{
/**
* 粉丝标签,中文名
*
* @return
*/
private String tags;
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags;
}
public String getCanceltime() {
return canceltime;
}
public void setCanceltime(String canceltime) {
this.canceltime = canceltime;
}
/**
*
* @return
*/
private String storeName;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getRecommender() {
return recommender;
}
public void setRecommender(String recommender) {
this.recommender = recommender;
}
......@@ -99,66 +117,87 @@ public class MpFanssEntity extends BasicEntity{
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getTaglist() {
return taglist;
}
public void setTaglist(String taglist) {
this.taglist = taglist;
}
public Long getMpaccountid() {
return mpaccountid;
}
public void setMpaccountid(Long mpaccountid) {
this.mpaccountid = mpaccountid;
}
public Date getSubscribetime() {
return subscribetime;
}
public void setSubscribetime(Date subscribetime) {
this.subscribetime = subscribetime;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getHeadimgurl() {
return headimgurl;
}
public void setHeadimgurl(String headimgurl) {
this.headimgurl = headimgurl;
}
......@@ -166,9 +205,11 @@ public class MpFanssEntity extends BasicEntity{
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
@Override
public String toString() {
return "MpFanssEntity [openid=" + openid + ", nickname=" + nickname
......
......@@ -156,8 +156,9 @@ public class CoreService {
//@李士伟 客服消息转发前还是要有自动回复,而且希望根据时间回复不同内容。8:30-16:30回复“您好,
// 很高兴为您服务!”,其他时间段回复“非常抱歉哦~我们客服服务时间段是08:30-16:30哦~有需要请08:30之后在线咨询哦~或者是拨打全国服务热线4008288988/95105910咨询哦
if (msgType.equals(MessageUtil.REQ_MESSAGE_TYPE_TEXT)) {//文字消息进行关键字回复
String content = requestMap.get("Content");
return replyMessage(fromUserName, toUserName, content, "keyword");
// String content = requestMap.get("Content");
// return replyMessage(fromUserName, toUserName, content, "keyword");
return "";
}
// 图片消息
else if (msgType.equals(MessageUtil.REQ_MESSAGE_TYPE_IMAGE)) {
......@@ -195,15 +196,15 @@ public class CoreService {
mpFanssService.deleteByOpenId(fromUserName);
return "";
} else if (eventType.equals(MessageUtil.EVENT_TYPE_CLICK)) {// 自定义菜单点击事件
Menu menu = menuServices.fetchById(eventKey);
if (StringUtils.equals(menu.getMsgType(), "1")) {
String content = MessageUtil.textMessageToXml(text(fromUserName, toUserName, menu.getSourceContent()));
return content;
} else if (StringUtils.equals(menu.getMsgType(), "2")) {
return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, menu.getSourceContent()));
} else if (StringUtils.equals(menu.getMsgType(), "3")) {
return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, menu.getSourceContent()));
}
// Menu menu = menuServices.fetchById(eventKey);
// if (StringUtils.equals(menu.getMsgType(), "1")) {
// String content = MessageUtil.textMessageToXml(text(fromUserName, toUserName, menu.getSourceContent()));
// return content;
// } else if (StringUtils.equals(menu.getMsgType(), "2")) {
// return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, menu.getSourceContent()));
// } else if (StringUtils.equals(menu.getMsgType(), "3")) {
// return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, menu.getSourceContent()));
// }
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_GET_CARD)) {//用户领取卡券
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_GIFTING_CARD)) {//用户转赠卡券
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_CONSUME_CARD)) {//核销卡券
......@@ -234,30 +235,30 @@ public class CoreService {
conds.equal("delflag", 0);
conds.equal("accountsid", mpAccountEntity.getId());
conds.equal("send_type", "subscribe");
Reply reply = replyService.fetchSearchByConds(conds);
if (reply != null) {
if (reply.getReplyType().equals("text")) {//回复文本
return MessageUtil.textMessageToXml(text(fromUserName, toUserName, reply.getContentSource()));
} else if (reply.getReplyType().equals("news")) {//回复微信图文
return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, reply.getContentSource()));
} else if (reply.getReplyType().equals("article")) {//回复文章
return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, reply.getContentSource()));
}
}
// Reply reply = replyService.fetchSearchByConds(conds);
// if (reply != null) {
// if (reply.getReplyType().equals("text")) {//回复文本
// return MessageUtil.textMessageToXml(text(fromUserName, toUserName, reply.getContentSource()));
// } else if (reply.getReplyType().equals("news")) {//回复微信图文
// return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, reply.getContentSource()));
// } else if (reply.getReplyType().equals("article")) {//回复文章
// return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, reply.getContentSource()));
// }
// }
} else if (replyType.equals("keyword")) {
List<Reply> replyList = replyService.fetchkeywordByPage(content, mpAccountEntity.getId(), "keyword");
if (replyList != null && replyList.size() > 0) {
Reply reply = replyList.get(0);
if (reply.getReplyType().equals("text")) {//回复文本
return MessageUtil.textMessageToXml(text(fromUserName, toUserName, reply.getContentSource()));
} else if (reply.getReplyType().equals("news")) {//回复微信图文
return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, reply.getContentSource()));
} else if (reply.getReplyType().equals("article")) {//回复文章
return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, reply.getContentSource()));
}
} else {//没有匹配到关键字,接入到客服
return MessageUtil.customerServiceMessageToXml(resBaseMessage(fromUserName, toUserName));
}
// List<Reply> replyList = replyService.fetchkeywordByPage(content, mpAccountEntity.getId(), "keyword");
// if (replyList != null && replyList.size() > 0) {
// Reply reply = replyList.get(0);
// if (reply.getReplyType().equals("text")) {//回复文本
// return MessageUtil.textMessageToXml(text(fromUserName, toUserName, reply.getContentSource()));
// } else if (reply.getReplyType().equals("news")) {//回复微信图文
// return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, reply.getContentSource()));
// } else if (reply.getReplyType().equals("article")) {//回复文章
// return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, reply.getContentSource()));
// }
// } else {//没有匹配到关键字,接入到客服
// return MessageUtil.customerServiceMessageToXml(resBaseMessage(fromUserName, toUserName));
// }
} else {
}
......@@ -412,18 +413,14 @@ public class CoreService {
*/
public void updateFanssSource(String openid,String bindId,String ticket,String wxQrcodeType){
MpFanssEntity fans = mpFanssService.getWxUser(openid);
if(StringUtils.equals(wxQrcodeType,"meeting")){
if(StringUtils.equals(wxQrcodeType,"1")){//药师二维码
wxQrcodeType = "1";
}else if(StringUtils.equals(wxQrcodeType,"exhibi")){
} else if(StringUtils.equals(wxQrcodeType,"2")){//客服二维码
wxQrcodeType = "2";
}else if(StringUtils.equals(wxQrcodeType,"exhibiApp")){
} else if(StringUtils.equals(wxQrcodeType,"3")){//医生二维码
wxQrcodeType = "3";
}else if(StringUtils.equals(wxQrcodeType,"typeform")){
} else if(StringUtils.equals(wxQrcodeType,"4")){//组织二维码
wxQrcodeType = "4";
}else if(StringUtils.equals(wxQrcodeType,"brandApply")){
wxQrcodeType = "6";
}else if(StringUtils.equals(wxQrcodeType,"supplierlist")){
wxQrcodeType = "7";
}
if (fans != null) {
MpFanssEntity realFans = new MpFanssEntity();
......@@ -459,12 +456,12 @@ public class CoreService {
Long bindId = wxQrcode.getBindId();
String wxQrcodeType = wxQrcode.getType();
qrcodeRecord.setType(wxQrcodeType);
if(bindId!=null){
if (bindId!=null){
qrcodeRecord.setKeywords(String.valueOf(bindId));
}
qrcodeRecordService.save(qrcodeRecord);
if (event.equals(MessageUtil.EVENT_TYPE_SUBSCRIBE)) {
updateFanssSource(fromUserName,String.valueOf(bindId),ticket,wxQrcodeType);
updateFanssSource(fromUserName, String.valueOf(bindId), ticket, wxQrcodeType);
return rtnMessage(wxQrcodeType, fromUserName, toUserName, bindId);
} else {
return rtnMessage(wxQrcodeType, fromUserName, toUserName, bindId);
......@@ -563,8 +560,7 @@ public class CoreService {
fannsEntity.setSource(type);
fannsEntity.setRecommender(store);
fannsEntity.setStatus(ticket);
fannsEntity.setSubscribetime(new Date(Long.parseLong(user
.getSubscribe_time()) * 1000));
fannsEntity.setSubscribetime(new Date(Long.parseLong(user.getSubscribe_time()) * 1000));
fannsEntity.setUnionid(user.getUnionid());
String tags = "";
if (user.getTagid_list() != null && user.getTagid_list().size() > 0) {
......
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