Commit 938056ba authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-11-20

parent f4e651ac
...@@ -59,8 +59,10 @@ ...@@ -59,8 +59,10 @@
display: inline-block; display: inline-block;
} }
.bootstrap-switch-container{display: -webkit-box; .bootstrap-switch-container {
white-space: nowrap;} display: -webkit-box;
white-space: nowrap;
}
</style> </style>
</head> </head>
<!-- END HEAD --> <!-- END HEAD -->
...@@ -69,7 +71,8 @@ ...@@ -69,7 +71,8 @@
<div class="wrapper"> <div class="wrapper">
<div class="content-wrapper" style="margin-left:0;"> <div class="content-wrapper" style="margin-left:0;">
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
...@@ -81,8 +84,8 @@ ...@@ -81,8 +84,8 @@
<div class="modal-body"> <div class="modal-body">
<form> <form>
<!--<div class="form-group">--> <!--<div class="form-group">-->
<!--<label for="recipient-name" class="col-form-label">Recipient:</label>--> <!--<label for="recipient-name" class="col-form-label">Recipient:</label>-->
<!--<input type="text" class="form-control" id="recipient-name">--> <!--<input type="text" class="form-control" id="recipient-name">-->
<!--</div>--> <!--</div>-->
<div class="form-group"> <div class="form-group">
<label for="message-text" class="col-form-label">请输入拒绝原由:</label> <label for="message-text" class="col-form-label">请输入拒绝原由:</label>
...@@ -102,7 +105,7 @@ ...@@ -102,7 +105,7 @@
<section class="content-header"> <section class="content-header">
<h1> <h1>
咨询单管理 咨询单管理
<small>咨询单</small> <small>咨询单管理</small>
</h1> </h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i>首页</a></li> <li><a href="#"><i class="fa fa-dashboard"></i>首页</a></li>
...@@ -126,21 +129,17 @@ ...@@ -126,21 +129,17 @@
<div class="panel-heading">基础信息</div> <div class="panel-heading">基础信息</div>
<div class="panel-body"> <div class="panel-body">
<div class="form-group form-md-line-input col-xs-5"> <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"
class="form-control" name="consultId" class="form-control" name="consultId"
id="consultId" readonly="readonly" id="consultId" readonly="readonly"
maxlength="50" placeholder="用药人姓名" maxlength="50" placeholder="咨询单编码"
value="$!{data.consultId}" value="$!{data.consultId}"
> >
</div> </div>
<!-- <div-->
<!-- class="form-control" name="consultId"--> <div class="form-group form-md-line-input col-xs-3">
<!-- id="consultId"-->
<!-- style="height: 68px;background: #EEEEEE"-->
<!-- >$!{data.consultId}</div>-->
<div class="form-group form-md-line-input col-xs-5">
<label>用药人姓名</label> <label>用药人姓名</label>
<input type="text" <input type="text"
class="form-control" name="userName" class="form-control" name="userName"
...@@ -149,24 +148,18 @@ ...@@ -149,24 +148,18 @@
value="$!{data.userName}" value="$!{data.userName}"
> >
</div> </div>
<!-- <label>身份证号<font style="color: red"></font></label>-->
<!-- <input type="text"--> <div class="form-group form-md-line-input col-xs-3">
<!-- class="form-control" name="numberId"-->
<!-- id="numberId" readonly="readonly"-->
<!-- maxlength="50" placeholder="身份证号"-->
<!-- value="$!{data.numberId}"-->
<!-- >-->
<div class="form-group form-md-line-input col-xs-5">
<label>性别<font style="color: red"></font></label> <label>性别<font style="color: red"></font></label>
<input type="text" <input type="text"
class="form-control" name="sex" class="form-control" name="sex"
id="sex" readonly="readonly" id="sex" readonly="readonly"
maxlength="50" placeholder="" maxlength="50" placeholder="性别"
value="$!{data.sex}" value="$!{data.sex}"
> >
</div> </div>
<div class="form-group form-md-line-input col-xs-5"> <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"
class="form-control" name="iPhone" class="form-control" name="iPhone"
...@@ -176,66 +169,70 @@ ...@@ -176,66 +169,70 @@
> >
</div> </div>
</div> <div class="form-group form-md-line-input col-xs-3">
</div> <label>药师姓名<font style="color: red"></font></label>
<input type="text"
<div class="panel panel-primary"> class="form-control" name="doctorName"
<div class="panel-heading">订单信息</div> id="doctorName" readonly="readonly"
maxlength="50" placeholder="药师姓名"
value="$!{data.pharmaName}"
>
</div>
<div class="panel-body"> <div class="form-group form-md-line-input col-xs-3">
<div class="form-group form-md-line-input col-xs-10"> <label>客服姓名<font style="color: red"></font></label>
<label>审核状态<font style="color: red"></font></label>
<input type="text" <input type="text"
class="form-control" name="status" class="form-control" name="customerName"
id="status" readonly="readonly" id="customerName" readonly="readonly"
maxlength="50" placeholder="status" maxlength="50" placeholder="客服姓名"
value="$!{data.status}" value="$!{data.customerName}"
> >
</div> </div>
<div class="form-group form-md-line-input col-xs-5"> <div class="form-group form-md-line-input col-md-3">
<label>处方单<font style="color: red"></font></label> <label>处方医院</label>
<br/> <div class="input-group">
<div class="form-group " id="imageurl" <input type="text" name="allergy" id="allergy" value="$!{data.allergy}" class="form-control" style="display: none">
style=" width: 130px; height: 120px;margin-left: 5px; padding :10px ;background-color :#f4f4f4; border: 1px solid #CCCCCC"> <input type="text" id="hospital" name="hospital" value="$!{hospital}" class="form-control" disabled>
<img style="cursor:zoom-in; width: 108px;height: 100% " <span class="input-group-btn">
src="$!{data.prescription}" onclick="imgcli(this)"> <button type="button" name="selHospital" id="selHospital" class="btn btn-info btn-flat">选择</button>
</span>
</div> </div>
</div> </div>
<div class="form-group form-md-line-input col-xs-5"> <div class="form-group form-md-line-input col-md-3">
<label>有无过敏反应<font style="color: red"></font></label> <label>处方医生</label>
<br/> <div class="input-group">
<div class="switch"> <input type="text" name="pastRecords" id="pastRecords" value="$!{data.pastRecords}" class="form-control" style="display: none">
<input id="allergy" name="allergy" type="checkbox" checked readonly="readonly" /> <input type="text" id="pharmacist" name="pharmacist" value="$!{pharmacist}" class="form-control" disabled>
<span class="input-group-btn">
<button type="button" name="selDoctor" id="selDoctor" class="btn btn-info btn-flat">选择</button>
</span>
</div> </div>
<!-- <div-->
<!-- class="form-control" name="allergy"-->
<!-- id="allergy"-->
<!-- maxlength="50"-->
<!-- style="height: 68px;background: #EEEEEE"-->
<!-- >$!{data.allergy}-->
<!-- </div>-->
</div> </div>
<div class="form-group form-md-line-input col-xs-5">
<label>有无不良反应<font style="color: red"></font></label> <div class="form-group form-md-line-input col-xs-3">
<label>处方单<font style="color: red"></font></label>
<br/> <br/>
<div class="switch"> <div class="form-group " id="imageurl"
<input id="pastRecords" name="pastRecords" checked type="checkbox" readonly="readonly" /> style="width: 130px; height: 120px; margin-left: 5px; padding: 10px; background-color: #f4f4f4; border: 1px solid #CCCCCC">
<img id="prescription" style="cursor:zoom-in; width: 100%; height: 100% " src="$!{data.prescription}" onclick="imgcli(this)">
</div> </div>
</div> </div>
<div class="form-group form-md-line-input col-xs-5"> <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/> <input type="text"
<div class="switch"> class="form-control" name="status"
<input id="illness" name="illness" checked type="checkbox" readonly="readonly" /> id="status" readonly="readonly"
</div> maxlength="50" placeholder="status"
value="$!{data.status}"
>
</div> </div>
<div class="form-group form-md-line-input col-xs-5">
<div class="form-group form-md-line-input col-xs-6">
<label>审核未通过原因<font style="color: red"></font></label> <label>审核未通过原因<font style="color: red"></font></label>
<div <div class="form-control" name="description"
class="form-control" name="description"
id="description" id="description"
maxlength="50" maxlength="50"
style="height: 68px;background: #EEEEEE" style="height: 68px;background: #EEEEEE"
...@@ -243,25 +240,17 @@ ...@@ -243,25 +240,17 @@
</div> </div>
</div> </div>
<div class="form-group form-md-line-input col-xs-5"> </div>
<label>药师姓名<font style="color: red"></font></label> </div>
<input type="text"
class="form-control" name="doctorName" <div class="panel panel-primary">
id="doctorName" readonly="readonly" <div class="panel-heading">咨询单信息</div>
maxlength="50" placeholder="药师姓名"
value="$!{data.pharmaName}" <div class="panel-body">
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>客服姓名<font style="color: red"></font></label>
<input type="text"
class="form-control" name="customerName"
id="customerName" readonly="readonly"
maxlength="50" placeholder="客服姓名"
value="$!{data.customerName}"
>
</div>
</div> </div>
</div> </div>
...@@ -271,9 +260,10 @@ ...@@ -271,9 +260,10 @@
#if($shiro.hasPermission("qy:consultSheet:edit")) #if($shiro.hasPermission("qy:consultSheet:edit"))
<input class="btn btn-info" id="save" value="通过" type="submit"> <input class="btn btn-info" id="save" value="通过" type="submit">
#end #end
<a id="reject" class="btn btn-danger" data-toggle="modal" data-target="#exampleModal">拒绝</a> <a id="reject" class="btn btn-danger" data-toggle="modal"
data-target="#exampleModal">拒绝</a>
<a href="#springUrl('/a/consultSheet/list')" class="btn btn-default" >返回 </a> <a href="#springUrl('/a/consultSheet/list')" class="btn btn-default">返回 </a>
</div> </div>
</div> </div>
</form> </form>
...@@ -292,9 +282,9 @@ ...@@ -292,9 +282,9 @@
<div class="control-sidebar-bg"></div> <div class="control-sidebar-bg"></div>
</div><!-- ./wrapper --> </div><!-- ./wrapper -->
<div id="divimg" <div id="divimg"
style="cursor:zoom-out;background: rgba(0,0,0,.6);width:100%;position: absolute;z-index: 9999;left: 0;top: 0;display: none" style="cursor:zoom-out; background: rgba(0,0,0,.6); width:100%; height:100%; position: absolute;z-index: 9999;left: 0;top: 0;display: none"
onclick="hide()"> onclick="hide()">
<img style="width: 50%;margin-left: 25%; "> <img>
</div> </div>
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script> <script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 --> <!-- Bootstrap 3.3.5 -->
...@@ -322,71 +312,35 @@ ...@@ -322,71 +312,35 @@
<script src="common/js/cfapp.js"></script> <script src="common/js/cfapp.js"></script>
<!-- END PAGE LEVEL PLUGINS --> <!-- END PAGE LEVEL PLUGINS -->
<script> <script>
var consultid;
var bindSwitch = function () { var bindSwitch = function () {
var allergy = "$!{data.allergy}";
var pastRecords = "$!{data.pastRecords}";
var illness = "$!{data.illness}";
if (allergy==0){
$('#allergy').bootstrapSwitch({
onText: '是',
offText: '否',
offColor:'danger',
state: false
});
}else{
$('#allergy').bootstrapSwitch({
onText: '是',
offText: '否',
offColor:'danger',
state: true
});
}
if (pastRecords==0){ // var illness = "$!{data.illness}";
$('#pastRecords').bootstrapSwitch({ // if (illness == 0) {
onText: '是', // $('#illness').bootstrapSwitch({
offText: '否', // onText: '是',
offColor:'danger', // offText: '否',
state: false // offColor: 'danger',
}); // state: false
}else{ // });
$('#pastRecords').bootstrapSwitch({ // } else {
onText: '是', // $('#illness').bootstrapSwitch({
offText: '否', // onText: '是',
offColor:'danger', // offText: '否',
state: true // offColor: 'danger',
}); // state: true
} // });
if (illness==0){ // }
$('#illness').bootstrapSwitch({
onText: '是',
offText: '否',
offColor:'danger',
state: false
});
}else{
$('#illness').bootstrapSwitch({
onText: '是',
offText: '否',
offColor:'danger',
state: true
});
}
}; };
// href="#springUrl('/a/consultSheet/list')"
$().ready(function () {
consultid = $("#consultId").val();
$().ready(function () {
var value = $("#sex").val(); var value = $("#sex").val();
if (value == 0) { if (value == 0) {
$("#sex").val("女"); $("#sex").val("女");
} else { } else {
$("#sex").val("男"); $("#sex").val("男");
} }
var status = $("#status").val(); var status = $("#status").val();
if (status == 0) { if (status == 0) {
$("#status").val("未审核"); $("#status").val("未审核");
...@@ -395,21 +349,13 @@ ...@@ -395,21 +349,13 @@
} else if (status == 2) { } else if (status == 2) {
$("#status").val("已拒绝"); $("#status").val("已拒绝");
} }
if (status == 1 || status == 2) { if (status == 1 || status == 2) {
$("#reject").hide(); $("#reject").hide();
$("#save").hide(); $("#save").hide();
} }
bindSwitch(); bindSwitch();
// if (allergy==0){
// $('#allergy').bootstrapSwitch('state',false);
// }
// if (pastRecords==0){
// $('#pastRecords').bootstrapSwitch('state',false);
// }
// if (illness==0){
// $('#illness').bootstrapSwitch('state',false);
// }
Cfapp.init(); Cfapp.init();
recdTypeAdd.init(); recdTypeAdd.init();
}); });
...@@ -417,18 +363,36 @@ ...@@ -417,18 +363,36 @@
$('#divimg').click(function () { $('#divimg').click(function () {
$(this).fadeOut(200) $(this).fadeOut(200)
}) });
function imgcli(obj) { function imgcli(obj) {
$('#divimg').height($('.content-wrapper').height())
$('#divimg').fadeIn(200);
$('#divimg img').attr('src', $(obj).attr("src")); $('#divimg img').attr('src', $(obj).attr("src"));
$('#divimg img').css("margin-top", "10%")
$('#divimg img').css("height", "55%") var img = document.getElementById("prescription");
let imgH = img.naturalHeight;//图片高度
let imgW = img.naturalWidth;//图片宽度
//console.log(imgH + "-" + imgW);
let finalImgH = ($('.content-wrapper').height() * 0.8).toFixed(2);
let algorithm = (imgH / finalImgH).toFixed(2);
let finalImgW = (imgW / algorithm).toFixed(2);
let val = (1 - (finalImgW / $('.content-wrapper').width()).toFixed(2)) / 2 * 100 -3;
$('#divimg').height($('.content-wrapper').height());
$('#divimg img').height(finalImgH);
$('#divimg img').width(finalImgW);
$('#divimg img').css("margin-left", val + "%");
$('#divimg img').css("margin-top", "5%");
$('#divimg').fadeIn(200);
} }
function hide() { function hide() {
$("#hide").hide(); $("#hide").hide();
} }
function review() { function review() {
var url = "#springUrl('/a/consultSheet/updateData')"; var url = "#springUrl('/a/consultSheet/updateData')";
var reason = $("#js-textarea").val(); var reason = $("#js-textarea").val();
...@@ -437,12 +401,13 @@ ...@@ -437,12 +401,13 @@
Cfapp.alert({ Cfapp.alert({
message: "请输入拒绝原由!", message: "请输入拒绝原由!",
btntext: "确定", btntext: "确定",
success: function () {} success: function () {
}
}); });
return; return;
} }
var aadata = { var aadata = {
id: $('#id').val(), consultId: $('#id').val(),
status: "2", status: "2",
description: reason description: reason
}; };
...@@ -472,6 +437,86 @@ ...@@ -472,6 +437,86 @@
}); });
} }
$("#selHospital").click(function () {
Cfapp.f7({
dataUrl: "#springUrl('/a/wxQrcode/listOrg')",
checkType: "single", // 多选为multi
title: '请选择医院',
btnoktext: "确定",
btncanceltext: "取消",
columns: ["选择", "请选择医院"],
isSearch: '0',
searchColumns: ["name"],//搜索的字段名称
searchColumnsRemarks: ["请选择医院"],//搜索的字段备注
aoColumns: [{
"mData": "id"
}, {
"mData": "name"
}],
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": "name",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}],
success: function () {
},
cancel: function () {
},
storeFields: 'allergy', // 储存的字段
displayFields: 'hospital'
})
});
$("#selDoctor").click(function () {
Cfapp.f7({
dataUrl: "#springUrl('/a/wxQrcode/listUser?type=" + 3 + "')",
checkType: "single", // 多选为multi
title: '请选择医生',
btnoktext: "确定",
btncanceltext: "取消",
columns: ["选择", "请选择医生"],
isSearch: '0',
searchColumns: ["name"],//搜索的字段名称
searchColumnsRemarks: ["请选择医生"],//搜索的字段备注
aoColumns: [{
"mData": "id"
}, {
"mData": "name"
}],
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": "name",
"mRender": function (a, b, c, d) {//a表示createtime对应的值,c表示当前记录行对象
return a;
}
}],
success: function () {
},
cancel: function () {
},
storeFields: 'pastRecords', // 储存的字段
displayFields: 'pharmacist'
})
});
var recdTypeAdd = function () { var recdTypeAdd = function () {
var initForm = function () { var initForm = function () {
var initFormCtrl = function () { var initFormCtrl = function () {
...@@ -482,20 +527,20 @@ ...@@ -482,20 +527,20 @@
rules: {}, rules: {},
messages: {}, messages: {},
submitHandler: function (form) { submitHandler: function (form) {
// $("#save").attr("disabled", true); $("#save").attr("disabled", true);
// var dataJSON = $("#myForm").serialize();
Cfapp.confirm({ Cfapp.confirm({
message: "确定审核通过吗", message: "确定审核通过吗",
btnoktext: "确定", btnoktext: "确定",
btncanceltext: "取消", btncanceltext: "取消",
success: function () { success: function () {
var dataJSON = { var dataJSON = {
"id": $("#id").val(), "consultId": $("#id").val(),
"status": "1" "status": "1",
"pastRecords": $("#pastRecords").val(),
"allergy": $("#allergy").val()
}; };
$.getJSON("#springUrl('/a/consultSheet/updateStatus')", dataJSON, function (returnobj) { $.getJSON("#springUrl('/a/consultSheet/updateStatus')", dataJSON, function (returnobj) {
// $("#save").attr("disabled", false); $("#save").attr("disabled", false);
if (returnobj.errorNo == 0) { //保存成功 if (returnobj.errorNo == 0) { //保存成功
Cfapp.alert({ Cfapp.alert({
message: "审核成功", message: "审核成功",
......
...@@ -78,20 +78,62 @@ ...@@ -78,20 +78,62 @@
<div class="box-header"> <div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/consultSheet/list')" method="get"> <form id="seachTableForm" action="#springUrl('/a/consultSheet/list')" method="get">
<div class="col-xs-2" > <div class="col-xs-2">
<input type="text" class="form-control " <input type="text" class="form-control"
name="userName" placeholder="用药人姓名"> name="consultId" placeholder="咨询单编码">
</div>
<div class="col-xs-2">
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" class="form-control pull-right datepicker"
name="startCreateTime" placeholder="提交开始时间"
readonly="readonly">
</div> </div>
<!-- <div class="col-xs-2">--> </div>
<!-- <input type="text" class="form-control "-->
<!-- name="illness" placeholder="病情描述">--> <div class="col-xs-2">
<!-- </div>--> <div class="input-group date">
<a href="javascript:void(0)" class="btn btn-primary search">搜索</a> <div class="input-group-addon">
#if($shiro.hasPermission("qy:consultSheet:edit")) <i class="fa fa-calendar"></i>
</div>
<a href="#springUrl('/a/consultSheet/exportExcel')" class="btn btn-primary">导出</a> <input type="text"
class="form-control pull-right datepicker"
name="endCreateTime" placeholder="提交结束时间"
readonly="readonly">
</div>
</div>
<div class="col-xs-2">
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" class="form-control pull-right datepicker"
name="startAuditTime" placeholder="审核开始时间"
readonly="readonly">
</div>
</div>
<div class="col-xs-2">
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text"
class="form-control pull-right datepicker"
name="endAuditTime" placeholder="审核结束时间"
readonly="readonly">
</div>
</div>
#end <a href="javascript:void(0)" class="btn btn-primary search">搜索</a>
<button type="button" class="btn btn-info" onclick="clearSearch()">重置</button>
#if($shiro.hasPermission("qy:consultSheet:edit"))
<a href="#springUrl('/a/consultSheet/exportExcel')" class="btn btn-primary">导出</a>
#end
</form> </form>
</div><!-- /.box-header --> </div><!-- /.box-header -->
...@@ -101,16 +143,16 @@ ...@@ -101,16 +143,16 @@
<tr> <tr>
<td hidden="true">Id</td> <td hidden="true">Id</td>
<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>
<th>客服姓名</th> <th>客服姓名</th>
<th>审核状态</th> <th>审核状态</th>
<th>拒绝原由</th> <th>拒绝原由</th>
<th>提交时间</th>
<th>审核时间</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
...@@ -164,8 +206,8 @@ ...@@ -164,8 +206,8 @@
var hour = now.getHours(); var hour = now.getHours();
var minute = now.getMinutes(); var minute = now.getMinutes();
var second = now.getSeconds(); var second = now.getSeconds();
return year + "-" + month + "-" + date + " " + hour + ":" return year + "-" + (month <= 9 ? "0" + month : month) + "-" + (date <= 9 ? "0" + date : date) + " " + (hour <= 9 ? "0" + hour : hour) + ":"
+ minute + ":" + second; + (minute <= 9 ? "0" + minute : minute) + ":" + (second <= 9 ? "0" + second : second);
} }
function seachTable() { function seachTable() {
...@@ -183,7 +225,7 @@ ...@@ -183,7 +225,7 @@
value: $(this).val() value: $(this).val()
}; };
aoData.push(params); aoData.push(params);
}) });
$.ajax({ $.ajax({
"type": "GET", "type": "GET",
...@@ -213,6 +255,9 @@ ...@@ -213,6 +255,9 @@
{ {
"mData": "consultId" "mData": "consultId"
}, },
{
"mData": "orderCode"
},
{ {
"mData": "userName" "mData": "userName"
}, },
...@@ -222,15 +267,6 @@ ...@@ -222,15 +267,6 @@
{ {
"mData": "phone" "mData": "phone"
}, },
{
"mData": "pastRecords"
},
{
"mData": "illness"
},
{
"mData": "allergy"
},
{ {
"mData": "pharmaName" "mData": "pharmaName"
}, },
...@@ -243,24 +279,29 @@ ...@@ -243,24 +279,29 @@
{ {
"mData": "description" "mData": "description"
}, },
{
"mData": "createTime"
},
{
"mData": "auditTime"
},
{ {
"mData": "id" "mData": "id"
} }
], ],
"aoColumnDefs": [ "aoColumnDefs": [
{ // set default column settings { // set default column settings
'visible': false, 'visible': false,
'targets': [0] 'targets': [0]
}, },
{ {
"aTargets": [1], "aTargets": [1],
"mData": "consultId", "mData": "consultId",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){ if (a) {
return a; return a;
}else{ } else {
return null; return null;
} }
...@@ -268,115 +309,118 @@ ...@@ -268,115 +309,118 @@
}, },
{ {
"aTargets": [2], "aTargets": [2],
"mData": "orderCode",
"mRender": function (a, b, c, d) {
if (a) {
var html = `#if($shiro.hasPermission("qy:order:view"))<a href="#springUrl("/a/consultSheet/orderlist?orderCode=` + a + `")">` + a + `</a> #end`;
return html;
} else {
return '';
}
}
},
{
"aTargets": [3],
"mData": "userName", "mData": "userName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(c){ if (c) {
return c.userName.slice(0, 1) + '*' + c.userName.slice(2, 3); return c.userName.slice(0, 1) + '*' + c.userName.slice(2, 3);
}else{ } else {
return null; return null;
} }
} }
}, },
{ {
"aTargets": [3], "aTargets": [4],
"mData": "sex", "mData": "sex",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a==0){ if (a == 0) {
return "女"; return "女";
}else{ } else {
return "男"; return "男";
} }
} }
}, },
{ {
"aTargets": [4], "aTargets": [5],
"mData": "phone", "mData": "phone",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(c){ if (c) {
return c.phone.slice(0, 3) + '****' + c.phone.slice(7); return c.phone.slice(0, 3) + '****' + c.phone.slice(7);
}else{ } else {
return null; return null;
} }
} }
}, },
{
"aTargets": [5],
"mData": "pastRecords",
"mRender": function (a, b, c, d) {
if(a==0){
return "否";
}else{
return "是";
}
}
},
{ {
"aTargets": [6], "aTargets": [6],
"mData": "illness", "mData": "pharmaName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a==0){ if (a) {
return "否"; return a;
}else{ } else {
return "是"; return null;
} }
} }
}, },
{ {
"aTargets": [7], "aTargets": [7],
"mData": "allergy", "mData": "customerName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a==0){ if (a) {
return "否"; return a;
}else{ } else {
return "是"; return null;
} }
} }
}, },
{ {
"aTargets": [8], "aTargets": [8],
"mData": "pharmaName", "mData": "status",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){ if (a == 0) {
return a; return "待审核";
}else{ } else if (a == 1) {
return null; return "已通过";
} else if (a == 2) {
return "已拒绝";
} }
} }
}, },
{ {
"aTargets": [9], "aTargets": [9],
"mData": "customerName", "mData": "description",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){ if (a) {
return a; return a;
}else{ } else {
return null; return null;
} }
} }
}, },
{ {
"aTargets": [10], "aTargets": [10],
"mData": "status", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a==0){ if (a) {
return "待审核"; return formatDates(a);
}else if(a==1){ } else {
return "已通过"; return null;
}else if(a==2){
return "已拒绝";
} }
} }
}, },
{ {
"aTargets": [11], "aTargets": [11],
"mData": "description", "mData": "auditTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a){ if (a) {
return a; return a;
}else{ } else {
return null; return null;
} }
} }
...@@ -385,15 +429,21 @@ ...@@ -385,15 +429,21 @@
"aTargets": [12], "aTargets": [12],
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
var object = c.status; let html = '';
html += '<div class="btn-group">\n' +
var html = ''; '<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
if (object==0 ){ '<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
html += '#if($shiro.hasPermission("qy:consultSheet:edit"))<a href="#springUrl("/a/consultSheet/form?id=' + a + '")" class="btn green">审核</a>#end'; ' <span class="caret"></span>\n' +
}else{ ' <span class="sr-only">Toggle Dropdown</span>\n' +
html += '#if($shiro.hasPermission("qy:consultSheet:view"))<a href="#springUrl("/a/consultSheet/form?id=' + a + '")" class="btn green">查看</a> #end'; '</button>\n' +
'<ul class="dropdown-menu" role="menu" style="min-width: 100px;">\n';
if (c.status == '0') {
html += '<li>#if($shiro.hasPermission("qy:consultSheet:edit"))<a href="#springUrl("/a/consultSheet/form?id=' + a + '")" class="btn green">审核</a>#end</li>';
} else {
html += '<li>#if($shiro.hasPermission("qy:consultSheet:view"))<a href="#springUrl("/a/consultSheet/form?id=' + a + '")" class="btn green">查看</a> #end</li>';
} }
return html html += '</ul>';
return html;
} }
} }
] ]
...@@ -466,6 +516,13 @@ ...@@ -466,6 +516,13 @@
}); });
} }
function clearSearch() {
$("#seachTableForm input").each(function () {
$(this).val('');
});
$("#table").dataTable().fnClearTable();
}
</script> </script>
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<result column="drugs_id" property="drugsId"></result> <result column="drugs_id" property="drugsId"></result>
<result column="member_id" property="memberId"></result> <result column="member_id" property="memberId"></result>
<result column="order_id" property="orderId"></result> <result column="order_id" property="orderId"></result>
<result column="address_id" property="addressId"></result>
<result column="audit_time" property="auditTime"></result>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -85,9 +87,12 @@ ...@@ -85,9 +87,12 @@
a.drugs_id, a.drugs_id,
a.member_id, a.member_id,
a.order_id, a.order_id,
a.address_id,
a.audit_time,
b.`name` pharmaName, b.`name` pharmaName,
c.`name` customerName c.`name` customerName
</sql> </sql>
<sql id="sqlCol"> <sql id="sqlCol">
id, id,
CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8) userName, CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8) userName,
...@@ -102,8 +107,8 @@ ...@@ -102,8 +107,8 @@
description, description,
allergy, allergy,
symptom, symptom,
open_id open_id,
consult_id consultId
</sql> </sql>
<insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true" <insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true"
...@@ -135,7 +140,9 @@ ...@@ -135,7 +140,9 @@
open_id, open_id,
drugs_id, drugs_id,
member_id, member_id,
order_id order_id,
address_id,
audit_time
) )
values values
( (
...@@ -160,21 +167,25 @@ ...@@ -160,21 +167,25 @@
#{updateBy, jdbcType=BIGINT}, #{updateBy, jdbcType=BIGINT},
#{allergy, jdbcType=VARCHAR}, #{allergy, jdbcType=VARCHAR},
#{symptom, jdbcType=VARCHAR}, #{symptom, jdbcType=VARCHAR},
#{diagnosis,jdbcType=BIGINT}, #{diagnosis, jdbcType=BIGINT},
#{openId, jdbcType=VARCHAR}, #{openId, jdbcType=VARCHAR},
#{drugsId,jdbcType=BIGINT}, #{drugsId, jdbcType=BIGINT},
#{memberId,jdbcType=BIGINT}, #{memberId, jdbcType=BIGINT},
#{orderId,jdbcType=BIGINT} #{orderId, jdbcType=BIGINT},
#{addressId, jdbcType=VARCHAR},
#{auditTime, jdbcType=TIMESTAMP},
) )
</insert> </insert>
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap"> <select id="fetchById" parameterType="java.lang.Long" resultMap="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>, d.name pharmacist,e.org_name hospital
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
WHERE a.id=#{id} LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_qyuser e ON e.id = a.allergy
WHERE a.id = #{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">
...@@ -186,10 +197,11 @@ ...@@ -186,10 +197,11 @@
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>, o.number orderCode
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
LEFT JOIN t_order o ON a.order_id = o.id
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"/>
...@@ -207,7 +219,7 @@ ...@@ -207,7 +219,7 @@
and open_id = #{openid} and open_id = #{openid}
</if> </if>
<if test="name!=null and name !=''"> <if test="name!=null and name !=''">
and CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8) like concat('%',#{name},'%') and (CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8) like concat('%',#{name},'%') OR consult_id like concat('%',#{name},'%'))
</if> </if>
<if test="id!=null"> <if test="id!=null">
and id = #{id} and id = #{id}
...@@ -233,7 +245,6 @@ ...@@ -233,7 +245,6 @@
<if test="numberId != null"> <if test="numberId != null">
number_id = AES_ENCRYPT(#{numberId, jdbcType=VARBINARY},'aideakey'), number_id = AES_ENCRYPT(#{numberId, jdbcType=VARBINARY},'aideakey'),
</if> </if>
<if test="sex != null"> <if test="sex != null">
sex = #{sex, jdbcType=BIGINT}, sex = #{sex, jdbcType=BIGINT},
</if> </if>
...@@ -297,6 +308,12 @@ ...@@ -297,6 +308,12 @@
<if test="openId != null"> <if test="openId != null">
order_id = #{orderId, jdbcType=BIGINT}, order_id = #{orderId, jdbcType=BIGINT},
</if> </if>
<if test="addressId != null">
address_id = #{addressId, jdbcType=BIGINT},
</if>
<if test="auditTime != null">
audit_time = #{auditTime, jdbcType=TIMESTAMP},
</if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
...@@ -315,18 +332,18 @@ ...@@ -315,18 +332,18 @@
description = #{description} description = #{description}
</if> </if>
</set> </set>
where id = #{id} where id = #{consultId}
</update> </update>
<update id="updateStatus" > <update id="updateStatus">
update t_aidea_consult_sheet update t_aidea_consult_sheet
<set> <set>
<if test="status !=null"> <if test="status !=null">
status = #{status} status = #{status}
</if> </if>
</set> </set>
where id = #{id} where id = #{consultId}
</update> </update>
</mapper> </mapper>
package com.cftech.consultsheet.model; package com.cftech.consultsheet.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.cftech.core.poi.ExportConfig; import com.cftech.core.poi.ExportConfig;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data; import lombok.Data;
import org.codehaus.jackson.format.DataFormatMatcher;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -19,7 +15,6 @@ import java.util.Date; ...@@ -19,7 +15,6 @@ import java.util.Date;
@Data @Data
public class ConsultSheet extends UserSheet implements Serializable { public class ConsultSheet extends UserSheet implements Serializable {
/* 主键id */ /* 主键id */
private Long id; private Long id;
/* 咨询单编码 */ /* 咨询单编码 */
...@@ -36,17 +31,13 @@ public class ConsultSheet extends UserSheet implements Serializable { ...@@ -36,17 +31,13 @@ public class ConsultSheet extends UserSheet implements Serializable {
/* 手机号 */ /* 手机号 */
@ExportConfig(value = "联系电话", width = 100, showLevel = 1) @ExportConfig(value = "联系电话", width = 100, showLevel = 1)
private String phone; private String phone;
/* 有无不良反应 */ /* 处方医院组织长字段 */
@ExportConfig(value = "有无不良反应", width = 100, showLevel = 1)
private Long pastRecords;
/* 有无过敏反应 */
@ExportConfig(value = "有无过敏反应", width = 100, showLevel = 1)
private Long allergy;
/* 是否服用过该药且无禁忌症 */
@ExportConfig(value = "是否服用过该药且无禁忌症", width = 100, showLevel = 1)
private Long illness; private Long illness;
/* 处方医院 */
private Long allergy;
/* 处方医生 */
private Long pastRecords;
/* 处方单 */ /* 处方单 */
@ExportConfig(value = "处方单", width = 100, showLevel = 1)
private String prescription; private String prescription;
/* 药师id */ /* 药师id */
private Long doctorId; private Long doctorId;
...@@ -82,7 +73,25 @@ public class ConsultSheet extends UserSheet implements Serializable { ...@@ -82,7 +73,25 @@ public class ConsultSheet extends UserSheet implements Serializable {
/* 订单id */ /* 订单id */
private Long orderId; private Long orderId;
/**
* 审核时间
*/
private String auditTime;
private String addressId;
/**
* 无数据库映射字段
*/
private String appId; private String appId;
private String orderCode;
private String startCreateTime;
private String endCreateTime;
private String startAuditTime;
private String endAuditTime;
private String hospital;//处方医院
private String pharmacist;//处方医生
public ConsultSheet() { public ConsultSheet() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
......
...@@ -9,6 +9,7 @@ import lombok.Data; ...@@ -9,6 +9,7 @@ import lombok.Data;
*/ */
@Data @Data
public class ConsultSheetDto { public class ConsultSheetDto {
/*搜索条件*/ /*搜索条件*/
private String name; private String name;
private Long id; private Long id;
......
...@@ -176,31 +176,31 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im ...@@ -176,31 +176,31 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
conds.in("o.status", new String[]{"2", "3", "4"});//2 待发货,3:待收货 4:待付款 conds.in("o.status", new String[]{"2", "3", "4"});//2 待发货,3:待收货 4:待付款
int count = orderService.count(conds); int count = orderService.count(conds);
if (count > 0) { //复购 if (count > 0) { //复购
Conds memberConds = new Conds(); // Conds memberConds = new Conds();
memberConds.equal("del_flag", Constants.DEL_FLAG_0); // memberConds.equal("del_flag", Constants.DEL_FLAG_0);
memberConds.equal("open_id", openid); // memberConds.equal("open_id", openid);
Member member = memberService.fetchSearchByConds(conds); // Member member = memberService.fetchSearchByConds(memberConds);
//
String serviceId = member.getServiceId(); // String serviceId = member.getServiceId();
Conds userConds = new Conds(); // Conds userConds = new Conds();
userConds.equal("t.del_flag", Constants.DEL_FLAG_0); // userConds.equal("t.del_flag", Constants.DEL_FLAG_0);
userConds.equal("t.id", serviceId); // userConds.equal("t.id", serviceId);
Qyuser user = qyuserService.fetchSearchByConds(userConds); // Qyuser user = qyuserService.fetchSearchByConds(userConds);
if (user.getPeakVal() > 0) {//客服峰值大于0 // if (user.getPeakVal() > 0) {//客服峰值大于0
consultSheet.setServiceId(user.getId()); // consultSheet.setServiceId(user.getId());
//推送消息 // //推送消息
} else {//普通轮询 // } else {//普通轮询
// firstCustomerProcess(consultSheet);
// }
//
// String doctorId = member.getDoctorId();
// userConds.equal("t.id", doctorId);
// user = qyuserService.fetchSearchByConds(userConds);
// if (user.getPeakVal() > 0) {//药师峰值大于0
// consultSheet.setDoctorId(user.getId());
// } else {//普通轮询
firstCustomerProcess(consultSheet); firstCustomerProcess(consultSheet);
} //}
String doctorId = member.getDoctorId();
userConds.equal("t.id", doctorId);
user = qyuserService.fetchSearchByConds(userConds);
if (user.getPeakVal() > 0) {//药师峰值大于0
consultSheet.setDoctorId(user.getId());
} else {//普通轮询
firstCustomerProcess(consultSheet);
}
} else {//首次购买 } else {//首次购买
firstCustomerProcess(consultSheet); firstCustomerProcess(consultSheet);
} }
......
...@@ -15,10 +15,7 @@ import com.cftech.core.poi.ExcelKit; ...@@ -15,10 +15,7 @@ import com.cftech.core.poi.ExcelKit;
import com.cftech.core.scope.OrderType; 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.Constants; import com.cftech.core.util.*;
import com.cftech.core.util.DateFormatUtils;
import com.cftech.core.util.MpTokenUtil;
import com.cftech.core.util.SystemConfig;
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;
...@@ -26,7 +23,6 @@ import com.google.gson.Gson; ...@@ -26,7 +23,6 @@ import com.google.gson.Gson;
import org.mp.api.core.req.model.message.IndustryTemplateMessageSend; import org.mp.api.core.req.model.message.IndustryTemplateMessageSend;
import org.mp.api.core.req.model.message.TemplateData; import org.mp.api.core.req.model.message.TemplateData;
import org.mp.api.wxsendmsg.JwTemplateMessageAPI; import org.mp.api.wxsendmsg.JwTemplateMessageAPI;
import org.springframework.util.StringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
...@@ -83,7 +79,6 @@ public class ConsultSheetController { ...@@ -83,7 +79,6 @@ public class ConsultSheetController {
private AddressService addressService; private AddressService addressService;
//列表页面 //列表页面
@RequiresPermissions(value = CONSULTSHEET_VIEW) @RequiresPermissions(value = CONSULTSHEET_VIEW)
@RequestMapping("/list") @RequestMapping("/list")
...@@ -93,13 +88,32 @@ public class ConsultSheetController { ...@@ -93,13 +88,32 @@ public class ConsultSheetController {
return "consultSheet/consultSheetlist"; return "consultSheet/consultSheetlist";
} }
//跳转订单列表
@RequestMapping("/orderlist")
public String orderlist(HttpServletRequest request, Model model, String orderCode) {
Long accountId = UserUtils.getmpaccounts(request);
model.addAttribute("accountId", accountId);
model.addAttribute("orderCode", orderCode);
return "order/orderlist";
}
//编辑页面(新增、修改) //编辑页面(新增、修改)
@RequiresPermissions(value = CONSULTSHEET_VIEW) @RequiresPermissions(value = CONSULTSHEET_VIEW)
@RequestMapping("/form") @RequestMapping("/form")
public String form(HttpServletRequest request, String id, Model model) { public String form(HttpServletRequest request, String id, Model model) {
if (!StringUtils.isEmpty(id)) { if (StringUtils.isNoneBlank(id)) {
ConsultSheet consultSheet = consultSheetService.fetchById(id); ConsultSheet consultSheet = consultSheetService.fetchById(id);
JSONObject object= JSON.parseObject(JSON.toJSONString(consultSheet)); if (StringUtils.isNoneBlank(consultSheet.getUserName()) && consultSheet.getUserName().length() >=2) {
StringBuilder str = new StringBuilder(consultSheet.getUserName());
str.replace(1, 1, "*");
consultSheet.setUserName(str.toString());
}
if (StringUtils.isNoneBlank(consultSheet.getPhone())) {
StringBuilder str = new StringBuilder(consultSheet.getPhone());
str.replace(3, 7, "****");
consultSheet.setPhone(str.toString());
}
JSONObject object = JSON.parseObject(JSON.toJSONString(consultSheet));
model.addAttribute("data", object); model.addAttribute("data", object);
} }
return "consultSheet/consultSheetform"; return "consultSheet/consultSheetform";
...@@ -132,127 +146,6 @@ public class ConsultSheetController { ...@@ -132,127 +146,6 @@ public class ConsultSheetController {
return rtnJson; return rtnJson;
} }
//审核拒绝功能
@RequestMapping(value = "/updateData")
@ResponseBody
public JSONObject updateData(Long id, String status, String description ,HttpServletRequest request) {
JSONObject rtnJson = new JSONObject();
ConsultSheet consultSheet = consultSheetService.fetchById(id);
try {
if (id!=null && !StringUtils.isEmpty(status) && !StringUtils.isEmpty(description)) {
Integer integer = consultSheetService.updateDate(id, status, description);
if (integer<0) {
//发送审核通过模板消息
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("CONSULT_SHEET_AUDIT_REFUSE_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您的咨询单审核通过。";
String remark = "不通过原由:{" + consultSheet.getDescription() + "};请点击详情重新填写咨询单。";
String [] keywords = {consultSheet.getUserName(),
consultSheet.getConsultId(),
DateFormatUtils.getDateFormat(consultSheet.getCreateTime(), "yyyy年MM月dd日")};
sendMessage(refuseTmpId, token, consultSheet.getOpenId(),first, remark, keywords, null);
}
if(integer>0){
rtnJson.put("errorNo", 0);
}
}
} catch (Exception e) {
//发送审核通过模板消息
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您提交的咨询单审核失败。";
String remark = "不通过原由:{" + consultSheet.getDescription() + "};请点击详情重新填写咨询单。";
String [] keywords = {consultSheet.getUserName(),
consultSheet.getConsultId(),
DateFormatUtils.getDateFormat(consultSheet.getCreateTime(), "yyyy年MM月dd日")};
sendMessage(refuseTmpId, token, consultSheet.getOpenId(),first, remark, keywords, null);
e.printStackTrace();
rtnJson.put("errorNo", 1);
}
return rtnJson;
}
//审核通过功能
@RequiresPermissions(value = CONSULTSHEET_EDIT)
@RequestMapping("/updateStatus")
@ResponseBody
public JSONObject updateStatus(Long id, String status) {
JSONObject rtnJson = new JSONObject();
ConsultSheet consultSheet = consultSheetService.fetchById(id);
try {
if (!StringUtils.isEmpty(id) && !StringUtils.isEmpty(id) ) {
// ConsultSheet sheet = new ConsultSheet();
// sheet.setId(id);
// sheet.setStatus(status);
Integer integer = consultSheetService.updateStatus(id,status);
if (integer>0){
//生成空订单
Order order = new Order();
order.setNumber(codingruleUtils.getNumber(consultSheet.getAccountsId(), Order.class.getName()));
order.setOpenid(consultSheet.getOpenId());
order.setConsultId(consultSheet.getId());
order.setServiceId(consultSheet.getServiceId());
order.setDoctorId(consultSheet.getDoctorId());
//获取默认地址
Conds adsConds = new Conds();
adsConds.equal("t.del_flag", Constants.DEL_FLAG_0);
adsConds.equal("t.open_id", consultSheet.getOpenId());
adsConds.equal("t.whether", "1");
Address address = addressService.fetchSearchByConds(adsConds);
if (address != null) {
order.setAddressId(address.getId());
}
orderService.save(order);
// //反写咨询单
// consultSheet.setOrderId(order.getId());
// consultSheetService.update(consultSheet);
//发送审核通过模板消息
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您的咨询单已完成。";
String remark = "请点击详情查看咨询单信息。";
String [] keywords = {consultSheet.getUserName(),
order.getNumber()};
sendMessage(refuseTmpId, token, consultSheet.getOpenId(),first, remark, keywords, null);
rtnJson.put("errorNo", 0);
}
}
} catch (Exception e) {
//发送审核通过模板消息
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您提交的咨询单审核失败。";
String remark = "请重新填写咨询单。";
String [] keywords = {consultSheet.getUserName(),
consultSheet.getConsultId(),
DateFormatUtils.getDateFormat(consultSheet.getCreateTime(), "yyyy年MM月dd日")};
sendMessage(refuseTmpId, token, consultSheet.getOpenId(),first, remark, keywords, null);
e.printStackTrace();
rtnJson.put("errorNo", 1);
}
return rtnJson;
}
//获取列表数据 //获取列表数据
@RequiresPermissions(value = CONSULTSHEET_VIEW) @RequiresPermissions(value = CONSULTSHEET_VIEW)
@RequestMapping(value = "/listData") @RequestMapping(value = "/listData")
...@@ -263,24 +156,31 @@ public class ConsultSheetController { ...@@ -263,24 +156,31 @@ public class ConsultSheetController {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds(); Conds conds = new Conds();
if (!StringUtils.isEmpty(consultSheet.getUserName())){ if (StringUtils.isNoneBlank(consultSheet.getConsultId())) {
conds.like("CONVERT(AES_DECRYPT(a.user_name,'aideakey') USING UTF8)",consultSheet.getUserName()); conds.like("a.consult_id", "%" + consultSheet.getConsultId() + "%");
}
if (StringUtils.isNoneBlank(consultSheet.getStartCreateTime())) {
conds.greatEqual("DATE_FORMAT(a.create_time, '%Y-%m-%d')", consultSheet.getStartCreateTime());
}
if (StringUtils.isNoneBlank(consultSheet.getEndCreateTime())) {
conds.lessEqual("DATE_FORMAT(a.create_time, '%Y-%m-%d')", consultSheet.getEndCreateTime());
}
if (StringUtils.isNoneBlank(consultSheet.getStartAuditTime())) {
conds.greatEqual("DATE_FORMAT(a.audit_time, '%Y-%m-%d')", consultSheet.getStartAuditTime());
}
if (StringUtils.isNoneBlank(consultSheet.getEndAuditTime())) {
conds.lessEqual("DATE_FORMAT(a.audit_time, '%Y-%m-%d')", consultSheet.getEndAuditTime());
} }
// if (!StringUtils.isEmpty(consultSheet.getIllness())){
// conds.like("a.illness",consultSheet.getIllness());
// }
conds.equal("a.del_flag", Constants.DEL_FLAG_0); conds.equal("a.del_flag", Constants.DEL_FLAG_0);
conds.equal("a.accounts_id", accountsId); conds.equal("a.accounts_id", accountsId);
Sort sort = new Sort("a.create_time", OrderType.DESC); Sort sort = new Sort("a.create_time", OrderType.DESC);
List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength,id); List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, id);
Integer counts = consultSheetService.count(conds); Integer counts = consultSheetService.count(conds);
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts); rtnJson.put("iTotalRecords", counts);
rtnJson.put("iTotalDisplayRecords", counts); rtnJson.put("iTotalDisplayRecords", counts);
rtnJson.put("aaData", list); rtnJson.put("aaData", list);
System.out.println(rtnJson.toJSONString());
return rtnJson; return rtnJson;
} }
...@@ -363,6 +263,155 @@ public class ConsultSheetController { ...@@ -363,6 +263,155 @@ public class ConsultSheetController {
return list(request, model); return list(request, model);
} }
/**
* 咨询单审核拒绝功能
* @param consultId
* @param status
* @param description
* @param request
* @return
*/
@RequestMapping(value = "/updateData")
@ResponseBody
public JSONObject updateData(String consultId, String status, String description ,HttpServletRequest request) {
JSONObject rtnJson = new JSONObject();
ConsultSheet consultSheet = consultSheetService.fetchById(Long.parseLong(consultId));
consultSheet.setDescription(description);
try {
if (StringUtils.isNoneBlank(consultId) && StringUtils.isNoneBlank(status) && StringUtils.isNoneBlank(description)) {
Integer integer = consultSheetService.updateDate(consultId, status, description);
if (integer>0) {
//发送审核通过模板消息
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("CONSULT_SHEET_AUDIT_REFUSE_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您的咨询单审核不通过。";
String remark = "不通过原由:" + consultSheet.getDescription() + ";请点击详情重新填写咨询单。";
String [] keywords = {consultSheet.getUserName(),
consultSheet.getConsultId(),
DateFormatUtils.getDateFormat(consultSheet.getCreateTime(), "yyyy年MM月dd日")};
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);
rtnJson.put("errorNo", 0);
}
}
} catch (Exception e) {
//发送审核通过模板消息
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您提交的咨询单审核失败。";
String remark = "请重新填写咨询单。";
String [] keywords = {consultSheet.getUserName(),
consultSheet.getConsultId(),
DateFormatUtils.getDateFormat(consultSheet.getCreateTime(), "yyyy年MM月dd日")};
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);
e.printStackTrace();
rtnJson.put("errorNo", 1);
}
return rtnJson;
}
/**
* 咨询单审核通过
* @param consultId
* @param status
* @param request
* @return
*/
@RequiresPermissions(value = CONSULTSHEET_EDIT)
@RequestMapping("/updateStatus")
@ResponseBody
public JSONObject updateStatus(String consultId, String status, Long pastRecords, Long allergy, HttpServletRequest request) {
Long accountId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject();
ConsultSheet consultSheet = consultSheetService.fetchById(Long.parseLong(consultId));
try {
if (StringUtils.isNoneBlank(consultId) && StringUtils.isNoneBlank(status)) {
Integer integer = consultSheetService.updateStatus(consultId, status);
if (integer > 0){
//生成空订单
Order order = new Order();
order.setNumber(codingruleUtils.getNumber(consultSheet.getAccountsId(), Order.class.getName()));
order.setOpenid(consultSheet.getOpenId());
order.setConsultId(consultSheet.getId());
order.setServiceId(consultSheet.getServiceId());
order.setDoctorId(consultSheet.getDoctorId());
order.setAccountsId(accountId);
order.setStatus("0");//添加订单待确认
//获取默认地址
if (StringUtils.isEmpty(consultSheet.getAddressId())) {
Conds adsConds = new Conds();
adsConds.equal("t.del_flag", Constants.DEL_FLAG_0);
adsConds.equal("t.open_id", consultSheet.getOpenId());
adsConds.equal("t.whether", "1");
Address address = addressService.fetchSearchByConds(adsConds);
if (address != null) {
order.setAddressId(address.getId());
}
} else {//固化地址
Conds adsConds = new Conds();
adsConds.equal("t.del_flag", Constants.DEL_FLAG_0);
adsConds.equal("t.id", consultSheet.getAddressId());
Address address = addressService.fetchSearchByConds(adsConds);
order.setAddressId(Long.parseLong(consultSheet.getAddressId()));
order.setAddressDes(address.getProvinceName()+address.getCityName()+address.getCountyName()+address.getAddressName());
}
orderService.save(order);
//反写咨询单
if (pastRecords != null) {
consultSheet.setPastRecords(pastRecords);
}
if (allergy != null) {
consultSheet.setAllergy(allergy);
}
consultSheet.setStatus(status);
consultSheet.setOrderId(order.getId());
consultSheetService.update(consultSheet);
//发送审核通过模板消息
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您的咨询单已完成。";
String remark = "请点击详情查看咨询单信息。";
String url = SystemConfig.p.getProperty("MOBILE_MP_DOMAIN_NAME") + "/zxdxq?appid=" + appid + "&tokenId=1&id="+consultSheet.getId();
String [] keywords = {consultSheet.getUserName(),
order.getNumber()};
sendMessage(refuseTmpId, token, consultSheet.getOpenId(),first, remark, keywords, url);
rtnJson.put("errorNo", 0);
}
}
} catch (Exception e) {
//发送审核通过模板消息
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String refuseTmpId = SystemConfig.p.getProperty("CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String first = "您好,您提交的咨询单审核失败。";
String remark = "请重新填写咨询单。";
String [] keywords = {consultSheet.getUserName(),
consultSheet.getConsultId(),
DateFormatUtils.getDateFormat(consultSheet.getCreateTime(), "yyyy年MM月dd日")};
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);
e.printStackTrace();
rtnJson.put("errorNo", 1);
}
return rtnJson;
}
private void sendMessage(String templateId, String token, String openId, String first, String remark, String [] keywords, String url){ private void sendMessage(String templateId, String token, String openId, String first, String remark, String [] keywords, String url){
IndustryTemplateMessageSend mc = new IndustryTemplateMessageSend(); IndustryTemplateMessageSend mc = new IndustryTemplateMessageSend();
mc.setTemplate_id(templateId); mc.setTemplate_id(templateId);
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<result column="drugs_id" property="drugsId"></result> <result column="drugs_id" property="drugsId"></result>
<result column="member_id" property="memberId"></result> <result column="member_id" property="memberId"></result>
<result column="order_id" property="orderId"></result> <result column="order_id" property="orderId"></result>
<result column="address_id" property="addressId"></result>
<result column="audit_time" property="auditTime"></result>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -85,9 +87,12 @@ ...@@ -85,9 +87,12 @@
a.drugs_id, a.drugs_id,
a.member_id, a.member_id,
a.order_id, a.order_id,
a.address_id,
a.audit_time,
b.`name` pharmaName, b.`name` pharmaName,
c.`name` customerName c.`name` customerName
</sql> </sql>
<sql id="sqlCol"> <sql id="sqlCol">
id, id,
CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8) userName, CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8) userName,
...@@ -102,8 +107,8 @@ ...@@ -102,8 +107,8 @@
description, description,
allergy, allergy,
symptom, symptom,
open_id open_id,
consult_id consultId
</sql> </sql>
<insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true" <insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true"
...@@ -135,7 +140,9 @@ ...@@ -135,7 +140,9 @@
open_id, open_id,
drugs_id, drugs_id,
member_id, member_id,
order_id order_id,
address_id,
audit_time
) )
values values
( (
...@@ -160,21 +167,25 @@ ...@@ -160,21 +167,25 @@
#{updateBy, jdbcType=BIGINT}, #{updateBy, jdbcType=BIGINT},
#{allergy, jdbcType=VARCHAR}, #{allergy, jdbcType=VARCHAR},
#{symptom, jdbcType=VARCHAR}, #{symptom, jdbcType=VARCHAR},
#{diagnosis,jdbcType=BIGINT}, #{diagnosis, jdbcType=BIGINT},
#{openId, jdbcType=VARCHAR}, #{openId, jdbcType=VARCHAR},
#{drugsId,jdbcType=BIGINT}, #{drugsId, jdbcType=BIGINT},
#{memberId,jdbcType=BIGINT}, #{memberId, jdbcType=BIGINT},
#{orderId,jdbcType=BIGINT} #{orderId, jdbcType=BIGINT},
#{addressId, jdbcType=VARCHAR},
#{auditTime, jdbcType=TIMESTAMP},
) )
</insert> </insert>
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap"> <select id="fetchById" parameterType="java.lang.Long" resultMap="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>, d.name pharmacist,e.org_name hospital
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
WHERE a.id=#{id} LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_qyuser e ON e.id = a.allergy
WHERE a.id = #{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">
...@@ -186,10 +197,11 @@ ...@@ -186,10 +197,11 @@
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>, o.number orderCode
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
LEFT JOIN t_order o ON a.order_id = o.id
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"/>
...@@ -197,24 +209,25 @@ ...@@ -197,24 +209,25 @@
<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 id="consultSheetList" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlCol"/> <include refid="sqlCol"/>
from t_aidea_consult_sheet from t_aidea_consult_sheet
where del_flag = 0 where del_flag = 0
<if test="openid!=null"> <if test="openid!=null">
and open_id = #{openid} and open_id = #{openid}
</if> </if>
<if test="name!=null and name !=''"> <if test="name!=null and name !=''">
and user_name like concat('%',#{name},'%') and (CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8) like concat('%',#{name},'%') OR consult_id like concat('%',#{name},'%'))
</if> </if>
<if test="id!=null"> <if test="id!=null">
and id = #{id} and id = #{id}
</if> </if>
ORDER BY create_time DESC ORDER BY create_time DESC
<if test="page!=null and pageSize !='' and pageSize!=null and page !=''"> <if test="page!=null and pageSize !='' and pageSize!=null and page !=''">
limit #{page},#{pageSize} limit #{page}, #{pageSize}
</if> </if>
</select> </select>
<update id="update" parameterType="com.cftech.consultsheet.model.ConsultSheet"> <update id="update" parameterType="com.cftech.consultsheet.model.ConsultSheet">
...@@ -232,7 +245,6 @@ ...@@ -232,7 +245,6 @@
<if test="numberId != null"> <if test="numberId != null">
number_id = AES_ENCRYPT(#{numberId, jdbcType=VARBINARY},'aideakey'), number_id = AES_ENCRYPT(#{numberId, jdbcType=VARBINARY},'aideakey'),
</if> </if>
<if test="sex != null"> <if test="sex != null">
sex = #{sex, jdbcType=BIGINT}, sex = #{sex, jdbcType=BIGINT},
</if> </if>
...@@ -296,6 +308,12 @@ ...@@ -296,6 +308,12 @@
<if test="openId != null"> <if test="openId != null">
order_id = #{orderId, jdbcType=BIGINT}, order_id = #{orderId, jdbcType=BIGINT},
</if> </if>
<if test="addressId != null">
address_id = #{addressId, jdbcType=BIGINT},
</if>
<if test="auditTime != null">
audit_time = #{auditTime, jdbcType=TIMESTAMP},
</if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
...@@ -314,7 +332,7 @@ ...@@ -314,7 +332,7 @@
description = #{description} description = #{description}
</if> </if>
</set> </set>
where consult_id = #{consultId} where id = #{consultId}
</update> </update>
<update id="updateStatus"> <update id="updateStatus">
...@@ -325,8 +343,7 @@ ...@@ -325,8 +343,7 @@
</if> </if>
</set> </set>
where consult_id = #{consultId} where id = #{consultId}
</update> </update>
</mapper> </mapper>
...@@ -110,15 +110,15 @@ ...@@ -110,15 +110,15 @@
> >
</div> </div>
<div class="form-group form-md-line-input col-xs-5"> <!--<div class="form-group form-md-line-input col-xs-5">-->
<label>收货地址<font style="color: red"></font></label> <!--<label>收货地址<font style="color: red"></font></label>-->
<input type="text" <!--<input type="text"-->
class="form-control" name="address" <!--class="form-control" name="address"-->
id="address" readonly="readonly" <!--id="address" readonly="readonly"-->
maxlength="50" placeholder="收货地址" <!--maxlength="50" placeholder="收货地址"-->
value="$!{data.address}" <!--value="$!{data.address}"-->
> <!--&gt;-->
</div> <!--</div>-->
<div class="form-group form-md-line-input col-xs-5"> <div class="form-group form-md-line-input col-xs-5">
<label>订单状态<font style="color: red"></font></label> <label>订单状态<font style="color: red"></font></label>
<input type="text" <input type="text"
...@@ -355,7 +355,7 @@ ...@@ -355,7 +355,7 @@
var amountPrice = countSi * item.price var amountPrice = countSi * item.price
var amountTmp = amountPrice.toFixed(2) var amountTmp = amountPrice.toFixed(2)
var item = areaList[0] var item = areaList[0]
HtmlAmount += `<input id="htmlAmount" class="form-control" name="htmlAmount" data-price="${item.id}" style="width: 180px;margin-right: 50px" type="text" readonly="readonly" value="${amountTmp}"></input>` HtmlAmount += `<input id="htmlAmount" class="form-control" name="htmlAmount" data-price="${item.id}" style="width: 180px;margin-right: 50px" type="number" value="${amountTmp}"></input>`
} }
......
...@@ -77,17 +77,83 @@ ...@@ -77,17 +77,83 @@
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/order/list')" method="get"> <form id="seachTableForm" action="#springUrl('/a/order/list')" method="get">
<div class="col-xs-2">
<input type="text" class="form-control"
name="number" value="" placeholder="订单编号">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="consultCode" placeholder="咨询单编码">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="productNameTmp" placeholder="产品名称">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="courierNumber" placeholder="顺丰运单号">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="startOrderAmount" placeholder="订单金额开始区间">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="endOrderAmount" placeholder="订单金额结束区间">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="startPayAmount" placeholder="付款金额开始区间">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="endPayAmount" placeholder="付款金额结束区间">
</div>
<div class="col-xs-2">
<select id="status" name="status" class="form-control required">
<option value="">请选择订单状态</option>
<option value="0">待确认</option>
<option value="1">待付款</option>
<option value="2">待发货</option>
<option value="3">待收货</option>
<option value="4">已完成</option>
<option value="5">已取消</option>
</select>
</div>
<div class="col-xs-2"> <div class="col-xs-2">
<input type="text" class="form-control " <select id="isBill" name="isBill" class="form-control required">
name="number" placeholder="订单编号"> <option value="">请选择是否开票</option>
<option value="0"></option>
<option value="1"></option>
</select>
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
<input type="text" class="form-control " <div class="input-group date">
name="productName" placeholder="产品名称"> <div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" class="form-control pull-right datepicker"
name="orderStartTime" placeholder="订单开始时间"
readonly="readonly">
</div>
</div>
<div class="col-xs-2">
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text"
class="form-control pull-right datepicker"
name="orderEndTime" placeholder="订单结束时间"
readonly="readonly">
</div>
</div> </div>
<button type="button" class="search btn btn-primary">搜索</button> <button type="button" class="search btn btn-primary">搜索</button>
<button type="button" class="btn btn-info" onclick="clearSearch()">重置</button>
#if($shiro.hasPermission("qy:order:edit")) #if($shiro.hasPermission("qy:order:edit"))
<!-- <a href="#springUrl('/a/order/form')" class="btn btn-primary">新增</a>--> <!-- <a href="#springUrl('/a/order/form')" class="btn btn-primary">新增</a>-->
<a href="#springUrl('/a/order/exportExcel')" class="btn btn-primary">导出</a> <a href="#springUrl('/a/order/exportExcel')" class="btn btn-primary">导出</a>
...@@ -103,14 +169,17 @@ ...@@ -103,14 +169,17 @@
<tr> <tr>
<td hidden="true">Id</td> <td hidden="true">Id</td>
<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>openid</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>
...@@ -159,6 +228,12 @@ ...@@ -159,6 +228,12 @@
var csrf = '${_csrf.token}'; var csrf = '${_csrf.token}';
var csrf_header = '${_csrf.headerName}'; var csrf_header = '${_csrf.headerName}';
//咨询单列表通过订单编码跳转单条订单信息
var orderCode = `${orderCode}`;
if (orderCode != null && orderCode != '' && orderCode != "undefined") {
$('input[name="number"]').val(`${orderCode}`);
}
function formatDates(now) { function formatDates(now) {
var now = new Date(now); var now = new Date(now);
var year = now.getFullYear(); var year = now.getFullYear();
...@@ -176,16 +251,16 @@ ...@@ -176,16 +251,16 @@
var aoData = { var aoData = {
iDisplayStart: 1, iDisplayStart: 1,
iDosplayLength: 10 iDosplayLength: 10
} };
var retrieveData = function (sSource, aoData, fnCallback) {
$("#seachTableForm input").each(function () { var retrieveData = function (sSource, aoData, fnCallback) {
$("#seachTableForm input,select").each(function () {
var params = { var params = {
name: $(this).attr("name"), name: $(this).attr("name"),
value: $(this).val() value: $(this).val()
}; };
aoData.push(params); aoData.push(params);
}) });
$.ajax({ $.ajax({
"type": "GET", "type": "GET",
...@@ -214,6 +289,9 @@ ...@@ -214,6 +289,9 @@
{ {
"mData": "number" "mData": "number"
}, },
{
"mData": "consultCode"
},
{ {
"mData": "productName" "mData": "productName"
}, },
...@@ -226,7 +304,11 @@ ...@@ -226,7 +304,11 @@
} }
, ,
{ {
"mData": "address" "mData": "nickName"
}
,
{
"mData": "openid"
} }
, ,
{ {
...@@ -245,6 +327,10 @@ ...@@ -245,6 +327,10 @@
"mData": "description" "mData": "description"
} }
, ,
{
"mData": "confirm"
}
,
{ {
"mData": "createTime" "mData": "createTime"
} }
...@@ -266,9 +352,16 @@ ...@@ -266,9 +352,16 @@
return a; return a;
} }
}, },
{ {
"aTargets": [2], "aTargets": [2],
"mData": "consultCode",
"mRender": function (a, b, c, d) {
return a;
}
},
{
"aTargets": [3],
"mData": "productName", "mData": "productName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -276,7 +369,7 @@ ...@@ -276,7 +369,7 @@
} }
, ,
{ {
"aTargets": [3], "aTargets": [4],
"mData": "orderAmount", "mData": "orderAmount",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -284,7 +377,7 @@ ...@@ -284,7 +377,7 @@
} }
, ,
{ {
"aTargets": [4], "aTargets": [5],
"mData": "totalAmount", "mData": "totalAmount",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -292,15 +385,23 @@ ...@@ -292,15 +385,23 @@
} }
, ,
{ {
"aTargets": [5], "aTargets": [6],
"mData": "address", "mData": "nickName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
} }
} }
, ,
{ {
"aTargets": [6], "aTargets": [7],
"mData": "openid",
"mRender": function (a, b, c, d) {
return a;
}
}
,
{
"aTargets": [8],
"mData": "courierNumber", "mData": "courierNumber",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -308,7 +409,7 @@ ...@@ -308,7 +409,7 @@
} }
, ,
{ {
"aTargets": [7], "aTargets": [9],
"mData": "status", "mData": "status",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == '0') { if (a == '0') {
...@@ -327,7 +428,7 @@ ...@@ -327,7 +428,7 @@
} }
}, },
{ {
"aTargets": [8], "aTargets": [10],
"mData": "tradeNo", "mData": "tradeNo",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -335,7 +436,7 @@ ...@@ -335,7 +436,7 @@
} }
, ,
{ {
"aTargets": [9], "aTargets": [11],
"mData": "description", "mData": "description",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -343,7 +444,15 @@ ...@@ -343,7 +444,15 @@
} }
, ,
{ {
"aTargets": [10], "aTargets": [12],
"mData": "confirm",
"mRender": function (a, b, c, d) {
return a == null ? '否':'是';
}
}
,
{
"aTargets": [13],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a); return formatDates(a);
...@@ -351,7 +460,7 @@ ...@@ -351,7 +460,7 @@
} }
, ,
{ {
"aTargets": [11], "aTargets": [14],
"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"))';
...@@ -361,11 +470,20 @@ ...@@ -361,11 +470,20 @@
' <span class="caret"></span>\n' + ' <span class="caret"></span>\n' +
' <span class="sr-only">Toggle Dropdown</span>\n' + ' <span class="sr-only">Toggle Dropdown</span>\n' +
'</button>\n' + '</button>\n' +
'<ul class="dropdown-menu" role="menu">\n'; '<ul class="dropdown-menu" role="menu" style="min-width: 100px;">\n';
html += '<li><a href="#springUrl("/a/order/form?id=' + a + '")">查看</a></li>'; html += '<li><a href="#springUrl("/a/order/findorderDetail?id=' + a + '&isDetail=y")">查看清单明细</a></li>';
html += '<li><a href="#springUrl("/a/order/findorderDetail?id=' + a + '&isDetail=y")">查看需求清单明细</a></li>'; if (!c.productName || c.productName == '') {
html += '<li><a href="#springUrl("/a/order/sendOut?id=' + a + '")">订单出库</a></li>'; html += '<li><a href="#springUrl("/a/order/form?id=' + a + '")">添加商品</a></li>';
html += '<li><a onclick="updateStatus(' + a + ')">关闭</a></li>'; }
if (c.status == '1') {
html += '<li><a onclick="updateStatusSuccess(' + a + ')">订单付款</a></li>';
}
if (c.status != '4' && c.status != '5') {
html += '<li><a onclick="updateStatus(' + a + ')">订单关闭</a></li>';
}
if (c.status == '2') {//待发货才可以出库操作
html += '<li><a href="#springUrl("/a/order/sendOut?id=' + a + '")">订单出库</a></li>';
}
html += '</ul>'; html += '</ul>';
html += '#end'; html += '#end';
return html; return html;
...@@ -400,8 +518,22 @@ ...@@ -400,8 +518,22 @@
btntext: "确定", btntext: "确定",
btncanceltext: "取消", btncanceltext: "取消",
success: function () { success: function () {
updateStatu(id) updateStatu(id, 5);
},
cancel: function () {
location.href = "#springUrl('/a/order/list')";
}
});
}
function updateStatusSuccess(id) {
Cfapp.confirm({
message: "是否确认付款",
btntext: "确定",
btncanceltext: "取消",
success: function () {
updateStatu(id, 3);//付款待发货
}, },
cancel: function () { cancel: function () {
location.href = "#springUrl('/a/order/list')"; location.href = "#springUrl('/a/order/list')";
...@@ -409,17 +541,18 @@ ...@@ -409,17 +541,18 @@
}); });
} }
function updateStatu(id) { function updateStatu(id, status) {
var url = "#springUrl('/a/order/updateStatus')" var url = "#springUrl('/a/order/updateStatus')"
$.ajax({ $.ajax({
url: url, url: url,
type: "GET", type: "GET",
data: {id:id}, data: {id: id,
status: status},
success: function (rsp) { success: function (rsp) {
console.log(rsp); console.log(rsp);
if (rsp.errorNo == "0") { if (rsp.errorNo == "0") {
Cfapp.alert({ Cfapp.alert({
message: "关闭成功", message: "设置成功",
btntext: "确定", btntext: "确定",
success: function () { success: function () {
location.href = "#springUrl('/a/order/list')"; location.href = "#springUrl('/a/order/list')";
...@@ -427,7 +560,7 @@ ...@@ -427,7 +560,7 @@
}); });
} else { } else {
Cfapp.alert({ Cfapp.alert({
message: "关闭成功", message: "设置失败",
btntext: "确定", btntext: "确定",
success: function () { success: function () {
location.href = "#springUrl('/a/order/list')"; location.href = "#springUrl('/a/order/list')";
...@@ -487,7 +620,12 @@ ...@@ -487,7 +620,12 @@
}); });
} }
function clearSearch() {
$("#seachTableForm input,select").each(function () {
$(this).val('');
});
$("#table").dataTable().fnClearTable();
}
</script> </script>
</body> </body>
......
...@@ -19,7 +19,8 @@ import java.util.Map; ...@@ -19,7 +19,8 @@ import java.util.Map;
public interface OrderMapper extends GenericDao<Order> { public interface OrderMapper extends GenericDao<Order> {
Integer deleteAll(@Param("id") Long id); Integer deleteAll(@Param("id") Long id);
Integer updateStatus(@Param("id") Long id);
Integer updateStatus(Map<String, Object> params);
List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long id); List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long id);
......
...@@ -33,11 +33,13 @@ ...@@ -33,11 +33,13 @@
<result column="courier_number" property="courierNumber"/> <result column="courier_number" property="courierNumber"/>
<result column="address_id" property="addressId"/> <result column="address_id" property="addressId"/>
<result column="clerk_id" property="clerkId"/> <result column="clerk_id" property="clerkId"/>
<result column="address_des" property="addressDes"/>
</resultMap> </resultMap>
<resultMap id="resultMapList" type="com.cftech.order.model.Order"> <resultMap id="resultMapList" type="com.cftech.order.model.Order">
<id column="id" property="id"/> <id column="id" property="id"/>
<result column="consult_id" property="consultId"/> <result column="consult_id" property="consultId"/>
<result column="openid" property="openid"/>
<result column="number" property="number"/> <result column="number" property="number"/>
<result column="member_id" property="memberId"/> <result column="member_id" property="memberId"/>
<result column="service_id" property="serviceId"/> <result column="service_id" property="serviceId"/>
...@@ -65,7 +67,9 @@ ...@@ -65,7 +67,9 @@
<result column="product_name" property="productName"/> <result column="product_name" property="productName"/>
<result column="address_id" property="addressId"/> <result column="address_id" property="addressId"/>
<result column="courier_number" property="courierNumber"/> <result column="courier_number" property="courierNumber"/>
<result column="address" property="address"/> <result column="address_des" property="addressDes"/>
<result column="consultCode" property="consultCode"/>
<result column="nickName" property="nickName"/>
<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>
...@@ -101,6 +105,7 @@ ...@@ -101,6 +105,7 @@
<sql id="sqlColumns"> <sql id="sqlColumns">
o.id, o.id,
o.openid,
t.product_number, t.product_number,
o.consult_id, o.consult_id,
t.product_name, t.product_name,
...@@ -118,36 +123,36 @@ ...@@ -118,36 +123,36 @@
o.confirm, o.confirm,
d.drugs_num, d.drugs_num,
o.courier_number, o.courier_number,
CONCAT(a.areaname, b.areaname, c.areaname,s.address) as address, o.address_des,
t.id as productId t.id as productId
</sql> </sql>
<sql id="sqlColumnFrom"> <sql id="sqlColumnFrom">
o.id, o.id,
o.consult_id AS consultId, o.consult_id AS consultId,
o.number, o.number,
o.pay_amount AS payAmount, o.pay_amount AS payAmount,
o.order_amount AS orderAmount, o.order_amount AS orderAmount,
o.pay_status AS payStatus, o.pay_status AS payStatus,
o.order_cancel AS orderCancel, o.order_cancel AS orderCancel,
o.trade_no AS tradeNo, o.trade_no AS tradeNo,
o.description, o.description,
o.STATUS, o.STATUS,
o.create_time AS createTime, o.create_time AS createTime,
o.confirm, o.confirm,
o.courier_number AS courierNumber, o.courier_number AS courierNumber,
CONCAT( a.areaname, b.areaname, c.areaname, s.address ) AS address o.address_des
</sql> </sql>
<sql id="sqlColumnProduct"> <sql id="sqlColumnProduct">
d.id, d.id,
d.order_id, d.order_id,
t.product_number AS productNumber, t.product_number AS productNumber,
t.product_name AS productName, t.product_name AS productName,
t.id AS productId, t.id AS productId,
d.drugs_num AS drugsNum, d.drugs_num AS drugsNum,
d.price, d.price,
d.amount d.amount
</sql> </sql>
<sql id="Column"> <sql id="Column">
...@@ -194,7 +199,8 @@ ...@@ -194,7 +199,8 @@
`member_id`, `member_id`,
`service_id`, `service_id`,
`doctor_id`, `doctor_id`,
`clerk_id` `clerk_id`,
address_des
) )
values values
( (
...@@ -208,7 +214,7 @@ ...@@ -208,7 +214,7 @@
now(), now(),
#{tradeNo, jdbcType=VARCHAR}, #{tradeNo, jdbcType=VARCHAR},
#{courierNumber, jdbcType=VARCHAR}, #{courierNumber, jdbcType=VARCHAR},
#{confirm, jdbcType=BIGINT}, #{confirm, jdbcType=VARCHAR},
#{orderCancel, jdbcType=VARCHAR}, #{orderCancel, jdbcType=VARCHAR},
#{remarks, jdbcType=VARCHAR}, #{remarks, jdbcType=VARCHAR},
#{accountsId, jdbcType=BIGINT}, #{accountsId, jdbcType=BIGINT},
...@@ -224,7 +230,8 @@ ...@@ -224,7 +230,8 @@
#{memberId, jdbcType=BIGINT}, #{memberId, jdbcType=BIGINT},
#{serviceId, jdbcType=BIGINT}, #{serviceId, jdbcType=BIGINT},
#{doctorId, jdbcType=BIGINT}, #{doctorId, jdbcType=BIGINT},
#{clerkId, jdbcType=BIGINT} #{clerkId, jdbcType=BIGINT},
#{addressDes, jdbcType=VARCHAR}
) )
</insert> </insert>
<update id="deleteAll" > <update id="deleteAll" >
...@@ -256,32 +263,31 @@ ...@@ -256,32 +263,31 @@
</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 (select count(1) from t_order o SELECT IFNULL(SUM(col), 0)
LEFT JOIN t_shipping_address s ON o.address_id = s.id FROM (
LEFT JOIN t_order_details d ON o.id = d.order_id SELECT COUNT(1) col
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id FROM t_order o
LEFT JOIN area a ON s.province_id = a.areaid LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id
LEFT JOIN area b ON s.city_id = b.areaid LEFT JOIN t_shipping_address s ON o.address_id = s.id
LEFT JOIN area c ON s.area_id = c.areaid LEFT JOIN t_order_details d ON o.id = d.order_id
<include refid="sqlWhere"/> LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
GROUP BY o.id <include refid="sqlWhere"/>
) b <if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
GROUP BY o.id ) duals
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMapList"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMapList">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>, cs.consult_id consultCode, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName
FROM t_order o FROM t_order o
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 area a ON s.province_id = a.areaid LEFT JOIN wx_mp_fanss f ON f.openid = o.openid
LEFT JOIN area b ON s.city_id = b.areaid
LEFT JOIN area c ON s.area_id = c.areaid
LEFT JOIN t_qyuser q ON o.service_id = q.id AND o.doctor_id = q.id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="id!=null">and(o.service_id = ${id} or o.doctor_id =${id} or o.clerk_id = ${id})</if> <if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
GROUP BY o.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>
...@@ -336,7 +342,7 @@ ...@@ -336,7 +342,7 @@
courier_number = #{courierNumber, jdbcType=VARCHAR}, courier_number = #{courierNumber, jdbcType=VARCHAR},
</if> </if>
<if test="confirm != null"> <if test="confirm != null">
confirm = #{confirm, jdbcType=BIGINT}, confirm = #{confirm, jdbcType=VARCHAR},
</if> </if>
<if test="remarks != null"> <if test="remarks != null">
remarks = #{remarks, jdbcType=VARCHAR}, remarks = #{remarks, jdbcType=VARCHAR},
...@@ -383,6 +389,9 @@ ...@@ -383,6 +389,9 @@
<if test="clerkId != null"> <if test="clerkId != null">
clerk_id = #{clerkId, jdbcType=BIGINT}, clerk_id = #{clerkId, jdbcType=BIGINT},
</if> </if>
<if test="addressDes != null">
address_des = #{addressDes, jdbcType=VARCHAR}
</if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
...@@ -390,9 +399,11 @@ ...@@ -390,9 +399,11 @@
<update id="delete" parameterType="java.lang.Long"> <update id="delete" parameterType="java.lang.Long">
update t_order set del_flag=1 where id=#{id,jdbcType=BIGINT} update t_order set del_flag=1 where id=#{id,jdbcType=BIGINT}
</update> </update>
<select id="fetchProduct" resultType="com.cftech.order.model.ProductDto" parameterType="java.util.Map"> <select id="fetchProduct" resultType="com.cftech.order.model.ProductDto" parameterType="java.util.Map">
SELECT * FROM t_aidea_product WHERE id = #{productId} AND accounts_id=#{accountsId} AND del_flag = 0 SELECT * FROM t_aidea_product WHERE id = #{productId} AND accounts_id=#{accountsId} AND del_flag = 0
</select> </select>
<update id="updateDetill" parameterType="java.util.Map"> <update id="updateDetill" parameterType="java.util.Map">
update t_order_details update t_order_details
<set> <set>
...@@ -412,9 +423,11 @@ ...@@ -412,9 +423,11 @@
</set> </set>
where order_id =#{id} and id = #{idDetail} where order_id =#{id} and id = #{idDetail}
</update> </update>
<select id="fetcheDeta" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="fetcheDeta" parameterType="java.util.Map" resultType="java.lang.Integer">
select * from t_order_details where order_id =#{id} and accounts_id=#{accountsId} and drugs_id =#{productId} and del_flag = 0 select * from t_order_details where order_id =#{id} and accounts_id=#{accountsId} and drugs_id =#{productId} and del_flag = 0
</select> </select>
<insert id="saveDetill" parameterType="com.cftech.order.model.OrderDetailDto"> <insert id="saveDetill" parameterType="com.cftech.order.model.OrderDetailDto">
insert into t_order_details insert into t_order_details
( (
...@@ -434,6 +447,7 @@ ...@@ -434,6 +447,7 @@
#{accountsId} #{accountsId}
) )
</insert> </insert>
<select id="fetchOrder" resultType="com.cftech.order.model.Order" parameterType="java.lang.Long"> <select id="fetchOrder" resultType="com.cftech.order.model.Order" parameterType="java.lang.Long">
select * from t_order where id= #{id} and del_flag = 0 select * from t_order where id= #{id} and del_flag = 0
</select> </select>
...@@ -447,11 +461,12 @@ ...@@ -447,11 +461,12 @@
</set> </set>
where id= #{id} where id= #{id}
</update> </update>
<update id="updateStatus" parameterType="java.lang.Long">
<update id="updateStatus" parameterType="java.util.Map">
update t_order update t_order
<set> <set>
<if test="id!=null"> <if test="id!=null">
status = 5 status = #{status}
</if> </if>
</set> </set>
where id= #{id} where id= #{id}
...@@ -459,37 +474,53 @@ ...@@ -459,37 +474,53 @@
<select id="orderFall" resultType="com.cftech.order.model.OrderMobile"> <select id="orderFall" resultType="com.cftech.order.model.OrderMobile">
SELECT SELECT
t.id, t.id,
t.number, t.number,
t.pay_status AS payStatus, t.pay_status AS payStatus,
t.total_amount AS totalAmount, t.total_amount AS totalAmount,
t.pay_time AS payTime, t.pay_time AS payTime,
t.trade_no AS tradeNo, t.trade_no AS tradeNo,
t.courier_number AS courierNumber, t.courier_number AS courierNumber,
t.order_cancel AS orderCancel, t.order_cancel AS orderCancel,
t.status, t.status,
t.create_time AS createTime, DATE_FORMAT(t.create_time,'%Y-%m-%d %h:%i:%s') AS createTime,
s.address_name AS addressName, s.address_name AS addressName,
a.areaname AS province, a.areaname AS province,
b.areaname AS city, b.areaname AS city,
c.areaname AS area, c.areaname AS area,
s.phone, s.phone,
s.address s.address
FROM FROM
t_order t LEFT JOIN t_shipping_address s ON t.openid = s.open_id AND s.whether = 1 t_order t
LEFT JOIN t_order_details d ON t.id =d.order_id
LEFT JOIN t_aidea_product p ON d.drugs_id = p.id
LEFT JOIN t_shipping_address s ON t.address_id = s.id
LEFT JOIN area a ON s.province_id = a.areaid LEFT JOIN area a ON s.province_id = a.areaid
LEFT JOIN area b ON s.city_id = b.areaid LEFT JOIN area b ON s.city_id = b.areaid
LEFT JOIN area c ON s.area_id = c.areaid LEFT JOIN area c ON s.area_id = c.areaid
WHERE t.del_flag=0 WHERE t.del_flag=0
<if test="id !=null"> <if test="id != null">
AND t.id =#{id} AND t.id = #{id}
</if> </if>
<if test="openId !=null"> <if test="openId != null">
AND t.openid =#{openId} AND t.openid = #{openId}
</if> </if>
<if test="status!=null "> <if test="value != null and value != ''">
AND t.status =#{status} AND (t.number LIKE '%${value}%' OR p.product_name LIKE '%${value}%')
</if> </if>
<choose>
<when test="status != null and status == 1 ">
AND (t.status = 0 OR t.status = 1)
</when>
<when test="status != null and status == 3 ">
AND (t.status = 2 OR t.status = 3)
</when>
<when test="status != null ">
AND t.status = #{status}
</when>
<otherwise></otherwise>
</choose>
GROUP BY t.id
ORDER BY t.create_time DESC ORDER BY t.create_time DESC
</select> </select>
...@@ -506,16 +537,17 @@ ...@@ -506,16 +537,17 @@
and t.order_id =#{orderId} and t.order_id =#{orderId}
</if> </if>
</select> </select>
<select id="orderSize" resultType="com.cftech.order.model.OrderSizeVO" > <select id="orderSize" resultType="com.cftech.order.model.OrderSizeVO" >
SELECT SELECT
SUM(status=0) AS confirm, SUM(status = 0 OR status = 1) AS waitPay,
SUM(status=2) AS delivered, SUM(status = 2 OR status = 3) AS waitExpress,
SUM(status=3) AS received, SUM(status=4) AS completed,
SUM(status=4) AS completed, SUM(status=5) AS cancelled
SUM(status=5) AS cancelled FROM t_order WHERE del_flag = 0 AND openid = #{openid}
FROM t_order WHERE del_flag = 0
</select> </select>
<select id="orderList" resultType="com.cftech.order.model.OrderMobile" parameterType="com.cftech.order.model.OrderMobileDto"> <select id="orderList" resultType="com.cftech.order.model.OrderMobile" parameterType="com.cftech.order.model.OrderMobileDto">
SELECT SELECT
t.id, t.id,
......
...@@ -46,8 +46,8 @@ public class Order extends OrderDetail implements Serializable { ...@@ -46,8 +46,8 @@ public class Order extends OrderDetail implements Serializable {
private String tradeNo; private String tradeNo;
/* 顺丰运单号 */ /* 顺丰运单号 */
private String courierNumber; private String courierNumber;
/* 用户是否确认 0:待确认 1:已确认 2:取消 */ /* 订单开票编码 */
private Long confirm; private String confirm;
/* 订单取消原因 */ /* 订单取消原因 */
@ExportConfig(value = "订单取消原因", width = 100, showLevel = 1) @ExportConfig(value = "订单取消原因", width = 100, showLevel = 1)
private String orderCancel; private String orderCancel;
...@@ -65,6 +65,8 @@ public class Order extends OrderDetail implements Serializable { ...@@ -65,6 +65,8 @@ public class Order extends OrderDetail implements Serializable {
private Long consultId; private Long consultId;
/* 收货地址 */ /* 收货地址 */
private Long addressId; private Long addressId;
/* 收货地址详情 */
private String addressDes;
/* 所属会员id */ /* 所属会员id */
@ExportConfig(value = "所属会员id", width = 100, showLevel = 1) @ExportConfig(value = "所属会员id", width = 100, showLevel = 1)
private Long memberId; private Long memberId;
...@@ -99,11 +101,38 @@ public class Order extends OrderDetail implements Serializable { ...@@ -99,11 +101,38 @@ public class Order extends OrderDetail implements Serializable {
private List<ProductVO> list; private List<ProductVO> list;
/**
* 搜索字段
*/
private String consultCode; /* 咨询单编码 */
private String productNameTmp;//产品名称
private String startOrderAmount;//订单开始金额
private String endOrderAmount;//订单结束金额
private String startPayAmount;//付款开始金额
private String endPayAmount;//付款结束金额
private String isBill; /* 是否开票 0:是 1:否 */
private String orderStartTime;//订单开始时间
private String orderEndTime;//订单结束时间
private String nickName;//患者昵称
public Order() { public Order() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
} }
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
if (list == null) {
return null;
}
List<String> collect = this.list.stream().map(x -> x.getProductName()).collect(Collectors.toList());
return StringUtils.join(collect, ";");
}
@Override @Override
public Long getId() { public Long getId() {
return id; return id;
...@@ -114,14 +143,6 @@ public class Order extends OrderDetail implements Serializable { ...@@ -114,14 +143,6 @@ public class Order extends OrderDetail implements Serializable {
this.id = id; this.id = id;
} }
public Long getConsultId() {
return consultId;
}
public void setConsultId(Long consultId) {
this.consultId = consultId;
}
public String getNumber() { public String getNumber() {
return number; return number;
} }
...@@ -130,30 +151,6 @@ public class Order extends OrderDetail implements Serializable { ...@@ -130,30 +151,6 @@ public class Order extends OrderDetail implements Serializable {
this.number = number; this.number = number;
} }
public Long getMemberId() {
return memberId;
}
public void setMemberId(Long memberId) {
this.memberId = memberId;
}
public Long getServiceId() {
return serviceId;
}
public void setServiceId(Long serviceId) {
this.serviceId = serviceId;
}
public Long getDoctorId() {
return doctorId;
}
public void setDoctorId(Long doctorId) {
this.doctorId = doctorId;
}
@Override @Override
public String getOpenid() { public String getOpenid() {
return openid; return openid;
...@@ -212,12 +209,20 @@ public class Order extends OrderDetail implements Serializable { ...@@ -212,12 +209,20 @@ public class Order extends OrderDetail implements Serializable {
this.tradeNo = tradeNo; this.tradeNo = tradeNo;
} }
public String getRemarks() { public String getCourierNumber() {
return remarks; return courierNumber;
} }
public void setRemarks(String remarks) { public void setCourierNumber(String courierNumber) {
this.remarks = remarks; this.courierNumber = courierNumber;
}
public String getConfirm() {
return confirm;
}
public void setConfirm(String confirm) {
this.confirm = confirm;
} }
public String getOrderCancel() { public String getOrderCancel() {
...@@ -228,6 +233,14 @@ public class Order extends OrderDetail implements Serializable { ...@@ -228,6 +233,14 @@ public class Order extends OrderDetail implements Serializable {
this.orderCancel = orderCancel; this.orderCancel = orderCancel;
} }
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
@Override @Override
public Long getAccountsId() { public Long getAccountsId() {
return accountsId; return accountsId;
...@@ -258,6 +271,62 @@ public class Order extends OrderDetail implements Serializable { ...@@ -258,6 +271,62 @@ public class Order extends OrderDetail implements Serializable {
this.status = status; this.status = status;
} }
public Long getConsultId() {
return consultId;
}
public void setConsultId(Long consultId) {
this.consultId = consultId;
}
public Long getAddressId() {
return addressId;
}
public void setAddressId(Long addressId) {
this.addressId = addressId;
}
public String getAddressDes() {
return addressDes;
}
public void setAddressDes(String addressDes) {
this.addressDes = addressDes;
}
public Long getMemberId() {
return memberId;
}
public void setMemberId(Long memberId) {
this.memberId = memberId;
}
public Long getServiceId() {
return serviceId;
}
public void setServiceId(Long serviceId) {
this.serviceId = serviceId;
}
public Long getDoctorId() {
return doctorId;
}
public void setDoctorId(Long doctorId) {
this.doctorId = doctorId;
}
public Long getClerkId() {
return clerkId;
}
public void setClerkId(Long clerkId) {
this.clerkId = clerkId;
}
@Override @Override
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
...@@ -308,71 +377,115 @@ public class Order extends OrderDetail implements Serializable { ...@@ -308,71 +377,115 @@ public class Order extends OrderDetail implements Serializable {
this.updateBy = updateBy; this.updateBy = updateBy;
} }
public Long getConfirm() { public String getProductNumber() {
return confirm; return productNumber;
} }
public void setConfirm(Long confirm) { public void setProductNumber(String productNumber) {
this.confirm = confirm; this.productNumber = productNumber;
} }
public String getCourierNumber() { public Long getProductId() {
return courierNumber; return productId;
} }
public void setCourierNumber(String courierNumber) { public void setProductId(Long productId) {
this.courierNumber = courierNumber; this.productId = productId;
} }
public String getProductNumber() { public String getAddress() {
return productNumber; return address;
} }
public void setProductNumber(String productNumber) { public void setAddress(String address) {
this.productNumber = productNumber; this.address = address;
} }
public String getProductName() { public List<ProductVO> getList() {
if (list == null) { return list;
return null;
}
List<String> collect = this.list.stream().map(x -> x.getProductName()).collect(Collectors.toList());
return StringUtils.join(collect, ";");
} }
public void setProductName(String productName) { public void setList(List<ProductVO> list) {
this.productName = productName; this.list = list;
} }
public Long getAddressId() { public String getConsultCode() {
return addressId; return consultCode;
} }
public void setAddressId(Long addressId) { public void setConsultCode(String consultCode) {
this.addressId = addressId; this.consultCode = consultCode;
} }
public Long getClerkId() { public String getProductNameTmp() {
return clerkId; return productNameTmp;
} }
public void setClerkId(Long clerkId) { public void setProductNameTmp(String productNameTmp) {
this.clerkId = clerkId; this.productNameTmp = productNameTmp;
} }
public List<ProductVO> getList() { public String getStartOrderAmount() {
return list; return startOrderAmount;
} }
public void setList(List<ProductVO> list) { public void setStartOrderAmount(String startOrderAmount) {
this.list = list; this.startOrderAmount = startOrderAmount;
} }
public String getAddress() { public String getEndOrderAmount() {
return address; return endOrderAmount;
} }
public void setAddress(String address) { public void setEndOrderAmount(String endOrderAmount) {
this.address = address; this.endOrderAmount = endOrderAmount;
}
public String getStartPayAmount() {
return startPayAmount;
}
public void setStartPayAmount(String startPayAmount) {
this.startPayAmount = startPayAmount;
}
public String getEndPayAmount() {
return endPayAmount;
}
public void setEndPayAmount(String endPayAmount) {
this.endPayAmount = endPayAmount;
}
public String getIsBill() {
return isBill;
}
public void setIsBill(String isBill) {
this.isBill = isBill;
}
public String getOrderStartTime() {
return orderStartTime;
}
public void setOrderStartTime(String orderStartTime) {
this.orderStartTime = orderStartTime;
}
public String getOrderEndTime() {
return orderEndTime;
}
public void setOrderEndTime(String orderEndTime) {
this.orderEndTime = orderEndTime;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
} }
} }
\ No newline at end of file
...@@ -9,13 +9,13 @@ import lombok.Data; ...@@ -9,13 +9,13 @@ import lombok.Data;
*/ */
@Data @Data
public class OrderMobileDto { public class OrderMobileDto {
private String openId;
private String search; private Long id;
private String searchName; private String appId;
private Long status; private String openId;
private Long page; private Long status;
private Long pageSize; private String value;
private Long id; private Long page;
private String appId; private Long pageSize;
} }
...@@ -9,16 +9,15 @@ import lombok.Data; ...@@ -9,16 +9,15 @@ import lombok.Data;
*/ */
@Data @Data
public class OrderSizeVO { public class OrderSizeVO {
/*待确认数量*/
private Long confirm; /*待付款数量*/
/*待发货数量*/ private Long waitPay;
private Long delivered;
/*待收货数量*/ /*待收货数量*/
private Long received; private Long waitExpress;
/*已完成数量*/ /*已完成数量*/
private Long completed; private Long completed;
/*已取消数量*/ /*已取消数量*/
private Long cancelled; private Long cancelled;
} }
...@@ -5,52 +5,67 @@ import com.cftech.core.sql.Conds; ...@@ -5,52 +5,67 @@ import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import com.cftech.order.model.*; import com.cftech.order.model.*;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import com.qiniu.util.Json;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* 订单管理Service * 订单管理Service
* *
* @author Licc * @author Licc
* @date: 2020-10-10 14:20 * @date: 2020-10-10 14:20
*/ */
public interface OrderService extends GenericService<Order> { public interface OrderService extends GenericService<Order> {
/**
* 查询订单主列表
* @param conds
* @param sort
* @param page
* @param pageSize
* @param userid
* @return
*/
List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid);
List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize , String id); Integer count(Conds conds, Long userid);
List<ProductOrder> listProduct(); List<ProductOrder> listProduct();
OrderFromVO fetchId(Serializable id); OrderFromVO fetchId(Serializable id);
List<OrderFromVO> fetchProductId(Serializable id); List<OrderFromVO> fetchProductId(Serializable id);
Integer updateStatus(Long id);
Integer updateStatus(Long id, String status);
JSONObject newlyAdded(String datas, Long accountsId); JSONObject newlyAdded(String datas, Long accountsId);
JSONObject deleteAll(Long id); JSONObject deleteAll(Long id);
/** /**
* @return
* @Author Licc * @Author Licc
* @Description 根据订单状态查询订单 * @Description 根据订单状态查询订单
* @Date 15:45 2020/10/30 * @Date 15:45 2020/10/30
* @Param * @Param
* @return
**/ **/
JSONObject confirm(OrderMobileDto orderMobileDto); JSONObject confirm(OrderMobileDto orderMobileDto);
/** /**
* @return
* @Author Licc * @Author Licc
* @Description 订单数量 * @Description 订单数量
* @Date 19:05 2020/11/3 * @Date 19:05 2020/11/3
* @Param * @Param
* @return
**/ **/
JSONObject orderSize(String openId,String appId); JSONObject orderSize(String openId, String appId);
/** /**
* @return
* @Author Licc * @Author Licc
* @Description 根据搜索条件查询订单 * @Description 根据搜索条件查询订单
* @Date 19:05 2020/11/3 * @Date 19:05 2020/11/3
* @Param * @Param
* @return
**/ **/
JSONObject orderList(OrderMobileDto orderMobileDto); JSONObject orderList(OrderMobileDto orderMobileDto);
......
package com.cftech.order.service.impl; package com.cftech.order.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray;
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.core.sql.Sort; import com.cftech.core.sql.Sort;
...@@ -12,14 +13,11 @@ import com.cftech.core.generic.GenericDao; ...@@ -12,14 +13,11 @@ import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.ws.rs.PUT;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -39,25 +37,38 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -39,25 +37,38 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
private OrderMapper orderMapper; private OrderMapper orderMapper;
@Autowired @Autowired
private MpAccountsService mpAccountsService; private MpAccountsService mpAccountsService;
private Order orders;
@Override @Override
public GenericDao<Order> getGenericMapper() { public GenericDao<Order> getGenericMapper() {
return orderMapper; return orderMapper;
} }
@Override @Override
public List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, String id) { public List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid) {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("conds", conds); params.put("conds", conds);
params.put("offset", page > 0 ? page : 0); params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0); params.put("limit", pageSize > 0 ? pageSize : 0);
params.put("sort", sort); params.put("sort", sort);
if (!StringUtils.equals(id, "1")) { //非管理员查询所有
params.put("id", id); if (userid != null && userid != 1L) {
params.put("userid", userid);
} }
return orderMapper.fetchSearchByPage(params); return orderMapper.fetchSearchByPage(params);
} }
@Override
public Integer count(Conds conds, Long userid) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("conds", conds);
//非管理员查询所有
if (userid != null && userid != 1L) {
params.put("userid", userid);
}
return orderMapper.count(params);
}
@Override @Override
public List<ProductOrder> listProduct() { public List<ProductOrder> listProduct() {
return orderMapper.listProduct(); return orderMapper.listProduct();
...@@ -74,18 +85,21 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -74,18 +85,21 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
} }
@Override @Override
public Integer updateStatus(Long id) { public Integer updateStatus(Long id, String status) {
return orderMapper.updateStatus(id); Map<String, Object> params = new HashMap<>();
params.put("id", id);
params.put("status", status);
return orderMapper.updateStatus(params);
} }
@Transactional @Transactional
@Override @Override
public com.alibaba.fastjson.JSONObject newlyAdded(String datas, Long accountsId) { public JSONObject newlyAdded(String datas, Long accountsId) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject(); JSONObject rtnJson = new JSONObject();
OrderDetailDto orderDetailDto = null; OrderDetailDto orderDetailDto = null;
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
datas = datas.replaceAll("&quot;", "\""); datas = datas.replaceAll("&quot;", "\"");
JSONArray jsonArray = JSONArray.fromObject(datas); JSONArray jsonArray = JSONArray.parseArray(datas);
try { try {
if (jsonArray.size() > 0) { if (jsonArray.size() > 0) {
...@@ -106,18 +120,14 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -106,18 +120,14 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
params.put("amount", amount); params.put("amount", amount);
params.put("orderAmount", orderAmount); params.put("orderAmount", orderAmount);
params.put("idDetail", idDetail); params.put("idDetail", idDetail);
if(!"".equals(idDetail)){ if (!"".equals(idDetail)) {
orderMapper.updateDetill(params); orderMapper.updateDetill(params);
Integer integer = orderMapper.updateOrder(params); rtnJson.put("errorNo", "0");
if (integer > 0) { } else {
rtnJson.put("errorNo", "0");
}
}else {
ProductDto productDtos = orderMapper.fetchProduct(params); ProductDto productDtos = orderMapper.fetchProduct(params);
orderDetailDto = new OrderDetailDto(); orderDetailDto = new OrderDetailDto();
Order orders = orderMapper.fetchOrder(id); Order orders = orderMapper.fetchOrder(id);
String number = orders.getNumber(); String number = orders.getNumber();
orderDetailDto.setOrderCode(orders.getNumber()); orderDetailDto.setOrderCode(orders.getNumber());
orderDetailDto.setOrderId(id); orderDetailDto.setOrderId(id);
orderDetailDto.setDrugsId(productDtos.getId()); orderDetailDto.setDrugsId(productDtos.getId());
...@@ -129,10 +139,10 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -129,10 +139,10 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
orderDetailDto.setDrugsSku(productDtos.getFormat()); orderDetailDto.setDrugsSku(productDtos.getFormat());
orderDetailDto.setAccountsId(accountsId); orderDetailDto.setAccountsId(accountsId);
Integer detill = orderMapper.saveDetill(orderDetailDto); Integer detill = orderMapper.saveDetill(orderDetailDto);
if (detill<0){ if (detill < 0) {
rtnJson.put("errorNo","1"); rtnJson.put("errorNo", "1");
rtnJson.put("errorNo","修改失败"); rtnJson.put("errorNo", "修改失败");
}else { } else {
if (detill > 0) { if (detill > 0) {
Integer integer = orderMapper.updateOrder(params); Integer integer = orderMapper.updateOrder(params);
if (integer > 0) { if (integer > 0) {
...@@ -142,6 +152,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -142,6 +152,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
} }
} }
} }
//修改订单待付款
Order newOrder = orderMapper.fetchOrder(id);
newOrder.setStatus("1");
orderMapper.update(newOrder);
} }
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -153,45 +168,46 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -153,45 +168,46 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
} }
@Override @Override
public com.alibaba.fastjson.JSONObject deleteAll(Long id) { public JSONObject deleteAll(Long id) {
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); JSONObject jsonObject = new JSONObject();
Integer integer = orderMapper.deleteAll(id); Integer integer = orderMapper.deleteAll(id);
if (integer<0){ if (integer < 0) {
jsonObject.put("errorNo","1"); jsonObject.put("errorNo", "1");
} }
jsonObject.put("errorNo","0"); jsonObject.put("errorNo", "0");
return jsonObject; return jsonObject;
} }
@Override @Override
public com.alibaba.fastjson.JSONObject confirm(OrderMobileDto orderMobileDto) { public JSONObject confirm(OrderMobileDto orderMobileDto) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject(); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(orderMobileDto.getAppId());
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
if (StringUtils.isEmpty(orderMobileDto.getOpenId())){ if (StringUtils.isEmpty(orderMobileDto.getOpenId())) {
rtnJson.put("errorNo","1"); rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg","openid不能为空"); rtnJson.put("errorMsg", "openid不能为空");
return rtnJson; return rtnJson;
} }
if (orderMobileDto.getStatus()==null){ if (orderMobileDto.getStatus() == null) {
rtnJson.put("errorNo","1"); rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg","status不能为空"); rtnJson.put("errorMsg", "status不能为空");
return rtnJson; return rtnJson;
} }
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(orderMobileDto.getAppId());
List<OrderMobile> orderMobiles = orderMapper.orderFall(orderMobileDto); List<OrderMobile> orderMobiles = orderMapper.orderFall(orderMobileDto);
for (OrderMobile orderMobile : orderMobiles) { for (OrderMobile orderMobile : orderMobiles) {
Long mobileId = orderMobile.getId(); if (orderMobile.getId() != null) {
if (mobileId!=null){ List<ProductMobile> mobiles = orderMapper.orderDetill(orderMobile.getId());
List<ProductMobile> mobiles = orderMapper.orderDetill(mobileId);
orderMobile.setProductMobile(mobiles); orderMobile.setProductMobile(mobiles);
} }
} }
//com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(orderMobiles));
JSONObject object = new JSONObject();
object.put("orderMobiles", orderMobiles); object.put("orderMobiles", orderMobiles);
rtnJson.put("errorNo","0");
rtnJson.put("data",object); rtnJson.put("errorNo", "0");
}catch (Exception e){ rtnJson.put("data", object);
} catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
...@@ -200,57 +216,57 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -200,57 +216,57 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
} }
@Override @Override
public com.alibaba.fastjson.JSONObject orderSize(String openId,String appId) { public JSONObject orderSize(String openId, String appId) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject(); JSONObject rtnJson = new JSONObject();
try{ try {
if (StringUtils.isEmpty(openId)){ if (StringUtils.isEmpty(openId)) {
rtnJson.put("errorNo","0"); rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg","openid不能为空"); rtnJson.put("errorMsg", "openid不能为空");
return rtnJson; return rtnJson;
} }
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
OrderSizeVO productMobiles = orderMapper.orderSize(openId); OrderSizeVO productMobiles = orderMapper.orderSize(openId);
if (productMobiles!=null){ if (productMobiles != null) {
rtnJson.put("errorNo","0"); rtnJson.put("errorNo", "0");
rtnJson.put("data",productMobiles); rtnJson.put("data", productMobiles);
return rtnJson; return rtnJson;
} }
rtnJson.put("errorNo","1"); rtnJson.put("errorNo", "1");
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
} }
return rtnJson; return rtnJson;
} }
@Override @Override
public com.alibaba.fastjson.JSONObject orderList(OrderMobileDto orderMobileDto) { public JSONObject orderList(OrderMobileDto orderMobileDto) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject(); JSONObject rtnJson = new JSONObject();
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject(); JSONObject object = new JSONObject();
try{ try {
if (StringUtils.isEmpty(orderMobileDto.getOpenId())){ if (StringUtils.isEmpty(orderMobileDto.getOpenId())) {
rtnJson.put("errorNo","0"); rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg","openid不能为空"); rtnJson.put("errorMsg", "openid不能为空");
return rtnJson; return rtnJson;
} }
if (orderMobileDto.getStatus()==null){ if (orderMobileDto.getStatus() == null) {
rtnJson.put("errorNo","0"); rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg","订单状态不能为空"); rtnJson.put("errorMsg", "订单状态不能为空");
return rtnJson; return rtnJson;
} }
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(orderMobileDto.getAppId()); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(orderMobileDto.getAppId());
List<OrderMobile> orderMobiles = orderMapper.orderList(orderMobileDto); List<OrderMobile> orderMobiles = orderMapper.orderList(orderMobileDto);
for (OrderMobile orderMobile : orderMobiles) { for (OrderMobile orderMobile : orderMobiles) {
Long mobileId = orderMobile.getId(); Long mobileId = orderMobile.getId();
if (mobileId!=null){ if (mobileId != null) {
List<ProductMobile> mobiles = orderMapper.orderDetill(mobileId); List<ProductMobile> mobiles = orderMapper.orderDetill(mobileId);
orderMobile.setProductMobile(mobiles); orderMobile.setProductMobile(mobiles);
} }
} }
object.put("orderMobiles", orderMobiles); object.put("orderMobiles", orderMobiles);
rtnJson.put("errorNo","0"); rtnJson.put("errorNo", "0");
rtnJson.put("data",object); rtnJson.put("data", object);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
} }
......
...@@ -37,13 +37,13 @@ public class MobileOrderController { ...@@ -37,13 +37,13 @@ public class MobileOrderController {
/** /**
* @return * @return
* @Author Licc * @Author Licc
* @Description 订单数量 * @Description 个人中心订单统计
* @Date 19:03 2020/11/3 * @Date 19:03 2020/11/3
* @Param * @Param
**/ **/
@RequestMapping(value = "/orderSize", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/orderSize", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject orderSize(String openId,String appId) { public JSONObject orderSize(String openId,String appId) {
return orderService.orderSize(openId,appId); return orderService.orderSize(openId, appId);
} }
/** /**
......
...@@ -14,7 +14,6 @@ import com.cftech.core.sql.Conds; ...@@ -14,7 +14,6 @@ import com.cftech.core.sql.Conds;
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.order.utils.DoubleJSONFilter; import com.cftech.order.utils.DoubleJSONFilter;
import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.orderdetail.web.OrderDetailsController; import com.cftech.orderdetail.web.OrderDetailsController;
import com.cftech.sys.security.UserUtils; import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -24,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -24,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -46,7 +44,7 @@ import java.util.List; ...@@ -46,7 +44,7 @@ import java.util.List;
* 查看:public static final String ORDER_EDIT = "qy:order:edit" * 查看:public static final String ORDER_EDIT = "qy:order:edit"
* *
* @author Licc * @author Licc
* @date: 2020-10-10 14:20 * @date: 2020-10-10 14:20 express
*/ */
@Slf4j @Slf4j
@Controller @Controller
...@@ -125,23 +123,67 @@ public class OrderController { ...@@ -125,23 +123,67 @@ public class OrderController {
@RequiresPermissions(value = ORDER_VIEW) @RequiresPermissions(value = ORDER_VIEW)
@RequestMapping(value = "/listData") @RequestMapping(value = "/listData")
@ResponseBody @ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, Order order, HttpServletRequest request) { public JSONObject listData(int iDisplayStart, int iDisplayLength, Order order, HttpServletRequest request) {
String id = String.valueOf(UserUtils.getUser().getId()); Long userid = UserUtils.getUser().getId();
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
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("d.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId); conds.equal("o.accounts_id", accountsId);
Sort sort = new Sort("o.create_time", OrderType.DESC); //咨询单编码
if (!StringUtils.isEmpty(order.getNumber())) { if (StringUtils.isNoneBlank(order.getConsultCode())) {
conds.like("cs.consult_id", order.getConsultCode());
}
//订单编码
if (StringUtils.isNoneBlank(order.getNumber())) {
conds.like("o.number", order.getNumber()); conds.like("o.number", order.getNumber());
} }
if (!StringUtils.isEmpty(order.getProductName())) { //产品名称
conds.like("t.product_name", order.getProductName()); if (StringUtils.isNoneBlank(order.getProductNameTmp())) {
conds.like("t.product_name", order.getProductNameTmp());
}
//顺丰运单号
if (StringUtils.isNoneBlank(order.getCourierNumber())) {
conds.like("o.courier_number", order.getCourierNumber());
}
//订单开始金额
if (StringUtils.isNoneBlank(order.getStartOrderAmount())) {
conds.greatEqual("o.order_amount", order.getStartOrderAmount());
}
//订单结束金额
if (StringUtils.isNoneBlank(order.getEndOrderAmount())) {
conds.lessEqual("o.order_amount", order.getEndOrderAmount());
}
//最终开始金额
if (StringUtils.isNoneBlank(order.getStartPayAmount())) {
conds.greatEqual("o.total_amount", order.getStartPayAmount());
}
//最终结束金额
if (StringUtils.isNoneBlank(order.getEndPayAmount())) {
conds.lessEqual("o.total_amount", order.getEndPayAmount());
}
//订单状态
if (StringUtils.isNoneBlank(order.getStatus())) {
conds.equal("o.status", order.getStatus());
}
//是否开票
if (StringUtils.isNoneBlank(order.getIsBill()) && StringUtils.equals(order.getIsBill(), "1")) {//未开票
conds.isNull("o.confirm");
} else if (StringUtils.isNoneBlank(order.getIsBill()) && StringUtils.equals(order.getIsBill(), "0")) {//已开票
conds.notNull("o.confirm");
}
//订单开始时间
if (StringUtils.isNoneBlank(order.getOrderStartTime())) {
conds.greatEqual("DATE_FORMAT(o.create_time, '%Y-%m-%d')", order.getOrderStartTime());
}
//订单结束时间
if (StringUtils.isNoneBlank(order.getOrderEndTime())) {
conds.lessEqual("DATE_FORMAT(o.create_time, '%Y-%m-%d')", order.getOrderEndTime());
} }
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, id); Sort sort = new Sort("o.create_time", OrderType.DESC);
Integer counts = orderService.count(conds); List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid);
Integer counts = orderService.count(conds, userid);
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts); rtnJson.put("iTotalRecords", counts);
rtnJson.put("iTotalDisplayRecords", counts); rtnJson.put("iTotalDisplayRecords", counts);
...@@ -184,11 +226,7 @@ public class OrderController { ...@@ -184,11 +226,7 @@ public class OrderController {
orderVO.setCourierNumber(order.getCourierNumber()); orderVO.setCourierNumber(order.getCourierNumber());
orderVO.setTradeNo(order.getTradeNo()); orderVO.setTradeNo(order.getTradeNo());
orderVO.setCreateTime(simpleDateFormat.format(order.getCreateTime())); orderVO.setCreateTime(simpleDateFormat.format(order.getCreateTime()));
if (("").equals(order.getPayStatus()) && order.getPayStatus()==null){ orderVO.setPayStatus(order.getPayStatus().equals("0") ? "待确认" : order.getPayStatus().equals("1") ? "待付款" : order.getPayStatus().equals("2") ? "待发货" :order.getPayStatus().equals("3") ? "待收货":order.getPayStatus().equals("4") ? "已完成" :"已取消");
orderVO.setPayStatus("");
}else {
orderVO.setPayStatus(("0").equals(order.getPayStatus()) ? "待确认" : ("1").equals(order.getPayStatus()) ? "待付款" : ("2").equals(order.getPayStatus()) ? "待发货" :("3").equals(order.getPayStatus()) ? "待收货":("4").equals(order.getPayStatus()) ? "已完成" :"已取消");
}
orderVOS.add(orderVO); orderVOS.add(orderVO);
} }
ExcelKit.$Export(OrderVO.class, response).toExcel(orderVOS, "订单管理信息"); ExcelKit.$Export(OrderVO.class, response).toExcel(orderVOS, "订单管理信息");
...@@ -245,9 +283,9 @@ public class OrderController { ...@@ -245,9 +283,9 @@ public class OrderController {
} }
@RequestMapping("/updateStatus") @RequestMapping("/updateStatus")
@ResponseBody @ResponseBody
public JSONObject updateStatus(Long id,HttpServletRequest request ,Model model) { public JSONObject updateStatus(Long id, String status, HttpServletRequest request) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
Integer integer = orderService.updateStatus(id); Integer integer = orderService.updateStatus(id, status);
if (integer>0){ if (integer>0){
rtnJson.put("errorNo","0"); rtnJson.put("errorNo","0");
return rtnJson; return rtnJson;
......
...@@ -102,7 +102,6 @@ ...@@ -102,7 +102,6 @@
<td>序号</td> <td>序号</td>
<td>分类级别</td> <td>分类级别</td>
<td>上级分类</td> <td>上级分类</td>
<td>banner图</td>
<td>是否推荐</td> <td>是否推荐</td>
<td>备注</td> <td>备注</td>
<th>创建时间</th> <th>创建时间</th>
...@@ -221,10 +220,6 @@ ...@@ -221,10 +220,6 @@
, ,
{ {
"mData":"parentName" "mData":"parentName"
}
,
{
"mData":"classifyImg"
}, },
{ {
"mData":"whetherRecommend" "mData":"whetherRecommend"
......
...@@ -237,30 +237,28 @@ ...@@ -237,30 +237,28 @@
var columnUrl = ""; var columnUrl = "";
//选择栏目 //选择栏目
$("#columnSelect").click(function () { $("#columnSelect").click(function () {
var Id= $("#typeselect").val() var type = $("#typeselect").val();
if (Id=="3"){ if (type == "4") {
columnUrl ="#springUrl('/a/wxQrcode/listOrg')" columnUrl ="#springUrl('/a/wxQrcode/listOrg')"
} else {
}else{ columnUrl ="#springUrl('/a/wxQrcode/listUser?type=" + type + "')"
columnUrl ="#springUrl('/a/wxQrcode/listUser?userId=" + Id + "')"
} }
var title = type == "4" ? "人员名称" : "组织名称";
Cfapp.f7({ Cfapp.f7({
dataUrl: columnUrl, dataUrl: columnUrl,
checkType: 'single', // 多选为multi checkType: 'single', // 多选为multi
title: "选择二维码绑定对象", title: "选择二维码绑定对象",
btnoktext: "确定", btnoktext: "确定",
btncanceltext: "取消", btncanceltext: "取消",
columns: ['选择', '人员名称'], columns: ['选择', title],
isSearch: '0', isSearch: '0',
searchColumns: ["name"],//搜索的字段名称 searchColumns: ["name"],//搜索的字段名称
searchColumnsRemarks: ['人员名称'],//搜索的字段备注 searchColumnsRemarks: [title],//搜索的字段备注
aoColumns: [{ aoColumns: [{
"mData": "id" "mData": "id"
}, { }, {
"mData": "name" "mData": "name"
} }],
],
aoColumnDefs: [{ aoColumnDefs: [{
"aTargets": [0], "aTargets": [0],
"mData": "id", "mData": "id",
......
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
"sScrollY" : 400, "sScrollY" : 400,
sScrollX: "100%", sScrollX: "100%",
bScrollCollapse: false, bScrollCollapse: false,
sScrollXInner: "150%", sScrollXInner: "100%",
scrollCollapse: true, scrollCollapse: true,
iDisplayLength: 20, iDisplayLength: 20,
"lengthChange": false, "lengthChange": false,
......
...@@ -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("userId") int userId, @Param("name")String name); List<QyUser> fromUser(@Param("type") int type, @Param("name")String name, @Param("page") int page, @Param("pageSize") int pageSize);
List<WxQrcode> fromOrg(@Param("name")String name); int countUser(@Param("type") int type, @Param("name")String name);
List<WxQrcode> fromOrg(@Param("name")String name, @Param("page") int page, @Param("pageSize") int pageSize);
int countUser(int userId);
int countOrg(); int countOrg();
} }
\ No newline at end of file
...@@ -243,14 +243,21 @@ ...@@ -243,14 +243,21 @@
</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=#{userId} <if test=" name !=null and name != '' "> and name like '%${name}%'</if> select id, name from t_qyuser where user_type=#{type} <if test=" name !=null and name != '' "> and name like '%${name}%'</if>
ORDER BY create_time DESC
<if test="pageSize>0">limit #{page}, #{pageSize}</if>
</select> </select>
<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>
<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 <if test=" name !=null and name != '' "> where org_name like '%${name}%'</if>
ORDER BY create_time DESC
<if test="pageSize>0">limit #{page}, #{pageSize}</if>
</select> </select>
<select id="countUser" resultType="java.lang.Integer">
select count(1) from t_qyuser where user_type=#{userId}
</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
</select> </select>
......
...@@ -30,10 +30,11 @@ public interface WxQrcodeService extends GenericService<WxQrcode> { ...@@ -30,10 +30,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 userId,String name); List<QyUser> fromUser(int type, String name, int iDisplayStart, int iDisplayLength);
List<WxQrcode> fromOrg(String name); int countUser(int type, String name);
List<WxQrcode> fromOrg(String name, int iDisplayStart, int iDisplayLength);
int countUser(int userId);
int countOrg(); int countOrg();
} }
...@@ -84,18 +84,22 @@ public class WxQrcodeServiceImpl extends GenericServiceImpl<WxQrcode> implements ...@@ -84,18 +84,22 @@ public class WxQrcodeServiceImpl extends GenericServiceImpl<WxQrcode> implements
} }
@Override @Override
public List<QyUser> fromUser(int userId,String name) { public List<QyUser> fromUser(int type, String name, int page, int pageSize) {
return wxQrcodeMapper.fromUser(userId,name); page = page > 0 ? page : 0;
pageSize = pageSize > 0 ? pageSize : 0;
return wxQrcodeMapper.fromUser(type, name, page, pageSize);
} }
@Override @Override
public List<WxQrcode> fromOrg(String name) { public int countUser(int type, String name) {
return wxQrcodeMapper.fromOrg(name); return wxQrcodeMapper.countUser(type, name);
} }
@Override @Override
public int countUser(int userId) { public List<WxQrcode> fromOrg(String name, int page, int pageSize) {
return wxQrcodeMapper.countUser(userId); page = page > 0 ? page : 0;
pageSize = pageSize > 0 ? pageSize : 0;
return wxQrcodeMapper.fromOrg(name, page, pageSize);
} }
@Override @Override
......
...@@ -147,8 +147,6 @@ public class WxQrcodeController { ...@@ -147,8 +147,6 @@ public class WxQrcodeController {
} else { } else {
rtnJson.put("errorNo", 1); rtnJson.put("errorNo", 1);
} }
} }
} catch (Exception e) { } catch (Exception e) {
rtnJson.put("errorNo", 1); rtnJson.put("errorNo", 1);
...@@ -159,15 +157,14 @@ public class WxQrcodeController { ...@@ -159,15 +157,14 @@ public class WxQrcodeController {
//获取用户展示数据 //获取用户展示数据
@RequestMapping(value = "/listUser") @RequestMapping(value = "/listUser")
@ResponseBody @ResponseBody
public JSONObject fromUser( int userId,String name) { public JSONObject fromUser(int type, String name, int iDisplayStart, int iDisplayLength) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
if (!StringUtils.isEmpty(userId)) { if (!StringUtils.isEmpty(type)) {
List<QyUser> qyUsers = wxQrcodeService.fromUser(userId,name); List<QyUser> qyUsers = wxQrcodeService.fromUser(type, name, iDisplayStart, iDisplayLength);
int countUser = wxQrcodeService.countUser(userId); int countUser = wxQrcodeService.countUser(type, name);
rtnJson.put("iTotalRecords", countUser); rtnJson.put("iTotalRecords", countUser);
rtnJson.put("iTotalDisplayRecords", countUser); rtnJson.put("iTotalDisplayRecords", countUser);
rtnJson.put("data", qyUsers); rtnJson.put("data", qyUsers);
} }
return rtnJson; return rtnJson;
} }
...@@ -175,9 +172,9 @@ public class WxQrcodeController { ...@@ -175,9 +172,9 @@ public class WxQrcodeController {
//获取组织展示数据 //获取组织展示数据
@RequestMapping(value = "/listOrg",method = {RequestMethod.GET}) @RequestMapping(value = "/listOrg",method = {RequestMethod.GET})
@ResponseBody @ResponseBody
public JSONObject fromOrg(@RequestParam(required = false)String name) { 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); List<WxQrcode> wxQrcodes = wxQrcodeService.fromOrg(name, iDisplayStart, iDisplayLength);
int countOrg = wxQrcodeService.countOrg(); int countOrg = wxQrcodeService.countOrg();
rtnJson.put("iTotalRecords", countOrg); rtnJson.put("iTotalRecords", countOrg);
rtnJson.put("iTotalDisplayRecords", countOrg); rtnJson.put("iTotalDisplayRecords", countOrg);
...@@ -204,7 +201,6 @@ public class WxQrcodeController { ...@@ -204,7 +201,6 @@ public class WxQrcodeController {
} }
Sort sort = new Sort("t.create_time", OrderType.DESC); Sort sort = new Sort("t.create_time", OrderType.DESC);
List<WxQrcodeVO> list = wxQrcodeService.fetchSearchByPageVO(conds, sort, iDisplayStart, iDisplayLength); List<WxQrcodeVO> list = wxQrcodeService.fetchSearchByPageVO(conds, sort, iDisplayStart, iDisplayLength);
Integer counts = wxQrcodeService.count(0L, conds); Integer counts = wxQrcodeService.count(0L, conds);
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
......
...@@ -16,7 +16,8 @@ CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5Uk ...@@ -16,7 +16,8 @@ CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5Uk
ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A
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/adiea QY_DOMAIN_NAME=https://pd.shxrtech.com/aidea
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
QY_SEND_APPID=350 QY_SEND_APPID=350
...@@ -25,8 +26,6 @@ QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF ...@@ -25,8 +26,6 @@ QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF
#\u63A8\u9001\u836F\u5E08\u6D88\u606F\u5BA1\u6279\u54A8\u8BE2\u5355 #\u63A8\u9001\u836F\u5E08\u6D88\u606F\u5BA1\u6279\u54A8\u8BE2\u5355
QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\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
userfiles.imgdir=/mydata/fileResource userfiles.imgdir=/mydata/fileResource
......
package com.cftech.core.util;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by 16444 on 2020/11/20.
*/
public class IdcardUtils {
public static StringBuffer idcards = new StringBuffer();
public static List<String> idcardList = null;
static {
InputStream inputStream = null;
InputStreamReader inputStreamReader = null;
try {
inputStream = IdcardUtils.class.getClassLoader().getResourceAsStream("idcard.txt");
inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
int len = 0;
while ((len = inputStreamReader.read()) != -1) {
idcards.append(len);
}
String str = idcards.toString();
String[] strArr = str.split(",");
idcardList = Arrays.asList(strArr);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStreamReader != null) {
try {
inputStreamReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
...@@ -75,12 +75,13 @@ ...@@ -75,12 +75,13 @@
<!-- dialog body --> <!-- dialog body -->
<div class="modal-body"> <div class="modal-body">
<font color="red" style="margin: 10px;">*谨慎操作:生成虚拟会员后,此邀请码对应的预导入名单人员状态自动为报名状态*</font> <font color="red" style="margin: 10px;">*谨慎操作:生成虚拟会员后,此邀请码对应的预导入名单人员状态自动为报名状态*</font>
<input class="form-control select2" style="width: 100%" id="addlabel" <input class="form-control select2" style="width: 100%" id="addlabel"
placeholder='邀请码'> placeholder='邀请码'>
</input> </input>
</div> </div>
<div style="text-align: center;padding-bottom: 20px;"> <div style="text-align: center;padding-bottom: 20px;">
<button style="width: 100px;" type="button" class="btn btn-primary" onclick="addlabelsubmit()">确定 <button style="width: 100px;" type="button" class="btn btn-primary" onclick="addlabelsubmit()">
确定
</button> </button>
<button style="width: 100px;" type="button" id="tagCacel" class="btn btn-default">取消</button> <button style="width: 100px;" type="button" id="tagCacel" class="btn btn-default">取消</button>
</div> </div>
...@@ -94,7 +95,8 @@ ...@@ -94,7 +95,8 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/member/exportExcel')" method="get" onkeydown="if(event.keyCode==13){return false;}"> <form id="seachTableForm" action="#springUrl('/a/member/exportExcel')" method="get"
onkeydown="if(event.keyCode==13){return false;}">
<div class="col-xs-2"> <div class="col-xs-2">
<input type="text" class="form-control required" <input type="text" class="form-control required"
name="phone" placeholder="手机号"> name="phone" placeholder="手机号">
...@@ -103,20 +105,20 @@ ...@@ -103,20 +105,20 @@
<input type="text" class="form-control required" <input type="text" class="form-control required"
name="name" placeholder="会员名称"> name="name" placeholder="会员名称">
</div> </div>
<!-- <div class="col-xs-2">--> <!-- <div class="col-xs-2">-->
<!-- <select name="status" class="form-control">--> <!-- <select name="status" class="form-control">-->
<!-- <option value="0">请选择会员状态</option>--> <!-- <option value="0">请选择会员状态</option>-->
<!-- <option value="1">会员注册</option>--> <!-- <option value="1">会员注册</option>-->
<!-- <option value="2">虚拟会员</option>--> <!-- <option value="2">虚拟会员</option>-->
<!-- </select>--> <!-- </select>-->
<!-- </div>--> <!-- </div>-->
<div class="col-xs-5"> <div class="col-xs-5">
<a href="javascript:void(0)" class="btn btn-primary search">搜索</a> <a href="javascript:void(0)" class="btn btn-primary search">搜索</a>
#if($shiro.hasPermission("qy:member:edit")) #if($shiro.hasPermission("qy:member:edit"))
<!-- <a href="#springUrl('/a/member/form')" class="btn btn-primary">新增</a>--> <!-- <a href="#springUrl('/a/member/form')" class="btn btn-primary">新增</a>-->
#end #end
<button class="btn btn-primary">导出</button> <button class="btn btn-primary">导出</button>
<!-- <a href="javascript:void(0)" onclick="addMemer()" class="btn btn-primary">添加虚拟会员</a>--> <!-- <a href="javascript:void(0)" onclick="addMemer()" class="btn btn-primary">添加虚拟会员</a>-->
</div> </div>
</form> </form>
</div><!-- /.box-header --> </div><!-- /.box-header -->
...@@ -127,15 +129,15 @@ ...@@ -127,15 +129,15 @@
<td hidden="true">Id</td> <td hidden="true">Id</td>
<th>头像</th> <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>
<th>来源</th> <th>来源</th>
<!-- <th>邀请码</th>--> <!-- <th>邀请码</th>-->
<!-- <th>客户分类</th>--> <!-- <th>客户分类</th>-->
<!-- <th>名片</th>--> <!-- <th>名片</th>-->
<th>创建日期</th> <th>创建日期</th>
</tr> </tr>
</thead> </thead>
...@@ -178,14 +180,14 @@ ...@@ -178,14 +180,14 @@
<script type="text/javascript" <script type="text/javascript"
src="plugins/jquery-validation/js/jquery.validate.min.js"></script> src="plugins/jquery-validation/js/jquery.validate.min.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 src="common/js/tabletok.js"></script> <script src="common/js/tabletok.js"></script>
<!-- AdminLTE for demo purposes --> <!-- AdminLTE for demo purposes -->
<script src="common/js/cfapp.js"></script> <script src="common/js/cfapp.js"></script>
<script> <script>
function formatDates(now) { function formatDates(now) {
var date = new Date(now); var date = new Date(now);
var y = date.getFullYear(); var y = date.getFullYear();
var m = date.getMonth() + 1; var m = date.getMonth() + 1;
...@@ -198,7 +200,7 @@ ...@@ -198,7 +200,7 @@
var second = date.getSeconds(); var second = date.getSeconds();
minute = minute < 10 ? ('0' + minute) : minute; minute = minute < 10 ? ('0' + minute) : minute;
second = second < 10 ? ('0' + second) : second; second = second < 10 ? ('0' + second) : second;
return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second; return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
} }
function seachTable() { function seachTable() {
...@@ -206,8 +208,8 @@ ...@@ -206,8 +208,8 @@
var aoData = { var aoData = {
iDisplayStart: 0, iDisplayStart: 0,
iDosplayLength: 10, iDosplayLength: 10,
csrf_header:csrfheader, csrf_header: csrfheader,
csrf_token:csrftoken csrf_token: csrftoken
} }
...@@ -236,18 +238,18 @@ ...@@ -236,18 +238,18 @@
"mData": "openId" "mData": "openId"
}, },
{ {
"mData":"phone" "mData": "phone"
}, },
{ {
"mData":"name" "mData": "name"
}, },
{ {
"mData":"source" "mData": "source"
}, },
{ {
"mData":"createTime" "mData": "createTime"
} }
], ],
"aoColumnDefs": [ "aoColumnDefs": [
{ // set default column settings { // set default column settings
'visible': false, 'visible': false,
...@@ -258,30 +260,30 @@ ...@@ -258,30 +260,30 @@
"aTargets": [1], "aTargets": [1],
"mData": "imageurl", "mData": "imageurl",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return '<img src="'+a+'" style="width:80px;height:80px;">'; return '<img src="' + a + '" style="width:80px;height:80px;">';
} }
}, { }, {
"aTargets": [2], "aTargets": [2],
"mData": "sex", "mData": "sex",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a==0){ if (a == 0) {
return '女' return '女'
}else if(a==1){ } else if (a == 1) {
return '男'; return '男';
}else{ } else {
return ''; return '';
} }
} }
}, },
/* { /* {
"aTargets": [6], "aTargets": [6],
"mData": "createTime", "mData": "createTime",
"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");
} }
},*/ },*/
// { // {
// "aTargets": [3], // "aTargets": [3],
// "mData": "surname", // "mData": "surname",
...@@ -295,43 +297,43 @@ ...@@ -295,43 +297,43 @@
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
} }
},{ }, {
"aTargets":[4], "aTargets": [4],
"mData":"phone", "mData": "phone",
"mRender":function(a,b,c,d){ "mRender": function (a, b, c, d) {
return c.phone.slice(0, 1) + '*' + c.phone.slice(2, 3); return c.phone.slice(0, 1) + '*' + c.phone.slice(2, 3);
} }
},{ }, {
"aTargets":[5], "aTargets": [5],
"mData":"name", "mData": "name",
"mRender":function(a,b,c,d){ "mRender": function (a, b, c, d) {
return c.name.slice(0, 3) + '****' + c.name.slice(7); return c.name.slice(0, 3) + '****' + c.name.slice(7);
} }
},{ }, {
"aTargets":[6], "aTargets": [6],
"mData":"source", "mData": "source",
"mRender":function(a,b,c,d){ "mRender": function (a, b, c, d) {
if (a==1){ if (a == 1) {
return "普通关注"; return "普通关注";
}else if (a==2){ } else if (a == 2) {
return "师二维码"; return "师二维码";
}else if (a==3){ } else if (a == 3) {
return "客服二维码"; return "客服二维码";
}else if(a==4){ } else if (a == 4) {
return "医生二维码"; return "医生二维码";
}else if(a==5){ } else if (a == 5) {
return "组织二维码"; return "组织二维码";
}else{ } else {
return ""; return "";
} }
} }
} }
,{ , {
"aTargets":[7], "aTargets": [7],
"mData":"createTime", "mData": "createTime",
"mRender":function(a,b,c,d){ "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
} }
...@@ -341,12 +343,12 @@ ...@@ -341,12 +343,12 @@
} }
function addlabelsubmit(){ function addlabelsubmit() {
var code = $("#addlabel").val(); var code = $("#addlabel").val();
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "#springUrl('/a/member/addMember')", url: "#springUrl('/a/member/addMember')",
data: {code: code,_csrf_header:csrfheader.value,_csrf:csrftoken.value}, data: {code: code, _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) {
...@@ -357,7 +359,7 @@ ...@@ -357,7 +359,7 @@
location.href = "#springUrl('/a/member/list')"; location.href = "#springUrl('/a/member/list')";
} }
}); });
}else if(data.errorNo == 1){ } else if (data.errorNo == 1) {
Cfapp.alert({ Cfapp.alert({
message: "系统异常", message: "系统异常",
btntext: "确定", btntext: "确定",
...@@ -365,7 +367,7 @@ ...@@ -365,7 +367,7 @@
} }
}); });
}else{ } else {
Cfapp.alert({ Cfapp.alert({
message: "无效的邀请码", message: "无效的邀请码",
btntext: "确定", btntext: "确定",
...@@ -379,7 +381,7 @@ ...@@ -379,7 +381,7 @@
} }
}) })
} }
function addMemer(){ function addMemer() {
$("#addlabelModal").modal("show"); $("#addlabelModal").modal("show");
} }
...@@ -417,7 +419,7 @@ ...@@ -417,7 +419,7 @@
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "#springUrl('/a/member/delete')", url: "#springUrl('/a/member/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) {
......
package com.cftech.member.dao; package com.cftech.member.dao;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.sql.Conds;
import com.cftech.member.model.FanssVO; import com.cftech.member.model.FanssVO;
import com.cftech.member.model.Member; import com.cftech.member.model.Member;
import com.cftech.member.model.MemberDto; import com.cftech.member.model.MemberDto;
...@@ -44,7 +43,7 @@ public interface MemberMapper extends GenericDao<Member> { ...@@ -44,7 +43,7 @@ public interface MemberMapper extends GenericDao<Member> {
* @Param * @Param
* @return * @return
**/ **/
List<MemberVO> memberFormation(Long id); List<MemberVO> memberFormation(String openid);
/** /**
* *
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<resultMap id="resultMap" type="com.cftech.member.model.Member"> <resultMap id="resultMap" type="com.cftech.member.model.Member">
<id column="id" property="id"/> <id column="id" property="id"/>
<result column="number" property="number"/> <result column="number" property="number"/>
<result column="surname" property="surname"/>
<result column="name" property="name"/> <result column="name" property="name"/>
<result column="phone" property="phone"/> <result column="phone" property="phone"/>
<result column="imageurl" property="imageurl"/> <result column="imageurl" property="imageurl"/>
...@@ -22,14 +21,15 @@ ...@@ -22,14 +21,15 @@
<result column="update_by" property="updateBy"/> <result column="update_by" property="updateBy"/>
<result column="open_id" property="openId"/> <result column="open_id" property="openId"/>
<result column="storeid" property="storeid"/> <result column="storeid" property="storeid"/>
<result column="level" property="level"/>
<result column="area" property="area"/>
<result column="fanss_store_id" property="fanssStoreId"/> <result column="fanss_store_id" property="fanssStoreId"/>
<result column="oilSum" property="oilSum"/> <result column="sex" property="sex"/>
<result column="birthday" property="birthday"/>
<result column="area" property="area"/>
<result column="service_id" property="serviceId"/>
<result column="doctor_id" property="doctorId"/>
<result column="invitcode" property="invitcode"/> <result column="invitcode" property="invitcode"/>
<result column="compan" property="compan"/> <result column="compan" property="compan"/>
<result column="position" property="position"/> <result column="source" property="source"/>
<result column="service_id" property="serviceId"/>
</resultMap> </resultMap>
<resultMap id="resultMapDto" type="com.cftech.member.model.MemberDto"> <resultMap id="resultMapDto" type="com.cftech.member.model.MemberDto">
...@@ -76,104 +76,74 @@ ...@@ -76,104 +76,74 @@
</if> </if>
</sql> </sql>
<sql id="sqlColumnslist">
id,
number,
CONVERT(AES_DECRYPT(name,'aideakey') USING UTF8) name ,
CONVERT(AES_DECRYPT(phone,'aideakey') USING UTF8) phone,
imageurl,
cardid,
CONVERT(AES_DECRYPT(email,'aideakey') USING UTF8) email,
member_id,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by,
open_id,
storeid,
fanss_store_id,
sex,
CONVERT( AES_DECRYPT(birthday,'aideakey') USING UTF8) birthday,
area,
service_id,
doctor_id,
invitcode,
compan,
source
</sql>
<sql id="sqlColumns"> <sql id="sqlColumns">
id, id,number,name,phone,imageurl,cardid,email,member_id,accounts_id,del_flag,status,create_time,update_time,description,create_by,update_by,
number, open_id,storeid,fanss_store_id,sex,birthday,area,service_id,doctor_id,invitcode,compan,source
name, </sql>
phone,
imageurl,
cardid,
email,
member_id,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by,
open_id,
storeid,
birthday,
sex,
position,
level,
area,
fanss_store_id,
oilSum,
invitcode,
compan,
service_id
</sql>
<sql id="sqlColumnslist">
id,
number,
CONVERT(AES_DECRYPT(name,'aideakey') USING UTF8) name ,
CONVERT(AES_DECRYPT(phone,'aideakey') USING UTF8) phone,
imageurl,
cardid,
CONVERT(AES_DECRYPT(email,'aideakey') USING UTF8) email,
member_id,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by,
open_id,
storeid,
CONVERT( AES_DECRYPT(birthday,'aideakey') USING UTF8) birthday,
sex,
position,
level,
area,
fanss_store_id,
oilSum,
invitcode,
compan,
service_id
</sql>
<insert id="save" parameterType="com.cftech.member.model.Member" useGeneratedKeys="true" <insert id="save" parameterType="com.cftech.member.model.Member" useGeneratedKeys="true"
keyProperty="id"> keyProperty="id">
insert into wx_mp_member insert into wx_mp_member
( (
<include refid="sqlColumns"/> <include refid="sqlColumns"/>
) )
values values
( (
#{id, jdbcType=BIGINT}, #{id, jdbcType=BIGINT},
#{number, jdbcType=VARCHAR}, #{number, jdbcType=VARCHAR},
AES_ENCRYPT(#{name, jdbcType=VARBINARY},'aideakey'), AES_ENCRYPT(#{name, jdbcType=VARBINARY},'aideakey'),
#{surname}, AES_ENCRYPT(#{phone, jdbcType=VARBINARY},'aideakey'),
AES_ENCRYPT(#{phone, jdbcType=VARBINARY},'aideakey'), #{imageurl, jdbcType=VARCHAR},
#{imageurl, jdbcType=VARCHAR}, #{cardid, jdbcType=VARCHAR},
#{cardid, jdbcType=VARCHAR}, AES_ENCRYPT(#{email, jdbcType=VARBINARY},'aideakey'),
AES_ENCRYPT(#{email, jdbcType=VARBINARY},'aideakey'), #{memberId, jdbcType=VARCHAR},
#{memberId, jdbcType=VARCHAR}, #{accountsId, jdbcType=BIGINT},
#{accountsId, jdbcType=BIGINT}, #{delFlag, jdbcType=TINYINT},
#{delFlag, jdbcType=TINYINT}, #{status, jdbcType=VARCHAR},
#{status, jdbcType=VARCHAR}, now(),
now(), now(),
now(), #{description, jdbcType=VARCHAR},
#{description, jdbcType=VARCHAR}, #{createBy, jdbcType=BIGINT},
#{createBy, jdbcType=BIGINT}, #{updateBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT}, #{openId, jdbcType=VARCHAR},
#{openId, jdbcType=VARCHAR}, #{storeid,jdbcType=VARCHAR},
#{storeid,jdbcType=VARCHAR}, #{fanssStoreId, jdbcType=BIGINT},
AES_ENCRYPT(#{birthday,jdbcType=VARBINARY},'aideakey'), #{sex, jdbcType=BIGINT},AES_ENCRYPT(#{birthday,jdbcType=VARBINARY},'aideakey'),#{area,jdbcType=VARCHAR},
#{sex,jdbcType=VARCHAR}, #{serviceId, jdbcType=VARCHAR},
#{position}, #{doctorId,jdbcType=VARCHAR},
#{level,jdbcType=VARCHAR}, #{invitcode,jdbcType=VARCHAR},
#{area,jdbcType=VARCHAR}, #{compan,jdbcType=VARCHAR},
#{fanssStoreId,jdbcType=BIGINT}, #{source,jdbcType=BIGINT}
#{doctorId,jdbcType=VARCHAR},
#{invitcode,jdbcType=VARCHAR},
#{compan,jdbcType=VARCHAR},
#{serviceId, jdbc=VARCHAR}
) )
</insert> </insert>
...@@ -199,7 +169,6 @@ ...@@ -199,7 +169,6 @@
t.storeid, t.storeid,
CONVERT( AES_DECRYPT(offline.birthday,'aideakey') USING UTF8) offline.birthday, CONVERT( AES_DECRYPT(offline.birthday,'aideakey') USING UTF8) offline.birthday,
offline.sex, offline.sex,
t.level,
t.area, t.area,
t.fanss_store_id,t.doctor_id, t.fanss_store_id,t.doctor_id,
t.invitcode,t.compan, t.invitcode,t.compan,
...@@ -321,17 +290,11 @@ ...@@ -321,17 +290,11 @@
storeid = #{storeid, jdbcType=VARCHAR}, storeid = #{storeid, jdbcType=VARCHAR},
</if> </if>
<if test="sex != null"> <if test="sex != null">
sex = #{sex, jdbcType=BINARY}, sex = #{sex, jdbcType=BIGINT},
</if>
<if test="position!=null">
position = #{position},
</if> </if>
<if test="birthday != null"> <if test="birthday != null">
birthday = AES_ENCRYPT(#{birthday, jdbcType=VARBINARY},'aideakey'), birthday = AES_ENCRYPT(#{birthday, jdbcType=VARBINARY},'aideakey'),
</if> </if>
<if test="level != null">
level = #{level, jdbcType=VARCHAR},
</if>
<if test="area != null"> <if test="area != null">
area = #{area, jdbcType=VARCHAR}, area = #{area, jdbcType=VARCHAR},
</if> </if>
...@@ -383,14 +346,15 @@ ...@@ -383,14 +346,15 @@
</select> </select>
<!--个人信息回填 <!--个人信息回填
--> -->
<select id="memberFormation" parameterType="java.lang.Long" resultType="com.cftech.member.model.MemberVO"> <select id="memberFormation" parameterType="java.lang.String" resultType="com.cftech.member.model.MemberVO">
SELECT id,CONVERT(AES_DECRYPT(name,'aideakey') USING UTF8) AS memberName,sex,CONVERT(AES_DECRYPT(birthday,'aideakey')USING UTF8) birthday,imageurl,CONVERT(AES_DECRYPT(email,'aideakey')USING UTF8) AS mailbox,CONVERT(AES_DECRYPT(phone,'aideakey')USING UTF8) as phone SELECT id,CONVERT(AES_DECRYPT(name,'aideakey') USING UTF8) AS memberName, sex, CONVERT(AES_DECRYPT(birthday,'aideakey')USING UTF8) birthday, imageurl,
FROM wx_mp_member WHERE id= #{id} and del_flag=0 CONVERT(AES_DECRYPT(email,'aideakey')USING UTF8) AS mailbox, CONVERT(AES_DECRYPT(phone,'aideakey')USING UTF8) as phone, cardid
FROM wx_mp_member WHERE open_id = #{openid} and del_flag=0
</select> </select>
<select id="fanssChat" resultType="com.cftech.member.model.FanssVO">
SELECT openid,CONVERT(AES_DECRYPT(nickname,'aideakey') USING UTF8) nickname,headimgurl
FROM wx_mp_fanss WHERE openid = #{openid} and delflag=0
<select id="fanssChat" resultType="com.cftech.member.model.FanssVO">
SELECT openid,CONVERT(AES_DECRYPT(nickname,'aideakey') USING UTF8) nickname,headimgurl
FROM wx_mp_fanss WHERE openid = #{openid} and delflag=0
</select> </select>
<!--个人信息修改 <!--个人信息修改
--> -->
...@@ -413,7 +377,13 @@ FROM wx_mp_fanss WHERE openid = #{openid} and delflag=0 ...@@ -413,7 +377,13 @@ FROM wx_mp_fanss WHERE openid = #{openid} and delflag=0
phone = AES_ENCRYPT(#{phone},'aideakey'), phone = AES_ENCRYPT(#{phone},'aideakey'),
</if> </if>
<if test="imageUrl !=null"> <if test="imageUrl !=null">
imageurl = #{imageUrl} imageurl = #{imageUrl},
</if>
<if test="cardid != null ">
cardid = #{cardid}
</if>
<if test="compan != null ">
compan = #{compan}
</if> </if>
</set> </set>
where id =#{id} where id =#{id}
......
...@@ -19,7 +19,7 @@ public class Member implements Serializable { ...@@ -19,7 +19,7 @@ public class Member implements Serializable {
public static void main(String[] args) throws WexinReqException { public static void main(String[] args) throws WexinReqException {
Cosconfig cosconfig = new Cosconfig(); Cosconfig cosconfig = new Cosconfig();
net.sf.json.JSONObject mediaJson= JwMediaAPI.downMedia("12_r_qzTWhvOUsmjGtRKE7bXsat2Ih10K-L9kZJoj74mZRGu3ZOYfHJzENBgSHQBDGNhCfE7Vnl3bfTuS-zh2h3MF7C6H3XErVzfOnVBBsgreAA-dqVxBmsmK4B6CJfbJDonAp9x2vvBvEcepBqVRHhAHAGCS","jwjOUMFA_llgdAP_MBMarxIHu3YozRfHdC5Cdo_koujuoRfxUSNab4u8RLoFBdjL","",cosconfig); net.sf.json.JSONObject mediaJson = JwMediaAPI.downMedia("12_r_qzTWhvOUsmjGtRKE7bXsat2Ih10K-L9kZJoj74mZRGu3ZOYfHJzENBgSHQBDGNhCfE7Vnl3bfTuS-zh2h3MF7C6H3XErVzfOnVBBsgreAA-dqVxBmsmK4B6CJfbJDonAp9x2vvBvEcepBqVRHhAHAGCS", "jwjOUMFA_llgdAP_MBMarxIHu3YozRfHdC5Cdo_koujuoRfxUSNab4u8RLoFBdjL", "", cosconfig);
} }
/* 主键id */ /* 主键id */
...@@ -29,10 +29,8 @@ public class Member implements Serializable { ...@@ -29,10 +29,8 @@ public class Member implements Serializable {
/* 姓名 */ /* 姓名 */
@ExportConfig(value = "名", width = 100) @ExportConfig(value = "名", width = 100)
private String name; private String name;
@ExportConfig(value = "姓",width = 100)
private String surname;
/* 手机号 */ /* 手机号 */
@ExportConfig(value = "手机号码" , width = 100) @ExportConfig(value = "手机号码", width = 100)
private String phone; private String phone;
/* 头像 */ /* 头像 */
@ExportConfig(value = "头像", width = 100) @ExportConfig(value = "头像", width = 100)
...@@ -41,6 +39,10 @@ public class Member implements Serializable { ...@@ -41,6 +39,10 @@ public class Member implements Serializable {
//@ExportConfig(value = "身份证", width = 100) //@ExportConfig(value = "身份证", width = 100)
private String cardid; private String cardid;
/* 其他信息 */
@ExportConfig(value = "Email", width = 100)
private String email;
/* 会员卡号 */ /* 会员卡号 */
//@ExportConfig(value = "会员卡号", width = 100) //@ExportConfig(value = "会员卡号", width = 100)
private String memberId; private String memberId;
...@@ -65,65 +67,41 @@ public class Member implements Serializable { ...@@ -65,65 +67,41 @@ public class Member implements Serializable {
//@ExportConfig(value = "openId", width = 100) //@ExportConfig(value = "openId", width = 100)
private String openId; private String openId;
private String position;
/** /**
* 辅助字段 * 绑定的门店
*/ */
/*生日*/
private String birthday;
/*性别*/
@ExportConfig(value = "性别", width = 100)
private String sex;
/**会员等级*/
private String level;
/**地区*/
private String area;
/* 其他信息 */
@ExportConfig(value = "Email", width = 100)
private String email;
/**绑定的门店*/
private String storeid; private String storeid;
/** /**
*注册时从粉丝表取的门店ID * 注册时从粉丝表取的门店ID
* */ */
private Long fanssStoreId; private Long fanssStoreId;
/*性别*/
@ExportConfig(value = "性别", width = 100)
private Long sex;
private String position;
/** /**
*会员卡名字 * 辅助字段
*/ */
private String memberName; /*生日*/
private String birthday;
/** /**
*会员卡手机号 * 会员等级
*/ */
private String memberPhone; private String level;
/** /**
* 会员卡所绑定门店 * 地区
*/
private String memberStoreId;
/**
* 会员邀请码
*/ */
private String invitcode; private String area;
private String compan;
/** /**
* 所属客服id * 所属客服id
*/ */
//private String member_uid;
private String serviceId; private String serviceId;
/** /**
...@@ -132,6 +110,16 @@ public class Member implements Serializable { ...@@ -132,6 +110,16 @@ public class Member implements Serializable {
//private String oilSum; //private String oilSum;
private String doctorId; private String doctorId;
/**
* 会员邀请码
*/
private String invitcode;
/**
* 是否三期患者
*/
private String compan;
/** /**
* 会员来源: 1:普通关注 2:医师二维码 3:客服二维码 4:医生二维码 5:组织二维码 * 会员来源: 1:普通关注 2:医师二维码 3:客服二维码 4:医生二维码 5:组织二维码
*/ */
...@@ -140,7 +128,20 @@ public class Member implements Serializable { ...@@ -140,7 +128,20 @@ public class Member implements Serializable {
/**
* 会员卡名字
*/
private String memberName;
/**
* 会员卡手机号
*/
private String memberPhone;
/**
* 会员卡所绑定门店
*/
private String memberStoreId;
public Member() { public Member() {
......
...@@ -13,13 +13,15 @@ import java.util.Date; ...@@ -13,13 +13,15 @@ import java.util.Date;
*/ */
@Data @Data
public class MemberVO { public class MemberVO {
/*appid*/ /*appid*/
private String appId; private String appId;
private Long id; private Long id;
/*姓名*/ /*姓名*/
private String memberName; private String memberName;
/*性别*/ /*性别*/
private Long sex; private String sex;
/*生日*/ /*生日*/
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birthday; private Date birthday;
...@@ -35,4 +37,13 @@ public class MemberVO { ...@@ -35,4 +37,13 @@ public class MemberVO {
private Long accountsID; private Long accountsID;
private String birthdayStr; private String birthdayStr;
private String cardid;
/**
* 会员编码
*/
private String number;
private String compan;
} }
...@@ -52,7 +52,7 @@ public interface MemberService extends GenericService<Member> { ...@@ -52,7 +52,7 @@ public interface MemberService extends GenericService<Member> {
* @Param * @Param
* @return * @return
**/ **/
JSONObject memberFormation(Long id,String appId); JSONObject memberFormation(String openid, String appId);
/** /**
* 个人信息修改 * 个人信息修改
......
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,7 @@ 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.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.scope.OrderType; import com.cftech.core.scope.OrderType;
...@@ -11,6 +12,7 @@ import com.cftech.core.sql.Cond; ...@@ -11,6 +12,7 @@ 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.DateFormatUtils;
import com.cftech.core.util.IdcardUtils;
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.FanssVO; import com.cftech.member.model.FanssVO;
...@@ -18,6 +20,8 @@ import com.cftech.member.model.Member; ...@@ -18,6 +20,8 @@ import com.cftech.member.model.Member;
import com.cftech.member.model.MemberDto; import com.cftech.member.model.MemberDto;
import com.cftech.member.model.MemberVO; import com.cftech.member.model.MemberVO;
import com.cftech.member.service.MemberService; import com.cftech.member.service.MemberService;
import com.cftech.mp.fans.model.MpFanssEntity;
import com.cftech.mp.fans.service.MpFanssService;
import com.cftech.workshop.meeting.model.Meeting; import com.cftech.workshop.meeting.model.Meeting;
import com.cftech.workshop.workshop.model.Workshop; import com.cftech.workshop.workshop.model.Workshop;
import com.cftech.workshop.workshop.service.WorkshopService; import com.cftech.workshop.workshop.service.WorkshopService;
...@@ -43,11 +47,19 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem ...@@ -43,11 +47,19 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
@Autowired @Autowired
@Qualifier("memberMapper") @Qualifier("memberMapper")
private MemberMapper memberMapper; private MemberMapper memberMapper;
@Autowired @Autowired
private MpAccountsService mpAccountsService; private MpAccountsService mpAccountsService;
@Autowired @Autowired
private WorkshopService workshopService; private WorkshopService workshopService;
@Autowired
private MpFanssService fanssService;
@Autowired
private CodingruleUtils codingruleUtils;
@Override @Override
public GenericDao<Member> getGenericMapper() { public GenericDao<Member> getGenericMapper() {
return memberMapper; return memberMapper;
...@@ -90,20 +102,30 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem ...@@ -90,20 +102,30 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
} }
@Override @Override
public JSONObject memberFormation(Long id, String appId) { public JSONObject memberFormation(String openid, String appId) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
if (org.springframework.util.StringUtils.isEmpty(id)) { if (org.springframework.util.StringUtils.isEmpty(openid)) {
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg", "id不能为空"); rtnJson.put("errorMsg", "id不能为空");
return rtnJson; return rtnJson;
} }
MpAccountsEntity accountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity accountsAppid = mpAccountsService.getMpAccountsAppid(appId);
List<MemberVO> memberVOS = memberMapper.memberFormation(id); //未注册会员时,填充粉丝信息
Log.info("返回值" + memberVOS); List<MemberVO> memberVOS = memberMapper.memberFormation(openid);
rtnJson.put("errorNo", "0"); if (memberVOS == null || memberVOS.size() == 0) {
rtnJson.put("data", memberVOS); MpFanssEntity fanssEntity = fanssService.getWxUser(openid);
MemberVO member = new MemberVO();
member.setOpenid(openid);
member.setMemberName(fanssEntity.getNickname());
member.setSex(fanssEntity.getSex());
member.setImageUrl(fanssEntity.getHeadimgurl());
rtnJson.put("errorNo", "0");
rtnJson.put("data", member);
} else {
rtnJson.put("errorNo", "0");
rtnJson.put("data", memberVOS.get(0));
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
...@@ -115,16 +137,14 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem ...@@ -115,16 +137,14 @@ 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 {
Date birthday = DateFormatUtils.formatDate(memberVO.getBirthdayStr(), "yyyy-MM-dd");
memberVO.setBirthday(birthday);
if (StringUtils.isEmpty(memberVO.getMemberName())) { if (StringUtils.isEmpty(memberVO.getMemberName())) {
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg", "姓名不能为空"); rtnJson.put("errorMsg", "姓名不能为空");
return rtnJson; return rtnJson;
} }
if (StringUtils.isEmpty(memberVO.getMailbox())) { if (StringUtils.isEmpty(memberVO.getCardid())) {
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg", "邮箱不能为空"); rtnJson.put("errorMsg", "身份证不能为空");
return rtnJson; return rtnJson;
} }
if (StringUtils.isEmpty(memberVO.getPhone())) { if (StringUtils.isEmpty(memberVO.getPhone())) {
...@@ -132,8 +152,37 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem ...@@ -132,8 +152,37 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
rtnJson.put("errorMsg", "联系方式不能为空"); rtnJson.put("errorMsg", "联系方式不能为空");
return rtnJson; return rtnJson;
} }
MpAccountsEntity accountsAppid = mpAccountsService.getMpAccountsAppid(memberVO.getAppId());
int i = memberMapper.updateMember(memberVO); int i = 0;
MpAccountsEntity accounts= mpAccountsService.getMpAccountsAppid(memberVO.getAppId());
List<MemberVO> memberVOS = memberMapper.memberFormation(memberVO.getOpenid());
if (memberVOS == null || memberVOS.size() == 0) {
Member member = new Member();
member.setOpenId(memberVO.getOpenid());
member.setName(memberVO.getMemberName());
member.setSex(Long.parseLong(memberVO.getSex()));
if (StringUtils.isNoneBlank(memberVO.getCardid())) {
//三期患者
if (IdcardUtils.idcardList.contains(memberVO.getCardid())) {
member.setCompan("0");//三期患者
}
}
member.setCardid(memberVO.getCardid());
member.setPhone(memberVO.getPhone());
member.setImageurl(memberVO.getImageUrl());
memberMapper.save(member);
} else {
memberVO.setNumber(codingruleUtils.getNumber(accounts.getId(), Member.class.getName()));
if (StringUtils.isNoneBlank(memberVO.getCardid())) {
//三期患者
if (IdcardUtils.idcardList.contains(memberVO.getCardid())) {
memberVO.setCompan("0");//三期患者
}
}
i = memberMapper.updateMember(memberVO);
}
if (i > 0) { if (i > 0) {
rtnJson.put("errorNo", "0"); rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "修改成功"); rtnJson.put("errorMsg", "修改成功");
...@@ -183,7 +232,7 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem ...@@ -183,7 +232,7 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
List<Workshop> list1 = workshopService.selectworkshop(conds1, sort1, 0, 0); List<Workshop> list1 = workshopService.selectworkshop(conds1, sort1, 0, 0);
if (list1 != null && list1.size() > 0) { if (list1 != null && list1.size() > 0) {
Workshop workshop = list1.get(0); Workshop workshop = list1.get(0);
if (member.getSurname().equals(workshop.getSurname()) && member.getName().equals(workshop.getFirst_name()) && member.getPhone().equals("")) { if ( member.getName().equals(workshop.getFirst_name()) && member.getPhone().equals("")) {
member.setPhone(workshop.getPhone()); member.setPhone(workshop.getPhone());
memberMapper.save(member); //注册成功会员表里面添加一条数据 memberMapper.save(member); //注册成功会员表里面添加一条数据
} else { } else {
......
...@@ -229,7 +229,6 @@ public class MemberController { ...@@ -229,7 +229,6 @@ public class MemberController {
//member.setOilSum("0"); //member.setOilSum("0");
member.setNumber(codingruleUtils.getNumber(accountsId, Member.class.getName())); member.setNumber(codingruleUtils.getNumber(accountsId, Member.class.getName()));
//member.setMember_uid(UUID.randomUUID().toString()); //member.setMember_uid(UUID.randomUUID().toString());
member.setSurname(workshop.getSurname());
member.setName(workshop.getFirst_name()); member.setName(workshop.getFirst_name());
member.setPhone(workshop.getPhone()); member.setPhone(workshop.getPhone());
member.setPosition(workshop.getPosition()); member.setPosition(workshop.getPosition());
......
...@@ -30,8 +30,8 @@ public class MobileMemberController { ...@@ -30,8 +30,8 @@ public class MobileMemberController {
* @Param * @Param
**/ **/
@RequestMapping(value = "/memberFormation", method = {RequestMethod.GET, RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/memberFormation", method = {RequestMethod.GET, RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject memberFormation(Long id,String appId) { public JSONObject memberFormation(String openid, String appId) {
return memberService.memberFormation(id,appId); return memberService.memberFormation(openid, appId);
} }
/** /**
......
...@@ -553,7 +553,7 @@ ...@@ -553,7 +553,7 @@
if (a == 0) { if (a == 0) {
return "普通关注"; return "普通关注";
} else if (a == 1) { } else if (a == 1) {
return "药师二维码"; return "药师二维码";
} else if (a == 2) { } else if (a == 2) {
return "客服二维码"; return "客服二维码";
} else if (a == 3) { } else if (a == 3) {
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
<script>
var test = localStorage.getItem("test");
if(test && test!=null){
alert("已经有缓存"+test);
}else{
var test = localStorage.setItem("test","123");
alert("没有缓存,已插入新缓存"+test);
}
</script>
</html>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<id column="id" property="id" jdbcType="BIGINT"/> <id column="id" property="id" jdbcType="BIGINT"/>
<result column="openid" property="openid" jdbcType="VARCHAR"/> <result column="openid" property="openid" jdbcType="VARCHAR"/>
<result column="nickname" property="nickname" jdbcType="VARCHAR"/> <result column="nickname" property="nickname" jdbcType="VARCHAR"/>
<result column="sex" property="sex" jdbcType="CHAR"/> <result column="sex" property="sex" />
<result column="city" property="city" jdbcType="VARCHAR"/> <result column="city" property="city" jdbcType="VARCHAR"/>
<result column="province" property="province" jdbcType="VARCHAR"/> <result column="province" property="province" jdbcType="VARCHAR"/>
<result column="country" property="country" jdbcType="VARCHAR"/> <result column="country" property="country" jdbcType="VARCHAR"/>
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
<!-- 根据openid获取用户详情 --> <!-- 根据openid获取用户详情 -->
<select id="getWxUser" parameterType="java.lang.String" resultType="com.cftech.mp.fans.model.MpFanssEntity"> <select id="getWxUser" parameterType="java.lang.String" resultType="com.cftech.mp.fans.model.MpFanssEntity">
select * from wx_mp_fanss select <include refid="Base_Column_List"/> from wx_mp_fanss
<where> <where>
openid=#{openid,jdbcType=VARCHAR} and delflag=0 openid=#{openid,jdbcType=VARCHAR} and delflag=0
</where> </where>
......
...@@ -29,7 +29,7 @@ public interface MpFanssService extends GenericService<MpFanssEntity> { ...@@ -29,7 +29,7 @@ public interface MpFanssService extends GenericService<MpFanssEntity> {
Long selectFannscounts(@Param("userid") Long userid); Long selectFannscounts(@Param("userid") Long userid);
// 获取公众号下面所有关注者的粉丝appid
MpFanssEntity getWxUser(String openid); MpFanssEntity getWxUser(String openid);
// 根据公众号ID更新获取详细信息 // 根据公众号ID更新获取详细信息
......
...@@ -218,7 +218,7 @@ public class MpMenuController { ...@@ -218,7 +218,7 @@ public class MpMenuController {
} }
@RequestMapping(value="/remove",method={RequestMethod.POST}) @RequestMapping(value="/remove",method={RequestMethod.POST})
@RequiresPermissions(value=PermissionSign.REPLY_EDIT) //@RequiresPermissions(value=PermissionSign.MPMENU_EDIT)
@ResponseBody @ResponseBody
public JSONObject removereply(Long id){ public JSONObject removereply(Long id){
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
......
...@@ -235,16 +235,16 @@ public class CoreService { ...@@ -235,16 +235,16 @@ 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) {
...@@ -532,8 +532,9 @@ public class CoreService { ...@@ -532,8 +532,9 @@ public class CoreService {
article.setPicUrl(cover); article.setPicUrl(cover);
article.setUrl(qyDomain + "/aidea/static/mp/aidea/wx-brand-agreement.html?appid=" + appid); article.setUrl(qyDomain + "/aidea/static/mp/aidea/wx-brand-agreement.html?appid=" + appid);
return MessageUtil.newsMessageToXml(newsinfo(fromUserName, toUserName, article)); return MessageUtil.newsMessageToXml(newsinfo(fromUserName, toUserName, article));
} else {
return replyMessage(fromUserName, toUserName, null, "subscribe");
} }
return null;
} }
......
package com.cftech.mp.reply.web; package com.cftech.mp.reply.web;
import com.alibaba.fastjson.JSON;
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.core.sql.Conds;
import com.cftech.core.util.MpTokenUtil; import com.cftech.core.util.MpTokenUtil;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.mp.fans.service.MpFanssService;
import com.cftech.mp.reply.service.CoreService; import com.cftech.mp.reply.service.CoreService;
import com.cftech.mp.reply.service.ReplyService; import com.cftech.mp.reply.service.ReplyService;
import com.google.gson.Gson;
import org.mp.api.core.common.util.MessageUtil; import org.mp.api.core.common.util.MessageUtil;
import org.mp.api.core.common.util.SignUtil; import org.mp.api.core.common.util.SignUtil;
import org.mp.api.core.req.model.message.IndustryTemplateMessageSend;
import org.mp.api.core.req.model.message.TemplateData;
import org.mp.api.wxsendmsg.JwSendMessageAPI;
import org.mp.api.wxsendmsg.JwTemplateMessageAPI;
import org.mp.api.wxsendmsg.test.JwSendMessageAPITest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
......
...@@ -144,11 +144,11 @@ ...@@ -144,11 +144,11 @@
<div class="form-group form-md-line-input col-md-4"> <div class="form-group form-md-line-input col-md-4">
<label>职业</label> <label>职业</label>
<select name="userType" class="form-control pull-right"> <select name="userType" class="form-control pull-right">
<option label="其他" value="4">其他</option> <option label="其他" value="0">其他</option>
<option label="订单员" value="3" #if($data.userType == '3') selected #end>订单员</option>
<option label="医生" value="2" #if($data.userType == '2') selected #end>医生</option>
<option label="药师" value="1" #if($data.userType == '1') selected #end>药师</option> <option label="药师" value="1" #if($data.userType == '1') selected #end>药师</option>
<option label="客服" value="0" #if($data.userType == '0') selected #end>客服</option> <option label="客服" value="2" #if($data.userType == '2') selected #end>客服</option>
<option label="医生" value="3" #if($data.userType == '3') selected #end>医生</option>
<option label="订单员" value="4" #if($data.userType == '4') selected #end>订单员</option>
</select> </select>
</div> </div>
<!--<div class="form-group form-md-line-input col-md-4">--> <!--<div class="form-group form-md-line-input col-md-4">-->
......
...@@ -349,19 +349,19 @@ ...@@ -349,19 +349,19 @@
let postion = null; let postion = null;
switch (a) { switch (a) {
case "0": case "0":
postion = "客服"; postion = "其他";
break; break;
case "1": case "1":
postion = "药师"; postion = "药师";
break; break;
case "2": case "2":
postion = "医生"; postion = "客服";
break; break;
case "3": case "3":
postion = "订单员"; postion = "医生";
break; break;
case "4": case "4":
postion = "其他"; postion = "订单员";
break; break;
} }
return "<font color='blue'>" +postion + "</font>"; return "<font color='blue'>" +postion + "</font>";
......
...@@ -364,19 +364,19 @@ public class QyuserController { ...@@ -364,19 +364,19 @@ public class QyuserController {
String position = o.getUserType(); String position = o.getUserType();
switch (position) { switch (position) {
case "0": case "0":
o.setUserType("客服"); o.setUserType("其他");
break; break;
case "1": case "1":
o.setUserType("药师"); o.setUserType("药师");
break; break;
case "2": case "2":
o.setUserType("医生"); o.setUserType("客服");
break; break;
case "3": case "3":
o.setUserType("订单员"); o.setUserType("医生");
break; break;
case "4": case "4":
o.setUserType("其他"); o.setUserType("订单员");
break; break;
} }
}); });
......
...@@ -24,7 +24,7 @@ $().ready(function () { ...@@ -24,7 +24,7 @@ $().ready(function () {
function validate(){ function validate(){
if (code != null && code != "") { //有code已授权 if (code != null && code != "") { //有code已授权
window.location.href=redirect_uri+"&code="+code; window.location.href=redirect_uri+"&code="+code;
}else{//无Code调用微信授权 } else {//无Code调用微信授权
oauth2(); oauth2();
} }
} }
......
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