提交 b2dd41f7 作者: yuanhaojie

智库维护

上级 28faf7e3
...@@ -57,4 +57,12 @@ public interface ThinktankBasicInfoMapper extends BaseMapper<ThinktankBasicInfo> ...@@ -57,4 +57,12 @@ public interface ThinktankBasicInfoMapper extends BaseMapper<ThinktankBasicInfo>
@Param("nature")String nature, @Param("nature")String nature,
@Param("influencePosition")String influencePosition, @Param("influencePosition")String influencePosition,
@Param("scale")String scale); @Param("scale")String scale);
/**
* 根据id更新智库影响力和地位
* @param id 智库id
* @param influencePosition 影响力和地位
*/
@Update("update thinktank_basic_info set influence_position = #{influencePosition} where id = #{id} ")
void updateThinkTankInfluencePositionById(@Param("id") String id, @Param("influencePosition")String influencePosition);
} }
...@@ -917,22 +917,34 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf ...@@ -917,22 +917,34 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
for (int i = 1; i <= sheet.getLastRowNum(); i++) { for (int i = 1; i <= sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i); Row row = sheet.getRow(i);
if (row != null) { if (row != null) {
Cell idCell = row.getCell(1); // Cell idCell = row.getCell(1);
Cell codeCell = row.getCell(2); // Cell codeCell = row.getCell(2);
Cell cell1 = row.getCell(11); // Cell cell1 = row.getCell(11);
Cell cell2 = row.getCell(13); // Cell cell2 = row.getCell(13);
Cell cell3 = row.getCell(14); // Cell cell3 = row.getCell(14);
Cell cell4 = row.getCell(16); // Cell cell4 = row.getCell(16);
Cell cell5 = row.getCell(17); // Cell cell5 = row.getCell(17);
Cell idCell = row.getCell(0);
Cell influencePositionCell = row.getCell(10);
if (idCell != null) { if (idCell != null) {
String id = idCell.getStringCellValue(); String id = idCell.getStringCellValue();
String stringCellValue1 = cell1.getStringCellValue(); // String stringCellValue1 = cell1.getStringCellValue();
String stringCellValue2 = cell2.getStringCellValue(); // String stringCellValue2 = cell2.getStringCellValue();
String stringCellValue3 = cell3.getStringCellValue(); // String stringCellValue3 = cell3.getStringCellValue();
String stringCellValue4 = cell4.getStringCellValue(); // String stringCellValue4 = cell4.getStringCellValue();
String stringCellValue5 = cell5.getStringCellValue(); // String stringCellValue5 = cell5.getStringCellValue();
thinktankBasicInfoMapper.updateThinkTankBasicInfoById(id,stringCellValue1,stringCellValue2,stringCellValue3,stringCellValue4,stringCellValue5); // thinktankBasicInfoMapper.updateThinkTankBasicInfoById(id,stringCellValue1,stringCellValue2,stringCellValue3,stringCellValue4,stringCellValue5);
log.info("success,{}",i); try {
String stringCellValue = influencePositionCell.getStringCellValue();
if (stringCellValue != null && !"".equals(stringCellValue)) {
thinktankBasicInfoMapper.updateThinkTankInfluencePositionById(id,stringCellValue);
log.info("success,{}",i);
}
} catch (Exception e) {
log.info("读取数据异常,{}",i);
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论