Commit 3fe79752 authored by tianyiming's avatar tianyiming

一码通总览bug修改

parent 67e42fa4
...@@ -699,6 +699,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -699,6 +699,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
Long count = bizJdbcTemplate.queryForObject(countSql, Long.class); Long count = bizJdbcTemplate.queryForObject(countSql, Long.class);
String finalSelectSql = selectSql; String finalSelectSql = selectSql;
System.out.println(finalSelectSql);
List<Map<String, Object>> mapList = bizJdbcTemplate.queryForList(finalSelectSql); List<Map<String, Object>> mapList = bizJdbcTemplate.queryForList(finalSelectSql);
page.setTotal(count); page.setTotal(count);
page.setRecords(mapList); page.setRecords(mapList);
...@@ -870,14 +871,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -870,14 +871,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
equipmentCategoryData.setRecDate(new Date()); equipmentCategoryData.setRecDate(new Date());
list.add(equipmentCategoryData); list.add(equipmentCategoryData);
} }
if(ObjectUtils.isEmpty(unitCodes)){ if(!ObjectUtils.isEmpty(unitCodes)){
equipmentCategoryDataService.saveOrUpdateBatch(list); equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code",unitCodes));
} else {
for (EquipmentCategoryData equipmentCategoryData : list) {
equipmentCategoryDataService.update(equipmentCategoryData,
new QueryWrapper<EquipmentCategoryData>().eq("unit_code", equipmentCategoryData.getUnitCode()).eq("org_branch_code",equipmentCategoryData.getOrgBranchCode()));
}
} }
equipmentCategoryDataService.saveOrUpdateBatch(list);
stopWatch.stop(); stopWatch.stop();
if(log.isInfoEnabled()){ if(log.isInfoEnabled()){
log.info("总览数据刷新结束,耗时:{} 秒",stopWatch.getTotalTimeSeconds()); log.info("总览数据刷新结束,耗时:{} 秒",stopWatch.getTotalTimeSeconds());
...@@ -926,13 +923,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -926,13 +923,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
private EquipmentCategoryData updateEquipmentCategoryData(String unitCode,String orgBranchCode) { private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode,String orgBranchCode) {
List<String> unitCodeList = new ArrayList<>(); List<String> unitCodeList = new ArrayList<>();
unitCodeList.add(unitCode); unitCodeList.add(unitCode);
List<String> orgBranchCodeList = new ArrayList<>(); List<String> orgBranchCodeList = new ArrayList<>();
orgBranchCodeList.add(orgBranchCode); orgBranchCodeList.add(orgBranchCode);
List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList,orgBranchCodeList); List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList,null);
return equipmentCategoryData.get(0); return equipmentCategoryData;
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment