设备管理 ,部件管理
This commit is contained in:
parent
67b140318e
commit
efef85c89b
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.convert.Convert;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.admin.pojo.dto.DeviceComponentDTO;
|
||||
import com.nflg.mobilebroken.admin.pojo.dto.DeviceComponentDetailDTO;
|
||||
import com.nflg.mobilebroken.admin.pojo.query.DeviceComponentQuery;
|
||||
import com.nflg.mobilebroken.common.constant.STATE;
|
||||
import com.nflg.mobilebroken.common.exception.NflgException;
|
||||
|
|
@ -16,8 +17,11 @@ import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
|||
import com.nflg.mobilebroken.common.util.EecExcelUtil;
|
||||
import com.nflg.mobilebroken.common.util.VUtils;
|
||||
import com.nflg.mobilebroken.repository.entity.DeviceComponent;
|
||||
import com.nflg.mobilebroken.repository.entity.DeviceComponentDetail;
|
||||
import com.nflg.mobilebroken.repository.service.IDeviceComponentDetailService;
|
||||
import com.nflg.mobilebroken.repository.service.IDeviceComponentService;
|
||||
import com.nflg.mobilebroken.starter.annotation.MethodInfoMark;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.ttzero.excel.entity.ListSheet;
|
||||
|
|
@ -29,6 +33,7 @@ import javax.validation.Valid;
|
|||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 机型部件管理
|
||||
|
|
@ -40,18 +45,32 @@ public class DeviceComponentController extends ControllerBase {
|
|||
@Resource
|
||||
IDeviceComponentService deviceComponentService;
|
||||
|
||||
@Resource
|
||||
IDeviceComponentDetailService deviceComponentDetailService;
|
||||
|
||||
/**
|
||||
* 获取机型部件列表
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getList")
|
||||
@MethodInfoMark(value = "获取部件列表", menuName = "机型部件")
|
||||
@MethodInfoMark(value = "获取设备机型列表", menuName = "机型部件")
|
||||
public ApiResult<PageData<DeviceComponent>> getList(@RequestBody DeviceComponentQuery query){
|
||||
Page<DeviceComponent> result = deviceComponentService.selectListByPage(query);
|
||||
return ApiResult.success(result.getRecords(),query,result.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备机型部件列表
|
||||
* @param deviceComponentId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getModelPartList")
|
||||
@MethodInfoMark(value = "获取机型部件列表", menuName = "机型部件")
|
||||
public ApiResult<List<DeviceComponentDetailDTO>> getModelPartList(@RequestParam("deviceComponentId") Integer deviceComponentId){
|
||||
List<DeviceComponentDetail> result = deviceComponentDetailService.lambdaQuery().eq(DeviceComponentDetail::getDeviceComponentId, deviceComponentId).list();
|
||||
return ApiResult.success(Convert.toList(DeviceComponentDetailDTO.class,result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 部件设置
|
||||
|
|
@ -60,15 +79,25 @@ public class DeviceComponentController extends ControllerBase {
|
|||
*/
|
||||
@PostMapping("setPart")
|
||||
@MethodInfoMark(value = "部件设置",menuName = "机型部件")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ApiResult<Boolean> setPart(@Valid @RequestBody DeviceComponentDTO component){
|
||||
|
||||
if(StrUtil.isBlank(component.getComponent())){
|
||||
if(CollUtil.isEmpty(component.getComponent())){
|
||||
throw new NflgException(STATE.ParamErr,"机型部件不能为空");
|
||||
}
|
||||
DeviceComponent ent = Convert.convert(DeviceComponent.class, component);
|
||||
List<String> compinets = component.getComponent().stream().map(u -> u.getModelPartName()).collect(Collectors.toList());
|
||||
ent.setComponent(StrUtil.join(",",compinets));
|
||||
|
||||
List<DeviceComponentDetail> deviceComponentDetails = Convert.toList(DeviceComponentDetail.class, component.getComponent());
|
||||
ent.setUpdateBy(AdminUserUtil.getUserName());
|
||||
ent.setUpdateTime(LocalDateTime.now());
|
||||
deviceComponentService.updateById(ent);
|
||||
deviceComponentDetails.forEach(u->{
|
||||
u.setDeviceComponentId(component.getId());
|
||||
});
|
||||
deviceComponentDetailService.delByComponentId(component.getId());
|
||||
deviceComponentDetailService.saveBatch(deviceComponentDetails);
|
||||
return ApiResult.success(true);
|
||||
}
|
||||
|
||||
|
|
@ -80,11 +109,13 @@ public class DeviceComponentController extends ControllerBase {
|
|||
*/
|
||||
@PostMapping("del")
|
||||
@MethodInfoMark(value = "删除部件",menuName = "机型部件")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ApiResult<Boolean> del(@RequestBody List<Integer> ids){
|
||||
if(CollUtil.isNotEmpty(ids)){
|
||||
throw new NflgException(STATE.ParamErr,"请选择要删除的部件");
|
||||
}
|
||||
deviceComponentService.batchDelComponent(ids);
|
||||
deviceComponentDetailService.batchDelByComponentId(ids);
|
||||
return ApiResult.success(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.admin.pojo.dto.DeviceDTO;
|
||||
import com.nflg.mobilebroken.admin.pojo.query.DeviceQuery;
|
||||
import com.nflg.mobilebroken.admin.pojo.vo.DeviceDetailResultVO;
|
||||
import com.nflg.mobilebroken.admin.pojo.vo.DeviceExcelVO;
|
||||
import com.nflg.mobilebroken.admin.service.AdminDeviceService;
|
||||
import com.nflg.mobilebroken.common.constant.STATE;
|
||||
|
|
@ -14,8 +15,11 @@ import com.nflg.mobilebroken.common.pojo.PageData;
|
|||
import com.nflg.mobilebroken.common.util.EecExcelUtil;
|
||||
import com.nflg.mobilebroken.common.util.VUtils;
|
||||
import com.nflg.mobilebroken.repository.entity.Device;
|
||||
import com.nflg.mobilebroken.repository.entity.DictionaryItem;
|
||||
import com.nflg.mobilebroken.repository.service.IDeviceService;
|
||||
import com.nflg.mobilebroken.repository.service.IDictionaryItemService;
|
||||
import com.nflg.mobilebroken.starter.annotation.MethodInfoMark;
|
||||
import org.apache.ibatis.annotations.Result;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.ttzero.excel.entity.ListSheet;
|
||||
|
|
@ -42,6 +46,9 @@ public class DeviceController extends ControllerBase {
|
|||
@Resource
|
||||
AdminDeviceService adminDeviceService;
|
||||
|
||||
@Resource
|
||||
IDictionaryItemService dictionaryItemService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -52,6 +59,28 @@ public class DeviceController extends ControllerBase {
|
|||
return ApiResult.success(result.getRecords(), query, result.getTotal());
|
||||
}
|
||||
|
||||
@GetMapping("getDetail")
|
||||
@MethodInfoMark(value = "获取设备详情", menuName = "设备管理")
|
||||
public ApiResult<DeviceDetailResultVO> getDetail(@RequestParam("id") Integer id) {
|
||||
Device data = deviceService.getById(id);
|
||||
DeviceDetailResultVO result = Convert.convert(DeviceDetailResultVO.class, data);
|
||||
if(null!=result && null!=result.getDeviceState()) {
|
||||
DictionaryItem deviceState = dictionaryItemService.getById(result.getDeviceState());
|
||||
if(null!=deviceState){
|
||||
result.setDeviceStateName(deviceState.getName());
|
||||
}
|
||||
}
|
||||
if(null!=result && null!=result.getWarrantyState()){
|
||||
DictionaryItem warrantyState = dictionaryItemService.getById(result.getWarrantyState());
|
||||
if(null!=warrantyState){
|
||||
result.setWarrantyStateName(warrantyState.getName());
|
||||
}
|
||||
}
|
||||
return ApiResult.success(result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ package com.nflg.mobilebroken.admin.pojo.dto;
|
|||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机型部件-设置参数
|
||||
|
|
@ -21,6 +23,6 @@ public class DeviceComponentDTO {
|
|||
/**
|
||||
* 机型部件-多个以逗号隔开
|
||||
*/
|
||||
@NotBlank(message = "机型部件不能为空")
|
||||
private String component;
|
||||
@NotEmpty(message = "机型部件不能为空")
|
||||
private List<DeviceComponentDetailDTO> component;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.nflg.mobilebroken.admin.pojo.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeviceComponentDetailDTO {
|
||||
|
||||
/**
|
||||
* 部件ID
|
||||
*/
|
||||
private Integer modelPartId;
|
||||
|
||||
/**
|
||||
* 部件名称
|
||||
*/
|
||||
private String modelPartName;
|
||||
}
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
package com.nflg.mobilebroken.admin.pojo.dto;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.nflg.mobilebroken.admin.constant.DeviceSourceFromEnum;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -58,10 +56,10 @@ public class DeviceDTO {
|
|||
private String customerName;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
* 设备状态-来自字典
|
||||
*/
|
||||
@NotBlank(message = "设备状态不能为空")
|
||||
private String deviceState;
|
||||
@NotNull(message = "设备状态不能为空")
|
||||
private Integer deviceState;
|
||||
|
||||
/**
|
||||
* 代理商编码
|
||||
|
|
@ -91,10 +89,10 @@ public class DeviceDTO {
|
|||
private LocalDate shipmentDate;
|
||||
|
||||
/**
|
||||
* 质保状态
|
||||
* 质保状态-来自字典
|
||||
*/
|
||||
@NotBlank(message = "质保状态不能为空")
|
||||
private String warrantyState;
|
||||
@NotNull(message = "质保状态不能为空")
|
||||
private Integer warrantyState;
|
||||
|
||||
/**
|
||||
* 开始质保日期
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.nflg.mobilebroken.admin.pojo.vo;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.Device;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeviceDetailResultVO extends Device {
|
||||
|
||||
/**
|
||||
* 设备状态名称
|
||||
*/
|
||||
private String deviceStateName;
|
||||
|
||||
/**
|
||||
* 质检状态名称
|
||||
*/
|
||||
private String warrantyStateName;
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.nflg.mobilebroken.common.pojo.dto.UserDTO;
|
|||
import com.nflg.mobilebroken.starter.service.INotifyPushService;
|
||||
import com.nflg.mobilebroken.starter.service.SSEManagerService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -14,6 +15,7 @@ import java.io.IOException;
|
|||
public class SSEINotifyPushService implements INotifyPushService {
|
||||
|
||||
@Resource
|
||||
@Qualifier("APPSSEManagerService")
|
||||
private SSEManagerService sseManagerService;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.nflg.mobilebroken.common.util;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
|
@ -20,7 +22,7 @@ public class AdminUserUtil {
|
|||
|
||||
public static List<String> getRoles() {
|
||||
// return (List<String>) SaTokenAdminUtil.getExtra("roles");
|
||||
return List.of("管理员");
|
||||
return ListUtil.of("管理员");
|
||||
}
|
||||
|
||||
public static String getUserNo(){
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.common.util;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.nflg.mobilebroken.common.pojo.dto.UserDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -23,7 +24,7 @@ public class AppUserUtil {
|
|||
|
||||
public static List<Integer> getCompanyIds() {
|
||||
// return (List<Integer>) SaTokenAppUtil.getExtra("companyIds");
|
||||
return List.of(1);
|
||||
return ListUtil.of(1);
|
||||
}
|
||||
|
||||
public static UserDTO getUser() {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ package com.nflg.mobilebroken.repository.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ package com.nflg.mobilebroken.repository.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ package com.nflg.mobilebroken.repository.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,13 +3,12 @@ package com.nflg.mobilebroken.repository.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
|
|||
|
|
@ -3,13 +3,12 @@ package com.nflg.mobilebroken.repository.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户端-用户申请
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@ public class Device implements Serializable {
|
|||
private String customerName;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
* 设备状态-来自字典
|
||||
*/
|
||||
private String deviceState;
|
||||
private Integer deviceState;
|
||||
|
||||
/**
|
||||
* 代理商编码
|
||||
|
|
@ -93,9 +93,9 @@ public class Device implements Serializable {
|
|||
private LocalDate shipmentDate;
|
||||
|
||||
/**
|
||||
* 质保状态
|
||||
* 质保状态-来自字典
|
||||
*/
|
||||
private String warrantyState;
|
||||
private Integer warrantyState;
|
||||
|
||||
/**
|
||||
* 开始质保日期
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
package com.nflg.mobilebroken.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机型部件详情
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("device_component_detail")
|
||||
public class DeviceComponentDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 设备机型id
|
||||
*/
|
||||
private Integer deviceComponentId;
|
||||
|
||||
/**
|
||||
* 机型部件ID
|
||||
*/
|
||||
private Integer modelPartId;
|
||||
|
||||
/**
|
||||
* 机型部件名称
|
||||
*/
|
||||
private String modelPartName;
|
||||
}
|
||||
|
|
@ -3,17 +3,16 @@ package com.nflg.mobilebroken.repository.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.DeviceComponentDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机型部件详情 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface DeviceComponentDetailMapper extends BaseMapper<DeviceComponentDetail> {
|
||||
|
||||
void delByComponentId(@Param("componentId") Integer componentId);
|
||||
|
||||
void batchDelByComponentId(@Param("componentIds") List<Integer> componentIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.DeviceComponentDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机型部件详情 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface IDeviceComponentDetailService extends IService<DeviceComponentDetail> {
|
||||
|
||||
|
||||
void delByComponentId(@Param("componentId") Integer componentId);
|
||||
|
||||
void batchDelByComponentId(@Param("componentIds") List<Integer> componentIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.DeviceComponentDetail;
|
||||
import com.nflg.mobilebroken.repository.mapper.DeviceComponentDetailMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IDeviceComponentDetailService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机型部件详情 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Service
|
||||
public class DeviceComponentDetailServiceImpl extends ServiceImpl<DeviceComponentDetailMapper, DeviceComponentDetail> implements IDeviceComponentDetailService {
|
||||
|
||||
public void delByComponentId(@Param("componentId") Integer componentId){
|
||||
this.getBaseMapper().delByComponentId(componentId);
|
||||
}
|
||||
|
||||
public void batchDelByComponentId(@Param("componentIds") List<Integer> componentIds){
|
||||
this.getBaseMapper().batchDelByComponentId(componentIds);
|
||||
}
|
||||
}
|
||||
|
|
@ -55,6 +55,7 @@ public class DeviceComponentServiceImpl extends ServiceImpl<DeviceComponentMappe
|
|||
|
||||
public void batchDelComponent(List<Integer> ids){
|
||||
this.getBaseMapper().deleteBatchIds(ids);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
@ -37,7 +38,7 @@ public class TBasePositionServiceImpl extends ServiceImpl<TBasePositionMapper, T
|
|||
public List<TitleSimpleVO> getSimpleTitles(Integer type) {
|
||||
List<TBasePosition> datas = lambdaQuery()
|
||||
.eq(TBasePosition::getDataValidState, 1)
|
||||
.in(TBasePosition::getPositionAttribute, type, List.of(type, 3))
|
||||
.in(TBasePosition::getPositionAttribute, type, ListUtil.of(type, 3))
|
||||
.list();
|
||||
return Convert.toList(TitleSimpleVO.class, datas);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.DeviceComponentDetailMapper">
|
||||
|
||||
|
||||
<delete id="delByComponentId">
|
||||
delete from device_component_detail where device_component_id=#{componentId}
|
||||
</delete>
|
||||
|
||||
<delete id="batchDelByComponentId">
|
||||
delete from device_component_detail where device_component_id in
|
||||
<foreach collection="componentIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue