|
@@ -10,7 +10,6 @@ import cn.com.ctop.common.module.entity.TagInfo;
|
|
import cn.com.ctop.common.module.mapper.MaterialAscriptionMapper;
|
|
import cn.com.ctop.common.module.mapper.MaterialAscriptionMapper;
|
|
import cn.com.ctop.common.module.mapper.MaterialInfoMapper;
|
|
import cn.com.ctop.common.module.mapper.MaterialInfoMapper;
|
|
import cn.com.ctop.common.module.mapper.MaterialParameterMapper;
|
|
import cn.com.ctop.common.module.mapper.MaterialParameterMapper;
|
|
-import cn.com.ctop.common.module.mapper.MaterialTagMapper;
|
|
|
|
import cn.com.ctop.common.module.service.IMaterialCutFrameService;
|
|
import cn.com.ctop.common.module.service.IMaterialCutFrameService;
|
|
import cn.com.ctop.common.module.service.IMaterialImageInfoService;
|
|
import cn.com.ctop.common.module.service.IMaterialImageInfoService;
|
|
import cn.com.ctop.common.module.service.IMaterialInfoService;
|
|
import cn.com.ctop.common.module.service.IMaterialInfoService;
|
|
@@ -131,7 +130,7 @@ public class DuxiaomanMaterialInfoServiceImpl extends ServiceImpl<DuxiaomanMater
|
|
private static ExecutorService uploadExecutorService = Executors.newFixedThreadPool(5);
|
|
private static ExecutorService uploadExecutorService = Executors.newFixedThreadPool(5);
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void getMaterialChannel() {
|
|
|
|
|
|
+ public JSONObject getMaterialChannel() {
|
|
String datetime = new Date().getTime() + "";
|
|
String datetime = new Date().getTime() + "";
|
|
TreeMap<String, Object> params = new TreeMap<>();
|
|
TreeMap<String, Object> params = new TreeMap<>();
|
|
params.put("app_id", duAppId);
|
|
params.put("app_id", duAppId);
|
|
@@ -144,13 +143,11 @@ public class DuxiaomanMaterialInfoServiceImpl extends ServiceImpl<DuxiaomanMater
|
|
String resultStr = HttpUtils.httpGetRequest(duUrl + KuaishouDuXiaoManAPIConstant.MATERIAL_CHANNEL, null, params);
|
|
String resultStr = HttpUtils.httpGetRequest(duUrl + KuaishouDuXiaoManAPIConstant.MATERIAL_CHANNEL, null, params);
|
|
JSONObject resultJson = JSONObject.parseObject(resultStr);
|
|
JSONObject resultJson = JSONObject.parseObject(resultStr);
|
|
log.info("----------查询渠道:{}", resultJson);
|
|
log.info("----------查询渠道:{}", resultJson);
|
|
- if (!Check.isNull(resultJson) && resultJson.getInteger("retCode") == 0) {
|
|
|
|
- JSONArray result = resultJson.getJSONArray("result");
|
|
|
|
- }
|
|
|
|
|
|
+ return resultJson;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void getmaterialType() {
|
|
|
|
|
|
+ public JSONObject getMaterialType() {
|
|
String datetime = new Date().getTime() + "";
|
|
String datetime = new Date().getTime() + "";
|
|
TreeMap<String, Object> params = new TreeMap<>();
|
|
TreeMap<String, Object> params = new TreeMap<>();
|
|
params.put("app_id", duAppId);
|
|
params.put("app_id", duAppId);
|
|
@@ -163,9 +160,7 @@ public class DuxiaomanMaterialInfoServiceImpl extends ServiceImpl<DuxiaomanMater
|
|
String resultStr = HttpUtils.httpGetRequest(duUrl + KuaishouDuXiaoManAPIConstant.MATERIAL_TYPE, null, params);
|
|
String resultStr = HttpUtils.httpGetRequest(duUrl + KuaishouDuXiaoManAPIConstant.MATERIAL_TYPE, null, params);
|
|
JSONObject resultJson = JSONObject.parseObject(resultStr);
|
|
JSONObject resultJson = JSONObject.parseObject(resultStr);
|
|
log.info("----------查询通用素材分类:{}", resultJson);
|
|
log.info("----------查询通用素材分类:{}", resultJson);
|
|
- if (!Check.isNull(resultJson) && resultJson.getInteger("retCode") == 0) {
|
|
|
|
- JSONArray result = resultJson.getJSONArray("result");
|
|
|
|
- }
|
|
|
|
|
|
+ return resultJson;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -211,11 +206,6 @@ public class DuxiaomanMaterialInfoServiceImpl extends ServiceImpl<DuxiaomanMater
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
- public void materialDetail2(DuxiaomanMaterialInfo materialInfo) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 素材报备
|
|
* 素材报备
|
|
*/
|
|
*/
|
|
@@ -252,7 +242,8 @@ public class DuxiaomanMaterialInfoServiceImpl extends ServiceImpl<DuxiaomanMater
|
|
String resultStr = HttpUtils.httpPostRequest(duUrl + KuaishouDuXiaoManAPIConstant.MATERIAL_REPORT, params, null);
|
|
String resultStr = HttpUtils.httpPostRequest(duUrl + KuaishouDuXiaoManAPIConstant.MATERIAL_REPORT, params, null);
|
|
JSONObject resultJson = JSONObject.parseObject(resultStr);
|
|
JSONObject resultJson = JSONObject.parseObject(resultStr);
|
|
log.info("----------素材报备:{}", resultJson);
|
|
log.info("----------素材报备:{}", resultJson);
|
|
- if (!Check.isNull(resultJson) && resultJson.getInteger("retCode") == 0) {
|
|
|
|
|
|
+ if ((!Check.isNull(resultJson) && resultJson.getInteger("retCode") == 0)
|
|
|
|
+ || (!Check.isNull(resultJson) && resultJson.getInteger("retCode") == 1 && resultJson.getString("retMsg").contains("已送审"))) {
|
|
//2:审批中
|
|
//2:审批中
|
|
materialInfo.setStatus(2);
|
|
materialInfo.setStatus(2);
|
|
materialInfo.setAuditTaskId(resultJson.getString("result"));
|
|
materialInfo.setAuditTaskId(resultJson.getString("result"));
|
|
@@ -288,8 +279,10 @@ public class DuxiaomanMaterialInfoServiceImpl extends ServiceImpl<DuxiaomanMater
|
|
if (!Check.isNull(resultJson) && resultJson.getInteger("retCode") == 0) {
|
|
if (!Check.isNull(resultJson) && resultJson.getInteger("retCode") == 0) {
|
|
JSONObject result = resultJson.getJSONObject("result");
|
|
JSONObject result = resultJson.getJSONObject("result");
|
|
Integer auditStatus = result.getInteger("audit_status");
|
|
Integer auditStatus = result.getInteger("audit_status");
|
|
|
|
+
|
|
materialInfo.setStatus(auditStatus);
|
|
materialInfo.setStatus(auditStatus);
|
|
materialInfo.setConfirmTime(result.getString("audit_time"));
|
|
materialInfo.setConfirmTime(result.getString("audit_time"));
|
|
|
|
+ materialInfo.setRefuseReason(result.getString("audit_reason"));
|
|
//3 审核通过 同步到素材表
|
|
//3 审核通过 同步到素材表
|
|
if (auditStatus == 3) {
|
|
if (auditStatus == 3) {
|
|
syncMaterial(materialInfo);
|
|
syncMaterial(materialInfo);
|