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

View File

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

View File

@ -23,7 +23,7 @@ public interface RepairProjectService extends IService<RepairProject> {
* @author PQZ * @author PQZ
* @date 14:51 2024/9/12 * @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 * @author PQZ
* @date 9:33 2024/9/18 * @date 9:33 2024/9/18
**/ **/
void saveWares(RepairWaresSaveReqVO saveReqVO); RepairWares saveWares(RepairWaresSaveReqVO saveReqVO);
/** /**
* @param id 配件id * @param id 配件id

View File

@ -36,9 +36,10 @@ public class RepairProjectServiceImpl extends ServiceImpl<RepairProjectMapper, R
* @date 14:51 2024/9/12 * @date 14:51 2024/9/12
**/ **/
@Override @Override
public void saveRepairProject(RepairProjectSaveReqVO saveReqVO) { public RepairProject saveRepairProject(RepairProjectSaveReqVO saveReqVO) {
RepairProject repairProject = BeanUtils.toBean(saveReqVO, RepairProject.class); RepairProject repairProject = BeanUtils.toBean(saveReqVO, RepairProject.class);
saveOrUpdate(repairProject); 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 * @date 9:33 2024/9/18
**/ **/
@Override @Override
public void saveWares(RepairWaresSaveReqVO saveReqVO) { public RepairWares saveWares(RepairWaresSaveReqVO saveReqVO) {
RepairWares repairWares = BeanUtils.toBean(saveReqVO, RepairWares.class); RepairWares repairWares = BeanUtils.toBean(saveReqVO, RepairWares.class);
saveOrUpdate(repairWares); saveOrUpdate(repairWares);
return getById(repairWares.getId());
} }
/** /**

View File

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