施工产值报错
This commit is contained in:
@ -19,9 +19,9 @@ public interface OutConstructionValueMapper extends BaseMapperPlus<OutConstructi
|
||||
|
||||
@Select({
|
||||
"<script>",
|
||||
"select sum(out_value) from out_construction_value where project_id = #{projectId} and audit_status = 'finish'",
|
||||
"select sum(v.out_value) from out_construction_value v left join out_construction_value_range r on v.range_id = r.id where v.project_id = #{projectId} and r.audit_status = 'finish'",
|
||||
"<if test='month != null and month != \"\"'>",
|
||||
"and DATE_FORMAT(report_date, '%Y-%m') = #{month}",
|
||||
"and DATE_FORMAT(v.report_date, '%Y-%m') = #{month}",
|
||||
"</if>",
|
||||
"</script>"
|
||||
})
|
||||
@ -29,9 +29,9 @@ public interface OutConstructionValueMapper extends BaseMapperPlus<OutConstructi
|
||||
|
||||
@Select({
|
||||
"<script>",
|
||||
"select sum(owner_value) from out_construction_value where project_id = #{projectId} and audit_status = 'finish'",
|
||||
"select sum(v.owner_value) from out_construction_value v left join out_construction_value_range r on v.range_id = r.id where v.project_id = #{projectId} and r.audit_status = 'finish'",
|
||||
"<if test='month != null and month != \"\"'>",
|
||||
"and DATE_FORMAT(report_date, '%Y-%m') = #{month}",
|
||||
"and DATE_FORMAT(v.report_date, '%Y-%m') = #{month}",
|
||||
"</if>",
|
||||
"</script>"
|
||||
})
|
||||
|
||||
@ -245,6 +245,24 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
||||
.set(SubConstructionUser::getTeamName, projectTeam.getTeamName());
|
||||
constructionUserService.update(constructionUserLuw);
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(req.getPostId()) && !oldProjectTeamMember.getPostId().equals(req.getPostId())){
|
||||
//设置基础角色 先清空已有角色
|
||||
userRoleMapper.delete(Wrappers.<SysUserRole>lambdaQuery()
|
||||
.eq(SysUserRole::getUserId, constructionUser.getSysUserId())
|
||||
.eq(SysUserRole::getProjectId, req.getProjectId())
|
||||
.in(SysUserRole::getRoleId, Arrays.asList(2L, 3L))
|
||||
);
|
||||
//再添加分配角色
|
||||
Long roleId = "0".equals(req.getPostId()) ? 2L : 3L;
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(constructionUser.getSysUserId());
|
||||
sysUserRole.setRoleId(roleId);
|
||||
sysUserRole.setProjectId(req.getProjectId());
|
||||
userRoleMapper.insert(sysUserRole);
|
||||
|
||||
roleService.cleanOnlineUser(Collections.singletonList(constructionUser.getSysUserId()));
|
||||
}
|
||||
// 操作数据库
|
||||
return this.updateById(projectTeamMember);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.dromara.transferData.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -40,6 +41,7 @@ import java.util.stream.Collectors;
|
||||
@RestController
|
||||
@RequestMapping("/transferData")
|
||||
@Slf4j
|
||||
@SaIgnore
|
||||
public class TransferDataController {
|
||||
|
||||
@Resource
|
||||
|
||||
Reference in New Issue
Block a user