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

Aidea product update by Strive Date 2020-11-26

parent 27b8b4a0
......@@ -11,32 +11,10 @@
<artifactId>consult-module</artifactId>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>sys-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>order-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>member-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>shipping-address-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>shipping-address-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -96,7 +96,7 @@
<input type="text"
class="form-control" name="courierNumber"
id="courierNumber" readonly="readonly"
maxlength="50" placeholder="快递单号"
maxlength="50" placeholder=""
value="$!{data.courierNumber}" >
</div>
......@@ -110,33 +110,33 @@
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>收货地址<font style="color: red"></font></label>
<input type="text"
class="form-control" name="address"
id="address" readonly="readonly"
maxlength="50" placeholder="收货地址"
value="$!{data.address}"
>
</div>
<!--<div class="form-group form-md-line-input col-xs-5">-->
<!--<label>收货地址<font style="color: red"></font></label>-->
<!--<input type="text"-->
<!--class="form-control" name="address"-->
<!--id="address" readonly="readonly"-->
<!--maxlength="50" placeholder="收货地址"-->
<!--value="$!{data.address}"-->
<!--&gt;-->
<!--</div>-->
<div class="form-group form-md-line-input col-xs-5">
<label>订单状态<font style="color: red"></font></label>
<input type="text"
class="form-control" name="payStatus"
id="payStatus" readonly="readonly"
class="form-control" name="status"
id="status" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.payStatus}"
>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>支付备注<font style="color: red"></font></label>
<input type="text"
class="form-control" name="description"
id="description" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.description}"
value="$!{data.status}"
>
</div>
<!--<div class="form-group form-md-line-input col-xs-5">-->
<!--<label>支付备注<font style="color: red"></font></label>-->
<!--<input type="text"-->
<!--class="form-control" name="description"-->
<!--id="description" readonly="readonly"-->
<!--maxlength="50" placeholder=""-->
<!--value="$!{data.description}"-->
<!--&gt;-->
<!--</div>-->
<div class="form-group form-md-line-input col-xs-5">
<label>支付交易号<font style="color: red"></font></label>
<input type="text"
......@@ -158,10 +158,10 @@
</div>
<div class="form-group form-md-line-input col-xs-8">
<label>订单取消原因<font style="color: red"></font></label>
<textarea class="form-control" id="orderCancel" name="orderCancel" rows="3" readonly>$!{data.orderCancel}</textarea>
</div>
<!--<div class="form-group form-md-line-input col-xs-8">-->
<!--<label>订单取消原因<font style="color: red"></font></label>-->
<!--<textarea class="form-control" id="orderCancel" name="orderCancel" rows="3" readonly>$!{data.orderCancel}</textarea>-->
<!--</div>-->
</div>
......@@ -193,9 +193,9 @@
<div class="box-footer">
#if($shiro.hasPermission("qy:order:edit"))
<button class="btn btn-primary" onclick="save()">保存</button>
<button class="btn btn-primary" onclick="save()">订单出库</button>
#end
<a href="#springUrl('/a/order/list')" class="btn btn-default">取消</a>
<a href="#springUrl('/a/order/listout')" class="btn btn-default">取消</a>
</div>
<!--</form>-->
<!-- /.box-body -->
......@@ -243,6 +243,31 @@
var csrf_header='${_csrf.headerName}';
var areaList = [];
let status = `$!{data.status}`;
if (status != null && status != '') {
let str = "";
switch (status) {
case '0':
str = "待确认";
break;
case '1':
str = "待付款";
break;
case '2':
str = "待发货";
break;
case '3':
str = "待收货";
break;
case '4':
str = "已完成";
break;
case '5':
str = "已取消";
break;
}
$('input[name="status"]').val(str);
}
//扫码全局变量
var scanCodeStr = "";
......@@ -306,7 +331,6 @@
}
scanNumEle.val(count);
$('textarea[name="scanGoodsCode"]').text(scanCodeStr);
......@@ -511,8 +535,8 @@
});
return;
}
var id = $("#id").val()
var orderAmount = $("#orderAmount").val()
var id = $("#id").val();
var orderAmount = $("#orderAmount").val();
var datas = [];
$('.translate').each(function (index,item){
const idDetail = $(item).find('[name="idDetail"]').val()
......@@ -529,32 +553,34 @@
amount : amount,
orderAmount :orderAmount
})
})
});
var url = "#springUrl('/a/order/formData')"
var url = "#springUrl('/a/waybill/orderSendOutForWaybill')";
$.ajax({
url: url,
type: "POST",
dateType:'json',
headers:{"Accept": "application/json;charset=UTF-8"},
data : {_csrf:csrf,_csrf_header:csrf_header,datas:JSON.stringify(datas)},
data : { _csrf: csrf,
_csrf_header: csrf_header,
orderId: $("#id").val() },
success :function (rsp) {
if(rsp.errorNo == "0"){
Cfapp.alert({
message: "修改成功",
message: "出库成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/order/list')";
location.href = "#springUrl('/a/order/listout')";
}
});
}else{
Cfapp.alert({
message: "修改失败",
message: "出库失败",
btntext: "确定",
success: function () {
let idTmp = $('input[name="id"]').val();
location.href = "#springUrl('/a/order/form?id="+idTmp+"')";
location.href = "#springUrl('/a/order/sendOut?id="+idTmp+"')";
}
});
}
......
......@@ -163,7 +163,15 @@
<textarea class="form-control" id="orderCancel" name="orderCancel" rows="3" readonly>$!{data.orderCancel}</textarea>
</div>
<div class="form-group form-md-line-input col-xs-5">
<label>是否三期用户<font style="color: red"></font></label>
<input type="text"
class="form-control" name="isThree"
id="isThree" readonly="readonly"
maxlength="50" placeholder=""
value="$!{isThree}"
>
</div>
</div>
</div>
......@@ -241,8 +249,12 @@
var goodsList = [];
var isView = `$!{isView}`;
let isThree = `$!{isThree}`;
if (isThree != null && isThree != '') {
$('input[name="isThree"]').val(isThree == '0' ? '是' : '否');
}
let status = `$!{data.status}`;
console.log(status);
if (status != null && status != '') {
let str = "";
switch (status) {
......
......@@ -207,7 +207,11 @@
<th>支付交易号</th>
<th>是否开票</th>
<th>创建时间</th>
<th>确认时间</th>
<th>付款时间</th>
<th>发货时间</th>
<th>签收时间</th>
<th>取消时间</th>
<th>操作</th>
</tr>
</thead>
......@@ -349,7 +353,6 @@
{
"mData": "tradeNo"
}
,
{
"mData": "confirm"
......@@ -359,10 +362,26 @@
"mData": "createTime"
}
,
{
"mData": "orderTime"
}
,
{
"mData": "payTime"
}
,
{
"mData": "sendExpressDateStr"
}
,
{
"mData": "acceptExpressDateStr"
}
,
{
"mData": "cancelTime"
}
,
{
"mData": "id"
}
......@@ -477,15 +496,19 @@
,
{
"aTargets": [12],
"mData": "payTime",
"mData": "createTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
if (time.indexOf("1970") != -1) {
return '';
}
return formatDates(a);
}
}
,
{
"aTargets": [13],
"mData": "createTime",
"mData": "orderTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
if (time.indexOf("1970") != -1) {
......@@ -497,10 +520,50 @@
,
{
"aTargets": [14],
"mData": "payTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
if (time.indexOf("1970") != -1) {
return '';
}
return formatDates(a);
}
}
,
{
"aTargets": [15],
"mData": "sendExpressDateStr",
"mRender": function (a, b, c, d) {
return a;
}
}
,
{
"aTargets": [16],
"mData": "acceptExpressDateStr",
"mRender": function (a, b, c, d) {
return a;
}
}
,
{
"aTargets": [17],
"mData": "cancelTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
if (time.indexOf("1970") != -1) {
return '';
}
return formatDates(a);
}
}
,
{
"aTargets": [18],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:order:edit"))';
html += '<div class="btn-group">\n' +
html += '<div class="btn-group" style="min-width: 100px;">\n' +
'<button type="button" class="btn btn-success btn-flat">操作</button>\n' +
'<button type="button" class="btn btn-success btn-flat dropdown-toggle" data-toggle="dropdown">\n' +
' <span class="caret"></span>\n' +
......
......@@ -138,13 +138,13 @@
</div>
<div class="col-xs-2">
<select id="status" name="status" class="form-control required">
<option value="">请选择订单状态</option>
<option value="0">待确认</option>
<option value="1">待付款</option>
<option value="2">待发货</option>
<!--<option value="">请选择订单状态</option>-->
<!--<option value="0">待确认</option>-->
<!--<option value="1">待付款</option>-->
<option selected="selected" value="2">待发货</option>
<option value="3">待收货</option>
<option value="4">已完成</option>
<option value="5">已取消</option>
<!--<option value="4">已完成</option>-->
<!--<option value="5">已取消</option>-->
</select>
</div>
......@@ -253,6 +253,7 @@
<script>
var csrf = '${_csrf.token}';
var csrf_header = '${_csrf.headerName}';
//var isFirst = true;
//咨询单列表通过订单编码跳转单条订单信息
var orderCode = `${orderCode}`;
......@@ -288,6 +289,15 @@
aoData.push(params);
});
// if (isFirst) {
// isFirst = false;
// for (let i=0; i<aoData.length; i ++) {
// if (aoData.name == 'status') {
// aoData.value = "2";
// }
// }
// }
$.ajax({
"type": "GET",
"url": sSource,
......
......@@ -72,6 +72,10 @@
<result column="address_des" property="addressDes"/>
<result column="consultCode" property="consultCode"/>
<result column="nickName" property="nickName"/>
<result column="order_time" property="orderTime"/>
<result column="cancel_time" property="cancelTime"/>
<result column="sendExpressDateStr" property="sendExpressDateStr"/>
<result column="acceptExpressDateStr" property="acceptExpressDateStr"/>
<collection property="list" ofType="com.cftech.order.model.ProductVO">
<result column="product_name" property="productName"/>
</collection>
......@@ -206,7 +210,8 @@
`doctor_id`,
`clerk_id`,
address_des,
order_time
order_time,
cancel_time
)
values
(
......@@ -238,7 +243,8 @@
#{doctorId, jdbcType=BIGINT},
#{clerkId, jdbcType=BIGINT},
#{addressDes, jdbcType=VARCHAR},
#{orderTime, jdbcType=TIMESTAMP}
#{orderTime, jdbcType=TIMESTAMP},
#{cancelTime, jdbcType=TIMESTAMP}
)
</insert>
<update id="deleteAll" >
......@@ -285,13 +291,42 @@
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMapList">
SELECT
<include refid="sqlColumns"/>, cs.consult_id consultCode, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName
o.id,
o.openid,
t.product_number,
o.consult_id,
t.product_name,
o.number,
o.pay_time,
o.pay_amount,
o.order_amount,
o.total_amount,
o.pay_status,
o.order_cancel,
o.trade_no,
o.description,
o.STATUS,
o.create_time,
o.update_time,
o.confirm,
d.drugs_num,
o.courier_number,
o.address_des,
t.id as productId,
cs.consult_id consultCode,
CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName,
o.address_id,
order_time,
cancel_time,
DATE_FORMAT(aw.send_express_date, '%Y-%m-%d %H:%i') sendExpressDateStr,
DATE_FORMAT(aw.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDateStr
FROM t_order o
LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id
LEFT JOIN t_shipping_address s ON o.address_id = s.id
LEFT JOIN t_order_details d ON o.id = d.order_id
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
LEFT JOIN wx_mp_fanss f ON f.openid = o.openid
LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id
<include refid="sqlWhere"/>
<if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
GROUP BY o.id
......@@ -400,7 +435,10 @@
address_des = #{addressDes, jdbcType=VARCHAR},
</if>
<if test="orderTime != null">
order_time = #{orderTime, jdbcType=TIMESTAMP}
order_time = #{orderTime, jdbcType=TIMESTAMP},
</if>
<if test="cancelTime != null">
cancel_time = #{cancelTime, jdbcType=TIMESTAMP}
</if>
</set>
where id=#{id,jdbcType=BIGINT}
......@@ -480,6 +518,9 @@
<if test="status != null and status == 2">
pay_time = now(),
</if>
<if test="status != null and status == 5 and orderCancel!=null and orderCancel != ''">
cancel_time = now(),
</if>
<if test="orderCancel!=null and orderCancel != ''">
order_cancel = #{orderCancel}
</if>
......@@ -607,7 +648,10 @@
</select>
<select id="isThreeUsers" resultType="java.lang.Integer">
SELECT COUNT(1) FROM wx_mp_fanss f INNER JOIN wx_mp_member m ON f.openid = m.open_id
WHERE f.delflag = '0' AND m.del_flag = '0' AND m.compan = '0' AND m.open_id = #{openid}
SELECT COUNT(1)
FROM wx_mp_fanss f
INNER JOIN wx_mp_member m ON f.openid = m.open_id
INNER JOIN t_aidea_authentication au ON m.cardid = au.id_card
WHERE f.delflag = '0' AND m.del_flag = '0' AND au.del_flag = '0' AND m.open_id = #{openid}
</select>
</mapper>
\ No newline at end of file
......@@ -103,6 +103,8 @@ public class Order extends OrderDetail implements Serializable {
private List<ProductVO> list;
private Date cancelTime;
/**
* 搜索字段
*/
......@@ -116,6 +118,9 @@ public class Order extends OrderDetail implements Serializable {
private String orderStartTime;//订单开始时间
private String orderEndTime;//订单结束时间
private String nickName;//患者昵称
private String sendExpressDateStr;//发件时间
private String acceptExpressDateStr;//签收时间
public Order() {
......@@ -498,4 +503,28 @@ public class Order extends OrderDetail implements Serializable {
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public String getSendExpressDateStr() {
return sendExpressDateStr;
}
public void setSendExpressDateStr(String sendExpressDateStr) {
this.sendExpressDateStr = sendExpressDateStr;
}
public String getAcceptExpressDateStr() {
return acceptExpressDateStr;
}
public void setAcceptExpressDateStr(String acceptExpressDateStr) {
this.acceptExpressDateStr = acceptExpressDateStr;
}
public Date getCancelTime() {
return cancelTime;
}
public void setCancelTime(Date cancelTime) {
this.cancelTime = cancelTime;
}
}
\ No newline at end of file
......@@ -3,6 +3,12 @@ package com.cftech.order.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.org.api.QyMsgUtil;
import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService;
import com.cftech.core.util.SystemConfig;
import com.cftech.order.model.Order;
import com.cftech.order.model.OrderFromVO;
import com.cftech.order.model.OrderVO;
......@@ -32,6 +38,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
......@@ -61,6 +68,15 @@ public class OrderController {
@Autowired
private OrderDetailsController orderDetailsController;
@Autowired
private MpAccountsService accountsService;
@Autowired
private QyuserService qyuserService;
@Autowired
private QyMsgUtil qyMsgUtil;
//列表页面
@RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/list")
......@@ -365,10 +381,46 @@ public class OrderController {
Integer integer = orderService.updateStatus(id, status, orderCancel);
//设置已付款
if (integer > 0){
//线下付款成功
if (StringUtils.equals(status, "2")) {
sendQyWechatMassage(id);
}
rtnJson.put("errorNo","0");
return rtnJson;
}
rtnJson.put("errorNo","1");
return rtnJson;
}
/**
* 推送企业微信消息
*/
public boolean sendQyWechatMassage(Long orderId) {
Long accounts = Long.parseLong(SystemConfig.p.getProperty("QY_SEND_APPID"));
MpAccountsEntity accountsEntity = accountsService.getDetail(accounts);
Long agenId = Long.parseLong(accountsEntity.getAgentId());
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.equal("o.id", orderId);
List<Order> orders = orderService.fetchSearchByPage(orderConds, null, 0, 0);
if (orders == null || orders.size() != 1) {
return false;
}
Conds qyuserConds = new Conds();
qyuserConds.equal("t.del_flag", Constants.DEL_FLAG_0);
qyuserConds.equal("t.user_type", "4");//订单员职业
List<Qyuser> qyusers = qyuserService.fetchSearchByPage(qyuserConds, null, 0, 0);
if (qyusers == null || qyusers.size() <= 0) {
return false;
}
//推送客服消息
Order order = orders.get(0);
String msg = SystemConfig.p.getProperty("QY_SEND_ORDERCLERK_MSG") + order.getNumber();
qyMsgUtil.sendText(accounts, false, qyusers, null, null, agenId, msg, false);
return true;
}
}
......@@ -41,6 +41,22 @@
<artifactId>accounts-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>sys-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>member-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>shipping-address-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -155,7 +155,7 @@
<div class="form-group form-md-line-input col-md-12">
<label>药品简介</label>
<textarea type="text" required class="form-control pull-right"
value="" maxlength="500" required
value="" maxlength="500" required rows="5"
name="description" placeholder="药品简介"
>$!{data.description}</textarea>
</div>
......@@ -178,10 +178,10 @@
</div>
<div class="form-group form-md-line-input col-md-12">
<label>服用频率</label>
<label>服用频率<span style="color:red;">(格式“ 1/10 ” :1表示每天服用数量,10表示单盒药品总数)</span></label>
<input type="text" required class="form-control pull-right"
value="$!{data.takeFrequency}" maxlength="500" required
name="takeFrequency" placeholder="服用频率"
name="takeFrequency" placeholder="1/100"
>
</div>
......@@ -298,7 +298,15 @@
<script src="common/component/uePicPicker.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<script>
let description = `$!{data.description}`;
if (description != null && description != '') {
$("textarea[name='description']").text(description.replace(/<br\/>/g, "\r\n"));
}
$().ready(function () {
let redingType = $("#redingType").val();
let redingYes = $("#redingYes").val();
if (redingType==redingYes){
......@@ -409,6 +417,8 @@
messages: {},
submitHandler: function (form) {
$("#save").attr("disabled", true);
console.log($("textarea[name='description']").val());
var data = $("#myForm").serializeJSON();
var productImg = coverPP.getStringValues().split(',')[0];
var productImgDetail = coverPPDetail.getStringValues();
......@@ -416,6 +426,7 @@
data.classifyId = classify;
data.productImg = productImg;
data.productImgDetail = productImgDetail;
$.post("#springUrl('/a/product/formData')", data, function (returnobj) {
$("#save").attr("disabled", false);
if (returnobj.errorNo == 2) { //保存成功
......
......@@ -2,6 +2,7 @@ package com.cftech.product.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.util.StringUtils;
import com.cftech.product.model.Product;
import com.cftech.product.service.ProductService;
import com.cftech.core.poi.ExcelKit;
......@@ -12,14 +13,12 @@ import com.cftech.core.util.Constants;
import com.cftech.productclassify.model.Productclassify;
import com.cftech.productclassify.service.ProductclassifyService;
import com.cftech.productintowareroom.model.ProductIntoWareroom;
import com.cftech.sys.security.PermissionSign;
import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
......@@ -98,6 +97,9 @@ public class ProductController {
Long accountsId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject();
try {
if (StringUtils.isNotBlank(product.getDescription())) {
product.setDescription(product.getDescription().replace("\n", "<br/>"));
}
if (product != null && product.getId() != null) {
product.setUpdateBy(UserUtils.getUser().getId());
productService.update(product);
......
......@@ -33,6 +33,8 @@
<result column="description" property="description"/>
<result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/>
<result column="route_des" property="routeDes"/>
<result column="filter_result" property="filterResult"/>
</resultMap>
<sql id="sqlWhere">
......@@ -75,12 +77,12 @@
monthly_card,
express_type_id,
temperature_range,
CONVERT( AES_DECRYPT(t.contact, 'aideakey') USING UTF8) contact,
CONVERT( AES_DECRYPT(t.mobile, 'aideakey') USING UTF8) mobile,
CONVERT( AES_DECRYPT(t.province, 'aideakey') USING UTF8) province,
CONVERT( AES_DECRYPT(t.city, 'aideakey') USING UTF8) city,
CONVERT( AES_DECRYPT(t.county, 'aideakey') USING UTF8) county,
CONVERT( AES_DECRYPT(t.address, 'aideakey') USING UTF8) address,
contact,
mobile,
province,
city,
county,
address,
address_id,
send_express_date,
accept_express_date,
......@@ -92,7 +94,8 @@
update_time,
description,
create_by,
update_by
update_by,
filter_result
</sql>
<sql id="insertSqlColumns">
......@@ -125,7 +128,9 @@
update_time,
description,
create_by,
update_by
update_by,
route_des,
filter_result
</sql>
......@@ -149,15 +154,15 @@
#{monthlyCard, jdbcType=VARCHAR},
#{expressTypeId, jdbcType=VARCHAR},
#{temperatureRange, jdbcType=VARCHAR},
AES_ENCRYPT(#{contact, jdbcType=VARBINARY}, 'aideakey'),
AES_ENCRYPT(#{mobile, jdbcType=VARBINARY}, 'aideakey'),
AES_ENCRYPT(#{province, jdbcType=VARBINARY}, 'aideakey'),
AES_ENCRYPT(#{city, jdbcType=VARBINARY}, 'aideakey'),
AES_ENCRYPT(#{county, jdbcType=VARBINARY}, 'aideakey'),
AES_ENCRYPT(#{address, jdbcType=VARBINARY}, 'aideakey'),
#{contact, jdbcType=VARCHAR},
#{mobile, jdbcType=VARCHAR},
#{province, jdbcType=VARCHAR},
#{city, jdbcType=VARCHAR},
#{county, jdbcType=VARCHAR},
#{address, jdbcType=VARCHAR},
#{addressId, jdbcType=VARCHAR},
now(),
now(),
#{sendExpressDate, jdbcType=TIMESTAMP},
#{acceptExpressDate, jdbcType=TIMESTAMP},
#{waybillRemark, jdbcType=VARCHAR},
#{accountsId, jdbcType=BIGINT},
#{delFlag, jdbcType=TINYINT},
......@@ -166,7 +171,9 @@
now(),
#{description, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT}
#{updateBy, jdbcType=BIGINT},
#{routeDes, jdbcType=VARCHAR},
#{filterResult, jdbcType=VARCHAR}
)
</insert>
......@@ -191,12 +198,12 @@
t.monthly_card monthlyCard,
t.express_type_id expressTypeId,
t.temperature_range temperatureRange,
CONVERT( AES_DECRYPT(t.contact, 'aideakey') USING UTF8) contact,
CONVERT( AES_DECRYPT(t.mobile, 'aideakey') USING UTF8) mobile,
CONVERT( AES_DECRYPT(t.province, 'aideakey') USING UTF8) province,
CONVERT( AES_DECRYPT(t.city, 'aideakey') USING UTF8) city,
CONVERT( AES_DECRYPT(t.county, 'aideakey') USING UTF8) county,
CONVERT( AES_DECRYPT(t.address, 'aideakey') USING UTF8) address,
t.contact,
t.mobile,
t.province,
t.city,
t.county,
t.address,
t.address_id addressId,
DATE_FORMAT(t.send_express_date, '%Y-%m-%d %H:%i') sendExpressDateStr,
DATE_FORMAT(t.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDateStr,
......@@ -216,7 +223,9 @@
od.price,
AES_DECRYPT(m.name, 'aideakey') memberName,
cs.consult_id consultSheetCode,
qyu.name storageManageName
qyu.name storageManageName,
route_des routeDes,
filter_result filterResult
FROM t_aidea_waybill t
LEFT JOIN t_aidea_consult_sheet cs ON cs.id = t.consult_id
LEFT JOIN t_order o ON t.order_id = o.id
......@@ -246,12 +255,12 @@
t.monthly_card monthlyCard,
t.express_type_id expressTypeId,
t.temperature_range temperatureRange,
CONVERT( AES_DECRYPT(t.contact, 'aideakey') USING UTF8) contact,
CONVERT( AES_DECRYPT(t.mobile, 'aideakey') USING UTF8) mobile,
CONVERT( AES_DECRYPT(t.province, 'aideakey') USING UTF8) province,
CONVERT( AES_DECRYPT(t.city, 'aideakey') USING UTF8) city,
CONVERT( AES_DECRYPT(t.county, 'aideakey') USING UTF8) county,
CONVERT( AES_DECRYPT(t.address, 'aideakey') USING UTF8) address,
t.contact,
t.mobile,
t.province,
t.city,
t.county,
t.address,
t.address_id addressId,
DATE_FORMAT(t.send_express_date, '%Y-%m-%d %H:%i') sendExpressDateStr,
DATE_FORMAT(t.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDateStr,
......@@ -271,7 +280,9 @@
od.price,
AES_DECRYPT(m.name, 'aideakey') memberName,
cs.consult_id consultSheetCode,
qyu.name storageManageName
qyu.name storageManageName,
route_des routeDes,
filter_result filterResult
FROM t_aidea_waybill t
LEFT JOIN t_aidea_consult_sheet cs ON cs.id = t.consult_id
LEFT JOIN t_order o ON t.order_id = o.id
......@@ -324,22 +335,22 @@
temperature_range = #{temperatureRange, jdbcType=VARCHAR},
</if>
<if test="contact != null">
contact = AES_ENCRYPT(#{contact, jdbcType=VARBINARY}, 'aideakey'),
contact = #{contact, jdbcType=VARCHAR},
</if>
<if test="mobile != null">
mobile = AES_ENCRYPT(#{mobile, jdbcType=VARBINARY}, 'aideakey'),
mobile = #{mobile, jdbcType=VARCHAR},
</if>
<if test="province != null">
province = AES_ENCRYPT(#{province, jdbcType=VARBINARY}, 'aideakey'),
province = {province, jdbcType=VARCHAR},
</if>
<if test="city != null">
city = AES_ENCRYPT(#{city, jdbcType=VARBINARY}, 'aideakey'),
city = #{city, jdbcType=VARCHAR},
</if>
<if test="county != null">
county = AES_ENCRYPT(#{county, jdbcType=VARBINARY}, 'aideakey'),
county = #{county, jdbcType=VARCHAR},
</if>
<if test="address != null">
address = AES_ENCRYPT(#{address, jdbcType=VARBINARY}, 'aideakey'),
address = #{address, jdbcType=VARCHAR},
</if>
<if test="addressId != null">
address_id = #{addressId, jdbcType=VARCHAR},
......@@ -374,6 +385,12 @@
<if test="updateBy != null">
update_by = #{updateBy, jdbcType=BIGINT},
</if>
<if test="routeDes != null">
route_des = #{routeDes, jdbcType=BIGINT},
</if>
<if test="filterResult != null">
filter_result = #{filterResult, jdbcType=BIGINT},
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
......
......@@ -80,7 +80,7 @@ public class Waybill implements Serializable {
private Date sendExpressDate;
/* 收件时间 */
private Date acceptExpressDate;
/* 运单描述 */
/* 运单描述不可派发原因 */
private String waybillRemark;
/* 所属的账号 */
private Long accountsId;
......@@ -100,6 +100,16 @@ public class Waybill implements Serializable {
/* 更新人 */
private Long updateBy;
/**
*路由信息
*/
private String routeDes;
/**
* 筛单结果
*/
private String filterResult;
/**
* 非数据库字段
*/
......
package com.cftech.waybill.service;
import com.alibaba.fastjson.JSONObject;
import com.cftech.waybill.model.Waybill;
import com.cftech.core.generic.GenericService;
import javax.servlet.http.HttpServletRequest;
/**
* 顺丰物流运单Service
*
* @author Strive
* @date: 2020-10-21 15:04
* @date: 2020-10-21 15:04boolean
*/
public interface WaybillService extends GenericService<Waybill> {
......@@ -17,4 +20,10 @@ public interface WaybillService extends GenericService<Waybill> {
* @return
*/
Waybill fetchByWayBillId(String id);
/**
* 调用顺丰下订单接口
* @param orderId
*/
JSONObject orderSendOutForWaybill(HttpServletRequest request, Long orderId);
}
package com.cftech.waybill.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cftech.addresst.model.Address;
import com.cftech.addresst.model.AddressVO;
import com.cftech.addresst.service.AddressService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.util.Constants;
import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig;
import com.cftech.order.model.Order;
import com.cftech.order.service.OrderService;
import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.sys.model.User;
import com.cftech.sys.security.UserUtils;
import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.dao.WaybillMapper;
import com.cftech.waybill.service.WaybillService;
import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.cftech.waybill.utils.CloseableHttpEntity;
import com.cftech.waybill.utils.ExpressOrderInfoUtils;
import com.cftech.waybill.utils.FqConstants;
import com.cftech.waybill.utils.FqHttpUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* 顺丰物流运单ServiceImpl
......@@ -16,6 +42,7 @@ import org.springframework.stereotype.Service;
* @author Strive
* @date: 2020-10-21 15:04
*/
@Slf4j
@Service("waybillService")
public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements WaybillService {
......@@ -23,13 +50,150 @@ public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements W
@Qualifier("waybillMapper")
private WaybillMapper waybillMapper;
@Autowired
private OrderService orderService;
@Autowired
private OrderDetailsService orderDetailsService;
@Autowired
private AddressService addressService;
@Autowired
private CodingruleUtils codingruleUtils;
@Override
public GenericDao<Waybill> getGenericMapper() {
return waybillMapper;
}
@Override
public Waybill fetchByWayBillId(String id) {
return waybillMapper.fetchByWayBillId(id);
}
@Override
@Transactional
public JSONObject orderSendOutForWaybill(HttpServletRequest request, Long orderId) {
JSONObject retObj = new JSONObject();
Long accountsId = UserUtils.getmpaccounts(request);
User user = UserUtils.getUser();
try {
if (orderId == null) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "Request Params Is Null ! ");
return retObj;
}
//获取订单
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.equal("o.id", orderId);
List<Order> orders = orderService.fetchSearchByPage(orderConds, null, 0, 0);
if (orders == null || orders.size() != 1) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", " 订单不存在 ! ");
return retObj;
}
Order order = orders.get(0);
Conds detailConds = new Conds();
detailConds.equal("d.del_flag", Constants.DEL_FLAG_0);
detailConds.equal("o.id", orderId);
List<OrderDetails> odets = orderDetailsService.fetchSearchByPage(detailConds, null, 0, 0);
if (odets == null || odets.size() == 0) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", " 订单明细不存在 ! ");
return retObj;
}
Address address = addressService.fetchById(order.getAddressId());
if (address == null) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", " 收货地址不存在 ! ");
return retObj;
}
//生成物流数据
Waybill waybill = new Waybill();
waybill.setNumber(codingruleUtils.getNumber(accountsId, Waybill.class.getName()));
waybill.setConsultId(order.getConsultId());
waybill.setOpenId(order.getOpenid());
waybill.setStorageManage(String.valueOf(user.getId()));
waybill.setOrderId(order.getId());
waybill.setOrderCode(order.getNumber());
waybill.setContact(address.getAddressName());
waybill.setMobile(address.getPhone());
waybill.setProvince(address.getProvinceName());
waybill.setCity(address.getCityName());
waybill.setCounty(address.getCountyName());
waybill.setAddress(address.getAddress());
waybill.setAddressId(String.valueOf(order.getAddressId()));
//接口调用数据
JSONObject msgDataObj = ExpressOrderInfoUtils.generateWaybillOrder(order, odets, waybill);
Long timestamp = System.currentTimeMillis();//时间戳
String checkWord = SystemConfig.p.getProperty("sf.checkWord");
String msgDigest = ExpressOrderInfoUtils.generateSfDigest(msgDataObj.toString(), timestamp, checkWord);
System.out.println(msgDataObj.toString());
List<BasicNameValuePair> content = new ArrayList<>();
content.add(new BasicNameValuePair("partnerID", SystemConfig.p.getProperty("sf.partnerID")));//合作伙伴编码、顾客编码
content.add(new BasicNameValuePair("requestID", FqHttpUtils.generateUUID()));
content.add(new BasicNameValuePair("serviceCode", FqConstants.SF_ORDER_SEND_CODE));//接口服务代码
content.add(new BasicNameValuePair("timestamp", String.valueOf(timestamp)));
content.add(new BasicNameValuePair("msgDigest", msgDigest));
content.add(new BasicNameValuePair("msgData", msgDataObj.toString()));
CloseableHttpEntity closeableHttpEntity = FqHttpUtils.sendHttpPost(FqConstants.SF_ORDER_SEND_URL, content);
if (closeableHttpEntity != null && closeableHttpEntity.getCode() == 200) {
waybill.setDescription(msgDataObj.toString());
if (closeableHttpEntity.getRetObj().containsKey("apiResultCode") && StringUtils.equals(closeableHttpEntity.getRetObj().getString("apiResultCode"), "A1000")) {
JSONObject apiResultData = closeableHttpEntity.getRetObj().getJSONObject("apiResultData");
if (apiResultData.getBoolean("success")) {
JSONObject msgData = apiResultData.getJSONObject("msgData");
String originCode = msgData.getString("originCode");//原寄地区域代码,可用于顺丰电子运单标签打印
String destCode = msgData.getString("destCode");//目的地区域代码,可用于顺丰电子运单标签打
String filterResult = msgData.getString("filterResult");//筛单结果
waybill.setFilterResult(filterResult);
JSONArray waybillNoInfoList = msgData.getJSONArray("waybillNoInfoList");//顺丰运单号
for (int i=0; i<waybillNoInfoList.size(); i++) {
JSONObject obj = waybillNoInfoList.getJSONObject(i);
if (obj.getInteger("waybillType") == 1) {
waybill.setWaybillNo(obj.getString("waybillNo"));//顺丰运单号
}
}
JSONArray routeLabelInfo = msgData.getJSONArray("routeLabelInfo");//路由标签数据详细数据
for (int i=0; i<routeLabelInfo.size(); i++) {
JSONObject obj = routeLabelInfo.getJSONObject(i);
if (StringUtils.equals(obj.getString("code"),"1000")) {
waybill.setRouteDes(obj.getString("routeLabelData"));
}
}
waybill.setWaybillRemark(msgData.getString("remark"));//不可派发原因
waybillMapper.save(waybill);
retObj.put("errorNo", 0);
retObj.put("errorMsg", " 成功 ");
return retObj;
}
}
} else {
log.info("调用丰桥接口:订单编码 {} 错误!" + orderId);
retObj.put("errorNo", 1);
}
} catch (Exception e) {
retObj.put("errorNo", 1);
e.printStackTrace();
} finally {
log.info("调用丰桥接口:订单编码 {}" + orderId );
}
return retObj;
}
}
\ No newline at end of file
......@@ -27,6 +27,8 @@ public class ExpressOrderInfoUtils {
private static final String currencyCode = "HKD";
private static final String payMethod = "1";//寄方付
/**
* 下订单接口参数封装
* @param order
......@@ -41,22 +43,23 @@ public class ExpressOrderInfoUtils {
waybill.put("language", language);
waybill.put("orderId", order.getNumber());//快递单号
waybill.put("cargoDesc", "医疗药品");//托寄物描述
waybill.put("monthlyCard", "");//顺丰月结卡号
waybill.put("monthlyCard", "7551234567");//顺丰月结卡号
waybill.put("orderSource", "WECHAT_STORE");//平台编码 微信咨询平台
waybill.put("remark", waybillObj.getWaybillRemark());//订单备注
waybill.put("payMethod", payMethod);//寄放付
//业务需要增加
waybill.put("isReturnQRCode", "1");//是否返回用来推送业务的二维码 1:返回 0:不返回
//waybill.put("isReturnQRCode", "0");//是否返回用来推送业务的二维码 1:返回 0:不返回
//waybill.put("specialDeliveryTypeCode", "1");//特殊派送类型代码 1:身份验证
//waybill.put("specialDeliveryValue", "12345678");//特殊派件具体表述 证件类型:证件后8位如:1:09296231(1 表示身份证,暂不支持其他证件)
//waybill.put("isReturnSignBackRoutelabel", "0");//是否返回签回单路由标签: 默认0, 1:返回路由标签,0:不返回
waybill.put("isReturnRoutelabel", "0");//是否返回路由标签: 默认0, 1:返回路由标签, 0:不返回
//waybill.put("isReturnRoutelabel", "0");//是否返回路由标签: 默认0, 1:返回路由标签, 0:不返回
//waybill.put("podModelAddress", "url");//签单返回范本地址
//特殊需求药品,需冷冻、冷藏
if (StringUtils.isNoneBlank(waybillObj.getExpressTypeId())) {
waybill.put("expressTypeId", waybillObj.getExpressTypeId());//快件产品类别Id 12医药类 冷冻 冷藏
waybill.put("temperatureRange", waybillObj.getTemperatureRange());//1:冷藏 3:冷冻
//waybill.put("temperatureRange", waybillObj.getTemperatureRange());//1:冷藏 3:冷冻
}
//托寄物信息List
......@@ -64,12 +67,12 @@ public class ExpressOrderInfoUtils {
for (OrderDetails orderd: orderDetails) {
JSONObject cargo = new JSONObject();
cargo.put("name", orderd.getProductName());//商品名称
cargo.put("count", 1);//商品数量
cargo.put("count", orderd.getDrugsNum());//商品数量
cargo.put("unit", "盒");//商品单位
cargo.put("amount", orderd.getPrice());//商品价格
cargo.put("currency", currencyCode);//币种编码
cargoDetails.add(cargo);
}
waybill.put("cargoDetails", cargoDetails);
//收寄双方信息List
......@@ -78,21 +81,20 @@ public class ExpressOrderInfoUtils {
//寄件方信息
JSONObject sender = new JSONObject();
sender.put("contactType", "1");
sender.put("company", "康诺");
sender.put("contact", "小谢");
sender.put("tel", "15800815547");
sender.put("mobile", "15800815547");
sender.put("company", "扬州诺康大药房有限公司");
sender.put("contact", "吴赵龙");
sender.put("tel", "0514-82360278");
sender.put("mobile", "15150808407");
sender.put("country", countryCode);
sender.put("province", "上海市");
sender.put("city", "上海市");
sender.put("county", "闵行区");
sender.put("address", "江玮路100号");
sender.put("province", "江苏");
sender.put("city", "扬州市");
sender.put("county", "邗江区");
sender.put("address", "科技园路18号");
contactInfoList.add(sender);
//收件方信息
JSONObject recipient = new JSONObject();
recipient.put("contactType", "2");
//recipient.put("company", "");
recipient.put("contact", waybillObj.getContact());
recipient.put("tel", waybillObj.getMobile());
recipient.put("mobile", waybillObj.getMobile());
......@@ -168,7 +170,7 @@ public class ExpressOrderInfoUtils {
retObj.put("trackingType", 1);//1:根据顺丰运单号查询
JSONArray waybills = new JSONArray();
waybills.add(waybillObj.getWaybillNo());
waybills.add("SF7444420632664");
retObj.put("trackingNumber", waybills);//顺丰运单号
retObj.put("methodType", 1);//标准路由查询
} catch (Exception e) {
......@@ -185,13 +187,15 @@ public class ExpressOrderInfoUtils {
public static String generateSfDigest(String msgData, Long timestamp, String checkWord) {
String msgDigest = null;
try {
StringBuffer verifyText = new StringBuffer();
verifyText.append(msgData);
verifyText.append(timestamp);
verifyText.append(checkWord);
// StringBuffer verifyText = new StringBuffer();
// verifyText.append(msgData);
// verifyText.append(timestamp);
// verifyText.append(checkWord);
String verifyText = msgData + timestamp + checkWord;
//因业务报文中可能包含加号、空格等特殊字符,需要urlEnCode处理
String text = URLEncoder.encode(verifyText.toString(), "UTF-8");
String text = URLEncoder.encode(verifyText, "UTF-8");
//进行Md5加密
MessageDigest md5 = MessageDigest.getInstance("MD5");
......
package com.cftech.waybill.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cftech.core.util.SystemConfig;
import com.cftech.order.model.Order;
......@@ -194,7 +195,7 @@ public class FqHttpUtils {
//包装请求体
List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("partnerID", partnerId));
//params.add(new BasicNameValuePair("partnerID", partnerId));
params.addAll(content);
HttpEntity request = new UrlEncodedFormEntity(params, CHARACTER_CODE_UTF8);
......@@ -251,40 +252,49 @@ public class FqHttpUtils {
public static void main(String[] args) {
Order order = new Order();
order.setNumber("ORD20201022001");
List<OrderDetails> orders = new ArrayList<>();
OrderDetails orderDetail = new OrderDetails();
orderDetail.setProductName("药品");
orderDetail.setPrice(123.4);
Waybill waybill = new Waybill();
waybill.setExpressTypeId("12");
waybill.setTemperatureRange("1");
waybill.setWaybillRemark("加速送快递");
waybill.setContact("小明");
waybill.setMobile("13410934014");
waybill.setProvince("上海市");
waybill.setCity("上海市");
waybill.setCounty("徐汇区");
waybill.setAddress("虹口足球场");
order.setNumber("ORD20201022002");
//
// List<OrderDetails> orders = new ArrayList<>();
// OrderDetails orderDetail = new OrderDetails();
// orderDetail.setProductName("药品");
// orderDetail.setPrice(123.4);
// orders.add(orderDetail);
//
//
// Waybill waybill = new Waybill();
// waybill.setExpressTypeId("12");
// waybill.setTemperatureRange("1");
// waybill.setWaybillRemark("加速送快递");
// waybill.setContact("小明");
// waybill.setMobile("13410934014");
// waybill.setProvince("上海市");
// waybill.setCity("上海市");
// waybill.setCounty("徐汇区");
// waybill.setAddress("虹口足球场");
//
//
// JSONObject msgDataObj = ExpressOrderInfoUtils.generateWaybillOrder(order, orders, waybill);
JSONObject msgDataObj = ExpressOrderInfoUtils.generateRouteData(null);
String msgData = msgDataObj.toString();
Long timestamp = System.currentTimeMillis();//时间戳
//String checkWord = SystemConfig.p.getProperty("sf.checkWord");
String checkWord = "ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd";
String msgDigest = ExpressOrderInfoUtils.generateSfDigest(msgData, timestamp, checkWord);
JSONObject msgDataObj = ExpressOrderInfoUtils.generateWaybillOrder(order, orders, waybill);
String msgData = msgDataObj.toString();
Long timestamp = System.currentTimeMillis();
String code = FqConstants.SF_ORDER_SEND_CODE;
String msgDigest = ExpressOrderInfoUtils.generateSfDigest(msgData, timestamp, code);
System.out.println(msgData);
List<BasicNameValuePair> content = new ArrayList<>();
//content.add(new BasicNameValuePair("partnerID", SystemConfig.p.getProperty("sf.partnerID")));//合作伙伴编码、顾客编码
content.add(new BasicNameValuePair("partnerID", "NKDYFr"));//合作伙伴编码、顾客编码
content.add(new BasicNameValuePair("requestID", generateUUID()));
content.add(new BasicNameValuePair("serviceCode", generateUUID()));
content.add(new BasicNameValuePair("serviceCode", FqConstants.SF_ORDER_ROUTE_CODE));//接口服务代码
content.add(new BasicNameValuePair("timestamp", String.valueOf(timestamp)));
content.add(new BasicNameValuePair("msgDigest", msgDigest));
content.add(new BasicNameValuePair("msgData", msgData));
sendHttpPost(FqConstants.SF_ORDER_SEND_URL, content);
sendHttpPost(FqConstants.SF_ORDER_ROUTE_URL, content);
}
}
package com.cftech.waybill.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.order.model.Order;
import com.cftech.order.service.OrderService;
import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.service.WaybillService;
import com.cftech.core.poi.ExcelKit;
......@@ -8,7 +13,6 @@ import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.sys.security.PermissionSign;
import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......@@ -48,6 +52,8 @@ public class WaybillController {
@Autowired
private WaybillService waybillService;
@Autowired
private MpAccountsService accountsService;
//列表页面
@RequiresPermissions(value = WAYBILL_VIEW)
......@@ -215,4 +221,15 @@ public class WaybillController {
return list(request, model);
}
/**
* 订单出库
* @return
*/
@RequestMapping("/orderSendOutForWaybill")
@ResponseBody
public JSONObject orderSendOutForWaybill(HttpServletRequest request, Long orderId) {
return waybillService.orderSendOutForWaybill(request, orderId);
}
}
......@@ -25,6 +25,8 @@ QY_SEND_APPID=350
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A
#\u63A8\u9001\u836F\u5E08\u6D88\u606F\u5BA1\u6279\u54A8\u8BE2\u5355
QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A
#\u63A8\u9001\u8BA2\u5355\u5458\u53D1\u8D27\u6D88\u606F
QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801\uFF1A
#\u56FE\u7247\u4E0A\u4F20\u5730\u5740
#userfiles.imgdir=/mydata/fileResource
......@@ -40,21 +42,21 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY=DONGCHANGINT9527;
list.refreshtoken=true
jwt.domain=127.0.0.1
jwt.domain=pd.shxrtech.com
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
security.secure=false
#\uFFFD\u01F7\uFFFD\uFFFD\u01FC\uFFFD\u023A\uFFFD\uFFFD\u02B1\uFFFD\uFFFD\uFFFD\uFFFDMaster\uFFFD\uFFFD\uFFFD\u06B5\uFFFD\u04BB\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue\uFFFD\uFFFD\uFFFD\uFFFD
quartz.isCluster=false
#\u662F\u5426\u96C6\u7FA4 master\u4E3Atrue
quartz.isCluster=true
#\u987A\u4E30API\u914D\u7F6E\u53C2\u6570
#\u987A\u4E30\u5BA2\u6237\u7F16\u7801
sf.partnerID=XXYZ
sf.partnerID=NKDYFr
#\u987A\u4E30\u5BA2\u6237\u6821\u9A8C\u7801
sf.checkWord=5Nhuavqk0JG7zTYLtPKq7JpnceuekRcH
sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd
#\u987A\u4E30\u6708\u7ED3\u5361\u53F7
sf.monthlyCard=
sf.monthlyCard=7551234567
......
......@@ -132,8 +132,8 @@
<!-- <th>姓</th>-->
<!-- <th>名</th>-->
<th>微信OPENID</th>
<th>联系方式</th>
<th>会员名称</th>
<th>联系方式</th>
<th>来源</th>
<!-- <th>邀请码</th>-->
<!-- <th>客户分类</th>-->
......@@ -238,10 +238,10 @@
"mData": "openId"
},
{
"mData": "phone"
"mData": "name"
},
{
"mData": "name"
"mData": "phone"
},
{
"mData": "source"
......@@ -299,15 +299,15 @@
}
}, {
"aTargets": [4],
"mData": "phone",
"mData": "name",
"mRender": function (a, b, c, d) {
return c.phone.slice(0, 1) + '*' + c.phone.slice(2, 3);
return a.slice(0, 1) + '*' + a.slice(2, a.length);
}
}, {
"aTargets": [5],
"mData": "name",
"mData": "phone",
"mRender": function (a, b, c, d) {
return c.name.slice(0, 3) + '****' + c.name.slice(7);
return a.slice(0, 3) + '****' + a.slice(7);
}
}, {
"aTargets": [6],
......
......@@ -153,42 +153,26 @@ public class MemberServiceImpl extends GenericServiceImpl<Member> implements Mem
return rtnJson;
}
int i = 0;
MpAccountsEntity accounts= mpAccountsService.getMpAccountsAppid(memberVO.getAppId());
List<MemberVO> memberVOS = memberMapper.memberFormation(memberVO.getOpenid());
if (memberVOS == null || memberVOS.size() == 0) {
Member member = new Member();
memberVO.setNumber(codingruleUtils.getNumber(accounts.getId(), Member.class.getName()));
member.setOpenId(memberVO.getOpenid());
member.setName(memberVO.getMemberName());
member.setSex(Long.parseLong(memberVO.getSex()));
if (StringUtils.isNoneBlank(memberVO.getCardid())) {
//三期患者
if (IdcardUtils.idcardList.contains(memberVO.getCardid())) {
member.setCompan("0");//三期患者
}
}
member.setCardid(memberVO.getCardid());
member.setPhone(memberVO.getPhone());
member.setImageurl(memberVO.getImageUrl());
memberMapper.save(member);
} else {
memberVO.setNumber(codingruleUtils.getNumber(accounts.getId(), Member.class.getName()));
if (StringUtils.isNoneBlank(memberVO.getCardid())) {
//三期患者
if (IdcardUtils.idcardList.contains(memberVO.getCardid())) {
memberVO.setCompan("0");//三期患者
}
}
i = memberMapper.updateMember(memberVO);
}
if (i > 0) {
rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "修改成功");
return rtnJson;
} else {
rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg", "修改失败");
memberMapper.updateMember(memberVO);
rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "修改成功");
return rtnJson;
}
} catch (Exception e) {
......
......@@ -925,6 +925,18 @@
</exclusions>
</dependency>
<dependency>
<groupId>sf.csim</groupId>
<artifactId>printer-api</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>sf.csim</groupId>
<artifactId>waybill-api</artifactId>
<version>V1.1.1</version>
</dependency>
</dependencies>
<build>
<resources>
......
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