Commit e3aa79c2 authored by 廖旭伟's avatar 廖旭伟

协议list返回接口增加修改用户名称显示

parent 6131654c
package com.mortals.xhx.module.sst.service.impl; package com.mortals.xhx.module.sst.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.feign.user.IUserFeign;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -6,6 +13,9 @@ import com.mortals.framework.model.Context; ...@@ -6,6 +13,9 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.sst.dao.SstAgreementDao; import com.mortals.xhx.module.sst.dao.SstAgreementDao;
import com.mortals.xhx.module.sst.model.SstAgreementEntity; import com.mortals.xhx.module.sst.model.SstAgreementEntity;
import com.mortals.xhx.module.sst.service.SstAgreementService; import com.mortals.xhx.module.sst.service.SstAgreementService;
import java.util.List;
/** /**
* SstAgreementService * SstAgreementService
* 协议管理 service实现 * 协议管理 service实现
...@@ -15,5 +25,21 @@ import com.mortals.xhx.module.sst.service.SstAgreementService; ...@@ -15,5 +25,21 @@ import com.mortals.xhx.module.sst.service.SstAgreementService;
*/ */
@Service("sstAgreementService") @Service("sstAgreementService")
public class SstAgreementServiceImpl extends AbstractCRUDServiceImpl<SstAgreementDao, SstAgreementEntity, Long> implements SstAgreementService { public class SstAgreementServiceImpl extends AbstractCRUDServiceImpl<SstAgreementDao, SstAgreementEntity, Long> implements SstAgreementService {
@Autowired
private IUserFeign userFeign;
@Override
protected void findAfter(SstAgreementEntity params, PageInfo pageInfo, Context context, List<SstAgreementEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){
list.stream().forEach(item->{
if(item.getUpdateUserId()!=null) {
Rest<UserPdu> resp = userFeign.info(item.getUpdateUserId());
if (resp.getCode() == YesNoEnum.YES.getValue()) {
item.setUpdateUserName(resp.getData().getRealName());
}
}
});
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment