lyhzzz 1 vuosi sitten
vanhempi
commit
a1945511a8

+ 32 - 3
src/main/java/com/fdkankan/manage/service/impl/RtkInfoServiceImpl.java

@@ -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());
     }
     }
 }
 }

+ 22 - 0
src/main/java/com/fdkankan/manage/vo/request/RtkInfoParam.java

@@ -1,11 +1,33 @@
 package com.fdkankan.manage.vo.request;
 package com.fdkankan.manage.vo.request;
 
 
+import com.fdkankan.manage.util.DateUtils;
 import lombok.Data;
 import lombok.Data;
 
 
+import java.util.List;
+
 @Data
 @Data
 public class RtkInfoParam extends RequestBase{
 public class RtkInfoParam extends RequestBase{
     private String rtkSnCode;
     private String rtkSnCode;
     private String userName;
     private String userName;
     private String createTime;
     private String createTime;
     private String operator;
     private String operator;
+
+    private List<String> timeList;
+
+    private String startTime;
+    private String endTime;
+
+    public String getStartTime() {
+        if(timeList != null && timeList.size() >1){
+            return DateUtils.getStartTime(timeList.get(0));
+        }
+        return DateUtils.getStartTime(startTime);
+    }
+
+    public String getEndTime() {
+        if(timeList != null && timeList.size() >1){
+            return DateUtils.getEndTime(timeList.get(1));
+        }
+        return DateUtils.getEndTime(endTime);
+    }
 }
 }