| | |
| | | package com.zy.ints.task.scheduler; |
| | | |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.ints.entity.ErpDetTb; |
| | | 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任务控制器 |
| | |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | @Autowired |
| | | private MatService matService; |
| | | /** |
| | | * 获取入出库订单信息 |
| | | */ |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void InOrOutOrder() { |
| | | if (!erpEnabled) return; |
| | | String sqlSelecterpDetTb = "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 erp_det_tb where 1=1"; |
| | | String sqlUpDateerpDetTbOne = "update erp_det_tb set status=1 where prd_no="; |
| | | String sqlUpDateerpDetTbTwo = "update erp_det_tb set status=2 where prd_no="; |
| | | |
| | | try { |
| | | List<ErpDetTb> erpDetTbs = erpSqlServer.select(sqlSelecterpDetTb, ErpDetTb.class); |
| | | if (erpDetTbs.size() > 0){ |
| | | for (ErpDetTb erpDetTb:erpDetTbs){ |
| | | Integer status = erpDetTb.getStatus(); |
| | | if (status == 0){ |
| | | |
| | | }else if (status == 1){ |
| | | |
| | | }else if (status == 2){ |
| | | |
| | | }else { |
| | | |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |