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