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

fix:报表修改

parent 04109897
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
<div class="col-xs-2"> <div class="col-xs-2">
<select id="status" name="status" class="form-control required"> <select id="status" name="status" class="form-control required">
<option value="">请选择订单状态</option> <option value="">请选择订单状态</option>
<option value="all">全部</option> <option value="waitOp" selected="selected">待确认/待付款</option>
<option value="0">待确认</option> <option value="0">待确认</option>
<option value="1">待付款</option> <option value="1">待付款</option>
<option value="2">待发货</option> <option value="2">待发货</option>
...@@ -452,21 +452,18 @@ ...@@ -452,21 +452,18 @@
'aTargets': [0], 'aTargets': [0],
"mData":"id", "mData":"id",
"mRender": function(a, b, c, d){ "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天 //是否超过7天 0标识超过7天
//if( c.isExceedSevenDay == '0' && c.isThree != '1'){ if ( c.isExceedSevenDay == '0' && c.isThree != '1') {
if(isCheckedQyCode.indexOf(a+"")!=-1){ if (isCheckedQyCode.indexOf(a+"") != -1) {
return '<input class="isExport" checked value="'+a+'" type="checkBox">'; return '<input class="isExport" checked value="'+a+'" type="checkBox">';
}else{ } else {
return '<input class="isExport" value="'+a+'" type="checkBox">'; return '<input class="isExport" value="'+a+'" type="checkBox">';
} }
//}else{ }
return "";
//}
}else{
return "";
} }
return "";
} }
}, },
{ {
...@@ -598,7 +595,11 @@ ...@@ -598,7 +595,11 @@
"aTargets": [11], "aTargets": [11],
"mData": "confirm", "mData": "confirm",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a == null ? '否':'是'; if (c.confirm == null || c.confirm == '') {
return '否'
} else {
return '是';
}
} }
}, },
{ {
......
...@@ -282,9 +282,9 @@ public class OrderController { ...@@ -282,9 +282,9 @@ public class OrderController {
conds.like("f.store", order.getFansAlias()); 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"}); 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()); conds.equal("o.status", order.getStatus());
} }
//三期患者 //三期患者
...@@ -310,10 +310,10 @@ public class OrderController { ...@@ -310,10 +310,10 @@ public class OrderController {
Integer counts = orderService.count(conds, userid, order.getStartOrderAmount(), order.getStartPayAmount()); Integer counts = orderService.count(conds, userid, order.getStartOrderAmount(), order.getStartPayAmount());
//设置是否可以开票,拼接付款链接 //设置是否可以开票,拼接付款链接
Date today = new Date(); Date today = new Date();
int longNum = 0; long longNum = 0;
for (Order obj : list) { for (Order obj : list) {
if (obj.getPayTime() != null && StringUtils.isBlank(obj.getConfirm())) { 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) { if (longNum >= 7) {
obj.setIsExceedSevenDay("0"); obj.setIsExceedSevenDay("0");
} }
...@@ -332,6 +332,10 @@ public class OrderController { ...@@ -332,6 +332,10 @@ public class OrderController {
return rtnJson; return rtnJson;
} }
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm");
}
//开发票 //开发票
@RequiresPermissions(value = ORDER_EDIT) @RequiresPermissions(value = ORDER_EDIT)
@RequestMapping("/invoice") @RequestMapping("/invoice")
...@@ -345,7 +349,7 @@ public class OrderController { ...@@ -345,7 +349,7 @@ public class OrderController {
conds.in("o.id", id.split(",")); conds.in("o.id", id.split(","));
conds.equal("o.del_flag", Constants.DEL_FLAG_0); conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId); conds.equal("o.accounts_id", accountsId);
List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid, null, null); List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, null, null, null);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (Order order : list) { for (Order order : list) {
//订单为0无法开票 //订单为0无法开票
......
...@@ -96,8 +96,6 @@ ...@@ -96,8 +96,6 @@
<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>openId</th> <th>openId</th>
...@@ -201,6 +199,9 @@ ...@@ -201,6 +199,9 @@
"sAjaxSource": sSource, "sAjaxSource": sSource,
"fnServerData": retrieveData, "fnServerData": retrieveData,
"pagingType": "full_numbers", "pagingType": "full_numbers",
"autoWidth": true,
"scrollX": true,
"sScrollY": false,
"aoColumns": [ "aoColumns": [
{ {
"mData": "id" "mData": "id"
...@@ -211,12 +212,6 @@ ...@@ -211,12 +212,6 @@
{ {
"mData": "consultNo" "mData": "consultNo"
}, },
{
"mData": "hospitalName"
},
{
"mData": "storeName"
},
{ {
"mData": "custName" "mData": "custName"
}, },
...@@ -252,8 +247,44 @@ ...@@ -252,8 +247,44 @@
'visible': false, 'visible': false,
'targets': [0] '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) { "mRender": function (a, b, c, d) {
if (a == '0') { if (a == '0') {
return '审核通过'; return '审核通过';
...@@ -267,14 +298,16 @@ ...@@ -267,14 +298,16 @@
} }
}, },
{ {
"aTargets": [9], "width": "120px",
"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");
} }
}, },
{ {
"aTargets": [10], "width": "120px",
"aTargets": [8],
"mData": "prepayId", "mData": "prepayId",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if(a != null && a != '') { if(a != null && a != '') {
...@@ -284,8 +317,9 @@ ...@@ -284,8 +317,9 @@
} }
} }
}, },
{ // set default column settings {
'targets': [11], "width": "90px",
'targets': [9],
"mData": "payStatus", "mData": "payStatus",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == '0') { if (a == '0') {
...@@ -300,7 +334,8 @@ ...@@ -300,7 +334,8 @@
} }
}, },
{ {
"aTargets": [12], "width": "90px",
"aTargets": [10],
"mData": "payAmount", "mData": "payAmount",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a != null && a != '' && a > 100) { if (a != null && a != '' && a > 100) {
...@@ -311,7 +346,8 @@ ...@@ -311,7 +346,8 @@
} }
}, },
{ {
"aTargets": [13], "width": "120px",
"aTargets": [11],
"mData": "payTime", "mData": "payTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a != null) { if (a != null) {
...@@ -322,12 +358,13 @@ ...@@ -322,12 +358,13 @@
} }
}, },
{ {
"aTargets": [14], "width": "80px",
"aTargets": [12],
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
var html = ''; var html = '';
html += '<a href="#springUrl("/a/prescription/form?id=' + a + '")" class="btn green">查看</a>'; 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>'; html += '<a onclick="refund(`' + a + '`)" class="btn green">退款</a>';
} }
return html; return html;
......
...@@ -52,4 +52,12 @@ public interface CdfortisService { ...@@ -52,4 +52,12 @@ public interface CdfortisService {
* @return * @return
*/ */
String getFbusiPictureUrl(String presId) throws Exception; String getFbusiPictureUrl(String presId) throws Exception;
/**
* 通过订单号获取视频处方详情
*
* @param orderId
* @return
*/
JSONObject findPreScriptByVideoOrderId(String orderId) throws Exception;
} }
...@@ -146,4 +146,19 @@ public class CdfortisServiceImpl implements CdfortisService { ...@@ -146,4 +146,19 @@ public class CdfortisServiceImpl implements CdfortisService {
return picUrl; 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; ...@@ -2,7 +2,6 @@ package com.cftech.cdfortis.util;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.cdfortis.constants.CdfortisConstant; import com.cftech.cdfortis.constants.CdfortisConstant;
import com.cftech.core.util.SystemConfig;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import okhttp3.*; import okhttp3.*;
...@@ -41,7 +40,7 @@ public class CdfortisResponseUtil { ...@@ -41,7 +40,7 @@ public class CdfortisResponseUtil {
String codeValue = returnCode.getString(CdfortisConstant.RETURN_CODE_KEY); String codeValue = returnCode.getString(CdfortisConstant.RETURN_CODE_KEY);
if (!CdfortisConstant.RESULT_SUCC_CODE.equals(codeValue)) { if (!CdfortisConstant.RESULT_SUCC_CODE.equals(codeValue)) {
log.error(returnCode.toJSONString()); 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 { ...@@ -87,12 +86,21 @@ public class CdfortisResponseUtil {
log.debug("request result: {}", retStr); log.debug("request result: {}", retStr);
// 转换结果 // 转换结果
JSONObject retObj = JSONObject.parseObject(retStr); JSONObject retObj = JSONObject.parseObject(retStr);
// 接口没有数据的特殊处理(理论上没有数据应该是一个空数组,但是微问诊返回结果是错误) if (retObj == null) {
if (CdfortisConstant.RESULT_NO_DATA_CODE.equals(retObj.getJSONObject(CdfortisConstant.RETURN_CODE).getString(CdfortisConstant.RETURN_CODE_KEY))) { 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 ""; return "";
} }
// 检查结果 // 检查结果
checkResponse(retObj); //checkResponse(retObj);
return retObj.getString("data"); return retObj.getString("data");
} }
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<resultMap id="resultMap" type="com.cftech.prescription.model.Prescription"> <resultMap id="resultMap" type="com.cftech.prescription.model.Prescription">
<id column="id" property="id"/> <id column="id" property="id"/>
<result column="number" property="number"/> <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="min_program_no" property="minProgramNo"/>
<result column="store_id" property="storeId"/> <result column="store_id" property="storeId"/>
<result column="hospital_name" property="hospitalName"/> <result column="hospital_name" property="hospitalName"/>
...@@ -19,7 +21,9 @@ ...@@ -19,7 +21,9 @@
<result column="doctor_dpmt_name" property="doctorDpmtName"/> <result column="doctor_dpmt_name" property="doctorDpmtName"/>
<result column="doc_status" property="docStatus"/> <result column="doc_status" property="docStatus"/>
<result column="doc_result" property="docResult"/> <result column="doc_result" property="docResult"/>
<result column="doc_picture" property="docPicture"/>
<result column="pharm_name" property="pharmName"/> <result column="pharm_name" property="pharmName"/>
<result column="pharm_status" property="pharmStatus"/>
<result column="result" property="result"/> <result column="result" property="result"/>
<result column="guoms" property="guoms"/> <result column="guoms" property="guoms"/>
<result column="age" property="age"/> <result column="age" property="age"/>
...@@ -78,6 +82,8 @@ ...@@ -78,6 +82,8 @@
<sql id="sqlColumns"> <sql id="sqlColumns">
id, id,
number, number,
type,
pre_id,
min_program_no, min_program_no,
store_id, store_id,
hospital_name, hospital_name,
...@@ -92,7 +98,9 @@ ...@@ -92,7 +98,9 @@
doctor_dpmt_name, doctor_dpmt_name,
doc_status, doc_status,
doc_result, doc_result,
doc_picture,
pharm_name, pharm_name,
pharm_status,
result, result,
guoms, guoms,
age, age,
...@@ -123,6 +131,8 @@ ...@@ -123,6 +131,8 @@
<sql id="listColumns"> <sql id="listColumns">
t.id, t.id,
t.number, t.number,
t.type,
t.pre_id,
t.min_program_no, t.min_program_no,
t.store_id, t.store_id,
t.hospital_name, t.hospital_name,
...@@ -137,7 +147,9 @@ ...@@ -137,7 +147,9 @@
t.doctor_dpmt_name, t.doctor_dpmt_name,
t.doc_status, t.doc_status,
t.doc_result, t.doc_result,
t.doc_picture,
t.pharm_name, t.pharm_name,
t.pharm_status,
t.result, t.result,
t.guoms, t.guoms,
t.age, t.age,
...@@ -175,6 +187,8 @@ ...@@ -175,6 +187,8 @@
( (
#{id, jdbcType=BIGINT}, #{id, jdbcType=BIGINT},
#{number, jdbcType=VARCHAR}, #{number, jdbcType=VARCHAR},
#{type, jdbcType=VARCHAR},
#{preId, jdbcType=VARCHAR},
#{minProgramNo, jdbcType=VARCHAR}, #{minProgramNo, jdbcType=VARCHAR},
#{storeId, jdbcType=VARCHAR}, #{storeId, jdbcType=VARCHAR},
#{hospitalName, jdbcType=VARCHAR}, #{hospitalName, jdbcType=VARCHAR},
...@@ -189,7 +203,9 @@ ...@@ -189,7 +203,9 @@
#{doctorDpmtName, jdbcType=VARCHAR}, #{doctorDpmtName, jdbcType=VARCHAR},
#{docStatus, jdbcType=VARCHAR}, #{docStatus, jdbcType=VARCHAR},
#{docResult, jdbcType=VARCHAR}, #{docResult, jdbcType=VARCHAR},
#{docPicture, jdbcType=VARCHAR},
#{pharmName, jdbcType=VARCHAR}, #{pharmName, jdbcType=VARCHAR},
#{pharmStatus, jdbcType=VARCHAR},
#{result, jdbcType=VARCHAR}, #{result, jdbcType=VARCHAR},
#{guoms, jdbcType=VARCHAR}, #{guoms, jdbcType=VARCHAR},
#{age, jdbcType=VARCHAR}, #{age, jdbcType=VARCHAR},
...@@ -250,6 +266,12 @@ ...@@ -250,6 +266,12 @@
<if test="number != null"> <if test="number != null">
number = #{number, jdbcType=VARCHAR}, number = #{number, jdbcType=VARCHAR},
</if> </if>
<if test="type != null">
type = #{type, jdbcType=VARCHAR},
</if>
<if test="preId != null">
pre_id = #{preId, jdbcType=VARCHAR},
</if>
<if test="minProgramNo != null"> <if test="minProgramNo != null">
min_program_no = #{minProgramNo, jdbcType=VARCHAR}, min_program_no = #{minProgramNo, jdbcType=VARCHAR},
</if> </if>
...@@ -292,9 +314,15 @@ ...@@ -292,9 +314,15 @@
<if test="docResult != null"> <if test="docResult != null">
doc_result = #{docResult, jdbcType=VARCHAR}, doc_result = #{docResult, jdbcType=VARCHAR},
</if> </if>
<if test="docPicture != null">
doc_picture = #{docPicture, jdbcType=VARCHAR},
</if>
<if test="pharmName != null"> <if test="pharmName != null">
pharm_name = #{pharmName, jdbcType=VARCHAR}, pharm_name = #{pharmName, jdbcType=VARCHAR},
</if> </if>
<if test="pharmStatus != null">
pharm_status = #{pharmStatus, jdbcType=VARCHAR},
</if>
<if test="result != null"> <if test="result != null">
result = #{result, jdbcType=VARCHAR}, result = #{result, jdbcType=VARCHAR},
</if> </if>
...@@ -388,6 +416,12 @@ ...@@ -388,6 +416,12 @@
<update id="updateByNumber" parameterType="com.cftech.prescription.model.Prescription"> <update id="updateByNumber" parameterType="com.cftech.prescription.model.Prescription">
update t_aidea_prescription update t_aidea_prescription
<set> <set>
<if test="type != null">
type = #{type, jdbcType=VARCHAR},
</if>
<if test="preId != null">
pre_id = #{preId, jdbcType=VARCHAR},
</if>
<if test="minProgramNo != null"> <if test="minProgramNo != null">
min_program_no = #{minProgramNo, jdbcType=VARCHAR}, min_program_no = #{minProgramNo, jdbcType=VARCHAR},
</if> </if>
...@@ -430,9 +464,15 @@ ...@@ -430,9 +464,15 @@
<if test="docResult != null"> <if test="docResult != null">
doc_result = #{docResult, jdbcType=VARCHAR}, doc_result = #{docResult, jdbcType=VARCHAR},
</if> </if>
<if test="docPicture != null">
doc_picture = #{docPicture, jdbcType=VARCHAR},
</if>
<if test="pharmName != null"> <if test="pharmName != null">
pharm_name = #{pharmName, jdbcType=VARCHAR}, pharm_name = #{pharmName, jdbcType=VARCHAR},
</if> </if>
<if test="pharmStatus != null">
pharm_status = #{pharmStatus, jdbcType=VARCHAR},
</if>
<if test="result != null"> <if test="result != null">
result = #{result, jdbcType=VARCHAR}, result = #{result, jdbcType=VARCHAR},
</if> </if>
......
...@@ -5,6 +5,7 @@ import com.cftech.accounts.service.JobService; ...@@ -5,6 +5,7 @@ import com.cftech.accounts.service.JobService;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.core.util.SpringContextHolder; import com.cftech.core.util.SpringContextHolder;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig; import com.cftech.core.util.SystemConfig;
import com.cftech.prescription.model.Prescription; import com.cftech.prescription.model.Prescription;
import com.cftech.prescription.service.PrescriptionService; import com.cftech.prescription.service.PrescriptionService;
...@@ -52,17 +53,25 @@ public class SynPrescriptBillJob implements Job { ...@@ -52,17 +53,25 @@ public class SynPrescriptBillJob implements Job {
PrescriptionService prescriptionService = SpringContextHolder.getBean(PrescriptionService.class); PrescriptionService prescriptionService = SpringContextHolder.getBean(PrescriptionService.class);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.description", "1");//提交状态 为返回 conds.notEqual("t.description", "2");
//conds.equal("DATE_FORMAT(t.create_time ,'%Y-%m-%d')", DateUtils.getDate());//获取当天
List<Prescription> prescriptionList = prescriptionService.fetchSearchByPage(conds, null, 0, 0); List<Prescription> prescriptionList = prescriptionService.fetchSearchByPage(conds, null, 0, 0);
for (Prescription prescript: prescriptionList) { for (Prescription prescript : prescriptionList) {
prescriptionService.findPreScriptionByOrderId(prescript.getNumber()); 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) { } catch (Exception e) {
log.error("同步更新处方单任务执行失败,{}" + e.getMessage()); log.error("同步更新处方单任务执行失败,{}" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
...@@ -44,14 +44,14 @@ public class SynPrescriptRefundJob implements Job { ...@@ -44,14 +44,14 @@ public class SynPrescriptRefundJob implements Job {
//执行更新操作 //执行更新操作
if (context.getNextFireTime() != null) { 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 { } else {
JobService jobService = SpringContextHolder.getBean(JobService.class); JobService jobService = SpringContextHolder.getBean(JobService.class);
SysJob sysJob = new SysJob(); SysJob sysJob = new SysJob();
sysJob.setJobuid(id); sysJob.setJobuid(id);
sysJob.setStatus("0"); sysJob.setStatus("0");
jobService.updateStatus(sysJob); jobService.updateStatus(sysJob);
log.info("同步更新处方单任务,已执行完成!"); log.info("同步处方单退款任务,已执行完成!");
} }
} }
...@@ -67,7 +67,7 @@ public class SynPrescriptRefundJob implements Job { ...@@ -67,7 +67,7 @@ public class SynPrescriptRefundJob implements Job {
MpAccountsEntity accountsEntity = accountsService.getMpAccountsAppid(SystemConfig.p.getProperty("WX_MP_SERVER_APPID")); MpAccountsEntity accountsEntity = accountsService.getMpAccountsAppid(SystemConfig.p.getProperty("WX_MP_SERVER_APPID"));
List<Prescription> prescriptionList = prescriptionService.fetchSearchByPage(conds, null, 0, 0); List<Prescription> prescriptionList = prescriptionService.fetchSearchByPage(conds, null, 0, 0);
for (Prescription prescript: prescriptionList) { for (Prescription prescript: prescriptionList) {
if (StringUtils.equals(prescript.getDocStatus(), "0")) {//单据已审核通过 if (StringUtils.equals(prescript.getDocStatus(), "0") || StringUtils.isNotBlank(prescript.getPresUrl())) {//单据已审核通过
continue; continue;
} }
......
...@@ -21,6 +21,11 @@ public class Prescription implements Serializable { ...@@ -21,6 +21,11 @@ public class Prescription implements Serializable {
/* 编码 */ /* 编码 */
@ExportConfig(value = "编码", width = 100, showLevel = 1) @ExportConfig(value = "编码", width = 100, showLevel = 1)
private String number; private String number;
/* 处方开取类型 0:图文处方 1:视频处方 */
private String type;
/* 处方开取类型 0:对应小程序处方唯一编号 */
private String preId;
/* openid */ /* openid */
@ExportConfig(value = "人员openid", width = 100, showLevel = 1) @ExportConfig(value = "人员openid", width = 100, showLevel = 1)
private String openid; private String openid;
...@@ -66,6 +71,9 @@ public class Prescription implements Serializable { ...@@ -66,6 +71,9 @@ public class Prescription implements Serializable {
/* 医生审核不通过理由 */ /* 医生审核不通过理由 */
@ExportConfig(value = "医生审核不通过理由", width = 100, showLevel = 1) @ExportConfig(value = "医生审核不通过理由", width = 100, showLevel = 1)
private String docResult; private String docResult;
/* 医生签名 */
private String docPicture;
/* 此处方被审核后审方药师名 */ /* 此处方被审核后审方药师名 */
@ExportConfig(value = "此处方被审核后审方药师名", width = 100, showLevel = 1) @ExportConfig(value = "此处方被审核后审方药师名", width = 100, showLevel = 1)
private String pharmName; private String pharmName;
...@@ -87,7 +95,7 @@ public class Prescription implements Serializable { ...@@ -87,7 +95,7 @@ public class Prescription implements Serializable {
private Long accountsId; private Long accountsId;
/* 删除标识 */ /* 删除标识 */
private boolean delFlag; private boolean delFlag;
/* 状态 */ /* 状态 0-未审核 1-通过 2-不通过 */
private String status; private String status;
/* 创建时间 */ /* 创建时间 */
private Date createTime; private Date createTime;
...@@ -130,15 +138,15 @@ public class Prescription implements Serializable { ...@@ -130,15 +138,15 @@ public class Prescription implements Serializable {
public Prescription() { public Prescription() {
this.delFlag = false; this.delFlag = false;
this.status = "0";
} }
@Override @Override
public String toString() { public String toString() {
return "Prescription{" + return "Prescription{" +
"id=" + id + "id=" + id +
", number='" + number + '\'' + ", number='" + number + '\'' +
", type='" + type + '\'' +
", preId='" + preId + '\'' +
", openid='" + openid + '\'' + ", openid='" + openid + '\'' +
", minProgramNo='" + minProgramNo + '\'' + ", minProgramNo='" + minProgramNo + '\'' +
", storeId='" + storeId + '\'' + ", storeId='" + storeId + '\'' +
...@@ -154,6 +162,7 @@ public class Prescription implements Serializable { ...@@ -154,6 +162,7 @@ public class Prescription implements Serializable {
", doctorDpmtName='" + doctorDpmtName + '\'' + ", doctorDpmtName='" + doctorDpmtName + '\'' +
", docStatus='" + docStatus + '\'' + ", docStatus='" + docStatus + '\'' +
", docResult='" + docResult + '\'' + ", docResult='" + docResult + '\'' +
", docPicture='" + docPicture + '\'' +
", pharmName='" + pharmName + '\'' + ", pharmName='" + pharmName + '\'' +
", pharmStatus='" + pharmStatus + '\'' + ", pharmStatus='" + pharmStatus + '\'' +
", result='" + result + '\'' + ", result='" + result + '\'' +
...@@ -172,8 +181,14 @@ public class Prescription implements Serializable { ...@@ -172,8 +181,14 @@ public class Prescription implements Serializable {
", tradeNo='" + tradeNo + '\'' + ", tradeNo='" + tradeNo + '\'' +
", payStatus='" + payStatus + '\'' + ", payStatus='" + payStatus + '\'' +
", payAmount=" + payAmount + ", payAmount=" + payAmount +
", cashFee=" + cashFee +
", payTime=" + payTime + ", payTime=" + payTime +
", payRemark='" + payRemark + '\'' + ", payRemark='" + payRemark + '\'' +
", refundId='" + refundId + '\'' +
", refundNo='" + refundNo + '\'' +
", refundCaseFee=" + refundCaseFee +
", refundTime=" + refundTime +
", refundRemark='" + refundRemark + '\'' +
", consultNo='" + consultNo + '\'' + ", consultNo='" + consultNo + '\'' +
'}'; '}';
} }
......
...@@ -29,7 +29,7 @@ public interface PrescriptionService extends GenericService<Prescription> { ...@@ -29,7 +29,7 @@ public interface PrescriptionService extends GenericService<Prescription> {
* @param number * @param number
* @return * @return
*/ */
JSONObject updatePrescription(String appId, String openId, String number); JSONObject updatePrescription(String appId, String openId, String number, String type);
/** /**
* 获取处方单列表(从距今日7天内的数据) * 获取处方单列表(从距今日7天内的数据)
...@@ -75,6 +75,14 @@ public interface PrescriptionService extends GenericService<Prescription> { ...@@ -75,6 +75,14 @@ public interface PrescriptionService extends GenericService<Prescription> {
*/ */
Prescription findPreScriptionByOrderId(String orderId) throws Exception; Prescription findPreScriptionByOrderId(String orderId) throws Exception;
/**
* 通过处方单编码获取视频问诊结果
* @param orderId
* @return
* @throws Exception
*/
Prescription findPreScriptByVideoOrderId(String orderId) throws Exception;
/** /**
* 退款 * 退款
* @param id * @param id
...@@ -89,4 +97,6 @@ public interface PrescriptionService extends GenericService<Prescription> { ...@@ -89,4 +97,6 @@ public interface PrescriptionService extends GenericService<Prescription> {
* @return * @return
*/ */
JSONObject findPrescriptDetail(String appId, String openId); JSONObject findPrescriptDetail(String appId, String openId);
int updateByNumber(Prescription prescription);
} }
...@@ -192,17 +192,18 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im ...@@ -192,17 +192,18 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
} }
@Override @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(); JSONObject retObj = new JSONObject();
try { try {
//获取当前用户当天开取的处方单 //获取当前用户当天开取的处方单
Conds conds = new Conds(); 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.number", number);
conds.equal("t.openid", openId); conds.equal("t.openid", openId);
Prescription prescription = this.fetchSearchByConds(conds); Prescription prescription = this.fetchSearchByConds(conds);
if (prescription != null) { if (prescription != null) {
prescription.setDescription("1"); prescription.setDescription("1");
prescription.setType(type);
this.update(prescription); this.update(prescription);
retObj.put("errorNo", 0); retObj.put("errorNo", 0);
return retObj; return retObj;
...@@ -237,15 +238,23 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im ...@@ -237,15 +238,23 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
if ("2".equals(prescription.getDescription()) && "0".equals(prescription.getDocStatus())) { if ("2".equals(prescription.getDescription()) && "0".equals(prescription.getDocStatus())) {
retObj.put("errorNo", 0); retObj.put("errorNo", 0);
retObj.put("data", prescription); 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()); prescription = this.findPreScriptionByOrderId(prescription.getNumber());
if (prescription == null) { } else if (StringUtils.equals("1", prescription.getType())) {//获取视频处方
retObj.put("errorNo", 1); prescription = this.findPreScriptByVideoOrderId(prescription.getNumber());
retObj.put("errorMsg", "暂无单据"); }
} else {
retObj.put("errorNo", 0); if (prescription == null) {
retObj.put("data", prescription); retObj.put("errorNo", 1);
} retObj.put("errorMsg", "暂无单据");
} else {
retObj.put("errorNo", 0);
retObj.put("data", prescription);
} }
} catch (Exception e) { } catch (Exception e) {
retObj.put("errorNo", 1); retObj.put("errorNo", 1);
...@@ -258,21 +267,22 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im ...@@ -258,21 +267,22 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
public JSONObject findPrescriptDetail(String appId, String openId) { public JSONObject findPrescriptDetail(String appId, String openId) {
JSONObject retObj = new JSONObject(); JSONObject retObj = new JSONObject();
try { try {
//获取最新处方单数据 //获取已开具成功的图文处方
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.openid", openId); conds.equal("t.openid", openId);
conds.equal("t.description", "2");//已获取返回结果 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); Sort sort = new Sort("t.create_time", OrderType.DESC);
List<Prescription> list = this.fetchSearchByPage(conds, sort, 0, 0); List<Prescription> list = this.fetchSearchByPage(conds, sort, 0, 0);
if (CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
retObj.put("errorNo", 1); retObj.put("errorNo", 0);
retObj.put("errorMsg", "处方暂未开具"); retObj.put("data", list.get(0));
return retObj; return retObj;
} }
retObj.put("errorNo", 0);
retObj.put("data", list.get(0)); retObj.put("errorNo", 1);
retObj.put("errorMsg", "处方单暂未开具!");
} catch (Exception e) { } catch (Exception e) {
retObj.put("errorNo", 1); retObj.put("errorNo", 1);
e.printStackTrace(); e.printStackTrace();
...@@ -280,6 +290,11 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im ...@@ -280,6 +290,11 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
return retObj; return retObj;
} }
@Override
public int updateByNumber(Prescription prescription) {
return prescriptionMapper.updateByNumber(prescription);
}
@Override @Override
public List<Prescription> findPreScriptionList(int iDisplayStart, int iDisplayLength) throws Exception { public List<Prescription> findPreScriptionList(int iDisplayStart, int iDisplayLength) throws Exception {
return findPreScriptionList(iDisplayStart, iDisplayLength, null, null); return findPreScriptionList(iDisplayStart, iDisplayLength, null, null);
...@@ -357,6 +372,50 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im ...@@ -357,6 +372,50 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
return prescription; 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获取详情 * 通过number/orderId获取详情
...@@ -374,10 +433,6 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im ...@@ -374,10 +433,6 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
//@NotNull //@NotNull
private Prescription handlePrescription(FbusiDetail fbusiDetail, String number) throws Exception { private Prescription handlePrescription(FbusiDetail fbusiDetail, String number) throws Exception {
if (fbusiDetail == null) { if (fbusiDetail == null) {
Prescription prescription = new Prescription();
prescription.setNumber(number);//通过编码更新
prescription.setDescription("2");//已返回
prescriptionMapper.updateByNumber(prescription);
return null; return null;
} }
//更新 //更新
......
package com.cftech.prescription.web; package com.cftech.prescription.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.cdfortis.service.CdfortisService;
import com.cftech.prescription.service.PrescriptionService; import com.cftech.prescription.service.PrescriptionService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -14,8 +15,11 @@ public class MobilePrecriptionController { ...@@ -14,8 +15,11 @@ public class MobilePrecriptionController {
@Autowired @Autowired
private PrescriptionService prescriptionService; private PrescriptionService prescriptionService;
@Autowired
private CdfortisService cdfortisService;
/** /**
* 生成处方单编码 * 生成临时处方单
* @param appId * @param appId
* @param openId * @param openId
* @return * @return
...@@ -51,7 +55,7 @@ public class MobilePrecriptionController { ...@@ -51,7 +55,7 @@ public class MobilePrecriptionController {
} }
/** /**
* 更新处方单 * 更新处方单为提交状态且更新处方类型
* @param appId * @param appId
* @param openId * @param openId
* @param number * @param number
...@@ -60,7 +64,9 @@ public class MobilePrecriptionController { ...@@ -60,7 +64,9 @@ public class MobilePrecriptionController {
@RequestMapping(value = "updatePrescription", method = { RequestMethod.POST }, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "updatePrescription", method = { RequestMethod.POST }, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject updatePrescription(@RequestParam String appId, public JSONObject updatePrescription(@RequestParam String appId,
@RequestParam String openId, @RequestParam String openId,
@RequestParam String number) { @RequestParam String number,
return prescriptionService.updatePrescription(appId, openId, number); @RequestParam String type) {
return prescriptionService.updatePrescription(appId, openId, number, type);
} }
} }
...@@ -238,17 +238,6 @@ ...@@ -238,17 +238,6 @@
'visible': false, 'visible': false,
'targets': [0] 'targets': [0]
}, },
{
"aTargets": [3],
"mData": "isThree",
"mRender": function (a, b, c, d) {
if(a == '1'){
return "三期";
}else {
return "";
}
}
},
{ {
"aTargets": [8], "aTargets": [8],
"mData": "outStoreDate", "mData": "outStoreDate",
......
...@@ -323,7 +323,6 @@ ...@@ -323,7 +323,6 @@
'visible': false, 'visible': false,
'targets': [0] 'targets': [0]
}, },
{ {
"aTargets": [16], "aTargets": [16],
"mData": "fkTime", "mData": "fkTime",
......
...@@ -184,20 +184,61 @@ ...@@ -184,20 +184,61 @@
</select> </select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_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"/> <include refid="sqlWhere"/>
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.report.model.Report">
SELECT SELECT
<include refid="sqlColumns"/> ord.id id,
FROM t_aidea_report 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"/> <include refid="sqlWhere"/>
<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="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 id="update" parameterType="com.cftech.report.model.Report">
update t_aidea_report update t_aidea_report
<set> <set>
...@@ -383,7 +424,7 @@ ...@@ -383,7 +424,7 @@
sb.drugs_num drugNum, sb.drugs_num drugNum,
sb.drugs_batchno drugBatchNo, sb.drugs_batchno drugBatchNo,
w.create_time outStoreDate, 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 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_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' 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; ...@@ -20,7 +20,6 @@ import com.cftech.report.model.ReportCode;
import com.cftech.report.model.ReportDoctorInfo; import com.cftech.report.model.ReportDoctorInfo;
import com.cftech.report.model.ReportPeopleInfo; import com.cftech.report.model.ReportPeopleInfo;
import com.cftech.report.service.ReportService; import com.cftech.report.service.ReportService;
import com.cftech.shop.qrcode.model.QyUser;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.quartz.Job; import org.quartz.Job;
import org.quartz.JobDataMap; import org.quartz.JobDataMap;
...@@ -45,7 +44,8 @@ public class ReportJob implements Job { ...@@ -45,7 +44,8 @@ public class ReportJob implements Job {
private static String REGION_LONG_ID = SystemConfig.p.getProperty("REGION_LONG_ID"); private static String REGION_LONG_ID = SystemConfig.p.getProperty("REGION_LONG_ID");
@Override @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) { if (!isCluster) {
return; return;
} }
...@@ -179,9 +179,6 @@ public class ReportJob implements Job { ...@@ -179,9 +179,6 @@ public class ReportJob implements Job {
report.setSalesRepresent(sb.toString()); report.setSalesRepresent(sb.toString());
} }
break; break;
// case 8://科室
// report.setDepartment(item.getOrgName());
// break;
} }
}); });
} }
......
...@@ -103,44 +103,43 @@ public class ReportController { ...@@ -103,44 +103,43 @@ public class ReportController {
public JSONObject listData(int iDisplayStart, int iDisplayLength, Report report, HttpServletRequest request,String startPayTime,String endPayTime) { public JSONObject listData(int iDisplayStart, int iDisplayLength, Report report, HttpServletRequest request,String startPayTime,String endPayTime) {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0); conds.equal("ord.del_flag", Constants.DEL_FLAG_0);
//conds.equal("accounts_id", accountsId); Sort sort = new Sort("ord.create_time", OrderType.DESC);
Sort sort = new Sort("order_number", OrderType.DESC);
if(!StringUtils.isEmpty(report.getRegion())){ if(!StringUtils.isEmpty(report.getRegion())){
conds.like("region",report.getRegion()); conds.like("report.region",report.getRegion());
} }
if(!StringUtils.isEmpty(report.getProvince())){ if(!StringUtils.isEmpty(report.getProvince())){
conds.like("province",report.getProvince()); conds.like("report.province",report.getProvince());
} }
if(!StringUtils.isEmpty(report.getCity())){ if(!StringUtils.isEmpty(report.getCity())){
conds.like("city",report.getCity()); conds.like("report.city",report.getCity());
} }
if(!StringUtils.isEmpty(report.getHospital())){ if(!StringUtils.isEmpty(report.getHospital())){
conds.like("hospital",report.getHospital()); conds.like("consult.allergy",report.getHospital());
} }
if(!StringUtils.isEmpty(report.getDoctorName())){ if(!StringUtils.isEmpty(report.getDoctorName())){
conds.like("doctor_name",report.getDoctorName()); conds.like("consult.past_records",report.getDoctorName());
} }
if(!StringUtils.isEmpty(report.getPhone())){ 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())){ if(!StringUtils.isEmpty(report.getDrugsNum())){
conds.equal("drugs_num",report.getDrugsNum()); conds.equal("detail.drugs_num",report.getDrugsNum());
} }
if(!StringUtils.isEmpty(startPayTime)){ 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)){ 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);
} }
...@@ -172,43 +171,43 @@ public class ReportController { ...@@ -172,43 +171,43 @@ public class ReportController {
@RequiresPermissions(value = REPORT_VIEW) @RequiresPermissions(value = REPORT_VIEW)
public void exportExcel(Report report, HttpServletRequest request,String startPayTime,String endPayTime, HttpServletResponse response) { public void exportExcel(Report report, HttpServletRequest request,String startPayTime,String endPayTime, HttpServletResponse response) {
Long accountId = UserUtils.getmpaccounts(request); 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 conds = new Conds();
conds.equal("del_flag", 0); conds.equal("ord.del_flag", 0);
if(!StringUtils.isEmpty(report.getRegion())){ if(!StringUtils.isEmpty(report.getRegion())){
conds.like("region",report.getRegion()); conds.like("report.region",report.getRegion());
} }
if(!StringUtils.isEmpty(report.getProvince())){ if(!StringUtils.isEmpty(report.getProvince())){
conds.like("province",report.getProvince()); conds.like("report.province",report.getProvince());
} }
if(!StringUtils.isEmpty(report.getCity())){ if(!StringUtils.isEmpty(report.getCity())){
conds.like("city",report.getCity()); conds.like("report.city",report.getCity());
} }
if(!StringUtils.isEmpty(report.getHospital())){ if(!StringUtils.isEmpty(report.getHospital())){
conds.like("hospital",report.getHospital()); conds.like("consult.allergy",report.getHospital());
} }
if(!StringUtils.isEmpty(report.getDoctorName())){ if(!StringUtils.isEmpty(report.getDoctorName())){
conds.like("doctor_name",report.getDoctorName()); conds.like("consult.past_records",report.getDoctorName());
} }
if(!StringUtils.isEmpty(report.getPhone())){ 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())){ if(!StringUtils.isEmpty(report.getDrugsNum())){
conds.equal("drugs_num",report.getDrugsNum()); conds.equal("detail.drugs_num",report.getDrugsNum());
} }
if(!StringUtils.isEmpty(startPayTime)){ 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)){ 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); List<Report> list = reportService.fetchSearchByPage(conds, sort, 0, 0);
ExcelKit.$Export(Report.class, response).toExcel(list, "报表信息信息"); ExcelKit.$Export(Report.class, response).toExcel(list, "报表信息信息");
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<bean id="convertPwdPropertyConfigurer" class="com.cftech.core.util.ConvertPwdPropertyConfigurer"> <bean id="convertPwdPropertyConfigurer" class="com.cftech.core.util.ConvertPwdPropertyConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>classpath*:application-test.properties</value> <value>classpath*:application.properties</value>
</list> </list>
</property> </property>
</bean> </bean>
......
...@@ -172,5 +172,7 @@ cdfortis.get_fbusi_pic_url=https://api.cdfortis.com/api/fbusi/getFbusiPicture ...@@ -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 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 #\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 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 #\u5FAE\u95EE\u8BCA\u95E8\u5E97\u7F16\u7801
cdfortis.store_no=wxc43bd62c1 cdfortis.store_no=wxc43bd62c1
...@@ -171,5 +171,7 @@ cdfortis.get_fbusi_pic_url=https://api.cdfortis.com/api/fbusi/getFbusiPicture ...@@ -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 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 #\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 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 #\u5FAE\u95EE\u8BCA\u95E8\u5E97\u7F16\u7801
cdfortis.store_no=wxc43bd62c1 cdfortis.store_no=wxc43bd62c1
\ No newline at end of file
...@@ -14,10 +14,10 @@ public class SystemConfig { ...@@ -14,10 +14,10 @@ public class SystemConfig {
try { try {
// inputStream = SystemConfig.class.newInstance().getClass() // inputStream = SystemConfig.class.newInstance().getClass()
// .getClassLoader().getResourceAsStream(""); // .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() inputStreamRedis = SystemConfig.class.newInstance().getClass()
.getClassLoader().getResourceAsStream("/redis-config-test.properties"); .getClassLoader().getResourceAsStream("/redis-config.properties");
r.load(inputStreamRedis); r.load(inputStreamRedis);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
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