浏览代码

iaw

master
chenchaod 1 个月前
父节点
当前提交
34f90cbbda

+ 40
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/api/comm/PortalConfigController.java 查看文件

@@ -0,0 +1,40 @@
package cn.com.taiji.iaw.api.comm;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.web.ApiResponse;
import cn.com.taiji.iaw.api.MyValidController;
import cn.com.taiji.iaw.dto.CommRequestDTO;
import cn.com.taiji.iaw.dto.comm.GetPortalConfigResDTO;
import cn.com.taiji.iaw.manager.comm.PortalConfigManage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;

/**
* @Author:ChenChao
* @Date:2025/7/10 10:59
* @Filename:PortalConfigController
* @description:
*/

@Api(tags = {"门户信息"})
@RestController
@RequestMapping("/api/protalConfig")
public class PortalConfigController extends MyValidController {

@Autowired
private PortalConfigManage portalConfigManage;

@ApiOperation(value = "根据登录来源方获取门户配置")
@PostMapping(value = "/getPortalConfig")
public ApiResponse<GetPortalConfigResDTO> getPortalConfig(@Valid @RequestBody CommRequestDTO reqDto) throws ManagerException {
GetPortalConfigResDTO res = portalConfigManage.getPortalConfig(reqDto);
return ApiResponse.of(res).setMessage("操作成功");
}

}

+ 1
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/api/issue/IssueProductController.java 查看文件

@@ -35,7 +35,7 @@ public class IssueProductController extends MyValidController {

@ApiOperation(value = "产品分页查询")
@PostMapping(value = "/pageQuery")
public ApiResponse<Pagination> pageQuery(@Valid @RequestBody ProductPagReqDTO reqDto) throws ServiceHandleException {
public ApiResponse<Pagination> pageQuery(@Valid @RequestBody ProductPagReqDTO reqDto) throws ManagerException {
return ApiResponse.of(issueProductManager.pageQuery(reqDto));
}


+ 0
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/comm/AddressAddRequestDTO.java 查看文件

@@ -1,6 +1,5 @@
package cn.com.taiji.iaw.dto.comm;

import cn.com.taiji.common.valid.ViolationValidator;
import cn.com.taiji.core.dto.AbstractBizRequestDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

+ 0
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/comm/AddressInfoRequestDTO.java 查看文件

@@ -1,6 +1,5 @@
package cn.com.taiji.iaw.dto.comm;

import cn.com.taiji.common.valid.ViolationValidator;
import cn.com.taiji.core.dto.AbstractBizRequestDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

+ 55
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/comm/GetPortalConfigResDTO.java 查看文件

@@ -0,0 +1,55 @@
package cn.com.taiji.iaw.dto.comm;

import cn.com.taiji.core.entity.dict.EnableStatus;
import cn.com.taiji.core.entity.dict.user.RbacSource;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;

/**
* @Author:ChenChao
* @Date:2025/7/10 14:25
* @Filename:GetPortalConfigResDTO
* @description:
*/
@ApiModel(description = "门户配置信息响应")
@Data
public class GetPortalConfigResDTO {

@ApiModelProperty(value = "来源类型")
private RbacSource source;

@ApiModelProperty(value = "客车车牌颜色(字典)")
private List<String> carPlateColorType;

@ApiModelProperty("货车车牌颜色(字典)")
private List<String> trucksPlateColorType;

@ApiModelProperty(value = "是否:置灰(APP/小程序)")
private EnableStatus setGray;

@ApiModelProperty(value = "是否:小程序信息带出(小程序)")
private EnableStatus miniInfoShow;

@ApiModelProperty("是否:小程序是否支持他人办理(小程序)")
private EnableStatus miniSupportOther;

@ApiModelProperty("是否:他人办理时是否上传委托书(APP/小程序)")
private EnableStatus otherUploadProxy;

@ApiModelProperty("是否:允许修改OCR识别出来的数据")
private EnableStatus changeOCRData;

@ApiModelProperty("是否:申办时是否允许带出车辆信息")
private EnableStatus applyCarInfo;

@ApiModelProperty("是否:申办时是否允许修改OCR识别出来的车辆信息数据")
private EnableStatus applyChangeOCRCarInfo;

@ApiModelProperty(value = "是否:申办时是否允许修改OCR识别出来的他人信息数据")
private EnableStatus applyChangeOCROtherInfo;

@ApiModelProperty(value = "一路开关")
private EnableStatus setPath;
}

+ 14
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/comm/PortalConfigManage.java 查看文件

@@ -0,0 +1,14 @@
package cn.com.taiji.iaw.manager.comm;

import cn.com.taiji.iaw.dto.CommRequestDTO;
import cn.com.taiji.iaw.dto.comm.GetPortalConfigResDTO;

/**
* @Author:ChenChao
* @Date:2025/7/10 14:20
* @Filename:PortalConfigManage
* @description:
*/
public interface PortalConfigManage {
GetPortalConfigResDTO getPortalConfig(CommRequestDTO reqDto);
}

+ 65
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/comm/PortalConfigManageImpl.java 查看文件

@@ -0,0 +1,65 @@
package cn.com.taiji.iaw.manager.comm;

import cn.com.taiji.core.entity.comm.PortalConfig;
import cn.com.taiji.core.entity.dict.basic.SourceType;
import cn.com.taiji.core.repo.jpa.comm.PortalConfigRepo;
import cn.com.taiji.iaw.dto.CommRequestDTO;
import cn.com.taiji.iaw.dto.comm.GetPortalConfigResDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;

/**
* @Author:ChenChao
* @Date:2025/7/10 14:20
* @Filename:PortalConfigManageImpl
* @description:
*/
@Service
public class PortalConfigManageImpl implements PortalConfigManage {

@Autowired
private PortalConfigRepo portalConfigRepo;

@Override
public GetPortalConfigResDTO getPortalConfig(CommRequestDTO reqDto) {

//获取对应的来源端
SourceType loginSource = reqDto.getOrderSource();

//检查是否已经存在该端来源方的门户配置
Long countBySource = portalConfigRepo.countBySource(loginSource);
//只获取最终结果数量为1个的
GetPortalConfigResDTO response = new GetPortalConfigResDTO();
if (countBySource == 1) {
PortalConfig config = portalConfigRepo.findBySource(loginSource);
BeanUtils.copyProperties(config, response);
//设置车牌颜色
if (config.getCarPlateColorType() != null && !config.getCarPlateColorType().trim().isEmpty()) {
response.setCarPlateColorType(arrayStringToList(config.getCarPlateColorType()));
}
if (config.getTrucksPlateColorType() != null && !config.getTrucksPlateColorType().trim().isEmpty()) {
response.setTrucksPlateColorType(arrayStringToList(config.getTrucksPlateColorType()));
}
}
return response;
}



private List<String> arrayStringToList(String arrayString){
if(StringUtils.isEmpty(arrayString)) return new ArrayList<>();
// arrayString 格式为 ["0","4","5","3","1"] 的字符串
String replace = arrayString.replace("[", "").replace("]", "").replaceAll("\"","");
if(StringUtils.isEmpty(replace)) return new ArrayList<>();
String[] split = replace.split(",");
if(split.length == 0){
return new ArrayList<>();
}else{
return List.of(split);
}
}
}

+ 4
- 3
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/IssueOrderManageImpl.java 查看文件

@@ -79,11 +79,12 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd
public String add(OrderCreateReqDTO reqDto) throws ManagerException {
reqDto.validate();
IssueProduct product = issueProductRepo.findByReleaseId(reqDto.getProductId());

OrderInitRequest request = copyProperties(reqDto, new OrderInitRequest());

if (SourceType.WECHAT == reqDto.getOrderSource()) {
request.setAgentId(product.getAgencyId());
request.setChannelId("5201010200601130001");
request.setChannelId("5201010600401130001");
request.setOpenId(findOpenIdByToken(reqDto.getAccessToken()));
}
if (SourceType.SERVICE_HALL == reqDto.getOrderSource()) {
@@ -257,7 +258,7 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd
request.setSourceType(reqDto.getOrderSource());
request.setOpenId(findOpenIdByToken(reqDto.getAccessToken()));
if (SourceType.WECHAT == reqDto.getOrderSource()) {
request.setServiceHallId("5201010200601130001");
request.setServiceHallId("5201010600401130001");
}
if (SourceType.SERVICE_HALL == reqDto.getOrderSource()) {
Staff staff = staffRepo.findByStaffId(reqDto.getStaffId());
@@ -277,7 +278,7 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd
request.setSourceType(reqDto.getOrderSource());
request.setOpenId(findOpenIdByToken(reqDto.getAccessToken()));
if (SourceType.WECHAT == reqDto.getOrderSource()) {
request.setServiceHallId("5201010200601130001");
request.setServiceHallId("5201010600401130001");
}
if (SourceType.SERVICE_HALL == reqDto.getOrderSource()) {
Staff staff = staffRepo.findByStaffId(reqDto.getStaffId());

+ 1
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/IssueProductManager.java 查看文件

@@ -14,7 +14,7 @@ import cn.com.taiji.iaw.dto.issue.product.ProductPagReqDTO;
* @description:
*/
public interface IssueProductManager {
Pagination pageQuery(ProductPagReqDTO reqDto) throws ServiceHandleException;
Pagination pageQuery(ProductPagReqDTO reqDto) throws ManagerException;

ProductDetailResDTO pageDetail(ProductDetailReqDTO reqDto) throws ManagerException;
}

+ 4
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/IssueProductManagerImpl.java 查看文件

@@ -46,7 +46,7 @@ public class IssueProductManagerImpl extends AbstractCommManager implements Issu
@Autowired
private IssueSingleEquityRepo issueSingleEquityRepo;
@Override
public Pagination pageQuery(ProductPagReqDTO reqDto) throws ServiceHandleException {
public Pagination pageQuery(ProductPagReqDTO reqDto) throws ManagerException {
reqDto.validate();
ProductPageRequest request = copyProperties(reqDto, new ProductPageRequest());
String agencyId = "";
@@ -59,6 +59,9 @@ public class IssueProductManagerImpl extends AbstractCommManager implements Issu
}
//找出启用状态的推广产品
List<String> releaseIds = issueProductPromotionRepo.findReleaseIds("%"+agencyId+"%", LocalDateTime.now());
if (isEmpty(releaseIds)) {
throw new ManagerException("没有产品可发行推广,请联系管理员");
}
request.setOrderSource(reqDto.getOrderSource());
request.setReleaseIdList(releaseIds);
return issueProductRepo.page(request);

正在加载...
取消
保存