add lombok and update pay
This commit is contained in:
parent
39a0c7d19f
commit
5bedcfc2f6
@ -135,6 +135,7 @@
|
|||||||
<groupId>org.mybatis</groupId>
|
<groupId>org.mybatis</groupId>
|
||||||
<artifactId>mybatis</artifactId>
|
<artifactId>mybatis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- mybatis-plus 增强CRUD -->
|
<!-- mybatis-plus 增强CRUD -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
@ -145,6 +146,12 @@
|
|||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- lombok -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -93,7 +93,9 @@ public class PayOrderController extends BaseController
|
|||||||
{
|
{
|
||||||
payOrder.setUserId(getUserId());
|
payOrder.setUserId(getUserId());
|
||||||
payOrder.setOrderNumber(snowflakeidworker.nextId().toString());
|
payOrder.setOrderNumber(snowflakeidworker.nextId().toString());
|
||||||
return toAjax(payOrderService.insertPayOrder(payOrder));
|
AjaxResult result = toAjax(payOrderService.insertPayOrder(payOrder));
|
||||||
|
result.put(AjaxResult.DATA_TAG, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,6 +110,18 @@ public class PayOrderController extends BaseController
|
|||||||
return toAjax(payOrderService.updatePayOrder(payOrder));
|
return toAjax(payOrderService.updatePayOrder(payOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单
|
||||||
|
*/
|
||||||
|
@Operation(summary = "通过订单号删除订单")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pay:order:remove')")
|
||||||
|
@Log(title = "订单", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/orderNumber/{orderNumber}")
|
||||||
|
public AjaxResult removeByOrderNumber(@PathVariable( name = "orderNumber" ) String orderNumbers)
|
||||||
|
{
|
||||||
|
return toAjax(payOrderService.deletePayOrderByOrderNumber(orderNumbers));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除订单
|
* 删除订单
|
||||||
*/
|
*/
|
||||||
|
@ -67,4 +67,6 @@ public interface PayOrderMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePayOrderByOrderIds(Long[] orderIds);
|
public int deletePayOrderByOrderIds(Long[] orderIds);
|
||||||
|
|
||||||
|
public int deletePayOrderByOrderNumber(String orderNumber);
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,15 @@ public interface IPayOrderService {
|
|||||||
*/
|
*/
|
||||||
public int deletePayOrderByOrderIds(Long[] orderIds);
|
public int deletePayOrderByOrderIds(Long[] orderIds);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单信息
|
||||||
|
*
|
||||||
|
* @param orderId 订单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePayOrderByOrderNumber(String orderNumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除订单信息
|
* 删除订单信息
|
||||||
*
|
*
|
||||||
|
@ -96,4 +96,15 @@ public class PayOrderServiceImpl implements IPayOrderService {
|
|||||||
public int deletePayOrderByOrderId(Long orderId) {
|
public int deletePayOrderByOrderId(Long orderId) {
|
||||||
return payOrderMapper.deletePayOrderByOrderId(orderId);
|
return payOrderMapper.deletePayOrderByOrderId(orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单信息
|
||||||
|
*
|
||||||
|
* @param orderIds 需要删除的订单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deletePayOrderByOrderNumber(String orderNumber) {
|
||||||
|
return payOrderMapper.deletePayOrderByOrderNumber(orderNumber);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,10 @@
|
|||||||
<include refid="selectPayOrderVo" />
|
<include refid="selectPayOrderVo" />
|
||||||
<where>
|
<where>
|
||||||
<if test="userId != null "> and user_id = #{userId}</if>
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
<if
|
<if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
|
||||||
test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
|
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
|
||||||
<if
|
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount}</if>
|
||||||
test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
|
<if test="orderContent != null and orderContent != ''"> and order_content =
|
||||||
<if
|
|
||||||
test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount}</if>
|
|
||||||
<if
|
|
||||||
test="orderContent != null and orderContent != ''"> and order_content =
|
|
||||||
#{orderContent}</if>
|
#{orderContent}</if>
|
||||||
<if test="orderRemark != null and orderRemark != ''"> and order_remark
|
<if test="orderRemark != null and orderRemark != ''"> and order_remark
|
||||||
= #{orderRemark}</if>
|
= #{orderRemark}</if>
|
||||||
@ -37,65 +33,63 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPayOrderByOrderId" parameterType="Long" resultMap="PayOrderResult">
|
<select id="selectPayOrderByOrderId" parameterType="Long" resultMap="PayOrderResult">
|
||||||
<include refid="selectPayOrderVo" /> where pay_order.order_id = #{orderId} </select>
|
<include refid="selectPayOrderVo" />
|
||||||
|
where pay_order.order_id = #{orderId} </select>
|
||||||
|
|
||||||
<select id="selectPayOrderByOrderNumber" parameterType="String" resultMap="PayOrderResult">
|
<select id="selectPayOrderByOrderNumber" parameterType="String" resultMap="PayOrderResult">
|
||||||
<include refid="selectPayOrderVo" /> where pay_order.order_number = #{orderNumber} </select>
|
<include refid="selectPayOrderVo" />
|
||||||
|
where pay_order.order_number = #{orderNumber} </select>
|
||||||
|
|
||||||
<insert id="insertPayOrder" parameterType="PayOrder"> insert into pay_order <trim prefix="("
|
<insert id="insertPayOrder" parameterType="PayOrder"> insert into pay_order <trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
suffix=")" suffixOverrides=",">
|
|
||||||
<if test="orderId != null">order_id,</if>
|
<if test="orderId != null">order_id,</if>
|
||||||
<if test="userId != null">user_id,</if>
|
<if test="userId != null">user_id,</if>
|
||||||
<if
|
<if test="orderNumber != null">order_number,</if>
|
||||||
test="orderNumber != null">order_number,</if>
|
|
||||||
<if test="orderStatus != null">
|
<if test="orderStatus != null">
|
||||||
order_status,</if>
|
order_status,</if>
|
||||||
<if test="totalAmount != null">total_amount,</if>
|
<if test="totalAmount != null">total_amount,</if>
|
||||||
<if
|
<if test="orderContent != null">order_content,</if>
|
||||||
test="orderContent != null">order_content,</if>
|
|
||||||
<if test="orderRemark != null">
|
<if test="orderRemark != null">
|
||||||
order_remark,</if>
|
order_remark,</if>
|
||||||
<if test="orderMessage != null">order_message,</if>
|
<if test="orderMessage != null">order_message,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="orderId != null">#{orderId},</if>
|
<if test="orderId != null">#{orderId},</if>
|
||||||
<if test="userId != null">#{userId},</if>
|
<if test="userId != null">#{userId},</if>
|
||||||
<if
|
<if test="orderNumber != null">#{orderNumber},</if>
|
||||||
test="orderNumber != null">#{orderNumber},</if>
|
|
||||||
<if test="orderStatus != null">
|
<if test="orderStatus != null">
|
||||||
#{orderStatus},</if>
|
#{orderStatus},</if>
|
||||||
<if test="totalAmount != null">#{totalAmount},</if>
|
<if test="totalAmount != null">#{totalAmount},</if>
|
||||||
<if
|
<if test="orderContent != null">#{orderContent},</if>
|
||||||
test="orderContent != null">#{orderContent},</if>
|
|
||||||
<if test="orderRemark != null">
|
<if test="orderRemark != null">
|
||||||
#{orderRemark},</if>
|
#{orderRemark},</if>
|
||||||
<if test="orderMessage != null">#{orderMessage},</if>
|
<if test="orderMessage != null">#{orderMessage},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updatePayOrder" parameterType="PayOrder"> update pay_order <trim prefix="SET"
|
<update id="updatePayOrder" parameterType="PayOrder"> update pay_order <trim prefix="SET" suffixOverrides=",">
|
||||||
suffixOverrides=",">
|
|
||||||
<if test="userId != null">user_id = #{userId},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
<if test="orderNumber != null">order_number
|
<if test="orderNumber != null">order_number
|
||||||
= #{orderNumber},</if>
|
= #{orderNumber},</if>
|
||||||
<if test="orderStatus != null">order_status = #{orderStatus},</if>
|
<if test="orderStatus != null">order_status = #{orderStatus},</if>
|
||||||
<if
|
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
|
||||||
test="totalAmount != null">total_amount = #{totalAmount},</if>
|
<if test="orderContent != null">order_content = #{orderContent},</if>
|
||||||
<if
|
<if test="orderRemark != null">order_remark = #{orderRemark},</if>
|
||||||
test="orderContent != null">order_content = #{orderContent},</if>
|
<if test="orderMessage != null">order_message = #{orderMessage},</if>
|
||||||
<if
|
|
||||||
test="orderRemark != null">order_remark = #{orderRemark},</if>
|
|
||||||
<if
|
|
||||||
test="orderMessage != null">order_message = #{orderMessage},</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
where pay_order.order_id = #{orderId} </update>
|
where pay_order.order_id = #{orderId} </update>
|
||||||
|
|
||||||
<delete id="deletePayOrderByOrderId" parameterType="Long"> delete from pay_order where order_id
|
<delete id="deletePayOrderByOrderId" parameterType="Long">
|
||||||
= #{orderId} </delete>
|
delete from pay_order where order_id = #{orderId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="deletePayOrderByOrderIds" parameterType="String"> delete from pay_order where
|
<delete id="deletePayOrderByOrderNumber" parameterType="String">
|
||||||
order_id in <foreach item="orderId" collection="array" open="(" separator="," close=")">
|
delete from pay_order where order_number= #{orderNumber}
|
||||||
#{orderId} </foreach>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePayOrderByOrderIds" parameterType="String">
|
||||||
|
delete from pay_order where order_id in
|
||||||
|
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{orderId}
|
||||||
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
@ -30,11 +30,11 @@ public class SQBController extends BaseController {
|
|||||||
|
|
||||||
@Operation(summary = "获取支付url")
|
@Operation(summary = "获取支付url")
|
||||||
@Parameters(value = {
|
@Parameters(value = {
|
||||||
@Parameter(name = "id", description = "订单号", required = true)
|
@Parameter(name = "orderNumber", description = "订单号", required = true)
|
||||||
})
|
})
|
||||||
@PostMapping("/payUrl")
|
@PostMapping("/payUrl")
|
||||||
@Anonymous
|
@Anonymous
|
||||||
public R<String> payUrl(@RequestParam("id") String orderNumber) throws Exception {
|
public R<String> payUrl(@RequestParam("orderNumber") String orderNumber) throws Exception {
|
||||||
PayOrder payOrder = payOrderServicer.selectPayOrderByOrderNumber(orderNumber);
|
PayOrder payOrder = payOrderServicer.selectPayOrderByOrderNumber(orderNumber);
|
||||||
String url = sqbServiceImpl.payUrl(payOrder);
|
String url = sqbServiceImpl.payUrl(payOrder);
|
||||||
return R.ok(url);
|
return R.ok(url);
|
||||||
@ -42,11 +42,11 @@ public class SQBController extends BaseController {
|
|||||||
|
|
||||||
@Operation(summary = "查询支付状态")
|
@Operation(summary = "查询支付状态")
|
||||||
@Parameters(value = {
|
@Parameters(value = {
|
||||||
@Parameter(name = "id", description = "订单号", required = true)
|
@Parameter(name = "orderNumber", description = "订单号", required = true)
|
||||||
})
|
})
|
||||||
@PostMapping("/query")
|
@PostMapping("/query")
|
||||||
@Anonymous
|
@Anonymous
|
||||||
public AjaxResult query(@RequestParam("id") String orderNumber) throws Exception {
|
public AjaxResult query(@RequestParam("orderNumber") String orderNumber) throws Exception {
|
||||||
PayOrder payOrder = payOrderServicer.selectPayOrderByOrderNumber(orderNumber);
|
PayOrder payOrder = payOrderServicer.selectPayOrderByOrderNumber(orderNumber);
|
||||||
return success(sqbServiceImpl.query(payOrder));
|
return success(sqbServiceImpl.query(payOrder));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user