app更改

This commit is contained in:
liuyingfang 2023-12-19 09:11:25 +08:00
parent 1f10f10a7c
commit ad88ec4da3
5 changed files with 116 additions and 17 deletions

View File

@ -78,6 +78,7 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
limitUri.add("/api/device/stock/checkNum");
limitUri.add("/api/device/stock/bindtablecode");
limitUri.add("/api/userApp/getUserId");
limitUri.add("/api/payConfig/appconfig");
boolean passFlag = limitUri.stream().anyMatch(s -> s.equals(requestUri) || requestUri.startsWith(s));
if (passFlag) {
return true;

View File

@ -93,6 +93,19 @@ public class FileUtil {
}
public static String readFile(String fileName) throws IOException {
StringBuilder fileContent = new StringBuilder();
BufferedReader br = new BufferedReader(new FileReader(fileName));
String line;
while ((line = br.readLine()) != null) {
fileContent.append(line).append(System.lineSeparator());
}
return fileContent.toString();
}
/**
* 根据文件路径读取byte[] 数组
*/

View File

@ -27,7 +27,21 @@ public enum MccAndStore {
FLOWER(10,"5992"),
WATER(11,"7299")
WATER(11,"7299"),
VISIT(12, "5691"),
JEWELRY(13,"5719"),
DIGITAL(14,"5732"),
BOOKS(15,"5942"),
BUYING(16,"5310"),
MOTHER(17,"5641"),
HIGH(18,"5691")
;
private final Integer value;

View File

@ -118,7 +118,7 @@ public class AlipayServiceImpl implements AlipayService {
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", ParametersUtil.ZY_ALI_APP_ID,
ParametersUtil.ZY_PRI, "json", "UTF-8", ParametersUtil.ZY_PUB, "RSA2");
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
request.setNotifyUrl(ParametersUtil.domain+"/wap/merchant/aliCallBack");
request.setNotifyUrl(ParametersUtil.domain+"/wap/merchant/aliDeviceCallBack");
request.setReturnUrl("");
JSONObject bizContent = new JSONObject();
bizContent.put("out_trade_no", mercOrder.getOrderNo());

View File

@ -9,6 +9,9 @@ import cn.pluss.platform.annotation.NoRepeatSubmit;
import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultCode;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.device.MercOrderDetailService;
import cn.pluss.platform.device.MercOrderNewService;
import cn.pluss.platform.device.MercShopTrolleyService;
import cn.pluss.platform.deviceStock.DeviceStockService;
import cn.pluss.platform.dto.AccountDTO;
import cn.pluss.platform.dto.RealFansDTO;
@ -79,8 +82,10 @@ import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradeCreateRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import com.alipay.api.response.AlipayTradeCreateResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
@ -89,9 +94,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
@ -204,36 +211,55 @@ public class MerchantController {
@Resource
private JftReceiptOrderMapper jftReceiptOrderMapper;
@Resource
private MercOrderNewService mercOrderNewService;
@Resource
private MercOrderDetailService mercOrderDetailService;
@Autowired
private MercShopTrolleyService mercShopTrolleyService;
@Value("${path}")
private String path;
/*@GetMapping("/auth/aKfAirN1hO.txt")
@ResponseBody
public String aKfAirN1hO() {
return "3cdbacb2d4ceefa36ef1c43d0c562fb9";
}*/
@GetMapping("/auth/ODzUwrTrcr.txt")
@GetMapping("/auths/{filePath}")
@ResponseBody
public String aKfAirN1hO() {
return "68eb6c8f59bf143e3165aa5198c6905f";
public String OeUIoBWT9l(@PathVariable("filePath") String filePath) {
try {
String filecontent=FileUtil.readFile(path.concat(filePath));
return filecontent;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@GetMapping("/auth/Hhk6kRGkb7.txt")
@ResponseBody
public String Hhk6kRGkb7() {
return "c9b7ead4b4b0efd96c335aad9d445f04";
}
@GetMapping("/auth/OeUIoBWT9l.txt")
@ResponseBody
public String OeUIoBWT9l() {
return "d8bd54ca68da9a76d473f246c8821ad0";
}
@GetMapping("/OeUIoBWT9l.txt")
@GetMapping("/{path}")
@ResponseBody
public String OeUIoBWT9l1() {
return "d8bd54ca68da9a76d473f246c8821ad0";
}
@GetMapping("/Hhk6kRGkb7.txt")
@ResponseBody
public String HhkGkb7(){return "c9b7ead4b4b0efd96c335aad9d445f04";}
@GetMapping("/JMLTYEDRru.txt")
@ResponseBody
public String HhkGkb(){return "6573ac68aee6cf17704526a136b9fb76";}
@GetMapping("/wVd03mU19R.txt")
@ResponseBody
public String wVd03mU(){return "6a7620e15818a9e4e7c6b52fecd19788";}
@GetMapping("/account/auth")
public String accountAuth(HttpServletResponse response, HttpServletRequest request) {
@ -2423,6 +2449,51 @@ public class MerchantController {
return code;
}
@RequestMapping("/aliDeviceCallBack")
@ResponseBody
public String getaliDeviceCallBack() throws Exception {
Map<String, Object> params = HttpUrlConnection.convertRequestParamsToMap(this.request);
log.info("===params====" + params);
String paramsJson = JSON.toJSONString(params);
log.info("zhifubaohuidiao{}", paramsJson);
String tradeStatus = (String) params.get("trade_status");
log.info("=====tradeStatus=====" + tradeStatus);
if ("TRADE_SUCCESS".equals(tradeStatus)) {
String orderNumber = (String) params.get("out_trade_no");// 商家订单号
String buyer_id = (String) params.get("buyer_id");// 支付宝唯一识别用户码
UpdateWrapper<MercOrderDetail> updateDetail = new UpdateWrapper<>();
updateDetail.eq("orderNo",orderNumber).set("status","01");
mercOrderDetailService.update(updateDetail);
UpdateWrapper<MercOrderNew> updateOrderNew = new UpdateWrapper<>();
updateOrderNew.eq("orderNo",orderNumber).set("status","01").set("transNo",buyer_id);
mercOrderNewService.update(updateOrderNew);
// 清除购物车的数据
LambdaQueryWrapper<MercOrderDetail> qWrapper = Wrappers.lambdaQuery();
qWrapper.eq(MercOrderDetail::getOrderNo, orderNumber);
List<MercOrderDetail> orderDetailList = mercOrderDetailService.list(qWrapper);
List<Long> shopTrolleyIdList = new ArrayList<>();
for (MercOrderDetail item : orderDetailList) {
shopTrolleyIdList.add(item.getShopTrolleyId());
}
LambdaQueryWrapper<MercShopTrolley> qWrapper2 = Wrappers.lambdaQuery();
qWrapper2.in(MercShopTrolley::getId, shopTrolleyIdList);
mercShopTrolleyService.remove(qWrapper2);
return "success";
}
return "failure";
}
/**
* toUpDateMerchantOrder:(修改订单状态[支付宝发起的] 有bug 必须在用户支付完成之后点右上角的完成才会触发 这里照样保留该方法
* 在上面的getaliCallBack()方法也会进行这个修改订单的处理). <br/>