|
@@ -15,9 +15,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.entity.SysUser;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -124,7 +126,33 @@ public class MaterialAscriptionController {
|
|
|
|
|
|
@PutMapping(value = "/update")
|
|
|
public Result<MaterialAscription> update(@RequestBody MaterialAscription materialAscription) {
|
|
|
+
|
|
|
+
|
|
|
Result<MaterialAscription> result = new Result<>();
|
|
|
+ String materialId = materialAscription.getMaterialId();
|
|
|
+ if (!Check.isNull(materialId)) {
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ String id = user.getId();
|
|
|
+ log.info("当前登陆人ID:{}",id);
|
|
|
+
|
|
|
+ String createId = materialAscriptionService.getUserIdByCode(materialId);
|
|
|
+ log.info("素材上传人人ID:{}",createId);
|
|
|
+
|
|
|
+ if (!id.equals(createId)) {
|
|
|
+ result.error500("非上传人不可修改");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* if (!id.equals("e9ca23d68d884d4ebb19d07889727dae")) {
|
|
|
+ if (!id.equals(createId)) {
|
|
|
+ result.error500("非上传人不可修改");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
String shotName = "";
|
|
|
String shotId = materialAscription.getShotId();
|
|
|
if (!Check.isNull(shotId)) {
|
|
@@ -132,10 +160,10 @@ public class MaterialAscriptionController {
|
|
|
String shotCode = sysUserService.getRoleCodeByUserId(shotId);
|
|
|
shotName = shot.getRealname();
|
|
|
materialAscription.setShotName(shotName);
|
|
|
- if("designTeamLeader".equals(shotCode)){
|
|
|
+ if ("designTeamLeader".equals(shotCode)) {
|
|
|
materialAscription.setShotLeaderId(shotId);
|
|
|
materialAscription.setShotLeaderName(shot.getRealname());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
materialAscription.setShotLeaderId(shot.getLeaderId());
|
|
|
materialAscription.setShotLeaderName(shot.getLeaderName());
|
|
|
}
|
|
@@ -157,17 +185,17 @@ public class MaterialAscriptionController {
|
|
|
clipName = clip.getRealname();
|
|
|
materialAscription.setClipName(clipName);
|
|
|
String roleCode = sysUserService.getRoleCodeByUserId(clipId);
|
|
|
- log.info("剪辑人员名称:"+clip.getRealname()+";ID:"+clipId);
|
|
|
+ log.info("剪辑人员名称:" + clip.getRealname() + ";ID:" + clipId);
|
|
|
String leaderName = "";
|
|
|
String leaderId = "";
|
|
|
- if("designTeamLeader".equals(roleCode)){
|
|
|
+ if ("designTeamLeader".equals(roleCode)) {
|
|
|
leaderId = clipId;
|
|
|
leaderName = clip.getRealname();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
leaderId = clip.getLeaderId();
|
|
|
leaderName = clip.getLeaderName();
|
|
|
}
|
|
|
- log.info("负责人名称:"+leaderName+";ID:"+leaderId);
|
|
|
+ log.info("负责人名称:" + leaderName + ";ID:" + leaderId);
|
|
|
materialAscription.setLeaderName(leaderName);
|
|
|
materialAscription.setLeaderId(leaderId);
|
|
|
}
|