| | |
| | |
|
| | | @RequestMapping(value = "banlishop/pay")
|
| | | public void banLiShopPay(HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | Map<String, String> map = WXUtil.parseXML(request);
|
| | | JSONObject json = JSONObject.fromObject(map);
|
| | | LogHelper.test("商城微信支付回调:" + json.toString());
|
| | | String sign = map.get("sign");
|
| | | map.remove("sign");
|
| | | boolean isSuccess = BanLiShopWXPayUtil.signIsRight(map, sign);
|
| | |
| | | data.put("clickUrl", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
|
| | |
|
| | | data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | | // 测试
|
| | | List<String> commentTexts = new ArrayList<>();
|
| | | commentTexts.add("口令1");
|
| | | commentTexts.add("口令2口令口令淘口令口令口令淘口令");
|
| | | commentTexts.add("口令3");
|
| | | commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
|
| | | data.put("commentTexts", commentTexts);
|
| | | data.put("wxErCode", "这是微信分享二维码内容");
|
| | | |
| | | |
| | | }
|
| | |
|
| | | } else if (cid == 4) { // 邀请分享
|
| | |
| | |
|
| | | @Resource
|
| | | private RedPackDetailService redPackDetailService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private RedPackGiveRecordService redPackGiveRecordService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private RedPackExchangeService redPackExchangeService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private RedPackWinInviteService redPackWinInviteService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | |
|
| | | /**
|
| | | * 统计
|
| | |
| | | tips.add("你也可以选择使用红包,享受给力折扣。");
|
| | | String giveMin = redPackConfigService.getValueByKey("give_money_min");
|
| | | String giveMax = redPackConfigService.getValueByKey("give_money_max");
|
| | | |
| | |
|
| | | // 正在提现金额
|
| | | BigDecimal extractingMoney = redPackExchangeService.countMoneyByUidAndState(uid, RedPackExchange.STATE_INIT);
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("balance", balance.setScale(2).toString());
|
| | | data.put("helpLink", redPackConfigService.getValueByKey("desc_help_link"));
|
| | |
| | | data.put("giveMax", giveMax);
|
| | | data.put("giveDesc", "注:红包赠送金额至少" + giveMin + "元至多" + giveMax + "元");
|
| | |
|
| | | if (extractingMoney != null && extractingMoney.compareTo(zero) > 0) |
| | | if (extractingMoney != null && extractingMoney.compareTo(zero) > 0)
|
| | | data.put("extractingInfo", "提现中:¥" + extractingMoney.setScale(2));
|
| | | |
| | |
|
| | | data.put("extractShortage", tips);
|
| | | data.put("extractMin", redPackConfigService.getValueByKey("extract_money_min"));
|
| | | data.put("extractMax", redPackConfigService.getValueByKey("extract_money_max"));
|
| | | data.put("extractBanlenMin", redPackConfigService.getValueByKey("extract_banlen_min"));
|
| | | data.put("extractDesc", "注:3个工作日内完成审核,红包提现成功后将会进入到余额。");
|
| | | |
| | |
|
| | | data.put("useLink", redPackConfigService.getValueByKey("use_link"));
|
| | |
|
| | | data.put("todayWin", todayWin.setScale(2).toString());
|
| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param index List最末的主键ID
|
| | | * @param year 年份
|
| | | * @param month 月份
|
| | | * @param index
|
| | | * List最末的主键ID
|
| | | * @param year
|
| | | * 年份
|
| | | * @param month
|
| | | * 月份
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMoneyDetails")
|
| | |
| | | }
|
| | | });
|
| | |
|
| | |
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 转换红包为真实金钱
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param amount
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 红包邀请进度
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getRewardList", method = RequestMethod.POST)
|
| | | public void getRewardList(AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
|
| | | @RequestMapping(value = "getRewardList")
|
| | | public void getRewardList(AcceptData acceptData, Integer page, Long uid, String callback, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (page == null || page < 1) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "页码不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | List<RedPackWinInviteVO> list = new ArrayList<RedPackWinInviteVO>();
|
| | | |
| | | List<RedPackWinInvite> listRecord = redPackWinInviteService.getRewardList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | |
|
| | | List<RedPackWinInvite> listRecord = redPackWinInviteService.getRewardList((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE, uid);
|
| | | if (listRecord != null && !listRecord.isEmpty()) {
|
| | | for (RedPackWinInvite record: listRecord) {
|
| | | for (RedPackWinInvite record : listRecord) {
|
| | | UserInfo user = null;
|
| | | RedPackWinInviteVO winVO = new RedPackWinInviteVO();
|
| | | RedPackWinInviteTypeEnum type = record.getType();
|
| | |
| | | list.add(winVO);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", redPackWinInviteService.countRewardRecord(uid));
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 用户基础信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getBasicInfo", method = RequestMethod.POST)
|
| | | public void getBasicInfo(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | @RequestMapping(value = "getBasicInfo")
|
| | | public void getBasicInfo(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("balance", redPackBalanceService.getBalance(uid));
|
| | | data.put("ruleLink", redPackConfigService.getValueByKey("invite_reward_rule_link"));
|
| | |
| | | } else {
|
| | | data.put("inviteCode", "");
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | public abstract class BaseMQMsgBody {
|
| | | public class BaseMQMsgBody {
|
| | | private boolean test;// 是否是测试
|
| | |
|
| | | public BaseMQMsgBody() {
|
| | |
| | | private Date updateTime;
|
| | | @Column(name = "sg_weight")
|
| | | private Integer weight;
|
| | |
|
| | | @Column(name = "so_square_picture")
|
| | | private String squarePicture;// 方形图片
|
| | | // 套餐
|
| | | private List<BanLiShopGoodsSets> setsList;
|
| | | // 图片
|
| | |
| | | public void setWeight(Integer weight) {
|
| | | this.weight = weight;
|
| | | }
|
| | |
|
| | | public String getSquarePicture() {
|
| | | return squarePicture;
|
| | | }
|
| | |
|
| | | public void setSquarePicture(String squarePicture) {
|
| | | this.squarePicture = squarePicture;
|
| | | }
|
| | | }
|
| | |
| | | private BigDecimal hongBaoPayment;// 红包支付金额
|
| | | @Column(name = "so_payment_hongbao_state")
|
| | | private Integer hongBaoPaymentState;// 支付金额状态
|
| | | @Column(name = "so_payment_money")
|
| | | private BigDecimal balancePayment;// 余额支付金额
|
| | | @Column(name = "so_payment_money_state")
|
| | | private Integer balancePaymentState;// 余额金额状态
|
| | | @Column(name = "so_payment_balance")
|
| | | private BigDecimal moneyPayment;// 现金支付金额
|
| | | private BigDecimal balancePayment;// 余额支付金额
|
| | | @Column(name = "so_payment_balance_state")
|
| | | private Integer balancePaymentState;// 余额金额状态
|
| | | @Column(name = "so_payment_money")
|
| | | private BigDecimal moneyPayment;// 现金支付金额
|
| | | @Column(name = "so_payment_money_state")
|
| | | private Integer moneyPaymentState;// 现金金额状态
|
| | | @Column(name = "so_pay_time")
|
| | | private Date payTime;// 订单支付时间
|
| | |
| | | private String stateDesc;// 状态简介
|
| | | @Column(name = "so_charge_account_type")
|
| | | private ChargeTypeEnum chargeAccountType;// 充值账号类型
|
| | |
|
| | | @Column(name = "so_charge_account")
|
| | | private String chargeAccount;// 充值账号
|
| | | @Column(name = "so_charge_account2")
|
| | |
| | | @Column(name = "so_order_goods_id")
|
| | | private BanLiShopOrderGoods orderGoods;
|
| | |
|
| | |
|
| | | public BanLiShopOrderGoods getOrderGoods() {
|
| | | return orderGoods;
|
| | | }
|
| | |
| | | <result column="sg_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="sg_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="sg_weight" property="weight" jdbcType="INTEGER" /> |
| | | <result column="so_square_picture" property="squarePicture" |
| | | jdbcType="VARCHAR" /> |
| | | <association property="goodsClass" column="sg_class_id" |
| | | javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass"> |
| | | <id column="sg_class_id" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <resultMap id="BaseResultDetailMap" type="com.yeshi.fanli.entity.shop.BanLiShopGoods"> |
| | | <id column="sg_id" property="id" jdbcType="BIGINT" /> |
| | |
| | | <result column="sg_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="sg_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="sg_weight" property="weight" jdbcType="INTEGER" /> |
| | | <result column="so_square_picture" property="squarePicture" |
| | | jdbcType="VARCHAR" /> |
| | | <association property="goodsClass" column="sg_class_id" |
| | | javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass" |
| | | select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsClassMapper.selectByPrimaryKey" /> |
| | |
| | | <collection property="imgList" column="sg_id" |
| | | select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsImgMapper.listByGoodsId" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight |
| | | <sql id="Base_Column_List">sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight,so_square_picture |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_shop_goods where sg_id = #{0} |
| | | </select> |
| | | |
| | | <select id="listGoods" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_shop_goods where sg_title like '${key}%' |
| | | <if test="state!=null"> |
| | | and sg_state=#{state} |
| | | </if> |
| | | <if test="state!=null">and sg_state=#{state}</if> |
| | | order by sg_weight desc limit #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countGoods" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from yeshi_ec_shop_goods where sg_title like '${key}%' |
| | | <if test="state!=null"> |
| | | and sg_state=#{state} |
| | | </if> |
| | | select count(*) from yeshi_ec_shop_goods where sg_title like '${key}%' |
| | | <if test="state!=null">and sg_state=#{state}</if> |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_shop_goods where sg_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | yeshi_ec_shop_goods where sg_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_shop_goods |
| | | (sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight) |
| | | (sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight,so_square_picture) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsClass.id,jdbcType=BIGINT},#{salesCount,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{desc,jdbcType=VARCHAR},#{chargeType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER}) |
| | | (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsClass.id,jdbcType=BIGINT},#{salesCount,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{desc,jdbcType=VARCHAR},#{chargeType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER},#{squarePicture,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="createTime != null">sg_create_time,</if> |
| | | <if test="updateTime != null">sg_update_time,</if> |
| | | <if test="weight != null">sg_weight,</if> |
| | | <if test="squarePicture != null">so_square_picture,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="weight != null">#{weight,jdbcType=INTEGER}</if> |
| | | <if test="squarePicture != null">#{squarePicture,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods">update |
| | |
| | | #{state,jdbcType=INTEGER},sg_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},sg_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} ,sg_weight |
| | | =#{weight,jdbcType=INTEGER} where sg_id = #{id,jdbcType=BIGINT} |
| | | =#{weight,jdbcType=INTEGER} ,so_square_picture |
| | | =#{squarePicture,jdbcType=VARCHAR} where sg_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods"> |
| | | update yeshi_ec_shop_goods |
| | |
| | | <if test="createTime != null">sg_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">sg_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="weight !=null">sg_weight =#{weight,jdbcType=INTEGER},</if> |
| | | <if test="squarePicture !=null">so_square_picture =#{squarePicture,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where sg_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | jdbcType="DECIMAL" /> |
| | | <result column="so_payment_hongbao_state" property="hongBaoPaymentState" |
| | | jdbcType="INTEGER" /> |
| | | <result column="so_payment_money" property="balancePayment" |
| | | <result column="so_payment_money" property="moneyPayment" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="so_payment_money_state" property="balancePaymentState" |
| | | <result column="so_payment_money_state" property="moneyPaymentState" |
| | | jdbcType="INTEGER" /> |
| | | <result column="so_payment_balance" property="moneyPayment" |
| | | <result column="so_payment_balance" property="balancePayment" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="so_payment_balance_state" property="moneyPaymentState" |
| | | <result column="so_payment_balance_state" property="balancePaymentState" |
| | | jdbcType="INTEGER" /> |
| | | <result column="so_pay_time" property="payTime" jdbcType="TIMESTAMP" /> |
| | | <result column="so_reject_time" property="rejectTime" jdbcType="TIMESTAMP" /> |
| | |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_shop_order |
| | | (so_id,so_uid,so_order_no,so_goods_id,so_goods_set_id,so_payment_hongbao,so_payment_hongbao_state,so_payment_money,so_payment_money_state,so_payment_balance,so_payment_balance_state,so_pay_time,so_reject_time,so_success_time,so_state,so_state_desc,so_charge_account,so_charge_account2,so_beizhu,so_create_time,so_update_time,so_order_goods_id,so_charge_account_type) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{goods.id,jdbcType=BIGINT},#{goodsSet.id,jdbcType=BIGINT},#{hongBaoPayment,jdbcType=DECIMAL},#{hongBaoPaymentState,jdbcType=INTEGER},#{balancePayment,jdbcType=DECIMAL},#{balancePaymentState,jdbcType=INTEGER},#{moneyPayment,jdbcType=DECIMAL},#{moneyPaymentState,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP},#{rejectTime,jdbcType=TIMESTAMP},#{successTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{chargeAccount,jdbcType=VARCHAR},#{chargeAccount2,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderGoods.id,jdbcType=BIGINT},#{chargeAccountType,jdbcType=VARCHAR}) |
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{goods.id,jdbcType=BIGINT},#{goodsSet.id,jdbcType=BIGINT},#{hongBaoPayment,jdbcType=DECIMAL},#{hongBaoPaymentState,jdbcType=INTEGER},#{moneyPayment,jdbcType=DECIMAL},#{moneyPaymentState,jdbcType=INTEGER},#{balancePayment,jdbcType=DECIMAL},#{balancePaymentState,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP},#{rejectTime,jdbcType=TIMESTAMP},#{successTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{chargeAccount,jdbcType=VARCHAR},#{chargeAccount2,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderGoods.id,jdbcType=BIGINT},#{chargeAccountType,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="goodsSet != null">so_goods_set_id,</if> |
| | | <if test="hongBaoPayment != null">so_payment_hongbao,</if> |
| | | <if test="hongBaoPaymentState != null">so_payment_hongbao_state,</if> |
| | | <if test="balancePayment != null">so_payment_money,</if> |
| | | <if test="balancePaymentState != null">so_payment_money_state,</if> |
| | | <if test="moneyPayment != null">so_payment_balance,</if> |
| | | <if test="moneyPaymentState != null">so_payment_balance_state,</if> |
| | | <if test="balancePayment != null"> so_payment_balance,</if> |
| | | <if test="balancePaymentState != null">so_payment_balance_state,</if> |
| | | <if test="moneyPayment != null">so_payment_money,</if> |
| | | <if test="moneyPaymentState != null">so_payment_money_state,</if> |
| | | <if test="payTime != null">so_pay_time,</if> |
| | | <if test="rejectTime != null">so_reject_time,</if> |
| | | <if test="successTime != null">so_success_time,</if> |
| | |
| | | #{goodsSet.id,jdbcType=BIGINT},so_payment_hongbao = |
| | | #{hongBaoPayment,jdbcType=DECIMAL},so_payment_hongbao_state = |
| | | #{hongBaoPaymentState,jdbcType=INTEGER},so_payment_money = |
| | | #{balancePayment,jdbcType=DECIMAL},so_payment_money_state = |
| | | #{balancePaymentState,jdbcType=INTEGER},so_payment_balance = |
| | | #{moneyPayment,jdbcType=DECIMAL},so_payment_balance_state = |
| | | #{moneyPaymentState,jdbcType=INTEGER},so_pay_time = |
| | | #{moneyPayment,jdbcType=DECIMAL},so_payment_money_state = |
| | | #{moneyPaymentState,jdbcType=INTEGER},so_payment_balance = |
| | | #{balancePayment,jdbcType=DECIMAL},so_payment_balance_state = |
| | | #{balancePaymentState,jdbcType=INTEGER},so_pay_time = |
| | | #{payTime,jdbcType=TIMESTAMP},so_reject_time = |
| | | #{rejectTime,jdbcType=TIMESTAMP},so_success_time = |
| | | #{successTime,jdbcType=TIMESTAMP},so_state = |
| | |
| | | </if> |
| | | <if test="hongBaoPaymentState != null">so_payment_hongbao_state=#{hongBaoPaymentState,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="balancePayment != null">so_payment_money=#{balancePayment,jdbcType=DECIMAL},</if> |
| | | <if test="balancePaymentState != null">so_payment_money_state=#{balancePaymentState,jdbcType=INTEGER}, |
| | | <if test="balancePayment != null">so_payment_balance=#{balancePayment,jdbcType=DECIMAL},</if> |
| | | <if test="balancePaymentState != null">so_payment_balance_state=#{balancePaymentState,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="moneyPayment != null">so_payment_balance=#{moneyPayment,jdbcType=DECIMAL},</if> |
| | | <if test="moneyPaymentState != null">so_payment_balance_state=#{moneyPaymentState,jdbcType=INTEGER}, |
| | | <if test="moneyPayment != null">so_payment_money=#{moneyPayment,jdbcType=DECIMAL},</if> |
| | | <if test="moneyPaymentState != null">so_payment_money_state=#{moneyPaymentState,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="payTime != null">so_pay_time=#{payTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="rejectTime != null">so_reject_time=#{rejectTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
|
| | | if (order == null)
|
| | | throw new BanLiShopOrderException(1, "订单不存在");
|
| | | if (order.getState() != BanLiShopOrder.STATE_REJECT)
|
| | | if (order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_FAIL
|
| | | || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_SUCCESS)
|
| | | throw new BanLiShopOrderException(2, "订单未被拒绝/订单已退款");
|
| | |
|
| | | BanLiShopOrder update = new BanLiShopOrder();
|
| | |
| | | BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid());
|
| | | Message message = new Message(MQTopicName.TOPIC_ORDER.name(),
|
| | | OrderTopicTagEnum.banLiShopOrderRefund.name(), new Gson().toJson(msg).getBytes());
|
| | | message.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L);// 延时24小时通知检测微信退款状态
|
| | | message.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60 *5L);// 延时24小时通知检测微信退款状态
|
| | | SendResult result = producer.send(message);
|
| | | if (result == null) {
|
| | | throw new BanLiShopOrderException(8, "消息发送失败");
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.transaction.support.DefaultTransactionDefinition;
|
| | | import org.yeshi.utils.exception.WXOrderException;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | |
| | | import com.yeshi.fanli.util.factory.RedPackDetailFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.util.shop.BanLiShopOrderUtil;
|
| | | import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
|
| | |
|
| | | @Service
|
| | | public class BanLiShopOrderServiceImpl implements BanLiShopOrderService {
|
| | |
| | | orderGoods.setSetName(set.getName());
|
| | | orderGoods.setState(set.getState());
|
| | | orderGoods.setZkPrice(set.getZkPrice());
|
| | | orderGoods.setPicture(goods.getSquarePicture());
|
| | | banLiShopOrderGoodsMapper.insertSelective(orderGoods);
|
| | | return orderGoods;
|
| | | }
|
| | |
| | |
|
| | | // 判断是否处于未付款
|
| | | if (order.getState() == BanLiShopOrder.STATE_NO_PAY) {
|
| | | /**
|
| | | * 查询是否已经微信支付
|
| | | */
|
| | | if (order.getMoneyPayment() != null) {
|
| | | try {
|
| | | boolean isS = BanLiShopWXPayUtil.isPaySuccess(order.getOrderNo());
|
| | | if (isS)// 支付成功,重新发送支付成功消息
|
| | | {
|
| | | BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid());
|
| | | Message message = new Message(MQTopicName.TOPIC_ORDER.name(),
|
| | | OrderTopicTagEnum.banLiShopOrderPaid.name(), new Gson().toJson(msg).getBytes());
|
| | | producer.send(message);
|
| | | return;
|
| | | }
|
| | |
|
| | | } catch (WXOrderException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | BanLiShopOrder update = new BanLiShopOrder();
|
| | | update.setId(id);
|
| | | update.setStateDesc(desc);
|
| | |
| | | String content) {
|
| | | try {
|
| | | String url = String.format(
|
| | | "http://111.230.142.62:8089/BuWan/email/sendEmail?fromAccount=%s&fromPwd=%s&toAccount=%s&title=%s&content=%s",
|
| | | "http://193.112.34.40:9001/BuWan/email/sendEmail?fromAccount=%s&fromPwd=%s&toAccount=%s&title=%s&content=%s",
|
| | | URLEncoder.encode(fromEmail, "UTF-8"), URLEncoder.encode(fromEmailPwd, "UTF-8"),
|
| | | URLEncoder.encode(toEmail, "UTF-8"), URLEncoder.encode(title, "UTF-8"),
|
| | | URLEncoder.encode(content, "UTF-8"));
|
| | |
| | | vo.setOrderId(order.getOrderNo());
|
| | | vo.setOrderTime(TimeUtil.getGernalTime(order.getCreateTime().getTime(), "yyyy-MM-dd HH:mm:ss"));
|
| | | // 需要确定订单状态输出
|
| | | if (order.getState() == BanLiShopOrder.STATE_INVALID) {
|
| | | vo.setState("订单失效");
|
| | | vo.setStateColor("#E5005C");
|
| | | vo.setStateDesc("未成功支付");
|
| | | if (order.getState() == BanLiShopOrder.STATE_INVALID || order.getState() == BanLiShopOrder.STATE_NO_PAY) {
|
| | | vo.setState("未付款");
|
| | | vo.setStateColor("#e5005c");
|
| | | } else if (order.getState() == BanLiShopOrder.STATE_PART_PAY) {
|
| | | vo.setState("未实付");
|
| | | vo.setStateColor("#e5005c");
|
| | | } else if (order.getState() == BanLiShopOrder.STATE_SUCCESS) {
|
| | | vo.setState("充值成功");
|
| | | vo.setStateColor("#2FB102");
|
| | | vo.setStateDesc("");
|
| | | } else {
|
| | | vo.setState("充值成功");
|
| | | vo.setStateColor("#2FB102");
|
| | | vo.setStateDesc("");
|
| | | } else if (order.getState() == BanLiShopOrder.STATE_REJECT
|
| | | || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_FAIL
|
| | | || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_PART_SUCCESS
|
| | | || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_SUCCESS) {// 拒绝了
|
| | | vo.setState("充值失败");
|
| | | vo.setStateColor("#e5005c");
|
| | | } else if (order.getState() == BanLiShopOrder.STATE_PAID) {
|
| | | vo.setState("审核中");
|
| | | vo.setStateColor("#777777");
|
| | | }
|
| | | vo.setStateDesc("实付款 ¥" + getPaidMoney(order));
|
| | |
|
| | | return vo;
|
| | | }
|
| | |
|
| | | private static String getPaidMoney(BanLiShopOrder order) {
|
| | | if (order.getMoneyPaymentState() == null || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_NOPAY
|
| | | || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_REFUND) {
|
| | | return "0";
|
| | | } else
|
| | | return order.getMoneyPayment().toString();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.mq.BaseMQMsgBody;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopOrder;
|
| | | import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopOrderPayService;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
| | | @Resource
|
| | | private BanLiShopOrderService banLiShopOrderService;
|
| | |
|
| | | @Resource
|
| | | private BanLiShopOrderPayService banLiShopOrderPayService;
|
| | |
|
| | | public BanLiShopOrderMessageListener() {
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | BaseMQMsgBody baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
|
| | | if (baseBody.isTest() != Constant.IS_TEST)
|
| | | return Action.ReconsumeLater;
|
| | | BaseMQMsgBody baseBody = null;
|
| | | try {
|
| | | baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
|
| | | if (baseBody.isTest() != Constant.IS_TEST)
|
| | | return Action.ReconsumeLater;
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | LogHelper.mqInfo("consumer:BanLiShopOrderMessageListener", message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | |
| | | // 使订单失效
|
| | | banLiShopOrderService.invalidOrderByOrderId(banLiShopOrderMQMsg.getOrderId(), "订单失效-长期未付款");
|
| | | return Action.CommitMessage;
|
| | | } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.banLiShopOrderPaid.name()))// 商城订单付款成功
|
| | | {
|
| | | BanLiShopOrderMQMsg msg = new Gson().fromJson(new String(message.getBody()), BanLiShopOrderMQMsg.class);
|
| | | BanLiShopOrder banLiOrder = banLiShopOrderService.selectByPrimaryKey(msg.getOrderId());
|
| | | try {
|
| | | banLiShopOrderPayService.payOrderByMoney(banLiOrder.getId(), banLiOrder.getMoneyPayment());
|
| | | } catch (BanLiShopOrderException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.banLiShopOrderRefund.name()))// 商城退款订阅
|
| | | {
|
| | | BanLiShopOrderMQMsg msg = new Gson().fromJson(new String(message.getBody()), BanLiShopOrderMQMsg.class);
|
| | | try {
|
| | | banLiShopOrderPayService.refund(msg.getOrderId());
|
| | | } catch (BanLiShopOrderException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | |
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 是否支付成功
|
| | | * |
| | | * @param orderNo
|
| | | * @return
|
| | | * @throws WXOrderException
|
| | | */
|
| | | public static boolean isPaySuccess(String orderNo) throws WXOrderException {
|
| | | return WXPayUtil.isPaySuccess(BanLiShopOrderUtil.getWXPayOrderNo(orderNo),
|
| | | new WXAPPInfo(Constant.getWXAccount(null, null).getGzAppId(),
|
| | | Constant.getWXAccount(null, null).getGzAppSecret(), MCH_ID, MCH_KEY));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 签名是否正确
|
| | | *
|
| | | * @param params
|
| | |
| | | <bean id="banLiShopOrderMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.order.BanLiShopOrderMessageListener"></bean> <!--Listener 配置 -->
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="orderTransactionConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | <bean id="banLiShopOrderConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | |
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 订阅下单延时消息 -->
|
| | | <entry value-ref="inviteOrderSubsidyMsgListener">
|
| | | <!-- 订阅下单延时消息,订单支付成功消息 -->
|
| | | <entry value-ref="banLiShopOrderMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_ORDER" />
|
| | | <property name="expression" value="banLiShopOrderDelay" /><!--expression |
| | | <property name="expression" value="banLiShopOrderDelay||banLiShopOrderPaid||banLiShopOrderRefund" /><!--expression |
| | | 即 Tag,可以设置成具体的 Tag,如 taga||tagb||tagc,也可设置成 *。 * 仅代表订阅所有 Tag,不支持通配 -->
|
| | | </bean>
|
| | | </key>
|