Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev-pushdata-important
汤建军 1 year ago
parent
commit
78132af739
  1. 4
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/ClassifyController.java
  2. 29
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/IndicatorsController.java
  3. 3
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/ClassifyMapper.java
  4. 2
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/ClassifyMapper.xml
  5. 4
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsAnnexMapper.xml
  6. 5
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml
  7. 4
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java
  8. 1
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IIndicatorsService.java
  9. 18
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java
  10. 7
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java

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

@ -74,8 +74,8 @@ public class ClassifyController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入classify")
public R<IPage<ClassifyVO>> list(@ApiIgnore @RequestParam Map<String, Object> classify, Query query) {
IPage<ClassifyEntity> pages = classifyService.pageList(Condition.getPage(query), classify);
return R.data(ClassifyWrapper.build().pageVO(pages));
IPage<ClassifyVO> pages = classifyService.pageList(Condition.getPage(query), classify);
return R.data(pages);
}

29
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/IndicatorsController.java

@ -19,8 +19,8 @@ import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/classify")
@Api(value = "分类指标表", tags = "指标接口")
@RequestMapping("/indicators")
@Api(value = "考核表", tags = "考核接口")
public class IndicatorsController {
private final IIndicatorsService indicatorsService;
@ -92,4 +92,29 @@ public class IndicatorsController {
}
}
@PostMapping("/removeById")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "删除考核", notes = "传入indicatorsDTO")
public R removeById(@RequestBody IndicatorsDTO indicatorsDTO) {
String method = "##############removeById: ";
log.info(method+"更新指标 参数={}",indicatorsDTO);
try{
Long id = indicatorsDTO.getId();
if(Objects.isNull(id)){
log.warn(method+"指标id为空 id={}",id);
return R.fail(405,"指标id为空");
}
indicatorsService.deleteById(id);
return R.success("删除成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

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.ClassifyVO;
import com.logpm.supervise.vo.api.ClassifyApiVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -13,7 +14,7 @@ import java.util.List;
@Mapper
public interface ClassifyMapper extends BaseMapper<ClassifyEntity> {
IPage<ClassifyEntity> pageList(IPage<Object> page, @Param("param") ClassifyDTO classifyDTO);
IPage<ClassifyVO> pageList(IPage<Object> page, @Param("param") ClassifyDTO classifyDTO);
List<ClassifyEntity> selectParentCalssifyList(@Param("param") ClassifyDTO classifyDTO);

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

@ -20,7 +20,7 @@
</resultMap>
<select id="pageList" resultType="com.logpm.supervise.entity.ClassifyEntity">
<select id="pageList" resultType="com.logpm.supervise.vo.ClassifyVO">
select *
from sup_classify
<where>

4
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsAnnexMapper.xml

@ -5,8 +5,8 @@
<select id="findListByIndicatorsIdAndType" resultType="com.logpm.supervise.entity.IndicatorsAnnexEntity">
select *
from sup_indicators_annex
and indicators_id = #{id}
and type = #{type}
where indicators_id = #{id}
and `type` = #{type}
</select>
</mapper>

5
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml

@ -4,7 +4,8 @@
<select id="pageList" resultType="com.logpm.supervise.vo.IndicatorsVO">
select sc.name classifyName,
select si.id id,
sc.name classifyName,
psc.name parentClassifyName,
si.assess_dept_name assessDeptName,
si.assess_user_name assessUserName,
@ -17,7 +18,7 @@
left join sup_classify sc on sc.id = si.classify_id
left join sup_classify psc on psc.id = sc.p_id
where 1=1
and si.id = #{param.id}
and si.is_deleted = 0
<if test="param.assessDept != null">
and si.assess_dept = #{param.assessDept}
</if>

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

@ -17,10 +17,10 @@
package com.logpm.supervise.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.supervise.dto.ClassifyDTO;
import com.logpm.supervise.dto.IndicatorsDTO;
import com.logpm.supervise.entity.ClassifyEntity;
import com.logpm.supervise.vo.ClassifyVO;
import com.logpm.supervise.vo.IndicatorsVO;
import com.logpm.supervise.vo.api.ClassifyApiVO;
import org.springblade.core.mp.base.BaseService;
@ -38,7 +38,7 @@ import java.util.Map;
public interface IClassifyService extends BaseService<ClassifyEntity> {
IPage<ClassifyEntity> pageList(IPage<Object> page, Map<String, Object> classify);
IPage<ClassifyVO> pageList(IPage<Object> page, Map<String, Object> classify);
void addChild(ClassifyDTO classifyDTO);

1
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IIndicatorsService.java

@ -12,4 +12,5 @@ public interface IIndicatorsService extends BaseService<IndicatorsEntity> {
R updateIndicators(IndicatorsDTO indicatorsDTO);
void deleteById(Long id);
}

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

@ -76,7 +76,7 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
@Override
public IPage<ClassifyEntity> pageList(IPage<Object> page, Map<String, Object> classify) {
public IPage<ClassifyVO> pageList(IPage<Object> page, Map<String, Object> classify) {
Long pId = (Long) classify.get("pId");
String name = (String) classify.get("name");
String isPid = (String) classify.get("isPid");
@ -86,7 +86,21 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
classifyDTO.setName(name);
classifyDTO.setIsPid(Integer.parseInt(isPid));
IPage<ClassifyEntity> pages = baseMapper.pageList(page,classifyDTO);
IPage<ClassifyVO> pages = baseMapper.pageList(page,classifyDTO);
List<ClassifyVO> records = pages.getRecords();
if(!"1".equals(isPid)){
for (ClassifyVO record : records) {
Long classifyId = record.getId();
QueryWrapper<PointsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("classify_id",classifyId)
.eq("is_deleted",0);
List<PointsEntity> list = pointsService.list(queryWrapper);
record.setPointsEntities(list);
}
}
pages.setRecords(records);
return pages;
}

7
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java

@ -86,4 +86,11 @@ public class IndicatorsServiceImpl extends BaseServiceImpl<IndicatorsMapper, Ind
return R.success("更新成功");
}
@Override
public void deleteById(Long id) {
baseMapper.deleteById(id);
}
}

Loading…
Cancel
Save