质量规划
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.cnbm.processInspection.service;
|
||||
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.processInspection.dto.InspectionSheetDTO;
|
||||
import com.cnbm.processInspection.entity.InspectionSheet;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 检验单 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-08-17
|
||||
*/
|
||||
public interface IInspectionSheetService extends CrudService<InspectionSheet, InspectionSheetDTO> {
|
||||
|
||||
PageData<InspectionSheetDTO> page (Map<String, Object> params);
|
||||
|
||||
InspectionSheetDTO get(Long id);
|
||||
|
||||
void save(InspectionSheetDTO dto);
|
||||
|
||||
void update(InspectionSheetDTO dto);
|
||||
|
||||
void delete(Long[] ids);
|
||||
|
||||
List<InspectionSheetDTO> list(Map<String, Object> params);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.cnbm.processInspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import com.cnbm.processInspection.dto.InspectionSheetDTO;
|
||||
import com.cnbm.processInspection.entity.InspectionSheet;
|
||||
import com.cnbm.processInspection.mapper.InspectionSheetMapper;
|
||||
import com.cnbm.processInspection.service.IInspectionSheetService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 检验单 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-08-17
|
||||
*/
|
||||
@Service
|
||||
public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetMapper, InspectionSheet, InspectionSheetDTO> implements IInspectionSheetService {
|
||||
|
||||
@Autowired
|
||||
private InspectionSheetMapper mapper;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<InspectionSheet> getWrapper(Map<String, Object> params){
|
||||
String id = (String)params.get("id");
|
||||
|
||||
QueryWrapper<InspectionSheet> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageData<InspectionSheetDTO> page (Map<String, Object> params){
|
||||
IPage<InspectionSheet> page = baseDao.selectPage(
|
||||
getPage(params, "id", true),
|
||||
getWrapper(params)
|
||||
);
|
||||
return getPageData(page, InspectionSheetDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InspectionSheetDTO get(Long id) {
|
||||
InspectionSheet entity = baseDao.selectById(id);
|
||||
return ConvertUtils.sourceToTarget(entity, InspectionSheetDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(InspectionSheetDTO dto) {
|
||||
InspectionSheet entity = ConvertUtils.sourceToTarget(dto, InspectionSheet.class);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(InspectionSheetDTO dto) {
|
||||
InspectionSheet entity = ConvertUtils.sourceToTarget(dto, InspectionSheet.class);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long[] ids) {
|
||||
//删除
|
||||
deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<InspectionSheetDTO> list(Map<String, Object> params) {
|
||||
List<InspectionSheetDTO> list = mapper.list(params);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user