This commit is contained in:
xiao-fajia 2024-09-25 18:15:17 +08:00
commit e3188a4c8d
7 changed files with 12 additions and 11 deletions

View File

@ -45,9 +45,9 @@ public class RepairProjectController {
@PostMapping("/create")
@Operation(summary = "创建维修项目")
@PreAuthorize("@ss.hasPermission('repair:project:create')")
public CommonResult<Boolean> createRepairProject(@Valid @RequestBody RepairProjectSaveReqVO createReqVO) {
repairProjectService.saveRepairProject(createReqVO);
return success(true);
public CommonResult<RepairProject> createRepairProject(@Valid @RequestBody RepairProjectSaveReqVO createReqVO) {
RepairProject repairProject = repairProjectService.saveRepairProject(createReqVO);
return success(repairProject);
}
/**

View File

@ -44,9 +44,8 @@ public class RepairWaresController {
@PostMapping("/create")
@Operation(summary = "创建配件库")
@PreAuthorize("@ss.hasPermission('repair:wares:create')")
public CommonResult<Boolean> createWares(@Valid @RequestBody RepairWaresSaveReqVO createReqVO) {
waresService.saveWares(createReqVO);
return success(true);
public CommonResult<RepairWares> createWares(@Valid @RequestBody RepairWaresSaveReqVO createReqVO) {
return success(waresService.saveWares(createReqVO));
}
/**

View File

@ -23,7 +23,7 @@ public interface RepairProjectService extends IService<RepairProject> {
* @author PQZ
* @date 14:51 2024/9/12
**/
void saveRepairProject(RepairProjectSaveReqVO saveReqVO);
RepairProject saveRepairProject(RepairProjectSaveReqVO saveReqVO);
/**
* 删除维修项目

View File

@ -23,7 +23,7 @@ public interface RepairWaresService extends IService<RepairWares> {
* @author PQZ
* @date 9:33 2024/9/18
**/
void saveWares(RepairWaresSaveReqVO saveReqVO);
RepairWares saveWares(RepairWaresSaveReqVO saveReqVO);
/**
* @param id 配件id

View File

@ -36,9 +36,10 @@ public class RepairProjectServiceImpl extends ServiceImpl<RepairProjectMapper, R
* @date 14:51 2024/9/12
**/
@Override
public void saveRepairProject(RepairProjectSaveReqVO saveReqVO) {
public RepairProject saveRepairProject(RepairProjectSaveReqVO saveReqVO) {
RepairProject repairProject = BeanUtils.toBean(saveReqVO, RepairProject.class);
saveOrUpdate(repairProject);
return getById(repairProject.getId());
}
/**

View File

@ -38,9 +38,10 @@ public class RepairWaresServiceImpl extends ServiceImpl<RepairWaresMapper, Repai
* @date 9:33 2024/9/18
**/
@Override
public void saveWares(RepairWaresSaveReqVO saveReqVO) {
public RepairWares saveWares(RepairWaresSaveReqVO saveReqVO) {
RepairWares repairWares = BeanUtils.toBean(saveReqVO, RepairWares.class);
saveOrUpdate(repairWares);
return getById(repairWares.getId());
}
/**

View File

@ -22,7 +22,7 @@
<where>
drw.deleted = 0
<if test="entity.name != null and entity.name != ''">
and drw.name = #{entity.name}
and drw.name like concat('%', #{entity.name}, '%')
</if>
</where>
GROUP BY