|
|
@@ -24,7 +24,6 @@ import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
|
import org.apache.ibatis.builder.BuilderException;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -42,13 +41,13 @@ import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements CustomerService {
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private UserMapper userMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private UserIdentityMapper userIdentityMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private OrganizationIdentityMapper organizationIdentityMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private OrganizationContactBookMapper organizationContactBookMapper;
|
|
|
@Resource(name = "passwordUtil")
|
|
|
private PasswordUtil passwordUtil;
|
|
|
@@ -108,13 +107,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
private PublicReleaseLogMapper publicReleaseLogMapper;
|
|
|
@Resource
|
|
|
private PublicReleaseMapper publicReleaseMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SystemWebSocketHandler systemWebSocketHandler;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private AdminUserCountMapper adminUserCountMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private RestrictProjectMapper restrictProjectMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private AsyncUtils asyncUtils;
|
|
|
|
|
|
|
|
|
@@ -123,7 +122,6 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
@Value(value = "${upload.path}")
|
|
|
private String uploadPath = null;
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<CustomerListOut> listPrivatePersonalCustomer(CustomerListIn cli, Integer pageNo,
|
|
|
Integer pageSize) {
|
|
|
@@ -138,40 +136,33 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<CustomerListOut> listPublicPersonalCustomer(CustomerListIn cli, Integer pageNo,
|
|
|
Integer pageSize) {
|
|
|
cli.setType(AFTConstants.USER_TYPE_PERSONAL);
|
|
|
Map<String, Object> params = disposeParams(cli);
|
|
|
- Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPublicPersonalCustomerList",
|
|
|
+ return (Pagination<CustomerListOut>) findPage("selectPublicPersonalCustomerList",
|
|
|
"selectPublicPersonalCustomerCount", params, pageNo, pageSize);
|
|
|
- return list;
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<CustomerListOut> listAllPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize) {
|
|
|
cli.setType(AFTConstants.USER_TYPE_PERSONAL);
|
|
|
Map<String, Object> params = disposeParams(cli);
|
|
|
- Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPersonalCustomerList",
|
|
|
+ return (Pagination<CustomerListOut>) findPage("selectPersonalCustomerList",
|
|
|
"selectPersonalCustomerCount", params, pageNo, pageSize);
|
|
|
- return list;
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<CustomerListOut> listAllManagePersonalCustomer(CustomerListIn cli, Integer pageNo,
|
|
|
Integer pageSize) {
|
|
|
cli.setType(AFTConstants.USER_TYPE_PERSONAL);
|
|
|
cli.setShareType(String.valueOf(AFTConstants.USER_SHARE_PRIVATE));
|
|
|
Map<String, Object> params = disposeParams(cli);
|
|
|
- Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectManagePersonalCustomerList",
|
|
|
+ return (Pagination<CustomerListOut>) findPage("selectManagePersonalCustomerList",
|
|
|
"selectManagePersonalCustomerCount", params, pageNo, pageSize);
|
|
|
- return list;
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli, Integer sort,
|
|
|
Integer sortType, Integer power, Integer pageNo, Integer pageSize) {
|
|
|
@@ -213,19 +204,16 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<CustomerListOut> listPublicOrganizationCustomer(CustomerListIn cli, Integer pageNo,
|
|
|
Integer pageSize) {
|
|
|
cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
|
|
|
cli.setShareType(String.valueOf(AFTConstants.USER_SHARE_PUBLIC));
|
|
|
Map<String, Object> params = disposeParams(cli);
|
|
|
- Pagination<CustomerListOut> p = (Pagination<CustomerListOut>) findPage("selectPublicOrganizationCustomerList",
|
|
|
+ return (Pagination<CustomerListOut>) findPage("selectPublicOrganizationCustomerList",
|
|
|
"selectPublicOrganizationCustomerCount", params, pageNo, pageSize);
|
|
|
- return p;
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<CustomerListOut> listAllOrganizationCustomer(CustomerListIn cli, Integer pageNo,
|
|
|
Integer pageSize) {
|
|
|
@@ -278,8 +266,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
String newstr1=name.replaceAll(" ",","); //先把所有空格替换成 逗号。
|
|
|
String newstr2=newstr1.replaceAll("\t",","); //再把所有的制表符替换成逗号。
|
|
|
String newstr3=newstr2.replaceAll(",+", ","); //把所有重复的逗号合并成一个逗号。
|
|
|
- String[] strings=newstr3.split(","); //按逗号分解该字符串。
|
|
|
- return strings;
|
|
|
+ return newstr3.split(",");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -289,15 +276,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
cli.setShareType(String.valueOf(AFTConstants.USER_SHARE_PRIVATE));
|
|
|
cli.setAid(TokenManager.getAdminId());
|
|
|
Map<String, Object> params = disposeParams(cli);
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage(
|
|
|
+ return (Pagination<CustomerListOut>) findPage(
|
|
|
"selectManageOrganizationCustomerList", "selectManageOrganizationCustomerCount", params, pageNo,
|
|
|
pageSize);
|
|
|
- return list;
|
|
|
}
|
|
|
|
|
|
private Map<String, Object> disposeParams(CustomerListIn cli) {
|
|
|
- Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
if (StringUtils.isNotBlank(cli.getType()))
|
|
|
params.put("type", Integer.parseInt(cli.getType()));
|
|
|
if (StringUtils.isNotBlank(cli.getName()))
|
|
|
@@ -401,6 +386,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
ui.setAuditStatus(IdentityProcess.SUCCESS.getCode());// 认证个人
|
|
|
userIdentityMapper.insert(ui);
|
|
|
} else if (Objects.equals(in.getType(), UserType.ORGANIZATION.getCode())) {
|
|
|
+ //判定客户名称
|
|
|
checkUserName(in);
|
|
|
UserMid um=new UserMid();
|
|
|
um.setAid(user.getAid());
|
|
|
@@ -450,11 +436,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
cob.setMajor(AFTConstants.YES);
|
|
|
organizationContactBookMapper.insert(cob);
|
|
|
// 新增锁定数据
|
|
|
- boolean isUs = false;
|
|
|
- if (uid.contains(",")) {
|
|
|
- isUs = true;
|
|
|
- }
|
|
|
- List<String> uList = new ArrayList<>();
|
|
|
+ boolean isUs = uid.contains(",");
|
|
|
+ List<String> uList = new ArrayList<>();
|
|
|
if (isUs) {
|
|
|
uList = Arrays.asList(uid.split(","));
|
|
|
}
|
|
|
@@ -475,12 +458,11 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
String startTime=DateUtils.formatDate(transferTime,AFTConstants.YYYYMMDD);
|
|
|
String endTime=startTime+" 23:59:59";
|
|
|
AdminUserCount adminUserCount=getAdminUserCount(aid,startTime);
|
|
|
- if (adminUserCount==null){
|
|
|
- AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
- if(selectAUC!=null) adminUserCountMapper.insertSelective(selectAUC);
|
|
|
+ AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
+ if (adminUserCount==null){
|
|
|
+ if(selectAUC!=null) adminUserCountMapper.insertSelective(selectAUC);
|
|
|
}else {
|
|
|
- AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
- AdminUserCount newAUC=new AdminUserCount();
|
|
|
+ AdminUserCount newAUC=new AdminUserCount();
|
|
|
newAUC.setId(adminUserCount.getId());
|
|
|
if (selectAUC==null){
|
|
|
newAUC.setPrivateCount(0);
|
|
|
@@ -767,7 +749,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
@Override
|
|
|
|
|
|
public List<OrganizationContactBook> findCustomerContacts(String uid) {
|
|
|
- List<OrganizationContactBook> list = userMapper.findCustomerContacts(uid, null);
|
|
|
+ List<OrganizationContactBook> list = userMapper.findCustomerContacts(uid, TokenManager.getAdminId());
|
|
|
for (OrganizationContactBook ob : list) {
|
|
|
if (!ob.getAid().equals(TokenManager.getAdminId())){
|
|
|
ob.setName("***");
|
|
|
@@ -1006,16 +988,15 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
String endTime=startTime+" 23:59:59";
|
|
|
AdminUserCount adminUserCount = getAdminUserCount(aid,startTime);
|
|
|
Integer count = userFollowMapper.selectByaidAndDate(aid, startTime, endTime);
|
|
|
- if (adminUserCount==null){
|
|
|
- AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
- if (selectAUC==null)selectAUC=new AdminUserCount();
|
|
|
+ AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
+ if (adminUserCount==null){
|
|
|
+ if (selectAUC==null)selectAUC=new AdminUserCount();
|
|
|
selectAUC.setFollowCount(count);
|
|
|
selectAUC.setAid(aid);
|
|
|
selectAUC.setDateTime(transferTime);
|
|
|
adminUserCountMapper.insertSelective(selectAUC);
|
|
|
}else {
|
|
|
- AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
- AdminUserCount newAUC=new AdminUserCount();
|
|
|
+ AdminUserCount newAUC=new AdminUserCount();
|
|
|
newAUC.setId(adminUserCount.getId());
|
|
|
newAUC.setFollowCount(count);
|
|
|
if (selectAUC==null){
|
|
|
@@ -1396,6 +1377,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
List<User> useList=new ArrayList<>();
|
|
|
List<User> newList=new ArrayList<>();
|
|
|
//领取
|
|
|
+ boolean typeFlag = AFTConstants.USER_TRANSFER_TO_OTHER.equals(operatorType)
|
|
|
+ || AFTConstants.SIGN_USER_TRANSFER_TO_OTHER.equals(operatorType)
|
|
|
+ || AFTConstants.CHANNEL_USER_TRANSFER_TO_OTHER.equals(operatorType);
|
|
|
if (AFTConstants.USER_RECEIVE.equals(operatorType)) {
|
|
|
User use = userMapper.selectByPrimaryKey(uid);
|
|
|
user.setAid(TokenManager.getAdminId());
|
|
|
@@ -1411,9 +1395,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
updateUserMid(aid,uid,0,null);
|
|
|
organizationContactBookMapper.updateAdmin(uid,aid);
|
|
|
//转交
|
|
|
- } else if (AFTConstants.USER_TRANSFER_TO_OTHER.equals(operatorType)
|
|
|
- || AFTConstants.SIGN_USER_TRANSFER_TO_OTHER .equals(operatorType)
|
|
|
- || AFTConstants.CHANNEL_USER_TRANSFER_TO_OTHER .equals(operatorType)) {
|
|
|
+ } else if (typeFlag) {
|
|
|
|
|
|
if (!isUs) {
|
|
|
user.setAid(aid);
|
|
|
@@ -1476,7 +1458,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
throw new BusinessException(new Error(ErrorConstants.CUSTOMER_TRANSFER_FAIL, ""));
|
|
|
}
|
|
|
}
|
|
|
- Integer type = 2;
|
|
|
+ int type = 2;
|
|
|
if (AFTConstants.SIGN_USER_TRANSFER_TO_OTHER == operatorType)type = 7;
|
|
|
|
|
|
addUserTransferLog(uid, aid,oldAid, type, null, now, uList);
|
|
|
@@ -1484,7 +1466,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
transferUser(uList,aid,uid);
|
|
|
}
|
|
|
if (isUs) {
|
|
|
- if (AFTConstants.USER_RECEIVE == operatorType) {
|
|
|
+ if (AFTConstants.USER_RECEIVE.equals(operatorType)) {
|
|
|
userMapper.updateList(aid, null, 3, null, 2, uList,null);
|
|
|
} else {
|
|
|
userMapper.updateList(aid, null, 3, null, null, uList,data);
|
|
|
@@ -1496,9 +1478,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
if (AFTConstants.USER_RECEIVE.equals(operatorType)){
|
|
|
updateAdminUserCount(user.getAid(),user.getTransferTime());
|
|
|
}
|
|
|
- if (AFTConstants.USER_TRANSFER_TO_OTHER.equals(operatorType)
|
|
|
- || AFTConstants.SIGN_USER_TRANSFER_TO_OTHER .equals(operatorType)
|
|
|
- || AFTConstants.CHANNEL_USER_TRANSFER_TO_OTHER .equals(operatorType)) {
|
|
|
+ if (typeFlag) {
|
|
|
updateAdminUserCountTransfer(useList,newList);
|
|
|
}
|
|
|
return errors;
|
|
|
@@ -1540,7 +1520,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
PublicRelease pr=new PublicRelease();
|
|
|
pr.setId(e.getId());
|
|
|
pr.setPublicType(0);
|
|
|
- publicReleaseMapper.updateByPrimaryKeySelective(pr);
|
|
|
+ publicReleaseMapper.update(pr);
|
|
|
Admin sendAdmin=adminMapper.selectByPrimaryKey(admin.getReviewer());
|
|
|
noticeAid=sendAdmin.getId();
|
|
|
logStatus=2;
|
|
|
@@ -2601,11 +2581,11 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
Date date = new Date();
|
|
|
List<LockingReleaseBo> newList = new ArrayList<LockingReleaseBo>();
|
|
|
List<UserTransferLog> list3 = new ArrayList<UserTransferLog>();
|
|
|
- if (list != null && list.size() > 0) {
|
|
|
+ if (!list.isEmpty()) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
newList.add(list.get(i));
|
|
|
if (50 == newList.size() || i == list.size() - 1) {
|
|
|
- if (newList.size() > 0) {
|
|
|
+ if (!newList.isEmpty()) {
|
|
|
// 处理日志
|
|
|
for (LockingReleaseBo lrb : newList) {
|
|
|
UserTransferLog utl = new UserTransferLog();
|
|
|
@@ -2725,7 +2705,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
@Override
|
|
|
public boolean checkChannel(List<String> uids) {
|
|
|
for (String uid : uids) {
|
|
|
- List<UserFollow> list = userFollowMapper.selectbyUid(uid, TokenManager.getAdminId());
|
|
|
+ List<UserFollow> list = userFollowMapper.selectByUidAndUid(uid, TokenManager.getAdminId());
|
|
|
if (!list.isEmpty()) {
|
|
|
return true;
|
|
|
}
|
|
|
@@ -2902,33 +2882,34 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int updateUserDate(String uid,Integer province, Integer city, Integer area, String businessScope, String intendedProject,
|
|
|
- String introduction,Integer channelType,String orgCode) {
|
|
|
+ public int updateUserDate(InputUserData in ) {
|
|
|
OrganizationIdentity oi =new OrganizationIdentity();
|
|
|
- oi.setUid(uid);
|
|
|
- if (province!=null ||city !=null ||area!=null|| businessScope!=null ||intendedProject!=null||orgCode!=null){
|
|
|
- if(province!=null)oi.setLocationProvince(province);
|
|
|
- if(city!=null)oi.setLocationCity(city);
|
|
|
- if(area!=null)oi.setLocationArea(area);
|
|
|
- if (orgCode!=null)oi.setOrgCode(orgCode);
|
|
|
- if (businessScope!=null){
|
|
|
- OrganizationIdentity use=organizationIdentityMapper.selectOrgIdentityByUserId(uid);
|
|
|
- updateBusinessScope(uid,businessScope,use.getBusinessScope(),new Date());
|
|
|
- oi.setBusinessScope(businessScope);
|
|
|
+ oi.setUid(in.getUid());
|
|
|
+ if (in.getProvince()!=null ||in.getCity() !=null ||in.getArea()!=null|| in.getBusinessScope()!=null
|
|
|
+ ||in.getIntendedProject()!=null||in.getOrgCode()!=null||in.getIndustry()!=null){
|
|
|
+ if(in.getProvince()!=null)oi.setLocationProvince(in.getProvince());
|
|
|
+ if(in.getCity()!=null)oi.setLocationCity(in.getCity());
|
|
|
+ if(in.getArea()!=null)oi.setLocationArea(in.getArea());
|
|
|
+ if (in.getOrgCode()!=null)oi.setOrgCode(in.getOrgCode());
|
|
|
+ if (in.getIndustry()!=null)oi.setIndustry(in.getIndustry());
|
|
|
+ if (in.getBusinessScope()!=null){
|
|
|
+ OrganizationIdentity use=organizationIdentityMapper.selectOrgIdentityByUserId(in.getUid());
|
|
|
+ updateBusinessScope(in.getUid(),in.getBusinessScope(),use.getBusinessScope(),new Date());
|
|
|
+ oi.setBusinessScope(in.getBusinessScope());
|
|
|
}
|
|
|
- if(intendedProject!=null)oi.setIntendedProject(intendedProject);
|
|
|
+ if(in.getIntendedProject()!=null)oi.setIntendedProject(in.getIntendedProject());
|
|
|
organizationIdentityMapper.updateServiceByUid(oi);
|
|
|
}
|
|
|
- if (introduction!=null){
|
|
|
+ if (in.getIntroduction()!=null){
|
|
|
User user=new User();
|
|
|
- user.setId(uid);
|
|
|
- user.setIntroduction(introduction);
|
|
|
+ user.setId(in.getUid());
|
|
|
+ user.setIntroduction(in.getIntroduction());
|
|
|
userMapper.updateByPrimaryKeySelective(user);
|
|
|
}
|
|
|
- if (channelType !=null){
|
|
|
+ if (in.getChannelType() !=null){
|
|
|
UserMid um =new UserMid();
|
|
|
- um.setUid(uid);
|
|
|
- um.setChannelType(channelType);
|
|
|
+ um.setUid(in.getUid());
|
|
|
+ um.setChannelType(in.getChannelType());
|
|
|
userMidMapper.updateByUid(um);
|
|
|
}
|
|
|
return 1;
|
|
|
@@ -3128,6 +3109,24 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
return userMapper.getRestrictCustomerByName(name,TokenManager.getAdminId());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public UserArchivesDetails selectUserByUid(String id) {
|
|
|
+ UserArchivesDetails user = userMapper.selectUser(id);
|
|
|
+ return user;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object getPublicReleaseList(String id) {
|
|
|
+ Map<String, Object> map=new HashMap<>();
|
|
|
+ User user = userMapper.selectByPrimaryKey(id);
|
|
|
+ if (user.getAid().equals(TokenManager.getAdminId())){
|
|
|
+ map.put("myUser",1);
|
|
|
+ }else {
|
|
|
+ map.put("myUser",0);
|
|
|
+ }
|
|
|
+ map.put("list",userMapper.getPublicReleaseList(id));
|
|
|
+ return map;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
|
|
|
@@ -3166,4 +3165,50 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Pagination<SelectMyUserOut> selectMyUser(SelectMyUserBo in) {
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ if (in.getType() != null){
|
|
|
+ params.put("type", in.getType());
|
|
|
+ }else {
|
|
|
+ params.put("type", 0);
|
|
|
+ }
|
|
|
+ if (in.getLevel() !=null) params.put("level", in.getLevel());
|
|
|
+ if (in.getShareType() != null) params.put("shareType", in.getShareType());
|
|
|
+ if (in.getName() != null) params.put("name", in.getName());
|
|
|
+ params.put("aid", TokenManager.getAdminId());
|
|
|
+ Pagination<SelectMyUserOut> list = (Pagination<SelectMyUserOut>) findPage("selectMyUserList",
|
|
|
+ "selectMyUserCount", params, in.getPageNo(), in.getPageSize());
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object selectMyUserDetails(String id) {
|
|
|
+ Map<String, Object> params = new LinkedHashMap<>();
|
|
|
+ List<MyUserDetailsBo> publicReleases = publicReleaseMapper.selectByUid(id);
|
|
|
+ MyUserDetailsBo maxPr = new MyUserDetailsBo();
|
|
|
+ MyUserDetailsBo minPr = new MyUserDetailsBo();
|
|
|
+ for (MyUserDetailsBo e : publicReleases) {
|
|
|
+ if (maxPr.getReleaseStart()==null)maxPr=e;
|
|
|
+ if (maxPr.getReleaseStart().before(e.getReleaseStart()))maxPr=e;
|
|
|
+ if (minPr.getReleaseStart()==null)minPr=e;
|
|
|
+ if (minPr.getReleaseStart().after(e.getReleaseStart()))minPr=e;
|
|
|
+ }
|
|
|
+ List<UserFollow> userFollows = userFollowMapper.selectByUidAndUid(id, null);
|
|
|
+ Optional<UserFollow> latestFollow = userFollows.stream()
|
|
|
+ .max(Comparator.comparing(UserFollow::getCreateTime));
|
|
|
+ params.put("count",publicReleases.size());
|
|
|
+ params.put("minPublicRelease",minPr);
|
|
|
+ params.put("maxPublicRelease",maxPr);
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
+ latestFollow.ifPresent(userFollow -> {
|
|
|
+ map.put("id",userFollow.getId());
|
|
|
+ map.put("followTime",DateUtils.formatDate(userFollow.getCreateTime(),AFTConstants.YYYYMMDD));
|
|
|
+ map.put("followName",userFollow.getFollowName());
|
|
|
+ });
|
|
|
+ params.put("latestFollow",map);
|
|
|
+ return params;
|
|
|
+ }
|
|
|
+
|
|
|
}
|