|
@@ -279,29 +279,38 @@ public class MatchLogic {
|
|
|
* @throws
|
|
|
* @author ZHAOXA
|
|
|
*/
|
|
|
- public static JSONArray getKuaiShouSendData(JSONArray accountDatas, JSONArray groupDatas, JSONArray planDatas, JSONArray creativeDatas, JSONArray targetDatas) {
|
|
|
+ public static JSONArray getKuaiShouSendData(JSONArray accountDatas, JSONArray planDatas, JSONArray groupDatas, JSONArray creativeDatas, JSONArray targetDatas) {
|
|
|
JSONArray sendData = new JSONArray();
|
|
|
if (!Check.isNull(accountDatas) && Check.isNull(groupDatas) && Check.isNull(planDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
|
|
|
sendData = accountDatas;
|
|
|
} else {
|
|
|
- if (Check.isNull(groupDatas)) {
|
|
|
- if (!Check.isNull(planDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
|
|
|
- sendData = planDatas;
|
|
|
- } else if (Check.isNull(planDatas) && !Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
|
|
|
+ if (Check.isNull(planDatas)) {
|
|
|
+ if (!Check.isNull(groupDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
|
|
|
+ sendData = groupDatas;
|
|
|
+ } else if (Check.isNull(groupDatas) && !Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
|
|
|
sendData = creativeDatas;
|
|
|
- } else if (Check.isNull(planDatas) && Check.isNull(creativeDatas) && !Check.isNull(targetDatas)) {
|
|
|
+ } else if (Check.isNull(groupDatas) && Check.isNull(creativeDatas) && !Check.isNull(targetDatas)) {
|
|
|
sendData = targetDatas;
|
|
|
}
|
|
|
} else {
|
|
|
- if (Check.isNull(planDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
|
|
|
- sendData = groupDatas;
|
|
|
- } else if (!Check.isNull(targetDatas)) {
|
|
|
- for (int i = 0; i < groupDatas.size(); i++) {
|
|
|
- Long gGroupId = groupDatas.getJSONObject(i).getLong("groupId");
|
|
|
- for (int k = 0; k < targetDatas.size(); k++) {
|
|
|
- Long tgGroupId = targetDatas.getJSONObject(k).getLong("groupId");
|
|
|
- if (tgGroupId == gGroupId) {
|
|
|
- sendData.add(creativeDatas.getJSONObject(k));
|
|
|
+ if (Check.isNull(groupDatas) && Check.isNull(creativeDatas) && Check.isNull(targetDatas)) {
|
|
|
+ sendData = planDatas;
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < planDatas.size(); i++) {
|
|
|
+ Long planId = planDatas.getJSONObject(i).getLong("planId");
|
|
|
+ if (!Check.isNull(targetDatas) && Check.isNull(groupDatas)) {
|
|
|
+ for (int k = 0; k < targetDatas.size(); k++) {
|
|
|
+ Long tgPlanId = targetDatas.getJSONObject(k).getLong("planId");
|
|
|
+ if (tgPlanId == planId) {
|
|
|
+ sendData.add(creativeDatas.getJSONObject(k));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (Check.isNull(targetDatas) && !Check.isNull(groupDatas)) {
|
|
|
+ for (int k = 0; k < groupDatas.size(); k++) {
|
|
|
+ Long tgPlanId = groupDatas.getJSONObject(k).getLong("planId");
|
|
|
+ if (tgPlanId == planId) {
|
|
|
+ sendData.add(creativeDatas.getJSONObject(k));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|