业务单据:功能,界面修改优化
parent
16d98215e6
commit
711358f34a
@ -0,0 +1,11 @@
|
||||
package com.glxp.sale.admin.req.inout;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StockSelectDataEntity {
|
||||
private String relId;
|
||||
private String batchNo;
|
||||
private String expireDate;
|
||||
private String productDate;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.sale.admin.res.basic;
|
||||
|
||||
import com.glxp.sale.admin.entity.basic.UdiInfoEntity;
|
||||
import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class UdiExportJsonResponse {
|
||||
|
||||
private List<UdiRelevanceEntity> udiRelevanceEntities;
|
||||
private List<UdiInfoEntity> udiInfoEntities;
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.glxp.sale.admin.thread;
|
||||
|
||||
import com.glxp.sale.admin.dao.info.ScheduledDao;
|
||||
import com.glxp.sale.admin.entity.info.ScheduledEntity;
|
||||
import com.glxp.sale.admin.req.udid.ScheduledRequest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.SchedulingConfigurer;
|
||||
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||
import org.springframework.scheduling.support.CronTrigger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
@EnableScheduling
|
||||
public class IoErpCheckTask implements SchedulingConfigurer {
|
||||
|
||||
final Logger logger = LoggerFactory.getLogger(IoErpCheckTask.class);
|
||||
@Resource
|
||||
protected ScheduledDao scheduledDao;
|
||||
@Resource
|
||||
private IoTransInoutService ioTransInoutService;
|
||||
|
||||
@Override
|
||||
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
|
||||
scheduledTaskRegistrar.addTriggerTask(() -> process(),
|
||||
triggerContext -> {
|
||||
ScheduledRequest scheduledRequest = new ScheduledRequest();
|
||||
scheduledRequest.setCronName("erpCheck");
|
||||
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
|
||||
String cron = scheduledEntity.getCron();
|
||||
if (cron.isEmpty()) {
|
||||
logger.error("cron is null");
|
||||
}
|
||||
return new CronTrigger(cron).nextExecutionTime(triggerContext);
|
||||
});
|
||||
}
|
||||
|
||||
private void process() {
|
||||
logger.info("定时校验ERP单---暂停");
|
||||
// ioTransInoutService.checkOrder();
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.glxp.sale.admin.util;
|
||||
|
||||
public class CronUtils {
|
||||
|
||||
public static String parseSecondIntervel(String time) {
|
||||
int second = Integer.parseInt(time);
|
||||
String cron = "0/" + second + " " + "*" + " " + "* * * ?";//start[1] + "-" + end[1]
|
||||
if (second >= 60) {
|
||||
second = Math.round(second / 60);
|
||||
if (second >= 60) {
|
||||
second = 59;
|
||||
}
|
||||
cron = "0" + " " + "0/" + second + " " + "* * * ?";
|
||||
}
|
||||
return cron;
|
||||
}
|
||||
|
||||
|
||||
public static String parseMinuteIntervel(int time) {
|
||||
int minute = time;
|
||||
String cron = "0" + " " + "0/" + minute + " " + "* * * ?";
|
||||
if (minute >= 60) {
|
||||
minute = Math.round(minute / 60);
|
||||
if (minute >= 60) {
|
||||
minute = 59;
|
||||
}
|
||||
cron = "0" + " " + "0" + " " + "0/" + minute + " " + "* * ?";
|
||||
}
|
||||
return cron;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue