人员信息报送增加模糊查询
This commit is contained in:
parent
229186e510
commit
3a9b772cb9
|
|
@ -110,4 +110,11 @@ public interface EmployMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DataCollectionEmployee> listByDismissDate(String dismissDate);
|
List<DataCollectionEmployee> listByDismissDate(String dismissDate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户名和工号模糊查询
|
||||||
|
* @param keyword
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataCollectionEmployee> listByKeyword(@Param("keyword") String keyword);
|
||||||
}
|
}
|
||||||
|
|
@ -446,4 +446,53 @@
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="listByKeyword" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
||||||
|
select e.id as employeeId,
|
||||||
|
e.lastname as username,
|
||||||
|
e.status as status,
|
||||||
|
e.certificatenum as idNo,
|
||||||
|
e.workcode as workcode,
|
||||||
|
e.companystartdate as companystartdate,
|
||||||
|
e.mobile as mobile,
|
||||||
|
e.enddate as dismissdate
|
||||||
|
from hrmresource e
|
||||||
|
where e.status not in (7)
|
||||||
|
<include refid="keywordParamSql"/>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<sql id="keywordParamSql">
|
||||||
|
<!-- 关键字(姓名、 -->
|
||||||
|
<if test="keyword != null and keyword != ''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
e.lastname like CONCAT('%',#{keyword},'%')
|
||||||
|
OR
|
||||||
|
e.workcode like CONCAT('%',#{keyword},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
<sql id="keywordParamSql" databaseId="oracle">
|
||||||
|
<if test="keyword != null and keyword != ''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
e.lastname like '%'||#{keyword}||'%'
|
||||||
|
OR
|
||||||
|
e.workcode like '%'||#{keyword}||'%'
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
<sql id="keywordParamSql" databaseId="sqlserver">
|
||||||
|
<if test="keyword != null and keyword != ''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
e.lastname like '%'+#{keyword}+'%'
|
||||||
|
OR
|
||||||
|
e.workcode like '%'+#{keyword}+'%'
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -86,4 +86,11 @@ public interface ExternalEmployeeMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Collection<DataCollectionEmployee> listAllForReport();
|
Collection<DataCollectionEmployee> listAllForReport();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据姓名、工号模糊查询
|
||||||
|
* @param keyword
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataCollectionEmployee> listByKeyword(@Param("keyword") String keyword);
|
||||||
}
|
}
|
||||||
|
|
@ -292,6 +292,52 @@
|
||||||
left join hrmdepartment d on e.department_id = d.id
|
left join hrmdepartment d on e.department_id = d.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="listByKeyword" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
||||||
|
select e.id as employeeId,
|
||||||
|
e.username as username,
|
||||||
|
e.status as status,
|
||||||
|
e.workcode as workcode,
|
||||||
|
e.companystartdate as companystartdate,
|
||||||
|
e.mobile as mobile,
|
||||||
|
e.department_id as departmentId,
|
||||||
|
e.subcompany_id as subcompanyid,
|
||||||
|
e.jobtitle_id as jobtitleId
|
||||||
|
from hrsa_external_employee e
|
||||||
|
where 1=1
|
||||||
|
<include refid="keywordParamSql"/>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<sql id="keywordParamSql">
|
||||||
|
<!-- 关键字(姓名、 -->
|
||||||
|
<if test="keyword != null and keyword != ''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
e.username like CONCAT('%',#{keyword},'%')
|
||||||
|
OR
|
||||||
|
e.workcode like CONCAT('%',#{keyword},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
<sql id="keywordParamSql" databaseId="oracle">
|
||||||
|
<if test="keyword != null and keyword != ''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
e.username like '%'||#{keyword}||'%'
|
||||||
|
OR
|
||||||
|
e.workcode like '%'||#{keyword}||'%'
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
<sql id="keywordParamSql" databaseId="sqlserver">
|
||||||
|
<if test="keyword != null and keyword != ''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
e.username like '%'+#{keyword}+'%'
|
||||||
|
OR
|
||||||
|
e.workcode like '%'+#{keyword}+'%'
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
<!-- 插入不为NULL的字段 -->
|
<!-- 插入不为NULL的字段 -->
|
||||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.extemp.po.ExtEmpPO">
|
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.extemp.po.ExtEmpPO">
|
||||||
|
|
|
||||||
|
|
@ -58,4 +58,6 @@ public interface ExtEmpService {
|
||||||
Map<String, Object> previewImportExtEmp(ExtEmpImportParam param);
|
Map<String, Object> previewImportExtEmp(ExtEmpImportParam param);
|
||||||
|
|
||||||
Map<String, Object> importExtEmp(ExtEmpImportParam param);
|
Map<String, Object> importExtEmp(ExtEmpImportParam param);
|
||||||
|
|
||||||
|
List<DataCollectionEmployee> listByKeyword(String keyword);
|
||||||
}
|
}
|
||||||
|
|
@ -133,4 +133,11 @@ public interface SalaryEmployeeService {
|
||||||
*/
|
*/
|
||||||
Map<Long, String> mapByEmployeeIds(Collection<Long> employeeIds);
|
Map<Long, String> mapByEmployeeIds(Collection<Long> employeeIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据姓名工号模糊查看
|
||||||
|
* @param keyword
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataCollectionEmployee> listByKeyword(String keyword);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public interface TaxDeclarationValueService {
|
||||||
* @param taxDeclarationIds
|
* @param taxDeclarationIds
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PageInfo<TaxDeclarationValuePO> listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection<Long> taxDeclarationIds);
|
PageInfo<TaxDeclarationValuePO> listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection<Long> taxDeclarationIds, String keyWord);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询个税申报表明细
|
* 查询个税申报表明细
|
||||||
|
|
|
||||||
|
|
@ -572,4 +572,12 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
|
||||||
resultPo.setModifier((long) user.getUID());
|
resultPo.setModifier((long) user.getUID());
|
||||||
return resultPo;
|
return resultPo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataCollectionEmployee> listByKeyword(String keyword) {
|
||||||
|
if (StringUtils.isBlank(keyword)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return getExternalEmployeeMapper().listByKeyword(keyword);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobRangePO;
|
import com.engine.salary.entity.salarysob.po.SalarySobRangePO;
|
||||||
import com.engine.salary.enums.UserStatusEnum;
|
import com.engine.salary.enums.UserStatusEnum;
|
||||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||||
|
import com.engine.salary.mapper.datacollection.EmployMapper;
|
||||||
import com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper;
|
import com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper;
|
||||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||||
import com.engine.salary.service.ExtEmpService;
|
import com.engine.salary.service.ExtEmpService;
|
||||||
|
|
@ -27,8 +28,8 @@ import com.engine.salary.service.SalarySobExtRangeService;
|
||||||
import com.engine.salary.service.SalarySobRangeService;
|
import com.engine.salary.service.SalarySobRangeService;
|
||||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||||
import com.engine.salary.util.SalaryEntityUtil;
|
import com.engine.salary.util.SalaryEntityUtil;
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.engine.salary.util.db.IdGenerator;
|
import com.engine.salary.util.db.IdGenerator;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -66,6 +67,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private EmployMapper getEmployMapper() {
|
||||||
|
return SqlProxyHandle.getProxy(EmployMapper.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private ExtEmpService getExtEmpService(User user) {
|
private ExtEmpService getExtEmpService(User user) {
|
||||||
return ServiceUtil.getService(ExtEmpServiceImpl.class, user);
|
return ServiceUtil.getService(ExtEmpServiceImpl.class, user);
|
||||||
}
|
}
|
||||||
|
|
@ -427,4 +433,16 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataCollectionEmployee> listByKeyword(String keyword) {
|
||||||
|
if (StringUtils.isBlank(keyword)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<DataCollectionEmployee> result = getEmployMapper().listByKeyword(keyword);
|
||||||
|
if (openExtEmp) {
|
||||||
|
result.addAll(getExtEmpService(user).listByKeyword(keyword));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ import com.google.common.collect.Maps;
|
||||||
import com.engine.salary.util.db.IdGenerator;
|
import com.engine.salary.util.db.IdGenerator;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import weaver.general.Util;
|
import weaver.general.Util;
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
|
@ -90,8 +91,14 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<TaxDeclarationValuePO> listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection<Long> taxDeclarationIds) {
|
public PageInfo<TaxDeclarationValuePO> listPageByTaxDeclarationIds(TaxDeclarationValueListQueryParam queryParam, Collection<Long> taxDeclarationIds, String keyword) {
|
||||||
List<TaxDeclarationValuePO> taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build());
|
List<TaxDeclarationValuePO> taxDeclarationValuePOS = getTaxDeclarationValueMapper().listSome(TaxDeclarationValuePO.builder().taxDeclarationIds(taxDeclarationIds).build());
|
||||||
|
// 根据关键词查人员信息
|
||||||
|
if (StringUtils.isNotBlank(keyword)) {
|
||||||
|
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByKeyword(keyword);
|
||||||
|
List<Long> empIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
||||||
|
taxDeclarationValuePOS = taxDeclarationValuePOS.stream().filter(po -> empIds.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
taxDeclarationValuePOS = decryptBatch(taxDeclarationValuePOS);
|
taxDeclarationValuePOS = decryptBatch(taxDeclarationValuePOS);
|
||||||
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclarationValuePOS, TaxDeclarationValuePO.class);
|
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), taxDeclarationValuePOS, TaxDeclarationValuePO.class);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "对不起,您暂时没有权限查看"));
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156515, "对不起,您暂时没有权限查看"));
|
||||||
}
|
}
|
||||||
// 查询个税申报表详情
|
// 查询个税申报表详情
|
||||||
PageInfo<TaxDeclarationValuePO> page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam, Collections.singleton(queryParam.getTaxDeclarationId()));
|
PageInfo<TaxDeclarationValuePO> page = getTaxDeclarationValueService(user).listPageByTaxDeclarationIds(queryParam, Collections.singleton(queryParam.getTaxDeclarationId()), queryParam.getKeyword());
|
||||||
TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclaration, page.getList());
|
TaxDeclarationValueListDTO taxDeclarationValueListDTO = getTaxDeclarationValueService(user).convert2List(taxDeclaration, page.getList());
|
||||||
PageInfo<Map<String, Object>> dtoPage = new PageInfo<>(
|
PageInfo<Map<String, Object>> dtoPage = new PageInfo<>(
|
||||||
page.getPageNum(),
|
page.getPageNum(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue