Merge branch 'feature/通过扣缴义务人和uid获取人员档案' into release/2.6.2.2302.02
This commit is contained in:
commit
0337db02df
|
|
@ -30,9 +30,11 @@ public class SalaryArchiveQueryParam extends BaseQueryParam {
|
|||
|
||||
//姓名
|
||||
private String username;
|
||||
private Long employeeId;
|
||||
|
||||
//个税扣缴义务人id
|
||||
private Long taxAgentId;
|
||||
private String taxAgentName;
|
||||
|
||||
//分部id
|
||||
private List<Long> subcompanyIds;
|
||||
|
|
|
|||
|
|
@ -464,6 +464,9 @@
|
|||
FROM
|
||||
hrsa_salary_archive t
|
||||
WHERE t.delete_type = 0
|
||||
<if test="param.employeeId != null ">
|
||||
AND t.employee_id = #{param.employeeId}
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size()>0">
|
||||
AND t.employee_id IN
|
||||
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.engine.salary.process.salaryArchive;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveImportActionParam;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.wrapper.SalaryArchiveWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
|
|
@ -84,17 +86,13 @@ public class SalaryArchiveActionAPI {
|
|||
return new ResponseResult<SalaryArchiveImportActionParam, Map<String, Object>>(user).run(getSalaryArchiveWrapper(user)::adjustmentSalaryArchive, importData);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导入薪资档案附件上传前置校验
|
||||
// * @param importParam
|
||||
// * @return
|
||||
// */
|
||||
// @POST
|
||||
// @Path("/checkImportSalaryArchiveUpload")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String checkParam(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveImportHandleParam importParam) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<SalaryArchiveImportHandleParam, Map<String, Object>>(user).run(getSalaryArchiveWrapper(user)::checkImportSalaryArchive, importParam);
|
||||
// }
|
||||
@POST
|
||||
@Path("/salaryArchiveId")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String adjustmentSalaryArchive(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryArchiveQueryParam, SalaryArchivePO>(user).run(getSalaryArchiveWrapper(user)::getSalaryArchiveInfo, param);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
package com.engine.salary.process.salaryArchive;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SalaryArchiveCommon {
|
||||
|
||||
public static Map<String,Object> getImportDatas(String requestId,String tableName){
|
||||
RecordSet rs = new RecordSet();
|
||||
String sql = "select xzxmdr,xzxmpldr from "+tableName+" where requestid="+requestId;
|
||||
rs.executeQuery(sql);
|
||||
Map<String,Object> dataMap = Maps.newHashMap();
|
||||
List<Map<String, Object>> importDatas = Lists.newArrayList();
|
||||
dataMap.put("importDatas",importDatas);
|
||||
if (rs.next()){
|
||||
String data = rs.getString("xzxmdr");
|
||||
dataMap.put("imageId",rs.getString("xzxmpldr"));
|
||||
if (data != null && !"".equals(data)){
|
||||
if (data.contains(""")){
|
||||
data = data.replaceAll(""","\"");
|
||||
}
|
||||
JSONArray jsonObject = JSONObject.parseArray(data);
|
||||
jsonObject.forEach(e -> {
|
||||
Map<String, Object> map = (Map<String, Object>)e;
|
||||
importDatas.add(map);
|
||||
});
|
||||
}
|
||||
}
|
||||
String queryImageId = "select imagefileid from docimagefile where docid = ?";
|
||||
if (dataMap.get("imageId") != null && !"".equals(dataMap.get("imageId"))){
|
||||
rs.executeQuery(queryImageId,dataMap.get("imageId"));
|
||||
if (rs.next()){
|
||||
dataMap.put("imageId",rs.getString("imagefileid"));
|
||||
}
|
||||
}
|
||||
|
||||
return dataMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
//package com.engine.salary.process.salaryArchive;
|
||||
//
|
||||
//import com.engine.common.util.ServiceUtil;
|
||||
//import com.engine.salary.entity.salaryarchive.param.SalaryArchiveImportActionParam;
|
||||
//import com.engine.salary.entity.salaryarchive.param.SalaryArchiveImportHandleParam;
|
||||
//import com.engine.salary.service.SalaryArchiveService;
|
||||
//import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
//import weaver.general.BaseBean;
|
||||
//import weaver.hrm.User;
|
||||
//import weaver.interfaces.workflow.action.Action;
|
||||
//import weaver.soa.workflow.request.RequestInfo;
|
||||
//
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * 薪资档案流程使用,导入薪资档案(初始化)
|
||||
// * <p>Copyright: Copyright (c) 2022</p>
|
||||
// * <p>Company: 泛微软件</p>
|
||||
// *
|
||||
// * @author liuliang
|
||||
// * @version 1.0
|
||||
// **/
|
||||
//public class SalaryArchiveInitAction extends BaseBean implements Action {
|
||||
// private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
// return (SalaryArchiveService) ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
// }
|
||||
// @Override
|
||||
// public String execute(RequestInfo requestInfo) {
|
||||
// String requestId = requestInfo.getRequestid();
|
||||
// String tableName = requestInfo.getRequestManager().getBillTableName();
|
||||
// writeLog("requestId:"+requestId);
|
||||
// writeLog("tableName:"+tableName);
|
||||
// Map<String,Object> dataMap = SalaryArchiveCommon.getImportDatas(requestId,tableName);
|
||||
// List<Map<String, Object>> importDatas = (List<Map<String, Object>>)dataMap.get("importDatas");
|
||||
// String imageId = dataMap.get("imageId") == null?"":dataMap.get("imageId").toString();
|
||||
// User user = new User(Integer.valueOf(importDatas.get(0).get("userId").toString()));
|
||||
// //手动列表添加导入
|
||||
// if (importDatas.size() > 0){
|
||||
//
|
||||
// SalaryArchiveImportActionParam importData = SalaryArchiveImportActionParam.builder().importDatas(importDatas)
|
||||
// .importType("init").build();
|
||||
//
|
||||
// Map<String, Object> resultMap = getSalaryArchiveService(user).importSalaryArchiveAction(importData,true);
|
||||
// writeLog("result :"+resultMap.toString());
|
||||
// }
|
||||
// //附件上传导入
|
||||
// if (!"".equals(imageId)){
|
||||
// SalaryArchiveImportHandleParam param = SalaryArchiveImportHandleParam.builder().imageId(imageId).importType("init").build();
|
||||
// Map<String,Object> responseMap = getSalaryArchiveService(user).importSalaryArchive(param);
|
||||
// writeLog("result :"+responseMap.toString());
|
||||
// }
|
||||
//
|
||||
// return SUCCESS;
|
||||
// }
|
||||
//}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
//package com.engine.salary.process.salaryArchive;
|
||||
//
|
||||
//import com.engine.common.util.ServiceUtil;
|
||||
//import com.engine.salary.entity.salaryarchive.param.SalaryArchiveImportActionParam;
|
||||
//import com.engine.salary.entity.salaryarchive.param.SalaryArchiveImportHandleParam;
|
||||
//import com.engine.salary.service.SalaryArchiveService;
|
||||
//import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
//import weaver.general.BaseBean;
|
||||
//import weaver.hrm.User;
|
||||
//import weaver.interfaces.workflow.action.Action;
|
||||
//import weaver.soa.workflow.request.RequestInfo;
|
||||
//
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * 薪资档案流程使用,导入薪资档案(调薪)
|
||||
// * <p>Copyright: Copyright (c) 2022</p>
|
||||
// * <p>Company: 泛微软件</p>
|
||||
// *
|
||||
// * @author liuliang
|
||||
// * @version 1.0
|
||||
// **/
|
||||
//public class SalaryArchiveSalaryItemAdjustAction extends BaseBean implements Action {
|
||||
// private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
// return (SalaryArchiveService) ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
// }
|
||||
// @Override
|
||||
// public String execute(RequestInfo requestInfo) {
|
||||
// String requestId = requestInfo.getRequestid();
|
||||
// String tableName = requestInfo.getRequestManager().getBillTableName();
|
||||
// writeLog("requestId:"+requestId);
|
||||
// writeLog("tableName:"+tableName);
|
||||
// Map<String,Object> dataMap = SalaryArchiveCommon.getImportDatas(requestId,tableName);
|
||||
// List<Map<String, Object>> importDatas = (List<Map<String, Object>>)dataMap.get("importDatas");
|
||||
// String imageId = dataMap.get("imageId").toString();
|
||||
// User user = new User(Integer.valueOf(importDatas.get(0).get("userId").toString()));
|
||||
// if (importDatas.size() > 0){
|
||||
//
|
||||
// SalaryArchiveImportActionParam importData = SalaryArchiveImportActionParam.builder().importDatas(importDatas)
|
||||
// .importType("salaryItemAdjust").build();
|
||||
//
|
||||
// Map<String, Object> resultMap = getSalaryArchiveService(user).importSalaryArchiveAction(importData,true);
|
||||
// writeLog("result :"+resultMap.toString());
|
||||
// }
|
||||
// //附件上传导入
|
||||
// if (!"".equals(imageId)){
|
||||
// SalaryArchiveImportHandleParam param = SalaryArchiveImportHandleParam.builder().imageId(imageId).importType("salaryItemAdjust").build();
|
||||
// Map<String,Object> responseMap = getSalaryArchiveService(user).importSalaryArchive(param);
|
||||
// writeLog("result :"+responseMap.toString());
|
||||
// }
|
||||
// return SUCCESS;
|
||||
// }
|
||||
//}
|
||||
|
|
@ -626,8 +626,6 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<TaxAgentManageRangeEmployeeDTO> listTaxAgentAndEmployeeTree() {
|
||||
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeList = Lists.newArrayList();
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ public class SalaryArchiveWrapper extends Service {
|
|||
|
||||
// 获取所有可被引用的薪资项目
|
||||
List<SalaryItemPO> salaryItemList = getSalaryArchiveItemService(user).getCanAdjustSalaryItems()
|
||||
.stream().filter(item->getSalaryItemService(user).filterInRange(Collections.singleton(taxAgentId), item))
|
||||
.stream().filter(item -> getSalaryItemService(user).filterInRange(Collections.singleton(taxAgentId), item))
|
||||
.collect(Collectors.toList());
|
||||
Collection<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
List<SalaryArchiveItemPO> salaryArchiveItemList = getSalaryArchiveService(user).getCurrentEffectiveItemList(Collections.singletonList(salaryArchiveId), salaryItemIds);
|
||||
|
|
@ -548,4 +548,15 @@ public class SalaryArchiveWrapper extends Service {
|
|||
public Map<String, Object> handleRepeatData() {
|
||||
return getSalaryArchiveService(user).handleRepeatData();
|
||||
}
|
||||
|
||||
public SalaryArchivePO getSalaryArchiveInfo(SalaryArchiveQueryParam param) {
|
||||
List<SalaryArchivePO> list = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().employeeId(param.getEmployeeId()).taxAgentId(param.getTaxAgentId()).build());
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
throw new SalaryRunTimeException("薪资档案不存在!");
|
||||
}
|
||||
if (list.size() > 1) {
|
||||
throw new SalaryRunTimeException("存在多个薪资档案!");
|
||||
}
|
||||
return list.get(0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue