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

Aidea product update by Strive Date 2020-10-30

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