| @@ -138,8 +138,19 @@ public class UserThirdCircleOrderController extends BaseController { | |||||
| } catch (ParseException e) { | } catch (ParseException e) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"timeEnd格式不正确"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"timeEnd格式不正确"); | ||||
| } | } | ||||
| if(StringUtils.isNotBlank(refundAmount) && (!NumberUtils.isCreatable(refundAmount) || Integer.parseInt(refundAmount) <= 0)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"refundAmount为非数字"); | |||||
| Integer refund = 0; | |||||
| if(StringUtils.isNotBlank(refundAmount)){ | |||||
| if(!NumberUtils.isCreatable(refundAmount)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"refundAmount为非数字"); | |||||
| } | |||||
| try { | |||||
| if(Integer.parseInt(refundAmount) < 0){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"refundAmount为正整数"); | |||||
| } | |||||
| } catch (NumberFormatException e) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"refundAmount为正整数"); | |||||
| } | |||||
| refund = Integer.parseInt(refundAmount); | |||||
| } | } | ||||
| if(StringUtils.isBlank(refundId)){ | if(StringUtils.isBlank(refundId)){ | ||||
| @@ -154,7 +165,9 @@ public class UserThirdCircleOrderController extends BaseController { | |||||
| thirdPartyOrders.setTransactionId(transactionId); | thirdPartyOrders.setTransactionId(transactionId); | ||||
| thirdPartyOrders.setTimeEnd(refundTimeDate); | thirdPartyOrders.setTimeEnd(refundTimeDate); | ||||
| thirdPartyOrders.setSummary(refundSummary); | thirdPartyOrders.setSummary(refundSummary); | ||||
| thirdPartyOrders.setRefundAmount(Integer.parseInt(refundAmount)); | |||||
| if(refund > 0){ | |||||
| thirdPartyOrders.setRefundAmount(refund); | |||||
| } | |||||
| thirdPartyOrders.setRefundId(refundId); | thirdPartyOrders.setRefundId(refundId); | ||||
| try{ | try{ | ||||
| @@ -199,9 +212,13 @@ public class UserThirdCircleOrderController extends BaseController { | |||||
| if(StringUtils.isBlank(userNumber)){ | if(StringUtils.isBlank(userNumber)){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"userNumber为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"userNumber为空"); | ||||
| } | } | ||||
| if(StringUtils.isNotBlank(userPhone) && !userPhone.matches("^1[0-9]{10}$")){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"userPhone格式不正确"); | |||||
| if(StringUtils.isNotBlank(userPhone)){ | |||||
| logger.info("phone+"+userPhone); | |||||
| if(!userPhone.matches("^1[0-9]{10}$")){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"userPhone格式不正确"); | |||||
| } | |||||
| } | } | ||||
| if(timeEnd == null){ | if(timeEnd == null){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"timeEnd为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"timeEnd为空"); | ||||
| } | } | ||||
| @@ -39,7 +39,7 @@ public class AppTest { | |||||
| /** | /** | ||||
| * 查询用户详细信息 参数 | * 查询用户详细信息 参数 | ||||
| */ | */ | ||||
| paramMap.put("phone","18872592633"); | |||||
| // paramMap.put("phone","18872592633"); | |||||
| // paramMap.put("openId","opvcM5A41kbQF_NY8k3LMDqxCDUM"); | // paramMap.put("openId","opvcM5A41kbQF_NY8k3LMDqxCDUM"); | ||||
| @@ -69,15 +69,15 @@ public class AppTest { | |||||
| /** | /** | ||||
| * 积分抵扣 参数 | * 积分抵扣 参数 | ||||
| */ | */ | ||||
| // IdWorker idWorker = IdWorker.get(); | |||||
| // paramMap.put("transactionId",String.valueOf(idWorker.nextId()));//***订单Id | |||||
| // paramMap.put("shopNumber","1001");//***门店唯一标识 对应双方平台门店 | |||||
| // paramMap.put("shopName","百丽");//门店名称 | |||||
| // paramMap.put("userNumber","546907706202185728");//***会员Id546907706202185728 | |||||
| IdWorker idWorker = IdWorker.get(); | |||||
| paramMap.put("transactionId",String.valueOf(idWorker.nextId()));//***订单Id | |||||
| paramMap.put("shopNumber","1001");//***门店唯一标识 对应双方平台门店 | |||||
| paramMap.put("shopName","百丽");//门店名称 | |||||
| paramMap.put("userNumber","546907706202185728");//***会员Id546907706202185728 | |||||
| // paramMap.put("userPhone","18872592633");//会员手机号 | // paramMap.put("userPhone","18872592633");//会员手机号 | ||||
| // paramMap.put("timeEnd","2021-04-26 11:43:00");//***积分抵扣时间 | |||||
| // paramMap.put("amount","100");//***付款金额(分) | |||||
| // paramMap.put("summary","我要换东西");//付款摘要 | |||||
| paramMap.put("timeEnd","2021-04-26 11:43:00");//***积分抵扣时间 | |||||
| paramMap.put("amount","100");//***付款金额(分) | |||||
| paramMap.put("summary","我要换东西");//付款摘要 | |||||
| /** | /** | ||||
| @@ -91,7 +91,7 @@ public class AppTest { | |||||
| /** | /** | ||||
| * 注册并查询用户详细信息 接口 | * 注册并查询用户详细信息 接口 | ||||
| */ | */ | ||||
| String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/userInfo/register", headMap, JSON.toJSONString(paramMap)); | |||||
| // String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/userInfo/register", headMap, JSON.toJSONString(paramMap)); | |||||
| /** | /** | ||||
| * 注册并查询用户详细信息 接口 | * 注册并查询用户详细信息 接口 | ||||
| @@ -114,7 +114,7 @@ public class AppTest { | |||||
| /** | /** | ||||
| * 交易退款 接口 | * 交易退款 接口 | ||||
| */ | */ | ||||
| // String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/thirdCircle/pointDeduction", headMap, JSON.toJSONString(paramMap)); | |||||
| String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/thirdCircle/pointDeduction", headMap, JSON.toJSONString(paramMap)); | |||||
| System.out.println(s); | System.out.println(s); | ||||
| @@ -151,9 +151,9 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||||
| if(userId != null){ | if(userId != null){ | ||||
| basicInfo = wxCUserBasicInfoService.getById(userId, record.getFinalTenantId()); | basicInfo = wxCUserBasicInfoService.getById(userId, record.getFinalTenantId()); | ||||
| } | } | ||||
| if(basicInfo == null){ | |||||
| basicInfo = wxCUserBasicInfoService.registerByPhone(record, record.getUserPhone(),null,null,null); | |||||
| } | |||||
| // if(basicInfo == null && StringUtils.isNotBlank(record.getUserPhone())){ | |||||
| // basicInfo = wxCUserBasicInfoService.registerByPhone(record, record.getUserPhone(),null,null,null); | |||||
| // } | |||||
| if(basicInfo != null){ | if(basicInfo != null){ | ||||
| record.setCUserId(basicInfo.getId()); | record.setCUserId(basicInfo.getId()); | ||||