| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dao.dynamic.DynamicInfoDao;
|
| | | import com.yeshi.fanli.dao.mybatis.help.HelpCenterMapper;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityShareResult;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture;
|
| | | import com.yeshi.fanli.entity.dynamic.InviteMaterial;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | |
| | |
|
| | | @Resource
|
| | | private InviteMaterialService inviteMaterialService;
|
| | | |
| | | @Resource
|
| | | private DynamicInfoDao dynamicInfoDao;
|
| | | |
| | |
|
| | | @RequestMapping(value = "testimg")
|
| | | public void testImg(HttpServletRequest request, PrintWriter out) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 插入邀请素材
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryExistsId")
|
| | | public void queryExistsAuctionId(PrintWriter out) {
|
| | | try {
|
| | | List<DynamicInfo> list = dynamicInfoDao.queryExistsAuctionId();
|
| | | for (DynamicInfo dynamicInfo: list) {
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | if (imgs == null || imgs.size() == 0) {
|
| | | continue;
|
| | | }
|
| | | |
| | | boolean update = false;
|
| | | for (GoodsPicture goodsPicture: imgs) {
|
| | | TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
|
| | | if (goods == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | if (goods.getAuctionId() == null) {
|
| | | update = true;
|
| | | goods.setAuctionId(goods.getId());
|
| | | }
|
| | | }
|
| | | |
| | | if (update) {
|
| | | dynamicInfo.setImgs(imgs);
|
| | | dynamicInfoDao.updateGoodInfo(dynamicInfo);
|
| | | }
|
| | | }
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadTrueResult("操作成功"));
|
| | | // JsonUtil.printMode(out, null, JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(list)));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, null, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | bossData = new JSONObject();
|
| | | UserInfo boss = threeSale.getBoss();
|
| | | if (boss != null) {
|
| | | bossData.put("bossId", boss.getId());
|
| | | bossData.put("nickName", boss.getNickName());
|
| | | bossData.put("portrait", boss.getPortrait());
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(boss.getId());
|
| | | if (userInfoExtra != null) |
| | | bossData.put("weiXin", userInfoExtra.getWeiXin());
|
| | | }
|
| | |
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | Long createTime = threeSale.getCreateTime();
|
| | |
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | |
|
| | | // 界面状态
|
| | | UserSettingsVO mySettings = null;
|
| | | try {
|
| | |
| | | userInfo.setRankNamePicture(null);
|
| | | userInfo.setRankIcon(null);
|
| | | }
|
| | | |
| | | userInfo.setSex(userInfoExtra.getSex());
|
| | | userInfo.setWeiXin(userInfoExtra.getWeiXin());
|
| | | }
|
| | |
|
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | | data.put("invitCode", invitCode); // 邀请码
|
| | | data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 更换昵称
|
| | | * 更换基础信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param nickName
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveInfo")
|
| | | public void saveInfo(AcceptData acceptData, String nickName, Long uid, PrintWriter out) {
|
| | | public void saveInfo(AcceptData acceptData, String nickName, String weiXin, Integer sex, Long uid, PrintWriter out) {
|
| | | try {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(nickName)) {
|
| | | out.print(JsonUtil.loadFalseResult("昵称不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 修改昵称
|
| | | if (!StringUtil.isNullOrEmpty(nickName)) {
|
| | | if (nickName.length() > 200) {
|
| | | out.print(JsonUtil.loadFalseResult("昵称过长"));
|
| | | return;
|
| | |
| | | out.print(JsonUtil.loadFalseResult("不能包含敏感词汇"));
|
| | | return;
|
| | | }
|
| | |
|
| | | userInfoService.saveUserInfo(nickName, uid);
|
| | | }
|
| | |
|
| | | // 修改微信号
|
| | | if (!StringUtil.isNullOrEmpty(weiXin)) {
|
| | | if (weiXin.length() > 32) {
|
| | | out.print(JsonUtil.loadFalseResult("微信号过长"));
|
| | | return;
|
| | | }
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setWeiXin(weiXin);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | }
|
| | | }
|
| | | |
| | | // 修改性别
|
| | | if (sex != null && sex > 0 && sex < 3) {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setSex(sex);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (UserInfoException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.goods.JDCommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.goods.PDDCommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | @RequestMapping("api/v2/commoncontent")
|
| | | public class CommonContentControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
| | | public void getListPDD(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> bannerList = new ArrayList<>();
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> bannerList = null;
|
| | | if (Constant.IS_TEST) {
|
| | | bannerList = swiperPictureService.getByBannerCard("index_top");
|
| | | } |
| | | |
| | | if (bannerList == null) {
|
| | | bannerList = new ArrayList<SwiperPicture>();
|
| | | }
|
| | |
|
| | | data.put("bannerList", new Gson().toJson(bannerList));
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass.UniqueKeyEnum;
|
| | | import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskClassService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.vo.integral.DailySignVO;
|
| | | import com.yeshi.fanli.vo.integral.IntegralTaskClassVO;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v2/integral")
|
| | | public class IntegralControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | | @Resource
|
| | | private IntegralTaskClassService integralTaskClassService;
|
| | |
|
| | | @Resource
|
| | | private IntegralTaskRecordService integralTaskRecordService;
|
| | | |
| | |
|
| | | /**
|
| | | * 获取任务列表
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param page
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTaskList", method = RequestMethod.POST)
|
| | | public void getTaskList(AcceptData acceptData, Long uid, Integer page, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (page == null || page < 1) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "页码不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson = gsonBuilder.create();
|
| | | try {
|
| | | JSONObject data = new JSONObject();
|
| | | List<IntegralTaskClassVO> list = integralTaskClassService.getIntegralTaskClassVO(uid, (page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE);
|
| | | if (list == null) {
|
| | | list = new ArrayList<IntegralTaskClassVO>();
|
| | | }
|
| | | long count = integralTaskClassService.countTaskClass();
|
| | | |
| | | if (page == 1) {
|
| | | UserInfoExtraVO extraVO = userInfoExtraService.getInfoExtraVOByUid(uid);
|
| | | if (extraVO == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户相关信息不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo userInfo = extraVO.getUserInfo();
|
| | | if (userInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "查询用户信息不全"));
|
| | | return;
|
| | | }
|
| | | |
| | | UserRank userRank = extraVO.getUserRank();
|
| | | if (userRank == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户等级不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | boolean signState = false;
|
| | | IntegralTaskClass taskClass = integralTaskClassService.getByUniqueKey(UniqueKeyEnum.dailySign.name());
|
| | | if (taskClass != null)
|
| | | signState = integralTaskRecordService.isToDaySign(uid, taskClass.getId());
|
| | | |
| | | // 签到日期
|
| | | DailySignVO dailySignVO = integralTaskClassService.getDailySignList(uid, userRank.getId());
|
| | | data.put("signState", signState);
|
| | | data.put("goldCoin", extraVO.getGoldCoin());
|
| | | data.put("portrait", userInfo.getPortrait());
|
| | | data.put("userRank", gson.toJson(userRank));
|
| | | data.put("dailySign", dailySignVO);
|
| | | }
|
| | | |
| | | data.put("count", count);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 获取已完成任务 未领取金币
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getNotReceived", method = RequestMethod.POST)
|
| | | public void getNotReceived(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<IntegralTaskRecord> list = integralTaskRecordService.listNotReceived(5, uid);
|
| | | if (list == null) {
|
| | | list = new ArrayList<IntegralTaskRecord>();
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson = gsonBuilder.create();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 领取金币
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param ids
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "receiveGoldCoin", method = RequestMethod.POST)
|
| | | public void receiveGoldCoin(AcceptData acceptData, Long uid, String ids, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | Gson gson = new Gson();
|
| | | Set<Long> idList = gson.fromJson(ids, new TypeToken<HashSet<Long>>() {}.getType());
|
| | | if (idList == null || idList.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("领取id不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | Integer goldCoin = integralTaskRecordService.receiveGoldCoin(uid, idList);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("goldCoin", goldCoin);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (IntegralTaskRecordException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v1/invite")
|
| | | public class InviteController {
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | | |
| | | /**
|
| | | * 邀请码验证
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "verifyCode")
|
| | | public void verifyCode(AcceptData acceptData, Long uid, String inviteCode, PrintWriter out) {
|
| | | try {
|
| | | UserInfo userInfo = userInfoExtraService.getUserByInviteCode(inviteCode);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("nickName", userInfo.getNickName());
|
| | | data.put("portrait", userInfo.getPortrait());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 邀请码微信
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "verifyWX")
|
| | | public void verifyWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
|
| | | try {
|
| | | UserInfo userInfo = userInfoExtraService.getInviterInfo(uid, code);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("nickName", userInfo.getNickName());
|
| | | data.put("portrait", userInfo.getPortrait());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | return (List<DynamicInfo>) mongoTemplate.findAll(DynamicInfo.class);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查询所有数据
|
| | | * @param clazz
|
| | | * @return
|
| | | */
|
| | | public List<DynamicInfo> queryExistsAuctionId() {
|
| | | Query query = new Query();
|
| | | query.addCriteria(
|
| | | new Criteria().andOperator(
|
| | | Criteria.where("imgs.goods").exists(true),
|
| | | Criteria.where("imgs.goods.auctionId").exists(false)
|
| | | )
|
| | | );
|
| | | List<DynamicInfo> list = mongoTemplate.find(query, DynamicInfo.class);
|
| | | return list;
|
| | | }
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.integral; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass; |
| | | import com.yeshi.fanli.vo.integral.IntegralTaskClassVO; |
| | | |
| | | public interface IntegralTaskClassMapper extends BaseMapper<IntegralTaskClass> { |
| | | |
| | | /** |
| | | * 获取有效任务 |
| | | * @return |
| | | */ |
| | | List<IntegralTaskClassVO> getIntegralTaskClassVO(@Param("start")long start, @Param("count")int count); |
| | | |
| | | Long countTaskClass(); |
| | | |
| | | /** |
| | | * 根据唯一值查询 |
| | | * @param uniqueKey |
| | | * @return |
| | | */ |
| | | IntegralTaskClass getByUniqueKey(@Param("uniqueKey") String uniqueKey); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.integral; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.integral.IntegralTask; |
| | | |
| | | public interface IntegralTaskMapper extends BaseMapper<IntegralTask> { |
| | | |
| | | /** |
| | | * 查询任务 |
| | | * @param cid |
| | | * @param uniqueKey |
| | | * @return |
| | | */ |
| | | List<IntegralTask> listByCid(@Param("cid")Long cid); |
| | | |
| | | /** |
| | | * 查询任务 |
| | | * @param cid |
| | | * @param uniqueKey |
| | | * @return |
| | | */ |
| | | IntegralTask getByCidAndUniqueKey(@Param("cid")Long cid, @Param("uniqueKey")String uniqueKey); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.integral; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRank; |
| | | |
| | | public interface IntegralTaskRankMapper extends BaseMapper<IntegralTaskRank> { |
| | | |
| | | /** |
| | | * 查询任务等级奖励 |
| | | * @param tsakId |
| | | * @param rankId |
| | | * @return |
| | | */ |
| | | IntegralTaskRank getByTsakIdAndRankId(@Param("tsakId")Long tsakId,@Param("rankId") Long rankId); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.integral; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRecord; |
| | | |
| | | public interface IntegralTaskRecordMapper extends BaseMapper<IntegralTaskRecord> { |
| | | |
| | | /** |
| | | * 未领取金币 |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<IntegralTaskRecord> listNotReceived(@Param("count") int count, @Param("uid") Long uid); |
| | | |
| | | |
| | | /** |
| | | * 总完成 |
| | | * @param uid |
| | | * @param dateType |
| | | * @return |
| | | */ |
| | | Integer getTotalGoldCoin(@Param("uid") Long uid, @Param("cid") Long cid, @Param("dateType")Integer dateType); |
| | | |
| | | /** |
| | | * 统计完成数量 |
| | | * @param uid |
| | | * @param cid |
| | | * @param dateType |
| | | * @return |
| | | */ |
| | | Integer countFinished(@Param("uid") Long uid, @Param("cid") Long cid, @Param("dateType")Integer dateType); |
| | | |
| | | /** |
| | | * 近7天签到情况 |
| | | * @param uid |
| | | * @param cid |
| | | * @param sortState 1倒序-创建时间 |
| | | * @return |
| | | */ |
| | | List<IntegralTaskRecord> listDaySignRecord(@Param("uid") Long uid, @Param("cid") Long cid); |
| | | |
| | | } |
| | | |
| | |
| | | @Expose
|
| | | private String rankIcon;// 等级图标
|
| | |
|
| | |
|
| | | // 性别: 1-女 2-男
|
| | | @Transient
|
| | | @Expose
|
| | | private Integer sex;
|
| | | |
| | | // 微信号
|
| | | @Transient
|
| | | @Expose
|
| | | private String weiXin;
|
| | | |
| | | // 微信提示语
|
| | | @Transient
|
| | | @Expose
|
| | | private String weiXinTip;
|
| | |
|
| | | @Transient
|
| | | @Expose
|
| | | private String rankNamePicture;// 等级名称图片
|
| | |
| | | this.payPassword = payPassword;
|
| | | }
|
| | |
|
| | | public Integer getSex() {
|
| | | return sex;
|
| | | }
|
| | |
|
| | | public void setSex(Integer sex) {
|
| | | this.sex = sex;
|
| | | }
|
| | |
|
| | | public String getWeiXin() {
|
| | | return weiXin;
|
| | | }
|
| | |
|
| | | public void setWeiXin(String weiXin) {
|
| | | this.weiXin = weiXin;
|
| | | }
|
| | |
|
| | | public String getWeiXinTip() {
|
| | | return weiXinTip;
|
| | | }
|
| | |
|
| | | public void setWeiXinTip(String weiXinTip) {
|
| | | this.weiXinTip = weiXinTip;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int hashCode() {
|
| | | final int prime = 31;
|
| | |
| | | @Column(name = "uie_first_login_time")
|
| | | private Date firstLoginTime;
|
| | |
|
| | | // 性别: 1-女 2-男
|
| | | @Column(name = "uie_sex")
|
| | | private Integer sex;
|
| | | |
| | | // 微信号
|
| | | @Column(name = "uie_weixin")
|
| | | private String weiXin;
|
| | |
|
| | | // 金币数量
|
| | | @Column(name = "uie_gold_coin")
|
| | | private Integer goldCoin;
|
| | | |
| | | // 创建时间
|
| | | @Column(name = "uie_create_time")
|
| | | private Date createTime;
|
| | |
| | | this.synchNavbar = synchNavbar;
|
| | | }
|
| | |
|
| | | public Integer getSex() {
|
| | | return sex;
|
| | | }
|
| | |
|
| | | public void setSex(Integer sex) {
|
| | | this.sex = sex;
|
| | | }
|
| | |
|
| | | public String getWeiXin() {
|
| | | return weiXin;
|
| | | }
|
| | |
|
| | | public void setWeiXin(String weiXin) {
|
| | | this.weiXin = weiXin;
|
| | | }
|
| | |
|
| | | public Integer getGoldCoin() {
|
| | | return goldCoin;
|
| | | }
|
| | |
|
| | | public void setGoldCoin(Integer goldCoin) {
|
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.integral;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 积分任务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_integral_task")
|
| | | public class IntegralTask implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public enum FrequencyEnum {
|
| | | everyday("每天"), onlyOne("只有一次");
|
| | | private final String desc;
|
| | |
|
| | | private FrequencyEnum(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Column(name = "it_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "it_cid")
|
| | | private IntegralTaskClass taskClass ; |
| | | |
| | | @Column(name = "it_name")
|
| | | private String name;// 名称
|
| | |
|
| | | @Column(name = "it_unique_key")
|
| | | private String uniqueKey; // 唯一值
|
| | |
|
| | | @Column(name = "it_explain")
|
| | | private String explain; // 规则
|
| | |
|
| | | @Column(name = "it_frequency")
|
| | | private FrequencyEnum frequency; // 频率
|
| | | |
| | | @Column(name = "it_gold_coin")
|
| | | private Integer goldCoin; // 基础金币
|
| | |
|
| | | @Column(name = "it_upper_limit")
|
| | | private Integer upperLimit; // 限制
|
| | | |
| | | @Column(name = "it_double_num")
|
| | | private Integer doubleNum; // 加倍数量
|
| | | |
| | | @Column(name = "it_state")
|
| | | private Integer state; // 状态: 1启用 0停用
|
| | | |
| | | @Column(name = "it_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "it_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public IntegralTaskClass getTaskClass() {
|
| | | return taskClass;
|
| | | }
|
| | |
|
| | | public void setTaskClass(IntegralTaskClass taskClass) {
|
| | | this.taskClass = taskClass;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public String getUniqueKey() {
|
| | | return uniqueKey;
|
| | | }
|
| | |
|
| | | public void setUniqueKey(String uniqueKey) {
|
| | | this.uniqueKey = uniqueKey;
|
| | | }
|
| | |
|
| | | public String getExplain() {
|
| | | return explain;
|
| | | }
|
| | |
|
| | | public void setExplain(String explain) {
|
| | | this.explain = explain;
|
| | | }
|
| | |
|
| | | public Integer getGoldCoin() {
|
| | | return goldCoin;
|
| | | }
|
| | |
|
| | | public void setGoldCoin(Integer goldCoin) {
|
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | |
|
| | | public Integer getUpperLimit() {
|
| | | return upperLimit;
|
| | | }
|
| | |
|
| | | public void setUpperLimit(Integer upperLimit) {
|
| | | this.upperLimit = upperLimit;
|
| | | }
|
| | |
|
| | | public Integer getDoubleNum() {
|
| | | return doubleNum;
|
| | | }
|
| | |
|
| | | public void setDoubleNum(Integer doubleNum) {
|
| | | this.doubleNum = doubleNum;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public FrequencyEnum getFrequency() {
|
| | | return frequency;
|
| | | }
|
| | |
|
| | | public void setFrequency(FrequencyEnum frequency) {
|
| | | this.frequency = frequency;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.integral;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
|
| | | /**
|
| | | * 积分任务分类
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_integral_task_class")
|
| | | public class IntegralTaskClass implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public enum UniqueKeyEnum {
|
| | | dailySign("每日签到"), smartSearch("智能搜索"), buyReduce("自购立减"), inviteTeam("邀请队员"), shareReward("分享奖励"), |
| | | giveReward("赠送奖励"), scanReward("浏览奖励") , orderReward("订单奖励"), accountMaintain("账号维护");
|
| | | private final String desc;
|
| | |
|
| | | private UniqueKeyEnum(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | }
|
| | |
|
| | | @Expose
|
| | | @Column(name = "tc_id")
|
| | | private Long id;
|
| | |
|
| | | @Expose
|
| | | @Column(name = "tc_name")
|
| | | private String name;// 名称
|
| | | |
| | | @Expose
|
| | | @Column(name = "tc_picture")
|
| | | private String picture;// 图片
|
| | |
|
| | | @Column(name = "tc_unique_key")
|
| | | private UniqueKeyEnum uniqueKey; // 唯一值
|
| | | |
| | | @Expose
|
| | | @Column(name = "tc_tip")
|
| | | private String tip; // 提示
|
| | |
|
| | | @Expose
|
| | | @Column(name = "tc_btn_name")
|
| | | private String btnName; // 按钮名称
|
| | |
|
| | | @Expose
|
| | | @Column(name = "tc_jump_id")
|
| | | private JumpDetailV2 jumpDetail; // 跳转
|
| | |
|
| | | @Expose
|
| | | @Column(name = "tc_params")
|
| | | private String params; // 跳转参数
|
| | |
|
| | | @Expose
|
| | | @Column(name = "tc_rule_name")
|
| | | private String ruleName; // 规则名称
|
| | |
|
| | | @Expose
|
| | | @Column(name = "tc_rule")
|
| | | private String rule; // 规则
|
| | | |
| | | @Expose
|
| | | @Column(name = "tc_rule_link")
|
| | | private String ruleLink; // 规则详细链接
|
| | | |
| | | @Expose
|
| | | @Column(name = "tc_progress")
|
| | | private String progress; // 进度
|
| | |
|
| | | @Column(name = "tc_orderby")
|
| | | private Integer orderBy;// 排序值,越小越靠前
|
| | | |
| | | @Column(name = "tc_state")
|
| | | private Integer state;// 状态:1启用,0停用
|
| | |
|
| | | @Column(name = "tc_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "tc_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public String getTip() {
|
| | | return tip;
|
| | | }
|
| | |
|
| | | public void setTip(String tip) {
|
| | | this.tip = tip;
|
| | | }
|
| | |
|
| | | public String getRule() {
|
| | | return rule;
|
| | | }
|
| | |
|
| | | public void setRule(String rule) {
|
| | | this.rule = rule;
|
| | | }
|
| | |
|
| | | public Integer getOrderBy() {
|
| | | return orderBy;
|
| | | }
|
| | |
|
| | | public void setOrderBy(Integer orderBy) {
|
| | | this.orderBy = orderBy;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public String getBtnName() {
|
| | | return btnName;
|
| | | }
|
| | |
|
| | | public void setBtnName(String btnName) {
|
| | | this.btnName = btnName;
|
| | | }
|
| | |
|
| | | public String getRuleName() {
|
| | | return ruleName;
|
| | | }
|
| | |
|
| | | public void setRuleName(String ruleName) {
|
| | | this.ruleName = ruleName;
|
| | | }
|
| | |
|
| | | public JumpDetailV2 getJumpDetail() {
|
| | | return jumpDetail;
|
| | | }
|
| | |
|
| | | public void setJumpDetail(JumpDetailV2 jumpDetail) {
|
| | | this.jumpDetail = jumpDetail;
|
| | | }
|
| | |
|
| | | public String getParams() {
|
| | | return params;
|
| | | }
|
| | |
|
| | | public void setParams(String params) {
|
| | | this.params = params;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public UniqueKeyEnum getUniqueKey() {
|
| | | return uniqueKey;
|
| | | }
|
| | |
|
| | | public void setUniqueKey(UniqueKeyEnum uniqueKey) {
|
| | | this.uniqueKey = uniqueKey;
|
| | | }
|
| | |
|
| | | public String getPicture() {
|
| | | return picture;
|
| | | }
|
| | |
|
| | | public void setPicture(String picture) {
|
| | | this.picture = picture;
|
| | | }
|
| | |
|
| | | public String getProgress() {
|
| | | return progress;
|
| | | }
|
| | |
|
| | | public void setProgress(String progress) {
|
| | | this.progress = progress;
|
| | | }
|
| | |
|
| | | public String getRuleLink() {
|
| | | return ruleLink;
|
| | | }
|
| | |
|
| | | public void setRuleLink(String ruleLink) {
|
| | | this.ruleLink = ruleLink;
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.integral;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 积分等级奖励
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_integral_task_rank")
|
| | | public class IntegralTaskRank implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Column(name = "tr_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "tr_task_id")
|
| | | private Long taskId;
|
| | |
|
| | | @Column(name = "tr_rank_id")
|
| | | private Long rankId;// 名称
|
| | |
|
| | | @Column(name = "tr_add_coin")
|
| | | private Integer addCoin; // 增加数量
|
| | | |
| | | @Column(name = "tr_double_num")
|
| | | private Integer doubleNum; // 加倍数量
|
| | |
|
| | | @Column(name = "tr_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "tr_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getTaskId() {
|
| | | return taskId;
|
| | | }
|
| | |
|
| | | public void setTaskId(Long taskId) {
|
| | | this.taskId = taskId;
|
| | | }
|
| | |
|
| | | public Long getRankId() {
|
| | | return rankId;
|
| | | }
|
| | |
|
| | | public void setRankId(Long rankId) {
|
| | | this.rankId = rankId;
|
| | | }
|
| | |
|
| | | public Integer getAddCoin() {
|
| | | return addCoin;
|
| | | }
|
| | |
|
| | | public void setAddCoin(Integer addCoin) {
|
| | | this.addCoin = addCoin;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Integer getDoubleNum() {
|
| | | return doubleNum;
|
| | | }
|
| | |
|
| | | public void setDoubleNum(Integer doubleNum) {
|
| | | this.doubleNum = doubleNum;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.integral;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | /**
|
| | | * 用户积分任务记录
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | /**
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_integral_task_record")
|
| | | public class IntegralTaskRecord implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Expose
|
| | | @Column(name = "ir_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "ir_cid")
|
| | | private Long cid;
|
| | | |
| | | @Column(name = "ir_task_id")
|
| | | private Long taskId;
|
| | |
|
| | | @Column(name = "ir_uid")
|
| | | private Long uid;
|
| | |
|
| | | @Expose
|
| | | @Column(name = "ir_gold_coin")
|
| | | private Integer goldCoin; // 获得金币
|
| | |
|
| | | @Column(name = "ir_state")
|
| | | private Integer state; // 状态:0待领取 1已领取 2失效
|
| | |
|
| | | @Column(name = "ir_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "ir_update_time")
|
| | | private Date updateTime;
|
| | | |
| | | @Expose
|
| | | private String taskName; // 任务名称
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getCid() {
|
| | | return cid;
|
| | | }
|
| | |
|
| | | public void setCid(Long cid) {
|
| | | this.cid = cid;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Integer getGoldCoin() {
|
| | | return goldCoin;
|
| | | }
|
| | |
|
| | | public void setGoldCoin(Integer goldCoin) {
|
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public String getTaskName() {
|
| | | return taskName;
|
| | | }
|
| | |
|
| | | public void setTaskName(String taskName) {
|
| | | this.taskName = taskName;
|
| | | }
|
| | |
|
| | | public Long getTaskId() {
|
| | | return taskId;
|
| | | }
|
| | |
|
| | | public void setTaskId(Long taskId) {
|
| | | this.taskId = taskId;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.integral;
|
| | |
|
| | | public class IntegralTaskRecordException extends Exception {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | private int code;
|
| | | private String msg;
|
| | |
|
| | | public int getCode() {
|
| | | return code;
|
| | | }
|
| | |
|
| | | public String getMsg() {
|
| | | return msg;
|
| | | }
|
| | |
|
| | | public IntegralTaskRecordException(int code, String msg) {
|
| | | this.code = code;
|
| | | this.msg = msg;
|
| | | }
|
| | |
|
| | | public IntegralTaskRecordException() {
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getMessage() {
|
| | | return this.msg;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.integral.IntegralTaskClassMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.integral.IntegralTaskClass"> |
| | | <id column="tc_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="tc_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="tc_picture" property="picture" jdbcType="VARCHAR"/> |
| | | <result column="tc_tip" property="tip" jdbcType="VARCHAR"/> |
| | | <result column="tc_btn_name" property="btnName" jdbcType="VARCHAR"/> |
| | | <result column="tc_params" property="params" jdbcType="VARCHAR"/> |
| | | <result column="tc_rule_name" property="ruleName" jdbcType="VARCHAR"/> |
| | | <result column="tc_rule" property="rule" jdbcType="VARCHAR"/> |
| | | <result column="tc_rule_link" property="ruleLink" jdbcType="VARCHAR"/> |
| | | <result column="tc_progress" property="progress" jdbcType="VARCHAR"/> |
| | | <result column="tc_orderby" property="orderBy" jdbcType="INTEGER"/> |
| | | <result column="tc_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="tc_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="tc_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <result column="tc_unique_key" property="uniqueKey" typeHandler="com.yeshi.fanli.util.mybatishandler.integral.UniqueKeyEnumHandler"/> |
| | | <association property="jumpDetail" column="tc_jump_id" |
| | | select="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.selectByPrimaryKey"> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <resultMap id="BaseResultVOMap" type="com.yeshi.fanli.vo.integral.IntegralTaskClassVO"> |
| | | <id column="tc_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="tc_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="tc_picture" property="picture" jdbcType="VARCHAR"/> |
| | | <result column="tc_tip" property="tip" jdbcType="VARCHAR"/> |
| | | <result column="tc_btn_name" property="btnName" jdbcType="VARCHAR"/> |
| | | <result column="tc_params" property="params" jdbcType="VARCHAR"/> |
| | | <result column="tc_rule_name" property="ruleName" jdbcType="VARCHAR"/> |
| | | <result column="tc_rule" property="rule" jdbcType="VARCHAR"/> |
| | | <result column="tc_rule_link" property="ruleLink" jdbcType="VARCHAR"/> |
| | | <result column="tc_progress" property="progress" jdbcType="VARCHAR"/> |
| | | <result column="tc_orderby" property="orderBy" jdbcType="INTEGER"/> |
| | | <result column="tc_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="tc_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="tc_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <result column="totalCoin" property="totalCoin" jdbcType="INTEGER"/> |
| | | <result column="taskNum" property="taskNum" jdbcType="INTEGER"/> |
| | | |
| | | <result column="tc_unique_key" property="uniqueKey" typeHandler="com.yeshi.fanli.util.mybatishandler.integral.UniqueKeyEnumHandler"/> |
| | | <association property="jumpDetail" column="tc_jump_id" |
| | | select="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.selectByPrimaryKey"> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">tc_id,tc_name,tc_picture,tc_unique_key,tc_tip,tc_btn_name,tc_jump_id,tc_params,tc_rule_name,tc_rule,tc_rule_link,tc_progress,tc_orderby,tc_state,tc_create_time,tc_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_integral_task_class where tc_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_integral_task_class where tc_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task_class (tc_id,tc_name,tc_picture,tc_unique_key,tc_tip,tc_btn_name,tc_jump_id,tc_params,tc_rule_name,tc_rule,tc_rule_link,tc_progress,tc_orderby,tc_state,tc_create_time,tc_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{uniqueKey,jdbcType=VARCHAR},#{tip,jdbcType=VARCHAR},#{btnName,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{ruleName,jdbcType=VARCHAR},#{rule,jdbcType=VARCHAR},#{ruleLink,jdbcType=VARCHAR},#{progress,jdbcType=VARCHAR},#{orderBy,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task_class |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">tc_id,</if> |
| | | <if test="name != null">tc_name,</if> |
| | | <if test="picture != null">tc_picture,</if> |
| | | <if test="uniqueKey != null">tc_unique_key,</if> |
| | | <if test="tip != null">tc_tip,</if> |
| | | <if test="btnName != null">tc_btn_name,</if> |
| | | <if test="jumpDetail != null">tc_jump_id,</if> |
| | | <if test="params != null">tc_params,</if> |
| | | <if test="ruleName != null">tc_rule_name,</if> |
| | | <if test="rule != null">tc_rule,</if> |
| | | <if test="ruleLink != null">tc_rule_link,</if> |
| | | <if test="progress != null">tc_progress,</if> |
| | | <if test="orderBy != null">tc_orderby,</if> |
| | | <if test="state != null">tc_state,</if> |
| | | <if test="createTime != null">tc_create_time,</if> |
| | | <if test="updateTime != null">tc_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="uniqueKey != null">#{uniqueKey,jdbcType=VARCHAR},</if> |
| | | <if test="tip != null">#{tip,jdbcType=VARCHAR},</if> |
| | | <if test="btnName != null">#{btnName,jdbcType=VARCHAR},</if> |
| | | <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if> |
| | | <if test="params != null">#{params,jdbcType=VARCHAR},</if> |
| | | <if test="ruleName != null">#{ruleName,jdbcType=VARCHAR},</if> |
| | | <if test="rule != null">#{rule,jdbcType=VARCHAR},</if> |
| | | <if test="ruleLink != null">#{ruleLink,jdbcType=VARCHAR},</if> |
| | | <if test="progress != null">#{progress,jdbcType=VARCHAR},</if> |
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskClass">update yeshi_ec_integral_task_class set tc_name = #{name,jdbcType=VARCHAR},tc_picture = #{picture,jdbcType=VARCHAR},tc_unique_key = #{uniqueKey,jdbcType=VARCHAR},tc_tip = #{tip,jdbcType=VARCHAR},tc_btn_name = #{btnName,jdbcType=VARCHAR},tc_jump_id = #{jumpDetail.id,jdbcType=BIGINT},tc_params = #{params,jdbcType=VARCHAR},tc_rule_name = #{ruleName,jdbcType=VARCHAR},tc_rule = #{rule,jdbcType=VARCHAR},tc_rule_link = #{ruleLink,jdbcType=VARCHAR},tc_progress = #{progress,jdbcType=VARCHAR},tc_orderby = #{orderBy,jdbcType=INTEGER},tc_state = #{state,jdbcType=INTEGER},tc_create_time = #{createTime,jdbcType=TIMESTAMP},tc_update_time = #{updateTime,jdbcType=TIMESTAMP} where tc_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskClass">update yeshi_ec_integral_task_class |
| | | <set> |
| | | <if test="name != null">tc_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="picture != null">tc_picture=#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="uniqueKey != null">tc_unique_key=#{uniqueKey,jdbcType=VARCHAR},</if> |
| | | <if test="tip != null">tc_tip=#{tip,jdbcType=VARCHAR},</if> |
| | | <if test="btnName != null">tc_btn_name=#{btnName,jdbcType=VARCHAR},</if> |
| | | <if test="jumpDetail != null">tc_jump_id=#{jumpDetail.id,jdbcType=BIGINT},</if> |
| | | <if test="params != null">tc_params=#{params,jdbcType=VARCHAR},</if> |
| | | <if test="ruleName != null">tc_rule_name=#{ruleName,jdbcType=VARCHAR},</if> |
| | | <if test="rule != null">tc_rule=#{rule,jdbcType=VARCHAR},</if> |
| | | <if test="ruleLink != null">tc_rule_link=#{ruleLink,jdbcType=VARCHAR},</if> |
| | | <if test="progress != null">tc_progress=#{progress,jdbcType=VARCHAR},</if> |
| | | <if test="orderBy != null">tc_orderby=#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="state != null">tc_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">tc_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">tc_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where tc_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getIntegralTaskClassVO" resultMap="BaseResultVOMap"> |
| | | SELECT * FROM `yeshi_ec_integral_task_class` c |
| | | LEFT JOIN (SELECT t.`it_cid` AS cid,SUM(t.`it_gold_coin` * (IFNULL(t.`it_upper_limit`,1)))AS totalCoin,SUM(t.`it_upper_limit`) AS taskNum |
| | | FROM yeshi_ec_integral_task t |
| | | WHERE t.`it_state` = 1 GROUP BY t.`it_cid`)ta ON ta.cid = c.`tc_id` |
| | | WHERE c.`tc_state` = 1 |
| | | ORDER BY c.`tc_orderby` |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countTaskClass" resultType="Long"> |
| | | SELECT IFNULL(COUNT(c.`tc_id`),0) FROM `yeshi_ec_integral_task_class` c |
| | | WHERE c.`tc_state` = 1 |
| | | </select> |
| | | |
| | | <select id="getByUniqueKey" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_integral_task_class` |
| | | WHERE tc_unique_key = #{uniqueKey} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.integral.IntegralTaskMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.integral.IntegralTask"> |
| | | <id column="it_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="it_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="it_unique_key" property="uniqueKey" jdbcType="VARCHAR"/> |
| | | <result column="it_explain" property="explain" jdbcType="VARCHAR"/> |
| | | <result column="it_gold_coin" property="goldCoin" jdbcType="INTEGER"/> |
| | | <result column="it_upper_limit" property="upperLimit" jdbcType="INTEGER"/> |
| | | <result column="it_double_num" property="doubleNum" jdbcType="INTEGER"/> |
| | | <result column="it_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="it_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="it_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="it_frequency" property="frequency" typeHandler="com.yeshi.fanli.util.mybatishandler.integral.FrequencyEnumHandler"/> |
| | | |
| | | <association property="taskClass" column="it_cid" |
| | | select="com.yeshi.fanli.entity.dao.IntegralTaskClassMapper.selectByPrimaryKey"> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="SimpleResultMap" type="com.yeshi.fanli.entity.integral.IntegralTask"> |
| | | <id column="it_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="it_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="it_unique_key" property="uniqueKey" jdbcType="VARCHAR"/> |
| | | <result column="it_explain" property="explain" jdbcType="VARCHAR"/> |
| | | <result column="it_gold_coin" property="goldCoin" jdbcType="INTEGER"/> |
| | | <result column="it_upper_limit" property="upperLimit" jdbcType="INTEGER"/> |
| | | <result column="it_double_num" property="doubleNum" jdbcType="INTEGER"/> |
| | | <result column="it_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="it_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="it_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="it_frequency" property="frequency" typeHandler="com.yeshi.fanli.util.mybatishandler.integral.FrequencyEnumHandler"/> |
| | | |
| | | <association property="taskClass" column="it_cid" javaType="com.yeshi.fanli.entity.integral.IntegralTaskClass"> |
| | | <id column="it_cid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">it_id,it_cid,it_name,it_unique_key,it_explain,it_frequency,it_gold_coin,it_upper_limit,it_double_num,it_state,it_create_time,it_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_integral_task where it_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_integral_task where it_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralTask" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task (it_id,it_cid,it_name,it_unique_key,it_explain,it_frequency,it_gold_coin,it_upper_limit,it_double_num,it_state,it_create_time,it_update_time) values (#{id,jdbcType=BIGINT},#{taskClass.id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{uniqueKey,jdbcType=VARCHAR},#{explain,jdbcType=VARCHAR},#{frequency,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{upperLimit,jdbcType=INTEGER},#{doubleNum,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTask" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">it_id,</if> |
| | | <if test="taskClass != null">it_cid,</if> |
| | | <if test="name != null">it_name,</if> |
| | | <if test="uniqueKey != null">it_unique_key,</if> |
| | | <if test="explain != null">it_explain,</if> |
| | | <if test="frequency != null">it_frequency,</if> |
| | | <if test="goldCoin != null">it_gold_coin,</if> |
| | | <if test="upperLimit != null">it_upper_limit,</if> |
| | | <if test="doubleNum != null">it_double_num,</if> |
| | | <if test="state != null">it_state,</if> |
| | | <if test="createTime != null">it_create_time,</if> |
| | | <if test="updateTime != null">it_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="taskClass != null">#{taskClass.id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="uniqueKey != null">#{uniqueKey,jdbcType=VARCHAR},</if> |
| | | <if test="explain != null">#{explain,jdbcType=VARCHAR},</if> |
| | | <if test="frequency != null">#{frequency,jdbcType=VARCHAR},</if> |
| | | <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="upperLimit != null">#{upperLimit,jdbcType=INTEGER},</if> |
| | | <if test="doubleNum != null">#{doubleNum,jdbcType=INTEGER},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralTask">update yeshi_ec_integral_task set it_cid = #{taskClass.id,jdbcType=BIGINT},it_name = #{name,jdbcType=VARCHAR},it_unique_key = #{uniqueKey,jdbcType=VARCHAR},it_explain = #{explain,jdbcType=VARCHAR},it_frequency = #{frequency,jdbcType=VARCHAR},it_gold_coin = #{goldCoin,jdbcType=INTEGER},it_upper_limit = #{upperLimit,jdbcType=INTEGER},it_double_num = #{doubleNum,jdbcType=INTEGER},it_state = #{state,jdbcType=INTEGER},it_create_time = #{createTime,jdbcType=TIMESTAMP},it_update_time = #{updateTime,jdbcType=TIMESTAMP} where it_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTask">update yeshi_ec_integral_task |
| | | <set> |
| | | <if test="taskClass != null">it_cid=#{taskClass.id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">it_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="uniqueKey != null">it_unique_key=#{uniqueKey,jdbcType=VARCHAR},</if> |
| | | <if test="explain != null">it_explain=#{explain,jdbcType=VARCHAR},</if> |
| | | <if test="frequency != null">it_frequency=#{frequency,jdbcType=VARCHAR},</if> |
| | | <if test="goldCoin != null">it_gold_coin=#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="upperLimit != null">it_upper_limit=#{upperLimit,jdbcType=INTEGER},</if> |
| | | <if test="doubleNum != null">it_double_num=#{doubleNum,jdbcType=INTEGER},</if> |
| | | <if test="state != null">it_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">it_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">it_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where it_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="listByCid" resultMap="SimpleResultMap"> |
| | | SELECT * FROM yeshi_ec_integral_task |
| | | WHERE it_state = 1 AND it_cid = #{cid} |
| | | </select> |
| | | |
| | | <select id="getByCidAndUniqueKey" resultMap="SimpleResultMap"> |
| | | SELECT * FROM yeshi_ec_integral_task |
| | | WHERE it_state = 1 AND it_cid = #{cid} AND it_unique_key = #{uniqueKey} |
| | | LIMIT 1 |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.integral.IntegralTaskRankMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.integral.IntegralTaskRank"> |
| | | <id column="tr_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="tr_task_id" property="taskId" jdbcType="BIGINT"/> |
| | | <result column="tr_rank_id" property="rankId" jdbcType="BIGINT"/> |
| | | <result column="tr_add_coin" property="addCoin" jdbcType="INTEGER"/> |
| | | <result column="tr_double_num" property="doubleNum" jdbcType="INTEGER"/> |
| | | <result column="tr_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="tr_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">tr_id,tr_task_id,tr_rank_id,tr_add_coin,tr_double_num,tr_create_time,tr_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_integral_task_rank where tr_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_integral_task_rank where tr_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRank" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task_rank (tr_id,tr_task_id,tr_rank_id,tr_add_coin,tr_double_num,tr_create_time,tr_update_time) values (#{id,jdbcType=BIGINT},#{taskId,jdbcType=BIGINT},#{rankId,jdbcType=BIGINT},#{addCoin,jdbcType=INTEGER},#{doubleNum,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRank" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task_rank |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">tr_id,</if> |
| | | <if test="taskId != null">tr_task_id,</if> |
| | | <if test="rankId != null">tr_rank_id,</if> |
| | | <if test="addCoin != null">tr_add_coin,</if> |
| | | <if test="doubleNum != null">tr_double_num,</if> |
| | | <if test="createTime != null">tr_create_time,</if> |
| | | <if test="updateTime != null">tr_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="taskId != null">#{taskId,jdbcType=BIGINT},</if> |
| | | <if test="rankId != null">#{rankId,jdbcType=BIGINT},</if> |
| | | <if test="addCoin != null">#{addCoin,jdbcType=INTEGER},</if> |
| | | <if test="doubleNum != null">#{doubleNum,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRank">update yeshi_ec_integral_task_rank set tr_task_id = #{taskId,jdbcType=BIGINT},tr_rank_id = #{rankId,jdbcType=BIGINT},tr_add_coin = #{addCoin,jdbcType=INTEGER},tr_double_num = #{doubleNum,jdbcType=INTEGER},tr_create_time = #{createTime,jdbcType=TIMESTAMP},tr_update_time = #{updateTime,jdbcType=TIMESTAMP} where tr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRank">update yeshi_ec_integral_task_rank |
| | | <set> |
| | | <if test="taskId != null">tr_task_id=#{taskId,jdbcType=BIGINT},</if> |
| | | <if test="rankId != null">tr_rank_id=#{rankId,jdbcType=BIGINT},</if> |
| | | <if test="addCoin != null">tr_add_coin=#{addCoin,jdbcType=INTEGER},</if> |
| | | <if test="doubleNum != null">tr_double_num=#{doubleNum,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">tr_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">tr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where tr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getByTsakIdAndRankId" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_integral_task_rank |
| | | WHERE tr_task_id = #{tsakId} AND tr_rank_id = #{rankId} |
| | | LIMIT 1 |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.integral.IntegralTaskRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.integral.IntegralTaskRecord"> |
| | | <id column="ir_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="ir_cid" property="cid" jdbcType="BIGINT"/> |
| | | <result column="ir_task_id" property="taskId" jdbcType="BIGINT"/> |
| | | <result column="ir_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="ir_gold_coin" property="goldCoin" jdbcType="INTEGER"/> |
| | | <result column="ir_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="ir_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ir_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <result column="taskName" property="taskName" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ir_id,ir_cid,ir_task_id,ir_uid,ir_gold_coin,ir_state,ir_create_time,ir_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_integral_task_record where ir_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_integral_task_record where ir_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task_record (ir_id,ir_cid,ir_task_id,ir_uid,ir_gold_coin,ir_state,ir_create_time,ir_update_time) values (#{id,jdbcType=BIGINT},#{cid,jdbcType=BIGINT},#{taskId,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{goldCoin,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ir_id,</if> |
| | | <if test="cid != null">ir_cid,</if> |
| | | <if test="taskId != null">ir_task_id,</if> |
| | | <if test="uid != null">ir_uid,</if> |
| | | <if test="goldCoin != null">ir_gold_coin,</if> |
| | | <if test="state != null">ir_state,</if> |
| | | <if test="createTime != null">ir_create_time,</if> |
| | | <if test="updateTime != null">ir_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="cid != null">#{cid,jdbcType=BIGINT},</if> |
| | | <if test="taskId != null">#{taskId,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord">update yeshi_ec_integral_task_record set ir_cid = #{cid,jdbcType=BIGINT},ir_task_id = #{taskId,jdbcType=BIGINT},ir_uid = #{uid,jdbcType=BIGINT},ir_gold_coin = #{goldCoin,jdbcType=INTEGER},ir_state = #{state,jdbcType=INTEGER},ir_create_time = #{createTime,jdbcType=TIMESTAMP},ir_update_time = #{updateTime,jdbcType=TIMESTAMP} where ir_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTaskRecord">update yeshi_ec_integral_task_record |
| | | <set> |
| | | <if test="cid != null">ir_cid=#{cid,jdbcType=BIGINT},</if> |
| | | <if test="taskId != null">ir_task_id=#{taskId,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">ir_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="goldCoin != null">ir_gold_coin=#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="state != null">ir_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">ir_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ir_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ir_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="listNotReceived" resultMap="BaseResultMap"> |
| | | SELECT tc.`tc_name` AS taskName,d.* FROM yeshi_ec_integral_task_record d |
| | | LEFT JOIN `yeshi_ec_integral_task_class` tc ON tc.`tc_id` = d.`ir_cid` |
| | | WHERE d.`ir_uid` = #{uid} AND d.ir_state = 0 |
| | | ORDER BY d.ir_create_time |
| | | LIMIT #{count} |
| | | </select> |
| | | |
| | | <select id="getTotalGoldCoin" resultType="Integer"> |
| | | SELECT SUM(tr.`ir_gold_coin`) FROM yeshi_ec_integral_task_record tr |
| | | WHERE tr.ir_uid = #{uid} AND tr.`ir_cid`=#{cid} <!-- tr.ir_state <![CDATA[<>]]>2 AND --> |
| | | <if test="dateType == 1"> |
| | | AND TO_DAYS(tr.ir_create_time) = TO_DAYS(NOW()) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="countFinished" resultType="Integer"> |
| | | SELECT IFNULL(COUNT(tr.`ir_id`),0) FROM yeshi_ec_integral_task_record tr |
| | | WHERE tr.ir_uid = #{uid} AND tr.`ir_cid`=#{cid} |
| | | <if test="dateType == 1"> |
| | | AND TO_DAYS(tr.ir_create_time) = TO_DAYS(NOW()) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="listDaySignRecord" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_integral_task_record d |
| | | WHERE d.`ir_uid` = #{uid} AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) <![CDATA[<=]]> DATE(d.ir_create_time) |
| | | ORDER BY d.ir_create_time |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER"/>
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR"/>
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER"/>
|
| | | |
| | | <association property="userInfo" column="uie_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" /> |
| | |
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER"/>
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR"/>
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER"/>
|
| | | |
| | | <association property="userInfo" column="uie_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap"/> |
| | |
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_sex" property="sex" jdbcType="INTEGER"/>
|
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR"/>
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER"/>
|
| | | |
| | | <association property="userInfo" column="uie_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" /> |
| | |
| | | |
| | | |
| | | |
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_create_time,uie_update_time</sql> |
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time</sql>
|
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT} |
| | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}</delete> |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra (uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_create_time,uie_update_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{synchNavbar,jdbcType=VARCHAR},#{firstLoginTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra (uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{synchNavbar,jdbcType=VARCHAR},#{firstLoginTime,jdbcType=TIMESTAMP},#{sex,jdbcType=INTEGER},#{weiXin,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="couponNews != null">uie_coupon_news,</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar,</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time,</if> |
| | | <if test="sex != null">uie_sex,</if>
|
| | | <if test="weiXin != null">uie_weixin,</if>
|
| | | <if test="goldCoin != null">uie_gold_coin,</if>
|
| | | <if test="createTime != null">uie_create_time,</if> |
| | | <if test="updateTime != null">uie_update_time,</if> |
| | | </trim>values |
| | |
| | | <if test="couponNews != null">#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="firstLoginTime != null">#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sex != null">#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra set uie_uid = #{userInfo.id,jdbcType=BIGINT},uie_rank_id = #{userRank.id,jdbcType=BIGINT},uie_rank_source = #{rankSource,jdbcType=INTEGER},uie_rank_order_num = #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time = #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code = #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies = #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news = #{couponNews,jdbcType=INTEGER},uie_synch_navbar = #{synchNavbar,jdbcType=VARCHAR},uie_first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},uie_create_time = #{createTime,jdbcType=TIMESTAMP},uie_update_time = #{updateTime,jdbcType=TIMESTAMP} where uie_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra set uie_uid = #{userInfo.id,jdbcType=BIGINT},uie_rank_id = #{userRank.id,jdbcType=BIGINT},uie_rank_source = #{rankSource,jdbcType=INTEGER},uie_rank_order_num = #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time = #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code = #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies = #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news = #{couponNews,jdbcType=INTEGER},uie_synch_navbar = #{synchNavbar,jdbcType=VARCHAR},uie_first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},uie_sex = #{sex,jdbcType=INTEGER},uie_weixin = #{weiXin,jdbcType=VARCHAR},uie_gold_coin = #{goldCoin,jdbcType=INTEGER},uie_create_time = #{createTime,jdbcType=TIMESTAMP},uie_update_time = #{updateTime,jdbcType=TIMESTAMP} where uie_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra |
| | | <set> |
| | | <if test="userInfo != null">uie_uid=#{userInfo.id,jdbcType=BIGINT},</if> |
| | |
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where uie_id = #{id,jdbcType=BIGINT} |
| | |
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},</if> |
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if>
|
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if>
|
| | | <if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where uie_uid = #{userInfo.id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | }
|
| | |
|
| | | // 处理9.9包邮
|
| | | if (listArc != null && VersionUtil.greaterThan_1_5_50(acceptData.getPlatform(), acceptData.getVersion())
|
| | | && !Constant.IS_TEST)
|
| | | if (listArc != null && VersionUtil.greaterThan_1_5_50(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | for (Special s : listArc) {
|
| | | if (s.getName().contains("9.9")) {// 9块9
|
| | | s.setJumpDetail(jumpDetailV2Service.getByTypeCache("common_template"));
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.exception.ThreeSaleException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | |
| | | import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
| | |
|
| | | long countTotal = threeSaleMapper.countFirstTeam(uid, state);
|
| | |
|
| | | return organizeTeam(countTotal, list);
|
| | | return organizeTeam(countTotal, list, uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | long countTotal = threeSaleMapper.countSecondTeam(uid, state);
|
| | |
|
| | | return organizeTeam(countTotal, list);
|
| | | return organizeTeam(countTotal, list, uid);
|
| | | }
|
| | |
|
| | | public JSONObject organizeTeam(long count, List<ThreeSale> list) {
|
| | | public JSONObject organizeTeam(long count, List<ThreeSale> list, Long uid) {
|
| | |
|
| | | JSONObject result = new JSONObject();
|
| | |
|
| | |
| | | object.put("memoName", memoName);
|
| | |
|
| | | String nickName = "";
|
| | | Long workerId= null;
|
| | | String portrait = "";
|
| | | Long lastLoginTime = null;
|
| | |
|
| | | UserInfo worker = threeSale.getWorker();
|
| | | if (worker != null) {
|
| | | workerId = worker.getId();
|
| | | portrait = worker.getPortrait();
|
| | | lastLoginTime = worker.getLastLoginTime();
|
| | | nickName = worker.getNickName();
|
| | | }
|
| | | object.put("workerId", workerId);
|
| | | object.put("nickName", nickName);
|
| | | object.put("portrait", portrait);
|
| | |
|
| | |
| | | // 往年
|
| | | contentJson.put("content", "最近登录 " + format.format(lastLoginTime));
|
| | | }
|
| | |
|
| | | array.add(contentJson);
|
| | | |
| | | |
| | | if (workerId != null) {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(workerId);
|
| | | if (userInfoExtra != null) |
| | | object.put("weiXin", userInfoExtra.getWeiXin());
|
| | | }
|
| | | |
| | |
|
| | | } else if (threeSale.getExpire() != null
|
| | | && (threeSale.getExpire() == 1 || threeSale.getExpire().equals(1))) {
|
| | |
| | | resultArray.add(object);
|
| | | }
|
| | |
|
| | | boolean bdWeiXin = false;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) |
| | | bdWeiXin = true;
|
| | | |
| | | result.put("bdWeiXin", bdWeiXin);
|
| | | result.put("count", count);
|
| | | result.put("result_list", resultArray);
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.integral;
|
| | |
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.integral.IntegralTaskClassMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass.UniqueKeyEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRank;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskClassService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRankService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.integral.DailySignVO;
|
| | | import com.yeshi.fanli.vo.integral.IntegralTaskClassVO;
|
| | | import com.yeshi.fanli.vo.integral.SignDateVO;
|
| | |
|
| | | @Service
|
| | | public class IntegralTaskClassServiceImpl implements IntegralTaskClassService {
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | | |
| | | @Resource
|
| | | private IntegralTaskClassMapper integralTaskClassMapper;
|
| | |
|
| | | @Resource
|
| | | private IntegralTaskService integralTaskService;
|
| | |
|
| | | @Resource
|
| | | private IntegralTaskRankService integralTaskRankService;
|
| | |
|
| | | @Resource
|
| | | private IntegralTaskRecordService integralTaskRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | |
| | | @Override
|
| | | public List<IntegralTaskClassVO> getIntegralTaskClassVO(Long uid, long start, int count) {
|
| | | // 用户签到
|
| | | Integer baseGoldCoin = 5;
|
| | | boolean dailySign = false;
|
| | | if (start == 0) { // 第一页签到
|
| | | try { |
| | | baseGoldCoin = finishedDailySign(uid);
|
| | | dailySign = true;
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | List<IntegralTaskClassVO> listVo = integralTaskClassMapper.getIntegralTaskClassVO(start, count);
|
| | | if (listVo == null || listVo.size() == 0) {
|
| | | return listVo;
|
| | | }
|
| | |
|
| | | for (IntegralTaskClassVO taskClassVO : listVo) {
|
| | | String progress = taskClassVO.getProgress();
|
| | | if (StringUtil.isNullOrEmpty(progress))
|
| | | continue;
|
| | | |
| | | Integer taskNum = taskClassVO.getTaskNum();
|
| | | if (taskNum == null)
|
| | | continue;
|
| | |
|
| | | // 目前只有签到变灰
|
| | | UniqueKeyEnum uniqueKey = taskClassVO.getUniqueKey();
|
| | | if (uniqueKey == UniqueKeyEnum.dailySign) {
|
| | | taskClassVO.setTotalCoin(baseGoldCoin);
|
| | | taskClassVO.setLightUp(dailySign);
|
| | | } else {
|
| | | taskClassVO.setLightUp(true);
|
| | | }
|
| | | |
| | | |
| | | Integer dateType = 1; // 查询当日
|
| | | if (uniqueKey == UniqueKeyEnum.orderReward)
|
| | | dateType = null; // 查询历史
|
| | |
|
| | | Long id = taskClassVO.getId();
|
| | | int countFinished = 0;
|
| | | Integer totalGoldCoin = integralTaskRecordService.getTotalGoldCoin(uid, id, dateType);
|
| | | if (totalGoldCoin != null && totalGoldCoin > 0) {
|
| | | taskClassVO.setFinishedCoin("+" + totalGoldCoin);
|
| | | if (uniqueKey != UniqueKeyEnum.dailySign)
|
| | | countFinished = integralTaskRecordService.countFinished(uid, id, dateType);
|
| | | }
|
| | | progress = progress.replace("{已完成}", countFinished + "").replace("{总任务}", taskNum + "");
|
| | | |
| | | if (!dailySign && uniqueKey == UniqueKeyEnum.dailySign) {
|
| | | progress = "未签到";
|
| | | taskClassVO.setBtnName("签到");
|
| | | } |
| | | taskClassVO.setProgress(progress);
|
| | | }
|
| | | return listVo;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public Long countTaskClass() {
|
| | | return integralTaskClassMapper.countTaskClass();
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public IntegralTaskClass getByUniqueKey(String uniqueKey) {
|
| | | return integralTaskClassMapper.getByUniqueKey(uniqueKey);
|
| | | }
|
| | | |
| | | /**
|
| | | * 签到
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | @Transactional
|
| | | public Integer finishedDailySign(long uid) throws Exception{
|
| | | Integer baseGoldCoin = 5;
|
| | | |
| | | IntegralTaskClass taskClass = getByUniqueKey(UniqueKeyEnum.dailySign.name());
|
| | | if (taskClass == null || taskClass.getState() == null || taskClass.getState() != 1)
|
| | | return baseGoldCoin;
|
| | |
|
| | | Long cid = taskClass.getId();
|
| | | |
| | | // 今日已签到完成
|
| | | if (integralTaskRecordService.isToDaySign(uid, cid))
|
| | | return baseGoldCoin;
|
| | |
|
| | | // 任务
|
| | | Integer num = integralTaskRecordService.getNowdaySignNum(uid, cid);
|
| | | String uniqueKey = UniqueKeyEnum.dailySign.name() + num;
|
| | | IntegralTask integralTask = integralTaskService.getByCidAndUniqueKey(cid, uniqueKey);
|
| | | if (integralTask == null)
|
| | | return baseGoldCoin;
|
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null)
|
| | | return baseGoldCoin;
|
| | |
|
| | | UserRank userRank = userInfoExtra.getUserRank();
|
| | | if (userRank == null)
|
| | | return baseGoldCoin;
|
| | |
|
| | | Integer goldCoin = integralTask.getGoldCoin();
|
| | | Integer baseDoubleNum = integralTask.getDoubleNum();
|
| | | if (baseDoubleNum != null && baseDoubleNum > 0)
|
| | | goldCoin = goldCoin * baseDoubleNum;
|
| | | |
| | | baseGoldCoin = goldCoin;
|
| | | |
| | | // 根据等级计算是否增加或加倍
|
| | | Long taskId = integralTask.getId();
|
| | | IntegralTaskRank traskRank = integralTaskRankService.getByTsakIdAndRankId(taskId, userRank.getId());
|
| | | if (traskRank != null) {
|
| | | Integer addCoin = traskRank.getAddCoin();
|
| | | if (addCoin != null && addCoin > 0)
|
| | | goldCoin += addCoin;
|
| | |
|
| | | Integer doubleNum = traskRank.getDoubleNum();
|
| | | if (doubleNum != null && doubleNum > 0) {
|
| | | goldCoin = goldCoin * doubleNum;
|
| | | }
|
| | | }
|
| | | // 加入记录
|
| | | integralTaskRecordService.finishedTask(uid, cid, taskId, goldCoin);
|
| | | return baseGoldCoin;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public DailySignVO getDailySignList(Long uid, Long rankId) throws ParseException{
|
| | | IntegralTaskClass taskClass = integralTaskClassMapper.getByUniqueKey(UniqueKeyEnum.dailySign.name());
|
| | | if (taskClass == null || taskClass.getState() == null || taskClass.getState() != 1)
|
| | | return null;
|
| | | |
| | | Long cid = taskClass.getId();
|
| | | List<IntegralTask> listTask = integralTaskService.listByCid(cid);
|
| | | if (listTask == null || listTask.size() == 0) {
|
| | | return null;
|
| | | }
|
| | | |
| | | Date date = new Date();
|
| | | SimpleDateFormat format = new SimpleDateFormat("MM.dd");
|
| | | List<SignDateVO> listSign = new ArrayList<SignDateVO>();
|
| | | |
| | | List<Date> listDays = integralTaskRecordService.getSignDays(uid, cid);
|
| | | for (int i = 0; i < listDays.size(); i ++) {
|
| | | if(i == listDays.size() -1) {
|
| | | SignDateVO signDate = new SignDateVO();
|
| | | signDate.setDate("今日");
|
| | | signDate.setLightUp(true);
|
| | | listSign.add(signDate);
|
| | | break;
|
| | | }
|
| | | |
| | | String before = format.format(listDays.get(i));
|
| | | if (before.startsWith("0")) |
| | | before = before.substring(1, before.length());
|
| | | SignDateVO signDateVO = new SignDateVO();
|
| | | signDateVO.setDate(before);
|
| | | listSign.add(signDateVO);
|
| | | }
|
| | | |
| | | for (int i = 1; i <= 7- listDays.size(); i ++) {
|
| | | String after = format.format(DateUtil.reduceDay(i, date));
|
| | | if (after.startsWith("0")) |
| | | after = after.substring(1, after.length());
|
| | | |
| | | SignDateVO signDateVO = new SignDateVO();
|
| | | signDateVO.setDate(after);
|
| | | listSign.add(signDateVO);
|
| | | }
|
| | | |
| | | DailySignVO dailySignVO = new DailySignVO();
|
| | | for (int i = 0; i < listTask.size(); i++) {
|
| | | if (listSign.size() <= i) {
|
| | | break;
|
| | | }
|
| | | SignDateVO signDateVO = listSign.get(i);
|
| | | |
| | | IntegralTask task = listTask.get(i);
|
| | | Integer goldCoin = task.getGoldCoin();
|
| | | Integer baseDoubleNum = task.getDoubleNum();
|
| | | if (baseDoubleNum != null && baseDoubleNum > 0)
|
| | | goldCoin = goldCoin * baseDoubleNum;
|
| | | |
| | | IntegralTaskRank traskRank = integralTaskRankService.getByTsakIdAndRankId(task.getId(), rankId);
|
| | | if (traskRank != null) {
|
| | | Integer addCoin = traskRank.getAddCoin();
|
| | | if (addCoin != null && addCoin > 0)
|
| | | goldCoin += addCoin;
|
| | |
|
| | | Integer doubleNum = traskRank.getDoubleNum();
|
| | | if (doubleNum != null && doubleNum > 0) {
|
| | | goldCoin = goldCoin * doubleNum;
|
| | | }
|
| | | }
|
| | | signDateVO.setGoldCoin("+" + goldCoin);
|
| | | |
| | | if("今日".equals(signDateVO.getDate()))
|
| | | dailySignVO.setGoldCoin(goldCoin);
|
| | | |
| | | }
|
| | | |
| | | dailySignVO.setDays(listDays.size());
|
| | | dailySignVO.setListDate(listSign);
|
| | | return dailySignVO;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.integral;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.integral.IntegralTaskRankMapper;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRank;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRankService;
|
| | |
|
| | | @Service
|
| | | public class IntegralTaskRankServiceImpl implements IntegralTaskRankService {
|
| | |
|
| | | @Resource
|
| | | private IntegralTaskRankMapper integralTaskRankMapper;
|
| | |
|
| | | @Override
|
| | | public IntegralTaskRank getByTsakIdAndRankId(Long tsakId, Long rankId) {
|
| | | return integralTaskRankMapper.getByTsakIdAndRankId(tsakId, rankId);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.integral;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.integral.IntegralTaskRecordMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
|
| | | import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | |
|
| | | @Service
|
| | | public class IntegralTaskRecordServiceImpl implements IntegralTaskRecordService {
|
| | |
|
| | | @Resource
|
| | | private IntegralTaskRecordMapper integralTaskRecordMapper;
|
| | | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | | @Override
|
| | | public Integer getTotalGoldCoin(long uid, Long cid, Integer dateType) {
|
| | | return integralTaskRecordMapper.getTotalGoldCoin(uid, cid, dateType);
|
| | | }
|
| | | |
| | | @Override
|
| | | public Integer countFinished(long uid, Long cid, Integer dateType) {
|
| | | return integralTaskRecordMapper.countFinished(uid, cid, dateType);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void finishedTask(long uid, long cid, long taskId, int goldCoin) {
|
| | | IntegralTaskRecord taskRecord = new IntegralTaskRecord();
|
| | | taskRecord.setUid(uid);
|
| | | taskRecord.setCid(cid);
|
| | | taskRecord.setTaskId(taskId);
|
| | | taskRecord.setGoldCoin(goldCoin);
|
| | | taskRecord.setState(0);
|
| | | taskRecord.setCreateTime(new Date());
|
| | | taskRecord.setUpdateTime(new Date());
|
| | | integralTaskRecordMapper.insertSelective(taskRecord);
|
| | | }
|
| | | |
| | | @Override
|
| | | public boolean isToDaySign(long uid, Long cid) {
|
| | | Integer countFinished = integralTaskRecordMapper.countFinished(uid, cid, 1);
|
| | | if (countFinished != null && countFinished > 0) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | @Override
|
| | | public Integer getNowdaySignNum(long uid, Long cid) {
|
| | | int num = 1;
|
| | | try {
|
| | | // 签到时间倒序查询近7天数据
|
| | | List<IntegralTaskRecord> list = integralTaskRecordMapper.listDaySignRecord(uid, cid);
|
| | | if (list != null && list.size() > 0) {
|
| | | Date today =new Date();
|
| | | for (IntegralTaskRecord record: list) {
|
| | | if (DateUtil.daysBetween2(record.getCreateTime(),today) != 1) {
|
| | | break; // 天数未连续
|
| | | }
|
| | | num ++ ;
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | if (num > 7) {
|
| | | num = 1;
|
| | | }
|
| | | return num;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<Date> getSignDays(long uid, Long cid) {
|
| | | List<Date> listDate = new ArrayList<Date>();
|
| | | try {
|
| | | // 签到时间正序序查询近7天数据
|
| | | List<IntegralTaskRecord> list = integralTaskRecordMapper.listDaySignRecord(uid, cid);
|
| | | if (list != null && list.size() > 0) {
|
| | | Date date = new Date();
|
| | | for (IntegralTaskRecord record: list) {
|
| | | Date createTime = record.getCreateTime();
|
| | | if (DateUtil.daysBetween2(createTime,date) > 1) {
|
| | | break; // 天数未连续
|
| | | }
|
| | | date = createTime;
|
| | | listDate.add(record.getCreateTime());
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | // 倒序
|
| | | Collections.reverse(listDate);
|
| | | return listDate;
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<IntegralTaskRecord> listNotReceived(int count, long uid) {
|
| | | return integralTaskRecordMapper.listNotReceived(count, uid);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public Integer receiveGoldCoin(Long uid, Set<Long> idList) throws IntegralTaskRecordException {
|
| | | if(idList == null || idList.size() == 0) {
|
| | | throw new IntegralTaskRecordException(1, "id为空");
|
| | | }
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null) {
|
| | | throw new IntegralTaskRecordException(1, "用户信息不全");
|
| | | }
|
| | | |
| | | Integer totalGoldCoin = 0;
|
| | | for (Long id: idList) {
|
| | | IntegralTaskRecord record = integralTaskRecordMapper.selectByPrimaryKey(id);
|
| | | if (record == null) |
| | | continue;
|
| | | |
| | | Long uid2 = record.getUid();
|
| | | if (uid2 == null || uid.longValue() != uid2.longValue())
|
| | | continue; // 用户id不符合
|
| | | |
| | | if (record.getState() != null && record.getState().intValue() == 1) {
|
| | | continue; // 已领取
|
| | | }
|
| | | |
| | | IntegralTaskRecord taskRecord = new IntegralTaskRecord();
|
| | | taskRecord.setId(record.getId());
|
| | | taskRecord.setState(1); // 已领取
|
| | | taskRecord.setUpdateTime(new Date());
|
| | | integralTaskRecordMapper.updateByPrimaryKeySelective(taskRecord);
|
| | | |
| | | totalGoldCoin += record.getGoldCoin();
|
| | | }
|
| | | |
| | | Integer goldCoin = userInfoExtra.getGoldCoin();
|
| | | if (goldCoin == null) |
| | | goldCoin = 0;
|
| | | |
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setGoldCoin(goldCoin + totalGoldCoin);
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | } catch (UserInfoExtraException e) {
|
| | | throw new IntegralTaskRecordException(1, "用户信息不全");
|
| | | }
|
| | | |
| | | return extra.getGoldCoin();
|
| | | }
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.integral;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.integral.IntegralTaskMapper;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskService;
|
| | |
|
| | | @Service
|
| | | public class IntegralTaskServiceImpl implements IntegralTaskService {
|
| | |
|
| | | @Resource
|
| | | private IntegralTaskMapper integralTaskMapper;
|
| | |
|
| | | @Override
|
| | | public List<IntegralTask> listByCid(Long cid) {
|
| | | return integralTaskMapper.listByCid(cid);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public IntegralTask getByCidAndUniqueKey(Long cid, String uniqueKey) {
|
| | | return integralTaskMapper.getByCidAndUniqueKey(cid, uniqueKey);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | } else {
|
| | | // 奖励订单、免单 使用记录
|
| | | if (sourceType == null) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null, signList);
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null, signList, acceptData);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordTB, signList);
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordTB, signList, acceptData);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordJD, signList);
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordJD, signList, acceptData);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordPDD, signList);
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordPDD, signList, acceptData);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | * @param signList
|
| | | */
|
| | | public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState,
|
| | | Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList) {
|
| | | Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList, AcceptData acceptData) {
|
| | |
|
| | | // 是否免单商品
|
| | | boolean freeOrder = false;
|
| | |
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | | if (VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | jumpLink.put("goodsType", order.getSourceType());
|
| | | }
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", type);
|
| | |
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | | if (VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | jumpLink.put("goodsType", order.getSourceType());
|
| | | }
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", 1); // 页面跳转
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @Override
|
| | | public UserInfo getUserByInviteCode(String inviteCode) throws UserInfoExtraException{
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | throw new UserInfoExtraException(1, "邀请码不能为空");
|
| | | }
|
| | | // 邀请人信息
|
| | | UserInfo inviter = userInfoService.getInfoByPhoneOrInviteCode(inviteCode, inviteCode);
|
| | | if (inviter == null) {
|
| | | throw new UserInfoExtraException(1, "上级邀请码不存在");
|
| | | }
|
| | | return inviter;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public UserInfo getInviterInfo(Long uid, String code) throws UserInfoExtraException{
|
| | | if (code == null) {
|
| | | throw new UserInfoExtraException(1, "code信息不完整");
|
| | | }
|
| | | |
| | | // 用户信息
|
| | | UserInfo invitee = userInfoService.selectByPKey(uid);
|
| | | if (invitee == null) {
|
| | | throw new UserInfoExtraException(1, "用户不存在");
|
| | | }
|
| | | |
| | | // 用户额外信息
|
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra != null) {
|
| | | String inviteCodeHas = extra.getInviteCode();
|
| | | if (inviteCodeHas != null && inviteCodeHas.trim().length() > 0) {
|
| | | throw new UserInfoExtraException(1, "已经激活, 无需再次激活");
|
| | | }
|
| | | }
|
| | | |
| | | // 获取微信信息
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code);
|
| | | if (weiXinUser == null) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | | |
| | | // 验证数据
|
| | | String wxUnionIdExist = invitee.getWxUnionId();
|
| | | if (StringUtil.isNullOrEmpty(wxUnionIdExist)) {
|
| | | UserInfo newUser = userInfoService.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
|
| | | if (newUser != null) {
|
| | | throw new UserInfoExtraException(1, "此微信已被其他帐号绑定");
|
| | | }
|
| | | } else if (!wxUnionId.equals(wxUnionIdExist)){
|
| | | throw new UserInfoExtraException(1, "绑定微信与激活微信不一致");
|
| | | }
|
| | | |
| | | // 邀请人ID
|
| | | Long inviterId = userInviteRecordService.getNewestInviterId(wxUnionId);
|
| | | if (inviterId == null) {
|
| | | throw new UserInfoExtraException(1, "没有对应的邀请关系");
|
| | | }
|
| | | |
| | | UserInfo inviter = userInfoService.selectByPKey(inviterId);
|
| | | if (inviter == null) {
|
| | | throw new UserInfoExtraException(1, "对应的邀请关系不存在");
|
| | | }
|
| | | return inviter;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.integral;
|
| | |
|
| | | import java.text.ParseException;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass;
|
| | | import com.yeshi.fanli.vo.integral.DailySignVO;
|
| | | import com.yeshi.fanli.vo.integral.IntegralTaskClassVO;
|
| | |
|
| | | public interface IntegralTaskClassService {
|
| | |
|
| | | /**
|
| | | * 获取有效任务
|
| | | * @return
|
| | | */
|
| | | public List<IntegralTaskClassVO> getIntegralTaskClassVO(Long uid, long start, int count);
|
| | |
|
| | | /**
|
| | | * 统计有效
|
| | | * @return
|
| | | */
|
| | | public Long countTaskClass();
|
| | |
|
| | | |
| | | /**
|
| | | * 签到列表
|
| | | * @param uid
|
| | | * @param rankId
|
| | | * @return
|
| | | * @throws ParseException
|
| | | */
|
| | | public DailySignVO getDailySignList(Long uid, Long rankId) throws ParseException;
|
| | |
|
| | | |
| | | /**
|
| | | * 签到
|
| | | * @param uid
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public Integer finishedDailySign(long uid) throws Exception;
|
| | |
|
| | | /**
|
| | | * 根据key查询
|
| | | * @param uniqueKey
|
| | | * @return
|
| | | */
|
| | | public IntegralTaskClass getByUniqueKey(String uniqueKey);
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.integral;
|
| | |
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRank;
|
| | |
|
| | | public interface IntegralTaskRankService {
|
| | |
|
| | | /**
|
| | | * 查询等级奖励
|
| | | * @param tsakId
|
| | | * @param rankId
|
| | | * @return
|
| | | */
|
| | | public IntegralTaskRank getByTsakIdAndRankId(Long tsakId, Long rankId);
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.integral;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
|
| | | import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
|
| | |
|
| | | public interface IntegralTaskRecordService {
|
| | |
|
| | | |
| | | /**
|
| | | * 待领取金币
|
| | | * @param count
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<IntegralTaskRecord> listNotReceived(int count, long uid);
|
| | |
|
| | | /**
|
| | | * 已领取金币
|
| | | * @param uid
|
| | | * @param dateType
|
| | | * @return
|
| | | */
|
| | | public Integer getTotalGoldCoin(long uid, Long cid, Integer dateType);
|
| | |
|
| | | /**
|
| | | * 完成任务数量
|
| | | * @param uid
|
| | | * @param cid
|
| | | * @param dateType
|
| | | * @return
|
| | | */
|
| | | public Integer countFinished(long uid, Long cid, Integer dateType);
|
| | |
|
| | | /**
|
| | | * 今日是已签到
|
| | | * @param uid
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public boolean isToDaySign(long uid, Long cid);
|
| | |
|
| | |
|
| | | /**
|
| | | * 计算今日签到的天数
|
| | | * @param uid
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public Integer getNowdaySignNum(long uid, Long cid);
|
| | |
|
| | | /**
|
| | | * 完成任务记录
|
| | | * @param uid
|
| | | * @param cid
|
| | | * @param taskId
|
| | | * @param goldCoin
|
| | | */
|
| | | public void finishedTask(long uid, long cid, long taskId, int goldCoin);
|
| | |
|
| | | /**
|
| | | * 获取已连续签到次数
|
| | | * @param uid
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<Date> getSignDays(long uid, Long cid);
|
| | |
|
| | | |
| | | /**
|
| | | * 领取金币
|
| | | * @param uid
|
| | | * @param idList
|
| | | * @throws IntegralTaskRecordException |
| | | */
|
| | | public Integer receiveGoldCoin(Long uid, Set<Long> idList) throws IntegralTaskRecordException;
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.integral;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask;
|
| | |
|
| | | public interface IntegralTaskService {
|
| | |
|
| | | /**
|
| | | * 查询任务
|
| | | * @param cid
|
| | | * @param uniqueKey
|
| | | * @return
|
| | | */
|
| | | public IntegralTask getByCidAndUniqueKey(Long cid, String uniqueKey);
|
| | |
|
| | | |
| | | /**
|
| | | * 查询分类下所有有效任务
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<IntegralTask> listByCid(Long cid);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | |
| | | */
|
| | | public UserRank gerUserRank(Long uid);
|
| | |
|
| | | /**
|
| | | * 根据邀请码查询用户
|
| | | * @param inviteCode
|
| | | * @return
|
| | | * @throws UserInfoExtraException
|
| | | */
|
| | | public UserInfo getUserByInviteCode(String inviteCode) throws UserInfoExtraException;
|
| | |
|
| | | /**
|
| | | * 获取邀请人关系信息
|
| | | * @param uid
|
| | | * @param code
|
| | | * @return
|
| | | * @throws UserInfoExtraException
|
| | | */
|
| | | public UserInfo getInviterInfo(Long uid, String code) throws UserInfoExtraException;
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.mybatishandler.integral;
|
| | |
|
| | | import java.sql.CallableStatement;
|
| | | import java.sql.PreparedStatement;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
|
| | | import org.apache.ibatis.type.BaseTypeHandler;
|
| | | import org.apache.ibatis.type.JdbcType;
|
| | |
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask.FrequencyEnum;
|
| | |
|
| | | public class FrequencyEnumHandler extends BaseTypeHandler<FrequencyEnum> {
|
| | |
|
| | | @Override
|
| | | public FrequencyEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | return FrequencyEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public FrequencyEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return FrequencyEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public FrequencyEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return FrequencyEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, FrequencyEnum arg2, JdbcType arg3)
|
| | | throws SQLException {
|
| | | arg0.setString(arg1, arg2.name());
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.mybatishandler.integral;
|
| | |
|
| | | import java.sql.CallableStatement;
|
| | | import java.sql.PreparedStatement;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
|
| | | import org.apache.ibatis.type.BaseTypeHandler;
|
| | | import org.apache.ibatis.type.JdbcType;
|
| | |
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass.UniqueKeyEnum;
|
| | |
|
| | | public class UniqueKeyEnumHandler extends BaseTypeHandler<UniqueKeyEnum> {
|
| | |
|
| | | @Override
|
| | | public UniqueKeyEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | return UniqueKeyEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UniqueKeyEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return UniqueKeyEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UniqueKeyEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return UniqueKeyEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, UniqueKeyEnum arg2, JdbcType arg3)
|
| | | throws SQLException {
|
| | | arg0.setString(arg1, arg2.name());
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.integral;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class DailySignVO implements Serializable {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 签到天数
|
| | | @Expose
|
| | | private Integer days;
|
| | | |
| | | // 今日签到金币
|
| | | @Expose
|
| | | private Integer goldCoin;
|
| | | |
| | | // 完成任务金币数
|
| | | @Expose
|
| | | private List<SignDateVO> listDate;
|
| | |
|
| | | public Integer getDays() {
|
| | | return days;
|
| | | }
|
| | |
|
| | | public void setDays(Integer days) {
|
| | | this.days = days;
|
| | | }
|
| | |
|
| | | public List<SignDateVO> getListDate() {
|
| | | return listDate;
|
| | | }
|
| | |
|
| | | public void setListDate(List<SignDateVO> listDate) {
|
| | | this.listDate = listDate;
|
| | | }
|
| | |
|
| | | public Integer getGoldCoin() {
|
| | | return goldCoin;
|
| | | }
|
| | |
|
| | | public void setGoldCoin(Integer goldCoin) {
|
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.integral;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass;
|
| | |
|
| | | public class IntegralTaskClassVO extends IntegralTaskClass {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 总奖励金币
|
| | | @Expose
|
| | | private Integer totalCoin;
|
| | | // 完成任务金币数
|
| | | @Expose
|
| | | private String finishedCoin;
|
| | | // 按钮是否点亮
|
| | | @Expose
|
| | | private boolean lightUp;
|
| | | |
| | | // 总任务数量
|
| | | private Integer taskNum;
|
| | | // 已完成任务数量
|
| | | private Integer finishedNum;
|
| | | |
| | | |
| | | public Integer getTotalCoin() {
|
| | | return totalCoin;
|
| | | }
|
| | |
|
| | | public void setTotalCoin(Integer totalCoin) {
|
| | | this.totalCoin = totalCoin;
|
| | | }
|
| | |
|
| | | public String getFinishedCoin() {
|
| | | return finishedCoin;
|
| | | }
|
| | |
|
| | | public void setFinishedCoin(String finishedCoin) {
|
| | | this.finishedCoin = finishedCoin;
|
| | | }
|
| | |
|
| | | public Integer getTaskNum() {
|
| | | return taskNum;
|
| | | }
|
| | |
|
| | | public void setTaskNum(Integer taskNum) {
|
| | | this.taskNum = taskNum;
|
| | | }
|
| | |
|
| | | public Integer getFinishedNum() {
|
| | | return finishedNum;
|
| | | }
|
| | |
|
| | | public void setFinishedNum(Integer finishedNum) {
|
| | | this.finishedNum = finishedNum;
|
| | | }
|
| | |
|
| | | public boolean isLightUp() {
|
| | | return lightUp;
|
| | | }
|
| | |
|
| | | public void setLightUp(boolean lightUp) {
|
| | | this.lightUp = lightUp;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.integral;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class SignDateVO implements Serializable {
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 金币
|
| | | @Expose
|
| | | private String goldCoin;
|
| | | // 日期
|
| | | @Expose
|
| | | private String date;
|
| | | // 按钮是否点亮
|
| | | @Expose
|
| | | private boolean lightUp;
|
| | |
|
| | | public String getGoldCoin() {
|
| | | return goldCoin;
|
| | | }
|
| | |
|
| | | public void setGoldCoin(String goldCoin) {
|
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | |
|
| | | public String getDate() {
|
| | | return date;
|
| | | }
|
| | |
|
| | | public void setDate(String date) {
|
| | | this.date = date;
|
| | | }
|
| | |
|
| | | public boolean isLightUp() {
|
| | | return lightUp;
|
| | | }
|
| | |
|
| | | public void setLightUp(boolean lightUp) {
|
| | | this.lightUp = lightUp;
|
| | | }
|
| | | }
|
| | |
| | | * @return 相差天数
|
| | | * @throws ParseException calendar 对日期进行时间操作 getTimeInMillis() 获取日期的毫秒显示形式
|
| | | */
|
| | | public static int daysBetween(Date smdate, Date bdate) throws ParseException {
|
| | | public static int daysBetween(Date minDate, Date maxDate) throws ParseException {
|
| | | Calendar cal = Calendar.getInstance();
|
| | | cal.setTime(smdate);
|
| | | long time1 = cal.getTimeInMillis();
|
| | | cal.setTime(bdate);
|
| | | long time2 = cal.getTimeInMillis();
|
| | | long between_days = (time2 - time1) / (1000 * 3600 * 24);
|
| | | cal.setTime(minDate);
|
| | | long minTime = cal.getTimeInMillis();
|
| | | cal.setTime(maxDate);
|
| | | long maxTime = cal.getTimeInMillis();
|
| | | long between_days = (maxTime - minTime) / (1000 * 3600 * 24);
|
| | | return Integer.parseInt(String.valueOf(between_days));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 字符串日期格式的计算
|
| | | * |
| | | * @param smdate
|
| | | * @param bdate
|
| | | * @return 单位天数
|
| | | * @throws ParseException
|
| | | */
|
| | | public static int daysBetween2(Date minDate, Date maxDate) throws ParseException {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | return daysBetween(sdf.format(minDate), sdf.format(maxDate));
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 字符串日期格式的计算
|
| | |
| | | * @return
|
| | | * @throws ParseException
|
| | | */
|
| | | public static int daysBetween(String smdate, String bdate) throws ParseException {
|
| | | public static int daysBetween(String minDate, String maxDate) throws ParseException {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | Calendar cal = Calendar.getInstance();
|
| | | cal.setTime(sdf.parse(smdate));
|
| | | long time1 = cal.getTimeInMillis();
|
| | | cal.setTime(sdf.parse(bdate));
|
| | | long time2 = cal.getTimeInMillis();
|
| | | long between_days = (time2 - time1) / (1000 * 3600 * 24);
|
| | | cal.setTime(sdf.parse(minDate));
|
| | | long minTime = cal.getTimeInMillis();
|
| | | cal.setTime(sdf.parse(maxDate));
|
| | | long maxTime = cal.getTimeInMillis();
|
| | | long between_days = (maxTime - minTime) / (1000 * 3600 * 24);
|
| | | return Integer.parseInt(String.valueOf(between_days));
|
| | | }
|
| | |
|