修改bug
This commit is contained in:
parent
e06b341023
commit
6a42f1c7c6
|
|
@ -6,10 +6,12 @@ import com.engine.salary.entity.hrm.PositionInfo;
|
|||
import com.engine.salary.entity.hrm.SubCompanyInfo;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
import com.engine.salary.mapper.datacollection.EmployMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EmployBiz extends BaseBean {
|
||||
|
|
@ -32,8 +34,13 @@ public class EmployBiz extends BaseBean {
|
|||
public List<DataCollectionEmployee> getEmployeeByIds(List<Long> list) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
List<DataCollectionEmployee> dataList = new ArrayList<>();
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getEmployeeByIds(list);
|
||||
List<List<Long>> partition = Lists.partition(list, 1000);
|
||||
for (List<Long> longs : partition) {
|
||||
dataList.addAll(mapper.getEmployeeByIds(longs));
|
||||
}
|
||||
return dataList;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
|
@ -43,8 +50,13 @@ public class EmployBiz extends BaseBean {
|
|||
public List<DataCollectionEmployee> getEmployeeByIdsAll(List<Long> list) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
List<DataCollectionEmployee> employeeList = new ArrayList<>();
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getEmployeeByIdsAll(list);
|
||||
List<List<Long>> partition = Lists.partition(list, 1000);
|
||||
for (List<Long> longs : partition) {
|
||||
employeeList.addAll(mapper.getEmployeeByIdsAll(longs));
|
||||
}
|
||||
return employeeList;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
|
@ -54,7 +66,12 @@ public class EmployBiz extends BaseBean {
|
|||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getAdminEmployeeByIds(list);
|
||||
List<DataCollectionEmployee> employeeList = Lists.newArrayList();
|
||||
List<List<Long>> partition = Lists.partition(list, 1000);
|
||||
for (List<Long> longs : partition) {
|
||||
employeeList.addAll(mapper.getAdminEmployeeByIds(longs));
|
||||
}
|
||||
return employeeList;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
|
|||
import com.engine.salary.service.RecordsBuildService;
|
||||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
|
@ -44,7 +45,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
return result;
|
||||
}
|
||||
List<Long> employeeIds = list.stream().map(item -> item.getEmployeeId()).collect(Collectors.toList());
|
||||
List<DataCollectionEmployee> employeeByIds = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(employeeIds);
|
||||
List<DataCollectionEmployee> employeeByIds = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
|
||||
for (List<Long> longs : partition) {
|
||||
employeeByIds.addAll(MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(longs));
|
||||
}
|
||||
if (CollectionUtils.isEmpty(employeeByIds)) {
|
||||
return result;
|
||||
}
|
||||
|
|
@ -187,7 +192,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
return result;
|
||||
}
|
||||
List<Long> employeeIds = list.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList());
|
||||
List<DataCollectionEmployee> employeeByIds = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(employeeIds);
|
||||
List<DataCollectionEmployee> employeeByIds = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
|
||||
for (List<Long> longs : partition) {
|
||||
employeeByIds.addAll(MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(longs));
|
||||
}
|
||||
if (CollectionUtils.isEmpty(employeeByIds)) {
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.engine.salary.service.SIArchivesService;
|
|||
import com.engine.salary.service.SIImportService;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelComment;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -129,8 +130,16 @@ public class SIImportServiceImpl extends Service implements SIImportService {
|
|||
}
|
||||
|
||||
// 3.表数据
|
||||
|
||||
// 4.注释
|
||||
List<ExcelComment> excelComments = Lists.newArrayList();
|
||||
excelComments.add(new ExcelComment(0, 0, 3, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
|
||||
excelComments.add(new ExcelComment(4, 0, 5, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
|
||||
excelComments.add(new ExcelComment(5, 0, 6, 2, SalaryI18nUtil.getI18nLabel(100344, "社保,公积金,其他福利方案名称不可同时为空")));
|
||||
|
||||
|
||||
//工作簿数据
|
||||
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName);
|
||||
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName,excelComments);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -145,9 +154,9 @@ public class SIImportServiceImpl extends Service implements SIImportService {
|
|||
result.add(SalaryI18nUtil.getI18nLabel( 86185, "部门"));
|
||||
result.add(SalaryI18nUtil.getI18nLabel( 86186, "手机号"));
|
||||
result.add(SalaryI18nUtil.getI18nLabel( 86187, "员工状态"));
|
||||
result.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"));
|
||||
result.add(SalaryI18nUtil.getI18nLabel( 91323, "社保方案名称"));
|
||||
// result.add(SalaryI18nUtil.getI18nLabel( 91325, "社保缴纳组织"));
|
||||
result.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"));
|
||||
//社保福利基数
|
||||
Map<String, Long> socialMap = welfareNameIdMap( WelfareTypeEnum.SOCIAL_SECURITY);
|
||||
socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数")));
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
|||
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
||||
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
||||
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
|
||||
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
||||
import com.engine.salary.service.SIImportService;
|
||||
import com.engine.salary.service.SISchemeService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
|
|
@ -86,6 +87,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
private InsuranceSchemeMapper getInsuranceSchemeMapper() {
|
||||
return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class);
|
||||
}
|
||||
private TaxAgentMapper getTaxAgentMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
|
||||
}
|
||||
|
||||
private ICategoryMapper getICategoryMapper() {
|
||||
return MapperProxyFactory.getProxy(ICategoryMapper.class);
|
||||
|
|
@ -201,6 +205,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
@Override
|
||||
public List<Map<String, Object>> buildTableData(List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS) {
|
||||
List<Map<String, Object>> records = new ArrayList<>();
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listAll();
|
||||
Map<Long, TaxAgentPO> longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId);
|
||||
List<Long> employeeIds = insuranceArchivesEmployeePOS.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(employeeIds)) {
|
||||
return records;
|
||||
|
|
@ -239,6 +245,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
map.put("departmentName", item.getDepartmentName());
|
||||
map.put("departmentId", item.getDepartmentId());
|
||||
map.put("jobNum", item.getJobNum());
|
||||
map.put("paymentOrganizationName", longTaxAgentPOMap.get(item.getPaymentOrganization()) != null ? longTaxAgentPOMap.get(item.getPaymentOrganization()).getName() : "");
|
||||
map.put("mobile", item.getTelephone());
|
||||
map.put("status", item.getUserStatus() == null ? "" : UserStatusEnum.getDefaultLabelByValue(item.getUserStatus()));
|
||||
if (socialItem != null) {
|
||||
|
|
@ -246,7 +253,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
Map<String, Object> socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
if (socialJson != null) {
|
||||
SalaryEntityUtil.thousandthConvert(socialJson, map);
|
||||
map.putAll(socialJson);
|
||||
// SalaryEntityUtil.thousandthConvert(socialJson, map);
|
||||
}
|
||||
map.put("socialAccount", socialItem.getSocialAccount());
|
||||
map.put("socialStartTime", socialItem.getSocialStartTime());
|
||||
|
|
@ -258,7 +266,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
Map<String, Object> fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
if (fundJson != null) {
|
||||
SalaryEntityUtil.thousandthConvert(fundJson, map);
|
||||
map.putAll(fundJson);
|
||||
// SalaryEntityUtil.thousandthConvert(fundJson, map);
|
||||
}
|
||||
map.put("supplementFundAccount", fundItem.getSupplementFundAccount());
|
||||
map.put("fundStartTime", fundItem.getFundStartTime());
|
||||
|
|
@ -270,7 +279,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
Map<String, Object> otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
if (otherJson != null) {
|
||||
SalaryEntityUtil.thousandthConvert(otherJson, map);
|
||||
map.putAll(otherJson);
|
||||
//SalaryEntityUtil.thousandthConvert(otherJson, map);
|
||||
}
|
||||
map.put("otherStartTime", otherItem.getOtherStartTime());
|
||||
map.put("otherEndTime", otherItem.getOtherEndTime());
|
||||
|
|
@ -399,6 +409,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName"));
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86186, "手机号"), "mobile"));
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86187, "员工状态"), "status"));
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(93910, "个税扣缴义务人"), "paymentOrganizationName"));
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"), "socialName"));
|
||||
titleMap.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k)));
|
||||
list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(91324, "社保账号"), "socialAccount"));
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.engine.salary.service.SalaryEmployeeService;
|
|||
import com.engine.salary.service.SalarySobRangeService;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -98,7 +99,12 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
if(CollectionUtils.isEmpty(simpleEmployeeIds)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return getEmployMapper().getEmployeeByIds(simpleEmployeeIds);
|
||||
List<DataCollectionEmployee> employeeList = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition(simpleEmployeeIds, 1000);
|
||||
for (List<Long> longs : partition) {
|
||||
employeeList.addAll(getEmployMapper().getEmployeeByIds(longs));
|
||||
}
|
||||
return employeeList;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue