Merge remote-tracking branch 'origin/mater-1.6.0' into div
| | |
| | |
|
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HomeNavbarUserService homeNavbarUserService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoDeleteRecordService userInfoDeleteRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | | |
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | |
| | | }
|
| | | redisManager.cacheCommonString(key, "1", 120);
|
| | |
|
| | | |
| | |
|
| | | // 支付宝绑定
|
| | | ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
|
| | | .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount, account);
|
| | |
| | | "PERM_AML_NOT_REALNAME_REV", "PAYEE_USER_INFO_ERROR", "PAYEE_ACC_OCUPIED",
|
| | | "PERMIT_CHECK_PERM_IDENTITY_THEFT", "PERMIT_NON_BANK_LIMIT_PAYEE", "EXCEED_LIMIT_UNRN_DM_AMOUNT" };
|
| | | try {
|
| | | BigDecimal balance = user.getMyHongBao();
|
| | | BindingAccount bindingAccount = bindingAccountService.changeAlipayBindingWithVerify(uid, name, account);
|
| | | out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount),
|
| | | "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。"));
|
| | | // 余额充足
|
| | | if (balance.compareTo(new BigDecimal("0.1")) >= 0)
|
| | | out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount),
|
| | | "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。"));
|
| | | else
|
| | | out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount),
|
| | | "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。注:此0.1元将会在后续产生的余额中合理扣除,敬请知晓。"));
|
| | | } catch (AlipayTransferException e1) {
|
| | | if (e1.getSubCode().equalsIgnoreCase("PAYEE_NOT_EXIST")) {
|
| | | String msg = "系统未能成功转账0.1元,提现账号信息有误,请核对后重新填写。";
|
| | |
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | |
|
| | | /* 同步未登录之前设备抽奖数据 */
|
| | | try {
|
| | | int platformType = 0;
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | /* 新人红包 */
|
| | | try {
|
| | | userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(), device);
|
| | | userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(), device);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | } |
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | List<CommonOrderVO> listUserOrder(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid, |
| | | @Param("state") Integer state, @Param("type") Integer type, @Param("orderState") Integer orderState, |
| | | @Param("orderNo") String orderNo, @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("day") Integer day, @Param("source")Integer source); |
| | | @Param("day") Integer day, @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 统计用户订单 并订单号分组 |
| | |
| | | */ |
| | | long countUserOrder(@Param("uid") Long uid, @Param("state") Integer state, @Param("type") Integer type, |
| | | @Param("orderState") Integer orderState, @Param("orderNo") String orderNo, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day, @Param("source")Integer source); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day, |
| | | @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 判断部分失效状态 |
| | |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> countHistoryOrder(@Param("uid") Long uid, @Param("day") Integer day, @Param("source") Integer source); |
| | | Map<String, BigDecimal> countHistoryOrder(@Param("uid") Long uid, @Param("day") Integer day, |
| | | @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 昨日总订单-根据红包类型 自购 邀请 分享 |
| | |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> countByUidAndOrderState(@Param("uid") Long uid, @Param("type") Integer type, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day, |
| | | @Param("source")Integer source); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day, |
| | | @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 奖金订单数量 |
| | |
| | | * @return |
| | | */ |
| | | long countBonusOrderNumber(@Param("uid") Long uid, @Param("type") Integer type, @Param("day") Integer day, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 奖金统计 |
| | |
| | | * @return |
| | | */ |
| | | BigDecimal countBonusOrderMoney(@Param("uid") Long uid, @Param("type") Integer type, @Param("day") Integer day, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 奖金统计 |
| | |
| | | * @return |
| | | */ |
| | | Map<String, Object> countBonusOrderMoneyAndNumber(@Param("uid") Long uid, @Param("type") Integer type, |
| | | @Param("day") Integer day, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source); |
| | | @Param("day") Integer day, @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("source") Integer source); |
| | | |
| | | int countByOrderNOAndOrderType(@Param("orderNO") String orderNO, @Param("orderType") int orderType); |
| | | |
| | |
| | | List<CommonOrderVO> listQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state, |
| | | @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("source")Integer source); |
| | | |
| | | |
| | | @Param("endTime") String endTime, @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 订单列表查询(不包含子订单) |
| | | * 订单列表查询(不包含子订单) |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param keyType |
| | |
| | | List<CommonOrderVO> listQueryWithNoChild(@Param("start") long start, @Param("count") int count, |
| | | @Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state, |
| | | @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("source")Integer source); |
| | | @Param("endTime") String endTime, @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 统计 |
| | | */ |
| | | long countQuery(@Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state, |
| | | @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("source")Integer source); |
| | | |
| | | long countQueryWithNoChild(@Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state, |
| | | @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("source")Integer source); |
| | | @Param("endTime") String endTime, @Param("source") Integer source); |
| | | |
| | | long countQueryWithNoChild(@Param("keyType") Integer keyType, @Param("key") String key, |
| | | @Param("state") Integer state, @Param("type") Integer type, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source") Integer source); |
| | | |
| | | /** |
| | | * 根据来源类型与订单号查询列表 |
| | |
| | | @Table("yeshi_ec_user_debt")
|
| | | public class UserMoneyDebt {
|
| | | public enum UserMoneyDebtTypeEnum {
|
| | | order("维权退款"), other("其他");
|
| | | order("维权退款"), other("其他"), extractVerify("提现账号验证");
|
| | | private final String desc;
|
| | |
|
| | | private UserMoneyDebtTypeEnum(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | |
| | | @SerializedName("order_modify_at")
|
| | | @Column(name = "po_order_modify_at")
|
| | | private Long orderModifyAt;// 最后更新时间
|
| | | @SerializedName("order_receive_time")
|
| | | @Column(name = "po_order_receive_time")
|
| | | private Long orderReceiveTime;//收货时间
|
| | | @SerializedName("custom_parameters")
|
| | | @Column(name = "po_custom_parameters")
|
| | | private String customParameters;// 自定义参数
|
| | |
| | | public void setOrderId(String orderId) {
|
| | | this.orderId = orderId;
|
| | | }
|
| | |
|
| | | public Long getOrderReceiveTime() {
|
| | | return orderReceiveTime;
|
| | | }
|
| | |
|
| | | public void setOrderReceiveTime(Long orderReceiveTime) {
|
| | | this.orderReceiveTime = orderReceiveTime;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | if (result != null && result.getOrderList() != null)
|
| | | saveJDOrders(result.getOrderList());
|
| | | // 查询上个小时的
|
| | | result = JDApiUtil.getOrderList(1, 200, new Date(now - 1000 * 60 * 60 * 24L), JDApiUtil.ORDER_TYPE_CREATETIME);
|
| | | result = JDApiUtil.getOrderList(1, 200, new Date(now - 1000 * 60 * 60L), JDApiUtil.ORDER_TYPE_CREATETIME);
|
| | | if (result != null && result.getOrderList() != null)
|
| | | saveJDOrders(result.getOrderList());
|
| | | }
|
| | |
| | | public void doJob2() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | doTaoBaoWeiQuanOrder(2);
|
| | | LogHelper.error("处理返利到账前置");
|
| | | try {
|
| | | |
| | | doTaoBaoWeiQuanOrder(2);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | LogHelper.error("开始处理返利");
|
| | | orderProcessService.fanli();
|
| | | }
|
| | |
|
| | |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_order_modify_at" property="orderModifyAt" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_order_receive_time" property="orderReceiveTime" |
| | | jdbcType="BIGINT" /> |
| | | <result column="po_custom_parameters" property="customParameters" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="po_order_settle_time" property="orderSettleTime" |
| | |
| | | <result column="po_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="po_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time |
| | | <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time,po_order_receive_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_pdd_order |
| | | (po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time) |
| | | (po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time,po_order_receive_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{orderSn,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{groupId,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{goodsThumbnailUrl,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},#{goodsPrice,jdbcType=BIGINT},#{orderAmount,jdbcType=BIGINT},#{pId,jdbcType=VARCHAR},#{promotionRate,jdbcType=BIGINT},#{promotionAmount,jdbcType=BIGINT},#{orderStatus,jdbcType=INTEGER},#{orderStatusDesc,jdbcType=VARCHAR},#{orderCreateTime,jdbcType=BIGINT},#{orderPayTime,jdbcType=BIGINT},#{orderGroupSuccessTime,jdbcType=BIGINT},#{orderVerifyTime,jdbcType=BIGINT},#{orderModifyAt,jdbcType=BIGINT},#{customParameters,jdbcType=VARCHAR},#{orderSettleTime,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | (#{id,jdbcType=BIGINT},#{orderSn,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{groupId,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{goodsThumbnailUrl,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},#{goodsPrice,jdbcType=BIGINT},#{orderAmount,jdbcType=BIGINT},#{pId,jdbcType=VARCHAR},#{promotionRate,jdbcType=BIGINT},#{promotionAmount,jdbcType=BIGINT},#{orderStatus,jdbcType=INTEGER},#{orderStatusDesc,jdbcType=VARCHAR},#{orderCreateTime,jdbcType=BIGINT},#{orderPayTime,jdbcType=BIGINT},#{orderGroupSuccessTime,jdbcType=BIGINT},#{orderVerifyTime,jdbcType=BIGINT},#{orderModifyAt,jdbcType=BIGINT},#{customParameters,jdbcType=VARCHAR},#{orderSettleTime,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderReceiveTime,jdbcType=BIGINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="orderId != null">po_order_id,</if> |
| | | <if test="createTime != null">po_create_time,</if> |
| | | <if test="updateTime != null">po_update_time,</if> |
| | | <if test="orderReceiveTime != null">po_order_receive_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="orderReceiveTime != null">#{orderReceiveTime,jdbcType=BIGINT},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder">update |
| | |
| | | #{orderSettleTime,jdbcType=BIGINT},po_order_id = |
| | | #{orderId,jdbcType=VARCHAR},po_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},po_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where po_id = #{id,jdbcType=BIGINT} |
| | | #{updateTime,jdbcType=TIMESTAMP},po_order_receive_time = |
| | | #{orderReceiveTime,jdbcType=BIGINT} where po_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder"> |
| | | update yeshi_ec_pdd_order |
| | |
| | | <if test="orderId != null">po_order_id=#{orderId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">po_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">po_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="orderReceiveTime != null">po_order_receive_time=#{orderReceiveTime,jdbcType=BIGINT},</if> |
| | | </set> |
| | | where po_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!-- 统计 --> |
| | | <sql id="Column_DateType"> |
| | | <if test="dateType == 1">FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') AS 'showDate' |
| | | <if test="dateType == 1">FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') AS |
| | | 'showDate' |
| | | </if> |
| | | <if test="dateType == 2">FROM_UNIXTIME(po_order_create_time,'%m') AS 'showDate'</if> |
| | | <if test="dateType == 3">FROM_UNIXTIME(po_order_create_time,'%Y') AS 'showDate'</if> |
| | | <if test="dateType == 2">FROM_UNIXTIME(po_order_create_time,'%m') AS 'showDate' |
| | | </if> |
| | | <if test="dateType == 3">FROM_UNIXTIME(po_order_create_time,'%Y') AS 'showDate' |
| | | </if> |
| | | </sql> |
| | | <sql id="Count_Select_DateType"> |
| | | <if test="startTime != null and startTime != '' "> |
| | |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}' |
| | | </if> |
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(po_order_create_time,'%Y') = '${year}'</if> |
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(po_order_create_time,'%Y') = '${year}' |
| | | </if> |
| | | </sql> |
| | | <sql id="Count_Group_DateType"> |
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d')</if> |
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') |
| | | </if> |
| | | <if test="dateType == 2">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m')</if> |
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y')</if> |
| | | </sql> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | SELECT IFNULL(COUNT(`po_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | |
| | | <include refid="Count_Group_DateType" /> |
| | | ORDER BY po_order_create_time |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.AlipayAccountValidNormalHistoryMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDebtMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDebtReturnHistoryMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private AlipayAccountValidNormalHistoryMapper alipayAccountValidNormalHistoryMapper;
|
| | |
|
| | | @Override
|
| | | public void addUserMoneyDebt(UserMoneyDebt debt) throws UserMoneyDebtException {
|
| | |
| | | }
|
| | |
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.fanliOrderWeiQuan(uid, weiQuanDrawBack.getOrderId(),Constant.SOURCE_TYPE_TAOBAO, money,
|
| | | userInfoService.getBalance(uid));
|
| | | userMoneyMsgNotificationService.fanliOrderWeiQuan(uid, weiQuanDrawBack.getOrderId(),
|
| | | Constant.SOURCE_TYPE_TAOBAO, money, userInfoService.getBalance(uid));
|
| | |
|
| | | break;
|
| | | case HongBaoV2.TYPE_SHARE_GOODS:
|
| | |
| | | weiQuanDrawBack, money);
|
| | | userMoneyService.subUserMoney(uid, money, userMoneyDetail);
|
| | |
|
| | | userMoneyMsgNotificationService.shareOrderWeiQuan(debt.getUid(), weiQuanDrawBack.getOrderId(),Constant.SOURCE_TYPE_TAOBAO,
|
| | | money, userInfoService.getBalance(uid));
|
| | | userMoneyMsgNotificationService.shareOrderWeiQuan(debt.getUid(), weiQuanDrawBack.getOrderId(),
|
| | | Constant.SOURCE_TYPE_TAOBAO, money, userInfoService.getBalance(uid));
|
| | |
|
| | | } catch (UserMoneyDetailException e) {
|
| | | throw new UserMoneyDebtException(12, "插入资金详情出错");
|
| | |
| | | }
|
| | |
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.inviteOrderWeiQuan(uid, weiQuanDrawBack.getOrderId(),Constant.SOURCE_TYPE_TAOBAO, money,
|
| | | userInfoService.getBalance(uid));
|
| | | userMoneyMsgNotificationService.inviteOrderWeiQuan(uid, weiQuanDrawBack.getOrderId(),
|
| | | Constant.SOURCE_TYPE_TAOBAO, money, userInfoService.getBalance(uid));
|
| | | break;
|
| | | }
|
| | | } else if (debt.getType() == UserMoneyDebtTypeEnum.extractVerify) {// 提现验证
|
| | | // 新版资金记录
|
| | | AlipayAccountValidNormalHistory aliPayAccountHistory = alipayAccountValidNormalHistoryMapper
|
| | | .selectByPrimaryKey(debt.getSourceId());
|
| | | if (aliPayAccountHistory == null)
|
| | | return;
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractAccountValid(aliPayAccountHistory,
|
| | | money);
|
| | | userMoneyService.subUserMoney(aliPayAccountHistory.getUid(), money, userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | throw new UserMoneyDebtException(12, "插入资金详情出错");
|
| | | }
|
| | |
|
| | | userMoneyMsgNotificationService.alipayAccountValid(aliPayAccountHistory);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | goods = JDUtil.getGoodsFromWeb(itemOrder.getSkuId());
|
| | | }
|
| | |
|
| | | if (goods == null) {
|
| | | goods = new JDGoods();
|
| | | goods.setSkuName(itemOrder.getSkuName());
|
| | | goods.setPrice(itemOrder.getPrice());
|
| | | goods.setSkuId(itemOrder.getSkuId());
|
| | | }
|
| | |
|
| | | if (goods != null) {
|
| | | cog = CommonOrderGoodsFactory.create(goods);
|
| | | }
|
| | |
|
| | | cog.setCreateTime(new Date());
|
| | | cog.setUpdateTime(new Date());
|
| | | commonOrderGoodsMapper.insertSelective(cog);
|
| | |
| | | if (!StringUtil.isNullOrEmpty(commonOrder.getTradeId()))
|
| | | oldCommonOrder = commonOrderMapper.selectBySourceTypeAndTradeId(commonOrder.getSourceType(),
|
| | | commonOrder.getTradeId());
|
| | | else
|
| | | oldCommonOrder = commonOrderMapper.selectByOrderNoAndOrderTypeAndOrderBy(commonOrder.getOrderNo(),
|
| | | commonOrder.getSourceType(), commonOrder.getOrderBy());
|
| | |
|
| | | else {
|
| | | throw new CommonOrderException(10, "交易ID为空");
|
| | | }
|
| | | if (oldCommonOrder == null)// 新增
|
| | | {
|
| | | commonOrder.setCreateTime(new Date());
|
| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.HongBaoV2Mapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | |
| | | public void weiQuanOrder(List<TaoBaoWeiQuanOrder> orderList) {
|
| | | if (orderList != null)
|
| | | for (TaoBaoWeiQuanOrder order : orderList) {
|
| | | if (order.getState().contains("维权成功")) {
|
| | | CMQManager.getInstance().addWeiQuanOrderMsg(order);
|
| | | try {
|
| | | if (order.getState().contains("维权成功")) {
|
| | | CMQManager.getInstance().addWeiQuanOrderMsg(order);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.error("维权订单加入到队列出错:"+order!=null?new Gson().toJson(order):null);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | // 加入订单
|
| | | Order oldOrder = orderMapper.selectOrderByOrderIdAndOrderType(jdOrder.getOrderId() + "",
|
| | | Constant.SOURCE_TYPE_JD);
|
| | | if (uid == null && oldOrder.getBeizhu().contains("补单"))
|
| | | if (uid == null && oldOrder != null && oldOrder.getBeizhu() != null && oldOrder.getBeizhu().contains("补单"))
|
| | | uid = oldOrder.getUserInfo().getId();
|
| | |
|
| | | if (uid == null)
|
| | |
| | |
|
| | | // 加入订单
|
| | | Order oldOrder = orderMapper.selectOrderByOrderIdAndOrderType(pddOrder.getOrderSn(), Constant.SOURCE_TYPE_PDD);
|
| | | if (uid == null && oldOrder.getBeizhu().contains("补单"))
|
| | | if (uid == null && oldOrder != null && oldOrder.getBeizhu() != null && oldOrder.getBeizhu().contains("补单"))
|
| | | uid = oldOrder.getUserInfo().getId();
|
| | |
|
| | | if (uid == null)
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void repairCommonOrderByByTaoBaoOrder(String orderId) {
|
| | | //根据订单号查询淘宝订单
|
| | | List<TaoBaoOrder> orderList= taoBaoOrderService.getTaoBaoOrderByOrderId(orderId);
|
| | | if(orderList!=null)
|
| | | for(TaoBaoOrder order:orderList)
|
| | | {
|
| | | //根据交易ID查询常规订单
|
| | | CommonOrder commonOrder= commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO, order.getTradeId());
|
| | | //修复orderby
|
| | | if(commonOrder!=null)
|
| | | {CommonOrder update=new CommonOrder(commonOrder.getId());
|
| | | update.setOrderBy(order.getOrderBy());
|
| | | update.setUpdateTime(new Date()); |
| | | commonOrderService.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.exception.AlipayAccountException;
|
| | | import com.yeshi.fanli.exception.AlipayTransferException;
|
| | | import com.yeshi.fanli.exception.BindingAccountException;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDebtException;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
|
| | |
| | | private UserMoneyService userMoneyService;
|
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | | @Resource
|
| | | private UserMoneyDebtService userMoneyDebtService;
|
| | |
|
| | | public List<BindingAccount> getBindingAccountByUid(long uid) {
|
| | | return bindingAccountMapper.selectByUid(uid);
|
| | |
| | |
|
| | | UserInfo userInfo = userInfoMapper.selectByPrimaryKeyForUpdate(uid);
|
| | | if (userInfo.getMyHongBao().compareTo(new BigDecimal("0")) <= 0)
|
| | | throw new AlipayAccountException(AlipayAccountException.CODE_NO_MONEY, "你的账户目前没有余额,无需绑定提现帐号。");
|
| | | throw new AlipayAccountException(AlipayAccountException.CODE_NO_MONEY, "你的账户无余额,无需绑定提现帐号。");
|
| | |
|
| | | // 需要转账验证
|
| | | BigDecimal money = new BigDecimal("0.1");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 扣款
|
| | | userMoneyService.subUserMoney(uid, money, userMoneyDetail);
|
| | | userMoneyMsgNotificationService.alipayAccountValid(history);
|
| | | // 余额充足
|
| | | if (userInfo.getMyHongBao().compareTo(money) >= 0) {
|
| | | // 扣款
|
| | | userMoneyService.subUserMoney(uid, money, userMoneyDetail);
|
| | | userMoneyMsgNotificationService.alipayAccountValid(history);
|
| | | } else {// 余额不足,暂时不扣款,加入借贷关系
|
| | | UserMoneyDebt debt = new UserMoneyDebt();
|
| | | debt.setCreateTime(new Date());
|
| | | debt.setLeftMoney(money);
|
| | | debt.setOriginMoney(money);
|
| | | debt.setSourceId(history.getId());
|
| | | debt.setType(UserMoneyDebtTypeEnum.extractVerify);
|
| | | debt.setUid(uid);
|
| | | try {
|
| | | userMoneyDebtService.addUserMoneyDebt(debt);
|
| | | } catch (UserMoneyDebtException e) {
|
| | | LogHelper.errorDetailInfo(e, "验证ID:" + history.getId(), "");
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void transferAlipayWithVerify(String account, String name)
|
| | |
| | | * @param pddOrder
|
| | | */
|
| | | public void processPDDOrder(PDDOrder pddOrder);
|
| | | |
| | | |
| | | /**
|
| | | * 根据淘宝订单的排序值修复常规订单的排序值
|
| | | * @param orderId
|
| | | */
|
| | | public void repairCommonOrderByByTaoBaoOrder(String orderId);
|
| | |
|
| | | }
|
| | |
| | | public void run() {
|
| | | while (true) {
|
| | | try {
|
| | |
|
| | | // 取16个订单
|
| | | List<String> orderIds = CMQManager.getInstance().consumeTaoBaoOrderMsg(16);
|
| | | Map<String, List<TaoBaoOrder>> map = new HashMap<>();
|
| | | if (orderIds != null) {
|
| | | for (String orderId : orderIds) {
|
| | | if (NumberUtil.isNumeric(orderId.trim())) {
|
| | | Map<String, List<TaoBaoOrder>> map = new HashMap<>();
|
| | | List<TaoBaoOrder> orderList = taoBaoOrderService
|
| | | .getTaoBaoOrderByOrderId(orderId);
|
| | | map.put(orderId, orderList);
|
| | |
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.error("还款出错:" + e.getMessage());
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | PDDOrderCMQManager.getInstance().deletePDDOrder(key);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.error("拼多多订单:" + e.getMessage());
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | } else if (3 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_FK;
|
| | | } else if (4 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_WQ;
|
| | | if (order.getOrderReceiveTime() == null || order.getOrderReceiveTime() == 0)
|
| | | state = CommonOrder.STATE_SX;
|
| | | else
|
| | | state = CommonOrder.STATE_WQ;
|
| | | } else if (5 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_JS;
|
| | | } else if (8 == order.getOrderStatus()) {
|
| | |
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.jd.JDOrderItem;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | json.put("orderReq", orderReq);
|
| | | String result = baseRequest2("jd.union.open.order.query", null, json);
|
| | | System.out.println(result);
|
| | | JSONObject root = JSONObject.fromObject(result).optJSONObject("jd_union_open_order_query_response");
|
| | | if (root.optInt("code") == 0) {
|
| | | boolean hasMore = root.optBoolean("hasMore");
|
| | |
| | | List<JDOrder> orderList = new Gson().fromJson(date, typeToken);
|
| | | if (orderList != null)
|
| | | for (JDOrder order : orderList) {
|
| | | Map<Long, List<JDOrderItem>> map = new HashMap<>();
|
| | | for (int i = 0; i < order.getOrderItemList().size(); i++) {
|
| | | JDOrderItem orderItem = order.getOrderItemList().get(i);
|
| | | if (map.get(orderItem.getSkuId()) == null)
|
| | | map.put(orderItem.getSkuId(), new ArrayList<>());
|
| | | map.get(orderItem.getSkuId()).add(orderItem);
|
| | |
|
| | | order.getOrderItemList().get(i)
|
| | | .setTradeId(order.getOrderId() + "-" + order.getOrderItemList().get(i).getSkuId());
|
| | | order.getOrderItemList().get(i).setOrderId(order.getOrderId());
|
| | | order.getOrderItemList().get(i).setOrderBy(i + 1);
|
| | | }
|
| | | // 查询商品ID相同的子订单
|
| | | for (Iterator<Long> its = map.keySet().iterator(); its.hasNext();) {
|
| | | Long skuId = its.next();
|
| | | if (map.get(skuId).size() > 1) {
|
| | | int skuOrderBy = 1;
|
| | | for (int i = 0; i < order.getOrderItemList().size(); i++) {
|
| | | JDOrderItem orderItem = order.getOrderItemList().get(i);
|
| | | if (orderItem.getSkuId().longValue() == skuId) {
|
| | | order.getOrderItemList().get(i).setTradeId(order.getOrderId() + "-"
|
| | | + order.getOrderItemList().get(i).getSkuId() + "-" + skuOrderBy++);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | return new JDOrderResult(hasMore, orderList);
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | map.put("page", page + "");
|
| | | map.put("page_size", pageSize + "");
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject root = json.optJSONObject("order_list_get_response");
|
| | | if (root != null) {
|