@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
* @description: | |||
@@ -20,4 +21,8 @@ public class ServiceHallRegisterLocationBatchReqDTO extends AbstractStaffBizRequ | |||
@NotBlank(message = "") | |||
@ApiModelProperty(value = "网点数据id") | |||
private String serviceHallId; | |||
@NotNull | |||
@ApiModelProperty(value = "1-可办理2-禁止办理") | |||
private Integer type; | |||
} |
@@ -29,11 +29,13 @@ public class ServiceHallRegisterLocationBatchListener implements ReadListener<Se | |||
private Set<ServiceLocationRegisterData> errors = new HashSet<>(); | |||
private List<ServiceLocationRegisterData> result = new ArrayList<>(); | |||
private String openId; | |||
private Integer type; | |||
public ServiceHallRegisterLocationBatchListener(QtkServicehallLocationRepo LocationRepo, QtkServiceHall serviceHall,String openId) { | |||
public ServiceHallRegisterLocationBatchListener(QtkServicehallLocationRepo LocationRepo, QtkServiceHall serviceHall,String openId,Integer type) { | |||
this.LocationRepo = LocationRepo; | |||
this.serviceHall = serviceHall; | |||
this.openId = openId; | |||
this.type = type; | |||
} | |||
@Override | |||
@@ -59,6 +61,7 @@ public class ServiceHallRegisterLocationBatchListener implements ReadListener<Se | |||
for (ServiceLocationRegisterData serviceLocationRegisterData : result) { | |||
QtkServicehallLocation serviceHall = covertToQtk(serviceLocationRegisterData); | |||
serviceHall.setCreateOpenId(openId); | |||
serviceHall.setType(type); | |||
locations.add(serviceHall); | |||
} | |||
LocationRepo.saveAll(locations); |
@@ -384,7 +384,7 @@ public class ServiceHallManagerImpl extends AbstractUserwManager implements Serv | |||
throw new ManagerException("通过文件流失败!"); | |||
} | |||
ServiceHallRegisterLocationBatchListener listener = | |||
new ServiceHallRegisterLocationBatchListener(locationRepo, serviceHall,findOpenIdByToken(reqDto.getAccessToken())); | |||
new ServiceHallRegisterLocationBatchListener(locationRepo, serviceHall,findOpenIdByToken(reqDto.getAccessToken()),reqDto.getType()); | |||
//读取文件数据并保存 | |||
EasyExcel.read(fileInputStream, | |||
ServiceLocationRegisterData.class, |
@@ -27,5 +27,8 @@ public class ServiceHallLocationModel extends BaseModel { | |||
@NotNull | |||
@ApiModelProperty(value = "半径距离") | |||
private Integer radial;//半径距离 | |||
@NotNull | |||
@ApiModelProperty(value = "1-可办理2-禁止办理") | |||
private Integer type = 1; | |||
} |