New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.TbCallbackLog; |
| | | import com.ruoyi.system.service.ITbCallbackLogService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 回调记录Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/callbacklog") |
| | | public class TbCallbackLogController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ITbCallbackLogService tbCallbackLogService; |
| | | |
| | | /** |
| | | * 查询回调记录列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:callbacklog:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(TbCallbackLog tbCallbackLog) |
| | | { |
| | | startPage(); |
| | | List<TbCallbackLog> list = tbCallbackLogService.selectTbCallbackLogList(tbCallbackLog); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导出回调记录列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:callbacklog:export')") |
| | | @Log(title = "回调记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, TbCallbackLog tbCallbackLog) |
| | | { |
| | | List<TbCallbackLog> list = tbCallbackLogService.selectTbCallbackLogList(tbCallbackLog); |
| | | ExcelUtil<TbCallbackLog> util = new ExcelUtil<TbCallbackLog>(TbCallbackLog.class); |
| | | util.exportExcel(response, list, "回调记录数据"); |
| | | } |
| | | |
| | | /** |
| | | * 获取回调记录详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:callbacklog:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(tbCallbackLogService.selectTbCallbackLogById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增回调记录 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:callbacklog:add')") |
| | | @Log(title = "回调记录", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody TbCallbackLog tbCallbackLog) |
| | | { |
| | | return toAjax(tbCallbackLogService.insertTbCallbackLog(tbCallbackLog)); |
| | | } |
| | | |
| | | /** |
| | | * 修改回调记录 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:callbacklog:edit')") |
| | | @Log(title = "回调记录", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody TbCallbackLog tbCallbackLog) |
| | | { |
| | | return toAjax(tbCallbackLogService.updateTbCallbackLog(tbCallbackLog)); |
| | | } |
| | | |
| | | /** |
| | | * 删除回调记录 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:callbacklog:remove')") |
| | | @Log(title = "回调记录", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(tbCallbackLogService.deleteTbCallbackLogByIds(ids)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.quartz.task; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.system.domain.*; |
| | | import com.ruoyi.system.service.IAOrderStatusService; |
| | | import com.ruoyi.system.service.IDispatchOrdService; |
| | | import com.ruoyi.system.service.ISysClientAppService; |
| | | import com.ruoyi.system.service.ITbOrdersService; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.service.impl.SysUserServiceImpl; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import java.util.Date; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Autowired |
| | | private ISysClientAppService sysClientAppService; |
| | | |
| | | @Autowired |
| | | private ITbCallbackLogService tbCallbackLogService; |
| | | |
| | | public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) |
| | | { |
| | |
| | | for (AOrderStatus orderStatus : orderStatusList) { |
| | | int count = tbOrdersService.checkServiceOrdIDExists(orderStatus.getServiceOrdID()); |
| | | if (count > 0) { |
| | | System.out.println("服务订单ID存在:" + orderStatus.getServiceOrdID()); |
| | | log.info("服务订单ID存在:" + orderStatus.getServiceOrdID()); |
| | | |
| | | TbOrders tbOrders = tbOrdersService.selectTbOrdersByServiceOrdID(orderStatus.getServiceOrdID()); |
| | | |
| | |
| | | log.error("获取调度单异常:"+e.getMessage()); |
| | | } |
| | | |
| | | SysClientApp clientApp = sysClientAppService.selectSysClientAppByAppKey("appId1"); |
| | | SysClientApp clientApp = sysClientAppService.selectSysClientAppByAppKey(tbOrders.getAppId()); |
| | | if(clientApp==null){ |
| | | log.error("回调地址不存在"); |
| | | return; |
| | |
| | | map.put("plateNo",carLicense); |
| | | map.put("driverMobile",driverMobiles.toString()); |
| | | map.put("driverName", driverNames.toString()); |
| | | map.put("appId", tbOrders.getAppId()); |
| | | |
| | | // 第一次尝试 |
| | | String response = sendCallback(callbackUrl, map); |
| | |
| | | log.info("回调推送成功,参数如下:"); |
| | | map.forEach((key, value) -> log.info(" {} : {}", key, value)); |
| | | orderStatusService.updateAOrderStatusFlag(orderStatus.getId()); |
| | | |
| | | |
| | | |
| | | } else { |
| | | log.error("回调请求重试后仍然失败"); |
| | | orderStatusService.updateAOrderStatusFlag(orderStatus.getId()); |
| | |
| | | |
| | | // 新增发送回调的方法 |
| | | private String sendCallback(String callbackUrl, Map<String, String> params) { |
| | | TbCallbackLog callbackLog = new TbCallbackLog(); |
| | | callbackLog.setCallbackUrl(callbackUrl); |
| | | callbackLog.setRequestParams(JSON.toJSONString(params)); |
| | | callbackLog.setCreateTime(new Date()); |
| | | callbackLog.setStatus("0"); // 默认失败 |
| | | callbackLog.setRetryCount(0); |
| | | callbackLog.setServiceOrdId(params.get("thirdOrderNo")); |
| | | callbackLog.setOrderId(Long.valueOf(params.get("orderID"))); |
| | | callbackLog.setAppId(params.get("appId")); |
| | | |
| | | try { |
| | | // 打印请求参数 |
| | | log.info("发送回调请求,URL: " + callbackUrl); |
| | |
| | | // 打印响应结果 |
| | | log.info("回调响应结果: " + response); |
| | | |
| | | // 更新日志状态 |
| | | callbackLog.setResponseResult(response); |
| | | callbackLog.setStatus("1"); // 成功 |
| | | |
| | | tbCallbackLogService.insertTbCallbackLog(callbackLog); |
| | | return response; |
| | | } catch (Exception e) { |
| | | log.error("回调请求异常: " + e.getMessage()); |
| | | // 记录错误信息 |
| | | callbackLog.setErrorMsg(e.getMessage()); |
| | | callbackLog.setRetryCount(1); // 如果是重试的情况下需要+1 |
| | | tbCallbackLogService.insertTbCallbackLog(callbackLog); |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 回调记录对象 tb_callback_log |
| | | * |
| | | */ |
| | | @Data |
| | | public class TbCallbackLog extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主键ID */ |
| | | private Long id; |
| | | |
| | | /** 服务订单ID */ |
| | | @Excel(name = "服务订单ID") |
| | | private String serviceOrdId; |
| | | |
| | | /** 订单ID */ |
| | | @Excel(name = "订单ID") |
| | | private Long orderId; |
| | | |
| | | /** 回调地址 */ |
| | | @Excel(name = "回调地址") |
| | | private String callbackUrl; |
| | | |
| | | /** 请求参数 */ |
| | | @Excel(name = "请求参数") |
| | | private String requestParams; |
| | | |
| | | /** 响应结果 */ |
| | | @Excel(name = "响应结果") |
| | | private String responseResult; |
| | | |
| | | /** 状态(0失败 1成功) */ |
| | | @Excel(name = "状态", readConverterExp = "0=失败,1=成功") |
| | | private String status; |
| | | |
| | | /** 重试次数 */ |
| | | @Excel(name = "重试次数") |
| | | private Integer retryCount; |
| | | |
| | | /** 错误信息 */ |
| | | @Excel(name = "错误信息") |
| | | private String errorMsg; |
| | | |
| | | /** 创建时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** 应用ID */ |
| | | @Excel(name = "应用ID") |
| | | private String appId; |
| | | } |
| | |
| | | @JsonProperty("OrderStatus") |
| | | private Integer OrderStatus; |
| | | |
| | | |
| | | /** 商户ID */ |
| | | @Excel(name = "商户ID") |
| | | @JsonProperty("AppId") |
| | | private String AppId; |
| | | |
| | | |
| | | public void setOrderID(Long OrderID) |
| | | { |
| | | this.OrderID = OrderID; |
| | |
| | | |
| | | public Integer getOrderStatus(){return this.OrderStatus;} |
| | | |
| | | public void setAppId(String AppId){this.AppId = AppId;} |
| | | |
| | | public String getAppId(){return this.AppId;} |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.TbCallbackLog; |
| | | |
| | | /** |
| | | * 回调记录Mapper接口 |
| | | * |
| | | */ |
| | | public interface TbCallbackLogMapper |
| | | { |
| | | /** |
| | | * 查询回调记录 |
| | | * |
| | | * @param id 回调记录主键 |
| | | * @return 回调记录 |
| | | */ |
| | | public TbCallbackLog selectTbCallbackLogById(Long id); |
| | | |
| | | /** |
| | | * 查询回调记录列表 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 回调记录集合 |
| | | */ |
| | | public List<TbCallbackLog> selectTbCallbackLogList(TbCallbackLog tbCallbackLog); |
| | | |
| | | /** |
| | | * 新增回调记录 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 结果 |
| | | */ |
| | | public int insertTbCallbackLog(TbCallbackLog tbCallbackLog); |
| | | |
| | | /** |
| | | * 修改回调记录 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 结果 |
| | | */ |
| | | public int updateTbCallbackLog(TbCallbackLog tbCallbackLog); |
| | | |
| | | /** |
| | | * 删除回调记录 |
| | | * |
| | | * @param id 回调记录主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteTbCallbackLogById(Long id); |
| | | |
| | | /** |
| | | * 批量删除回调记录 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteTbCallbackLogByIds(Long[] ids); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.TbCallbackLog; |
| | | |
| | | /** |
| | | * 回调记录Service接口 |
| | | * |
| | | */ |
| | | public interface ITbCallbackLogService |
| | | { |
| | | /** |
| | | * 查询回调记录 |
| | | * |
| | | * @param id 回调记录主键 |
| | | * @return 回调记录 |
| | | */ |
| | | public TbCallbackLog selectTbCallbackLogById(Long id); |
| | | |
| | | /** |
| | | * 查询回调记录列表 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 回调记录集合 |
| | | */ |
| | | public List<TbCallbackLog> selectTbCallbackLogList(TbCallbackLog tbCallbackLog); |
| | | |
| | | /** |
| | | * 新增回调记录 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 结果 |
| | | */ |
| | | public int insertTbCallbackLog(TbCallbackLog tbCallbackLog); |
| | | |
| | | /** |
| | | * 修改回调记录 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 结果 |
| | | */ |
| | | public int updateTbCallbackLog(TbCallbackLog tbCallbackLog); |
| | | |
| | | /** |
| | | * 批量删除回调记录 |
| | | * |
| | | * @param ids 需要删除的回调记录主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteTbCallbackLogByIds(Long[] ids); |
| | | |
| | | /** |
| | | * 删除回调记录信息 |
| | | * |
| | | * @param id 回调记录主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteTbCallbackLogById(Long id); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.mapper.TbCallbackLogMapper; |
| | | import com.ruoyi.system.domain.TbCallbackLog; |
| | | import com.ruoyi.system.service.ITbCallbackLogService; |
| | | |
| | | /** |
| | | * 回调记录Service业务层处理 |
| | | * |
| | | */ |
| | | @Service |
| | | public class TbCallbackLogServiceImpl implements ITbCallbackLogService |
| | | { |
| | | @Autowired |
| | | private TbCallbackLogMapper tbCallbackLogMapper; |
| | | |
| | | /** |
| | | * 查询回调记录 |
| | | * |
| | | * @param id 回调记录主键 |
| | | * @return 回调记录 |
| | | */ |
| | | @Override |
| | | public TbCallbackLog selectTbCallbackLogById(Long id) |
| | | { |
| | | return tbCallbackLogMapper.selectTbCallbackLogById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询回调记录列表 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 回调记录 |
| | | */ |
| | | @Override |
| | | public List<TbCallbackLog> selectTbCallbackLogList(TbCallbackLog tbCallbackLog) |
| | | { |
| | | return tbCallbackLogMapper.selectTbCallbackLogList(tbCallbackLog); |
| | | } |
| | | |
| | | /** |
| | | * 新增回调记录 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertTbCallbackLog(TbCallbackLog tbCallbackLog) |
| | | { |
| | | return tbCallbackLogMapper.insertTbCallbackLog(tbCallbackLog); |
| | | } |
| | | |
| | | /** |
| | | * 修改回调记录 |
| | | * |
| | | * @param tbCallbackLog 回调记录 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateTbCallbackLog(TbCallbackLog tbCallbackLog) |
| | | { |
| | | return tbCallbackLogMapper.updateTbCallbackLog(tbCallbackLog); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除回调记录 |
| | | * |
| | | * @param ids 需要删除的回调记录主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteTbCallbackLogByIds(Long[] ids) |
| | | { |
| | | return tbCallbackLogMapper.deleteTbCallbackLogByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除回调记录信息 |
| | | * |
| | | * @param id 回调记录主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteTbCallbackLogById(Long id) |
| | | { |
| | | return tbCallbackLogMapper.deleteTbCallbackLogById(id); |
| | | } |
| | | } |
New file |
| | |
| | | <?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.ruoyi.system.mapper.TbCallbackLogMapper"> |
| | | |
| | | <resultMap type="TbCallbackLog" id="TbCallbackLogResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="serviceOrdId" column="service_ord_id" /> |
| | | <result property="orderId" column="order_id" /> |
| | | <result property="callbackUrl" column="callback_url" /> |
| | | <result property="requestParams" column="request_params" /> |
| | | <result property="responseResult" column="response_result" /> |
| | | <result property="status" column="status" /> |
| | | <result property="retryCount" column="retry_count" /> |
| | | <result property="errorMsg" column="error_msg" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="appId" column="app_id" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectTbCallbackLogVo"> |
| | | select id, service_ord_id, order_id, callback_url, request_params, response_result, status, retry_count, error_msg, create_time, app_id |
| | | from tb_callback_log |
| | | </sql> |
| | | |
| | | <select id="selectTbCallbackLogList" parameterType="TbCallbackLog" resultMap="TbCallbackLogResult"> |
| | | <include refid="selectTbCallbackLogVo"/> |
| | | <where> |
| | | <if test="serviceOrdId != null and serviceOrdId != ''"> and service_ord_id = #{serviceOrdId}</if> |
| | | <if test="orderId != null "> and order_id = #{orderId}</if> |
| | | <if test="status != null and status != ''"> and status = #{status}</if> |
| | | <if test="appId != null and appId != ''"> and app_id = #{appId}</if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |
| | | </if> |
| | | <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
| | | AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | </where> |
| | | order by create_time,id desc |
| | | </select> |
| | | |
| | | <select id="selectTbCallbackLogById" parameterType="Long" resultMap="TbCallbackLogResult"> |
| | | <include refid="selectTbCallbackLogVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertTbCallbackLog" parameterType="TbCallbackLog" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into tb_callback_log |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="serviceOrdId != null">service_ord_id,</if> |
| | | <if test="orderId != null">order_id,</if> |
| | | <if test="callbackUrl != null">callback_url,</if> |
| | | <if test="requestParams != null">request_params,</if> |
| | | <if test="responseResult != null">response_result,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="retryCount != null">retry_count,</if> |
| | | <if test="errorMsg != null">error_msg,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="appId != null">app_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="serviceOrdId != null">#{serviceOrdId},</if> |
| | | <if test="orderId != null">#{orderId},</if> |
| | | <if test="callbackUrl != null">#{callbackUrl},</if> |
| | | <if test="requestParams != null">#{requestParams},</if> |
| | | <if test="responseResult != null">#{responseResult},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="retryCount != null">#{retryCount},</if> |
| | | <if test="errorMsg != null">#{errorMsg},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="appId != null">#{appId},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateTbCallbackLog" parameterType="TbCallbackLog"> |
| | | update tb_callback_log |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="serviceOrdId != null">service_ord_id = #{serviceOrdId},</if> |
| | | <if test="orderId != null">order_id = #{orderId},</if> |
| | | <if test="callbackUrl != null">callback_url = #{callbackUrl},</if> |
| | | <if test="requestParams != null">request_params = #{requestParams},</if> |
| | | <if test="responseResult != null">response_result = #{responseResult},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="retryCount != null">retry_count = #{retryCount},</if> |
| | | <if test="errorMsg != null">error_msg = #{errorMsg},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="appId != null">app_id = #{appId},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteTbCallbackLogById" parameterType="Long"> |
| | | delete from tb_callback_log where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteTbCallbackLogByIds" parameterType="String"> |
| | | delete from tb_callback_log where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | |
| | | <result property="CreateTime" column="CreateTime" /> |
| | | <result property="UpdateTime" column="UpdateTime" /> |
| | | <result property="OrderStatus" column="OrderStatus" /> |
| | | <result property="AppId" column="AppId" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectTbOrdersVo"> |
| | | select OrderID, LinkPerson, LinkTel, AlarmTel, PatientName, Sex, Age, Kg, Sense, LocalAddress, LocalLongitude, LocalLatitude, LocalProvince, LocalCity, LocalDistrict, SendAddress, SendLongitude, SendLatitude, SendProvince, SendCity, SendDistrict, BookingPrice, BookingDate, Remark, Complaint, PatientCount, BookingKM, EscortCode, LiftingCode, LiftingFloor, RequirementCode, TypeCode, ThirdPartyResult, ServiceOrdID, ServiceOrdNo, CreateTime, UpdateTime, OrderStatus from tb_orders |
| | | select OrderID, LinkPerson, LinkTel, AlarmTel, PatientName, Sex, Age, Kg, Sense, LocalAddress, LocalLongitude, LocalLatitude, LocalProvince, LocalCity, LocalDistrict, SendAddress, SendLongitude, SendLatitude, SendProvince, SendCity, SendDistrict, BookingPrice, BookingDate, Remark, Complaint, PatientCount, BookingKM, EscortCode, LiftingCode, LiftingFloor, RequirementCode, TypeCode, ThirdPartyResult, ServiceOrdID, ServiceOrdNo, CreateTime, UpdateTime, OrderStatus, AppId from tb_orders |
| | | </sql> |
| | | |
| | | <select id="selectTbOrdersList" parameterType="TbOrders" resultMap="TbOrdersResult"> |
| | |
| | | <if test="CreateTime != null "> and CreateTime = #{CreateTime}</if> |
| | | <if test="UpdateTime != null "> and UpdateTime = #{UpdateTime}</if> |
| | | <if test="OrderStatus != null "> and OrderStatus = #{OrderStatus}</if> |
| | | <if test="AppId != null and AppId != ''"> and AppId = #{AppId}</if> |
| | | </where> |
| | | ORDER BY CreateTime DESC |
| | | </select> |
| | |
| | | <if test="CreateTime != null">CreateTime,</if> |
| | | <if test="UpdateTime != null">UpdateTime,</if> |
| | | <if test="OrderStatus != null">OrderStatus,</if> |
| | | <if test="AppId != null">AppId,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="OrderID != null">#{OrderID},</if> |
| | |
| | | <if test="CreateTime != null">#{CreateTime},</if> |
| | | <if test="UpdateTime != null">#{UpdateTime},</if> |
| | | <if test="OrderStatus != null">#{OrderStatus},</if> |
| | | <if test="AppId != null">#{AppId},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="CreateTime != null">CreateTime = #{CreateTime},</if> |
| | | <if test="UpdateTime != null">UpdateTime = #{UpdateTime},</if> |
| | | <if test="OrderStatus != null">OrderStatus = #{OrderStatus},</if> |
| | | <if test="AppId != null">AppId = #{AppId},</if> |
| | | </trim> |
| | | where OrderID = #{OrderID} |
| | | </update> |
New file |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // 查询回调记录列表 |
| | | export function listCallbacklog(query) { |
| | | return request({ |
| | | url: '/system/callbacklog/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 查询回调记录详细 |
| | | export function getCallbacklog(id) { |
| | | return request({ |
| | | url: '/system/callbacklog/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 新增回调记录 |
| | | export function addCallbacklog(data) { |
| | | return request({ |
| | | url: '/system/callbacklog', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 修改回调记录 |
| | | export function updateCallbacklog(data) { |
| | | return request({ |
| | | url: '/system/callbacklog', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 删除回调记录 |
| | | export function delCallbacklog(id) { |
| | | return request({ |
| | | url: '/system/callbacklog/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="服务订单ID" prop="serviceOrdId"> |
| | | <el-input |
| | | v-model="queryParams.serviceOrdId" |
| | | placeholder="请输入服务订单ID" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="订单ID" prop="orderId"> |
| | | <el-input |
| | | v-model="queryParams.orderId" |
| | | placeholder="请输入订单ID" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="回调地址" prop="callbackUrl"> |
| | | <el-input |
| | | v-model="queryParams.callbackUrl" |
| | | placeholder="请输入回调地址" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="重试次数" prop="retryCount"> |
| | | <el-input |
| | | v-model="queryParams.retryCount" |
| | | placeholder="请输入重试次数" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> --> |
| | | <el-form-item label="应用ID" prop="appId"> |
| | | <el-input |
| | | v-model="queryParams.appId" |
| | | placeholder="请输入应用ID" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <!-- <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:callbacklog:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:callbacklog:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:callbacklog:remove']" |
| | | >删除</el-button> |
| | | </el-col> --> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:callbacklog:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="callbacklogList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="ID" align="center" prop="id" /> |
| | | <el-table-column label="民航服务订单ID" align="center" prop="serviceOrdId" /> |
| | | <el-table-column label="订单ID" align="center" prop="orderId" /> |
| | | <el-table-column label="回调地址" align="center" prop="callbackUrl" /> |
| | | <el-table-column label="请求参数" align="center" prop="requestParams" /> |
| | | <el-table-column label="响应结果" align="center" prop="responseResult" /> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="scope.row.status === '1' ? 'success' : 'danger'"> |
| | | {{ scope.row.status === '1' ? '成功' : '失败' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="重试次数" align="center" prop="retryCount" /> |
| | | <el-table-column label="错误信息" align="center" prop="errorMsg" /> |
| | | <el-table-column label="应用ID" align="center" prop="appId" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:callbacklog:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:callbacklog:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> --> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- 添加或修改回调记录对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="服务订单ID" prop="serviceOrdId"> |
| | | <el-input v-model="form.serviceOrdId" placeholder="请输入服务订单ID" /> |
| | | </el-form-item> |
| | | <el-form-item label="订单ID" prop="orderId"> |
| | | <el-input v-model="form.orderId" placeholder="请输入订单ID" /> |
| | | </el-form-item> |
| | | <el-form-item label="回调地址" prop="callbackUrl"> |
| | | <el-input v-model="form.callbackUrl" placeholder="请输入回调地址" /> |
| | | </el-form-item> |
| | | <el-form-item label="请求参数" prop="requestParams"> |
| | | <el-input v-model="form.requestParams" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="响应结果" prop="responseResult"> |
| | | <el-input v-model="form.responseResult" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="重试次数" prop="retryCount"> |
| | | <el-input v-model="form.retryCount" placeholder="请输入重试次数" /> |
| | | </el-form-item> |
| | | <el-form-item label="错误信息" prop="errorMsg"> |
| | | <el-input v-model="form.errorMsg" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="应用ID" prop="appId"> |
| | | <el-input v-model="form.appId" placeholder="请输入应用ID" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listCallbacklog, getCallbacklog, delCallbacklog, addCallbacklog, updateCallbacklog } from "@/api/system/callbacklog"; |
| | | |
| | | export default { |
| | | name: "Callbacklog", |
| | | data() { |
| | | return { |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 选中数组 |
| | | ids: [], |
| | | // 非单个禁用 |
| | | single: true, |
| | | // 非多个禁用 |
| | | multiple: true, |
| | | // 显示搜索条件 |
| | | showSearch: true, |
| | | // 总条数 |
| | | total: 0, |
| | | // 回调记录表格数据 |
| | | callbacklogList: [], |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | // 查询参数 |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | serviceOrdId: null, |
| | | orderId: null, |
| | | callbackUrl: null, |
| | | requestParams: null, |
| | | responseResult: null, |
| | | status: null, |
| | | retryCount: null, |
| | | errorMsg: null, |
| | | appId: null |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: { |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** 查询回调记录列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listCallbacklog(this.queryParams).then(response => { |
| | | this.callbacklogList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表单重置 |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | serviceOrdId: null, |
| | | orderId: null, |
| | | callbackUrl: null, |
| | | requestParams: null, |
| | | responseResult: null, |
| | | status: null, |
| | | retryCount: null, |
| | | errorMsg: null, |
| | | createTime: null, |
| | | appId: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "添加回调记录"; |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getCallbacklog(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "修改回调记录"; |
| | | }); |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateCallbacklog(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addCallbacklog(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('是否确认删除回调记录编号为"' + ids + '"的数据项?').then(function() { |
| | | return delCallbacklog(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | this.download('system/callbacklog/export', { |
| | | ...this.queryParams |
| | | }, `callbacklog_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | <el-descriptions-item label="交易流水号"> |
| | | {{ transactionNo }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="支付方式"> |
| | | {{ payType }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </el-card> |
| | | </div> |
| | |
| | | errorMessage: '', |
| | | payAmount: '', |
| | | orderNo: '', |
| | | transactionNo: '' |
| | | transactionNo: '', |
| | | payType: '' |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | initData() { |
| | | // 从URL参数中获取数据 |
| | | const query = this.$route.query; |
| | | if (!query.payAmount || !query.orderNo || !query.transactionNo) { |
| | | this.errorMessage = '缺少必要的参数信息'; |
| | | return; |
| | | } |
| | | |
| | | // 设置数据 |
| | | this.payAmount = query.payAmount; |
| | | this.orderNo = query.orderNo; |
| | | this.transactionNo = query.transactionNo; |
| | | // 设置数据,使用空字符串作为默认值 |
| | | this.payAmount = query.PayMoney || '0'; |
| | | this.orderNo = query.ServiceOrdID || '--'; |
| | | this.transactionNo = query.DispatchOrdID || '--'; |
| | | this.payType = query.payType === '微信' ? '微信' : |
| | | query.payType === '支付宝' ? '支付宝' : '--'; |
| | | |
| | | // 模拟加载延迟 |
| | | setTimeout(() => { |
| | | // 直接显示数据,不做必填校验 |
| | | this.validated = true; |
| | | }, 500); |
| | | } |
| | | } |
| | | } |