feat: 首页-将实施标准

This commit is contained in:
2024-07-22 11:09:33 +08:00
parent 028ef757a9
commit 642a26d22b
3 changed files with 20 additions and 16 deletions
@@ -6,7 +6,6 @@ import com.jero.common.aspect.annotation.AutoLog;
import com.jero.modules.laws.localTool.service.ILawsStandardEarlyWarningService;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -16,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Author: liao
* @Date: 2023/10/31 9:46
@@ -31,9 +28,6 @@ public class LawsStandardEarlyWarningController {
@Autowired
private ILawsStandardEarlyWarningService lawsStandardEarlyWarningService;
@Resource
private ILawsEnterpriseStandardService esService;
@AutoLog(value = "标准预警-最新入库标准")
@ApiOperation(value = "标准预警-最新入库标准", notes = "标准预警-最新入库标准")
@GetMapping(value = "/newAddStandard")
@@ -54,10 +48,10 @@ public class LawsStandardEarlyWarningController {
@AutoLog(value = "标准预警-将实施标准")
@ApiOperation(value = "标准预警-将实施标准", notes = "标准预警-将实施标准")
@GetMapping(value = "/latestImplementEs")
public Result<?> latestImplementEs(@RequestParam(name="pageNo", defaultValue="1") @ApiParam("页码") Integer pageNo,
@GetMapping(value = "/latestImplement")
public Result<IPage<LawsDomesticStandard>> latestImplementEs(@RequestParam(name="pageNo", defaultValue="1") @ApiParam("页码") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") @ApiParam("页面显示数量") Integer pageSize) {
return Result.OK(esService.latestImplementEs(pageNo, pageSize));
return Result.OK(lawsStandardEarlyWarningService.latestImplementStandard(pageNo, pageSize));
}
}
@@ -21,4 +21,6 @@ public interface ILawsStandardEarlyWarningService {
IPage<LawsDomesticStandard> newAddStandard(Integer pageNo, Integer pageSize);
IPage<LawsEnterpriseStandard> newAddEsStandard(Integer pageNo, Integer pageSize);
IPage<LawsDomesticStandard> latestImplementStandard(Integer pageNo, Integer pageSize);
}
@@ -3,16 +3,15 @@ package com.jero.modules.laws.localTool.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.SendMessageAPI;
import com.jero.modules.activiti.process.common.enums.StandardStateEnum;
import com.jero.modules.laws.localTool.entity.StandardEarlyWarning;
import com.jero.modules.laws.localTool.mapper.LawsStandardEarlyWarningMapper;
import com.jero.modules.laws.localTool.service.ILawsStandardEarlyWarningService;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
import com.jero.modules.laws.standard.entity.OutStandardStateEnum;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.system.service.ISysUserDepartService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -29,14 +28,12 @@ import java.util.List;
@Slf4j
public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWarningService {
@Resource
private ISysUserDepartService userDepartService;
@Resource
private SendMessageAPI sendMessageAPI;
@Resource
private ILawsDomesticStandardService domesticStandardService;
@Resource
private ILawsEnterpriseStandardService enterpriseStandardService;
@Resource
private LawsStandardEarlyWarningMapper lawsStandardEarlyWarningMapper;
/**
* @Author: liao
@@ -75,7 +72,7 @@ public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWa
@Override
public IPage<LawsEnterpriseStandard> newAddEsStandard(Integer pageNo, Integer pageSize) {
// 获取当前日期往前90天以内创建的外部标准
// 获取当前日期往前90天以内创建的企业标准
LambdaQueryWrapper<LawsEnterpriseStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.ne(LawsEnterpriseStandard::getStandardState, StandardStateEnum.ABOLISH.getStateValue());
queryWrapper.between(LawsEnterpriseStandard::getCreateTime, LocalDate.now().minusDays(90), LocalDate.now());
@@ -84,6 +81,17 @@ public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWa
return enterpriseStandardService.page(page, queryWrapper);
}
@Override
public IPage<LawsDomesticStandard> latestImplementStandard(Integer pageNo, Integer pageSize) {
// 获取当前日期往后180天以内实施的外部标准
LambdaQueryWrapper<LawsDomesticStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.ne(LawsDomesticStandard::getStandardState, OutStandardStateEnum.ABOLISH.getStateValue());
queryWrapper.between(LawsDomesticStandard::getImplementationDate, LocalDate.now(), LocalDate.now().plusDays(180));
queryWrapper.orderByAsc(LawsDomesticStandard::getImplementationDate);
IPage<LawsDomesticStandard> page = new Page<>(pageNo, pageSize);
return domesticStandardService.page(page, queryWrapper);
}
/**
* @Author: liao
* @Date: 2023/11/10 17:39