fix 81419 专项项目库-标准状态没有回显

This commit is contained in:
lijiarao
2024-02-01 11:28:00 +08:00
parent c34cc2ebb7
commit d97dbd0d12
6 changed files with 145 additions and 22 deletions
@@ -236,21 +236,24 @@ public class LawsAssessController extends JeroController<LawsAssess, ILawsAssess
@GetMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LawsAssess lawsAssess, HttpServletResponse response) {
//获取数据
List<LawsAssess> dos = null;
String selections = request.getParameter("selections");
if (StringUtils.isNotBlank(selections)) {
dos = lawsAssessService.listByIds(Arrays.asList(selections.split(",")));
} else {
lawsAssess.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
QueryWrapper<LawsAssess> queryWrapper = QueryGenerator.initQueryWrapper(lawsAssess, request.getParameterMap());
dos = lawsAssessService.list(queryWrapper);
}
lawsAssess.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
QueryWrapper<LawsAssess> queryWrapper = QueryGenerator.initQueryWrapper(lawsAssess, request.getParameterMap());
List<LawsAssess> dos = lawsAssessService.list(queryWrapper);
if (dos.isEmpty()) {
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
}
lawsAssessService.assignment(dos);
List<LawsAssess> exportList;
String selections = request.getParameter("selections");
if (StringUtils.isNotBlank(selections)) {
List<String> selectionList = Arrays.asList(selections.split(","));
exportList = dos.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
}else {
exportList = dos;
}
lawsAssessService.assignment(exportList);
String title = "法规清单";
return super.exportListXls(dos, LawsAssess.class, title);
return super.exportListXls(exportList, LawsAssess.class, title);
}
}
@@ -3,6 +3,7 @@ package com.jero.modules.projectLibrary.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import com.jero.common.api.vo.Result;
import com.jero.common.api.vo.ResultCommon;
@@ -153,7 +154,17 @@ public class LawsSpecialProjectLibraryController extends JeroController<LawsSpec
@ApiOperation(value="专项项目库-导出")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LawsSpecialProjectLibrary lawsSpecialProjectLibrary) {
return super.exportXls(request, lawsSpecialProjectLibrary, LawsSpecialProjectLibrary.class, "专项项目库");
IPage<LawsSpecialProjectLibrary> pageList = lawsSpecialProjectLibraryService.queryPage(lawsSpecialProjectLibrary, -1, -1, request);
List<LawsSpecialProjectLibrary> records = pageList.getRecords();
List<LawsSpecialProjectLibrary> exportList;
String selections = request.getParameter("selections");
if (StringUtils.isNotBlank(selections)) {
List<String> selectionList = Arrays.asList(selections.split(","));
exportList = records.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
}else {
exportList = records;
}
return super.exportListXls(exportList, LawsSpecialProjectLibrary.class, "专项项目库");
}
}
@@ -2,7 +2,10 @@ package com.jero.modules.projectLibrary.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jero.common.aspect.annotation.Dict;
@@ -80,10 +83,10 @@ public class LawsSpecialProjectLibrary implements Serializable {
/**标准类型(1-国内、2-海外、3-企标)*/
@ApiModelProperty(value = "标准类型(1-国内、2-海外、3-企标)")
private String standardType;
/**标准状态(1-草案、2-征求意见稿、3-送审稿、4-报批稿、5-发布稿、5-修改单)*/
@Dict(dicCode = "decomposition_order_source")
@Excel(name = "标准状态", width = 15, dicCode = "decomposition_order_source")
@ApiModelProperty(value = "标准状态(1-草案、2-征求意见稿、3-送审稿、4-报批稿、5-发布稿、5-修改单)")
/**标准状态*/
@Excel(name = "标准状态", width = 15, dicCode = "standard_state")
@ApiModelProperty(value = "标准状态")
@Dict(dicCode = "standard_state")
private String standardState;
/**车型系列*/
@Excel(name = "车型系列", width = 15, dicCode = "model_series")
@@ -129,5 +132,12 @@ public class LawsSpecialProjectLibrary implements Serializable {
/**流程关联条款id*/
@ApiModelProperty(value = "流程关联条款id")
private String processTermId;
/**排序字段*/
@ApiModelProperty(value = "排序字段")
private String column;
/**排序方式*/
@ApiModelProperty(value = "排序方式")
private String order;
}
@@ -1,7 +1,7 @@
package com.jero.modules.projectLibrary.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.projectLibrary.entity.LawsSpecialProjectLibrary;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface LawsSpecialProjectLibraryMapper extends BaseMapper<LawsSpecialProjectLibrary> {
Page<LawsSpecialProjectLibrary> pageList(Page<LawsSpecialProjectLibrary> page,@Param("obj") LawsSpecialProjectLibrary lawsSpecialProjectLibrary);
}
@@ -25,5 +25,82 @@
<result column="work_number" property="workNumber" />
<result column="project_name" property="projectName" />
<result column="process_num" property="processNum" />
<result column="model_series" property="modelSeries"/>
<result column="process_term_id" property="processTermId"/>
</resultMap>
<select id="pageList" resultMap="LawsSpecialProjectLibraryResultMap">
select lspl.id,
lspl.create_by,
lspl.create_time,
lspl.update_by,
lspl.update_time,
lspl.org_code,
lspl.`source`,
lspl.standard_number,
lspl.standard_name,
lspl.standard_id,
lspl.term_number,
lspl.term_name,
lspl.standard_type,
case
when lspl.`source` = 1
then lds.standard_state
when lspl.`source` = 2
then los.standard_state
end as standard_state,
lspl.model_series,
lspl.`result`,
lspl.description,
lspl.material,
lspl.valuation_time,
lspl.project_approval,
lspl.work_number,
lspl.project_name,
lspl.process_num,
lspl.process_term_id
from laws_special_project_library lspl
left join laws_domestic_standard lds on lspl.standard_id = lds.id
left join laws_overseas_standard los on lspl.standard_id = los.id
<where>
<if test="obj.source != null">
lspl.`source` = #{obj.source}
</if>
<if test="obj.projectName != null">
and lspl.project_name like concat('%', #{obj.projectName}, '%')
</if>
<if test="obj.modelSeries != null and obj.modelSeries != ''">
and lspl.model_series REGEXP (#{obj.modelSeries})
</if>
<if test="obj.standardState != null">
and (
lds.standard_state = #{obj.standardState}
or
los.standard_state = #{obj.standardState}
)
</if>
<if test="obj.result != null">
and lspl.`result` = #{obj.result}
</if>
<if test="obj.projectApproval != null">
and lspl.project_approval = #{obj.projectApproval}
</if>
</where>
order by
<choose>
<when test="obj.column != null and obj.column == 'standardNumber'">
lspl.standard_number<!--@sql ,-->
</when>
<when test="obj.column != null and obj.column == 'valuationTime'">
lspl.valuation_time<!--@sql ,-->
</when>
<otherwise>
lspl.create_time
</otherwise>
</choose>
<if test="obj.order != null and obj.order == 'desc'">
desc
</if>
</select>
</mapper>
@@ -1,16 +1,28 @@
package com.jero.modules.projectLibrary.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.constant.CommonConstant;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.projectLibrary.entity.LawsSpecialProjectLibrary;
import com.jero.modules.projectLibrary.mapper.LawsSpecialProjectLibraryMapper;
import com.jero.modules.projectLibrary.service.ILawsSpecialProjectLibraryService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jero.common.exception.JeroBootException;
import java.util.Arrays;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.system.query.QueryGenerator;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -25,7 +37,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Service
@Transactional(rollbackFor = JeroBootException.class)
public class LawsSpecialProjectLibraryServiceImpl extends ServiceImpl<LawsSpecialProjectLibraryMapper, LawsSpecialProjectLibrary> implements ILawsSpecialProjectLibraryService {
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Resource
private LawsSpecialProjectLibraryMapper specialProjectLibraryMapper;
/**
* 分页查询
@@ -39,9 +56,13 @@ public class LawsSpecialProjectLibraryServiceImpl extends ServiceImpl<LawsSpecia
@Override
public IPage<LawsSpecialProjectLibrary> queryPage(LawsSpecialProjectLibrary lawsSpecialProjectLibrary, Integer pageNo, Integer pageSize,
HttpServletRequest req) {
QueryWrapper<LawsSpecialProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsSpecialProjectLibrary, req.getParameterMap());
Page<LawsSpecialProjectLibrary> page = new Page<>(pageNo, pageSize);
return page(page, queryWrapper);
String modelSeries = lawsSpecialProjectLibrary.getModelSeries();
if (StringUtils.isNotBlank(modelSeries)){
lawsSpecialProjectLibrary.setModelSeries(Strings.join(Arrays.asList(modelSeries.split(",")),'|'));
}
Page<LawsSpecialProjectLibrary> page = new Page<>(pageNo, pageSize);
Page<LawsSpecialProjectLibrary> pageList = specialProjectLibraryMapper.pageList(page, lawsSpecialProjectLibrary);
return pageList;
}
/**