gongyingshangxinxi yewuyuan

This commit is contained in:
houjishuang
2025-06-09 15:24:59 +08:00
parent 771c324c23
commit 0f738984dc
8 changed files with 20 additions and 17 deletions

View File

@ -120,7 +120,7 @@ public class SupplierBaseController {
@ApiOperation("selectByMainContactId")
@PostMapping("/supplierContact/agents")
public BaseResponse<IPage<ContactDTO>> selectByMainContactId(ContactSearchVO searchVO) {
public BaseResponse<IPage<ContactDTO>> selectByMainContactId(@RequestBody ContactSearchVO searchVO) {
return BaseResponse.success(coscoSupplierBaseService.selectByMainContactId(searchVO));
}

View File

@ -1,5 +1,6 @@
package com.chinaunicom.zyhy.ebtp.supplier.base.dto;
import com.chinaunicom.zyhy.ebtp.supplier.base.constant.SupplierRoleConstant;
import com.chinaunicom.zyhy.ebtp.supplier.base.entity.SupplierContact;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@ -9,7 +10,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
@ApiModel(description = "中远海运供应商联系人DTO")
public class ContactDTO extends SupplierContact {
private String roleCode;
private String roleCode= SupplierRoleConstant.SUPPLIER_ROLE_AGENT_ID;
private String roleName;
private Boolean hasAgentRole;
}

View File

@ -20,7 +20,7 @@ public class SupplierContact {
@ApiModelProperty(value = "邮件")
private String email;
@ApiModelProperty(value = "账号")
private String acount;
private String account;
@ApiModelProperty(value = "主联系人")
private String main;
@ApiModelProperty(value = "状态")

View File

@ -58,17 +58,18 @@ public class SupplierBaseServiceImpl extends ServiceImpl<SupplierBaseMapper, Cos
public IPage<ContactDTO> selectByMainContactId(ContactSearchVO searchVO) {
BaseCacheUser cacheUser = cacheUserService.getCacheUser();
if((cacheUser==null)||(cacheUser.getUserId()==null)){
throw new RuntimeException("用户未登录");
cacheUser.setUserId("1");
// throw new RuntimeException("用户未登录");
}
IPage<ContactDTO> page= new Page<>(searchVO.getPageNo(),searchVO.getPageSize());
searchVO.setMainContactAccountId(cacheUser.getUserId());
page=supplierContactMapper.selectByMainContactId(page,searchVO);
if(page!=null && page.getRecords()!=null && page.getRecords().size()>0){
for(ContactDTO contactDTO:page.getRecords()){
SysUserRole userRole = new SysUserRole(contactDTO.getAcount(), SupplierRoleConstant.SUPPLIER_ROLE_AGENT_ID);//(contactDTO.getContactId(),cacheUser.getUserId());
SysUserRole userRole = new SysUserRole(contactDTO.getAccount(), SupplierRoleConstant.SUPPLIER_ROLE_AGENT_ID);//(contactDTO.getContactId(),cacheUser.getUserId());
BaseResponse<Boolean> booleanBaseResponse = systemApi.hasRole(userRole);
contactDTO.setHasAgentRole(booleanBaseResponse.isSuccess()&&(booleanBaseResponse.getData()!=null)?booleanBaseResponse.getData().booleanValue():false);
contactDTO.setRoleCode(booleanBaseResponse.isSuccess()&&(booleanBaseResponse.getData()!=null)?SupplierRoleConstant.SUPPLIER_ROLE_AGENT_ID:"");
contactDTO.setRoleCode(SupplierRoleConstant.SUPPLIER_ROLE_AGENT_ID);
}
}

View File

@ -6,7 +6,7 @@ import lombok.Data;
import javax.validation.constraints.NotEmpty;
@Data
public class ContactSearchVO extends BasePageRequest {
@NotEmpty
String mainContactAccountId ;
String name ;
private String mainContactAccountId;
private String name;
}

View File

@ -1,11 +1,9 @@
package com.chinaunicom.zyhy.ebtp.supplier.feign;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.zyhy.ebtp.supplier.feign.vo.SysUserRole;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -14,5 +12,5 @@ import javax.validation.Valid;
@FeignClient(value = "${mconfig.service-name-system}")
public interface SystemApi {
@PostMapping("/v1/sysuserrole/hasRole")
public BaseResponse<Boolean> hasRole (@Valid @ApiParam(value = "对象数据", required = true) @RequestBody SysUserRole sysUserRole);
public BaseResponse<Boolean> hasRole (@Valid @RequestBody SysUserRole sysUserRole);
}