新增报工功能
parent
23f6f9285b
commit
9ee464f67e
@ -0,0 +1,27 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 进度条显示信息。
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2020-04-01
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class ImportDataModel {
|
||||||
|
@ApiParam(value ="当前执行进度")
|
||||||
|
private Integer curProcess = 0;
|
||||||
|
|
||||||
|
@ApiParam(value ="总行数")
|
||||||
|
private Integer totalSize = 0;
|
||||||
|
|
||||||
|
@ApiParam(value ="进度消息")
|
||||||
|
private String processMsg = "";
|
||||||
|
|
||||||
|
private Boolean finish = false;
|
||||||
|
|
||||||
|
private ImportErrorInfo errorInfo;
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.validator;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.annotation.ShiftTimeAnnotation;
|
||||||
|
import cn.estsh.i3plus.pojo.aps.model.TimeBlock;
|
||||||
|
|
||||||
|
import javax.validation.ConstraintValidator;
|
||||||
|
import javax.validation.ConstraintValidatorContext;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
|
public class ShiftTimeValidator implements ConstraintValidator<ShiftTimeAnnotation, String> {
|
||||||
|
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
|
||||||
|
for (String strTime : s.split(",")) {
|
||||||
|
String[] times = strTime.split("-");
|
||||||
|
if (times.length != 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
TimeBlock timeBlock = new TimeBlock();
|
||||||
|
timeBlock.setBegin(timeFormat.parse(times[0]));
|
||||||
|
timeBlock.setEnd(timeFormat.parse(times[1]));
|
||||||
|
} catch (ParseException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue