记得上下班打卡 | git大法好,push需谨慎

Commit 7762dfd9 authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/dev' into dev

parents fe62d20c 48050359
...@@ -22,6 +22,6 @@ public interface IDragonOrderRefundsService { ...@@ -22,6 +22,6 @@ public interface IDragonOrderRefundsService {
String wePayRefundCallBack(HttpServletRequest request , HttpServletResponse response); String wePayRefundCallBack(HttpServletRequest request , HttpServletResponse response);
String aliPayRefundCodeStatus(String outTradeNo ,String tradeNo ,String outBizNo,String callBackUrl);
} }
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
</div> </div>
<div> <div>
<span>票种说明:</span> <span>票种说明:</span>
<span th:text="${dict2.title}"></span> <span th:text="${dict2.describes}"></span>
</div> </div>
<div th:if="${dict2.isElectronic==1}"> <div th:if="${dict2.isElectronic==1}">
<span>电子票说明:</span> <span>电子票说明:</span>
......
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
<div th:text="*{totalGeneral}">80</div> <div th:text="*{totalGeneral}">80</div>
</div> </div>
</div> </div>
<div class="col-lg-1"> <!-- <div class="col-lg-1">-->
<div> <!-- <div>-->
<div>已兑换总数(张)</div> <!-- <div>已兑换总数(张)</div>-->
<div th:text="*{totalExchange}">0</div> <!-- <div th:text="*{totalExchange}">0</div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<!-- <div class="col-lg-1">--> <!-- <div class="col-lg-1">-->
<!-- <div>--> <!-- <div>-->
<!-- <div>兑换库存(张)</div>--> <!-- <div>兑换库存(张)</div>-->
...@@ -100,9 +100,9 @@ ...@@ -100,9 +100,9 @@
<th> <th>
<div class="cell">销售额(元)</div> <div class="cell">销售额(元)</div>
</th> </th>
<th> <!-- <th>-->
<div class="cell">兑换数量</div> <!-- <div class="cell">兑换数量</div>-->
</th> <!-- </th>-->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -137,9 +137,9 @@ ...@@ -137,9 +137,9 @@
<td> <td>
<div class="cell" th:text="${respBean.totalSalePrice}">0</div> <div class="cell" th:text="${respBean.totalSalePrice}">0</div>
</td> </td>
<td> <!-- <td>-->
<div class="cell" th:text="${respBean.totalExchange}">0</div> <!-- <div class="cell" th:text="${respBean.totalExchange}">0</div>-->
</td> <!-- </td>-->
</tr> </tr>
</tbody> </tbody>
</table> </table>
......
...@@ -447,10 +447,6 @@ public abstract class StringUtil { ...@@ -447,10 +447,6 @@ public abstract class StringUtil {
sb.append(right(bankId, 4)); sb.append(right(bankId, 4));
return sb.toString(); return sb.toString();
} }
public static void main(String[] args) {
System.out.println(isEmail("123@qq.com"));
}
public static boolean isBlank(CharSequence cs) { public static boolean isBlank(CharSequence cs) {
...@@ -598,4 +594,31 @@ public abstract class StringUtil { ...@@ -598,4 +594,31 @@ public abstract class StringUtil {
} }
return false; return false;
} }
public static void main(String[] args) {
System.out.println(isEmail("123@qq.com#$%^&*()"));
String regEx="[\n`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。, 、?]";
//可以在中括号内加上任何想要替换的字符,实际上是一个正则表达式
String aa = "";//这里是将特殊字符换为aa字符串," "代表直接去掉
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher("原字符串");//这里把想要替换的字符串传进来
String newString = m.replaceAll(aa).trim();
System.out.println("newString====="+newString);
//将替换后的字符串存在变量newString中
//方法二 如果第一种太麻烦可以直接用下面的
String str = "#$%^&*()我的正确#$%^&*()原字符串#$%^&*()";
String newString2 = str.replaceAll(regEx,aa).trim();//不想保留原来的字符串可以直接写成 “str = str.replaceAll(regEX,aa);”
System.out.println("newString2====="+newString2);
}
} }
...@@ -125,8 +125,8 @@ public class AdamUserController { ...@@ -125,8 +125,8 @@ public class AdamUserController {
// editVo.setAvatar(parameter.getAvatar()); // editVo.setAvatar(parameter.getAvatar());
// editVo.setBackground(parameter.getBackground()); // editVo.setBackground(parameter.getBackground());
// editVo.setNickname(parameter.getNickname()); // editVo.setNickname(parameter.getNickname());
editVo.setAvatar(editVo.getAvatar()); editVo.setAvatar(StringUtils.isEmpty(editVo.getAvatar()) ? avatarDefUrl : editVo.getAvatar());
editVo.setBackground(editVo.getBackground()); editVo.setBackground(StringUtils.isEmpty(editVo.getBackground()) ? backgroundDefUrl : editVo.getBackground());
editVo.setNickname(editVo.getNickname()); editVo.setNickname(editVo.getNickname());
editVo.setSex(sex); editVo.setSex(sex);
editVo.setBirthday(parameter.getBirthday()); editVo.setBirthday(parameter.getBirthday());
......
...@@ -89,14 +89,14 @@ public class PayController { ...@@ -89,14 +89,14 @@ public class PayController {
dragonPayBaseReqDto.setOpenId(openId); dragonPayBaseReqDto.setOpenId(openId);
dragonPayBaseReqDto.setType(type); dragonPayBaseReqDto.setType(type);
dragonPayBaseReqDto.setPrice(price); dragonPayBaseReqDto.setPrice(price);
if(StringUtil.isNotNull(name)&&name.length()>=32){ // if(StringUtil.isNotNull(name)&&name.length()>=32){
name = name.substring(0,32); // name = name.substring(0,32);
} // }
dragonPayBaseReqDto.setName(name); dragonPayBaseReqDto.setName("正在现场");
if(StringUtil.isNotNull(detail)&&detail.length()>=64){ // if(StringUtil.isNotNull(detail)&&detail.length()>=64){
detail = detail.substring(0,64); // detail = detail.substring(0,64);
} // }
dragonPayBaseReqDto.setDetail(detail); dragonPayBaseReqDto.setDetail("正在现场");
dragonPayBaseReqDto.setOrderCode(orderCode); dragonPayBaseReqDto.setOrderCode(orderCode);
dragonPayBaseReqDto.setClientIp(clientIp); dragonPayBaseReqDto.setClientIp(clientIp);
dragonPayBaseReqDto.setNotifyUrl(notifyUrl); dragonPayBaseReqDto.setNotifyUrl(notifyUrl);
......
...@@ -46,4 +46,16 @@ public class RefundController { ...@@ -46,4 +46,16 @@ public class RefundController {
return orderRefundsService.wePayRefundCallBack(request, response); return orderRefundsService.wePayRefundCallBack(request, response);
} }
@PostMapping("refund/alipay/result")
@ApiOperation("支付宝查询退款结果")
@ApiResponse(code = 200, message = "接口返回对象参数")
public String refundSingle(
@RequestParam(value = "orderCode") String orderCode,
@RequestParam(value = "paymentId") String paymentId,
@RequestParam(value = "orderRefundCode") String orderRefundCode,
@RequestParam(value = "callBackUrl") String callBackUrl) {
return orderRefundsService.aliPayRefundCodeStatus(orderCode, paymentId, orderRefundCode, callBackUrl);
}
} }
...@@ -384,7 +384,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -384,7 +384,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundAt(refundAt); dto.setRefundAt(refundAt);
dto.setRefundError(callBackDto.getReturnMsg()); dto.setRefundError(callBackDto.getReturnMsg());
log.debug("SEND WEPAY NOTIFTURL = " + JSON.toJSONString(dto)); log.debug("SEND WEPAY NOTIFTURL = " + JSON.toJSONString(dto));
sendNotifyUrl(dto); sendNotifyUrl(dto,null);
mqHandleUtil.sendMySqlRedis( mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"), SqlMapping.get("dragon_order_refund_log.insert"),
...@@ -412,6 +412,63 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -412,6 +412,63 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
} }
} }
@Override
public String aliPayRefundCodeStatus(String outTradeNo, String tradeNo, String outBizNo,String callBackUrl) {
try {
LocalDateTime nowTime = LocalDateTime.now();
AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();//创建API对应的request类
request.setBizContent("{" +
"\"out_trade_no\":\"" + outTradeNo + "\"," +
"\"trade_no\":\"" + tradeNo + "\"," +
"\"out_request_no\":\"" + outBizNo + "\"}"); //设置业务参数
AlipayTradeFastpayRefundQueryResponse response = PayAlipayUtils.getInstance().getHttpClient().execute(request);
log.info("AlipayTradeFastpayRefundQueryRequest -> data = " + JSON.toJSONString(response));
if (response.isSuccess()) {
try {
NotifyUrlDto dto = new NotifyUrlDto();
if (response.getMsg().equalsIgnoreCase("SUCCESS")) {
dto.setStatus(1);
} else {
dto.setStatus(0);
}
dto.setOrderRefundCode(response.getOutRequestNo());
dto.setRefundCode(response.getOutTradeNo());
dto.setRefundPrice(response.getRefundAmount());
dto.setRefundAt(DateUtil.format(response.getGmtRefundPay(), DateUtil.Formatter.yyyyMMddHHmmss));
dto.setRefundPrice(response.getRefundAmount());
dto.setRefundError("");
sendNotifyUrl(dto,callBackUrl);
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"),
new Object[]{outBizNo, "ALIPAY", JSON.toJSONString(response), nowTime, nowTime},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_success.update"),
new Object[]{nowTime, DateUtil.format(response.getGmtRefundPay(), DateUtil.Formatter.yyyyMMddHHmmss), DragonConstant.RefundStatusEnum.STATUS_REFUNDED.getCode(), response.getOutRequestNo()},
DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_KEY.getCode()
);
return "success";
} catch (Exception e) {
e.printStackTrace();
log.error("");
return "fail";
}
} else {
log.error("response.isSuccess() -> fail ");
return "fail";
}
}catch (Exception e){
}
return null;
}
public String aliPayRefundCallBack(String jsonStr) { public String aliPayRefundCallBack(String jsonStr) {
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
try { try {
...@@ -426,7 +483,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -426,7 +483,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
if (response.isSuccess()) { if (response.isSuccess()) {
try { try {
NotifyUrlDto dto = new NotifyUrlDto(); NotifyUrlDto dto = new NotifyUrlDto();
if (response.getMsg().equalsIgnoreCase("SUCCESS")) { if (response.getMsg().equalsIgnoreCase("SUCCESS")) {
dto.setStatus(1); dto.setStatus(1);
...@@ -440,7 +496,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -440,7 +496,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundPrice(response.getRefundAmount()); dto.setRefundPrice(response.getRefundAmount());
dto.setRefundError(""); dto.setRefundError("");
log.debug("SEND ALIPAY NOTIFTURL = " + JSON.toJSONString(dto)); log.debug("SEND ALIPAY NOTIFTURL = " + JSON.toJSONString(dto));
sendNotifyUrl(dto); sendNotifyUrl(dto,null);
mqHandleUtil.sendMySqlRedis( mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"), SqlMapping.get("dragon_order_refund_log.insert"),
...@@ -471,7 +527,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -471,7 +527,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
} }
} }
private void sendNotifyUrl(NotifyUrlDto notifyUrlDto) { private void sendNotifyUrl(NotifyUrlDto notifyUrlDto,String url) {
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
MultiValueMap<String, String> params = new LinkedMultiValueMap(); MultiValueMap<String, String> params = new LinkedMultiValueMap();
params.add("orderRefundCode", notifyUrlDto.getOrderRefundCode()); params.add("orderRefundCode", notifyUrlDto.getOrderRefundCode());
...@@ -480,8 +536,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -480,8 +536,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
params.add("refundError", notifyUrlDto.getRefundError()); params.add("refundError", notifyUrlDto.getRefundError());
params.add("refundPrice", notifyUrlDto.getRefundPrice()); params.add("refundPrice", notifyUrlDto.getRefundPrice());
params.add("status", notifyUrlDto.getStatus().toString()); params.add("status", notifyUrlDto.getStatus().toString());
String response = HttpUtil.post(dataUtils.getRefundNotifyUrl(DragonConstant.REFUND_REDIS_KET + notifyUrlDto.getOrderRefundCode()), params); String response = HttpUtil.post(url==null?dataUtils.getRefundNotifyUrl(DragonConstant.REFUND_REDIS_KET + notifyUrlDto.getOrderRefundCode()):url, params);
log.debug("RETURN RESPONSE=" + response); log.info("RETURN RESPONSE=" + response);
if (response.equals("success")) { if (response.equals("success")) {
mqHandleUtil.sendMySqlRedis( mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_call_back.update"), SqlMapping.get("dragon_order_refund_call_back.update"),
...@@ -496,4 +552,5 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -496,4 +552,5 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
); );
} }
} }
} }
...@@ -412,6 +412,11 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -412,6 +412,11 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
} }
} }
@Override
public String aliPayRefundCodeStatus(String outTradeNo, String tradeNo, String outBizNo,String callBackUrl) {
return null;
}
public String aliPayRefundCallBack(String jsonStr) { public String aliPayRefundCallBack(String jsonStr) {
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
try { try {
......
...@@ -523,7 +523,7 @@ public class DataImpl { ...@@ -523,7 +523,7 @@ public class DataImpl {
} }
//退款 //退款
String refundSql = "select refund_table_id,sum(refund_number) as 'refund_number',sum(refund_price) as 'refund_price' from order_refunds where refund_table = 'order_ticket_entities' and order_id = " + orderData.getInt("id") + " group by refund_table_id"; //设置的预编译语句格式 String refundSql = "select refund_table_id,sum(refund_number) as 'refund_number',sum(refund_price) as 'refund_price' from order_refunds where refund_table = 'order_ticket_entities' and order_id = " + orderData.getInt("id") + " and refund_status = 4 group by refund_table_id"; //设置的预编译语句格式
pstmt = con.prepareStatement(refundSql); pstmt = con.prepareStatement(refundSql);
int refundNumber = 0; int refundNumber = 0;
BigDecimal refundPrice = new BigDecimal("0.00"); BigDecimal refundPrice = new BigDecimal("0.00");
......
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