From 6eddbbc337d8ab1de6daaa5afda2699179e3e8db Mon Sep 17 00:00:00 2001 From: wzp <2040239371@qq.com> Date: 星期一, 05 五月 2025 20:33:54 +0800 Subject: [PATCH] fix:修复bug --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java | 98 +++++++++++++++++++++++++++++++------------------ 1 files changed, 62 insertions(+), 36 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java index 5f0b743..50ab317 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java @@ -13,17 +13,14 @@ import com.ruoyi.common.utils.civilAviation.ServiceOrderUtil; import com.ruoyi.system.domain.SysClientApp; import com.ruoyi.system.service.ISysClientAppService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -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 org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -40,6 +37,7 @@ * @author wzp * @date 2025-05-01 */ +@Api("璁㈠崟绠$悊") @RestController @RequestMapping("/system/orders") public class TbOrdersController extends BaseController @@ -50,9 +48,7 @@ @Autowired private ISysClientAppService clientAppService; - /** - * 鏌ヨorders鍒楄〃 - */ + @ApiOperation("鏌ヨ璁㈠崟鍒楄〃") @PreAuthorize("@ss.hasPermi('system:orders:list')") @GetMapping("/list") public TableDataInfo list(TbOrders tbOrders) @@ -62,9 +58,7 @@ return getDataTable(list); } - /** - * 瀵煎嚭orders鍒楄〃 - */ + @ApiOperation("瀵煎嚭璁㈠崟鍒楄〃") @PreAuthorize("@ss.hasPermi('system:orders:export')") @Log(title = "orders", businessType = BusinessType.EXPORT) @PostMapping("/export") @@ -75,9 +69,8 @@ util.exportExcel(response, list, "orders鏁版嵁"); } - /** - * 鑾峰彇orders璇︾粏淇℃伅 - */ + @ApiOperation("鑾峰彇璁㈠崟璇︾粏淇℃伅") + @ApiImplicitParam(name = "OrderID", value = "璁㈠崟ID", required = true, dataType = "Long", paramType = "path") @PreAuthorize("@ss.hasPermi('system:orders:query')") @GetMapping(value = "/{OrderID}") public AjaxResult getInfo(@PathVariable("OrderID") Long OrderID) @@ -93,6 +86,22 @@ // @Anonymous(needSign = true) @Anonymous // @Log(title = "orders", businessType = BusinessType.INSERT) + @ApiOperation("鏂板璁㈠崟") + @ApiImplicitParams({ + @ApiImplicitParam(name = "orderID", value = "璁㈠崟ID", dataType = "Long"), + @ApiImplicitParam(name = "typeCode", value = "璁㈠崟绫诲瀷", dataType = "Integer"), + @ApiImplicitParam(name = "linkTel", value = "鑱旂郴鐢佃瘽", dataType = "String"), + @ApiImplicitParam(name = "linkPerson", value = "鑱旂郴浜�", dataType = "String"), + @ApiImplicitParam(name = "bookingDate", value = "棰勭害鏃堕棿", dataType = "Date"), + @ApiImplicitParam(name = "patientName", value = "鎮h�呭鍚�", dataType = "String"), + @ApiImplicitParam(name = "age", value = "骞撮緞", dataType = "Integer"), + @ApiImplicitParam(name = "sex", value = "鎬у埆", dataType = "Integer"), + @ApiImplicitParam(name = "localAddress", value = "杞嚭鍖婚櫌", dataType = "String"), + @ApiImplicitParam(name = "sendAddress", value = "杞叆鍖婚櫌", dataType = "String"), + @ApiImplicitParam(name = "complaint", value = "璇婃柇淇℃伅", dataType = "String"), + @ApiImplicitParam(name = "remark", value = "澶囨敞", dataType = "String"), + @ApiImplicitParam(name = "bookingPrice", value = "鎶ヤ环", dataType = "BigDecimal") + }) @PostMapping("/add") public AjaxResult add(@RequestBody TbOrders tbOrders) { try { @@ -116,7 +125,7 @@ // model.setCoTies("瀹跺睘"); // 闅忔満璁剧疆瀹㈡埛鑱旂郴浜轰笌鎮h�呭叧绯� // 璁剧疆棰勭害鏃堕棿涓轰竴澶╁悗 Calendar calendar = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd%20HH:mm"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); model.setApptDate(sdf.format(tbOrders.getBookingDate())); // 鏍煎紡鍖栭绾﹁繍閫佹椂闂� model.setPtName(tbOrders.getPatientName()); // 鎮h�呭鍚� @@ -130,12 +139,12 @@ model.setCondition(tbOrders.getRemark()); // 璁剧疆澶囨敞淇℃伅 // model.setDoctor("鍖荤敓" + (int) (Math.random() * 10)); // 闅忔満璁剧疆鎮h�呭尰鐢� // model.setDoctorPhone("13" + (int) (Math.random() * 900000000 + 100000000)); // 闅忔満鐢熸垚鎮h�呭尰鐢熺數璇� - model.setOfferPrice(tbOrders.getBookingPrice().doubleValue()); // 闅忔満鐢熸垚鎶ヤ环 + model.setOfferPrice(tbOrders.getBookingPrice().doubleValue()); // 鐢熸垚鎶ヤ环 // model.setReferrals("鎺ㄤ粙浜�" + (int) (Math.random() * 10)); // 闅忔満璁剧疆鎺ㄤ粙浜轰俊鎭� // model.setUnitRemarks("鍟嗘埛闅忔満澶囨敞淇℃伅"); // 闅忔満璁剧疆鍟嗘埛澶囨敞 -// model.setPayQRcodeURL("https://example.com/qrcode/" + (int) (Math.random() * 100)); // 闅忔満鐢熸垚澶栭儴鏀粯浜岀淮鐮侀摼鎺� + model.setPayQRcodeURL(scApp.getPayUrl()); - ServiceOrderAppResultVo result = ServiceOrderUtil.CreateServiceOrder(model); + ServiceOrderAppResultVo result = ServiceOrderUtil.CreateServiceOrder(model,scApp.getMinAppSecret()); if (result.getResult() == 1) { tbOrders.setOrderID(tbOrders.getOrderID()); @@ -154,9 +163,8 @@ } } - /** - * 閲嶆柊鍙戦�佽鍗� - */ + @ApiOperation("閲嶆柊鍙戦�佽鍗�") + @ApiImplicitParam(name = "orderId", value = "璁㈠崟ID", required = true, dataType = "Long", paramType = "path") @PostMapping("/resend/{orderId}") public AjaxResult resendOrder(@PathVariable Long orderId) { @@ -168,7 +176,7 @@ return AjaxResult.error("璁㈠崟鐘舵�佸凡鍙栨秷"); } - SysClientApp scApp = clientAppService.selectSysClientAppByAppId(1L); + SysClientApp scApp = clientAppService.selectSysClientAppByAppKey("appId1"); ServiceOrderAppVo model = new ServiceOrderAppVo(); @@ -180,7 +188,7 @@ // model.setCoTies("瀹跺睘"); // 闅忔満璁剧疆瀹㈡埛鑱旂郴浜轰笌鎮h�呭叧绯� // 璁剧疆棰勭害鏃堕棿涓轰竴澶╁悗 Calendar calendar = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd%20HH:mm"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); model.setApptDate(sdf.format(tbOrders.getBookingDate())); // 鏍煎紡鍖栭绾﹁繍閫佹椂闂� model.setPtName(tbOrders.getPatientName()); // 鎮h�呭鍚� @@ -197,9 +205,9 @@ model.setOfferPrice(tbOrders.getBookingPrice().doubleValue()); // 鎶ヤ环 // model.setReferrals("鎺ㄤ粙浜�")); // 璁剧疆鎺ㄤ粙浜轰俊鎭�--娌℃湁鎺ㄤ粙浜轰俊鎭� // model.setUnitRemarks("鍟嗘埛澶囨敞淇℃伅"); // 璁剧疆鍟嗘埛澶囨敞--娌℃湁鍟嗘埛澶囨敞 -// model.setPayQRcodeURL("https://example.com/qrcode/")); // 澶栭儴鏀粯浜岀淮鐮侀摼鎺�--鐢ㄤ笉鍒� + model.setPayQRcodeURL(scApp.getPayUrl()); - ServiceOrderAppResultVo result = ServiceOrderUtil.CreateServiceOrder(model); + ServiceOrderAppResultVo result = ServiceOrderUtil.CreateServiceOrder(model,scApp.getMinAppSecret()); if (result.getResult() == 1) { tbOrders.setOrderID(tbOrders.getOrderID()); @@ -217,6 +225,12 @@ + @ApiOperation("鍙栨秷璁㈠崟") + @ApiImplicitParams({ + @ApiImplicitParam(name = "orderID", value = "璁㈠崟ID", required = true, dataType = "Long"), + @ApiImplicitParam(name = "thirdOrderNo", value = "绗笁鏂硅鍗曞彿", required = true, dataType = "String"), + @ApiImplicitParam(name = "reason", value = "鍙栨秷鍘熷洜", required = true, dataType = "String") + }) @Anonymous @PostMapping("/cancelOrder") public AjaxResult cancelOrder(@RequestBody OrderCancelVo cancelVo) @@ -235,7 +249,7 @@ model.setServiceOrdID(cancelVo.getThirdOrderNo()); // 璁剧疆绗笁鏂硅鍗曞彿 model.setDELRemarks(cancelVo.getReason()); // 璁剧疆鍙栨秷鍘熷洜 - ServiceOrderAppResultVo result = ServiceOrderUtil.CancelServiceOrder(model); + ServiceOrderAppResultVo result = ServiceOrderUtil.CancelServiceOrder(model,scApp.getMinAppSecret()); if (result.getResult() == 1) { // 鏇存柊鏈湴璁㈠崟鐘舵�� @@ -252,9 +266,22 @@ } } - /** - * 淇敼orders - */ + @ApiOperation("淇敼璁㈠崟") + @ApiImplicitParams({ + @ApiImplicitParam(name = "orderID", value = "璁㈠崟ID", required = true, dataType = "Long"), + @ApiImplicitParam(name = "typeCode", value = "璁㈠崟绫诲瀷", dataType = "Integer"), + @ApiImplicitParam(name = "linkTel", value = "鑱旂郴鐢佃瘽", dataType = "String"), + @ApiImplicitParam(name = "linkPerson", value = "鑱旂郴浜�", dataType = "String"), + @ApiImplicitParam(name = "bookingDate", value = "棰勭害鏃堕棿", dataType = "Date"), + @ApiImplicitParam(name = "patientName", value = "鎮h�呭鍚�", dataType = "String"), + @ApiImplicitParam(name = "age", value = "骞撮緞", dataType = "Integer"), + @ApiImplicitParam(name = "sex", value = "鎬у埆", dataType = "Integer"), + @ApiImplicitParam(name = "localAddress", value = "杞嚭鍖婚櫌", dataType = "String"), + @ApiImplicitParam(name = "sendAddress", value = "杞叆鍖婚櫌", dataType = "String"), + @ApiImplicitParam(name = "complaint", value = "璇婃柇淇℃伅", dataType = "String"), + @ApiImplicitParam(name = "remark", value = "澶囨敞", dataType = "String"), + @ApiImplicitParam(name = "bookingPrice", value = "鎶ヤ环", dataType = "BigDecimal") + }) @PreAuthorize("@ss.hasPermi('system:orders:edit')") @Log(title = "orders", businessType = BusinessType.UPDATE) @PutMapping @@ -263,12 +290,11 @@ return toAjax(tbOrdersService.updateTbOrders(tbOrders)); } - /** - * 鍒犻櫎orders - */ + @ApiOperation("鍒犻櫎璁㈠崟") + @ApiImplicitParam(name = "OrderIDs", value = "璁㈠崟ID鏁扮粍", required = true, dataType = "Long[]", paramType = "path") @PreAuthorize("@ss.hasPermi('system:orders:remove')") @Log(title = "orders", businessType = BusinessType.DELETE) - @DeleteMapping("/{OrderIDs}") + @DeleteMapping("/{OrderIDs}") public AjaxResult remove(@PathVariable Long[] OrderIDs) { return toAjax(tbOrdersService.deleteTbOrdersByOrderIDs(OrderIDs)); -- Gitblit v1.9.1