我得免单订单状态

This commit is contained in:
wangguocheng 2024-05-17 10:02:39 +08:00
parent 31d3a65c00
commit 6a2efde318
5 changed files with 29 additions and 1 deletions

View File

@ -76,6 +76,12 @@ public class OrderController {
private Result 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")
private Result getYhqPara(){
return orderService.getYhqPara();

View File

@ -33,4 +33,5 @@ public interface TbOrderInfoMapper {
List<TbOrderInfo> selectByTradeDay(@Param("day") String day,@Param("minPrice") BigDecimal minPrice,@Param("maxPrice") BigDecimal maxPrice);
List<TbOrderInfo> selectWinnerByUserId(@Param("userId")Integer userId);
}

View File

@ -99,7 +99,8 @@ public class TbOrderInfo implements Serializable {
private String isUseCoupon;
private Integer totalNumber;
private List<TbOrderDetail> detailList;
private String winnnerNo;
private String isWinner;
private static final long serialVersionUID = 1L;
public TbOrderInfo(){
super();

View File

@ -16,6 +16,7 @@ import com.chaozhanggui.system.cashierservice.util.N;
import com.chaozhanggui.system.cashierservice.util.RedisUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -383,4 +384,18 @@ public class OrderService {
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);
}
}

View File

@ -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)
and tio1.trade_day = #{day} and status = 'closed' and tio1.pay_amount &gt;= #{minPrice} and tio1.pay_amount &lt; #{maxPrice} and tio1.order_type = 'miniapp'
</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>