|
@@ -401,7 +401,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
//由于第一行需要指明列对应的标题
|
|
//由于第一行需要指明列对应的标题
|
|
int rowNum = sheet.getLastRowNum();
|
|
int rowNum = sheet.getLastRowNum();
|
|
//获取当前表单模板 校验规则
|
|
//获取当前表单模板 校验规则
|
|
- SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCode, "Product").eq(SysForm::getCompanyId, companyId).eq(SysForm::getIsCurrent, 1));
|
|
|
|
|
|
+ SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCode, "Thread").eq(SysForm::getCompanyId, companyId).eq(SysForm::getIsCurrent, 1));
|
|
if(sysForm==null){
|
|
if(sysForm==null){
|
|
msg.setError("当前模块未配置自定义模板,需先完成配置");
|
|
msg.setError("当前模块未配置自定义模板,需先完成配置");
|
|
return msg;
|
|
return msg;
|
|
@@ -409,7 +409,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
String config = sysForm.getConfig();
|
|
String config = sysForm.getConfig();
|
|
JSONObject configOb = JSON.parseObject(config);
|
|
JSONObject configOb = JSON.parseObject(config);
|
|
JSONArray configObJSONArray = configOb.getJSONArray("list");
|
|
JSONArray configObJSONArray = configOb.getJSONArray("list");
|
|
- List<Clue> importClueList=new ArrayList<>();
|
|
|
|
|
|
+// List<Clue> importClueList=new ArrayList<>();
|
|
List<String> userNameList=new ArrayList<>();
|
|
List<String> userNameList=new ArrayList<>();
|
|
HttpRespMsg respMsg=new HttpRespMsg();
|
|
HttpRespMsg respMsg=new HttpRespMsg();
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
@@ -427,29 +427,32 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
JSONObject item = configObJSONArray.getJSONObject(i);
|
|
JSONObject item = configObJSONArray.getJSONObject(i);
|
|
String modelName = item.getString("model");
|
|
String modelName = item.getString("model");
|
|
XSSFCell cell = row.getCell(i);
|
|
XSSFCell cell = row.getCell(i);
|
|
-// if(cell!=null){
|
|
|
|
-// switch (item.getString("type")){
|
|
|
|
-// case "time":cell.setCellType(CellType.NUMERIC);
|
|
|
|
-// break;
|
|
|
|
-// default:cell.setCellType(CellType.STRING);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
- if(modelName.equals("inchargerId")){
|
|
|
|
- if(!StringUtils.isEmpty(cell.getStringCellValue())){
|
|
|
|
- userNameList.add(cell.getStringCellValue());
|
|
|
|
|
|
+ if(cell!=null){
|
|
|
|
+ switch (item.getString("type")){
|
|
|
|
+ case "time":cell.setCellType(CellType.NUMERIC);
|
|
|
|
+ break;
|
|
|
|
+ default:cell.setCellType(CellType.STRING);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// if(modelName.equals("inchargerId")){
|
|
|
|
+// System.out.println("=====");
|
|
|
|
+// System.out.println(modelName);
|
|
|
|
+// System.out.println(cell.toString());
|
|
|
|
+// if(!StringUtils.isEmpty(cell.getStringCellValue())){
|
|
|
|
+// userNameList.add(cell.getStringCellValue());
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- System.out.println("参与搜索的人员列表"+userNameList + userNameList.size());
|
|
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
|
|
|
|
- respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
|
|
|
|
- if(respMsg.code.equals("0")){
|
|
|
|
- msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
|
|
- return msg;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// System.out.println("参与搜索的人员列表"+userNameList + userNameList.size());
|
|
|
|
+// if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
|
|
|
|
+// respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
|
|
|
|
+// if(respMsg.code.equals("0")){
|
|
|
|
+// msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
|
|
+// return msg;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
List<User> targetUserList= (List<User>) respMsg.data;
|
|
List<User> targetUserList= (List<User>) respMsg.data;
|
|
//直接忽略空行 从row1开始
|
|
//直接忽略空行 从row1开始
|
|
for (int rowIndex = 1; rowIndex <= rowNum; rowIndex++) {
|
|
for (int rowIndex = 1; rowIndex <= rowNum; rowIndex++) {
|
|
@@ -465,6 +468,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
int cellNum = row.getLastCellNum();
|
|
int cellNum = row.getLastCellNum();
|
|
Clue clue =new Clue();
|
|
Clue clue =new Clue();
|
|
clue.setCompanyId(companyId);
|
|
clue.setCompanyId(companyId);
|
|
|
|
+ clue.setCreateTime(new Date());
|
|
clue.setCreateId(user.getId());
|
|
clue.setCreateId(user.getId());
|
|
for (int i = 0; i < cellNum; i++) {
|
|
for (int i = 0; i < cellNum; i++) {
|
|
JSONObject item = configObJSONArray.getJSONObject(i);
|
|
JSONObject item = configObJSONArray.getJSONObject(i);
|
|
@@ -520,7 +524,8 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
if(!StringUtils.isEmpty(cell.getStringCellValue())){
|
|
if(!StringUtils.isEmpty(cell.getStringCellValue())){
|
|
Optional<SysDict> first = sysDictOfClueSources.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
|
|
Optional<SysDict> first = sysDictOfClueSources.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
|
|
if(first.isPresent()){
|
|
if(first.isPresent()){
|
|
- clue.setClueSourceId(first.get().getId());
|
|
|
|
|
|
+ Integer id = first.get().getId();
|
|
|
|
+ clue.setClueSourceId(id);
|
|
}else {
|
|
}else {
|
|
throw new Exception("线索来源["+cell.getStringCellValue()+"不存在,请在系统字典中增加");
|
|
throw new Exception("线索来源["+cell.getStringCellValue()+"不存在,请在系统字典中增加");
|
|
}
|
|
}
|
|
@@ -543,13 +548,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- importClueList.add(clue);
|
|
|
|
- }
|
|
|
|
- if(importClueList.size()>0){
|
|
|
|
- if(!saveOrUpdateBatch(importClueList)){
|
|
|
|
- msg.setError("验证失败");
|
|
|
|
- return msg;
|
|
|
|
- }
|
|
|
|
|
|
+ clueMapper.insert(clue);
|
|
}
|
|
}
|
|
} catch (IOException | NoSuchMethodException e) {
|
|
} catch (IOException | NoSuchMethodException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|