|
@@ -8,11 +8,13 @@ import com.steerinfo.dil.mapper.TmstruckLeaveFactoryResultMapper;
|
|
|
import com.steerinfo.dil.mapper.TmstruckLoadResultMapper;
|
|
|
import com.steerinfo.dil.mapper.UtilsMapper;
|
|
|
import com.steerinfo.dil.model.TmstruckLeaveFactoryResult;
|
|
|
+import com.steerinfo.dil.model.TmstruckWeightResult;
|
|
|
import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
|
|
|
import com.steerinfo.dil.util.DataChange;
|
|
|
import com.steerinfo.dil.util.HTTPRequestUtils;
|
|
|
import com.steerinfo.dil.util.getRequestUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -673,4 +675,25 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 非钢材,出净重24h后自动出厂,并关单
|
|
|
+ */
|
|
|
+ @Scheduled(fixedRate = 1000*60*60*3)
|
|
|
+ public void autoLeaveFactory(){
|
|
|
+ Date date=new Date();
|
|
|
+ Calendar calendar=Calendar.getInstance();
|
|
|
+ calendar.setTime(date);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH,-1);
|
|
|
+ date=calendar.getTime();
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("nowDate",date);
|
|
|
+ List<Map<String,Object>> list = tmstruckLeaveFactoryResultMapper.getWeightResultNetted(map);
|
|
|
+ for(Map<String,Object> item:list){
|
|
|
+ //更新出厂
|
|
|
+ tmstruckLeaveFactoryResultMapper.updateLeaveTime(item);
|
|
|
+ //关闭订单
|
|
|
+ tmstruckLeaveFactoryResultMapper.updateLeaveOrder(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|