我得免单订单状态
This commit is contained in:
parent
31d3a65c00
commit
6a2efde318
|
|
@ -76,6 +76,12 @@ public class OrderController {
|
||||||
private Result findWiningUser(){
|
private Result findWiningUser(){
|
||||||
return orderService.findWiningUser();
|
return orderService.findWiningUser();
|
||||||
}
|
}
|
||||||
|
@GetMapping("/mineWinner")
|
||||||
|
private Result mineWinner(@RequestHeader String token,@RequestParam Integer userId,
|
||||||
|
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
|
||||||
|
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size){
|
||||||
|
return orderService.mineWinner(userId,page,size);
|
||||||
|
}
|
||||||
@GetMapping("/getYhqPara")
|
@GetMapping("/getYhqPara")
|
||||||
private Result getYhqPara(){
|
private Result getYhqPara(){
|
||||||
return orderService.getYhqPara();
|
return orderService.getYhqPara();
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,5 @@ public interface TbOrderInfoMapper {
|
||||||
|
|
||||||
|
|
||||||
List<TbOrderInfo> selectByTradeDay(@Param("day") String day,@Param("minPrice") BigDecimal minPrice,@Param("maxPrice") BigDecimal maxPrice);
|
List<TbOrderInfo> selectByTradeDay(@Param("day") String day,@Param("minPrice") BigDecimal minPrice,@Param("maxPrice") BigDecimal maxPrice);
|
||||||
|
List<TbOrderInfo> selectWinnerByUserId(@Param("userId")Integer userId);
|
||||||
}
|
}
|
||||||
|
|
@ -99,7 +99,8 @@ public class TbOrderInfo implements Serializable {
|
||||||
private String isUseCoupon;
|
private String isUseCoupon;
|
||||||
private Integer totalNumber;
|
private Integer totalNumber;
|
||||||
private List<TbOrderDetail> detailList;
|
private List<TbOrderDetail> detailList;
|
||||||
|
private String winnnerNo;
|
||||||
|
private String isWinner;
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
public TbOrderInfo(){
|
public TbOrderInfo(){
|
||||||
super();
|
super();
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import com.chaozhanggui.system.cashierservice.util.N;
|
||||||
import com.chaozhanggui.system.cashierservice.util.RedisUtils;
|
import com.chaozhanggui.system.cashierservice.util.RedisUtils;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -383,4 +384,18 @@ public class OrderService {
|
||||||
modityDouble(conponsId);
|
modityDouble(conponsId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Result mineWinner(Integer userId, Integer page, Integer size) {
|
||||||
|
PageHelper.startPage(page, size);
|
||||||
|
List<TbOrderInfo> list = orderInfoMapper.selectWinnerByUserId(userId);
|
||||||
|
for (TbOrderInfo tbOrderInfo:list){
|
||||||
|
if (StringUtils.isNotEmpty(tbOrderInfo.getWinnnerNo())){
|
||||||
|
tbOrderInfo.setIsWinner("true");
|
||||||
|
}else {
|
||||||
|
tbOrderInfo.setIsWinner("false");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PageInfo pageInfo = new PageInfo(list);
|
||||||
|
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -560,4 +560,9 @@
|
||||||
select tio1.* from tb_order_info tio1 where not EXISTS (SELECT 1 FROM `tb_order_info` toi2 where toi2.order_type = 'return' and toi2.source = tio1.id)
|
select tio1.* from tb_order_info tio1 where not EXISTS (SELECT 1 FROM `tb_order_info` toi2 where toi2.order_type = 'return' and toi2.source = tio1.id)
|
||||||
and tio1.trade_day = #{day} and status = 'closed' and tio1.pay_amount >= #{minPrice} and tio1.pay_amount < #{maxPrice} and tio1.order_type = 'miniapp'
|
and tio1.trade_day = #{day} and status = 'closed' and tio1.pay_amount >= #{minPrice} and tio1.pay_amount < #{maxPrice} and tio1.order_type = 'miniapp'
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectWinnerByUserId" resultType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo">
|
||||||
|
select toi.*,two.order_no as winnnerNo,tui.nick_name as userName from tb_order_info toi left join tb_wining_user two on two.order_no = toi.order_no
|
||||||
|
left join tb_user_info tui on tui.id = toi.user_id
|
||||||
|
where toi.user_id = #{userId} and
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue