10.10
This commit is contained in:
parent
8edd6408c1
commit
45068ab88f
@ -48,5 +48,11 @@ public interface FyPayService {
|
||||
*/
|
||||
public Map<String, String> queryOrderPos(ReceiveParameterPos receiveParameterPos,String insCd,String mchntCd) throws Exception;
|
||||
|
||||
/**
|
||||
* 主扫
|
||||
* @param receiveParameterPos
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Map<String, String> mainScan(ReceiveParameterPos receiveParameterPos) throws Exception;
|
||||
}
|
||||
|
@ -61,13 +61,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
@Resource
|
||||
private IntegralSettingsService integralSettingsService;
|
||||
|
||||
@Resource
|
||||
private UserBalanceService userBalanceService;
|
||||
|
||||
@Resource
|
||||
private CardValueOrdersService cardValueOrdersService;
|
||||
@Resource
|
||||
private CardFuleOrdersService fuleOrdersService;
|
||||
|
||||
/**
|
||||
* 条码支付
|
||||
@ -97,10 +93,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
map.put("mchnt_cd", mchntCd);
|
||||
map.put("goods_des", goodsDes);
|
||||
|
||||
|
||||
// 请求报文
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody, Const.fuiou_31_url);
|
||||
|
||||
//响应报文验签
|
||||
@ -180,9 +175,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
receiveParameter.setStoreId(storeId1);
|
||||
receiveParameter.setPayType(payType);
|
||||
|
||||
// 请求报文
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody, Const.fuiou_34_url);
|
||||
|
||||
//响应报文验签
|
||||
@ -197,12 +192,12 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
|
||||
String transactionType = null;
|
||||
String oilGunId = null;
|
||||
if (ObjectUtil.isNotEmpty(oilOrder) && ObjectUtil.isNotEmpty(goodsOrder)){
|
||||
if (ObjectUtil.isNotEmpty(oilOrder) && ObjectUtil.isNotEmpty(goodsOrder)) {
|
||||
transactionType = "5";
|
||||
}else if (ObjectUtil.isNotEmpty(oilOrder)) {
|
||||
} else if (ObjectUtil.isNotEmpty(oilOrder)) {
|
||||
transactionType = "4";
|
||||
oilGunId = oilOrder.getOilGunNum();
|
||||
}else if (ObjectUtil.isNotEmpty(goodsOrder)) {
|
||||
} else if (ObjectUtil.isNotEmpty(goodsOrder)) {
|
||||
transactionType = "2";
|
||||
}
|
||||
if ("CVR".equals(type) || "CFR".equals(type)) {
|
||||
@ -212,28 +207,22 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
transactionType = "3";
|
||||
}
|
||||
//查询商户配置
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId1,transactionType,oilGunId);
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId1, transactionType, oilGunId);
|
||||
List<ReturnRecord> returnRecords = returnRecordService.selectReturnRecordByOrderNo(orderNo);
|
||||
Date date = new Date();
|
||||
if (reqMap.get("trans_stat").equals("SUCCESS")) {
|
||||
|
||||
payStatus = "paid";
|
||||
if (!ObjectUtil.isEmpty(oilOrder)) {
|
||||
// 油品订单
|
||||
// 油品订单
|
||||
oilOrder.setOrderStatus("paid");
|
||||
oilOrder.setPayTime(date);
|
||||
oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getActiveId(), oilOrder.getCouponId(), oilOrder.getActiveType(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), Integer.valueOf(oilOrder.getOils()));
|
||||
oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getId());
|
||||
oilOrderService.insertFavorable(oilOrder, Double.valueOf(map1.get("oilCardAmount")));
|
||||
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId()))
|
||||
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), "1", orderNo);
|
||||
// 修改油罐容量
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class);
|
||||
if (jsonObjects.size() <= 1) {
|
||||
|
||||
Integer tankId = Integer.valueOf(jsonObjects.get(0).get("tankId").toString());
|
||||
oilOrder.setTankId(tankId);
|
||||
oilOrderService.addOilTracks(oilOrder, oilOrder.getStoreId());
|
||||
}
|
||||
// 修改油罐容量
|
||||
oilOrderService.addOilTracks(oilOrder, oilOrder.getStoreId());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder);
|
||||
//修改优惠券使用状态
|
||||
@ -246,7 +235,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(goodsOrder)) {
|
||||
// 商品订单
|
||||
// 商品订单
|
||||
goodsOrder.setStatus("paid");
|
||||
goodsOrder.setPayTime(date);
|
||||
goodsOrderService.insertFavorable(goodsOrder);
|
||||
@ -268,13 +257,13 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(cashierOrder)) {
|
||||
// 收银台订单
|
||||
// 收银台订单
|
||||
cashierOrder.setStatus("paid");
|
||||
cashierOrder.setPayTime(date);
|
||||
}
|
||||
if (!ArrayUtil.isEmpty(returnRecords)) {
|
||||
for (ReturnRecord returnRecord : returnRecords) {
|
||||
// 挂账归还信息
|
||||
// 挂账归还信息
|
||||
returnRecord.setReturnType("1");
|
||||
returnRecord.setPayStatus("paid");
|
||||
returnRecord.setPayTime(date);
|
||||
@ -291,16 +280,16 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
if (ObjectUtil.isNotEmpty(goodsOrder) && ObjectUtil.isNotEmpty(goodsOrder.getUserId())) {
|
||||
receiveParameter.setUserId(goodsOrder.getUserId());
|
||||
}
|
||||
|
||||
}
|
||||
if ("CFR".equals(type)) {
|
||||
//囤油卡订单
|
||||
payStates = "paid";
|
||||
}
|
||||
if ("IOS".equals(type)) { // 积分商城
|
||||
if ("IOS".equals(type)) {
|
||||
// 积分商城
|
||||
payStates = "paid";
|
||||
}
|
||||
// 修改商户账号余额信息
|
||||
// 修改商户账号余额信息
|
||||
Double amount = merchantConfig.getAmount();
|
||||
merchantConfig.setAmount(amount + (allAmount / 100));
|
||||
merchantConfigService.updateMerch(merchantConfig);
|
||||
@ -324,17 +313,15 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
returnRecord.setPayStatus("payFail");
|
||||
returnRecordService.updateReturnRecord(returnRecord);
|
||||
}
|
||||
|
||||
receiveParameter.setType("7");
|
||||
receiveParameter.setContent("挂账订单");
|
||||
}
|
||||
if ("CVR".equals(type)) {
|
||||
payStates = "payFail";
|
||||
cardValueOrdersService.updateOrderStatus(orderNo,payStatus);
|
||||
cardValueOrdersService.updateOrderStatus(orderNo, payStatus);
|
||||
}
|
||||
if ("CFR".equals(type)) {
|
||||
payStates = "payFail";
|
||||
|
||||
}
|
||||
if ("IOS".equals(type)) {
|
||||
payStates = "payFail";
|
||||
@ -382,7 +369,6 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
//储值卡
|
||||
Integer id = Integer.parseInt(map1.get("orderId"));
|
||||
cardValueRecordService.editPayStatus(id, payStates);
|
||||
//cardValueOrdersService.updateBalance(orderNo,payStatus);
|
||||
CardValueRecord byId = cardValueRecordService.getById(id);
|
||||
receiveParameter.setType("3");
|
||||
if (byId.getMtUserId() != null) {
|
||||
@ -415,7 +401,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
if (!reqMap.get("trans_stat").equals("USERPAYING")) {
|
||||
String payChannel = "cashier";
|
||||
if (ObjectUtil.isNotEmpty(map1.get("payChannel"))) payChannel = map1.get("payChannel");
|
||||
this.insertAllOrderInfo(receiveParameter, payStatus,discountAmount,payChannel,merchantConfig);
|
||||
this.insertAllOrderInfo(receiveParameter, payStatus, discountAmount, payChannel, merchantConfig);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(merchantConfig)) {
|
||||
//添加配置记录信息
|
||||
@ -423,7 +409,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
merchantConfigRecord.setMerchantId(merchantConfig.getId());
|
||||
if (payStatus.equals("paid")) {
|
||||
merchantConfigRecord.setIsSuccess("yes");
|
||||
}else {
|
||||
} else {
|
||||
merchantConfigRecord.setIsSuccess("no");
|
||||
}
|
||||
merchantConfigRecord.setAmount(allAmount / 100.0);
|
||||
@ -446,58 +432,57 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
try {
|
||||
String transactionType = null;
|
||||
String oilGunId = null;
|
||||
if (receiveParameter.getType().equals("1")){
|
||||
if (receiveParameter.getType().equals("1")) {
|
||||
transactionType = "4";
|
||||
oilGunId = receiveParameter.getOilGunId();
|
||||
} else if (receiveParameter.getType().equals("2")){
|
||||
} else if (receiveParameter.getType().equals("2")) {
|
||||
transactionType = "2";
|
||||
} else if (receiveParameter.getType().equals("3") || receiveParameter.getType().equals("5")){
|
||||
} else if (receiveParameter.getType().equals("3") || receiveParameter.getType().equals("5")) {
|
||||
transactionType = "1";
|
||||
} else if (receiveParameter.getType().equals("4")){
|
||||
} else if (receiveParameter.getType().equals("4")) {
|
||||
transactionType = "3";
|
||||
} else if (receiveParameter.getType().equals("6")){
|
||||
} else if (receiveParameter.getType().equals("6")) {
|
||||
transactionType = "5";
|
||||
}
|
||||
// 查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId(),transactionType,oilGunId);
|
||||
// 查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId(), transactionType, oilGunId);
|
||||
if (ObjectUtil.isEmpty(merchantConfig)) {
|
||||
res.put("code", "error");
|
||||
res.put("msg", "暂未配置商户信息");
|
||||
return res;
|
||||
}
|
||||
// MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16);
|
||||
// 查询用户信息
|
||||
// 查询用户信息
|
||||
LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId(), receiveParameter.getStoreId());
|
||||
|
||||
// 公钥
|
||||
// 公钥
|
||||
Const.INS_PUBLIC_KEY = merchantConfig.getPublicKey();
|
||||
// 私钥
|
||||
// 私钥
|
||||
Const.INS_PRIVATE_KEY = merchantConfig.getPrivateKey();
|
||||
Map<String, String> map = Builder.buildFuiou23();
|
||||
// 机构号
|
||||
// 机构号
|
||||
map.put("ins_cd", merchantConfig.getInsCd());
|
||||
// 商户号
|
||||
// 商户号
|
||||
map.put("mchnt_cd", merchantConfig.getMchntCd());
|
||||
// 订单号
|
||||
// 订单号
|
||||
map.put("mchnt_order_no", receiveParameter.getOrderNo());
|
||||
// 订单总金额
|
||||
// 订单总金额
|
||||
Integer goodsMoney = (int) (receiveParameter.getGoodsMoney() * 100);
|
||||
map.put("order_amt", goodsMoney.toString());
|
||||
// 订单描述
|
||||
// 订单描述
|
||||
map.put("goods_des", receiveParameter.getContent());
|
||||
if (receiveParameter.getPayType().equals("WECHAT")) {
|
||||
map.put("trade_type", "LETPAY");
|
||||
// 微信open_id
|
||||
// 微信open_id
|
||||
map.put("sub_openid", userVo.getOpenId());
|
||||
System.out.println("微信open_id:" + userVo.getOpenId());
|
||||
// appid
|
||||
// appid
|
||||
map.put("sub_appid", merchantConfig.getAppid());
|
||||
} else if (receiveParameter.getPayType().equals("ALIPAY")) {
|
||||
map.put("trade_type", "FWC");
|
||||
// 支付宝userId
|
||||
// 支付宝userId
|
||||
map.put("sub_openid", userVo.getUserId());
|
||||
System.out.println("支付宝userId:" + userVo.getUserId());
|
||||
// appid
|
||||
// appid
|
||||
map.put("sub_appid", merchantConfig.getAlipayAppid());
|
||||
} else {
|
||||
res.put("code", "error");
|
||||
@ -506,8 +491,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(merchantConfig)) {
|
||||
|
||||
// 添加配置记录信息
|
||||
// 添加配置记录信息
|
||||
MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord();
|
||||
merchantConfigRecord.setMerchantId(merchantConfig.getId());
|
||||
merchantConfigRecord.setIsSuccess("no");
|
||||
@ -518,9 +502,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
merchantConfigRecordService.insertMerchantConfigRecord(merchantConfigRecord);
|
||||
}
|
||||
|
||||
// 请求报文
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody, Const.fuiou_32_url);
|
||||
//响应报文验签
|
||||
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
|
||||
@ -529,10 +513,10 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
if (Utils.verifySign(resMap, str)) {
|
||||
System.out.println(resMap);
|
||||
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(receiveParameter.getOrderNo());
|
||||
// 添加订单信息
|
||||
// 添加订单信息
|
||||
Double discountAmount = 0.0;
|
||||
if (ObjectUtil.isNotEmpty(oilOrder)) discountAmount = oilOrder.getDiscountAmount();
|
||||
this.insertAllOrderInfo(receiveParameter, discountAmount,merchantConfig);
|
||||
this.insertAllOrderInfo(receiveParameter, discountAmount, merchantConfig);
|
||||
|
||||
res.put("code", "success");
|
||||
res.put("msg", "成功");
|
||||
@ -565,7 +549,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
/**
|
||||
* 添加所有订单信息
|
||||
*/
|
||||
private void insertAllOrderInfo(ReceiveParameter receiveParameter, String payStatus,Double discountAmount,String payChannel,MerchantConfig merchantConfig) {
|
||||
private void insertAllOrderInfo(ReceiveParameter receiveParameter, String payStatus, Double discountAmount, String payChannel, MerchantConfig merchantConfig) {
|
||||
AllOrderInfo allOrderInfo = new AllOrderInfo();
|
||||
allOrderInfo.setOrderNo(receiveParameter.getOrderNo());
|
||||
allOrderInfo.setType(receiveParameter.getType());
|
||||
@ -593,7 +577,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
/**
|
||||
* 添加所有订单信息
|
||||
*/
|
||||
private void insertAllOrderInfo(ReceiveParameter receiveParameter,Double discountAmount,MerchantConfig merchantConfig) {
|
||||
private void insertAllOrderInfo(ReceiveParameter receiveParameter, Double discountAmount, MerchantConfig merchantConfig) {
|
||||
AllOrderInfo allOrderInfo = new AllOrderInfo();
|
||||
allOrderInfo.setOrderNo(receiveParameter.getOrderNo());
|
||||
allOrderInfo.setType(receiveParameter.getType());
|
||||
@ -640,9 +624,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
Const.INS_PUBLIC_KEY = publicKey;
|
||||
Const.INS_PRIVATE_KEY = privateKey;
|
||||
|
||||
// 请求报文
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody, Const.fuiou_33_url);
|
||||
|
||||
//响应报文验签
|
||||
@ -661,20 +645,20 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
try {
|
||||
String transactionType = null;
|
||||
String oilGunId = null;
|
||||
if (receiveParameterPos.getType().equals("1")){
|
||||
if (receiveParameterPos.getType().equals("1")) {
|
||||
transactionType = "4";
|
||||
oilGunId = receiveParameterPos.getOilGunId();
|
||||
} else if (receiveParameterPos.getType().equals("2")){
|
||||
} else if (receiveParameterPos.getType().equals("2")) {
|
||||
transactionType = "2";
|
||||
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")){
|
||||
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")) {
|
||||
transactionType = "1";
|
||||
} else if (receiveParameterPos.getType().equals("4")){
|
||||
} else if (receiveParameterPos.getType().equals("4")) {
|
||||
transactionType = "3";
|
||||
} else if (receiveParameterPos.getType().equals("6")){
|
||||
} else if (receiveParameterPos.getType().equals("6")) {
|
||||
transactionType = "5";
|
||||
}
|
||||
// 查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(),transactionType,oilGunId);
|
||||
// 查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(), transactionType, oilGunId);
|
||||
if (ObjectUtil.isEmpty(merchantConfig)) {
|
||||
res.put("code", "error");
|
||||
res.put("msg", "暂未配置商户信息");
|
||||
@ -695,9 +679,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
map.put("goods_des", receiveParameterPos.getContent());
|
||||
|
||||
|
||||
// 请求报文
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody, Const.fuiou_31_url);
|
||||
|
||||
//响应报文验签
|
||||
@ -750,9 +734,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
map.put("mchnt_cd", mchntCd);
|
||||
|
||||
String payStatus = "unpaid";
|
||||
// 请求报文
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody, Const.fuiou_34_url);
|
||||
|
||||
//响应报文验签
|
||||
@ -762,35 +746,35 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(receiveParameterPos.getOrderNo());
|
||||
String transactionType = null;
|
||||
String oilGunId = null;
|
||||
if (receiveParameterPos.getType().equals("1")){
|
||||
if (receiveParameterPos.getType().equals("1")) {
|
||||
transactionType = "4";
|
||||
oilGunId = receiveParameterPos.getOilGunId();
|
||||
} else if (receiveParameterPos.getType().equals("2")){
|
||||
} else if (receiveParameterPos.getType().equals("2")) {
|
||||
transactionType = "2";
|
||||
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")){
|
||||
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")) {
|
||||
transactionType = "1";
|
||||
} else if (receiveParameterPos.getType().equals("4")){
|
||||
} else if (receiveParameterPos.getType().equals("4")) {
|
||||
transactionType = "3";
|
||||
} else if (receiveParameterPos.getType().equals("6")){
|
||||
} else if (receiveParameterPos.getType().equals("6")) {
|
||||
transactionType = "5";
|
||||
}
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(),transactionType,oilGunId);
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(), transactionType, oilGunId);
|
||||
ReceiveParameter receiveParameter = new ReceiveParameter();
|
||||
BeanUtils.copyProperties(receiveParameterPos, receiveParameter);
|
||||
Double discountAmount = 0.0;
|
||||
if (ObjectUtil.isNotEmpty(oilOrder)) discountAmount = oilOrder.getDiscountAmount();
|
||||
this.insertAllOrderInfo(receiveParameter, receiveParameterPos.getPayType(),discountAmount,"POS",merchantConfig);
|
||||
this.insertAllOrderInfo(receiveParameter, receiveParameterPos.getPayType(), discountAmount, "POS", merchantConfig);
|
||||
if (reqMap.get("trans_stat").equals("SUCCESS")) {
|
||||
payStatus = "paid";
|
||||
if (!ObjectUtil.isEmpty(oilOrder)) {
|
||||
// 油品订单
|
||||
// 油品订单
|
||||
oilOrder.setOrderStatus("paid");
|
||||
oilOrder.setPayTime(new Date());
|
||||
oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getActiveId(), oilOrder.getCouponId(), oilOrder.getActiveType(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), Integer.valueOf(oilOrder.getOils()));
|
||||
oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getId());
|
||||
oilOrderService.insertFavorable(oilOrder, receiveParameterPos.getOilCardAmount());
|
||||
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId()))
|
||||
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), "1", receiveParameterPos.getOrderNo());
|
||||
// 修改油罐容量
|
||||
// 修改油罐容量
|
||||
oilOrderService.addOilTracks(oilOrder, oilOrder.getStoreId());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder);
|
||||
@ -803,7 +787,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 修改商户账号余额信息
|
||||
// 修改商户账号余额信息
|
||||
Double amount = merchantConfig.getAmount();
|
||||
merchantConfig.setAmount(amount + receiveParameterPos.getGoodsMoney());
|
||||
merchantConfigService.updateMerch(merchantConfig);
|
||||
@ -829,7 +813,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(merchantConfig)) {
|
||||
|
||||
// 添加配置记录信息
|
||||
// 添加配置记录信息
|
||||
MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord();
|
||||
merchantConfigRecord.setMerchantId(merchantConfig.getId());
|
||||
if (payStatus.equals("paid")) {
|
||||
@ -856,20 +840,20 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
|
||||
String transactionType = null;
|
||||
String oilGunId = null;
|
||||
if (receiveParameterPos.getType().equals("1")){
|
||||
if (receiveParameterPos.getType().equals("1")) {
|
||||
transactionType = "4";
|
||||
oilGunId = receiveParameterPos.getOilGunId();
|
||||
} else if (receiveParameterPos.getType().equals("2")){
|
||||
} else if (receiveParameterPos.getType().equals("2")) {
|
||||
transactionType = "2";
|
||||
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")){
|
||||
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")) {
|
||||
transactionType = "1";
|
||||
} else if (receiveParameterPos.getType().equals("4")){
|
||||
} else if (receiveParameterPos.getType().equals("4")) {
|
||||
transactionType = "3";
|
||||
} else if (receiveParameterPos.getType().equals("6")){
|
||||
} else if (receiveParameterPos.getType().equals("6")) {
|
||||
transactionType = "5";
|
||||
}
|
||||
// 查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(),transactionType,oilGunId);
|
||||
// 查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(), transactionType, oilGunId);
|
||||
if (ObjectUtil.isEmpty(merchantConfig)) {
|
||||
res.put("code", "error");
|
||||
res.put("msg", "暂未配置商户信息");
|
||||
@ -897,7 +881,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(merchantConfig)) {
|
||||
|
||||
// 添加配置记录信息
|
||||
// 添加配置记录信息
|
||||
MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord();
|
||||
merchantConfigRecord.setMerchantId(merchantConfig.getId());
|
||||
merchantConfigRecord.setIsSuccess("no");
|
||||
@ -907,9 +891,9 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
merchantConfigRecord.setOrderNo(receiveParameterPos.getOrderNo());
|
||||
merchantConfigRecordService.insertMerchantConfigRecord(merchantConfigRecord);
|
||||
}
|
||||
// 请求报文
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody, Const.fuiou_35_url);
|
||||
|
||||
//响应报文验签
|
||||
@ -920,10 +904,10 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(receiveParameterPos.getOrderNo());
|
||||
ReceiveParameter receiveParameter = new ReceiveParameter();
|
||||
BeanUtils.copyProperties(receiveParameterPos, receiveParameter);
|
||||
// 添加订单信息
|
||||
// 添加订单信息
|
||||
Double discountAmount = 0.0;
|
||||
if (ObjectUtil.isNotEmpty(oilOrder)) discountAmount = oilOrder.getDiscountAmount();
|
||||
this.insertAllOrderInfo(receiveParameter, discountAmount,merchantConfig);
|
||||
this.insertAllOrderInfo(receiveParameter, discountAmount, merchantConfig);
|
||||
System.out.println(resMap);
|
||||
}
|
||||
return resMap;
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
* @since 2023-11-07 15:04:17
|
||||
*/
|
||||
@Data
|
||||
@TableName("mt_order")
|
||||
@TableName("lj_order")
|
||||
@ApiModel(value = "LJOrder对象", description = "商品订单表")
|
||||
public class LJOrder extends BaseEntity implements Serializable {
|
||||
|
||||
@ -101,6 +101,10 @@ public class LJOrder extends BaseEntity implements Serializable {
|
||||
* 操作员工
|
||||
*/
|
||||
private Integer staffId;
|
||||
/**
|
||||
* 优惠券 用户 id
|
||||
*/
|
||||
private Integer couponUserId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String goodsName;
|
||||
|
@ -15,7 +15,7 @@ import java.io.Serializable;
|
||||
* 订单商品表(OrderGoods)实体类
|
||||
*/
|
||||
@Data
|
||||
@TableName("mt_order_goods")
|
||||
@TableName("lj_order_goods")
|
||||
@ApiModel(value = "OrderGoods对象", description = "订单商品表")
|
||||
public class OrderGoods extends BaseEntity implements Serializable {
|
||||
|
||||
|
@ -98,13 +98,8 @@ public interface OilOrderService extends IService<OilOrder> {
|
||||
* 消费有礼调用接口
|
||||
* @param storeId 店铺id
|
||||
* @param userId 用户id
|
||||
* @param activeId 活动id
|
||||
* @param cardFavorableId 优惠券id
|
||||
* @param type 活动类型
|
||||
* @param orderAmount 订单金额
|
||||
* @param oilId 油品id
|
||||
*/
|
||||
void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Double payAmount,Integer oilId) throws Exception;
|
||||
void updateCardAndActiveById(Integer storeId,Integer userId,Integer orderId);
|
||||
|
||||
/**
|
||||
* 扫描小程序中二维码所处理的逻辑
|
||||
@ -154,7 +149,7 @@ public interface OilOrderService extends IService<OilOrder> {
|
||||
public void addOilTracks(OilOrder oilOrder,Integer storeId);
|
||||
|
||||
/**
|
||||
* 添加油品订单信息
|
||||
* 修改油品订单信息
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
|
@ -217,7 +217,10 @@ public class LJOrderServiceImpl extends ServiceImpl<LJOrderMapper, LJOrder> impl
|
||||
return row;
|
||||
}
|
||||
|
||||
// 添加优惠记录
|
||||
/**
|
||||
* 添加优惠记录
|
||||
* @param order
|
||||
*/
|
||||
@Override
|
||||
public void insertFavorable(LJOrder order) {
|
||||
FavorableRecords favorableRecords = new FavorableRecords();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -63,9 +63,16 @@ public class PayCenterController extends BaseController {
|
||||
return getSuccessResult("查询成功",payCenterService.cashRegisterSpendWisely(map));
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序支付成功后 消费有礼
|
||||
* @param map
|
||||
* @param request
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping("/cashRegisterSpendWiselyApp")
|
||||
public ResponseObject cashRegisterSpendWiselyApp(@RequestBody Map<String,String> map,HttpServletRequest request) throws Exception {
|
||||
logger.info("收银台获取可用优惠券参数:{}", map);
|
||||
logger.info("小程序获取可用优惠券参数:{}", map);
|
||||
return getSuccessResult("查询成功",payCenterService.cashRegisterSpendWiselyApp(map));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user