package com.zy.ints.task.scheduler;
|
|
import com.zy.ints.entity.LkDetTb;
|
import com.zy.ints.erp.ErpSqlServer;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import java.util.List;
|
|
/**
|
* erp任务控制器
|
* Created by vincent on 2020/11/27
|
*/
|
@Slf4j
|
@Component
|
public class LkDetTbScheduler {
|
/**
|
* ERP接口是否启用
|
*/
|
@Value("${erp.enabled}")
|
private Boolean erpEnabled;
|
@Autowired
|
private ErpSqlServer erpSqlServer;
|
/**
|
* 上报入出库完结订单信息
|
*/
|
@Scheduled(cron = "${erp.refreshtime}")
|
public void InOrOutOrder() {
|
if (!erpEnabled) return;
|
String sqlSelectLkDetTb = "select bill_no as billNo,prd_no as prdNo,iokindid,add_id as addId,qty,prd_mark as prdMark,wh,billdate,status,temp1,temp2,temp3 from lk_det_tb where 1=1";
|
String sqlUpDateLkDetTbOne = "update lk_det_tb set status=1 where prd_no=";
|
String sqlUpDateLkDetTbTwo = "update lk_det_tb set status=2 where prd_no=";
|
|
try {
|
List<LkDetTb> lkDetTbs = erpSqlServer.select(sqlSelectLkDetTb, LkDetTb.class);
|
if (lkDetTbs.size() > 0){
|
for (LkDetTb lkDetTb:lkDetTbs){
|
Integer status = lkDetTb.getStatus();
|
if (status == 0){
|
|
}else if (status == 1){
|
|
}else if (status == 2){
|
|
}else {
|
|
}
|
}
|
}
|
}catch (Exception e){
|
|
}
|
}
|
}
|