|
@@ -2701,7 +2701,7 @@ public class WeiXinCorpController {
|
|
|
}
|
|
|
|
|
|
private boolean saveOrderAndUpCompany(org.json.JSONObject jsonObject) throws Exception {
|
|
|
- System.err.println("+++++++++++++++++++"+"订单回调时间"+"++++++++++++++++++++++");
|
|
|
+ System.err.println("+++++++++++++++++++"+"订单回调开始"+"++++++++++++++++++++++");
|
|
|
String infoType = jsonObject.getString("InfoType");
|
|
|
String suiteAccessToken = getSuiteAccessToken();
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
@@ -2713,18 +2713,19 @@ public class WeiXinCorpController {
|
|
|
if ("change_editon".equals(infoType)){
|
|
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/service/get_auth_info?suite_access_token="+suiteAccessToken;
|
|
|
String paidCorpId = jsonObject.getString("PaidCorpId");
|
|
|
- WxCorpInfo corpid = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("corpid", paidCorpId));
|
|
|
- Company company = companyMapper.selectById(corpid.getCompanyId());
|
|
|
+ WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("corpid", paidCorpId));
|
|
|
+ Company company = companyMapper.selectById(wxCorpInfo.getCompanyId());
|
|
|
JSONObject map = new JSONObject();
|
|
|
map.put("auth_corpid",corpId);
|
|
|
- map.put("permanent_code",corpid.getPermanentCode());
|
|
|
+ map.put("permanent_code",wxCorpInfo.getPermanentCode());
|
|
|
HttpEntity<JSONObject> detailEntity = new HttpEntity<>(map, headers);
|
|
|
ResponseEntity<String> detailResponseEntity = restTemplate.postForEntity(url, detailEntity, String.class);
|
|
|
JSONObject json = JSONObject.parseObject(detailResponseEntity.getBody());
|
|
|
- if (json.getInteger("errcode")==0){
|
|
|
- String editionName = json.getString("edition_name");
|
|
|
+ if (json.containsKey("auth_corp_info")){
|
|
|
+ String editionName = json.getString("edition_id");
|
|
|
switch (editionName){
|
|
|
- case "工时基础版":
|
|
|
+ //基础版
|
|
|
+ case "sp17da4a6e6f2a91f8":
|
|
|
company.setPackageProject(0);
|
|
|
company.setPackageOa(0);
|
|
|
company.setPackageExpense(0);
|
|
@@ -2732,7 +2733,8 @@ public class WeiXinCorpController {
|
|
|
company.setPackageEngineering(0);
|
|
|
company.setPackageProvider(0);
|
|
|
break;
|
|
|
- case "项目管理专业版":
|
|
|
+ //专业版
|
|
|
+ case "sp4a30d92ede178afd":
|
|
|
company.setPackageProject(1);//项目协作平台
|
|
|
company.setPackageOa(0);//OA平台;请假,出差等
|
|
|
company.setPackageExpense(1);//费用报销
|
|
@@ -2740,7 +2742,8 @@ public class WeiXinCorpController {
|
|
|
company.setPackageEngineering(0);//工程专业
|
|
|
company.setPackageProvider(0);//供应商模块
|
|
|
break;
|
|
|
- case "建筑工程管理专业版":
|
|
|
+ //建筑版
|
|
|
+ case "spd04f1b0582a0fe19":
|
|
|
company.setPackageProject(1);//项目协作平台
|
|
|
company.setPackageOa(0);//OA平台;请假,出差等
|
|
|
company.setPackageExpense(1);//费用报销
|
|
@@ -2748,7 +2751,8 @@ public class WeiXinCorpController {
|
|
|
company.setPackageEngineering(1);//工程专业
|
|
|
company.setPackageProvider(0);//供应商模块
|
|
|
break;
|
|
|
- case "企业办公旗舰版":
|
|
|
+ //旗舰版
|
|
|
+ case "sp69f71e42798c7f55":
|
|
|
company.setPackageProject(1);//项目协作平台
|
|
|
company.setPackageOa(1);//OA平台;请假,出差等
|
|
|
company.setPackageExpense(1);//费用报销
|
|
@@ -2770,7 +2774,7 @@ public class WeiXinCorpController {
|
|
|
orderId = jsonObject.getString("NewOrderId");
|
|
|
}
|
|
|
WxOrder wxOrder = new WxOrder();
|
|
|
- String detailUrl = " https://qyapi.weixin.qq.com/cgi-bin/service/get_order?suite_access_token=" + suiteAccessToken;
|
|
|
+ String detailUrl = "https://qyapi.weixin.qq.com/cgi-bin/service/get_order?suite_access_token=" + suiteAccessToken;
|
|
|
JSONObject detailMap = new JSONObject();
|
|
|
detailMap.put("orderid",orderId);
|
|
|
HttpEntity<JSONObject> detailEntity = new HttpEntity<>(detailMap, headers);
|