Merge remote-tracking branch 'origin/master'
| | |
| | |
|
| | | @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
|
| | |
| | | }
|
| | |
|
| | | 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);
|
| | |
| | | int updateByPrimaryKey(ThreeSale record); |
| | | |
| | | int effectThreeSale(Long workerUid); |
| | | |
| | | /** |
| | | * 删除失效 |
| | | * @param bossId |
| | | * @param workerId |
| | | * @return |
| | | */ |
| | | int deleteExpireRecord(@Param("bossId")Long bossId, @Param("workerId")Long workerId); |
| | | |
| | | |
| | | /** |
| | | * 查询一度队员集合 |
| | |
| | | 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 |
| | |
| | | threeSale.setWorker(inviteeUser);
|
| | | threeSaleMapper.insertSelective(threeSale);
|
| | |
|
| | | // 删除已失效关系
|
| | | threeSaleMapper.deleteExpireRecord(inviter.getId(), inviteeUser.getId());
|
| | | |
| | | //创建通知
|
| | | userInviteMsgNotificationService.inviteScan(inviter.getId(), threeSale);
|
| | |
|
| | |
| | | threeSale.setCreateTime(java.lang.System.currentTimeMillis());
|
| | | threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
|
| | | threeSaleMapper.insertSelective(threeSale);
|
| | | |
| | | // 删除已失效关系
|
| | | threeSaleMapper.deleteExpireRecord(inviter.getId(), invitee.getId());
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | |
| | | 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();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 验证是否属于同一天
|
| | | * |
| | | * @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;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 指定日期加上天数后的日期
|
| | | *
|
| | |
| | | break; // 时间结束
|
| | | }
|
| | | }
|
| | | |
| | | return listDate;
|
| | | }
|
| | |
|
| | | |
| | | } |