Merge branch 'master' of https://gitee.com/nny_1/oilSystem
# Conflicts: # fuintBackend/fuint-application/src/main/resources/application.properties
This commit is contained in:
commit
b40a9d8efe
@ -4,6 +4,10 @@ import com.fuint.api.fuyou.service.FyPayService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@ -37,6 +41,26 @@ public class FyPayController {
|
||||
return map;
|
||||
}
|
||||
|
||||
// 接收支付平台异步通知的接口
|
||||
@PostMapping("/notify")
|
||||
public String notifyUrl(@RequestBody HttpServletRequest request,@RequestBody HttpServletResponse response) {
|
||||
System.out.println(request+"111");
|
||||
System.out.println(response+"222");
|
||||
// Map paramMap = new HashMap<>();
|
||||
// Enumeration parameterNames = request.getParameterNames();
|
||||
// while(parameterNames.hasMoreElements()) {
|
||||
// String parameterName = (String) parameterNames.nextElement();
|
||||
// paramMap.put(parameterName, request.getParameter(parameterName));
|
||||
// }
|
||||
// boolean isSuccess = processNotify(paramMap); // 处理支付结果并返回成功或失败状态
|
||||
// if(isSuccess) {
|
||||
// return "success"; // 返回成功状态,通知支付平台异步通知已成功接收
|
||||
// } else {
|
||||
// return "fail"; // 返回失败状态,通知支付平台异步通知已失败
|
||||
// }
|
||||
return "11111111";
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款 成功 result_msg 显示success
|
||||
* result_code显示000000
|
||||
|
@ -38,7 +38,7 @@ public class Builder {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
// sdf_no.format(calendar.getTime()) + (int) (random.nextDouble() * 100000)
|
||||
map.put("mchnt_order_no", "");
|
||||
map.put("curr_type", "");
|
||||
map.put("curr_type", "CNY");
|
||||
map.put("order_amt", "1");
|
||||
map.put("term_ip", Const.term_ip);
|
||||
SimpleDateFormat sdf_ts = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
@ -71,6 +71,49 @@ public class Builder {
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> buildFuiou23() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
|
||||
map.put("version", Const.version);
|
||||
map.put("ins_cd", Const.ins_cd);
|
||||
map.put("mchnt_cd", Const.mchnt_cd);
|
||||
map.put("term_id", Const.term_id);
|
||||
map.put("random_str", randomNumberGenerator.nextBytes().toHex());
|
||||
map.put("sign", "");
|
||||
map.put("goods_des", Const.goods_des);
|
||||
map.put("goods_detail", "");
|
||||
map.put("goods_tag", "");
|
||||
map.put("product_id", "");
|
||||
map.put("addn_inf", "");
|
||||
map.put("mchnt_order_no", "");
|
||||
map.put("curr_type", "CNY");
|
||||
map.put("openid", "");
|
||||
map.put("order_amt", "1");
|
||||
map.put("term_ip", Const.term_ip);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
SimpleDateFormat sdf_ts = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
map.put("txn_begin_ts",sdf_ts.format(calendar.getTime()));
|
||||
map.put("notify_url", Const.notify_url);
|
||||
map.put("limit_pay", "");
|
||||
map.put("trade_type", Const.trade_type);
|
||||
map.put("sub_openid", "");
|
||||
map.put("sub_appid", Const.sub_appid);
|
||||
map.put("reserved_expire_minute", "1");
|
||||
map.put("reserved_fy_term_id", "");
|
||||
map.put("reserved_fy_term_type", "");
|
||||
map.put("reserved_txn_bonus", "");
|
||||
map.put("reserved_fy_term_sn", "");
|
||||
map.put("reserved_device_info", "");
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退款
|
||||
*
|
||||
|
@ -35,18 +35,23 @@ public class Const {
|
||||
public static String auth_code = "";
|
||||
// 交易关闭时间
|
||||
public static Integer reserved_expire_minute = 1;
|
||||
// 小程序appid
|
||||
public static String sub_appid = "wxba517a9bac38fe92";
|
||||
// 订单类型 小程序等
|
||||
public static String trade_type = "LETPAY";
|
||||
|
||||
//机构公钥
|
||||
public static String INS_PUBLIC_KEY="";
|
||||
|
||||
//异步通知(回调地址)
|
||||
// public static String notify_url = "https://www.fuint.cn/fuint-application/clientApi/pay/aliPayCallback";
|
||||
public static String notify_url = "http://www.wrx.cn";
|
||||
|
||||
//下单
|
||||
public static String fuiou_21_url = "https://fundwx.fuiou.com/preCreate";
|
||||
//扫码
|
||||
public static String fuiou_22_url = "https://fundwx.fuiou.com/micropay";
|
||||
//公众号/服务窗统一下单
|
||||
//公众号/服务窗/小程序统一下单
|
||||
public static String fuiou_23_url = "https://fundwx.fuiou.com/wxPreCreate";
|
||||
//退款
|
||||
public static String fuiou_24_url = "https://fundwx.fuiou.com/commonRefund";
|
||||
|
@ -17,6 +17,13 @@ public interface FyPayService {
|
||||
*/
|
||||
public Map<String, String> queryOrder(Map<String, String> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 小程序
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<String, String> applet(Map<String, String> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 退款
|
||||
* @return
|
||||
|
@ -11,6 +11,7 @@ import com.fuint.api.fuyou.entity.MerchantConfig;
|
||||
import com.fuint.api.fuyou.entity.Message;
|
||||
import com.fuint.api.fuyou.service.FyPayService;
|
||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import com.fuint.api.fuyou.util.HttpUtils;
|
||||
import com.fuint.api.fuyou.util.Utils;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||
@ -19,14 +20,16 @@ import com.fuint.business.marketingActivity.cardFule.service.CardFuelRecordServi
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService;
|
||||
import com.fuint.business.order.entity.*;
|
||||
import com.fuint.business.order.service.*;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@ -297,6 +300,45 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
return resMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> applet(Map<String, String> map1) throws Exception {
|
||||
String publicKey = map1.get("publicKey");
|
||||
String privateKey = map1.get("privateKey");
|
||||
Const.INS_PUBLIC_KEY = publicKey;
|
||||
Const.INS_PRIVATE_KEY = privateKey;
|
||||
String orderNo = map1.get("orderNo");
|
||||
String payType = "WECHAT";
|
||||
String allAmount = map1.get("allAmount");
|
||||
String insCd = map1.get("insCd");
|
||||
String mchntCd = map1.get("mchntCd");
|
||||
String goodsDes = map1.get("goodsDes");
|
||||
Map<String, String> map = Builder.buildFuiou23();
|
||||
map.put("mchnt_order_no",orderNo);
|
||||
map.put("order_type",payType);
|
||||
map.put("order_amt", allAmount);
|
||||
map.put("ins_cd", insCd);
|
||||
map.put("mchnt_cd", mchntCd);
|
||||
map.put("goods_des", goodsDes);
|
||||
map.put("openid", map1.get("openId"));
|
||||
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody,Const.fuiou_23_url);
|
||||
System.out.println("1+"+reqBody);
|
||||
System.out.println("2+"+rspXml);
|
||||
//响应报文验签
|
||||
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
|
||||
|
||||
String str = resMap.get("sign");
|
||||
if (Utils.verifySign(resMap, str)){
|
||||
|
||||
}
|
||||
System.out.println(resMap);
|
||||
|
||||
return resMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> refund(Map<String, String> map1) throws Exception {
|
||||
String orderNo = map1.get("orderNo");
|
||||
|
@ -0,0 +1,79 @@
|
||||
package com.fuint.api.fuyou.util;
|
||||
|
||||
import com.fuint.api.fuyou.entity.Const;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class HttpUtils {
|
||||
|
||||
/**
|
||||
* 发送 post请求访问本地应用并根据传递参数不同返回不同结果
|
||||
*/
|
||||
public void post(String url, Map<String, String> map, StringBuffer result) {
|
||||
// 创建默认的httpClient实例.
|
||||
CloseableHttpClient httpclient = HttpClients.createDefault();
|
||||
// 创建httppost
|
||||
HttpPost httppost = new HttpPost(url);
|
||||
// 创建参数队列
|
||||
List<NameValuePair> formparams = new ArrayList<>();
|
||||
|
||||
Iterator it=map.keySet().iterator();
|
||||
while(it.hasNext()){
|
||||
String key;
|
||||
String value;
|
||||
key=it.next().toString();
|
||||
value=map.get(key);
|
||||
|
||||
formparams.add(new BasicNameValuePair(key, value));
|
||||
}
|
||||
|
||||
UrlEncodedFormEntity uefEntity;
|
||||
try {
|
||||
uefEntity = new UrlEncodedFormEntity(formparams, Const.charset);
|
||||
httppost.setEntity(uefEntity);
|
||||
|
||||
System.out.println("提交请求 " + httppost.getURI());
|
||||
CloseableHttpResponse response = httpclient.execute(httppost);
|
||||
try {
|
||||
HttpEntity entity = response.getEntity();
|
||||
|
||||
if (entity != null && result != null) {
|
||||
result.append(EntityUtils.toString(entity, Const.charset));
|
||||
}
|
||||
|
||||
// 打印响应状态
|
||||
System.out.println(response.getStatusLine());
|
||||
} finally {
|
||||
response.close();
|
||||
}
|
||||
} catch (ClientProtocolException e) {
|
||||
e.printStackTrace();
|
||||
} catch (UnsupportedEncodingException e1) {
|
||||
e1.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
// 关闭连接,释放资源
|
||||
try {
|
||||
httpclient.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.fuint.api.rocketMQ.test;
|
||||
|
||||
import org.apache.rocketmq.client.producer.DefaultMQProducer;
|
||||
import org.apache.rocketmq.client.producer.SendResult;
|
||||
import org.apache.rocketmq.client.producer.SendStatus;
|
||||
import org.apache.rocketmq.common.message.Message;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 发送同步消息
|
||||
*/
|
||||
public class SyncProducer {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
//1.创建消息生产者producer,并制定生产者组名
|
||||
DefaultMQProducer producer = new DefaultMQProducer("group1");
|
||||
//2.指定Nameserver地址
|
||||
producer.setNamesrvAddr("39.104.58.101:9876");
|
||||
//3.启动producer
|
||||
producer.start();
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
//4.创建消息对象,指定主题Topic、Tag和消息体
|
||||
/**
|
||||
* 参数一:消息主题Topic
|
||||
* 参数二:消息Tag
|
||||
* 参数三:消息内容
|
||||
*/
|
||||
Message msg = new Message("springboot-mq", "Tag1", ("Hello World" + i).getBytes());
|
||||
//5.发送消息
|
||||
SendResult result = producer.send(msg);
|
||||
//发送状态
|
||||
SendStatus status = result.getSendStatus();
|
||||
|
||||
System.out.println("发送结果:" + result);
|
||||
|
||||
//线程睡1秒
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
}
|
||||
|
||||
//6.关闭生产者producer
|
||||
producer.shutdown();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,17 @@ public class ActiveConsumptionController extends BaseController {
|
||||
return getSuccessResult(this.activeConsumptionService.getOneById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询数据集合
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("/list/{id}")
|
||||
public ResponseObject selectList(@PathVariable Serializable id) {
|
||||
return getSuccessResult(this.activeConsumptionChildService.selectList(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
@ -4,6 +4,7 @@ import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -16,6 +17,7 @@ import java.io.Serializable;
|
||||
* @since 2023-11-10 10:44:58
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@TableName("active_consumption")
|
||||
public class ActiveConsumption extends Model<ActiveConsumption> {
|
||||
//主键id
|
||||
@TableId(type = IdType.AUTO)
|
||||
|
@ -3,6 +3,9 @@ package com.fuint.business.marketingActivity.activeConsumption.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消费有礼活动子表(存放兑换物品)(ActiveConsumptionChild)表数据库访问层
|
||||
*
|
||||
@ -11,4 +14,6 @@ import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsu
|
||||
*/
|
||||
public interface ActiveConsumptionChildMapper extends BaseMapper<ActiveConsumptionChild> {
|
||||
|
||||
|
||||
List<ActiveConsumptionChild> selectConsumptionChilds(Serializable id);
|
||||
}
|
||||
|
@ -1,7 +1,12 @@
|
||||
package com.fuint.business.marketingActivity.activeConsumption.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消费有礼活动(ActiveConsumption)表数据库访问层
|
||||
@ -11,5 +16,6 @@ import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsu
|
||||
*/
|
||||
public interface ActiveConsumptionMapper extends BaseMapper<ActiveConsumption> {
|
||||
|
||||
IPage selectConsumptions(Page page, @Param("activeConsumption") ActiveConsumption activeConsumption);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsumptionChildMapper">
|
||||
|
||||
<resultMap type="com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild" id="ActiveConsumptionChildMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="activeConsumptionId" column="active_consumption_id" />
|
||||
<result property="activeGift" column="active_gift" />
|
||||
<result property="goodsIds" column="goods_ids" />
|
||||
<result property="goodsName" column="goods_name" />
|
||||
<result property="goodsTotal" column="goods_total" />
|
||||
<result property="vouchersId" column="vouchers_id" />
|
||||
<result property="giftCardName" column="gift_card_name" />
|
||||
<result property="giftCardType" column="gift_card_type" />
|
||||
<result property="giftCardDetail" column="gift_card_detail" />
|
||||
<result property="giftCardTime" column="gift_card_time" />
|
||||
<result property="giftCardTotal" column="gift_card_total" />
|
||||
<result property="validityZero" column="validity_zero" />
|
||||
<result property="validityOne" column="validity_one" />
|
||||
<result property="validityTwo" column="validity_two" />
|
||||
<result property="timeType" column="time_type" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectConsumptionChilds" resultMap="ActiveConsumptionChildMap">
|
||||
select
|
||||
*
|
||||
from active_consumption_child acc
|
||||
where
|
||||
acc.active_consumption_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
@ -2,46 +2,55 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsumptionMapper">
|
||||
|
||||
<resultMap type="com.fuint.business.petrolStationManagement.entity.OilGun" id="OilGunMap">
|
||||
<resultMap type="com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVOS" id="ActiveConsumptionMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="gunName" column="gun_name" jdbcType="VARCHAR"/>
|
||||
<result property="tankId" column="tank_id" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="chainStorId" column="chain_storId" jdbcType="INTEGER"/>
|
||||
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
<result property="numberId" column="number_id" jdbcType="INTEGER"/>
|
||||
<result property="tankName" column="tank_name" jdbcType="VARCHAR"/>
|
||||
<result property="oilNumber" column="oil_number" jdbcType="VARCHAR"/>
|
||||
<result property="oilMachineGunNumber" column="oil_machine_gun_number" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="participationConditionMoney" column="participation_condition_money" jdbcType="VARCHAR"/>
|
||||
<result property="activeStartTime" column="active_start_time" />
|
||||
<result property="activeEndTime" column="active_end_time" />
|
||||
<result property="adaptOil" column="adapt_oil" />
|
||||
<result property="adaptUserType" column="adapt_user_type" />
|
||||
<result property="member_type" column="member_type" />
|
||||
<result property="dieselUserLevel" column="diesel_user_level" />
|
||||
<result property="gasolineUserLevel" column="gasoline_user_level" />
|
||||
<result property="naturalUserLevel" column="natural_user_level" />
|
||||
<result property="paymentType" column="payment_type" />
|
||||
<result property="participationCondition" column="participation_condition" />
|
||||
<result property="participationAcount" column="participation_acount" />
|
||||
<result property="limitAcount" column="limit_acount" />
|
||||
<result property="activeGift" column="active_gift" />
|
||||
<result property="points" column="points" />
|
||||
<result property="status" column="status" />
|
||||
<result property="isonline" column="isonline" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<collection property="activeConsumptionChildList" javaType="java.util.ArrayList" ofType="com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild"
|
||||
select="com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsumptionChildMapper.selectConsumptionChilds" column="id">
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="getAllList" resultMap="OilGunMap">
|
||||
<select id="selectConsumptions" resultMap="ActiveConsumptionMap">
|
||||
select
|
||||
og.id, og.gun_name, og.tank_id, og.status, og.store_id, og.create_time, og.update_time, og.create_by, og.update_by, og.number_id, ot.tank_name,
|
||||
og.oil_machine_gun_number
|
||||
from oil_gun og left join oil_tank ot on og.tank_id = ot.id
|
||||
*
|
||||
from active_consumption
|
||||
<where>
|
||||
<if test="oilGun.id != null">
|
||||
and og.id = #{oilGun.id}
|
||||
<if test="activeConsumption.status != null and activeConsumption.status != ''">
|
||||
and status = #{activeConsumption.status}
|
||||
</if>
|
||||
<if test="oilGun.gunName != null and oilGun.gunName != ''">
|
||||
and og.gun_name = #{oilGun.gunName}
|
||||
<if test="activeConsumption.isonline != null and activeConsumption.isonline != ''">
|
||||
and isonline = #{activeConsumption.isonline}
|
||||
</if>
|
||||
<if test="oilGun.tankId != null">
|
||||
and og.tank_id = #{oilGun.tankId}
|
||||
<if test="activeConsumption.storeId != null and activeConsumption.storeId != ''">
|
||||
and store_id = #{activeConsumption.storeId}
|
||||
</if>
|
||||
<if test="oilGun.status != null and oilGun.status != ''">
|
||||
and og.status = #{oilGun.status}
|
||||
</if>
|
||||
<if test="oilGun.storeId != null">
|
||||
and og.store_id = #{oilGun.storeId}
|
||||
</if>
|
||||
<if test="oilGun.updateBy != null">
|
||||
and og.update_by = #{oilGun.updateBy}
|
||||
<if test="activeConsumption.name != null and activeConsumption.name != ''">
|
||||
and name like concat('%', #{activeConsumption.name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
@ -3,6 +3,9 @@ package com.fuint.business.marketingActivity.activeConsumption.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消费有礼活动子表(存放兑换物品)(ActiveConsumptionChild)表服务接口
|
||||
*
|
||||
@ -11,4 +14,6 @@ import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsu
|
||||
*/
|
||||
public interface ActiveConsumptionChildService extends IService<ActiveConsumptionChild> {
|
||||
|
||||
|
||||
List<ActiveConsumptionChild> selectList(Serializable id);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.dto.ActiveConsumptionDTO;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO;
|
||||
|
||||
|
@ -6,6 +6,10 @@ import com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsu
|
||||
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消费有礼活动子表(存放兑换物品)(ActiveConsumptionChild)表服务实现类
|
||||
*
|
||||
@ -15,4 +19,10 @@ import org.springframework.stereotype.Service;
|
||||
@Service("activeConsumptionChildService")
|
||||
public class ActiveConsumptionChildServiceImpl extends ServiceImpl<ActiveConsumptionChildMapper, ActiveConsumptionChild> implements ActiveConsumptionChildService {
|
||||
|
||||
@Resource
|
||||
private ActiveConsumptionChildMapper activeConsumptionChildMapper;
|
||||
@Override
|
||||
public List<ActiveConsumptionChild> selectList(Serializable id) {
|
||||
return activeConsumptionChildMapper.selectConsumptionChilds(id);
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import com.fuint.business.marketingActivity.activeConsumption.service.ActiveCons
|
||||
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionService;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVOS;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
@ -49,6 +50,8 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
private LJUserGradeService userGradeService;
|
||||
@Resource
|
||||
private OilNameService oilNameService;
|
||||
@Resource
|
||||
private ActiveConsumptionMapper activeConsumptionMapper;
|
||||
/**
|
||||
* 新增数据
|
||||
* @param activeConsumptionDTO
|
||||
@ -98,31 +101,14 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage select(Page page, ActiveConsumption activeConsumption) {
|
||||
//构建查询条件
|
||||
LambdaQueryWrapper<ActiveConsumption> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if(ObjectUtils.isNotEmpty(activeConsumption.getName())){
|
||||
queryWrapper.like(ActiveConsumption::getName,activeConsumption.getName());
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(activeConsumption.getStatus())) {
|
||||
queryWrapper.eq(ActiveConsumption::getStatus,activeConsumption.getStatus());
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(activeConsumption.getIsonline())) {
|
||||
queryWrapper.eq(ActiveConsumption::getIsonline,activeConsumption.getIsonline());
|
||||
}
|
||||
queryWrapper.eq(ActiveConsumption::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
|
||||
queryWrapper.orderByDesc(ActiveConsumption::getCreateTime);
|
||||
IPage page1 = page(page, queryWrapper);
|
||||
//会员等级
|
||||
List<ActiveConsumption> records = page1.getRecords();
|
||||
public IPage<ActiveConsumptionVOS> select(Page page, ActiveConsumption activeConsumption) {
|
||||
//所属店铺id
|
||||
activeConsumption.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||
//查询活动及其兑换券
|
||||
IPage activeConsumptionVOSIPage = activeConsumptionMapper.selectConsumptions(page, activeConsumption);
|
||||
List<ActiveConsumptionVOS> records = activeConsumptionVOSIPage.getRecords();
|
||||
List<ActiveConsumptionVO> activeConsumptionVOList = records.stream().map(s ->{
|
||||
ActiveConsumptionVO activeConsumptionVO = new ActiveConsumptionVO();
|
||||
//获取兑换物品信息
|
||||
LambdaQueryWrapper<ActiveConsumptionChild> queryWrappers = new LambdaQueryWrapper<>();
|
||||
queryWrappers.eq(ActiveConsumptionChild::getActiveConsumptionId,s.getId());
|
||||
queryWrappers.orderByDesc(ActiveConsumptionChild::getCreateTime);
|
||||
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.list(queryWrappers);
|
||||
|
||||
BeanUtils.copyProperties(s,activeConsumptionVO);
|
||||
activeConsumptionVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
|
||||
.map(Integer::valueOf)
|
||||
@ -139,11 +125,10 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
}
|
||||
activeConsumptionVO.setDieselUserLevel(str.split(","));
|
||||
}
|
||||
activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList);
|
||||
return activeConsumptionVO;
|
||||
}).collect(Collectors.toList());
|
||||
page1.setRecords(activeConsumptionVOList);
|
||||
return page1;
|
||||
activeConsumptionVOSIPage.setRecords(activeConsumptionVOList);
|
||||
return activeConsumptionVOSIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,72 @@
|
||||
package com.fuint.business.marketingActivity.activeConsumption.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ActiveConsumptionVOS implements Serializable {
|
||||
//主键id
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
//所属连锁店id
|
||||
private Integer chainStorId;
|
||||
//所属店铺id
|
||||
private Integer storeId;
|
||||
//活动名称
|
||||
private String name;
|
||||
//满足金额
|
||||
private String participationConditionMoney;
|
||||
//活动开始时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date activeStartTime;
|
||||
//活动结束时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date activeEndTime;
|
||||
//适用油品0:92# 1: 95# 2:98# 3:0# 4:-10# 5: LNG 6;CNG 7:京92# 8:京95# 9:京0#
|
||||
private String adaptOil;
|
||||
//适用会员类型 0:全部用户 1:全部会员 2:等级会员
|
||||
private String adaptUserType;
|
||||
//会员类型 0:汽油会员 1:柴油会员 2:天然气会员
|
||||
private String member_type;
|
||||
//柴油会员等级 1:一级会员 2:二级会员。。。。。。。
|
||||
private String dieselUserLevel;
|
||||
//汽油会员等级 1:一级会员 2:二级会员。。。。。。。
|
||||
private String gasolineUserLevel;
|
||||
//天然气会员等级 1:一级会员 2:二级会员。。。。。。。
|
||||
private String naturalUserLevel;
|
||||
//支付方式 0:微信支付 1:支付宝 2:银行卡 3:会员卡 4:现金 5:组合支付
|
||||
private String paymentType;
|
||||
//参与条件 0:不限制 1:优惠订单不参与
|
||||
private String participationCondition;
|
||||
//参与次数类别0:不限制 1:限制
|
||||
private String participationAcount;
|
||||
//限制次数
|
||||
private Integer limitAcount;
|
||||
//活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物
|
||||
private String activeGift;
|
||||
//赠送积分
|
||||
private Integer points;
|
||||
//活动状态 0:启用 1:禁用
|
||||
private String status;
|
||||
//是否在线 0:在线 1: 下线
|
||||
private String isonline;
|
||||
//券列表
|
||||
private List<ActiveConsumptionChild> activeConsumptionChildList;
|
||||
//创建者
|
||||
private String createBy;
|
||||
//创建时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
//更新者
|
||||
private String updateBy;
|
||||
//更新时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
@ -31,6 +31,9 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueService;
|
||||
import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@ -67,6 +70,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
private ActiveNewlywedsService activeNewlywedsService;
|
||||
@Resource
|
||||
private ActiveRecommendService activeRecommendService;
|
||||
@Resource
|
||||
private CardValueService cardValueService;
|
||||
/**
|
||||
* 分页查询所有
|
||||
* @param
|
||||
@ -339,6 +344,20 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
activeAppletVO.setDes("活动准备中,敬请期待!");
|
||||
activeAppletVOS.add(activeAppletVO);
|
||||
}
|
||||
//充值有礼
|
||||
List<CardValueAppletVO> cardValueAppletVOS = cardValueService.selectAllApplet(new CardValue());
|
||||
if (CollectionUtils.isNotEmpty(cardValueAppletVOS)){
|
||||
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
|
||||
activeAppletVO.setName("储值卡充值活动");
|
||||
activeAppletVO.setDes(cardValueAppletVOS.get(0).getDiscountActiveDescribe());
|
||||
activeAppletVO.setTime(cardValueAppletVOS.get(0).getTime());
|
||||
activeAppletVOS.add(activeAppletVO);
|
||||
}else {
|
||||
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
|
||||
activeAppletVO.setName("储值卡充值活动");
|
||||
activeAppletVO.setDes("活动准备中,敬请期待!");
|
||||
activeAppletVOS.add(activeAppletVO);
|
||||
}
|
||||
return activeAppletVOS;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.cardValue.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
|
||||
import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO;
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueService;
|
||||
@ -44,6 +45,16 @@ public class CardValueController extends BaseController {
|
||||
return getSuccessResult(this.cardValueService.select(page, cardValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据(小程序端)
|
||||
* @param cardValue
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("appletList")
|
||||
public ResponseObject selectAllApplet(@Param("cardValue") CardValue cardValue) {
|
||||
return getSuccessResult(this.cardValueService.selectAllApplet(cardValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
|
@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO;
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
|
||||
import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO;
|
||||
import com.fuint.business.marketingActivity.cardValue.vo.CardValueVO;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 储值卡表(CardValue)表服务接口
|
||||
@ -45,5 +47,13 @@ public interface CardValueService extends IService<CardValue> {
|
||||
* @return
|
||||
*/
|
||||
boolean updateOneById(CardValueDTO cardValueDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有数据(小程序端)
|
||||
* @param cardValue
|
||||
* @return
|
||||
*/
|
||||
List<CardValueAppletVO> selectAllApplet(CardValue cardValue);
|
||||
}
|
||||
|
||||
|
@ -5,22 +5,33 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionAppletVO;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO;
|
||||
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
|
||||
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
|
||||
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
|
||||
import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO;
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
|
||||
import com.fuint.business.marketingActivity.cardValue.mapper.CardValueMapper;
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueChildService;
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueService;
|
||||
import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO;
|
||||
import com.fuint.business.marketingActivity.cardValue.vo.CardValueVO;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@ -38,6 +49,8 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
|
||||
private CardValueChildService cardValueChildService;
|
||||
@Resource
|
||||
private StoreService storeService;
|
||||
@Autowired
|
||||
private LJUserGradeService userGradeService;
|
||||
/**
|
||||
* 分页查询所有数据
|
||||
* @param page
|
||||
@ -75,6 +88,46 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
|
||||
return page1;
|
||||
}
|
||||
|
||||
public IPage selectAll(Page page, CardValue cardValue) {
|
||||
LambdaQueryWrapper<CardValue> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//构建查询条件
|
||||
if (ObjectUtils.isNotEmpty(cardValue.getIsonline())){
|
||||
queryWrapper.eq(CardValue::getIsonline,cardValue.getIsonline());
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(cardValue.getActiveStatus())){
|
||||
queryWrapper.eq(CardValue::getActiveStatus,cardValue.getActiveStatus());
|
||||
}
|
||||
queryWrapper.eq(CardValue::getStoreId, TokenUtil.getNowAccountInfo().getStoreId());
|
||||
queryWrapper.orderByDesc(CardValue::getCreateTime);
|
||||
IPage page1 = page(page, queryWrapper);
|
||||
List<CardValue> records = page1.getRecords();
|
||||
//会员等级
|
||||
List<CardValueVO> cardValueVOS = records.stream().map(s ->{
|
||||
CardValueVO cardValueVO = new CardValueVO();
|
||||
//获取兑换物品信息
|
||||
LambdaQueryWrapper<CardValueChild> queryWrappers = new LambdaQueryWrapper<>();
|
||||
queryWrappers.eq(CardValueChild::getCardValueId,s.getId());
|
||||
queryWrappers.orderByDesc(CardValueChild::getCreateTime);
|
||||
List<CardValueChild> cardValueChildList = cardValueChildService.list(queryWrappers);
|
||||
|
||||
BeanUtils.copyProperties(s,cardValueVO);
|
||||
//获取会员等级
|
||||
String str = "";
|
||||
if (ObjectUtils.isNotEmpty(s.getMembershipLevel())){
|
||||
for (String gradeId : s.getMembershipLevel().split(",")) {
|
||||
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){
|
||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||
}
|
||||
}
|
||||
cardValueVO.setMembershipLevel(str.split(","));
|
||||
}
|
||||
cardValueVO.setCardValueChildList(cardValueChildList);
|
||||
return cardValueVO;
|
||||
}).collect(Collectors.toList());
|
||||
page1.setRecords(cardValueVOS);
|
||||
return page1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据(充值)
|
||||
* @param id
|
||||
@ -167,6 +220,49 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
|
||||
return update;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据(小程序端)
|
||||
* @param cardValue
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CardValueAppletVO> selectAllApplet(CardValue cardValue) {
|
||||
//获取本油站消费有礼活动列表
|
||||
IPage page = selectAll(new Page(1, 20), cardValue);
|
||||
List<CardValueVO> cardValueAppletVOList = page.getRecords();
|
||||
List<CardValueAppletVO> appletVOList = cardValueAppletVOList.stream().map(s -> {
|
||||
CardValueAppletVO cardValueAppletVO = new CardValueAppletVO();
|
||||
//活动时间
|
||||
if (s.getActiveTime().equals("1")){
|
||||
cardValueAppletVO.setTime("不限时间");
|
||||
}else {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd");
|
||||
String formatSt = dateFormat.format(s.getStartTime());
|
||||
String formatEd = dateFormat.format(s.getEndTime());
|
||||
cardValueAppletVO.setTime(formatSt+"-" + formatEd+"");
|
||||
}
|
||||
//适用用户名
|
||||
String adaptUserType = "";
|
||||
if (s.getGroupOriented().equals("1")){
|
||||
adaptUserType = "普通群体";
|
||||
}else {
|
||||
adaptUserType = arrayToString(s.getMembershipLevel());
|
||||
//adaptUserType = s.getMembershipLevel();
|
||||
}
|
||||
//赠送优惠券兑换券实物
|
||||
String card = "";
|
||||
if (CollectionUtils.isNotEmpty(s.getCardValueChildList())) {
|
||||
for (CardValueChild cardValueChild : s.getCardValueChildList()) {
|
||||
card = cardValueChild.getGiftCardDetail() + "的券";
|
||||
}
|
||||
}
|
||||
cardValueAppletVO.setDiscountActiveDescribe("本充值活动"+adaptUserType+"可用,充值满"+
|
||||
s.getBidBalance()+"元,赠送金额为:"+s.getGiftBalance()+"元,赠送券:"+card+" 赠送积分:"+s.getPoints()+"积分,赠送成长值为:"+s.getGrowthValue()+"。");
|
||||
return cardValueAppletVO;
|
||||
}).collect(Collectors.toList());
|
||||
return appletVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数组转字符串
|
||||
* @param array
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.fuint.business.marketingActivity.cardValue.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class CardValueAppletVO implements Serializable {
|
||||
//活动描述
|
||||
private String discountActiveDescribe;
|
||||
//活动时间
|
||||
private String time;
|
||||
}
|
@ -74,6 +74,17 @@ public class OilOrderController extends BaseController {
|
||||
return getSuccessResult(order);
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序支付接口
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/appletPay")
|
||||
public ResponseObject appletPay(@Validated @RequestBody Map<String,String> map){
|
||||
orderService.appletPay(map);
|
||||
return getSuccessResult("success");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号查询订单信息
|
||||
* @param map
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.order.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
@ -117,6 +118,10 @@ public class OilOrder extends BaseEntity implements Serializable {
|
||||
* 订单备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 油罐id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer tankId;
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,12 @@ public interface OilOrderService extends IService<OilOrder> {
|
||||
*/
|
||||
public String addOilOrder(OilOrder oilOrder);
|
||||
|
||||
/**
|
||||
* 小程序订单支付
|
||||
* @param map
|
||||
*/
|
||||
public void appletPay(Map<String,String> map);
|
||||
|
||||
/**
|
||||
* 添加油品跟踪信息
|
||||
* @param oilOrder
|
||||
@ -79,6 +85,13 @@ public interface OilOrderService extends IService<OilOrder> {
|
||||
*/
|
||||
public void addOilTrack(JSONObject oilOrder, Integer storeId);
|
||||
|
||||
/**
|
||||
* 添加油品跟踪信息
|
||||
* @param oilOrder
|
||||
* @param storeId
|
||||
*/
|
||||
public void addOilTracks(OilOrder oilOrder,Integer storeId);
|
||||
|
||||
/**
|
||||
* 添加油品订单信息
|
||||
* @param order
|
||||
|
@ -18,11 +18,15 @@ import com.fuint.business.order.mapper.OilOrderMapper;
|
||||
import com.fuint.business.order.service.*;
|
||||
import com.fuint.business.order.vo.OilOrderVo;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilNumber;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTank;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTracking;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNumberService;
|
||||
import com.fuint.business.petrolStationManagement.service.OilTankService;
|
||||
import com.fuint.business.petrolStationManagement.service.OilTrackingService;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
@ -146,7 +150,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
// 会员id
|
||||
userId = Integer.valueOf(map.get("userId"));
|
||||
|
||||
this.insertCardBalance(consumeAmount,userId);
|
||||
this.insertCardBalance(consumeAmount,userId,storeId);
|
||||
}
|
||||
// 优惠券id
|
||||
Integer couponId = null;
|
||||
@ -271,7 +275,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
}
|
||||
|
||||
if (userId!=null){
|
||||
this.updateGrowthValue(oilActualPay, userId, Integer.valueOf(jsonObjects.get(i).get("oilName").toString()),refuelMoney);
|
||||
this.updateGrowthValue(oilActualPay, userId, Integer.valueOf(jsonObjects.get(i).get("oilName").toString()),refuelMoney,storeId);
|
||||
}
|
||||
order.setStoreId(storeId);
|
||||
order.setUserId(userId);
|
||||
@ -378,6 +382,64 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appletPay(Map<String, String> map) {
|
||||
String orderNo = map.get("orderNo");
|
||||
// 支付金额
|
||||
Integer payAmount = (int) (Double.valueOf(map.get("payAmount"))*100);
|
||||
// 优惠金额
|
||||
String discountAmount = map.get("discountAmount");
|
||||
// 囤油卡消费后的信息
|
||||
String oilCardAmount = map.get("oilCardAmount");
|
||||
// 储值卡消费金额
|
||||
String balanceAmount = map.get("balanceAmount");
|
||||
Integer tankId = Integer.valueOf(map.get("tankId"));
|
||||
|
||||
// 根据订单号查询订单信息
|
||||
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
|
||||
oilOrder.setTankId(tankId);
|
||||
if (!map.get("payAmount").equals("0")) {
|
||||
// 调用支付接口
|
||||
// 判断是否开启支付规则
|
||||
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
|
||||
if (list.size() > 0) {
|
||||
oilConfigService.oilRule();
|
||||
}
|
||||
// 根据店铺id查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIsUse("1");
|
||||
LJUserVo userVo = userService.selectUserById(oilOrder.getUserId());
|
||||
// 处理支付需要的数据
|
||||
Map<String, String> map1 = new HashMap<>();
|
||||
map1.put("allAmount", payAmount.toString());
|
||||
map1.put("orderNo", oilOrder.getOrderNo());
|
||||
map1.put("insCd", merchantConfig.getInsCd());
|
||||
map1.put("mchntCd", merchantConfig.getMchntCd());
|
||||
map1.put("goodsDes", oilOrder.getOils() + oilOrder.getOilGunNum());
|
||||
map1.put("publicKey", merchantConfig.getPublicKey());
|
||||
map1.put("privateKey", merchantConfig.getPrivateKey());
|
||||
map1.put("discountAmount", discountAmount);
|
||||
map1.put("oilCardAmount", oilCardAmount);
|
||||
map1.put("balanceAmount", balanceAmount);
|
||||
map1.put("openId", userVo.getOpenId());
|
||||
|
||||
// 调用支付接口
|
||||
try {
|
||||
fyPayService.applet(map1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else {
|
||||
this.updateGrowthValue(Double.valueOf(payAmount),oilOrder.getUserId(), Integer.valueOf(oilOrder.getOils()),oilCardAmount,oilOrder.getStoreId());
|
||||
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
||||
this.insertCardBalance(Double.valueOf(balanceAmount),oilOrder.getUserId(),oilOrder.getStoreId());
|
||||
oilOrder.setPayAmount(Double.valueOf(payAmount));
|
||||
oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
|
||||
oilOrder.setPayTime(new Date());
|
||||
oilOrder.setOrderStatus("paid");
|
||||
baseMapper.updateById(oilOrder);
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private OilTankService oilTankService;
|
||||
@Autowired
|
||||
@ -411,6 +473,32 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
oilTankService.update(oilTank);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加油品库存跟踪信息
|
||||
* @param oilOrder
|
||||
*/
|
||||
@Override
|
||||
public void addOilTracks(OilOrder oilOrder,Integer storeId){
|
||||
OilTank oilTank = oilTankService.queryById(oilOrder.getTankId());
|
||||
// 添加库存跟踪信息
|
||||
OilTracking oilTracking = new OilTracking();
|
||||
oilTracking.setDocument("油品出售");
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
oilTracking.setOrderNumber(timestamp+randomString);
|
||||
|
||||
oilTracking.setQuantityChange(-oilOrder.getOilNum());
|
||||
oilTracking.setStoreId(storeId);
|
||||
oilTracking.setTankId(oilOrder.getTankId());
|
||||
oilTrackingService.insert(oilTracking);
|
||||
|
||||
// 修改油罐容量
|
||||
Double storedQuantity = oilTank.getStoredQuantity();
|
||||
oilTank.setStoredQuantity(storedQuantity-oilOrder.getOilNum());
|
||||
oilTankService.update(oilTank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateOilOrder(OilOrder order) {
|
||||
int row = baseMapper.updateById(order);
|
||||
@ -423,19 +511,21 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
private LJUserService userService;
|
||||
@Autowired
|
||||
private LJUserGradeService userGradeService;
|
||||
@Autowired
|
||||
private ILJStoreService storeService;
|
||||
|
||||
/**
|
||||
* 修改用户成长值信息
|
||||
*/
|
||||
private void updateGrowthValue(Double oilActualPay,Integer userid,Integer oilId,String refuelMoney){
|
||||
private void updateGrowthValue(Double oilActualPay,Integer userid,Integer oilId,String refuelMoney,Integer storeId){
|
||||
if (oilId!=null){
|
||||
OilName oilName = oilNameService.selectOilNameById(oilId);
|
||||
// 获取成长值增长数值
|
||||
Integer gasGrowthValue = null;
|
||||
Integer dieselGrowthValue = null;
|
||||
Integer naturalGrowthValue = null;
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userid,nowAccountInfo.getStoreId());
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
|
||||
int growth = balance.getGrowthValue();
|
||||
balance.setRefuelMoney(refuelMoney);
|
||||
// 查询会员等级列表信息
|
||||
@ -492,10 +582,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
}
|
||||
}
|
||||
|
||||
private void insertCardBalance(Double amount,Integer userId){
|
||||
private void insertCardBalance(Double amount,Integer userId,Integer storeId){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// 根据用户id查询用户余额信息
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userId,nowAccountInfo.getStoreId());
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userId,store.getChainStoreId());
|
||||
// 修改余额信息
|
||||
Double beforeBalance = balance.getCardBalance();
|
||||
Double afterBalance = beforeBalance - amount;
|
||||
|
@ -132,7 +132,9 @@
|
||||
</select>
|
||||
<select id="selectOilNumberNameByStoreId" resultType="com.fuint.business.petrolStationManagement.vo.OilNumberNameVo"
|
||||
parameterType="java.lang.Integer">
|
||||
select onu.*,ona.oil_type,ona.oil_name oilNames from oil_number onu left join oil_name ona on onu.oil_name = ona.id
|
||||
select onu.*,ona.oil_type,ona.oil_name oilNames,ot.id tankId from oil_tank ot
|
||||
left join oil_number onu on ot.number_id = onu.number_id
|
||||
left join oil_name ona on onu.oil_name = ona.id
|
||||
<where>
|
||||
onu.store_id = #{storeId} and onu.state = '启用'
|
||||
</where>
|
||||
|
@ -61,5 +61,13 @@ public interface OilNumberService extends IService<OilNumber> {
|
||||
* @return
|
||||
*/
|
||||
List<OilNumberNameVo> selectOilNumberNameByStoreId(Integer storeId);
|
||||
|
||||
/**
|
||||
* 根据油号和店铺id查询店铺油品信息
|
||||
* @param oilName
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
OilNumber selectOilNumberByOilName(String oilName,Integer storeId);
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.business.petrolStationManagement.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -98,5 +99,14 @@ public class OilNumberServiceImpl extends ServiceImpl<OilNumberMapper, OilNumber
|
||||
return baseMapper.selectOilNumberNameByStoreId(storeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OilNumber selectOilNumberByOilName(String oilName, Integer storeId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("oil_name",oilName);
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
OilNumber oilNumber = baseMapper.selectOne(queryWrapper);
|
||||
return oilNumber;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,4 +9,6 @@ public class OilNumberNameVo extends OilNumber {
|
||||
private String oilType;
|
||||
// 油号
|
||||
private String oilNames;
|
||||
// 油罐id
|
||||
private String tankId;
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
# \u57FA\u672C\u914D\u7F6E
|
||||
server.port=8008
|
||||
server.port=8080
|
||||
env.profile=dev
|
||||
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
|
||||
|
||||
|
||||
# \u6570\u636E\u5E93\u914D\u7F6E
|
||||
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
|
@ -2279,7 +2279,7 @@
|
||||
this.map.oilOrder = JSON.stringify(this.oilOrder);
|
||||
this.map.goodsOrder = JSON.stringify(this.goodsOrder);
|
||||
this.map.authCode = this.authCode;
|
||||
this.map.allAmount = (this.oilActualPay + this.goodsActualPay).toFixed(2);
|
||||
this.map.allAmount = +this.oilActualPay + +this.goodsActualPay
|
||||
this.map.consumeAmount = this.consumeAmount;
|
||||
this.updateRefuelMoney();
|
||||
this.map.refuelMoney = JSON.stringify(this.refuelMoney)
|
||||
|
@ -63,7 +63,7 @@
|
||||
"desc":"您的位置信息将用于获取离您最近的店铺信息"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos" : [ "getLocation" ]
|
||||
"requiredPrivateInfos": ["chooseLocation", "getLocation"]
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
|
@ -178,7 +178,7 @@
|
||||
this.storeId = uni.getStorageSync("inviteStoreId")
|
||||
this.staffId = uni.getStorageSync("inviteStaffId")
|
||||
}
|
||||
this.isExistStoreId();
|
||||
// this.isExistStoreId();
|
||||
|
||||
this.getUserAuthority();
|
||||
this.getOilType();
|
||||
@ -200,6 +200,8 @@
|
||||
// 获取定位信息
|
||||
getUserAuthority() {
|
||||
let _this = this;
|
||||
// this.getAddress();
|
||||
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting['scope.userLocation']) {
|
||||
@ -232,7 +234,7 @@
|
||||
}).then((response) => {
|
||||
_this.store = response.data
|
||||
let welfare = response.data.welfare
|
||||
console.log(response.data)
|
||||
uni.setStorageSync("storeId",response.data.id)
|
||||
uni.setStorageSync("chainStoreId",response.data.chainStoreId)
|
||||
if (welfare != undefined && welfare != null && welfare != "") {
|
||||
if (welfare.includes(",")) {
|
||||
@ -279,9 +281,16 @@
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
uni.showToast({
|
||||
title:"获取位置信息成功"
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
_this.getStore(0);
|
||||
_this.getStore(2);
|
||||
uni.showToast({
|
||||
title:"获取位置信息失败"
|
||||
})
|
||||
console.log('获取位置信息失败: ' + err.errMsg);
|
||||
}
|
||||
});
|
||||
|
@ -44,7 +44,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="my-top-box" style="margin-top: 45px;">
|
||||
<view class="centenr-sx" @click="gomyorder()">
|
||||
<view class="centenr-sx" @click="gomyorder(0)">
|
||||
<view class="centenr-img">
|
||||
<image src="../../static/my/dingdan.png" mode=""></image>
|
||||
</view>
|
||||
@ -54,7 +54,7 @@
|
||||
</view>
|
||||
|
||||
|
||||
<view class="centenr-sx">
|
||||
<view class="centenr-sx" @click="gomyorder(1)">
|
||||
<view class="centenr-img">
|
||||
<image src="../../static/my/dsy.png" mode=""></image>
|
||||
</view>
|
||||
@ -63,7 +63,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="centenr-sx">
|
||||
<view class="centenr-sx" @click="gomyorder(2)">
|
||||
<view class="centenr-img">
|
||||
<image src="../../static/my/ywc.png" mode=""></image>
|
||||
</view>
|
||||
@ -71,7 +71,7 @@
|
||||
已完成
|
||||
</view>
|
||||
</view>
|
||||
<view class="centenr-sx">
|
||||
<view class="centenr-sx" @click="gomyorder(3)">
|
||||
<view class="centenr-img">
|
||||
<image src="../../static/my/dpj.png" mode=""></image>
|
||||
</view>
|
||||
@ -172,9 +172,9 @@
|
||||
tabbar
|
||||
},
|
||||
methods: {
|
||||
gomyorder() {
|
||||
gomyorder(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesMy/myorder/myorder'
|
||||
url: '/pagesMy/myorder/myorder?id=' + id
|
||||
})
|
||||
},
|
||||
gotodaby() {
|
||||
@ -405,4 +405,4 @@
|
||||
.centenr-size {
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -248,6 +248,7 @@
|
||||
_this.oilPrice = res.data[0].gbPrice
|
||||
_this.oilUnit = res.data[0].unit
|
||||
_this.oilOrder.oils = res.data[0].oilName
|
||||
uni.setStorageSync("tankId",res.data[0].tankId)
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -298,10 +299,12 @@
|
||||
// 选择油品信息
|
||||
getHIndex(index,data) {
|
||||
this.hindex = index
|
||||
console.log(data)
|
||||
this.getOilGun(data.numberId)
|
||||
this.oilPrice = data.gbPrice
|
||||
this.oilUnit = data.unit
|
||||
this.oilOrder.oils = data.oilName
|
||||
uni.setStorageSync("tankId",data.tankId)
|
||||
},
|
||||
// 选择油枪信息
|
||||
getQIndex(index,data) {
|
||||
|
@ -57,9 +57,9 @@
|
||||
})
|
||||
},
|
||||
getData() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
/*uni.showLoading({
|
||||
//title: '加载中'
|
||||
});*/
|
||||
request({
|
||||
url: 'business/marketingActivity/activeExchange/applet',
|
||||
method: 'get',
|
||||
|
@ -59,7 +59,7 @@
|
||||
methods: {
|
||||
getData(name) {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
//title: '加载中'
|
||||
});
|
||||
if (name == '消费有礼活动') {
|
||||
request({
|
||||
|
@ -24,7 +24,7 @@
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<scroll-view scroll-y="true" :scroll-top="scrollTop" id="scrollList" style="height: 80vh;"
|
||||
<scroll-view scroll-y="true" :scroll-top="scrollTop" id="scrollList" style="height: 78vh;"
|
||||
@scrolltolower="scrolltolower">
|
||||
<!-- 列表 -->
|
||||
<view class="box-order" v-for="(item,index) in list" :key="index">
|
||||
@ -46,7 +46,7 @@
|
||||
<view class="" v-if="item.orderStatus=='paid'">{{parseTime(item.payTime)}}</view>
|
||||
<view class="" v-else>{{item.createTime}}</view>
|
||||
</view>
|
||||
<view class="end-box">
|
||||
<view class="end-box" @click="goComment()">
|
||||
<view class="anniu">
|
||||
<text>评价有礼</text>
|
||||
</view>
|
||||
@ -102,8 +102,10 @@
|
||||
scrollTop: 0,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getMyOrder()
|
||||
onLoad(option) {
|
||||
this.tapindex = option.id
|
||||
this.getTapIndex(option.id)
|
||||
// this.getMyOrder()
|
||||
this.getStores()
|
||||
this.getPayList()
|
||||
},
|
||||
@ -204,14 +206,21 @@
|
||||
method: 'get',
|
||||
params: _this.map,
|
||||
}).then((res) => {
|
||||
if (_this.map.page == 1) {
|
||||
_this.orderList = res.data.records
|
||||
_this.list = res.data.records
|
||||
} else {
|
||||
_this.orderList = _this.orderList.concat(res.data.records)
|
||||
_this.list = _this.list.concat(res.data.records)
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
if (res.code == 200) {
|
||||
if (_this.map.page == 1) {
|
||||
_this.orderList = res.data.records
|
||||
_this.list = res.data.records
|
||||
} else {
|
||||
_this.orderList = _this.orderList.concat(res.data.records)
|
||||
_this.list = _this.list.concat(res.data.records)
|
||||
}
|
||||
_this.total = res.data.total
|
||||
uni.hideLoading();
|
||||
}
|
||||
_this.total = res.data.total
|
||||
|
||||
})
|
||||
},
|
||||
getTapIndex(index) {
|
||||
@ -246,12 +255,17 @@
|
||||
page: 1,
|
||||
pageSize: 5,
|
||||
storeId: "",
|
||||
orderStatus: "",
|
||||
orderStatus: "paid",
|
||||
remark: "待评价",
|
||||
}
|
||||
this.getMyOrder()
|
||||
}
|
||||
},
|
||||
goComment() {
|
||||
uni.navigateTo({
|
||||
url: "/pagesMy/comment/comment"
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
@ -97,46 +97,107 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="desc" v-if="fullRedece >= couponRedece && exclusion == 0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="满减优惠" :open="true">
|
||||
<view v-for="(item,index) in fullReduceDiscount" :key="index">
|
||||
<span v-if="item.discount!=0">
|
||||
{{item.type}}:满{{ item.full }}元,打{{ item.discount }}折
|
||||
</span>
|
||||
<span v-else>满{{ item.full }}元,减{{ item.reduce }}元</span>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 满减优惠fullReduceDiscount -->
|
||||
<view v-if="exclusion == 0">
|
||||
<view class="desc" v-if="fullRedece >= couponRedece && exclusion == 0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="满减优惠" :open="true">
|
||||
<view v-for="(item,index) in fullReduceDiscount" :key="index">
|
||||
<span v-if="item.discount!=0">
|
||||
{{item.type}}:满{{ item.full }}元,打{{ item.discount }}折
|
||||
</span>
|
||||
<span v-else>满{{ item.full }}元,减{{ item.reduce }}元</span>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- <u-dropdown ref="uDropdown">
|
||||
<u-dropdown-item title="满减优惠">
|
||||
<view class="slot-content">
|
||||
<view class="u-text-center u-content-color u-m-t-20 u-m-b-20">其他自定义内容</view>
|
||||
<u-button type="primary" @click="closeDropdown">确定</u-button>
|
||||
</view>
|
||||
</u-dropdown-item>
|
||||
</u-dropdown> -->
|
||||
<!-- 满减优惠fullReduceDiscount -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{fullRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="coupon"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{fullRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="coupon"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
|
||||
<view class="desc" v-else-if="fullRedece < couponRedece && exclusion == 0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="优惠券" :open="true">
|
||||
<view v-for="(item,index) in couponDiscount" :key="index">
|
||||
满{{ item.full }}元,减{{ item.reduce }}元
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 优惠券 couponDiscount -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{couponRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="coupon"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="desc" v-else>
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="优惠券" :open="true">
|
||||
<view v-for="(item,index) in couponDiscount" :key="index">
|
||||
满{{ item.full }}元,减{{ item.reduce }}元
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 优惠券 couponDiscount -->
|
||||
<view v-else>
|
||||
<view class="desc" v-if="fullRedece >= 0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="满减优惠" :open="true">
|
||||
<view v-for="(item,index) in fullReduceDiscount" :key="index">
|
||||
<span v-if="item.discount!=0">
|
||||
{{item.type}}:满{{ item.full }}元,打{{ item.discount }}折
|
||||
</span>
|
||||
<span v-else>满{{ item.full }}元,减{{ item.reduce }}元</span>
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- <u-dropdown ref="uDropdown">
|
||||
<u-dropdown-item title="满减优惠">
|
||||
<view class="slot-content">
|
||||
<view class="u-text-center u-content-color u-m-t-20 u-m-b-20">其他自定义内容</view>
|
||||
<u-button type="primary" @click="closeDropdown">确定</u-button>
|
||||
</view>
|
||||
</u-dropdown-item>
|
||||
</u-dropdown> -->
|
||||
<!-- 满减优惠fullReduceDiscount -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{fullRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="coupon"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{couponRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="coupon"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
|
||||
<view class="desc" v-if="fullRedece >= 0">
|
||||
<view style="display: flex;">
|
||||
<u-collapse>
|
||||
<u-collapse-item title="优惠券" :open="true">
|
||||
<view v-for="(item,index) in couponDiscount" :key="index">
|
||||
满{{ item.full }}元,减{{ item.reduce }}元
|
||||
</view>
|
||||
</u-collapse-item>
|
||||
</u-collapse>
|
||||
<!-- 优惠券 couponDiscount -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{couponRedece}}</span>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="coupon"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view style="background-color: white;width: 94%;margin: 15px auto;">
|
||||
@ -158,7 +219,7 @@
|
||||
</view>
|
||||
<view style="color: red;font-size: 12px;">应付金额</view>
|
||||
</view>
|
||||
<view
|
||||
<view @click="payment"
|
||||
style="margin-right: 20px;width: 30%;border-radius:30px;background-color: #1879ff;height: 40px;line-height: 40px;text-align: center;color: white">
|
||||
确认支付
|
||||
</view>
|
||||
@ -232,21 +293,31 @@
|
||||
},
|
||||
onLoad(e) {
|
||||
// this.orderNo = e.orderNo
|
||||
this.orderNo = "20231201114800ebe24b"
|
||||
this.orderNo = "20231201175248e68558"
|
||||
},
|
||||
onShow() {
|
||||
this.getOilOrder();
|
||||
this.testPay();
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 测试支付接口
|
||||
testPay(){
|
||||
// 支付接口
|
||||
payment(){
|
||||
let map = {
|
||||
orderNo : "20231201175248e68558",
|
||||
payAmount : "0.01",
|
||||
discountAmount : '0',
|
||||
oilCardAmount : "",
|
||||
balanceAmount : this.balanceRedece,
|
||||
// tankId : uni.getStorageSync("tankId"),
|
||||
tankId : 6,
|
||||
};
|
||||
let _this = this;
|
||||
request({
|
||||
url: "api/wechat/pay",
|
||||
url: "business/oilOrder/appletPay",
|
||||
method: 'post',
|
||||
data: map,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
@ -748,7 +819,9 @@
|
||||
method: 'get',
|
||||
}).then((res) => {
|
||||
_this.user = res.data;
|
||||
_this.refuelMoney = JSON.parse(res.data.refuelMoney)
|
||||
if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
|
||||
_this.refuelMoney = JSON.parse(res.data.refuelMoney)
|
||||
}
|
||||
_this.changeRefuelMoney()
|
||||
_this.getGrade(res.data.gradeId)
|
||||
_this.preferentialData.oilPrice = _this.oilPrice
|
||||
|
@ -103,9 +103,6 @@ try {
|
||||
uniIcons: function () {
|
||||
return Promise.all(/*! import() | node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons")]).then(__webpack_require__.bind(null, /*! @dcloudio/uni-ui/lib/uni-icons/uni-icons.vue */ 453))
|
||||
},
|
||||
uEmpty: function () {
|
||||
return Promise.all(/*! import() | uni_modules/uview-ui/components/u-empty/u-empty */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-empty/u-empty")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-empty/u-empty.vue */ 536))
|
||||
},
|
||||
}
|
||||
} catch (e) {
|
||||
if (
|
||||
@ -128,15 +125,6 @@ var render = function () {
|
||||
var _vm = this
|
||||
var _h = _vm.$createElement
|
||||
var _c = _vm._self._c || _h
|
||||
var g0 = _vm.list.length
|
||||
_vm.$mp.data = Object.assign(
|
||||
{},
|
||||
{
|
||||
$root: {
|
||||
g0: g0,
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
var recyclableRender = false
|
||||
var staticRenderFns = []
|
||||
@ -200,12 +188,34 @@ exports.default = void 0;
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
var _default = {
|
||||
data: function data() {
|
||||
return {
|
||||
title: '',
|
||||
tindex: 0,
|
||||
list: [],
|
||||
list: ["1"],
|
||||
tapList: [{
|
||||
text: "全部"
|
||||
}, {
|
||||
|
@ -2,7 +2,6 @@
|
||||
"navigationBarTitleText": "充值记录",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"uni-icons": "/node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons",
|
||||
"u-empty": "/uni_modules/uview-ui/components/u-empty/u-empty"
|
||||
"uni-icons": "/node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
<view class="content data-v-4ea1f3b2"><view class="container data-v-4ea1f3b2"><view class="my-header data-v-4ea1f3b2"><view data-event-opts="{{[['tap',[['goback',['$event']]]]]}}" class="my-icons data-v-4ea1f3b2" bindtap="__e"><uni-icons vue-id="f4c5f8d8-1" type="left" size="16" class="data-v-4ea1f3b2" bind:__l="__l"></uni-icons></view><view class="my-text data-v-4ea1f3b2">充值记录</view><view class="my-icons data-v-4ea1f3b2"></view></view><view class="tap-top data-v-4ea1f3b2"><block wx:for="{{tapList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['tapindex',[index]]]]]}}" class="{{['tap-box','data-v-4ea1f3b2',(tindex==index)?'act':'']}}" bindtap="__e"><view class="data-v-4ea1f3b2">{{item.text}}</view><view class="{{['gang','data-v-4ea1f3b2',(tindex==index)?'lan':'']}}"></view></view></block></view><block wx:if="{{$root.g0==0}}"><u-empty vue-id="f4c5f8d8-2" mode="coupon" text="内容为空" icon="http://cdn.uviewui.com/uview/empty/coupon.png" class="data-v-4ea1f3b2" bind:__l="__l"></u-empty></block></view></view>
|
||||
<view class="content data-v-4ea1f3b2"><view class="container data-v-4ea1f3b2"><view class="my-header data-v-4ea1f3b2"><view data-event-opts="{{[['tap',[['goback',['$event']]]]]}}" class="my-icons data-v-4ea1f3b2" bindtap="__e"><uni-icons vue-id="f4c5f8d8-1" type="left" size="16" class="data-v-4ea1f3b2" bind:__l="__l"></uni-icons></view><view class="my-text data-v-4ea1f3b2">充值记录</view><view class="my-icons data-v-4ea1f3b2"></view></view><view class="tap-top data-v-4ea1f3b2"><block wx:for="{{tapList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['tapindex',[index]]]]]}}" class="{{['tap-box','data-v-4ea1f3b2',(tindex==index)?'act':'']}}" bindtap="__e"><view class="data-v-4ea1f3b2">{{item.text}}</view><view class="{{['gang','data-v-4ea1f3b2',(tindex==index)?'lan':'']}}"></view></view></block></view><view class="ail data-v-4ea1f3b2"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="box-order data-v-4ea1f3b2"><view class="or-box-top data-v-4ea1f3b2"><view class="data-v-4ea1f3b2">储值卡</view><view class="chengg data-v-4ea1f3b2">充值成功</view></view><view class="but-box data-v-4ea1f3b2"><view class="huis data-v-4ea1f3b2">充值金额</view><view class="data-v-4ea1f3b2">¥123</view></view><view class="but-box data-v-4ea1f3b2"><view class="huis data-v-4ea1f3b2">优惠合计</view><view class="reds data-v-4ea1f3b2">¥999</view></view><view class="but-box data-v-4ea1f3b2"><view class="huis data-v-4ea1f3b2">订单时间</view><view class="data-v-4ea1f3b2">20230304</view></view></view></block></view></view></view>
|
@ -76,4 +76,55 @@
|
||||
.lan.data-v-4ea1f3b2 {
|
||||
background: #0000ff;
|
||||
}
|
||||
.box-order.data-v-4ea1f3b2 {
|
||||
width: 95%;
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.or-box-top.data-v-4ea1f3b2 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 5px 0px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.chengg.data-v-4ea1f3b2 {
|
||||
color: #1678ff;
|
||||
}
|
||||
.but-box.data-v-4ea1f3b2 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
margin: 5px 0px;
|
||||
}
|
||||
.reds.data-v-4ea1f3b2 {
|
||||
color: red;
|
||||
}
|
||||
.huis.data-v-4ea1f3b2 {
|
||||
color: #666666;
|
||||
}
|
||||
.end-box.data-v-4ea1f3b2 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.anniu.data-v-4ea1f3b2 {
|
||||
width: 70px;
|
||||
height: 25px;
|
||||
background-color: #1678ff;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
|
@ -104,10 +104,10 @@ try {
|
||||
return Promise.all(/*! import() | node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons")]).then(__webpack_require__.bind(null, /*! @dcloudio/uni-ui/lib/uni-icons/uni-icons.vue */ 453))
|
||||
},
|
||||
"u-Textarea": function () {
|
||||
return Promise.all(/*! import() | uni_modules/uview-ui/components/u--textarea/u--textarea */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u--textarea/u--textarea")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u--textarea/u--textarea.vue */ 632))
|
||||
return Promise.all(/*! import() | uni_modules/uview-ui/components/u--textarea/u--textarea */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u--textarea/u--textarea")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u--textarea/u--textarea.vue */ 640))
|
||||
},
|
||||
uUpload: function () {
|
||||
return Promise.all(/*! import() | uni_modules/uview-ui/components/u-upload/u-upload */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-upload/u-upload")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-upload/u-upload.vue */ 638))
|
||||
return Promise.all(/*! import() | uni_modules/uview-ui/components/u-upload/u-upload */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-upload/u-upload")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-upload/u-upload.vue */ 646))
|
||||
},
|
||||
}
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user