|
@@ -25,10 +25,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
-import org.jeecg.modules.ctop.entity.Project;
|
|
|
|
import org.jeecg.modules.ctop.service.IKuaiShouUploadService;
|
|
import org.jeecg.modules.ctop.service.IKuaiShouUploadService;
|
|
import org.jeecg.modules.ctop.service.IProjectMemberService;
|
|
import org.jeecg.modules.ctop.service.IProjectMemberService;
|
|
-import org.jeecg.modules.ctop.service.IProjectService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -342,77 +340,75 @@ public class MaterialInfoController {
|
|
Result<MaterialInfo> result = new Result<>();
|
|
Result<MaterialInfo> result = new Result<>();
|
|
MaterialInfo materialInfoEntity = materialInfoService.getById(materialInfo.getId());
|
|
MaterialInfo materialInfoEntity = materialInfoService.getById(materialInfo.getId());
|
|
if (materialInfoEntity == null) {
|
|
if (materialInfoEntity == null) {
|
|
- result.error500("未找到对应实体");
|
|
|
|
- } else {
|
|
|
|
- String url = materialInfo.getUrl();
|
|
|
|
- if (!Check.isNull(url)) {
|
|
|
|
- if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
|
|
|
|
- url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
|
|
|
|
- }
|
|
|
|
- materialInfo.setUrl(url);
|
|
|
|
|
|
+ return result.error500("未找到对应实体");
|
|
|
|
+ }
|
|
|
|
+ String url = materialInfo.getUrl();
|
|
|
|
+ if (!Check.isNull(url)) {
|
|
|
|
+ if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
|
|
|
|
+ url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
|
|
}
|
|
}
|
|
|
|
+ materialInfo.setUrl(url);
|
|
|
|
+ }
|
|
|
|
|
|
- // 修改素材库 相关联code
|
|
|
|
- if (!Check.isNull(materialInfo.getCode())) {
|
|
|
|
- String code = materialInfoEntity.getCode();
|
|
|
|
- if (!Check.isNull(code)) {
|
|
|
|
- MaterialTag updateMaterialTag = new MaterialTag();
|
|
|
|
- updateMaterialTag.setMaterialId(materialInfo.getCode());
|
|
|
|
- QueryWrapper<MaterialTag> tagQueryWrapper = new QueryWrapper<>();
|
|
|
|
- tagQueryWrapper.eq("material_id", code);
|
|
|
|
- materialTagService.update(updateMaterialTag, tagQueryWrapper);
|
|
|
|
- MaterialParameter updateParameter = new MaterialParameter();
|
|
|
|
- updateParameter.setMaterialId(materialInfo.getCode());
|
|
|
|
- QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
|
|
|
|
- parameterQueryWrapper.eq("material_id", code);
|
|
|
|
- materialParameterService.update(updateParameter, parameterQueryWrapper);
|
|
|
|
- MaterialAscription updateMaterialAscription = new MaterialAscription();
|
|
|
|
- updateMaterialAscription.setMaterialId(materialInfo.getCode());
|
|
|
|
- QueryWrapper<MaterialAscription> ascriptionQueryWrapper = new QueryWrapper<>();
|
|
|
|
- ascriptionQueryWrapper.eq("material_id", code);
|
|
|
|
- materialAscriptionService.update(updateMaterialAscription, ascriptionQueryWrapper);
|
|
|
|
- }
|
|
|
|
|
|
+ // 修改素材库 相关联code
|
|
|
|
+ if (!Check.isNull(materialInfo.getCode())) {
|
|
|
|
+ String code = materialInfoEntity.getCode();
|
|
|
|
+ if (!Check.isNull(code)) {
|
|
|
|
+ MaterialTag updateMaterialTag = new MaterialTag();
|
|
|
|
+ updateMaterialTag.setMaterialId(materialInfo.getCode());
|
|
|
|
+ QueryWrapper<MaterialTag> tagQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tagQueryWrapper.eq("material_id", code);
|
|
|
|
+ materialTagService.update(updateMaterialTag, tagQueryWrapper);
|
|
|
|
+ MaterialParameter updateParameter = new MaterialParameter();
|
|
|
|
+ updateParameter.setMaterialId(materialInfo.getCode());
|
|
|
|
+ QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ parameterQueryWrapper.eq("material_id", code);
|
|
|
|
+ materialParameterService.update(updateParameter, parameterQueryWrapper);
|
|
|
|
+ MaterialAscription updateMaterialAscription = new MaterialAscription();
|
|
|
|
+ updateMaterialAscription.setMaterialId(materialInfo.getCode());
|
|
|
|
+ QueryWrapper<MaterialAscription> ascriptionQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ ascriptionQueryWrapper.eq("material_id", code);
|
|
|
|
+ materialAscriptionService.update(updateMaterialAscription, ascriptionQueryWrapper);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- // 审核通过自动同步到到媒体后台
|
|
|
|
- /* Long projectId = materialInfoEntity.getProjectId();
|
|
|
|
- Project project = projectService.getById(projectId);
|
|
|
|
- if (!Check.isNull(projectId)) {
|
|
|
|
- if ("2".equals(project.getMediaId())) {
|
|
|
|
- if (!Check.isNull(materialInfo.getStatus())) {
|
|
|
|
- Integer status = materialInfo.getStatus();
|
|
|
|
- if (status == 1) {
|
|
|
|
- Thread thread = new Thread() {
|
|
|
|
- @Override
|
|
|
|
- public void run() {
|
|
|
|
- log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
|
|
|
|
- uploadService.upload(materialInfoEntity);
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- thread.start();
|
|
|
|
- }
|
|
|
|
|
|
+ // 审核通过自动同步到到媒体后台
|
|
|
|
+ /* Long projectId = materialInfoEntity.getProjectId();
|
|
|
|
+ Project project = projectService.getById(projectId);
|
|
|
|
+ if (!Check.isNull(projectId)) {
|
|
|
|
+ if ("2".equals(project.getMediaId())) {
|
|
|
|
+ if (!Check.isNull(materialInfo.getStatus())) {
|
|
|
|
+ Integer status = materialInfo.getStatus();
|
|
|
|
+ if (status == 1) {
|
|
|
|
+ Thread thread = new Thread() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
|
|
|
|
+ uploadService.upload(materialInfoEntity);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ thread.start();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
- boolean ok = materialInfoService.updateById(materialInfo);
|
|
|
|
- if (ok) {
|
|
|
|
- result.success("修改成功!");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- Integer status = materialInfo.getStatus();
|
|
|
|
- // 如果状态为2 审核拒绝 给上传人发送消息
|
|
|
|
- if (status == 2) {
|
|
|
|
- Project project = projectService.getById(materialInfoEntity.getProjectId());
|
|
|
|
- String text = messageTemplate.getMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
|
|
|
|
- sendMessageService.sendMessage(materialInfoEntity.getUserId(), text);
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
- String feishuText = messageTemplate.getFeishuMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
|
|
|
|
- sendMessageService.sendFeishuMessage(materialInfoEntity.getUserId(), feishuText);
|
|
|
|
- }
|
|
|
|
|
|
+ boolean ok = materialInfoService.updateById(materialInfo);
|
|
|
|
+ if (ok) {
|
|
|
|
+ result.success("修改成功!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Integer status = materialInfo.getStatus();
|
|
|
|
+ // 如果状态为2 审核拒绝 给上传人发送消息
|
|
|
|
+ if (status == 2) {
|
|
|
|
+ Project project = projectService.getById(materialInfoEntity.getProjectId());
|
|
|
|
+ String text = messageTemplate.getMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
|
|
|
|
+ sendMessageService.sendMessage(materialInfoEntity.getUserId(), text);
|
|
|
|
+
|
|
|
|
+ String feishuText = messageTemplate.getFeishuMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
|
|
|
|
+ sendMessageService.sendFeishuMessage(materialInfoEntity.getUserId(), feishuText);
|
|
|
|
+ }
|
|
return result;
|
|
return result;
|
|
|
|
|
|
}
|
|
}
|