Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
farming
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑云飞
farming
Commits
87224ad6
Commit
87224ad6
authored
Dec 08, 2023
by
zhengyunfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发货备注
parent
19ebf622
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
124 additions
and
51 deletions
+124
-51
src/main/java/com/yunniu/farming/webadmin/controller/GroupOrderController.java
+8
-5
src/main/java/com/yunniu/farming/webadmin/model/GroupOrder.java
+2
-0
src/main/java/com/yunniu/farming/webadmin/model/OrderMain.java
+1
-1
src/main/java/com/yunniu/farming/webadmin/service/GroupOrderService.java
+1
-1
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupOrderServiceImpl.java
+17
-2
src/main/java/com/yunniu/farming/webadmin/service/impl/WxServiceImpl.java
+1
-1
src/main/java/com/yunniu/farming/wx/WxConfigUtil.java
+4
-4
src/main/resources/mappings/OrderMainMapper.xml
+11
-8
src/main/resources/templates/groupOrder/list.html
+79
-29
No files found.
src/main/java/com/yunniu/farming/webadmin/controller/GroupOrderController.java
View file @
87224ad6
...
...
@@ -2,7 +2,6 @@ package com.yunniu.farming.webadmin.controller;
import
com.yunniu.farming.common.plugin.PageInfo
;
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.OrderMain
;
import
com.yunniu.farming.webadmin.model.OrderSub
;
...
...
@@ -10,7 +9,10 @@ import com.yunniu.farming.webadmin.service.GroupOrderService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
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.List
;
...
...
@@ -55,13 +57,14 @@ public class GroupOrderController {
/**
* 发货
*
* @param id
* @return
*/
@RequestMapping
(
value
=
"/updateFwStatus"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/updateFwStatus"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Result
updateFwStatus
(
Long
id
)
{
return
Result
.
success
(
groupOrderService
.
sendOutGoods
(
id
));
public
Result
updateFwStatus
(
Long
id
,
String
remark
)
{
return
Result
.
success
(
groupOrderService
.
sendOutGoods
(
id
,
remark
));
}
/**
...
...
src/main/java/com/yunniu/farming/webadmin/model/GroupOrder.java
View file @
87224ad6
...
...
@@ -40,6 +40,8 @@ public class GroupOrder {
private
String
createBy
;
private
String
remark
;
/**
* 辅助对象:分页信息对象
*/
...
...
src/main/java/com/yunniu/farming/webadmin/model/OrderMain.java
View file @
87224ad6
...
...
@@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import
com.yunniu.farming.common.plugin.PageInfo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -107,6 +106,7 @@ public class OrderMain {
private
Integer
ipaytype
;
// 支付方式[10:微信支付.20:支付宝支付.30积分支付]
private
String
sremark
;
// 备注信息
private
String
remark
;
// 发货备注信息
...
...
src/main/java/com/yunniu/farming/webadmin/service/GroupOrderService.java
View file @
87224ad6
...
...
@@ -29,7 +29,7 @@ public interface GroupOrderService {
boolean
updateRefundStatus
(
String
outRefundNo
);
int
sendOutGoods
(
Long
id
);
int
sendOutGoods
(
Long
id
,
String
remark
);
int
successOrder
(
Long
id
);
}
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupOrderServiceImpl.java
View file @
87224ad6
...
...
@@ -16,6 +16,7 @@ import com.yunniu.farming.webadmin.service.GroupOrderService;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -147,6 +148,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
public
boolean
updateRefundStatus
(
String
outRefundNo
)
{
OrderMain
order
=
orderDao
.
getBySdef1
(
outRefundNo
);
order
.
setIrefundstatus
(
OrderMain
.
STATUS_REFUND_SUC
);
order
.
setIstatus
(
OrderMain
.
STATUS_COMPLETE
);
int
update
=
orderMainDao
.
updateById
(
order
);
List
<
OrderSub
>
orderSubs
=
this
.
orderSubDao
.
selectList
(
Wrappers
.<
OrderSub
>
lambdaQuery
().
eq
(
OrderSub:
:
getMainid
,
order
.
getId
()).
eq
(
OrderSub:
:
getSdef1
,
2
));
orderSubs
.
forEach
(
sub
->{
...
...
@@ -161,14 +163,27 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/**
* 发货
*
* @param id
* @param remark
* @return
*/
@Override
public
int
sendOutGoods
(
Long
id
)
{
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
sendOutGoods
(
Long
id
,
String
remark
)
{
GroupOrder
order
=
orderDao
.
selectById
(
id
);
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
;
}
/**
...
...
src/main/java/com/yunniu/farming/webadmin/service/impl/WxServiceImpl.java
View file @
87224ad6
...
...
@@ -258,7 +258,7 @@ public class WxServiceImpl implements WxService {
parameters
.
put
(
"refund_fee_type"
,
"CNY"
);
// 默认人民币:CNY
parameters
.
put
(
"total_fee"
,
decimalFormat
.
format
(
tradeMoney
*
100
));
// 订单总金额
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
{
parameters
.
put
(
"refund_fee"
,
decimalFormat
.
format
(
order
.
getIrefundmoney
()
*
100
));
// 退款金额
}
...
...
src/main/java/com/yunniu/farming/wx/WxConfigUtil.java
View file @
87224ad6
...
...
@@ -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
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 notify_url = "https://farming.nyinhong.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
=
"https://qpxdnyy.com/wx/wxRefundNotify"
;
// 订单回调接口
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
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_ORDER_URL
=
"https://api.mch.weixin.qq.com/secapi/pay/refund"
;
public
static
String
GET_MINICODE_URL
=
"https://api.weixin.qq.com/wxa/getwxacodeunlimit"
;
...
...
src/main/resources/mappings/OrderMainMapper.xml
View file @
87224ad6
...
...
@@ -32,6 +32,7 @@
<result
column=
"productid"
property=
"productid"
jdbcType=
"INTEGER"
/>
<result
column=
"ipaytype"
property=
"ipaytype"
jdbcType=
"INTEGER"
/>
<result
column=
"sremark"
property=
"sremark"
jdbcType=
"VARCHAR"
/>
<result
column=
"remark"
property=
"remark"
jdbcType=
"VARCHAR"
/>
<result
column=
"sdef1"
property=
"sdef1"
jdbcType=
"VARCHAR"
/>
<result
column=
"sdef2"
property=
"sdef2"
jdbcType=
"VARCHAR"
/>
...
...
@@ -313,15 +314,17 @@
<include
refid=
"Full_Column_List"
/>
<!-- 关联子表信息 -->
,
sub.id AS zid,
sub.ipronum AS zipronum,
sub.dprosum AS zdprosum,
sub.productid AS zproductid,
sub.sgoodprice AS zsgoodprice,
sub.sproductname AS zsproductname,
sub.spshortpic AS zspshortpic
sub.id AS zid,
sub.ipronum AS zipronum,
sub.dprosum AS zdprosum,
sub.productid AS zproductid,
sub.sgoodprice AS zsgoodprice,
sub.sproductname AS zsproductname,
sub.spshortpic AS zspshortpic,
go.remark
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}
</select>
...
...
src/main/resources/templates/groupOrder/list.html
View file @
87224ad6
...
...
@@ -171,9 +171,10 @@
str
+=
' <span>'
+
status
+
'</span>'
;
str
+=
'</div>'
;
return
str
?
str
:
""
;
}
}
,
{
field
:
'successTime'
,
title
:
'成团时间'
}
}
,
{
field
:
'successTime'
,
title
:
'成团时间'
}
,
{
field
:
'remark'
,
title
:
'发货备注'
}
,
{
field
:
''
,
width
:
130
,
title
:
'操作'
,
toolbar
:
'#table-handle'
,
fixed
:
"right"
}
]
]
...
...
@@ -261,35 +262,84 @@
}
;
});
//监听行工具事件
table
.
on
(
'tool(tableId)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
if
(
obj
.
event
===
'deliver'
)
{
var
id
=
obj
.
data
.
id
;
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
});
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
)
{
var
data
=
obj
.
data
;
if
(
obj
.
event
===
'deliver'
)
{
var
id
=
obj
.
data
.
id
;
layer
.
open
({
title
:
'确定接受订单吗?'
,
// 弹出框标题
area
:
[
'300px'
,
'300px'
],
// 弹出框大小
shade
:
0
,
// 不显示遮罩层
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
({
url
:
"updateFwStatus?id="
+
id
+
"&remark="
+
field
.
remark
,
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
});
}
}
}
});
// return false; // 阻止默认 form 跳转
});
});
}
else
if
(
obj
.
event
===
'edit'
)
{
}
});
// 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'
)
{
var
id
=
obj
.
data
.
orderId
;
var
w
=
(
$
(
window
).
width
()
*
0.95
);
var
h
=
(
$
(
window
).
height
()
*
0.95
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment