pcn line off diff time statistics
parent
6587ea358a
commit
2f5453ae49
@ -0,0 +1,25 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.base.jx;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesTimeSegmentStatistics;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangjie
|
||||
* @CreateDate: 2021/01/18 11:22 上午
|
||||
* @Description:
|
||||
**/
|
||||
public interface IJxTimeSegmentStatisticsService {
|
||||
|
||||
/**
|
||||
* 根据生产线代码,班次代码查询分时段统计方式信息
|
||||
* @param organizeCode 组织代码
|
||||
* @param workCenterCode 生产线代码
|
||||
* @param shiftCode 班次代码
|
||||
* @return 分时段统计方式信息
|
||||
*/
|
||||
@ApiOperation(value = "根据生产线代码,班次代码查询分时段统计方式信息", notes = "根据生产线代码,班次代码查询分时段统计方式信息")
|
||||
List<MesTimeSegmentStatistics> getTimeSegmentStatisticsListByShiftCode(String organizeCode, String workCenterCode, String shiftCode);
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.busi.jx;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesOutPutStatisticsTimeSegment;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangjie
|
||||
* @CreateDate: 2021/01/18 11:22 上午
|
||||
* @Description:
|
||||
**/
|
||||
public interface IJxOutPutStatisticsTimeSegmentService {
|
||||
|
||||
/**
|
||||
* 根据工单,作业时间,分时代码查询分时产量统计信息
|
||||
* @param organizeCode 组织代码
|
||||
* @param workOrderNo 工单
|
||||
* @param workTime 作业时间
|
||||
* @param shiftCode 班次代码
|
||||
* @param timeSegmentCode 分时代码
|
||||
* @return 分时产量统计信息
|
||||
*/
|
||||
@ApiOperation(value = "根据工单,作业时间,班次代码,分时代码查询分时产量统计信息", notes = "根据工单,作业时间,班次代码,分时代码查询分时产量统计信息")
|
||||
List<MesOutPutStatisticsTimeSegment> getOutPutStatisticsTimeSegmentByOrderAndTsCode(String organizeCode, String workOrderNo, String workTime, String shiftCode, String timeSegmentCode);
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base.jx;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.jx.IJxTimeSegmentStatisticsService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesTimeSegmentStatistics;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.repository.MesTimeSegmentStatisticsRepository;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: wangjie
|
||||
* @CreateDate: 2021/01/18 11:41 上午
|
||||
* @Description:
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class JxTimeSegmentStatisticsService implements IJxTimeSegmentStatisticsService {
|
||||
|
||||
@Autowired
|
||||
private MesTimeSegmentStatisticsRepository timeSegmentStatisticsRepository;
|
||||
|
||||
@Override
|
||||
public List<MesTimeSegmentStatistics> getTimeSegmentStatisticsListByShiftCode(String organizeCode, String workCenterCode, String shiftCode) {
|
||||
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workCenterCode) || StringUtils.isEmpty(shiftCode)) return null;
|
||||
List<MesTimeSegmentStatistics> timeCfgList = timeSegmentStatisticsRepository.findByProperty(
|
||||
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_CENTER_CODE, MesPcnExtConstWords.SHIFT_CODE},
|
||||
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, shiftCode});
|
||||
return CollectionUtils.isEmpty(timeCfgList) ? null :
|
||||
timeCfgList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getStartTime()) && !StringUtils.isEmpty(o.getEndTime()))).sorted(Comparator.comparing(MesTimeSegmentStatistics::getStartTime)).collect(Collectors.toList());
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.jx;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.jx.IJxOutPutStatisticsTimeSegmentService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesOutPutStatisticsTimeSegment;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.repository.MesOutPutStatisticsTimeSegmentRepository;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangjie
|
||||
* @CreateDate: 2021/01/18 11:41 上午
|
||||
* @Description:
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class JxOutPutStatisticsTimeSegmentService implements IJxOutPutStatisticsTimeSegmentService {
|
||||
|
||||
@Autowired
|
||||
private MesOutPutStatisticsTimeSegmentRepository outPutStatisticsTimeSegmentRepository;
|
||||
|
||||
@Override
|
||||
public List<MesOutPutStatisticsTimeSegment> getOutPutStatisticsTimeSegmentByOrderAndTsCode(String organizeCode, String workOrderNo, String workTime, String shiftCode, String timeSegmentCode) {
|
||||
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workOrderNo) || StringUtils.isEmpty(workTime) || StringUtils.isEmpty(shiftCode) || StringUtils.isEmpty(timeSegmentCode)) return null;
|
||||
MesOutPutStatisticsTimeSegment outPutStatisticsTimeSegment = outPutStatisticsTimeSegmentRepository.getByProperty(
|
||||
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.WORK_TIME, MesPcnExtConstWords.TIME_SEGMENT_CODE},
|
||||
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, workTime, timeSegmentCode});
|
||||
List<MesOutPutStatisticsTimeSegment> outPutStatisticsTimeSegmentList;
|
||||
if (null == outPutStatisticsTimeSegment)
|
||||
outPutStatisticsTimeSegmentList = outPutStatisticsTimeSegmentRepository.findByProperty(
|
||||
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO, MesPcnExtConstWords.WORK_TIME, MesPcnExtConstWords.SHIFT_CODE},
|
||||
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo, workTime, shiftCode});
|
||||
else {
|
||||
outPutStatisticsTimeSegmentList = new ArrayList<>();
|
||||
outPutStatisticsTimeSegmentList.add(outPutStatisticsTimeSegment);
|
||||
}
|
||||
return outPutStatisticsTimeSegmentList;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.pojo.bean;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 分时产量统计表
|
||||
* @Reference:
|
||||
* @Author: wangjie
|
||||
* @CreateDate: 2023\02\10 09:45
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@Table(name = "MES_OUT_PUT_STATISTICS_TIME_SEGMENT", indexes = {
|
||||
@Index(columnList = "WORK_ORDER_NO,WORK_TIME,TIME_SEGMENT_CODE"),
|
||||
@Index(columnList = "WORK_ORDER_NO,WORK_TIME"),
|
||||
@Index(columnList = "WORK_ORDER_NO"),
|
||||
@Index(columnList = "WORK_CENTER_CODE"),
|
||||
@Index(columnList = "PART_NO"),
|
||||
@Index(columnList = "SHIFT_CODE"),
|
||||
@Index(columnList = "WORK_TIME"),
|
||||
@Index(columnList = "WORK_ORDER_TYPE")
|
||||
})
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Api("分时产量统计表")
|
||||
public class MesOutPutStatisticsTimeSegment extends BaseBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3516752104569948931L;
|
||||
|
||||
@Column(name = "SYSTEM_SYNC_STATUS")
|
||||
@ColumnDefault("2")
|
||||
@ApiParam(value = "系统同步标志")
|
||||
public Integer systemSyncStatus = 2;
|
||||
|
||||
@Column(name = "WORK_CENTER_CODE")
|
||||
@ApiParam("产线代码")
|
||||
private String workCenterCode;
|
||||
|
||||
@Column(name = "SHIFT_CODE")
|
||||
@ApiParam("班次代码")
|
||||
private String shiftCode;
|
||||
|
||||
@Column(name = "WORK_TIME")
|
||||
@ApiParam("作业时间")
|
||||
private String workTime;
|
||||
|
||||
@Column(name = "WORK_ORDER_NO")
|
||||
@ApiParam("生产工单号")
|
||||
private String workOrderNo;
|
||||
|
||||
@Column(name = "PART_NO")
|
||||
@ApiParam("物料号")
|
||||
private String partNo;
|
||||
|
||||
@Column(name = "PART_NAME_RDD")
|
||||
@ApiParam("物料名称")
|
||||
private String partNameRdd;
|
||||
|
||||
@Column(name = "START_TIME")
|
||||
@ApiParam("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Column(name = "END_TIME")
|
||||
@ApiParam("结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Column(name = "QTY", columnDefinition = "decimal(18,8)")
|
||||
@ColumnDefault("0")
|
||||
@ApiParam("产量")
|
||||
private Double qty;
|
||||
|
||||
@Column(name = "PLAN_QTY", columnDefinition = "decimal(18,8)")
|
||||
@ColumnDefault("0")
|
||||
@ApiParam("工单计划数量")
|
||||
private Double planQty;
|
||||
|
||||
@Column(name = "WORK_ORDER_TYPE")
|
||||
@ApiParam("工单类型")
|
||||
private Integer workOrderType;
|
||||
|
||||
@Column(name = "TIME_SEGMENT_CODE")
|
||||
@ApiParam("分时代码")
|
||||
private String timeSegmentCode;
|
||||
|
||||
@Column(name = "TIME_SEGMENT_START_TIME")
|
||||
@ApiParam("分时开始时间")
|
||||
private String timeSegmentsStartTime;
|
||||
|
||||
@Column(name = "TIME_SEGMENT_END_TIME")
|
||||
@ApiParam("分时结束时间")
|
||||
private String timeSegmentEndTime;
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.pojo.bean;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Index;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @DESCRIPTION: MES_分时段统计方式表
|
||||
* @USER: wangjie
|
||||
* @DATE: 2023-02-03 16:11
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name = "MES_TIME_SEGMENT_STATISTICS", indexes = {
|
||||
@Index(columnList = "SYSTEM_SYNC_STATUS"),
|
||||
@Index(columnList = "WORK_CENTER_CODE, SHIFT_CODE")
|
||||
})
|
||||
@Api("MES_分时段统计方式表")
|
||||
public class MesTimeSegmentStatistics extends BaseBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5490654692344095490L;
|
||||
|
||||
@Column(name = "WORK_CENTER_CODE")
|
||||
@ApiParam("工作中心代码")
|
||||
private String workCenterCode;
|
||||
|
||||
@Column(name = "SHIFT_CODE")
|
||||
@ApiParam("班次")
|
||||
private String shiftCode;
|
||||
|
||||
@Column(name = "START_TIME")
|
||||
@ApiParam("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Column(name = "END_TIME")
|
||||
@ApiParam("结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Column(name = "REST_TIME")
|
||||
@ApiParam("休息时间")
|
||||
private String restTime;
|
||||
|
||||
@Column(name = "TIME_LENGTH")
|
||||
@ApiParam("实际工作时间长度(分钟)")
|
||||
private String timeLength;
|
||||
|
||||
@Column(name = "TIME_SEGMENT_CODE")
|
||||
@ApiParam("分时代码(方便统计)")
|
||||
private String timeSegmentCode;
|
||||
|
||||
@Column(name = "SYSTEM_SYNC_STATUS")
|
||||
@ColumnDefault("2")
|
||||
@ApiParam(value = "系统同步标志")
|
||||
public Integer systemSyncStatus = 2;
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.pojo.repository;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesOutPutStatisticsTimeSegment;
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description: 分时产量统计表RDao
|
||||
* @Author: wangjie
|
||||
* @Date: 2023/01/10 09:46
|
||||
* @Modify:
|
||||
*/
|
||||
@Repository
|
||||
public interface MesOutPutStatisticsTimeSegmentRepository extends BaseRepository<MesOutPutStatisticsTimeSegment,Long> {
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.pojo.repository;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesTimeSegmentStatistics;
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface MesTimeSegmentStatisticsRepository extends BaseRepository<MesTimeSegmentStatistics, Long> {
|
||||
}
|
Loading…
Reference in New Issue