|
@@ -138,39 +138,8 @@ public class WorkClientInfoController extends BaseController {
|
|
|
return "modules/workclientinfo/workClientInfoFormType";
|
|
|
}
|
|
|
|
|
|
- //二次进行增加联系人类型
|
|
|
- /*@RequiresPermissions(value={"workclientinfo:workClientInfo:view","workclientinfo:workClientInfo:add","workclientinfo:workClientInfo:edit"},logical=Logical.OR)
|
|
|
- @RequestMapping(value = "type")
|
|
|
- public Object type(WorkClientInfo workClientInfo, Model model,String linkType) {
|
|
|
- model.addAttribute("workClientInfo", workClientInfo);
|
|
|
- model.addAttribute("linkType",linkType);
|
|
|
- try {
|
|
|
- if (!beanValidator(model, workClientInfo)){
|
|
|
- return form(workClientInfo, model);
|
|
|
- }
|
|
|
- String typeStr = workClientInfo.getJobTypeStr();
|
|
|
- typeStr=typeStr+","+linkType;
|
|
|
- workClientInfo.setJobTypeStr(typeStr);
|
|
|
- //保存当前人的公司
|
|
|
- workClientInfo.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
- workClientInfo.setOfficeId(UserUtils.getSelectOffice().getId());
|
|
|
- if(!workClientInfo.getIsNewRecord()){//编辑表单保存
|
|
|
- WorkClientInfo t = workClientInfoService.get(workClientInfo.getId());//从数据库取出记录的值
|
|
|
- MyBeanUtils.copyBeanNotNull2Bean(workClientInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
- workClientInfoService.save(t);//保存
|
|
|
- }else{//新增表单保存
|
|
|
- workClientInfoService.save(workClientInfo);//保存
|
|
|
- }
|
|
|
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- System.out.println("-----"+linkType);
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
- return map;
|
|
|
- }*/
|
|
|
//直接进行增加联系人类型
|
|
|
- //@RequiresPermissions(value={"workclientinfo:workClientInfo:view","workclientinfo:workClientInfo:add","workclientinfo:workClientInfo:edit"},logical=Logical.OR)
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "typeAdd")
|
|
|
public Map typeAdd(WorkClientInfo workClientInfo, Model model,String linkType) {
|
|
@@ -185,31 +154,7 @@ public class WorkClientInfoController extends BaseController {
|
|
|
map.put("linkName",linkman.getName());
|
|
|
map.put("linkMobile",linkman.getLinkMobile());
|
|
|
map.put("linkPhone",linkman.getLinkPhone());
|
|
|
- /*//统一信用代码添加到WorkClientLinkman的统一信用代码里面
|
|
|
- if(workClientInfo.getWorkClientLinkmanList().size()>0){
|
|
|
- for( int i=0;i<workClientInfo.getWorkClientLinkmanList().size();i++){
|
|
|
- workClientInfo.getWorkClientLinkmanList().get(i).setUscCode(workClientInfo.getUscCode());
|
|
|
- workClientInfo.getWorkClientLinkmanList().get(i).getClientId().setUscCode(workClientInfo.getUscCode());
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- ProjectRecords projectRecords=new ProjectRecords();
|
|
|
- if("1".equals(linkType)){
|
|
|
- projectRecords.setWorkClientLinkmanList(workClientInfo.getWorkClientLinkmanList());
|
|
|
- }else if("2".equals(linkType)){
|
|
|
- projectRecords.setWorkBuildLinkmanList(workClientInfo.getWorkClientLinkmanList());
|
|
|
- }else if("3".equals(linkType)){
|
|
|
- projectRecords.setWorkConstructionLinkmanList(workClientInfo.getWorkClientLinkmanList());
|
|
|
- }else if("4".equals(linkType)){
|
|
|
- projectRecords.setWorkSuperLinkmanList(workClientInfo.getWorkClientLinkmanList());
|
|
|
- }else if("5".equals(linkType)){
|
|
|
- projectRecords.setWorkDesignLinkmanList(workClientInfo.getWorkClientLinkmanList());
|
|
|
- }
|
|
|
- model.addAttribute(projectRecords);*/
|
|
|
-
|
|
|
-
|
|
|
- //return "modules/projectrecord/projectRecordsForm";
|
|
|
- /*return "redirect:"+Global.getAdminPath()+"/modules/projectrecord/projectRecordsForm/?repage";*/
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@@ -241,7 +186,6 @@ public class WorkClientInfoController extends BaseController {
|
|
|
model.addAttribute("attachmentSize",workClientInfo.getWorkAttachments().size());
|
|
|
return "modules/workclientinfo/workClientInfoFormDetail";
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 保存客户管理
|
|
|
*/
|
|
@@ -256,12 +200,6 @@ public class WorkClientInfoController extends BaseController {
|
|
|
return form(workClientInfo, model);
|
|
|
}
|
|
|
|
|
|
- //上传文件
|
|
|
-// List<WorkClientAttachment> workClientAttachments = workClientInfoService.uploadFile(request, upload_files, workClientInfo.getId(), VarStr.attachmentFlag[0]);
|
|
|
-// List<WorkClientAttachment> workClientAttachmentList = workClientInfo.getWorkClientAttachmentList();
|
|
|
-// workClientAttachments.addAll(workClientAttachmentList);
|
|
|
-// workClientInfo.setWorkClientAttachmentList(workClientAttachments);
|
|
|
-
|
|
|
//保存当前人的公司
|
|
|
workClientInfo.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
workClientInfo.setOfficeId(UserUtils.getSelectOffice().getId());
|
|
@@ -292,10 +230,7 @@ public class WorkClientInfoController extends BaseController {
|
|
|
}
|
|
|
|
|
|
//上传文件
|
|
|
-// List<WorkClientAttachment> workClientAttachments = workClientInfoService.uploadFile(request, upload_files, workClientInfo.getId(), VarStr.attachmentFlag[0]);
|
|
|
-// List<WorkClientAttachment> workClientAttachmentList = workClientInfo.getWorkClientAttachmentList();
|
|
|
-// workClientAttachments.addAll(workClientAttachmentList);
|
|
|
-// workClientInfo.setWorkClientAttachmentList(workClientAttachments);
|
|
|
+
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
|
String [] jobStr=workClientInfo.getJobTypeStr().split(",");
|
|
@@ -305,9 +240,7 @@ public class WorkClientInfoController extends BaseController {
|
|
|
}
|
|
|
|
|
|
String str = StringUtils.join(setType.toArray(), ",");
|
|
|
-
|
|
|
workClientInfo.setJobTypeStr(str);
|
|
|
-
|
|
|
//保存当前人的公司
|
|
|
workClientInfo.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
workClientInfo.setOfficeId(UserUtils.getSelectOffice().getId());
|
|
@@ -318,12 +251,7 @@ public class WorkClientInfoController extends BaseController {
|
|
|
}else{//新增表单保存
|
|
|
workClientInfoService.save(workClientInfo);//保存
|
|
|
}
|
|
|
- /*if(workClientInfo.getWorkClientLinkmanList().size()>0){
|
|
|
- for(WorkClientLinkman workList:workClientInfo.getWorkClientLinkmanList()){
|
|
|
- workList.setUscCode(workClientInfo.getUscCode());
|
|
|
- }
|
|
|
- }
|
|
|
- map.put("workLinkList",workClientInfo.getWorkClientLinkmanList());*/
|
|
|
+
|
|
|
WorkClientLinkman linkman = workClientInfo.getWorkClientLinkmanList().get(0);
|
|
|
map.put("id",linkman.getId());//联系人id
|
|
|
map.put("clientId",workClientInfo.getId());//客户id
|
|
@@ -334,9 +262,6 @@ public class WorkClientInfoController extends BaseController {
|
|
|
map.put("linkPhone",linkman.getLinkPhone());
|
|
|
|
|
|
map.put("str","新增客户信息成功!");
|
|
|
- //addMessage(redirectAttributes, "保存客户管理成功");
|
|
|
-
|
|
|
- //return "redirect:"+Global.getAdminPath()+"/workclientinfo/workClientInfo/?repage";
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@@ -573,10 +498,7 @@ public class WorkClientInfoController extends BaseController {
|
|
|
sysImportInfo.setIsTrue("1");
|
|
|
sysImportInfo.setErrCount("0");
|
|
|
}
|
|
|
- /*if(errList.size() > 0){
|
|
|
- failureNum = errList.size() + failureNum;
|
|
|
- failureMsg.insert(0, ",失败 "+failureNum+" 条客户管理记录");
|
|
|
- }*/
|
|
|
+
|
|
|
String msg = "已成功导入 "+successNum+" 条客户信息记录"+failureMsg;
|
|
|
String info = "已成功导入 "+successNum+" 条客户信息记录,失败 "+failureNum+" 个错误信息记录。";
|
|
|
sysImportInfo.setErrInfo(info);
|
|
@@ -619,9 +541,6 @@ public class WorkClientInfoController extends BaseController {
|
|
|
return "modules/sysimportinfo/sysimportinfoList";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 选择客户的联系人
|
|
|
*/
|
|
@@ -667,9 +586,6 @@ public class WorkClientInfoController extends BaseController {
|
|
|
WorkClientAttachment workClientAttachment = workClientInfoService.uploadFileSingle(request, myFile, workClientInfo.getId(), VarStr.attachmentFlag[0]);
|
|
|
workClientAttachment.setId(attchmentId);
|
|
|
String s = workClientInfoService.save(workClientAttachment);
|
|
|
-// addMessage(redirectAttributes,s);
|
|
|
-// model.addAttribute("workClientInfo",workClientInfo);
|
|
|
-// model.addAttribute("msg","success");
|
|
|
Map map = new HashMap();
|
|
|
map.put("msg","success");
|
|
|
return map;
|
|
@@ -767,34 +683,6 @@ public class WorkClientInfoController extends BaseController {
|
|
|
model.addAttribute("obj", clientInfo);
|
|
|
model.addAttribute("page", page);
|
|
|
return "modules/sys/gridselectClientBuild";
|
|
|
- /*Page<WorkClientInfo> page = workClientInfoService.findPageUnit(new Page<WorkClientInfo>(request, response), clientInfo);
|
|
|
- try {
|
|
|
- fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");
|
|
|
- fieldKeys = URLDecoder.decode(fieldKeys, "UTF-8");
|
|
|
- searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
|
|
|
- searchKey = URLDecoder.decode(searchKey, "UTF-8");
|
|
|
- } catch (UnsupportedEncodingException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- model.addAttribute("labelNames", fieldLabels.split("\\|"));
|
|
|
- model.addAttribute("labelValues", fieldKeys.split("\\|"));
|
|
|
- model.addAttribute("fieldLabels", fieldLabels);
|
|
|
- model.addAttribute("fieldKeys", fieldKeys);
|
|
|
- model.addAttribute("url", url);
|
|
|
- model.addAttribute("searchLabel", searchLabel);
|
|
|
- model.addAttribute("searchKey", searchKey);
|
|
|
- model.addAttribute("obj", clientInfo);
|
|
|
- model.addAttribute("page", page);
|
|
|
- if(clientInfo.getClientType().equals("3")){
|
|
|
- return "modules/sys/gridselectClientLink";
|
|
|
- }else if(clientInfo.getClientType().equals("2")){
|
|
|
- return "modules/sys/gridselectClientBuild";
|
|
|
- }else if(clientInfo.getClientType().equals("4")){
|
|
|
- return "modules/sys/gridselectClientSuper";
|
|
|
- }else if(clientInfo.getClientType().equals("5")){
|
|
|
- return "modules/sys/gridselectClientDesign";
|
|
|
- }
|
|
|
- return "null";*/
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -846,34 +734,6 @@ public class WorkClientInfoController extends BaseController {
|
|
|
model.addAttribute("obj", clientInfo);
|
|
|
model.addAttribute("page", page);
|
|
|
return "modules/sys/gridselectClientDesign";
|
|
|
- /*Page<WorkClientInfo> page = workClientInfoService.findPageUnit(new Page<WorkClientInfo>(request, response), clientInfo);
|
|
|
- try {
|
|
|
- fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");
|
|
|
- fieldKeys = URLDecoder.decode(fieldKeys, "UTF-8");
|
|
|
- searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
|
|
|
- searchKey = URLDecoder.decode(searchKey, "UTF-8");
|
|
|
- } catch (UnsupportedEncodingException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- model.addAttribute("labelNames", fieldLabels.split("\\|"));
|
|
|
- model.addAttribute("labelValues", fieldKeys.split("\\|"));
|
|
|
- model.addAttribute("fieldLabels", fieldLabels);
|
|
|
- model.addAttribute("fieldKeys", fieldKeys);
|
|
|
- model.addAttribute("url", url);
|
|
|
- model.addAttribute("searchLabel", searchLabel);
|
|
|
- model.addAttribute("searchKey", searchKey);
|
|
|
- model.addAttribute("obj", clientInfo);
|
|
|
- model.addAttribute("page", page);
|
|
|
- if(clientInfo.getClientType().equals("3")){
|
|
|
- return "modules/sys/gridselectClientLink";
|
|
|
- }else if(clientInfo.getClientType().equals("2")){
|
|
|
- return "modules/sys/gridselectClientBuild";
|
|
|
- }else if(clientInfo.getClientType().equals("4")){
|
|
|
- return "modules/sys/gridselectClientSuper";
|
|
|
- }else if(clientInfo.getClientType().equals("5")){
|
|
|
- return "modules/sys/gridselectClientDesign";
|
|
|
- }
|
|
|
- return "null";*/
|
|
|
}
|
|
|
@ResponseBody
|
|
|
@RequestMapping("checkUscCode")
|
|
@@ -942,17 +802,6 @@ public class WorkClientInfoController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 无合同,查询公司所有客户及其关联的联系人
|
|
|
- * @param linkman
|
|
|
- * @param url
|
|
|
- * @param fieldLabels
|
|
|
- * @param fieldKeys
|
|
|
- * @param searchLabel
|
|
|
- * @param searchKey
|
|
|
- * @param searchLabel1
|
|
|
- * @param searchKey1
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @param model
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("queryLinkManByCompany")
|