Merge branch 'develop_master' into FOTON

This commit is contained in:
liyawei
2022-11-15 21:36:24 +08:00
7 changed files with 74 additions and 3 deletions
@@ -94,6 +94,14 @@ public class FileMaterialController extends BaseController<FileMaterial> {
return Result.success(fileMaterial);
}
@GetMapping("/getFileMaterialIndex")
@ApiOperation("首页-查询前十条文件资料组")
public ResponseMessage<List<FileMaterial>> getFileMaterialIndex(String userId){
List<FileMaterial> fileMaterial = iFileMaterialService.getFileMaterialIndex(userId);
return Result.success(fileMaterial);
}
@PutMapping
@ApiOperation("修改文件资料组")
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
@@ -22,4 +24,6 @@ public interface FileMaterialDao extends BaseMapper<FileMaterial> {
IPage<FileMaterial> getFileMaterialPage(IPage<FileMaterial> page, @Param("flieM") FileMaterialPage fileMaterialPage);
List<FileMaterial> getFileMaterialIndex(@Param("treeIdList") List<String> treeIdList);
}
@@ -26,6 +26,13 @@ public interface IFileMaterialService extends IService<FileMaterial> {
*/
IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage);
/**
* 首页-查询前十条文件资料组
* @param userId
* @return
*/
List<FileMaterial> getFileMaterialIndex(String userId);
/**
* 获取类型
@@ -78,6 +78,26 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
return fileMaterialDao.getFileMaterialPage(page,queryPage);
}
@Override
public List<FileMaterial> getFileMaterialIndex(String userId) {
if (StringUtils.isBlank(userId)) {
// 获取当前登录人
userId = LoginUserUtil.getUserId();
}
List<String> positionIds = tsUserDao.selectPositionIds(userId);
List<String> roleIds = tsPositionService.getRoleIdsByPositionIds(positionIds);
QueryWrapper<TsRoleMenuData> wrapper = new QueryWrapper<>();
wrapper.in("ROLE_ID", roleIds);
List<TsRoleMenuData> tsRoleMenuData = iTsRoleMenuDataService.list(wrapper);
List<String> treeIdList = tsRoleMenuData.stream().map(TsRoleMenuData::getMenuId).distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(treeIdList)) {
return null;
}
return fileMaterialDao.getFileMaterialIndex(treeIdList);
}
@Override
public List<String> getFileMaterialType() {
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
@@ -9,6 +9,7 @@ import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarInterpretat
import com.adc.da.sys.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -59,7 +60,17 @@ public class SarInterpretationNationalStandardServiceImpl extends ServiceImpl<Sa
@Override
public List<SarInterpretationNationalStandard> getAllDatas(InterpretationEO sarInterpretationNationalStandard) {
return sarInterpretationNationalStandardDao.getAllDatas(sarInterpretationNationalStandard);
List<SarInterpretationNationalStandard> list = sarInterpretationNationalStandardDao.getAllDatas(sarInterpretationNationalStandard);
// 处理适用车型 ["N1","N2"]
for (SarInterpretationNationalStandard standard : list) {
if (StringUtils.isNotEmpty(standard.getApplyArctic()) && standard.getApplyArctic().startsWith("[") && standard.getApplyArctic().endsWith("]")) {
String applyArctics = standard.getApplyArctic().substring(1,standard.getApplyArctic().length()-1).replace("\"", "");
standard.setApplyArctic(applyArctics);
}
}
return list;
}
@Override
@@ -53,4 +53,25 @@
group by fm.id
order by fm.data_upload_time desc
</select>
<select id="getFileMaterialIndex" resultType="com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial">
SELECT
fm.id, fm.data_type, fm.data_title, fm.data_upload_time, fm.data_explain, fm.attach_file_id, fm.click_count,
fm.is_top, fm.del_flag, fm.is_show, zd.id as treeId, zt.name as treeName
FROM
file_material fm
LEFT JOIN zl_data zd ON zd.data_id=fm.id
LEFT JOIN zl_tree zt ON zd.id=zt.id
WHERE
fm.del_flag = '0'
<if test="treeIdList != null">
and zd.id in
<foreach collection="treeIdList" open="(" separator="," close=")" index="index" item="item">
#{item}
</foreach>
</if>
group by fm.id
order by fm.data_upload_time desc
limit 0,10
</select>
</mapper>
@@ -79,9 +79,9 @@
<if test="prcNum!=null and prcNum!=''">
AND sins.prc_num like concat(concat('%',#{prcNum}),'%')
</if>
ORDER BY sins.STAND_ID, sins.specific_item
ORDER BY sins.specific_item
) c ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.specific_item,1,(SELECT LOCATE('.',CONCAT(c.specific_item,'.')))),SIGNED) ,rows
) c ORDER BY CONVERT(SUBSTRING(c.specific_item,1,(SELECT LOCATE('.',CONCAT(c.specific_item,'.')))),SIGNED)
LIMIT ${(current-1)*size},${size}
</select>
<select id="getAllDatasCout" resultType="java.lang.Integer">