|
|
@@ -8,6 +8,7 @@ import com.usoftchina.saas.account.dto.AccountDTO;
|
|
|
import com.usoftchina.saas.account.dto.CompanyDTO;
|
|
|
import com.usoftchina.saas.account.dto.RoleBaseDTO;
|
|
|
import com.usoftchina.saas.commons.dto.AddApplyDTO;
|
|
|
+import com.usoftchina.saas.commons.dto.AddApplyReqDTO;
|
|
|
import com.usoftchina.saas.commons.dto.ListReqDTO;
|
|
|
import com.usoftchina.saas.commons.exception.BizExceptionCode;
|
|
|
import com.usoftchina.saas.commons.mapper.SystemRemindMapper;
|
|
|
@@ -18,6 +19,7 @@ import com.usoftchina.saas.exception.BizException;
|
|
|
import com.usoftchina.saas.exception.ExceptionCode;
|
|
|
import com.usoftchina.saas.page.PageRequest;
|
|
|
import com.usoftchina.saas.utils.BeanMapper;
|
|
|
+import com.usoftchina.saas.utils.CollectionUtils;
|
|
|
import com.usoftchina.saas.utils.ObjectUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -51,6 +53,9 @@ public class SystemRemindServiceImpl implements SystemRemindService {
|
|
|
AddApply addApply = new AddApply();
|
|
|
addApply.setMobile(addApplyDTO.getMobile());
|
|
|
addApply.setUsername(addApplyDTO.getUsername());
|
|
|
+ addApply.setCompanyName(addApplyDTO.getCompanyName());
|
|
|
+ addApply.setAdmin(addApplyDTO.getAdmin());
|
|
|
+ addApply.setAdminMobile(addApplyDTO.getAdminMobile());
|
|
|
addApply.setStatus("2");
|
|
|
addApply.setCompanyId(addApplyDTO.getCompanyId());
|
|
|
addApply.setCreateTime(new Date());
|
|
|
@@ -70,14 +75,16 @@ public class SystemRemindServiceImpl implements SystemRemindService {
|
|
|
for (AddApplyDTO addapplyDTO : addApplyDTOList) {
|
|
|
AccountDTO accountDTO = accountApi.getAccount(addapplyDTO.getMobile()).getData();
|
|
|
List<RoleBaseDTO> roleBaseDTOList = accountDTO.getRolesMap().get(companyId);
|
|
|
- for (RoleBaseDTO roleBaseDTO : roleBaseDTOList){
|
|
|
- roles.append(roleBaseDTO.getId() + ",");
|
|
|
- roleNames.append(roleBaseDTO.getName() + ",");
|
|
|
+ if (!CollectionUtils.isEmpty(roleBaseDTOList)) {
|
|
|
+ for (RoleBaseDTO roleBaseDTO : roleBaseDTOList) {
|
|
|
+ roles.append(roleBaseDTO.getId() + ",");
|
|
|
+ roleNames.append(roleBaseDTO.getName() + ",");
|
|
|
+ }
|
|
|
+ addapplyDTO.setRoles(roles.substring(0, roles.length() - 1));
|
|
|
+ addapplyDTO.setRoleNames(roleNames.substring(0, roleNames.length() - 1));
|
|
|
+ roles.setLength(0);
|
|
|
+ roleNames.setLength(0);
|
|
|
}
|
|
|
- addapplyDTO.setRoles(roles.substring(0, roles.length() - 1));
|
|
|
- addapplyDTO.setRoleNames(roleNames.substring(0, roleNames.length() - 1));
|
|
|
- roles.setLength(0);
|
|
|
- roleNames.setLength(0);
|
|
|
}
|
|
|
PageInfo<AddApplyDTO> pageInfo = new PageInfo<AddApplyDTO>(addApplyDTOList);
|
|
|
return pageInfo;
|
|
|
@@ -98,4 +105,9 @@ public class SystemRemindServiceImpl implements SystemRemindService {
|
|
|
//更新申请单状态
|
|
|
systemRemindMapper.confirmApply(addApplyDTO.getStatus(), addApplyDTO.getId(), BaseContextHolder.getUserId());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getApplyCountById(Long accountId, Long companyId) {
|
|
|
+ return systemRemindMapper.getApplyCountById(accountId, companyId);
|
|
|
+ }
|
|
|
}
|