huminghao 1 天前
父节点
当前提交
3f16476294

+ 20
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/api/ServiceHallController.java 查看文件

@@ -8,6 +8,7 @@ import cn.com.taiji.userw.dto.serviceHall.*;
import cn.com.taiji.userw.manager.serviceHall.ServiceHallManager;
import cn.com.taiji.userw.model.FormatException;
import cn.com.taiji.userw.model.comm.CommExportExcelResponse;
import cn.com.taiji.userw.model.serviceHall.ServiceHallLocationModel;
import cn.com.taiji.userw.model.serviceHall.ServiceHallSonQueryModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -96,6 +97,25 @@ public class ServiceHallController extends MyValidController{
public ApiResponse<List<QtkServicehallLocation>> queryLocations(@Valid @RequestBody ServiceHallDeleteRequestDTO reqDto) throws ManagerException {
return ApiResponse.of(manager.queryLocations(reqDto));
}
@ApiOperation(value = "查询网点位置分页")
@PostMapping(value = "/locationPage")
public ApiResponse<Pagination> locationPage(@Valid @RequestBody ServiceHallDeleteRequestDTO reqDto) throws ManagerException {
return ApiResponse.of(manager.locationPage(reqDto));
}
@ApiOperation(value = "网点位置新增/修改")
@PostMapping(value = "/locationAdd")
public ApiResponse<?> locationAdd(@Valid @RequestBody ServiceHallLocationModel reqDto) throws ManagerException {
manager.locationAdd(reqDto);
return ApiResponse.success();
}

@ApiOperation(value = "网点位置删除")
@PostMapping(value = "/locationDelete")
public ApiResponse<?> locationDelete(@RequestBody String id) throws ManagerException {
manager.locationDelete(id);
return ApiResponse.success();
}


@ApiOperation(value = "网点信息批量导入")
@PostMapping(value = "/registerFullBath")

+ 4
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/dto/serviceHall/ServiceHallDeleteRequestDTO.java 查看文件

@@ -12,6 +12,10 @@ public class ServiceHallDeleteRequestDTO extends AbstractStaffBizRequestDTO {
@NotBlank(message = "网点编号不能为空")
@ApiModelProperty(value = "网点编号")
private String serviceHallId;
@ApiModelProperty(value = "办理点名称")
private String name;
@ApiModelProperty(value = "类型1-可办理2-禁止办理")
private Integer type = 1;//类型1-可办理2-禁止办理




+ 7
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/serviceHall/ServiceHallManager.java 查看文件

@@ -6,6 +6,7 @@ import cn.com.taiji.common.model.dao.Pagination;
import cn.com.taiji.core.entity.basic.QtkServicehallLocation;
import cn.com.taiji.userw.dto.serviceHall.*;
import cn.com.taiji.userw.model.comm.CommExportExcelResponse;
import cn.com.taiji.userw.model.serviceHall.ServiceHallLocationModel;
import cn.com.taiji.userw.model.serviceHall.ServiceHallSonQueryModel;

import java.util.List;
@@ -38,4 +39,10 @@ public interface ServiceHallManager {
List<ServiceHallSonQueryModel> serviceHallGetByAgencyId(ServiceHallGetIdRequestDTO reqDto);

CommExportExcelResponse export(ServiceHallPageRequestDTO reqDto) throws ManagerException;

Pagination locationPage(ServiceHallDeleteRequestDTO reqDto);

void locationAdd(ServiceHallLocationModel reqDto) throws ServiceHandleException;

void locationDelete(String id);
}

+ 31
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/serviceHall/ServiceHallManagerImpl.java 查看文件

@@ -24,6 +24,7 @@ import cn.com.taiji.userw.model.excel.ServiceHallRegisterData;
import cn.com.taiji.userw.model.excel.ServiceLocationRegisterData;
import cn.com.taiji.userw.model.serviceHall.*;
import cn.com.taiji.userw.repo.jpa.request.ServiceHallPageRequest;
import cn.com.taiji.userw.repo.jpa.request.ServiceLocaltionPageRequest;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil;
import com.alibaba.excel.EasyExcel;
@@ -158,6 +159,35 @@ public class ServiceHallManagerImpl extends AbstractUserwManager implements Serv
return response;
}

@Override
public Pagination locationPage(ServiceHallDeleteRequestDTO reqDto) {
ServiceLocaltionPageRequest request = copyProperties(reqDto, new ServiceLocaltionPageRequest());
request.setName(reqDto.getName());
request.setServicehallId(reqDto.getServiceHallId());
request.setType(reqDto.getType());
return locationRepo.page(request);
}

@Override
public void locationAdd(ServiceHallLocationModel reqDto) throws ServiceHandleException {
QtkServicehallLocation qtkServicehallLocation = null;
if (hasText(reqDto.getId())) {
qtkServicehallLocation = locationRepo.findById(reqDto.getId()).orElse(null);
}
if (qtkServicehallLocation == null){
qtkServicehallLocation = new QtkServicehallLocation();
}
copyProperties(reqDto, qtkServicehallLocation, "id");
qtkServicehallLocation.setCreateOpenId(findOpenIdByToken(reqDto.getAccessToken()));
qtkServicehallLocation.setInsertTime(LocalDateTime.now());
locationRepo.save(qtkServicehallLocation);
}

@Override
public void locationDelete(String id) {
locationRepo.deleteById(id);
}

private ServiceHallExcelModel converExcel(QtkServiceHall hall) {
ServiceHallExcelModel model = copyProperties(hall, new ServiceHallExcelModel());
// 设置上级网点名称
@@ -299,6 +329,7 @@ public class ServiceHallManagerImpl extends AbstractUserwManager implements Serv
qtkServiceHall.setContact(reqDto.getContact());
qtkServiceHall.setLongitude(reqDto.getLongitude());
qtkServiceHall.setLatitude(reqDto.getLatitude());
qtkServiceHall.setRadial(reqDto.getRadial());
qtkServiceHall.setUpdateTime(now);
qtkServiceHall.setUpdateOpenId(openId);
// 更新

+ 13
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/model/serviceHall/ServiceHallLocationModel.java 查看文件

@@ -8,10 +8,20 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;


@ApiModel("新增网点-位置信息")
@Data
public class ServiceHallLocationModel extends BaseModel {

@ApiModelProperty(value = "ID")
private String id;
@ApiModelProperty(value = "渠道编号")
private String agencyId;//渠道编号
@ApiModelProperty(value = "网点编号")
private String servicehallId;//网点编号
@ApiModelProperty(value = "网点名称")
private String servicehallName;//网点名称

@NotBlank
@ApiModelProperty(value = "位置名称")
private String name;//名称
@@ -30,5 +40,8 @@ public class ServiceHallLocationModel extends BaseModel {
@NotNull
@ApiModelProperty(value = "1-可办理2-禁止办理")
private Integer type = 1;
// @NotBlank(message = "accessToken不能为空")
private String accessToken;


}

+ 31
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/repo/jpa/request/ServiceLocaltionPageRequest.java 查看文件

@@ -0,0 +1,31 @@
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.QtkServiceHall;
import cn.com.taiji.core.entity.basic.QtkServicehallLocation;
import lombok.Data;

import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;

@Data
public class ServiceLocaltionPageRequest extends JpaPageableDataRequest<QtkServicehallLocation> {

private String name;//网点名称
private Integer type = 1;//类型1-可办理2-禁止办理
private String servicehallId;//网点编号



@Override
public HqlBuilder toSelectHql() {
HqlBuilder hql = new HqlBuilder("from QtkServicehallLocation where 1=1 ");
hql.append(" and name like :name ", like(name));
hql.append(" and type = :type ", type);
hql.append(" and servicehallId = :servicehallId ", servicehallId);
return hql;
}
}

正在加载...
取消
保存