master
parent
306e4b9a48
commit
d6a291d4c4
Binary file not shown.
@ -0,0 +1,57 @@ |
||||
package com.cweb.controller.meituan; |
||||
|
||||
import com.alibaba.fastjson.JSONArray; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.common.utils.RandomStringGeneratorUtil; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.meituan.MeiTuanService; |
||||
import com.hfkj.model.ResponseData; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
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 java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
@Controller |
||||
@RequestMapping(value="/meiTuan") |
||||
@Api(value="美团") |
||||
public class MeiTuanController { |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MeiTuanController.class); |
||||
|
||||
@RequestMapping(value = "/loginFree", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "H5免登接口") |
||||
public ResponseData loginFree(@RequestParam(name = "staffPhone", required = true) String staffPhone, |
||||
@RequestParam(name = "productType", required = true) String productType) { |
||||
try { |
||||
|
||||
Map<String , Object> map = new HashMap<>(); |
||||
Map<String , Object> staffInfo = new HashMap<>(); |
||||
|
||||
staffInfo.put("staffPhone", staffPhone); |
||||
|
||||
map.put("staffInfo", staffInfo); |
||||
map.put("entId", 104310L); |
||||
map.put("ts", new Date().getTime()); |
||||
map.put("productType", productType); |
||||
map.put("nonce" , RandomStringGeneratorUtil.generateRandomString(36)); |
||||
JSONObject jsonObject = MeiTuanService.loginFree(map); |
||||
JSONArray jsonArray = jsonObject.getJSONArray("url"); |
||||
JSONObject json = jsonArray.getJSONObject(0); |
||||
return ResponseMsgUtil.success(json.getString("value")); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,58 @@ |
||||
package com.order.controller.business; |
||||
|
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.SecConfig; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.service.SecConfigService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
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; |
||||
|
||||
@Controller |
||||
@RequestMapping(value="/orderMeiTuan") |
||||
@Api(value="美团订单管理") |
||||
public class BsOrderMeiTuanController { |
||||
|
||||
@Resource |
||||
private SecConfigService secConfigService; |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BsOrderGoodsController.class); |
||||
|
||||
@RequestMapping(value="/servicePrice",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询服务费") |
||||
public ResponseData servicePrice(@RequestParam(value = "platformCode" , required = true) String platformCode, |
||||
@RequestParam(value = "price" , required = true) BigDecimal price |
||||
) { |
||||
try { |
||||
// 查询配置的平台服务费
|
||||
SecConfig config = secConfigService.queryDetail(platformCode); |
||||
BigDecimal servicePrice = new BigDecimal(0); |
||||
|
||||
if (config == null) { |
||||
log.error("orderMeiTuan -> servicePrice() error!"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相信息"); |
||||
} |
||||
|
||||
servicePrice = price.multiply(new BigDecimal(config.getCodeValue())); |
||||
|
||||
return ResponseMsgUtil.success(servicePrice); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,67 @@ |
||||
package com.hfkj.service.goods; |
||||
|
||||
import com.hfkj.entity.BsOrderMeituan; |
||||
|
||||
public interface BsOrderMeiTuanService { |
||||
|
||||
/** |
||||
* @MethodName create |
||||
* @Description: 创建 |
||||
* @param orderMeiTuan |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/9/5 下午4:18 |
||||
*/ |
||||
void create(BsOrderMeituan orderMeiTuan); |
||||
|
||||
/** |
||||
* @MethodName update |
||||
* @Description: 更新 |
||||
* @param orderMeiTuan |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/9/5 下午4:19 |
||||
*/ |
||||
void update(BsOrderMeituan orderMeiTuan); |
||||
|
||||
/** |
||||
* @MethodName delete |
||||
* @Description: 删除 |
||||
* @param id |
||||
* @param fullDelete |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/9/5 下午4:19 |
||||
*/ |
||||
void delete(Long id , Boolean fullDelete); |
||||
|
||||
/** |
||||
* @MethodName queryDetail |
||||
* @Description: 查询详情 |
||||
* @param id |
||||
* @return: com.hfkj.entity.BsOrderMeituan |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/9/5 下午4:19 |
||||
*/ |
||||
BsOrderMeituan queryDetail(Long id); |
||||
|
||||
/** |
||||
* @MethodName findOrderMeiTuan |
||||
* @Description: 根据订单号查询 |
||||
* @param childOrderNo |
||||
* @return: com.hfkj.entity.BsOrderMeituan |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/9/5 下午4:22 |
||||
*/ |
||||
BsOrderMeituan findOrderMeiTuan(String childOrderNo); |
||||
|
||||
/** |
||||
* @MethodName findOrderMeiTuanByTradeNo |
||||
* @Description: 通过渠道订单号查询 |
||||
* @param tradeNo |
||||
* @return: com.hfkj.entity.BsOrderMeituan |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/9/18 下午5:54 |
||||
*/ |
||||
BsOrderMeituan findOrderMeiTuanByTradeNo(String tradeNo); |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,67 @@ |
||||
package com.hfkj.service.goods.impl; |
||||
|
||||
import com.hfkj.dao.BsOrderMeituanMapper; |
||||
import com.hfkj.entity.BsOrderMeituan; |
||||
import com.hfkj.entity.BsOrderMeituanExample; |
||||
import com.hfkj.service.goods.BsOrderMeiTuanService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.List; |
||||
|
||||
@Service("bsOrderMeiTuanService") |
||||
public class BsOrderMeiTuanServiceImpl implements BsOrderMeiTuanService { |
||||
|
||||
@Resource |
||||
private BsOrderMeituanMapper bsOrderMeituanMapper; |
||||
|
||||
@Override |
||||
public void create(BsOrderMeituan orderMeiTuan) { |
||||
bsOrderMeituanMapper.insert(orderMeiTuan); |
||||
} |
||||
|
||||
@Override |
||||
public void update(BsOrderMeituan orderMeiTuan) { |
||||
bsOrderMeituanMapper.updateByPrimaryKeySelective(orderMeiTuan); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(Long id, Boolean fullDelete) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public BsOrderMeituan queryDetail(Long id) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderMeituan findOrderMeiTuan(String childOrderNo) { |
||||
BsOrderMeituanExample example = new BsOrderMeituanExample(); |
||||
BsOrderMeituanExample.Criteria criteria = example.createCriteria(); |
||||
criteria.andChildOrderNoEqualTo(childOrderNo); |
||||
|
||||
List<BsOrderMeituan> list = bsOrderMeituanMapper.selectByExample(example); |
||||
|
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderMeituan findOrderMeiTuanByTradeNo(String tradeNo) { |
||||
BsOrderMeituanExample example = new BsOrderMeituanExample(); |
||||
BsOrderMeituanExample.Criteria criteria = example.createCriteria(); |
||||
criteria.andTradeNoEqualTo(tradeNo); |
||||
|
||||
List<BsOrderMeituan> list = bsOrderMeituanMapper.selectByExample(example); |
||||
|
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
} |
Loading…
Reference in new issue