已添加16个文件
已删除45个文件
已修改23个文件
已重命名1个文件
| | |
| | | ## diandongche |
| | | |
| | | çµå¨è½¦é¡¹ç® |
| | | å¿é¦ç¹å°ç³»ç» |
| | | |
| | |
| | | VUE_APP_ROUTER_MODE = 'hash' |
| | | ddd |
| | | # æ¥å£åç¼ |
| | | VUE_APP_API_PREFIX = '/dianjiang_admin_api' |
| | | VUE_APP_API_PREFIX = '/diandongche_admin_api' |
| | |
| | | |
| | | # å
³éDEBUG |
| | | VUE_APP_DEBUG = 'off' |
| | | VUE_APP_CONTEXT_PATH = '/dianjiang_admin' |
| | | VUE_APP_API_URL = 'https://jinkuai.832smartfarm.com/jinkuai_admin' |
| | | VUE_APP_CONTEXT_PATH = '/diandongche_admin' |
| | | VUE_APP_API_URL = ' ' |
| | |
| | | # å¼åç¯å¢é
ç½® |
| | | NODE_ENV = 'development' |
| | | |
| | | VUE_APP_CONTEXT_PATH = '/dianjiang_admin' |
| | | VUE_APP_API_URL = 'http://192.168.0.7:10010/dianjiang_admin_interface' |
| | | VUE_APP_CONTEXT_PATH = '/diandongche_admin' |
| | | VUE_APP_API_URL = 'http://192.168.0.7:10010/diandongche_admin_api' |
| | |
| | | { |
| | | "name": "zbom_dianjiang", |
| | | "name": "diandongche", |
| | | "version": "1.0.0", |
| | | "private": true, |
| | | "scripts": { |
| | |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
| | | <link rel="icon" href="<%= BASE_URL %>favicon.ico"> |
| | | <title>å¿é¦ç¹å°åå°ç®¡çç³»ç»</title> |
| | | <title>è±ç±³çµå¨è½¦åå°ç®¡çç³»ç»</title> |
| | | </head> |
| | | <body> |
| | | <div id="app"></div> |
| | |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç¼ç " prop="detail" v-if="form.type ==0" > |
| | | <el-form-item label="ç¼ç " prop="detail" v-if="form.type ==3" > |
| | | <el-input v-model="form.detail" placeholder="请è¾å
¥æåºç¼ç " v-trim/> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.type == 3" label="徿 " prop="icon"> |
| | | <el-form-item v-if="form.type == 0" label="徿 " prop="icon"> |
| | | <UploadAvatarImage |
| | | :file="{ imgurlfull: form.iconFull, imgurl: form.icon }" |
| | | :uploadData="uploadData" |
| | |
| | | <div class="menu" :class="{collapse: menuData.collapse}"> |
| | | <div class="logo"> |
| | | <div><img src="@/assets/logo.png"></div> |
| | | <h1 :class="{hidden: menuData.collapse}">å¿é¦ç¹å°åå°ç®¡çç³»ç»</h1> |
| | | <h1 :class="{hidden: menuData.collapse}">è±ç±³çµå¨è½¦åå°ç®¡çç³»ç»</h1> |
| | | </div> |
| | | <scrollbar> |
| | | <el-menu |
| | |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('æ°å»ºæåº',null,searchForm.type)" icon="el-icon-plus" v-permissions="['business:category:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('æ°å»ºåç',null,searchForm.type)" icon="el-icon-plus" v-permissions="['business:category:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" icon="el-icon-refresh" v-permissions="['business:category:create']">忥</el-button></li> |
| | | <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button></li> |
| | | </ul> |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="name" label="æåºåç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="detail" label="æåºç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="åçåç§°" min-width="100px"></el-table-column> |
| | | <!-- <el-table-column prop="icon" label="徿 " min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-image v-if="row.iconFull" style="width: 50px; height: 50px; margin-right: 10px" :src="row.iconFull" |
| | | :preview-src-list="[row.iconFull]"> |
| | | </el-image> |
| | | </template> |
| | | </el-table-column>--> |
| | | <el-table-column prop="detail" label="åçç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column label="ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" |
| | |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCategoryWindow.open('ç¼è¾æåº', row,searchForm.type)" icon="el-icon-edit" v-permissions="['business:category:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="$refs.operaCategoryWindow.open('ç¼è¾åç', row,searchForm.type)" icon="el-icon-edit" v-permissions="['business:category:update']">ç¼è¾</el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <div class="home_header"> |
| | | <div class="mb10 fs17">ä¸å好ï¼{{ userInfo.realname }}</div> |
| | | <div class="fs13"> |
| | | ä»å¤©æ¯ {{ nowDate }} {{ nowWeek }}ï¼æ¬¢è¿è®¿é®å¿é¦ç¹å°åå°ç®¡çç³»ç» |
| | | ä»å¤©æ¯ {{ nowDate }} {{ nowWeek }}ï¼æ¬¢è¿è®¿é®è±ç±³çµå¨è½¦åå°ç®¡çç³»ç» |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <template> |
| | | <div class="wrap"> |
| | | <div class="introduce"> |
| | | <h2>å¿é¦ç¹å°åå°ç®¡çç³»ç»</h2> |
| | | <h2>è±ç±³çµå¨è½¦åå°ç®¡çç³»ç»</h2> |
| | | <h3></h3> |
| | | </div> |
| | | <div class="login"> |
| | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.doumee</groupId> |
| | | <artifactId>dianjiang</artifactId> |
| | | <artifactId>diandongche</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | </parent> |
| | | <artifactId>admin</artifactId> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.service.business.OrdersService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | /** |
| | | * 订åè®°å½è¡¨ä¿¡æ¯è¡¨Controllerå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-02-02 11:10:42 |
| | | */ |
| | | @Api(tags = "订åä¿¡æ¯æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/business/orders") |
| | | public class OrdersController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrdersService ordersService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:orders:create") |
| | | public ApiResponse create(@RequestBody Orders orders) { |
| | | return ApiResponse.success(ordersService.create(orders)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:orders:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | ordersService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:orders:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | ordersService.deleteByIdInBatch(this.getIdList(ids)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:orders:update") |
| | | public ApiResponse updateById(@RequestBody Orders orders) { |
| | | ordersService.updateById(orders); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:orders:query") |
| | | public ApiResponse<PageData<Orders>> findPage (@RequestBody PageWrap<Orders> pageWrap) { |
| | | return ApiResponse.success(ordersService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:orders:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Orders> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Orders.class).export(ordersService.findPage(pageWrap).getRecords(), "订åè®°å½è¡¨ä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:orders:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(ordersService.findById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.dto.PayOrderResponse; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.service.business.OrdersService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.mvc.support.RedirectAttributes; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 订åè®°å½è¡¨ä¿¡æ¯è¡¨Controllerå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-02-02 11:10:42 |
| | | */ |
| | | @Api(tags = "订åä¿¡æ¯æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/web/orders") |
| | | public class WebController extends BaseController { |
| | | @Autowired |
| | | private OrdersService ordersService; |
| | | @ApiOperation("è®¢åæ°å»º") |
| | | @PostMapping("/create") |
| | | public ApiResponse<PayOrderResponse> createOrder(@RequestBody Orders orders, RedirectAttributes redirectAttributes) { |
| | | PayOrderResponse result = ordersService.createPay(orders); |
| | | return ApiResponse.success(result); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("detail") |
| | | public ApiResponse findById(@RequestParam Integer id) { |
| | | return ApiResponse.success(ordersService.findById(id)); |
| | | } |
| | | } |
| | |
| | | package com.doumee.init; |
| | | |
| | | import com.doumee.service.business.ImportRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | public class InitService { |
| | | |
| | | @Autowired |
| | | private ImportRecordService importRecordService; |
| | | @PostConstruct |
| | | public void initImportTaskStatus() { |
| | | importRecordService.clearImporTask(); |
| | | } |
| | | } |
| | |
| | | port: 11010 |
| | | # 项ç®ä¿¡æ¯é
ç½® |
| | | project: |
| | | name: å¿é¦-ç¹å° |
| | | name: è±ç±³çµå¨è½¦ |
| | | version: 1.0.0 |
| | | # ç¯å¢ï¼ç产ç¯å¢productionï¼å¼åç¯å¢development |
| | | env: production |
| | |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <groupId>com.doumee</groupId> |
| | | <artifactId>dianjiang</artifactId> |
| | | <artifactId>diandongche</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | <packaging>pom</packaging> |
| | | <name>dianjiang</name> |
| | | <name>diandongche</name> |
| | | <description></description> |
| | | <modules> |
| | | <module>admin</module> |
| | | <module>web</module> |
| | | <module>services</module> |
| | | </modules> |
| | | |
| | |
| | | <artifactId>services</artifactId> |
| | | <parent> |
| | | <groupId>com.doumee</groupId> |
| | | <artifactId>dianjiang</artifactId> |
| | | <artifactId>diandongche</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | </parent> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.tianyiyun</groupId> |
| | | <artifactId>zob</artifactId> |
| | | <version>1.0</version> |
| | | <scope>system</scope> |
| | | <!--æ¬å°çjacob.jarçè·¯å¾--> |
| | | <systemPath>${project.basedir}/lib/zos-sdk.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.lib; |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.DataOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | | import java.net.URLEncoder; |
| | | import java.util.Map; |
| | | |
| | | import javax.net.ssl.HostnameVerifier; |
| | | import javax.net.ssl.HttpsURLConnection; |
| | | import javax.net.ssl.SSLSession; |
| | | |
| | | import org.apache.commons.logging.Log; |
| | | |
| | | public class HttpConnectionUtil { |
| | | private HttpURLConnection conn; |
| | | private String connectUrl; |
| | | |
| | | public HttpConnectionUtil(String connectUrl){ |
| | | this.connectUrl = connectUrl; |
| | | } |
| | | |
| | | public void init() throws Exception{ |
| | | URL url = new URL(connectUrl); |
| | | System.setProperty("java.protocol.handler.pkgs", "javax.net.ssl"); |
| | | HostnameVerifier hv = new HostnameVerifier() { |
| | | public boolean verify(String urlHostName, SSLSession session) { |
| | | return urlHostName.equals(session.getPeerHost()); |
| | | } |
| | | }; |
| | | HttpsURLConnection.setDefaultHostnameVerifier(hv); |
| | | URLConnection conn = url.openConnection(); |
| | | conn.setDoInput(true); |
| | | conn.setDoOutput(true); |
| | | conn.setReadTimeout(60000); |
| | | conn.setConnectTimeout(30000); |
| | | if (conn instanceof HttpsURLConnection){ |
| | | HttpsURLConnection httpsConn = (HttpsURLConnection)conn; |
| | | httpsConn.setSSLSocketFactory(SSLUtil.getInstance().getSSLSocketFactory()); |
| | | } else if (conn instanceof HttpURLConnection){ |
| | | HttpURLConnection httpConn = (HttpURLConnection)conn; |
| | | } else { |
| | | throw new Exception("䏿¯http/httpsåè®®çurl"); |
| | | } |
| | | this.conn = (HttpURLConnection)conn; |
| | | initDefaultPost(); |
| | | } |
| | | |
| | | public void destory(){ |
| | | try{ |
| | | if(this.conn!=null){ |
| | | this.conn.disconnect(); |
| | | } |
| | | }catch(Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | private void initDefaultPost() throws Exception{ |
| | | conn.setDoOutput(true); |
| | | conn.setDoInput(true); |
| | | conn.setRequestMethod("POST"); |
| | | conn.setUseCaches(false); |
| | | conn.setInstanceFollowRedirects(true); |
| | | conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); |
| | | } |
| | | |
| | | public byte[] postParams(Map<String, String> params,boolean readreturn) throws IOException { |
| | | StringBuilder outBuf = new StringBuilder(); |
| | | boolean isNotFirst = false; |
| | | for (Map.Entry<String, String> entry: params.entrySet()){ |
| | | if (isNotFirst) |
| | | outBuf.append('&'); |
| | | isNotFirst = true; |
| | | outBuf |
| | | .append(entry.getKey()) |
| | | .append('=') |
| | | .append(URLEncoder.encode(entry.getValue(), "UTF-8")); |
| | | } |
| | | System.out.println("åæ°:"+outBuf.toString()); |
| | | return postParams(outBuf.toString(),readreturn); |
| | | } |
| | | |
| | | public byte[] postParams(String message,boolean readreturn) throws IOException { |
| | | DataOutputStream out = new DataOutputStream(conn.getOutputStream()); |
| | | out.write(message.getBytes("UTF-8")); |
| | | out.close(); |
| | | if(readreturn){ |
| | | return readBytesFromStream(conn.getInputStream()); |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public byte[] postParams(byte[] message,boolean readreturn) throws IOException { |
| | | DataOutputStream out = new DataOutputStream(conn.getOutputStream()); |
| | | out.write(message); |
| | | out.close(); |
| | | if(readreturn){ |
| | | return readBytesFromStream(conn.getInputStream()); |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | private byte[] readBytesFromStream(InputStream is) throws IOException{ |
| | | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | | int readLen; |
| | | byte[] tmpBuf = new byte[4096]; |
| | | while ((readLen = is.read(tmpBuf)) > 0) |
| | | baos.write(tmpBuf, 0, readLen); |
| | | is.close(); |
| | | return baos.toByteArray(); |
| | | } |
| | | |
| | | public HttpURLConnection getConn() { |
| | | return conn; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.lib; |
| | | |
| | | import java.security.KeyManagementException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.cert.CertificateException; |
| | | import java.security.cert.X509Certificate; |
| | | |
| | | import javax.net.ssl.SSLContext; |
| | | import javax.net.ssl.SSLSocketFactory; |
| | | import javax.net.ssl.TrustManager; |
| | | import javax.net.ssl.X509TrustManager; |
| | | |
| | | /** |
| | | * SSL管çå©æç±» |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | public class SSLUtil implements X509TrustManager { |
| | | private SSLSocketFactory sslFactory = null; |
| | | |
| | | private SSLUtil(){ |
| | | } |
| | | |
| | | public void checkClientTrusted(X509Certificate[] arg0, String arg1) |
| | | throws CertificateException { |
| | | } |
| | | |
| | | public void checkServerTrusted(X509Certificate[] arg0, String arg1) |
| | | throws CertificateException { |
| | | } |
| | | |
| | | public X509Certificate[] getAcceptedIssuers() { |
| | | return null; |
| | | } |
| | | |
| | | /** è·åSSL Socketå·¥å */ |
| | | public SSLSocketFactory getSSLSocketFactory(){ |
| | | return sslFactory; |
| | | } |
| | | |
| | | private static SSLUtil _instance = null; |
| | | |
| | | /** è·åSSL管çå©æç±»å®ä¾ */ |
| | | synchronized public static SSLUtil getInstance() throws NoSuchAlgorithmException, KeyManagementException { |
| | | if (_instance == null){ |
| | | _instance = new SSLUtil(); |
| | | SSLContext sc = SSLContext.getInstance("SSLv3"); |
| | | sc.init(null, new TrustManager[]{new SSLUtil()}, null); |
| | | _instance.sslFactory = sc.getSocketFactory(); |
| | | } |
| | | return _instance; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.lib; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigInteger; |
| | | import java.security.KeyFactory; |
| | | import java.security.PrivateKey; |
| | | import java.security.PublicKey; |
| | | import java.security.SecureRandom; |
| | | import java.security.Security; |
| | | import java.security.Signature; |
| | | import java.security.spec.PKCS8EncodedKeySpec; |
| | | import java.security.spec.X509EncodedKeySpec; |
| | | import java.util.Arrays; |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.bouncycastle.asn1.ASN1EncodableVector; |
| | | import org.bouncycastle.asn1.ASN1Integer; |
| | | import org.bouncycastle.asn1.ASN1Sequence; |
| | | import org.bouncycastle.asn1.DERSequence; |
| | | import org.bouncycastle.jcajce.spec.SM2ParameterSpec; |
| | | import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| | | import org.bouncycastle.util.encoders.Hex; |
| | | |
| | | public class SmUtil { |
| | | static{ |
| | | Security.addProvider(new BouncyCastleProvider()); |
| | | } |
| | | /**ç®æ³å¸¸é:SM3withSM2*/ |
| | | public static final String ALGORITHM_SM3SM2_BCPROV = "SM3withSM2"; |
| | | private final static int SM3withSM2_RS_LEN=32; |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | /**åæ·å¹³å°åé
çappid,乿¯ç¾åçcertid**/ |
| | | String appid = "00000156"; |
| | | /**åæ·sm2ç§é¥,ç¨äºåéèå起请æ±åè¿è¡ç¾å**/ |
| | | String cusPrivateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjj4Rk+b0YjwO+UwXofnHf4bK+kaaY5Btkd8nMP2VimmgCgYIKoEcz1UBgi2hRANCAAQqlALW4qGC3bP1x3wo5QsKxaCMEZJ2ODTTwOQ+d8UGU7GoK/y/WMBQWf5upMnFU06p5FxGooXYYoBtldgm03hq"; |
| | | /**åæ·sm2å
¬é¥ï¼éè¦é
ç½®å°éèåæ·å¹³å°**/ |
| | | String cusPubKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEKpQC1uKhgt2z9cd8KOULCsWgjBGSdjg008DkPnfFBlOxqCv8v1jAUFn+bqTJxVNOqeRcRqKF2GKAbZXYJtN4ag=="; |
| | | |
| | | /**éèå¹³å°sm2å
¬é¥ï¼ç¨äºè¯·æ±è¿åæè
éèéç¥çéªç¾**/ |
| | | String tlPubKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE/BnA8BawehBtH0ksPyayo4pmzL/u1FQ2sZcqwOp6bjVqQX4tjo930QAvHZPJ2eez8sCz/RYghcqv4LvMq+kloQ=="; |
| | | |
| | | String blankStr = "请æ±å¾
ç¾åæ°æ®"; |
| | | PrivateKey privkey = privKeySM2FromBase64Str(cusPrivateKey); |
| | | String sign = signSM3SM2RetBase64(privkey, appid, blankStr.getBytes("UTF-8"));//ç¾å |
| | | System.out.println(sign); |
| | | |
| | | String rspBlankStr = "è¿åå¾
éªç¾æ°æ®";//éèè¿åçææ |
| | | String rspSign = "AovBKQGUe0xuJ0ox7FgIIX+yB3DzbudgUsnNvJmDV0IdHZtU2Y8vdeUY1pd2vmPUf08hNgdkoz+4WP/D/ktOcA==";//éèè¿åçç¾å |
| | | PublicKey publicKey = pubKeySM2FromBase64Str(tlPubKey); |
| | | boolean isOk = verifySM3SM2(publicKey, "Allinpay", Base64.decodeBase64(rspSign), rspBlankStr.getBytes("UTF-8")); |
| | | System.out.println("éªç¾ç»æ:"+isOk); |
| | | |
| | | |
| | | } |
| | | |
| | | /**ç¾åå¹¶BASE64ç¼ç -SM3WithSM2 */ |
| | | public static String signSM3SM2RetBase64(final PrivateKey privateKey,String certid,final byte[] data) throws Exception{ |
| | | return Base64.encodeBase64String(signSM3SM2(privateKey, certid, data)); |
| | | } |
| | | |
| | | /**ç¾å-SM3WithSM2 */ |
| | | public static byte[] signSM3SM2(final PrivateKey privateKey,String certid,final byte[] data) throws Exception{ |
| | | SM2ParameterSpec parameterSpec = new SM2ParameterSpec(certid.getBytes()); |
| | | Signature signer = Signature.getInstance(ALGORITHM_SM3SM2_BCPROV, "BC"); |
| | | signer.setParameter(parameterSpec); |
| | | signer.initSign(privateKey, new SecureRandom()); |
| | | signer.update(data); |
| | | return byteAsn12BytePlain(signer.sign()); |
| | | } |
| | | |
| | | /** éªè¯ç¾å-SM3WithSM2*/ |
| | | public static boolean verifySM3SM2(final PublicKey publicKey,String certid,final byte[] signData, final byte[] srcData) throws Exception { |
| | | SM2ParameterSpec parameterSpec = new SM2ParameterSpec(certid.getBytes()); |
| | | Signature verifier = Signature.getInstance(ALGORITHM_SM3SM2_BCPROV, "BC"); |
| | | verifier.setParameter(parameterSpec); |
| | | verifier.initVerify(publicKey); |
| | | verifier.update(srcData); |
| | | return verifier.verify(bytePlain2ByteAsn1(signData)); |
| | | } |
| | | |
| | | /**ä»å符串读åç§é¥-ç®åæ¯æPKCS8(keystr为BASE64æ ¼å¼)*/ |
| | | public static PrivateKey privKeySM2FromBase64Str(String keystr) throws Exception { |
| | | KeyFactory keyFactory = KeyFactory.getInstance("EC"); |
| | | return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(Base64.decodeBase64(keystr))); |
| | | } |
| | | |
| | | /**ä»å符串读åRSAå
¬é¥(keystr为BASE64æ ¼å¼)*/ |
| | | public static PublicKey pubKeySM2FromBase64Str(String keystr) throws Exception { |
| | | KeyFactory keyFactory = KeyFactory.getInstance("EC"); |
| | | return keyFactory.generatePublic(new X509EncodedKeySpec(Base64.decodeBase64(keystr))); |
| | | } |
| | | |
| | | /** |
| | | * å°æ®éåèæ°ç»è½¬æ¢ä¸ºASN1åèæ°ç» éç¨äºSM3withSM2éªç¾æ¶éªç¾ææè½¬æ¢ |
| | | */ |
| | | private static byte[] bytePlain2ByteAsn1(byte[] data) { |
| | | if (data.length != SM3withSM2_RS_LEN * 2) throw new RuntimeException("err data. "); |
| | | BigInteger r = new BigInteger(1, Arrays.copyOfRange(data, 0, SM3withSM2_RS_LEN)); |
| | | BigInteger s = new BigInteger(1, Arrays.copyOfRange(data, SM3withSM2_RS_LEN, SM3withSM2_RS_LEN * 2)); |
| | | ASN1EncodableVector v = new ASN1EncodableVector(); |
| | | v.add(new ASN1Integer(r)); |
| | | v.add(new ASN1Integer(s)); |
| | | try { |
| | | return new DERSequence(v).getEncoded("DER"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | /** |
| | | * å°ASN1åèæ°ç»è½¬æ¢ä¸ºæ®éåèæ°ç» éç¨äºSM3withSM2ç¾åæ¶ç¾åç»æè½¬æ¢ |
| | | */ |
| | | private static byte[] byteAsn12BytePlain(byte[] dataAsn1) { |
| | | ASN1Sequence seq = ASN1Sequence.getInstance(dataAsn1); |
| | | byte[] r = bigIntToFixexLengthBytes(ASN1Integer.getInstance(seq.getObjectAt(0)).getValue()); |
| | | byte[] s = bigIntToFixexLengthBytes(ASN1Integer.getInstance(seq.getObjectAt(1)).getValue()); |
| | | byte[] result = new byte[SM3withSM2_RS_LEN * 2]; |
| | | System.arraycopy(r, 0, result, 0, r.length); |
| | | System.arraycopy(s, 0, result, SM3withSM2_RS_LEN, s.length); |
| | | return result; |
| | | } |
| | | |
| | | private static byte[] bigIntToFixexLengthBytes(BigInteger rOrS) { |
| | | byte[] rs = rOrS.toByteArray(); |
| | | if (rs.length == SM3withSM2_RS_LEN) return rs; |
| | | else if (rs.length == SM3withSM2_RS_LEN + 1 && rs[0] == 0) |
| | | return Arrays.copyOfRange(rs, 1, SM3withSM2_RS_LEN + 1); |
| | | else if (rs.length < SM3withSM2_RS_LEN) { |
| | | byte[] result = new byte[SM3withSM2_RS_LEN]; |
| | | Arrays.fill(result, (byte) 0); |
| | | System.arraycopy(rs, 0, result, SM3withSM2_RS_LEN - rs.length, rs.length); |
| | | return result; |
| | | } else { |
| | | throw new RuntimeException("err rs: " + Hex.toHexString(rs)); |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.lib; |
| | | |
| | | public class SybConstants { |
| | | // æµè¯ç¯å¢æµè¯åæ° |
| | | // public static final String SYB_ORGID = "";//éå¢/æºææ¨¡å¼ä¸è¯¥åæ°ä¸ä¸ºç©ºï¼ä¸appidä¸keyæ¯ä¸æ¬¡åæ°å¯¹åº |
| | | // public static final String SYB_CUSID = "990581007426001"; |
| | | // public static final String SYB_APPID = "00000051"; |
| | | // public static final String SYB_MD5_APPKEY = "allinpay888"; |
| | | // public static final String SYB_APIURL = "http://172.16.1.10/apiweb"; |
| | | /**åæ·RSAç§é¥,ç¨äºåéèå起请æ±åè¿è¡ç¾å**/ |
| | | // public static final String SYB_RSACUSPRIKEY = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAK5aIo+E1eyWwEIgMB8ZEZRAaWjSAglmfKVhzy8N1eLjAlqPjJgOCqXGEYt/r61AyIjCCJiYVDTHzcqstmbBU7HKpYjTsquCLjRWcL/fhMwMGBSg2bP5mqw5locSOz1gtRujmd3kZo9OIJuWtfG2+wgPPdKUdGZS+5K8WtWCF4z1AgMBAAECgYAPvvqvkPzb9tpqrmsCJ/qvM6kBazP9Ytjfe8ehFYQLT1qrUJsPMXdzNMHpYhD82eSyeymZFGrIcIIMq4/2lD+pYOMQTMGGjoVb2wnQhZFqPdgjXgOQ90E43X69jD3p5F8CuKVNa13I4l3iyfzlVIL780JPdJdug7yKEFdSeOQZUQJBAONlFpIqz87pbnwzfgO5kRTbbI7DcyObb8OEeCK3VlGB3r9P4NoMEDaXm+HnIdv53gnFq+xgbREWUt2nFq9dSUUCQQDESOIdSvIBc3KQTYR+cnlQTH0SOvm0Tlx4KekBCLxTFAFyBqnOBLdVyQb6Z1wxGz855AjnNbHy1rFhUYQ6hPfxAkAIRZUcnBITJMqwGe9rk0SDzbeVOebmVLEsG5WDLcgmDuNbcjxrsiSk178D6LSCnARHtrkaUCenh3hcN8fLeUlBAkABNP2G9pYEYkRbFM7yxBtw3feK7Cfq7uxspL1VD0uxKxdTLy1OIgNKmMDdO1N6zdMWtQtE+LSObLmMgqbQgU7RAkBFX5kl4+B3k+/aCYB/ndqd1nQIr4SNAtLFJDtlW2xah9W2lQL/7KQDT4o4dUMY51m7Bu61SAmKtralv7Hf25yf"; |
| | | // /**éèå¹³å°RSAå
¬é¥ï¼ç¨äºè¯·æ±è¿åæè
éèéç¥çéªç¾**/ |
| | | // public static final String SYB_RSATLPUBKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYXfu4b7xgDSmEGQpQ8Sn3RzFgl5CE4gL4TbYrND4FtCYOrvbgLijkdFgIrVVWi2hUW4K0PwBsmlYhXcbR+JSmqv9zviVXZiym0lK3glJGVCN86r9EPvNTusZZPm40TOEKMVENSYaUjCxZ7JzeZDfQ4WCeQQr2xirqn6LdJjpZ5wIDAQAB"; |
| | | // |
| | | // /**åæ·sm2ç§é¥,ç¨äºåéèå起请æ±åè¿è¡ç¾å**/ |
| | | // public static final String SYB_SM2PPRIVATEKEY = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjj4Rk+b0YjwO+UwXofnHf4bK+kaaY5Btkd8nMP2VimmgCgYIKoEcz1UBgi2hRANCAAQqlALW4qGC3bP1x3wo5QsKxaCMEZJ2ODTTwOQ+d8UGU7GoK/y/WMBQWf5upMnFU06p5FxGooXYYoBtldgm03hq"; |
| | | // /**éèå¹³å°sm2å
¬é¥ï¼ç¨äºè¯·æ±è¿åæè
éèéç¥çéªç¾**/ |
| | | // public static final String SYB_SM2TLPUBKEY = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE/BnA8BawehBtH0ksPyayo4pmzL/u1FQ2sZcqwOp6bjVqQX4tjo930QAvHZPJ2eez8sCz/RYghcqv4LvMq+kloQ=="; |
| | | |
| | | // æ£å¼ç¯å¢æµè¯åæ° |
| | | public static final String SYB_ORGID = "";//éå¢/æºææ¨¡å¼ä¸è¯¥åæ°ä¸ä¸ºç©ºï¼ä¸appidä¸keyæ¯ä¸æ¬¡åæ°å¯¹åº |
| | | public static final String SYB_CUSID = "990361082416001"; |
| | | public static final String SYB_APPID = "00012395"; |
| | | public static final String SYB_MD5_APPKEY = "allinpay123"; |
| | | public static final String SYB_APIURL = "https://vsp.allinpay.com/apiweb";//ç产ç¯å¢ |
| | | public static final String SYB_RSACUSPRIKEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCW/IG0a0swTXKqT6h9rEDh7i2LS1+92Ab/e4ZbNT+zWKzYPkbJ96EphN49ik7gMK1BOaMS9C+AgGvEDgizGxTR+RoRsbbeTqBMdVm2rDUK4tnlVHoWEa5eDOLomzb4EJs03OJ91qcgJk9neCTEkntXWcBKNNXEvlCFXAPEfsaccEXmi2ouYyaqT5cYBihULYB7DTTPXsOg09A/KjICSJIBGTFRjjpfwgXisjBaNjOWYAlXHF3UVisMlZueKVWnO1USdWK24gQEis1HSf0mj61rAVQMt5/dkMYbxVQlQvKlJFMXt/koKzo1GoanMfyFSg0iyI6zcBWynhmBIASwwkdzAgMBAAECggEAO/vYOcnQhsGWFvRrr3XiFwAtZuQMhtsOuKwl7hFjG8jUblqbe/ydseV/93n9qRKdmkagM1UAlDAw4CRlL2bIaDzrLvFoAbzB8W5DtI+IySjjwTjFAgSHPgUnlpqnhXjveFpyvuSq49pkfGpeTRwW1VaqTrDb5nxnd/vc4VEubZKO6D1wgUpyczNiqvjfEecX0gwLHtwUI6jqMYcq0bRCJ5aXqXZHBqIDZ+2j9wpBx0CvdNdRULYAwO824xLxmCu3cIAUBntTsZ6MlBjIfYHdXJY3jOwK2AR+RPJ3NDPotgwf9JkxcAGRqC47GEn1Wjz1iDglhLnasPHYeOXczLsAfQKBgQDJYL4CIXPNfAbCdJKGb0H2kKrkG4Jt2PnYKySFLKzY9HvKnco9h+6t6lxvtTlWZtb8gLwiDsqaP4X24W6pVwedkSSK8JPbjaepDA7gzqCGRE7IVJLMU6PO8j0DNXGT5z9whNQJXWv6qIlC3AeWBHNov0b2BK7RXWr54YP5tpoChwKBgQC/8K54scZYV/XlYmaFQnzv9ZCUaLrPyvpDzXi0jxmIuYs2uslWKnsXzgGZNcbaDdIRa0T4xNHCVkbb3AW2QfEqXA+TUjse877znScTkfdVsW0dADHEm5YN9Ec1sxPQI4IUaWqC//59AjewfDJS6lEcerGvIZLPVG6y1L7E0AcStQKBgQDIrWSMQQPiyO7/hyWhXGvypxX1fUiL6QaJmeyp3exdw709G+M3UCfVHlCBbao25QLm2+8fTXgvIJCChwI9NKI9Li+pWbcuuspSltaYxrCHPLj5v/YOMmdySkns0axehLreiS+4KWX6g0tN2nCg2cycnMi9T8tajmqVm1tmVMbDLwKBgFC6/ddcBq3vyUhC3BYewgf3xGj3p+NwX1UXXjarnbTJPcm2RKrOUVnQ1xFG8i2S9JFJCgiMWCGiQkmFQI3JLJOBhzeStbUuFlnG9sGfemV7rAYvp78nJbUW0sC+Yo3/8V1+fUM+Qx73SM8dXdlMHvOYk5WyzFoSDEGBg/+p89+lAoGBAMhuMLE0K1mDxF4fp9Bpxvu2xhJuFYfBQNizUQE4nPvjG7czFv7UZXhO9ml6OOf9483YBHi9O3uhMTjiiqnFVcJrjiy3bhsdamm9FnO7GMgoZ7QOlq8LNikVRuPj+udSwrF3ICVAMMKq8bAxzZTGQoAH2He3S5K4dY+kGbsTsQxt"; |
| | | public static final String SYB_RSATLPUBKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCm9OV6zH5DYH/ZnAVYHscEELdCNfNTHGuBv1nYYEY9FrOzE0/4kLl9f7Y9dkWHlc2ocDwbrFSm0Vqz0q2rJPxXUYBCQl5yW3jzuKSXif7q1yOwkFVtJXvuhf5WRy+1X5FOFoMvS7538No0RpnLzmNi3ktmiqmhpcY/1pmt20FHQQIDAQAB"; |
| | | |
| | | public static final String VERSION = "12"; |
| | | public static final String RET_URL = "https://test.allinpaygd.com/JWeb/reccomparams.jsp"; |
| | | public static final String NOTFIY_URL = "https://test.allinpaygd.com/JWeb/NotifyServlet"; |
| | | public static final String VALID_TIME = "30"; |
| | | public static final String SIGN_TYPE = "RSA";//RSA,SM2,(å
¶ä») |
| | | // /**åæ·sm2ç§é¥,ç¨äºåéèå起请æ±åè¿è¡ç¾å**/ |
| | | public static final String SYB_SM2PPRIVATEKEY = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjj4Rk+b0YjwO+UwXofnHf4bK+kaaY5Btkd8nMP2VimmgCgYIKoEcz1UBgi2hRANCAAQqlALW4qGC3bP1x3wo5QsKxaCMEZJ2ODTTwOQ+d8UGU7GoK/y/WMBQWf5upMnFU06p5FxGooXYYoBtldgm03hq"; |
| | | // /**éèå¹³å°sm2å
¬é¥ï¼ç¨äºè¯·æ±è¿åæè
éèéç¥çéªç¾**/ |
| | | public static final String SYB_SM2TLPUBKEY = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEBQicgWm0KAMqhO3bdqMUEDrKQvYg8cCXHhdGwq7CGE6oJDzJ1P/94HpuVdBf1KidmPxr7HOH+0DAnpeCcx9TcQ=="; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.lib; |
| | | |
| | | import java.net.URLEncoder; |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | |
| | | public class SybPayService { |
| | | |
| | | public Map<String,String> cancel(long trxamt,String reqsn,String oldtrxid,String oldreqsn) throws Exception{ |
| | | HttpConnectionUtil http = new HttpConnectionUtil(SybConstants.SYB_APIURL+"/unitorder/cancel"); |
| | | http.init(); |
| | | TreeMap<String,String> params = new TreeMap<String,String>(); |
| | | if(!SybUtil.isEmpty(SybConstants.SYB_ORGID)) |
| | | params.put("orgid", SybConstants.SYB_ORGID); |
| | | params.put("cusid", SybConstants.SYB_CUSID); |
| | | params.put("appid", SybConstants.SYB_APPID); |
| | | params.put("version", "11"); |
| | | params.put("trxamt", String.valueOf(trxamt)); |
| | | params.put("reqsn", reqsn); |
| | | params.put("oldtrxid", oldtrxid); |
| | | params.put("oldreqsn", oldreqsn); |
| | | params.put("randomstr", SybUtil.getValidatecode(8)); |
| | | params.put("signtype", SybConstants.SIGN_TYPE); |
| | | String appkey = ""; |
| | | if(SybConstants.SIGN_TYPE.equals("RSA")) |
| | | appkey = SybConstants.SYB_RSACUSPRIKEY; |
| | | else if(SybConstants.SIGN_TYPE.equals("SM2")) |
| | | appkey = SybConstants.SYB_SM2PPRIVATEKEY; |
| | | else |
| | | appkey = SybConstants.SYB_MD5_APPKEY; |
| | | params.put("sign", SybUtil.unionSign(params,appkey,SybConstants.SIGN_TYPE)); |
| | | byte[] bys = http.postParams(params, true); |
| | | String result = new String(bys,"UTF-8"); |
| | | Map<String,String> map = handleResult(result); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,String> refund(long trxamt,String reqsn,String oldtrxid,String oldreqsn) throws Exception{ |
| | | HttpConnectionUtil http = new HttpConnectionUtil(SybConstants.SYB_APIURL+"/unitorder/refund"); |
| | | http.init(); |
| | | TreeMap<String,String> params = new TreeMap<String,String>(); |
| | | if(!SybUtil.isEmpty(SybConstants.SYB_ORGID)) |
| | | params.put("orgid", SybConstants.SYB_ORGID); |
| | | params.put("cusid", SybConstants.SYB_CUSID); |
| | | params.put("appid", SybConstants.SYB_APPID); |
| | | params.put("version", "11"); |
| | | params.put("trxamt", String.valueOf(trxamt)); |
| | | params.put("reqsn", reqsn); |
| | | params.put("oldreqsn", oldreqsn); |
| | | params.put("oldtrxid", oldtrxid); |
| | | params.put("randomstr", SybUtil.getValidatecode(8)); |
| | | params.put("signtype", SybConstants.SIGN_TYPE); |
| | | String appkey = ""; |
| | | if(SybConstants.SIGN_TYPE.equals("RSA")) |
| | | appkey = SybConstants.SYB_RSACUSPRIKEY; |
| | | else if(SybConstants.SIGN_TYPE.equals("SM2")) |
| | | appkey = SybConstants.SYB_SM2PPRIVATEKEY; |
| | | else |
| | | appkey = SybConstants.SYB_MD5_APPKEY; |
| | | params.put("sign", SybUtil.unionSign(params,appkey,SybConstants.SIGN_TYPE)); |
| | | byte[] bys = http.postParams(params, true); |
| | | String result = new String(bys,"UTF-8"); |
| | | Map<String,String> map = handleResult(result); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,String> query(String reqsn,String trxid) throws Exception{ |
| | | HttpConnectionUtil http = new HttpConnectionUtil(SybConstants.SYB_APIURL+"/unitorder/query"); |
| | | http.init(); |
| | | TreeMap<String,String> params = new TreeMap<String,String>(); |
| | | if(!SybUtil.isEmpty(SybConstants.SYB_ORGID)) |
| | | params.put("orgid", SybConstants.SYB_ORGID); |
| | | params.put("cusid", SybConstants.SYB_CUSID); |
| | | params.put("appid", SybConstants.SYB_APPID); |
| | | params.put("version", "11"); |
| | | params.put("reqsn", reqsn); |
| | | params.put("trxid", trxid); |
| | | params.put("randomstr", SybUtil.getValidatecode(8)); |
| | | params.put("signtype", SybConstants.SIGN_TYPE); |
| | | String appkey = ""; |
| | | if(SybConstants.SIGN_TYPE.equals("RSA")) |
| | | appkey = SybConstants.SYB_RSACUSPRIKEY; |
| | | else if(SybConstants.SIGN_TYPE.equals("SM2")) |
| | | appkey = SybConstants.SYB_SM2PPRIVATEKEY; |
| | | else |
| | | appkey = SybConstants.SYB_MD5_APPKEY; |
| | | params.put("sign", SybUtil.unionSign(params,appkey,SybConstants.SIGN_TYPE)); |
| | | byte[] bys = http.postParams(params, true); |
| | | String result = new String(bys,"UTF-8"); |
| | | Map<String,String> map = handleResult(result); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public static Map<String,String> handleResult(String result) throws Exception{ |
| | | System.out.println("ret:"+result); |
| | | Map map = SybUtil.json2ObjMap(result); |
| | | if(map == null){ |
| | | throw new Exception("è¿åæ°æ®é误"); |
| | | } |
| | | if("SUCCESS".equals(map.get("retcode"))){ |
| | | TreeMap tmap = new TreeMap(); |
| | | tmap.putAll(map); |
| | | String appkey = ""; |
| | | if(SybConstants.SIGN_TYPE.equals("RSA")) |
| | | appkey = SybConstants.SYB_RSATLPUBKEY; |
| | | else if(SybConstants.SIGN_TYPE.equals("SM2")) |
| | | appkey = SybConstants.SYB_SM2TLPUBKEY; |
| | | else |
| | | appkey = SybConstants.SYB_MD5_APPKEY; |
| | | if(SybUtil.validSign(tmap, appkey, SybConstants.SIGN_TYPE)){ |
| | | System.out.println("ç¾åæå"); |
| | | return map; |
| | | }else{ |
| | | throw new Exception("éªè¯ç¾å失败"); |
| | | } |
| | | |
| | | }else{ |
| | | throw new Exception(map.get("retmsg").toString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.lib; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.KeyFactory; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.PrivateKey; |
| | | import java.security.PublicKey; |
| | | import java.security.spec.PKCS8EncodedKeySpec; |
| | | import java.security.spec.X509EncodedKeySpec; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.TreeMap; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | |
| | | public class SybUtil { |
| | | /** |
| | | * js转å为å®ä½ |
| | | * |
| | | * @param <T> |
| | | * @param jsonstr |
| | | * @param cls |
| | | * @return |
| | | */ |
| | | public static <T> T json2Obj(String jsonstr, Class<T> cls) { |
| | | TypeReference<T> type = new TypeReference<T>() { }; |
| | | T obj = JSONObject.parseObject(jsonstr, type.getType()); |
| | | // JSONObject jo = JSONObject.fromObject(jsonstr); |
| | | // T obj = (T) JSONObject.toBean(jo, cls); |
| | | return obj; |
| | | } |
| | | public static Map json2ObjMap(String jsonstr ) { |
| | | TypeReference<Map> type = new TypeReference<Map>() { }; |
| | | Map obj = JSONObject.parseObject(jsonstr, type.getType()); |
| | | // JSONObject jo = JSONObject.fromObject(jsonstr); |
| | | // T obj = (T) JSONObject.toBean(jo, cls); |
| | | return obj; |
| | | } |
| | | |
| | | /** |
| | | * md5 |
| | | * |
| | | * @param b |
| | | * @return |
| | | */ |
| | | public static String md5(byte[] b) { |
| | | try { |
| | | MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | md.reset(); |
| | | md.update(b); |
| | | byte[] hash = md.digest(); |
| | | StringBuffer outStrBuf = new StringBuffer(32); |
| | | for (int i = 0; i < hash.length; i++) { |
| | | int v = hash[i] & 0xFF; |
| | | if (v < 16) { |
| | | outStrBuf.append('0'); |
| | | } |
| | | outStrBuf.append(Integer.toString(v, 16).toLowerCase()); |
| | | } |
| | | return outStrBuf.toString(); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | return new String(b); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 夿å符串æ¯å¦ä¸ºç©º |
| | | * |
| | | * @param s |
| | | * @return |
| | | */ |
| | | public static boolean isEmpty(String s) { |
| | | if (s == null || "".equals(s.trim())) |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * çæéæºç |
| | | * |
| | | * @param n |
| | | * @return |
| | | */ |
| | | public static String getValidatecode(int n) { |
| | | Random random = new Random(); |
| | | String sRand = ""; |
| | | n = n == 0 ? 4 : n;// default 4 |
| | | for (int i = 0; i < n; i++) { |
| | | String rand = String.valueOf(random.nextInt(10)); |
| | | sRand += rand; |
| | | } |
| | | return sRand; |
| | | } |
| | | |
| | | |
| | | |
| | | public static boolean validSign(TreeMap<String, String> param, |
| | | String appkey, String signType) throws Exception { |
| | | if (param != null && !param.isEmpty()) { |
| | | if (!param.containsKey("sign")) |
| | | return false; |
| | | String sign = param.remove("sign"); |
| | | if ("MD5".equals(signType)) {// 妿æ¯md5åéè¦æmd5çkeyå å
¥å°æåº |
| | | param.put("key", appkey); |
| | | } |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (Map.Entry<String, String> entry : param.entrySet()) { |
| | | if (entry.getValue() != null && entry.getValue().length() > 0) { |
| | | sb.append(entry.getKey()).append("=") |
| | | .append(entry.getValue()).append("&"); |
| | | } |
| | | } |
| | | if (sb.length() > 0) { |
| | | sb.deleteCharAt(sb.length() - 1); |
| | | } |
| | | if ("MD5".equals(signType)) { |
| | | return sign.toLowerCase().equals( |
| | | md5(sb.toString().getBytes("UTF-8")).toLowerCase()); |
| | | } else if("SM2".equals(signType)){ |
| | | PublicKey publicKey = SmUtil.pubKeySM2FromBase64Str(appkey); |
| | | return SmUtil.verifySM3SM2(publicKey, "Allinpay", Base64.decodeBase64(sign), sb.toString().getBytes("UTF-8")); |
| | | }else { |
| | | return rsaVerifyPublickey(sb.toString(), sign, appkey, "UTF-8"); |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static boolean rsaVerifyPublickey(String content, String sign, |
| | | String publicKey, String charset) throws Exception { |
| | | try { |
| | | PublicKey pubKey = getPublicKeyFromX509("RSA", |
| | | Base64.decodeBase64(publicKey.getBytes())); |
| | | return rsaVerifyPublickey(content, sign, pubKey, charset); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new Exception("RSAcontent = " + content + ",sign=" + sign |
| | | + ",charset = " + charset, e); |
| | | } |
| | | } |
| | | |
| | | public static boolean rsaVerifyPublickey(String content, String sign, |
| | | PublicKey pubKey, String charset) throws Exception { |
| | | try { |
| | | java.security.Signature signature = java.security.Signature |
| | | .getInstance("SHA1WithRSA"); |
| | | |
| | | signature.initVerify(pubKey); |
| | | |
| | | if (charset == null || "".equals(charset)) { |
| | | signature.update(content.getBytes()); |
| | | } else { |
| | | signature.update(content.getBytes(charset)); |
| | | } |
| | | |
| | | return signature.verify(Base64.decodeBase64(sign.getBytes())); |
| | | } catch (Exception e) { |
| | | throw e; |
| | | } |
| | | } |
| | | public static String unionSign(TreeMap<String, String> params,String appkey, |
| | | String signType) throws Exception { |
| | | // TODO Auto-generated method stub |
| | | |
| | | params.remove("sign"); |
| | | if ("MD5".equals(signType)) {// 妿æ¯md5åéè¦æmd5çkeyå å
¥å°æåº |
| | | params.put("key", appkey); |
| | | } |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (Map.Entry<String, String> entry : params.entrySet()) { |
| | | if (entry.getValue() != null && entry.getValue().length() > 0) { |
| | | sb.append(entry.getKey()).append("=").append(entry.getValue()) |
| | | .append("&"); |
| | | } |
| | | } |
| | | if (sb.length() > 0) { |
| | | sb.deleteCharAt(sb.length() - 1); |
| | | } |
| | | String sign = ""; |
| | | if ("MD5".equals(signType)) { |
| | | System.out.println(sb.toString()); |
| | | sign = md5(sb.toString().getBytes("UTF-8"));// è®°å¾æ¯md5ç¼ç çå ç¾ |
| | | params.remove("key"); |
| | | } else if("SM2".equals(signType)){ |
| | | System.out.println(sb.toString()); |
| | | PrivateKey privkey = SmUtil.privKeySM2FromBase64Str(appkey); |
| | | sign = SmUtil.signSM3SM2RetBase64(privkey, params.get("appid"), sb.toString().getBytes("UTF-8"));//ç¾å |
| | | } else { |
| | | System.out.println(sb.toString()); |
| | | sign = rsaSign(sb.toString(), appkey, "UTF-8"); |
| | | } |
| | | return sign; |
| | | } |
| | | |
| | | public static String rsaSign(String content, String privateKey, |
| | | String charset) throws Exception { |
| | | PrivateKey priKey = getPrivateKeyFromPKCS8("RSA", |
| | | Base64.decodeBase64(privateKey.getBytes())); |
| | | return rsaSign(content, priKey, charset); |
| | | } |
| | | |
| | | public static String rsaSign(String content, byte[] privateKey, |
| | | String charset) throws Exception { |
| | | PrivateKey priKey = getPrivateKeyFromPKCS8("RSA", privateKey); |
| | | return rsaSign(content, priKey, charset); |
| | | } |
| | | |
| | | public static String rsaSign(String content, PrivateKey priKey, |
| | | String charset) throws Exception { |
| | | java.security.Signature signature = java.security.Signature |
| | | .getInstance("SHA1WithRSA"); |
| | | signature.initSign(priKey); |
| | | if (charset == null || "".equals(charset)) { |
| | | signature.update(content.getBytes()); |
| | | } else { |
| | | signature.update(content.getBytes(charset)); |
| | | } |
| | | byte[] signed = signature.sign(); |
| | | |
| | | return new String(Base64.encodeBase64(signed)); |
| | | } |
| | | |
| | | public static PrivateKey getPrivateKeyFromPKCS8(String algorithm, |
| | | byte[] encodedKey) throws Exception { |
| | | |
| | | KeyFactory keyFactory = KeyFactory.getInstance(algorithm); |
| | | |
| | | return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(encodedKey)); |
| | | } |
| | | |
| | | public static PublicKey getPublicKeyFromX509(String algorithm, |
| | | byte[] encodedKey) throws Exception { |
| | | KeyFactory keyFactory = KeyFactory.getInstance(algorithm); |
| | | |
| | | return keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.test; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import com.allinpay.syb.lib.SybPayService; |
| | | import com.allinpay.syb.lib.SybUtil; |
| | | |
| | | |
| | | public class ApiTestV2 { |
| | | public static void main(String[] args) throws Exception{ |
| | | testCancel(); |
| | | //testRefund(); |
| | | // testQuery(); |
| | | } |
| | | |
| | | public static void testQuery() throws Exception{ |
| | | SybPayService service = new SybPayService(); |
| | | Map<String, String> map = service.query("", "112094120001239205"); |
| | | print(map); |
| | | } |
| | | |
| | | public static void testRefund() throws Exception{ |
| | | SybPayService service = new SybPayService(); |
| | | String reqsn = String.valueOf(System.currentTimeMillis()); |
| | | Map<String, String> map = service.refund(1, reqsn, "", "20160712167578.2547"); |
| | | print(map); |
| | | } |
| | | |
| | | public static void testCancel() throws Exception{ |
| | | SybPayService service = new SybPayService(); |
| | | String reqsn = String.valueOf(System.currentTimeMillis()); |
| | | Map<String, String> map = service.cancel(1, reqsn, "112094120001239205", ""); |
| | | print(map); |
| | | } |
| | | |
| | | |
| | | public static void print(Map<String, String> map){ |
| | | System.out.println("è¿åæ°æ®å¦ä¸:"); |
| | | if(map!=null){ |
| | | for(String key:map.keySet()){ |
| | | System.out.println(key+";"+map.get(key)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.test; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServlet; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.allinpay.syb.lib.SybConstants; |
| | | import com.allinpay.syb.lib.SybUtil; |
| | | |
| | | public class NotifyServlet extends HttpServlet { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public NotifyServlet() { |
| | | super(); |
| | | } |
| | | |
| | | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
| | | System.out.println("get method,no deal"); |
| | | } |
| | | |
| | | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
| | | System.out.println("æ¥æ¶å°éç¥"); |
| | | request.setCharacterEncoding("UTF-8");//éç¥ä¼ è¾çç¼ç 为GBK |
| | | response.setCharacterEncoding("UTF-8"); |
| | | TreeMap<String,String> params = getParams(request);//卿éåè·åæææ¶å°çåæ°,æ¤æ¥é常å
³é®,å 为æ¶é¶å®ä»¥åå¯è½ä¼å åæ®µ,卿è·åå¯ä»¥å
¼å®¹ |
| | | try { |
| | | String appkey = ""; |
| | | if("RSA".equals(params.get("signtype"))) |
| | | appkey = SybConstants.SYB_RSATLPUBKEY; |
| | | else if("SM2".equals(params.get("signtype"))) |
| | | appkey = SybConstants.SYB_SM2TLPUBKEY; |
| | | else |
| | | appkey = SybConstants.SYB_MD5_APPKEY; |
| | | boolean isSign = SybUtil.validSign(params, appkey, params.get("signtype"));// æ¥åå°æ¨ééç¥,é¦å
éªç¾ |
| | | System.out.println("éªç¾ç»æ:"+isSign); |
| | | //éªç¾å®æ¯è¿è¡ä¸å¡å¤ç |
| | | } catch (Exception e) {//å¤çå¼å¸¸ |
| | | // TODO: handle exception |
| | | e.printStackTrace(); |
| | | } |
| | | finally{//æ¶å°éç¥,è¿åsuccess |
| | | response.getOutputStream().write("success".getBytes()); |
| | | response.flushBuffer(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 卿éåè·åæææ¶å°çåæ°,æ¤æ¥é常å
³é®,å 为æ¶é¶å®ä»¥åå¯è½ä¼å åæ®µ,卿è·åå¯ä»¥å
¼å®¹ç±äºæ¶é¶å®å åæ®µèå¼èµ·çç¾åå¼å¸¸ |
| | | * @param request |
| | | * @return |
| | | */ |
| | | private TreeMap<String, String> getParams(HttpServletRequest request){ |
| | | TreeMap<String, String> map = new TreeMap<String, String>(); |
| | | Map reqMap = request.getParameterMap(); |
| | | for(Object key:reqMap.keySet()){ |
| | | String value = ((String[])reqMap.get(key))[0]; |
| | | System.out.println(key+";"+value); |
| | | map.put(key.toString(),value); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.FtpUtil; |
| | | import com.doumee.core.utils.tyyun.TyyZosUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartResolver; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.imageio.stream.ImageOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.awt.*; |
| | |
| | | String fileName = UUID.randomUUID().toString() + nfix; |
| | | String tempFileName = nowDate + "/" + fileName; |
| | | String key = folder + tempFileName;// æä»¶å |
| | | TyyZosUtil obs = new TyyZosUtil(endpoint,access_id, access_key); |
| | | /* TyyZosUtil obs = new TyyZosUtil(endpoint,access_id, access_key); |
| | | if (obs.uploadInputstreamObject(file.getInputStream(),bucketName, key)) { |
| | | // ç§»å¨æå,è¿åæä»¶å |
| | | // sendSuccessMessage(response, resourcePath+key); |
| | |
| | | context.put("message", "ä¸ä¼ 失败"); |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.vo.WebLoginUserVO; |
| | | import io.jsonwebtoken.Jwts; |
| | | import io.jsonwebtoken.SignatureAlgorithm; |
| | |
| | | * @param token å令ç |
| | | * @return æ°ä»¤ç |
| | | */ |
| | | public void refreshToken(String token,Member member) { |
| | | public void refreshToken(String token,Object member) { |
| | | try { |
| | | if(Objects.nonNull(member)){ |
| | | // redisTemplate.expire(Constants.REDIS_TOKEN_KEY+token,jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | /** |
| | | * 订åè®°å½è¡¨ä¿¡æ¯è¡¨Mapperå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-02-02 11:10:42 |
| | | */ |
| | | public interface OrdersMapper extends MPJBaseMapper<Orders> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | | @Data |
| | | @ApiModel("è®¢åæ¯ä»åæ°") |
| | | public class PayOrderParam { |
| | | |
| | | private String appid; |
| | | private String body; |
| | | private String charset; |
| | | private String cusid; |
| | | private String notify_url; |
| | | private String randomstr; |
| | | private String remark; |
| | | private String returl; |
| | | private String reqsn; |
| | | private String sign; |
| | | private String signtype; |
| | | private String trxamt; |
| | | private String validtime; |
| | | private String version; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | | @Data |
| | | @ApiModel("è®¢åæ¯ä»åæ°è¿å") |
| | | public class PayOrderResponse { |
| | | |
| | | private String url; |
| | | private PayOrderParam param; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | /** |
| | | * 订åè®°å½è¡¨ä¿¡æ¯è¡¨Modelå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-02-02 11:10:42 |
| | | */ |
| | | @Data |
| | | @TableName("orders") |
| | | @ApiModel(value = "Orders å®ä½ç±»") |
| | | public class Orders { |
| | | |
| | | @ApiModelProperty("æ¯ä»ç¶æ:0=æªæ¯ä»;1=å·²æ¯ä»") |
| | | @ExcelColumn(name="æ¯ä»ç¶æ:0=æªæ¯ä»;1=å·²æ¯ä»",index=1 ,width=10) |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | @ApiModelProperty("æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤") |
| | | @ExcelColumn(name="æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤",index=2 ,width=10) |
| | | private Integer deleted; |
| | | @ApiModelProperty("å建人ç¼ç ") |
| | | @ExcelColumn(name="å建人ç¼ç ",index=3 ,width=10) |
| | | private Integer createUser; |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´",index=4 ,width=10) |
| | | private Date createTime; |
| | | @ApiModelProperty("æ´æ°äººç¼ç ") |
| | | @ExcelColumn(name="æ´æ°äººç¼ç ",index=5 ,width=10) |
| | | private Integer updateUser; |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @ExcelColumn(name="æ´æ°æ¶é´",index=6 ,width=10) |
| | | private Date updateTime; |
| | | @ApiModelProperty("夿³¨") |
| | | @ExcelColumn(name="夿³¨",index=7 ,width=10) |
| | | private String remark; |
| | | @ApiModelProperty("ç¶æ:0=å¤çä¸;1=å·²æ¯ä»;2=æ¯ä»å¤±è´¥;") |
| | | @ExcelColumn(name="ç¶æ:0=å¤çä¸;1=å·²æ¯ä»;2=æ¯ä»å¤±è´¥;",index=8 ,width=10) |
| | | private Integer status; |
| | | @ApiModelProperty("主é¢") |
| | | @ExcelColumn(name="主é¢",index=9 ,width=10) |
| | | private String name; |
| | | @ApiModelProperty("è´è´£äººç¼ç ï¼å
³èsystem_user)") |
| | | @ExcelColumn(name="è´è´£äººç¼ç ï¼å
³èsystem_user)",index=10 ,width=10) |
| | | private Integer userId; |
| | | @ApiModelProperty("订å说æ") |
| | | @ExcelColumn(name="订å说æ",index=11 ,width=10) |
| | | private String detail; |
| | | @ApiModelProperty("å表å¾") |
| | | @ExcelColumn(name="å表å¾",index=12 ,width=10) |
| | | private String imgurl; |
| | | @ApiModelProperty("æåºç ï¼ååºä½¿ç¨ï¼") |
| | | @ExcelColumn(name="æåºç ï¼ååºä½¿ç¨ï¼",index=13 ,width=10) |
| | | private Integer sortnum; |
| | | @ApiModelProperty("æ·»å æ¹å¼ 0=车款;1=å»¶ææ¬¾;") |
| | | @ExcelColumn(name="æ·»å æ¹å¼ 0=车款;1=å»¶ææ¬¾;",index=14 ,width=10) |
| | | private Integer type; |
| | | @ApiModelProperty("åçç¼ç ï¼å
³ècategory)") |
| | | @ExcelColumn(name="åçç¼ç ï¼å
³ècategory)",index=15 ,width=10) |
| | | private Integer brandId; |
| | | @ApiModelProperty("ææºå·") |
| | | @ExcelColumn(name="ææºå·",index=16 ,width=10) |
| | | private String phone; |
| | | @ApiModelProperty("éé¢ï¼å
ï¼") |
| | | @ExcelColumn(name="éé¢ï¼å
ï¼",index=17 ,width=10) |
| | | private BigDecimal money; |
| | | @ApiModelProperty("æ¯ä»æ¹å¼ 0微信 1æ¯ä»å® 2éèæ¯ä»") |
| | | @ExcelColumn(name="æ¯ä»æ¹å¼ 0微信 1æ¯ä»å® 2éèæ¯ä»",index=18 ,width=10) |
| | | private Integer payMethod; |
| | | @ApiModelProperty("éèäº¤ææµæ°´") |
| | | @ExcelColumn(name="éèäº¤ææµæ°´",index=19 ,width=10) |
| | | private String payOrderId; |
| | | @ApiModelProperty("æ¯ä»æ¶é´") |
| | | @ExcelColumn(name="æ¯ä»æ¶é´",index=20 ,width=10) |
| | | private Date payDate; |
| | | @ApiModelProperty("åæ¶æ¶é´") |
| | | @ExcelColumn(name="åæ¶æ¶é´",index=21 ,width=10) |
| | | private Date cancelDate; |
| | | @ApiModelProperty("åæ¶æ¹å¼ 0èªå¨åæ¶;1æ¶å°åæ¶") |
| | | @ExcelColumn(name="åæ¶æ¹å¼ 0èªå¨åæ¶;1æ¶å°åæ¶",index=22 ,width=10) |
| | | private String cancelWay; |
| | | @ApiModelProperty("忶夿³¨") |
| | | @ExcelColumn(name="忶夿³¨",index=23 ,width=10) |
| | | private String cancelInfo; |
| | | @ApiModelProperty("åæ¶äººç¼ç ï¼å
³èsystem_user)") |
| | | @ExcelColumn(name="åæ¶äººç¼ç ï¼å
³èsystem_user)",index=24 ,width=10) |
| | | private Integer cancelUserId; |
| | | @ApiModelProperty("åæ¶ç¶æ 0å¤çä¸ 1æå 2失败") |
| | | @ExcelColumn(name="åæ¶ç¶æ 0å¤çä¸ 1æå 2失败",index=25 ,width=10) |
| | | private Integer cancelStatus; |
| | | @ApiModelProperty("æ¯ä»ç¶æ:0=æªæ¯ä»;1=å·²æ¯ä»") |
| | | @ExcelColumn(name="æ¯ä»ç¶æ:0=æªæ¯ä»;1=å·²æ¯ä»",index=26 ,width=10) |
| | | private Integer payStatus; |
| | | } |
| ÎļþÃû´Ó server/services/src/main/java/com/doumee/service/business/CasesService.java ÐÞ¸Ä |
| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Cases; |
| | | import com.doumee.dao.business.dto.PayOrderResponse; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å类信æ¯è¡¨Serviceå®ä¹ |
| | | * 订åè®°å½è¡¨ä¿¡æ¯è¡¨Serviceå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-01-27 16:02:37 |
| | | * @date 2026-02-02 11:10:42 |
| | | */ |
| | | public interface CasesService { |
| | | public interface OrdersService { |
| | | |
| | | /** |
| | | * å建 |
| | |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return Integer |
| | | */ |
| | | Integer create(Cases model); |
| | | Integer create(Orders model); |
| | | PayOrderResponse createPay(Orders model); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(Integer id); |
| | | void updateStatus(Cases cases); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(Cases model); |
| | | void delete(Orders model); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(Cases model); |
| | | void updateById(Orders model); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param model å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<Cases> model); |
| | | void updateByIdInBatch(List<Orders> model); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | |
| | | * @param id ä¸»é® |
| | | * @return model |
| | | */ |
| | | Cases findById(Integer id); |
| | | Orders findById(Integer id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return Cases |
| | | * @return Orders |
| | | */ |
| | | Cases findOne(Cases model); |
| | | Orders findOne(Orders model); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return List<Cases> |
| | | * @return List<Orders> |
| | | */ |
| | | List<Cases> findList(Cases model); |
| | | List<Orders> findList(Orders model); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<Cases> |
| | | * @return PageData<Orders> |
| | | */ |
| | | PageData<Cases> findPage(PageWrap<Cases> pageWrap); |
| | | PageData<Orders> findPage(PageWrap<Orders> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(Cases model); |
| | | long count(Orders model); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.allinpay.syb.lib.SybConstants; |
| | | import com.allinpay.syb.lib.SybUtil; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.dto.PayOrderParam; |
| | | import com.doumee.dao.business.dto.PayOrderResponse; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.OrdersMapper; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.OrdersService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.TreeMap; |
| | | |
| | | /** |
| | | * 订åè®°å½è¡¨ä¿¡æ¯è¡¨Serviceå®ç° |
| | | * @author doumee |
| | | * @date 2026-02-02 11:10:42 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class OrdersServiceImpl implements OrdersService { |
| | | |
| | | @Autowired |
| | | private OrdersMapper ordersMapper; |
| | | @Autowired |
| | | private SystemUserMapper systemUserMapper; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Integer create(Orders orders) { |
| | | return ordersMapper.insert(orders); |
| | | } |
| | | @Override |
| | | @Transactional |
| | | public PayOrderResponse createPay(Orders orders) { |
| | | if( orders.getType()==null |
| | | || StringUtils.isBlank(orders.getPhone()) |
| | | || StringUtils.isBlank(orders.getName()) |
| | | ||orders.getMoney()==null |
| | | ||orders.getMoney().compareTo(new BigDecimal("0.01")) < 0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请æç
§è¦æ±å¡«å仿¬¾ä¿¡æ¯ï¼"); |
| | | } |
| | | if(orders.getUserId()!=null){ |
| | | SystemUser user = systemUserMapper.selectById(orders.getUserId()); |
| | | if(user==null){ |
| | | orders.setUserId(null); |
| | | } |
| | | } |
| | | Date date = new Date(); |
| | | orders.setCreateTime(date); |
| | | orders.setPayStatus(Constants.ZERO); |
| | | orders.setStatus(Constants.ZERO); |
| | | orders.setPayMethod(Constants.ZERO); |
| | | ordersMapper.insert(orders); |
| | | return startPayDo(orders); |
| | | } |
| | | |
| | | private PayOrderResponse startPayDo(Orders orders) { |
| | | try { |
| | | PayOrderResponse r = new PayOrderResponse(); |
| | | PayOrderParam param = new PayOrderParam(); |
| | | param.setAppid(SybConstants.SYB_APPID); |
| | | param.setCusid(SybConstants.SYB_CUSID); |
| | | param.setVersion(SybConstants.VERSION); |
| | | param.setCharset("utf-8"); |
| | | param.setTrxamt("1"); |
| | | param.setReqsn(""+orders.getId()); |
| | | param.setReturl("http://localhost:8080/#/page/success/success"); |
| | | param.setNotify_url(SybConstants.NOTFIY_URL); |
| | | param.setNotify_url(""); |
| | | param.setBody(orders.getRemark()); |
| | | param.setValidtime( SybConstants.VALID_TIME); |
| | | param.setSigntype(SybConstants.SIGN_TYPE); |
| | | |
| | | String appkey = ""; |
| | | if(SybConstants.SIGN_TYPE.equals("RSA")){ |
| | | appkey = SybConstants.SYB_RSACUSPRIKEY; |
| | | } else if(SybConstants.SIGN_TYPE.equals("SM2")){ |
| | | appkey = SybConstants.SYB_SM2PPRIVATEKEY; |
| | | } else{ |
| | | appkey = SybConstants.SYB_MD5_APPKEY; |
| | | } |
| | | String sign = SybUtil.unionSign(getTreeMapByParam(param),appkey,param.getSigntype()); |
| | | param.setSign( sign); |
| | | r.setUrl(SybConstants.SYB_APIURL+"/h5unionpay/unionorder"); |
| | | r.setParam(param); |
| | | // String r = HttpsUtil.postJson(SybConstants.SYB_APIURL+"/h5unionpay/unionorder",JSONObject.toJSONString(param)); |
| | | // log.error(param); |
| | | return r; |
| | | }catch (Exception e){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼åèµ·æ¶æ¬¾è¯·æ±å¤±è´¥ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | } |
| | | |
| | | private TreeMap<String, String> getTreeMapByParam(PayOrderParam param) { |
| | | TypeReference< TreeMap<String, String> > type = new TypeReference< TreeMap<String, String> >() { }; |
| | | TreeMap<String, String> obj = JSONObject.parseObject(JSON.toJSONString(param), type.getType()); |
| | | return obj; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | ordersMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Orders orders) { |
| | | UpdateWrapper<Orders> deleteWrapper = new UpdateWrapper<>(orders); |
| | | ordersMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<Integer> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | ordersMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(Orders orders) { |
| | | ordersMapper.updateById(orders); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<Orders> orderss) { |
| | | if (CollectionUtils.isEmpty(orderss)) { |
| | | return; |
| | | } |
| | | for (Orders orders: orderss) { |
| | | this.updateById(orders); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Orders findById(Integer id) { |
| | | return ordersMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Orders findOne(Orders orders) { |
| | | QueryWrapper<Orders> wrapper = new QueryWrapper<>(orders).last("limit 1"); |
| | | return ordersMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<Orders> findList(Orders orders) { |
| | | QueryWrapper<Orders> wrapper = new QueryWrapper<>(orders); |
| | | return ordersMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<Orders> findPage(PageWrap<Orders> pageWrap) { |
| | | IPage<Orders> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<Orders> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getId() != null,Orders::getId, pageWrap.getModel().getId()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getDeleted() != null,Orders::getDeleted, pageWrap.getModel().getDeleted()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getCreateUser() != null,Orders::getCreateUser, pageWrap.getModel().getCreateUser()); |
| | | if (pageWrap.getModel().getCreateTime() != null) { |
| | | queryWrapper.lambda().ge(Orders::getCreateTime, Utils.Date.getStart(pageWrap.getModel().getCreateTime())); |
| | | queryWrapper.lambda().le(Orders::getCreateTime, Utils.Date.getEnd(pageWrap.getModel().getCreateTime())); |
| | | } |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getUpdateUser() != null,Orders::getUpdateUser, pageWrap.getModel().getUpdateUser()); |
| | | if (pageWrap.getModel().getUpdateTime() != null) { |
| | | queryWrapper.lambda().ge(Orders::getUpdateTime, Utils.Date.getStart(pageWrap.getModel().getUpdateTime())); |
| | | queryWrapper.lambda().le(Orders::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime())); |
| | | } |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getRemark() != null,Orders::getRemark, pageWrap.getModel().getRemark()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getStatus() != null,Orders::getStatus, pageWrap.getModel().getStatus()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getName() != null,Orders::getName, pageWrap.getModel().getName()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getUserId() != null,Orders::getUserId, pageWrap.getModel().getUserId()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getDetail() != null,Orders::getDetail, pageWrap.getModel().getDetail()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getImgurl() != null,Orders::getImgurl, pageWrap.getModel().getImgurl()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getSortnum() != null,Orders::getSortnum, pageWrap.getModel().getSortnum()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getType() != null,Orders::getType, pageWrap.getModel().getType()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getBrandId() != null,Orders::getBrandId, pageWrap.getModel().getBrandId()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getPhone() != null,Orders::getPhone, pageWrap.getModel().getPhone()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getMoney() != null,Orders::getMoney, pageWrap.getModel().getMoney()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getPayMethod() != null,Orders::getPayMethod, pageWrap.getModel().getPayMethod()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getPayOrderId() != null,Orders::getPayOrderId, pageWrap.getModel().getPayOrderId()); |
| | | if (pageWrap.getModel().getUpdateTime() != null) { |
| | | queryWrapper.lambda().ge(Orders::getPayDate, Utils.Date.getStart(pageWrap.getModel().getPayDate())); |
| | | queryWrapper.lambda().le(Orders::getPayDate, Utils.Date.getEnd(pageWrap.getModel().getPayDate())); |
| | | } |
| | | if (pageWrap.getModel().getUpdateTime() != null) { |
| | | queryWrapper.lambda().ge(Orders::getCancelDate, Utils.Date.getStart(pageWrap.getModel().getCancelDate())); |
| | | queryWrapper.lambda().le(Orders::getCancelDate, Utils.Date.getEnd(pageWrap.getModel().getCancelDate())); |
| | | } |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getCancelWay() != null,Orders::getCancelWay, pageWrap.getModel().getCancelWay()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getCancelInfo() != null,Orders::getCancelInfo, pageWrap.getModel().getCancelInfo()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getCancelUserId() != null,Orders::getCancelUserId, pageWrap.getModel().getCancelUserId()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getCancelStatus() != null,Orders::getCancelStatus, pageWrap.getModel().getCancelStatus()); |
| | | queryWrapper.lambda().eq(pageWrap.getModel().getPayStatus() != null,Orders::getPayStatus, pageWrap.getModel().getPayStatus()); |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(ordersMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | @Override |
| | | public long count(Orders orders) { |
| | | QueryWrapper<Orders> wrapper = new QueryWrapper<>(orders); |
| | | return ordersMapper.selectCount(wrapper); |
| | | } |
| | | } |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/zbom_dianjiang?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/diandongche?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | jackson: |
| | | time-zone: GMT+8 |
| | | date-format: yyyy-MM-dd HH:mm:ss |
| | | # mail: |
| | | # username: jiangping0849@outlook.com |
| | | # password: mwzaislgioyhxnig |
| | | # host: smtp-mail.outlook.com |
| | | # port: 587 |
| | | # default-encoding: UTF-8 |
| | | # properties: |
| | | # mail: |
| | | # debug: true |
| | | # smtp: |
| | | # ssl: |
| | | # socketFactory: |
| | | # class: com.sun.mail.util.MailSSLSocketFactory |
| | | # fallback: false |
| | | # auth: true |
| | | # starttls: |
| | | # enable: true |
| | | # required: true |
| | | |
| | | mail: |
| | | host: smtp.exmail.qq.com |
| | | username: jp@doumee.com |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/zbom_dianjiang?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/diandongche?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/zbom_dianjiang?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/diandongche?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #!/bin/bash |
| | | |
| | | killall java |
| | | |
| | | nohup java -jar /usr/local/jars/jinkuai/jinkuai_admin.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/jinkuai/jinkuai_web.jar > /dev/null 2>&1 & |
| | | |
| | | cd /data/jars/lianhelihua/logs |
| | | tail -f /data/jars/lianhelihua/logs/info.2025-05-19.1.log |