@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
import javax.validation.Valid; | |||
import java.util.List; | |||
/** | |||
@@ -53,7 +54,7 @@ public class CenterAgencyController extends MyValidController{ | |||
@ApiOperation(value = "分页查询") | |||
@PostMapping(value = "/page") | |||
public ApiResponse<Pagination> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyPageRequestDTO reqDto) { | |||
public ApiResponse<Pagination> getCenterServiceHall(@Valid @RequestBody CenterHallOrAgencyPageRequestDTO reqDto) { | |||
Pagination page = manager.page(reqDto); | |||
return ApiResponse.of(page); | |||
} |
@@ -1,6 +1,5 @@ | |||
package cn.com.taiji.userw.dto.agency; | |||
import cn.com.taiji.core.dto.AbstractBizPageRequestDTO; | |||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | |||
import io.swagger.annotations.ApiModel; |
@@ -11,7 +11,7 @@ import lombok.Data; | |||
* @Filename:CenterHallRequestDTO | |||
* @description: 中心网点/渠道请求参数 | |||
*/ | |||
@ApiModel(value = "中心网点/渠道请求参数") | |||
@ApiModel(description = "中心网点/渠道请求参数") | |||
@Data | |||
public class CenterHallOrAgencyPageRequestDTO extends AbstractStaffBizPageRequestDTO { | |||
@@ -6,8 +6,6 @@ import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotNull; | |||
@ApiModel(description = "网点查询请求参数") | |||
@Data | |||
public class ServiceHallPageRequestDTO extends AbstractStaffBizPageRequestDTO { | |||
@@ -15,7 +13,7 @@ public class ServiceHallPageRequestDTO extends AbstractStaffBizPageRequestDTO { | |||
@ApiModelProperty(value = "网点名称") | |||
private String name;//网点名称 | |||
@ApiModelProperty(value = "网点编号") | |||
private String servicehallId;//网点编号 | |||
private String serviceHallId;//网点编号 | |||
@ApiModelProperty(value = "渠道编号") | |||
private String agencyId;//渠道编号 | |||
@ApiModelProperty(value = "机构") |
@@ -9,6 +9,7 @@ import cn.com.taiji.userw.dto.centerHallAndAgency.CenterAgencyAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyPageRequestDTO; | |||
import cn.com.taiji.userw.repo.jpa.request.CenterAgencyPageRequest; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -53,6 +54,7 @@ public class CenterAgencyManagerImpl extends AbstractManager implements CenterAg | |||
@Override | |||
public Pagination page(CenterHallOrAgencyPageRequestDTO reqDto) { | |||
CenterAgencyPageRequest request = new CenterAgencyPageRequest(); | |||
BeanUtils.copyProperties(reqDto, request); | |||
request.setCenterAgencyId(reqDto.getId()); | |||
request.setCenterAgencyName(reqDto.getName()); | |||
return qtkAgencyMapRepo.page(request); |
@@ -9,6 +9,7 @@ import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteReques | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyPageRequestDTO; | |||
import cn.com.taiji.userw.repo.jpa.request.CenterServiceHallPageRequest; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -56,6 +57,7 @@ public class CenterServiceHallManagerImpl extends AbstractManager implements Cen | |||
@Override | |||
public Pagination page(CenterHallOrAgencyPageRequestDTO reqDto) { | |||
CenterServiceHallPageRequest request = new CenterServiceHallPageRequest(); | |||
BeanUtils.copyProperties(reqDto, request); | |||
request.setCenterServiceHallId(reqDto.getId()); | |||
request.setCenterServicehallName(reqDto.getName()); | |||
return qtkServicehallMapRepo.page(request); |
@@ -253,6 +253,8 @@ public class ServiceHallManagerImpl extends AbstractManager implements ServiceHa | |||
public String registerFullBath(ServiceHallRegisterFullBatchRequestDTO reqDto) throws ManagerException { | |||
String path = null; | |||
File tempFile = minioUtil.getFileByUrl(reqDto.getExcelFileUrl()); | |||
//获取本地文件 | |||
// File tempFile = new File("C:\\Users\\32258\\Desktop\\gy\\测试\\用户管理\\测试文件\\网点信息导入模板.xlsx"); | |||
//获取文件流 | |||
InputStream fileInputStream = null; | |||
try { | |||
@@ -282,6 +284,8 @@ public class ServiceHallManagerImpl extends AbstractManager implements ServiceHa | |||
.doWrite(errors); | |||
path = minioUtil.fileUploadHttp(upFile, BucketFileBus.SERVICEHALL); | |||
} | |||
//删除临时文件 | |||
FileUtil.del(tempFile); | |||
return path == null ? null : minioUtil.getOuterUrl(path); | |||
} | |||
@@ -3,12 +3,8 @@ package cn.com.taiji.userw.repo.jpa.request; | |||
import cn.com.taiji.common.pub.dao.HqlBuilder; | |||
import cn.com.taiji.common.repo.request.jpa.JpaPageableDataRequest; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyMap; | |||
import cn.com.taiji.core.entity.basic.QtkServicehallMap; | |||
import lombok.Data; | |||
import javax.persistence.Column; | |||
import javax.validation.constraints.Size; | |||
@Data | |||
public class CenterAgencyPageRequest extends JpaPageableDataRequest<QtkAgencyMap> { | |||
@@ -16,10 +12,6 @@ public class CenterAgencyPageRequest extends JpaPageableDataRequest<QtkAgencyMap | |||
private String centerAgencyName; | |||
public CenterAgencyPageRequest() { | |||
this.orderBy="insertTime"; | |||
this.desc=true; | |||
} | |||
@Override | |||
public HqlBuilder toSelectHql() { | |||
HqlBuilder hql = new HqlBuilder("from QtkAgencyMap where 1=1 "); |
@@ -9,18 +9,16 @@ import lombok.Data; | |||
public class ServiceHallPageRequest extends JpaPageableDataRequest<QtkServiceHall> { | |||
private String name;//网点名称 | |||
private String servicehallId; | |||
private String serviceHallId; | |||
private String agencyId; | |||
private String agencyName; | |||
@Override | |||
public HqlBuilder toSelectHql() { | |||
HqlBuilder hql = new HqlBuilder("from QtkServiceHall where 1=1 "); | |||
hql.append(" and name like :name ", like(name)); | |||
hql.append(" and servicehallId = :servicehallId ", servicehallId); | |||
hql.append(" and serviceHallId = :serviceHallId ", serviceHallId); | |||
hql.append(" and agencyId = :agencyId ", agencyId); | |||
hql.append(" and agencyName like :agencyName ", like(agencyName)); | |||
return hql; | |||
} | |||
} |