Commit 87224ad6 by zhengyunfei

发货备注

parent 19ebf622
...@@ -2,7 +2,6 @@ package com.yunniu.farming.webadmin.controller; ...@@ -2,7 +2,6 @@ package com.yunniu.farming.webadmin.controller;
import com.yunniu.farming.common.plugin.PageInfo; import com.yunniu.farming.common.plugin.PageInfo;
import com.yunniu.farming.result.Result; import com.yunniu.farming.result.Result;
import com.yunniu.farming.webadmin.model.GroupBuy;
import com.yunniu.farming.webadmin.model.GroupOrder; import com.yunniu.farming.webadmin.model.GroupOrder;
import com.yunniu.farming.webadmin.model.OrderMain; import com.yunniu.farming.webadmin.model.OrderMain;
import com.yunniu.farming.webadmin.model.OrderSub; import com.yunniu.farming.webadmin.model.OrderSub;
...@@ -10,7 +9,10 @@ import com.yunniu.farming.webadmin.service.GroupOrderService; ...@@ -10,7 +9,10 @@ import com.yunniu.farming.webadmin.service.GroupOrderService;
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.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -55,13 +57,14 @@ public class GroupOrderController { ...@@ -55,13 +57,14 @@ public class GroupOrderController {
/** /**
* 发货 * 发货
*
* @param id * @param id
* @return * @return
*/ */
@RequestMapping(value = "/updateFwStatus",method = RequestMethod.GET) @RequestMapping(value = "/updateFwStatus", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public Result updateFwStatus(Long id) { public Result updateFwStatus(Long id, String remark) {
return Result.success(groupOrderService.sendOutGoods(id)); return Result.success(groupOrderService.sendOutGoods(id, remark));
} }
/** /**
......
...@@ -40,6 +40,8 @@ public class GroupOrder { ...@@ -40,6 +40,8 @@ public class GroupOrder {
private String createBy; private String createBy;
private String remark;
/** /**
* 辅助对象:分页信息对象 * 辅助对象:分页信息对象
*/ */
......
...@@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; ...@@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.yunniu.farming.common.plugin.PageInfo; import com.yunniu.farming.common.plugin.PageInfo;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -107,6 +106,7 @@ public class OrderMain { ...@@ -107,6 +106,7 @@ public class OrderMain {
private Integer ipaytype; // 支付方式[10:微信支付.20:支付宝支付.30积分支付] private Integer ipaytype; // 支付方式[10:微信支付.20:支付宝支付.30积分支付]
private String sremark; // 备注信息 private String sremark; // 备注信息
private String remark; // 发货备注信息
......
...@@ -29,7 +29,7 @@ public interface GroupOrderService { ...@@ -29,7 +29,7 @@ public interface GroupOrderService {
boolean updateRefundStatus(String outRefundNo); boolean updateRefundStatus(String outRefundNo);
int sendOutGoods(Long id); int sendOutGoods(Long id, String remark);
int successOrder(Long id); int successOrder(Long id);
} }
...@@ -16,6 +16,7 @@ import com.yunniu.farming.webadmin.service.GroupOrderService; ...@@ -16,6 +16,7 @@ import com.yunniu.farming.webadmin.service.GroupOrderService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
...@@ -147,6 +148,7 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -147,6 +148,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
public boolean updateRefundStatus(String outRefundNo) { public boolean updateRefundStatus(String outRefundNo) {
OrderMain order = orderDao.getBySdef1(outRefundNo); OrderMain order = orderDao.getBySdef1(outRefundNo);
order.setIrefundstatus(OrderMain.STATUS_REFUND_SUC); order.setIrefundstatus(OrderMain.STATUS_REFUND_SUC);
order.setIstatus(OrderMain.STATUS_COMPLETE);
int update = orderMainDao.updateById(order); int update = orderMainDao.updateById(order);
List<OrderSub> orderSubs = this.orderSubDao.selectList(Wrappers.<OrderSub>lambdaQuery().eq(OrderSub::getMainid, order.getId()).eq(OrderSub::getSdef1, 2)); List<OrderSub> orderSubs = this.orderSubDao.selectList(Wrappers.<OrderSub>lambdaQuery().eq(OrderSub::getMainid, order.getId()).eq(OrderSub::getSdef1, 2));
orderSubs.forEach(sub->{ orderSubs.forEach(sub->{
...@@ -161,14 +163,27 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -161,14 +163,27 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/** /**
* 发货 * 发货
*
* @param id * @param id
* @param remark
* @return * @return
*/ */
@Override @Override
public int sendOutGoods(Long id) { @Transactional(rollbackFor = Exception.class)
public int sendOutGoods(Long id, String remark) {
GroupOrder order = orderDao.selectById(id); GroupOrder order = orderDao.selectById(id);
order.setGroupStatus("2"); order.setGroupStatus("2");
return orderDao.updateById(order); order.setRemark(remark);
int update = orderDao.updateById(order);
if (update > 0) {
OrderMain orderMain = new OrderMain();
orderMain.setIstatus(OrderMain.STATUS_WAITING);
orderMain.setGroupOrderId(id);
orderMainDao.update(orderMain, Wrappers.<OrderMain>lambdaUpdate()
.set(OrderMain::getIstatus, OrderMain.STATUS_WAITING)
.eq(OrderMain::getGroupOrderId, id));
}
return update;
} }
/** /**
......
...@@ -258,7 +258,7 @@ public class WxServiceImpl implements WxService { ...@@ -258,7 +258,7 @@ public class WxServiceImpl implements WxService {
parameters.put("refund_fee_type", "CNY"); // 默认人民币:CNY parameters.put("refund_fee_type", "CNY"); // 默认人民币:CNY
parameters.put("total_fee", decimalFormat.format(tradeMoney * 100)); // 订单总金额 parameters.put("total_fee", decimalFormat.format(tradeMoney * 100)); // 订单总金额
if (order.getIrefundstatus().equals(OrderMain.STATUS_APPLICATION)) { if (order.getIrefundstatus().equals(OrderMain.STATUS_APPLICATION)) {
parameters.put("refund_fee", decimalFormat.format(tradeMoney * 100)); // 订单总金额 parameters.put("refund_fee", decimalFormat.format(order.getIrefundmoney() * 100)); // 订单总金额
}else { }else {
parameters.put("refund_fee", decimalFormat.format(order.getIrefundmoney() * 100)); // 退款金额 parameters.put("refund_fee", decimalFormat.format(order.getIrefundmoney() * 100)); // 退款金额
} }
......
...@@ -15,10 +15,10 @@ public class WxConfigUtil { ...@@ -15,10 +15,10 @@ public class WxConfigUtil {
public final static String UNIFIED_ORDER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder"; public final static String UNIFIED_ORDER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
public final static String PROFIT_SHARING_URL = "https://api.mch.weixin.qq.com/secapi/pay/profitsharing"; public final static String PROFIT_SHARING_URL = "https://api.mch.weixin.qq.com/secapi/pay/profitsharing";
public final static String PROFIT_SHARING_ADDRECEIVER = "https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver"; public final static String PROFIT_SHARING_ADDRECEIVER = "https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver";
// public final static String notify_url = "https://farming.nyinhong.com/wx/notify"; // 订单回调接口 public final static String notify_url = "http://proud-panther-51.n.gaoyixia.com:8081/wx/notify"; // 订单回调接口
public final static String notify_url = "https://qpxdnyy.com/wx/notify"; // 订单回调接口 // public final static String notify_url = "https://qpxdnyy.com/wx/notify"; // 订单回调接口
// public final static String refund_notify_url = "https://farming.nyinhong.com/wx/wxRefundNotify"; // 订单回调接口 public final static String refund_notify_url = "http://proud-panther-51.n.gaoyixia.com:8081/wx/wxRefundNotify"; // 订单回调接口
public final static String refund_notify_url = "https://qpxdnyy.com/wx/wxRefundNotify"; // 订单回调接口 // public final static String refund_notify_url = "https://qpxdnyy.com/wx/wxRefundNotify"; // 订单回调接口
public final static String REFUND_ORDER_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund"; public final static String REFUND_ORDER_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund";
public static String GET_MINICODE_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit"; public static String GET_MINICODE_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit";
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<result column="productid" property="productid" jdbcType="INTEGER"/> <result column="productid" property="productid" jdbcType="INTEGER"/>
<result column="ipaytype" property="ipaytype" jdbcType="INTEGER"/> <result column="ipaytype" property="ipaytype" jdbcType="INTEGER"/>
<result column="sremark" property="sremark" jdbcType="VARCHAR"/> <result column="sremark" property="sremark" jdbcType="VARCHAR"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="sdef1" property="sdef1" jdbcType="VARCHAR"/> <result column="sdef1" property="sdef1" jdbcType="VARCHAR"/>
<result column="sdef2" property="sdef2" jdbcType="VARCHAR"/> <result column="sdef2" property="sdef2" jdbcType="VARCHAR"/>
...@@ -319,9 +320,11 @@ ...@@ -319,9 +320,11 @@
sub.productid AS zproductid, sub.productid AS zproductid,
sub.sgoodprice AS zsgoodprice, sub.sgoodprice AS zsgoodprice,
sub.sproductname AS zsproductname, sub.sproductname AS zsproductname,
sub.spshortpic AS zspshortpic sub.spshortpic AS zspshortpic,
go.remark
FROM order_main ordermain FROM order_main ordermain
LEFT JOIN order_sub sub ON ordermain.id = sub.mainid LEFT JOIN order_sub sub ON ordermain.id = sub.mainid
left join group_order go on ordermain.group_order_id = go.id
WHERE ordermain.id = #{id,jdbcType=INTEGER} WHERE ordermain.id = #{id,jdbcType=INTEGER}
</select> </select>
......
...@@ -174,6 +174,7 @@ ...@@ -174,6 +174,7 @@
} }
} }
, {field: 'successTime', title: '成团时间'} , {field: 'successTime', title: '成团时间'}
, {field: 'remark', title: '发货备注'}
, {field: '', width: 130, title: '操作', toolbar: '#table-handle', fixed: "right"} , {field: '', width: 130, title: '操作', toolbar: '#table-handle', fixed: "right"}
] ]
] ]
...@@ -261,20 +262,46 @@ ...@@ -261,20 +262,46 @@
} }
; ;
}); });
var content = '<form class="layui-form" action="">' +
'<div class="layui-form-item">' +
'<label class="layui-form-label">发货备注</label>' +
'<div class="layui-input-block">' +
'<input type="text" name="inputName" placeholder="请输入内容" autocomplete="off" class="layui-input">' +
'</div>' +
'</div>';
//监听行工具事件 //监听行工具事件
table.on('tool(tableId)', function (obj) { table.on('tool(tableId)', function (obj) {
var data = obj.data; var data = obj.data;
if (obj.event === 'deliver') { if (obj.event === 'deliver') {
var id = obj.data.id; var id = obj.data.id;
layer.confirm( '确定接受订单吗?', function (index) { layer.open({
title: '确定接受订单吗?', // 弹出框标题
var param = {}; area: ['300px', '300px'], // 弹出框大小
param.id = id; shade: 0, // 不显示遮罩层
param.istatus = 30; type: 1,
content: '<form class="layui-form" action="">' +
'<div class="layui-form-item">' +
'<label class="layui-form-label">发货备注</label>' +
'<div class="layui-input-block">' +
'<input type="text" name="remark" placeholder="请输入内容" autocomplete="off" class="layui-input">' +
'</div>' +
'</div>' +
' <div class="layui-form-item">' +
' <div class="layui-input-block">' +
' <button type="submit" class="layui-btn" lay-submit lay-filter="confirm">确定</button>' +
' <button type="reset" class="layui-btn layui-btn-primary">取消</button>' +
' </div>' +
' </div>' +
'</form>',
success: function () {
// 对弹层中的表单进行初始化渲染
form.render();
// 表单提交事件
form.on('submit(confirm)', function (data) {
var field = data.field; // 获取表单字段值
console.log("111111111111111", field)
$.ajax({ $.ajax({
url: "updateFwStatus?id=" + id, url: "updateFwStatus?id=" + id + "&remark=" + field.remark,
type: "GET", type: "GET",
dataType: "json", dataType: "json",
success: function (result) { success: function (result) {
...@@ -288,7 +315,30 @@ ...@@ -288,7 +315,30 @@
} }
} }
}); });
// return false; // 阻止默认 form 跳转
}); });
}
});
// layer.confirm( '确定接受订单吗?', function (index) {
// var param = {};
// param.id = id;
// param.istatus = 30;
// $.ajax({
// url: "updateFwStatus?id=" + id,
// type: "GET",
// dataType: "json",
// success: function (result) {
// if (result.code == 100) {
// layer.msg(result.msg, {icon: 6, time: 1000}, function () {
// layer.close(index);
// table.reload('tableId');
// });
// } else {
// layer.msg(result.msg, {icon: 5});
// }
// }
// });
// });
} else if (obj.event === 'edit') { } else if (obj.event === 'edit') {
var id = obj.data.orderId; var id = obj.data.orderId;
var w = ($(window).width() * 0.95); var w = ($(window).width() * 0.95);
......
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