Compare commits
10 Commits
d782ae275c
...
948a8afec1
| Author | SHA1 | Date | |
|---|---|---|---|
| 948a8afec1 | |||
| dbeacbc3a3 | |||
| f62b8997ca | |||
| 71483f272d | |||
| aecfea75f2 | |||
| df3ae32eb7 | |||
| 62dad7098f | |||
| c34960d011 | |||
| a8d369a8b2 | |||
|
|
beaf9ac7d7 |
@@ -56,8 +56,6 @@ public class EquipmentController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private EquipmentRecordService equipmentRecordService;
|
private EquipmentRecordService equipmentRecordService;
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('apps:equipment:list')")
|
|
||||||
@OperationLog
|
|
||||||
@ApiOperation("分页查询设备管理")
|
@ApiOperation("分页查询设备管理")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<Equipment>> page(EquipmentParam param) {
|
public ApiResult<PageResult<Equipment>> page(EquipmentParam param) {
|
||||||
@@ -68,8 +66,6 @@ public class EquipmentController extends BaseController {
|
|||||||
return success(equipmentService.pageRel(param));
|
return success(equipmentService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('apps:equipment:list')")
|
|
||||||
@OperationLog
|
|
||||||
@ApiOperation("查询全部设备管理")
|
@ApiOperation("查询全部设备管理")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<Equipment>> list(EquipmentParam param) {
|
public ApiResult<List<Equipment>> list(EquipmentParam param) {
|
||||||
@@ -84,7 +80,8 @@ public class EquipmentController extends BaseController {
|
|||||||
@OperationLog
|
@OperationLog
|
||||||
@ApiOperation("根据id查询设备管理")
|
@ApiOperation("根据id查询设备管理")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<Equipment> get(@PathVariable("id") Integer id) {
|
public ApiResult<?> get(@PathVariable("id") Integer id) {
|
||||||
|
if (getLoginUser() == null) return fail("请先登录");
|
||||||
// return success(equipmentService.getById(id));
|
// return success(equipmentService.getById(id));
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
return success(equipmentService.getByIdRel(id));
|
return success(equipmentService.getByIdRel(id));
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
|
|||||||
PageParam<Equipment, EquipmentParam> page = new PageParam<>(param);
|
PageParam<Equipment, EquipmentParam> page = new PageParam<>(param);
|
||||||
page.setDefaultOrder("create_time desc");
|
page.setDefaultOrder("create_time desc");
|
||||||
List<Equipment> list = baseMapper.selectPageRel(page, param);
|
List<Equipment> list = baseMapper.selectPageRel(page, param);
|
||||||
|
|
||||||
Set<Integer> touziUserIds = list.stream().map(Equipment::getTouziUserId).collect(Collectors.toSet());
|
Set<Integer> touziUserIds = list.stream().map(Equipment::getTouziUserId).collect(Collectors.toSet());
|
||||||
// List<User> touziUserList = userService.lambdaQuery().in(User::getUserId, touziUserIds).list();
|
// List<User> touziUserList = userService.lambdaQuery().in(User::getUserId, touziUserIds).list();
|
||||||
Map<Integer, User> touziUserCollect = null;
|
Map<Integer, User> touziUserCollect = null;
|
||||||
@@ -54,13 +53,14 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
|
|||||||
touziUserCollect = touziUserList.stream().collect(Collectors.toMap(User::getUserId, e->e));
|
touziUserCollect = touziUserList.stream().collect(Collectors.toMap(User::getUserId, e->e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
System.out.println("touziUserCollect = " + touziUserCollect);
|
||||||
// 查询绑定电池的用户
|
// 查询绑定电池的用户
|
||||||
for (Equipment equipment : list) {
|
for (Equipment equipment : list) {
|
||||||
// 查询状态
|
// 查询状态
|
||||||
System.out.println("equipment.getEquipmentCode() = " + equipment.getEquipmentCode());
|
System.out.println("equipment.getEquipmentCode() = " + equipment.getEquipmentCode());
|
||||||
try {
|
try {
|
||||||
ResponseEntity<JSONObject> entity = restTemplate.getForEntity("http://battery.zfdliot.com/api/battery/status?battery_sn=" + equipment.getEquipmentCode(), JSONObject.class);
|
ResponseEntity<JSONObject> entity = restTemplate.getForEntity("http://battery.zfdliot.com/api/battery/status?battery_sn=" + equipment.getEquipmentCode(), JSONObject.class);
|
||||||
|
System.out.println("entity = " + entity);
|
||||||
JSONObject body = entity.getBody();
|
JSONObject body = entity.getBody();
|
||||||
Integer code = body.getInteger("code");
|
Integer code = body.getInteger("code");
|
||||||
JSONObject data = body.getJSONObject("data");
|
JSONObject data = body.getJSONObject("data");
|
||||||
|
|||||||
@@ -308,7 +308,13 @@ public class OpenEquipmentController extends BaseController {
|
|||||||
// 订单信息
|
// 订单信息
|
||||||
Integer orderId = equipment.getOrderId();
|
Integer orderId = equipment.getOrderId();
|
||||||
Order order = orderService.getById(orderId);
|
Order order = orderService.getById(orderId);
|
||||||
|
if (order == null) {
|
||||||
|
return fail("订单不存在");
|
||||||
|
}
|
||||||
Integer oldEqId = order.getEquipmentId();
|
Integer oldEqId = order.getEquipmentId();
|
||||||
|
if (oldEqId == null) {
|
||||||
|
return fail("订单未绑定设备");
|
||||||
|
}
|
||||||
|
|
||||||
// 新电池
|
// 新电池
|
||||||
Equipment one = equipmentService.getByEquipmentCode(equipmentCode);
|
Equipment one = equipmentService.getByEquipmentCode(equipmentCode);
|
||||||
@@ -319,6 +325,9 @@ public class OpenEquipmentController extends BaseController {
|
|||||||
String newMerchantCode = one.getMerchantCode();
|
String newMerchantCode = one.getMerchantCode();
|
||||||
// 旧电池
|
// 旧电池
|
||||||
Equipment old = equipmentService.getById(oldEqId);
|
Equipment old = equipmentService.getById(oldEqId);
|
||||||
|
if (old == null) {
|
||||||
|
return fail("旧设备不存在");
|
||||||
|
}
|
||||||
String oldMerchantCode = order.getMerchantCode();
|
String oldMerchantCode = order.getMerchantCode();
|
||||||
|
|
||||||
Integer userId = one.getUserId();
|
Integer userId = one.getUserId();
|
||||||
@@ -336,7 +345,7 @@ public class OpenEquipmentController extends BaseController {
|
|||||||
saveData.setEquipmentId(one.getEquipmentId());
|
saveData.setEquipmentId(one.getEquipmentId());
|
||||||
saveData.setUserId(orderUserId);
|
saveData.setUserId(orderUserId);
|
||||||
saveData.setOrderId(orderId);
|
saveData.setOrderId(orderId);
|
||||||
saveData.setMerchantCode(newMerchantCode);
|
saveData.setMerchantCode(oldMerchantCode);//新电池归属地要变成订单的归属地
|
||||||
boolean b = equipmentService.updateById(saveData);
|
boolean b = equipmentService.updateById(saveData);
|
||||||
// 记录新电池明细
|
// 记录新电池明细
|
||||||
EquipmentRecord record = new EquipmentRecord();
|
EquipmentRecord record = new EquipmentRecord();
|
||||||
@@ -351,7 +360,7 @@ public class OpenEquipmentController extends BaseController {
|
|||||||
// 解绑旧电池
|
// 解绑旧电池
|
||||||
old.setUserId(0);
|
old.setUserId(0);
|
||||||
old.setOrderId(0);
|
old.setOrderId(0);
|
||||||
old.setMerchantCode(oldMerchantCode);
|
old.setMerchantCode(newMerchantCode);//旧电池归属地要变成换电电池的归属地
|
||||||
equipmentService.updateById(old);
|
equipmentService.updateById(old);
|
||||||
// 记录明细
|
// 记录明细
|
||||||
EquipmentRecord record2 = new EquipmentRecord();
|
EquipmentRecord record2 = new EquipmentRecord();
|
||||||
@@ -376,9 +385,9 @@ public class OpenEquipmentController extends BaseController {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("userId", loginUser.getUserId());
|
param.put("userId", order.getUserId());
|
||||||
param.put("userName", loginUser.getNickname());
|
param.put("userName", order.getNickname());
|
||||||
param.put("userPhone", loginUser.getPhone());
|
param.put("userPhone", order.getPhone());
|
||||||
param.put("battery_sn", one.getEquipmentCode());
|
param.put("battery_sn", one.getEquipmentCode());
|
||||||
System.out.println("param2 = " + param);
|
System.out.println("param2 = " + param);
|
||||||
ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity("http://battery.zfdliot.com/api/battery/batteryBindUser", param, JSONObject.class);
|
ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity("http://battery.zfdliot.com/api/battery/batteryBindUser", param, JSONObject.class);
|
||||||
@@ -411,8 +420,9 @@ public class OpenEquipmentController extends BaseController {
|
|||||||
String back = ImageUtil.ImageBase64(images.get(1) + "?x-oss-process=image/resize,w_750/quality,Q_80");
|
String back = ImageUtil.ImageBase64(images.get(1) + "?x-oss-process=image/resize,w_750/quality,Q_80");
|
||||||
|
|
||||||
IdcardRespVO verify = idcardService.verify(front, back);
|
IdcardRespVO verify = idcardService.verify(front, back);
|
||||||
|
System.out.println("verify res : " + verify);
|
||||||
if(!"FP00000".equals(verify.getCode())) {
|
if(!"FP00000".equals(verify.getCode())) {
|
||||||
return fail("请上传身份证正面照片");
|
return fail("请上传身份证正面照片." + verify.getMessage() + verify.getCode());
|
||||||
}
|
}
|
||||||
if(verify.getIssueDate() == null || verify.getIssueOrg() == null || verify.getExpireDate() == null) {
|
if(verify.getIssueDate() == null || verify.getIssueOrg() == null || verify.getExpireDate() == null) {
|
||||||
return fail("请上传身份证反面照片");
|
return fail("请上传身份证反面照片");
|
||||||
@@ -442,7 +452,7 @@ public class OpenEquipmentController extends BaseController {
|
|||||||
BeanCopier.create(receiptParam, order, CopyOptions.create().ignoreNullValue()).copy();
|
BeanCopier.create(receiptParam, order, CopyOptions.create().ignoreNullValue()).copy();
|
||||||
order.setOrderStatus(ORDER_STATUS_COMPLETED);
|
order.setOrderStatus(ORDER_STATUS_COMPLETED);
|
||||||
|
|
||||||
if (!order.getDeliveryStatus().equals(DELIVERY_STATUS_ACCEPT)) {//小程序下单流程修改后,是先绑定,后确认收获,这里为了兼容
|
if (!DELIVERY_STATUS_ACCEPT.equals(order.getDeliveryStatus())) {//小程序下单流程修改后,是先绑定,后确认收获,这里为了兼容
|
||||||
order.setDeliveryStatus(DELIVERY_STATUS_YES);
|
order.setDeliveryStatus(DELIVERY_STATUS_YES);
|
||||||
}
|
}
|
||||||
order.setReceiptStatus(RECEIPT_STATUS_YES);
|
order.setReceiptStatus(RECEIPT_STATUS_YES);
|
||||||
@@ -525,6 +535,7 @@ public class OpenEquipmentController extends BaseController {
|
|||||||
refund.setApplyDesc(isRefund == 3?"强制退租":"申请退租");//3强制退租(后台操作)
|
refund.setApplyDesc(isRefund == 3?"强制退租":"申请退租");//3强制退租(后台操作)
|
||||||
refund.setRefundMoney(new BigDecimal(0));
|
refund.setRefundMoney(new BigDecimal(0));
|
||||||
refund.setMerchantCode(order.getMerchantCode());
|
refund.setMerchantCode(order.getMerchantCode());
|
||||||
|
refund.setUpdateTime(DateUtil.date());
|
||||||
}
|
}
|
||||||
refund.setAuditStatus(10);
|
refund.setAuditStatus(10);
|
||||||
refund.setOrderNo(order.getOrderNo());
|
refund.setOrderNo(order.getOrderNo());
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
@@ -132,9 +133,13 @@ public class OrderController extends BaseController {
|
|||||||
for (Order order : list) {
|
for (Order order : list) {
|
||||||
//计算缴费总钱数
|
//计算缴费总钱数
|
||||||
List<OrderPay> orderPays = orderPayCollect.get(order.getOrderId());
|
List<OrderPay> orderPays = orderPayCollect.get(order.getOrderId());
|
||||||
|
order.setOrderPays(orderPays);
|
||||||
if (null != orderPays && !orderPays.isEmpty()) {
|
if (null != orderPays && !orderPays.isEmpty()) {
|
||||||
BigDecimal sum = orderPays.stream().map(OrderPay::getOrderPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal sum = orderPays.stream().map(OrderPay::getOrderPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
order.setTotalPayPrice(sum);
|
order.setTotalPayPrice(sum);
|
||||||
|
OrderPay lastOrderPay = orderPays.get(orderPays.size() - 1);
|
||||||
|
// 计算剩余天数
|
||||||
|
order.setRestDay((int) DateUtil.between(lastOrderPay.getExpirationTime(), new Date(), DateUnit.DAY));
|
||||||
} else {
|
} else {
|
||||||
order.setTotalPayPrice(BigDecimal.ZERO);
|
order.setTotalPayPrice(BigDecimal.ZERO);
|
||||||
}
|
}
|
||||||
@@ -377,14 +382,14 @@ public class OrderController extends BaseController {
|
|||||||
//.ge(Order::getCreateTime,DateUtil.offsetMonth(new Date(),-6))//最近三个6个月
|
//.ge(Order::getCreateTime,DateUtil.offsetMonth(new Date(),-6))//最近三个6个月
|
||||||
.orderByDesc(Order::getCreateTime)
|
.orderByDesc(Order::getCreateTime)
|
||||||
.list();
|
.list();
|
||||||
if (overdueOrderList != null && !overdueOrderList.isEmpty()) {
|
// if (overdueOrderList != null && !overdueOrderList.isEmpty()) {
|
||||||
for(Order overdueOrder:overdueOrderList){
|
// for(Order overdueOrder:overdueOrderList){
|
||||||
if (overdueOrder.getRestDay()<0){//如果剩余天数为负数
|
// if (overdueOrder.getRestDay()<0){//如果剩余天数为负数
|
||||||
log.warn("添加订单失败,有订单逾期未结 userId:{},orderId:{},orderNo:{},restDay:{}",loginUser.getUserId(),overdueOrder.getOrderId(),overdueOrder.getOrderNo(),overdueOrder.getRestDay());
|
// log.warn("添加订单失败,有订单逾期未结 userId:{},orderId:{},orderNo:{},restDay:{}",loginUser.getUserId(),overdueOrder.getOrderId(),overdueOrder.getOrderNo(),overdueOrder.getRestDay());
|
||||||
return fail("添加订单失败,有订单逾期未结");
|
// return fail("添加订单失败,有订单逾期未结");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 历史订单
|
// 历史订单
|
||||||
order.setCurrPeriods(0);
|
order.setCurrPeriods(0);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.copier.BeanCopier;
|
|||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DateField;
|
import cn.hutool.core.date.DateField;
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -17,6 +18,7 @@ import com.gxwebsoft.common.core.utils.JSONUtil;
|
|||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import com.gxwebsoft.shop.entity.FreezeOrder;
|
import com.gxwebsoft.shop.entity.FreezeOrder;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsService;
|
||||||
import com.gxwebsoft.shop.entity.Order;
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.shop.service.FreezeOrderService;
|
import com.gxwebsoft.shop.service.FreezeOrderService;
|
||||||
import com.gxwebsoft.shop.service.OrderPayService;
|
import com.gxwebsoft.shop.service.OrderPayService;
|
||||||
@@ -38,9 +40,9 @@ import java.math.BigDecimal;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import static com.gxwebsoft.common.core.constants.OrderConstants.ORDER_STATUS_OVER;
|
import static com.gxwebsoft.common.core.constants.OrderConstants.*;
|
||||||
import static com.gxwebsoft.common.core.constants.OrderConstants.PAY_STATUS_NO_PAY;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单记录表控制器
|
* 订单记录表控制器
|
||||||
@@ -57,8 +59,6 @@ public class OrderPayController extends BaseController {
|
|||||||
private OrderPayService orderPayService;
|
private OrderPayService orderPayService;
|
||||||
@Resource
|
@Resource
|
||||||
private FreezeOrderService freezeOrderService;
|
private FreezeOrderService freezeOrderService;
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private OrderService orderService;
|
private OrderService orderService;
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ public class OrderPayController extends BaseController {
|
|||||||
|
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<OrderPay>> list(OrderPayParam param) {
|
public ApiResult<List<OrderPay>> list(OrderPayParam param) {
|
||||||
List<OrderPay> orderPays = orderPayService.listRel(param);
|
List<OrderPay> orderPays = orderPayService.listRel(param);
|
||||||
if (null != param.getRentOrderId() && 0 != param.getRentOrderId()) {//如果是单个查询
|
if (null != param.getRentOrderId() && 0 != param.getRentOrderId()) {//如果是单个查询
|
||||||
Order order = orderService.getById(param.getRentOrderId());
|
Order order = orderService.getById(param.getRentOrderId());
|
||||||
if (null != order && !orderPays.isEmpty()) {
|
if (null != order && !orderPays.isEmpty()) {
|
||||||
@@ -98,9 +98,28 @@ public class OrderPayController extends BaseController {
|
|||||||
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<OrderPay> get(@PathVariable("id") Integer id) {
|
public ApiResult<OrderPay> get(@PathVariable("id") Integer id) {
|
||||||
return success(orderPayService.getById(id));
|
final OrderPay orderPay = orderPayService.getById(id);
|
||||||
// 使用关联查询
|
final BigDecimal rent = orderPay.getBatteryRent();
|
||||||
//return success(orderPayService.getByIdRel(id));
|
final OrderPay one = orderPayService.getOne(new LambdaQueryWrapper<OrderPay>()
|
||||||
|
.eq(OrderPay::getRentOrderId, orderPay.getRentOrderId())
|
||||||
|
.eq(OrderPay::getUserId, orderPay.getUserId())
|
||||||
|
.eq(OrderPay::getPayStatus, PAY_STATUS_SUCCESS)
|
||||||
|
.orderByDesc(OrderPay::getId)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
final Integer goodsId = orderPay.getGoodsId();
|
||||||
|
final EquipmentGoods goods = equipmentGoodsService.getByIdRel(goodsId);
|
||||||
|
final BigDecimal batteryRent = goods.getBatteryRent();
|
||||||
|
// 按新的续费价格
|
||||||
|
orderPay.setTotalPrice(batteryRent);
|
||||||
|
if (one != null) {
|
||||||
|
final long between = DateUtil.between(new Date(), one.getExpirationTime(), DateUnit.DAY, false);
|
||||||
|
if (between < 0) {
|
||||||
|
// 有逾期的订单不能享受折扣
|
||||||
|
orderPay.setTotalPrice(rent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(orderPay);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/change-order-no")
|
@GetMapping("/change-order-no")
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.gxwebsoft.shop.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.copier.BeanCopier;
|
import cn.hutool.core.bean.copier.BeanCopier;
|
||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alipay.api.AlipayApiException;
|
import com.alipay.api.AlipayApiException;
|
||||||
@@ -114,12 +115,12 @@ public class OrderRefundController extends BaseController {
|
|||||||
@PutMapping()
|
@PutMapping()
|
||||||
@Transactional
|
@Transactional
|
||||||
public ApiResult<?> update(@RequestBody OrderRefund orderRefund) throws AlipayApiException {
|
public ApiResult<?> update(@RequestBody OrderRefund orderRefund) throws AlipayApiException {
|
||||||
OrderRefund refund = orderRefundService.getById(orderRefund.getOrderRefundId());
|
|
||||||
BeanCopier.create(orderRefund, refund, CopyOptions.create().ignoreNullValue()).copy();
|
BeanCopier.create(orderRefund, orderRefund, CopyOptions.create().ignoreNullValue()).copy();
|
||||||
|
|
||||||
User loginUser = getLoginUser();
|
User loginUser = getLoginUser();
|
||||||
if (loginUser != null) {
|
if (loginUser != null) {
|
||||||
refund.setOperator(loginUser.getUsername());//操作人
|
orderRefund.setOperator(loginUser.getUsername());//操作人
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer auditStatus = orderRefund.getAuditStatus();
|
Integer auditStatus = orderRefund.getAuditStatus();
|
||||||
@@ -141,6 +142,7 @@ public class OrderRefundController extends BaseController {
|
|||||||
}
|
}
|
||||||
order.setReceiptStatus(RECEIPT_STATUS_RETURN);
|
order.setReceiptStatus(RECEIPT_STATUS_RETURN);
|
||||||
order.setOrderStatus(ORDER_STATUS_OVER);
|
order.setOrderStatus(ORDER_STATUS_OVER);
|
||||||
|
order.setUpdateTime(DateUtil.date());
|
||||||
orderService.updateById(order);
|
orderService.updateById(order);
|
||||||
try {
|
try {
|
||||||
freezeOrderService.unfreeze(order.getOrderId(), refundMoney);//这里有可能出现没有找不到解冻订单的问题
|
freezeOrderService.unfreeze(order.getOrderId(), refundMoney);//这里有可能出现没有找不到解冻订单的问题
|
||||||
@@ -155,7 +157,8 @@ public class OrderRefundController extends BaseController {
|
|||||||
order.setReceiptStatus(RECEIPT_STATUS_YES);
|
order.setReceiptStatus(RECEIPT_STATUS_YES);
|
||||||
orderService.updateById(order);
|
orderService.updateById(order);
|
||||||
}
|
}
|
||||||
orderRefundService.updateById(refund);
|
orderRefund.setUpdateTime(DateUtil.date());
|
||||||
|
orderRefundService.updateById(orderRefund);
|
||||||
return success("操作成功");
|
return success("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -408,6 +408,7 @@ public class PaymentController extends BaseController {
|
|||||||
|
|
||||||
order.setCurrPeriods(parentOrder.getCurrPeriods());
|
order.setCurrPeriods(parentOrder.getCurrPeriods());
|
||||||
order.setBatteryRent(parentOrder.getBatteryRent());
|
order.setBatteryRent(parentOrder.getBatteryRent());
|
||||||
|
order.setExpirationTime(DateUtil.offset(order.getExpirationTime(), DateField.MONTH, 1));
|
||||||
orderPayService.updateById(order);
|
orderPayService.updateById(order);
|
||||||
orderService.updateById(parentOrder);
|
orderService.updateById(parentOrder);
|
||||||
|
|
||||||
|
|||||||
@@ -343,6 +343,10 @@ public class Order implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private BigDecimal totalPayPrice;
|
private BigDecimal totalPayPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单交费总数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<OrderPay> orderPays;
|
||||||
|
|
||||||
public Integer getRestDay() {
|
public Integer getRestDay() {
|
||||||
if(null != orderStatus){
|
if(null != orderStatus){
|
||||||
switch(orderStatus){
|
switch(orderStatus){
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
||||||
LEFT JOIN apps_equipment c ON a.order_id = c.order_id
|
LEFT JOIN apps_equipment c ON a.order_id = c.order_id
|
||||||
LEFT JOIN shop_merchant d ON a.merchant_code = d.merchant_code
|
LEFT JOIN shop_merchant d ON a.merchant_code = d.merchant_code
|
||||||
|
LEFT JOIN shop_order e ON a.order_id = e.order_id
|
||||||
<where>
|
<where>
|
||||||
<if test="param.orderRefundId != null">
|
<if test="param.orderRefundId != null">
|
||||||
AND a.order_refund_id = #{param.orderRefundId}
|
AND a.order_refund_id = #{param.orderRefundId}
|
||||||
@@ -80,7 +81,7 @@
|
|||||||
AND a.create_time <= #{param.createTimeEnd}
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.orderNo != null">
|
<if test="param.orderNo != null">
|
||||||
AND a.order_no = #{param.orderNo}
|
AND e.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class OrderPayServiceImpl extends ServiceImpl<OrderPayMapper, OrderPay> i
|
|||||||
List<OrderPay> list = baseMapper.selectListRel(param);
|
List<OrderPay> list = baseMapper.selectListRel(param);
|
||||||
// 排序
|
// 排序
|
||||||
PageParam<OrderPay, OrderPayParam> page = new PageParam<>();
|
PageParam<OrderPay, OrderPayParam> page = new PageParam<>();
|
||||||
page.setDefaultOrder("pay_time desc");
|
page.setDefaultOrder("id desc");
|
||||||
return page.sortRecords(list);
|
return page.sortRecords(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
|
server:
|
||||||
|
port: 9200
|
||||||
# 数据源配置
|
# 数据源配置
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://47.119.165.234:3308/open_ws?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
|
url: jdbc:mysql://47.107.122.174:3308/yunxinwei?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
username: open_ws
|
username: yunxinwei
|
||||||
password: DzAmFiZfPJ6ZGApm
|
password: A56sK6aW2FA3wBy2
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
# datasource:
|
||||||
|
# url: jdbc:mysql://47.119.165.234:3308/open_ws?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
# username: open_ws
|
||||||
|
# password: DzAmFiZfPJ6ZGApm
|
||||||
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
# type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
|
||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# 数据源配置
|
# 数据源配置
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://1.14.159.185:3318/yunxinwei?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
|
url: jdbc:mysql://47.107.122.174:3318/yunxinwei?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
username: yunxinwei
|
username: yunxinwei
|
||||||
password: A56sK6aW2FA3wBy2
|
password: A56sK6aW2FA3wBy2
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
@@ -47,4 +47,4 @@ config:
|
|||||||
cron:
|
cron:
|
||||||
alert: 0 30 9 * * ?
|
alert: 0 30 9 * * ?
|
||||||
profit: 0 0/2 * * * ?
|
profit: 0 0/2 * * * ?
|
||||||
timeoutOrder: 1 0 0 * * ?
|
timeoutOrder: 1 0 0 * * ?
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# 端口
|
# 端口
|
||||||
server:
|
server:
|
||||||
port: 9090
|
port: 9200
|
||||||
# socketIo
|
# socketIo
|
||||||
socketio:
|
socketio:
|
||||||
port: 9190
|
port: 9190
|
||||||
# 多环境配置
|
# 多环境配置
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: dev
|
||||||
# json时间格式设置
|
# json时间格式设置
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
@@ -71,7 +71,7 @@ mybatis-plus:
|
|||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: true
|
map-underscore-to-camel-case: true
|
||||||
cache-enabled: true
|
cache-enabled: true
|
||||||
log-impl: ${LOG_IMPL:org.apache.ibatis.logging.nologging.NoLoggingImpl}
|
log-impl: ${LOG_IMPL:org.apache.ibatis.logging.stdout.StdOutImpl}
|
||||||
global-config:
|
global-config:
|
||||||
:banner: false
|
:banner: false
|
||||||
db-config:
|
db-config:
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.alipay.api.AlipayApiException;
|
|||||||
import com.alipay.api.DefaultAlipayClient;
|
import com.alipay.api.DefaultAlipayClient;
|
||||||
import com.alipay.api.request.AlipayFundAuthOrderUnfreezeRequest;
|
import com.alipay.api.request.AlipayFundAuthOrderUnfreezeRequest;
|
||||||
import com.alipay.api.response.AlipayFundAuthOrderUnfreezeResponse;
|
import com.alipay.api.response.AlipayFundAuthOrderUnfreezeResponse;
|
||||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
|
||||||
import com.gxwebsoft.apps.service.HualalaService;
|
import com.gxwebsoft.apps.service.HualalaService;
|
||||||
import com.gxwebsoft.apps.service.TestDataService;
|
import com.gxwebsoft.apps.service.TestDataService;
|
||||||
import com.gxwebsoft.common.core.utils.AlipayConfigUtil;
|
import com.gxwebsoft.common.core.utils.AlipayConfigUtil;
|
||||||
@@ -15,7 +14,6 @@ import com.gxwebsoft.common.system.mapper.UserMapper;
|
|||||||
import com.gxwebsoft.common.system.service.SettingService;
|
import com.gxwebsoft.common.system.service.SettingService;
|
||||||
import com.gxwebsoft.common.system.service.UserService;
|
import com.gxwebsoft.common.system.service.UserService;
|
||||||
import com.gxwebsoft.love.service.CertificateService;
|
import com.gxwebsoft.love.service.CertificateService;
|
||||||
import com.gxwebsoft.shop.entity.FreezeOrder;
|
|
||||||
import com.gxwebsoft.shop.mapper.OrderGoodsMapper;
|
import com.gxwebsoft.shop.mapper.OrderGoodsMapper;
|
||||||
import com.gxwebsoft.shop.mapper.OrderMapper;
|
import com.gxwebsoft.shop.mapper.OrderMapper;
|
||||||
import com.gxwebsoft.shop.service.FreezeOrderService;
|
import com.gxwebsoft.shop.service.FreezeOrderService;
|
||||||
@@ -23,14 +21,10 @@ import com.gxwebsoft.shop.service.OrderService;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by WebSoft on 2020-03-23 23:37
|
* Created by WebSoft on 2020-03-23 23:37
|
||||||
@@ -300,7 +294,7 @@ public class TestMain {
|
|||||||
@Test
|
@Test
|
||||||
public void close() throws AlipayApiException {
|
public void close() throws AlipayApiException {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DefaultAlipayClient alipayClient = null;
|
DefaultAlipayClient alipayClient = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user