feat: 获取指定业务数据

This commit is contained in:
裴浩宇 2024-05-23 10:21:19 +08:00
parent 6b3934ff49
commit e26eee87d0
34 changed files with 169 additions and 57 deletions

View File

@ -66,9 +66,9 @@ public class PxAdminChatController {
public AjaxResult signOut() {
WebSocketMessage webSocketMessage = new WebSocketMessage();
webSocketMessage.setWebSocket(MessageType.LOG_OUT);
webSocketMessage.setUserId(SecurityUtils.getUserId().toString());
webSocketMessage.setUserId(SecurityUtils.getUserId());
webSocketController.sendAllMessage(webSocketMessage);
pxChatMemberService.signOut(SecurityUtils.getUserId().toString());
pxChatMemberService.signOut(SecurityUtils.getUserId());
return AjaxResult.success("退出成功");
}
@ -89,7 +89,7 @@ public class PxAdminChatController {
pxChatMessage.setLocation(location);
WebSocketMessage webSocketMessage = new WebSocketMessage();
webSocketMessage.setWebSocket(MessageType.CHAT_MESSAGE);
webSocketMessage.setUserId(SecurityUtils.getUserId().toString());
webSocketMessage.setUserId(SecurityUtils.getUserId());
webSocketMessage.setMessage(pxChatMessage);
webSocketController.sendAllMessage(webSocketMessage);
return AjaxResult.success("发送成功", pxChatMessageService.sendMessage(pxChatMessage));

View File

@ -67,7 +67,7 @@ public class PxAdminController extends BaseController {
// 文章列表
PxArticleVo pxArticle = new PxArticleVo();
pxArticle.setSearchValue(searchCode);
pxArticle.setCreateBy(SecurityUtils.getUserId().toString());
pxArticle.setCreateBy(SecurityUtils.getUserId());
List<PxArticleVo> pxArticles = pxArticleService.selectPxArticleNotContent(pxArticle);
Map<String, Object> article = new HashMap<>();
article.put("label", "博客文章");
@ -117,7 +117,7 @@ public class PxAdminController extends BaseController {
// 待办事项TODO
PxToDo pxToDo = new PxToDo();
// 创建人
pxToDo.setCreateBy(SecurityUtils.getUserId().toString());
pxToDo.setCreateBy(SecurityUtils.getUserId());
// 未完成
pxToDo.setStatus(false);
// 结束时间
@ -145,7 +145,7 @@ public class PxAdminController extends BaseController {
// 通知公告
SysNoticeRead sysNoticeRead = new SysNoticeRead();
sysNoticeRead.setCreateBy(SecurityUtils.getUserId().toString());
sysNoticeRead.setCreateBy(SecurityUtils.getUserId());
List<SysNotice> unreadNoticeList = noticeService.getUnreadNoticeList(sysNoticeRead);
result.put("notice", unreadNoticeList);

View File

@ -5,12 +5,21 @@ import com.pnkx.common.core.controller.BaseController;
import com.pnkx.common.core.domain.AjaxResult;
import com.pnkx.common.enums.OperatorType;
import com.pnkx.common.utils.ip.IpUtils;
import com.pnkx.domain.po.*;
import com.pnkx.domain.vo.PxArticleVo;
import com.pnkx.domain.vo.PxCardRecordVo;
import com.pnkx.service.*;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* 开放式接口Controller
@ -21,6 +30,32 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("/open")
public class OpenController extends BaseController {
@Resource
private IPxArticleService pxArticleService;
@Resource
private IPxBookKeepingAccountService pxBookkeepingAccountService;
@Resource
private IPxBookkeepingClassificationService pxBookkeepingClassificationService;
@Resource
private IPxBookkeepingRecordService pxBookkeepingRecordService;
@Resource
private IPxLoversCardService pxLoversCardService;
@Resource
private IPxCommemorationDayService pxCommemorationDayService;
@Resource
private IPxDiaryService pxDiaryService;
@Resource
private IPxFriendLinkService pxFriendLinkService;
@Resource
private IPxMessageService pxMessageService;
@Resource
private IPxMenstruationRecordService pxMenstruationRecordService;
@Resource
private IPxNoteService pxNoteService;
@Resource
private IPxToDoService pxToDoService;
@Resource
private IPxVisitsService pxVisitsService;
/**
* 获取ip
@ -31,4 +66,74 @@ public class OpenController extends BaseController {
public AjaxResult getIp(HttpServletRequest request) {
return AjaxResult.success("获取IP成功", IpUtils.getIpAddr(request));
}
@ApiOperation("获取指定业务数据")
@Log(title = "获取指定业务数据", operatorType = OperatorType.MANAGE)
@GetMapping("/getSpecifyBusinessData/{businessType}")
public AjaxResult getSpecifyBusinessData(@PathVariable("businessType")String businessType) {
if (businessType == null) {
return AjaxResult.error("业务类型不能为空!");
}
// 业务数据
List list = new ArrayList<>();
switch (businessType) {
case "article":
// 文章
list = pxArticleService.selectPxArticleList(new PxArticle());
break;
case "friend_link":
// 友链
list = pxFriendLinkService.selectPxFriendLinkList(new PxFriendLink());
break;
case "leave_message":
// 留言
list = pxMessageService.selectPxLeaveMessageList(new PxLeaveMessage());
break;
case "visits":
// 访客
list = pxVisitsService.selectPxVisitsList(new PxVisits());
break;
case "bookkeeping_account":
// 账本用户
list = pxBookkeepingAccountService.selectPxBookkeepingAccountList(new PxBookkeepingAccount());
break;
case "bookkeeping_classification":
// 账本分类
list = pxBookkeepingClassificationService.selectPxBookkeepingClassificationList(new PxBookkeepingClassification());
break;
case "bookkeeping_record":
// 账本记录
list = pxBookkeepingRecordService.selectPxBookkeepingRecordList(new PxBookkeepingRecord()).getRows();
break;
case "love_card":
// 情侣卡券
list = pxLoversCardService.selectPxLoversCardList(new PxLoversCard());
break;
case "card_record":
// 情侣卡券使用记录
list = pxLoversCardService.selectPxLoversCardRecordList(new PxCardRecordVo());
break;
case "commemoration_day":
// 纪念日
list = pxCommemorationDayService.selectPxCommemorationDayList(new PxCommemorationDay());
break;
case "diary":
// 日记
list = pxDiaryService.selectPxDiaryList(new PxDiary());
break;
case "menstruation_record":
// 姨妈助手记录
list = pxMenstruationRecordService.selectMenstruationRecordList(new PxMenstruationRecord());
break;
case "note":
// 笔记
list = pxNoteService.selectPxNoteList(new PxNote());
break;
case "to_do":
// 待办事项
list = pxToDoService.selectPxToDoList(new PxToDo());
break;
}
return AjaxResult.success("获取指定业务数据成功!", list);
}
}

View File

@ -66,8 +66,8 @@ public class PxToDoController extends BaseController {
@Log(title = "待办事项", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody PxToDo pxToDo) {
pxToDo.setCreateBy(SecurityUtils.getUserId().toString());
pxToDo.setPerformer(SecurityUtils.getUserId().toString());
pxToDo.setCreateBy(SecurityUtils.getUserId());
pxToDo.setPerformer(SecurityUtils.getUserId());
return toAjax(pxToDoService.insertPxToDo(pxToDo));
}

View File

@ -79,7 +79,7 @@ public class SysConfigController extends BaseController {
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(SecurityUtils.getUserId().toString());
config.setCreateBy(SecurityUtils.getUserId());
return toAjax(configService.insertConfig(config));
}

View File

@ -99,7 +99,7 @@ public class SysDeptController extends BaseController {
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
dept.setCreateBy(SecurityUtils.getUserId().toString());
dept.setCreateBy(SecurityUtils.getUserId());
return toAjax(deptService.insertDept(dept));
}

View File

@ -92,7 +92,7 @@ public class SysDictDataController extends BaseController {
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictData dict) {
dict.setCreateBy(SecurityUtils.getUserId().toString());
dict.setCreateBy(SecurityUtils.getUserId());
return toAjax(dictDataService.insertDictData(dict));
}

View File

@ -66,7 +66,7 @@ public class SysDictTypeController extends BaseController {
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(SecurityUtils.getUserId().toString());
dict.setCreateBy(SecurityUtils.getUserId());
return toAjax(dictTypeService.insertDictType(dict));
}

View File

@ -103,7 +103,7 @@ public class SysMenuController extends BaseController {
&& !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) {
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
menu.setCreateBy(SecurityUtils.getUserId().toString());
menu.setCreateBy(SecurityUtils.getUserId());
return toAjax(menuService.insertMenu(menu));
}

View File

@ -75,7 +75,7 @@ public class SysNoticeController extends BaseController {
@Log(title = "通知公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysNotice notice) {
notice.setCreateBy(SecurityUtils.getUserId().toString());
notice.setCreateBy(SecurityUtils.getUserId());
int sysNotice = noticeService.insertNotice(notice);
webSocketController.sendAllMessage(notice);
return toAjax(sysNotice);

View File

@ -71,7 +71,7 @@ public class SysPostController extends BaseController {
} else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setCreateBy(SecurityUtils.getUserId().toString());
post.setCreateBy(SecurityUtils.getUserId());
return toAjax(postService.insertPost(post));
}

View File

@ -83,7 +83,7 @@ public class SysRoleController extends BaseController {
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setCreateBy(SecurityUtils.getUserId().toString());
role.setCreateBy(SecurityUtils.getUserId());
return toAjax(roleService.insertRole(role));
}

View File

@ -112,7 +112,7 @@ public class SysUserController extends BaseController {
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setCreateBy(SecurityUtils.getUserId().toString());
user.setCreateBy(SecurityUtils.getUserId());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user));
}

View File

@ -79,7 +79,7 @@ public class PxArticleServiceImpl implements IPxArticleService {
*/
@Override
public List<PxArticleVo> selectPxArticleList(PxArticle pxArticle) {
pxArticle.setCreateBy(SecurityUtils.getUserId().toString());
pxArticle.setCreateBy(SecurityUtils.getUserId());
return pxArticleMapper.selectPxArticleList(pxArticle);
}
@ -92,7 +92,7 @@ public class PxArticleServiceImpl implements IPxArticleService {
@Override
public Integer insertPxArticle(PxArticleVo pxArticle) {
pxArticle.setCreateTime(DateUtils.getNowDate());
pxArticle.setCreateBy(SecurityUtils.getUserId().toString());
pxArticle.setCreateBy(SecurityUtils.getUserId());
pxArticleMapper.insertPxArticle(pxArticle);
return pxArticle.getId();
}

View File

@ -58,7 +58,7 @@ public class PxFriendLinkServiceImpl implements IPxFriendLinkService {
*/
@Override
public int insertPxFriendLink(PxFriendLink pxFriendLink) {
pxFriendLink.setCreateBy(SecurityUtils.getUserId().toString());
pxFriendLink.setCreateBy(SecurityUtils.getUserId());
pxFriendLink.setCreateTime(DateUtils.getNowDate());
return pxFriendLinkMapper.insertPxFriendLink(pxFriendLink);
}

View File

@ -49,7 +49,7 @@ public class PxLikeRecordServiceImpl implements IPxLikeRecordService {
if (StringUtils.isNotNull(record)) {
pxLikeRecordMapper.deletePxLikeRecordById(record.getId());
} else {
pxLikeRecord.setCreateBy(SecurityUtils.getUserId().toString());
pxLikeRecord.setCreateBy(SecurityUtils.getUserId());
pxLikeRecord.setCreateTime(DateUtils.getNowDate());
pxLikeRecordMapper.insertPxLikeRecord(pxLikeRecord);
}

View File

@ -46,7 +46,7 @@ public class PxMessageServiceImpl implements IPxMessageService {
*/
@Override
public Integer addMessage(PxLeaveMessage pxLeaveMessage) {
pxLeaveMessage.setCreateBy(SecurityUtils.getUserId().toString());
pxLeaveMessage.setCreateBy(SecurityUtils.getUserId());
pxLeaveMessage.setCreateTime(DateUtils.getNowDate());
pxLeaveMessage.setAvatar(SecurityUtils.getLoginUser().getUser().getAvatar());
Integer result = pxMessageMapper.addMessage(pxLeaveMessage);
@ -165,7 +165,7 @@ public class PxMessageServiceImpl implements IPxMessageService {
*/
@Override
public int updatePxLeaveMessage(PxLeaveMessage pxLeaveMessage) {
pxLeaveMessage.setUpdateBy(SecurityUtils.getUserId().toString());
pxLeaveMessage.setUpdateBy(SecurityUtils.getUserId());
pxLeaveMessage.setUpdateTime(DateUtils.getNowDate());
return pxMessageMapper.updatePxLeaveMessage(pxLeaveMessage);
}

View File

@ -64,7 +64,7 @@ public class PxPhotoServiceImpl implements IPxPhotoService {
@Override
public int insertPxPhoto(PxPhoto pxPhoto) {
pxPhoto.setCreateTime(DateUtils.getNowDate());
pxPhoto.setCreateBy(SecurityUtils.getUserId().toString());
pxPhoto.setCreateBy(SecurityUtils.getUserId());
return pxPhotoMapper.insertPxPhoto(pxPhoto);
}

View File

@ -54,7 +54,7 @@ public class PxVideoServiceImpl implements IPxVideoService {
@Override
public int insertPxVideo(PxVideo pxVideo) {
pxVideo.setCreateTime(DateUtils.getNowDate());
pxVideo.setCreateBy(SecurityUtils.getUserId().toString());
pxVideo.setCreateBy(SecurityUtils.getUserId());
return pxVideoMapper.insertPxVideo(pxVideo);
}

View File

@ -54,7 +54,7 @@ public class PxVisitsServiceImpl implements IPxVisitsService {
public int insertPxVisits(PxVisits pxVisits) {
pxVisits.setCreateTime(DateUtils.getNowDate());
try {
pxVisits.setCreateBy(SecurityUtils.getUserId().toString());
pxVisits.setCreateBy(SecurityUtils.getUserId());
} catch (Exception e) {
pxVisits.setCreateBy("游客");
}

View File

@ -1,5 +1,8 @@
package com.pnkx.common.utils;
import com.pnkx.common.core.controller.BaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@ -13,6 +16,9 @@ import com.pnkx.common.exception.CustomException;
* @author phy
*/
public class SecurityUtils {
protected static final Logger logger = LoggerFactory.getLogger(SecurityUtils.class);
/**
* 获取用户账户
**/
@ -27,12 +33,13 @@ public class SecurityUtils {
/**
* 获取用户userId
**/
public static Long getUserId() {
public static String getUserId() {
try {
return getLoginUser().getUser().getUserId();
return getLoginUser().getUser().getUserId().toString();
} catch (Exception e) {
throw new CustomException("获取用户userId异常", HttpStatus.UNAUTHORIZED);
logger.error("获取用户userId异常");
}
return "";
}
/**

View File

@ -60,12 +60,12 @@ public class PxBookkeepingAccountServiceImpl implements IPxBookKeepingAccountSer
@Override
public int insertPxBookkeepingAccount(PxBookkeepingAccount pxBookkeepingAccount) {
pxBookkeepingAccount.setCreateTime(DateUtils.getNowDate());
pxBookkeepingAccount.setCreateBy(SecurityUtils.getUserId().toString());
pxBookkeepingAccount.setCreateBy(SecurityUtils.getUserId());
int result = pxBookkeepingAccountMapper.insertPxBookkeepingAccount(pxBookkeepingAccount);
PxBookkeepingRecord pxBookkeepingRecord = new PxBookkeepingRecord();
pxBookkeepingRecord.setType(1L);
pxBookkeepingRecord.setCreateTime(DateUtils.getNowDate());
pxBookkeepingRecord.setCreateBy(SecurityUtils.getUserId().toString());
pxBookkeepingRecord.setCreateBy(SecurityUtils.getUserId());
pxBookkeepingRecord.setAccount(pxBookkeepingAccount.getId());
pxBookkeepingRecord.setMoney(pxBookkeepingAccount.getBalance());
pxBookkeepingRecord.setPayTime(DateUtils.getNowDate());
@ -83,13 +83,13 @@ public class PxBookkeepingAccountServiceImpl implements IPxBookKeepingAccountSer
@Override
public int updatePxBookkeepingAccount(PxBookkeepingAccount pxBookkeepingAccount) {
pxBookkeepingAccount.setUpdateTime(DateUtils.getNowDate());
pxBookkeepingAccount.setUpdateBy(SecurityUtils.getUserId().toString());
pxBookkeepingAccount.setUpdateBy(SecurityUtils.getUserId());
int result = pxBookkeepingAccountMapper.updatePxBookkeepingAccount(pxBookkeepingAccount);
PxBookkeepingAccount oldPxBookkeepingAccount = pxBookkeepingAccountMapper.selectPxBookkeepingAccountById(pxBookkeepingAccount.getId());
PxBookkeepingRecord pxBookkeepingRecord = new PxBookkeepingRecord();
pxBookkeepingRecord.setType(1L);
pxBookkeepingRecord.setCreateTime(DateUtils.getNowDate());
pxBookkeepingRecord.setCreateBy(SecurityUtils.getUserId().toString());
pxBookkeepingRecord.setCreateBy(SecurityUtils.getUserId());
pxBookkeepingRecord.setAccount(pxBookkeepingAccount.getId());
pxBookkeepingRecord.setMoney(String.valueOf(Float.parseFloat(pxBookkeepingAccount.getBalance()) - Float.parseFloat(oldPxBookkeepingAccount.getBalance())));
pxBookkeepingRecord.setPayTime(DateUtils.getNowDate());

View File

@ -50,7 +50,7 @@ public class PxBookkeepingClassificationServiceImpl implements IPxBookkeepingCla
@Override
public int insertPxBookkeepingClassification(PxBookkeepingClassification pxBookkeepingClassification) {
pxBookkeepingClassification.setCreateTime(DateUtils.getNowDate());
pxBookkeepingClassification.setCreateBy(SecurityUtils.getUserId().toString());
pxBookkeepingClassification.setCreateBy(SecurityUtils.getUserId());
return pxBookkeepingClassificationMapper.insertPxBookkeepingClassification(pxBookkeepingClassification);
}
@ -63,7 +63,7 @@ public class PxBookkeepingClassificationServiceImpl implements IPxBookkeepingCla
@Override
public int updatePxBookkeepingClassification(PxBookkeepingClassification pxBookkeepingClassification) {
pxBookkeepingClassification.setUpdateTime(DateUtils.getNowDate());
pxBookkeepingClassification.setUpdateBy(SecurityUtils.getUserId().toString());
pxBookkeepingClassification.setUpdateBy(SecurityUtils.getUserId());
return pxBookkeepingClassificationMapper.updatePxBookkeepingClassification(pxBookkeepingClassification);
}

View File

@ -55,7 +55,7 @@ public class PxBookkeepingRecordModelServiceImpl implements IPxBookkeepingRecord
@Override
public int insertPxBookkeepingRecordModel(PxBookkeepingRecordModel pxBookkeepingRecordModel) {
pxBookkeepingRecordModel.setCreateTime(DateUtils.getNowDate());
pxBookkeepingRecordModel.setCreateBy(SecurityUtils.getUserId().toString());
pxBookkeepingRecordModel.setCreateBy(SecurityUtils.getUserId());
return pxBookkeepingRecordModelMapper.insertPxBookkeepingRecordModel(pxBookkeepingRecordModel);
}
@ -68,7 +68,7 @@ public class PxBookkeepingRecordModelServiceImpl implements IPxBookkeepingRecord
@Override
public int updatePxBookkeepingRecordModel(PxBookkeepingRecordModel pxBookkeepingRecordModel) {
pxBookkeepingRecordModel.setUpdateTime(DateUtils.getNowDate());
pxBookkeepingRecordModel.setCreateBy(SecurityUtils.getUserId().toString());
pxBookkeepingRecordModel.setCreateBy(SecurityUtils.getUserId());
return pxBookkeepingRecordModelMapper.updatePxBookkeepingRecordModel(pxBookkeepingRecordModel);
}

View File

@ -46,7 +46,7 @@ public class PxBookkeepingRecordServiceImpl implements IPxBookkeepingRecordServi
@Override
public int insertPxBookkeepingRecord(PxBookkeepingRecord pxBookkeepingRecord) {
pxBookkeepingRecord.setCreateTime(DateUtils.getNowDate());
pxBookkeepingRecord.setCreateBy(SecurityUtils.getUserId().toString());
pxBookkeepingRecord.setCreateBy(SecurityUtils.getUserId());
return pxBookkeepingRecordMapper.insertPxBookkeepingRecord(pxBookkeepingRecord);
}
@ -76,7 +76,7 @@ public class PxBookkeepingRecordServiceImpl implements IPxBookkeepingRecordServi
@Override
public int updatePxBookkeepingRecord(PxBookkeepingRecord pxBookkeepingRecord) {
pxBookkeepingRecord.setUpdateTime(DateUtils.getNowDate());
pxBookkeepingRecord.setUpdateBy(SecurityUtils.getUserId().toString());
pxBookkeepingRecord.setUpdateBy(SecurityUtils.getUserId());
return pxBookkeepingRecordMapper.updatePxBookkeepingRecord(pxBookkeepingRecord);
}

View File

@ -86,7 +86,7 @@ public class PxLoversCardServiceImpl implements IPxLoversCardService {
@Override
public int insertPxLoversCard(PxLoversCard pxLoversCard) {
int result = pxLoversCardMapper.insertPxLoversCard(pxLoversCard);
pxLoversCard.setCreateBy(SecurityUtils.getUserId().toString());
pxLoversCard.setCreateBy(SecurityUtils.getUserId());
pxLoversCard.setCreateTime(DateUtils.getNowDate());
// 新增男关联
PxCardUser pxCardUserMan = new PxCardUser();
@ -157,7 +157,7 @@ public class PxLoversCardServiceImpl implements IPxLoversCardService {
@Override
public int useCard(PxCardRecord pxCardRecord) {
pxCardRecord.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
pxCardRecord.setCreateBy(SecurityUtils.getUserId().toString());
pxCardRecord.setCreateBy(SecurityUtils.getUserId());
pxCardRecord.setCreateTime(DateUtils.getNowDate());
pxCardRecordMapper.insertPxCardRecord(pxCardRecord);
return pxCardUserMapper.useCard(pxCardRecord);

View File

@ -42,7 +42,7 @@ public class PxMenstruationRecordServiceImpl implements IPxMenstruationRecordSer
*/
@Override
public List<PxMenstruationRecord> selectPxMenstruationRecordList(PxMenstruationRecord pxMenstruationRecord) {
pxMenstruationRecord.setUserId(SecurityUtils.getUserId());
pxMenstruationRecord.setUserId(Long.valueOf(SecurityUtils.getUserId()));
return pxMenstruationRecordMapper.selectPxMenstruationRecordList(pxMenstruationRecord);
}
@ -54,7 +54,7 @@ public class PxMenstruationRecordServiceImpl implements IPxMenstruationRecordSer
*/
@Override
public List<PxMenstruationRecord> getPxMenstruationRecordList(PxMenstruationRecord pxMenstruationRecord) {
pxMenstruationRecord.setUserId(SecurityUtils.getUserId());
pxMenstruationRecord.setUserId(Long.valueOf(SecurityUtils.getUserId()));
return pxMenstruationRecordMapper.getPxMenstruationRecordList(pxMenstruationRecord);
}
@ -67,7 +67,7 @@ public class PxMenstruationRecordServiceImpl implements IPxMenstruationRecordSer
@Override
public int insertPxMenstruationRecord(PxMenstruationRecord pxMenstruationRecord) {
pxMenstruationRecord.setCreateTime(DateUtils.getNowDate());
pxMenstruationRecord.setCreateBy(SecurityUtils.getUserId().toString());
pxMenstruationRecord.setCreateBy(SecurityUtils.getUserId());
return pxMenstruationRecordMapper.insertPxMenstruationRecord(pxMenstruationRecord);
}
@ -80,7 +80,7 @@ public class PxMenstruationRecordServiceImpl implements IPxMenstruationRecordSer
@Override
public int updatePxMenstruationRecord(PxMenstruationRecord pxMenstruationRecord) {
pxMenstruationRecord.setUpdateTime(DateUtils.getNowDate());
pxMenstruationRecord.setUpdateBy(SecurityUtils.getUserId().toString());
pxMenstruationRecord.setUpdateBy(SecurityUtils.getUserId());
return pxMenstruationRecordMapper.updatePxMenstruationRecord(pxMenstruationRecord);
}

View File

@ -70,9 +70,9 @@ public class PxNoteFolderServiceImpl implements IPxNoteFolderService {
@Override
public PxNoteFolder insertPxNoteFolder(PxNoteFolder pxNoteFolder) {
pxNoteFolder.setCreateTime(DateUtils.getNowDate());
pxNoteFolder.setCreateBy(SecurityUtils.getUserId().toString());
pxNoteFolder.setCreateBy(SecurityUtils.getUserId());
pxNoteFolder.setUpdateTime(DateUtils.getNowDate());
pxNoteFolder.setUpdateBy(SecurityUtils.getUserId().toString());
pxNoteFolder.setUpdateBy(SecurityUtils.getUserId());
pxNoteFolderMapper.insertPxNoteFolder(pxNoteFolder);
return pxNoteFolder;
}
@ -86,7 +86,7 @@ public class PxNoteFolderServiceImpl implements IPxNoteFolderService {
@Override
public PxNoteFolder updatePxNoteFolder(PxNoteFolder pxNoteFolder) {
pxNoteFolder.setUpdateTime(DateUtils.getNowDate());
pxNoteFolder.setUpdateBy(SecurityUtils.getUserId().toString());
pxNoteFolder.setUpdateBy(SecurityUtils.getUserId());
pxNoteFolderMapper.updatePxNoteFolder(pxNoteFolder);
return pxNoteFolder;
}

View File

@ -55,9 +55,9 @@ public class PxNoteServiceImpl implements IPxNoteService {
@Override
public PxNote insertPxNote(PxNote pxNote) {
pxNote.setCreateTime(DateUtils.getNowDate());
pxNote.setCreateBy(SecurityUtils.getUserId().toString());
pxNote.setCreateBy(SecurityUtils.getUserId());
pxNote.setUpdateTime(DateUtils.getNowDate());
pxNote.setUpdateBy(SecurityUtils.getUserId().toString());
pxNote.setUpdateBy(SecurityUtils.getUserId());
pxNoteMapper.insertPxNote(pxNote);
return pxNote;
}
@ -71,7 +71,7 @@ public class PxNoteServiceImpl implements IPxNoteService {
@Override
public PxNote updatePxNote(PxNote pxNote) {
pxNote.setUpdateTime(DateUtils.getNowDate());
pxNote.setUpdateBy(SecurityUtils.getUserId().toString());
pxNote.setUpdateBy(SecurityUtils.getUserId());
pxNoteMapper.updatePxNote(pxNote);
return pxNote;
}

View File

@ -73,7 +73,7 @@ public class SysJobController extends BaseController {
if (!CronUtils.isValid(sysJob.getCronExpression())) {
return AjaxResult.error("cron表达式不正确");
}
sysJob.setCreateBy(SecurityUtils.getUserId().toString());
sysJob.setCreateBy(SecurityUtils.getUserId());
return toAjax(jobService.insertJob(sysJob));
}

View File

@ -64,7 +64,7 @@ public class SysAppServiceImpl implements ISysAppService {
@Override
public int insertAppUpdateLog(SysAppUpdateLog appUpdateLog) {
appUpdateLog.setCreateTime(DateUtils.getNowDate());
appUpdateLog.setCreateBy(SecurityUtils.getUserId().toString());
appUpdateLog.setCreateBy(SecurityUtils.getUserId());
return sysAppMapper.insertAppUpdateLog(appUpdateLog);
}
@ -77,7 +77,7 @@ public class SysAppServiceImpl implements ISysAppService {
@Override
public int updateAppUpdateLog(SysAppUpdateLog appUpdateLog) {
appUpdateLog.setUpdateTime(DateUtils.getNowDate());
appUpdateLog.setUpdateBy(SecurityUtils.getUserId().toString());
appUpdateLog.setUpdateBy(SecurityUtils.getUserId());
return sysAppMapper.updateAppUpdateLog(appUpdateLog);
}

View File

@ -195,7 +195,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
{
SysDictData sysDictData = new SysDictData();
sysDictData.setDictType(dictType);
sysDictData.setCreateBy(SecurityUtils.getUserId().toString());
sysDictData.setCreateBy(SecurityUtils.getUserId());
return dictDataMapper.selectDictTypeByLogin(sysDictData);
}
}

View File

@ -103,7 +103,7 @@ public class SysFileServiceImpl implements ISysFileService {
*/
@Override
public int insertSysFile(SysFile sysFile) {
sysFile.setCreateBy(SecurityUtils.getUserId().toString());
sysFile.setCreateBy(SecurityUtils.getUserId());
sysFile.setCreateTime(DateUtils.getNowDate());
return sysFileMapper.insertSysFile(sysFile);
}

View File

@ -41,7 +41,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
SysNoticeRead sysNoticeRead = new SysNoticeRead();
sysNoticeRead.setNoticeId(noticeId);
try {
sysNoticeRead.setCreateBy(SecurityUtils.getUserId().toString());
sysNoticeRead.setCreateBy(SecurityUtils.getUserId());
} catch (Exception e) {
sysNoticeRead.setCreateBy(null);
}