| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoCoupon;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/web/v1/class")
|
| | | public class WebGoodsClassController {
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoCouponService taoBaoCouponService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | |
| | |
|
| | | /**
|
| | | *
|
| | | * 方法说明: 获取优惠券页面商品列表
|
| | | * @author mawurui
|
| | | * createTime 2018年5月11日 下午2:41:16
|
| | | * |
| | | * @author mawurui createTime 2018年5月11日 下午2:41:16
|
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getCouponList", method = RequestMethod.GET)
|
| | | @RequestMapping(value = "getCouponList")
|
| | | public void getCouponList(AcceptData acceptData, String callback, int page, PrintWriter out) {
|
| | | List<TaoBaoCoupon> taoBaoCoupons = taoBaoCouponService.getTaoBaoCouponListBykeys(null, page);
|
| | | int count = taoBaoCouponService.getCount("");
|
| | |
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 设置红包进去
|
| | | *
|
| | |
| | | */
|
| | | private void setTaoBaoCouponHongBao(List<TaoBaoCoupon> taoBaoCoupons) {
|
| | | if (taoBaoCoupons.size() > 0) {
|
| | | String proportion = hongBaoManageService.get(Constant.HONGBAO_GOODS_PROPORTION);
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | for (TaoBaoCoupon taoBaoCoupon : taoBaoCoupons) {
|
| | | BigDecimal hb = TaoBaoUtil.getCouponHongBaoInfo(taoBaoCoupon, new BigDecimal(proportion));
|
| | | BigDecimal hb = TaoBaoUtil.getCouponHongBaoInfo(taoBaoCoupon, proportion);
|
| | | taoBaoCoupon.setHongbao(hb);
|
| | | }
|
| | | }
|