Browse Source

Merge branch 'dev' into pre-production

master
zhenghaoyu 11 months ago
parent
commit
2b3383158d
  1. 52
      blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyExportVO.java
  2. 2
      blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyVO.java
  3. 14
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/ClassifyController.java
  4. 3
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/ClassifyMapper.java
  5. 38
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/ClassifyMapper.xml
  6. 2
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java
  7. 62
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java

52
blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyExportVO.java

@ -0,0 +1,52 @@
package com.logpm.supervise.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class ClassifyExportVO implements Serializable {
@ExcelIgnore
private Long id;
@ExcelIgnore
private Long createUser;
@ExcelIgnore
private Long createDept;
@ExcelProperty(value = "创建时间")
private Date createTime;
@ExcelIgnore
private Long updateUser;
@ExcelProperty(value = "指标名称")
private String name;
@ExcelProperty(value = "指标描述")
private String description;
@ExcelProperty(value = "指标备注")
private String remark;
@ExcelIgnore
private Long pId;
@ExcelProperty(value = "考核范围")
private String examineDeptName;
@ExcelProperty(value = "指标分类")
private String parentClassifyName;
@ExcelProperty(value = "考核归属部门")
private String createDeptName;
@ExcelProperty(value = "考核分值")
private String pointStr;
}

2
blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyVO.java

@ -44,4 +44,6 @@ public class ClassifyVO extends ClassifyEntity {
private Integer isEdit;
private String pointStr;
}

14
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/ClassifyController.java

@ -21,6 +21,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.supervise.dto.ClassifyDTO;
import com.logpm.supervise.entity.ClassifyEntity;
import com.logpm.supervise.service.IClassifyService;
import com.logpm.supervise.vo.ClassifyExportVO;
import com.logpm.supervise.vo.ClassifyVO;
import com.logpm.supervise.wrapper.ClassifyWrapper;
import io.swagger.annotations.Api;
@ -30,15 +31,19 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -80,6 +85,15 @@ public class ClassifyController extends BladeController {
}
@GetMapping("/export-list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "导出列表", notes = "传入classify")
public void exportlist(@ApiIgnore @RequestParam Map<String, Object> classify, HttpServletResponse response) {
List<ClassifyExportVO> list = classifyService.exportList(classify);
ExcelUtil.export(response,"指标管理"+ DateUtil.time(),"指标管理",list,ClassifyExportVO.class);
}
/**
* 分类指标表 新增
*/

3
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/ClassifyMapper.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.supervise.dto.ClassifyDTO;
import com.logpm.supervise.entity.ClassifyEntity;
import com.logpm.supervise.vo.ClassifyExportVO;
import com.logpm.supervise.vo.ClassifyVO;
import com.logpm.supervise.vo.api.ClassifyApiVO;
import org.apache.ibatis.annotations.Mapper;
@ -27,4 +28,6 @@ public interface ClassifyMapper extends BaseMapper<ClassifyEntity> {
* @return
*/
List<ClassifyApiVO> selectAllClassifyList(@Param("pid") Long pid,@Param("list")List<Long> list);
List<ClassifyExportVO> exportList(@Param("param") ClassifyDTO classifyDTO);
}

38
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/ClassifyMapper.xml

@ -75,4 +75,42 @@
</foreach>
</if>
</select>
<select id="exportList" resultType="com.logpm.supervise.vo.ClassifyExportVO">
select id id,
create_user createUser,
create_dept createDept,
create_time createTime,
update_user updateUser,
`name` name,
description description,
remark remark,
p_id pId,
examine_dept_name examineDeptName
from sup_classify
<where>
and is_deleted = 0
<if test="param.isPid != null and param.isPid ==1 ">
and p_id = 0
</if>
<if test="param.isPid != null and param.isPid ==0 ">
and p_id != 0
</if>
<if test="param.pId != null">
and p_id = #{param.pId}
</if>
<if test="param.name != null and param.name != ''">
and `name` like concat('%',#{param.name},'%')
</if>
<if test="param.createDept != null ">
and create_dept = #{param.createDept}
</if>
<if test="param.examineDeptName != null and param.examineDeptName != ''">
and examine_dept_name = #{param.examineDeptName}
</if>
</where>
order by create_time desc
</select>
</mapper>

2
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.supervise.dto.ClassifyDTO;
import com.logpm.supervise.dto.IndicatorsDTO;
import com.logpm.supervise.entity.ClassifyEntity;
import com.logpm.supervise.vo.ClassifyExportVO;
import com.logpm.supervise.vo.ClassifyVO;
import com.logpm.supervise.vo.IndicatorsVO;
import com.logpm.supervise.vo.api.ClassifyApiVO;
@ -104,4 +105,5 @@ public interface IClassifyService extends BaseService<ClassifyEntity> {
R importClassify(MultipartFile file) throws IOException;
List<ClassifyExportVO> exportList(Map<String, Object> classify);
}

62
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java

@ -36,6 +36,7 @@ import com.logpm.supervise.service.IClassifyService;
import com.logpm.supervise.service.IIndicatorsAnnexService;
import com.logpm.supervise.service.IIndicatorsService;
import com.logpm.supervise.service.IPointsService;
import com.logpm.supervise.vo.ClassifyExportVO;
import com.logpm.supervise.vo.ClassifyVO;
import com.logpm.supervise.vo.IndicatorsVO;
import com.logpm.supervise.vo.api.BeIndicatorsVO;
@ -45,7 +46,6 @@ import com.logpm.supervise.wrapper.IndicatorsWrapper;
import com.logpm.supervise.wrapper.PointsWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -145,6 +145,15 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
queryWrapper.eq("classify_id", classifyId)
.eq("is_deleted", 0);
List<PointsEntity> list = pointsService.list(queryWrapper);
String pointStr = "";
for (PointsEntity pointsEntity : list) {
if(StringUtil.isBlank(pointStr)){
pointStr = pointStr + pointsEntity.getPoint();
}else{
pointStr = pointStr + "," + pointsEntity.getPoint();
}
}
record.setPointStr(pointStr);
record.setPointsEntities(list);
}
}
@ -592,6 +601,57 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
return R.success("导入成功");
}
@Override
public List<ClassifyExportVO> exportList(Map<String, Object> classify) {
String pId = (String) classify.get("pid");
String name = (String) classify.get("name");
String isPid = (String) classify.get("isPid");
String createDeptName = (String) classify.get("createDeptName");
String examineDeptName = (String) classify.get("examineDeptName");
ClassifyDTO classifyDTO = new ClassifyDTO();
if (StringUtil.isNotBlank(pId)) {
classifyDTO.setPId(Long.parseLong(pId));
}
Long createDept = deptClient.findIdByName(createDeptName);
classifyDTO.setName(name);
classifyDTO.setIsPid(Integer.parseInt(isPid));
classifyDTO.setCreateDept(createDept);
classifyDTO.setExamineDeptName(examineDeptName);
List<ClassifyExportVO> records = baseMapper.exportList(classifyDTO);
for (ClassifyExportVO record : records) {
Long deptId = record.getCreateDept();
String deptName = deptClient.findNameById(deptId);
record.setCreateDeptName(deptName);
if (!"1".equals(isPid)) {
Long classifyId = record.getId();
Long pId1 = record.getPId();
ClassifyEntity classifyEntity = getById(pId1);
record.setParentClassifyName(classifyEntity.getName());
QueryWrapper<PointsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("classify_id", classifyId)
.eq("is_deleted", 0);
List<PointsEntity> list = pointsService.list(queryWrapper);
String pointStr = "";
for (PointsEntity pointsEntity : list) {
if(StringUtil.isBlank(pointStr)){
pointStr = pointStr + pointsEntity.getPoint();
}else{
pointStr = pointStr + "," + pointsEntity.getPoint();
}
}
record.setPointStr(pointStr);
}
}
return records;
}
private List<ClassifyApiVO> getClassifyList(Long pid,String exAdminDeptId) {
List<Long> list = null;
if (Func.isNotEmpty(exAdminDeptId)){

Loading…
Cancel
Save