diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java index f9d246dc..22e59370 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTypeProjectController.java @@ -49,14 +49,6 @@ public class QcCheckTypeProjectController extends BaseController { return getDataTable(list); } - /** - * 获取物料组树列表 - */ - @GetMapping("/materialTree") - public AjaxResult selectQcMaterialTreeList(QcMaterialGroup materialGroup) { - return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup)); - } - /** * 导出物料检验项目维护列表 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java index 5efe77b8..89df4a14 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java @@ -44,6 +44,14 @@ public class QcMaterialGroupController extends BaseController { return getDataTable(list); } + /** + * 获取物料组树列表 + */ + @GetMapping("/materialTree") + public AjaxResult selectQcMaterialTreeList(QcMaterialGroup materialGroup) { + return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup)); + } + /** * 导出物料组列表 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java index 0634545a..a3d8cc53 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTypeProject.java @@ -28,7 +28,7 @@ public class QcCheckTypeProject extends BaseEntity { /** 标准值 */ @Excel(name = "标准值") - private BigDecimal standardValue; + private String standardValue; /** 上差值 */ @Excel(name = "上差值") @@ -104,11 +104,11 @@ public class QcCheckTypeProject extends BaseEntity { public String getTypeId() { return typeId; } - public void setStandardValue(BigDecimal standardValue) { + public void setStandardValue(String standardValue) { this.standardValue = standardValue; } - public BigDecimal getStandardValue() { + public String getStandardValue() { return standardValue; } public void setUpperDiff(BigDecimal upperDiff) { diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java index 20b87a2e..06d7504d 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupDetailServiceImpl.java @@ -1,12 +1,20 @@ package com.op.quality.service.serviceImpl; import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; 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.stereotype.Service; import com.op.quality.mapper.QcMaterialGroupDetailMapper; import com.op.quality.domain.QcMaterialGroupDetail; 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业务层处理 @@ -26,6 +34,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS * @return 物料组成员 */ @Override + @DS("#header.poolName") public QcMaterialGroupDetail selectQcMaterialGroupDetailById(String id) { return qcMaterialGroupDetailMapper.selectQcMaterialGroupDetailById(id); } @@ -37,6 +46,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS * @return 物料组成员 */ @Override + @DS("#header.poolName") public List selectQcMaterialGroupDetailList(QcMaterialGroupDetail qcMaterialGroupDetail) { return qcMaterialGroupDetailMapper.selectQcMaterialGroupDetailList(qcMaterialGroupDetail); } @@ -48,8 +58,14 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS * @return 结果 */ @Override + @DS("#header.poolName") public int insertQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail) { + qcMaterialGroupDetail.setId(IdUtils.fastSimpleUUID()); + qcMaterialGroupDetail.setCreateBy(SecurityUtils.getUsername()); 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); } @@ -60,6 +76,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS * @return 结果 */ @Override + @DS("#header.poolName") public int updateQcMaterialGroupDetail(QcMaterialGroupDetail qcMaterialGroupDetail) { qcMaterialGroupDetail.setUpdateTime(DateUtils.getNowDate()); return qcMaterialGroupDetailMapper.updateQcMaterialGroupDetail(qcMaterialGroupDetail); @@ -72,6 +89,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS * @return 结果 */ @Override + @DS("#header.poolName") public int deleteQcMaterialGroupDetailByIds(String[] ids) { return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailByIds(ids); } @@ -83,6 +101,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS * @return 结果 */ @Override + @DS("#header.poolName") public int deleteQcMaterialGroupDetailById(String id) { return qcMaterialGroupDetailMapper.deleteQcMaterialGroupDetailById(id); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java index 27e50cce..43f012aa 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcMaterialGroupServiceImpl.java @@ -10,13 +10,19 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.SpringUtils; 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.security.utils.SecurityUtils; import com.op.quality.domain.vo.TreeSelect; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.quality.mapper.QcMaterialGroupMapper; import com.op.quality.domain.QcMaterialGroup; 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业务层处理 @@ -73,7 +79,9 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { Map> listMap = childList.stream().collect(Collectors.groupingBy(QcMaterialGroup::getParentId)); for (QcMaterialGroup material : groups) { //根据根节点Id进行赋值 - material.setChildren(listMap.get(material.getId())); + if (listMap.containsKey(material.getId())){ + material.setChildren(listMap.get(material.getId())); + } resultList.add(material); } @@ -116,8 +124,14 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { * @return 结果 */ @Override + @DS("#header.poolName") public int insertQcMaterialGroup(QcMaterialGroup qcMaterialGroup) { + qcMaterialGroup.setId(IdUtils.fastSimpleUUID()); + qcMaterialGroup.setCreateBy(SecurityUtils.getUsername()); 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); } @@ -128,8 +142,10 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { * @return 结果 */ @Override + @DS("#header.poolName") public int updateQcMaterialGroup(QcMaterialGroup qcMaterialGroup) { qcMaterialGroup.setUpdateTime(DateUtils.getNowDate()); + qcMaterialGroup.setUpdateBy(SecurityUtils.getUsername()); return qcMaterialGroupMapper.updateQcMaterialGroup(qcMaterialGroup); } @@ -140,6 +156,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { * @return 结果 */ @Override + @DS("#header.poolName") public int deleteQcMaterialGroupByIds(String[] ids) { return qcMaterialGroupMapper.deleteQcMaterialGroupByIds(ids); } @@ -151,6 +168,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { * @return 结果 */ @Override + @DS("#header.poolName") public int deleteQcMaterialGroupById(String id) { return qcMaterialGroupMapper.deleteQcMaterialGroupById(id); }