账套外部人员接入

This commit is contained in:
钱涛 2023-03-15 09:13:29 +08:00
parent 5f465aa914
commit 5b88cda35c
6 changed files with 44 additions and 30 deletions

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.taxagent.po;
import com.engine.salary.annotation.TableTitle;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -61,6 +62,7 @@ public class TaxAgentExtRangePO {
/**
* 名字
*/
@TableTitle(title = "姓名",key = "targetName",dataIndex = "targetName")
private String targetName;

View File

@ -240,10 +240,11 @@
<delete id="deleteByIds">
UPDATE hrsa_salary_sob_ext_range
SET delete_type=1
WHERE id IN and delete_type=0
WHERE id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
and delete_type=0
</delete>
</mapper>

View File

@ -95,26 +95,26 @@
,e.username as targetName
FROM hrsa_tax_agent_ext_range t
left join hrsa_external_employee e on t.target_id = e.id
WHERE delete_type = 0
WHERE t.delete_type = 0
<if test="id != null">
AND id = #{id}
AND t.id = #{id}
</if>
<if test="targetId != null">
AND target_id = #{targetId}
AND t.target_id = #{targetId}
</if>
<if test="targetType != null">
AND target_type = #{targetType}
AND t.target_type = #{targetType}
</if>
<if test="taxAgentId != null">
AND tax_agent_id = #{taxAgentId}
AND t.tax_agent_id = #{taxAgentId}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
AND t.id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
ORDER BY t.id DESC
</select>
<!-- 插入不为NULL的字段 -->

View File

@ -392,7 +392,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
}
Date now = new Date();
List<TaxAgentExtRangePO> oldPO = listExtByIds(targetIds);
List<TaxAgentExtRangePO> oldPO = listAllExtBytaxAgentId(taxAgentId);
List<Long> oldIds = SalaryEntityUtil.properties(oldPO, TaxAgentExtRangePO::getTargetId, Collectors.toList());
targetIds.stream().filter(targetId -> !oldIds.contains(targetId)).forEach(targetId -> {
TaxAgentExtRangePO po = TaxAgentExtRangePO.builder()
@ -422,9 +422,18 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
}
}
private List<TaxAgentExtRangePO> listAllExtBytaxAgentId(Long taxAgentId) {
if(taxAgentId ==null){
return new ArrayList<>();
}
return getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().taxAgentId(taxAgentId).build());
}
private List<TaxAgentExtRangePO> listExtByIds(Collection<Long> targetIds) {
List<TaxAgentExtRangePO> oldPO = getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().ids(targetIds).build());
return oldPO;
if(CollectionUtils.isEmpty(targetIds)){
return new ArrayList<>();
}
return getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().ids(targetIds).build());
}
@Override

View File

@ -194,22 +194,6 @@ public class SalarySobController {
return new ResponseResult<SalarySobRangeSaveParam, String>(user).run(getSalarySobRangeWrapper(user)::save, saveParam);
}
@POST
@Path("/ext/save")
@Produces(MediaType.APPLICATION_JSON)
public String saveSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeExtSaveParam saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySobRangeExtSaveParam, String>(user).run(getSalarySobRangeWrapper(user)::saveExtRange, saveParam);
}
@POST
@Path("/range/ext/list")
@Produces(MediaType.APPLICATION_JSON)
public String listPage4Ext(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeQueryParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySobRangeQueryParam, PageInfo<SalarySobExtRangePO>>(user).run(getSalarySobRangeWrapper(user)::listPage4Ext, queryParam);
}
/**
* 删除薪资账套人员范围
*/
@ -221,6 +205,24 @@ public class SalarySobController {
return new ResponseResult<Collection<Long>, String>(user).run(getSalarySobRangeWrapper(user)::delete, ids);
}
@POST
@Path("/range/ext/list")
@Produces(MediaType.APPLICATION_JSON)
public String listPage4Ext(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeQueryParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySobRangeQueryParam, PageInfo<SalarySobExtRangePO>>(user).run(getSalarySobRangeWrapper(user)::listPage4Ext, queryParam);
}
@POST
@Path("/ext/save")
@Produces(MediaType.APPLICATION_JSON)
public String saveSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeExtSaveParam saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySobRangeExtSaveParam, String>(user).run(getSalarySobRangeWrapper(user)::saveExtRange, saveParam);
}
/**
* 删除薪资账套人员范围
*/

View File

@ -79,7 +79,7 @@ public class SalarySobRangeWrapper extends Service {
getSalarySobRangeService(user).saveExtRange(saveParam);
}
public PageInfo<SalarySobExtRangePO> listPage4Ext(SalarySobRangeQueryParam param) {
public PageInfo<SalarySobExtRangePO> listPage4Ext(SalarySobRangeQueryParam param) {
return getSalarySobRangeService(user).listPage4Ext(param);
}
@ -107,8 +107,8 @@ public class SalarySobRangeWrapper extends Service {
}
/**
* @description 薪资账套人员范围导入预览
* @return void
* @description 薪资账套人员范围导入预览
* @author Harryxzy
* @date 2023/1/9 13:37
*/
@ -117,8 +117,8 @@ public class SalarySobRangeWrapper extends Service {
}
/**
* @return Map<String, Object>
* @description 导入薪资账套人员范围
* @return Map<String,Object>
* @author Harryxzy
* @date 2023/1/9 14:10
*/