|
|
|
@ -1,8 +1,12 @@ |
|
|
|
|
package com.dxhy.core.controller.mailGather; |
|
|
|
|
|
|
|
|
|
import com.dxhy.common.constant.DbConstant; |
|
|
|
|
import com.dxhy.common.controller.AbstractController; |
|
|
|
|
import com.dxhy.common.datasource.config.DynamicContextHolder; |
|
|
|
|
import com.dxhy.common.utils.R; |
|
|
|
|
import com.dxhy.core.service.mailGather.MailGatherLogService; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
@ -10,6 +14,9 @@ import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.text.ParseException; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -18,6 +25,7 @@ import java.util.Map; |
|
|
|
|
* @author makejava |
|
|
|
|
* @since 2023-03-23 08:42:35 |
|
|
|
|
*/ |
|
|
|
|
@Slf4j |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("/mailGatherLog") |
|
|
|
|
public class MailGatherLogController extends AbstractController { |
|
|
|
@ -26,6 +34,7 @@ public class MailGatherLogController extends AbstractController { |
|
|
|
|
*/ |
|
|
|
|
@Resource |
|
|
|
|
private MailGatherLogService mailGatherLogService; |
|
|
|
|
final SimpleDateFormat sf2 = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页查询 |
|
|
|
@ -46,6 +55,26 @@ public class MailGatherLogController extends AbstractController { |
|
|
|
|
if (pramsMap.get("parseEnd") == null || "".equals(pramsMap.get("parseEnd"))) { |
|
|
|
|
return ResponseEntity.ok(R.error("结束日期不能为空!")); |
|
|
|
|
} |
|
|
|
|
Object parseStart = pramsMap.get("parseStart"); |
|
|
|
|
Object parseEnd = pramsMap.get("parseEnd"); |
|
|
|
|
if (parseEnd == null || parseEnd == null) { |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
try { |
|
|
|
|
Date starttime = sf2.parse(String.valueOf(parseStart)); |
|
|
|
|
Date endtime = sf2.parse(String.valueOf(parseEnd)); |
|
|
|
|
if (starttime.after(endtime)) { |
|
|
|
|
return ResponseEntity.ok(R.error("开始时间不能大于结束时间")); |
|
|
|
|
} |
|
|
|
|
pramsMap.put("startTime", starttime); |
|
|
|
|
pramsMap.put("endTime", endtime); |
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
String loginname = getUserInfo().getLoginname(); |
|
|
|
|
pramsMap.put("createUser",loginname); |
|
|
|
|
DynamicContextHolder.push(DbConstant.BASICS_READ); |
|
|
|
|
return ResponseEntity.ok(R.ok().put("data",this.mailGatherLogService.queryByPage(pramsMap))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|