parent
1e9b528570
commit
8361c8658a
@ -0,0 +1,141 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.bweb.controller.goods.GoodsController; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.security.SessionObject; |
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.BsProductConfig; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.SecUserSessionObject; |
||||
import com.hfkj.service.BsProductConfigService; |
||||
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; |
||||
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.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.Date; |
||||
|
||||
|
||||
@Controller |
||||
@RequestMapping(value="/productConfig") |
||||
@Api(value="商户产品折扣配置") |
||||
public class BsProductConfigController { |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GoodsController.class); |
||||
|
||||
@Resource |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private BsProductConfigService bsProductConfigService; |
||||
|
||||
|
||||
@RequestMapping(value="/editProductConfig",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "编辑产品配置") |
||||
public ResponseData editProductConfig(@RequestBody BsProductConfig body, HttpServletRequest request) { |
||||
try { |
||||
|
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); |
||||
|
||||
if (body == null |
||||
|| body.getMerId() == null |
||||
|| body.getProductType() == null |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
BsProductConfig productConfig = bsProductConfigService.queryDetail(body.getProductType()); |
||||
|
||||
if (productConfig != null && !productConfig.getMerId().equals(body.getMerId())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前产品已有商户配置,不可配置!"); |
||||
} |
||||
|
||||
if (productConfig != null) { |
||||
body.setId(productConfig.getId()); |
||||
} |
||||
|
||||
BsProductConfig bsProductConfig; |
||||
|
||||
if (body.getId() != null) { |
||||
// 查询
|
||||
bsProductConfig = bsProductConfigService.queryDetail(body.getId()); |
||||
if (bsProductConfig == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); |
||||
} |
||||
} else { |
||||
bsProductConfig = new BsProductConfig(); |
||||
bsProductConfig.setCreateTime(new Date()); |
||||
|
||||
} |
||||
bsProductConfig.setProductType(body.getProductType()); |
||||
bsProductConfig.setDiscount(body.getDiscount()); |
||||
bsProductConfig.setMerId(body.getMerId()); |
||||
bsProductConfig.setUpdateTime(new Date()); |
||||
bsProductConfig.setStatus(1); |
||||
|
||||
OrderChildProductTypeEnum typeEnum = OrderChildProductTypeEnum.getData(body.getProductType()); |
||||
if (typeEnum == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前产品类型未配置!"); |
||||
} |
||||
|
||||
bsProductConfig.setProductName(typeEnum.getName()); |
||||
bsProductConfig.setOpId(userModel.getAccount().getId()); |
||||
bsProductConfig.setOpName(userModel.getAccount().getUserName()); |
||||
|
||||
if (body.getId() != null) { |
||||
bsProductConfigService.update(bsProductConfig); |
||||
} else { |
||||
bsProductConfigService.create(bsProductConfig); |
||||
} |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
|
||||
} |
||||
|
||||
@RequestMapping(value="/getList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询列表") |
||||
public ResponseData getList(@RequestParam(value = "merId" , required = false) Long merId) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(bsProductConfigService.getList(merId)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/delete",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "删除") |
||||
public ResponseData delete(@RequestParam(value = "id" , required = false) Long id) { |
||||
try { |
||||
|
||||
|
||||
bsProductConfigService.delete(id , false); |
||||
|
||||
return ResponseMsgUtil.success("删除成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,85 @@ |
||||
package com.order.controller.business; |
||||
|
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.security.SessionObject; |
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.SecUserSessionObject; |
||||
import com.hfkj.service.goods.BsOrderCinemaService; |
||||
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
||||
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 javax.servlet.http.HttpServletRequest; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
@Controller |
||||
@RequestMapping(value="/orderCinema") |
||||
@Api(value="电影票订单管理") |
||||
public class BsOrderCinemaController { |
||||
private static final Logger log = LoggerFactory.getLogger(BsOrderCinemaController.class); |
||||
|
||||
@Resource |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private BsOrderCinemaService bsOrderCinemaService; |
||||
|
||||
|
||||
@RequestMapping(value="/getListCinema",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询列表") |
||||
public ResponseData getListCinema( |
||||
@RequestParam(value = "orderNo" , required = false) String orderNo, |
||||
@RequestParam(value = "childOrderNo" , required = false) String childOrderNo, |
||||
@RequestParam(value = "userPhone" , required = false) String userPhone, |
||||
@RequestParam(value = "goodsSpecsName" , required = false) String goodsSpecsName, |
||||
@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 = "pageNum" , required = true) Integer pageNum, |
||||
@RequestParam(value = "pageSize" , required = true) Integer pageSize, HttpServletRequest request) { |
||||
try { |
||||
|
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); |
||||
|
||||
Map<String , Object> map = new HashMap<>(); |
||||
|
||||
if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { |
||||
map.put("merId", userModel.getAccount().getObjectId()); |
||||
} |
||||
|
||||
map.put("orderNo", orderNo); |
||||
map.put("childOrderNo", childOrderNo); |
||||
map.put("userPhone", userPhone); |
||||
map.put("goodsSpecsName", goodsSpecsName); |
||||
map.put("goodsName", goodsName); |
||||
map.put("payType", payType); |
||||
map.put("createTimeS", createTimeS); |
||||
map.put("createTimeE", createTimeE); |
||||
map.put("status", status); |
||||
PageHelper.startPage(pageNum, pageSize); |
||||
|
||||
return ResponseMsgUtil.success(new PageInfo<>(bsOrderCinemaService.getList(map))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,49 @@ |
||||
package com.order.controller.notify; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
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.RequestBody; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestMethod; |
||||
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.PrintWriter; |
||||
|
||||
@Controller |
||||
@RequestMapping(value = "/cinemaNotify") |
||||
@Api(value = "千猪电影票通知") |
||||
public class QzCinemaNotify { |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(QzCinemaNotify.class); |
||||
|
||||
@RequestMapping(value = "/notify", method = RequestMethod.POST) |
||||
@ApiOperation(value = "回调") |
||||
@ResponseBody |
||||
public void notify(@RequestBody String reqBodyStr, HttpServletRequest request, HttpServletResponse response) { |
||||
try { |
||||
|
||||
JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class); |
||||
|
||||
log.info("============回调任务Start============="); |
||||
log.info("尖椒订单充值-回调参数: " + dataObject); |
||||
log.info("============回调任务End============="); |
||||
|
||||
|
||||
response.setCharacterEncoding("UTF-8"); |
||||
response.setContentType("text/html;charset=utf-8"); |
||||
PrintWriter writer= response.getWriter(); |
||||
writer.write("SUCCESS"); |
||||
|
||||
|
||||
} catch (Exception e) { |
||||
log.error("WechatPayController --> wechatNotify() error!", e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,78 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsProductConfig; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface BsProductConfigService { |
||||
|
||||
/** |
||||
* @MethodName create |
||||
* @Description:创建 |
||||
* @param productConfig |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/3 下午5:20 |
||||
*/ |
||||
void create(BsProductConfig productConfig); |
||||
|
||||
/** |
||||
* @MethodName update |
||||
* @Description:更新 |
||||
* @param productConfig |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/3 下午5:20 |
||||
*/ |
||||
void update(BsProductConfig productConfig); |
||||
|
||||
/** |
||||
* @MethodName delete |
||||
* @Description:删除 |
||||
* @param id |
||||
* @param fullDelete |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/3 下午5:20 |
||||
*/ |
||||
void delete(Long id , Boolean fullDelete); |
||||
|
||||
/** |
||||
* @MethodName queryDetail |
||||
* @Description:根据id查询 |
||||
* @param id |
||||
* @return: com.hfkj.entity.BsProductConfig |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/3 下午5:20 |
||||
*/ |
||||
BsProductConfig queryDetail(Long id); |
||||
|
||||
/** |
||||
* @MethodName queryDetailByProductType |
||||
* @Description:根据产品类型查询 |
||||
* @param productType |
||||
* @return: com.hfkj.entity.BsProductConfig |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/3 下午5:20 |
||||
*/ |
||||
BsProductConfig queryDetail(Integer productType); |
||||
|
||||
/** |
||||
* @MethodName queryDetailByMap |
||||
* @Description:根据map查询 |
||||
* @param map |
||||
* @return: com.hfkj.entity.BsProductConfig |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/3 下午5:20 |
||||
*/ |
||||
BsProductConfig queryDetailByMap(Map<String , Object> map); |
||||
|
||||
/** |
||||
* @MethodName getList |
||||
* @Description:根据map查询列表 |
||||
* @param merId |
||||
* @return: java.util.List<com.hfkj.entity.BsProductConfig> |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/3 下午5:20 |
||||
*/ |
||||
List<BsProductConfig> getList(Long merId); |
||||
|
||||
} |
@ -0,0 +1,77 @@ |
||||
package com.hfkj.service.goods; |
||||
|
||||
import com.hfkj.entity.BsOrderCinema; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface BsOrderCinemaService { |
||||
|
||||
/** |
||||
* @MethodName create |
||||
* @Description: 创建 |
||||
* @param orderCinema |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/4 下午2:30 |
||||
*/ |
||||
void create(BsOrderCinema orderCinema); |
||||
|
||||
/** |
||||
* @MethodName update |
||||
* @Description: 更新 |
||||
* @param orderCinema |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/4 下午2:30 |
||||
*/ |
||||
void update(BsOrderCinema orderCinema); |
||||
|
||||
/** |
||||
* @MethodName delete |
||||
* @Description: 删除 |
||||
* @param id |
||||
* @param fullDelete |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/4 下午2:30 |
||||
*/ |
||||
void delete(Long id , Boolean fullDelete); |
||||
|
||||
/** |
||||
* @MethodName queryDetail |
||||
* @Description:查询详情 |
||||
* @param id |
||||
* @return: com.hfkj.entity.BsOrderCinema |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/4 下午2:30 |
||||
*/ |
||||
BsOrderCinema queryDetail(Long id); |
||||
|
||||
/** |
||||
* @MethodName findGoodsOrder |
||||
* @Description: |
||||
* @param orderNo |
||||
* @return: com.hfkj.entity.BsOrderCinema |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/4 下午2:30 |
||||
*/ |
||||
BsOrderCinema findGoodsOrder(String orderNo); |
||||
|
||||
/** |
||||
* @MethodName queryDetailByMap |
||||
* @Description: 查询 |
||||
* @param map |
||||
* @return: com.hfkj.entity.BsOrderCinema |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/4 下午2:34 |
||||
*/ |
||||
BsOrderCinema queryDetailByMap(Map<String , Object> map); |
||||
|
||||
/** |
||||
* @MethodName getList |
||||
* @Description: 查询列表 |
||||
* @param map |
||||
* @return: java.util.List<com.hfkj.entity.BsOrderCinema> |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/7/4 下午2:35 |
||||
*/ |
||||
List<BsOrderCinema> getList(Map<String , Object> map); |
||||
} |
@ -0,0 +1,109 @@ |
||||
package com.hfkj.service.goods.impl; |
||||
|
||||
import com.hfkj.dao.BsOrderCinemaMapper; |
||||
import com.hfkj.entity.BsOrderCinema; |
||||
import com.hfkj.entity.BsOrderCinemaExample; |
||||
import com.hfkj.entity.BsOrderGoods; |
||||
import com.hfkj.entity.BsOrderGoodsExample; |
||||
import com.hfkj.service.goods.BsOrderCinemaService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Collections; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Service("bsOrderCinemaService") |
||||
public class BsOrderCinemaServiceImpl implements BsOrderCinemaService { |
||||
|
||||
@Resource |
||||
private BsOrderCinemaMapper bsOrderCinemaMapper; |
||||
|
||||
@Override |
||||
public void create(BsOrderCinema orderCinema) { |
||||
bsOrderCinemaMapper.insert(orderCinema); |
||||
} |
||||
|
||||
@Override |
||||
public void update(BsOrderCinema orderCinema) { |
||||
bsOrderCinemaMapper.updateByPrimaryKeySelective(orderCinema); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(Long id, Boolean fullDelete) { |
||||
bsOrderCinemaMapper.deleteByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderCinema queryDetail(Long id) { |
||||
return bsOrderCinemaMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderCinema findGoodsOrder(String orderNo) { |
||||
BsOrderCinemaExample example = new BsOrderCinemaExample(); |
||||
example.createCriteria().andOrderNoEqualTo(orderNo); |
||||
|
||||
List<BsOrderCinema> list = bsOrderCinemaMapper.selectByExample(example); |
||||
|
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderCinema queryDetailByMap(Map<String, Object> map) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<BsOrderCinema> getList(Map<String, Object> map) { |
||||
BsOrderCinemaExample example = new BsOrderCinemaExample(); |
||||
BsOrderCinemaExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
|
||||
if (MapUtils.getLong(map, "merId") != null) { |
||||
criteria.andMerIdEqualTo(MapUtils.getLong(map, "merId")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(map, "orderNo"))) { |
||||
criteria.andOrderNoEqualTo(MapUtils.getString(map, "orderNo")); |
||||
} |
||||
if (StringUtils.isNotBlank(MapUtils.getString(map, "childOrderNo"))) { |
||||
criteria.andChildOrderNoEqualTo(MapUtils.getString(map, "childOrderNo")); |
||||
} |
||||
if (StringUtils.isNotBlank(MapUtils.getString(map, "userPhone"))) { |
||||
criteria.andUserPhoneEqualTo(MapUtils.getString(map, "userPhone")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(map, "goodsSpecsName"))) { |
||||
criteria.andGoodsSpecsNameEqualTo(MapUtils.getString(map, "goodsSpecsName")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(map, "goodsName"))) { |
||||
criteria.andGoodsNameLike("%"+MapUtils.getString(map, "goodsName")+"%"); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(map, "payType") != null) { |
||||
criteria.andPayTypeEqualTo(MapUtils.getInteger(map, "payType")); |
||||
} |
||||
if (MapUtils.getLong(map, "createTimeS") != null) { |
||||
criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "createTimeS"))); |
||||
} |
||||
if (MapUtils.getLong(map, "createTimeE") != null) { |
||||
criteria.andCreateTimeLessThan(new Date(MapUtils.getLong(map, "createTimeE"))); |
||||
} |
||||
if (MapUtils.getInteger(map, "status") != null) { |
||||
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); |
||||
} else { |
||||
criteria.andStatusNotEqualTo(0); |
||||
} |
||||
example.setOrderByClause("create_time desc"); |
||||
return bsOrderCinemaMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,73 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.hfkj.dao.BsProductConfigMapper; |
||||
import com.hfkj.entity.BsProductConfig; |
||||
import com.hfkj.entity.BsProductConfigExample; |
||||
import com.hfkj.service.BsProductConfigService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Service("bsProductConfigService") |
||||
public class BsProductConfigServiceImpl implements BsProductConfigService { |
||||
|
||||
@Resource |
||||
private BsProductConfigMapper bsProductConfigMapper; |
||||
|
||||
@Override |
||||
public void create(BsProductConfig productConfig) { |
||||
bsProductConfigMapper.insert(productConfig); |
||||
} |
||||
|
||||
@Override |
||||
public void update(BsProductConfig productConfig) { |
||||
bsProductConfigMapper.updateByPrimaryKeySelective(productConfig); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(Long id, Boolean fullDelete) { |
||||
if (fullDelete) { |
||||
bsProductConfigMapper.deleteByPrimaryKey(id); |
||||
} else { |
||||
BsProductConfig productConfig = queryDetail(id); |
||||
productConfig.setStatus(0); |
||||
productConfig.setUpdateTime(new Date()); |
||||
update(productConfig); |
||||
} |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public BsProductConfig queryDetail(Long id) { |
||||
return bsProductConfigMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public BsProductConfig queryDetail(Integer productType) { |
||||
BsProductConfigExample example = new BsProductConfigExample(); |
||||
example.createCriteria().andProductTypeEqualTo(productType).andStatusEqualTo(1); |
||||
|
||||
List<BsProductConfig> list = bsProductConfigMapper.selectByExample(example); |
||||
|
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsProductConfig queryDetailByMap(Map<String, Object> map) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<BsProductConfig> getList(Long merId) { |
||||
BsProductConfigExample example = new BsProductConfigExample(); |
||||
example.createCriteria().andMerIdEqualTo(merId).andStatusEqualTo(1); |
||||
return bsProductConfigMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,74 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
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.config.CommonSysConst; |
||||
import com.hfkj.entity.BsOrderChild; |
||||
import com.hfkj.entity.BsOrderCinema; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.qianzhu.channel.CinemaService; |
||||
import com.hfkj.service.goods.BsOrderCinemaService; |
||||
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
|
||||
/** |
||||
* @ClassName OrderRefundSuccessService |
||||
* @Author Sum1Dream |
||||
* @Description 退款成功业务处理 |
||||
* @Date 2024/7/4 下午5:31 |
||||
**/ |
||||
@Component |
||||
public class OrderRefundSuccessService { |
||||
|
||||
@Resource |
||||
private BsOrderCinemaService bsOrderCinemaService; |
||||
|
||||
/** |
||||
* 订单业务处理 |
||||
* @param orderChild |
||||
* @throws Exception |
||||
*/ |
||||
public void orderRefundHandle(OrderChildModel orderChild) { |
||||
try { |
||||
if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { |
||||
// todo 实物产品退款业务
|
||||
} else if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { |
||||
// todo 虚拟产品退款业务
|
||||
} else if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) { |
||||
// 电影票退款业务
|
||||
cinema(orderChild); |
||||
} |
||||
} catch (Exception e) { |
||||
|
||||
} |
||||
} |
||||
|
||||
public void cinema(BsOrderChild childOrder) { |
||||
// 查询电影票订单
|
||||
BsOrderCinema orderCinema = bsOrderCinemaService.findGoodsOrder(childOrder.getOrderNo()); |
||||
|
||||
try { |
||||
|
||||
if (orderCinema != null) { |
||||
Map<String , Object> map = new HashMap<>(); |
||||
map.put("orderNo", childOrder.getOrderNo()); |
||||
CinemaService.refundMovieOrder(map); |
||||
orderCinema.setStatus(-5); |
||||
bsOrderCinemaService.update(orderCinema); |
||||
} |
||||
} catch (Exception e) { |
||||
orderCinema.setExceptionStatus(true); |
||||
orderCinema.setExceptionMsg(e.getMessage()); |
||||
bsOrderCinemaService.update(orderCinema); |
||||
} |
||||
|
||||
} |
||||
} |
@ -0,0 +1,50 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* @ClassName OrderCinemaStatusEnum |
||||
* @Author Sum1Dream |
||||
* @Description 电影票状态枚举 |
||||
* @Date 2024/7/4 下午3:32 |
||||
**/ |
||||
@Getter |
||||
public enum OrderCinemaStatusEnum { |
||||
|
||||
/** |
||||
* 待付款 |
||||
*/ |
||||
status0(0, "待付款"), |
||||
|
||||
/** |
||||
* 待出票 |
||||
*/ |
||||
status5(5, "待出票"), |
||||
|
||||
/** |
||||
* 已出票 |
||||
*/ |
||||
status10(10, "已出票"), |
||||
|
||||
/** |
||||
* 已退款 |
||||
*/ |
||||
status15(15, "交易成功"), |
||||
|
||||
/** |
||||
* 已取消 |
||||
*/ |
||||
statusNegative5(-5, "已取消"), |
||||
|
||||
; |
||||
|
||||
private final int code; |
||||
|
||||
private final String name; |
||||
|
||||
|
||||
OrderCinemaStatusEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
} |
Loading…
Reference in new issue