|
@@ -1198,50 +1198,52 @@ public class WeiXinCorpController {
|
|
|
System.err.println("该公司corpId为:"+corpId);
|
|
|
WxOrder wxOrder = wxOrderMapper.selectOne(new QueryWrapper<WxOrder>().eq("paid_corpid",corpId).eq("order_status",1).orderByDesc("paid_time"));
|
|
|
if (wxOrder != null){
|
|
|
+ Company newCompany = new Company();
|
|
|
+ newCompany.setId(company.getId());
|
|
|
System.err.println("########################查询到该新建企业" + company.getCompanyName() + "已支付过订单,进行版本变更");
|
|
|
String editionId = wxOrder.getEditionId();
|
|
|
switch (editionId){
|
|
|
//基础版
|
|
|
case "sp17da4a6e6f2a91f8":
|
|
|
- company.setPackageProject(0);
|
|
|
- company.setPackageOa(0);
|
|
|
- company.setPackageExpense(0);
|
|
|
- company.setPackageCustomer(0);
|
|
|
- company.setPackageEngineering(0);
|
|
|
- company.setPackageProvider(0);
|
|
|
+ newCompany.setPackageProject(0);
|
|
|
+ newCompany.setPackageOa(0);
|
|
|
+ newCompany.setPackageExpense(0);
|
|
|
+ newCompany.setPackageCustomer(0);
|
|
|
+ newCompany.setPackageEngineering(0);
|
|
|
+ newCompany.setPackageProvider(0);
|
|
|
break;
|
|
|
//专业版
|
|
|
case "sp4a30d92ede178afd":
|
|
|
- company.setPackageProject(1);//项目协作平台
|
|
|
- company.setPackageOa(0);//OA平台;请假,出差等
|
|
|
- company.setPackageExpense(1);//费用报销
|
|
|
- company.setPackageCustomer(0);//客户管理
|
|
|
- company.setPackageEngineering(0);//工程专业
|
|
|
- company.setPackageProvider(0);//供应商模块
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(0);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(0);//客户管理
|
|
|
+ newCompany.setPackageEngineering(0);//工程专业
|
|
|
+ newCompany.setPackageProvider(0);//供应商模块
|
|
|
break;
|
|
|
//建筑版
|
|
|
case "spd04f1b0582a0fe19":
|
|
|
- company.setPackageProject(1);//项目协作平台
|
|
|
- company.setPackageOa(0);//OA平台;请假,出差等
|
|
|
- company.setPackageExpense(1);//费用报销
|
|
|
- company.setPackageCustomer(1);//客户管理
|
|
|
- company.setPackageEngineering(1);//工程专业
|
|
|
- company.setPackageProvider(0);//供应商模块
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(0);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(1);//客户管理
|
|
|
+ newCompany.setPackageEngineering(1);//工程专业
|
|
|
+ newCompany.setPackageProvider(0);//供应商模块
|
|
|
break;
|
|
|
//旗舰版
|
|
|
case "sp69f71e42798c7f55":
|
|
|
- company.setPackageProject(1);//项目协作平台
|
|
|
- company.setPackageOa(1);//OA平台;请假,出差等
|
|
|
- company.setPackageExpense(1);//费用报销
|
|
|
- company.setPackageCustomer(1);//客户管理
|
|
|
- company.setPackageEngineering(0);//工程专业
|
|
|
- company.setPackageProvider(1);//供应商模块
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(1);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(1);//客户管理
|
|
|
+ newCompany.setPackageEngineering(0);//工程专业
|
|
|
+ newCompany.setPackageProvider(1);//供应商模块
|
|
|
break;
|
|
|
}
|
|
|
LocalDateTime endTime = wxOrder.getEndTime();
|
|
|
- company.setExpirationDate(endTime);
|
|
|
- System.out.println("版本变更成功,到期时间更新成功。版本变更后的信息为:" + company.toString());
|
|
|
- companyMapper.updateById(company);
|
|
|
+ newCompany.setExpirationDate(endTime);
|
|
|
+ companyMapper.updateById(newCompany);
|
|
|
+ System.out.println("版本变更成功,到期时间更新成功。");
|
|
|
}else {
|
|
|
System.out.println("未查询到该新建公司有支付订单");
|
|
|
}
|
|
@@ -2837,9 +2839,9 @@ public class WeiXinCorpController {
|
|
|
String paidCorpId = jsonObject.getString("PaidCorpId");
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("corpid", paidCorpId));
|
|
|
if(wxCorpInfo != null){
|
|
|
- System.err.println("版本变更的公司信息为:");
|
|
|
- System.err.println(wxCorpInfo.toString());
|
|
|
Company company = companyMapper.selectById(wxCorpInfo.getCompanyId());
|
|
|
+ System.err.println("版本变更的公司信息为:");
|
|
|
+ System.err.println(company.toString());
|
|
|
JSONObject map = new JSONObject();
|
|
|
map.put("auth_corpid",wxCorpInfo.getCorpid());
|
|
|
map.put("permanent_code",wxCorpInfo.getPermanentCode());
|
|
@@ -2847,48 +2849,50 @@ public class WeiXinCorpController {
|
|
|
ResponseEntity<String> detailResponseEntity = restTemplate.postForEntity(url, detailEntity, String.class);
|
|
|
JSONObject json = JSONObject.parseObject(detailResponseEntity.getBody());
|
|
|
System.out.println("+++++++++++++++++++++++++版本更新信息为:"+json);
|
|
|
+ Company newCompany = new Company();
|
|
|
+ newCompany.setId(company.getId());
|
|
|
if (json.containsKey("auth_corp_info")){
|
|
|
String edition_id = json.getJSONObject("edition_info").getJSONArray("agent")
|
|
|
.getJSONObject(0).getString("edition_id");
|
|
|
switch (edition_id){
|
|
|
//基础版
|
|
|
case "sp17da4a6e6f2a91f8":
|
|
|
- company.setPackageProject(0);
|
|
|
- company.setPackageOa(0);
|
|
|
- company.setPackageExpense(0);
|
|
|
- company.setPackageCustomer(0);
|
|
|
- company.setPackageEngineering(0);
|
|
|
- company.setPackageProvider(0);
|
|
|
+ newCompany.setPackageProject(0);
|
|
|
+ newCompany.setPackageOa(0);
|
|
|
+ newCompany.setPackageExpense(0);
|
|
|
+ newCompany.setPackageCustomer(0);
|
|
|
+ newCompany.setPackageEngineering(0);
|
|
|
+ newCompany.setPackageProvider(0);
|
|
|
break;
|
|
|
//专业版
|
|
|
case "sp4a30d92ede178afd":
|
|
|
- company.setPackageProject(1);//项目协作平台
|
|
|
- company.setPackageOa(0);//OA平台;请假,出差等
|
|
|
- company.setPackageExpense(1);//费用报销
|
|
|
- company.setPackageCustomer(0);//客户管理
|
|
|
- company.setPackageEngineering(0);//工程专业
|
|
|
- company.setPackageProvider(0);//供应商模块
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(0);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(0);//客户管理
|
|
|
+ newCompany.setPackageEngineering(0);//工程专业
|
|
|
+ newCompany.setPackageProvider(0);//供应商模块
|
|
|
break;
|
|
|
//建筑版
|
|
|
case "spd04f1b0582a0fe19":
|
|
|
- company.setPackageProject(1);//项目协作平台
|
|
|
- company.setPackageOa(0);//OA平台;请假,出差等
|
|
|
- company.setPackageExpense(1);//费用报销
|
|
|
- company.setPackageCustomer(1);//客户管理
|
|
|
- company.setPackageEngineering(1);//工程专业
|
|
|
- company.setPackageProvider(0);//供应商模块
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(0);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(1);//客户管理
|
|
|
+ newCompany.setPackageEngineering(1);//工程专业
|
|
|
+ newCompany.setPackageProvider(0);//供应商模块
|
|
|
break;
|
|
|
//旗舰版
|
|
|
case "sp69f71e42798c7f55":
|
|
|
- company.setPackageProject(1);//项目协作平台
|
|
|
- company.setPackageOa(1);//OA平台;请假,出差等
|
|
|
- company.setPackageExpense(1);//费用报销
|
|
|
- company.setPackageCustomer(1);//客户管理
|
|
|
- company.setPackageEngineering(0);//工程专业
|
|
|
- company.setPackageProvider(1);//供应商模块
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(1);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(1);//客户管理
|
|
|
+ newCompany.setPackageEngineering(0);//工程专业
|
|
|
+ newCompany.setPackageProvider(1);//供应商模块
|
|
|
break;
|
|
|
}
|
|
|
- companyMapper.updateById(company);
|
|
|
+ companyMapper.updateById(newCompany);
|
|
|
System.out.println(company.getCompanyName()+"已成功变更版本,版本号为:"+edition_id);
|
|
|
}else {
|
|
|
System.out.println("++++++++++++++++++++++"+"版本变更失败!"+"++++++++++++++++++++++++");
|
|
@@ -2961,10 +2965,12 @@ public class WeiXinCorpController {
|
|
|
if (corpid!=null){
|
|
|
Company company = companyMapper.selectById(corpid.getCompanyId());
|
|
|
System.err.println("#######################要进行更改有效期的公司信息为:"+ company.toString());
|
|
|
+ Company newCompany = new Company();
|
|
|
LocalDateTime endTime = wxOrder.getEndTime();
|
|
|
- company.setExpirationDate(endTime);
|
|
|
- companyMapper.updateById(company);
|
|
|
- System.out.println("更改有效期后的公司信息为:" + company.toString());
|
|
|
+ newCompany.setId(company.getId());
|
|
|
+ newCompany.setExpirationDate(endTime);
|
|
|
+ companyMapper.updateById(newCompany);
|
|
|
+ System.out.println("有效期变更为:" + endTime);
|
|
|
}
|
|
|
}else if ("refund".equals(infoType)){
|
|
|
//订单退款
|