Commit 0a9a7afe authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-11-28

parent 34e8669d
package com.cftech.sys.controller; package com.cftech.sys.controller;
import com.alibaba.fastjson.JSONPObject;
import com.cftech.accounts.model.MpAccountsEntity; import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
import com.cftech.core.scope.OrderType; import com.cftech.core.scope.OrderType;
......
...@@ -170,6 +170,26 @@ ...@@ -170,6 +170,26 @@
> >
</div> </div>
<div class="form-group form-md-line-input col-xs-3">
<label>用药人别称</label>
<input type="text"
class="form-control" name="fansAlias"
id="fansAlias"
maxlength="50" placeholder="用药人姓名"
value="$!{data.fansAlias}" #if ($!{isView} == 'true') readonly="readonly" #elseif ($!{data.fansAlias}) readonly="readonly" #end
>
</div>
<div class="form-group form-md-line-input col-xs-3">
<label>审核状态<font style="color: red"></font></label>
<input type="text"
class="form-control" name="status"
id="status" readonly="readonly"
maxlength="50" placeholder="status"
value="$!{data.status}"
>
</div>
<div class="form-group form-md-line-input col-xs-3"> <div class="form-group form-md-line-input col-xs-3">
<label>药师姓名<font style="color: red"></font></label> <label>药师姓名<font style="color: red"></font></label>
<input type="text" <input type="text"
...@@ -190,45 +210,74 @@ ...@@ -190,45 +210,74 @@
> >
</div> </div>
<div class="form-group form-md-line-input col-md-3"> <div class="form-group form-md-line-input col-xs-3">
<label>处方医院</label> <label>处方医院</label>
#if ($!{isView} == 'true') #if ($!{isView} == 'true')
<input type="text" <input type="text"
class="form-control" value="$!{data.hospital}" class="form-control" value="$!{data.hospital}"
readonly="readonly" readonly="readonly"
maxlength="50" placeholder="处方医院" /> maxlength="50" placeholder="处方医院"/>
#else #else
<div class="input-group"> <div class="input-group">
<input type="text" name="allergy" id="allergy" value="$!{data.allergy}" class="form-control" style="display: none"> <input type="text" name="allergy" id="allergy" value="$!{data.allergy}"
<input type="text" id="hospital" name="hospital" value="$!{data.hospital}" class="form-control" disabled> class="form-control" style="display: none">
<input type="text" id="hospital" name="hospital"
value="$!{data.hospital}" class="form-control" disabled>
<span class="input-group-btn"> <span class="input-group-btn">
<button type="button" name="selHospital" id="selHospital" class="btn btn-info btn-flat">选择</button> <button type="button" name="selHospital" id="selHospital"
class="btn btn-info btn-flat">选择</button>
</span> </span>
</div> </div>
#end #end
</div> </div>
<div class="form-group form-md-line-input col-md-3"> <div class="form-group form-md-line-input col-xs-3">
<label>处方医生</label> <label>处方医生</label>
#if ($!{isView} == 'true') #if ($!{isView} == 'true')
<input type="text" <input type="text"
class="form-control" value="$!{data.pharmacist}" class="form-control" value="$!{data.pharmacist}"
readonly="readonly" readonly="readonly"
maxlength="50" placeholder="处方医生" /> maxlength="50" placeholder="处方医生"/>
#else #else
<div class="input-group"> <div class="input-group">
<input type="text" name="pastRecords" id="pastRecords" value="$!{data.pastRecords}" class="form-control" style="display: none"> <input type="text" name="pastRecords" id="pastRecords"
<input type="text" id="pharmacist" name="pharmacist" value="$!{data.pharmacist}" class="form-control" disabled> value="$!{data.pastRecords}" class="form-control"
style="display: none">
<input type="text" id="pharmacist" name="pharmacist"
value="$!{data.pharmacist}" class="form-control" disabled>
<span class="input-group-btn"> <span class="input-group-btn">
<button type="button" name="selDoctor" id="selDoctor" class="btn btn-info btn-flat">选择</button> <button type="button" name="selDoctor" id="selDoctor"
class="btn btn-info btn-flat">选择</button>
</span> </span>
</div> </div>
#end #end
</div> </div>
<div class="form-group form-md-line-input col-xs-6">
<label>审核未通过原因<font style="color: red"></font></label>
<div class="form-control" name="description"
id="description"
maxlength="50"
style="height: 68px;background: #EEEEEE"
>$!{data.description}
</div>
</div>
<div class="form-group form-md-line-input col-xs-3">
<label></label>
<div class="input-group">
<input type="text" name="historySheet" id="historySheet" class="form-control"
style="display: none">
<input type="text" id="historySheetName" name="historySheetName"
class="form-control" style="display: none">
<span class="input-group-btn">
<button type="button" name="history" id="history"
class="btn btn-info btn-flat">查看历史咨询单</button>
</span>
</div>
</div>
<div class="form-group form-md-line-input col-xs-3"> <div class="form-group form-md-line-input col-xs-3">
<label>处方单<font style="color: red"></font></label> <label>处方单<font style="color: red"></font></label>
<br/> <br/>
...@@ -238,25 +287,7 @@ ...@@ -238,25 +287,7 @@
</div> </div>
</div> </div>
<div class="form-group form-md-line-input col-xs-3">
<label>审核状态<font style="color: red"></font></label>
<input type="text"
class="form-control" name="status"
id="status" readonly="readonly"
maxlength="50" placeholder="status"
value="$!{data.status}"
>
</div>
<div class="form-group form-md-line-input col-xs-6">
<label>审核未通过原因<font style="color: red"></font></label>
<div class="form-control" name="description"
id="description"
maxlength="50"
style="height: 68px;background: #EEEEEE"
>$!{data.description}
</div>
</div>
</div> </div>
</div> </div>
...@@ -565,6 +596,9 @@ ...@@ -565,6 +596,9 @@
}); });
} }
/**
* 处方医院
*/
$("#selHospital").click(function () { $("#selHospital").click(function () {
Cfapp.f7({ Cfapp.f7({
dataUrl: "#springUrl('/a/wxQrcode/listOrg')", dataUrl: "#springUrl('/a/wxQrcode/listOrg')",
...@@ -605,9 +639,22 @@ ...@@ -605,9 +639,22 @@
}) })
}); });
/**
* 处方医生
*/
$("#selDoctor").click(function () { $("#selDoctor").click(function () {
let allergy = $(`input[name='allergy']`).val();
if (allergy == null || allergy == '') {
Cfapp.alert({
message: "请先选择处方医院!",
btntext: "确定",
success: function () {}
});
return;
}
Cfapp.f7({ Cfapp.f7({
dataUrl: "#springUrl('/a/wxQrcode/listUser?type=" + 3 + "')", dataUrl: "#springUrl('/a/wxQrcode/listUser?type=" + 3 + "&allergy="+allergy+"')",
checkType: "single", // 多选为multi checkType: "single", // 多选为multi
title: '请选择医生', title: '请选择医生',
btnoktext: "确定", btnoktext: "确定",
...@@ -661,6 +708,43 @@ ...@@ -661,6 +708,43 @@
btnoktext: "确定", btnoktext: "确定",
btncanceltext: "取消", btncanceltext: "取消",
success: function () { success: function () {
let fansAlias = $(`input[name="fansAlias"]`).val();
if (fansAlias == null || fansAlias == '') {
Cfapp.alert({
message: "请输入用药人别名!",
btntext: "确定",
success: function () {
$("#save").attr("disabled", false);
}
});
return;
}
//是否增加医生
let allergy = $(`input[name="allergy"]`).val();
if (allergy == null || allergy == '') {
Cfapp.alert({
message: "请选择处方医院!",
btntext: "确定",
success: function () {
$("#save").attr("disabled", false);
}
});
return;
}
//是否增加医院
let pastRecords = $(`input[name="pastRecords"]`).val();
if (pastRecords == null || pastRecords == '') {
Cfapp.alert({
message: "请选择处方医生!",
btntext: "确定",
success: function () {
$("#save").attr("disabled", false);
}
});
return;
}
//验证商品是否重复 //验证商品是否重复
var arr = []; var arr = [];
...@@ -686,6 +770,7 @@ ...@@ -686,6 +770,7 @@
return; return;
} }
//验证是否增加商品
var datas = []; var datas = [];
$(".translate").each(function (index,item){ $(".translate").each(function (index,item){
datas.push({ datas.push({
...@@ -712,6 +797,7 @@ ...@@ -712,6 +797,7 @@
"status": "1", "status": "1",
"pastRecords": $("#pastRecords").val(), "pastRecords": $("#pastRecords").val(),
"allergy": $("#allergy").val(), "allergy": $("#allergy").val(),
"fansAlias": $(`input[name='fansAlias']`).val(),
"goodsDes": JSON.stringify(datas) "goodsDes": JSON.stringify(datas)
}; };
$.getJSON("#springUrl('/a/consultSheet/updateStatus')", dataJSON, function (returnobj) { $.getJSON("#springUrl('/a/consultSheet/updateStatus')", dataJSON, function (returnobj) {
...@@ -754,6 +840,90 @@ ...@@ -754,6 +840,90 @@
}; };
}(); }();
/**
* 查看历史咨询单
*/
var openid = `$!{data.openId}`;
$("#history").click(function () {
Cfapp.f7({
dataUrl: "#springUrl('/a/consultSheet/listData?openId="+openid+"')",
checkType: "single", // 多选为multi
title: '查看历史咨询单',
btnoktext: "确定",
btncanceltext: "取消",
columns: ["咨询单编码", "订单编码", "用药人", "手机号", "状态", "拒绝原由", "创建时间", "审核时间"],
isSearch: '0',
searchColumns: ["consultId"],//搜索的字段名称
searchColumnsRemarks: ["咨询单编码"],//搜索的字段备注
aoColumns: [{
"mData": "consultId"
}, {
"mData": "orderCode"
}, {
"mData": "userName"
}, {
"mData": "phone"
}, {
"mData": "status"
}, {
"mData": "description"
}, {
"mData": "createTime"
}, {
"mData": "auditTime"
}],
aoColumnDefs: [{
"aTargets": [0],
"mData": "consultId",
"mRender": function (a, b, c, d) {
return a;
}
},{
"aTargets": [4],
"mData": "createTime",
"mRender": function (a, b, c, d) {
if (a == 0) {
return "待审核";
} else if (a == 1) {
return "已通过";
} else if (a == 2) {
return "已拒绝";
}
}
},{
"aTargets": [6],
"mData": "createTime",
"mRender": function (a, b, c, d) {
if (a) {
return formatDates(a);
} else {
return null;
}
}
}],
success: function () {
},
cancel: function () {
},
storeFields: 'historySheet', // 储存的字段
displayFields: 'historySheetName'
})
});
function formatDates(now) {
var now = new Date(now);
var year = now.getFullYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var hour = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
return year + "-" + (month <= 9 ? "0" + month : month) + "-" + (date <= 9 ? "0" + date : date) + " " + (hour <= 9 ? "0" + hour : hour) + ":"
+ (minute <= 9 ? "0" + minute : minute) + ":" + (second <= 9 ? "0" + second : second);
}
</script> </script>
</body> </body>
......
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
</head> </head>
<body class="hold-transition skin-blue sidebar-mini"> <body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper"> <div class="wrapper">
<div class="content-wrapper" style="margin-left:0;"> <div class="content-wrapper" style="margin-left:0;">
<div id="importExcelDiv"></div> <div id="importExcelDiv"></div>
...@@ -523,8 +522,6 @@ ...@@ -523,8 +522,6 @@
}); });
$("#table").dataTable().fnClearTable(); $("#table").dataTable().fnClearTable();
} }
</script> </script>
</body> </body>
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
a.id, a.id,
a.consult_id, a.consult_id,
CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8) userName, CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8) userName,
CONVERT(AES_DECRYPT(a.number_id,'aideakey') USING UTF8) numberId, a.number_id 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,
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
a.allergy, a.allergy,
a.symptom, a.symptom,
a.diagnosis, a.diagnosis,
a.open_id, a.open_id openId,
a.drugs_id, a.drugs_id,
a.member_id, a.member_id,
a.order_id, a.order_id,
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
#{id, jdbcType=BIGINT}, #{id, jdbcType=BIGINT},
#{consultId, jdbcType=VARCHAR}, #{consultId, jdbcType=VARCHAR},
AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'), AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'),
AES_ENCRYPT(#{numberId, jdbcType=VARBINARY},'aideakey'), #{numberId, jdbcType=VARCHAR},
#{sex, jdbcType=BIGINT}, #{sex, jdbcType=BIGINT},
AES_ENCRYPT(#{phone, jdbcType=VARBINARY},'aideakey'), AES_ENCRYPT(#{phone, jdbcType=VARBINARY},'aideakey'),
#{pastRecords, jdbcType=VARCHAR}, #{pastRecords, jdbcType=VARCHAR},
...@@ -182,13 +182,15 @@ ...@@ -182,13 +182,15 @@
<select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet"> <select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital <include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
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
LEFT JOIN t_qyuser d ON d.id = a.past_records LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_orgunit e ON e.id = a.allergy LEFT JOIN t_orgunit e ON e.id = a.allergy
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id
WHERE a.id = #{id} WHERE a.id = #{id}
GROUP BY id
</select> </select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
...@@ -254,7 +256,7 @@ ...@@ -254,7 +256,7 @@
user_name = AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'), user_name = AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'),
</if> </if>
<if test="numberId != null"> <if test="numberId != null">
number_id = AES_ENCRYPT(#{numberId, jdbcType=VARBINARY},'aideakey'), number_id = #{numberId, jdbcType=VARBINARY},
</if> </if>
<if test="sex != null"> <if test="sex != null">
sex = #{sex, jdbcType=BIGINT}, sex = #{sex, jdbcType=BIGINT},
......
...@@ -23,7 +23,7 @@ public class ConsultSheet extends UserSheet implements Serializable { ...@@ -23,7 +23,7 @@ public class ConsultSheet extends UserSheet implements Serializable {
/* 用药人name */ /* 用药人name */
@ExportConfig(value = "用药人姓名", width = 100, showLevel = 1) @ExportConfig(value = "用药人姓名", width = 100, showLevel = 1)
private String userName; private String userName;
/* 身份证号 */ /* */
private String numberId; private String numberId;
/* 性别 */ /* 性别 */
@ExportConfig(value = "性别", width = 100, showLevel = 1) @ExportConfig(value = "性别", width = 100, showLevel = 1)
...@@ -45,7 +45,7 @@ public class ConsultSheet extends UserSheet implements Serializable { ...@@ -45,7 +45,7 @@ public class ConsultSheet extends UserSheet implements Serializable {
private Long serviceId; private Long serviceId;
/* 线下已确证疾病 */ /* 线下已确证疾病 */
private String symptom; private String symptom;
/*是否已在医院确诊*/ /*是否勾选处方单真实性声明 0:未勾选 1:勾选*/
private Long diagnosis; private Long diagnosis;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
...@@ -58,7 +58,7 @@ public class ConsultSheet extends UserSheet implements Serializable { ...@@ -58,7 +58,7 @@ public class ConsultSheet extends UserSheet implements Serializable {
private Date createTime; private Date createTime;
/* 更新时间 */ /* 更新时间 */
private Date updateTime; private Date updateTime;
/* 是否勾选处方单真实性声明 0:未勾选 1:勾选 */ /* 别名 */
private String description; private String description;
/* 创建人 */ /* 创建人 */
private Long createBy; private Long createBy;
...@@ -91,10 +91,12 @@ public class ConsultSheet extends UserSheet implements Serializable { ...@@ -91,10 +91,12 @@ public class ConsultSheet extends UserSheet implements Serializable {
private String endAuditTime; private String endAuditTime;
private String hospital;//处方医院 private String hospital;//处方医院
private String pharmacist;//处方医生 private String pharmacist;//处方医生
private String fansAlias;//粉丝别名
public ConsultSheet() { public ConsultSheet() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
this.diagnosis = 0L;
} }
} }
\ No newline at end of file
...@@ -3,11 +3,15 @@ package com.cftech.consultsheet.web; ...@@ -3,11 +3,15 @@ package com.cftech.consultsheet.web;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
import com.cftech.addresst.model.Address; import com.cftech.addresst.model.Address;
import com.cftech.addresst.service.AddressService; import com.cftech.addresst.service.AddressService;
import com.cftech.base.codingrule.utils.CodingruleUtils; import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.api.QyMsgUtil;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService;
import com.cftech.consultsheet.model.ConsultSheet; import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.consultsheet.model.ConsultSheetVO; import com.cftech.consultsheet.model.ConsultSheetVO;
import com.cftech.consultsheet.service.ConsultSheetService; import com.cftech.consultsheet.service.ConsultSheetService;
...@@ -16,6 +20,8 @@ import com.cftech.core.scope.OrderType; ...@@ -16,6 +20,8 @@ import com.cftech.core.scope.OrderType;
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.*; import com.cftech.core.util.*;
import com.cftech.mp.fans.model.MpFanssEntity;
import com.cftech.mp.fans.service.MpFanssService;
import com.cftech.order.model.Order; import com.cftech.order.model.Order;
import com.cftech.order.service.OrderService; import com.cftech.order.service.OrderService;
import com.cftech.sys.security.UserUtils; import com.cftech.sys.security.UserUtils;
...@@ -80,6 +86,15 @@ public class ConsultSheetController { ...@@ -80,6 +86,15 @@ public class ConsultSheetController {
@Autowired @Autowired
private AddressService addressService; private AddressService addressService;
@Autowired
private MpFanssService mpFanssService;
@Autowired
private QyuserService qyuserService;
@Autowired
private QyMsgUtil qyMsgUtil;
//列表页面 //列表页面
@RequiresPermissions(value = CONSULTSHEET_VIEW) @RequiresPermissions(value = CONSULTSHEET_VIEW)
...@@ -115,6 +130,15 @@ public class ConsultSheetController { ...@@ -115,6 +130,15 @@ public class ConsultSheetController {
str.replace(3, 7, "****"); str.replace(3, 7, "****");
consultSheet.setPhone(str.toString()); consultSheet.setPhone(str.toString());
} }
if (StringUtils.isNoneBlank(consultSheet.getOpenId())) {
Conds conds = new Conds();
conds.equal("t.openid", consultSheet.getOpenId());
conds.equal("t.delflag", Constants.DEL_FLAG_0);
MpFanssEntity mpFanssEntity = mpFanssService.fetchSearchByConds(conds);
if (mpFanssEntity != null && StringUtils.isNotBlank(mpFanssEntity.getStore())) {
consultSheet.setFansAlias(mpFanssEntity.getStore());
}
}
JSONObject object = JSON.parseObject(JSON.toJSONString(consultSheet)); JSONObject object = JSON.parseObject(JSON.toJSONString(consultSheet));
model.addAttribute("data", object); model.addAttribute("data", object);
model.addAttribute("isView", pageType.equals("View") ? true : false);//是否查看页面 model.addAttribute("isView", pageType.equals("View") ? true : false);//是否查看页面
...@@ -175,6 +199,9 @@ public class ConsultSheetController { ...@@ -175,6 +199,9 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getEndAuditTime())) { if (StringUtils.isNoneBlank(consultSheet.getEndAuditTime())) {
conds.lessEqual("DATE_FORMAT(a.audit_time, '%Y-%m-%d')", consultSheet.getEndAuditTime()); conds.lessEqual("DATE_FORMAT(a.audit_time, '%Y-%m-%d')", consultSheet.getEndAuditTime());
} }
if (StringUtils.isNoneBlank(consultSheet.getOpenId())) {
conds.equal("a.open_id", consultSheet.getOpenId());
}
Sort sort = new Sort("a.create_time", OrderType.DESC); Sort sort = new Sort("a.create_time", OrderType.DESC);
...@@ -318,6 +345,9 @@ public class ConsultSheetController { ...@@ -318,6 +345,9 @@ public class ConsultSheetController {
String url = SystemConfig.p.getProperty("MOBILE_MP_DOMAIN_NAME") + "/addzxd?appid=" + appid + "&tokenId=1&consultId="+consultSheet.getId(); String url = SystemConfig.p.getProperty("MOBILE_MP_DOMAIN_NAME") + "/addzxd?appid=" + appid + "&tokenId=1&consultId="+consultSheet.getId();
sendMessage(refuseTmpId, token, consultSheet.getOpenId(),first, remark, keywords, url); sendMessage(refuseTmpId, token, consultSheet.getOpenId(),first, remark, keywords, url);
//通知客服咨询单审核失败
sendQyWechatMassage(consultSheet);
rtnJson.put("errorNo", 0); rtnJson.put("errorNo", 0);
} }
} }
...@@ -351,7 +381,7 @@ public class ConsultSheetController { ...@@ -351,7 +381,7 @@ public class ConsultSheetController {
@RequiresPermissions(value = CONSULTSHEET_EDIT) @RequiresPermissions(value = CONSULTSHEET_EDIT)
@RequestMapping("/updateStatus") @RequestMapping("/updateStatus")
@ResponseBody @ResponseBody
public JSONObject updateStatus(Long consultId, String status, Long pastRecords, Long allergy, String goodsDes, HttpServletRequest request) { public JSONObject updateStatus(Long consultId, String status, Long pastRecords, Long allergy, String fansAlias, String goodsDes, HttpServletRequest request) {
Long accountId = UserUtils.getmpaccounts(request); Long accountId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
ConsultSheet consultSheet = consultSheetService.fetchById(consultId); ConsultSheet consultSheet = consultSheetService.fetchById(consultId);
...@@ -361,7 +391,10 @@ public class ConsultSheetController { ...@@ -361,7 +391,10 @@ public class ConsultSheetController {
goodsDes = HtmlUtils.htmlUnescape(contents); goodsDes = HtmlUtils.htmlUnescape(contents);
Integer integer = consultSheetService.updateStatus(consultId, status, goodsDes); Integer integer = consultSheetService.updateStatus(consultId, status, goodsDes);
if (integer > 0){ if (integer > 0){
//生成空订单
/**
* 生成空订单
*/
Order order = new Order(); Order order = new Order();
order.setNumber(codingruleUtils.getNumber(consultSheet.getAccountsId(), Order.class.getName())); order.setNumber(codingruleUtils.getNumber(consultSheet.getAccountsId(), Order.class.getName()));
order.setOpenid(consultSheet.getOpenId()); order.setOpenid(consultSheet.getOpenId());
...@@ -382,9 +415,22 @@ public class ConsultSheetController { ...@@ -382,9 +415,22 @@ public class ConsultSheetController {
order.setAddressDes(address.getProvinceName()+address.getCityName()+address.getCountyName()+address.getAddressName()); order.setAddressDes(address.getProvinceName()+address.getCityName()+address.getCountyName()+address.getAddressName());
} }
} }
orderService.save(order); orderService.save(order);
//如果粉丝别名为空,则更新粉丝别名
if (StringUtils.isNoneBlank(consultSheet.getOpenId())) {
Conds conds = new Conds();
conds.equal("t.openid", consultSheet.getOpenId());
conds.equal("t.delflag", Constants.DEL_FLAG_0);
MpFanssEntity mpFanssEntity = mpFanssService.fetchSearchByConds(conds);
if (mpFanssEntity != null && StringUtils.isBlank(mpFanssEntity.getStore())) {
mpFanssEntity.setStore(fansAlias);
mpFanssService.updateByOpenId(mpFanssEntity);
}
}
//反写咨询单 //反写咨询单
if (pastRecords != null) { if (pastRecords != null) {
consultSheet.setPastRecords(pastRecords); consultSheet.setPastRecords(pastRecords);
...@@ -392,6 +438,8 @@ public class ConsultSheetController { ...@@ -392,6 +438,8 @@ public class ConsultSheetController {
if (allergy != null) { if (allergy != null) {
consultSheet.setAllergy(allergy); consultSheet.setAllergy(allergy);
} }
//固化审批咨询单时别名
consultSheet.setNumberId(fansAlias);
consultSheet.setStatus(status); consultSheet.setStatus(status);
consultSheet.setOrderId(order.getId()); consultSheet.setOrderId(order.getId());
consultSheetService.update(consultSheet); consultSheetService.update(consultSheet);
...@@ -466,4 +514,23 @@ public class ConsultSheetController { ...@@ -466,4 +514,23 @@ public class ConsultSheetController {
json.append("}}"); json.append("}}");
JwTemplateMessageAPI.sendTemplateMsgJson(json.toString(),token); JwTemplateMessageAPI.sendTemplateMsgJson(json.toString(),token);
} }
public boolean sendQyWechatMassage(ConsultSheet consultSheet) {
Long accounts = Long.parseLong(SystemConfig.p.getProperty("QY_SEND_APPID"));
MpAccountsEntity accountsEntity = mpAccountsService.getDetail(accounts);
Long agenId = Long.parseLong(accountsEntity.getAgentId());
Conds qyuserConds = new Conds();
qyuserConds.equal("t.del_flag", Constants.DEL_FLAG_0);
qyuserConds.equal("t.id", consultSheet.getServiceId());//订单员职业
List<Qyuser> qyusers = qyuserService.fetchSearchByPage(qyuserConds, null, 0, 0);
if (qyusers == null || qyusers.size() <= 0) {
return false;
}
//推送客服消息
String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_AUDIT_FAIL_MAG") + consultSheet.getConsultId();
qyMsgUtil.sendText(accounts, false, qyusers, null, null, agenId, msg, false);
return true;
}
} }
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
a.id, a.id,
a.consult_id, a.consult_id,
CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8) userName, CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8) userName,
CONVERT(AES_DECRYPT(a.number_id,'aideakey') USING UTF8) numberId, a.number_id 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,
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
a.allergy, a.allergy,
a.symptom, a.symptom,
a.diagnosis, a.diagnosis,
a.open_id, a.open_id openId,
a.drugs_id, a.drugs_id,
a.member_id, a.member_id,
a.order_id, a.order_id,
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
#{id, jdbcType=BIGINT}, #{id, jdbcType=BIGINT},
#{consultId, jdbcType=VARCHAR}, #{consultId, jdbcType=VARCHAR},
AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'), AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'),
AES_ENCRYPT(#{numberId, jdbcType=VARBINARY},'aideakey'), #{numberId, jdbcType=VARCHAR},
#{sex, jdbcType=BIGINT}, #{sex, jdbcType=BIGINT},
AES_ENCRYPT(#{phone, jdbcType=VARBINARY},'aideakey'), AES_ENCRYPT(#{phone, jdbcType=VARBINARY},'aideakey'),
#{pastRecords, jdbcType=VARCHAR}, #{pastRecords, jdbcType=VARCHAR},
...@@ -182,13 +182,15 @@ ...@@ -182,13 +182,15 @@
<select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet"> <select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital <include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
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
LEFT JOIN t_qyuser d ON d.id = a.past_records LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_orgunit e ON e.id = a.allergy LEFT JOIN t_orgunit e ON e.id = a.allergy
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id
WHERE a.id = #{id} WHERE a.id = #{id}
GROUP BY id
</select> </select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
...@@ -254,7 +256,7 @@ ...@@ -254,7 +256,7 @@
user_name = AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'), user_name = AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'),
</if> </if>
<if test="numberId != null"> <if test="numberId != null">
number_id = AES_ENCRYPT(#{numberId, jdbcType=VARBINARY},'aideakey'), number_id = #{numberId, jdbcType=VARBINARY},
</if> </if>
<if test="sex != null"> <if test="sex != null">
sex = #{sex, jdbcType=BIGINT}, sex = #{sex, jdbcType=BIGINT},
......
...@@ -64,23 +64,25 @@ ...@@ -64,23 +64,25 @@
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="remindExampleModalLabel" style="font-weight: 700;">设置订单提醒</h4> <h4 class="modal-title" id="remindExampleModalLabel" style="font-weight: 700;">修改发货地址</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body" style="height: 80px;">
<form style="height: 80px;">
<div class="col-xs-6"> <div class="col-xs-6">
<select id="remind" name="remind" class="form-control required"> <div class="input-group">
<option value="0">请选择提醒周期</option> <input type="hidden" id="addressOpenId">
<option value="1">7天前</option> <input type="text" id="addressId" name="addressId"
<option value="2">当日</option> class="form-control" style="display: none">
<option value="3">7天后</option> <input type="text" name="addressName" id="addressName"
<option value="0">关闭提醒</option> class="form-control" style="width: 400px" disabled>
</select> <span class="input-group-btn">
<button type="button" name="selHospital" id="selHospital"
class="btn btn-info btn-flat">选择</button>
</span>
</div>
</div> </div>
</form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
...@@ -257,6 +259,7 @@ ...@@ -257,6 +259,7 @@
<th>订单金额</th> <th>订单金额</th>
<th>付款金额</th> <th>付款金额</th>
<th>昵称</th> <th>昵称</th>
<th>别名</th>
<th>openid</th> <th>openid</th>
<th>顺丰运单号</th> <th>顺丰运单号</th>
<th>订单状态</th> <th>订单状态</th>
...@@ -401,6 +404,10 @@ ...@@ -401,6 +404,10 @@
"mData": "nickName" "mData": "nickName"
} }
, ,
{
"mData": "fansAlias"
}
,
{ {
"mData": "openid" "mData": "openid"
} }
...@@ -457,9 +464,9 @@ ...@@ -457,9 +464,9 @@
'aTargets': [0], 'aTargets': [0],
"mData":"id", "mData":"id",
"mRender": function(a, b, c, d){ "mRender": function(a, b, c, d){
if (c.status == 4 ){ if (c.status == 4 || c.status == 3 || c.status == 2){
//是否超过7天 0标识超过7天 //是否超过7天 0标识超过7天
if( c.isExceedSevenDay == 0){ if( c.isExceedSevenDay == '0'){
if(isCheckedQyCode.indexOf(a+"")!=-1){ if(isCheckedQyCode.indexOf(a+"")!=-1){
return '<input class="isExport" checked value="'+a+'" type="checkBox">'; return '<input class="isExport" checked value="'+a+'" type="checkBox">';
}else{ }else{
...@@ -475,17 +482,6 @@ ...@@ -475,17 +482,6 @@
} }
}, },
/*{
'targets': [1],
"mData":"id",
"mRender": function(a, b, c, d){
if(isCheckedQyCode.indexOf(a+"")!=-1){
return '<input class="isExport" checked value="'+a+'" type="checkBox">';
}else{
return '<input class="isExport" value="'+a+'" type="checkBox">';
}
}
},*/
{ {
"aTargets": [1], "aTargets": [1],
"mData": "number", "mData": "number",
...@@ -525,7 +521,7 @@ ...@@ -525,7 +521,7 @@
"mData": "totalAmount", "mData": "totalAmount",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a != null) { if (a != null) {
return parseInt(a).toFixed(2); return parseInt(a/100).toFixed(2);
} }
return ''; return '';
} }
...@@ -545,15 +541,19 @@ ...@@ -545,15 +541,19 @@
, ,
{ {
"aTargets": [7], "aTargets": [7],
"mData": "openid", "mData": "fansAlias",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a) {
return a; return a;
} else {
return null;
}
} }
} }
, ,
{ {
"aTargets": [8], "aTargets": [8],
"mData": "courierNumber", "mData": "openid",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
} }
...@@ -561,6 +561,14 @@ ...@@ -561,6 +561,14 @@
, ,
{ {
"aTargets": [9], "aTargets": [9],
"mData": "courierNumber",
"mRender": function (a, b, c, d) {
return a;
}
}
,
{
"aTargets": [10],
"mData": "status", "mData": "status",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == '0') { if (a == '0') {
...@@ -579,7 +587,7 @@ ...@@ -579,7 +587,7 @@
} }
}, },
{ {
"aTargets": [10], "aTargets": [11],
"mData": "tradeNo", "mData": "tradeNo",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -587,7 +595,7 @@ ...@@ -587,7 +595,7 @@
} }
, ,
{ {
"aTargets": [11], "aTargets": [12],
"mData": "confirm", "mData": "confirm",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a == null ? '否':'是'; return a == null ? '否':'是';
...@@ -595,7 +603,7 @@ ...@@ -595,7 +603,7 @@
} }
, ,
{ {
"aTargets": [12], "aTargets": [13],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -607,7 +615,7 @@ ...@@ -607,7 +615,7 @@
} }
, ,
{ {
"aTargets": [13], "aTargets": [14],
"mData": "orderTime", "mData": "orderTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -619,7 +627,7 @@ ...@@ -619,7 +627,7 @@
} }
, ,
{ {
"aTargets": [14], "aTargets": [15],
"mData": "payTime", "mData": "payTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -631,7 +639,7 @@ ...@@ -631,7 +639,7 @@
} }
, ,
{ {
"aTargets": [15], "aTargets": [16],
"mData": "sendExpressDateStr", "mData": "sendExpressDateStr",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -639,7 +647,7 @@ ...@@ -639,7 +647,7 @@
} }
, ,
{ {
"aTargets": [16], "aTargets": [17],
"mData": "acceptExpressDateStr", "mData": "acceptExpressDateStr",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -647,7 +655,7 @@ ...@@ -647,7 +655,7 @@
} }
, ,
{ {
"aTargets": [17], "aTargets": [18],
"mData": "cancelTime", "mData": "cancelTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -659,7 +667,7 @@ ...@@ -659,7 +667,7 @@
} }
, ,
{ {
"aTargets": [18], "aTargets": [19],
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:order:edit"))'; var html = '#if($shiro.hasPermission("qy:order:edit"))';
...@@ -683,9 +691,8 @@ ...@@ -683,9 +691,8 @@
if (c.status != '4' && c.status != '5') { if (c.status != '4' && c.status != '5') {
html += '<li><a onclick="showModal(' + a + ')">订单关闭</a></li>'; html += '<li><a onclick="showModal(' + a + ')">订单关闭</a></li>';
} }
if (c.status == '4') { if (c.status == '1' || c.status == '2') {
//需求订单已完成设置提醒 html += '<li><a onclick="showRemindModal(' + a + ')">修改发货地址</a></li>';
html += '<li><a onclick="showRemindModal(' + a + ')">订单提醒</a></li>';
} }
// if (c.status == '2') {//待发货才可以出库操作 // if (c.status == '2') {//待发货才可以出库操作
// html += '<li><a href="#springUrl("/a/order/sendOut?id=' + a + '")">订单出库</a></li>'; // html += '<li><a href="#springUrl("/a/order/sendOut?id=' + a + '")">订单出库</a></li>';
...@@ -822,8 +829,6 @@ ...@@ -822,8 +829,6 @@
} }
} }
//alert(isCheckedQyCode)
}) })
}else{ }else{
$('#table tbody tr').each(function(){ $('#table tbody tr').each(function(){
...@@ -839,27 +844,19 @@ ...@@ -839,27 +844,19 @@
}); });
Cfapp.init(); Cfapp.init();
function showRemindModal(id) { function showRemindModal(orderId) {
$("#orderId").val(id); $("#addressOpenId").val(orderId);
$('#remindExampleModal').modal('show'); $('#remindExampleModal').modal('show');
} }
function submitRemind() { function submitRemind() {
let option = $('#remind option:selected') .val(); let addressId = $('#addressId') .val();
if (option == null || option == '') { var url = "#springUrl('/a/order/updateOrderAddress')";
Cfapp.alert({
message: "请选择对应周期",
btntext: "确定",
success: function () {}
});
return;
}
var url = "#springUrl('/a/order/setOrderRemind')";
$.ajax({ $.ajax({
url: url, url: url,
type: "GET", type: "GET",
data: {id: $("#orderId").val(), data: {orderId: $("#addressOpenId").val(),
option: option}, addressId: addressId},
success: function (rsp) { success: function (rsp) {
$('#remindExampleModal').modal('hide'); $('#remindExampleModal').modal('hide');
if (rsp.errorNo == "0") { if (rsp.errorNo == "0") {
...@@ -970,17 +967,6 @@ ...@@ -970,17 +967,6 @@
error: function () { error: function () {
} }
}) })
/*Cfapp.confirm({
message: "确定要开发票吗",
btnoktext: "确定",
btncanceltext: "取消",
success: function () {
},
cancel: function () {
$(".modal-backdrop").fadeOut();
}
});*/
} }
function updateStatu(id, status, reason) { function updateStatu(id, status, reason) {
...@@ -1073,6 +1059,88 @@ ...@@ -1073,6 +1059,88 @@
}); });
$("#table").dataTable().fnClearTable(); $("#table").dataTable().fnClearTable();
} }
$("#selHospital").click(function () {
let orderId = $('#addressOpenId').val();
console.log(orderId);
Cfapp.f7({
dataUrl: "#springUrl('/a/address/listData?orderId="+orderId+"')",
checkType: "single", // 多选为multi
title: '请选择发货地址',
btnoktext: "确定",
btncanceltext: "取消",
columns: ["选择", "收货人", "收货人电话", "省份", "城市", "区域", "详细地址" ],
isSearch: '0',
searchColumns: ["addressName"],//搜索的字段名称
searchColumnsRemarks: ["请输入收货认收货人"],//搜索的字段备注
aoColumns: [{
"mData": "id"
}, {
"mData": "addressName"
}, {
"mData": "phone"
}, {
"mData": "provinceName"
}, {
"mData": "cityName"
}, {
"mData": "countyName"
}, {
"mData": "address"
}],
aoColumnDefs: [{
"aTargets": [0],
"mData": "id",
"mRender": function (a, b, c, d) {
return '<input class="bindId" value="' + a + '" type="radio" id="' + a + '" name="sel" data-value="' + a + '" data-name="' + c.name + '">';
}
}, {
"aTargets": [1],
"mData": "addressName",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}, {
"aTargets": [2],
"mData": "phone",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
},{
"aTargets": [3],
"mData": "provinceName",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}, {
"aTargets": [4],
"mData": "cityName",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}, {
"aTargets": [5],
"mData": "countyName",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}, {
"aTargets": [6],
"mData": "address",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}],
success: function () {
},
cancel: function () {
},
storeFields: 'addressId', // 储存的字段
displayFields: 'addressName'
})
});
</script> </script>
</body> </body>
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
<result column="acceptExpressDateStr" property="acceptExpressDateStr"/> <result column="acceptExpressDateStr" property="acceptExpressDateStr"/>
<result column="outTime" property="outTime"/> <result column="outTime" property="outTime"/>
<result column="takeFrequency" property="takeFrequency"/> <result column="takeFrequency" property="takeFrequency"/>
<result column="fansAlias" property="fansAlias"/>
<collection property="list" ofType="com.cftech.order.model.ProductVO"> <collection property="list" ofType="com.cftech.order.model.ProductVO">
<result column="product_name" property="productName"/> <result column="product_name" property="productName"/>
</collection> </collection>
...@@ -341,13 +342,14 @@ ...@@ -341,13 +342,14 @@
a.address, a.address,
DATE_FORMAT(aw.create_time, '%Y-%m-%d %H:%i') outTime, DATE_FORMAT(aw.create_time, '%Y-%m-%d %H:%i') outTime,
o.remind_type, o.remind_type,
t.take_frequency takeFrequency t.take_frequency takeFrequency,
f.store fansAlias
FROM t_order o FROM t_order o
LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id
LEFT JOIN t_shipping_address s ON o.address_id = s.id LEFT JOIN t_shipping_address s ON o.address_id = s.id
LEFT JOIN t_order_details d ON o.id = d.order_id LEFT JOIN t_order_details d ON o.id = d.order_id
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
LEFT JOIN wx_mp_fanss f ON f.openid = o.openid LEFT JOIN wx_mp_fanss f ON f.openid = o.openid and f.delflag = '0'
LEFT JOIN wx_mp_member m on m.open_id = o.openid LEFT JOIN wx_mp_member m on m.open_id = o.openid
LEFT JOIN t_shipping_address a on a.id = o.address_id LEFT JOIN t_shipping_address a on a.id = o.address_id
LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id
...@@ -540,7 +542,7 @@ ...@@ -540,7 +542,7 @@
status = #{status}, status = #{status},
</if> </if>
<if test="status != null and status == 2"> <if test="status != null and status == 2">
pay_time = now(), pay_time = now(), pay_amount = order_amount * 100, total_amount = order_amount * 100,
</if> </if>
<if test="status != null and status == 5 and orderCancel!=null and orderCancel != ''"> <if test="status != null and status == 5 and orderCancel!=null and orderCancel != ''">
cancel_time = now(), cancel_time = now(),
......
...@@ -158,6 +158,7 @@ public class Order extends OrderDetail implements Serializable { ...@@ -158,6 +158,7 @@ public class Order extends OrderDetail implements Serializable {
private String acceptExpressDateStr;//签收时间 private String acceptExpressDateStr;//签收时间
private String outTime;//出库时间 private String outTime;//出库时间
private String takeFrequency;//服用频率 private String takeFrequency;//服用频率
private String fansAlias;//粉丝别名
......
...@@ -52,6 +52,8 @@ public class OrderMobile { ...@@ -52,6 +52,8 @@ public class OrderMobile {
/*区县*/ /*区县*/
private String area; private String area;
private long time;
private List<ProductMobile> ProductMobile; private List<ProductMobile> ProductMobile;
} }
...@@ -107,4 +107,11 @@ public interface OrderService extends GenericService<Order> { ...@@ -107,4 +107,11 @@ public interface OrderService extends GenericService<Order> {
* @return * @return
*/ */
String findOrderPayParams(String orderId, String openId, String appId, String prepayId); String findOrderPayParams(String orderId, String openId, String appId, String prepayId);
/**
* 发送
* @param id
* @return
*/
boolean sendQyWechatMassage(Long id);
} }
...@@ -7,6 +7,9 @@ import com.alibaba.fastjson.JSONObject; ...@@ -7,6 +7,9 @@ import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.MpAccountsEntity; import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.codingrule.utils.CodingruleUtils; import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.api.QyMsgUtil;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.core.util.DateFormatUtils; import com.cftech.core.util.DateFormatUtils;
...@@ -66,6 +69,12 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -66,6 +69,12 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
@Autowired @Autowired
private MpFanssService mpFanssService; private MpFanssService mpFanssService;
@Autowired
private QyuserService qyuserService;
@Autowired
private QyMsgUtil qyMsgUtil;
@Override @Override
public GenericDao<Order> getGenericMapper() { public GenericDao<Order> getGenericMapper() {
...@@ -231,12 +240,27 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -231,12 +240,27 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
List<OrderMobile> orderMobiles = orderMapper.orderFall(orderMobileDto); List<OrderMobile> orderMobiles = orderMapper.orderFall(orderMobileDto);
for (OrderMobile orderMobile : orderMobiles) { for (OrderMobile orderMobile : orderMobiles) {
if (orderMobileDto.getId() != null && orderMobile.getStatus().equals("1")) {
Date orderTime = DateFormatUtils.formatDate(orderMobile.getOrderTime(), "yyyy-MM-dd HH:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.setTime(orderTime);
calendar.add(Calendar.HOUR, 2);
orderTime = calendar.getTime();
long time = orderTime.getTime() - new Date().getTime();
if (time < 60 * 60 * 2 * 1000) {
orderMobile.setTime(time);
} else {
orderMobile.setTime(0);
}
}
if (orderMobile.getId() != null) { if (orderMobile.getId() != null) {
List<ProductMobile> mobiles = orderMapper.orderDetill(orderMobile.getId()); List<ProductMobile> mobiles = orderMapper.orderDetill(orderMobile.getId());
orderMobile.setProductMobile(mobiles); orderMobile.setProductMobile(mobiles);
} }
} }
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("orderMobiles", orderMobiles); object.put("orderMobiles", orderMobiles);
...@@ -430,6 +454,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -430,6 +454,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
order.setPayTime(date); order.setPayTime(date);
} }
if (orderMapper.update(order) > 0) { if (orderMapper.update(order) > 0) {
sendQyWechatMassage(order.getId());
return WechatPayUtils.retSucXml; return WechatPayUtils.retSucXml;
} }
} else { } else {
...@@ -506,4 +531,34 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -506,4 +531,34 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return retObj.toString(); return retObj.toString();
} }
@Override
public boolean sendQyWechatMassage(Long orderId) {
Long accounts = Long.parseLong(SystemConfig.p.getProperty("QY_SEND_APPID"));
MpAccountsEntity accountsEntity = mpAccountsService.getDetail(accounts);
Long agenId = Long.parseLong(accountsEntity.getAgentId());
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.equal("o.id", orderId);
List<Order> orders = this.fetchSearchByPage(orderConds, null, 0, 0);
if (orders == null || orders.size() != 1) {
return false;
}
Conds qyuserConds = new Conds();
qyuserConds.equal("t.del_flag", Constants.DEL_FLAG_0);
qyuserConds.equal("t.user_type", "4");//订单员职业
List<Qyuser> qyusers = qyuserService.fetchSearchByPage(qyuserConds, null, 0, 0);
if (qyusers == null || qyusers.size() <= 0) {
return false;
}
//推送客服消息
Order order = orders.get(0);
String msg = SystemConfig.p.getProperty("QY_SEND_ORDERCLERK_MSG") + order.getNumber();
qyMsgUtil.sendText(accounts, false, qyusers, null, null, agenId, msg, false);
return true;
}
} }
\ No newline at end of file
...@@ -188,9 +188,9 @@ public class InvoiceUtil { ...@@ -188,9 +188,9 @@ public class InvoiceUtil {
//零税率标识 非必填 //零税率标识 非必填
detail.put("zeroRateFlag","0"); detail.put("zeroRateFlag","0");
//商品编码(商品税收分类编码开发者自行填写)非必填 //商品编码(商品税收分类编码开发者自行填写)非必填
detail.put("goodsCode","1090511030000000000"); detail.put("goodsCode", product.getProductNumber());
//自行编码(可不填) 非必填 //自行编码(可不填) 非必填
detail.put("selfCode","130005426000000000"); detail.put("selfCode", "");
//商品名称(如invoiceLineProperty =1,则此商品行为折扣行,折扣行不允许多行折扣,折扣行必须紧邻被折扣行,商品名称必须与被折扣行一致) 必填 //商品名称(如invoiceLineProperty =1,则此商品行为折扣行,折扣行不允许多行折扣,折扣行必须紧邻被折扣行,商品名称必须与被折扣行一致) 必填
detail.put("goodsName",product.getProductName()); //todo detail.put("goodsName",product.getProductName()); //todo
//含税金额,[不含税金额] + [税额] = [含税金额],红票为负。不含税金额、税额、含税金额任何一个不传时,会根据传入的单价,数量进行计算,可能和实际数值存在误差,建议都传入 非必填 //含税金额,[不含税金额] + [税额] = [含税金额],红票为负。不含税金额、税额、含税金额任何一个不传时,会根据传入的单价,数量进行计算,可能和实际数值存在误差,建议都传入 非必填
......
package com.cftech.order.web; package com.cftech.order.web;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
import com.cftech.base.codingrule.utils.CodingruleUtils; import com.cftech.base.codingrule.utils.CodingruleUtils;
...@@ -11,9 +10,7 @@ import com.cftech.invoice.service.InvoiceService; ...@@ -11,9 +10,7 @@ import com.cftech.invoice.service.InvoiceService;
import com.cftech.accounts.model.MpAccountsEntity; import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.org.api.QyMsgUtil; import com.cftech.base.org.api.QyMsgUtil;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService; import com.cftech.base.org.service.QyuserService;
import com.cftech.core.util.SystemConfig;
import com.cftech.order.model.Order; import com.cftech.order.model.Order;
import com.cftech.order.model.OrderFromVO; import com.cftech.order.model.OrderFromVO;
import com.cftech.order.model.OrderVO; import com.cftech.order.model.OrderVO;
...@@ -27,7 +24,10 @@ import com.cftech.core.util.Constants; ...@@ -27,7 +24,10 @@ import com.cftech.core.util.Constants;
import com.cftech.order.utils.DoubleJSONFilter; import com.cftech.order.utils.DoubleJSONFilter;
import com.cftech.order.utils.InvoiceUtil; import com.cftech.order.utils.InvoiceUtil;
import com.cftech.orderdetail.web.OrderDetailsController; import com.cftech.orderdetail.web.OrderDetailsController;
import com.cftech.sys.model.User;
import com.cftech.sys.model.UserRole;
import com.cftech.sys.security.UserUtils; import com.cftech.sys.security.UserUtils;
import com.cftech.sys.service.RoleService;
import com.cftech.sys.service.UserService; import com.cftech.sys.service.UserService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -97,6 +97,9 @@ public class OrderController { ...@@ -97,6 +97,9 @@ public class OrderController {
@Autowired @Autowired
private CodingruleUtils codingruleUtils; private CodingruleUtils codingruleUtils;
@Autowired
private RoleService roleService;
//列表页面 //列表页面
@RequiresPermissions(value = ORDER_VIEW) @RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/list") @RequestMapping("/list")
...@@ -196,9 +199,17 @@ public class OrderController { ...@@ -196,9 +199,17 @@ public class OrderController {
@RequestMapping(value = "/listData") @RequestMapping(value = "/listData")
@ResponseBody @ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, Order order, HttpServletRequest request) throws ParseException { public JSONObject listData(int iDisplayStart, int iDisplayLength, Order order, HttpServletRequest request) throws ParseException {
Long userid = UserUtils.getUser().getUserid(); User user = UserUtils.getUser();
Long userid = user.getUserid();
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
List<UserRole> roleList = roleService.selectRolesByUserAccountsId(user.getId(), accountsId);
for (UserRole role : roleList) {
if (role.getRoleId() == 5L) {
userid = 1L;
}
}
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("o.del_flag", Constants.DEL_FLAG_0); conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId); conds.equal("o.accounts_id", accountsId);
...@@ -255,14 +266,11 @@ public class OrderController { ...@@ -255,14 +266,11 @@ public class OrderController {
Sort sort = new Sort("o.create_time", OrderType.DESC); Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid); List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:ss");
Date today = new Date(); Date today = new Date();
Date passDay = null;
int i = 0; int i = 0;
for (Order obj : list){ for (Order obj : list){
if(obj.getStatus().equals("4") && !StringUtils.isEmpty(obj.getAcceptExpressDateStr())){ if((obj.getStatus().equals("4") || obj.getStatus().equals("3") || obj.getStatus().equals("2")) && StringUtils.isBlank(obj.getConfirm()) && obj.getPayTime() != null){
passDay = format.parse(obj.getAcceptExpressDateStr()); i = (int)(today.getTime()-obj.getPayTime().getTime()) / (1000*3600*24);
i = (int)(today.getTime()-passDay.getTime()) / (1000*3600*24);
if(i >= 7){ if(i >= 7){
obj.setIsExceedSevenDay("0"); obj.setIsExceedSevenDay("0");
}else { }else {
...@@ -493,11 +501,30 @@ public class OrderController { ...@@ -493,11 +501,30 @@ public class OrderController {
if (integer > 0){ if (integer > 0){
//线下付款成功 //线下付款成功
if (StringUtils.equals(status, "2")) { if (StringUtils.equals(status, "2")) {
sendQyWechatMassage(id); orderService.sendQyWechatMassage(id);
}
rtnJson.put("errorNo","0");
return rtnJson;
}
rtnJson.put("errorNo","1");
return rtnJson;
} }
@RequestMapping("/updateOrderAddress")
@ResponseBody
public JSONObject updateOrderAddress(Long orderId, Long addressId, HttpServletRequest request) {
JSONObject rtnJson = new JSONObject();
if (orderId != null && addressId != null) {
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.equal("o.id", orderId);
Order order = orderService.fetchSearchByConds(orderConds);
order.setAddressId(addressId);
if (orderService.update(order)){
rtnJson.put("errorNo","0"); rtnJson.put("errorNo","0");
return rtnJson; return rtnJson;
} }
}
rtnJson.put("errorNo","1"); rtnJson.put("errorNo","1");
return rtnJson; return rtnJson;
} }
...@@ -516,36 +543,4 @@ public class OrderController { ...@@ -516,36 +543,4 @@ public class OrderController {
rtnJson.put("errorNo","1"); rtnJson.put("errorNo","1");
return rtnJson; return rtnJson;
} }
/**
* 推送企业微信消息
*/
public boolean sendQyWechatMassage(Long orderId) {
Long accounts = Long.parseLong(SystemConfig.p.getProperty("QY_SEND_APPID"));
MpAccountsEntity accountsEntity = accountsService.getDetail(accounts);
Long agenId = Long.parseLong(accountsEntity.getAgentId());
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.equal("o.id", orderId);
List<Order> orders = orderService.fetchSearchByPage(orderConds, null, 0, 0);
if (orders == null || orders.size() != 1) {
return false;
}
Conds qyuserConds = new Conds();
qyuserConds.equal("t.del_flag", Constants.DEL_FLAG_0);
qyuserConds.equal("t.user_type", "4");//订单员职业
List<Qyuser> qyusers = qyuserService.fetchSearchByPage(qyuserConds, null, 0, 0);
if (qyusers == null || qyusers.size() <= 0) {
return false;
}
//推送客服消息
Order order = orders.get(0);
String msg = SystemConfig.p.getProperty("QY_SEND_ORDERCLERK_MSG") + order.getNumber();
qyMsgUtil.sendText(accounts, false, qyusers, null, null, agenId, msg, false);
return true;
}
} }
...@@ -29,11 +29,11 @@ public interface WxQrcodeMapper extends GenericDao<WxQrcode> { ...@@ -29,11 +29,11 @@ public interface WxQrcodeMapper extends GenericDao<WxQrcode> {
List<WxQrcode> fetchSingleSearchInfo(Map<String, Object> params); List<WxQrcode> fetchSingleSearchInfo(Map<String, Object> params);
List<QyUser> fromUser(@Param("type") int type, @Param("name")String name, @Param("page") int page, @Param("pageSize") int pageSize); List<QyUser> fromUser(@Param("type") int type, @Param("name")String name, @Param("allergy")String allergy, @Param("page") int page, @Param("pageSize") int pageSize);
int countUser(@Param("type") int type, @Param("name")String name); int countUser(@Param("type") int type, @Param("name")String name, @Param("allergy")String allergy);
List<WxQrcode> fromOrg(@Param("name")String name, @Param("page") int page, @Param("pageSize") int pageSize); List<WxQrcode> fromOrg(@Param("outSide") String outSide, @Param("name")String name, @Param("page") int page, @Param("pageSize") int pageSize);
int countOrg(); int countOrg(@Param("outSide") String outSide, @Param("name")String name);
} }
\ No newline at end of file
...@@ -243,22 +243,34 @@ ...@@ -243,22 +243,34 @@
</select> </select>
<select id="fromUser" resultType="com.cftech.shop.qrcode.model.QyUser"> <select id="fromUser" resultType="com.cftech.shop.qrcode.model.QyUser">
select id, name from t_qyuser where user_type=#{type} <if test=" name !=null and name != '' "> and name like '%${name}%'</if> SELECT t.id, t.name FROM t_qyuser t
ORDER BY create_time DESC LEFT JOIN t_orgunit o ON t.org_id = o.id
where t.user_type = #{type}
<if test=" allergy !=null and allergy != '' "> and o.id = #{allergy} </if>
<if test=" name !=null and name != '' "> and name like '%${name}%'</if>
ORDER BY t.create_time
<if test="pageSize>0">limit #{page}, #{pageSize}</if> <if test="pageSize>0">limit #{page}, #{pageSize}</if>
</select> </select>
<select id="countUser" resultType="java.lang.Integer"> <select id="countUser" resultType="java.lang.Integer">
select count(1) from t_qyuser where user_type=#{type} <if test=" name !=null and name != '' "> and name like '%${name}%'</if> SELECT count(1) FROM t_qyuser t
LEFT JOIN t_orgunit o ON t.org_id = o.id
where t.user_type = #{type}
<if test=" allergy !=null and allergy != '' "> and o.id = #{allergy} </if>
<if test=" name !=null and name != '' "> and name like '%${name}%'</if>
ORDER BY t.create_time
</select> </select>
<select id="fromOrg" resultType="com.cftech.shop.qrcode.model.Orgunit"> <select id="fromOrg" resultType="com.cftech.shop.qrcode.model.Orgunit">
select id,org_name name from t_orgunit <if test=" name !=null and name != '' "> where org_name like '%${name}%'</if> select id, org_name name from t_orgunit
ORDER BY create_time DESC where FIND_IN_SET((SELECT id FROM t_orgunit WHERE org_name = #{outSide}), parent_ids) != 0 and del_flag = 0
<if test=" name !=null and name != '' ">AND org_name like '%${name}%' </if>
ORDER BY LENGTH(parent_ids) ASC, create_time DESC
<if test="pageSize>0">limit #{page}, #{pageSize}</if> <if test="pageSize>0">limit #{page}, #{pageSize}</if>
</select> </select>
<select id="countOrg" resultType="java.lang.Integer"> <select id="countOrg" resultType="java.lang.Integer">
select count(1) from t_orgunit select count(1) from t_orgunit where FIND_IN_SET((SELECT id FROM t_orgunit WHERE org_name = #{outSide}), parent_ids) != 0 and del_flag = 0
<if test=" name !=null and name != '' "> AND org_name like '%${name}%' </if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
package com.cftech.shop.qrcode.service; package com.cftech.shop.qrcode.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cftech.shop.qrcode.model.QyUser; import com.cftech.shop.qrcode.model.QyUser;
import com.cftech.shop.qrcode.model.WxQrcode; import com.cftech.shop.qrcode.model.WxQrcode;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
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.shop.qrcode.model.vo.WxQrcodeVO; import com.cftech.shop.qrcode.model.vo.WxQrcodeVO;
import org.apache.poi.ss.formula.functions.T;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 二维码Service * 二维码Service
...@@ -20,6 +16,7 @@ import java.util.Map; ...@@ -20,6 +16,7 @@ import java.util.Map;
* @date: 2017-12-04 17:56 * @date: 2017-12-04 17:56
*/ */
public interface WxQrcodeService extends GenericService<WxQrcode> { public interface WxQrcodeService extends GenericService<WxQrcode> {
List<WxQrcode> fetchSearchByPage(Long orgId, Conds conds, Sort sort, int page, int pageSize); List<WxQrcode> fetchSearchByPage(Long orgId, Conds conds, Sort sort, int page, int pageSize);
List<WxQrcodeVO> fetchSearchByPageVO(Conds conds, Sort sort, int page, int pageSize); List<WxQrcodeVO> fetchSearchByPageVO(Conds conds, Sort sort, int page, int pageSize);
...@@ -30,11 +27,11 @@ public interface WxQrcodeService extends GenericService<WxQrcode> { ...@@ -30,11 +27,11 @@ public interface WxQrcodeService extends GenericService<WxQrcode> {
List<WxQrcode> fetchSingleSearchInfo(Conds conds, Sort sort, int page, int pageSize); List<WxQrcode> fetchSingleSearchInfo(Conds conds, Sort sort, int page, int pageSize);
List<QyUser> fromUser(int type, String name, int iDisplayStart, int iDisplayLength); List<QyUser> fromUser(int type, String name, String allergy, int iDisplayStart, int iDisplayLength);
int countUser(int type, String name); int countUser(int type, String name, String allergy);
List<WxQrcode> fromOrg(String name, int iDisplayStart, int iDisplayLength); List<WxQrcode> fromOrg(String outSide, String name, int iDisplayStart, int iDisplayLength);
int countOrg(); int countOrg(String outSide, String name);
} }
...@@ -84,27 +84,27 @@ public class WxQrcodeServiceImpl extends GenericServiceImpl<WxQrcode> implements ...@@ -84,27 +84,27 @@ public class WxQrcodeServiceImpl extends GenericServiceImpl<WxQrcode> implements
} }
@Override @Override
public List<QyUser> fromUser(int type, String name, int page, int pageSize) { public List<QyUser> fromUser(int type, String name, String allergy, int page, int pageSize) {
page = page > 0 ? page : 0; page = page > 0 ? page : 0;
pageSize = pageSize > 0 ? pageSize : 0; pageSize = pageSize > 0 ? pageSize : 0;
return wxQrcodeMapper.fromUser(type, name, page, pageSize); return wxQrcodeMapper.fromUser(type, name, allergy, page, pageSize);
} }
@Override @Override
public int countUser(int type, String name) { public int countUser(int type, String name, String allergy) {
return wxQrcodeMapper.countUser(type, name); return wxQrcodeMapper.countUser(type, name, allergy);
} }
@Override @Override
public List<WxQrcode> fromOrg(String name, int page, int pageSize) { public List<WxQrcode> fromOrg(String outSide, String name, int page, int pageSize) {
page = page > 0 ? page : 0; page = page > 0 ? page : 0;
pageSize = pageSize > 0 ? pageSize : 0; pageSize = pageSize > 0 ? pageSize : 0;
return wxQrcodeMapper.fromOrg(name, page, pageSize); return wxQrcodeMapper.fromOrg(outSide, name, page, pageSize);
} }
@Override @Override
public int countOrg() { public int countOrg(String outSide, String name) {
return wxQrcodeMapper.countOrg(); return wxQrcodeMapper.countOrg(outSide, name);
} }
} }
\ No newline at end of file
...@@ -158,11 +158,11 @@ public class WxQrcodeController { ...@@ -158,11 +158,11 @@ public class WxQrcodeController {
//获取用户展示数据 //获取用户展示数据
@RequestMapping(value = "/listUser") @RequestMapping(value = "/listUser")
@ResponseBody @ResponseBody
public JSONObject fromUser(int type, String name, int iDisplayStart, int iDisplayLength) { public JSONObject fromUser(int type, String name, String allergy, int iDisplayStart, int iDisplayLength) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
if (!StringUtils.isEmpty(type)) { if (!StringUtils.isEmpty(type)) {
List<QyUser> qyUsers = wxQrcodeService.fromUser(type, name, iDisplayStart, iDisplayLength); List<QyUser> qyUsers = wxQrcodeService.fromUser(type, name, allergy, iDisplayStart, iDisplayLength);
int countUser = wxQrcodeService.countUser(type, name); int countUser = wxQrcodeService.countUser(type, name, allergy);
rtnJson.put("iTotalRecords", countUser); rtnJson.put("iTotalRecords", countUser);
rtnJson.put("iTotalDisplayRecords", countUser); rtnJson.put("iTotalDisplayRecords", countUser);
rtnJson.put("data", qyUsers); rtnJson.put("data", qyUsers);
...@@ -175,8 +175,11 @@ public class WxQrcodeController { ...@@ -175,8 +175,11 @@ public class WxQrcodeController {
@ResponseBody @ResponseBody
public JSONObject fromOrg(@RequestParam(required = false)String name, int iDisplayStart, int iDisplayLength) { public JSONObject fromOrg(@RequestParam(required = false)String name, int iDisplayStart, int iDisplayLength) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
List<WxQrcode> wxQrcodes = wxQrcodeService.fromOrg(name, iDisplayStart, iDisplayLength); //外部组织最上级名称
int countOrg = wxQrcodeService.countOrg(); String outSide = SystemConfig.p.getProperty("OUTSIDE_ORG_NAME");
List<WxQrcode> wxQrcodes = wxQrcodeService.fromOrg(outSide, name, iDisplayStart, iDisplayLength);
int countOrg = wxQrcodeService.countOrg(outSide, name);
rtnJson.put("iTotalRecords", countOrg); rtnJson.put("iTotalRecords", countOrg);
rtnJson.put("iTotalDisplayRecords", countOrg); rtnJson.put("iTotalDisplayRecords", countOrg);
rtnJson.put("data", wxQrcodes); rtnJson.put("data", wxQrcodes);
......
...@@ -14,9 +14,13 @@ CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5Uk ...@@ -14,9 +14,13 @@ CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5Uk
#\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F #\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F
ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A
#\u5916\u90E8\u7EC4\u7EC7\u6700\u4E0A\u7EA7\u540D\u79F0
OUTSIDE_ORG_NAME=\u533A\u57DF
#\u4F01\u4E1A\u53F7\u4E3B\u952E
AIDEA_QY_ACCOUNTS=349 AIDEA_QY_ACCOUNTS=349
#\u4F01\u4E1A\u53F7\u53D1\u9001\u6D88\u606F\uFF0C\u57DF\u540D\u914D\u7F6E #\u4F01\u4E1A\u53F7\u53D1\u9001\u6D88\u606F\uFF0C\u57DF\u540D\u914D\u7F6E
QY_DOMAIN_NAME=https://pd.shxrtech.com/aidea QY_DOMAIN_NAME=https://pd.shxrtech.com/aidea
#\u79FB\u52A8\u7AEF\u9879\u76EE\u540D\u79F0/\u57DF\u540D
MOBILE_MP_DOMAIN_NAME=https://pd.shxrtech.com/aideas MOBILE_MP_DOMAIN_NAME=https://pd.shxrtech.com/aideas
QY_DOMAIN=https://pd.shxrtech.com QY_DOMAIN=https://pd.shxrtech.com
#\u4F01\u4E1A\u53F7\u63A8\u9001\u9ED8\u8BA4\u5E94\u7528id #\u4F01\u4E1A\u53F7\u63A8\u9001\u9ED8\u8BA4\u5E94\u7528id
...@@ -29,6 +33,8 @@ QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\ ...@@ -29,6 +33,8 @@ QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\
QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801: QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801:
#\u63A8\u9001\u5BA2\u670D\u8DDF\u8FDB\u63D0\u9192\u6D88\u606F #\u63A8\u9001\u5BA2\u670D\u8DDF\u8FDB\u63D0\u9192\u6D88\u606F
QY_SEND_SERVICE_FOLLOWUP_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u8BA2\u5355\u8DDF\u8FDB\u63D0\u9192\uFF0C\u8BA2\u5355\u7F16\u7801\uFF1A QY_SEND_SERVICE_FOLLOWUP_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u8BA2\u5355\u8DDF\u8FDB\u63D0\u9192\uFF0C\u8BA2\u5355\u7F16\u7801\uFF1A
#\u54A8\u8BE2\u5355\u5BA1\u6838\u5931\u8D25\u63A8\u9001\u6D88\u606F
QY_SEND_SERVICE_AUDIT_FAIL_MAG=\u60A8\u6536\u5230\u4E00\u5F20\u5BA1\u6838\u672A\u901A\u8FC7\u7684\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A
#\u56FE\u7247\u4E0A\u4F20\u5730\u5740 #\u56FE\u7247\u4E0A\u4F20\u5730\u5740
#userfiles.imgdir=/mydata/fileResource #userfiles.imgdir=/mydata/fileResource
...@@ -85,3 +91,5 @@ mch.spbill_id=47.103.35.182 ...@@ -85,3 +91,5 @@ mch.spbill_id=47.103.35.182
mch.secret_key=4bcd5546d65f4d88bf1ba549436e0e9f mch.secret_key=4bcd5546d65f4d88bf1ba549436e0e9f
#\u5546\u6237\u53F7\u4ED8\u6B3E\u6210\u529F\u56DE\u8C03url #\u5546\u6237\u53F7\u4ED8\u6B3E\u6210\u529F\u56DE\u8C03url
mch.notify_url=https://pd.shxrtech.com/aidea/mobile/auth/order/wechatCallback mch.notify_url=https://pd.shxrtech.com/aidea/mobile/auth/order/wechatCallback
#\u4ED8\u6B3E\u754C\u9762\u6807\u9898
mch.title=\u8BFA\u5EB7\u5927\u836F\u623F\u54A8\u8BE2\u5E73\u53F0
...@@ -194,22 +194,26 @@ ...@@ -194,22 +194,26 @@
</select> </select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_shipping_address t select COUNT(1) from (
SELECT COUNT(1)FROM t_shipping_address t
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
LEFT JOIN t_order o ON o.openid = t.open_id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
GROUP BY t.id) tmp
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.addresst.model.Address">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>, concat( a.areaname ,b.areaname, c.areaname, t.address ) name
FROM t_shipping_address t FROM t_shipping_address t
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
LEFT JOIN t_order o ON o.openid = t.open_id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
GROUP BY t.id
<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>
......
...@@ -63,6 +63,10 @@ public class Address extends Area implements Serializable { ...@@ -63,6 +63,10 @@ public class Address extends Area implements Serializable {
private String appId; private String appId;
private String orderId;
private String name;
public Address() { public Address() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
......
...@@ -107,7 +107,7 @@ public class AddressController { ...@@ -107,7 +107,7 @@ public class AddressController {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.accounts_id", accountsId); //conds.equal("t.accounts_id", accountsId);
if (!StringUtils.isEmpty(address.getAddressName())) { if (!StringUtils.isEmpty(address.getAddressName())) {
conds.like("t.address_name", address.getAddressName()); conds.like("t.address_name", address.getAddressName());
} }
...@@ -120,6 +120,9 @@ public class AddressController { ...@@ -120,6 +120,9 @@ public class AddressController {
if (!StringUtils.isEmpty(address.getAreaId())) { if (!StringUtils.isEmpty(address.getAreaId())) {
conds.equal("t.area_id", address.getAreaId()); conds.equal("t.area_id", address.getAreaId());
} }
if (!StringUtils.isEmpty(address.getOrderId())) {
conds.equal("o.id", address.getOrderId());
}
Sort sort = new Sort("t.create_time", OrderType.DESC); Sort sort = new Sort("t.create_time", OrderType.DESC);
List<Address> list = addressService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength); List<Address> list = addressService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength);
...@@ -149,7 +152,6 @@ public class AddressController { ...@@ -149,7 +152,6 @@ public class AddressController {
@GetMapping("/listArea") @GetMapping("/listArea")
@ResponseBody @ResponseBody
public List<Area> listArea() { public List<Area> listArea() {
return addressService.listArea(); return addressService.listArea();
} }
...@@ -178,7 +180,7 @@ public class AddressController { ...@@ -178,7 +180,7 @@ public class AddressController {
if (file == null) { if (file == null) {
return list(request, model); return list(request, model);
} }
// 构造临时路径来存储上传的文件 // 构造临时路径来存储上传的文件
String uploadPath = System.getProperty("java.io.tmpdir"); String uploadPath = System.getProperty("java.io.tmpdir");
File uploadDir = new File(uploadPath); File uploadDir = new File(uploadPath);
if (!uploadDir.exists()) { if (!uploadDir.exists()) {
......
package com.cftech.addresst.web; package com.cftech.addresst.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
import com.cftech.addresst.model.Address; import com.cftech.addresst.model.Address;
import com.cftech.addresst.model.Area; import com.cftech.addresst.model.Area;
import com.cftech.addresst.service.AddressService; import com.cftech.addresst.service.AddressService;
import com.cftech.core.util.StringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -15,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -15,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
/** /**
* @author :licc * @author :licc
...@@ -30,6 +37,18 @@ public class MobileAddressController { ...@@ -30,6 +37,18 @@ public class MobileAddressController {
@Autowired @Autowired
private AddressService addressService; private AddressService addressService;
@Autowired
private RedisTemplate<String, String> redisTemplate;
private RedisTemplate<String, String> getConfig() {
GenericFastJsonRedisSerializer genericFastJsonRedisSerializer = new GenericFastJsonRedisSerializer();
//StringRedisSerializer stringSerializer = new StringRedisSerializer();
redisTemplate.setKeySerializer(genericFastJsonRedisSerializer);
redisTemplate.setHashKeySerializer(genericFastJsonRedisSerializer);
redisTemplate.setHashValueSerializer(genericFastJsonRedisSerializer);
return redisTemplate;
}
/** /**
* @return * @return
* @Description 个人收货地址数据回填 * @Description 个人收货地址数据回填
...@@ -53,6 +72,7 @@ public class MobileAddressController { ...@@ -53,6 +72,7 @@ public class MobileAddressController {
} }
/** /**
* 增加redis缓存
* @return * @return
* @Description 省市区信息回填 * @Description 省市区信息回填
* @Date 9:53 2020/10/20 * @Date 9:53 2020/10/20
...@@ -62,17 +82,31 @@ public class MobileAddressController { ...@@ -62,17 +82,31 @@ public class MobileAddressController {
public JSONObject listArea(String appId) { public JSONObject listArea(String appId) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
String key = "AIDEA_AREA_LIST_" + appId;
if (getConfig().hasKey(key)) {
String listArea = getConfig().opsForValue().get(key);
if (StringUtils.isNoneBlank(listArea)) {
JSONArray arr = JSON.parseArray(listArea);
rtnJson.put("errorNo", "0");
rtnJson.put("data", arr);
return rtnJson;
}
}
List<Area> areas = addressService.listArea(); List<Area> areas = addressService.listArea();
if (!areas.equals("") || areas != null) { if (areas != null && areas.size() != 0) {
//缓存至redis
getConfig().opsForValue().set(key, JSON.toJSONString(areas));
getConfig().expire(key, 24, TimeUnit.HOURS);
rtnJson.put("errorNo", "0"); rtnJson.put("errorNo", "0");
rtnJson.put("data", areas); rtnJson.put("data", areas);
return rtnJson;
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
} }
rtnJson.put("errorNo", "1");
return rtnJson; return rtnJson;
} }
......
...@@ -212,11 +212,13 @@ ...@@ -212,11 +212,13 @@
<tr> <tr>
<th hidden="true">id</th> <th hidden="true">id</th>
<th style="text-align: left;">头像</th> <th style="text-align: left;">头像</th>
<th>昵称</th>
<th>别名</th>
<th>性别</th> <th>性别</th>
<th>openid</th> <th>openid</th>
<th>省份</th> <th>省份</th>
<th>城市</th> <th>城市</th>
<th>昵称</th>
<!-- <th>标签</th>--> <!-- <th>标签</th>-->
<th>粉丝来源</th> <th>粉丝来源</th>
<th>关注日期</th> <th>关注日期</th>
...@@ -473,11 +475,12 @@ ...@@ -473,11 +475,12 @@
"aoColumns": [ "aoColumns": [
{"mData": "id"}, {"mData": "id"},
{"mData": "headimgurl"}, {"mData": "headimgurl"},
{"mData": "nickname"},
{"mData": "store"},
{"mData": "sex"}, {"mData": "sex"},
{"mData": "openid"}, {"mData": "openid"},
{"mData": "province"}, {"mData": "province"},
{"mData": "city"}, {"mData": "city"},
{"mData": "nickname"},
{"mData": "source"}, {"mData": "source"},
{"mData": "subscribetime"} {"mData": "subscribetime"}
], ],
...@@ -495,19 +498,23 @@ ...@@ -495,19 +498,23 @@
return '<img width="45px" height="45px" src="' + a + '" />'; return '<img width="45px" height="45px" src="' + a + '" />';
} }
} }
// ,{ , {
// "targets": [6], "aTargets": [2],
// "mData": "nickname", "mData": "nickname",
// "mRender": function (a, b, c, d) "mRender": function (a, b, c, d) {
// { return a;
// a=decodeURIComponent(a); }
// //a表示id对应的值,c表示当前记录行对象 }
// return a; , {
// } "aTargets": [3],
// } "mData": "store",
"mRender": function (a, b, c, d) {
return a;
}
}
, ,
{ {
"targets": [2], "targets": [4],
"mData": "sex", "mData": "sex",
"mRender": function (a, b, c, d) {//a表示id对应的值,c表示当前记录行对象 "mRender": function (a, b, c, d) {//a表示id对应的值,c表示当前记录行对象
if (a == '1') { if (a == '1') {
...@@ -520,34 +527,27 @@ ...@@ -520,34 +527,27 @@
} }
}, },
{ {
"targets": [3], "targets": [5],
"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;
} }
}, },
{ {
"aTargets": [4], "aTargets": [6],
"mData": "province", "mData": "province",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象 "mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a; return a;
} }
}, { }, {
"aTargets": [5], "aTargets": [7],
"mData": "city", "mData": "city",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象 "mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a; return a;
} }
} }
, { , {
"aTargets": [6], "aTargets": [8],
"mData": "nickname",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}
, {
"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 == 0) { if (a == 0) {
...@@ -567,7 +567,7 @@ ...@@ -567,7 +567,7 @@
} }
}, { }, {
"aTargets": [8], "aTargets": [9],
"mData": "subscribetime", "mData": "subscribetime",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象 "mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
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 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> </sql>
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
status = #{status} status = #{status}
</if> </if>
</set> </set>
where openid = #{openid} and delflag=0 where openid = #{openid} and delflag = 0
</update> </update>
<update id="updateLabelByid" parameterType="java.util.Map"> <update id="updateLabelByid" parameterType="java.util.Map">
update wx_mp_fanss update wx_mp_fanss
......
...@@ -46,7 +46,7 @@ public class MpFanssEntity extends BasicEntity { ...@@ -46,7 +46,7 @@ public class MpFanssEntity extends BasicEntity {
private String recommender;//推荐人 private String recommender;//推荐人
private Long store;//门店 private String store;//门店
private String status; private String status;
...@@ -106,11 +106,11 @@ public class MpFanssEntity extends BasicEntity { ...@@ -106,11 +106,11 @@ public class MpFanssEntity extends BasicEntity {
this.recommender = recommender; this.recommender = recommender;
} }
public Long getStore() { public String getStore() {
return store; return store;
} }
public void setStore(Long store) { public void setStore(String store) {
this.store = store; this.store = store;
} }
......
...@@ -24,8 +24,7 @@ public interface MpFanssService extends GenericService<MpFanssEntity> { ...@@ -24,8 +24,7 @@ public interface MpFanssService extends GenericService<MpFanssEntity> {
List<MpFanssEntity> getAllMpAccounts(); List<MpFanssEntity> getAllMpAccounts();
List<MpFanssEntity> getMpFansAndPage(Page<MpFanssEntity> page, List<MpFanssEntity> getMpFansAndPage(Page<MpFanssEntity> page, @Param("userid") Long userid);
@Param("userid") Long userid);
Long selectFannscounts(@Param("userid") Long userid); Long selectFannscounts(@Param("userid") Long userid);
...@@ -44,8 +43,7 @@ public interface MpFanssService extends GenericService<MpFanssEntity> { ...@@ -44,8 +43,7 @@ public interface MpFanssService extends GenericService<MpFanssEntity> {
//根据省市查询粉丝 //根据省市查询粉丝
public List<String> fannsByArea(String areaName, String accountsid, String sex, String tags, String storeIds); public List<String> fannsByArea(String areaName, String accountsid, String sex, String tags, String storeIds);
List<MpFanssEntity> fetchSearchByPage(Conds conds, Sort sort, List<MpFanssEntity> fetchSearchByPage(Conds conds, Sort sort, int iDisplayStart, int iDisplayLength, String areaname);
int iDisplayStart, int iDisplayLength, String areaname);
int count(Conds conds, String areaname); int count(Conds conds, String areaname);
......
...@@ -12,7 +12,9 @@ import com.cftech.cms.cfarticle.model.Cfarticle; ...@@ -12,7 +12,9 @@ import com.cftech.cms.cfarticle.model.Cfarticle;
import com.cftech.cms.cfarticle.service.CfarticleService; import com.cftech.cms.cfarticle.service.CfarticleService;
import com.cftech.cms.exhibi.model.Exhibi; import com.cftech.cms.exhibi.model.Exhibi;
import com.cftech.cms.exhibi.service.ExhibiService; import com.cftech.cms.exhibi.service.ExhibiService;
import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.core.util.MpTokenUtil; import com.cftech.core.util.MpTokenUtil;
import com.cftech.core.util.StringUtils; import com.cftech.core.util.StringUtils;
...@@ -547,10 +549,22 @@ public class CoreService { ...@@ -547,10 +549,22 @@ public class CoreService {
*/ */
public void insertFanss(String openId, String type, public void insertFanss(String openId, String type,
String store, String ticket) { String store, String ticket) {
MpFanssEntity fannsEntity = new MpFanssEntity();
try { try {
Wxuser user = JwUserAPI.getWxuser(mpTokenUtil.getToken(mpAccountEntity.getId()), //同步粉丝别名
openId); Conds fansConds = new Conds();
fansConds.equal("t.openid", openId);
fansConds.notNull("t.store");
Sort sort = new Sort("t.createtime", OrderType.DESC);
List<MpFanssEntity> fansList = mpFanssService.fetchSearchByPage(fansConds, sort, 0, 0);
Wxuser user = JwUserAPI.getWxuser(mpTokenUtil.getToken(mpAccountEntity.getId()), openId);
MpFanssEntity fannsEntity = new MpFanssEntity();
//增加粉丝别名
if (fansList != null && fansList.size() > 0) {
fannsEntity.setStore(fansList.get(0).getStore());
}
fannsEntity.setHeadimgurl(user.getHeadimgurl()); fannsEntity.setHeadimgurl(user.getHeadimgurl());
fannsEntity.setCity(user.getCity()); fannsEntity.setCity(user.getCity());
fannsEntity.setProvince(user.getProvince()); fannsEntity.setProvince(user.getProvince());
......
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