|
|
|
@@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxAppinfo; |
|
|
|
import com.iformall.domain.po.WxWeappExtSet; |
|
|
|
import com.iformall.domain.vo.WxWeappInfo; |
|
|
|
import com.iformall.service.WxAuthorizerInfoService; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
import com.iformall.service.WxWeappExtSetService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
@@ -31,6 +31,9 @@ import java.util.List; |
|
|
|
public class WxWeappExtSetController extends BaseController { |
|
|
|
private final Logger logger = LoggerFactory.getLogger(getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxAppinfoService appinfoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxWeappExtSetService weappExtSetService; |
|
|
|
|
|
|
|
@@ -78,16 +81,30 @@ public class WxWeappExtSetController extends BaseController { |
|
|
|
if(extObj == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
JSONObject attrObj = extObj.getJSONObject("attr"); |
|
|
|
if(attrObj == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
WxWeappExtSet extSetQ = new WxWeappExtSet(); |
|
|
|
extSetQ.setType(weappExtSet.getType()); |
|
|
|
List<WxWeappExtSet> weappExtSetList = weappExtSetService.getList(extSetQ); |
|
|
|
for(WxWeappExtSet info: weappExtSetList) { |
|
|
|
WxAppinfo appinfo = appinfoService.getByAppId(info.getAppId()); |
|
|
|
if(appinfo == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
obj.put("extAppid", info.getAppId()); |
|
|
|
if(attrObj != null) { |
|
|
|
attrObj.put("ifHaveCarModular", String.valueOf(info.getCarSupport())); |
|
|
|
} |
|
|
|
if(extObj != null) { |
|
|
|
extObj.put("weappId", info.getAppId()); |
|
|
|
extObj.put("name", appinfo.getName()); |
|
|
|
extObj.put("attr", attrObj); |
|
|
|
obj.put("ext", extObj); |
|
|
|
} |
|
|
|
info.setExtJson(JSON.toJSONString(obj)); |
|
|
|
|
|
|
|
try { |
|
|
|
weappExtSetService.saveOrUpdate(info); |
|
|
|
} catch (Exception e) { |
|
|
|
|