修改物料检验项目实体

highway
shaoyong 1 year ago
parent 8c3829be4d
commit c67c7a464d

@ -49,14 +49,6 @@ public class QcCheckTypeProjectController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
*
*/
@GetMapping("/materialTree")
public AjaxResult selectQcMaterialTreeList(QcMaterialGroup materialGroup) {
return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup));
}
/** /**
* *
*/ */

@ -44,6 +44,14 @@ public class QcMaterialGroupController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
*
*/
@GetMapping("/materialTree")
public AjaxResult selectQcMaterialTreeList(QcMaterialGroup materialGroup) {
return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup));
}
/** /**
* *
*/ */

@ -28,7 +28,7 @@ public class QcCheckTypeProject extends BaseEntity {
/** 标准值 */ /** 标准值 */
@Excel(name = "标准值") @Excel(name = "标准值")
private BigDecimal standardValue; private String standardValue;
/** 上差值 */ /** 上差值 */
@Excel(name = "上差值") @Excel(name = "上差值")
@ -104,11 +104,11 @@ public class QcCheckTypeProject extends BaseEntity {
public String getTypeId() { public String getTypeId() {
return typeId; return typeId;
} }
public void setStandardValue(BigDecimal standardValue) { public void setStandardValue(String standardValue) {
this.standardValue = standardValue; this.standardValue = standardValue;
} }
public BigDecimal getStandardValue() { public String getStandardValue() {
return standardValue; return standardValue;
} }
public void setUpperDiff(BigDecimal upperDiff) { public void setUpperDiff(BigDecimal upperDiff) {

@ -1,12 +1,20 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.serviceImpl;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
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.QcMaterialGroupDetailMapper; import com.op.quality.mapper.QcMaterialGroupDetailMapper;
import com.op.quality.domain.QcMaterialGroupDetail; import com.op.quality.domain.QcMaterialGroupDetail;
import com.op.quality.service.IQcMaterialGroupDetailService; import com.op.quality.service.IQcMaterialGroupDetailService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
@ -26,6 +34,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public QcMaterialGroupDetail selectQcMaterialGroupDetailById(String id) { public QcMaterialGroupDetail selectQcMaterialGroupDetailById(String id) {
return qcMaterialGroupDetailMapper.selectQcMaterialGroupDetailById(id); return qcMaterialGroupDetailMapper.selectQcMaterialGroupDetailById(id);
} }
@ -37,6 +46,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public List<QcMaterialGroupDetail> selectQcMaterialGroupDetailList(QcMaterialGroupDetail qcMaterialGroupDetail) { public List<QcMaterialGroupDetail> selectQcMaterialGroupDetailList(QcMaterialGroupDetail qcMaterialGroupDetail) {
return qcMaterialGroupDetailMapper.selectQcMaterialGroupDetailList(qcMaterialGroupDetail); return qcMaterialGroupDetailMapper.selectQcMaterialGroupDetailList(qcMaterialGroupDetail);
} }
@ -48,8 +58,14 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int insertQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail) { public int insertQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail) {
qcMaterialGroupDetail.setId(IdUtils.fastSimpleUUID());
qcMaterialGroupDetail.setCreateBy(SecurityUtils.getUsername());
qcMaterialGroupDetail.setCreateTime(DateUtils.getNowDate()); qcMaterialGroupDetail.setCreateTime(DateUtils.getNowDate());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
qcMaterialGroupDetail.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
return qcMaterialGroupDetailMapper.insertQcMaterialGroupDetail(qcMaterialGroupDetail); return qcMaterialGroupDetailMapper.insertQcMaterialGroupDetail(qcMaterialGroupDetail);
} }
@ -60,6 +76,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int updateQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail) { public int updateQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail) {
qcMaterialGroupDetail.setUpdateTime(DateUtils.getNowDate()); qcMaterialGroupDetail.setUpdateTime(DateUtils.getNowDate());
return qcMaterialGroupDetailMapper.updateQcMaterialGroupDetail(qcMaterialGroupDetail); return qcMaterialGroupDetailMapper.updateQcMaterialGroupDetail(qcMaterialGroupDetail);
@ -72,6 +89,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int deleteQcMaterialGroupDetailByIds(String[] ids) { public int deleteQcMaterialGroupDetailByIds(String[] ids) {
return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailByIds(ids); return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailByIds(ids);
} }
@ -83,6 +101,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int deleteQcMaterialGroupDetailById(String id) { public int deleteQcMaterialGroupDetailById(String id) {
return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailById(id); return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailById(id);
} }

@ -10,13 +10,19 @@ import com.baomidou.dynamic.datasource.annotation.DS;
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.datascope.annotation.DataScope; import com.op.common.datascope.annotation.DataScope;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.vo.TreeSelect; import com.op.quality.domain.vo.TreeSelect;
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;
import com.op.quality.domain.QcMaterialGroup; import com.op.quality.domain.QcMaterialGroup;
import com.op.quality.service.IQcMaterialGroupService; import com.op.quality.service.IQcMaterialGroupService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
@ -73,7 +79,9 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
Map<String,List<QcMaterialGroup>> listMap = childList.stream().collect(Collectors.groupingBy(QcMaterialGroup::getParentId)); Map<String,List<QcMaterialGroup>> listMap = childList.stream().collect(Collectors.groupingBy(QcMaterialGroup::getParentId));
for (QcMaterialGroup material : groups) { for (QcMaterialGroup material : groups) {
//根据根节点Id进行赋值 //根据根节点Id进行赋值
material.setChildren(listMap.get(material.getId())); if (listMap.containsKey(material.getId())){
material.setChildren(listMap.get(material.getId()));
}
resultList.add(material); resultList.add(material);
} }
@ -116,8 +124,14 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int insertQcMaterialGroup(QcMaterialGroup qcMaterialGroup) { public int insertQcMaterialGroup(QcMaterialGroup qcMaterialGroup) {
qcMaterialGroup.setId(IdUtils.fastSimpleUUID());
qcMaterialGroup.setCreateBy(SecurityUtils.getUsername());
qcMaterialGroup.setCreateTime(DateUtils.getNowDate()); qcMaterialGroup.setCreateTime(DateUtils.getNowDate());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
qcMaterialGroup.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
return qcMaterialGroupMapper.insertQcMaterialGroup(qcMaterialGroup); return qcMaterialGroupMapper.insertQcMaterialGroup(qcMaterialGroup);
} }
@ -128,8 +142,10 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int updateQcMaterialGroup(QcMaterialGroup qcMaterialGroup) { public int updateQcMaterialGroup(QcMaterialGroup qcMaterialGroup) {
qcMaterialGroup.setUpdateTime(DateUtils.getNowDate()); qcMaterialGroup.setUpdateTime(DateUtils.getNowDate());
qcMaterialGroup.setUpdateBy(SecurityUtils.getUsername());
return qcMaterialGroupMapper.updateQcMaterialGroup(qcMaterialGroup); return qcMaterialGroupMapper.updateQcMaterialGroup(qcMaterialGroup);
} }
@ -140,6 +156,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int deleteQcMaterialGroupByIds(String[] ids) { public int deleteQcMaterialGroupByIds(String[] ids) {
return qcMaterialGroupMapper.deleteQcMaterialGroupByIds(ids); return qcMaterialGroupMapper.deleteQcMaterialGroupByIds(ids);
} }
@ -151,6 +168,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int deleteQcMaterialGroupById(String id) { public int deleteQcMaterialGroupById(String id) {
return qcMaterialGroupMapper.deleteQcMaterialGroupById(id); return qcMaterialGroupMapper.deleteQcMaterialGroupById(id);
} }

Loading…
Cancel
Save