| @@ -15,6 +15,8 @@ import com.simple.service.WxMerchantService; | |||
| import com.simple.service.WxParkService; | |||
| import com.simple.utils.ETCPUtil; | |||
| import com.simple.utils.TJDCarUtil; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.log4j.Logger; | |||
| @@ -107,18 +109,21 @@ public class WxCarController extends BaseController | |||
| " {...},\n" + | |||
| " {...}\n" + | |||
| " ]}}\n") | |||
| @PostMapping("/quanTemplate") | |||
| public ResultData quanTemplate(Map<String, String > paramMap) { | |||
| logger.info("quanTemplate: " + paramMap.toString()); | |||
| @GetMapping("/quanTemplate") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="merchantId",value="商户ID",dataType="String", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData quanTemplate(String merchantId, Integer pageNum, Integer pageSize) { | |||
| logger.info("quanTemplate: " + merchantId.toString()); | |||
| MallUserInfo user = getUser(); | |||
| /// 1, get mall's park | |||
| WxPark park = getCurrentPark(user); | |||
| if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | |||
| String merchantIdStr = paramMap.get("merchantId"); | |||
| if (StringUtils.isBlank(merchantIdStr)) { | |||
| if (StringUtils.isBlank(merchantId)) { | |||
| // 优先从从商户表里取 | |||
| logger.error("quanTemplate failed, merchantId为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户为空"); | |||
| } | |||
| String params = park.getVendorParams(); | |||
| JSONObject objParams = JSON.parseObject(params); | |||
| @@ -130,7 +135,7 @@ public class WxCarController extends BaseController | |||
| // bussinessId from 参数信息 | |||
| String businessId = ""; | |||
| // 优先从从商户表里取 | |||
| businessId = getETCPBusinessID(merchantIdStr); | |||
| businessId = getETCPBusinessID(merchantId); | |||
| if (StringUtils.isBlank(businessId)) { | |||
| // 1期只有一个虚拟商户,可以写在商场配置里 | |||
| businessId = objParams.getString("businessId"); | |||
| @@ -141,7 +146,7 @@ public class WxCarController extends BaseController | |||
| return new ResultData(retObj.getJSONObject("data")); | |||
| } else { | |||
| logger.error("quanTemplate failed, 优免券模板未发现"); | |||
| return new ResultData(ErrorCode.ETCP_QUAN_TEMP_FAIL.getCode(), "优免券模板未发现"); | |||
| return new ResultData(ErrorCode.ETCP_QUAN_TEMP_FAIL.getCode(), "优免券模板未发现", retObj); | |||
| } | |||
| } | |||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "优免券模板失败"); | |||