Commit 5829c685 authored by 张永's avatar 张永

V1.1.7.8.4

parent 869e05d2
......@@ -209,7 +209,7 @@
</executions>
<configuration>
<repository>dockerhub.linkfern.com/b2c/shopapi</repository>
<tag>V1.1.7.8.3</tag>
<tag>V1.1.7.8.4</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
......
......@@ -26,10 +26,12 @@ import com.egolm.common.HttpUtil;
import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page;
import com.egolm.common.web.ServletUtil;
import com.egolm.shop.api.service.OrderService;
import com.egolm.shop.bean.RespObject;
import com.egolm.shop.common.XException;
import com.egolm.shop.common.component.IDCLogResource;
import com.egolm.shop.common.utils.I18NUtils;
import com.egolm.shop.common.utils.XmlUtil;
import io.swagger.annotations.Api;
......@@ -91,6 +93,79 @@ public class OrderController {
return orderService.submit(jsonObj);
}
//https://showdoc.linkfern.com/web/#/38/895
@ApiOperation("B2B订单提交V2")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = true, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = true, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "shopNO", dataType = "String", required = true, value = "店铺编码", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "payTypeID", dataType = "String", required = true, value = "订单付款类型", defaultValue = "1"),
@ApiImplicitParam(paramType = "query", name = "addrID", dataType = "String", required = true, value = "收货人地址ID", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "orderMemo", dataType = "String", required = true, value = "订单备注", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "balanceAmount", dataType = "String", required = false, value = "分账余额", defaultValue = "需求 #17203"),
@ApiImplicitParam(paramType = "query", name = "payDetails", dataType = "String", required = false, value = "付款详情JSON格式", defaultValue = "需求 #17402"),
})
@RequestMapping(value = "/submitV2",method=RequestMethod.POST,produces = "application/json")
@IDCLogResource(name="B2B订单提交V2")
public String submitV2(HttpServletRequest request) {
String shopNO = request.getParameter("shopNO");
String langID = request.getParameter("langID");
String payTypeID = request.getParameter("payTypeID");
String terminal = request.getParameter("terminal");
String addrID = request.getParameter("addrID");
String orderMemo = request.getParameter("orderMemo");
String balanceAmount = request.getParameter("balanceAmount");
String payDetails = request.getParameter("payDetails");
if(StringUtil.isNotUndefinedAndNull(balanceAmount)) {
}else {
balanceAmount = "0";
}
if(!StringUtil.isNotEmpty(shopNO,payTypeID,addrID)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(langID, "Msg_Parameter_empty")).toJson();
}
Map<String,Object> map = new HashMap<String,Object>();
map.put("shopNO", shopNO);
map.put("payTypeID", payTypeID);
map.put("terminal", terminal);
map.put("addrID", addrID);
map.put("orderMemo", orderMemo);
map.put("balanceAmount", balanceAmount);
map.put("payDetails", payDetails);
return orderService.submitV2(map);
}
//https://showdoc.linkfern.com/web/#/38/896
@ApiOperation("B2B订单支付提交V2")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = true, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = true, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "shopNO", dataType = "String", required = true, value = "店铺编码", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "salesOrderID", dataType = "String", required = true, value = "订单号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "goodsList", dataType = "String", required = true, value = "商品列表", defaultValue = ""),
})
@RequestMapping(value = "/paySubmitV2",method=RequestMethod.POST)
@IDCLogResource(name="B2B订单支付提交V2")
public String paySubmitV2(HttpServletRequest request) {
String langID = request.getParameter("langID");
String shopNO = request.getParameter("shopNO");
String salesOrderID = request.getParameter("salesOrderID");
String goodsList = request.getParameter("goodsList");
if(!StringUtil.isNotEmpty(shopNO,salesOrderID)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(langID, "Msg_Parameter_empty")).toJson();
}
Map<String,Object> map = new HashMap<String,Object>();
map.put("shopNO", shopNO);
map.put("salesOrderID", salesOrderID);
map.put("goodsList", goodsList);
map.put("ipaddress", ServletUtil.remoteIp(request));
return orderService.paySubmitV2(map);
}
@ApiOperation("获取主订单列表")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name="orgNo", dataType = "String", required = true),
......
package com.egolm.shop.api.service;
import java.math.BigDecimal;
import com.alibaba.fastjson.JSONObject;
public interface CrmService {
public void vUpdateAcceptCoupon(String StoreNO, String CouponNO, BigDecimal PayAmount, BigDecimal TotalRealSaleAmount, String OutTradeNO, String cashier, String hostname, String ipaddress);
public void couponVerification(String StoreNO, String CouponNO, String SalesOrderID, BigDecimal AcceptAmount, BigDecimal TotalRealSaleAmount, String OutTradeNO, String GoodsList, String cashier,String isOnline,String payTypeID);
public void vUpdateMemPoint(int TradeType, String StoreNO, String CardNO, BigDecimal PayPoint, String OutTradeNO, String cashier, String hostname, String ipaddress);
public JSONObject getVCardInfo(String StoreNO, String CardNO) ;
public void vCardPay(String StoreNO, String CardNO, BigDecimal PayAmount, String PosNO, String OutTradeNO, String cashier, String hostname, String ipaddress);
public void vCardRefund(String StoreNO, String PayCardNO, BigDecimal PayAmount, String PosNO, String OutTradeNO, String OldTransTraceNO, String cashier, String hostname, String ipaddress);
public void vCancelAcceptCoupon(String StoreNO, String PayCardNO, String OutTradeNO, String cashier, String hostname, String ipaddress) ;
}
......@@ -16,6 +16,10 @@ public interface OrderService {
public String submit(JSONObject submitObj);
public String submitV2(Map<String,Object> map);
public String paySubmitV2(Map<String,Object> map);
public String queryOrderList(String orgNo, String shopNo,String agentID, Integer status, String[] orderType, String langID, Page page);
public String queryOrderDetailList(String salesOrderId,String agentID);
......
package com.egolm.shop.common.config;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
import com.egolm.common.HttpUtil;
import com.egolm.common.StringUtil;
@Component
public class CrmClient {
@Value("${crm.baseUrl}")
private String baseUrl;
@Value("${crm.appid}")
private String appid;
@Value("${crm.secret}")
private String secret;
private static final Log log = LogFactory.getLog(CrmClient.class);
public String post(String url, Map<String, Object> parameters) {
for(String key : parameters.keySet()) {
Object val = parameters.get(key);
if(val == null) {
parameters.put(key, "");
}
}
String requestUrl = this.baseUrl + "/" + url;
log.debug("RequestUrl: " + requestUrl);
String timestamp = String.valueOf(System.currentTimeMillis()/1000L);
parameters.put("appid", this.appid);
parameters.put("timestamp", timestamp);
Map<String, Object> signMap = new TreeMap<String, Object>(parameters);
String queryString = HttpUtil.formatToQueryString(signMap) + "&APP_SECRET=" + this.secret;
log.debug("SignQueryString: " + queryString);
String md5String = StringUtil.toMD5HexString(queryString);
parameters.put("sign", md5String);
//String result = HttpCommon.post(requestUrl, parameters);
String result = HttpUtil.post(requestUrl, parameters);
log.debug("Result: " + result);
return result;
}
public String get(String url, Map<String, Object> parameters) {
for(String key : parameters.keySet()) {
Object val = parameters.get(key);
if(val == null) {
parameters.put(key, "");
}
}
String requestUrl = this.baseUrl + "/" + url;
log.debug("RequestUrl: " + requestUrl);
String timestamp = String.valueOf(System.currentTimeMillis()/1000L);
parameters.put(appid, this.appid);
parameters.put(timestamp, timestamp);
Map<String, Object> signMap = new TreeMap<String, Object>(parameters);
String signString = HttpUtil.formatToQueryString(signMap) + "&APP_SECRET=" + this.secret;
log.debug("SignQueryString: " + signString);
String md5String = StringUtil.toMD5HexString(signString);
parameters.put("sign", md5String);
String result = HttpUtil.get(requestUrl, parameters);
log.debug("Result: " + result);
return result;
}
public static void main(String[] args) {
String appid = "d30cde80e5ac42479c5551a5c00f3717";
String secret = "d0ca67eebe6c4c53996b9b310999fccd";
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("beginpoint", "0");
parameters.put("cardno", "8800168722");
parameters.put("cashier", "wxuser");
parameters.put("hostname", "wxhost");
parameters.put("ipaddress", "127.0.0.1");
parameters.put("receiptid", "");
parameters.put("storeno", "E800");
parameters.put("tradetime", "2020-07-15 17:45:00");
parameters.put("tradetype", "2");
parameters.put("updatepoint", "-250.00");
parameters.put("timestamp", "1594806300");
parameters.put("appid", appid);
Map<String, Object> signMap = new TreeMap<String, Object>(parameters);
String queryString = HttpUtil.formatToQueryString(signMap) + "&APP_SECRET=" + secret;
System.out.println(queryString);
String md5String = StringUtil.toMD5HexString(queryString);
parameters.put("sign", md5String);
System.out.println(JSON.toJSONString(parameters));
}
}
logging.level.com.egolm=debug
logging.level.com.egolm=debug
......@@ -101,8 +101,9 @@ log.datasource.filters=stat,log4j
crm.baseUrl: https://dev.linkfern.com/b2b-crm/
crm.appid: d30cde80e5ac42479c5551a5c00f3717
crm.secret: d0ca67eebe6c4c53996b9b310999fccd
opt.express.url=https://service-5ptj62bx-1257101137.ap-shanghai.apigateway.myqcloud.com/release/express/query
......
......@@ -24,6 +24,8 @@
</head>
<body>
<div id="app">
<el-divider content-position="left">V1.1.7.8.4 2024-9-18</el-divider>
<p class="title">1.需求 #17402</p>
<el-divider content-position="left">V1.1.7.8.3 2024-8-23</el-divider>
<p class="title">1.需求 #17240</p>
<p class="title">2. 订单提交增加参数,需求 #17203,需求 #17271</p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment