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

Aidea product update by Strive Date 2020-10-23

parent 50664c26
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
"mData": "drugsCode" "mData": "drugsCode"
}, },
{ {
"mData": "productName" "mData": "drugsName"
}, },
{ {
"mData": "price" "mData": "price"
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
} }
},{ },{
"aTargets": [3], "aTargets": [3],
"mData": "productName", "mData": "drugsName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<result column="order_id" property="orderId"/> <result column="order_id" property="orderId"/>
<result column="order_code" property="orderCode"/> <result column="order_code" property="orderCode"/>
<result column="drugs_id" property="drugsId"/> <result column="drugs_id" property="drugsId"/>
<result column="drugs_num" property="drugsNum"/> <result column="drugs_name" property="drugsName"/>
<result column="openid" property="openid"/> <result column="openid" property="openid"/>
<result column="price" property="price"/> <result column="price" property="price"/>
<result column="amount" property="amount"/> <result column="amount" property="amount"/>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
d.description, d.description,
d.create_by, d.create_by,
d.update_by, d.update_by,
p.drugs_name d.drugs_name
</sql> </sql>
...@@ -117,17 +117,17 @@ ...@@ -117,17 +117,17 @@
<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_order_details d SELECT COUNT(1) FROM t_order_details d
LEFT JOIN t_aidea_product p ON p.id = d.drugs_id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>
FROM t_order_details d FROM t_order_details d
LEFT JOIN t_aidea_product p ON p.id = d.drugs_id LEFT JOIN t_order o ON o.id = d.order_id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="userId!=null"> AND (o.service_id = ${userId} OR o.clerk_id = ${userId} OR o.doctor_id = ${userId}) </if>
<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>
......
package com.cftech.orderdetail.service; package com.cftech.orderdetail.service;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.orderdetail.model.OrderDetails; import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import java.util.List;
/** /**
* 订单管理Service * 订单管理Service
* *
...@@ -11,4 +16,13 @@ import com.cftech.core.generic.GenericService; ...@@ -11,4 +16,13 @@ import com.cftech.core.generic.GenericService;
public interface OrderDetailsService extends GenericService<OrderDetails> { public interface OrderDetailsService extends GenericService<OrderDetails> {
/**
* 通过客服、药师、订单员获取列表
* @param userId
* @param conds
* @param sort
* @param iDisplayStart
* @param iDisplayLength
*/
List<OrderDetails> fetchSearchByPageByUser(String userId, Conds conds, Sort sort, int iDisplayStart, int iDisplayLength);
} }
package com.cftech.orderdetail.service.impl; package com.cftech.orderdetail.service.impl;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.StringUtils;
import com.cftech.orderdetail.model.OrderDetails; import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.orderdetail.dao.OrderDetailsMapper; import com.cftech.orderdetail.dao.OrderDetailsMapper;
import com.cftech.orderdetail.service.OrderDetailsService; import com.cftech.orderdetail.service.OrderDetailsService;
...@@ -10,6 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -10,6 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 订单管理ServiceImpl * 订单管理ServiceImpl
* *
...@@ -28,4 +34,16 @@ public GenericDao<OrderDetails> getGenericMapper() { ...@@ -28,4 +34,16 @@ public GenericDao<OrderDetails> getGenericMapper() {
return orderDetailsMapper; return orderDetailsMapper;
} }
@Override
public List<OrderDetails> fetchSearchByPageByUser(String userId, Conds conds, Sort sort, int page, int pageSize) {
Map<String, Object> params = new HashMap<String, Object>();
if (!StringUtils.equals(userId, "1")) {
params.put("userId", userId);
}
params.put("conds", conds);
params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0);
params.put("sort", sort);
return getGenericMapper().fetchSearchByPage(params);
}
} }
\ No newline at end of file
...@@ -11,11 +11,11 @@ import com.cftech.core.util.Constants; ...@@ -11,11 +11,11 @@ import com.cftech.core.util.Constants;
import com.cftech.sys.security.PermissionSign; import com.cftech.sys.security.PermissionSign;
import com.cftech.sys.security.UserUtils; import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -103,14 +103,21 @@ public class OrderDetailsController { ...@@ -103,14 +103,21 @@ public class OrderDetailsController {
@ResponseBody @ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, OrderDetails orderDetails, HttpServletRequest request) { public JSONObject listData(int iDisplayStart, int iDisplayLength, OrderDetails orderDetails, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
String userId = String.valueOf(UserUtils.getUser().getId());
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("d.del_flag", Constants.DEL_FLAG_0); conds.equal("d.del_flag", Constants.DEL_FLAG_0);
conds.equal("d.accounts_id", accountsId); conds.equal("d.accounts_id", accountsId);
conds.like("d.order_code",orderDetails.getOrderCode());
conds.like("d.drugs_code",orderDetails.getDrugsCode()); if (StringUtils.isNoneBlank(orderDetails.getDrugsCode()))
conds.like("d.drugs_code", orderDetails.getDrugsCode());
if (StringUtils.isNoneBlank(orderDetails.getOrderCode()))
conds.like("d.order_code", orderDetails.getOrderCode());
Sort sort = new Sort("d.create_time", OrderType.DESC); Sort sort = new Sort("d.create_time", OrderType.DESC);
List<OrderDetails> list = orderDetailsService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength); List<OrderDetails> list = orderDetailsService.fetchSearchByPageByUser(userId, conds, sort, iDisplayStart, iDisplayLength);
Integer counts = orderDetailsService.count(conds); Integer counts = orderDetailsService.count(conds);
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts); rtnJson.put("iTotalRecords", counts);
......
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
},{ },{
"mData":"productNumber" "mData":"productNumber"
},{ },{
"mData":"productName" "mData":""
},{ },{
"mData":"productImg" "mData":"productImg"
},{ },{
......
...@@ -73,9 +73,9 @@ ...@@ -73,9 +73,9 @@
<!-- general form elements disabled --> <!-- general form elements disabled -->
<div class="box box-primary"> <div class="box box-primary">
<form role="form" id="myForm"> <form role="form" id="myForm">
<input name="id" value="$!{data.id}" hidden="true"/> <input name="id" value="$!{data.id}" hidden="true"/>
<div class="box-body"> <div class="box-body">
</div> </div>
<div class="box-footer"> <div class="box-footer">
#if($shiro.hasPermission("qy:waybill:edit")) #if($shiro.hasPermission("qy:waybill:edit"))
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
bindEvent(); bindEvent();
}; };
var bindEvent = function () { var bindEvent = function () {
$("#myForm").validate({ $("#myForm").validate({
rules: {}, rules: {},
messages: {}, messages: {},
......
...@@ -77,13 +77,13 @@ ...@@ -77,13 +77,13 @@
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/waybill/list')" method="get"> <form id="seachTableForm" action="#springUrl('/a/waybill/list')" method="get">
<div class="col-xs-5"> <div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button> <button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:waybill:edit")) #if($shiro.hasPermission("qy:waybill:edit"))
<a href="#springUrl('/a/waybill/form')" class="btn btn-primary">新增</a> <a href="#springUrl('/a/waybill/form')" class="btn btn-primary">新增</a>
<a href="#springUrl('/a/waybill/exportExcel')" class="btn btn-primary">导出</a> <a href="#springUrl('/a/waybill/exportExcel')" class="btn btn-primary">导出</a>
<a onclick="importExcel();" class="btn btn-primary">导入</a> <a onclick="importExcel();" class="btn btn-primary">导入</a>
#end #end
</div> </div>
</form> </form>
</div><!-- /.box-header --> </div><!-- /.box-header -->
...@@ -91,7 +91,11 @@ ...@@ -91,7 +91,11 @@
<table id="table" class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<td hidden="true">Id</td><th>创建时间</th> <td hidden="true">Id</td>
<th>物流单编码</th>
<th>顺丰运单号</th>
<th>会员名称</th>
<th>联系人</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
...@@ -145,7 +149,7 @@ ...@@ -145,7 +149,7 @@
var minute = now.getMinutes(); var minute = now.getMinutes();
var second = now.getSeconds(); var second = now.getSeconds();
return year + "-" + month + "-" + date + " " + hour + ":" return year + "-" + month + "-" + date + " " + hour + ":"
+ minute + ":" + second; + minute + ":" + second;
} }
function seachTable() { function seachTable() {
...@@ -185,32 +189,44 @@ ...@@ -185,32 +189,44 @@
"fnServerData": retrieveData, "fnServerData": retrieveData,
"pagingType": "full_numbers", "pagingType": "full_numbers",
"aoColumns": [ "aoColumns": [
{ {
"mData": "id" "mData": "id"
}, },
{ {
"mData": "createTime" "mData": "number"
}, },
{ {
"mData": "waybillNo"
},
{
"mData": "memberName"
},
{
"mData": "contact"
},
{
"mData": "createTime"
},
{
"mData": "id" "mData": "id"
}], }],
"aoColumnDefs": [ "aoColumnDefs": [
{ // set default column settings { // set default column settings
'visible': false, 'visible': false,
'targets': [0] 'targets': [0]
}, },
{ {
"aTargets": [1], "aTargets": [5],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return '<a href="#springUrl("/a/waybill/form?id=' + c.id + '")" data-id="' + c.id + '" data-action="view">' + formatDates(a, "yyyy-MM-dd HH:mm:ss"); return '<a href="#springUrl("/a/waybill/form?id=' + c.id + '")" data-id="' + c.id + '" data-action="view">' + formatDates(a, "yyyy-MM-dd HH:mm:ss");
+'</a>'; +'</a>';
} }
}, },
] ]
}); });
} }
...@@ -262,22 +278,22 @@ ...@@ -262,22 +278,22 @@
} }
}); });
} }
function importExcel() { function importExcel() {
var templateExcelUrl = "#springUrl('/a/waybill/templateExcel')"; var templateExcelUrl = "#springUrl('/a/waybill/templateExcel')";
var importExcelUrl = "#springUrl('/a/waybill/importExcel')"; var importExcelUrl = "#springUrl('/a/waybill/importExcel')";
Cfapp.importExcel({ Cfapp.importExcel({
title: '顺丰物流运单导入', title: '顺丰物流运单导入',
importurl: importExcelUrl, importurl: importExcelUrl,
templateurl: templateExcelUrl, templateurl: templateExcelUrl,
cancel: function () { cancel: function () {
}, },
success: function () { success: function () {
}
});
}
}
});
}
</script> </script>
......
...@@ -25,7 +25,7 @@ public class Waybill implements Serializable { ...@@ -25,7 +25,7 @@ public class Waybill implements Serializable {
private Long orderId; private Long orderId;
/* 物流单编码 */ /* 物流单编码 */
@ExportConfig(value = "物流单编码", width = 100, showLevel = 1) @ExportConfig(value = "物流单编码", width = 100, showLevel = 1)
private String numbetr; private String number;
/* 会员Id */ /* 会员Id */
@ExportConfig(value = "会员Id", width = 100, showLevel = 1) @ExportConfig(value = "会员Id", width = 100, showLevel = 1)
private String memberId; private String memberId;
...@@ -97,6 +97,16 @@ public class Waybill implements Serializable { ...@@ -97,6 +97,16 @@ public class Waybill implements Serializable {
/* 更新人 */ /* 更新人 */
private Long updateBy; private Long updateBy;
/**
* 非数据库字段
*/
private String orderCode;
private String drugsNum;
private String drugsName;
private String drugsCode;
private String price;
private String memberName;
public Waybill() { public Waybill() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
......
...@@ -47,11 +47,11 @@ public class ExpressOrderInfoUtils { ...@@ -47,11 +47,11 @@ public class ExpressOrderInfoUtils {
//业务需要增加 //业务需要增加
waybill.put("isReturnQRCode", "1");//是否返回用来推送业务的二维码 1:返回 0:不返回 waybill.put("isReturnQRCode", "1");//是否返回用来推送业务的二维码 1:返回 0:不返回
waybill.put("specialDeliveryTypeCode", "1");//特殊派送类型代码 1:身份验证 //waybill.put("specialDeliveryTypeCode", "1");//特殊派送类型代码 1:身份验证
waybill.put("specialDeliveryValue", "12345678");//特殊派件具体表述 证件类型:证件后8位如:1:09296231(1 表示身份证,暂不支持其他证件) //waybill.put("specialDeliveryValue", "12345678");//特殊派件具体表述 证件类型:证件后8位如:1:09296231(1 表示身份证,暂不支持其他证件)
waybill.put("isReturnSignBackRoutelabel", "1");//是否返回签回单路由标签: 默认0, 1:返回路由标签,0:不返回 //waybill.put("isReturnSignBackRoutelabel", "0");//是否返回签回单路由标签: 默认0, 1:返回路由标签,0:不返回
waybill.put("isReturnRoutelabel", "1");//是否返回路由标签: 默认0, 1:返回路由标签, 0:不返回 waybill.put("isReturnRoutelabel", "0");//是否返回路由标签: 默认0, 1:返回路由标签, 0:不返回
waybill.put("podModelAddress", "url");//签单返回范本地址 //waybill.put("podModelAddress", "url");//签单返回范本地址
//特殊需求药品,需冷冻、冷藏 //特殊需求药品,需冷冻、冷藏
if (StringUtils.isNoneBlank(waybillObj.getExpressTypeId())) { if (StringUtils.isNoneBlank(waybillObj.getExpressTypeId())) {
......
...@@ -15,13 +15,20 @@ import org.apache.http.client.entity.UrlEncodedFormEntity; ...@@ -15,13 +15,20 @@ import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair; import org.apache.http.message.BasicNameValuePair;
import org.apache.http.ssl.SSLContextBuilder;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import javax.net.ssl.SSLContext;
import java.io.*; import java.io.*;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -41,7 +48,8 @@ public class FqHttpUtils { ...@@ -41,7 +48,8 @@ public class FqHttpUtils {
/** /**
* 顺丰合作伙伴Id * 顺丰合作伙伴Id
*/ */
private static final String partnerId = SystemConfig.p.getProperty("sf.partnerID"); //private static final String partnerId = SystemConfig.p.getProperty("sf.partnerID");
private static final String partnerId = "XXYZ";
private static Map<String, String> headers = new HashMap<>(); private static Map<String, String> headers = new HashMap<>();
...@@ -168,15 +176,12 @@ public class FqHttpUtils { ...@@ -168,15 +176,12 @@ public class FqHttpUtils {
} }
public static CloseableHttpEntity sendHttpPost(String url, List<BasicNameValuePair> content) { public static CloseableHttpEntity sendHttpPost(String url, List<BasicNameValuePair> content) {
if (!url.contains("/")) {
return null;
}
String dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
//构建HttpClient实例 //构建HttpClient实例
CloseableHttpClient httpclient = null; CloseableHttpClient httpClient = null;
CloseableHttpResponse httpResponse = null; CloseableHttpResponse httpResponse = null;
try { try {
httpclient =HttpClients.createDefault(); SSLContext sslContext = SSLContextBuilder.create().useProtocol(SSLConnectionSocketFactory.SSL).loadTrustMaterial((x, y) -> true).build();
httpClient = HttpClientBuilder.create().setDefaultRequestConfig(requestConfig).setSSLContext(sslContext).setSSLHostnameVerifier((x, y) -> true).build();
//指定POST请求 //指定POST请求
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
httpPost.setConfig(requestConfig); httpPost.setConfig(requestConfig);
...@@ -196,23 +201,35 @@ public class FqHttpUtils { ...@@ -196,23 +201,35 @@ public class FqHttpUtils {
//发送请求 //发送请求
httpPost.setEntity(request); httpPost.setEntity(request);
httpResponse = httpclient.execute(httpPost); httpResponse = httpClient.execute(httpPost);
//读取响应 //读取响应
HttpEntity entity = httpResponse.getEntity(); HttpEntity entity = httpResponse.getEntity();
if (entity != null) { if (entity != null) {
String result = EntityUtils.toString(entity, CHARACTER_CODE_UTF8); String result = EntityUtils.toString(entity, CHARACTER_CODE_UTF8);
System.out.println(result);
log.info(result); log.info(result);
return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), result == null? null:JSONObject.parseObject(result)); return new CloseableHttpEntity(httpResponse.getStatusLine().getStatusCode(), result == null? null:JSONObject.parseObject(result));
} }
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
e.printStackTrace(); e.printStackTrace();
log.error("API HTTP POST UnsupportedEncodingException 请求异常 url={" + url + "}; error = " +e.getMessage() );
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
log.error("API HTTP POST IOException 请求异常 url={" + url + "}; error = " +e.getMessage() );
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
log.error("API HTTP POST NoSuchAlgorithmException 请求异常 url={" + url + "}; error = " +e.getMessage() );
} catch (KeyStoreException e) {
e.printStackTrace();
log.error("API HTTP POST KeyStoreException 请求异常 url={" + url + "}; error = " +e.getMessage() );
} catch (KeyManagementException e) {
e.printStackTrace();
log.error("API HTTP POST KeyManagementException 请求异常 url={" + url + "}; error = " +e.getMessage() );
} finally { } finally {
if (httpclient != null) { if (httpClient != null) {
try { try {
httpclient.close(); httpClient.close();
} catch (IOException e) { } catch (IOException 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