gongyingshangxinxi yewuyuan
This commit is contained in:
@ -120,7 +120,7 @@ public class SupplierBaseController {
|
|||||||
|
|
||||||
@ApiOperation("selectByMainContactId")
|
@ApiOperation("selectByMainContactId")
|
||||||
@PostMapping("/supplierContact/agents")
|
@PostMapping("/supplierContact/agents")
|
||||||
public BaseResponse<IPage<ContactDTO>> selectByMainContactId(ContactSearchVO searchVO) {
|
public BaseResponse<IPage<ContactDTO>> selectByMainContactId(@RequestBody ContactSearchVO searchVO) {
|
||||||
|
|
||||||
return BaseResponse.success(coscoSupplierBaseService.selectByMainContactId(searchVO));
|
return BaseResponse.success(coscoSupplierBaseService.selectByMainContactId(searchVO));
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.chinaunicom.zyhy.ebtp.supplier.base.dto;
|
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 com.chinaunicom.zyhy.ebtp.supplier.base.entity.SupplierContact;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -9,7 +10,7 @@ import lombok.experimental.Accessors;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(description = "中远海运供应商联系人DTO")
|
@ApiModel(description = "中远海运供应商联系人DTO")
|
||||||
public class ContactDTO extends SupplierContact {
|
public class ContactDTO extends SupplierContact {
|
||||||
private String roleCode;
|
private String roleCode= SupplierRoleConstant.SUPPLIER_ROLE_AGENT_ID;
|
||||||
private String roleName;
|
private String roleName;
|
||||||
private Boolean hasAgentRole;
|
private Boolean hasAgentRole;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class SupplierContact {
|
|||||||
@ApiModelProperty(value = "邮件")
|
@ApiModelProperty(value = "邮件")
|
||||||
private String email;
|
private String email;
|
||||||
@ApiModelProperty(value = "账号")
|
@ApiModelProperty(value = "账号")
|
||||||
private String acount;
|
private String account;
|
||||||
@ApiModelProperty(value = "主联系人")
|
@ApiModelProperty(value = "主联系人")
|
||||||
private String main;
|
private String main;
|
||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
|
@ -58,17 +58,18 @@ public class SupplierBaseServiceImpl extends ServiceImpl<SupplierBaseMapper, Cos
|
|||||||
public IPage<ContactDTO> selectByMainContactId(ContactSearchVO searchVO) {
|
public IPage<ContactDTO> selectByMainContactId(ContactSearchVO searchVO) {
|
||||||
BaseCacheUser cacheUser = cacheUserService.getCacheUser();
|
BaseCacheUser cacheUser = cacheUserService.getCacheUser();
|
||||||
if((cacheUser==null)||(cacheUser.getUserId()==null)){
|
if((cacheUser==null)||(cacheUser.getUserId()==null)){
|
||||||
throw new RuntimeException("用户未登录");
|
cacheUser.setUserId("1");
|
||||||
|
// throw new RuntimeException("用户未登录");
|
||||||
}
|
}
|
||||||
IPage<ContactDTO> page= new Page<>(searchVO.getPageNo(),searchVO.getPageSize());
|
IPage<ContactDTO> page= new Page<>(searchVO.getPageNo(),searchVO.getPageSize());
|
||||||
searchVO.setMainContactAccountId(cacheUser.getUserId());
|
searchVO.setMainContactAccountId(cacheUser.getUserId());
|
||||||
page=supplierContactMapper.selectByMainContactId(page,searchVO);
|
page=supplierContactMapper.selectByMainContactId(page,searchVO);
|
||||||
if(page!=null && page.getRecords()!=null && page.getRecords().size()>0){
|
if(page!=null && page.getRecords()!=null && page.getRecords().size()>0){
|
||||||
for(ContactDTO contactDTO:page.getRecords()){
|
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);
|
BaseResponse<Boolean> booleanBaseResponse = systemApi.hasRole(userRole);
|
||||||
contactDTO.setHasAgentRole(booleanBaseResponse.isSuccess()&&(booleanBaseResponse.getData()!=null)?booleanBaseResponse.getData().booleanValue():false);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import lombok.Data;
|
|||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
@Data
|
@Data
|
||||||
public class ContactSearchVO extends BasePageRequest {
|
public class ContactSearchVO extends BasePageRequest {
|
||||||
@NotEmpty
|
|
||||||
String mainContactAccountId ;
|
private String mainContactAccountId;
|
||||||
String name ;
|
private String name;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
package com.chinaunicom.zyhy.ebtp.supplier.feign;
|
package com.chinaunicom.zyhy.ebtp.supplier.feign;
|
||||||
|
|
||||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||||
|
|
||||||
import com.chinaunicom.zyhy.ebtp.supplier.feign.vo.SysUserRole;
|
import com.chinaunicom.zyhy.ebtp.supplier.feign.vo.SysUserRole;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
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.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
@ -14,5 +12,5 @@ import javax.validation.Valid;
|
|||||||
@FeignClient(value = "${mconfig.service-name-system}")
|
@FeignClient(value = "${mconfig.service-name-system}")
|
||||||
public interface SystemApi {
|
public interface SystemApi {
|
||||||
@PostMapping("/v1/sysuserrole/hasRole")
|
@PostMapping("/v1/sysuserrole/hasRole")
|
||||||
public BaseResponse<Boolean> hasRole (@Valid @ApiParam(value = "对象数据", required = true) @RequestBody SysUserRole sysUserRole);
|
public BaseResponse<Boolean> hasRole (@Valid @RequestBody SysUserRole sysUserRole);
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,10 @@ mconfig:
|
|||||||
service-name-resps: biz-service-ebtp-resps #标段应答文件
|
service-name-resps: biz-service-ebtp-resps #标段应答文件
|
||||||
service-name-rsms: biz-service-ebtp-rsms #评审微服务
|
service-name-rsms: biz-service-ebtp-rsms #评审微服务
|
||||||
service-name-tender: biz-service-ebtp-tender #标段投标微服务
|
service-name-tender: biz-service-ebtp-tender #标段投标微服务
|
||||||
service-name-system: sys-manager-ebtp-project #系统管理微服务
|
service-name-agency: biz-service-ebtp-agency #招标代理库微服务
|
||||||
|
service-name-provider: biz-supplier-manage #供应商微服务
|
||||||
|
service-name-project: biz-service-ebtp-project #项目微服务
|
||||||
|
service-name-system: sys-manager-ebtp-project
|
||||||
wfSectionNo: '080'
|
wfSectionNo: '080'
|
||||||
wfSectionName: 标段重新评审审批单
|
wfSectionName: 标段重新评审审批单
|
||||||
|
|
||||||
|
@ -38,13 +38,13 @@
|
|||||||
|
|
||||||
<select id="selectByMainContactId" resultType="com.chinaunicom.zyhy.ebtp.supplier.base.dto.ContactDTO">
|
<select id="selectByMainContactId" resultType="com.chinaunicom.zyhy.ebtp.supplier.base.dto.ContactDTO">
|
||||||
select
|
select
|
||||||
sub.id, sub.name, sub.phone, sub.email, sub.acount, sub.main, sub.status, sub.supplier_base_id
|
sub.id, sub.`name`,sub.phone,sub.email, sub.`account`, sub.main, sub.`status`, sub.supplier_base_id
|
||||||
from cosco_supplier_contact mainc,cosco_supplier_base sub
|
from cosco_supplier_contact mainc,cosco_supplier_contact sub
|
||||||
where mainc.supplier_base_id =sub.supplier_base_id
|
where mainc.supplier_base_id =sub.supplier_base_id
|
||||||
and mainc.main= '1' and sub.main='0'
|
and mainc.main= '1' and sub.main='0'
|
||||||
and mainc.acount = #{searchVO.mainContactAccountId}
|
and mainc.`account` = #{searchVO.mainContactAccountId}
|
||||||
<if test="searchVO.name!=null and searchVO.name!=''">
|
<if test="searchVO.name!=null and searchVO.name!=''">
|
||||||
and sub.name like concat('%', #{searchVO.name}, '%')
|
and sub.`name` like concat('%', #{searchVO.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user