Merge branch 'master' into 2.0-dev

* master:
  修改配置星巴克 肯德基 会员充值 话费 微信商户号
  修改配置星巴克 肯德基 会员充值 话费 微信商户号

# Conflicts:
#	hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java
#	hai-cweb/src/main/java/com/cweb/controller/pay/ThirdOrderController.java
dev-discount
袁野 2 years ago
parent 681dbf91b4
commit 4f93b703d6
  1. 3
      hai-order/src/main/java/com/web/controller/OrderController.java
  2. 211
      hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java
  3. 2
      hai-order/src/main/java/com/web/controller/business/OrderThirdPartyController.java
  4. 8
      hai-order/src/main/resources/dev/logback.xml
  5. 11
      hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java
  6. 10
      hai-service/src/main/java/com/hai/service/OutRechargeChildOrderService.java
  7. 9
      hai-service/src/main/java/com/hai/service/impl/OutRechargeChildOrderServiceImpl.java
  8. 34
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java

@ -47,9 +47,6 @@ public class OrderController {
@Resource @Resource
private OrderService orderService; private OrderService orderService;
@Resource
private OrderPaySuccessService orderPaySuccessService;
@Resource @Resource
private UserCenter userCenter; private UserCenter userCenter;

@ -0,0 +1,211 @@
package com.web.controller.business;
import com.alibaba.excel.EasyExcel;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighOrder;
import com.hai.enum_type.OrderStatusEnum;
import com.hai.enum_type.UserObjectTypeEnum;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.order.model.OrderThirdPartyModel;
import com.hai.order.service.OrderService;
import com.hai.order.type.OrderPayType;
import com.hai.service.OutRechargeOrderService;
import com.hai.service.impl.OutRechargeOrderServiceImpl;
import com.web.config.SysConst;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping(value = "mobileRecharge")
@Api(value = "话费充值业务")
public class OrderMobileRechargeController {
private static Logger log = LoggerFactory.getLogger(OrderMobileRechargeController.class);
@Resource
private UserCenter userCenter;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private OrderService orderService;
@RequestMapping(value = "/getOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询话费订单列表")
public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "memCardNo", required = false) String memCardNo,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String,Object> map = new HashMap<>();
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) {
map.put("companyId" , companyId);
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
map.put("companyId", userInfoModel.getBsCompany().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("memCardNo", memCardNo);
map.put("productType", 9);
map.put("status", status);
map.put("payType", payType);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(orderService.getOrderList(map)));
} catch (Exception e) {
log.error("OrderCouponController --> getOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/exportMobilePartyOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出话费订单列表")
public ResponseData exportMobilePartyOrderList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "memCardNo", required = false) String memCardNo,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "productType", required = false) Integer productType,
@RequestParam(name = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String,Object> map = new HashMap<>();
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) {
map.put("companyId" , companyId);
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
map.put("companyId", userInfoModel.getBsCompany().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("memCardNo", memCardNo);
map.put("productType", productType);
map.put("status", status);
map.put("payType", payType);
// 查询数据
List<HighOrder> orderList = orderService.getOrderList(map);
List<OrderThirdPartyModel> dataList = new ArrayList<>();
OrderThirdPartyModel model;
for (HighOrder thirdPartyModel : orderList) {
model = new OrderThirdPartyModel();
model.setOrderNo(thirdPartyModel.getOrderNo());
model.setMemPhone(thirdPartyModel.getMemPhone());
model.setTitle(thirdPartyModel.getTitle());
model.setTotalPrice(thirdPartyModel.getTotalPrice());
model.setTotalDeductionPrice(thirdPartyModel.getTotalDeductionPrice());
model.setDeductionProductPrice(thirdPartyModel.getDeductionProductPrice());
model.setPayablePrice(thirdPartyModel.getPayablePrice());
model.setPayPrice(thirdPartyModel.getPayPrice());
model.setPayType(OrderPayType.getDataByType(thirdPartyModel.getPayType()).getName());
model.setOrderStatus(OrderStatusEnum.getNameByType(thirdPartyModel.getOrderStatus()));
model.setCreateTime(thirdPartyModel.getCreateTime());
model.setPayTime(thirdPartyModel.getPayTime());
dataList.add(model);
}
String fileUrl = SysConst.getSysConfig().getFileUrl() + "temporary/";
String pathName = System.currentTimeMillis()+".xlsx";
File file = new File(fileUrl);
if (!file.exists()) {
file.mkdirs();
}
EasyExcel.write(fileUrl+pathName)
.head(OrderThirdPartyModel.class)
.sheet("交易订单")
.doWrite(dataList);
return ResponseMsgUtil.success(pathName);
} catch (Exception e) {
log.error("OrderCouponController --> getOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getMobileOrderDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询话费订单详情")
public ResponseData getMobileOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) {
try {
return ResponseMsgUtil.success(outRechargeOrderService.findByOrderNo(orderNo));
} catch (Exception e) {
log.error("OrderExtController -> getGasOrderDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -45,7 +45,7 @@ import java.util.Map;
@Api(value = "第三方订单业务") @Api(value = "第三方订单业务")
public class OrderThirdPartyController { public class OrderThirdPartyController {
private static Logger log = LoggerFactory.getLogger(OrderOilController.class); private static Logger log = LoggerFactory.getLogger(OrderThirdPartyController.class);
@Resource @Resource
private UserCenter userCenter; private UserCenter userCenter;

@ -95,7 +95,7 @@
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/QzLog.log</File> <File>log/QzLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/QzLog.log.%d.%i</fileNamePattern> <fileNamePattern>log/QzLog/QzLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB --> <!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize> <maxFileSize>64 MB</maxFileSize>
@ -112,7 +112,7 @@
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/RechargeLog.log</File> <File>log/RechargeLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/RechargeLog.log.%d.%i</fileNamePattern> <fileNamePattern>log/RechargeLog/RechargeLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB --> <!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize> <maxFileSize>64 MB</maxFileSize>
@ -149,4 +149,8 @@
<logger name="com.hai.config.RechargeConfig" level="INFO"> <logger name="com.hai.config.RechargeConfig" level="INFO">
<appender-ref ref="RechargeLog" /> <appender-ref ref="RechargeLog" />
</logger> </logger>
<logger name="com.hai.service.impl.OutRechargeOrderServiceImpl" level="INFO">
<appender-ref ref="RechargeLog" />
</logger>
</configuration> </configuration>

@ -3,6 +3,7 @@ package com.hai.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* out_recharge_order * out_recharge_order
@ -231,6 +232,16 @@ public class OutRechargeOrder implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
List<OutRechargeChildOrder> outRechargeChildOrders;
public List<OutRechargeChildOrder> getOutRechargeChildOrders() {
return outRechargeChildOrders;
}
public void setOutRechargeChildOrders(List<OutRechargeChildOrder> outRechargeChildOrders) {
this.outRechargeChildOrders = outRechargeChildOrders;
}
public Long getId() { public Long getId() {
return id; return id;
} }

@ -19,6 +19,16 @@ public interface OutRechargeChildOrderService {
*/ */
List<OutRechargeChildOrder> getListRechargeChildOrder(Map<String, Object> map); List<OutRechargeChildOrder> getListRechargeChildOrder(Map<String, Object> map);
/**
* @Author Sum1Dream
* @Name getListRechargeChildOrderByOrderNo
* @Description // 根据订单号查询话费子订单
* @Date 09:59 2023/1/18
* @Param [orderNo]
* @Return java.util.List<com.hai.entity.OutRechargeChildOrder>
*/
List<OutRechargeChildOrder> getListRechargeChildOrderByOrderId(Long orderId);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @name findById.java * @name findById.java

@ -40,6 +40,15 @@ public class OutRechargeChildOrderServiceImpl implements OutRechargeChildOrderSe
return rechargeChildOrderMapper.selectByExample(example); return rechargeChildOrderMapper.selectByExample(example);
} }
@Override
public List<OutRechargeChildOrder> getListRechargeChildOrderByOrderId(Long orderId) {
OutRechargeChildOrderExample example = new OutRechargeChildOrderExample();
example.createCriteria().andParentOrderIdEqualTo(orderId);
return rechargeChildOrderMapper.selectByExample(example);
}
@Override @Override
public OutRechargeChildOrder findById(Long id) { public OutRechargeChildOrder findById(Long id) {
return rechargeChildOrderMapper.selectByPrimaryKey(id); return rechargeChildOrderMapper.selectByPrimaryKey(id);

@ -2,6 +2,8 @@ package com.hai.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
@ -59,9 +61,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Resource @Resource
private OutRechargeOrderMapperExt outRechargeOrderMapperExt; private OutRechargeOrderMapperExt outRechargeOrderMapperExt;
@Resource
private HighUserCardService highUserCardService;
@Resource @Resource
private OrderService orderService; private OrderService orderService;
@ -195,10 +194,24 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
} }
@Override @Override
@Cached(cacheType = CacheType.REMOTE,name="order:", key = "#orderNo",expire = 3600*24*30)
public OutRechargeOrder findByOrderNo(String orderNo) { public OutRechargeOrder findByOrderNo(String orderNo) {
OutRechargeOrderExample example = new OutRechargeOrderExample(); OutRechargeOrderExample example = new OutRechargeOrderExample();
example.createCriteria().andOrderNoEqualTo(orderNo); example.createCriteria().andOrderNoEqualTo(orderNo);
return outRechargeOrderMapper.selectByExample(example).get(0);
List<OutRechargeOrder> list = outRechargeOrderMapper.selectByExample(example);
if (list.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");
}
OutRechargeOrder outRechargeOrder = list.get(0);
// 充值子订单
outRechargeOrder.setOutRechargeChildOrders(outRechargeChildOrderService.getListRechargeChildOrderByOrderId(outRechargeOrder.getId()));
return outRechargeOrder;
} }
@Override @Override
@ -987,19 +1000,6 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
childOrder.setUpdateTime(new Date()); childOrder.setUpdateTime(new Date());
outRechargeChildOrderService.insertOrder(childOrder); outRechargeChildOrderService.insertOrder(childOrder);
// 创建提交记录
// BsRequestRecord requestRecord = new BsRequestRecord();
// requestRecord.setCreateTime(new Date());
// requestRecord.setUpdateTime(new Date());
// requestRecord.setOrderNo(orderNo);
// requestRecord.setRequestContent(object.toJSONString());
// requestRecord.setOperatorId(0L);
// requestRecord.setOperatorName("系统生成");
// requestRecord.setSourceId(childOrder.getId().toString());
// requestRecord.setSourceType(1);
//
// bsRequestRecordService.insertRequestRecord(requestRecord);
// 判断是否充值提交成功 // 判断是否充值提交成功
if (childOrder.getStatus() == 102) { if (childOrder.getStatus() == 102) {
outRechargeOrder.setRechargeStatus(201); outRechargeOrder.setRechargeStatus(201);

Loading…
Cancel
Save