admin
2019-01-26 b8d98797f162f34ce0e4245b0d879ea0e6a30db0
Merge remote-tracking branch 'origin/master'
6个文件已修改
81 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/DateUtil.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java
@@ -87,7 +87,7 @@
    @RequestMapping(value = "/inviteGetMoney", method = RequestMethod.POST)
    public void everyDayTaskList(AcceptData acceptData, int pageIndex, PrintWriter out, String uid)
            throws NotExistObjectException {
            throws NotExistObjectException,UserInfoExtraException {
        // 查询商品总数
        Integer totalCount = 0;
        int totalPage = totalCount % Constant.PAGE_SIZE == 0 ? totalCount / Constant.PAGE_SIZE
@@ -172,6 +172,17 @@
        }
        data.put("desc", configService.get("invite_desc"));
        boolean hasCode = false;
        if (uid != null && uid.trim().length() > 0) {
            String inviteCode = userInfoExtraService.getUserInviteCode(Long.parseLong(uid));
            if (inviteCode != null && inviteCode.trim().length() > 0) {
                hasCode = true;    // 已有邀请码
            }
        }
        data.put("hasCode", hasCode);
        com.alibaba.fastjson.JSONObject root = new com.alibaba.fastjson.JSONObject();
        root.put("code", 0);
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -26,6 +26,15 @@
    int updateByPrimaryKey(ThreeSale record);
    int effectThreeSale(Long workerUid);
    /**
     * 删除失效
     * @param bossId
     * @param workerId
     * @return
     */
    int deleteExpireRecord(@Param("bossId")Long bossId, @Param("workerId")Long workerId);
    /**
     * 查询一度队员集合
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -146,7 +146,12 @@
        where t.state=0 and t.worker_id=#{0} AND (t.expire = 0 OR t.expire IS
        NULL)
    </update>
    <delete id="deleteExpireRecord" parameterType="java.lang.Long">
        DELETE FROM yeshi_ec_threesale
        WHERE expire = 1 AND boss_id = #{bossId} AND worker_id = #{workerId}
    </delete>
    <!-- 查询一度队员集合 -->
    <select id="queryMyFirstTeamList" resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_threesale` yet
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -113,6 +113,9 @@
            threeSale.setWorker(inviteeUser);
            threeSaleMapper.insertSelective(threeSale);
            
            // 删除已失效关系
            threeSaleMapper.deleteExpireRecord(inviter.getId(), inviteeUser.getId());
            //创建通知
            userInviteMsgNotificationService.inviteScan(inviter.getId(), threeSale);
            
@@ -624,6 +627,9 @@
            threeSale.setCreateTime(java.lang.System.currentTimeMillis());
            threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
            threeSaleMapper.insertSelective(threeSale);
            // 删除已失效关系
            threeSaleMapper.deleteExpireRecord(inviter.getId(), invitee.getId());
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.user;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@@ -140,8 +141,11 @@
        if (userInfoExtra != null && userInfoExtra.getId() != null) {
            // 判断当月是否已更新
            Date rankUpdateTime = userInfoExtra.getRankUpdateTime();
            if (rankUpdateTime != null && DateUtil.isSameMonth(rankUpdateTime, new Date())) {
                isupdateRank = false;
            if (rankUpdateTime != null) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
                if (sdf.format(rankUpdateTime).equals(sdf.format(new Date()))) {
                    isupdateRank = false;
                }
            } 
        } else {
            userInfoExtra = new UserInfoExtra();
utils/src/main/java/org/yeshi/utils/DateUtil.java
@@ -95,42 +95,6 @@
        }
    }
    
    /**
     * 验证是否属于同一天
     *
     * @param Date1
     * @param Date2
     * @return
     */
    public static boolean isSameMonth(Date date1, Date date2) {
        if (date1 != null && date2 != null) {
            Calendar cal1 = Calendar.getInstance();
            cal1.setTime(date1);
            Calendar cal2 = Calendar.getInstance();
            cal2.setTime(date2);
            return isSameMonth(cal1, cal2);
        } else {
            return false;
        }
    }
    /**
     * 验证是否属于同年同月
     *
     * @param cal1
     * @param cal2
     * @return
     */
    public static boolean isSameMonth(Calendar cal1, Calendar cal2) {
        if (cal1 != null && cal2 != null) {
            return cal1.get(0) == cal2.get(0) && cal1.get(1) == cal2.get(1) && cal1.get(6) == cal2.get(6);
        } else {
            return false;
        }
    }
    /**
     * 指定日期加上天数后的日期
     * 
@@ -198,8 +162,8 @@
                break; // 时间结束
            }
        }
        return listDate;
    }
    
}