|
|
@ -19,11 +19,11 @@ package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.ExcelImportUtil; |
|
|
|
import cn.afterturn.easypoi.excel.entity.ImportParams; |
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
@ -35,6 +35,7 @@ import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.config.StreamUtils; |
|
|
|
import com.elink.esua.epdc.dao.PartyMembersDao; |
|
|
|
import com.elink.esua.epdc.datasources.DataSourceNames; |
|
|
|
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.PartyMembersDTO; |
|
|
|
import com.elink.esua.epdc.dto.PartyTagRelationDTO; |
|
|
@ -73,6 +74,7 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa |
|
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
@DataSource(value = DataSourceNames.FIRST) |
|
|
|
public PageData<PartyMembersDTO> page(Map<String, Object> params) { |
|
|
|
IPage<PartyMembersEntity> page = baseDao.selectPage( |
|
|
|
getPage(params, FieldConstant.CREATED_TIME, false), |
|
|
@ -82,11 +84,13 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@DataSource(value = DataSourceNames.FIRST) |
|
|
|
public Result<PageData<PartyMembersDTO>> pageDIY(Map<String, Object> params) { |
|
|
|
return new Result().ok(pagePartyMember(params, YesOrNoEnum.YES.value())); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@DataSource(value = DataSourceNames.FIRST) |
|
|
|
public Result<PageData<PartyMembersDTO>> hasAuthenticationPartyPage(Map<String, Object> params) { |
|
|
|
return new Result().ok(pagePartyMember(params, YesOrNoEnum.NO.value())); |
|
|
|
} |
|
|
@ -161,6 +165,7 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@DataSource(value = DataSourceNames.FIRST) |
|
|
|
public PartyMembersDTO get(String id) { |
|
|
|
PartyMembersDTO partyMembersDTO = baseDao.selectByIdNew(id); |
|
|
|
if (partyMembersDTO.getDeptStrIds() != null) { |
|
|
@ -252,7 +257,7 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa |
|
|
|
List<PartyMembersEntity> partyMembersEntityList = ConvertUtils.sourceToTarget(partyList, PartyMembersEntity.class); |
|
|
|
for (int i = 0; i < partyMembersEntityList.size(); i++) { |
|
|
|
PartyMembersEntity partyMembersEntity = partyMembersEntityList.get(i); |
|
|
|
partyMembersEntity.setCadreFlag("0"); |
|
|
|
partyMembersEntity.setCadreFlag(YesOrNoEnum.NO.value()); |
|
|
|
partyMembersEntity.setRegistFlag(PartyMemberRegFlagEnum.NO.getValue()); |
|
|
|
partyMembersEntity.setGridName(null); |
|
|
|
} |
|
|
@ -268,12 +273,12 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa |
|
|
|
List<PartyMembersEntity> partyMembersEntityList = baseDao.selectList(new QueryWrapper<PartyMembersEntity>()); |
|
|
|
List<PartyMembersExcel> partyExportList = ExcelImportUtil.importExcel(f, PartyMembersExcel.class, importParams); |
|
|
|
// 去空格
|
|
|
|
List<PartyMembersExcel> partyList =new ArrayList<>(); |
|
|
|
for(PartyMembersExcel partyItem:partyExportList){ |
|
|
|
if(StringUtils.isNotBlank(partyItem.getIdentityNo())){ |
|
|
|
List<PartyMembersExcel> partyList = new ArrayList<>(); |
|
|
|
for (PartyMembersExcel partyItem : partyExportList) { |
|
|
|
if (StringUtils.isNotBlank(partyItem.getIdentityNo())) { |
|
|
|
partyItem.setIdentityNo(ModuleUtils.replaceIllegalCharacter(partyItem.getIdentityNo())); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(partyItem.getRealName())){ |
|
|
|
if (StringUtils.isNotBlank(partyItem.getRealName())) { |
|
|
|
partyItem.setRealName(ModuleUtils.replaceIllegalCharacter(partyItem.getRealName())); |
|
|
|
} |
|
|
|
partyList.add(partyItem); |
|
|
@ -284,10 +289,10 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa |
|
|
|
return new Result().ok(epdcPartyErroyResultDtos); |
|
|
|
} |
|
|
|
saveList(partyList); |
|
|
|
for (PartyMembersExcel partyMembers : partyList) { |
|
|
|
/*for (PartyMembersExcel partyMembers : partyList) { |
|
|
|
System.out.println("从Excel导入数据到数据库的详细为 :{}" + JSON.toJSONString(partyMembers)); |
|
|
|
} |
|
|
|
System.out.println("从Excel导入数据一共 {} 行 " + partyList.size()); |
|
|
|
System.out.println("从Excel导入数据一共 {} 行 " + partyList.size());*/ |
|
|
|
} catch (Exception e1) { |
|
|
|
throw new RuntimeException("导入失败:{}" + e1.getMessage()); |
|
|
|
} |
|
|
@ -366,34 +371,15 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@DataSource(value = DataSourceNames.FIRST) |
|
|
|
public List<PartyMembersDTO> exportHasMoudle(Map<String, Object> params) { |
|
|
|
checkParam(params); |
|
|
|
return baseDao.hasAuthenticationPartyPage(params); |
|
|
|
} |
|
|
|
|
|
|
|
params = trimParamValue(params); |
|
|
|
|
|
|
|
/*** |
|
|
|
* |
|
|
|
* @param params |
|
|
|
* @return void |
|
|
|
* @author qushutong |
|
|
|
* @date 2019/12/29 14:51 |
|
|
|
*/ |
|
|
|
private void checkParam(Map<String, Object> params) { |
|
|
|
String realName = (String) params.get("realName"); |
|
|
|
String mobile = (String) params.get("mobile"); |
|
|
|
String identityNo = (String) params.get("identityNo"); |
|
|
|
if (StringUtils.isNotBlank(realName)) { |
|
|
|
params.put("realName", realName.trim()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(mobile)) { |
|
|
|
params.put("mobile", mobile.trim()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(identityNo)) { |
|
|
|
params.put("identityNo", identityNo.trim()); |
|
|
|
} |
|
|
|
return baseDao.hasAuthenticationPartyPage(params); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Result upDataInfo(List<UserEntity> userEntities) { |
|
|
|
List<PartyMembersEntity> partyMembersEntityList = new ArrayList<>(); |
|
|
|