diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java index 25f7723f..02745192 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java @@ -182,6 +182,52 @@ public class HighDiscountAgentRelController { } } + @RequestMapping(value="/getDiscountUseConditionList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询优惠券使用情况") + public ResponseData getDiscountUseConditionList(@RequestParam(name = "discountId", required = false) Long discountId, + @RequestParam(name = "discountName", required = false) String discountName, + @RequestParam(name = "storeName", required = false) String storeName, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "receiveTimeS", required = false) Long receiveTimeS, + @RequestParam(name = "receiveTimeE", required = false) Long receiveTimeE, + @RequestParam(name = "useTimeS", required = false) Long useTimeS, + @RequestParam(name = "useTimeE", required = false) Long useTimeE, + @RequestParam(name = "idS", required = false) Long idS, + @RequestParam(name = "idE", required = false) Long idE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + if (userInfoModel.getHighAgent() == null) { + log.error("HighCouponController -> insertCoupon() error!","该主角色没有权限"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); + } + + Map map = new HashMap<>(); + map.put("agentId", userInfoModel.getHighAgent().getId()); + map.put("discountId", discountId); + map.put("discountName", discountName); + map.put("storeName", storeName); + map.put("status", status); + map.put("receiveTimeS", receiveTimeS); + map.put("receiveTimeE", receiveTimeE); + map.put("useTimeS", useTimeS); + map.put("useTimeE", useTimeE); + map.put("idS", idS); + map.put("idE", idE); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highDiscountAgentCodeService.getDiscountUseConditionList(map))); + + } catch (Exception e) { + log.error("HighDiscountController -> getDiscountUseConditionList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/getDiscountCodeById",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询优惠券码 详情") diff --git a/hai-cweb/src/main/java/com/cweb/controller/SmsContentController.java b/hai-cweb/src/main/java/com/cweb/controller/SmsContentController.java index c7ec16ca..980df38f 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/SmsContentController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/SmsContentController.java @@ -150,7 +150,7 @@ public class SmsContentController { String line = null; StringBuilder result = new StringBuilder(); while ((line = br.readLine()) != null) { // 读取数据 - result.append(line + "\n"); + result.append(line + ""); } connection.disconnect(); System.out.println(result.toString()); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index acf446e5..b6014d01 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -624,10 +624,10 @@ public class OrderController { } String buildMessage(String method, String url, long timestamp, String nonceStr, String body) { - return method + "\n" - + url + "\n" - + timestamp + "\n" - + nonceStr + "\n" - + body + "\n"; + return method + "" + + url + "" + + timestamp + "" + + nonceStr + "" + + body + ""; } } diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java index 890e38b1..6b224311 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java @@ -202,11 +202,11 @@ public class WechatPayController { } String buildMessage(String method, String url, long timestamp, String nonceStr, String body) { - return method + "\n" - + url + "\n" - + timestamp + "\n" - + nonceStr + "\n" - + body + "\n"; + return method + "" + + url + "" + + timestamp + "" + + nonceStr + "" + + body + ""; } @RequestMapping(value = "/telApi", method = RequestMethod.GET) diff --git a/hai-cweb/src/main/java/com/cweb/controller/testController.java b/hai-cweb/src/main/java/com/cweb/controller/testController.java index e0d3743a..e7265920 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/testController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/testController.java @@ -100,7 +100,7 @@ public class testController { String line = null; StringBuilder result = new StringBuilder(); while ((line = br.readLine()) != null) { // 读取数据 - result.append(line + "\n"); + result.append(line + ""); } connection.disconnect(); System.out.println(result.toString()); diff --git a/hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayReport.java b/hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayReport.java index 843cdb4d..b2228dd7 100644 --- a/hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayReport.java +++ b/hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayReport.java @@ -155,7 +155,7 @@ public class WXPayReport { break; } else { - sb.append("\n"); + sb.append(""); sb.append(msg); } } diff --git a/hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayUtil.java b/hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayUtil.java index 99ee0c8d..c8e31d79 100644 --- a/hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayUtil.java +++ b/hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayUtil.java @@ -92,7 +92,7 @@ public class WXPayUtil { StringWriter writer = new StringWriter(); StreamResult result = new StreamResult(writer); transformer.transform(source, result); - String output = writer.getBuffer().toString(); //.replaceAll("\n|\r", ""); + String output = writer.getBuffer().toString(); //.replaceAll("|\r", ""); try { writer.close(); } diff --git a/hai-service/src/main/java/com/hai/common/utils/IdCardUtil.java b/hai-service/src/main/java/com/hai/common/utils/IdCardUtil.java index b94cc7f9..31f970bb 100644 --- a/hai-service/src/main/java/com/hai/common/utils/IdCardUtil.java +++ b/hai-service/src/main/java/com/hai/common/utils/IdCardUtil.java @@ -86,7 +86,7 @@ public class IdCardUtil { public static String replaceBlank(String str) { String dest = ""; if (str!=null) { - Pattern p = Pattern.compile("\\s*|\t|\r|\n"); + Pattern p = Pattern.compile("\\s*|\t|\r|"); Matcher m = p.matcher(str); dest = m.replaceAll(""); } diff --git a/hai-service/src/main/java/com/hai/common/utils/MemberValidateUtil.java b/hai-service/src/main/java/com/hai/common/utils/MemberValidateUtil.java index 852793bb..67bf1ca3 100644 --- a/hai-service/src/main/java/com/hai/common/utils/MemberValidateUtil.java +++ b/hai-service/src/main/java/com/hai/common/utils/MemberValidateUtil.java @@ -99,7 +99,7 @@ public class MemberValidateUtil { public static String replaceBlank(String str) { String dest = ""; if (str!=null) { - Pattern p = Pattern.compile("\\s*|\t|\r|\n"); + Pattern p = Pattern.compile("\\s*|\t|\r|"); Matcher m = p.matcher(str); dest = m.replaceAll(""); } diff --git a/hai-service/src/main/java/com/hai/common/utils/WxUtils.java b/hai-service/src/main/java/com/hai/common/utils/WxUtils.java index 4df0fdc2..e0b88267 100644 --- a/hai-service/src/main/java/com/hai/common/utils/WxUtils.java +++ b/hai-service/src/main/java/com/hai/common/utils/WxUtils.java @@ -335,7 +335,7 @@ public class WxUtils { StringWriter writer = new StringWriter(); StreamResult result = new StreamResult(writer); transformer.transform(source, result); - String output = writer.getBuffer().toString(); //.replaceAll("\n|\r", ""); + String output = writer.getBuffer().toString(); //.replaceAll("|\r", ""); try { writer.close(); } diff --git a/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java index cab40958..9e83449c 100644 --- a/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java @@ -11,7 +11,7 @@ import java.util.Map; */ public interface HighActivityAwardUserMapperExt { - @Select(" select insert(b.phone, 4, 4, '****') phone,a.name awardName,a.create_time receiveTime from \n" + + @Select(" select insert(b.phone, 4, 4, '****') phone,a.name awardName,a.create_time receiveTime from " + " (select a.create_time, b.name,a.user_id " + " from high_activity_award_user a,high_activity_award b " + " where a.activity_award_id = b.id and a.activity_info_id = #{activityId} " + diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapperExt.java index 903f527e..ebf5c663 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapperExt.java @@ -3,8 +3,10 @@ package com.hai.dao; import com.hai.entity.HighDiscountAgentCode; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import java.util.List; +import java.util.Map; /** * mapper扩展类 @@ -30,4 +32,61 @@ public interface HighDiscountAgentCodeMapperExt { }) void insertListCode(@Param(value = "list") List discountAgentCodeList); + @Select({""}) + List> getDiscountUseConditionList(@Param("param") Map param); + } diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java b/hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java index 40a9ea9c..2d0c4197 100644 --- a/hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java +++ b/hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java @@ -41,6 +41,12 @@ public interface HighDiscountAgentCodeService { **/ List getDiscountCode(Map map); + /** + * 优惠券使用情况列表 + * @param map + * @return + */ + List> getDiscountUseConditionList(Map map); /** * @Author Sum1Dream diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java index ae562893..3a7b0d35 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java @@ -1,5 +1,6 @@ package com.hai.service.impl; +import com.hai.common.utils.DateUtil; import com.hai.dao.HighCouponCodeMapper; import com.hai.dao.HighDiscountAgentCodeMapper; import com.hai.entity.*; @@ -10,6 +11,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import java.util.Map; @@ -91,6 +93,28 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe return list; } + @Override + public List> getDiscountUseConditionList(Map map) { + try { + if (MapUtils.getLong(map, "receiveTimeS") != null) { + map.put("receiveTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "receiveTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + if (MapUtils.getLong(map, "receiveTimeE") != null) { + map.put("receiveTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "receiveTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + + if (MapUtils.getLong(map, "useTimeS") != null) { + map.put("useTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "useTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + if (MapUtils.getLong(map, "useTimeE") != null) { + map.put("useTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "useTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + } catch (Exception e) { + e.printStackTrace(); + } + return highDiscountAgentCodeMapper.getDiscountUseConditionList(map); + } + @Override public List getDiscountCodeByDiscountAgentId(Long discountAgentId) { diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/TestPayService.java b/hai-service/src/main/java/com/hai/service/pay/impl/TestPayService.java index f397d9a0..fc695c74 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/TestPayService.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/TestPayService.java @@ -15,8 +15,8 @@ public class TestPayService implements PayService { @Override public void paySuccess(Map map, String payType) throws Exception { log.info("AlipayNotify Test --------> start"); - System.out.println("\nAlipayNotify Test --------> start"); - System.out.println("\nAlipayNotify Test --------> done"); + System.out.println("AlipayNotify Test --------> start"); + System.out.println("AlipayNotify Test --------> done"); log.info("AlipayNotify Test --------> done"); }