| | |
| | | import org.yeshi.utils.exception.WXOrderException;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackBalance;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoods;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopOrder;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
|
| | | import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackForbidService;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsService;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetPayService;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
|
| | |
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.email.MailSenderUtil;
|
| | | import com.yeshi.fanli.util.factory.shop.BanLiShopOrderGoodsVOFactory;
|
| | | import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.BannerVO;
|
| | | import com.yeshi.fanli.vo.shop.BanLiShopOrderVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | @Resource
|
| | | private BanLiShopGoodsSetService banLiShopGoodsSetService;
|
| | |
|
| | | @Resource
|
| | | private RedPackForbidService redPackForbidService;
|
| | | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | | |
| | | @Resource
|
| | | private AdminUserService adminUserService;
|
| | |
|
| | | /**
|
| | | * 商品列表
|
| | | *
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "goodsList")
|
| | | public void goodsList(AcceptData acceptData, int page,Long uid, String callback, PrintWriter out) {
|
| | | public void goodsList(AcceptData acceptData, int page, Long uid, String callback, PrintWriter out) {
|
| | | if (page <= 0)
|
| | | page = 1;
|
| | | List<BanLiShopGoods> goodsList = banLiShopGoodsService.listGoods(null, BanLiShopGoods.STATE_ONLINE, page,
|
| | | Constant.PAGE_SIZE);
|
| | | long count = banLiShopGoodsService.countGoods(null, BanLiShopGoods.STATE_ONLINE);
|
| | | // 获取banner
|
| | | List<SwiperPicture> pictureList = swiperPictureService.getByBannerCard("hongbao_exchange_goods_list");
|
| | | List<BannerVO> pictureList = swiperPictureService.getByBannerCardAndVersion("hongbao_exchange_goods_list",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (pictureList != null && pictureList.size() > 0) {
|
| | |
| | | }
|
| | | data.put("data", goodsList);
|
| | | data.put("count", count);
|
| | | |
| | | RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
|
| | | if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) {
|
| | | data.put("redPackLock", true);
|
| | | } else {
|
| | | data.put("redPackLock", false);
|
| | | }
|
| | | |
| | | data.put("redPackLock", redPackForbidService.verifyForbid(uid));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | else
|
| | |
| | | }
|
| | | }
|
| | | BigDecimal money = redPackBalanceService.getBalance(uid);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("goods", goods);
|
| | | data.put("hongBaoBalance", money);
|
| | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | else
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | |
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | long[] targetUids = new long[] { 3L, 4L };
|
| | | Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey());
|
| | | String[] sts = config.getValue().split(",");
|
| | | String account = sts[0];
|
| | | String pwd = sts[1];
|
| | | for (long adminId : targetUids) {
|
| | | AdminUser adminUser = adminUserService.selectByPrimaryKey(adminId);
|
| | | String msg = "红包商城有新的订单,请前往审核";
|
| | | boolean isS = MailSenderUtil.sendEmail(adminUser.getEmail(), account, pwd, "红包商城新订单提醒", msg);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | }
|
| | |
|
| | | } catch (BanLiShopOrderException e) {
|