|
@@ -68,6 +68,8 @@ public class BusinessOpportunityController {
|
|
|
private ActionLogMapper actionLogMapper;
|
|
|
@Resource
|
|
|
private BusinessOpportunityService businessOpportunityService;
|
|
|
+ @Resource
|
|
|
+ private CompanyMapper companyMapper;
|
|
|
@Autowired
|
|
|
private TaskMapper taskMapper;
|
|
|
|
|
@@ -104,6 +106,9 @@ public class BusinessOpportunityController {
|
|
|
SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCompanyId, user.getCompanyId()).eq(SysForm::getCode, "business").eq(SysForm::getIsCurrent, 1));
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, user.getCompanyId()));
|
|
|
String config = sysForm.getConfig();
|
|
|
+ Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
+ String str = company.getIsExistBusiness() == 1 ? "商机" : "项目";
|
|
|
+
|
|
|
JSONObject configOb = JSON.parseObject(config);
|
|
|
JSONArray configObJSONArray = configOb.getJSONArray("list");
|
|
|
List<List<String>> dataList=new ArrayList<>();
|
|
@@ -130,6 +135,13 @@ public class BusinessOpportunityController {
|
|
|
}
|
|
|
}
|
|
|
dataList.add(titleList);
|
|
|
+ for (int i = 0; i < titleList.size(); i++) {
|
|
|
+ String s = titleList.get(i);
|
|
|
+ if (s.contains("商机")) {
|
|
|
+ s = s.replaceAll("商机", str);
|
|
|
+ titleList.set(i, s);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
HttpRespMsg respMsg = list(bo,request);
|
|
|
Map<String, Object> msgData = (Map<String, Object>) respMsg.getData();
|
|
@@ -194,7 +206,7 @@ public class BusinessOpportunityController {
|
|
|
}
|
|
|
dataList.add(item);
|
|
|
}
|
|
|
- String fileName="商机表导出_"+ System.currentTimeMillis();
|
|
|
+ String fileName=str+"表导出_"+ System.currentTimeMillis();
|
|
|
return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
|
|
|
}
|
|
|
|
|
@@ -265,6 +277,8 @@ public class BusinessOpportunityController {
|
|
|
public HttpRespMsg insertAndUpdate( BusinessOpportunity bo, HttpServletRequest request) {
|
|
|
User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
+ String str= company.getIsExistBusiness()==1 ? "商机" :"项目";
|
|
|
if (bo.getId() == null){
|
|
|
//新增
|
|
|
Integer count = businessOpportunityMapper.selectCount(new LambdaQueryWrapper<BusinessOpportunity>()
|
|
@@ -272,7 +286,7 @@ public class BusinessOpportunityController {
|
|
|
.eq(BusinessOpportunity::getCompanyId,user.getCompanyId())
|
|
|
);
|
|
|
if(count>0){
|
|
|
- msg.setError("已存在同名商机");
|
|
|
+ msg.setError("已存在同名"+str);
|
|
|
return msg;
|
|
|
}
|
|
|
if (bo.getClueId()!= null ){
|
|
@@ -309,7 +323,7 @@ public class BusinessOpportunityController {
|
|
|
.ne(BusinessOpportunity::getId,bo.getId())
|
|
|
);
|
|
|
if(count>0){
|
|
|
- msg.setError("已存在同名商机");
|
|
|
+ msg.setError("已存在同名"+str);
|
|
|
return msg;
|
|
|
}
|
|
|
bo.setEditTime(new Date());
|