|
|
@ -1,4 +1,4 @@
|
|
|
|
package com.op.quality.service.serviceImpl;
|
|
|
|
package com.op.quality.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.Iterator;
|
|
|
@ -7,13 +7,17 @@ import java.util.Map;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
import com.op.common.core.utils.SpringUtils;
|
|
|
|
import com.op.common.core.utils.SpringUtils;
|
|
|
|
import com.op.common.core.utils.StringUtils;
|
|
|
|
import com.op.common.core.utils.StringUtils;
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
import com.op.common.datascope.annotation.DataScope;
|
|
|
|
import com.op.common.datascope.annotation.DataScope;
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
|
|
|
|
import com.op.quality.domain.QcCheckTypeProject;
|
|
|
|
import com.op.quality.domain.vo.TreeSelect;
|
|
|
|
import com.op.quality.domain.vo.TreeSelect;
|
|
|
|
|
|
|
|
import com.op.quality.mapper.QcCheckTypeProjectMapper;
|
|
|
|
|
|
|
|
import com.op.system.api.domain.SysDictData;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import com.op.quality.mapper.QcMaterialGroupMapper;
|
|
|
|
import com.op.quality.mapper.QcMaterialGroupMapper;
|
|
|
@ -26,7 +30,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 物料组Service业务层处理
|
|
|
|
* 物料组Service业务层处理
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author materialGroup
|
|
|
|
* @author materialGroup
|
|
|
|
* @date 2023-10-16
|
|
|
|
* @date 2023-10-16
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -34,10 +38,12 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private QcMaterialGroupMapper qcMaterialGroupMapper;
|
|
|
|
private QcMaterialGroupMapper qcMaterialGroupMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private QcCheckTypeProjectMapper qcCheckTypeProjectMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询物料组
|
|
|
|
* 查询物料组
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param id 物料组主键
|
|
|
|
* @param id 物料组主键
|
|
|
|
* @return 物料组
|
|
|
|
* @return 物料组
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -46,7 +52,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
return qcMaterialGroupMapper.selectQcMaterialGroupById(id);
|
|
|
|
return qcMaterialGroupMapper.selectQcMaterialGroupById(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@DataScope(deptAlias = "d")
|
|
|
|
//@DataScope(deptAlias = "d")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public List<QcMaterialGroup> selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup) {
|
|
|
|
public List<QcMaterialGroup> selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup) {
|
|
|
|
return qcMaterialGroupMapper.selectQcMaterialGroupList(qcMaterialGroup);
|
|
|
|
return qcMaterialGroupMapper.selectQcMaterialGroupList(qcMaterialGroup);
|
|
|
@ -54,7 +60,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询物料树列表
|
|
|
|
* 查询物料树列表
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param qcMaterialGroup 物料组
|
|
|
|
* @param qcMaterialGroup 物料组
|
|
|
|
* @return 物料组
|
|
|
|
* @return 物料组
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -119,7 +125,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增物料组
|
|
|
|
* 新增物料组
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param qcMaterialGroup 物料组
|
|
|
|
* @param qcMaterialGroup 物料组
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -137,7 +143,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 修改物料组
|
|
|
|
* 修改物料组
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param qcMaterialGroup 物料组
|
|
|
|
* @param qcMaterialGroup 物料组
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -151,7 +157,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 批量删除物料组
|
|
|
|
* 批量删除物料组
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param ids 需要删除的物料组主键
|
|
|
|
* @param ids 需要删除的物料组主键
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -163,7 +169,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 删除物料组信息
|
|
|
|
* 删除物料组信息
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param id 物料组主键
|
|
|
|
* @param id 物料组主键
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -179,6 +185,21 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
|
|
|
|
return qcMaterialGroupMapper.validationData(id).size() > 0;
|
|
|
|
return qcMaterialGroupMapper.validationData(id).size() > 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<QcCheckTypeProject> getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject) {
|
|
|
|
|
|
|
|
List<QcCheckTypeProject> dtos = qcCheckTypeProjectMapper.getCheckTypeProjectList(qcCheckTypeProject);
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.push("master");
|
|
|
|
|
|
|
|
SysDictData sData = new SysDictData();
|
|
|
|
|
|
|
|
sData.setDictType("unit");
|
|
|
|
|
|
|
|
Map<String,SysDictData> dictMap = qcCheckTypeProjectMapper.getDictMap(sData);
|
|
|
|
|
|
|
|
if(dictMap != null){
|
|
|
|
|
|
|
|
for(QcCheckTypeProject dto:dtos){
|
|
|
|
|
|
|
|
dto.setUint(dictMap.get(dto.getUint()).getDictLabel());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return dtos;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private boolean hasChild(List<QcMaterialGroup> list, QcMaterialGroup t) {
|
|
|
|
private boolean hasChild(List<QcMaterialGroup> list, QcMaterialGroup t) {
|
|
|
|
return getChildList(list, t).size() > 0 ? true : false;
|
|
|
|
return getChildList(list, t).size() > 0 ? true : false;
|
|
|
|
}
|
|
|
|
}
|