Commit 66adcf29 authored by sunc's avatar sunc

Merge remote-tracking branch 'origin/master'

parents 0d4e670e 98b2a1c6
......@@ -330,6 +330,7 @@
<th>订单编码</th>
<th>用药人姓名</th>
<th>审核状态</th>
<th>订单状态</th>
<th>拒绝原由</th>
<th>提交时间</th>
<th>审核时间</th>
......@@ -1054,6 +1055,9 @@
{
"mData": "status"
},
{
"mData": "orderStatus"
},
{
"mData": "description"
},
......@@ -1121,17 +1125,27 @@
},
{
"aTargets": [5],
"mData": "drugNum",
"mData": "orderStatus",
"mRender": function (a, b, c, d) {
if (a) {
return a;
if (a == '0') {
return "<span style='color:RGB(100,160,240)'>待确认</span>";
} else if (a == '1') {
return "<span style='color:RGB(255,51,0)'>待付款</span>";
} else if (a == '2') {
return "<span>待发货</span>";
} else if (a == '3') {
return "<span'>待收货</span>";
} else if (a == '4') {
return "<span>已完成</span>";
} else if (a == '5') {
return "<span>已取消</span>";
} else {
return null;
return "";
}
}
},
{
"aTargets": [6],
"aTargets": [7],
"mData": "createTime",
"mRender": function (a, b, c, d) {
if (a) {
......@@ -1142,7 +1156,7 @@
}
},
{
"aTargets": [7],
"aTargets": [8],
"mData": "auditTime",
"mRender": function (a, b, c, d) {
if (a) {
......@@ -1153,7 +1167,7 @@
}
},
{
"aTargets": [8],
"aTargets": [9],
"mData": "prescription",
"mRender": function (a, b, c, d) {
if (a) {
......
......@@ -91,6 +91,7 @@
<select id="isThree" name="isThree" class="form-control required">
<option value="">请选择患者类型</option>
<option value="1">三期患者</option>
<option value="-1">非三期</option>
</select>
</div>
......
......@@ -226,6 +226,7 @@
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = '0'
<include refid="sqlWhere"/>
<if test="userid!=null">and (a.doctor_id = ${userid} or a.service_id =${userid})</if>
<if test="isThree==-1">AND (m.status IS NULL OR m.status != '1')</if>
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.consultsheet.model.ConsultSheet">
......@@ -249,8 +250,8 @@
LEFT JOIN t_aidea_member_group g ON FIND_IN_SET(g.id, m.member_id) != 0 AND g.del_flag = '0'
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = '0'
<include refid="sqlWhere"/>
<if test="userid!=null">AND (a.doctor_id = ${userid} or a.service_id =${userid})</if>
AND a.open_id NOT IN (SELECT open_id FROM wx_mp_member WHERE status = '0' AND del_flag = '0')
<if test="userid!=null">AND (a.doctor_id = ${userid} OR a.service_id =${userid})</if>
<if test="isThree==-1">AND (m.status IS NULL OR m.status != '1')</if>
GROUP BY a.id
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
......
......@@ -45,7 +45,7 @@ public interface ConsultSheetService extends GenericService<ConsultSheet> {
* @param userid
* @return
*/
List<ConsultSheet> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid);
List<ConsultSheet> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid, String isThree);
/**
* 咨询单列表统计查询
......@@ -53,7 +53,7 @@ public interface ConsultSheetService extends GenericService<ConsultSheet> {
* @param userid
* @return
*/
Integer fetchSearchByCount(Conds conds, Long userid);
Integer fetchSearchByCount(Conds conds, Long userid, String isThree);
/**
* 提交咨询单且轮询对应客服、医生进行处理
......
......@@ -22,6 +22,8 @@ import com.cftech.core.util.Constants;
import com.cftech.core.util.MpTokenUtil;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.member.model.FanssVO;
import com.cftech.member.model.Member;
import com.cftech.member.service.MemberService;
import com.cftech.mp.fans.model.MpFanssEntity;
import com.cftech.mp.fans.service.MpFanssService;
......@@ -31,6 +33,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -97,17 +100,20 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
}
@Override
public Integer fetchSearchByCount(Conds conds, Long userid) {
public Integer fetchSearchByCount(Conds conds, Long userid, String isThree) {
Map<String, Object> params = new HashMap<>();
params.put("conds", conds);
if (userid != null && userid != 1) {
params.put("userid", userid);
}
if (StringUtils.equals("-1", isThree)) {
params.put("isThree", isThree);
}
return consultSheetMapper.fetchSearchByCount(params);
}
@Override
public List<ConsultSheet> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid) {
public List<ConsultSheet> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid, String isThree) {
Map<String, Object> params = new HashMap<>();
params.put("conds", conds);
params.put("offset", page > 0 ? page : 0);
......@@ -116,6 +122,9 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
if (userid != null && userid != 1) {
params.put("userid", userid);
}
if (StringUtils.equals("-1", isThree)) {
params.put("isThree", isThree);
}
return consultSheetMapper.fetchSearchByPage(params);
}
......@@ -215,7 +224,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
conds.equal("o.openid", openid);
conds.in("o.status", new String[]{"4"});// 4:已成交
Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> orders = orderService.fetchSearchBy(conds, sort, 0, 0, null, null, null);
List<Order> orders = orderService.fetchSearchBy(conds, sort, 0, 0, null, null, null, null);
if (orders != null && orders.size() > 0 && orders.get(0) != null) { //复购
Order order = orders.get(0);
......@@ -346,12 +355,20 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
String nickname = "";
String fansAlias = "";
String patientType = "非三期";
if (StringUtils.isNoneBlank(consultSheet.getOpenId())) {
MpFanssEntity mpFanssEntity = mpFanssService.getWxUser(consultSheet.getOpenId());
if (mpFanssEntity != null) {
nickname = StringUtils.isBlank(mpFanssEntity.getNickname()) ? "":mpFanssEntity.getNickname();
fansAlias = StringUtils.isBlank(mpFanssEntity.getStore()) ? "":mpFanssEntity.getStore();
}
Conds mConds = new Conds();
mConds.equal("member.del_flag", Constants.DEL_FLAG_0);
mConds.equal("member.open_id", consultSheet.getOpenId());
List<Member> members = memberService.fetchSearchByPageServer(mConds, null, 0, 0);
if (!CollectionUtils.isEmpty(members) && StringUtils.equals("1", members.get(0).getStatus())) {
patientType = "三期";
}
}
//推送客服消息
......@@ -360,7 +377,8 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
if (service != null) {
msg = SystemConfig.p.getProperty("QY_SEND_CUSTOMERSERVICE_MSG").replace("{NUMBER}", consultSheet.getConsultId())//
.replace("{NICKNAME}", nickname)//
.replace("{FANSALIAS}", fansAlias);
.replace("{FANSALIAS}", fansAlias)
.replace("{PATIENTTYPE}", patientType);
List<Qyuser> serviceUsers = new ArrayList();
serviceUsers.add(service);
JSONObject result = qyMsgUtil.sendText(accounts, false, serviceUsers, null, null, agenId, msg, false);
......@@ -372,7 +390,8 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
if (service != null) {
msg = SystemConfig.p.getProperty("QY_SEND_DOCTOR_MSG").replace("{NUMBER}", consultSheet.getConsultId())//
.replace("{NICKNAME}", nickname)//
.replace("{FANSALIAS}", fansAlias);
.replace("{FANSALIAS}", fansAlias)
.replace("{PATIENTTYPE}", patientType);
List<Qyuser> doctorUsers = new ArrayList();
doctorUsers.add(doctor);
JSONObject result = qyMsgUtil.sendText(accounts, false, doctorUsers, null, null, agenId, msg, false);
......
......@@ -20,6 +20,7 @@ import com.cftech.consultsheet.model.ConsultSheetVO;
import com.cftech.consultsheet.service.ConsultSheetService;
import com.cftech.core.poi.ExcelKit;
import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Cond;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.*;
......@@ -53,6 +54,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
......@@ -236,8 +238,9 @@ public class ConsultSheetController {
@ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, ConsultSheet consultSheet, HttpServletRequest request) {
Long userid = UserUtils.getUser().getUserid();
boolean leader = roleService.selectRoleEntityByUserId(UserUtils.getUser().getId(), Constants.SYSTEM_LEADER);
if (leader) {
boolean leader = roleService.selectRoleEntityByUserId(userid, Constants.SYSTEM_LEADER);
boolean manager = roleService.selectRoleEntityByUserId(userid, Constants.SYSTEM_STORAGEMANAGER);//订单员
if (leader || manager) {
userid = 1L;//查看全部
}
......@@ -263,7 +266,6 @@ public class ConsultSheetController {
} else {
conds.equal("o.status", consultSheet.getOrderStatus());
}
}
if (consultSheet.getServiceId() != null) {
conds.equal("a.service_id", consultSheet.getServiceId());
......@@ -281,8 +283,8 @@ public class ConsultSheetController {
Sort sort = new Sort("a.create_time", OrderType.DESC);
List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid);
Integer counts = consultSheetService.fetchSearchByCount(conds, userid);
List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid, consultSheet.getIsThree());
Integer counts = consultSheetService.fetchSearchByCount(conds, userid, consultSheet.getIsThree());
JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts);
rtnJson.put("iTotalDisplayRecords", counts);
......@@ -303,8 +305,8 @@ public class ConsultSheetController {
Sort sort = new Sort("a.create_time", OrderType.DESC);
List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, null);
Integer counts = consultSheetService.fetchSearchByCount(conds, null);
List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, null, null);
Integer counts = consultSheetService.fetchSearchByCount(conds, null, null);
JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts);
rtnJson.put("iTotalDisplayRecords", counts);
......@@ -351,8 +353,12 @@ public class ConsultSheetController {
conds.equal("m.status", "1");
}
if (StringUtils.isNoneBlank(consultSheet.getOrderStatus())) {
if (StringUtils.equals("-1", consultSheet.getOrderStatus())) {//待收货和已完成
conds.in("o.status", new String[]{ "3", "4" });
} else {
conds.equal("o.status", consultSheet.getOrderStatus());
}
}
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
}
......@@ -373,7 +379,7 @@ public class ConsultSheetController {
conds.equal("a.open_id", consultSheet.getOpenId());
}
List<ConsultSheet> list = consultSheetService.fetchSearchByPage(conds, sort, 0, 0);
List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, 0, 0, null, consultSheet.getIsThree());
List<ConsultSheetVO> consultSheetVOS = new LinkedList<>();
ConsultSheetVO consultSheetVO = null;
StringBuffer tpl = new StringBuffer();
......@@ -412,6 +418,13 @@ public class ConsultSheetController {
@RequestMapping("/exportFromExcel")
@RequiresPermissions(value = CONSULTSHEET_VIEW)
public void exportFromExcel(HttpServletRequest request, HttpServletResponse response, ConsultSheet consultSheet) {
Long userid = UserUtils.getUser().getUserid();
boolean leader = roleService.selectRoleEntityByUserId(userid, Constants.SYSTEM_LEADER);
boolean manager = roleService.selectRoleEntityByUserId(userid, Constants.SYSTEM_STORAGEMANAGER);//订单员
if (leader || manager) {
userid = 1L;//查看全部
}
Long accountId = UserUtils.getmpaccounts(request);
Sort sort = new Sort("a.create_time", OrderType.ASC);
Conds conds = new Conds();
......@@ -426,11 +439,15 @@ public class ConsultSheetController {
if (StringUtils.equals(consultSheet.getIsThree(), "1")) {
conds.equal("m.status", "1");
}
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
}
if (StringUtils.isNoneBlank(consultSheet.getOrderStatus())) {
if (StringUtils.equals("-1", consultSheet.getOrderStatus())) {//待收货和已完成
conds.in("o.status", new String[]{ "3", "4" });
} else {
conds.equal("o.status", consultSheet.getOrderStatus());
}
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
}
if (consultSheet.getServiceId() != null) {
conds.equal("a.service_id", consultSheet.getServiceId());
......@@ -449,7 +466,7 @@ public class ConsultSheetController {
conds.equal("a.open_id", consultSheet.getOpenId());
}
List<ConsultSheet> list = consultSheetService.fetchSearchByPage(conds, sort, 0, 0);
List<ConsultSheet> list = consultSheetService.fetchSearchBy(conds, sort, 0, 0, userid, consultSheet.getIsThree());
List<ConsultSheetReportVo> consultSheetVOS = new LinkedList<>();
ConsultSheetReportVo consultSheetVO = null;
StringBuffer tpl = new StringBuffer();
......
......@@ -181,12 +181,13 @@
<select id="isThree" name="isThree" class="form-control required">
<option value="">请选择患者类型</option>
<option value="3">三期患者</option>
<option value="-1">非三期</option>
</select>
</div>
<div class="col-xs-2">
<select id="status" name="status" class="form-control required">
<option value="">请选择订单状态</option>
<option value="all">全部</option>
<option value="waitOp" selected="selected">待确认/待付款</option>
<option value="0">待确认</option>
<option value="1">待付款</option>
<option value="2">待发货</option>
......@@ -452,21 +453,18 @@
'aTargets': [0],
"mData":"id",
"mRender": function(a, b, c, d){
if ((c.status == 4 || c.status == 3 || c.status == 2) && c.confirm == null){
if ((c.status == 4 || c.status == 3 || c.status == 2) && (c.confirm == null || c.confirm == '')){
console.log(c);
//是否超过7天 0标识超过7天
//if( c.isExceedSevenDay == '0' && c.isThree != '1'){
if(isCheckedQyCode.indexOf(a+"")!=-1){
if ( c.isExceedSevenDay == '0' && c.isThree != '1') {
if (isCheckedQyCode.indexOf(a+"") != -1) {
return '<input class="isExport" checked value="'+a+'" type="checkBox">';
}else{
} else {
return '<input class="isExport" value="'+a+'" type="checkBox">';
}
//}else{
return "";
//}
}else{
return "";
}
}
return "";
}
},
{
......@@ -590,7 +588,7 @@
} else if (a == '4') {
return "<span>已完成</span>";
} else if (a == '5') {
return "<span>已取消</span>";
return "<span style='color:#FF0000'>已取消</span>";
}
}
},
......@@ -598,7 +596,11 @@
"aTargets": [11],
"mData": "confirm",
"mRender": function (a, b, c, d) {
return a == null ? '否':'是';
if (c.confirm == null || c.confirm == '') {
return '否'
} else {
return '是';
}
}
},
{
......
......@@ -74,7 +74,8 @@
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/order/list')" method="get">
<form id="seachTableForm" action="#springUrl('/a/order/exportExcel')" method="get">
<input type="text" class="form-control" name="excelName" placeholder="产品名称" value="需求清单出库">
<div class="col-xs-2">
<input type="text" class="form-control"
name="number" value="" placeholder="订单编码">
......@@ -85,13 +86,14 @@
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="productNameTmp" placeholder="产品名称">
name="courierNumber" placeholder="顺丰运单号">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="courierNumber" placeholder="顺丰运单号">
name="productNameTmp" placeholder="产品名称">
</div>
<div class="col-xs-4">
<div class="input-group date">
<div class="input-group-addon">
......@@ -105,33 +107,15 @@
<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 selected="selected" value="2">待发货</option>
<option value="3">待收货</option>
<!--<option value="4">已完成</option>-->
<!--<option value="5">已取消</option>-->
</select>
</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 class="col-xs-2">
<button type="button" class="search btn btn-primary">搜索</button>
<button type="button" class="btn btn-info" onclick="clearSearch()">重置</button>
<button type="submit" class="search btn btn-primary">导出</button>
</div>
</form>
......
......@@ -301,6 +301,7 @@
LEFT JOIN t_qyuser u ON o.service_id = u.id
<include refid="sqlWhere"/>
<if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
<if test="isThree==-1">AND (m.status IS NULL OR m.status != '1')</if>
GROUP BY o.id
<if test="orderAmount != null or payAmount != null">
HAVING 1=1
......@@ -385,6 +386,7 @@
LEFT JOIN t_qyuser u ON o.service_id = u.id
<include refid="sqlWhere"/>
<if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
<if test="isThree==-1"> AND (m.status IS NULL OR m.status != '1') </if>
GROUP BY o.id
<if test="orderAmount != null or payAmount != null">
HAVING 1=1
......
......@@ -29,9 +29,9 @@ public interface OrderService extends GenericService<Order> {
* @param userid
* @return
*/
List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid, String orderAmount, String payAmount);
List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid, String orderAmount, String payAmount, String isThree);
Integer count(Conds conds, Long userid, String orderAmount, String payAmount);
Integer count(Conds conds, Long userid, String orderAmount, String payAmount, String isThree);
List<ProductOrder> listProduct();
......
......@@ -117,7 +117,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
}
@Override
public List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid, String orderAmount, String payAmount) {
public List<Order> fetchSearchBy(Conds conds, Sort sort, int page, int pageSize, Long userid, String orderAmount, String payAmount, String isThree) {
Map<String, Object> params = new HashMap<>();
//非管理员查询所有
if (userid != null && userid != 1L) {
......@@ -133,6 +133,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
} else if (StringUtils.isNoneBlank(payAmount)) {
params.put("payAmount", payAmount);
}
if (StringUtils.equals("-1", isThree)) {
params.put("isThree", isThree);
}
params.put("conds", conds);
params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0);
......@@ -141,7 +144,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
}
@Override
public Integer count(Conds conds, Long userid, String orderAmount, String payAmount) {
public Integer count(Conds conds, Long userid, String orderAmount, String payAmount, String isThree) {
Map<String, Object> params = new HashMap<String, Object>();
//非管理员查询所有
if (userid != null && userid != 1L) {
......@@ -157,6 +160,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
} else if (StringUtils.isNoneBlank(payAmount)) {
params.put("payAmount", payAmount);
}
if (StringUtils.equals("-1", isThree)) {
params.put("isThree", isThree);
}
params.put("conds", conds);
return orderMapper.count(params);
}
......@@ -558,7 +564,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
Conds conds = new Conds();
conds.equal("o.id", invoiceDto.getId());
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
List<Order> list = this.fetchSearchBy(conds, null, 0, 0, null, null, null);
List<Order> list = this.fetchSearchBy(conds, null, 0, 0, null, null, null, null);
if (list != null && list.size() > 0) {
for (Order order : list) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
......@@ -28,11 +28,9 @@ import com.cftech.orderdetail.model.OrderSplitBatchDto;
import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.orderdetail.web.OrderDetailsController;
import com.cftech.sys.model.User;
import com.cftech.sys.model.UserRole;
import com.cftech.sys.security.UserUtils;
import com.cftech.sys.service.RoleService;
import com.cftech.sys.service.UserService;
import com.google.zxing.WriterException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -298,8 +296,8 @@ public class OrderController {
Long accountsId = UserUtils.getmpaccounts(request);
MpAccountsEntity mpAccountsEntity = accountsService.getDetail(accountsId);
boolean leader = roleService.selectRoleEntityByUserId(user.getId(), Constants.SYSTEM_LEADER);//药房主管
boolean manager = roleService.selectRoleEntityByUserId(user.getId(), Constants.SYSTEM_STORAGEMANAGER);//订单员
boolean leader = roleService.selectRoleEntityByUserId(user.getUserid(), Constants.SYSTEM_LEADER);//药房主管
boolean manager = roleService.selectRoleEntityByUserId(user.getUserid(), Constants.SYSTEM_STORAGEMANAGER);//订单员
if (leader || manager) {
userid = 1L;//药店主管
}
......@@ -328,9 +326,9 @@ public class OrderController {
conds.like("f.store", order.getFansAlias());
}
//订单状态
if (StringUtils.equals("", order.getStatus())) {
if (StringUtils.equals("waitOp", order.getStatus())) {//待确认/待付款
conds.in("o.status", new String[]{"0", "1"});
} else if (StringUtils.isNoneBlank(order.getStatus()) && !StringUtils.equals(order.getStatus(), "all")) {
} else if (StringUtils.isNoneBlank(order.getStatus())) {
conds.equal("o.status", order.getStatus());
}
//三期患者
......@@ -352,14 +350,14 @@ public class OrderController {
}
Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid, order.getStartOrderAmount(), order.getStartPayAmount());
Integer counts = orderService.count(conds, userid, order.getStartOrderAmount(), order.getStartPayAmount());
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid, order.getStartOrderAmount(), order.getStartPayAmount(), order.getIsThree());
Integer counts = orderService.count(conds, userid, order.getStartOrderAmount(), order.getStartPayAmount(), order.getIsThree());
//设置是否可以开票,拼接付款链接
Date today = new Date();
int longNum = 0;
long longNum = 0;
for (Order obj : list) {
if (obj.getPayTime() != null && StringUtils.isBlank(obj.getConfirm())) {
longNum = (int) (today.getTime() - obj.getPayTime().getTime()) / (1000 * 3600 * 24);
longNum = (today.getTime() - obj.getPayTime().getTime()) / (1000 * 3600 * 24);
if (longNum >= 7) {
obj.setIsExceedSevenDay("0");
}
......@@ -384,14 +382,14 @@ public class OrderController {
@ResponseBody
public JSONObject invoice(String id, HttpServletRequest request, String email) {
JSONObject jsonObject = new JSONObject();
Long userid = UserUtils.getUser().getUserid();
//Long userid = UserUtils.getUser().getUserid();
Long accountsId = UserUtils.getmpaccounts(request);
try {
Conds conds = new Conds();
conds.in("o.id", id.split(","));
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId);
List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid, null, null);
List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, null, null, null, null);
if (list != null && list.size() > 0) {
for (Order order : list) {
//订单为0无法开票
......@@ -403,7 +401,7 @@ public class OrderController {
order.setCreateTimeStr(format.format(order.getCreateTime()));
String str = invoiceUtil.startInvoice(order, email, "0", null, null);
JSONObject json = JSON.parseObject(str);
if (StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")) {
if (StringUtils.contains(str,"code") && StringUtils.equals("E0000", json.getString("code"))) {
//开票成功 添加一条开票记录
//流水号
String invoiceSerialNum = json.getJSONObject("result").getString("invoiceSerialNum");
......@@ -420,8 +418,7 @@ public class OrderController {
invoice.setEmail(email);
invoice.setInvoiceSerialNum(invoiceSerialNum);
invoice.setOpenId(order.getOpenid());
String userName = userService.fetchAuthById(userid).getWxUserName();
invoice.setOperator(StringUtils.isEmpty(userName) ? "admin" : userName);
invoice.setOperator(StringUtils.isBlank(UserUtils.getUser().getUsername()) ? "admin" : UserUtils.getUser().getUsername());
invoiceService.save(invoice);
//更新是否开票状态
......@@ -429,7 +426,7 @@ public class OrderController {
orderService.update(order);
} else {
jsonObject.put("errorNo", 1);
jsonObject.put("errorMsg", StringUtils.isEmpty(json.getString("describe")) ? json.getString("message") : json.getString("describe"));
jsonObject.put("errorMsg", StringUtils.isBlank(json.getString("describe"))? json.getString("message") : json.getString("describe"));
return jsonObject;
}
}
......@@ -437,6 +434,7 @@ public class OrderController {
}
} catch (Exception e) {
jsonObject.put("errorNo", 1);
jsonObject.put("errorMsg", e.getMessage());
}
return jsonObject;
}
......@@ -491,7 +489,7 @@ public class OrderController {
@RequestMapping("/exportExcel")
@RequiresPermissions(value = ORDER_VIEW)
public void exportExcel(HttpServletRequest request, HttpServletResponse response, Order order) {
public void exportExcel(HttpServletRequest request, HttpServletResponse response, Order order, String excelName) {
User user = UserUtils.getUser();
Long userid = user.getUserid();
Long accountsId = UserUtils.getmpaccounts(request);
......@@ -528,9 +526,9 @@ public class OrderController {
conds.like("f.store", order.getFansAlias());
}
//订单状态
if (StringUtils.equals("", order.getStatus())) {
if (StringUtils.equals("waitOp", order.getStatus())) {//待确认/待付款
conds.in("o.status", new String[]{"0", "1"});
} else if (StringUtils.isNoneBlank(order.getStatus()) && !StringUtils.equals(order.getStatus(), "all")) {
} else if (StringUtils.isNoneBlank(order.getStatus())) {
conds.equal("o.status", order.getStatus());
}
//三期患者
......@@ -550,7 +548,7 @@ public class OrderController {
conds.lessEqual("DATE_FORMAT(o.create_time, '%Y/%m/%d %H:%i')", dateArr[1]);
}
List<Order> list = orderService.fetchSearchBy(conds, sort, 0, 0, userid, order.getStartOrderAmount(), order.getStartPayAmount());
List<Order> list = orderService.fetchSearchBy(conds, sort, 0, 0, userid, order.getStartOrderAmount(), order.getStartPayAmount(), order.getIsThree());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
LinkedList<OrderVO> orderVOS = new LinkedList<>();
OrderVO orderVO = null;
......@@ -600,7 +598,7 @@ public class OrderController {
orderVO.setCencalTime(orderObject.getCancelTime() != null ? simpleDateFormat.format(orderObject.getCancelTime()) : "");
orderVOS.add(orderVO);
}
ExcelKit.$Export(OrderVO.class, response).toExcel(orderVOS, "订单管理信息");
ExcelKit.$Export(OrderVO.class, response).toExcel(orderVOS, StringUtils.isBlank(excelName) ? "订单管理信息": excelName);
}
@RequestMapping("/templateExcel")
......
......@@ -96,8 +96,6 @@
<td hidden="true">Id</td>
<th>处方编号</th>
<th>咨询单编号</th>
<th>医院名称</th>
<th>药店名称</th>
<th>姓名</th>
<th>手机号码</th>
<th>openId</th>
......@@ -201,6 +199,9 @@
"sAjaxSource": sSource,
"fnServerData": retrieveData,
"pagingType": "full_numbers",
"autoWidth": true,
"scrollX": true,
"sScrollY": false,
"aoColumns": [
{
"mData": "id"
......@@ -211,12 +212,6 @@
{
"mData": "consultNo"
},
{
"mData": "hospitalName"
},
{
"mData": "storeName"
},
{
"mData": "custName"
},
......@@ -252,8 +247,44 @@
'visible': false,
'targets': [0]
},
{ // set default column settings
'targets': [8],
{
"width": "120px",
"targets": [1],
"mData": "number",
},
{
"width": "110px",
"targets": [2],
"mData": "consultNo",
},
// {
// "width": "90px",
// "targets": [3],
// "mData": "hospitalName",
// },
// {
// "width": "90px",
// "targets": [4],
// "mData": "storeName",
// },
{
"width": "90px",
"targets": [3],
"mData": "custName",
},
{
"width": "100px",
"targets": [4],
"mData": "custPhone",
},
{
"width": "120px",
"targets": [5],
"mData": "openid",
},
{
"width": "90px",
'targets': [6],
"mRender": function (a, b, c, d) {
if (a == '0') {
return '审核通过';
......@@ -267,14 +298,16 @@
}
},
{
"aTargets": [9],
"width": "120px",
"aTargets": [7],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},
{
"aTargets": [10],
"width": "120px",
"aTargets": [8],
"mData": "prepayId",
"mRender": function (a, b, c, d) {
if(a != null && a != '') {
......@@ -284,8 +317,9 @@
}
}
},
{ // set default column settings
'targets': [11],
{
"width": "90px",
'targets': [9],
"mData": "payStatus",
"mRender": function (a, b, c, d) {
if (a == '0') {
......@@ -300,7 +334,8 @@
}
},
{
"aTargets": [12],
"width": "90px",
"aTargets": [10],
"mData": "payAmount",
"mRender": function (a, b, c, d) {
if (a != null && a != '' && a > 100) {
......@@ -311,7 +346,8 @@
}
},
{
"aTargets": [13],
"width": "120px",
"aTargets": [11],
"mData": "payTime",
"mRender": function (a, b, c, d) {
if (a != null) {
......@@ -322,12 +358,13 @@
}
},
{
"aTargets": [14],
"width": "80px",
"aTargets": [12],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '';
html += '<a href="#springUrl("/a/prescription/form?id=' + a + '")" class="btn green">查看</a>';
if (c.payStatus == '1' && c.description != '1') {//已支付且 单据不为待确认
if (c.payStatus == '1') {//已支付且 单据不为待确认
html += '<a onclick="refund(`' + a + '`)" class="btn green">退款</a>';
}
return html;
......
......@@ -52,4 +52,12 @@ public interface CdfortisService {
* @return
*/
String getFbusiPictureUrl(String presId) throws Exception;
/**
* 通过订单号获取视频处方详情
*
* @param orderId
* @return
*/
JSONObject findPreScriptByVideoOrderId(String orderId) throws Exception;
}
......@@ -146,4 +146,19 @@ public class CdfortisServiceImpl implements CdfortisService {
return picUrl;
}
@Override
public JSONObject findPreScriptByVideoOrderId(String orderId) throws Exception {
String getFbusiInfoByOrderIdUrl = SystemConfig.p.getProperty("cdfortis.get_video_info_by_order_id_url");
// 构建URL参数
Map<String, String> urlParam = new HashMap<>(3);
urlParam.put("appid", appid);
urlParam.put("token", cdfortisTokenUtil.getToken());
urlParam.put("orderId", orderId);
// 请求获取数据
String data = CdfortisResponseUtil.request(getFbusiInfoByOrderIdUrl, CdfortisConstant.METHOD_GET, urlParam,null, null);
if (StringUtils.isEmpty(data)) {
return null;
}
return JSONObject.parseObject(data);
}
}
......@@ -2,7 +2,6 @@ package com.cftech.cdfortis.util;
import com.alibaba.fastjson.JSONObject;
import com.cftech.cdfortis.constants.CdfortisConstant;
import com.cftech.core.util.SystemConfig;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
......@@ -41,7 +40,7 @@ public class CdfortisResponseUtil {
String codeValue = returnCode.getString(CdfortisConstant.RETURN_CODE_KEY);
if (!CdfortisConstant.RESULT_SUCC_CODE.equals(codeValue)) {
log.error(returnCode.toJSONString());
throw new Exception(returnCode.getString(CdfortisConstant.RETURN_CODE_CONTENT));
//throw new Exception(returnCode.getString(CdfortisConstant.RETURN_CODE_CONTENT));
}
}
......@@ -87,12 +86,21 @@ public class CdfortisResponseUtil {
log.debug("request result: {}", retStr);
// 转换结果
JSONObject retObj = JSONObject.parseObject(retStr);
// 接口没有数据的特殊处理(理论上没有数据应该是一个空数组,但是微问诊返回结果是错误)
if (CdfortisConstant.RESULT_NO_DATA_CODE.equals(retObj.getJSONObject(CdfortisConstant.RETURN_CODE).getString(CdfortisConstant.RETURN_CODE_KEY))) {
if (retObj == null) {
return "";
}
JSONObject returnCode = retObj.getJSONObject(CdfortisConstant.RETURN_CODE);
String codeValue = returnCode.getString(CdfortisConstant.RETURN_CODE_KEY);
if (!CdfortisConstant.RESULT_SUCC_CODE.equals(codeValue)) {
log.error(returnCode.toJSONString());
return "";
} else if (CdfortisConstant.RESULT_NO_DATA_CODE.equals(retObj.getJSONObject(CdfortisConstant.RETURN_CODE).getString(CdfortisConstant.RETURN_CODE_KEY))) {
log.error(returnCode.toJSONString());
return "";
}
// 检查结果
checkResponse(retObj);
//checkResponse(retObj);
return retObj.getString("data");
}
......
......@@ -5,6 +5,8 @@
<resultMap id="resultMap" type="com.cftech.prescription.model.Prescription">
<id column="id" property="id"/>
<result column="number" property="number"/>
<result column="type" property="type"/>
<result column="pre_id" property="preId"/>
<result column="min_program_no" property="minProgramNo"/>
<result column="store_id" property="storeId"/>
<result column="hospital_name" property="hospitalName"/>
......@@ -19,7 +21,9 @@
<result column="doctor_dpmt_name" property="doctorDpmtName"/>
<result column="doc_status" property="docStatus"/>
<result column="doc_result" property="docResult"/>
<result column="doc_picture" property="docPicture"/>
<result column="pharm_name" property="pharmName"/>
<result column="pharm_status" property="pharmStatus"/>
<result column="result" property="result"/>
<result column="guoms" property="guoms"/>
<result column="age" property="age"/>
......@@ -78,6 +82,8 @@
<sql id="sqlColumns">
id,
number,
type,
pre_id,
min_program_no,
store_id,
hospital_name,
......@@ -92,7 +98,9 @@
doctor_dpmt_name,
doc_status,
doc_result,
doc_picture,
pharm_name,
pharm_status,
result,
guoms,
age,
......@@ -123,6 +131,8 @@
<sql id="listColumns">
t.id,
t.number,
t.type,
t.pre_id,
t.min_program_no,
t.store_id,
t.hospital_name,
......@@ -137,7 +147,9 @@
t.doctor_dpmt_name,
t.doc_status,
t.doc_result,
t.doc_picture,
t.pharm_name,
t.pharm_status,
t.result,
t.guoms,
t.age,
......@@ -175,6 +187,8 @@
(
#{id, jdbcType=BIGINT},
#{number, jdbcType=VARCHAR},
#{type, jdbcType=VARCHAR},
#{preId, jdbcType=VARCHAR},
#{minProgramNo, jdbcType=VARCHAR},
#{storeId, jdbcType=VARCHAR},
#{hospitalName, jdbcType=VARCHAR},
......@@ -189,7 +203,9 @@
#{doctorDpmtName, jdbcType=VARCHAR},
#{docStatus, jdbcType=VARCHAR},
#{docResult, jdbcType=VARCHAR},
#{docPicture, jdbcType=VARCHAR},
#{pharmName, jdbcType=VARCHAR},
#{pharmStatus, jdbcType=VARCHAR},
#{result, jdbcType=VARCHAR},
#{guoms, jdbcType=VARCHAR},
#{age, jdbcType=VARCHAR},
......@@ -250,6 +266,12 @@
<if test="number != null">
number = #{number, jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type, jdbcType=VARCHAR},
</if>
<if test="preId != null">
pre_id = #{preId, jdbcType=VARCHAR},
</if>
<if test="minProgramNo != null">
min_program_no = #{minProgramNo, jdbcType=VARCHAR},
</if>
......@@ -292,9 +314,15 @@
<if test="docResult != null">
doc_result = #{docResult, jdbcType=VARCHAR},
</if>
<if test="docPicture != null">
doc_picture = #{docPicture, jdbcType=VARCHAR},
</if>
<if test="pharmName != null">
pharm_name = #{pharmName, jdbcType=VARCHAR},
</if>
<if test="pharmStatus != null">
pharm_status = #{pharmStatus, jdbcType=VARCHAR},
</if>
<if test="result != null">
result = #{result, jdbcType=VARCHAR},
</if>
......@@ -388,6 +416,12 @@
<update id="updateByNumber" parameterType="com.cftech.prescription.model.Prescription">
update t_aidea_prescription
<set>
<if test="type != null">
type = #{type, jdbcType=VARCHAR},
</if>
<if test="preId != null">
pre_id = #{preId, jdbcType=VARCHAR},
</if>
<if test="minProgramNo != null">
min_program_no = #{minProgramNo, jdbcType=VARCHAR},
</if>
......@@ -430,9 +464,15 @@
<if test="docResult != null">
doc_result = #{docResult, jdbcType=VARCHAR},
</if>
<if test="docPicture != null">
doc_picture = #{docPicture, jdbcType=VARCHAR},
</if>
<if test="pharmName != null">
pharm_name = #{pharmName, jdbcType=VARCHAR},
</if>
<if test="pharmStatus != null">
pharm_status = #{pharmStatus, jdbcType=VARCHAR},
</if>
<if test="result != null">
result = #{result, jdbcType=VARCHAR},
</if>
......
......@@ -5,6 +5,7 @@ import com.cftech.accounts.service.JobService;
import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants;
import com.cftech.core.util.SpringContextHolder;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.prescription.model.Prescription;
import com.cftech.prescription.service.PrescriptionService;
......@@ -52,17 +53,25 @@ public class SynPrescriptBillJob implements Job {
PrescriptionService prescriptionService = SpringContextHolder.getBean(PrescriptionService.class);
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.description", "1");//提交状态 为返回
//conds.equal("DATE_FORMAT(t.create_time ,'%Y-%m-%d')", DateUtils.getDate());//获取当天
conds.notEqual("t.description", "2");
List<Prescription> prescriptionList = prescriptionService.fetchSearchByPage(conds, null, 0, 0);
for (Prescription prescript: prescriptionList) {
for (Prescription prescript : prescriptionList) {
String number = prescript.getNumber();
if (StringUtils.equals(prescript.getType(), "0")) {
prescriptionService.findPreScriptionByOrderId(prescript.getNumber());
} else if (StringUtils.equals(prescript.getType(), "1")) {
prescriptionService.findPreScriptByVideoOrderId(prescript.getNumber());
}
//处理完成
Prescription prescription = new Prescription();
prescription.setNumber(number);
prescription.setDescription("2");
prescriptionService.updateByNumber(prescription);
}
} catch (Exception e) {
log.error("同步更新处方单任务执行失败,{}" + e.getMessage());
e.printStackTrace();
}
}
}
......@@ -44,14 +44,14 @@ public class SynPrescriptRefundJob implements Job {
//执行更新操作
if (context.getNextFireTime() != null) {
log.info("同步更新处方单任务:下次执行时间=====" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(context.getNextFireTime()) + "==============");
log.info("同步处方单退款任务:下次执行时间=====" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(context.getNextFireTime()) + "==============");
} else {
JobService jobService = SpringContextHolder.getBean(JobService.class);
SysJob sysJob = new SysJob();
sysJob.setJobuid(id);
sysJob.setStatus("0");
jobService.updateStatus(sysJob);
log.info("同步更新处方单任务,已执行完成!");
log.info("同步处方单退款任务,已执行完成!");
}
}
......@@ -67,7 +67,7 @@ public class SynPrescriptRefundJob implements Job {
MpAccountsEntity accountsEntity = accountsService.getMpAccountsAppid(SystemConfig.p.getProperty("WX_MP_SERVER_APPID"));
List<Prescription> prescriptionList = prescriptionService.fetchSearchByPage(conds, null, 0, 0);
for (Prescription prescript: prescriptionList) {
if (StringUtils.equals(prescript.getDocStatus(), "0")) {//单据已审核通过
if (StringUtils.equals(prescript.getDocStatus(), "0") || StringUtils.isNotBlank(prescript.getPresUrl())) {//单据已审核通过
continue;
}
......
......@@ -21,6 +21,11 @@ public class Prescription implements Serializable {
/* 编码 */
@ExportConfig(value = "编码", width = 100, showLevel = 1)
private String number;
/* 处方开取类型 0:图文处方 1:视频处方 */
private String type;
/* 处方开取类型 0:对应小程序处方唯一编号 */
private String preId;
/* openid */
@ExportConfig(value = "人员openid", width = 100, showLevel = 1)
private String openid;
......@@ -66,6 +71,9 @@ public class Prescription implements Serializable {
/* 医生审核不通过理由 */
@ExportConfig(value = "医生审核不通过理由", width = 100, showLevel = 1)
private String docResult;
/* 医生签名 */
private String docPicture;
/* 此处方被审核后审方药师名 */
@ExportConfig(value = "此处方被审核后审方药师名", width = 100, showLevel = 1)
private String pharmName;
......@@ -87,7 +95,7 @@ public class Prescription implements Serializable {
private Long accountsId;
/* 删除标识 */
private boolean delFlag;
/* 状态 */
/* 状态 0-未审核 1-通过 2-不通过 */
private String status;
/* 创建时间 */
private Date createTime;
......@@ -130,15 +138,15 @@ public class Prescription implements Serializable {
public Prescription() {
this.delFlag = false;
this.status = "0";
}
@Override
public String toString() {
return "Prescription{" +
"id=" + id +
", number='" + number + '\'' +
", type='" + type + '\'' +
", preId='" + preId + '\'' +
", openid='" + openid + '\'' +
", minProgramNo='" + minProgramNo + '\'' +
", storeId='" + storeId + '\'' +
......@@ -154,6 +162,7 @@ public class Prescription implements Serializable {
", doctorDpmtName='" + doctorDpmtName + '\'' +
", docStatus='" + docStatus + '\'' +
", docResult='" + docResult + '\'' +
", docPicture='" + docPicture + '\'' +
", pharmName='" + pharmName + '\'' +
", pharmStatus='" + pharmStatus + '\'' +
", result='" + result + '\'' +
......@@ -172,8 +181,14 @@ public class Prescription implements Serializable {
", tradeNo='" + tradeNo + '\'' +
", payStatus='" + payStatus + '\'' +
", payAmount=" + payAmount +
", cashFee=" + cashFee +
", payTime=" + payTime +
", payRemark='" + payRemark + '\'' +
", refundId='" + refundId + '\'' +
", refundNo='" + refundNo + '\'' +
", refundCaseFee=" + refundCaseFee +
", refundTime=" + refundTime +
", refundRemark='" + refundRemark + '\'' +
", consultNo='" + consultNo + '\'' +
'}';
}
......
......@@ -29,7 +29,7 @@ public interface PrescriptionService extends GenericService<Prescription> {
* @param number
* @return
*/
JSONObject updatePrescription(String appId, String openId, String number);
JSONObject updatePrescription(String appId, String openId, String number, String type);
/**
* 获取处方单列表(从距今日7天内的数据)
......@@ -75,6 +75,14 @@ public interface PrescriptionService extends GenericService<Prescription> {
*/
Prescription findPreScriptionByOrderId(String orderId) throws Exception;
/**
* 通过处方单编码获取视频问诊结果
* @param orderId
* @return
* @throws Exception
*/
Prescription findPreScriptByVideoOrderId(String orderId) throws Exception;
/**
* 退款
* @param id
......@@ -89,4 +97,6 @@ public interface PrescriptionService extends GenericService<Prescription> {
* @return
*/
JSONObject findPrescriptDetail(String appId, String openId);
int updateByNumber(Prescription prescription);
}
......@@ -192,17 +192,18 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
}
@Override
public JSONObject updatePrescription(String appId, String openId, String number) {
public JSONObject updatePrescription(String appId, String openId, String number, String type) {
JSONObject retObj = new JSONObject();
try {
//获取当前用户当天开取的处方单
Conds conds = new Conds();
conds.equal("t.description", "0");
conds.in("t.description", new String[] {"0", "1"});
conds.equal("t.number", number);
conds.equal("t.openid", openId);
Prescription prescription = this.fetchSearchByConds(conds);
if (prescription != null) {
prescription.setDescription("1");
prescription.setType(type);
this.update(prescription);
retObj.put("errorNo", 0);
return retObj;
......@@ -237,8 +238,17 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
if ("2".equals(prescription.getDescription()) && "0".equals(prescription.getDocStatus())) {
retObj.put("errorNo", 0);
retObj.put("data", prescription);
} else {
return retObj;
} else if ("2".equals(prescription.getDescription()) && StringUtils.equals("1", prescription.getType()) && StringUtils.isNotBlank(prescription.getPresUrl())) {
retObj.put("errorNo", 0);
retObj.put("data", prescription);
return retObj;
} else if (StringUtils.equals("0", prescription.getType())) {//获取图文处方
prescription = this.findPreScriptionByOrderId(prescription.getNumber());
} else if (StringUtils.equals("1", prescription.getType())) {//获取视频处方
prescription = this.findPreScriptByVideoOrderId(prescription.getNumber());
}
if (prescription == null) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "暂无单据");
......@@ -246,7 +256,6 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
retObj.put("errorNo", 0);
retObj.put("data", prescription);
}
}
} catch (Exception e) {
retObj.put("errorNo", 1);
e.printStackTrace();
......@@ -258,21 +267,22 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
public JSONObject findPrescriptDetail(String appId, String openId) {
JSONObject retObj = new JSONObject();
try {
//获取最新处方单数据
//获取已开具成功的图文处方
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.openid", openId);
conds.equal("t.description", "2");//已获取返回结果
conds.equal("t.doc_status", "0");//医生已审批
conds.notNull("t.pres_url");
Sort sort = new Sort("t.create_time", OrderType.DESC);
List<Prescription> list = this.fetchSearchByPage(conds, sort, 0, 0);
if (CollectionUtils.isEmpty(list)) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "处方暂未开具");
return retObj;
}
if (!CollectionUtils.isEmpty(list)) {
retObj.put("errorNo", 0);
retObj.put("data", list.get(0));
return retObj;
}
retObj.put("errorNo", 1);
retObj.put("errorMsg", "处方单暂未开具!");
} catch (Exception e) {
retObj.put("errorNo", 1);
e.printStackTrace();
......@@ -280,6 +290,11 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
return retObj;
}
@Override
public int updateByNumber(Prescription prescription) {
return prescriptionMapper.updateByNumber(prescription);
}
@Override
public List<Prescription> findPreScriptionList(int iDisplayStart, int iDisplayLength) throws Exception {
return findPreScriptionList(iDisplayStart, iDisplayLength, null, null);
......@@ -357,6 +372,50 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
return prescription;
}
/**
* 通过 number/orderId 获取视频处方详情
* @param orderId
* @return
*/
public Prescription findPreScriptByVideoOrderId(String orderId) throws Exception {
JSONObject obj = cdfortisService.findPreScriptByVideoOrderId(orderId);
if (obj == null) {
return null;
}
Prescription prescription = new Prescription();
prescription.setNumber(orderId);
prescription.setDescription("2");
prescription.setPreId(obj.getString("presId"));
prescription.setStoreId(obj.getString("storeId"));
prescription.setDoctorDpmtName(obj.getString("pharAcct"));//开方的医生账号
prescription.setDoctorName(obj.getString("pharName"));
prescription.setDocPicture(obj.getString("docPicture"));//医生签名图片
prescription.setDocResult(obj.getString("pharmAdvice"));//医生建议
prescription.setCustName(obj.getString("custName"));
prescription.setCustSex(obj.getString("custSex"));
prescription.setAge(obj.getString("custAge"));
prescription.setWeight(obj.getString("weight"));
prescription.setCustPhone(obj.getString("custPhone"));
prescription.setSymptom(obj.getString("syptom"));
prescription.setSyptmFlag(obj.getString("syptmFlag"));
prescription.setPresUrl(obj.getString("picPath"));
prescription.setPharmName(obj.getString("auditPharName"));
if (StringUtils.equals(obj.getString("status"), "B00120000")) {
prescription.setStatus("0");
} else if (StringUtils.equals(obj.getString("status"), "B00120001")) {
prescription.setStatus("1");
} else if (StringUtils.equals(obj.getString("status"), "B00120002")) {
prescription.setStatus("2");
}
prescriptionMapper.updateByNumber(prescription);
return prescription;
}
/**
* 通过number/orderId获取详情
......@@ -374,10 +433,6 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
//@NotNull
private Prescription handlePrescription(FbusiDetail fbusiDetail, String number) throws Exception {
if (fbusiDetail == null) {
Prescription prescription = new Prescription();
prescription.setNumber(number);//通过编码更新
prescription.setDescription("2");//已返回
prescriptionMapper.updateByNumber(prescription);
return null;
}
//更新
......
package com.cftech.prescription.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.cdfortis.service.CdfortisService;
import com.cftech.prescription.service.PrescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
......@@ -14,8 +15,11 @@ public class MobilePrecriptionController {
@Autowired
private PrescriptionService prescriptionService;
@Autowired
private CdfortisService cdfortisService;
/**
* 生成处方单编码
* 生成临时处方单
* @param appId
* @param openId
* @return
......@@ -51,7 +55,7 @@ public class MobilePrecriptionController {
}
/**
* 更新处方单
* 更新处方单为提交状态且更新处方类型
* @param appId
* @param openId
* @param number
......@@ -60,7 +64,9 @@ public class MobilePrecriptionController {
@RequestMapping(value = "updatePrescription", method = { RequestMethod.POST }, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject updatePrescription(@RequestParam String appId,
@RequestParam String openId,
@RequestParam String number) {
return prescriptionService.updatePrescription(appId, openId, number);
@RequestParam String number,
@RequestParam String type) {
return prescriptionService.updatePrescription(appId, openId, number, type);
}
}
......@@ -238,17 +238,6 @@
'visible': false,
'targets': [0]
},
{
"aTargets": [3],
"mData": "isThree",
"mRender": function (a, b, c, d) {
if(a == '1'){
return "三期";
}else {
return "";
}
}
},
{
"aTargets": [8],
"mData": "outStoreDate",
......
......@@ -137,9 +137,7 @@
<div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:report:edit"))
<button type="submit" class="btn btn-primary">导出</button>
#end
</div>
</form>
</div><!-- /.box-header -->
......@@ -323,7 +321,6 @@
'visible': false,
'targets': [0]
},
{
"aTargets": [16],
"mData": "fkTime",
......
......@@ -184,20 +184,61 @@
</select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_report
SELECT COUNT(1) FROM t_order ord
LEFT JOIN t_order_details detail ON ord.id = detail.order_id
LEFT JOIN t_aidea_product product ON product.id = detail.drugs_id AND product.del_flag = 0
LEFT JOIN t_aidea_consult_sheet consult ON ord.id = consult.order_id
LEFT JOIN wx_mp_member memb ON memb.open_id = consult.open_id AND memb.del_flag = 0
LEFT JOIN t_aidea_waybill waybill ON waybill.order_id = ord.id
LEFT JOIN t_aidea_report report ON report.order_number = ord.number
LEFT JOIN t_orgunit org ON org.id = memb.storeid AND org.del_flag = 0
<include refid="sqlWhere"/>
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
<select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.report.model.Report">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_report
ord.id id,
report.region region,
report.province province,
report.city city,
(SELECT org.org_name FROM t_behavior_qrcode_record record INNER JOIN t_shop_wxqrcode shop ON record.ticket = shop.ticket INNER JOIN t_orgunit org ON org.id = shop.bind_id WHERE record.openid = ord.openid AND org.del_flag = 0 AND record.del_flag = 0 AND shop.del_flag = 0 AND shop.type = 4 ORDER BY record.create_time DESC LIMIT 1) hospital,
(SELECT qyuser.name FROM t_behavior_qrcode_record record INNER JOIN t_shop_wxqrcode shop ON record.ticket = shop.ticket INNER JOIN t_orgunit org ON org.id = shop.bind_id INNER JOIN t_qyuser qyuser ON qyuser.org_id = shop.bind_id WHERE record.openid = ord.openid AND org.del_flag = 0 AND record.del_flag = 0 AND shop.del_flag = 0 AND shop.type = 4 AND qyuser.user_type = '5' AND qyuser.del_flag = 0 ORDER BY record.create_time DESC LIMIT 1) salesRepresent,
org.org_name department,
consult.allergy cfHospital,
consult.past_records cfDoctor,
consult.consult_id consultNumber,
ord.number orderNumber,
CONVERT ( AES_DECRYPT( consult.user_name, 'aideakey' ) USING UTF8 ) userName,
CONVERT ( AES_DECRYPT( consult.phone, 'aideakey' ) USING UTF8 ) phone,
CASE WHEN memb.status = '1' THEN '三期' ELSE '' END isThree,
product.common_name productName,
detail.drugs_num drugsNum,
ord.pay_time fkTime,
waybill.send_express_date fhTime,
waybill.accept_express_date sjTime
FROM
t_order ord
LEFT JOIN t_order_details detail ON ord.id = detail.order_id
LEFT JOIN t_aidea_product product ON product.id = detail.drugs_id AND product.del_flag = 0
LEFT JOIN t_aidea_consult_sheet consult ON ord.id = consult.order_id
LEFT JOIN wx_mp_member memb ON memb.open_id = consult.open_id AND memb.del_flag = 0
LEFT JOIN t_aidea_waybill waybill ON waybill.order_id = ord.id
LEFT JOIN t_aidea_report report ON report.order_number = ord.number
LEFT JOIN t_orgunit org ON org.id = memb.storeid AND org.del_flag = 0
<include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
<!-- <select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">-->
<!-- SELECT-->
<!-- <include refid="sqlColumns"/>-->
<!-- FROM t_aidea_report-->
<!-- <include refid="sqlWhere"/>-->
<!-- <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>-->
<!-- <if test="limit>0">limit #{offset},#{limit}</if>-->
<!-- </select>-->
<update id="update" parameterType="com.cftech.report.model.Report">
update t_aidea_report
<set>
......@@ -383,7 +424,7 @@
sb.drugs_num drugNum,
sb.drugs_batchno drugBatchNo,
w.create_time outStoreDate,
CASE WHEN m.status = '1' THEN '是' ELSE '否' END isThree
CASE WHEN m.status = '1' THEN '三期' ELSE '' END isThree
FROM t_order_split_batch sb
LEFT JOIN t_order o ON sb.order_id = o.id AND o.del_flag = '0'
LEFT JOIN t_aidea_consult_sheet cs ON cs.order_id = o.id AND cs.del_flag = '0'
......
......@@ -20,7 +20,6 @@ import com.cftech.report.model.ReportCode;
import com.cftech.report.model.ReportDoctorInfo;
import com.cftech.report.model.ReportPeopleInfo;
import com.cftech.report.service.ReportService;
import com.cftech.shop.qrcode.model.QyUser;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDataMap;
......@@ -45,7 +44,8 @@ public class ReportJob implements Job {
private static String REGION_LONG_ID = SystemConfig.p.getProperty("REGION_LONG_ID");
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {boolean isCluster = Boolean.valueOf(SystemConfig.p.getProperty("quartz.isCluster"));
public void execute(JobExecutionContext context) throws JobExecutionException {
boolean isCluster = Boolean.valueOf(SystemConfig.p.getProperty("quartz.isCluster"));
if (!isCluster) {
return;
}
......@@ -179,9 +179,6 @@ public class ReportJob implements Job {
report.setSalesRepresent(sb.toString());
}
break;
// case 8://科室
// report.setDepartment(item.getOrgName());
// break;
}
});
}
......
......@@ -103,44 +103,43 @@ public class ReportController {
public JSONObject listData(int iDisplayStart, int iDisplayLength, Report report, HttpServletRequest request,String startPayTime,String endPayTime) {
Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
//conds.equal("accounts_id", accountsId);
Sort sort = new Sort("order_number", OrderType.DESC);
conds.equal("ord.del_flag", Constants.DEL_FLAG_0);
Sort sort = new Sort("ord.create_time", OrderType.DESC);
if(!StringUtils.isEmpty(report.getRegion())){
conds.like("region",report.getRegion());
conds.like("report.region",report.getRegion());
}
if(!StringUtils.isEmpty(report.getProvince())){
conds.like("province",report.getProvince());
conds.like("report.province",report.getProvince());
}
if(!StringUtils.isEmpty(report.getCity())){
conds.like("city",report.getCity());
conds.like("report.city",report.getCity());
}
if(!StringUtils.isEmpty(report.getHospital())){
conds.like("hospital",report.getHospital());
conds.like("consult.allergy",report.getHospital());
}
if(!StringUtils.isEmpty(report.getDoctorName())){
conds.like("doctor_name",report.getDoctorName());
conds.like("consult.past_records",report.getDoctorName());
}
if(!StringUtils.isEmpty(report.getPhone())){
conds.like("phone",report.getPhone());
conds.like(" CONVERT ( AES_DECRYPT( consult.phone, 'aideakey' ) USING UTF8 ) ",report.getPhone());
}
if(!StringUtils.isEmpty(report.getDrugsNum())){
conds.equal("drugs_num",report.getDrugsNum());
conds.equal("detail.drugs_num",report.getDrugsNum());
}
if(!StringUtils.isEmpty(startPayTime)){
conds.greatEqual("DATE_FORMAT(fk_time,'%Y-%m-%d')",startPayTime);
conds.greatEqual("DATE_FORMAT(waybill.fk_time,'%Y-%m-%d')",startPayTime);
}
if(!StringUtils.isEmpty(endPayTime)){
conds.lessEqual("DATE_FORMAT(fk_time,'%Y-%m-%d')",endPayTime);
conds.lessEqual("DATE_FORMAT(waybill.fk_time,'%Y-%m-%d')",endPayTime);
}
......@@ -169,46 +168,45 @@ public class ReportController {
}
@RequestMapping("/exportExcel")
@RequiresPermissions(value = REPORT_VIEW)
public void exportExcel(Report report, HttpServletRequest request,String startPayTime,String endPayTime, HttpServletResponse response) {
Long accountId = UserUtils.getmpaccounts(request);
Sort sort = new Sort("create_time", OrderType.ASC);
Sort sort = new Sort("ord.create_time", OrderType.ASC);
Conds conds = new Conds();
conds.equal("del_flag", 0);
conds.equal("ord.del_flag", 0);
if(!StringUtils.isEmpty(report.getRegion())){
conds.like("region",report.getRegion());
conds.like("report.region",report.getRegion());
}
if(!StringUtils.isEmpty(report.getProvince())){
conds.like("province",report.getProvince());
conds.like("report.province",report.getProvince());
}
if(!StringUtils.isEmpty(report.getCity())){
conds.like("city",report.getCity());
conds.like("report.city",report.getCity());
}
if(!StringUtils.isEmpty(report.getHospital())){
conds.like("hospital",report.getHospital());
conds.like("consult.allergy",report.getHospital());
}
if(!StringUtils.isEmpty(report.getDoctorName())){
conds.like("doctor_name",report.getDoctorName());
conds.like("consult.past_records",report.getDoctorName());
}
if(!StringUtils.isEmpty(report.getPhone())){
conds.like("phone",report.getPhone());
conds.like(" CONVERT ( AES_DECRYPT( consult.phone, 'aideakey' ) USING UTF8 ) ",report.getPhone());
}
if(!StringUtils.isEmpty(report.getDrugsNum())){
conds.equal("drugs_num",report.getDrugsNum());
conds.equal("detail.drugs_num",report.getDrugsNum());
}
if(!StringUtils.isEmpty(startPayTime)){
conds.greatEqual("DATE_FORMAT(fk_time,'%Y-%m-%d')",startPayTime);
conds.greatEqual("DATE_FORMAT(waybill.fk_time,'%Y-%m-%d')",startPayTime);
}
if(!StringUtils.isEmpty(endPayTime)){
conds.lessEqual("DATE_FORMAT(fk_time,'%Y-%m-%d')",endPayTime);
conds.lessEqual("DATE_FORMAT(waybill.fk_time,'%Y-%m-%d')",endPayTime);
}
List<Report> list = reportService.fetchSearchByPage(conds, sort, 0, 0);
ExcelKit.$Export(Report.class, response).toExcel(list, "报表信息信息");
......
......@@ -28,7 +28,7 @@
<bean id="convertPwdPropertyConfigurer" class="com.cftech.core.util.ConvertPwdPropertyConfigurer">
<property name="locations">
<list>
<value>classpath*:application-test.properties</value>
<value>classpath*:application.properties</value>
</list>
</property>
</bean>
......
......@@ -36,9 +36,9 @@ QY_SEND_APPID=350
#\u4F01\u4E1A\u53F7\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863
QY_CHAT_WORK=351
#\u63A8\u9001\u5BA2\u670D\u6D88\u606F\u6DFB\u52A0\u7528\u6237
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}\uFF0C\u60A3\u8005\u7C7B\u578B\uFF1A{PATIENTTYPE}
#\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{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}
QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}\uFF0C\u60A3\u8005\u7C7B\u578B\uFF1A{PATIENTTYPE}
#\u63A8\u9001\u8BA2\u5355\u5458\u53D1\u8D27\u6D88\u606F
QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801:
#\u63A8\u9001\u5BA2\u670D\u8DDF\u8FDB\u63D0\u9192\u6D88\u606F
......@@ -108,7 +108,7 @@ APP_SECRET=SD25624CC1DF4AB7
KAIHUHANG_ADDRESS=\u6C5F\u82CF\u94F6\u884C\u626C\u5DDE\u5510\u57CE\u652F\u884C 90160188000128434
CLERK=\u5415\u5029
CHECKER=\u7530\u59DD
PAYEE=\u6C6A\u8A00\u52C7
PAYEE=\u7530\u59DD
#\u5F00\u53D1\u7968\u63A5\u53E3
INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew
#\u67E5\u8BE2\u53D1\u7968\u63A5\u53E3
......@@ -172,5 +172,7 @@ cdfortis.get_fbusi_pic_url=https://api.cdfortis.com/api/fbusi/getFbusiPicture
cdfortis.get_fbusi_info_url=https://api.cdfortis.com/api/fbusi/getFbusiInfo
#\u5FAE\u95EE\u8BCA\u901A\u8FC7\u8BA2\u5355\u53F7\u56FE\u6587\u5904\u65B9\u8BE6\u60C5
cdfortis.get_fbusi_info_by_order_id_url=https://api.cdfortis.com/api/fbusi/getFbusiInfoByOrderId
#\u5FAE\u95EE\u8BCA\u901A\u8FC7\u8BA2\u5355\u53F7\u83B7\u53D6\u89C6\u9891\u5904\u65B9\u8BE6\u60C5
cdfortis.get_video_info_by_order_id_url=https://api.cdfortis.com/api/pres/getWxPresInfo
#\u5FAE\u95EE\u8BCA\u95E8\u5E97\u7F16\u7801
cdfortis.store_no=wxc43bd62c1
......@@ -36,9 +36,9 @@ QY_SEND_APPID=350
#\u4F01\u4E1A\u53F7\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863
QY_CHAT_WORK=351
#\u63A8\u9001\u5BA2\u670D\u6D88\u606F\u6DFB\u52A0\u7528\u6237
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}\uFF0C\u60A3\u8005\u7C7B\u578B\uFF1A{PATIENTTYPE}
#\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{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}
QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}\uFF0C\u60A3\u8005\u7C7B\u578B\uFF1A{PATIENTTYPE}
#\u63A8\u9001\u8BA2\u5355\u5458\u53D1\u8D27\u6D88\u606F
QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801:
#\u63A8\u9001\u5BA2\u670D\u8DDF\u8FDB\u63D0\u9192\u6D88\u606F
......@@ -109,7 +109,7 @@ APP_SECRET=7625624CC1DF4AB7
KAIHUHANG_ADDRESS=\u6C5F\u82CF\u94F6\u884C\u626C\u5DDE\u5510\u57CE\u652F\u884C 90160188000128434
CLERK=\u5415\u5029
CHECKER=\u7530\u59DD
PAYEE=\u6C6A\u8A00\u52C7
PAYEE=\u7530\u59DD
#\u5F00\u53D1\u7968\u63A5\u53E3
INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew
#\u67E5\u8BE2\u53D1\u7968\u63A5\u53E3
......@@ -171,5 +171,7 @@ cdfortis.get_fbusi_pic_url=https://api.cdfortis.com/api/fbusi/getFbusiPicture
cdfortis.get_fbusi_info_url=https://api.cdfortis.com/api/fbusi/getFbusiInfo
#\u5FAE\u95EE\u8BCA\u901A\u8FC7\u8BA2\u5355\u53F7\u56FE\u6587\u5904\u65B9\u8BE6\u60C5
cdfortis.get_fbusi_info_by_order_id_url=https://api.cdfortis.com/api/fbusi/getFbusiInfoByOrderId
#\u5FAE\u95EE\u8BCA\u901A\u8FC7\u8BA2\u5355\u53F7\u83B7\u53D6\u89C6\u9891\u5904\u65B9\u8BE6\u60C5
cdfortis.get_video_info_by_order_id_url=https://api.cdfortis.com/api/pres/getWxPresInfo
#\u5FAE\u95EE\u8BCA\u95E8\u5E97\u7F16\u7801
cdfortis.store_no=wxc43bd62c1
\ No newline at end of file
......@@ -14,10 +14,10 @@ public class SystemConfig {
try {
// inputStream = SystemConfig.class.newInstance().getClass()
// .getClassLoader().getResourceAsStream("");
p.load(new InputStreamReader(SystemConfig.class.getClassLoader().getResourceAsStream("/common-test.properties"), "utf-8"));
p.load(new InputStreamReader(SystemConfig.class.getClassLoader().getResourceAsStream("/common.properties"), "utf-8"));
inputStreamRedis = SystemConfig.class.newInstance().getClass()
.getClassLoader().getResourceAsStream("/redis-config-test.properties");
.getClassLoader().getResourceAsStream("/redis-config.properties");
r.load(inputStreamRedis);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -206,12 +206,12 @@
member.id,
member.number,
member.name,
CONVERT(AES_DECRYPT(member.phone,'aideakey') USING UTF8) member.phone,
CONVERT(AES_DECRYPT(member.phone,'aideakey') USING UTF8) phone,
member.imageurl,
member.member_id,
member.accounts_id,
member.del_flag,
member. STATUS,
member.status,
member.create_time,
member.update_time,
member.description,
......
......@@ -239,7 +239,7 @@ public class MemberController {
Long accountsId = UserUtils.getmpaccounts(request);
User user = UserUtils.getUser();
//是否拥有药店主管角色 sys:leaders
boolean leader = roleService.selectRoleEntityByUserId(user.getId(), Constants.SYSTEM_LEADER);
boolean leader = roleService.selectRoleEntityByUserId(user.getUserid(), Constants.SYSTEM_LEADER);
Conds conds = new Conds();
conds.equal("m.del_flag", Constants.DEL_FLAG_0);
......@@ -429,7 +429,7 @@ public class MemberController {
conds.equal("m.del_flag", Constants.DEL_FLAG_0);
//是否拥有药店主管角色 sys:leaders
boolean leader = roleService.selectRoleEntityByUserId(user.getId(), Constants.SYSTEM_LEADER);
boolean leader = roleService.selectRoleEntityByUserId(user.getUserid(), Constants.SYSTEM_LEADER);
//权限控制
if (user.getId() != 1 && !leader) {
//获取当前人对应的审核部门
......@@ -513,7 +513,7 @@ public class MemberController {
conds.equal("m.del_flag", Constants.DEL_FLAG_0);
//是否拥有药店主管角色 sys:leaders
boolean leader = roleService.selectRoleEntityByUserId(user.getId(), Constants.SYSTEM_LEADER);
boolean leader = roleService.selectRoleEntityByUserId(user.getUserid(), Constants.SYSTEM_LEADER);
//权限控制
if (user.getId() != 1 && !leader) {
//获取当前人对应的审核部门
......
......@@ -73,8 +73,12 @@ public class AddressController {
if (StringUtils.isNotBlank(address.getPhone()) && address.getPhone().length() == 11) {
address.setPhone(address.getPhone().substring(0, 3) + "****" + address.getPhone().substring(7, address.getPhone().length()));
}
if (StringUtils.isNotBlank(address.getAddress()) && address.getAddress().length() >= 5) {
address.setAddress("****" + address.getAddress().substring(4, address.getAddress().length()));
if (StringUtils.isNotBlank(address.getAddress())) {
String adsStr = "";
for (int i=0; i<address.getAddress().length(); i++) {
adsStr += "*";
}
address.setAddress(adsStr);
}
model.addAttribute("data", address);
}
......
......@@ -349,7 +349,8 @@
COUNT(1)
FROM role r
INNER JOIN user_role ur ON r.id = ur.role_id
WHERE r.delflag = 0 AND user_id = #{userId, jdbcType=BIGINT} AND role_sign = #{roleSign, jdbcType=VARCHAR}
INNER JOIN user usr ON ur.user_id = usr.id
WHERE r.delflag = 0 AND usr.userid = #{userId, jdbcType=BIGINT} AND role_sign = #{roleSign, jdbcType=VARCHAR}
</select>
<!--<select id="getRoleByIds" resultMap="BaseResultMap" parameterType="string">-->
......
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