| | |
| | | @Column(name = "tmo_state")
|
| | | private String state;
|
| | | @Column(name = "tmo_jiesuan_time")
|
| | | private String jieSuanTime;
|
| | | private Date jieSuanTime;
|
| | | @Column(name = "tmo_weiquan_time")
|
| | | private String weiQuanTime;
|
| | | private Date weiQuanTime;
|
| | | @Column(name = "tmo_weiquan_finish_time")
|
| | | private String weiQuanFinishTime;
|
| | | private Date weiQuanFinishTime;
|
| | | @Column(name = "tmo_createtime")
|
| | | private Date createTime;// 创建时间
|
| | | @Column(name = "tmo_updatetime")
|
| | |
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public String getJieSuanTime() {
|
| | | public Date getJieSuanTime() {
|
| | | return jieSuanTime;
|
| | | }
|
| | |
|
| | | public void setJieSuanTime(String jieSuanTime) {
|
| | | public void setJieSuanTime(Date jieSuanTime) {
|
| | | this.jieSuanTime = jieSuanTime;
|
| | | }
|
| | |
|
| | | public String getWeiQuanTime() {
|
| | | public Date getWeiQuanTime() {
|
| | | return weiQuanTime;
|
| | | }
|
| | |
|
| | | public void setWeiQuanTime(String weiQuanTime) {
|
| | | public void setWeiQuanTime(Date weiQuanTime) {
|
| | | this.weiQuanTime = weiQuanTime;
|
| | | }
|
| | |
|
| | | public String getWeiQuanFinishTime() {
|
| | | public Date getWeiQuanFinishTime() {
|
| | | return weiQuanFinishTime;
|
| | | }
|
| | |
|
| | | public void setWeiQuanFinishTime(String weiQuanFinishTime) {
|
| | | public void setWeiQuanFinishTime(Date weiQuanFinishTime) {
|
| | | this.weiQuanFinishTime = weiQuanFinishTime;
|
| | | }
|
| | |
|
| | |
| | | public void doJob2() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | doJob4();
|
| | | doTaoBaoWeiQuan();
|
| | |
|
| | | orderProcessService.fanli();
|
| | | }
|
| | |
| | | // 维权订单处理-处理最近60天的
|
| | | // 30分钟一次
|
| | | @Scheduled(cron = "0 0/30 * * * ? ")
|
| | | public void doJob4() {
|
| | | public void doTaoBaoWeiQuan() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | |
| | |
|
| | | // 处理分享商品所产生的订单
|
| | | @Scheduled(cron = "0 0/2 * * * ? ")
|
| | | public void doJob7() {
|
| | | public void doPidOrder() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | pidOrderService.doPidOrder();
|
| | |
| | | <result column="tmo_fan_money" property="fanMoney" jdbcType="DECIMAL" /> |
| | | <result column="tmo_state" property="state" jdbcType="VARCHAR" /> |
| | | <result column="tmo_jiesuan_time" property="jieSuanTime" |
| | | jdbcType="VARCHAR" /> |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="tmo_weiquan_time" property="weiQuanTime" |
| | | jdbcType="VARCHAR" /> |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="tmo_weiquan_finish_time" property="weiQuanFinishTime" |
| | | jdbcType="VARCHAR" /> |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="tmo_createtime" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="tmo_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | |
| | | yeshi_ec_taobao_weiqaun_order |
| | | (tmo_id,tmo_order_id,tmo_order_item_id,tmo_goods_name,tmo_money,tmo_fan_money,tmo_state,tmo_jiesuan_time,tmo_weiquan_time,tmo_weiquan_finish_time,tmo_createtime,tmo_updatetime) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{orderItemId,jdbcType=VARCHAR},#{goodsName,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL},#{fanMoney,jdbcType=DECIMAL},#{state,jdbcType=VARCHAR},#{jieSuanTime,jdbcType=VARCHAR},#{weiQuanTime,jdbcType=VARCHAR},#{weiQuanFinishTime,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | (#{id,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{orderItemId,jdbcType=VARCHAR},#{goodsName,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL},#{fanMoney,jdbcType=DECIMAL},#{state,jdbcType=VARCHAR},#{jieSuanTime,jdbcType=TIMESTAMP},#{weiQuanTime,jdbcType=TIMESTAMP},#{weiQuanFinishTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="fanMoney != null">#{fanMoney,jdbcType=DECIMAL},</if> |
| | | <if test="state != null">#{state,jdbcType=VARCHAR},</if> |
| | | <if test="jieSuanTime != null">#{jieSuanTime,jdbcType=VARCHAR},</if> |
| | | <if test="weiQuanTime != null">#{weiQuanTime,jdbcType=VARCHAR},</if> |
| | | <if test="weiQuanFinishTime != null">#{weiQuanFinishTime,jdbcType=VARCHAR},</if> |
| | | <if test="jieSuanTime != null">#{jieSuanTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="weiQuanTime != null">#{weiQuanTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="weiQuanFinishTime != null">#{weiQuanFinishTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | |
| | | #{money,jdbcType=DECIMAL},tmo_fan_money = |
| | | #{fanMoney,jdbcType=DECIMAL},tmo_state = |
| | | #{state,jdbcType=VARCHAR},tmo_jiesuan_time = |
| | | #{jieSuanTime,jdbcType=VARCHAR},tmo_weiquan_time = |
| | | #{weiQuanTime,jdbcType=VARCHAR},tmo_weiquan_finish_time = |
| | | #{weiQuanFinishTime,jdbcType=VARCHAR},tmo_createtime = |
| | | #{jieSuanTime,jdbcType=TIMESTAMP},tmo_weiquan_time = |
| | | #{weiQuanTime,jdbcType=TIMESTAMP},tmo_weiquan_finish_time = |
| | | #{weiQuanFinishTime,jdbcType=TIMESTAMP},tmo_createtime = |
| | | #{createTime,jdbcType=TIMESTAMP},tmo_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP} where tmo_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | <if test="money != null">tmo_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="fanMoney != null">tmo_fan_money=#{fanMoney,jdbcType=DECIMAL},</if> |
| | | <if test="state != null">tmo_state=#{state,jdbcType=VARCHAR},</if> |
| | | <if test="jieSuanTime != null">tmo_jiesuan_time=#{jieSuanTime,jdbcType=VARCHAR},</if> |
| | | <if test="weiQuanTime != null">tmo_weiquan_time=#{weiQuanTime,jdbcType=VARCHAR},</if> |
| | | <if test="weiQuanFinishTime != null">tmo_weiquan_finish_time=#{weiQuanFinishTime,jdbcType=VARCHAR}, |
| | | <if test="jieSuanTime != null">tmo_jiesuan_time=#{jieSuanTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="weiQuanTime != null">tmo_weiquan_time=#{weiQuanTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="weiQuanFinishTime != null">tmo_weiquan_finish_time=#{weiQuanFinishTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createTime != null">tmo_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">tmo_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.OrderItemMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.share.PidUserMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoExtra;
|
| | |
| | |
|
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
|
| | |
|
| | | @Override
|
| | | public void processOrder(Map<String, List<TaoBaoOrder>> orders) {
|
| | |
| | | public void fanli(HongBao hb) throws TaoBaoWeiQuanException {
|
| | | // 查询最新的红包数据
|
| | | hb = hongBaoMapper.selectByPrimaryKeyForUpdate(hb.getId());
|
| | | // 维权中的不返利
|
| | | List<TaoBaoWeiQuanOrder> taoBaoWeiQuanList = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(hb.getOrderId(), "维权创建");
|
| | | if (taoBaoWeiQuanList != null && taoBaoWeiQuanList.size() > 0)
|
| | | return;
|
| | |
|
| | | taoBaoWeiQuanList = taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(hb.getOrderId(), "等待处理");
|
| | | if (taoBaoWeiQuanList != null && taoBaoWeiQuanList.size() > 0)
|
| | | return;
|
| | |
|
| | | long currentTimeMillis = System.currentTimeMillis();
|
| | | if (hb.getState() != HongBao.STATE_SHIXIAO) {
|
| | | // 设置为已返利
|
| | |
| | |
|
| | | List<TaoBaoOrder> orderList = taoBaoOrderService.getTaoBaoOrderByOrderId(order.getOrderId());
|
| | | if (orderList != null && orderList.size() > 0 & !StringUtil.isNullOrEmpty(orderList.get(0).getSettlementTime()))
|
| | | order.setJieSuanTime(orderList.get(0).getSettlementTime());
|
| | | if (TimeUtil.convertToTimeTemp(order.getJieSuanTime(), "yyyy-MM-dd HH:mm:ss") >= TimeUtil
|
| | | .convertToTimeTemp("2018-08-05", "yyyy-MM-dd")) {
|
| | | order.setJieSuanTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(orderList.get(0).getSettlementTime(), "yyyy-MM-dd HH:mm:ss")));
|
| | | if (order.getJieSuanTime().getTime() >= TimeUtil.convertToTimeTemp("2018-08-05", "yyyy-MM-dd")) {
|
| | | return;
|
| | | }
|
| | | try {
|
| | |
| | | String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd");
|
| | | String endTimeStr = TimeUtil.getGernalTime(endTime, "yyyy-MM-dd");
|
| | | String url = String.format(
|
| | | "http://pub.alimama.com/report/getNewTbkRefundPaymentDetails.json?spm=a219t.7664554.1998457203.105.49cc35d9eDSunp&refundType=1&searchType=3&DownloadID=DOWNLOAD_EXPORT_CPSPAYMENT_REFUND_OVERVIEW&startTime=%s&endTime=%s",
|
| | | "http://pub.alimama.com/report/getNewTbkRefundPaymentDetails.json?spm=a219t.7664554.1998457203.105.49cc35d9eDSunp&refundType=1&searchType=1&DownloadID=DOWNLOAD_EXPORT_CPSPAYMENT_REFUND_OVERVIEW&startTime=%s&endTime=%s",
|
| | | startTimeStr, endTimeStr);
|
| | | Map<String, String> headers = new HashMap<>();
|
| | | headers.put("User-Agent",
|
| | |
| | |
|
| | | list.addAll(getThirdWeiQuanOrders(cookies, startTime, endTime));
|
| | |
|
| | | if (list != null)
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (!list.get(i).getState().equalsIgnoreCase("维权成功")) {
|
| | | list.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | // if (list != null)
|
| | | // for (int i = 0; i < list.size(); i++) {
|
| | | // if (!list.get(i).getState().equalsIgnoreCase("维权成功")) {
|
| | | // list.remove(i);
|
| | | // i--;
|
| | | // }
|
| | | // }
|
| | | return list;
|
| | | }
|
| | |
|
| | |
| | | orderRecord.setState(content);
|
| | | break;
|
| | | case 6://
|
| | | orderRecord.setJieSuanTime(content);
|
| | | if (!StringUtil.isNullOrEmpty(content))
|
| | | orderRecord.setJieSuanTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd HH:mm:ss")));
|
| | | break;
|
| | | case 7://
|
| | | orderRecord.setWeiQuanTime(content);
|
| | | if (!StringUtil.isNullOrEmpty(content))
|
| | | orderRecord.setWeiQuanTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd HH:mm:ss")));
|
| | | break;
|
| | | case 8://
|
| | | orderRecord.setWeiQuanFinishTime(content);
|
| | | if (!StringUtil.isNullOrEmpty(content))
|
| | | orderRecord.setWeiQuanFinishTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd HH:mm:ss")));
|
| | | break;
|
| | | }
|
| | | }
|