图片套版生成模块
This commit is contained in:
parent
76d05ee11c
commit
fb3059d131
@ -27,6 +27,9 @@ import org.apache.commons.collections.map.HashedMap;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@ -175,7 +178,21 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
|
||||
setAppUpdateInfo(token, params);
|
||||
}
|
||||
if(StringUtils.isEmpty(distributionVO.getDistributionAllotTime())) {
|
||||
throw new UpdateException("需要确定最终分配时间");
|
||||
throw new UpdateException("需要确定最终开始时间");
|
||||
}
|
||||
if(StringUtils.isEmpty(distributionVO.getDistributionAllotEndTime())) {
|
||||
throw new UpdateException("需要确定最终结束时间");
|
||||
}
|
||||
try {
|
||||
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date startTime = fmt.parse(distributionVO.getDistributionAllotTime());
|
||||
Date endTime = fmt.parse(distributionVO.getDistributionAllotEndTime());
|
||||
long timeDelta = (startTime.getTime() - endTime.getTime()) /1000;//单位是秒
|
||||
if(timeDelta > (-1 * 60 * 60) ) {
|
||||
throw new UpdateException("时间范围错误");
|
||||
}
|
||||
}catch(Exception e) {
|
||||
throw new UpdateException("时间范围格式错误");
|
||||
}
|
||||
/**
|
||||
* 判断是否选择了考场
|
||||
@ -231,10 +248,12 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
|
||||
/**
|
||||
* 回显考场
|
||||
*/
|
||||
Map<String, Object> query = new HashMap<String, Object>();
|
||||
query.put("distributionId",dto.getDistributionId());
|
||||
List<DistributionFieldDTO> dtoList= iDistributionFieldService.list(query);
|
||||
dto.setDistributionFieldList(dtoList);
|
||||
if(dto != null) {
|
||||
Map<String, Object> query = new HashMap<String, Object>();
|
||||
query.put("distributionId",dto.getDistributionId());
|
||||
List<DistributionFieldDTO> dtoList= iDistributionFieldService.list(query);
|
||||
dto.setDistributionFieldList(dtoList);
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user