质量目标优化,人员线体

master
shaoyong 11 months ago
parent 705fdb1a3d
commit ba6ab6dd2b

@ -98,6 +98,7 @@ public class QcUserMaterial extends BaseEntity {
private String materialId;
private String[] userCodes;
private String[] userNames;
private String label;
private String key;
@ -271,6 +272,14 @@ public class QcUserMaterial extends BaseEntity {
this.selectedValues = selectedValues;
}
public String[] getUserNames() {
return userNames;
}
public void setUserNames(String[] userNames) {
this.userNames = userNames;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -76,9 +76,9 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
@Override
@DS("#header.poolName")
public int insertQcUserMaterial(QcUserMaterial qcUserMaterial) {
List<String> userCodes = new ArrayList<>();
/*List<String> userCodes = new ArrayList<>();
userCodes.add(qcUserMaterial.getUserCode());
qcUserMaterial.setUserCodes(userCodes.toArray(new String[userCodes.size()]));
qcUserMaterial.setUserCodes(userCodes.toArray(new String[userCodes.size()]));*/
Date now = DateUtils.getNowDate();
if (StringUtils.isNotEmpty(qcUserMaterial.getUserCodes())) {
@ -89,15 +89,17 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
QcUserMaterial qcUserMaterialDto = null;
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
for (String userCode : qcUserMaterial.getUserCodes()) {
String[] userCodes = qcUserMaterial.getUserCodes();
String[] userNames = qcUserMaterial.getUserNames();
for (int i = 0; i < userCodes.length; i++) {
for (String materialCode : qcUserMaterial.getSelectedValues()) {
//查询物料编码对应的各种信息
qcUserMaterialDto = new QcUserMaterial();
qcUserMaterialDto.setId(IdUtils.fastSimpleUUID());
qcUserMaterialDto.setCreateTime(now);
qcUserMaterialDto.setCreateBy(SecurityUtils.getUsername());
qcUserMaterialDto.setUserCode(userCode);
qcUserMaterialDto.setUserName(qcUserMaterial.getUserName());
qcUserMaterialDto.setUserCode(userCodes[i]);
qcUserMaterialDto.setUserName(userNames[i]);
qcUserMaterialDto.setMaterialCode(materialCode);
qcUserMaterialDto.setMaterialName(qcUserMaterial.getMaterialName());
qcUserMaterialDto.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
@ -151,7 +153,6 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
@Override
@DS("#header.poolName")
public List<QcUserMaterial> getList(QcUserMaterial qcUserMaterial) {
List<QcUserMaterial> dto = qcUserMaterialMapper.getUserMaterialListUndo(qcUserMaterial);
qcUserMaterial.setMaterialName(null);
List<QcUserMaterial> selected = qcUserMaterialMapper.getUserMaterialListDo(qcUserMaterial);

@ -228,7 +228,7 @@
FROM qc_goal_distribute gd
WHERE gd.belong_goal_id =#{ belongGoalId }
)
<if test="supplierName != null and supplierName != ''">and bs.zh_desc like concat('%', #{supplierName},'%')
<if test="supplierName != null and supplierName != ''">and bp.product_desc_zh like concat('%', #{supplierName},'%')
</if>
</select>

@ -75,16 +75,19 @@
<select id="getUserMaterialListUndo" resultType="com.op.quality.domain.QcUserMaterial">
select
bp.product_code materialCode,
concat(bp.product_desc_zh,'(',bp.product_code,')') label,
concat(bp.product_desc_zh,'(',bp.product_code,')') materialName,
bp.product_id materialId
from base_product bp
where bp.active_flag = '1' and bp.del_flag = '0'
and bp.product_code not in (
bp.equipment_code materialCode,
concat(bp.equipment_name,'(',bp.equipment_code,')') label,
concat(bp.equipment_name,'(',bp.equipment_code,')') materialName,
bp.equipment_id materialId
from base_equipment bp
where bp.status = '1' and bp.del_flag = '0' and bp.equipment_type_code = 'equ_type_bzx'
and bp.equipment_code not in (
select um.material_code
from qc_user_material um
where um.user_code =#{userCode}
where um.user_code in
<foreach collection="userCodes" item="userCode" open="(" close=")" separator=",">
#{userCode}
</foreach>
)
<if test="materialName != null and materialName != ''">and bp.product_desc_zh like concat('%', #{materialName},
'%')
@ -93,11 +96,14 @@
<select id="getUserMaterialListDo" resultType="com.op.quality.domain.QcUserMaterial">
select distinct um.material_code materialCode,
concat(bp.product_desc_zh,'(',bp.product_code,')') label
concat(bp.equipment_name,'(',bp.equipment_code,')') label
from qc_user_material um
left join base_product bp on um.material_code = bp.product_code
where um.user_code = #{userCode}
<if test="materialName != null and materialName != ''">and bp.product_desc_zh like concat('%', #{materialName},
left join base_equipment bp on um.material_code = bp.equipment_code
where bp.equipment_type_code = 'equ_type_bzx' and um.user_code in
<foreach collection="userCodes" item="userCode" open="(" close=")" separator=",">
#{userCode}
</foreach>
<if test="materialName != null and materialName != ''">and bp.equipment_name like concat('%', #{materialName},
'%')
</if>
</select>

Loading…
Cancel
Save