feat: 首页-最新入库标准/最新入库企标
This commit is contained in:
+3
-16
@@ -1,21 +1,16 @@
|
|||||||
package com.jero.modules.activiti.process.common.enums;
|
package com.jero.modules.activiti.process.common.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: Mzaxd
|
* @author: Mzaxd
|
||||||
* @Date: 2023/11/20 14:50
|
* @Date: 2023/11/20 14:50
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
public enum StandardStateEnum {
|
public enum StandardStateEnum {
|
||||||
|
|
||||||
DRAFT("草稿","1"),
|
|
||||||
SEEK_FOR_OPINIONS("征求意见","2"),
|
|
||||||
EXAMINE("审查","3"),
|
|
||||||
APPROVAL("报批","4"),
|
|
||||||
PRE_RELEASE("预发布","5"),
|
|
||||||
RELEASE("发布","6"),
|
|
||||||
TRIAL_OPERATION("试运行","7"),
|
|
||||||
CURRENTLY_EFFECTIVE("现行有效","8"),
|
CURRENTLY_EFFECTIVE("现行有效","8"),
|
||||||
ABOLISH("废止","9"),
|
ABOLISH("废止","9"),
|
||||||
ARCHIVE("封存","A"),
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String stateName;
|
private final String stateName;
|
||||||
@@ -27,12 +22,4 @@ public enum StandardStateEnum {
|
|||||||
this.stateValue = stateValue;
|
this.stateValue = stateValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStateName() {
|
|
||||||
return stateName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStateValue() {
|
|
||||||
return stateValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -336,8 +336,7 @@ public class ActFlowCommonService {
|
|||||||
LawsEnterpriseStandard es = esService.getById(standardId);
|
LawsEnterpriseStandard es = esService.getById(standardId);
|
||||||
if (es != null) {
|
if (es != null) {
|
||||||
String standardState = es.getStandardState();
|
String standardState = es.getStandardState();
|
||||||
if (StandardStateEnum.ABOLISH.getStateValue().equals(standardState) ||
|
if (StandardStateEnum.ABOLISH.getStateValue().equals(standardState)) {
|
||||||
StandardStateEnum.ARCHIVE.getStateValue().equals(standardState)) {
|
|
||||||
log.error("企标编号为{}的企标已经废止或者封存,无法进行复审流程", es.getStandardNumber());
|
log.error("企标编号为{}的企标已经废止或者封存,无法进行复审流程", es.getStandardNumber());
|
||||||
throw new JeroBootException(ResultCommon.CAN_NOT_EDIT_ABOLISH_OR_ARCHIVE_ES);
|
throw new JeroBootException(ResultCommon.CAN_NOT_EDIT_ABOLISH_OR_ARCHIVE_ES);
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-43
@@ -1,17 +1,15 @@
|
|||||||
package com.jero.modules.laws.localTool.controller;
|
package com.jero.modules.laws.localTool.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.modules.laws.localTool.entity.StandardEarlyWarning;
|
|
||||||
import com.jero.modules.laws.localTool.service.ILawsStandardEarlyWarningService;
|
import com.jero.modules.laws.localTool.service.ILawsStandardEarlyWarningService;
|
||||||
import com.jero.modules.laws.standard.entity.LawsNewsFeed;
|
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 com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -36,52 +34,27 @@ public class LawsStandardEarlyWarningController {
|
|||||||
@Resource
|
@Resource
|
||||||
private ILawsEnterpriseStandardService esService;
|
private ILawsEnterpriseStandardService esService;
|
||||||
|
|
||||||
@AutoLog(value = "标准预警-新车型实施预警")
|
@AutoLog(value = "标准预警-最新入库标准")
|
||||||
@ApiOperation(value = "标准预警-新车型实施预警", notes = "标准预警-新车型实施预警")
|
@ApiOperation(value = "标准预警-最新入库标准", notes = "标准预警-最新入库标准")
|
||||||
@GetMapping(value = "/newModelImplementation")
|
@GetMapping(value = "/newAddStandard")
|
||||||
@RequiresPermissions("standardWarning:search")
|
public Result<IPage<LawsDomesticStandard>> newAddStandard(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
public Result<IPage<StandardEarlyWarning>> newModelImplementation(StandardEarlyWarning standardEarlyWarning,
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
IPage<LawsDomesticStandard> pageList = lawsStandardEarlyWarningService.newAddStandard(pageNo, pageSize);
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
||||||
IPage<StandardEarlyWarning> pageList = lawsStandardEarlyWarningService.newModelImplementation(standardEarlyWarning, pageNo, pageSize);
|
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AutoLog(value = "标准预警-在产车实施预警")
|
@AutoLog(value = "标准预警-最新入库企标")
|
||||||
@ApiOperation(value = "标准预警-在产车实施预警", notes = "标准预警-在产车实施预警")
|
@ApiOperation(value = "标准预警-最新入库企标", notes = "标准预警-最新入库企标")
|
||||||
@GetMapping(value = "/onTheProduction")
|
@GetMapping(value = "/newAddEsStandard")
|
||||||
@RequiresPermissions("standardWarning:search")
|
public Result<IPage<LawsEnterpriseStandard>> newAddEsStandard(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
public Result<IPage<StandardEarlyWarning>> onTheProduction(StandardEarlyWarning standardEarlyWarning,
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
IPage<LawsEnterpriseStandard> pageList = lawsStandardEarlyWarningService.newAddEsStandard(pageNo, pageSize);
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
||||||
IPage<StandardEarlyWarning> pageList = lawsStandardEarlyWarningService.onTheProduction(standardEarlyWarning, pageNo, pageSize);
|
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "标准预警-将实施标准")
|
||||||
/**
|
@ApiOperation(value = "标准预警-将实施标准", notes = "标准预警-将实施标准")
|
||||||
* 标准预警-企标发布预警
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "标准预警-企标发布预警")
|
|
||||||
@ApiOperation(value = "标准预警-企标发布预警", notes = "标准预警-企标发布预警")
|
|
||||||
@GetMapping(value = "/latestReleaseEs")
|
|
||||||
@RequiresPermissions("standardWarning:search")
|
|
||||||
public Result<?> latestReleaseEs(@RequestParam(name="pageNo", defaultValue="1") @ApiParam("页码") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") @ApiParam("页面显示数量") Integer pageSize) {
|
|
||||||
return Result.OK(esService.latestReleaseEs(pageNo, pageSize));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标准预警-企标实施预警
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "标准预警-企标实施预警")
|
|
||||||
@ApiOperation(value = "标准预警-企标实施预警", notes = "标准预警-企标实施预警")
|
|
||||||
@GetMapping(value = "/latestImplementEs")
|
@GetMapping(value = "/latestImplementEs")
|
||||||
@RequiresPermissions("standardWarning:search")
|
|
||||||
public Result<?> latestImplementEs(@RequestParam(name="pageNo", defaultValue="1") @ApiParam("页码") Integer pageNo,
|
public Result<?> latestImplementEs(@RequestParam(name="pageNo", defaultValue="1") @ApiParam("页码") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") @ApiParam("页面显示数量") Integer pageSize) {
|
@RequestParam(name="pageSize", defaultValue="10") @ApiParam("页面显示数量") Integer pageSize) {
|
||||||
return Result.OK(esService.latestImplementEs(pageNo, pageSize));
|
return Result.OK(esService.latestImplementEs(pageNo, pageSize));
|
||||||
|
|||||||
+21
-16
@@ -1,8 +1,5 @@
|
|||||||
package com.jero.modules.laws.localTool.entity;
|
package com.jero.modules.laws.localTool.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.jero.common.aspect.annotation.Dict;
|
import com.jero.common.aspect.annotation.Dict;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
@@ -41,11 +38,6 @@ public class StandardEarlyWarning {
|
|||||||
@ApiModelProperty(value = "标准号/标准名称")
|
@ApiModelProperty(value = "标准号/标准名称")
|
||||||
private java.lang.String standardNumberOrName;
|
private java.lang.String standardNumberOrName;
|
||||||
|
|
||||||
/**责任部门*/
|
|
||||||
@Excel(name = "责任部门", width = 15)
|
|
||||||
@ApiModelProperty(value = "责任部门")
|
|
||||||
private java.lang.String responsibleDepartment;
|
|
||||||
|
|
||||||
/**标准编号*/
|
/**标准编号*/
|
||||||
@Excel(name = "标准编号", width = 15)
|
@Excel(name = "标准编号", width = 15)
|
||||||
@ApiModelProperty(value = "标准编号")
|
@ApiModelProperty(value = "标准编号")
|
||||||
@@ -56,14 +48,26 @@ public class StandardEarlyWarning {
|
|||||||
@ApiModelProperty(value = "标准名称")
|
@ApiModelProperty(value = "标准名称")
|
||||||
private java.lang.String standardName;
|
private java.lang.String standardName;
|
||||||
|
|
||||||
/**在产车实施日期*/
|
/**外部标准状态*/
|
||||||
@Excel(name = "在产车实施日期", width = 15)
|
@ApiModelProperty(value = "外部标准状态")
|
||||||
@ApiModelProperty(value = "在产车实施日期")
|
private java.lang.String standardState;
|
||||||
private java.lang.String onTheProductionDate;
|
|
||||||
/**新车型实施日期*/
|
/**企标状态*/
|
||||||
@Excel(name = "新车型实施日期", width = 15)
|
@Excel(name = "企标状态", width = 15)
|
||||||
@ApiModelProperty(value = "新车型实施日期")
|
@ApiModelProperty(value = "企标状态")
|
||||||
private java.lang.String newModelImplementationDate;
|
private java.lang.String esStandardState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新认证车实施日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "新认证车实施日期")
|
||||||
|
private java.lang.String newAuthImplDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新生产车实施日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "新生产车实施日期")
|
||||||
|
private java.lang.String newProductImplDate;
|
||||||
|
|
||||||
/**当前天前一周*/
|
/**当前天前一周*/
|
||||||
private List<String> dayStrings;
|
private List<String> dayStrings;
|
||||||
@@ -73,6 +77,7 @@ public class StandardEarlyWarning {
|
|||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "查询时间开始")
|
@ApiModelProperty(value = "查询时间开始")
|
||||||
private java.util.Date startDate;
|
private java.util.Date startDate;
|
||||||
|
|
||||||
/**查询时间结束*/
|
/**查询时间结束*/
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
|||||||
+6
-15
@@ -1,7 +1,8 @@
|
|||||||
package com.jero.modules.laws.localTool.service;
|
package com.jero.modules.laws.localTool.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.jero.modules.laws.localTool.entity.StandardEarlyWarning;
|
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||||
|
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: liao
|
* @Author: liao
|
||||||
@@ -10,24 +11,14 @@ import com.jero.modules.laws.localTool.entity.StandardEarlyWarning;
|
|||||||
*/
|
*/
|
||||||
public interface ILawsStandardEarlyWarningService {
|
public interface ILawsStandardEarlyWarningService {
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/31 10:30
|
|
||||||
* @Description: 新车型实施预警
|
|
||||||
**/
|
|
||||||
IPage<StandardEarlyWarning> newModelImplementation(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/31 13:32
|
|
||||||
* @Description: 在产车实施预警
|
|
||||||
**/
|
|
||||||
IPage<StandardEarlyWarning> onTheProduction(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: liao
|
* @Author: liao
|
||||||
* @Date: 2023/11/10 17:13
|
* @Date: 2023/11/10 17:13
|
||||||
* @Description: 定时发送消息
|
* @Description: 定时发送消息
|
||||||
**/
|
**/
|
||||||
void sendMsg();
|
void sendMsg();
|
||||||
|
|
||||||
|
IPage<LawsDomesticStandard> newAddStandard(Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
|
IPage<LawsEnterpriseStandard> newAddEsStandard(Integer pageNo, Integer pageSize);
|
||||||
}
|
}
|
||||||
|
|||||||
+87
-131
@@ -4,26 +4,21 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.jero.common.api.SendMessageAPI;
|
import com.jero.common.api.SendMessageAPI;
|
||||||
import com.jero.common.api.dto.message.SendMessageDTO;
|
import com.jero.modules.activiti.process.common.enums.StandardStateEnum;
|
||||||
import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon;
|
|
||||||
import com.jero.modules.laws.common.util.DateUtil;
|
|
||||||
import com.jero.modules.laws.localTool.entity.LawsEarlyWarningMessage;
|
|
||||||
import com.jero.modules.laws.localTool.entity.StandardEarlyWarning;
|
import com.jero.modules.laws.localTool.entity.StandardEarlyWarning;
|
||||||
import com.jero.modules.laws.localTool.mapper.LawsStandardEarlyWarningMapper;
|
|
||||||
import com.jero.modules.laws.localTool.service.ILawsEarlyWarningMessageService;
|
|
||||||
import com.jero.modules.laws.localTool.service.ILawsStandardEarlyWarningService;
|
import com.jero.modules.laws.localTool.service.ILawsStandardEarlyWarningService;
|
||||||
import com.jero.modules.system.entity.SysUserDepart;
|
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 com.jero.modules.system.service.ISysUserDepartService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: liao
|
* @Author: liao
|
||||||
@@ -34,55 +29,14 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWarningService {
|
public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWarningService {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private LawsStandardEarlyWarningMapper lawsStandardEarlyWarningMapper;
|
|
||||||
@Resource
|
|
||||||
private ILawsStandardEarlyWarningService lawsStandardEarlyWarningService;
|
|
||||||
@Resource
|
@Resource
|
||||||
private ISysUserDepartService userDepartService;
|
private ISysUserDepartService userDepartService;
|
||||||
@Resource
|
@Resource
|
||||||
private SendMessageAPI sendMessageAPI;
|
private SendMessageAPI sendMessageAPI;
|
||||||
@Resource
|
@Resource
|
||||||
private ILawsEarlyWarningMessageService lawsEarlyWarningMessageService;
|
private ILawsDomesticStandardService domesticStandardService;
|
||||||
|
@Resource
|
||||||
/**
|
private ILawsEnterpriseStandardService enterpriseStandardService;
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/31 10:30
|
|
||||||
* @Description: 新车型实施预警
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public IPage<StandardEarlyWarning> newModelImplementation(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize) {
|
|
||||||
standardEarlyWarning.setNewModelImplementationDate("A");
|
|
||||||
IPage<StandardEarlyWarning> pageList = pageList(standardEarlyWarning, pageNo, pageSize);
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/31 13:32
|
|
||||||
* @Description: 在产车实施预警
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public IPage<StandardEarlyWarning> onTheProduction(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize) {
|
|
||||||
standardEarlyWarning.setOnTheProductionDate("A");
|
|
||||||
IPage<StandardEarlyWarning> pageList = pageList(standardEarlyWarning, pageNo, pageSize);
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/31 14:08
|
|
||||||
* @Description: 标准预警通用分页查询
|
|
||||||
**/
|
|
||||||
private IPage<StandardEarlyWarning> pageList(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize) {
|
|
||||||
// 获取当前日前一月的日期字符串集合
|
|
||||||
List<String> dayStrings = DateUtil.getHalfYearAsString();
|
|
||||||
log.info("标准预警:当前半年的日期为{}", StringUtils.join(dayStrings, ","));
|
|
||||||
standardEarlyWarning.setDayStrings(dayStrings);
|
|
||||||
Page<StandardEarlyWarning> page = new Page<>(pageNo, pageSize);
|
|
||||||
IPage<StandardEarlyWarning> pageList = lawsStandardEarlyWarningMapper.pageList(page, standardEarlyWarning);
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: liao
|
* @Author: liao
|
||||||
@@ -91,21 +45,43 @@ public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWa
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void sendMsg() {
|
public void sendMsg() {
|
||||||
StandardEarlyWarning newModelImplementation = new StandardEarlyWarning();
|
// StandardEarlyWarning newModelImplementation = new StandardEarlyWarning();
|
||||||
IPage<StandardEarlyWarning> newPage = lawsStandardEarlyWarningService.newModelImplementation(newModelImplementation, -1, -1);
|
// IPage<StandardEarlyWarning> newPage = lawsStandardEarlyWarningService.newModelImplementation(newModelImplementation, -1, -1);
|
||||||
List<StandardEarlyWarning> newList = newPage.getRecords();
|
// List<StandardEarlyWarning> newList = newPage.getRecords();
|
||||||
StandardEarlyWarning onTheProduction = new StandardEarlyWarning();
|
// StandardEarlyWarning onTheProduction = new StandardEarlyWarning();
|
||||||
IPage<StandardEarlyWarning> onPage = lawsStandardEarlyWarningService.onTheProduction(onTheProduction, -1, -1);
|
// IPage<StandardEarlyWarning> onPage = lawsStandardEarlyWarningService.onTheProduction(onTheProduction, -1, -1);
|
||||||
List<StandardEarlyWarning> onList = onPage.getRecords();
|
// List<StandardEarlyWarning> onList = onPage.getRecords();
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
// 新车型实施日期
|
// // 新车型实施日期
|
||||||
if (CollectionUtils.isNotEmpty(newList)) {
|
// if (CollectionUtils.isNotEmpty(newList)) {
|
||||||
sendMsgList(MessageTemplateCodeCommon.NEW_MODEL_IMPLEMENTATION, newList, true);
|
// sendMsgList(MessageTemplateCodeCommon.NEW_MODEL_IMPLEMENTATION, newList, true);
|
||||||
}
|
// }
|
||||||
// 在产车实施日期
|
// // 在产车实施日期
|
||||||
if (CollectionUtils.isNotEmpty(onList)) {
|
// if (CollectionUtils.isNotEmpty(onList)) {
|
||||||
sendMsgList(MessageTemplateCodeCommon.ON_THE_PRODUCTION, onList, false);
|
// sendMsgList(MessageTemplateCodeCommon.ON_THE_PRODUCTION, onList, false);
|
||||||
}
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<LawsDomesticStandard> newAddStandard(Integer pageNo, Integer pageSize) {
|
||||||
|
// 获取当前日期往前90天以内创建的外部标准
|
||||||
|
LambdaQueryWrapper<LawsDomesticStandard> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.ne(LawsDomesticStandard::getStandardState, OutStandardStateEnum.ABOLISH.getStateValue());
|
||||||
|
queryWrapper.between(LawsDomesticStandard::getCreateTime, LocalDate.now().minusDays(90), LocalDate.now());
|
||||||
|
queryWrapper.orderByDesc(LawsDomesticStandard::getCreateTime);
|
||||||
|
IPage<LawsDomesticStandard> page = new Page<>(pageNo, pageSize);
|
||||||
|
return domesticStandardService.page(page, queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<LawsEnterpriseStandard> newAddEsStandard(Integer pageNo, Integer pageSize) {
|
||||||
|
// 获取当前日期往前90天以内创建的外部标准
|
||||||
|
LambdaQueryWrapper<LawsEnterpriseStandard> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.ne(LawsEnterpriseStandard::getStandardState, StandardStateEnum.ABOLISH.getStateValue());
|
||||||
|
queryWrapper.between(LawsEnterpriseStandard::getCreateTime, LocalDate.now().minusDays(90), LocalDate.now());
|
||||||
|
queryWrapper.orderByDesc(LawsEnterpriseStandard::getCreateTime);
|
||||||
|
IPage<LawsEnterpriseStandard> page = new Page<>(pageNo, pageSize);
|
||||||
|
return enterpriseStandardService.page(page, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,65 +90,45 @@ public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWa
|
|||||||
* @Description: 发送消息
|
* @Description: 发送消息
|
||||||
**/
|
**/
|
||||||
private void sendMsgList(String templateCode, List<StandardEarlyWarning> distinctList, Boolean flag) {
|
private void sendMsgList(String templateCode, List<StandardEarlyWarning> distinctList, Boolean flag) {
|
||||||
distinctList.forEach(data -> {
|
// distinctList.forEach(data -> {
|
||||||
String departId = data.getResponsibleDepartment();
|
// String departId = data.getResponsibleDepartment();
|
||||||
List<SysUserDepart> userDepartList = new ArrayList<>();
|
// List<SysUserDepart> userDepartList = new ArrayList<>();
|
||||||
if (StringUtils.isNotBlank(departId)) {
|
// if (StringUtils.isNotBlank(departId)) {
|
||||||
LambdaQueryWrapper<SysUserDepart> queryWrapper = new LambdaQueryWrapper<>();
|
// LambdaQueryWrapper<SysUserDepart> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(SysUserDepart::getDepId, Arrays.asList(departId.split(",")));
|
// queryWrapper.in(SysUserDepart::getDepId, Arrays.asList(departId.split(",")));
|
||||||
userDepartList = userDepartService.list(queryWrapper);
|
// userDepartList = userDepartService.list(queryWrapper);
|
||||||
}
|
// }
|
||||||
if (CollectionUtils.isNotEmpty(userDepartList)) {
|
// if (CollectionUtils.isNotEmpty(userDepartList)) {
|
||||||
// 每个部门需要发消息的用户id集合
|
// // 每个部门需要发消息的用户id集合
|
||||||
List<String> userIdList = userDepartList.stream().map(SysUserDepart::getUserId).collect(Collectors.toList());
|
// List<String> userIdList = userDepartList.stream().map(SysUserDepart::getUserId).collect(Collectors.toList());
|
||||||
String userIds = StringUtils.join(userIdList, ",");
|
// String userIds = StringUtils.join(userIdList, ",");
|
||||||
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
// SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||||
sendMessageDTO.setTemplateCode(templateCode);
|
// sendMessageDTO.setTemplateCode(templateCode);
|
||||||
sendMessageDTO.setToUserId(userIds);
|
// sendMessageDTO.setToUserId(userIds);
|
||||||
Map<String, String> map = new HashMap<>();
|
// Map<String, String> map = new HashMap<>();
|
||||||
String standardNumber = data.getStandardNumber();
|
// String standardNumber = data.getStandardNumber();
|
||||||
map.put("standardNumber", standardNumber);
|
// map.put("standardNumber", standardNumber);
|
||||||
map.put("standardName", data.getStandardName());
|
// map.put("standardName", data.getStandardName());
|
||||||
String dateDay;
|
// String dateDay;
|
||||||
if (flag) { // 新车型实施日期
|
// if (flag) { // 新车型实施日期
|
||||||
dateDay = data.getNewModelImplementationDate();
|
// dateDay = data.getNewModelImplementationDate();
|
||||||
if (isNotExist(standardNumber, dateDay, "1")) {
|
// if (isNotExist(standardNumber, dateDay, "1")) {
|
||||||
map.put("days", dateDay);
|
// map.put("days", dateDay);
|
||||||
sendMessageDTO.setMap(map);
|
// sendMessageDTO.setMap(map);
|
||||||
sendMessageAPI.sendMessage(sendMessageDTO);
|
// sendMessageAPI.sendMessage(sendMessageDTO);
|
||||||
saveWarningMessage(standardNumber, dateDay, "1");
|
// saveWarningMessage(standardNumber, dateDay, "1");
|
||||||
}
|
// }
|
||||||
} else { // 在产车实施日期
|
// } else { // 在产车实施日期
|
||||||
dateDay = data.getOnTheProductionDate();
|
// dateDay = data.getOnTheProductionDate();
|
||||||
if (isNotExist(standardNumber, dateDay, "2")) {
|
// if (isNotExist(standardNumber, dateDay, "2")) {
|
||||||
map.put("days", dateDay);
|
// map.put("days", dateDay);
|
||||||
sendMessageDTO.setMap(map);
|
// sendMessageDTO.setMap(map);
|
||||||
sendMessageAPI.sendMessage(sendMessageDTO);
|
// sendMessageAPI.sendMessage(sendMessageDTO);
|
||||||
saveWarningMessage(standardNumber, dateDay, "2");
|
// saveWarningMessage(standardNumber, dateDay, "2");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
|
||||||
|
|
||||||
private Boolean isNotExist(String standardNumber, String dateDay, String type) {
|
|
||||||
LambdaQueryWrapper<LawsEarlyWarningMessage> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(LawsEarlyWarningMessage::getStandardNumber, standardNumber)
|
|
||||||
.eq(LawsEarlyWarningMessage::getWarningDay, dateDay)
|
|
||||||
.eq(LawsEarlyWarningMessage::getWarningType, type);
|
|
||||||
LawsEarlyWarningMessage lawsEarlyWarningMessage = lawsEarlyWarningMessageService.getOne(queryWrapper, false);
|
|
||||||
if (lawsEarlyWarningMessage == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void saveWarningMessage(String standardNumber, String dateDay, String type) {
|
|
||||||
LawsEarlyWarningMessage lawsEarlyWarningMessage = new LawsEarlyWarningMessage();
|
|
||||||
lawsEarlyWarningMessage.setStandardNumber(standardNumber);
|
|
||||||
lawsEarlyWarningMessage.setWarningDay(dateDay);
|
|
||||||
lawsEarlyWarningMessage.setWarningType(type);
|
|
||||||
lawsEarlyWarningMessageService.save(lawsEarlyWarningMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -2,6 +2,7 @@ package com.jero.modules.laws.standard.entity;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.jero.common.aspect.annotation.Dict;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -115,6 +116,7 @@ public class LawsDomesticStandard implements Serializable {
|
|||||||
/**标准状态*/
|
/**标准状态*/
|
||||||
@Excel(name = "标准状态", width = 15)
|
@Excel(name = "标准状态", width = 15)
|
||||||
@ApiModelProperty(value = "标准状态")
|
@ApiModelProperty(value = "标准状态")
|
||||||
|
@Dict(dicCode = "standard_state")
|
||||||
private java.lang.String standardState;
|
private java.lang.String standardState;
|
||||||
/**责任人*/
|
/**责任人*/
|
||||||
@Excel(name = "责任人", width = 15)
|
@Excel(name = "责任人", width = 15)
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ public class UpdateStandardStatusJob implements Job {
|
|||||||
esWrapper.eq(LawsEnterpriseStandard::getDelFlag, YesOrNoEnum.NO.getInteger());
|
esWrapper.eq(LawsEnterpriseStandard::getDelFlag, YesOrNoEnum.NO.getInteger());
|
||||||
esWrapper.isNotNull(LawsEnterpriseStandard::getReleaseDate);
|
esWrapper.isNotNull(LawsEnterpriseStandard::getReleaseDate);
|
||||||
esWrapper.isNotNull(LawsEnterpriseStandard::getImplementationDate);
|
esWrapper.isNotNull(LawsEnterpriseStandard::getImplementationDate);
|
||||||
esWrapper.eq(LawsEnterpriseStandard::getStandardState, StandardStateEnum.RELEASE.getStateValue());
|
esWrapper.eq(LawsEnterpriseStandard::getStandardState, StandardStateEnum.CURRENTLY_EFFECTIVE.getStateValue());
|
||||||
List<LawsEnterpriseStandard> esList = esService.list(esWrapper);
|
List<LawsEnterpriseStandard> esList = esService.list(esWrapper);
|
||||||
for (LawsEnterpriseStandard es : esList) {
|
for (LawsEnterpriseStandard es : esList) {
|
||||||
// 实施日期及之后的标准 状态更新为现行有效
|
// 实施日期及之后的标准 状态更新为现行有效
|
||||||
|
|||||||
Reference in New Issue
Block a user