|
|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
|
|
import cn.hutool.core.lang.Opt; |
|
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
|
import cn.hutool.core.util.EnumUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
|
import com.alibaba.excel.ExcelWriter; |
|
|
|
|
@ -168,6 +169,13 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public Result<Boolean> updateComplaintCollection(ComplaintCollectionUpdateRequest request) { |
|
|
|
|
// 只有市局管理员可以修改
|
|
|
|
|
Set<String> allowUpdateRoles = Set.of(RoleCodeEnum.FIRST_ADMIN.getCode(), RoleCodeEnum.ADMIN_1_12337.getCode()); |
|
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
|
List<String> roleCodes = user.getRoleCodes(); |
|
|
|
|
if (CollectionUtil.isEmpty(roleCodes) || roleCodes.stream().noneMatch(allowUpdateRoles::contains)) { |
|
|
|
|
throw new IllegalStateException("只有市局管理员可以修改!"); |
|
|
|
|
} |
|
|
|
|
String id = request.getId(); |
|
|
|
|
ComplaintCollectionExistParam existParam = new ComplaintCollectionExistParam(); |
|
|
|
|
existParam.setId(id); |
|
|
|
|
|