add(mes): 添加生产计划监控功能

- 新增生产计划监控页面接口和实现
- 添加生产计划监控相关的数据结构和映射
- 实现生产计划监控的分页查询功能
- 优化生产计划信息的查询和展示
master
zch 1 month ago
parent 097c6afca0
commit 7c06d2187d

@ -173,4 +173,13 @@ public class ProdPlanInfoController extends BaseController {
return toAjax(prodPlanInfoService.issuePlanByPlanIds(workshopId, List.of(planIds)));
}
/**
*
*/
@SaCheckPermission("mes:planInfo:list")
@GetMapping("/queryMoritorPageList")
public TableDataInfo<ProdPlanInfoVo> queryMoritorPageList(ProdPlanInfoBo bo, PageQuery pageQuery) {
return prodPlanInfoService.queryMoritorPageList(bo, pageQuery);
}
}

@ -201,4 +201,10 @@ public class ProdPlanInfo extends TenantEntity {
@TableField(exist = false)
private String releaseName;//映射字段
/**
*
*/
@TableField(exist = false)
private String shiftName;//映射字段
}

@ -227,7 +227,6 @@ public class ProdPlanInfoVo implements Serializable {
private String materialCode;
private String materialName;
private String processName;
private String shiftName;
private String teamName;
private String materialBomName;
private String releaseName;
@ -241,4 +240,11 @@ public class ProdPlanInfoVo implements Serializable {
@ExcelIgnore
private Long processProductionTime;
/**
*
*/
@ExcelProperty(value = "班次名称")
private String shiftName;//
}

@ -47,5 +47,11 @@ public interface ProdPlanInfoMapper extends BaseMapperPlus<ProdPlanInfo, ProdPla
List<ProdPlanInfoVo> selectProdPlanInfoList(@Param("tableName") String tableName, @Param(Constants.WRAPPER) Wrapper<ProdPlanInfo> queryWrapper);
/**
*
* @param page
* @param queryWrapper
* @return
*/
public Page<ProdPlanInfoVo> queryMoritorPageList(@Param("page") Page<ProdPlanInfoVo> page, @Param("tableName")String tableName,@Param(Constants.WRAPPER) Wrapper<ProdPlanInfo> queryWrapper);
}

@ -73,7 +73,7 @@ public interface IProdPlanInfoService {
*
* @return
*/
public String getDispatchCode();
String getDispatchCode();
/**
* ,join process
@ -81,16 +81,7 @@ public interface IProdPlanInfoService {
* @param bo
* @return
*/
public List<ProdPlanInfoVo> selectProdPlanInfoJoinProcessList(ProdPlanInfoBo bo);
/**
*
*
* @param boList
* @return
*/
/* public Boolean insertBatchList(List<ProdPlanInfoBo> boList);*/
List<ProdPlanInfoVo> selectProdPlanInfoJoinProcessList(ProdPlanInfoBo bo);
/**
@ -99,7 +90,7 @@ public interface IProdPlanInfoService {
* @param mesProductPlanEditVo VO
* @return
*/
public int orderAddMesProductPlanList(MesProductPlanEditVo mesProductPlanEditVo);
int orderAddMesProductPlanList(MesProductPlanEditVo mesProductPlanEditVo);
/**
*
@ -109,4 +100,12 @@ public interface IProdPlanInfoService {
*/
Boolean issuePlanByPlanIds(Long workshopId, List<Long> planIds);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ProdPlanInfoVo> queryMoritorPageList(ProdPlanInfoBo bo, PageQuery pageQuery);
}

@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.RequiredArgsConstructor;
import org.dromara.mes.domain.BaseShiftInfo;
import org.dromara.mes.domain.vo.MesProductPlanEditVo;
import org.springframework.stereotype.Service;
import org.dromara.mes.domain.bo.ProdPlanInfoBo;
@ -281,4 +282,63 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService {
return true;
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<ProdPlanInfoVo> queryMoritorPageList(ProdPlanInfoBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ProdPlanInfo> lqw = buildQW(bo);
String tableName = getPlanInfoTableName(bo.getWorkshopId());
Page<ProdPlanInfoVo> result = baseMapper.queryMoritorPageList(pageQuery.build(), tableName, lqw);
return TableDataInfo.build(result);
}
private MPJLambdaWrapper<ProdPlanInfo> buildQW(ProdPlanInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ProdPlanInfo> lqw = JoinWrappers.lambda(ProdPlanInfo.class)
.selectAll(ProdPlanInfo.class)
//生产计划监控页面传参查询时间区间
.between( !ObjectUtils.isEmpty(params.get("monitorBeginTime")) && !ObjectUtils.isEmpty(params.get("monitorBeginTime")),
ProdPlanInfo::getPlanBeginTime, params.get("monitorBeginTime"), params.get("monitorEndTime"))
.eq(bo.getPlanId() != null, ProdPlanInfo::getPlanId, bo.getPlanId())
.eq(bo.getProductOrderId() != null, ProdPlanInfo::getProductOrderId, bo.getProductOrderId())
.eq(bo.getSaleOrderId() != null, ProdPlanInfo::getSaleOrderId, bo.getSaleOrderId())
.eq(StringUtils.isNotBlank(bo.getSaleorderCode()), ProdPlanInfo::getSaleorderCode, bo.getSaleorderCode())
.eq(StringUtils.isNotBlank(bo.getPlanCode()), ProdPlanInfo::getPlanCode, bo.getPlanCode())
.eq(StringUtils.isNotBlank(bo.getDispatchCode()), ProdPlanInfo::getDispatchCode, bo.getDispatchCode())
.eq(bo.getMaterialId() != null, ProdPlanInfo::getMaterialId, bo.getMaterialId())
.eq(bo.getMaterialBomId() != null, ProdPlanInfo::getMaterialBomId, bo.getMaterialBomId())
.eq(bo.getProcessId() != null, ProdPlanInfo::getProcessId, bo.getProcessId())
.eq(bo.getProcessOrder() != null, ProdPlanInfo::getProcessOrder, bo.getProcessOrder())
.eq(bo.getLastProcessId() != null, ProdPlanInfo::getLastProcessId, bo.getLastProcessId())
.eq(StringUtils.isNotBlank(bo.getFinalProcessFlag()), ProdPlanInfo::getFinalProcessFlag, bo.getFinalProcessFlag())
.eq(StringUtils.isNotBlank(bo.getReleaseType()), ProdPlanInfo::getReleaseType, bo.getReleaseType())
.eq(bo.getReleaseId() != null, ProdPlanInfo::getReleaseId, bo.getReleaseId())
.eq(bo.getProductionTime() != null, ProdPlanInfo::getProductionTime, bo.getProductionTime())
.eq(bo.getPlanAmount() != null, ProdPlanInfo::getPlanAmount, bo.getPlanAmount())
.eq(bo.getDispatchAmount() != null, ProdPlanInfo::getDispatchAmount, bo.getDispatchAmount())
.eq(bo.getCompleteAmount() != null, ProdPlanInfo::getCompleteAmount, bo.getCompleteAmount())
.eq(bo.getPlanBeginTime() != null, ProdPlanInfo::getPlanBeginTime, bo.getPlanBeginTime())
.eq(bo.getPlanEndTime() != null, ProdPlanInfo::getPlanEndTime, bo.getPlanEndTime())
.eq(bo.getRealBeginTime() != null, ProdPlanInfo::getRealBeginTime, bo.getRealBeginTime())
.eq(bo.getRealEndTime() != null, ProdPlanInfo::getRealEndTime, bo.getRealEndTime())
.eq(StringUtils.isNotBlank(bo.getAttachId()), ProdPlanInfo::getAttachId, bo.getAttachId())
.eq(StringUtils.isNotBlank(bo.getPlanStatus()), ProdPlanInfo::getPlanStatus, bo.getPlanStatus())
.eq(StringUtils.isNotBlank(bo.getImportFlag()), ProdPlanInfo::getImportFlag, bo.getImportFlag())
.eq(StringUtils.isNotBlank(bo.getFinishFlag()), ProdPlanInfo::getFinishFlag, bo.getFinishFlag())
.eq(bo.getPriority() != null, ProdPlanInfo::getPriority, bo.getPriority())
.eq(bo.getShiftId() != null, ProdPlanInfo::getShiftId, bo.getShiftId())
.eq(bo.getClassTeamId() != null, ProdPlanInfo::getClassTeamId, bo.getClassTeamId())
.eq(StringUtils.isNotBlank(bo.getModelCode()), ProdPlanInfo::getModelCode, bo.getModelCode())
.in(StringUtils.isNotNull(bo.getPlanIds()), ProdPlanInfo::getPlanId, bo.getPlanIds())
.orderByDesc(ProdPlanInfo::getCreateTime);
return lqw;
}
}

@ -168,4 +168,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by mpp.dispatch_code,mpp.process_order
</select>
<select id="queryMoritorPageList" parameterType="ProdPlanInfoBo" resultType="ProdPlanInfoVo">
select
${ew.getSqlSelect},
bmi.material_code,
bmi.material_name,
bomi.material_name material_bom_name,
case
when t.release_type = 1 then (select pbmi.machine_name
from prod_base_machine_info pbmi
where t.release_id = pbmi.machine_id)
when t.release_type = 2 then (select su.nick_name
from sys_user su
where t.release_id = su.user_id)
when t.release_type = 3 then (select pbsi.station_name
from prod_base_station_info pbsi
where t.release_id = pbsi.station_id)
end as release_name,
pbpi.process_name,
bsi.shift_name,
bcti.team_name
from ${tableName} t
left join base_material_info bmi on bmi.material_id = t.material_id
left join prod_material_bom pmb on pmb.material_bom_id = t.material_bom_id
left join base_material_info bomi on bomi.material_id = pmb.material_id
left join prod_base_process_info pbpi on pbpi.process_id = t.process_id
left join base_shift_info bsi on bsi.shift_id = t.shift_id
left join base_class_team_info bcti on bcti.class_team_id = t.class_team_id
${ew.getCustomSqlSegment}
</select>
</mapper>

Loading…
Cancel
Save