部件管理-新增
This commit is contained in:
parent
fdd46a5f04
commit
e495710f2a
|
|
@ -68,7 +68,7 @@ public class DeviceComponentController extends ControllerBase {
|
|||
public ApiResult<PageData<DeviceComponentVO>> getList(@RequestBody DeviceComponentQuery query){
|
||||
Page<DeviceComponentVO> result = deviceComponentService.selectListByPage(query);
|
||||
result.getRecords().forEach(u->{
|
||||
List<DeviceComponentDetail> detail = deviceComponentDetailService.lambdaQuery().eq(DeviceComponentDetail::getDeviceComponentId, u.getId()).list();
|
||||
List<DeviceComponentDetailVO> detail = deviceComponentDetailService.getDevicePartDetail(u.getId());
|
||||
u.setPartList(Convert.toList(DeviceComponentDetailVO.class,detail));
|
||||
});
|
||||
return ApiResult.success(result.getRecords(),query,result.getTotal());
|
||||
|
|
@ -80,7 +80,7 @@ public class DeviceComponentController extends ControllerBase {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("getModelPartList")
|
||||
@ApiMark(moduleName = "机型部件管理", apiName = "获取机型部件列表")
|
||||
@ApiMark(moduleName = "机型部件管理", apiName = "获取机型已设置部件列表")
|
||||
public ApiResult<List<DeviceComponentDetailDTO>> getModelPartList(@RequestParam("deviceComponentId") Integer deviceComponentId){
|
||||
if (deviceComponentId == null) {
|
||||
throw new NflgException(STATE.ParamErr, "设备ID不能为空");
|
||||
|
|
|
|||
|
|
@ -56,4 +56,9 @@ public class DeviceComponentDetailVO implements Serializable {
|
|||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 部件编码
|
||||
*/
|
||||
private String partNo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceComponentDetailVO;
|
||||
import com.nflg.mobilebroken.repository.entity.DeviceComponentDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -19,4 +20,6 @@ public interface DeviceComponentDetailMapper extends BaseMapper<DeviceComponentD
|
|||
void delByComponentId(@Param("componentId") Integer componentId);
|
||||
|
||||
void batchDelByComponentId(@Param("componentIds") List<Integer> componentIds);
|
||||
|
||||
List<DeviceComponentDetailVO> getDevicePartDetail(@Param("deviceComponentId") Integer deviceComponentId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceComponentDetailVO;
|
||||
import com.nflg.mobilebroken.repository.entity.DeviceComponentDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -20,4 +21,6 @@ public interface IDeviceComponentDetailService extends IService<DeviceComponentD
|
|||
void delByComponentId(@Param("componentId") Integer componentId);
|
||||
|
||||
void batchDelByComponentId(@Param("componentIds") List<Integer> componentIds);
|
||||
|
||||
List<DeviceComponentDetailVO> getDevicePartDetail(@Param("deviceComponentId") Integer deviceComponentId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceComponentDetailVO;
|
||||
import com.nflg.mobilebroken.repository.entity.DeviceComponentDetail;
|
||||
import com.nflg.mobilebroken.repository.mapper.DeviceComponentDetailMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IDeviceComponentDetailService;
|
||||
|
|
@ -27,4 +28,8 @@ public class DeviceComponentDetailServiceImpl extends ServiceImpl<DeviceComponen
|
|||
public void batchDelByComponentId(@Param("componentIds") List<Integer> componentIds){
|
||||
this.getBaseMapper().batchDelByComponentId(componentIds);
|
||||
}
|
||||
|
||||
public List<DeviceComponentDetailVO> getDevicePartDetail(@Param("deviceComponentId") Integer deviceComponentId){
|
||||
return this.getBaseMapper().getDevicePartDetail(deviceComponentId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,4 +13,10 @@
|
|||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getDevicePartDetail" resultType="com.nflg.mobilebroken.common.pojo.vo.DeviceComponentDetailVO">
|
||||
select a.* ,b.part_no from device_component_detail a
|
||||
join t_base_part b on a.model_part_id=b.id
|
||||
where a.device_component_id=#{deviceComponentId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue