修改首页没有积分专区

dev-discount
袁野 2 years ago
parent 4590ee9b11
commit 3bbc59e4af
  1. 1
      hai-bweb/src/main/java/com/bweb/controller/BsMsgController.java
  2. 24
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  3. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  4. 2
      hai-order/src/main/java/com/web/controller/business/OrderThirdPartyController.java
  5. 33
      hai-service/src/main/java/com/hai/common/utils/DateUtil.java
  6. 3
      hai-service/src/main/java/com/hai/dao/BsMsgUserMapperExt.java
  7. 11
      hai-service/src/main/java/com/hai/entity/BsMsg.java
  8. 2
      hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java
  9. 78
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  10. 29
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  11. 16
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  12. 11
      hai-service/src/main/java/com/hai/service/BsMsgService.java
  13. 11
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  14. 38
      hai-service/src/main/java/com/hai/service/impl/BsMsgServiceImpl.java
  15. 19
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java

@ -91,6 +91,7 @@ public class BsMsgController {
bsMsg.setOpId(userInfoModel.getSecUser().getId()); bsMsg.setOpId(userInfoModel.getSecUser().getId());
bsMsg.setOpName(userInfoModel.getSecUser().getUserName()); bsMsg.setOpName(userInfoModel.getSecUser().getUserName());
bsMsg.setMsgType(2); bsMsg.setMsgType(2);
bsMsg.setStatus(1);
bsMsgService.insertMsg(bsMsg , null); bsMsgService.insertMsg(bsMsg , null);
return ResponseMsgUtil.success("新增成功"); return ResponseMsgUtil.success("新增成功");

@ -6,6 +6,7 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject; import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CmsContentConfig; import com.hai.config.CmsContentConfig;
import com.hai.entity.*; import com.hai.entity.*;
@ -95,7 +96,7 @@ public class CmsContentController {
object.put("sort" , cmsCategory.getSort()); object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode()); object.put("code" , cmsCategory.getCode());
List<CmsContent> cmsContent = cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform); List<CmsContent> cmsContent = cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform);
if (cmsContent != null) { if (cmsContent.size() > 0) {
object.put("jumpType" , cmsContent.get(0).getJumpType()); object.put("jumpType" , cmsContent.get(0).getJumpType());
object.put("jumpUrl" , cmsContent.get(0).getJumpUrl()); object.put("jumpUrl" , cmsContent.get(0).getJumpUrl());
} }
@ -106,16 +107,29 @@ public class CmsContentController {
object.put("sort" , cmsCategory.getSort()); object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode()); object.put("code" , cmsCategory.getCode());
List<CmsContent> cmsContent = cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform); List<CmsContent> cmsContent = cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform);
if (cmsContent != null) { if (cmsContent.size() > 0) {
object.put("jumpType" , cmsContent.get(0).getJumpType()); object.put("jumpType" , cmsContent.get(0).getJumpType());
object.put("jumpUrl" , cmsContent.get(0).getJumpUrl()); object.put("jumpUrl" , cmsContent.get(0).getJumpUrl());
} }
Map<String, Object> mapUser = new HashMap<>();
mapUser.put("companyId" , companyId);
mapUser.put("whereCheck" , false);
mapUser.put("msgType" , 1);
mapUser.put("userId" , userInfoModel.getHighUser().getId());
List<BsMsg> listUser = bsMsgService.queryMsgByList(mapUser);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("companyId" , companyId); map.put("companyId" , companyId);
map.put("whereCheck" , false); map.put("msgType" , 2);
map.put("userId" , userInfoModel.getHighUser().getId()); List<BsMsg> list = bsMsgService.queryMsgByList(map);
object.put("childDate" , bsMsgService.queryMsgByList(map)); list.addAll(listUser);
for (BsMsg bsMsg : list) {
bsMsg.setTimeData( DateUtil.timeDifference(bsMsg.getCreateTime(), new Date() ));
}
object.put("childDate" , list);
} }
objectList.add(object); objectList.add(object);
} }

File diff suppressed because one or more lines are too long

@ -200,7 +200,7 @@ public class OrderThirdPartyController {
} }
EasyExcel.write(fileUrl+pathName) EasyExcel.write(fileUrl+pathName)
.head(ExportGasOrderModel.class) .head(OrderThirdPartyModel.class)
.sheet("交易订单") .sheet("交易订单")
.doWrite(dataList); .doWrite(dataList);
return ResponseMsgUtil.success(pathName); return ResponseMsgUtil.success(pathName);

@ -22,6 +22,7 @@ public class DateUtil {
public static final String Y_M_D = "yyyy-MM-dd"; public static final String Y_M_D = "yyyy-MM-dd";
public static final String Y_M_D_HM = "yyyy-MM-dd HH:mm"; public static final String Y_M_D_HM = "yyyy-MM-dd HH:mm";
public static final String Y_M_D_HMS = "yyyy-MM-dd HH:mm:ss"; public static final String Y_M_D_HMS = "yyyy-MM-dd HH:mm:ss";
public static final String Y_M_D_HMS_C = "yyyy年MM月dd日 HH:mm:ss";
public static final String YMD = "yyyyMMdd"; public static final String YMD = "yyyyMMdd";
public static final String YMDHM = "yyyyMMddHHmm"; public static final String YMDHM = "yyyyMMddHHmm";
public static final String YMDHMS = "yyyyMMddHHmmss"; public static final String YMDHMS = "yyyyMMddHHmmss";
@ -785,4 +786,36 @@ public class DateUtil {
System.out.println(getSecondDiff(new Date(), date)); System.out.println(getSecondDiff(new Date(), date));
} }
/**
* @Author Sum1Dream
* @Name timeDifference
* @Description // 计算时间差
* @Date 16:22 2022/11/1
* @Param [finishTime, end]
* @Return java.lang.String
*/
public static String timeDifference(Date finishTime , Date end) {
long timeLag = end.getTime() - finishTime.getTime();
//天
long day=timeLag/(24*60*60*1000);
//小时
long hour=(timeLag/(60*60*1000));
//分钟
long minute=((timeLag/(60*1000)));
//秒,顺便说一下,1秒 = 1000毫秒
long s=(timeLag/1000);
if (day >= 1) {
return day + "天前";
}
if (hour >= 1) {
return hour + "小时前";
}
if (minute >= 1) {
return minute + "分钟前";
}
return s + "秒前";
}
} }

@ -21,10 +21,11 @@ public interface BsMsgUserMapperExt {
"where status = 2 " + "where status = 2 " +
"and company_id = #{param.companyId} " + "and company_id = #{param.companyId} " +
"<if test='param.userId != null'> and user_id = #{param.userId} </if>", "<if test='param.userId != null'> and user_id = #{param.userId} </if>",
"<if test='param.userId == null'> and user_id is null </if>",
"<if test='param.type != null'> and type = #{param.type} </if>", "<if test='param.type != null'> and type = #{param.type} </if>",
"<if test='param.msgType != null'> and msg_type = #{param.msgType} </if>", "<if test='param.msgType != null'> and msg_type = #{param.msgType} </if>",
"<if test='param.whereCheck != null'> and where_check = #{param.whereCheck} </if>", "<if test='param.whereCheck != null'> and where_check = #{param.whereCheck} </if>",
"order by create_time desc; " + "order by create_time desc limit 5; " +
" </script>"}) " </script>"})
@Results({ @Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),

@ -88,6 +88,9 @@ public class BsMsg implements Serializable {
*/ */
private Integer status; private Integer status;
// 时间内容
private String timeData;
/** /**
* ext_1 * ext_1
*/ */
@ -103,6 +106,14 @@ public class BsMsg implements Serializable {
*/ */
private String ext3; private String ext3;
public String getTimeData() {
return timeData;
}
public void setTimeData(String timeData) {
this.timeData = timeData;
}
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {

@ -74,6 +74,6 @@ public interface OrderCreateHandleService {
* @Param [object] * @Param [object]
* @Return com.hai.entity.HighChildOrder * @Return com.hai.entity.HighChildOrder
*/ */
HighChildOrder prepaidRecharge(JSONObject object) throws Exception; HighChildOrder mobileRecharge(HighOrder order , JSONObject object) throws Exception;
} }

@ -11,13 +11,12 @@ import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil; import com.hai.common.utils.DateUtil;
import com.hai.common.utils.IDGenerator; import com.hai.common.utils.IDGenerator;
import com.hai.config.*; import com.hai.config.*;
import com.hai.dao.OutRechargeOrderMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.enum_type.GasClassGroupTaskStatus; import com.hai.enum_type.*;
import com.hai.enum_type.JinZhuJiaYouOilNo;
import com.hai.enum_type.MerAccountMarketingType;
import com.hai.enum_type.MerchantStoreSourceType;
import com.hai.model.GasPayPriceModel; import com.hai.model.GasPayPriceModel;
import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantModel;
import com.hai.model.OutRechargePriceModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.order.model.CreateOrderChildModel; import com.hai.order.model.CreateOrderChildModel;
import com.hai.order.model.CreateOrderModel; import com.hai.order.model.CreateOrderModel;
@ -61,6 +60,12 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
@Resource @Resource
private OrderService orderService; private OrderService orderService;
@Resource
private BsConfigService bsConfigService;
@Resource
private SecConfigService secConfigService;
@Resource @Resource
private HighUserService userService; private HighUserService userService;
@ -79,12 +84,18 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
@Resource @Resource
private HighDiscountCouponRelService discountCouponRelService; private HighDiscountCouponRelService discountCouponRelService;
@Resource
private OutRechargeOrderMapper outRechargeOrderMapper;
@Resource @Resource
private HighCouponHandselService highCouponHandselService; private HighCouponHandselService highCouponHandselService;
@Resource @Resource
private HighMerchantAccountMarketingService merchantAccountMarketingService; private HighMerchantAccountMarketingService merchantAccountMarketingService;
@Resource
private OutRechargePriceService outRechargePriceService;
@Resource @Resource
private HighGasOrderService gasOrderService; private HighGasOrderService gasOrderService;
@ -809,7 +820,62 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
} }
@Override @Override
public HighChildOrder prepaidRecharge(JSONObject object) throws Exception { public HighChildOrder mobileRecharge(HighOrder order , JSONObject object) throws Exception {
return null; // 初始化话费订单对象
OutRechargeOrder outRechargeOrder = new OutRechargeOrder();
// 查询用户信息
HighUser user = highUserService.findByUserId(object.getLong("userId"));
// 产品id
Long goodsId = object.getLong("goodsId");
// 充值内容
String rechargeContent = object.getString("rechargeContent");
// 查询产品详情
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(goodsId, null);
// 判断充值系统是否关闭
if (!secConfigService.isConfig("RECHARGE", "1")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.RECHARGE_CLOSE, "");
}
// 生成交易子订单
HighChildOrder childOrder = new HighChildOrder();
childOrder.setMemId(user.getId());
childOrder.setMemName(user.getName());
childOrder.setMemPhone(user.getPhone());
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo());
childOrder.setGoodsType(OrderChildGoodsType.TYPE6.getNumber());
childOrder.setGoodsId(goodsId);
childOrder.setGoodsName(OperatorEnum.getNameByType(outRechargePrice.getOperatorType()) + "话费充值" + outRechargePrice.getRechargePrice() + "元");
childOrder.setGoodsSpecName(outRechargePrice.getRechargePrice() + "元");
childOrder.setGoodsPrice(outRechargePrice.getRechargePrice());
childOrder.setGoodsActualPrice(outRechargePrice.getPayPrice());
childOrder.setSaleCount(1);
childOrder.setGiveawayType(false);
childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber());
childOrder.setTotalPrice(outRechargePrice.getRechargePrice());
childOrder.setTotalActualPrice(outRechargePrice.getPayPrice());
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setPraiseStatus(0);
childOrder.setCreateTime(new Date());
outRechargeOrder.setUserId(user.getId());
outRechargeOrder.setRechargeContent(rechargeContent);
outRechargeOrder.setCompanyId(outRechargePrice.getCompanyId());
outRechargeOrder.setUserName(user.getName());
outRechargeOrder.setRechargeType(outRechargePrice.getRechargeType());
outRechargeOrder.setUserPhone(user.getPhone());
outRechargeOrder.setOrderNo(order.getOrderNo());
outRechargeOrder.setChildOrderNo(childOrder.getChildOrderNo());
outRechargeOrder.setCreateTimed(new Date());
outRechargeOrder.setGoodsId(goodsId);
outRechargeOrder.setRechargePrice(outRechargePrice.getRechargePrice());
outRechargeOrder.setOrderPrice(outRechargePrice.getRechargePrice());
outRechargeOrder.setType(1);
outRechargeOrder.setOperatorName(OperatorEnum.getNameByType(outRechargePrice.getOperatorType()));
outRechargeOrder.setOperatorType(outRechargePrice.getOperatorType());
outRechargeOrderMapper.insert(outRechargeOrder);
return childOrder;
} }
} }

@ -92,6 +92,12 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
@Resource @Resource
private ApiMemberProductService apiMemberProductService; private ApiMemberProductService apiMemberProductService;
@Resource
private BsMsgService bsMsgService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Override @Override
public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard) { public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard) {
HighOrder order = orderService.getOrderDetailByNo(orderNo); HighOrder order = orderService.getOrderDetailByNo(orderNo);
@ -128,6 +134,9 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
// 处理订单产品业务 // 处理订单产品业务
orderBusHandle(order); orderBusHandle(order);
// 推送支付成功消息
bsMsgService.pushUserMsg(order.getId() , "支付成功");
} }
return order; return order;
@ -152,6 +161,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
timeout = 20, timeout = 20,
rollbackFor = Exception.class) rollbackFor = Exception.class)
public void orderBusHandle(HighOrder order) throws Exception { public void orderBusHandle(HighOrder order) throws Exception {
for (HighChildOrder childOrder : order.getHighChildOrderList()) { for (HighChildOrder childOrder : order.getHighChildOrderList()) {
if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE1.getNumber())) { if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE1.getNumber())) {
couponHandle(order, childOrder); couponHandle(order, childOrder);
@ -170,7 +180,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE5.getNumber())) { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE5.getNumber())) {
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) {
mobileRecharge(order);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE7.getNumber())) { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE7.getNumber())) {
eCouponPackageHandle(order , childOrder); eCouponPackageHandle(order , childOrder);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE8.getNumber())) { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE8.getNumber())) {
@ -462,5 +472,22 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
} }
/**
* @Author Sum1Dream
* @Name mobileRecharge
* @Description // 话费订单操作
* @Date 13:46 2022/11/2
* @Param [order]
* @Return void
*/
private void mobileRecharge(HighOrder order) throws Exception {
OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(order.getOrderNo());
if (outRechargeOrder.getPayStatus() == null) {
if (order.getProductType().equals(9)) {
outRechargeOrderService.editOutRechargeOrder(order);
}
}
outRechargeOrderService.pollRequest(outRechargeOrder);
}
} }

@ -21,10 +21,7 @@ import com.hai.order.service.*;
import com.hai.order.topic.OrderTopic; import com.hai.order.topic.OrderTopic;
import com.hai.order.type.*; import com.hai.order.type.*;
import com.hai.order.utils.OrderUtil; import com.hai.order.utils.OrderUtil;
import com.hai.service.HighDiscountAgentCodeService; import com.hai.service.*;
import com.hai.service.HighDiscountUserRelService;
import com.hai.service.HighUserPayPasswordService;
import com.hai.service.HighUserService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.producer.SendCallback; import org.apache.rocketmq.client.producer.SendCallback;
@ -86,6 +83,9 @@ public class OrderServiceImpl implements OrderService {
@Resource @Resource
private OrderPaySuccessService paySuccessService; private OrderPaySuccessService paySuccessService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Override @Override
public HighOrder insertOrderData(HighOrder order) { public HighOrder insertOrderData(HighOrder order) {
orderMapper.insert(order); orderMapper.insert(order);
@ -170,6 +170,9 @@ public class OrderServiceImpl implements OrderService {
object.put("userId" , child.getMemId()); object.put("userId" , child.getMemId());
object.put("orderItems" , child.getOrderItems()); object.put("orderItems" , child.getOrderItems());
/*********** 话费 请求数据************/
object.put("rechargeContent" , child.getRechargeContent());
object.put("goodsId" , child.getGoodsId());
// 购买卡券 // 购买卡券
if (child.getGoodsType().equals(OrderChildGoodsType.TYPE1.getNumber())) { if (child.getGoodsType().equals(OrderChildGoodsType.TYPE1.getNumber())) {
order.setProductType(OrderProductType.PRODUCT_TYPE5.getNumber()); order.setProductType(OrderProductType.PRODUCT_TYPE5.getNumber());
@ -218,6 +221,9 @@ public class OrderServiceImpl implements OrderService {
// 话费充值 // 话费充值
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) { } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE6.getNumber())) {
HighChildOrder childOrder = orderCreateHandleService.mobileRecharge(order , object);
childOrderList.add(childOrder);
order.setTitle(childOrder.getGoodsName());
order.setProductType(OrderProductType.PRODUCT_TYPE9.getNumber()); order.setProductType(OrderProductType.PRODUCT_TYPE9.getNumber());
// 优惠券包 // 优惠券包
@ -425,6 +431,8 @@ public class OrderServiceImpl implements OrderService {
// 订单入库 // 订单入库
HighOrder orderData = insertOrderData(order); HighOrder orderData = insertOrderData(order);
if (orderData.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { if (orderData.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) {
// 10分钟内未支付,自动取消订单 // 10分钟内未支付,自动取消订单
Message<HighOrder> rocketMsg = MessageBuilder.withPayload(order).build(); Message<HighOrder> rocketMsg = MessageBuilder.withPayload(order).build();

@ -1,5 +1,6 @@
package com.hai.service; package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.BsMsg; import com.hai.entity.BsMsg;
import com.hai.entity.BsMsgUser; import com.hai.entity.BsMsgUser;
import com.hai.entity.HighUser; import com.hai.entity.HighUser;
@ -86,5 +87,15 @@ public interface BsMsgService {
*/ */
List<BsMsg> queryMsgByList(Map<String , Object> map); List<BsMsg> queryMsgByList(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name pushUserMsg
* @Description // 推送用户信息
* @Date 18:21 2022/11/1
* @Param [orderId, userId]
* @Return void
*/
void pushUserMsg(Long orderId , String title) throws Exception;
} }

@ -1,6 +1,7 @@
package com.hai.service; package com.hai.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighOrder;
import com.hai.entity.HighUserCard; import com.hai.entity.HighUserCard;
import com.hai.entity.OutRechargeChildOrder; import com.hai.entity.OutRechargeChildOrder;
import com.hai.entity.OutRechargeOrder; import com.hai.entity.OutRechargeOrder;
@ -186,4 +187,14 @@ public interface OutRechargeOrderService {
*/ */
List<OutRechargeOrder> integralRebateRechargeOrder(); List<OutRechargeOrder> integralRebateRechargeOrder();
/**
* @Author Sum1Dream
* @Name editOutRechargeOrder
* @Description // 根据订单号修改订单内容
* @Date 11:42 2022/11/2
* @Param [order, outRechargeOrder]
* @Return void
*/
void editOutRechargeOrder(HighOrder order);
} }

@ -1,9 +1,13 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.DateUtil;
import com.hai.dao.BsMsgMapper; import com.hai.dao.BsMsgMapper;
import com.hai.dao.BsMsgUserMapper; import com.hai.dao.BsMsgUserMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.service.BsMsgService; import com.hai.service.BsMsgService;
import com.hai.service.HighOrderService;
import com.hai.service.HighUserService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -28,11 +32,16 @@ public class BsMsgServiceImpl implements BsMsgService {
@Resource @Resource
private BsMsgUserMapper bsMsgUserMapper; private BsMsgUserMapper bsMsgUserMapper;
@Resource
private HighOrderService highOrderService;
@Resource
private HighUserService highUserService;
@Override @Override
@Transactional @Transactional
public void insertMsg(BsMsg bsMsg , HighUser user) { public void insertMsg(BsMsg bsMsg , HighUser user) {
bsMsg.setStatus(1);
bsMsg.setCreateTime(new Date()); bsMsg.setCreateTime(new Date());
bsMsg.setUpdateTime(new Date()); bsMsg.setUpdateTime(new Date());
@ -133,4 +142,31 @@ public class BsMsgServiceImpl implements BsMsgService {
public List<BsMsg> queryMsgByList(Map<String, Object> map) { public List<BsMsg> queryMsgByList(Map<String, Object> map) {
return bsMsgUserMapper.queryMsgByList(map); return bsMsgUserMapper.queryMsgByList(map);
} }
@Override
public void pushUserMsg(Long orderId,String title) throws Exception {
// 查询订单
HighOrder highOrder = highOrderService.getOrderById(orderId);
// 查询用户信息
HighUser highUser = highUserService.findByUserId(highOrder.getMemId());
JSONObject object = new JSONObject();
object.put("price" , highOrder.getPayRealPrice());
object.put("objectName" , highOrder.getTitle());
object.put("time" , DateUtil.date2String(highOrder.getCreateTime() , DateUtil.Y_M_D_HMS_C));
BsMsg bsMsg = new BsMsg();
bsMsg.setCompanyId(highOrder.getCompanyId());
bsMsg.setOpName("系统生成");
bsMsg.setMsgType(1);
bsMsg.setType(1);
bsMsg.setObjectId(orderId);
bsMsg.setObjectType(highOrder.getPayType());
bsMsg.setJumpType(1);
bsMsg.setTitle(title);
bsMsg.setStatus(2);
bsMsg.setContent(object.toString());
insertMsg(bsMsg , highUser);
}
} }

@ -996,4 +996,23 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
return outRechargeOrderMapper.integralRebateRechargeOrder(); return outRechargeOrderMapper.integralRebateRechargeOrder();
} }
@Override
public void editOutRechargeOrder(HighOrder orderData) {
OutRechargeOrder outRechargeOrder = outRechargeOrderService.findByOrderNo(orderData.getOrderNo());
// 201:充值中 202:充值成功 203:充值失败 204:未充值
outRechargeOrder.setRechargeStatus(201);
// 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
outRechargeOrder.setPayStatus(102);
outRechargeOrder.setMemDiscountId(orderData.getMemDiscountId());
outRechargeOrder.setMemDiscountName(orderData.getMemDiscountName());
outRechargeOrder.setPayType(orderData.getPayType());
outRechargeOrder.setLaborUnionCard(orderData.getMemCardNo());
outRechargeOrder.setDiscountDeductionPrice(orderData.getDeductionCouponPrice());
outRechargeOrder.setIntegralDeductionPrice( new BigDecimal(orderData.getPayGold().toString()).divide(new BigDecimal(100)));
outRechargeOrder.setIntegralNum(new BigDecimal(orderData.getPayGold()));
outRechargeOrder.setPayPrice(orderData.getPayPrice());
outRechargeOrder.setPayRealPrice(orderData.getPayRealPrice());
outRechargeOrderService.updateOrder(outRechargeOrder);
}
} }

Loading…
Cancel
Save