jx pcn 数据复核
parent
95f9962750
commit
e56bf6f6f1
@ -0,0 +1,21 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.job.gz;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Author: wangjie
|
||||
* @CreateDate: 2021/01/19 15:06 下午
|
||||
* @Description:
|
||||
**/
|
||||
public interface IGzThirdPartyDbCollectDataJobService {
|
||||
|
||||
/**
|
||||
* 第三方数据库数据采集定时任务
|
||||
* @param organizeCode 组织代码
|
||||
* @param cfgCode 配置代码
|
||||
* @param userInfo 操作人
|
||||
*/
|
||||
@ApiOperation(value = "第三方数据库数据采集定时任务", notes = "第三方数据库数据采集定时任务")
|
||||
void doThirdPartyDbCollectData(String organizeCode, String cfgCode, String userInfo);
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.schedulejob.gz;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.job.gz.IGzThirdPartyDbCollectDataJobService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* @author wangjie
|
||||
* @version 1.0
|
||||
* @date 2021/2/2 16:44
|
||||
**/
|
||||
@DisallowConcurrentExecution
|
||||
@ApiOperation("第三方数据库数据采集定时任务")
|
||||
public class GzThirdPartyDbCollectDataJob implements Job {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(GzThirdPartyDbCollectDataJob.class);
|
||||
|
||||
@Autowired
|
||||
private IGzThirdPartyDbCollectDataJobService thirdPartyDbCollectDataJobService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) {
|
||||
LOGGER.info("Pcn处理第三方数据库数据采集JOB开始执行...");
|
||||
|
||||
Object param = jobExecutionContext.getJobDetail().getJobDataMap().get(MesPcnExtConstWords.PARAM);
|
||||
if (StringUtils.isEmpty(param)) {
|
||||
LOGGER.error("Pcn处理第三方数据库数据采集JOB,未配置参数");
|
||||
return;
|
||||
}
|
||||
|
||||
String[] paramArr = param.toString().split(MesPcnExtConstWords.COMMA);
|
||||
if (paramArr.length != 2) {
|
||||
LOGGER.error("Pcn处理第三方数据库数据采集JOB,配置的参数无效");
|
||||
return;
|
||||
}
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
thirdPartyDbCollectDataJobService.doThirdPartyDbCollectData(paramArr[0], paramArr[1], MesPcnExtConstWords.JOB);
|
||||
|
||||
long endTime = System.currentTimeMillis();
|
||||
LOGGER.info("Pcn处理第三方数据库数据采集JOB执行完成耗时: " + (endTime - startTime) + "ms");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.job;
|
||||
|
||||
public class SxThirdPartyPlcCollectCellTaktService {
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
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 = "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,14 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.pojo.repository;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.SxWorkCellTaktCollectRecord;
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author wangjie
|
||||
* @version 1.0
|
||||
* @date 2021/1/29 15:02
|
||||
**/
|
||||
@Repository
|
||||
public interface SxWorkCellTaktCollectRecordRepository extends BaseRepository<SxWorkCellTaktCollectRecord, Long> {
|
||||
}
|
Loading…
Reference in New Issue