feat(smartfactory): 添加工厂和公司列表接口并优化参数接收- 在 FactoryInfoController 中添加 getList 方法,用于获取工厂和公司列表

- 在 FactoryInfoService 接口中添加 getList 方法
- 在 FactoryInfoServiceImpl 中实现 getList 方法
- 优化 StaffSalaryApi 中 updateIsGrant 方法的参数接收,允许 ids 参数为可选
- 在 StaffController 中为 exportStaffExcel 方法添加状态参数,以筛选有效员工
This commit is contained in:
furongxin 2025-06-20 15:57:01 +08:00
parent b7cb164837
commit d899fdf3d3
5 changed files with 25 additions and 1 deletions

View File

@ -19,6 +19,6 @@ public interface StaffSalaryApi {
@PutMapping(PREFIX + "/updateIsGrant")
@Operation(summary = "更新是否已发放薪资")
CommonResult<Boolean> updateIsGrant(@RequestParam("ids") Collection<Long> ids,
CommonResult<Boolean> updateIsGrant(@RequestParam(value = "ids", required = false) Collection<Long> ids,
@RequestParam("isGrant") Integer isGrant);
}

View File

@ -96,6 +96,15 @@ public class FactoryInfoController {
return success(respVO);
}
@GetMapping("/list")
@Operation(summary = "获得工厂以及公司列表 | 用于前端下拉框")
@PreAuthorize("@ss.hasPermission('smartfactory:factory-info:query')")
public CommonResult<List<FactorySimpleRespVO>> getList() {
List<FactoryInfoDO> factoryInfo = factoryInfoService.getList();
return success(BeanUtils.toBean(factoryInfo, FactorySimpleRespVO.class));
}
@GetMapping("/simple-list")
@Operation(summary = "获得工厂列表 | 用于前端下拉框")
@PreAuthorize("@ss.hasPermission('smartfactory:factory-info:query')")

View File

@ -139,6 +139,7 @@ public class StaffController {
public void exportStaffExcel(@Valid StaffPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
pageReqVO.setStatus(1);
List<StaffDO> list = staffService.getStaffPage(pageReqVO).getList();
// 获取工种字典值

View File

@ -158,4 +158,10 @@ public interface FactoryInfoService {
* @return 工厂列表
*/
List<FactoryInfoDO> getFactoryListByLoginUser();
/**
* 获得工厂以及公司列表
* @return 工厂列表
*/
List<FactoryInfoDO> getList();
}

View File

@ -422,4 +422,12 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
return factoryInfoMapper.selectListByType(factoryIds);
}
@Override
public List<FactoryInfoDO> getList() {
return factoryInfoMapper.selectList(new LambdaQueryWrapperX<FactoryInfoDO>()
.eq(FactoryInfoDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
.orderByAsc(FactoryInfoDO::getType));
}
}