|
@@ -540,22 +540,79 @@ public class WeiXinCorpController {
|
|
|
org.json.JSONObject jsonObject = XML.toJSONObject(sMsg);
|
|
|
log.info("json=="+jsonObject.toString());
|
|
|
jsonObject = jsonObject.getJSONObject("xml");
|
|
|
-
|
|
|
- //存储更新订单、更新公司续费情况
|
|
|
+ //订单回调。存储更新订单、更新公司续费情况
|
|
|
if (jsonObject.has("InfoType")){
|
|
|
+ System.err.println("+++++++++++++++++++订单回调开始++++++++++++++++++++++");
|
|
|
+ System.err.println(jsonObject);
|
|
|
String infoType = jsonObject.getString("InfoType");
|
|
|
- //open_order:下单成功通知; change_order:改单通知; pay_for_app_success:支付成功通知;
|
|
|
- //refund:退款通知; change_editon:付费版本变更通知;
|
|
|
- if ("open_order".equals(infoType) || "change_order".equals(infoType) || "pay_for_app_success".equals(infoType) || "refund".equals(infoType) || "change_editon".equals(infoType)){
|
|
|
- boolean b = saveOrderAndUpCompany(jsonObject);
|
|
|
- if (!b){
|
|
|
- System.out.println("+++++++++++++++++++微信应用市场付费回调处理失败+++++++++++++++++++++++");
|
|
|
- System.out.println(jsonObject);
|
|
|
- }
|
|
|
+ String orderId = "";
|
|
|
+ if (jsonObject.has("OrderId")){
|
|
|
+ orderId = jsonObject.getString("OrderId");
|
|
|
+ }else {
|
|
|
+ orderId = jsonObject.getString("NewOrderId");
|
|
|
+ }
|
|
|
+ WxOrder wxOrder = null;
|
|
|
+ switch (infoType){
|
|
|
+ case "open_order"://open_order:下单成功通知
|
|
|
+ System.err.println("###########################下单成功");
|
|
|
+ wxOrder = getOrder(orderId);
|
|
|
+ if (wxOrder!=null){
|
|
|
+ wxOrderMapper.insert(wxOrder);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "pay_for_app_success"://pay_for_app_success:支付成功通知
|
|
|
+ System.err.println("###########################订单支付成功");
|
|
|
+ wxOrder = getOrder(orderId);
|
|
|
+ if (wxOrder!=null){
|
|
|
+ wxOrderMapper.updateById(wxOrder);
|
|
|
+ WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("corpid", wxOrder.getPaidCorpid()));
|
|
|
+ if (wxCorpInfo!=null){
|
|
|
+ System.err.println("#######################要进行更改有效期的公司信息为:"+ wxCorpInfo.toString());
|
|
|
+ Company newCompany = new Company();
|
|
|
+ LocalDateTime endTime = wxOrder.getEndTime();
|
|
|
+ newCompany.setId(wxCorpInfo.getCompanyId());
|
|
|
+ newCompany.setExpirationDate(endTime);
|
|
|
+ companyMapper.updateById(newCompany);
|
|
|
+ System.out.println("有效期变更为:" + endTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "change_editon"://change_editon:付费版本变更通知
|
|
|
+ System.err.println("###########################付费版本变更");
|
|
|
+ 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());
|
|
|
+ versionChange(wxCorpInfo);
|
|
|
+ }else {
|
|
|
+ System.err.println("#############################" + paidCorpId + "该公司尚未授权开通,将在授权开通后为其变更版本及更新到期时间。");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "change_order"://change_order:改单通知
|
|
|
+ System.err.println("###########################改单通知");
|
|
|
+ wxOrder = getOrder(orderId);
|
|
|
+ if (wxOrder!=null){
|
|
|
+ wxOrder.setOldOrderid(jsonObject.getString("OldOrderId"));
|
|
|
+ wxOrderMapper.insert(wxOrder);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "refund"://refund:退款通知
|
|
|
+ System.err.println("###########################退款通知");
|
|
|
+ wxOrder = getOrder(orderId);
|
|
|
+ wxOrderMapper.updateById(wxOrder);
|
|
|
+ WxCorpInfo corpid = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("corpid", wxOrder.getPaidCorpid()));
|
|
|
+ if (corpid!=null){
|
|
|
+ Company newCompany = new Company();
|
|
|
+ newCompany.setId(corpid.getCompanyId());
|
|
|
+ //退款则将其到期时间设置为现在的时间减去一天
|
|
|
+ newCompany.setExpirationDate(LocalDateTime.now().minusDays(1));
|
|
|
+ companyMapper.updateById(newCompany);
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (jsonObject.has("AuthCode")) {
|
|
|
//企业授权通知
|
|
|
String authCode = jsonObject.getString("AuthCode");
|
|
@@ -2823,178 +2880,6 @@ public class WeiXinCorpController {
|
|
|
return cnt>0;
|
|
|
}
|
|
|
|
|
|
- private boolean saveOrderAndUpCompany(org.json.JSONObject jsonObject) throws Exception {
|
|
|
- System.err.println("+++++++++++++++++++订单回调开始++++++++++++++++++++++");
|
|
|
- String infoType = jsonObject.getString("InfoType");
|
|
|
- String suiteAccessToken = getSuiteAccessToken();
|
|
|
- System.out.println("++++++++++++++++++++suiteAccessToken为:"+suiteAccessToken);
|
|
|
- HttpHeaders headers = new HttpHeaders();
|
|
|
- RestTemplate restTemplate = new RestTemplate();
|
|
|
- MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
- headers.setContentType(type);
|
|
|
- headers.add("Accept", MediaType.APPLICATION_JSON.toString());
|
|
|
- //版本变更
|
|
|
- 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 wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("corpid", paidCorpId));
|
|
|
- if(wxCorpInfo != null){
|
|
|
- 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());
|
|
|
- HttpEntity<JSONObject> detailEntity = new HttpEntity<>(map, headers);
|
|
|
- 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":
|
|
|
- newCompany.setPackageProject(0);
|
|
|
- newCompany.setPackageOa(0);
|
|
|
- newCompany.setPackageExpense(0);
|
|
|
- newCompany.setPackageCustomer(0);
|
|
|
- newCompany.setPackageEngineering(0);
|
|
|
- newCompany.setPackageProvider(0);
|
|
|
- break;
|
|
|
- //专业版
|
|
|
- case "sp4a30d92ede178afd":
|
|
|
- newCompany.setPackageProject(1);//项目协作平台
|
|
|
- newCompany.setPackageOa(0);//OA平台;请假,出差等
|
|
|
- newCompany.setPackageExpense(1);//费用报销
|
|
|
- newCompany.setPackageCustomer(0);//客户管理
|
|
|
- newCompany.setPackageEngineering(0);//工程专业
|
|
|
- newCompany.setPackageProvider(0);//供应商模块
|
|
|
- break;
|
|
|
- //建筑版
|
|
|
- case "spd04f1b0582a0fe19":
|
|
|
- newCompany.setPackageProject(1);//项目协作平台
|
|
|
- newCompany.setPackageOa(0);//OA平台;请假,出差等
|
|
|
- newCompany.setPackageExpense(1);//费用报销
|
|
|
- newCompany.setPackageCustomer(1);//客户管理
|
|
|
- newCompany.setPackageEngineering(1);//工程专业
|
|
|
- newCompany.setPackageProvider(0);//供应商模块
|
|
|
- break;
|
|
|
- //旗舰版
|
|
|
- case "sp69f71e42798c7f55":
|
|
|
- newCompany.setPackageProject(1);//项目协作平台
|
|
|
- newCompany.setPackageOa(1);//OA平台;请假,出差等
|
|
|
- newCompany.setPackageExpense(1);//费用报销
|
|
|
- newCompany.setPackageCustomer(1);//客户管理
|
|
|
- newCompany.setPackageEngineering(0);//工程专业
|
|
|
- newCompany.setPackageProvider(1);//供应商模块
|
|
|
- break;
|
|
|
- }
|
|
|
- companyMapper.updateById(newCompany);
|
|
|
- System.out.println(company.getCompanyName()+"已成功变更版本,版本号为:"+edition_id);
|
|
|
- }else {
|
|
|
- System.out.println("++++++++++++++++++++++"+"版本变更失败!"+"++++++++++++++++++++++++");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }else {
|
|
|
- System.err.println("#############################" + paidCorpId + "该公司尚未授权开通,将在授权开通后为其变更版本及更新到期时间。");
|
|
|
- }
|
|
|
- }else {
|
|
|
- String orderId = "";
|
|
|
- if (jsonObject.has("OrderId")){
|
|
|
- orderId = jsonObject.getString("OrderId");
|
|
|
- }else {
|
|
|
- orderId = jsonObject.getString("NewOrderId");
|
|
|
- }
|
|
|
- WxOrder wxOrder = new WxOrder();
|
|
|
- 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);
|
|
|
- ResponseEntity<String> detailResponseEntity = restTemplate.postForEntity(detailUrl, detailEntity, String.class);
|
|
|
- String body = detailResponseEntity.getBody();
|
|
|
- System.out.println("+++++++++++++++++++++++++++++++++++++++订单详情信息!");
|
|
|
- System.out.println(body);
|
|
|
- JSONObject orderDetail = JSONObject.parseObject(body);
|
|
|
- if (orderDetail.getInteger("errcode")==0){
|
|
|
- wxOrder.setOrderid(orderDetail.getString("orderid"));
|
|
|
- wxOrder.setOrderStatus(orderDetail.getInteger("order_status"));
|
|
|
- wxOrder.setOrderType(orderDetail.getInteger("order_type"));
|
|
|
- wxOrder.setPaidCorpid(orderDetail.getString("paid_corpid"));
|
|
|
- if (orderDetail.containsKey("operator_id")){
|
|
|
- wxOrder.setOperatorId(orderDetail.getString("operator_id"));
|
|
|
- }
|
|
|
- wxOrder.setSuiteid(orderDetail.getString("suiteid"));
|
|
|
- wxOrder.setEditionId(orderDetail.getString("edition_id"));
|
|
|
- wxOrder.setEditionName(orderDetail.getString("edition_name"));
|
|
|
- wxOrder.setPrice(orderDetail.getInteger("price"));
|
|
|
- wxOrder.setUserCount(orderDetail.getInteger("user_count"));
|
|
|
- wxOrder.setOrderPeriod(orderDetail.getInteger("order_period"));
|
|
|
- LocalDateTime order_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("order_time"),0,ZoneOffset.ofHours(8));
|
|
|
- wxOrder.setOrderTime(order_time);
|
|
|
- if (orderDetail.getLong("paid_time")!=0){
|
|
|
- LocalDateTime paid_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("paid_time"),0,ZoneOffset.ofHours(8));
|
|
|
- wxOrder.setPaidTime(paid_time);
|
|
|
- }
|
|
|
- if (orderDetail.getLong("begin_time")!=0){
|
|
|
- LocalDateTime begin_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("begin_time"),0,ZoneOffset.ofHours(8));
|
|
|
- wxOrder.setBeginTime(begin_time);
|
|
|
- }
|
|
|
- if (orderDetail.getLong("end_time")!=0){
|
|
|
- LocalDateTime end_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("end_time"),0,ZoneOffset.ofHours(8));
|
|
|
- wxOrder.setEndTime(end_time);
|
|
|
- }
|
|
|
- wxOrder.setOrderFrom(orderDetail.getInteger("order_from"));
|
|
|
- wxOrder.setOperatorCorpid(orderDetail.getString("operator_corpid"));
|
|
|
- wxOrder.setServiceShareAmount(orderDetail.getInteger("service_share_amount"));
|
|
|
- wxOrder.setPlatformShareAmount(orderDetail.getInteger("platform_share_amount"));
|
|
|
- wxOrder.setDealerShareAmount(orderDetail.getInteger("dealer_share_amount"));
|
|
|
- if (orderDetail.containsKey("dealer_corp_info")){
|
|
|
- JSONObject dealer_corp_info = orderDetail.getJSONObject("dealer_corp_info");
|
|
|
- wxOrder.setDealerCorpid(dealer_corp_info.getString("corpid"));
|
|
|
- wxOrder.setDealerCorpName(dealer_corp_info.getString("corp_name"));
|
|
|
- }
|
|
|
- //获取该公司对象
|
|
|
- WxCorpInfo corpid = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("corpid", wxOrder.getPaidCorpid()));
|
|
|
- //订单支付成功
|
|
|
- if("pay_for_app_success".equals(infoType)){
|
|
|
- System.err.println("###########################订单支付成功");
|
|
|
- wxOrderMapper.updateById(wxOrder);
|
|
|
- if (corpid!=null){
|
|
|
- Company company = companyMapper.selectById(corpid.getCompanyId());
|
|
|
- System.err.println("#######################要进行更改有效期的公司信息为:"+ company.toString());
|
|
|
- Company newCompany = new Company();
|
|
|
- LocalDateTime endTime = wxOrder.getEndTime();
|
|
|
- newCompany.setId(company.getId());
|
|
|
- newCompany.setExpirationDate(endTime);
|
|
|
- companyMapper.updateById(newCompany);
|
|
|
- System.out.println("有效期变更为:" + endTime);
|
|
|
- }
|
|
|
- }else if ("refund".equals(infoType)){
|
|
|
- //订单退款
|
|
|
- wxOrderMapper.updateById(wxOrder);
|
|
|
- if (corpid!=null){
|
|
|
- Company company = companyMapper.selectById(corpid.getCompanyId());
|
|
|
- //退款则将其到期时间设置为现在的时间减去一天
|
|
|
- company.setExpirationDate(LocalDateTime.now().minusDays(1));
|
|
|
- companyMapper.updateById(company);
|
|
|
- }
|
|
|
- }else if ("open_order".equals(infoType)){
|
|
|
- wxOrderMapper.insert(wxOrder);
|
|
|
- }else if ("change_order".equals(infoType)){
|
|
|
- wxOrder.setOldOrderid(jsonObject.getString("OldOrderId"));
|
|
|
- wxOrderMapper.insert(wxOrder);
|
|
|
- }
|
|
|
- }else {
|
|
|
- System.out.println("+++++++++++++"+"微信订单查询更新失败"+"+++++++++++++++");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
@RequestMapping("getCorpAuthInfo")
|
|
|
public HttpRespMsg getCorpAuthInfo(String corpId) throws Exception {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
@@ -3034,4 +2919,135 @@ public class WeiXinCorpController {
|
|
|
|
|
|
return new HttpRespMsg();
|
|
|
}
|
|
|
+
|
|
|
+ //查询订单
|
|
|
+ private WxOrder getOrder (String orderId) throws Exception {
|
|
|
+ String suiteAccessToken = getSuiteAccessToken();
|
|
|
+ System.out.println("++++++++++++++++++++suiteAccessToken为:"+suiteAccessToken);
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ RestTemplate restTemplate = new RestTemplate();
|
|
|
+ MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
+ headers.setContentType(type);
|
|
|
+ headers.add("Accept", MediaType.APPLICATION_JSON.toString());
|
|
|
+ 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);
|
|
|
+ ResponseEntity<String> detailResponseEntity = restTemplate.postForEntity(detailUrl, detailEntity, String.class);
|
|
|
+ String body = detailResponseEntity.getBody();
|
|
|
+ System.out.println("+++++++++++++++++++++++++++++++++++++++订单详情信息!");
|
|
|
+ System.out.println(body);
|
|
|
+ JSONObject orderDetail = JSONObject.parseObject(body);
|
|
|
+ WxOrder wxOrder = new WxOrder();
|
|
|
+ if (orderDetail.getInteger("errcode")==0){
|
|
|
+ wxOrder.setOrderid(orderDetail.getString("orderid"));
|
|
|
+ wxOrder.setOrderStatus(orderDetail.getInteger("order_status"));
|
|
|
+ wxOrder.setOrderType(orderDetail.getInteger("order_type"));
|
|
|
+ wxOrder.setPaidCorpid(orderDetail.getString("paid_corpid"));
|
|
|
+ if (orderDetail.containsKey("operator_id")){
|
|
|
+ wxOrder.setOperatorId(orderDetail.getString("operator_id"));
|
|
|
+ }
|
|
|
+ wxOrder.setSuiteid(orderDetail.getString("suiteid"));
|
|
|
+ wxOrder.setEditionId(orderDetail.getString("edition_id"));
|
|
|
+ wxOrder.setEditionName(orderDetail.getString("edition_name"));
|
|
|
+ wxOrder.setPrice(orderDetail.getInteger("price"));
|
|
|
+ wxOrder.setUserCount(orderDetail.getInteger("user_count"));
|
|
|
+ wxOrder.setOrderPeriod(orderDetail.getInteger("order_period"));
|
|
|
+ LocalDateTime order_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("order_time"),0,ZoneOffset.ofHours(8));
|
|
|
+ wxOrder.setOrderTime(order_time);
|
|
|
+ if (orderDetail.getLong("paid_time")!=0){
|
|
|
+ LocalDateTime paid_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("paid_time"),0,ZoneOffset.ofHours(8));
|
|
|
+ wxOrder.setPaidTime(paid_time);
|
|
|
+ }
|
|
|
+ if (orderDetail.getLong("begin_time")!=0){
|
|
|
+ LocalDateTime begin_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("begin_time"),0,ZoneOffset.ofHours(8));
|
|
|
+ wxOrder.setBeginTime(begin_time);
|
|
|
+ }
|
|
|
+ if (orderDetail.getLong("end_time")!=0){
|
|
|
+ LocalDateTime end_time =LocalDateTime.ofEpochSecond(orderDetail.getLong("end_time"),0,ZoneOffset.ofHours(8));
|
|
|
+ wxOrder.setEndTime(end_time);
|
|
|
+ }
|
|
|
+ wxOrder.setOrderFrom(orderDetail.getInteger("order_from"));
|
|
|
+ wxOrder.setOperatorCorpid(orderDetail.getString("operator_corpid"));
|
|
|
+ wxOrder.setServiceShareAmount(orderDetail.getInteger("service_share_amount"));
|
|
|
+ wxOrder.setPlatformShareAmount(orderDetail.getInteger("platform_share_amount"));
|
|
|
+ wxOrder.setDealerShareAmount(orderDetail.getInteger("dealer_share_amount"));
|
|
|
+ if (orderDetail.containsKey("dealer_corp_info")){
|
|
|
+ JSONObject dealer_corp_info = orderDetail.getJSONObject("dealer_corp_info");
|
|
|
+ wxOrder.setDealerCorpid(dealer_corp_info.getString("corpid"));
|
|
|
+ wxOrder.setDealerCorpName(dealer_corp_info.getString("corp_name"));
|
|
|
+ }
|
|
|
+ return wxOrder;
|
|
|
+ }else {
|
|
|
+ System.out.println("+++++++++++++"+"微信订单查询更新失败"+"+++++++++++++++");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //版本变更
|
|
|
+ private void versionChange (WxCorpInfo wxCorpInfo) throws Exception {
|
|
|
+ String suiteAccessToken = getSuiteAccessToken();
|
|
|
+ System.out.println("++++++++++++++++++++suiteAccessToken为:"+suiteAccessToken);
|
|
|
+ String url = "https://qyapi.weixin.qq.com/cgi-bin/service/get_auth_info?suite_access_token="+suiteAccessToken;
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ RestTemplate restTemplate = new RestTemplate();
|
|
|
+ MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
+ headers.setContentType(type);
|
|
|
+ headers.add("Accept", MediaType.APPLICATION_JSON.toString());
|
|
|
+ JSONObject map = new JSONObject();
|
|
|
+ map.put("auth_corpid",wxCorpInfo.getCorpid());
|
|
|
+ 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());
|
|
|
+ System.out.println("+++++++++++++++++++++++++版本更新信息为:"+json);
|
|
|
+ Company newCompany = new Company();
|
|
|
+ newCompany.setId(wxCorpInfo.getCompanyId());
|
|
|
+ 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":
|
|
|
+ newCompany.setPackageProject(0);
|
|
|
+ newCompany.setPackageOa(0);
|
|
|
+ newCompany.setPackageExpense(0);
|
|
|
+ newCompany.setPackageCustomer(0);
|
|
|
+ newCompany.setPackageEngineering(0);
|
|
|
+ newCompany.setPackageProvider(0);
|
|
|
+ break;
|
|
|
+ //专业版
|
|
|
+ case "sp4a30d92ede178afd":
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(0);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(0);//客户管理
|
|
|
+ newCompany.setPackageEngineering(0);//工程专业
|
|
|
+ newCompany.setPackageProvider(0);//供应商模块
|
|
|
+ break;
|
|
|
+ //建筑版
|
|
|
+ case "spd04f1b0582a0fe19":
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(0);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(1);//客户管理
|
|
|
+ newCompany.setPackageEngineering(1);//工程专业
|
|
|
+ newCompany.setPackageProvider(0);//供应商模块
|
|
|
+ break;
|
|
|
+ //旗舰版
|
|
|
+ case "sp69f71e42798c7f55":
|
|
|
+ newCompany.setPackageProject(1);//项目协作平台
|
|
|
+ newCompany.setPackageOa(1);//OA平台;请假,出差等
|
|
|
+ newCompany.setPackageExpense(1);//费用报销
|
|
|
+ newCompany.setPackageCustomer(1);//客户管理
|
|
|
+ newCompany.setPackageEngineering(0);//工程专业
|
|
|
+ newCompany.setPackageProvider(1);//供应商模块
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ companyMapper.updateById(newCompany);
|
|
|
+ System.out.println("已成功变更版本,版本号为:"+edition_id);
|
|
|
+ }else {
|
|
|
+ System.out.println("++++++++++++++++++++++"+"版本变更失败!"+"++++++++++++++++++++++++");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|