Browse Source

考核小程序修改

chenglong
汤建军 1 year ago
parent
commit
d9f77c5f5d
  1. 17
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/api/ClassifyApi.java
  2. 6
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsAnnexMapper.java
  3. 3
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsAnnexMapper.xml
  4. 2
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.java
  5. 14
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml
  6. 7
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java
  7. 49
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java

17
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/api/ClassifyApi.java

@ -62,12 +62,25 @@ public class ClassifyApi {
@GetMapping("/myApiIndicatorsDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "我的考核列表")
public R myApiIndicatorsDetail(@RequestParam Long Id) {
R r = classifyService.myApiIndicatorsDetail(Id);
public R myApiIndicatorsDetail(@RequestParam Long id) {
R r = classifyService.myApiIndicatorsDetail(id);
return r;
}
@PostMapping("/updateApiIndicators")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "小程序保存考核内容", notes = "传入classify")
public R updateApiIndicators(@RequestBody IndicatorsDTO instanceofDTO) {
R r = classifyService.updateApiIndicators(instanceofDTO);
return r;
}

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

@ -12,4 +12,10 @@ public interface IndicatorsAnnexMapper extends BaseMapper<IndicatorsAnnexEntity>
List<IndicatorsAnnexEntity> findListByIndicatorsIdAndType(@Param("id") Long id, @Param("type") int type);
/**
* \进行考核的资源文件删除
* @param id
*/
void deleteResourceByInstanceoId(@Param("indicatorsId") Long indicatorsId);
}

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

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.supervise.mapper.IndicatorsAnnexMapper">
<delete id="deleteResourceByInstanceoId">
DELETE FROM sup_indicators_annex WHERE indicators_id = #{indicatorsId}
</delete>
<select id="findListByIndicatorsIdAndType" resultType="com.logpm.supervise.entity.IndicatorsAnnexEntity">
select *

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

@ -25,5 +25,5 @@ public interface IndicatorsMapper extends BaseMapper<IndicatorsEntity> {
* @param params
* @return
*/
Page<IndicatorsVO> selectMyApiIndicators(IPage<IndicatorsVO> page, Map<String, Object> params);
Page<IndicatorsVO> selectMyApiIndicators(IPage<IndicatorsVO> page,@Param("params") Map<String, Object> params);
}

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

@ -45,15 +45,15 @@
and si.id = #{id}
</select>
<select id="selectMyApiIndicators" resultType="com.logpm.supervise.vo.IndicatorsVO">
SELECT * FROM sup_indicators WHERE is_deleted = 0 and
<if test="param.assessDept != null and param.assessDept != ''" >
and assess_dept = #{param.assessDept}
SELECT * FROM sup_indicators WHERE is_deleted = 0 AND create_user =#{params.userId}
<if test="params.assessDept != null and params.assessDept != ''" >
and assess_dept = #{params.assessDept}
</if>
<if test="param.startTime != null and param.startTime != ''" >
and date_format(create_time,'%y%m%d%') >= date_format(#{param.startTime},'%y%m%d%')
<if test="params.startTime != null and params.startTime != ''" >
and date_format(create_time,'%y%m%d%') >= date_format(#{params.startTime},'%y%m%d%')
</if>
<if test="param.endTime != null and param.endTime != ''" >
and date_format(create_time,'%y%m%d%') &lt;= date_format(#{param.endTime},'%y%m%d%')
<if test="params.endTime != null and params.endTime != ''" >
and date_format(create_time,'%y%m%d%') &lt;= date_format(#{params.endTime},'%y%m%d%')
</if>
</select>

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

@ -79,4 +79,11 @@ public interface IClassifyService extends BaseService<ClassifyEntity> {
* @return
*/
R myApiIndicatorsDetail(Long id);
/**
* 修改考核详情
* @param instanceofDTO
* @return
*/
R updateApiIndicators(IndicatorsDTO instanceofDTO);
}

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

@ -27,6 +27,7 @@ import com.logpm.supervise.entity.IndicatorsAnnexEntity;
import com.logpm.supervise.entity.IndicatorsEntity;
import com.logpm.supervise.entity.PointsEntity;
import com.logpm.supervise.mapper.ClassifyMapper;
import com.logpm.supervise.mapper.IndicatorsAnnexMapper;
import com.logpm.supervise.mapper.IndicatorsMapper;
import com.logpm.supervise.service.IClassifyService;
import com.logpm.supervise.service.IIndicatorsAnnexService;
@ -66,6 +67,8 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
private final IIndicatorsAnnexService indicatorsAnnexService;
private final IndicatorsAnnexMapper indicatorsAnnexMapper;
private final IIndicatorsService iIndicatorsService;
private final IndicatorsMapper indicatorsMapper;
@ -189,22 +192,36 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
@Override
@Transactional
public R saveApiIndicators(IndicatorsDTO instanceofDTO) {
//保存考核内容
IndicatorsEntity indicatorsEntity = Func.copy(instanceofDTO, IndicatorsEntity.class);
indicatorsEntity.setIndicatorsStatus(1);
iIndicatorsService.save(indicatorsEntity);
if (Func.isNotEmpty(instanceofDTO.getResourceList())){
//存在附件进行保存
List<Map<String, Object>> resourceList = instanceofDTO.getResourceList();
for (Map<String, Object> map : resourceList) {
IndicatorsAnnexEntity indicatorsAnnexEntity = Func.copy(map, IndicatorsAnnexEntity.class);
indicatorsAnnexService.save(indicatorsAnnexEntity);
}
handleResource(resourceList,indicatorsEntity.getId());
}
return R.status(true);
}
@Transactional
private void handleResource(List<Map<String, Object>> resourceList, Long id) {
for (Map<String, Object> map : resourceList) {
IndicatorsAnnexEntity indicatorsAnnexEntity = Func.copy(map, IndicatorsAnnexEntity.class);
indicatorsAnnexEntity.setIndicatorsId(id);
indicatorsAnnexService.save(indicatorsAnnexEntity);
}
//保存考核内容
IndicatorsEntity indicatorsEntity = Func.copy(instanceofDTO, IndicatorsEntity.class);
return R.status(iIndicatorsService.save(indicatorsEntity));
}
@Override
public R selectMyApiIndicators(Map<String, Object> params, IPage<IndicatorsVO> page) {
Long userId = AuthUtil.getUserId();
if (Func.isEmpty(userId)){
return null;
}
params.put("userId",userId);
Page<IndicatorsVO> indicatorsVOPage = indicatorsMapper.selectMyApiIndicators(page,params);
return R.data(indicatorsVOPage);
}
@ -223,12 +240,28 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
}
if (Func.isNotEmpty(resourceMap.get(2))){
//存在附件资源
indicatorsVO.setPictures(resourceMap.get(2));
indicatorsVO.setFiles(resourceMap.get(2));
}
}
return R.data(indicatorsVO);
}
@Override
@Transactional
public R updateApiIndicators(IndicatorsDTO instanceofDTO) {
//查询对应的考核是否存在附件信息
List<IndicatorsAnnexEntity> annexEntityList = indicatorsAnnexService.list(Wrappers.<IndicatorsAnnexEntity>query().lambda().eq(IndicatorsAnnexEntity::getIndicatorsId, instanceofDTO.getId()));
if (Func.isNotEmpty(annexEntityList)){
//进行附件文件信息删除
indicatorsAnnexMapper.deleteResourceByInstanceoId(instanceofDTO.getId());
}
if (Func.isNotEmpty(instanceofDTO.getResourceList())){
handleResource(instanceofDTO.getResourceList(), instanceofDTO.getId());
}
IndicatorsEntity indicatorsEntity = Func.copy(instanceofDTO, IndicatorsEntity.class);
return R.status(iIndicatorsService.updateById(indicatorsEntity));
}
private List<ClassifyApiVO> getClassifyList(Long pid) {
return baseMapper.selectAllClassifyList(pid);
}

Loading…
Cancel
Save