|
@ -140,4 +140,60 @@ public class ServiceItemService extends BaseService {
|
|
|
}
|
|
|
return JSONObject.parseObject(response);
|
|
|
}
|
|
|
|
|
|
|
|
|
/*public JSONObject importData(HttpServletRequest request) throws Exception {
|
|
|
String response = null;
|
|
|
String url =getBaseUrl() + "importData";
|
|
|
JSONObject object =
|
|
|
try {
|
|
|
response = httpClientUtil.po;
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
logger.error(e.getMessage());
|
|
|
}
|
|
|
return JSONObject.parseObject(response);
|
|
|
}*/
|
|
|
|
|
|
/* public boolean importData(Workbook workbook) {
|
|
|
Sheet[] sheets = workbook.getSheets();
|
|
|
Sheet sheet = sheets[0];
|
|
|
int rows = ReadExcelUtil.getRightRows(sheet);
|
|
|
for (int row = 1; row < rows; row++) { //索引从0开始,第一行为标题
|
|
|
Hospital hospital = new Hospital();
|
|
|
Map<Integer, ExcelData> mapping = mapping(hospital);
|
|
|
int finalRow = row;
|
|
|
mapping.forEach((index, excelData) -> {
|
|
|
String value = sheet.getCell(index, finalRow).getContents().trim();
|
|
|
excelData.transform(value);
|
|
|
});
|
|
|
|
|
|
//Additional Handel
|
|
|
String hospitalExist = this.isNameExist(hospital.getName());
|
|
|
if (hospitalExist.equals("true")) {//机构存在,但是未判断wlyyRole是否存在
|
|
|
hospital = hospitalDao.findByName(hospital.getName());
|
|
|
WlyyRole wlyyRole = new WlyyRole();
|
|
|
WlyyRole wlyyRole1 = wlyyRoleDao.findByName(hospital.getName());
|
|
|
if(wlyyRole1==null){//不存在则保存
|
|
|
wlyyRole.setName(hospital.getName());
|
|
|
wlyyRole.setCode(hospital.getCode());
|
|
|
wlyyRole.setCzrq(new Date());
|
|
|
wlyyRoleDao.save(wlyyRole);
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
|
//机构不存在,先保存机构,在判断wlyyRole是否存在
|
|
|
hospital.setDel("1");
|
|
|
hospital = hospitalDao.save(hospital);
|
|
|
WlyyRole wlyyRole = new WlyyRole();
|
|
|
WlyyRole wlyyRole1 = wlyyRoleDao.findByName(hospital.getName());
|
|
|
if(wlyyRole1==null){//不存在则保存
|
|
|
wlyyRole.setName(hospital.getName());
|
|
|
wlyyRole.setCode(hospital.getCode());
|
|
|
wlyyRole.setCzrq(new Date());
|
|
|
wlyyRoleDao.save(wlyyRole);
|
|
|
}
|
|
|
}
|
|
|
return true;
|
|
|
}*/
|
|
|
}
|