update 标准预警
This commit is contained in:
+1
@@ -75,6 +75,7 @@ public class LawsDataCenterFile implements Serializable {
|
|||||||
@Excel(name = "上传资料(文件id)", width = 15)
|
@Excel(name = "上传资料(文件id)", width = 15)
|
||||||
@ApiModelProperty(value = "上传资料(文件id,上传时多个用逗号分隔)")
|
@ApiModelProperty(value = "上传资料(文件id,上传时多个用逗号分隔)")
|
||||||
@NotBlank(message = "上传资料不能为空")
|
@NotBlank(message = "上传资料不能为空")
|
||||||
|
@Dict(dictTable = "oss_file", dicCode = "id", dicText = "file_name")
|
||||||
private java.lang.String fileId;
|
private java.lang.String fileId;
|
||||||
/**推送范围(用户id逗号拼接)*/
|
/**推送范围(用户id逗号拼接)*/
|
||||||
@Excel(name = "推送范围(用户id逗号拼接)", width = 15)
|
@Excel(name = "推送范围(用户id逗号拼接)", width = 15)
|
||||||
|
|||||||
+1
-17
@@ -156,24 +156,8 @@ public class LawsDataCenterFileServiceImpl extends ServiceImpl<LawsDataCenterFil
|
|||||||
if (StringUtils.isBlank(lawsDataCenterFile.getFileId())) {
|
if (StringUtils.isBlank(lawsDataCenterFile.getFileId())) {
|
||||||
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "fileId");
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "fileId");
|
||||||
}
|
}
|
||||||
List<String> fileIds = Arrays.asList(lawsDataCenterFile.getFileId().split(","));
|
|
||||||
if (1 == fileIds.size()) {
|
|
||||||
updateById(lawsDataCenterFile);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 删除原来存储的
|
|
||||||
removeById(lawsDataCenterFile.getId());
|
|
||||||
|
|
||||||
List<LawsDataCenterFile> fileList = new ArrayList();
|
updateById(lawsDataCenterFile);
|
||||||
fileIds.forEach(fileId -> {
|
|
||||||
LawsDataCenterFile file = new LawsDataCenterFile();
|
|
||||||
BeanUtils.copyProperties(lawsDataCenterFile, file);
|
|
||||||
file.setFileId(fileId);
|
|
||||||
file.setId(null);
|
|
||||||
fileList.add(file);
|
|
||||||
});
|
|
||||||
|
|
||||||
saveBatch(fileList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.laws.localTool.entity;
|
package com.jero.modules.laws.localTool.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
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;
|
||||||
|
|||||||
+2
@@ -39,11 +39,13 @@
|
|||||||
) AS standard
|
) AS standard
|
||||||
WHERE
|
WHERE
|
||||||
<if test="param.newModelImplementationDate != null and param.newModelImplementationDate != ''">
|
<if test="param.newModelImplementationDate != null and param.newModelImplementationDate != ''">
|
||||||
|
standard.new_model_implementation_date IS NOT NULL AND
|
||||||
<foreach collection="param.dayStrings" separator=" or " open="(" close=")" item="item">
|
<foreach collection="param.dayStrings" separator=" or " open="(" close=")" item="item">
|
||||||
standard.new_model_implementation_date LIKE CONCAT('%', #{item}, '%')
|
standard.new_model_implementation_date LIKE CONCAT('%', #{item}, '%')
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="param.onTheProductionDate != null and param.onTheProductionDate != ''">
|
<if test="param.onTheProductionDate != null and param.onTheProductionDate != ''">
|
||||||
|
standard.on_the_production_date IS NOT NULL AND
|
||||||
<foreach collection="param.dayStrings" separator=" or " open="(" close=")" item="item">
|
<foreach collection="param.dayStrings" separator=" or " open="(" close=")" item="item">
|
||||||
standard.on_the_production_date LIKE CONCAT('%', #{item}, '%')
|
standard.on_the_production_date LIKE CONCAT('%', #{item}, '%')
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
+31
-6
@@ -6,9 +6,12 @@ import com.jero.modules.laws.common.util.DateUtil;
|
|||||||
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.mapper.LawsStandardEarlyWarningMapper;
|
||||||
import com.jero.modules.laws.localTool.service.ILawsStandardEarlyWarningService;
|
import com.jero.modules.laws.localTool.service.ILawsStandardEarlyWarningService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,6 +20,7 @@ import java.util.List;
|
|||||||
* @Description: 标准预警
|
* @Description: 标准预警
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWarningService {
|
public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWarningService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -29,12 +33,8 @@ public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWa
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public IPage<StandardEarlyWarning> newModelImplementation(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize) {
|
public IPage<StandardEarlyWarning> newModelImplementation(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize) {
|
||||||
// 获取当前日前一周的日期字符串集合
|
|
||||||
List<String> dayStrings = DateUtil.getLastWeekDateAsString();
|
|
||||||
standardEarlyWarning.setDayStrings(dayStrings);
|
|
||||||
standardEarlyWarning.setNewModelImplementationDate("A");
|
standardEarlyWarning.setNewModelImplementationDate("A");
|
||||||
Page<StandardEarlyWarning> page = new Page<>(pageNo, pageSize);
|
IPage<StandardEarlyWarning> pageList = pageList(standardEarlyWarning, pageNo, pageSize);
|
||||||
IPage<StandardEarlyWarning> pageList = lawsStandardEarlyWarningMapper.pageList(page, standardEarlyWarning);
|
|
||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,12 +45,37 @@ public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWa
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public IPage<StandardEarlyWarning> onTheProduction(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize) {
|
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.getLastWeekDateAsString();
|
List<String> dayStrings = DateUtil.getLastWeekDateAsString();
|
||||||
|
log.info("标准预警:当前一周的日期为{}", StringUtils.join(dayStrings, ","));
|
||||||
standardEarlyWarning.setDayStrings(dayStrings);
|
standardEarlyWarning.setDayStrings(dayStrings);
|
||||||
standardEarlyWarning.setOnTheProductionDate("A");
|
|
||||||
Page<StandardEarlyWarning> page = new Page<>(pageNo, pageSize);
|
Page<StandardEarlyWarning> page = new Page<>(pageNo, pageSize);
|
||||||
IPage<StandardEarlyWarning> pageList = lawsStandardEarlyWarningMapper.pageList(page, standardEarlyWarning);
|
IPage<StandardEarlyWarning> pageList = lawsStandardEarlyWarningMapper.pageList(page, standardEarlyWarning);
|
||||||
|
pageList.getRecords().forEach(warning -> {
|
||||||
|
// 新车型实施日期
|
||||||
|
if (StringUtils.isNotBlank(standardEarlyWarning.getNewModelImplementationDate())) {
|
||||||
|
List<String> eStrings = Arrays.asList(warning.getNewModelImplementationDate().split(","));
|
||||||
|
eStrings.retainAll(dayStrings); // 删除eStrings中与dayStrings不相同的元素
|
||||||
|
warning.setNewModelImplementationDate(eStrings.get(0));
|
||||||
|
}
|
||||||
|
// 在产车实施日期
|
||||||
|
if (StringUtils.isNotBlank(standardEarlyWarning.getOnTheProductionDate())) {
|
||||||
|
List<String> eStrings = Arrays.asList(warning.getOnTheProductionDate().split(","));
|
||||||
|
eStrings.retainAll(dayStrings); // 删除eStrings中与dayStrings不相同的元素
|
||||||
|
warning.setOnTheProductionDate(eStrings.get(0));
|
||||||
|
}
|
||||||
|
});
|
||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user