| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/system/appUser") |
| | | @Api( tags = "后台-系统设置-用户管理") |
| | | @Api( tags = "后台-用户管理") |
| | | public class AppUserController { |
| | | |
| | | @Resource |
New file |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.wx.RefundCallbackResult; |
| | | import com.ruoyi.system.pojo.dto.AppUserPageDTO; |
| | | import com.ruoyi.system.pojo.dto.OrderPageDTO; |
| | | import com.ruoyi.system.pojo.vo.*; |
| | | import com.ruoyi.system.service.OrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/system/order") |
| | | @Api( tags = "后台-订单管理") |
| | | public class OrderController { |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @PostMapping("/getOrderPage") |
| | | @ApiOperation(value = "订单分页") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R<IPage<OrderPageVO>> getOrderPage(@RequestBody OrderPageDTO dto) { |
| | | return R.ok(orderService.getOrderPage(dto)); |
| | | } |
| | | /** |
| | | * 查看详情 |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation(value = "查看详情-基础信息") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R<OrderDetailVO> detail(@PathVariable("id") String id) { |
| | | return R.ok(orderService.detail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 企业工商信息 |
| | | */ |
| | | @GetMapping("/business/{id}") |
| | | @ApiOperation(value = "查看详情-企业工商信息") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R<BusinessVO> business(@PathVariable("id") String id) { |
| | | return R.ok(orderService.business(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * todo redis 企业异常信息 |
| | | */ |
| | | @GetMapping("/error/{id}") |
| | | @ApiOperation(value = "查看详情-企业异常信息") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R<ErrorVO> error(@PathVariable("id") String id) { |
| | | return R.ok(orderService.error(id)); |
| | | } |
| | | /** |
| | | * todo redis 企业变更信息 |
| | | */ |
| | | @GetMapping("/change/{id}") |
| | | @ApiOperation(value = "查看详情-企业变更信息") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R<ChangeVO> change(@PathVariable("id") String id) { |
| | | return R.ok(orderService.change(id)); |
| | | } |
| | | /** |
| | | * todo redis 企业纳税信息 |
| | | */ |
| | | @GetMapping("/tax/{id}") |
| | | @ApiOperation(value = "查看详情-企业纳税信息") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R<TaxVO> tax(@PathVariable("id") String id) { |
| | | return R.ok(orderService.tax(id)); |
| | | } |
| | | |
| | | /** |
| | | * todo redis 企业发票信息 |
| | | */ |
| | | @GetMapping("/invoice/{id}") |
| | | @ApiOperation(value = "查看详情-企业纳税信息") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R<InvoiceVO> invoice(@PathVariable("id") String id) { |
| | | return R.ok(orderService.invoice(id)); |
| | | } |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @DeleteMapping("/delete/{id}") |
| | | @ApiOperation(value = "删除") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R delete(@PathVariable("id") String id) { |
| | | orderService.delete(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上、下架 |
| | | */ |
| | | @PutMapping("/shelves/{id}") |
| | | @ApiOperation(value = "上、下架") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R shelves(@PathVariable("id") String id) { |
| | | orderService.shelves(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 取消交易 |
| | | */ |
| | | @PutMapping("/cancel/{id}") |
| | | @ApiOperation(value = "取消交易") |
| | | @PreAuthorize("@ss.hasPermi('order:manage')") |
| | | public R cancel(@PathVariable("id") String id) { |
| | | orderService.cancel(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 订单取消支付回退 |
| | | * |
| | | * @param refundCallbackResult |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/refundPayMoneyCallback") |
| | | public void refundPayMoneyCallback(RefundCallbackResult refundCallbackResult, HttpServletResponse response) { |
| | | R callback = orderService.refundPayMoneyCallback(refundCallbackResult); |
| | | if (callback.getCode() == 200) { |
| | | response.setStatus(200); |
| | | PrintWriter out = null; |
| | | try { |
| | | out = response.getWriter(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | out.println("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CloseOrderResult { |
| | | /** |
| | | * 商户编号 |
| | | */ |
| | | private String r1_MerchantNo; |
| | | /** |
| | | * 业务结果 100:成功,101:失败 |
| | | */ |
| | | private String ra_Status; |
| | | /** |
| | | * 响应码 |
| | | * 0 系统连接超时 |
| | | * 4 服务不可用 |
| | | * 100 关单成功 |
| | | * 101 失败,详见响应码描述 |
| | | * 10080000 系统异常 |
| | | * 10080002 验证签名失败 |
| | | * 10080003 订单号不正确 |
| | | * 10080042 交易类型不合法 |
| | | * 10083001 订单正在处理中 |
| | | * 10083002 该订单请求多次交易 |
| | | * 10083003 订单已关闭,无需关单操作 |
| | | * 10083003 交易成功,无需关单操作 |
| | | * 10083004 通道系统异常,请用相同参数重新请求 |
| | | * 10083005 通道其他异常信息 |
| | | */ |
| | | private String rb_Code; |
| | | /** |
| | | * 响应码描述 |
| | | */ |
| | | private String rc_CodeMsg; |
| | | /** |
| | | * 签名数据 |
| | | */ |
| | | private String hmac; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | public enum FrpCodeEnum { |
| | | ALIPAY_NATIVE("支付宝扫码(主扫)", "ALIPAY_NATIVE"), |
| | | ALIPAY_CARD("支付宝刷卡(被扫)", "ALIPAY_CARD"), |
| | | ALIPAY_H5("支付宝 H5", "ALIPAY_H5"), |
| | | ALIPAY_FWC("支付宝服务窗", "ALIPAY_FWC"), |
| | | ALIPAY_SYT("支付宝收银台", "ALIPAY_SYT"), |
| | | WEIXIN_NATIVE("微信扫码(主扫)", "WEIXIN_NATIVE"), |
| | | WEIXIN_CARD("微信刷卡(被扫)", "WEIXIN_CARD"), |
| | | WEIXIN_APP3("微信 APP+支付", "WEIXIN_APP3"), |
| | | WEIXIN_H5_PLUS("微信 H5 支付", "WEIXIN_H5_PLUS"), |
| | | WEIXIN_GZH("微信公众号支付", "WEIXIN_GZH"), |
| | | WEIXIN_XCX("微信小程序支付", "WEIXIN_XCX"), |
| | | QQ_NATIVE("QQ 扫码(主扫)", "QQ_NATIVE"), |
| | | QQ_CARD("QQ 刷卡(被扫)", "QQ_CARD"), |
| | | QQ_APP("QQ APP 支付", "QQ_APP"), |
| | | QQ_H5("QQH5 支付", "QQ_H5"), |
| | | QQ_GZH("QQ 公众号支付", "QQ_GZH"), |
| | | UNIONPAY_NATIVE("银联扫码(主扫)", "UNIONPAY_NATIVE"), |
| | | UNIONPAY_CARD("银联刷卡(被扫)", "UNIONPAY_CARD"), |
| | | UNIONPAY_APP("银联 APP 支付", "UNIONPAY_APP"), |
| | | UNIONPAY_H5("银联 H5", "UNIONPAY_H5"), |
| | | UNIONPAY_SYT("银联统一收银台", "UNIONPAY_SYT"), |
| | | UNIONPAY_WXMP("银联云微小程序(无感支付)", "UNIONPAY_WXMP") |
| | | ; |
| | | |
| | | private String name; |
| | | |
| | | private String code; |
| | | |
| | | FrpCodeEnum(String name, String code) { |
| | | this.name = name; |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | import java.security.MessageDigest; |
| | | |
| | | public class MD5AndKL { |
| | | |
| | | /** |
| | | * MD5加码。32位 |
| | | * |
| | | * @param inStr |
| | | * @return |
| | | */ |
| | | public static String MD5(String inStr) { |
| | | MessageDigest md5 = null; |
| | | try { |
| | | md5 = MessageDigest.getInstance("MD5"); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e.toString()); |
| | | } |
| | | byte[] md5Bytes = md5.digest(inStr.getBytes()); |
| | | StringBuffer hexValue = new StringBuffer(); |
| | | for (int i = 0; i < md5Bytes.length; i++) { |
| | | int val = ((int) md5Bytes[i]) & 0xff; |
| | | if (val < 16) { |
| | | hexValue.append("0"); |
| | | } |
| | | hexValue.append(Integer.toHexString(val)); |
| | | } |
| | | return hexValue.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 可逆的加密算法 |
| | | * |
| | | * @param inStr |
| | | * @return |
| | | */ |
| | | public static String KL(String inStr) { |
| | | char[] a = inStr.toCharArray(); |
| | | for (int i = 0; i < a.length; i++) { |
| | | a[i] = (char) (a[i] ^ 't'); |
| | | } |
| | | String s = new String(a); |
| | | return s; |
| | | } |
| | | |
| | | /** |
| | | * 加密后解密 |
| | | * |
| | | * @param inStr |
| | | * @return |
| | | */ |
| | | public static String JM(String inStr) { |
| | | char[] a = inStr.toCharArray(); |
| | | for (int i = 0; i < a.length; i++) { |
| | | a[i] = (char) (a[i] ^ 't'); |
| | | } |
| | | String k = new String(a); |
| | | return k; |
| | | } |
| | | |
| | | |
| | | |
| | | private static String byteArrayToHexString(byte b[]) { |
| | | StringBuffer resultSb = new StringBuffer(); |
| | | for (int i = 0; i < b.length; i++) |
| | | resultSb.append(byteToHexString(b[i])); |
| | | |
| | | return resultSb.toString(); |
| | | } |
| | | |
| | | private static String byteToHexString(byte b) { |
| | | int n = b; |
| | | if (n < 0) |
| | | n += 256; |
| | | int d1 = n / 16; |
| | | int d2 = n % 16; |
| | | return hexDigits[d1] + hexDigits[d2]; |
| | | } |
| | | |
| | | public static String MD5Encode(String origin, String charsetname) { |
| | | String resultString = null; |
| | | try { |
| | | resultString = new String(origin); |
| | | MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | if (charsetname == null || "".equals(charsetname)){ |
| | | resultString = byteArrayToHexString(md.digest(resultString.getBytes())); |
| | | }else{ |
| | | resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname))); |
| | | } |
| | | } catch (Exception exception) { |
| | | exception.printStackTrace(); |
| | | } |
| | | return resultString; |
| | | } |
| | | |
| | | private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", |
| | | "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; |
| | | |
| | | public static void main(String args[]) { |
| | | |
| | | System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | System.out.println(MD5("123456")); |
| | | // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // s = KL(s); |
| | | // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // System.out.println("解密:" + JM(KL(s))); |
| | | // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | import cn.hutool.http.Header; |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | public class PaymentUtil { |
| | | |
| | | //微信公众号、微信小程序、微信 APP+/H5、云微小程序支付 |
| | | private static final String appId = "wxdeed472c98e42a54"; |
| | | /** |
| | | * 商户密钥 |
| | | */ |
| | | private static final String key = "925899fcc374430f9e4b4ba3db05b448"; |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | private static final String merchantNo = "888122600004175"; |
| | | /** |
| | | * 平台-报备商户号 |
| | | */ |
| | | private static final String sysTradeMerchantNo = "777168500885852"; |
| | | /** |
| | | * 支付回调地址 |
| | | */ |
| | | private static final String callbackUrl = "https://www.qijisheng.top"; |
| | | |
| | | |
| | | /** |
| | | * 支付 |
| | | * @param orderNo 商户订单号 |
| | | * @param amount 订单金额 |
| | | * @param productName 商品名称 |
| | | * @param productDesc 商品描述 |
| | | * @param mp 公用回传参数 |
| | | * @param notifyUrl 服务器异步通知地址 |
| | | * @param openId 微信 Openid |
| | | * @param tradeMerchantNo 报备商户号 |
| | | * @return |
| | | */ |
| | | public static UniPayResult uniPay(String orderNo, Double amount, String productName, String productDesc, String mp, String notifyUrl, String openId, String tradeMerchantNo){ |
| | | String url = "https://trade.joinpay.com/tradeRt/uniPay"; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded"); |
| | | JSONObject body = new JSONObject(); |
| | | //版本号 |
| | | body.put("p0_Version", "2.5"); |
| | | //商户编号 |
| | | body.put("p1_MerchantNo", merchantNo); |
| | | //商户订单号 |
| | | body.put("p2_OrderNo", orderNo); |
| | | //订单金额 |
| | | body.put("p3_Amount", amount); |
| | | //交易币种 |
| | | body.put("p4_Cur", "1"); |
| | | //商品名称 |
| | | body.put("p5_ProductName", productName); |
| | | //商品描述 |
| | | body.put("p6_ProductDesc", productDesc); |
| | | //公用回传参数 |
| | | body.put("p7_Mp", mp); |
| | | //服务器异步通知地址 |
| | | body.put("p9_NotifyUrl", callbackUrl + notifyUrl); |
| | | //交易类型 |
| | | body.put("q1_FrpCode", FrpCodeEnum.WEIXIN_XCX.getCode()); |
| | | //微信 Openid |
| | | body.put("q5_OpenId", openId); |
| | | //APPID |
| | | body.put("q7_AppId", appId); |
| | | //报备商户号 |
| | | body.put("qa_TradeMerchantNo", StringUtils.isNotEmpty(tradeMerchantNo) ? tradeMerchantNo : sysTradeMerchantNo); |
| | | String sign = null; |
| | | try { |
| | | sign = sign(body); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | body.put("hmac", sign); |
| | | post.form(body); |
| | | log.info("支付接口请求参数:" + body); |
| | | HttpResponse execute = post.execute(); |
| | | log.info("支付接口请求响应:" + execute.body()); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("支付接口异常:" + execute.body()); |
| | | return null; |
| | | } |
| | | UniPayResult uniPayResult = JSON.parseObject(execute.body(), UniPayResult.class); |
| | | return uniPayResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询支付订单 |
| | | * @param orderNo 订单号 |
| | | * @return |
| | | */ |
| | | public static QueryOrderResult queryOrder(String orderNo){ |
| | | String url = "https://trade.joinpay.com/tradeRt/queryOrder"; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded"); |
| | | JSONObject body = new JSONObject(); |
| | | //版本号 |
| | | body.put("p0_Version", "2.5"); |
| | | //商户编号 |
| | | body.put("p1_MerchantNo", merchantNo); |
| | | //商户订单号 |
| | | body.put("p2_OrderNo", orderNo); |
| | | String sign = null; |
| | | try { |
| | | sign = sign(body); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | body.put("hmac", sign); |
| | | post.form(body); |
| | | log.info("查询支付接口请求参数:" + body); |
| | | HttpResponse execute = post.execute(); |
| | | log.info("查询支付接口请求响应:" + execute.body()); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("查询支付接口异常:" + execute.body()); |
| | | return null; |
| | | } |
| | | QueryOrderResult uniPayResult = JSON.parseObject(execute.body(), QueryOrderResult.class); |
| | | return uniPayResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 退款 |
| | | * @param orderNo 支付订单号 |
| | | * @param refundOrderNo 退款订单号 |
| | | * @param refundAmount 退款金额 |
| | | * @param notifyUrl 异步通知地址 |
| | | * @return |
| | | */ |
| | | public static RefundResult refund(String orderNo, String refundOrderNo, Double refundAmount, String notifyUrl){ |
| | | String url = "https://trade.joinpay.com/tradeRt/refund"; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded"); |
| | | JSONObject body = new JSONObject(); |
| | | //版本号 |
| | | body.put("p0_Version", "2.3"); |
| | | //商户编号 |
| | | body.put("p1_MerchantNo", merchantNo); |
| | | //商户订单号 |
| | | body.put("p2_OrderNo", orderNo); |
| | | //商户退款订单号 |
| | | body.put("p3_RefundOrderNo", refundOrderNo); |
| | | //退款金额 |
| | | body.put("p4_RefundAmount", refundAmount); |
| | | //服务器异步通知地址 |
| | | body.put("p6_NotifyUrl", callbackUrl + notifyUrl); |
| | | String sign = null; |
| | | try { |
| | | sign = sign(body); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | body.put("hmac", sign); |
| | | post.form(body); |
| | | log.info("退款接口请求参数:" + body); |
| | | HttpResponse execute = post.execute(); |
| | | log.info("退款接口请求响应:" + execute.body()); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("退款接口异常:" + execute.body()); |
| | | return null; |
| | | } |
| | | RefundResult uniPayResult = JSON.parseObject(execute.body(), RefundResult.class); |
| | | return uniPayResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询退款订单 |
| | | * @param refundOrderNo 退款订单号 |
| | | * @return |
| | | */ |
| | | public static QueryRefundResult queryRefund(String refundOrderNo){ |
| | | String url = "https://trade.joinpay.com/tradeRt/refund"; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded"); |
| | | JSONObject body = new JSONObject(); |
| | | //版本号 |
| | | body.put("p0_Version", "2.3"); |
| | | //商户编号 |
| | | body.put("p1_MerchantNo", merchantNo); |
| | | //商户退款订单号 |
| | | body.put("p2_RefundOrderNo", refundOrderNo); |
| | | String sign = null; |
| | | try { |
| | | sign = sign(body); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | body.put("hmac", sign); |
| | | post.form(body); |
| | | log.info("退款接口请求参数:" + body); |
| | | HttpResponse execute = post.execute(); |
| | | log.info("退款接口请求响应:" + execute.body()); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("退款接口异常:" + execute.body()); |
| | | return null; |
| | | } |
| | | QueryRefundResult uniPayResult = JSON.parseObject(execute.body(), QueryRefundResult.class); |
| | | return uniPayResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 关闭订单(仅支持微信和支付宝) |
| | | * @param orderNo 订单号 |
| | | * @return |
| | | */ |
| | | public static CloseOrderResult closeOrder(String orderNo){ |
| | | String url = "https://www.joinpay.com/trade/closeOrder.action"; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded"); |
| | | JSONObject body = new JSONObject(); |
| | | //商户编号 |
| | | body.put("p1_MerchantNo", merchantNo); |
| | | //商户订单号 |
| | | body.put("p2_OrderNo", orderNo); |
| | | //交易类型 |
| | | body.put("p3_FrpCode", FrpCodeEnum.WEIXIN_XCX.getCode()); |
| | | String sign = null; |
| | | try { |
| | | sign = sign(body); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | body.put("hmac", sign); |
| | | post.form(body); |
| | | log.info("关闭订单接口请求参数:" + body); |
| | | HttpResponse execute = post.execute(); |
| | | log.info("关闭订单接口请求响应:" + execute.body()); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("关闭订单接口异常:" + execute.body()); |
| | | return null; |
| | | } |
| | | CloseOrderResult uniPayResult = JSON.parseObject(execute.body(), CloseOrderResult.class); |
| | | return uniPayResult; |
| | | } |
| | | |
| | | |
| | | |
| | | public static String sign(JSONObject body) { |
| | | Set<Map.Entry<String, Object>> entries = body.entrySet(); |
| | | List<Map.Entry<String, Object>> infoIds = new ArrayList<Map.Entry<String, Object>>(entries); |
| | | // 对所有传入参数按照字段名的 ASCII 码从小到大排序(字典序) |
| | | Collections.sort(infoIds, new Comparator<Map.Entry<String, Object>>() { |
| | | public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2) { |
| | | return (o1.getKey()).compareTo(o2.getKey()); |
| | | } |
| | | }); |
| | | // 构造签名键值对的格式 |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (Map.Entry<String, Object> item : infoIds) { |
| | | if (item.getKey() != null || item.getKey() != "") { |
| | | Object val = item.getValue(); |
| | | if (!(val == "" || val == null)) { |
| | | sb.append(val); |
| | | } |
| | | } |
| | | } |
| | | sb.append(key); |
| | | log.info("待签名串:{}", sb.toString()); |
| | | return MD5AndKL.MD5(sb.toString()); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // UniPayResult uniPayResult = PaymentUtil.uniPay("852963742", 0.01D, "测试商品", "这是用于对接支付测试的商品描述", |
| | | // "", "/order/shopping-cart/shoppingCartPaymentCallback", "ooOrs64zHLuInkZ_GF0LpIN9_Rxc", "777168500885852"); |
| | | // PaymentUtil.queryOrder("852963742"); |
| | | // PaymentUtil.closeOrder("852963742"); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class QueryOrderResult { |
| | | /** |
| | | * 版本号 |
| | | */ |
| | | private Double r0_Version; |
| | | /** |
| | | * 商户编号 |
| | | */ |
| | | private String r1_MerchantNo; |
| | | /** |
| | | * 商户订单号 |
| | | */ |
| | | private String r2_OrderNo; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | private Double r3_Amount; |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | private String r4_ProductName; |
| | | /** |
| | | * 交易流水号 |
| | | */ |
| | | private String r5_TrxNo; |
| | | /** |
| | | * 银行流水号 |
| | | */ |
| | | private String r6_BankTrxNo; |
| | | /** |
| | | * 订单手续费 |
| | | */ |
| | | private Double r7_Fee; |
| | | /** |
| | | * 交易类型 |
| | | */ |
| | | private String r8_FrpCode; |
| | | /** |
| | | * 订单状态 100:成功,101:失败,102:已创建,105:订单已关闭 |
| | | */ |
| | | private String ra_Status; |
| | | /** |
| | | * 响应码 |
| | | */ |
| | | private String rb_Code; |
| | | /** |
| | | * 响应码描述 |
| | | */ |
| | | private String rc_CodeMsg; |
| | | /** |
| | | * 用户标识 |
| | | */ |
| | | private String rd_OpenId; |
| | | /** |
| | | * 平台优惠金额 |
| | | */ |
| | | private Double re_DiscountAmount; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | private String rf_PayTime; |
| | | /** |
| | | * 卡类型 |
| | | */ |
| | | private String rh_cardType; |
| | | /** |
| | | * 银行编码 |
| | | */ |
| | | private String rj_BankCode; |
| | | /** |
| | | * 签约 ID |
| | | */ |
| | | private String rl_ContractId; |
| | | /** |
| | | * 签名数据 |
| | | */ |
| | | private String hmac; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class QueryRefundResult { |
| | | /** |
| | | * 版本号 |
| | | */ |
| | | private Double r0_Version; |
| | | /** |
| | | * 商户编号 |
| | | */ |
| | | private String r1_MerchantNo; |
| | | /** |
| | | * 商户退款订单号 |
| | | */ |
| | | private String r2_RefundOrderNo; |
| | | /** |
| | | * 退款金额 |
| | | */ |
| | | private Double r3_RefundAmount; |
| | | /** |
| | | * 退款流水号 |
| | | */ |
| | | private String r4_RefundTrxNo; |
| | | /** |
| | | * 退款完成时间 |
| | | */ |
| | | private String r5_RefundCompleteTime; |
| | | /** |
| | | * 退款渠道 |
| | | */ |
| | | private String r8_RefundWay; |
| | | /** |
| | | * 退款入账账户 |
| | | */ |
| | | private String r9_ReceiveAccountNo; |
| | | /** |
| | | * 退款状态 |
| | | * 100:退款成功 |
| | | * 101:退款失败 |
| | | * 102:退款处理中 |
| | | */ |
| | | private String ra_Status; |
| | | /** |
| | | * 响应码 |
| | | */ |
| | | private String rb_Code; |
| | | /** |
| | | * 响应码描述 |
| | | */ |
| | | private String rc_CodeMsg; |
| | | /** |
| | | * 签名数据 |
| | | */ |
| | | private String hmac; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class RefundCallbackResult { |
| | | /** |
| | | * 版本号 |
| | | */ |
| | | private Double r0_Version; |
| | | /** |
| | | * 商户编号 |
| | | */ |
| | | private String r1_MerchantNo; |
| | | /** |
| | | * 商户订单号 |
| | | */ |
| | | private String r2_OrderNo; |
| | | /** |
| | | * 商户退款订单号 |
| | | */ |
| | | private String r3_RefundOrderNo; |
| | | /** |
| | | * 退款金额 |
| | | */ |
| | | private Double r4_RefundAmount; |
| | | /** |
| | | * 商户退款流水号 |
| | | */ |
| | | private String r5_RefundTrxNo; |
| | | /** |
| | | * 退款完成时间 |
| | | */ |
| | | private String r6_RefundCompleteTime; |
| | | /** |
| | | * 退款渠道 |
| | | */ |
| | | private String r7_RefundWay; |
| | | /** |
| | | * 退款入账账户 |
| | | */ |
| | | private String r8_ReceiveAccountNo; |
| | | /** |
| | | * 退款状态 100:成功;101:失败 |
| | | */ |
| | | private String ra_Status; |
| | | /** |
| | | * 响应码 |
| | | */ |
| | | private String rb_Code; |
| | | /** |
| | | * 响应码描述 |
| | | */ |
| | | private String rc_CodeMsg; |
| | | /** |
| | | * 签名数据 |
| | | */ |
| | | private String hmac; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class RefundResult { |
| | | /** |
| | | * 版本号 |
| | | */ |
| | | private Double r0_Version; |
| | | /** |
| | | * 商户编号 |
| | | */ |
| | | private String r1_MerchantNo; |
| | | /** |
| | | * 商户订单号 |
| | | */ |
| | | private String r2_OrderNo; |
| | | /** |
| | | * 商户退款订单号 |
| | | */ |
| | | private String r3_RefundOrderNo; |
| | | /** |
| | | * 退款金额 |
| | | */ |
| | | private Double r4_RefundAmount; |
| | | /** |
| | | * 商户退款流水号 |
| | | */ |
| | | private String r5_RefundTrxNo; |
| | | /** |
| | | * 退款申请状态 |
| | | * 100:成功, |
| | | * 101:失败 。 |
| | | */ |
| | | private String ra_Status; |
| | | /** |
| | | * 响应码 |
| | | */ |
| | | private String rb_Code; |
| | | /** |
| | | * 响应码描述 |
| | | */ |
| | | private String rc_CodeMsg; |
| | | /** |
| | | * 营销退款金额 |
| | | */ |
| | | private Double rd_MarketRefAmount; |
| | | /** |
| | | * 签名数据 |
| | | */ |
| | | private String hmac; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils.wx; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UniPayResult { |
| | | /** |
| | | * 版本号 |
| | | */ |
| | | private Double r0_Version; |
| | | /** |
| | | * 商户编号 |
| | | */ |
| | | private String r1_MerchantNo; |
| | | /** |
| | | * 商户订单号 |
| | | */ |
| | | private String r2_OrderNo; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | private Double r3_Amount; |
| | | /** |
| | | * 币种 |
| | | */ |
| | | private String r4_Cur; |
| | | /** |
| | | * 公用回传参数 |
| | | */ |
| | | private String r5_Mp; |
| | | /** |
| | | * 交易类型 |
| | | */ |
| | | private String r6_FrpCode; |
| | | /** |
| | | * 交易流水号 |
| | | */ |
| | | private String r7_TrxNo; |
| | | /** |
| | | * 银行商户编码 |
| | | */ |
| | | private String r8_MerchantBankCode; |
| | | /** |
| | | * 响应码,返回 100 时表示成功 |
| | | */ |
| | | private String ra_Code; |
| | | /** |
| | | * 响应码描述 |
| | | */ |
| | | private String rb_CodeMsg; |
| | | /** |
| | | * 1.主扫支付返回二维码地址。 |
| | | * 2.支付宝 H5,mode1/2/3 参考请求参数q9_TransactionModel 说明。 |
| | | * 3.微信 H5_PLUS,获取支付信息的 openlink,通过手机端浏览器跳转并唤起微信 APP客户端,直接打开对应的小程序进行支付。 |
| | | * 3.公众号支付:需要商户参考微信的官方文档 JSAPI 支付接口进行处理,详情请见:https://pay.weixin.qq.com/wiki/doc/api/index.html |
| | | * 4.微信小程序支付返回支付信息。 |
| | | * 5.支付宝收银台返回支付宝收银台跳转链接,通过请求该链接跳转至支付宝。 |
| | | * 6.微信 app3 支付,返回预支付信息,集成微信 SDK 唤起小程序进行支付。 |
| | | * 7.支付宝服务窗支付返回银联交易号 trade_no,可用以唤起支付宝 APP,调起支付宝APP 收银台。 |
| | | * 8.银联 app 或银联统一收银台支付,返回预支付信息用此网址的接口调起支付。https://open.unionpay.com/tjweb/acproduct/list?apiservId=450#nav02 |
| | | * 9.银联云微小程序返回跳转地址,格式:{“cqpMpAppId”:”云闪付小程序 id”,”cqpMpPath”:”云闪付小程序 path”} |
| | | * 10.其他类型支付返回支付信息。 |
| | | */ |
| | | private String rc_Result; |
| | | /** |
| | | * 二维码图片码 |
| | | */ |
| | | private String rd_Pic; |
| | | /** |
| | | * 签名数据 |
| | | */ |
| | | private String hmac; |
| | | } |
| | |
| | | .authorizeHttpRequests((requests) -> { |
| | | permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); |
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问 |
| | | requests.antMatchers("/system/login", "/register", "/captchaImage").permitAll() |
| | | requests.antMatchers("/system/login", "/register", "/captchaImage","/system/order/refundPayMoneyCallback").permitAll() |
| | | // 静态资源,可匿名访问 |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| | | .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | 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.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("tb_buyer_company_info") |
| | | @ApiModel(value = "用户支付前填写信息") |
| | | public class BuyerCompanyInfo { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主键ID") |
| | | private String id; |
| | | |
| | | @TableField("order_id") |
| | | @ApiModelProperty(value = "关联订单ID") |
| | | private String orderId; |
| | | |
| | | @TableField("legal_person_img") |
| | | @ApiModelProperty(value = "法人照片URL") |
| | | private String legalPersonImg; |
| | | |
| | | @TableField("need_rename") |
| | | @ApiModelProperty(value = "是否需要改名(0=不需要,1=需要)") |
| | | private Integer needRename; |
| | | |
| | | @TableField("new_name") |
| | | @ApiModelProperty(value = "新公司名称") |
| | | private String newName; |
| | | |
| | | @TableField("backups_name") |
| | | @ApiModelProperty(value = "备选公司名称") |
| | | private String backupsName; |
| | | |
| | | @TableField("backups_name_one") |
| | | @ApiModelProperty(value = "备选名称1") |
| | | private String backupsNameOne; |
| | | |
| | | @TableField("backups_name_two") |
| | | @ApiModelProperty(value = "备选名称2") |
| | | private String backupsNameTwo; |
| | | |
| | | @TableField("registered_capital") |
| | | @ApiModelProperty(value = "注册资本") |
| | | private String registeredCapital; |
| | | |
| | | @TableField("account_type") |
| | | @ApiModelProperty(value = "账户类型(1=无账户,2=变更,3=新法人注销,4=老法人注销)") |
| | | private Integer accountType; |
| | | |
| | | @TableField("address") |
| | | @ApiModelProperty(value = "公司地址") |
| | | private String address; |
| | | |
| | | @TableField("new_district") |
| | | @ApiModelProperty(value = "是否迁区(0=不需要,1=需要)") |
| | | private Integer newDistrict; |
| | | |
| | | @TableField("tenancy_agreement") |
| | | @ApiModelProperty(value = "租房合同文本/URL") |
| | | private String tenancyAgreement; |
| | | |
| | | @TableField("property_ownership_certificate") |
| | | @ApiModelProperty(value = "房产证文本/URL") |
| | | private String propertyOwnershipCertificate; |
| | | |
| | | @TableField("account") |
| | | @ApiModelProperty(value = "实名认证账户") |
| | | private String account; |
| | | |
| | | @TableField("password") |
| | | @ApiModelProperty(value = "实名认证密码") |
| | | private String password; |
| | | |
| | | @TableField("business_scope") |
| | | @ApiModelProperty(value = "经营范围") |
| | | private String businessScope; |
| | | |
| | | @TableField("remark") |
| | | @ApiModelProperty(value = "备注信息") |
| | | private String remark; |
| | | |
| | | @TableField("create_time") |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField("add_day") |
| | | @ApiModelProperty(value = "新增天数") |
| | | private Integer addDay; |
| | | } |
| | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @TableField("status") |
| | | @ApiModelProperty(value = "状态(1上架 2 下架 3已出售 4锁定中)") |
| | | private Integer status; |
| | | |
| | | @TableField(value = "create_time") |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | @TableField("is_delete") |
| | | @ApiModelProperty(value = "删除标记(0=正常,1=删除)") |
| | | private Integer isDelete; |
| | | |
| | | |
| | | @TableField("scope") |
| | | @ApiModelProperty(value = "经营范围", notes = "企业经营的业务范围描述") |
| | | private String scope; |
| | | |
| | | @TableField("oper_name") |
| | | @ApiModelProperty(value = "法人", notes = "企业法定代表人姓名") |
| | | private String operName; |
| | | |
| | | @TableField("belong_org") |
| | | @ApiModelProperty(value = "登记机关", notes = "企业注册的登记管理机构") |
| | | private String belongOrg; |
| | | |
| | | @TableField("registration_status") |
| | | @ApiModelProperty(value = "登记状态", notes = "企业的工商登记状态") |
| | | private String registrationStatus; |
| | | } |
| | |
| | | @TableField(value = "commission_platform") |
| | | @ApiModelProperty(value = "平台分佣金额") |
| | | private BigDecimal commissionPlatform; |
| | | |
| | | @TableField(value = "finish_time") |
| | | @ApiModelProperty(value = "完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime finishTime; |
| | | |
| | | @TableField(value = "finish_time") |
| | | @ApiModelProperty(value = "完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sellerFinishTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | 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.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("tb_permit") |
| | | @ApiModel(value = "许可证表") |
| | | public class Permit { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主键ID") |
| | | private String id; |
| | | |
| | | @TableField("company_id") |
| | | @ApiModelProperty(value = "公司ID") |
| | | private String companyId; |
| | | |
| | | @TableField("name") |
| | | @ApiModelProperty(value = "许可证名称") |
| | | private String name; |
| | | |
| | | @TableField("level") |
| | | @ApiModelProperty(value = "许可证等级") |
| | | private String level; |
| | | |
| | | @TableField("expire_time") |
| | | @ApiModelProperty(value = "失效时间(格式示例:2025-12-31)") |
| | | private String expireTime; |
| | | |
| | | @TableField(value = "create_time") |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | 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.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("tb_schedule") |
| | | @ApiModel(value = "Schedule对象", description = "进度跟踪表") |
| | | public class Schedule { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主键ID") |
| | | private String id; |
| | | |
| | | @TableField("order_id") |
| | | @ApiModelProperty(value = "关联订单ID") |
| | | private String orderId; |
| | | |
| | | @TableField("text") |
| | | @ApiModelProperty(value = "进度内容详情") |
| | | private String text; |
| | | |
| | | @TableField("img") |
| | | @ApiModelProperty(value = "相关图片URL(多个用逗号分隔)") |
| | | private String img; |
| | | |
| | | @TableField(value = "create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField("parent_id") |
| | | @ApiModelProperty(value = "父级进度ID(卖家回复时关联)",hidden = true) |
| | | private String parentId; |
| | | |
| | | @TableField("user_id") |
| | | @ApiModelProperty(value = "操作人ID") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "买家回复") |
| | | @TableField(exist = false) |
| | | private Schedule schedule; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | 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.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("tb_shareholder") |
| | | @ApiModel(value = "Shareholder对象", description = "股东信息表") |
| | | public class Shareholder { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主键ID") |
| | | private String id; |
| | | |
| | | @TableField("order_id") |
| | | @ApiModelProperty(value = "关联订单ID") |
| | | private String orderId; |
| | | |
| | | @TableField("name") |
| | | @ApiModelProperty(value = "股东姓名") |
| | | private String name; |
| | | |
| | | @TableField("rate") |
| | | @ApiModelProperty(value = "持股比例(示例:30%)") |
| | | private String rate; |
| | | |
| | | @TableField("img") |
| | | @ApiModelProperty(value = "身份证图片URL/Base64") |
| | | private String img; |
| | | |
| | | @TableField(value = "create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.AccountDetail; |
| | | import com.ruoyi.system.domain.BuyerCompanyInfo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface BuyerCompanyInfoMapper extends BaseMapper<BuyerCompanyInfo> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.AccountDetail; |
| | | import com.ruoyi.system.domain.OpeningBank; |
| | | import com.ruoyi.system.pojo.vo.OpeningBankVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface OpeningBankMapper extends BaseMapper<OpeningBank> { |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.system.domain.Agreement; |
| | | import com.ruoyi.system.domain.Order; |
| | | import com.ruoyi.system.pojo.dto.OrderPageDTO; |
| | | import com.ruoyi.system.pojo.vo.OrderDetailVO; |
| | | import com.ruoyi.system.pojo.vo.OrderPageVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Mapper |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | BigDecimal getProcessingCommissionPriceByShareUserId(@Param("id") String id); |
| | | |
| | | IPage<OrderPageVO> getOrderPage(@Param("page")IPage<OrderPageVO> page,@Param("dto") OrderPageDTO dto); |
| | | |
| | | OrderDetailVO getDetailById(@Param("id")String id); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.AccountDetail; |
| | | import com.ruoyi.system.domain.Permit; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface PermitMapper extends BaseMapper<Permit> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.AccountDetail; |
| | | import com.ruoyi.system.domain.Schedule; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface ScheduleMapper extends BaseMapper<Schedule> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.AccountDetail; |
| | | import com.ruoyi.system.domain.Shareholder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface ShareholderMapper extends BaseMapper<Shareholder> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("订单分页DTO") |
| | | public class OrderPageDTO { |
| | | |
| | | @ApiModelProperty("页码") |
| | | private Integer pageNum=0; |
| | | @ApiModelProperty("分页大小") |
| | | private Integer pageSize=10; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "发布用户") |
| | | private String publishName; |
| | | |
| | | @ApiModelProperty(value = "发布用户-联系电话") |
| | | private String publishPhone; |
| | | |
| | | |
| | | @ApiModelProperty(value = "预订用户") |
| | | private String bookName; |
| | | |
| | | @ApiModelProperty(value = "预订用户-联系电话") |
| | | private String bookPhone; |
| | | |
| | | @ApiModelProperty(value = "发布时间-开始") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTimeStart; |
| | | |
| | | @ApiModelProperty(value = "发布时间-结束") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTimeEnd; |
| | | |
| | | @ApiModelProperty(value = "预订时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime bookTimeStart; |
| | | |
| | | @ApiModelProperty(value = "预订时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime bookTimeEnd; |
| | | |
| | | @ApiModelProperty(value = "完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime finishTimeStart; |
| | | |
| | | @ApiModelProperty(value = "完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime finishTimeEnd; |
| | | |
| | | @ApiModelProperty(value = "订单状态: 1-待交易(上架) 2待确认(预订) 3已确认(待支付) 4办理中 5卖家已完成 6买家完成 7-已下架 ") |
| | | private Integer status; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("企业工商信息VO") |
| | | public class BusinessVO { |
| | | |
| | | @ApiModelProperty(value = "法人", notes = "企业法定代表人姓名") |
| | | private String operName; |
| | | |
| | | @ApiModelProperty(value = "登记机关", notes = "企业注册的登记管理机构") |
| | | private String belongOrg; |
| | | |
| | | |
| | | @ApiModelProperty(value = "登记状态", notes = "企业的工商登记状态") |
| | | private String registrationStatus; |
| | | |
| | | @ApiModelProperty(value = "所在地区") |
| | | private String place; |
| | | |
| | | @ApiModelProperty(value = "注册资本") |
| | | private String registeredCapital; |
| | | |
| | | |
| | | @ApiModelProperty(value = "公司类型") |
| | | private String companyCategoryName; |
| | | |
| | | @ApiModelProperty(value = "纳税人类型(1=一般纳税人,2=小规模纳税人,3=税务未登记)") |
| | | private Integer taxpayerType; |
| | | |
| | | @ApiModelProperty(value = "纳税信用等级") |
| | | private String taxCredit; |
| | | |
| | | @ApiModelProperty(value = "公章数") |
| | | private Integer officialSealNum; |
| | | |
| | | @ApiModelProperty(value = "实缴资金") |
| | | private String paidInFunds; |
| | | |
| | | @ApiModelProperty(value = "高新技术企业(0=否,1=是)") |
| | | private Integer highTechEnterpriseTechnology; |
| | | |
| | | @ApiModelProperty(value = "经营范围", notes = "企业经营的业务范围描述") |
| | | private String scope; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("企业变更信息") |
| | | public class ChangeVO { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("企业异常信息VO") |
| | | public class ErrorVO { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("企业发票信息") |
| | | public class InvoiceVO { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("开户行信息VO") |
| | | public class OpeningBankVO { |
| | | |
| | | @ApiModelProperty("开户行名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("开户类型") |
| | | private String category; |
| | | |
| | | @ApiModelProperty("有无外币(0=无,1=有)") |
| | | private Integer haveForeignCurrency; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.system.domain.OpeningBank; |
| | | import com.ruoyi.system.domain.Schedule; |
| | | import com.ruoyi.system.domain.Shareholder; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("订单详情VO") |
| | | public class OrderDetailVO { |
| | | @ApiModelProperty(value = "公司主键ID") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "订单状态:1-待交易 2待确认(预订) 3已确认(待支付) 4办理中 5-已完成 6-已下架 ") |
| | | private Integer status; |
| | | |
| | | |
| | | //不用显示给前端 |
| | | @ApiModelProperty(value = "订单主键",hidden = true) |
| | | private String orderId; |
| | | /** |
| | | * 基础信息 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "公司名称") |
| | | private String companyName; |
| | | |
| | | @ApiModelProperty(value = "成立时间") |
| | | private String establishTime; |
| | | |
| | | @ApiModelProperty(value = "所在地区") |
| | | private String place; |
| | | |
| | | @ApiModelProperty(value = "注册资本") |
| | | private String registeredCapital; |
| | | |
| | | @ApiModelProperty(value = "公司类型") |
| | | private String companyCategoryName; |
| | | |
| | | @ApiModelProperty(value = "所属行业") |
| | | private String industryName; |
| | | |
| | | @ApiModelProperty(value = "纳税人类型(1=一般纳税人,2=小规模纳税人,3=税务未登记)") |
| | | private Integer taxpayerType; |
| | | |
| | | @ApiModelProperty(value = "纳税信用等级") |
| | | private String taxCredit; |
| | | |
| | | @ApiModelProperty(value = "公章数") |
| | | private Integer officialSealNum; |
| | | |
| | | @ApiModelProperty(value = "实缴资金") |
| | | private String paidInFunds; |
| | | |
| | | @ApiModelProperty(value = "高新技术企业(0=否,1=是)") |
| | | private Integer highTechEnterpriseTechnology; |
| | | |
| | | @ApiModelProperty(value = "法人", notes = "企业法定代表人姓名") |
| | | private String operName; |
| | | |
| | | @ApiModelProperty(value = "经营范围", notes = "企业经营的业务范围描述") |
| | | private String scope; |
| | | |
| | | @ApiModelProperty("许可证集合") |
| | | List<PermitVO> permitVOList; |
| | | |
| | | @ApiModelProperty("开户行信息集合") |
| | | List<OpeningBankVO> openingBankVOList; |
| | | |
| | | @ApiModelProperty(value = "开票额度") |
| | | private String invoiceLimit; |
| | | |
| | | @ApiModelProperty(value = "社保缴纳(0=无,1=有)") |
| | | private Integer socialSecurity; |
| | | |
| | | @ApiModelProperty(value = "招投标(0=无,1=有)") |
| | | private Integer tendering; |
| | | |
| | | @ApiModelProperty(value = "商标(0=无,1=有)") |
| | | private Integer haveTrademark; |
| | | |
| | | @ApiModelProperty(value = "专利(0=无,1=有)") |
| | | private Integer havePatent; |
| | | |
| | | @ApiModelProperty(value = "软著(0=无,1=有)") |
| | | private Integer haveSoftWorks; |
| | | |
| | | @ApiModelProperty(value = "是否需要改名(0=不需要,1=需要)") |
| | | private Integer needRename; |
| | | |
| | | @ApiModelProperty(value = "是否迁区(0=不需要,1=需要)") |
| | | private Integer newDistrict; |
| | | |
| | | /** |
| | | * 交易信息 |
| | | */ |
| | | @ApiModelProperty(value = "发布用户") |
| | | private String publishName; |
| | | |
| | | @ApiModelProperty(value = "发布用户-联系电话") |
| | | private String publishPhone; |
| | | |
| | | @ApiModelProperty(value = "发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "预计完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime estimateTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "预订用户") |
| | | private String bookName; |
| | | |
| | | @ApiModelProperty(value = "预订用户-联系电话") |
| | | private String bookPhone; |
| | | |
| | | @ApiModelProperty(value = "预订时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime bookTime; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime payTime; |
| | | |
| | | @ApiModelProperty(value = "卖家确认时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime confirmTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "卖家完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sellerFinishTime; |
| | | |
| | | @ApiModelProperty(value = "完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime finishTime; |
| | | |
| | | /** |
| | | * 客户信息 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "法人照片URL") |
| | | private String legalPersonImg; |
| | | |
| | | |
| | | @ApiModelProperty(value = "新公司名称") |
| | | private String newName; |
| | | |
| | | @TableField("backups_name") |
| | | @ApiModelProperty(value = "备选公司名称") |
| | | private String backupsName; |
| | | |
| | | @TableField("backups_name_one") |
| | | @ApiModelProperty(value = "备选名称1") |
| | | private String backupsNameOne; |
| | | |
| | | @TableField("backups_name_two") |
| | | @ApiModelProperty(value = "备选名称2") |
| | | private String backupsNameTwo; |
| | | |
| | | |
| | | @ApiModelProperty(value = "注册资本") |
| | | private String newRegisteredCapital; |
| | | |
| | | @ApiModelProperty(value = "账户类型(1=无账户,2=变更,3=新法人注销,4=老法人注销)") |
| | | private Integer accountType; |
| | | |
| | | @TableField("address") |
| | | @ApiModelProperty(value = "公司地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "实名认证账户") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "实名认证密码") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "租房合同文本/URL") |
| | | private String tenancyAgreement; |
| | | |
| | | @ApiModelProperty(value = "房产证文本/URL") |
| | | private String propertyOwnershipCertificate; |
| | | |
| | | @TableField("business_scope") |
| | | @ApiModelProperty(value = "经营范围") |
| | | private String businessScope; |
| | | |
| | | /** |
| | | * 股东占比 |
| | | */ |
| | | @ApiModelProperty(value = "股东占比") |
| | | List<Shareholder> shareholderList; |
| | | |
| | | /** |
| | | * 进度汇报 |
| | | */ |
| | | List<Schedule> scheduleList; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("订单分页VO") |
| | | public class OrderPageVO { |
| | | @ApiModelProperty(value = "公司主键ID") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "发布用户") |
| | | private String publishName; |
| | | |
| | | @ApiModelProperty(value = "发布用户-联系电话") |
| | | private String publishPhone; |
| | | |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private BigDecimal price; |
| | | |
| | | |
| | | @ApiModelProperty(value = "预订用户") |
| | | private String bookName; |
| | | |
| | | @ApiModelProperty(value = "预订用户-联系电话") |
| | | private String bookPhone; |
| | | |
| | | @ApiModelProperty(value = "发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "预订时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime bookTime; |
| | | |
| | | @ApiModelProperty(value = "订单状态:1-待交易 2待确认(预订) 3已确认(待支付) 4办理中 5-已完成 6-已下架 ") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime finishTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("许可证VO") |
| | | public class PermitVO { |
| | | |
| | | @TableField("name") |
| | | @ApiModelProperty(value = "许可证名称") |
| | | private String name; |
| | | |
| | | @TableField("level") |
| | | @ApiModelProperty(value = "许可证等级") |
| | | private String level; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.pojo.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("企业纳税信息") |
| | | public class TaxVO { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.wx.RefundCallbackResult; |
| | | import com.ruoyi.system.domain.Agreement; |
| | | import com.ruoyi.system.domain.Order; |
| | | import com.ruoyi.system.pojo.dto.AddAgreementDTO; |
| | | import com.ruoyi.system.pojo.dto.OrderPageDTO; |
| | | import com.ruoyi.system.pojo.vo.*; |
| | | |
| | | |
| | | public interface OrderService extends IService<Order> { |
| | | |
| | | IPage<OrderPageVO> getOrderPage(OrderPageDTO dto); |
| | | |
| | | OrderDetailVO detail(String id); |
| | | |
| | | BusinessVO business(String id); |
| | | |
| | | ErrorVO error(String id); |
| | | |
| | | ChangeVO change(String id); |
| | | |
| | | TaxVO tax(String id); |
| | | |
| | | InvoiceVO invoice(String id); |
| | | |
| | | void delete(String id); |
| | | |
| | | void shelves(String id); |
| | | |
| | | void cancel(String id); |
| | | |
| | | R refundPayMoneyCallback(RefundCallbackResult refundCallbackResult); |
| | | } |
| | |
| | | user.setUpdateTime(LocalDateTime.now()); |
| | | user.setUpdateBy(getLoginUser().getUserId()); |
| | | this.baseMapper.updateById(user); |
| | | //todo 是否需要加消息 |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.wx.PaymentUtil; |
| | | import com.ruoyi.common.utils.wx.RefundCallbackResult; |
| | | import com.ruoyi.common.utils.wx.RefundResult; |
| | | import com.ruoyi.system.domain.*; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.pojo.dto.AddAgreementDTO; |
| | | import com.ruoyi.system.pojo.dto.OrderPageDTO; |
| | | import com.ruoyi.system.pojo.vo.*; |
| | | import com.ruoyi.system.service.AgreementService; |
| | | import com.ruoyi.system.service.OrderService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { |
| | | |
| | | @Resource |
| | | private PermitMapper permitMapper; |
| | | |
| | | @Resource |
| | | private OpeningBankMapper openingBankMapper; |
| | | @Resource |
| | | private BuyerCompanyInfoMapper buyerCompanyInfoMapper; |
| | | @Resource |
| | | private ShareholderMapper shareholderMapper; |
| | | @Resource |
| | | private ScheduleMapper scheduleMapper; |
| | | @Resource |
| | | private CompanyMapper companyMapper; |
| | | |
| | | @Override |
| | | public IPage<OrderPageVO> getOrderPage(OrderPageDTO dto) { |
| | | IPage<OrderPageVO> page = new Page<>(dto.getPageNum(), dto.getPageSize()); |
| | | return this.baseMapper.getOrderPage(page,dto); |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetailVO detail(String id) { |
| | | OrderDetailVO vo = this.baseMapper.getDetailById(id); |
| | | if (null == vo) { |
| | | throw new ServiceException("该公司不存在"); |
| | | } |
| | | //许可证集合 |
| | | List<Permit> permits = permitMapper.selectList(new LambdaQueryWrapper<Permit>().eq(Permit::getCompanyId, id)); |
| | | List<PermitVO> permitVOs = new ArrayList<>(); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | for (Permit permit : permits) { |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | LocalDateTime expireTime = LocalDateTime.parse(permit.getExpireTime(), formatter); |
| | | if (now.isAfter(expireTime)) { |
| | | //过滤 未过期的 |
| | | PermitVO permitVO = new PermitVO(); |
| | | permitVO.setName(permit.getName()); |
| | | permitVO.setLevel(permit.getLevel()); |
| | | permitVOs.add(permitVO); |
| | | } |
| | | } |
| | | vo.setPermitVOList(permitVOs); |
| | | //开户行信息集合 |
| | | List<OpeningBank> openingBanks = openingBankMapper.selectList(new LambdaQueryWrapper<OpeningBank>().eq(OpeningBank::getCompanyId, id)); |
| | | List<OpeningBankVO> openingBankVOs = new ArrayList<>(); |
| | | for (OpeningBank openingBank : openingBanks) { |
| | | OpeningBankVO openingBankVO = new OpeningBankVO(); |
| | | BeanUtils.copyProperties(openingBank, openingBankVO); |
| | | openingBankVOs.add(openingBankVO); |
| | | } |
| | | vo.setOpeningBankVOList(openingBankVOs); |
| | | |
| | | if (vo.getStatus() != 4 && vo.getStatus() != 5) { |
| | | return vo; |
| | | } |
| | | |
| | | //状态为办理中和已完成 |
| | | //客户信息 |
| | | BuyerCompanyInfo buyerCompanyInfo = buyerCompanyInfoMapper.selectOne(new LambdaQueryWrapper<BuyerCompanyInfo>().eq(BuyerCompanyInfo::getOrderId, vo.getOrderId())); |
| | | copyProperties(vo,buyerCompanyInfo); |
| | | //股东占比 |
| | | List<Shareholder> shareholders = shareholderMapper.selectList(new LambdaQueryWrapper<Shareholder>().eq(Shareholder::getOrderId, vo.getOrderId())); |
| | | vo.setShareholderList(shareholders); |
| | | //进度汇报 |
| | | List<Schedule> schedules = scheduleMapper.selectList(new LambdaQueryWrapper<Schedule>().eq(Schedule::getOrderId, vo.getOrderId())); |
| | | //构建进度汇报结构 |
| | | List<Schedule> scheduleVOList = new ArrayList<>(); |
| | | for (Schedule schedule : schedules) { |
| | | if (schedule.getParentId() == null) { |
| | | scheduleVOList.add(schedule); |
| | | }else { |
| | | //查找到父类的集合 |
| | | for (Schedule schedule1 : scheduleVOList) { |
| | | if (schedule1.getId().equals(schedule.getParentId())) { |
| | | schedule1.setSchedule(schedule); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | vo.setScheduleList(scheduleVOList); |
| | | return vo; |
| | | } |
| | | |
| | | private static void copyProperties(OrderDetailVO vo,BuyerCompanyInfo info){ |
| | | vo.setLegalPersonImg(info.getLegalPersonImg()); |
| | | vo.setNewName(info.getNewName()); |
| | | vo.setBackupsName(info.getBackupsName()); |
| | | vo.setBackupsNameOne(info.getBackupsNameOne()); |
| | | vo.setBackupsNameTwo(info.getBackupsNameTwo()); |
| | | vo.setNewRegisteredCapital(info.getRegisteredCapital()); |
| | | vo.setAccount(info.getAccount()); |
| | | vo.setAddress(info.getAddress()); |
| | | vo.setPassword(info.getPassword()); |
| | | vo.setTenancyAgreement(info.getTenancyAgreement()); |
| | | vo.setPropertyOwnershipCertificate(info.getPropertyOwnershipCertificate()); |
| | | vo.setBusinessScope(info.getBusinessScope()); |
| | | } |
| | | |
| | | @Override |
| | | public BusinessVO business(String id) { |
| | | Company company = companyMapper.selectById(id); |
| | | if (null == company || company.getIsDelete() != 0) { |
| | | throw new ServiceException("公司不存在"); |
| | | } |
| | | BusinessVO vo = new BusinessVO(); |
| | | BeanUtils.copyProperties(company, vo); |
| | | vo.setPlace(company.getCity()+company.getProvince()+company.getArea()); |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public ErrorVO error(String id) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ChangeVO change(String id) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public TaxVO tax(String id) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public InvoiceVO invoice(String id) { |
| | | return null; |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void delete(String id) { |
| | | Company company = companyMapper.selectById(id); |
| | | if (null == company || company.getIsDelete() != 0) { |
| | | throw new ServiceException("公司不存在"); |
| | | } |
| | | if (company.getStatus().equals(3)){//已完成 |
| | | throw new ServiceException("状态错误,已完成订单不能删除"); |
| | | } |
| | | |
| | | if (company.getStatus().equals(4)){//锁定中 |
| | | //查看订单状态是否为待确认 |
| | | Order order = this.baseMapper.selectOne(new LambdaQueryWrapper<Order>() |
| | | .eq(Order::getCompanyId, company.getId()) |
| | | .ne(Order::getStatus,-1));//取消的订单不要 |
| | | if (null == order) { |
| | | throw new ServiceException("订单不存在"); |
| | | } |
| | | if (!order.getStatus().equals(2)) {//不在待确认状态的 |
| | | throw new ServiceException("状态错误,不能删除"); |
| | | } |
| | | //删除订单 |
| | | this.baseMapper.deleteById(order.getId()); |
| | | } |
| | | //删除公司 |
| | | company.setIsDelete(1); |
| | | companyMapper.updateById(company); |
| | | } |
| | | |
| | | /** |
| | | * 上下架 |
| | | */ |
| | | @Override |
| | | public void shelves(String id) { |
| | | Company company = companyMapper.selectById(id); |
| | | if (null == company || company.getIsDelete() != 0) { |
| | | throw new ServiceException("公司不存在"); |
| | | } |
| | | if (company.getStatus().equals(3)){//已完成 |
| | | throw new ServiceException("状态错误,已完成订单不能修改"); |
| | | } |
| | | |
| | | if (company.getStatus().equals(4)){//锁定中 |
| | | //查看订单状态是否为待确认 |
| | | Order order = this.baseMapper.selectOne(new LambdaQueryWrapper<Order>() |
| | | .eq(Order::getCompanyId, company.getId()) |
| | | .ne(Order::getStatus,-1)//取消的不要 |
| | | ); |
| | | if (null == order) { |
| | | throw new ServiceException("订单不存在"); |
| | | } |
| | | if (!order.getStatus().equals(2)) {//不在待确认状态的 |
| | | throw new ServiceException("状态错误,不能修改"); |
| | | } |
| | | //删除订单 |
| | | this.baseMapper.deleteById(order.getId()); |
| | | } |
| | | //上下架 |
| | | if (company.getStatus().equals(1)||company.getStatus().equals(4)){//1-上架中 4-锁定中(待确认) |
| | | company.setStatus(2);//2-下架中 |
| | | }else if (company.getStatus().equals(2)){ |
| | | company.setStatus(1); |
| | | } |
| | | companyMapper.updateById(company); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void cancel(String id) { |
| | | Company company = companyMapper.selectById(id); |
| | | if (null == company || company.getIsDelete() != 0) { |
| | | throw new ServiceException("公司不存在"); |
| | | } |
| | | if (!company.getStatus().equals(4)){// 4-锁定中 |
| | | throw new ServiceException("订单状态错误,不能操作"); |
| | | } |
| | | //查看订单 取消的不要 |
| | | Order order = this.baseMapper.selectOne(new LambdaQueryWrapper<Order>() |
| | | .eq(Order::getCompanyId, company.getId()) |
| | | .ne(Order::getStatus,-1)); |
| | | if (null == order) { |
| | | throw new ServiceException("订单不存在"); |
| | | } |
| | | //检查状态 3已确认(未付款) 4办理中 5卖家已完成 |
| | | if (!order.getStatus().equals(3)||!order.getStatus().equals(4)||!order.getStatus().equals(5)) { |
| | | throw new ServiceException("订单状态错误,不能操作"); |
| | | } |
| | | if (company.getStatus().equals(3)){ |
| | | //未付款 直接取消订单 |
| | | order.setStatus(-1); |
| | | this.baseMapper.updateById(order); |
| | | }else{ |
| | | //退款 |
| | | order.setStatus(-1); |
| | | R r = refundPayMoney(order);//退款 |
| | | if (200 == r.getCode()) { |
| | | this.updateById(order); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R refundPayMoneyCallback(RefundCallbackResult refundCallbackResult) { |
| | | String code = refundCallbackResult.getR3_RefundOrderNo().substring(1); |
| | | log.info("退款回调:{}",code); |
| | | Order order = this.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, code)); |
| | | if (null == order || order.getStatus() == -1) { |
| | | return R.ok(); |
| | | } |
| | | order.setStatus(-1); |
| | | this.updateById(order); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 返回订单支付金额 |
| | | */ |
| | | public R refundPayMoney(Order order) { |
| | | //开始退款 |
| | | BigDecimal paymentAmount = order.getPrice(); |
| | | if (BigDecimal.ZERO.compareTo(order.getPrice()) < 0) {//支付的金额是否大于0 |
| | | //微信退款 |
| | | RefundResult refund = PaymentUtil.refund(order.getOrderNo(), "R" + order.getOrderNo(), paymentAmount.doubleValue(), |
| | | "/system/order/refundPayMoneyCallback"); |
| | | if (!"100".equals(refund.getRa_Status())) { |
| | | return R.fail(refund.getRc_CodeMsg());//退款失败 |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
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.BuyerCompanyInfoMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | LEFT JOIN |
| | | tb_order tbo |
| | | ON c.id = tbo.company_id |
| | | AND tbo.status IN (4, 5) -- 仅关联状态为4或5的订单 |
| | | AND tbo.status IN (4, 5) -- 仅关联状态为4或5的订单 办理中的订单 |
| | | LEFT JOIN |
| | | tb_buyer_company_info tinfo |
| | | ON tbo.id = tinfo.order_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.OpeningBankMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <select id="getProcessingCommissionPriceByShareUserId" resultType="java.math.BigDecimal"> |
| | | select COALESCE(SUM(commission_price), 0.00) AS total_commission from tb_order where status in (4,5) and share_user_id =#{id} |
| | | </select> |
| | | <select id="getOrderPage" resultType="com.ruoyi.system.pojo.vo.OrderPageVO"> |
| | | select |
| | | c.id, |
| | | o.order_no, |
| | | publish.user_name as publishName, |
| | | publish.phone as publishPhone, |
| | | o.price, |
| | | book.user_name as bookName, |
| | | book.phone as bookPhone, |
| | | c.create_time as createTime, |
| | | o.create_time as bookTime, |
| | | o.finish_time as finishTime, |
| | | -- 状态映射逻辑 |
| | | CASE |
| | | WHEN c.status = 1 THEN 1 |
| | | WHEN c.status = 2 THEN 6 |
| | | WHEN c.status = 3 THEN 5 |
| | | WHEN c.status = 4 THEN |
| | | CASE |
| | | WHEN o.status = 2 THEN 2 |
| | | WHEN o.status = 3 THEN 3 |
| | | WHEN o.status IN (4, 5) THEN 4 |
| | | ELSE c.status -- 默认保持原状态(可根据需求调整) |
| | | END |
| | | ELSE c.status -- 其他状态保持不变 |
| | | END AS status |
| | | from |
| | | tb_company c |
| | | left join tb_order o on c.id = o.company_id and o.status != -1 |
| | | left join (select id,user_name,phone from tb_user group by id) publish on c.user_id = publish.id |
| | | left join (select id,user_name,phone from tb_user group by id) book on o.user_id = book.id |
| | | where |
| | | c.is_delete=0 |
| | | |
| | | <if test="null != dto.orderNo"> |
| | | and o.order_no like concat('%',#{dto.orderNo},'%') |
| | | </if> |
| | | <if test="null != dto.publishName and '' != dto.publishName"> |
| | | and publish.user_name like concat('%',#{dto.publishName},'%') |
| | | </if> |
| | | <if test="null != dto.publishPhone and '' != dto.publishPhone"> |
| | | and publish.phone like concat('%',#{dto.publishPhone},'%') |
| | | </if> |
| | | |
| | | <if test="null != dto.bookName and '' != dto.bookName"> |
| | | and book.user_name like concat('%',#{dto.bookName},'%') |
| | | </if> |
| | | <if test="null != dto.bookPhone and '' != dto.bookPhone"> |
| | | and book.phone like concat('%',#{dto.bookPhone},'%') |
| | | </if> |
| | | |
| | | <if test="null != dto.createTimeStart and null != dto.createTimeEnd"> |
| | | and c.create_time between #{dto.createTimeStart} and #{dto.createTimeEnd} |
| | | </if> |
| | | |
| | | <if test="null != dto.bookTimeStart and null != dto.bookTimeEnd"> |
| | | and o.create_time between #{dto.bookTimeStart} and #{dto.bookTimeEnd} |
| | | </if> |
| | | |
| | | <if test="null != dto.finishTimeStart and null != dto.finishTimeEnd"> |
| | | and o.finish_time between #{dto.finishTimeStart} and #{dto.finishTimeEnd} |
| | | </if> |
| | | |
| | | <if test="null != dto.status"> |
| | | AND ( |
| | | <!-- 直接匹配原始状态 --> |
| | | (c.status IN (1,2,3) AND |
| | | CASE |
| | | WHEN c.status = 1 THEN 1 |
| | | WHEN c.status = 2 THEN 6 |
| | | WHEN c.status = 3 THEN 5 |
| | | ELSE c.status |
| | | END = #{dto.status}) |
| | | <!-- 匹配映射后的状态4(c.status=4且o.status=4/5) --> |
| | | OR (c.status = 4 AND o.status IN (4,5) AND 4 = #{dto.status}) |
| | | <!-- 匹配映射后的状态2(c.status=4且o.status=2) --> |
| | | OR (c.status = 4 AND o.status = 2 AND 2 = #{dto.status}) |
| | | <!-- 匹配映射后的状态3(c.status=4且o.status=3) --> |
| | | OR (c.status = 4 AND o.status = 3 AND 3 = #{dto.status}) |
| | | ) |
| | | </if> |
| | | </select> |
| | | <select id="getDetailById" resultType="com.ruoyi.system.pojo.vo.OrderDetailVO"> |
| | | |
| | | select |
| | | c.id, |
| | | -- 状态映射逻辑 |
| | | CASE |
| | | WHEN c.status = 1 THEN 1 |
| | | WHEN c.status = 2 THEN 6 |
| | | WHEN c.status = 3 THEN 5 |
| | | WHEN c.status = 4 THEN |
| | | CASE |
| | | WHEN o.status = 2 THEN 2 |
| | | WHEN o.status = 3 THEN 3 |
| | | WHEN o.status IN (4, 5) THEN 4 |
| | | ELSE c.status -- 默认保持原状态(可根据需求调整) |
| | | END |
| | | ELSE c.status -- 其他状态保持不变 |
| | | END AS status, |
| | | o.id as orderId, |
| | | c.company_name, |
| | | c.establish_time, |
| | | concat(c.city,c.province,c.area) as place, |
| | | c.registered_capital, |
| | | ct.name as companyCategoryName, |
| | | industry.name as industryName, |
| | | c.taxpayer_type, |
| | | c.tax_credit, |
| | | c.official_seal_num, |
| | | c.paid_in_funds, |
| | | c.oper_name, |
| | | c.scope, |
| | | c.invoice_limit, |
| | | c.social_security, |
| | | c.tendering, |
| | | c.have_trademark, |
| | | c.have_patent, |
| | | c.have_soft_works, |
| | | info.need_rename, |
| | | info.new_district, |
| | | publish.user_name as publishName, |
| | | publish.phone as publishPhone, |
| | | c.create_time as createTime, |
| | | book.user_name as bookName, |
| | | book.phone as bookPhone, |
| | | o.create_time as bookTime, |
| | | o.price as price, |
| | | o.pay_time as payTime, |
| | | o.confirm_time, |
| | | o.seller_finish_time, |
| | | o.finish_time, |
| | | -- 计算预计完成时间 |
| | | CASE |
| | | WHEN |
| | | ( |
| | | CASE |
| | | WHEN c.status = 1 THEN 1 |
| | | WHEN c.status = 2 THEN 6 |
| | | WHEN c.status = 3 THEN 5 |
| | | WHEN c.status = 4 THEN |
| | | CASE |
| | | WHEN o.status = 2 THEN 2 |
| | | WHEN o.status = 3 THEN 3 |
| | | WHEN o.status IN (4, 5) THEN 4 |
| | | ELSE c.status |
| | | END |
| | | ELSE c.status |
| | | END |
| | | ) IN (3, 4, 5) |
| | | THEN |
| | | DATE_ADD(o.pay_time, INTERVAL (c.estimated_days+info.add_day) DAY) |
| | | ELSE NULL |
| | | END AS estimateTime |
| | | from tb_company c |
| | | left join tb_company_type ct on c.company_category = ct.id |
| | | left join tb_industry industry on c.company_industry_id = industry.id |
| | | left join tb_order o on c.id= o.company_id and o.status != -1 |
| | | left join tb_buyer_company_info info on o.id = info.order_id |
| | | left join tb_user publish on c.user_id = publish.id |
| | | left join tb_user book on o.user_id = book.id |
| | | where |
| | | c.is_delete=0 |
| | | and |
| | | c.id=#{id} |
| | | |
| | | |
| | | </select> |
| | | </mapper> |
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.PermitMapper"> |
| | | |
| | | |
| | | </mapper> |
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.ScheduleMapper"> |
| | | |
| | | |
| | | </mapper> |
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.ShareholderMapper"> |
| | | |
| | | |
| | | </mapper> |