|
@@ -863,7 +863,7 @@ public class WeiXinCorpController {
|
|
|
}
|
|
|
} else if ("change_contact".equals(jsonObject.get("InfoType")) && jsonObject.has("ChangeType")) {
|
|
|
//{"xml":{"ChangeType":"delete_user","UserID":"ShanShuiGongZhangTianYiSe",
|
|
|
- // "SuiteId":"ww4e237fd6abb635af","InfoType":"change_contact","AuthCorpId":"wwf11426cf618e1703",
|
|
|
+ // "SuiteId":"wwdd1137a65ce0fc87","InfoType":"change_contact","AuthCorpId":"wwf11426cf618e1703",
|
|
|
// "TimeStamp":1655908762,"OpenUserID":"woy9TkCAAApdqSxsfJbmK4cBJhbzI5Ug"}}
|
|
|
String changeType = jsonObject.getString("ChangeType");
|
|
|
String corpId = jsonObject.getString("AuthCorpId");
|
|
@@ -1300,7 +1300,7 @@ public class WeiXinCorpController {
|
|
|
JSONArray jsonArray = obj.getJSONObject("auth_info").getJSONArray("agent");
|
|
|
for (int i=0;i<jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
- if (jsonObject.getString("name").equals("工时管家")) {
|
|
|
+ if (jsonObject.getString("name").equals("客户管家")) {
|
|
|
int agentId = jsonObject.getInteger("agentid");
|
|
|
data.setAgentid(agentId);
|
|
|
//授权模式:0为管理员授权;1为成员授权
|
|
@@ -1330,94 +1330,10 @@ public class WeiXinCorpController {
|
|
|
//设置来源
|
|
|
company.setRegFrom("企业微信");
|
|
|
companyMapper.insert(company);
|
|
|
- //生成项目的成本基线默认条目
|
|
|
- String[] array = Constant.DEFAULT_BASE_COST_ITEMS;
|
|
|
- for (String baseItem : array) {
|
|
|
- ProjectBasecostSetting setting = new ProjectBasecostSetting();
|
|
|
- setting.setName(baseItem);
|
|
|
- setting.setCompanyId(company.getId());
|
|
|
- projectBasecostSettingMapper.insert(setting);
|
|
|
- }
|
|
|
- //生成费用报销默认条目
|
|
|
- String[] expenseTypes = Constant.EXPENSE_TYPES;
|
|
|
- List<String> commonly = new ArrayList<>();
|
|
|
- commonly.add("材料费");
|
|
|
- //commonly.add(MessageUtils.message("entry.materialCost"));
|
|
|
- commonly.add("办公用品");
|
|
|
- //commonly.add(MessageUtils.message("entry.workCost"));
|
|
|
- commonly.add("培训费");
|
|
|
- //commonly.add(MessageUtils.message("entry.trainCost"));
|
|
|
- commonly.add("打印费");
|
|
|
- //commonly.add(MessageUtils.message("entry.printCost"));
|
|
|
- commonly.add("快递费");
|
|
|
- //commonly.add(MessageUtils.message("entry.expressCost"));
|
|
|
- commonly.add("制作费");
|
|
|
- //commonly.add(MessageUtils.message("entry.makeCost"));
|
|
|
- commonly.add("律师费");
|
|
|
- //commonly.add(MessageUtils.message("entry.lawyerCost"));
|
|
|
- commonly.add("水费");
|
|
|
- //commonly.add(MessageUtils.message("entry.waterCost"));
|
|
|
- commonly.add("电费");
|
|
|
- //commonly.add(MessageUtils.message("entry.electricCost"));
|
|
|
- commonly.add("团建费");
|
|
|
- //commonly.add(MessageUtils.message("entry.leagueCost"));
|
|
|
- commonly.add("其他");
|
|
|
- //commonly.add(MessageUtils.message("entry.other"));
|
|
|
- List<String> travel = new ArrayList<>();
|
|
|
- travel.add("城市间交通费");
|
|
|
- //travel.add(MessageUtils.message("entry.cityTrafficCost"));
|
|
|
- travel.add("住宿费");
|
|
|
- //travel.add(MessageUtils.message("entry.liveCost"));
|
|
|
- travel.add("伙食补助费");
|
|
|
- //travel.add(MessageUtils.message("entry.eatCost"));
|
|
|
- travel.add("市内交通费");
|
|
|
- //travel.add(MessageUtils.message("entry.insideCityCost"));
|
|
|
- travel.add("其他差旅费");
|
|
|
- //travel.add(MessageUtils.message("entry.otherLiveTraCost"));
|
|
|
- List<String> outsource = new ArrayList<>();
|
|
|
- outsource.add("项目外包费");
|
|
|
- //outsource.add(MessageUtils.message("entry.projectCost"));
|
|
|
- outsource.add("劳务外包费");
|
|
|
- //outsource.add(MessageUtils.message("entry.labourCost"));
|
|
|
- outsource.add("其他外包费");
|
|
|
- //outsource.add(MessageUtils.message("entry.OtherOutsourceCost"));
|
|
|
- List<ExpenseType> expenseTypeList=new ArrayList<>();
|
|
|
- List<ExpenseMainType> expenseMainTypes=new ArrayList<>();
|
|
|
- ExpenseMainType expenseMainType=new ExpenseMainType();
|
|
|
- expenseMainType.setName("一般费用");
|
|
|
- expenseMainType.setCompanyId(company.getId());
|
|
|
- ExpenseMainType expenseMainType1=new ExpenseMainType();
|
|
|
- expenseMainType1.setName("差旅费用");
|
|
|
- expenseMainType1.setCompanyId(company.getId());
|
|
|
- ExpenseMainType expenseMainType2=new ExpenseMainType();
|
|
|
- expenseMainType2.setName("外包费用");
|
|
|
- expenseMainType2.setCompanyId(company.getId());
|
|
|
- expenseMainTypes.add(expenseMainType);
|
|
|
- expenseMainTypes.add(expenseMainType1);
|
|
|
- expenseMainTypes.add(expenseMainType2);
|
|
|
- expenseMainTypeService.saveBatch(expenseMainTypes);
|
|
|
- for (String expenseType : expenseTypes) {
|
|
|
- ExpenseType item=new ExpenseType();
|
|
|
- item.setCompanyId(company.getId());
|
|
|
- item.setTypeName(expenseType);
|
|
|
- if(commonly.contains(expenseType)){
|
|
|
- item.setMainType(expenseMainType.getId());
|
|
|
- }
|
|
|
- if(travel.contains(expenseType)){
|
|
|
- item.setMainType(expenseMainType1.getId());
|
|
|
- }
|
|
|
- if(outsource.contains(expenseType)){
|
|
|
- item.setMainType(expenseMainType2.getId());
|
|
|
- }
|
|
|
- expenseTypeList.add(item);
|
|
|
- }
|
|
|
- expenseTypeService.saveBatch(expenseTypeList);
|
|
|
|
|
|
//生成工作时长
|
|
|
TimeType timeType = new TimeType();
|
|
|
timeType.setCompanyId(company.getId());
|
|
|
- timeType.setFinanceJobnumEnabled(1);//启用工号来导入财务匹配
|
|
|
- timeType.setProjectManDay(1);//默认开启预估项目人天
|
|
|
timeTypeMapper.insert(timeType);
|
|
|
|
|
|
managerRole = sysRoleService.generateDefaultRoles(company.getId());
|
|
@@ -1449,72 +1365,7 @@ public class WeiXinCorpController {
|
|
|
.setCorpwxRealUserid(userId);
|
|
|
userMapper.insert(user);
|
|
|
System.out.println("生成超级管理员:"+userId);
|
|
|
- //todo: 生成初始测试项目及任务
|
|
|
- Project project=new Project();
|
|
|
- project.setCompanyId(company.getId());
|
|
|
- project.setInchargerId(user.getId());
|
|
|
- project.setInchargerName(user.getName());
|
|
|
- project.setCreatorId(user.getId());
|
|
|
- project.setCreatorName(user.getName());
|
|
|
- project.setCreateDate(LocalDate.now());
|
|
|
- project.setProjectCode("example");
|
|
|
- project.setProjectName("示例项目");
|
|
|
- //设置为公共项目,这样测试的用户都能填报
|
|
|
- project.setIsPublic(1);
|
|
|
- projectMapper.insert(project);
|
|
|
- //todo: 生成初始项目相关日报审核人
|
|
|
- ProjectAuditor projectAuditor=new ProjectAuditor();
|
|
|
- projectAuditor.setAuditorId(user.getId());
|
|
|
- projectAuditor.setAuditorName(user.getName());
|
|
|
- projectAuditor.setProjectId(project.getId());
|
|
|
- projectAuditorMapper.insert(projectAuditor);
|
|
|
- //todo: 生成项目报表服务默认条目
|
|
|
- Integer[] arrayInteger=new Integer[]{1,2,3,4,7};
|
|
|
- for (Integer integerItem : arrayInteger) {
|
|
|
- CompanyReport companyReport=new CompanyReport();
|
|
|
- companyReport.setCompanyId(company.getId());
|
|
|
- companyReport.setReportFormId(integerItem);
|
|
|
- companyReportMapper.insert(companyReport);
|
|
|
- }
|
|
|
- //todo: 生成初始项目相关示例任务分组/任务阶段以及示例任务
|
|
|
- TaskGroup taskGroup = new TaskGroup();
|
|
|
- taskGroup.setProjectId(project.getId())
|
|
|
- .setInchargerId(user.getId())
|
|
|
- .setName("项目阶段");
|
|
|
- taskGroupMapper.insert(taskGroup);
|
|
|
- Stages stage = new Stages();
|
|
|
- stage.setGroupId(taskGroup.getId());
|
|
|
- stage.setSequence(1);
|
|
|
- stage.setProjectId(project.getId());
|
|
|
- stage.setStagesName("工作开展");
|
|
|
- stagesMapper.insert(stage);
|
|
|
- Task task=new Task();
|
|
|
- TimeType timeType = timeTypeMapper.selectById(company.getId());
|
|
|
- Integer oneDayHours = 8;
|
|
|
-// task.setCreateDate(LocalDate.now());
|
|
|
-// task.setProjectId(project.getId());
|
|
|
-// task.setCompanyId(company.getId());
|
|
|
-// task.setCreaterId(user.getId());
|
|
|
-// task.setCreaterName(user.getName());
|
|
|
-// task.setCreatorColor(user.getColor());
|
|
|
-// task.setExecutorId(user.getId());
|
|
|
-// task.setExecutorColor(user.getColor());
|
|
|
-// task.setExecutorName(user.getName());
|
|
|
-// task.setPlanHours(oneDayHours);
|
|
|
-// task.setStagesId(stage.getId());
|
|
|
-// task.setGroupId(taskGroup.getId());
|
|
|
-// task.setSeq(0);
|
|
|
-// task.setName("示例任务");
|
|
|
- taskMapper.insert(task);
|
|
|
- //任务执行人表也要插入,不然会导致编辑任务的时候执行人为空
|
|
|
- TaskExecutor executor = new TaskExecutor();
|
|
|
- executor.setTaskId(task.getId());
|
|
|
- executor.setPlanHours(oneDayHours);
|
|
|
- executor.setProjectId(project.getId());
|
|
|
- executor.setExecutorId(user.getId());
|
|
|
- executor.setExecutorColor(user.getColor());
|
|
|
- executor.setExecutorName(user.getName());
|
|
|
- taskExecutorMapper.insert(executor);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
int companyId = company.getId();
|
|
@@ -1601,7 +1452,7 @@ public class WeiXinCorpController {
|
|
|
JSONArray jsonArray = obj.getJSONObject("auth_info").getJSONArray("agent");
|
|
|
for (int i=0;i<jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
- if (jsonObject.getString("name").equals("工时管家")) {
|
|
|
+ if (jsonObject.getString("name").equals("客户管家")) {
|
|
|
int agentId = jsonObject.getInteger("agentid");
|
|
|
data.setAgentid(agentId);
|
|
|
}
|
|
@@ -1801,9 +1652,9 @@ public class WeiXinCorpController {
|
|
|
boolean isMobile = "MOBILE".equals(deviceType);
|
|
|
String redirecUrl = null;
|
|
|
if (isMobile) {
|
|
|
- redirecUrl = "http://mobworktime.ttkuaiban.com";
|
|
|
+ redirecUrl = "http://mobcrm.ttkuaiban.com";
|
|
|
} else {
|
|
|
- redirecUrl = "http://worktime.ttkuaiban.com";
|
|
|
+ redirecUrl = "http://crm.ttkuaiban.com";
|
|
|
}
|
|
|
User curUser = userMapper.selectById(userId);
|
|
|
//https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN&code=CODE
|
|
@@ -2108,7 +1959,7 @@ public class WeiXinCorpController {
|
|
|
JSONArray jsonArray = json.getJSONObject("auth_info").getJSONArray("agent");
|
|
|
for (int i=0;i<jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
-// if (jsonObject.getString("name").equals("工时管家")) {
|
|
|
+// if (jsonObject.getString("name").equals("客户管家")) {
|
|
|
// System.out.println(jsonObject);
|
|
|
JSONObject privilege = jsonObject.getJSONObject("privilege");
|
|
|
allowUserList = privilege.getJSONArray("allow_user");
|
|
@@ -2244,8 +2095,8 @@ public class WeiXinCorpController {
|
|
|
JSONArray jsonArray = json.getJSONObject("auth_info").getJSONArray("agent");
|
|
|
for (int i=0;i<jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
- //用户可能会自定义应用名称,不一定是工时管家。
|
|
|
-// if (jsonObject.getString("name").equals("工时管家")) {
|
|
|
+ //用户可能会自定义应用名称,不一定是客户管家。
|
|
|
+// if (jsonObject.getString("name").equals("客户管家")) {
|
|
|
// System.out.println(jsonObject);
|
|
|
JSONObject privilege = jsonObject.getJSONObject("privilege");
|
|
|
allowUserList = privilege.getJSONArray("allow_user");
|
|
@@ -3335,7 +3186,7 @@ public class WeiXinCorpController {
|
|
|
JSONArray jsonArray = json.getJSONObject("auth_info").getJSONArray("agent");
|
|
|
for (int i=0;i<jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
-// if (jsonObject.getString("name").equals("工时管家")) {
|
|
|
+// if (jsonObject.getString("name").equals("客户管家")) {
|
|
|
System.out.println(jsonObject);
|
|
|
Integer authMode = jsonObject.getInteger("auth_mode");
|
|
|
if (!wxCorpInfo.getAuthMode().equals(authMode)) {
|
|
@@ -3809,23 +3660,23 @@ public class WeiXinCorpController {
|
|
|
JSONObject data = new JSONObject();
|
|
|
data.put("card_type", "news_notice");
|
|
|
JSONObject mainTitle = new JSONObject();
|
|
|
- mainTitle.put("title", "工时管家使用指南");
|
|
|
- mainTitle.put("desc", "欢迎使用工时管家,点击查看工时管家使用指南");
|
|
|
+ mainTitle.put("title", "客户管家使用指南");
|
|
|
+ mainTitle.put("desc", "欢迎使用客户管家,点击查看客户管家使用指南");
|
|
|
data.put("main_title", mainTitle);
|
|
|
JSONObject cardImg = new JSONObject();
|
|
|
- cardImg.put("url", "http://www.ttkuaiban.com/card_img.png");
|
|
|
+ cardImg.put("url", "https://crm.ttkuaiban.com/card_img.png");
|
|
|
cardImg.put("aspect_ratio", 2.35);
|
|
|
data.put("card_image", cardImg);
|
|
|
JSONArray array = new JSONArray();
|
|
|
JSONObject docItem = new JSONObject();
|
|
|
docItem.put("type", 1);
|
|
|
docItem.put("title", "使用指南");
|
|
|
- docItem.put("url", "https://www.ttkuaiban.com/download/%E5%B7%A5%E6%97%B6%E7%AE%A1%E5%AE%B6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%E4%B9%A6.pdf");
|
|
|
+ docItem.put("url", "https://crm.ttkuaiban.com/download/%E5%B7%A5%E6%97%B6%E7%AE%A1%E5%AE%B6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%E4%B9%A6.pdf");
|
|
|
array.add(docItem);
|
|
|
JSONObject enterItem = new JSONObject();
|
|
|
enterItem.put("type", 1);
|
|
|
enterItem.put("title", "进入应用");
|
|
|
- enterItem.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
|
|
|
+ enterItem.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwdd1137a65ce0fc87&redirect_uri=https://crm.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
|
|
|
array.add(enterItem);
|
|
|
data.put("jump_list", array);
|
|
|
JSONObject cardAction = new JSONObject();
|