Showing
3 changed files
with
6 additions
and
3 deletions
| @@ -37,7 +37,7 @@ public class ProcurementPlanChangeController extends DefaultBaseController { | @@ -37,7 +37,7 @@ public class ProcurementPlanChangeController extends DefaultBaseController { | ||
| 37 | * 查询列表 | 37 | * 查询列表 |
| 38 | */ | 38 | */ |
| 39 | @ApiOperation("查询列表") | 39 | @ApiOperation("查询列表") |
| 40 | - @HasPermission({"plan-manage:plan-change:query"}) | 40 | + @HasPermission({"plan-manage:schedule-plan:query"}) |
| 41 | @GetMapping("/query") | 41 | @GetMapping("/query") |
| 42 | public InvokeResult<PageResult<ProcurementPlanChange>> query(@Valid QueryProcurementPlanChangeVo vo) { | 42 | public InvokeResult<PageResult<ProcurementPlanChange>> query(@Valid QueryProcurementPlanChangeVo vo) { |
| 43 | PageResult<ProcurementPlanChange> result = procurementPlanChangeService.query( | 43 | PageResult<ProcurementPlanChange> result = procurementPlanChangeService.query( |
| @@ -50,7 +50,7 @@ public class ProcurementPlanChangeController extends DefaultBaseController { | @@ -50,7 +50,7 @@ public class ProcurementPlanChangeController extends DefaultBaseController { | ||
| 50 | */ | 50 | */ |
| 51 | @ApiOperation("查询详情") | 51 | @ApiOperation("查询详情") |
| 52 | @ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true) | 52 | @ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true) |
| 53 | - @HasPermission({"plan-manage:plan-change:query","plan-manage:schedule-plan:view"}) | 53 | + @HasPermission({"plan-manage:schedule-plan:query","plan-manage:schedule-plan:view"}) |
| 54 | @GetMapping("/findById") | 54 | @GetMapping("/findById") |
| 55 | public InvokeResult<GetProcurementPlanChangeBo> findById(@NotBlank(message = "ID不能为空!") String id) { | 55 | public InvokeResult<GetProcurementPlanChangeBo> findById(@NotBlank(message = "ID不能为空!") String id) { |
| 56 | GetProcurementPlanChangeBo result = procurementPlanChangeService.findDetail(id); | 56 | GetProcurementPlanChangeBo result = procurementPlanChangeService.findDetail(id); |
| @@ -142,7 +142,7 @@ public class ProcurementPlanController extends DefaultBaseController { | @@ -142,7 +142,7 @@ public class ProcurementPlanController extends DefaultBaseController { | ||
| 142 | */ | 142 | */ |
| 143 | @ApiOperation("根据ID查询") | 143 | @ApiOperation("根据ID查询") |
| 144 | @ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true) | 144 | @ApiImplicitParam(value = "ID", name = "id", paramType = "query", required = true) |
| 145 | - @HasPermission({"procurement:plan:query"}) | 145 | + @HasPermission({"plan-manage:domestic-plan:query"}) |
| 146 | @GetMapping | 146 | @GetMapping |
| 147 | public InvokeResult<GetProcurementPlanBo> findById( | 147 | public InvokeResult<GetProcurementPlanBo> findById( |
| 148 | @NotBlank(message = "ID不能为空!") String id) { | 148 | @NotBlank(message = "ID不能为空!") String id) { |
| @@ -714,9 +714,11 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | @@ -714,9 +714,11 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | ||
| 714 | 714 | ||
| 715 | // 2. 查询当月最大的编号(例如:260100005) | 715 | // 2. 查询当月最大的编号(例如:260100005) |
| 716 | // 使用 MyBatis-Plus 的 likeRight 进行前缀匹配,确保只查当月的数据 | 716 | // 使用 MyBatis-Plus 的 likeRight 进行前缀匹配,确保只查当月的数据 |
| 717 | + // 过滤包含下划线的子计划/归档编号(如 260800001_01、260800001_HIST):下划线在LIKE中是通配符,需要ESCAPE转义 | ||
| 717 | ProcurementPlan maxPlan = getBaseMapper().selectOne( | 718 | ProcurementPlan maxPlan = getBaseMapper().selectOne( |
| 718 | Wrappers.lambdaQuery(ProcurementPlan.class) | 719 | Wrappers.lambdaQuery(ProcurementPlan.class) |
| 719 | .likeRight(ProcurementPlan::getCode, datePrefix) | 720 | .likeRight(ProcurementPlan::getCode, datePrefix) |
| 721 | + .apply("code NOT LIKE '%/_%' ESCAPE '/'") | ||
| 720 | .orderByDesc(ProcurementPlan::getCode) | 722 | .orderByDesc(ProcurementPlan::getCode) |
| 721 | .last("LIMIT 1") | 723 | .last("LIMIT 1") |
| 722 | ); | 724 | ); |
| @@ -737,6 +739,7 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | @@ -737,6 +739,7 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | ||
| 737 | 739 | ||
| 738 | // 4. 拼接最终编号,流水号不足5位左侧补0 | 740 | // 4. 拼接最终编号,流水号不足5位左侧补0 |
| 739 | String candidate = datePrefix + String.format("%05d", nextSeq); | 741 | String candidate = datePrefix + String.format("%05d", nextSeq); |
| 742 | + System.out.println("candidate===" + candidate); | ||
| 740 | 743 | ||
| 741 | // 5. 兜底校验:防止极端并发下出现重复 | 744 | // 5. 兜底校验:防止极端并发下出现重复 |
| 742 | Integer count = getBaseMapper().selectCount( | 745 | Integer count = getBaseMapper().selectCount( |