|
@@ -1,11 +1,17 @@
|
|
package com.fdkankan.manage.service.impl;
|
|
package com.fdkankan.manage.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.fdkankan.manage.common.PageInfo;
|
|
|
|
+import com.fdkankan.manage.common.ResultCode;
|
|
|
|
+import com.fdkankan.manage.entity.AgentAudit;
|
|
import com.fdkankan.manage.entity.RtkInfo;
|
|
import com.fdkankan.manage.entity.RtkInfo;
|
|
|
|
+import com.fdkankan.manage.exception.BusinessException;
|
|
import com.fdkankan.manage.mapper.IRtkInfoMapper;
|
|
import com.fdkankan.manage.mapper.IRtkInfoMapper;
|
|
import com.fdkankan.manage.service.IRtkInfoService;
|
|
import com.fdkankan.manage.service.IRtkInfoService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.fdkankan.manage.vo.request.RtkInfoParam;
|
|
import com.fdkankan.manage.vo.request.RtkInfoParam;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -28,16 +34,39 @@ public class RtkInfoServiceImpl extends ServiceImpl<IRtkInfoMapper, RtkInfo> imp
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Object pageList(RtkInfoParam param) {
|
|
public Object pageList(RtkInfoParam param) {
|
|
- return null;
|
|
|
|
|
|
+ LambdaQueryWrapper<RtkInfo> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ if(StringUtils.isNotBlank(param.getRtkSnCode())){
|
|
|
|
+ wrapper.like(RtkInfo::getRtkSnCode,param.getRtkSnCode());
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(param.getUserName())){
|
|
|
|
+ wrapper.like(RtkInfo::getUserName,param.getUserName());
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(param.getOperator())){
|
|
|
|
+ wrapper.like(RtkInfo::getOperator,param.getOperator());
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(param.getStartTime())&& StringUtils.isNotBlank(param.getEndTime()) ) {
|
|
|
|
+ wrapper.between(RtkInfo::getCreateTime,param.getStartTime(),param.getEndTime());
|
|
|
|
+ }
|
|
|
|
+ wrapper.orderByDesc(RtkInfo::getCreateTime);
|
|
|
|
+ wrapper.orderByDesc(RtkInfo::getId);
|
|
|
|
+ Page<RtkInfo> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
|
|
|
|
+ return PageInfo.PageInfo(page);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void saveOrEdit(RtkInfo rtkInfo) {
|
|
public void saveOrEdit(RtkInfo rtkInfo) {
|
|
-
|
|
|
|
|
|
+ this.saveOrUpdate(rtkInfo);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void del(RtkInfo rtkInfo) {
|
|
public void del(RtkInfo rtkInfo) {
|
|
-
|
|
|
|
|
|
+ if(rtkInfo.getId() == null){
|
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
|
+ }
|
|
|
|
+ RtkInfo rtkInfo1 = this.getById(rtkInfo.getId());
|
|
|
|
+ if(rtkInfo1 == null){
|
|
|
|
+ throw new BusinessException(ResultCode.RECOED_NO_EXITS);
|
|
|
|
+ }
|
|
|
|
+ this.removeById(rtkInfo.getId());
|
|
}
|
|
}
|
|
}
|
|
}
|