add work report to plan
parent
9cad2e1fce
commit
c0dd61f306
@ -0,0 +1,30 @@
|
||||
CREATE VIEW `mes_view_report_plan_detail` AS
|
||||
SELECT `wp`.`id` AS `id`,
|
||||
`wp`.`report_id` AS `report_id`,
|
||||
`wp`.`plan_id` AS `plan_id`,
|
||||
`wp`.`product_id` AS `product_id`,
|
||||
`wp`.`quality_number_plan` AS `quality_number_plan`,
|
||||
`wp`.`waste_number_plan` AS `waste_number_plan`,
|
||||
`wp`.`report_time_plan` AS `report_time_plan`,
|
||||
`wp`.`total_time_plan` AS `total_time_plan`,
|
||||
`wp`.`creator` AS `creator`,
|
||||
`wp`.`create_time` AS `create_time`,
|
||||
`wp`.`updater` AS `updater`,
|
||||
`wp`.`update_time` AS `update_time`,
|
||||
`wp`.`deleted` AS `deleted`,
|
||||
`wp`.`tenant_id` AS `tenant_id`,
|
||||
`pd`.`user_id` AS `user_id`,
|
||||
`pd`.`report_type` AS `report_type`,
|
||||
`pd`.`group_type` AS `group_type`,
|
||||
`pd`.`org_type` AS `org_type`,
|
||||
`pd`.`org_id` AS `org_id`,
|
||||
`pd`.`quality_number` AS `quality_number`,
|
||||
`pd`.`waste_number` AS `waste_number`,
|
||||
`pd`.`report_date` AS `report_date`,
|
||||
`pd`.`report_status` AS `report_status`,
|
||||
`pd`.`creator` AS `report_creator`
|
||||
FROM (
|
||||
`mes_work_report_plan` `wp`
|
||||
JOIN `mes_produce_report_detail` `pd` ON ((
|
||||
`wp`.`report_id` = `pd`.`id`
|
||||
)))
|
||||
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.workreportplan;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 报工分配计划 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_view_report_plan_summary")
|
||||
@KeySequence("mes_view_report_plan_summary_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ReportPlanSummaryDO {
|
||||
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
private Long planId;
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 工序类型
|
||||
*/
|
||||
private String orgType;
|
||||
/**
|
||||
* 成品数量
|
||||
*/
|
||||
private BigDecimal totalQualityNumber;
|
||||
/**
|
||||
* 废品数量
|
||||
*/
|
||||
private BigDecimal totalWasteNumber;
|
||||
/**
|
||||
* 计件时间
|
||||
*/
|
||||
private BigDecimal reportTimeSummary;
|
||||
/**
|
||||
* 总时长
|
||||
*/
|
||||
private BigDecimal totalTimeSummary;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.workreportplan;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.workreportplan.ReportPlanSummaryDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报工分配计划 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReportPlanSummaryMapper extends BaseMapperX<ReportPlanSummaryDO> {
|
||||
|
||||
default PageResult<ReportPlanSummaryDO> selectPage(PageParam param, ReportPlanSummaryDO reqVO) {
|
||||
LambdaQueryWrapper<ReportPlanSummaryDO> wrapper = new LambdaQueryWrapperX<ReportPlanSummaryDO>()
|
||||
.eqIfPresent(ReportPlanSummaryDO::getPlanId, reqVO.getPlanId())
|
||||
.eqIfPresent(ReportPlanSummaryDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(ReportPlanSummaryDO::getOrgType, reqVO.getOrgType())
|
||||
.orderByDesc(ReportPlanSummaryDO::getOrgType);
|
||||
return selectPage(param,wrapper );
|
||||
}
|
||||
|
||||
//查询计划某工序已经报工的总数
|
||||
default List<ReportPlanSummaryDO> selectList(ReportPlanSummaryDO reqVO) {
|
||||
LambdaQueryWrapper<ReportPlanSummaryDO> wrapper = new LambdaQueryWrapperX<ReportPlanSummaryDO>()
|
||||
.eqIfPresent(ReportPlanSummaryDO::getPlanId, reqVO.getPlanId())
|
||||
.eqIfPresent(ReportPlanSummaryDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(ReportPlanSummaryDO::getOrgType, reqVO.getOrgType())
|
||||
.orderByDesc(ReportPlanSummaryDO::getOrgType);
|
||||
List<ReportPlanSummaryDO> list = selectList(wrapper);
|
||||
return list;
|
||||
}
|
||||
default ReportPlanSummaryDO selectOne(ReportPlanSummaryDO reqVO) {
|
||||
LambdaQueryWrapper<ReportPlanSummaryDO> wrapper = new LambdaQueryWrapperX<ReportPlanSummaryDO>()
|
||||
.eqIfPresent(ReportPlanSummaryDO::getPlanId, reqVO.getPlanId())
|
||||
.eqIfPresent(ReportPlanSummaryDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(ReportPlanSummaryDO::getOrgType, reqVO.getOrgType())
|
||||
.orderByDesc(ReportPlanSummaryDO::getOrgType);
|
||||
List<ReportPlanSummaryDO> list = selectList(wrapper);
|
||||
if (list!=null && list.size()>0)return list.get(0);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue