This commit is contained in:
Vinjor 2024-10-16 17:15:14 +08:00
commit fab9fd8e8f
2 changed files with 18 additions and 5 deletions

View File

@ -161,15 +161,15 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
BigDecimal reduce = respVO.getWares().stream().map(DlRepairTitem::getItemMoney).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal reduce = respVO.getWares().stream().map(DlRepairTitem::getItemMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
repairTicketsService.update(new LambdaUpdateWrapper<DlRepairTickets>() repairTicketsService.update(new LambdaUpdateWrapper<DlRepairTickets>()
// 工单子项总数量增加上配件的数量 // 工单子项总数量增加上配件的数量
.setSql("count = count" + respVO.getWares().size()) .setSql("count = count + " + respVO.getWares().size())
// 工单配件总价 // 工单配件总价
.setSql("part_price = part_price" + reduce) .setSql("part_price = part_price + " + reduce)
// 工单总价 // 工单总价
.setSql("total_price = total_price" + reduce) .setSql("total_price = total_price + " + reduce)
// 参考成本 // 参考成本
.setSql("cost = cost" + reduce) .setSql("cost = cost + " + reduce)
// 参考毛利 // 参考毛利
.setSql("profit = profit" + reduce) .setSql("profit = profit + " + reduce)
// 领料状态 // 领料状态
.set(DlRepairTickets::getPartStatus, "02") .set(DlRepairTickets::getPartStatus, "02")
.eq(DlRepairTickets::getId, respVO.getTicketId()) .eq(DlRepairTickets::getId, respVO.getTicketId())

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.permission;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleDataScopeReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleDataScopeReqVO;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleMenuReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleMenuReqVO;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignUserRoleReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignUserRoleReqVO;
@ -79,4 +80,16 @@ public class PermissionController {
return success(true); return success(true);
} }
/**
* 用来判断角色
*
* @author 小李
* @date 9:47 2024/10/16
* @param code 角色标识
**/
@Operation(summary = "判断是否是对应的角色")
@GetMapping("/checkRole")
public CommonResult<?> checkRole(@RequestParam("code") String code) {
return success(permissionService.hasAnyRoles(SecurityFrameworkUtils.getLoginUserId(), code));
}
} }