| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.TeamFansInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInviteService userInviteService;
|
| | | |
| | | @Resource
|
| | | private TeamFansInfoService teamFansInfoService;
|
| | |
|
| | | |
| | |
|
| | | private static final String EXTRACT_MIN_MONEY = ConfigKeyEnum.extractMoneyMin.getKey();
|
| | | private static final String EXTRACT_MAX_MONEY = ConfigKeyEnum.extractMoneyMAX.getKey();
|
| | |
| | | */
|
| | | @RequestMapping(value = "setextrainfo", method = RequestMethod.POST)
|
| | | public void setExtraInfo(AcceptData acceptData, long uid, long inviteId, String memoName, PrintWriter out) {
|
| | | List<ThreeSale> listThreeSale = threeSaleSerivce.listbyIdAndBossId(inviteId, uid, null);
|
| | | if (listThreeSale == null || listThreeSale.size() == 0) {
|
| | | ThreeSale threeSale = threeSaleSerivce.selectByPrimaryKey(inviteId);
|
| | | if (threeSale == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该记录不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo worker = listThreeSale.get(0).getWorker();
|
| | | UserInfo worker = threeSale.getWorker();
|
| | | if (worker == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该记录不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | int type = 1;
|
| | | if (threeSale.getBoss().getId() != uid) {
|
| | | type = 2;
|
| | | }
|
| | | |
| | | ThreeSaleExtraInfo extraInfo = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(uid, worker.getId());
|
| | | if (extraInfo == null) {
|
| | | extraInfo = new ThreeSaleExtraInfo();
|
| | | Long bossUid = threeSale.getBoss().getId();
|
| | | if (uid == bossUid) {
|
| | | extraInfo.setType(1); // 直接
|
| | | } else {
|
| | | extraInfo.setType(2); // 间接
|
| | | }
|
| | | |
| | | extraInfo.setWorker(worker);
|
| | | extraInfo.setNickname(memoName);
|
| | | extraInfo.setCreateTime(new Date());
|
| | |
| | | updateInfo.setUpdateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.updateByPrimaryKeySelective(updateInfo);
|
| | | }
|
| | | |
| | | // 更新粉丝记录信息
|
| | | teamFansInfoService.updateMemoName(worker.getId(), type, memoName);
|
| | | |
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | }
|
| | |
|
| | |
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|