修改切換角色
This commit is contained in:
+18
-14
@@ -2,6 +2,7 @@ package com.jero.modules.project.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.utils.IOUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -1012,17 +1013,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
|
||||
/**
|
||||
* 批量更新状态
|
||||
* @param params
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<?> updateStatusBatch(Map<String, Object> params) {
|
||||
public Result<?> updateStatusBatch(JSONObject json) {
|
||||
String result = "";
|
||||
//operatorType: 0:studio工程师发起清单确认 1:法规工程师/认证工程师 (提交或拒绝)
|
||||
String operatorType = (String) params.get("operatorType");
|
||||
String projectLibraryId = (String) params.get("projectLibraryId");//项目id
|
||||
String cut = (String) params.get("cut");//中英文切换标识
|
||||
String ids = (String) params.get("ids");
|
||||
String operatorType = json.getString("operatorType");
|
||||
String projectLibraryId = json.getString("projectLibraryId");//项目id
|
||||
String cut = json.getString("cut");//中英文切换标识
|
||||
if(StringUtils.isEmpty(operatorType)){
|
||||
throw new JeroBootException("操作类型不能为空!");
|
||||
}
|
||||
@@ -1030,11 +1030,13 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
try {
|
||||
//TODO 切换成枚举,不要在代码里出现魔数
|
||||
if(StringUtils.equals(operatorType, OperatorTypeEnum.INVENTORY_AFFIRM.getValue())){
|
||||
String ids = json.getString("ids");
|
||||
|
||||
//验证用户是否是该项目的studio
|
||||
isStudio(projectLibraryId,cut);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//清单确认截止时间
|
||||
String inventoryAffirmDueDate = (String) params.get("inventoryAffirmDueDate");
|
||||
String inventoryAffirmDueDate = json.getString("inventoryAffirmDueDate");
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
if(StringUtils.isNotEmpty(ids)){
|
||||
@@ -1098,7 +1100,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
result = "发起清单确认";
|
||||
}else if(StringUtils.equals(operatorType,OperatorTypeEnum.SUBMIT_OR_REJECTED.getValue())){
|
||||
//提交结果 0通过 1拒绝
|
||||
String operatorResult = (String) params.get("operatorResult");
|
||||
String operatorResult = json.getString("operatorResult");
|
||||
if(StringUtils.equals(operatorResult, OperatorResultEnum.ACCEPTED.getValue())){
|
||||
result = "提交";
|
||||
}else if(StringUtils.equals(operatorResult, OperatorResultEnum.REJECTED.getValue())){
|
||||
@@ -1145,11 +1147,13 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
}
|
||||
}*/
|
||||
|
||||
List<Map<String,Object>> lawsInventoryList = (List<Map<String, Object>>) params.get("lawsInventoryList");
|
||||
JSONArray lawsInventoryList = json.getJSONArray("lawsInventoryList");
|
||||
if(CollectionUtils.isNotEmpty(lawsInventoryList)){
|
||||
lawsInventoryList.forEach(lawsInventory -> {
|
||||
int isProjectRole = (int) lawsInventory.get("roleCode");
|
||||
String id = (String) lawsInventory.get("id");
|
||||
Map<String,Object> lawsInventoryMap = null;
|
||||
for (Object lawsInventory : lawsInventoryList) {
|
||||
lawsInventoryMap = JSONObject.parseObject(JSONObject.toJSONString(lawsInventory),Map.class);
|
||||
int isProjectRole = (int) lawsInventoryMap.get("roleCode");
|
||||
String id = (String) lawsInventoryMap.get("id");
|
||||
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = getById(id);
|
||||
|
||||
@@ -1184,7 +1188,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
}
|
||||
super.baseMapper.updateById(projectLawsInventoryEO);
|
||||
}
|
||||
});
|
||||
}
|
||||
}else {
|
||||
throw new JeroBootException("请至少勾选一条法规清单进行" + result);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
{{ $t('add') }}
|
||||
</div>
|
||||
<div class="operator-text" @click="roleSwitchingClick">
|
||||
<a-icon type="setting"/>
|
||||
<a-icon type="select"/>
|
||||
{{ $t('roleSwitching') }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -133,7 +133,7 @@
|
||||
</div>
|
||||
<div class="operator-text" v-if="this.$route.query.studioEngineer == this.userInfo().id"
|
||||
@click="roleSwitchingClick">
|
||||
<a-icon type="setting"/>
|
||||
<a-icon type="select"/>
|
||||
{{ $t('roleSwitching') }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1206,7 +1206,7 @@
|
||||
...this.formInline
|
||||
}
|
||||
this.confirmLoading = true
|
||||
getAction(this.url.updateStatusBatch, query).then((res) => {
|
||||
postAction(this.url.updateStatusBatch, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
@@ -1342,7 +1342,7 @@
|
||||
projectLibraryId: _this.$route.query.id,
|
||||
operatorResult: num
|
||||
}
|
||||
getAction(_this.url.updateStatusBatch, query).then((res) => {
|
||||
postAction(_this.url.updateStatusBatch, query).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.visible = false
|
||||
|
||||
Reference in New Issue
Block a user