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

fix:报表修改

parent 04109897
......@@ -186,7 +186,7 @@
<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 +452,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 "";
}
},
{
......@@ -598,7 +595,11 @@
"aTargets": [11],
"mData": "confirm",
"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 {
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());
}
//三期患者
......@@ -310,10 +310,10 @@ public class OrderController {
Integer counts = orderService.count(conds, userid, order.getStartOrderAmount(), order.getStartPayAmount());
//设置是否可以开票,拼接付款链接
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");
}
......@@ -332,6 +332,10 @@ public class OrderController {
return rtnJson;
}
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm");
}
//开发票
@RequiresPermissions(value = ORDER_EDIT)
@RequestMapping("/invoice")
......@@ -345,7 +349,7 @@ public class OrderController {
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);
if (list != null && list.size() > 0) {
for (Order order : list) {
//订单为0无法开票
......
......@@ -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",
......
......@@ -323,7 +323,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);
}
......@@ -172,43 +171,43 @@ public class ReportController {
@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>
......
......@@ -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
......@@ -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();
......
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