ad(hwmom-mes): 工艺路线组成信息列表查询功能

- 新增 selectProdBaseRouteProcessJoinList 方法,用于查询工艺路线组成信息列表
- 在 ProdBaseRouteProcess 模型中添加 processName 和 processType 字段
- 更新 mapper 和 xml 文件以支持新的查询功能
- 使用左连接查询相关工序信息
master
zch 3 months ago
parent 1ceddf31d5
commit 8493d19459

@ -48,4 +48,18 @@ public class ProdBaseRouteProcess extends BaseEntity {
private String remark;
/**
*
*/
@TableField(exist = false)
private String processName;//映射字段
/**
* 1 2
*/
@TableField(exist = false)
private String processType;//映射字段
}

@ -4,6 +4,8 @@ import org.dromara.mes.domain.ProdBaseRouteProcess;
import org.dromara.mes.domain.vo.ProdBaseRouteProcessVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import java.util.List;
/**
* 线Mapper
*
@ -12,4 +14,13 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
*/
public interface ProdBaseRouteProcessMapper extends BaseMapperPlus<ProdBaseRouteProcess, ProdBaseRouteProcessVo> {
/**
* 线Join prod_base_process_info
*
* @param prodBaseRouteProcess 线
* @return 线
*/
public List<ProdBaseRouteProcess> selectProdBaseRouteProcessJoinList(ProdBaseRouteProcess prodBaseRouteProcess);
}

@ -66,4 +66,13 @@ public interface IProdBaseRouteProcessService {
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 线,Join mes_base_process
*
* @param prodBaseRouteProcess 线
* @return 线
*/
public List<ProdBaseRouteProcess> selectProdBaseRouteProcessJoinList(ProdBaseRouteProcess prodBaseRouteProcess);
}

@ -1,6 +1,5 @@
package org.dromara.mes.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.DateUtils;
@ -298,11 +297,6 @@ public class ProdBaseProcessInfoServiceImpl implements IProdBaseProcessInfoServi
prodBaseProcessUser.setCreateDept(prodBaseProcessInfo.getCreateDept());
prodBaseProcessUser.setTenantId(prodBaseProcessInfo.getTenantId());
Long userId = prodBaseProcessUser.getUserId();
list.add(prodBaseProcessUser);
}
if (!list.isEmpty()) {

@ -9,6 +9,7 @@ import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.mes.domain.ProdBaseProcessInfo;
import org.springframework.stereotype.Service;
import org.dromara.mes.domain.bo.ProdBaseRouteProcessBo;
import org.dromara.mes.domain.vo.ProdBaseRouteProcessVo;
@ -32,6 +33,8 @@ public class ProdBaseRouteProcessServiceImpl implements IProdBaseRouteProcessSer
private final ProdBaseRouteProcessMapper baseMapper;
private final ProdBaseRouteProcessMapper prodBaseRouteProcessMapper;
/**
* 线
*
@ -73,6 +76,11 @@ public class ProdBaseRouteProcessServiceImpl implements IProdBaseRouteProcessSer
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ProdBaseRouteProcess> lqw = JoinWrappers.lambda(ProdBaseRouteProcess.class)
.selectAll(ProdBaseRouteProcess.class)
.select(ProdBaseProcessInfo::getProcessName)
.select(ProdBaseProcessInfo::getProcessType)
.leftJoin(ProdBaseProcessInfo.class, ProdBaseProcessInfo::getProcessId, ProdBaseRouteProcess::getProcessId)
.eq(bo.getRouteProcessId() != null, ProdBaseRouteProcess::getRouteProcessId, bo.getRouteProcessId())
.eq(bo.getRouteId() != null, ProdBaseRouteProcess::getRouteId, bo.getRouteId())
.eq(bo.getProcessId() != null, ProdBaseRouteProcess::getProcessId, bo.getProcessId())
@ -132,4 +140,17 @@ public class ProdBaseRouteProcessServiceImpl implements IProdBaseRouteProcessSer
}
return baseMapper.deleteByIds(ids) > 0;
}
/**
* 线,Join mes_base_process
*
* @param prodBaseRouteProcess 线
* @return 线
*/
@Override
public List<ProdBaseRouteProcess> selectProdBaseRouteProcessJoinList(ProdBaseRouteProcess prodBaseRouteProcess)
{
return prodBaseRouteProcessMapper.selectProdBaseRouteProcessJoinList(prodBaseRouteProcess);
}
}

@ -196,10 +196,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mf.multiStationFlag
from prod_base_route_process brp
left join prod_base_process_info bpi on bpi.process_id = brp.process_id
left join mes_base_station_info bsi on bsi.process_id = bpi.process_id
left join prod_base_station_info bsi on bsi.process_id = bpi.process_id
left join (select brp.process_id, count(*) multiStationFlag
from prod_base_route_process brp
left join mes_base_station_info bsi on bsi.process_id = brp.process_id
left join prod_base_station_info bsi on bsi.process_id = brp.process_id
where brp.route_id = #{routeId}
group by brp.process_id) mf on mf.process_id = bsi.process_id
where brp.route_id = #{routeId}

@ -4,4 +4,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.mes.mapper.ProdBaseRouteProcessMapper">
<resultMap type="ProdBaseRouteProcess" id="ProdBaseRouteProcessResult">
<result property="routeProcessId" column="route_process_id" />
<result property="routeId" column="route_id" />
<result property="processId" column="process_id" />
<result property="processOrder" column="process_order" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="createDept" column="create_dept" />
<!-- <result property="processName" column="process_name" />
<result property="processType" column="process_type" />
<result property="productionTime" column="production_time" />
<result property="finalProcessFlag" column="final_process_flag" />-->
</resultMap>
<select id="selectProdBaseRouteProcessJoinList" parameterType="ProdBaseRouteProcess" resultMap="ProdBaseRouteProcessResult">
/* select mbrp.route_process_id, mbrp.route_id, mbrp.process_id, mbrp.process_order,
mbpi.process_name,mbpi.process_type,mbpi.production_time,mbpi.final_process_flag
from prod_base_route_process mbrp
left join prod_base_process_info mbpi on mbrp.process_id=mbpi.process_id*/
select mbrp.route_process_id, mbrp.route_id, mbrp.process_id, mbrp.process_order,
mbpi.process_name,mbpi.process_type,mbpi.production_time
from prod_base_route_process mbrp
left join prod_base_process_info mbpi on mbrp.process_id=mbpi.process_id
<where>
<if test="routeId != null "> and mbrp.route_id = #{routeId}</if>
<if test="processId != null "> and mbrp.process_id = #{processId}</if>
<if test="processOrder != null "> and mbrp.process_order = #{processOrder}</if>
<if test="remark != null and remark != ''"> and rmbrp.remark = #{remark}</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save