mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
基础配置权限修改,禅道-模糊,工序Bug修改
This commit is contained in:
+14
-2
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.service.plan;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -320,7 +321,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
queryWrapperX
|
||||
.eq("a.organ_id",getUserOrganId())
|
||||
.eq("a.status",OrderStatusEnum.NO_SORT.getStatus())
|
||||
.eqIfPresent("a.id", pageReqVO.getOrderId())
|
||||
.likeIfPresent("a.id", "%"+pageReqVO.getOrderId()+"%")
|
||||
.isNull("opi.item_id")
|
||||
.eqIfPresent("a.customer", pageReqVO.getConsignee())
|
||||
.eqIfPresent("a.custom_order_no", pageReqVO.getDefaultId())
|
||||
@@ -450,6 +451,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
.betweenIfPresent("a.height", new BigDecimal[]{vo.getLongMinRang(), vo.getLongMaxRang()})
|
||||
.inIfPresent("a.filter_type", filterTypes)
|
||||
.betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()})
|
||||
.orderByDesc("a.order_id")
|
||||
.orderByDesc("a.name");
|
||||
PageDTO<PlateResList> page = new PageDTO<>(vo.getPageNo(), vo.getPageSize());
|
||||
IPage<PlateResList> pageResult = plateMapper.selectPlateByPlanId(page, queryWrapperX);
|
||||
@@ -513,8 +515,18 @@ public class PlanServiceImpl implements PlanService {
|
||||
public List<PlateResList> getPlateList(List<Long> planIds) {
|
||||
|
||||
|
||||
return plateMapper.selectPlateListByPlanId(planIds,getUserOrganId());
|
||||
List<PlateResList> plateResLists = plateMapper.selectPlateListByPlanId(planIds, getUserOrganId());
|
||||
|
||||
Set<Long> bodyIds = plateResLists.stream().map(PlateResList::getBodyId).collect(Collectors.toSet());
|
||||
if (CollectionUtil.isNotEmpty(bodyIds)) {
|
||||
List<OrderBodyDO> orderBodyDOS = orderBodyMapper.selectBatchIds(bodyIds);
|
||||
for (PlateResList resList :plateResLists) {
|
||||
resList.setBodyName(orderBodyDOS.stream().filter(e -> Objects.equals(e.getId(), resList.getBodyId())).map(OrderBodyDO::getName).findAny().orElse(null));
|
||||
resList.setRoomName(orderBodyDOS.stream().filter(e -> Objects.equals(e.getRoomId(), resList.getRoomId())).map(OrderBodyDO::getRoomName).findAny().orElse(null));
|
||||
}
|
||||
}
|
||||
|
||||
return plateResLists;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -296,10 +296,10 @@
|
||||
|
||||
|
||||
select distinct a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
from order_plan_item p
|
||||
left join order_item b on p.item_id = b.id and b.organ_id = p.organ_id
|
||||
left join order_plate a on b.plate_id = a.id and b.order_id = a.order_id and b.organ_id = a.organ_id
|
||||
left join order_goods e on a.goods_id = e.id and a.order_id = e.order_id and a.organ_id = e.organ_id
|
||||
from order_plate a
|
||||
LEFT JOIN order_item b ON a.id = b.plate_id AND a.order_id = b.order_id and a.organ_id = b.organ_id
|
||||
LEFT JOIN order_goods e ON e.id = a.goods_id AND e.order_id = a.order_id and e.organ_id = a.organ_id
|
||||
LEFT JOIN order_plan_item p ON b.id = p.item_id and b.organ_id = p.organ_id
|
||||
|
||||
where p.organ_id = #{organId}
|
||||
and p.plan_id in
|
||||
|
||||
+7
-5
@@ -63,6 +63,7 @@ public class PackController {
|
||||
@GetMapping("/getOrderPlate")
|
||||
@Operation(summary = "查看生产订单对应的板材信息")
|
||||
@Parameter(name = "orderId", description = "生产单Id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack-palte:query')")
|
||||
public CommonResult<List<PlateDetailsRespVO>> getOrderPlateList(@Valid @RequestParam("orderId") Long orderId) {
|
||||
|
||||
return success(packService.getOrderPlateList(orderId));
|
||||
@@ -72,6 +73,7 @@ public class PackController {
|
||||
|
||||
@GetMapping("/getOrderPlateList")
|
||||
@Operation(summary = "查询多个生产单对应的板材信息")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack-palte:query')")
|
||||
public CommonResult<List<PlateDetailsRespVO>> getOrdersPlateList(@Valid @RequestParam List<Long> orderIds) {
|
||||
|
||||
return success(packService.getOrdersPlateList(orderIds));
|
||||
@@ -121,7 +123,7 @@ public class PackController {
|
||||
|
||||
@GetMapping("/getParts")
|
||||
@Operation(summary = "查看配件列表分页")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack-parts:query')")
|
||||
public CommonResult<PageResult<OrderPartsRespVO>> getParts(@Valid OrderPartsReqVO reqVO) {
|
||||
|
||||
return success(packService.getPartsList(reqVO));
|
||||
@@ -136,7 +138,7 @@ public class PackController {
|
||||
|
||||
@PutMapping("/updatePack")
|
||||
@Operation(summary = "板材包裹更新-即封包")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:updatePack')")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:update')")
|
||||
public CommonResult<OrderPackRespVO> updatePack(@Valid @RequestBody OrderPackReqVO packageVO) {
|
||||
|
||||
return success(packService.updatePack(packageVO));
|
||||
@@ -148,7 +150,7 @@ public class PackController {
|
||||
|
||||
@PutMapping("/updateParts")
|
||||
@Operation(summary = "配件包裹更新-即封包")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:updateParts')")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:update')")
|
||||
public CommonResult<OrderPackRespVO> updateParts(@Valid @RequestBody OrderPartsReqVO reqVO) {
|
||||
|
||||
return success(packService.updateParts(reqVO));
|
||||
@@ -162,7 +164,7 @@ public class PackController {
|
||||
@GetMapping("/selectPack")
|
||||
@Operation(summary = "查询包裹")
|
||||
@Parameter(name = "orderId", description = "生产单Id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:update')")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
|
||||
public CommonResult<List<OrderPackRespVO>> selectPack(@Valid @RequestParam("orderId") Long orderId) {
|
||||
|
||||
return success(packService.selectPack(orderId));
|
||||
@@ -186,7 +188,7 @@ public class PackController {
|
||||
|
||||
@PutMapping("/unpacking")
|
||||
@Operation(summary = "拆包-更改包裹为未封包")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:unpacking')")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:update')")
|
||||
public CommonResult<OrderPackRespVO> unpacking(@Valid @RequestBody PackingReqVO reqVO) {
|
||||
|
||||
OrderPackRespVO unpacking = packService.unpacking(reqVO.getPackageId());
|
||||
|
||||
+16
-8
@@ -44,14 +44,16 @@ public class PlateController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建板材信息表 plate_{N}")
|
||||
@PreAuthorize("@ss.hasPermission('manage:plate:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('manage:plate:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:plate:create','base:plate:create')")
|
||||
public CommonResult<Long> createPlate(@Valid @RequestBody PlateSaveReqVO createReqVO) {
|
||||
return success(plateService.createPlate(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新板材信息表 plate_{N}")
|
||||
@PreAuthorize("@ss.hasPermission('manage:plate:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('manage:plate:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:plate:update','base:plate:update')")
|
||||
public CommonResult<Boolean> updatePlate(@Valid @RequestBody PlateSaveReqVO updateReqVO) {
|
||||
plateService.updatePlate(updateReqVO);
|
||||
return success(true);
|
||||
@@ -63,7 +65,8 @@ public class PlateController {
|
||||
@Parameter(name = "id", description = "编号", required = true),
|
||||
@Parameter(name = "organId", description = "板材所属组织ID")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('manage:plate:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('manage:plate:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:plate:delete','base:plate:delete')")
|
||||
public CommonResult<Boolean> deletePlate(@RequestParam("id") Long id,
|
||||
@RequestParam(value = "organId",required = false) Long organId) {
|
||||
plateService.deletePlate(id,organId);
|
||||
@@ -73,7 +76,8 @@ public class PlateController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得板材信息表 plate_{N}")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('manage:plate:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('manage:plate:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:plate:query','base:plate:query')")
|
||||
public CommonResult<PlateRespVO> getPlate(@RequestParam("id") Long id) {
|
||||
PlateDO plate = plateService.getPlate(id);
|
||||
return success(BeanUtils.toBean(plate, PlateRespVO.class));
|
||||
@@ -81,7 +85,8 @@ public class PlateController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得板材信息表 plate_{N}分页")
|
||||
@PreAuthorize("@ss.hasPermission('manage:plate:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('manage:plate:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:plate:query','base:plate:query')")
|
||||
public CommonResult<PageResult<PlateRespVO>> getPlatePage(@Valid PlatePageReqVO pageReqVO) {
|
||||
PageResult<PlateDO> pageResult = plateService.getPlatePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlateRespVO.class));
|
||||
@@ -89,7 +94,8 @@ public class PlateController {
|
||||
|
||||
@GetMapping("/export")
|
||||
@Operation(summary = "导出板材信息")
|
||||
@PreAuthorize("@ss.hasPermission('manage:plate:export')")
|
||||
// @PreAuthorize("@ss.hasPermission('manage:plate:export')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:plate:export','base:plate:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportPlateExcel(@Valid PlatePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
@@ -102,7 +108,8 @@ public class PlateController {
|
||||
|
||||
@GetMapping("/get-import-template")
|
||||
@Operation(summary = "获得导入用户模板")
|
||||
@PreAuthorize("@ss.hasPermission('manage:plate:export')")
|
||||
// @PreAuthorize("@ss.hasPermission('manage:plate:export')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:plate:export','base:plate:export')")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
// 手动创建导出 demo
|
||||
List<PlateImportExcelVO> list = Arrays.asList(
|
||||
@@ -122,7 +129,8 @@ public class PlateController {
|
||||
@Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true"),
|
||||
@Parameter(name = "organId", description = "板材所属组织ID")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('manage:plate:import')")
|
||||
// @PreAuthorize("@ss.hasPermission('manage:plate:import')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:plate:import','base:plate:import')")
|
||||
public void importExcel(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport,
|
||||
@RequestParam(value = "organId") Long organId,
|
||||
|
||||
+8
-4
@@ -33,7 +33,8 @@ public class DeptController {
|
||||
|
||||
@PostMapping("create")
|
||||
@Operation(summary = "创建部门")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:create','base:dept:create')")
|
||||
public CommonResult<Long> createDept(@Valid @RequestBody DeptSaveReqVO createReqVO) {
|
||||
Long deptId = deptService.createDept(createReqVO);
|
||||
return success(deptId);
|
||||
@@ -41,7 +42,8 @@ public class DeptController {
|
||||
|
||||
@PutMapping("update")
|
||||
@Operation(summary = "更新部门")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:update','base:dept:update')")
|
||||
public CommonResult<Boolean> updateDept(@Valid @RequestBody DeptSaveReqVO updateReqVO) {
|
||||
deptService.updateDept(updateReqVO);
|
||||
return success(true);
|
||||
@@ -50,7 +52,8 @@ public class DeptController {
|
||||
@DeleteMapping("delete")
|
||||
@Operation(summary = "删除部门")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:delete','base:dept:delete')")
|
||||
public CommonResult<Boolean> deleteDept(@RequestParam("id") Long id) {
|
||||
deptService.deleteDept(id);
|
||||
return success(true);
|
||||
@@ -75,7 +78,8 @@ public class DeptController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得部门信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:query','base:dept:query')")
|
||||
public CommonResult<DeptRespVO> getDept(@RequestParam("id") Long id) {
|
||||
DeptDO dept = deptService.getDept(id);
|
||||
return success(BeanUtils.toBean(dept, DeptRespVO.class));
|
||||
|
||||
+2
-2
@@ -87,7 +87,7 @@ public class LabelTemplateController {
|
||||
@GetMapping("/getDefault")
|
||||
@Operation(summary = "获得默认标签模板")
|
||||
@Parameter(name = "type", description = "标签类型", required = true, example = "1024")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<LabelTemplateRespVO> getDefaultLabelTemplate(@RequestParam("type") String type) {
|
||||
return success(labelTemplateService.getDefaultLabelTemplate(type));
|
||||
@@ -95,7 +95,7 @@ public class LabelTemplateController {
|
||||
|
||||
@GetMapping("/setDefaultTemplate")
|
||||
@Operation(summary = "设置默认标签模板")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:update')")
|
||||
public CommonResult<Boolean> setDefaultTemplate(@RequestParam Long id) {
|
||||
return success(labelTemplateService.setDefaultTemplate(id));
|
||||
}
|
||||
|
||||
+4
-4
@@ -31,21 +31,21 @@ public class MachineAuthController {
|
||||
|
||||
@PostMapping("organ-auth")
|
||||
@Operation(summary = "组织机台授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-auth::update')")
|
||||
public CommonResult<Boolean> auth(@RequestBody MachineOrgAuthReq vo) {
|
||||
return success(machineService.auth(vo));
|
||||
}
|
||||
|
||||
@GetMapping("organ-page")
|
||||
@Operation(summary = "组织机台授权分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-auth::query')")
|
||||
public CommonResult<PageResult<OrganMachineResp>> organTemplatePage(OrganMachinePage page) {
|
||||
return success(machineService.organMachinePage(page));
|
||||
}
|
||||
|
||||
@GetMapping("organ-by-organId")
|
||||
@Operation(summary = "根据组织id查询组织机台授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-auth::query')")
|
||||
@Parameter(name = "organId", description = "组织id", required = true, example = "1")
|
||||
public CommonResult<OrganMachineResp> organTemplateByOrganId(@RequestParam Long organId ) {
|
||||
return success(machineService.organMachineByOrganId(organId));
|
||||
@@ -53,7 +53,7 @@ public class MachineAuthController {
|
||||
|
||||
@GetMapping("page-machine-auth")
|
||||
@Operation(summary = "授权机台分页")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-auth::query')")
|
||||
public CommonResult<PageResult<MachineAuthResp>> pageTemplateAuth(MachinePageReqVO pageParam) {
|
||||
PageResult<MachineDO> page = machineService.page(pageParam);
|
||||
List<MachineAuthResp> list = page.getList().stream().map(e->MachineAuthResp.builder()
|
||||
|
||||
+4
-4
@@ -30,21 +30,21 @@ public class MachineTemplateAuthController {
|
||||
|
||||
@PostMapping("organ-auth-template")
|
||||
@Operation(summary = "组织模板授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template-auth::update')")
|
||||
public CommonResult<Boolean> auth(@RequestBody MachineOrgAuthReq vo) {
|
||||
return success(machineTemplateService.auth(vo));
|
||||
}
|
||||
|
||||
@GetMapping("organ-template-page")
|
||||
@Operation(summary = "组织模板授权分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template-auth::query')")
|
||||
public CommonResult<PageResult<OrganTemplateResp>> organTemplatePage(OrganTemplatePage page) {
|
||||
return success(machineTemplateService.organTemplatePage(page));
|
||||
}
|
||||
|
||||
@GetMapping("organ-template-by-organId")
|
||||
@Operation(summary = "根据组织id查询组织模板授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template-auth:query')")
|
||||
@Parameter(name = "organId", description = "组织id", required = true, example = "1")
|
||||
public CommonResult<OrganTemplateResp> organTemplateByOrganId(@RequestParam Long organId ) {
|
||||
return success(machineTemplateService.organTemplateByOrganId(organId));
|
||||
@@ -52,7 +52,7 @@ public class MachineTemplateAuthController {
|
||||
|
||||
@GetMapping("page-template-machine-auth")
|
||||
@Operation(summary = "授权机台模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template-auth::query')")
|
||||
public CommonResult<PageResult<TemplateAutoResp>> pageTemplateAuth(MachinePageReqVO pageParam) {
|
||||
PageResult<MachineTemplateDO> page = machineTemplateService.page(pageParam);
|
||||
List<TemplateAutoResp> list = page.getList().stream().map(e->TemplateAutoResp.builder()
|
||||
|
||||
+5
-5
@@ -36,7 +36,7 @@ public class MachineTemplateController {
|
||||
|
||||
@GetMapping("/setDefaultTemplate")
|
||||
@Operation(summary = "设置默认机台模板")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::create')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::update')")
|
||||
public CommonResult<Boolean> setDefaultTemplate(@RequestParam Long id) {
|
||||
return success(machineTemplateService.setDefaultTemplate(id));
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class MachineTemplateController {
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("cutting-machine")
|
||||
@PutMapping("insert-template-machine")
|
||||
@Operation(summary = "新增机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::create')")
|
||||
@OperateLog(logArgs = false)
|
||||
@@ -65,7 +65,7 @@ public class MachineTemplateController {
|
||||
return success(machineTemplateService.createCuttingTemplate(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("cutting-machine")
|
||||
@PostMapping("update-template-machine")
|
||||
@Operation(summary = "修改机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::update')")
|
||||
@OperateLog(logArgs = false)
|
||||
@@ -73,14 +73,14 @@ public class MachineTemplateController {
|
||||
return success(machineTemplateService.updateCuttingTemplate(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping("cutting-machine")
|
||||
@GetMapping("get-template-machine")
|
||||
@Operation(summary = "获取机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<CuttingTemplateRespVO> getCuttingTemplateById(@RequestParam("id") String id) {
|
||||
return success(machineTemplateService.getCuttingTemplateById(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("cutting-machine")
|
||||
@DeleteMapping("delete-template-machine")
|
||||
@Operation(summary = "删除机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> deleteCutting(@RequestParam("id") Long id) {
|
||||
|
||||
+14
-7
@@ -45,14 +45,16 @@ public class PermissionController {
|
||||
@Operation(summary = "获得角色拥有的菜单编号")
|
||||
@Parameter(name = "roleId", description = "角色编号", required = true)
|
||||
@GetMapping("/list-role-menus")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-menu','base:permission:assign-role-menu')")
|
||||
public CommonResult<Set<Long>> getRoleMenuList(Long roleId) {
|
||||
return success(permissionService.getRoleMenuListByRoleId(roleId));
|
||||
}
|
||||
|
||||
@PostMapping("/assign-role-menu")
|
||||
@Operation(summary = "赋予角色菜单")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-menu','base:permission:assign-role-menu')")
|
||||
public CommonResult<Boolean> assignRoleMenu(@Validated @RequestBody PermissionAssignRoleMenuReqVO reqVO) {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
boolean isOrganRole = Objects.equals(reqVO.getRoleId(), InternalRoleConstants.ORGAN_ADMIN_ROLE_ID) || Objects.equals(reqVO.getRoleId(), InternalRoleConstants.ORGAN_STAFF_ROLE_ID);
|
||||
@@ -80,7 +82,8 @@ public class PermissionController {
|
||||
|
||||
@PostMapping("/assign-role-data-scope")
|
||||
@Operation(summary = "赋予角色数据权限")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-role-data-scope')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-data-scope')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-data-scope','base:permission:assign-role-data-scope')")
|
||||
public CommonResult<Boolean> assignRoleDataScope(@Valid @RequestBody PermissionAssignRoleDataScopeReqVO reqVO) {
|
||||
permissionService.assignRoleDataScope(reqVO.getRoleId(), reqVO.getDataScope(), reqVO.getDataScopeDeptIds());
|
||||
return success(true);
|
||||
@@ -89,14 +92,16 @@ public class PermissionController {
|
||||
@Operation(summary = "获得管理员拥有的角色编号列表")
|
||||
@Parameter(name = "userId", description = "用户编号", required = true)
|
||||
@GetMapping("/list-user-roles")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
public CommonResult<Set<Long>> listAdminRoles(@RequestParam("userId") Long userId) {
|
||||
return success(permissionService.getUserRoleIdListByUserId(userId));
|
||||
}
|
||||
|
||||
@Operation(summary = "赋予用户角色")
|
||||
@PostMapping("/assign-user-role")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
public CommonResult<Boolean> assignUserRole(@Validated @RequestBody PermissionAssignUserRoleReqVO reqVO) {
|
||||
Long organId = reqVO.getOrganId() == null ? OrganContextHolder.getOrganId() : reqVO.getOrganId();
|
||||
permissionService.assignUserRole(reqVO.getUserId(), reqVO.getRoleIds(), organId);
|
||||
@@ -105,7 +110,8 @@ public class PermissionController {
|
||||
|
||||
@Operation(summary = "赋予多用户角色")
|
||||
@PostMapping("/bath-assign-user-role")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
public CommonResult<Boolean> bathAssignUserRole(@Validated @RequestBody PermissionAssignRoleUserReqVO reqVO) {
|
||||
permissionService.batchAssignRoleUsers(reqVO);
|
||||
return success(true);
|
||||
@@ -115,7 +121,8 @@ public class PermissionController {
|
||||
@Operation(summary = "获得拥有角色的用户列表")
|
||||
@Parameter(name = "roleId", description = "角色id", required = true)
|
||||
@GetMapping("/list-role-users")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
public CommonResult<Set<Long>> listRoleUsers(@RequestParam("roleId") Long roleId, @RequestParam(value = "organId", required = false) Long organId) {
|
||||
return success(permissionService.getListRoleUsers(roleId, organId));
|
||||
}
|
||||
|
||||
+14
-7
@@ -48,7 +48,8 @@ public class RoleController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建角色")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:create','base:role:create')")
|
||||
public CommonResult<Long> createRole(@Valid @RequestBody RoleSaveReqVO createReqVO) {
|
||||
if(Objects.isNull(createReqVO.getOrganId())) {
|
||||
createReqVO.setOrganId(OrganContextHolder.getOrganId());
|
||||
@@ -59,7 +60,8 @@ public class RoleController {
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "修改角色")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:update','base:role:update')")
|
||||
public CommonResult<Boolean> updateRole(@Valid @RequestBody RoleSaveReqVO updateReqVO) {
|
||||
if (Objects.equals(updateReqVO.getId(), InternalRoleConstants.ORGAN_ADMIN_ROLE_ID) || Objects.equals(updateReqVO.getId(), InternalRoleConstants.ORGAN_STAFF_ROLE_ID)) {
|
||||
throw new ServiceException(11541, "内置角色无法修改");
|
||||
@@ -74,7 +76,8 @@ public class RoleController {
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "修改角色状态")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:update','base:role:update')")
|
||||
public CommonResult<Boolean> updateRoleStatus(@Valid @RequestBody RoleUpdateStatusReqVO reqVO) {
|
||||
roleService.updateRoleStatus(reqVO.getId(), reqVO.getStatus());
|
||||
return success(true);
|
||||
@@ -83,7 +86,8 @@ public class RoleController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除角色")
|
||||
@Parameter(name = "id", description = "角色编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:delete','base:role:delete')")
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("id") Long id) {
|
||||
roleService.deleteRole(id);
|
||||
return success(true);
|
||||
@@ -91,7 +95,8 @@ public class RoleController {
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得角色信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query')")
|
||||
public CommonResult<RoleRespVO> getRole(@RequestParam("id") Long id) {
|
||||
RoleDO role = roleService.getRole(id);
|
||||
return success(BeanUtils.toBean(role, RoleRespVO.class));
|
||||
@@ -99,7 +104,8 @@ public class RoleController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得角色分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query')")
|
||||
public CommonResult<PageResult<RoleRespVO>> getRolePage(RolePageReqVO pageReqVO) {
|
||||
PageResult<RoleDO> pageResult = roleService.getRolePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RoleRespVO.class));
|
||||
@@ -117,7 +123,8 @@ public class RoleController {
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出角色 Excel")
|
||||
@OperateLog(type = EXPORT)
|
||||
@PreAuthorize("@ss.hasPermission('system:role:export')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:export')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:export','base:role:export')")
|
||||
public void export(HttpServletResponse response, @Validated RolePageReqVO exportReqVO) throws IOException {
|
||||
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RoleDO> list = roleService.getRolePage(exportReqVO).getList();
|
||||
|
||||
+18
-9
@@ -69,7 +69,8 @@ public class UserController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "新增用户")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:create','base:user:create')")
|
||||
public CommonResult<Long> createUser(@Valid @RequestBody UserSaveReqVO reqVO) {
|
||||
Long id = userService.createUser(reqVO);
|
||||
return success(id);
|
||||
@@ -77,7 +78,8 @@ public class UserController {
|
||||
|
||||
@PutMapping("update")
|
||||
@Operation(summary = "修改用户")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:update','base:user:update')")
|
||||
public CommonResult<Boolean> updateUser(@Valid @RequestBody UserSaveReqVO reqVO) {
|
||||
userService.updateUser(reqVO);
|
||||
return success(true);
|
||||
@@ -86,7 +88,8 @@ public class UserController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:delete','base:user:delete')")
|
||||
public CommonResult<Boolean> deleteUser(@RequestParam("id") Long id) {
|
||||
userService.deleteUser(id);
|
||||
return success(true);
|
||||
@@ -94,7 +97,8 @@ public class UserController {
|
||||
|
||||
@PutMapping("/update-password")
|
||||
@Operation(summary = "重置用户密码")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:update-password')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:update-password')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:update-password','base:user:update-password')")
|
||||
public CommonResult<Boolean> updateUserPassword(@Valid @RequestBody UserUpdatePasswordReqVO reqVO) {
|
||||
userService.updateUserPassword(reqVO.getId(), reqVO.getPassword());
|
||||
return success(true);
|
||||
@@ -102,7 +106,8 @@ public class UserController {
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "修改用户状态")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:update','base:user:update')")
|
||||
public CommonResult<Boolean> updateUserStatus(@Valid @RequestBody UserUpdateStatusReqVO reqVO) {
|
||||
userService.updateUserStatus(reqVO.getId(), reqVO.getStatus());
|
||||
return success(true);
|
||||
@@ -110,7 +115,8 @@ public class UserController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:list')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:list')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:list','base:user:query')")
|
||||
public CommonResult<PageResult<UserRespVO>> getUserPage(@Valid UserPageReqVO pageReqVO) {
|
||||
// 获得用户分页列表
|
||||
PageResult<AdminUserDO> pageResult = userService.getUserPage(pageReqVO);
|
||||
@@ -138,7 +144,8 @@ public class UserController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:query','base:user:query')")
|
||||
public CommonResult<UserRespVO> getUser(@RequestParam("id") Long id) {
|
||||
AdminUserDO user = userService.getUser(id);
|
||||
// 拼接数据
|
||||
@@ -148,7 +155,8 @@ public class UserController {
|
||||
|
||||
@GetMapping("/export")
|
||||
@Operation(summary = "导出用户")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:export')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:export')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:export','base:user:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserList(@Validated UserPageReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
@@ -197,7 +205,8 @@ public class UserController {
|
||||
@Parameter(name = "file", description = "Excel 文件", required = true),
|
||||
@Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('system:user:import')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:import')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:import','base:user:import')")
|
||||
public CommonResult<UserImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport,
|
||||
@RequestParam(value = "organId", required = false) Long organId
|
||||
|
||||
+1
@@ -61,6 +61,7 @@ public interface ProcessMapper extends BaseMapperX<ProcessDO> {
|
||||
.eq(ProcessDO::getOrganId, organId)
|
||||
.eq(ProcessDO::getIsEnabled,true)
|
||||
.selectAll(ProcessDO.class)
|
||||
.orderByDesc(ProcessDO::getSort)
|
||||
.orderByDesc(ProcessDO::getId));
|
||||
|
||||
|
||||
|
||||
+1
@@ -41,6 +41,7 @@
|
||||
and p.piece_type = #{vo.pieceType}
|
||||
</if>
|
||||
</where>
|
||||
order by sort,id desc
|
||||
</select>
|
||||
|
||||
<select id="selectOneById" resultType="com.cf.imes.module.system.dal.dataobject.process.ProcessDO">
|
||||
|
||||
Reference in New Issue
Block a user