|
@@ -3,10 +3,10 @@ package cn.iselab.mooctest.site.web.logic.impl;
|
|
import cn.iselab.mooctest.site.dao.User2SalesPackageDao;
|
|
import cn.iselab.mooctest.site.dao.User2SalesPackageDao;
|
|
import cn.iselab.mooctest.site.service.OpenId2UserIdService;
|
|
import cn.iselab.mooctest.site.service.OpenId2UserIdService;
|
|
import cn.iselab.mooctest.site.service.User2ThemeService;
|
|
import cn.iselab.mooctest.site.service.User2ThemeService;
|
|
-import cn.iselab.mooctest.site.service.UserPackageService;
|
|
|
|
import cn.iselab.mooctest.site.web.logic.ProductProcessLogic;
|
|
import cn.iselab.mooctest.site.web.logic.ProductProcessLogic;
|
|
-import org.json.JSONArray;
|
|
|
|
-import org.json.JSONObject;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|
* @Author: xuexb
|
|
* @Author: xuexb
|
|
* @Date: 2019.7.5 1:00
|
|
* @Date: 2019.7.5 1:00
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
public class ProductProcessLogicImpl implements ProductProcessLogic {
|
|
public class ProductProcessLogicImpl implements ProductProcessLogic {
|
|
|
|
|
|
@@ -29,10 +30,12 @@ public class ProductProcessLogicImpl implements ProductProcessLogic {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public boolean sendProduct(JSONObject productDetails) {
|
|
public boolean sendProduct(JSONObject productDetails) {
|
|
|
|
+ log.info("productDetails: "+productDetails);
|
|
try{
|
|
try{
|
|
JSONArray entities = productDetails.getJSONArray("product2entities");
|
|
JSONArray entities = productDetails.getJSONArray("product2entities");
|
|
Long userId = openId2UserIdService.findUserIdByOpenId(productDetails.getString("user"));
|
|
Long userId = openId2UserIdService.findUserIdByOpenId(productDetails.getString("user"));
|
|
- for (int i=0; i<entities.length(); i++) {
|
|
|
|
|
|
+ log.info("userId"+userId);
|
|
|
|
+ for (int i=0; i<entities.size(); i++) {
|
|
JSONObject entity = entities.getJSONObject(i);
|
|
JSONObject entity = entities.getJSONObject(i);
|
|
switch (entity.getString("entityType")){//根据不同Type进行不同处理
|
|
switch (entity.getString("entityType")){//根据不同Type进行不同处理
|
|
case "THEME":
|
|
case "THEME":
|
|
@@ -44,6 +47,7 @@ public class ProductProcessLogicImpl implements ProductProcessLogic {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
|
+ log.error("添加关联出错", e);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|