Merge remote-tracking branch 'origin/qms/develop' into qms/develop
This commit is contained in:
commit
d92cb1136b
|
|
@ -153,6 +153,6 @@ public class QmsQualityInspectorController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("materialsByUser")
|
@PostMapping("materialsByUser")
|
||||||
public ApiResult<PageData<QmsQualityInspectorMaterialVO>> materialsByUser(@RequestBody QmsMaterialsByUserQO qo) {
|
public ApiResult<PageData<QmsQualityInspectorMaterialVO>> materialsByUser(@RequestBody QmsMaterialsByUserQO qo) {
|
||||||
return ApiResult.success(qualityInspectorService.getMaterialsByUserId(qo.getMaterialNo(), qo.getMaterialCategoryCode(), qo.getMaterialDesc(), qo.getPageNum(), qo.getPageSize()));
|
return ApiResult.success(qualityInspectorService.getMaterialsByUserId(qo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
package com.nflg.wms.common.pojo.qo;
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按用户查询绑定物料参数
|
* 按用户查询绑定物料参数
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class QmsMaterialsByUserQO {
|
public class QmsMaterialsByUserQO extends PageQO{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料编号(精确,可选)
|
* 物料编号(精确,可选)
|
||||||
|
|
@ -24,12 +25,8 @@ public class QmsMaterialsByUserQO {
|
||||||
private String materialDesc;
|
private String materialDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页码
|
* 质检类型:0为SQE,1为IQC,2为PQC
|
||||||
*/
|
*/
|
||||||
private Integer pageNum = 1;
|
@NotNull
|
||||||
|
private Integer inspectionType;
|
||||||
/**
|
|
||||||
* 每页大小
|
|
||||||
*/
|
|
||||||
private Integer pageSize = 10;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nflg.wms.repository.mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.nflg.wms.common.pojo.qo.QmsMaterialsByUserQO;
|
||||||
import com.nflg.wms.common.pojo.qo.QmsQualityInspectorSearchQO;
|
import com.nflg.wms.common.pojo.qo.QmsQualityInspectorSearchQO;
|
||||||
import com.nflg.wms.common.pojo.vo.QmsQualityInspectorCategoryVO;
|
import com.nflg.wms.common.pojo.vo.QmsQualityInspectorCategoryVO;
|
||||||
import com.nflg.wms.common.pojo.vo.QmsQualityInspectorMaterialVO;
|
import com.nflg.wms.common.pojo.vo.QmsQualityInspectorMaterialVO;
|
||||||
|
|
@ -43,12 +44,7 @@ public interface QmsQualityInspectorMapper extends BaseMapper<QmsQualityInspecto
|
||||||
/**
|
/**
|
||||||
* 按 userId 查询绑定物料列表(支持物料编号/类别/描述过滤,分页)
|
* 按 userId 查询绑定物料列表(支持物料编号/类别/描述过滤,分页)
|
||||||
*/
|
*/
|
||||||
IPage<QmsQualityInspectorMaterialVO> getMaterialsByUserIdWithFilter(
|
IPage<QmsQualityInspectorMaterialVO> getMaterialsByUserIdWithFilter(QmsMaterialsByUserQO request,Long userId, IPage<?> page);
|
||||||
Page<QmsQualityInspectorMaterialVO> page,
|
|
||||||
@Param("userId") Long userId,
|
|
||||||
@Param("materialNo") String materialNo,
|
|
||||||
@Param("materialCategoryCode") String materialCategoryCode,
|
|
||||||
@Param("materialDesc") String materialDesc);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按 userId 查询关联物料类别列表
|
* 按 userId 查询关联物料类别列表
|
||||||
|
|
|
||||||
|
|
@ -76,5 +76,5 @@ public interface IQmsQualityInspectorService extends IService<QmsQualityInspecto
|
||||||
/**
|
/**
|
||||||
* 按 userId 查询当前用户绑定的物料列表(支持物料编号/类别/描述过滤,分页)
|
* 按 userId 查询当前用户绑定的物料列表(支持物料编号/类别/描述过滤,分页)
|
||||||
*/
|
*/
|
||||||
PageData<QmsQualityInspectorMaterialVO> getMaterialsByUserId(String materialNo, String materialCategoryCode, String materialDesc, Integer pageNum, Integer pageSize);
|
IPage<QmsQualityInspectorMaterialVO> getMaterialsByUserId(QmsMaterialsByUserQO qo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -594,17 +594,8 @@ public class QmsQualityInspectorServiceImpl extends ServiceImpl<QmsQualityInspec
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageData<QmsQualityInspectorMaterialVO> getMaterialsByUserId(String materialNo, String materialCategoryCode,
|
public IPage<QmsQualityInspectorMaterialVO> getMaterialsByUserId(QmsMaterialsByUserQO qo) {
|
||||||
String materialDesc, Integer pageNum, Integer pageSize) {
|
|
||||||
Long userId = UserUtil.getUserId();
|
Long userId = UserUtil.getUserId();
|
||||||
Page<QmsQualityInspectorMaterialVO> page = new Page<>(pageNum, pageSize);
|
return baseMapper.getMaterialsByUserIdWithFilter(qo, userId, new Page<>(qo.getPage(), qo.getPageSize()));
|
||||||
IPage<QmsQualityInspectorMaterialVO> result = baseMapper.getMaterialsByUserIdWithFilter(
|
|
||||||
page, userId, materialNo, materialCategoryCode, materialDesc);
|
|
||||||
|
|
||||||
return new PageData<QmsQualityInspectorMaterialVO>()
|
|
||||||
.setPage((int) result.getCurrent())
|
|
||||||
.setPageSize((int) result.getSize())
|
|
||||||
.setTotal((int) result.getTotal())
|
|
||||||
.setItems(result.getRecords());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,18 +128,19 @@
|
||||||
m.material_texture,
|
m.material_texture,
|
||||||
m.is_standard_maintained AS material_status
|
m.is_standard_maintained AS material_status
|
||||||
FROM qms_inspector_material_item imi
|
FROM qms_inspector_material_item imi
|
||||||
|
INNER JOIN qms_quality_inspector qi ON qi.id = imi.inspector_id
|
||||||
LEFT JOIN qms_qc_material m ON m.id = imi.material_id
|
LEFT JOIN qms_qc_material m ON m.id = imi.material_id
|
||||||
WHERE imi.inspector_id = (
|
WHERE qi.inspection_type=#{request.inspectionType} AND imi.inspector_id = (
|
||||||
SELECT id FROM qms_quality_inspector WHERE user_id = #{userId} LIMIT 1
|
SELECT id FROM qms_quality_inspector WHERE user_id = #{userId} LIMIT 1
|
||||||
)
|
)
|
||||||
<if test="materialNo != null and materialNo != ''">
|
<if test="materialNo != null and materialNo != ''">
|
||||||
AND m.material_no = #{materialNo}
|
AND m.material_no = #{request.materialNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="materialCategoryCode != null and materialCategoryCode != ''">
|
<if test="materialCategoryCode != null and materialCategoryCode != ''">
|
||||||
AND m.material_category_code LIKE CONCAT(#{materialCategoryCode}, '%')
|
AND m.material_category_code LIKE CONCAT(#{request.materialCategoryCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="materialDesc != null and materialDesc != ''">
|
<if test="materialDesc != null and materialDesc != ''">
|
||||||
AND m.material_desc LIKE CONCAT('%', #{materialDesc}, '%')
|
AND m.material_desc LIKE CONCAT('%', #{request.materialDesc}, '%')
|
||||||
</if>
|
</if>
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -155,20 +156,21 @@
|
||||||
m.material_texture,
|
m.material_texture,
|
||||||
m.is_standard_maintained AS material_status
|
m.is_standard_maintained AS material_status
|
||||||
FROM qms_inspector_material_category_item imci
|
FROM qms_inspector_material_category_item imci
|
||||||
|
INNER JOIN qms_quality_inspector qi ON qi.id = imi.inspector_id
|
||||||
JOIN qms_qc_material_category mc ON mc.id = imci.material_category_id
|
JOIN qms_qc_material_category mc ON mc.id = imci.material_category_id
|
||||||
JOIN qms_qc_material_category descendant ON descendant.parent_tree <@ mc.parent_tree
|
JOIN qms_qc_material_category descendant ON descendant.parent_tree <@ mc.parent_tree
|
||||||
JOIN qms_qc_material m ON m.material_category_code = descendant.category_code
|
JOIN qms_qc_material m ON m.material_category_code = descendant.category_code
|
||||||
WHERE imci.inspector_id = (
|
WHERE qi.inspection_type=#{request.inspectionType} AND imci.inspector_id = (
|
||||||
SELECT id FROM qms_quality_inspector WHERE user_id = #{userId} LIMIT 1
|
SELECT id FROM qms_quality_inspector WHERE user_id = #{userId} LIMIT 1
|
||||||
)
|
)
|
||||||
<if test="materialNo != null and materialNo != ''">
|
<if test="materialNo != null and materialNo != ''">
|
||||||
AND m.material_no = #{materialNo}
|
AND m.material_no = #{request.materialNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="materialCategoryCode != null and materialCategoryCode != ''">
|
<if test="materialCategoryCode != null and materialCategoryCode != ''">
|
||||||
AND m.material_category_code LIKE CONCAT(#{materialCategoryCode}, '%')
|
AND m.material_category_code LIKE CONCAT(#{request.materialCategoryCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="materialDesc != null and materialDesc != ''">
|
<if test="materialDesc != null and materialDesc != ''">
|
||||||
AND m.material_desc LIKE CONCAT('%', #{materialDesc}, '%')
|
AND m.material_desc LIKE CONCAT('%', #{request.materialDesc}, '%')
|
||||||
</if>
|
</if>
|
||||||
ORDER BY material_id ASC
|
ORDER BY material_id ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue