parent
39b5450654
commit
e90f4107cd
@ -0,0 +1,105 @@ |
||||
package com.web.controller.business; |
||||
|
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.enum_type.UserObjectTypeEnum; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.model.UserInfoModel; |
||||
import com.hai.order.service.OrderService; |
||||
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 = "apiMerOrder") |
||||
@Api(value = "接口商户订单业务") |
||||
public class ApiMerOrderController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(OrderThirdPartyController.class); |
||||
|
||||
@Resource |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private OrderService orderService; |
||||
|
||||
|
||||
@RequestMapping(value = "/getOrderList", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询api商户订单列表") |
||||
public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, |
||||
@RequestParam(name = "memPhone", required = false) String memPhone, |
||||
@RequestParam(name = "memCardNo", required = false) String memCardNo, |
||||
@RequestParam(name = "payType", required = false) Integer payType, |
||||
@RequestParam(name = "status", required = false) Integer status, |
||||
@RequestParam(name = "companyId", required = false) Long companyId, |
||||
@RequestParam(name = "promoteCode", required = false) Long promoteCode, |
||||
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
||||
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
||||
@RequestParam(name = "payTimeS", required = false) Long payTimeS, |
||||
@RequestParam(name = "payTimeE", required = false) Long payTimeE, |
||||
@RequestParam(name = "productType", required = false) Integer productType, |
||||
@RequestParam(name = "finishTimeS", required = false) Long finishTimeS, |
||||
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize, |
||||
HttpServletRequest request) { |
||||
try { |
||||
|
||||
Map<String,Object> map = new HashMap<>(); |
||||
|
||||
map.put("createTimeS", createTimeS); |
||||
map.put("createTimeE", createTimeE); |
||||
map.put("payTimeS", payTimeS); |
||||
map.put("payTimeE", payTimeE); |
||||
map.put("finishTimeS", finishTimeS); |
||||
map.put("finishTimeE", finishTimeE); |
||||
map.put("orderNo", orderNo); |
||||
map.put("memPhone", memPhone); |
||||
map.put("memCardNo", memCardNo); |
||||
map.put("productType", productType); |
||||
map.put("status", status); |
||||
map.put("payType", payType); |
||||
map.put("promoteCode", promoteCode); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(orderService.getOrderList(map))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("OrderCouponController --> getOrderList() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getOrderDetail",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询订单详情") |
||||
public ResponseData getOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) { |
||||
try { |
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("tradeOrder", orderService.getOrderDetailByNo(orderNo)); |
||||
|
||||
return ResponseMsgUtil.success(map); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("OrderIntegralRechargeController -> getOrderDetail() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
} |
@ -1,7 +1,28 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighCouponAgentCode; |
||||
import com.hai.entity.HighDiscountPackageActual; |
||||
import com.hai.entity.HighDiscountPackageRecord; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighDiscountPackageActualMapperExt { |
||||
@Select( |
||||
" SELECT *" + |
||||
" FROM high_discount_package_actual" + |
||||
" WHERE" + |
||||
" status = 3 " + |
||||
" AND allocation_time >= DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL #{day} DAY) " + |
||||
" AND user_id = #{userId} " + |
||||
" AND discount_package_id = #{discountPackageId}; " |
||||
) |
||||
List<HighDiscountPackageActual> receivePackageLimit(@Param("userId") Integer userId, @Param("discountPackageId") Integer discountPackageId, @Param("day") Integer day); |
||||
} |
@ -0,0 +1,54 @@ |
||||
package com.hai.service; |
||||
|
||||
import com.hai.entity.BsMsg; |
||||
import com.hai.entity.BsPushScheduleTask; |
||||
import com.hai.entity.BsTemporary; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface BsTemporaryServices { |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @Name insert |
||||
* @Description // 新增
|
||||
* @Date 16:22 2023/12/22 |
||||
* @Param bsTemporary |
||||
* @return void |
||||
*/ |
||||
void insert(BsTemporary bsTemporary); |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @Name update |
||||
* @Description // 更新
|
||||
* @Date 16:23 2023/12/22 |
||||
* @Param bsTemporary |
||||
* @return void |
||||
*/ |
||||
void update(BsTemporary bsTemporary); |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @Name findById |
||||
* @Description // 查询
|
||||
* @Date 16:23 2023/12/22 |
||||
* @Param id |
||||
* @return com.hai.entity.BsMsg |
||||
*/ |
||||
BsTemporary findById(Long id); |
||||
|
||||
BsTemporary findByCode(String openId , Integer type); |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @Name getList |
||||
* @Description // 查询列表
|
||||
* @Date 16:23 2023/12/22 |
||||
* @Param map |
||||
* @return java.util.List<com.hai.entity.BsMsg> |
||||
*/ |
||||
List<BsTemporary> getList(Map<String , Object> map); |
||||
|
||||
} |
@ -0,0 +1,55 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.dao.BsTemporaryMapper; |
||||
import com.hai.entity.BsMsg; |
||||
import com.hai.entity.BsTemporary; |
||||
import com.hai.entity.BsTemporaryExample; |
||||
import com.hai.service.BsTemporaryServices; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Service("bsTemporaryServices") |
||||
public class BsTemporaryServicesImpl implements BsTemporaryServices { |
||||
|
||||
@Resource |
||||
private BsTemporaryMapper bsTemporaryMapper; |
||||
|
||||
@Override |
||||
public void insert(BsTemporary bsTemporary) { |
||||
bsTemporaryMapper.insert(bsTemporary); |
||||
} |
||||
|
||||
@Override |
||||
public void update(BsTemporary bsTemporary) { |
||||
bsTemporaryMapper.updateByPrimaryKey(bsTemporary); |
||||
} |
||||
|
||||
@Override |
||||
public BsTemporary findById(Long id) { |
||||
return bsTemporaryMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public BsTemporary findByCode(String openId , Integer type) { |
||||
BsTemporaryExample example = new BsTemporaryExample(); |
||||
example.createCriteria().andSourceCodeEqualTo(openId).andTypeEqualTo(type).andStatusEqualTo(1); |
||||
|
||||
List<BsTemporary> list = bsTemporaryMapper.selectByExample(example); |
||||
|
||||
if (list.size() > 0 ) { |
||||
return list.get(0); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<BsTemporary> getList(Map<String, Object> map) { |
||||
BsTemporaryExample example = new BsTemporaryExample(); |
||||
example.createCriteria().andStatusEqualTo(1); |
||||
return bsTemporaryMapper.selectByExample(example); |
||||
} |
||||
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue