Просмотр исходного кода

Merge branch 'release_toaliyun_real' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_20230228

release_toaliyun_real
xhxu 3 лет назад
Родитель
Сommit
e6fb9ea373
5 измененных файлов: 261 добавлений и 18 удалений
  1. +242
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardInfoController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  3. +12
    -12
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
  4. +2
    -1
      mallinkService/src/main/java/com/iformall/service/park/impl/fute/FuteParkService.java
  5. +4
    -4
      mallinkService/src/main/java/com/iformall/service/park/impl/fute/FuteUtil.java

+ 242
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardInfoController.java Просмотреть файл

@@ -0,0 +1,242 @@
package com.iformall.controller.market;


import com.github.pagehelper.PageInfo;
import com.iformall.annotation.SystemControllerLog;
import com.iformall.common.ErrorCode;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxCardSpendVo;
import com.iformall.domain.vo.WxCardVo;
import com.iformall.enums.EnumMerchantSubsidySource;
import com.iformall.enums.EnumMerchantSubsidyType;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxCardInfoService;
import com.iformall.service.WxCardSpendService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* @author Stormeye Wu wuguoqiang@iformall.com
*/
@RestController
@RequestMapping("cardInfo")
@Api(description = "储值卡")
public class WxCardInfoController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
WxMerchantService wxMerchantService;

@Autowired
WxOrderService wxOrderService;

@Autowired
WxCardInfoService wxCardInfoService;

@Autowired
WxCardSpendService wxCardSpendService;

@ApiOperation("批次消费卡的卡列表")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
@SystemControllerLog(description = "储值卡支付-售卡记录列表")
public ResultData cardOrderList(@ModelAttribute WxCardVo wxCardVo, Integer pageNum, Integer pageSize) {
String ipStr = getIpAddr();
if (wxCardVo == null) {wxCardVo = new WxCardVo();}
else {
if(StringUtils.isBlank(wxCardVo.getOuPhone())) {
wxCardVo.setOuPhone(null);
}
}
wxCardVo.updateTenantInfo(getTenantInfo());
if(StringUtils.isNotBlank(wxCardVo.getStatusStr())) {
String [] statusAttr = wxCardVo.getStatusStr().split(",");
List<Integer> tmpList = new ArrayList<Integer>();
for(String status: statusAttr) {
tmpList.add(Integer.valueOf(status));
}
if(!tmpList.isEmpty()) {
wxCardVo.setStatusS(tmpList);
}
}
final PageInfo<WxCardVo> page = wxCardInfoService.listAsPage(wxCardVo, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("C端扫B端储值卡交易流水(消费记录 + 补贴)列表接口")
@GetMapping("cardSpendlist")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
@SystemControllerLog(description = "储值卡支付-储值卡交易流水")
public ResultData cardSpendlist(@ModelAttribute WxCardSpendVo wxCardSpendVo, Integer pageNum, Integer pageSize) {
String ipStr = getIpAddr();
logger.info("cardPay/cardSpendlist: " + ipStr);
if (wxCardSpendVo == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件为空");
}
wxCardSpendVo.updateTenantInfo(getTenantInfo());
if(StringUtils.isNotBlank(wxCardSpendVo.getPayStatusStr())) {
String [] statusAttr = wxCardSpendVo.getPayStatusStr().split(",");
List<Integer> tmpList = new ArrayList<Integer>();
for(String status: statusAttr) {
tmpList.add(Integer.valueOf(status));
}
if(!tmpList.isEmpty()) {
wxCardSpendVo.setPayStatusS(tmpList);
}
}
List<Integer> sources = new ArrayList<Integer>();
sources.add(EnumMerchantSubsidySource.CARD.getCode());
wxCardSpendVo.setSources(sources);
wxCardSpendVo.setCardSpendListShow(1);
final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpendVo, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("C端扫B端储值卡交易流水SUM")
@GetMapping("sum")
@SystemControllerLog(description = "储值卡支付-储值卡交易流水SUM")
public ResultData sumCardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend) {
String ipStr = getIpAddr();
logger.info("cardPay/sumCardSpendList: " + ipStr + " :" + wxCardSpend.toString());
if (wxCardSpend == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件为空");
}
wxCardSpend.updateTenantInfo(getTenantInfo());
List<Integer> sources = new ArrayList<Integer>();
sources.add(EnumMerchantSubsidySource.CARD.getCode());
wxCardSpend.setSources(sources);
wxCardSpend.setCardSpendListShow(1);
final List<Map<String, Object>> mapList = wxCardSpendService.sumCardSpendForMerchant(wxCardSpend);
return new ResultData(mapList);
}

@ApiOperation("交易流水导出")
@GetMapping("/exportData")
@SystemControllerLog(description = "储值卡支付-储值卡交易流水导出")
public void exportData(@ModelAttribute WxCardSpendVo wxCardSpendVo, HttpServletRequest request, HttpServletResponse response) {
logger.info("[" + getIpAddr() + "] cardPay/exportData");
if (wxCardSpendVo == null) {
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件为空");
}
wxCardSpendVo.updateTenantInfo(getTenantInfo());
if(StringUtils.isNotBlank(wxCardSpendVo.getPayStatusStr())) {
String [] statusAttr = wxCardSpendVo.getPayStatusStr().split(",");
List<Integer> tmpList = new ArrayList<Integer>();
for(String status: statusAttr) {
tmpList.add(Integer.valueOf(status));
}
if(!tmpList.isEmpty()) {
wxCardSpendVo.setPayStatusS(tmpList);
}
}
wxCardSpendService.exportData(wxCardSpendVo, request, response);
}

@ApiOperation("更新卡消费支付状态")
@PostMapping("/updatePayStatus")
@SystemControllerLog(description = "储值卡支付-更新卡消费支付状态")
public ResultData update(@RequestBody WxCardSpend wxCardSpend) {
String ipStr = getIpAddr();
logger.info("cardPay/updatePayStatus: " + ipStr + " :" + wxCardSpend.toString());
if (wxCardSpend == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件为空");
}
wxCardSpend.updateTenantInfo(getTenantInfo());
wxCardSpendService.update(wxCardSpend);
return new ResultData();
}

@ApiOperation("卡完结")
@PostMapping("/finishCard")
@SystemControllerLog(description = "储值卡支付-卡完结")
public ResultData finishCard(@RequestBody WxCardInfo wxCardInfo) {
String ipStr = getIpAddr();
logger.info("cardPay/finishCard: " + ipStr + " :" + wxCardInfo.toString());
if (wxCardInfo == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件为空");
}
if (wxCardInfo.getId() == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "过滤条件ID为空");
}
wxCardInfo.updateTenantInfo(getTenantInfo());
int remainShareAmount = wxCardSpendService.finishCard(wxCardInfo);
return new ResultData(remainShareAmount);
}

@ApiOperation("卡订单-导出数据")
@GetMapping("/exportCardOrder")
@SystemControllerLog(description = "卡订单-导出数据")
public void exportCardOrder(@ModelAttribute WxCardVo wxCardVo, HttpServletRequest request, HttpServletResponse response) {
logger.info("[" + getIpAddr() + "] cardPay/exportCardOrder");
if (wxCardVo == null) {
wxCardVo = new WxCardVo();
} else {
if (StringUtils.isBlank(wxCardVo.getOuPhone())) {
wxCardVo.setOuPhone(null);
}
}
wxCardVo.updateTenantInfo(getTenantInfo());
if (StringUtils.isNotBlank(wxCardVo.getStatusStr())) {
String[] statusAttr = wxCardVo.getStatusStr().split(",");
List<Integer> tmpList = new ArrayList<Integer>();
for (String status : statusAttr) {
tmpList.add(Integer.valueOf(status));
}
if (!tmpList.isEmpty()) {
wxCardVo.setStatusS(tmpList);
}
}
wxCardInfoService.exportData(wxCardVo, request, response);
}

@ApiOperation("卡消费订单-导出数据")
@GetMapping("exportCardSpend")
@SystemControllerLog(description = "卡消费订单-导出数据")
public void exportCardSpend(@ModelAttribute WxCardSpendVo wxCardSpendVo, HttpServletRequest request, HttpServletResponse response) {
String ipStr = getIpAddr();
logger.info("cardPay/exportCardSpend: " + ipStr);
if (wxCardSpendVo == null) {
wxCardSpendVo = new WxCardSpendVo();
}
wxCardSpendVo.updateTenantInfo(getTenantInfo());
if (StringUtils.isNotBlank(wxCardSpendVo.getPayStatusStr())) {
String[] statusAttr = wxCardSpendVo.getPayStatusStr().split(",");
List<Integer> tmpList = new ArrayList<Integer>();
for (String status : statusAttr) {
tmpList.add(Integer.valueOf(status));
}
if (!tmpList.isEmpty()) {
wxCardSpendVo.setPayStatusS(tmpList);
}
}
List<Integer> sources = new ArrayList<Integer>();
sources.add(EnumMerchantSubsidySource.CARD.getCode());
wxCardSpendVo.setSources(sources);
wxCardSpendVo.setCardSpendListShow(1);
wxCardSpendService.exportData(wxCardSpendVo, request, response);

}

}

+ 1
- 1
mallinkService/src/main/java/com/iformall/common/ErrorCode.java Просмотреть файл

@@ -357,7 +357,7 @@ public enum ErrorCode{
REFUND_NOT_ALLOW(12017, "退款订单不允许退款"),

APP_ID_NOT_ENABLE(12019, "小程序未启用"),
APP_ID_NOT_FOUND(12020, "APPID没找到"),
APP_ID_NOT_FOUND(12020, "未找到可用的小程序"),
MCH_INFO_NOT_FOUND(12021, "微信商户平台信息没找到"),
MCH_INFO_NOT_EQUAL(12022, "微信商户平台信息不对应"),
API_KEY_NOT_FOUND(12023, "支付密钥未配置"),


+ 12
- 12
mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java Просмотреть файл

@@ -304,24 +304,24 @@ public class WxMerchant extends TenantEntity {
public String getWeappPath() {
if(id == null)
return Constant.mainPageUrl;
return Constant.mainPageUrl + "?type=md&id=" + id;
return Constant.mainPageUrl + "?type=md&id=" + id + "&tenantId=" + tenantId;
}

public String getTtparams(){
return Constant.mainPageUrl;
}
public String getTtPath(){
JsonObject object = new JsonObject();
object.addProperty("type","md");
object.addProperty("id",id);
return object.toString();
}
// public String getTtparams(){
// return Constant.mainPageUrl;
// }
//
// public String getTtPath(){
// JsonObject object = new JsonObject();
// object.addProperty("type","md");
// object.addProperty("id",id);
// return object.toString();
// }

public String getWeappScene() {
if(id == null)
return "";
return "t:md:" + id;
return "t:md:" + id + ":" + tenantId;
}

@io.swagger.annotations.ApiModelProperty(value = "积分锁定0正常1锁定", name = "creditLocked")


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/park/impl/fute/FuteParkService.java Просмотреть файл

@@ -43,7 +43,8 @@ import com.iformall.utils.RedisLock;

/**
* 福特停车
*
* http://hsh.appykt.com/
* 1287230005_888888 123456
*/
@Service
public class FuteParkService extends BaseParkService implements ParkAdapterService {


+ 4
- 4
mallinkService/src/main/java/com/iformall/service/park/impl/fute/FuteUtil.java Просмотреть файл

@@ -51,10 +51,10 @@ import java.util.TimeZone;
@Slf4j
public class FuteUtil {

public static final String QUERY_PRICE = "http://p.appykt.com/zld/parkapi/query_price";
public static final String COUPON_CREATE = "http://p.appykt.com/zld/createTicketByApi";
public static final String COUPON_USE = "http://p.appykt.com/zld/useTicket";
public static final String NOTIFY_PAID = "http://p.appykt.com/zld/parkapi/pay_notify";
public static final String QUERY_PRICE = "http://s.appykt.com/zld/parkapi/query_price";
public static final String COUPON_CREATE = "http://s.appykt.com/zld/createTicketByApi";
public static final String COUPON_USE = "http://s.appykt.com/zld/useTicket";
public static final String NOTIFY_PAID = "http://s.appykt.com/zld/parkapi/pay_notify";

/**
* @description UTC时间转化为本地时间


Загрузка…
Отмена
Сохранить