Merge branch 'dev' of http://gitea.dctpay.com/hurui/puhui-go into dev
commit
fb452786ac
Binary file not shown.
@ -0,0 +1,84 @@ |
|||||||
|
package com.order.controller.business; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.hfkj.common.exception.ErrorCode; |
||||||
|
import com.hfkj.common.exception.ErrorHelp; |
||||||
|
import com.hfkj.common.exception.SysCode; |
||||||
|
import com.hfkj.common.security.UserCenter; |
||||||
|
import com.hfkj.common.utils.ResponseMsgUtil; |
||||||
|
import com.hfkj.entity.BsOrderMeituan; |
||||||
|
import com.hfkj.entity.SecConfig; |
||||||
|
import com.hfkj.model.ResponseData; |
||||||
|
import com.hfkj.service.SecConfigService; |
||||||
|
import com.hfkj.service.goods.BsOrderMeiTuanService; |
||||||
|
import com.hfkj.service.goods.BsOrderMemberService; |
||||||
|
import com.hfkj.service.goods.impl.BsOrderMeiTuanServiceImpl; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Controller; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.math.RoundingMode; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@Controller |
||||||
|
@RequestMapping(value="/orderMember") |
||||||
|
@Api(value="会员订单管理") |
||||||
|
public class BsOrderMemberController { |
||||||
|
|
||||||
|
@Resource |
||||||
|
private BsOrderMemberService bsOrderMemberService; |
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(BsOrderGoodsController.class); |
||||||
|
|
||||||
|
@RequestMapping(value="/getListMember",method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "查询列表") |
||||||
|
public ResponseData getListMember( |
||||||
|
@RequestParam(value = "orderNo" , required = false) String orderNo, |
||||||
|
@RequestParam(value = "childOrderNo" , required = false) String childOrderNo, |
||||||
|
@RequestParam(value = "userPhone" , required = false) String userPhone, |
||||||
|
@RequestParam(value = "goodsName" , required = false) String goodsName, |
||||||
|
@RequestParam(value = "payType" , required = false) Integer payType, |
||||||
|
@RequestParam(value = "status" , required = false) Integer status, |
||||||
|
@RequestParam(value = "createTimeS" , required = false) Long createTimeS, |
||||||
|
@RequestParam(value = "createTimeE" , required = false) Long createTimeE, |
||||||
|
@RequestParam(value = "finishTimeS" , required = false) Long finishTimeS, |
||||||
|
@RequestParam(value = "finishTimeE" , required = false) Long finishTimeE, |
||||||
|
@RequestParam(value = "pageNum" , required = true) Integer pageNum, |
||||||
|
@RequestParam(value = "pageSize" , required = true) Integer pageSize) { |
||||||
|
try { |
||||||
|
|
||||||
|
Map<String , Object> map = new HashMap<>(); |
||||||
|
|
||||||
|
map.put("orderNo", orderNo); |
||||||
|
map.put("childOrderNo", childOrderNo); |
||||||
|
map.put("userPhone", userPhone); |
||||||
|
map.put("goodsName", goodsName); |
||||||
|
map.put("payType", payType); |
||||||
|
map.put("createTimeS", createTimeS); |
||||||
|
map.put("createTimeE", createTimeE); |
||||||
|
map.put("finishTimeS", finishTimeS); |
||||||
|
map.put("finishTimeE", finishTimeE); |
||||||
|
map.put("status", status); |
||||||
|
|
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
return ResponseMsgUtil.success(new PageInfo<>(bsOrderMemberService.getList(map))); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("error!",e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,13 @@ |
|||||||
|
package com.hfkj.model; |
||||||
|
|
||||||
|
import com.hfkj.entity.CmsContent; |
||||||
|
import com.hfkj.model.goods.GoodsModel; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class CmsContentModel extends CmsContent { |
||||||
|
|
||||||
|
List<GoodsModel> goodsMsgList; |
||||||
|
} |
@ -0,0 +1,168 @@ |
|||||||
|
package com.hfkj.service.coupon.channel; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON; |
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.hfkj.common.exception.ErrorCode; |
||||||
|
import com.hfkj.common.exception.ErrorHelp; |
||||||
|
import com.hfkj.common.exception.SysCode; |
||||||
|
import com.hfkj.common.utils.HttpsUtils; |
||||||
|
import com.hfkj.config.CommonSysConst; |
||||||
|
import com.meituan.sqt.utils.EncryptUtil; |
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException; |
||||||
|
import java.nio.charset.StandardCharsets; |
||||||
|
import java.security.MessageDigest; |
||||||
|
import java.security.NoSuchAlgorithmException; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName MeiTuanService |
||||||
|
* @Author Sum1Dream |
||||||
|
* @Description 优涂接口 |
||||||
|
* @Date 2024/8/26 下午4:52 |
||||||
|
**/ |
||||||
|
public class YouTuCouponService { |
||||||
|
|
||||||
|
private static Logger log = LoggerFactory.getLogger(YouTuCouponService.class); |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @MethodName getYouTuCouponList |
||||||
|
* @Description:电子券模板列表 |
||||||
|
* @param param |
||||||
|
* @return: com.alibaba.fastjson.JSONObject |
||||||
|
* @Author: Sum1Dream |
||||||
|
* @Date: 2024/11/19 下午3:38 |
||||||
|
*/ |
||||||
|
public static JSONObject getYouTuCouponList(JSONObject param) { |
||||||
|
|
||||||
|
try { |
||||||
|
JSONObject object = request( "/openapi/couponV3/getMerchantCouponTpl", param); |
||||||
|
|
||||||
|
if (object.getInteger("code").equals(200)) { |
||||||
|
return object.getJSONObject("data"); |
||||||
|
} else { |
||||||
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); |
||||||
|
} |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.info("响应错误信息:{}", e); |
||||||
|
} |
||||||
|
|
||||||
|
return null; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @MethodName getMerchantCouponCode |
||||||
|
* @Description:获取电子券码 |
||||||
|
* @param param |
||||||
|
* @return: com.alibaba.fastjson.JSONObject |
||||||
|
* @Author: Sum1Dream |
||||||
|
* @Date: 2024/11/19 下午3:38 |
||||||
|
*/ |
||||||
|
public static JSONObject getMerchantCouponCode(JSONObject param) { |
||||||
|
|
||||||
|
try { |
||||||
|
JSONObject object = request( "/openapi/couponV3/getMerchantCouponCode", param); |
||||||
|
|
||||||
|
if (object.getInteger("code").equals(200)) { |
||||||
|
return object.getJSONObject("data"); |
||||||
|
} else { |
||||||
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); |
||||||
|
} |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.info("响应错误信息:{}", e); |
||||||
|
} |
||||||
|
|
||||||
|
return null; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @MethodName merchantCouponToMember |
||||||
|
* @Description:发送电子券到优途 |
||||||
|
* @param param |
||||||
|
* @return: com.alibaba.fastjson.JSONObject |
||||||
|
* @Author: Sum1Dream |
||||||
|
* @Date: 2024/11/19 下午4:36 |
||||||
|
*/ |
||||||
|
public static JSONObject merchantCouponToMember(JSONObject param) { |
||||||
|
|
||||||
|
try { |
||||||
|
JSONObject object = request( "/openapi/couponV3/merchantCouponToMember", param); |
||||||
|
|
||||||
|
if (object.getInteger("code").equals(200)) { |
||||||
|
return object.getJSONObject("data"); |
||||||
|
} else { |
||||||
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); |
||||||
|
} |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.info("响应错误信息:{}", e); |
||||||
|
} |
||||||
|
|
||||||
|
return null; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public static JSONObject getMerchantCouponState(JSONObject param) { |
||||||
|
|
||||||
|
try { |
||||||
|
JSONObject object = request( "/openapi/couponV3/getMerchantCouponState", param); |
||||||
|
|
||||||
|
if (object.getInteger("code").equals(200)) { |
||||||
|
return object.getJSONObject("data"); |
||||||
|
} else { |
||||||
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); |
||||||
|
} |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.info("响应错误信息:{}", e); |
||||||
|
} |
||||||
|
|
||||||
|
return null; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public static JSONObject request(String url , JSONObject param) throws Exception { |
||||||
|
log.info("获取卡券列表-请求参数: " + JSON.toJSONString(param)); |
||||||
|
|
||||||
|
StringBuilder stringBuffer = new StringBuilder(); |
||||||
|
|
||||||
|
param.put("app_id", CommonSysConst.getSysConfig().getYtAccessKey()); |
||||||
|
JSONObject response = HttpsUtils.doPost(CommonSysConst.getSysConfig().getYtPostUrl() + url + "?app_id" + CommonSysConst.getSysConfig().getYtAccessKey() |
||||||
|
+ "&sign=" + encryptSha1(String.valueOf(stringBuffer.append(CommonSysConst.getSysConfig().getYtSecretKey()).append(param.toJSONString()))) |
||||||
|
, param); |
||||||
|
log.info("获取卡券列表-回调参数: " + JSON.toJSONString(response)); |
||||||
|
log.info("========================请求任务End========================="); |
||||||
|
// 请求接口
|
||||||
|
return response; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public static String encryptSha1(String input) { |
||||||
|
try { |
||||||
|
// Create MD5 Hash
|
||||||
|
MessageDigest md = MessageDigest.getInstance("SHA-1"); |
||||||
|
md.update(input.getBytes(java.nio.charset.StandardCharsets.UTF_8)); |
||||||
|
byte[] digest = md.digest(); |
||||||
|
StringBuffer hexString = new StringBuffer(); |
||||||
|
for (byte b : digest) { |
||||||
|
String hex = Integer.toHexString(0xff & b); |
||||||
|
if (hex.length() == 1) hexString.append('0'); |
||||||
|
hexString.append(hex); |
||||||
|
} |
||||||
|
return hexString.toString(); |
||||||
|
|
||||||
|
} catch (NoSuchAlgorithmException e) { |
||||||
|
e.printStackTrace(); |
||||||
|
} |
||||||
|
return ""; |
||||||
|
|
||||||
|
} |
||||||
|
} |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue