调整原因
This commit is contained in:
parent
0fd2ddf78c
commit
90335032fd
|
|
@ -47,6 +47,16 @@ public class EmployBiz extends BaseBean {
|
|||
}
|
||||
}
|
||||
|
||||
public List<DataCollectionEmployee> getAdminEmployeeByIds(List<Long> list) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.getAdminEmployeeByIds(list);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 岗位信息
|
||||
|
|
|
|||
|
|
@ -6,17 +6,18 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 员工基本信息
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/2/10 16:25
|
||||
*/
|
||||
* 员工基本信息
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
////员工基本信息")
|
||||
public class DataCollectionEmployee {
|
||||
|
||||
//员工id
|
||||
|
|
|
|||
|
|
@ -1,60 +1,39 @@
|
|||
//package com.engine.salary.entity.salaryacct.dto;
|
||||
//
|
||||
//import com.weaver.common.component.form.item.WeaFormItemType;
|
||||
//import com.weaver.hrm.salary.annotation.SalaryForm;
|
||||
//import com.weaver.hrm.salary.annotation.SalaryFormItem;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//import lombok.experimental.Accessors;
|
||||
//
|
||||
///**
|
||||
// * @description: 薪资核算基本信息详情
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 12/6/21 9:32 AM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//@Accessors(chain = true)
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//@ApiModel("薪资核算基本信息")
|
||||
//public class SalaryAcctRecordFormDTO {
|
||||
//
|
||||
// @ApiModelProperty("主键id")
|
||||
// private Long id;
|
||||
//
|
||||
// @SalaryForm(
|
||||
// label = "薪资所属月",
|
||||
// labelId = 87614,
|
||||
// items = @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true)
|
||||
// )
|
||||
// @ApiModelProperty("薪资所属月")
|
||||
// private String salaryMonth;
|
||||
//
|
||||
// @ApiModelProperty("薪资账套id")
|
||||
// private Long salarySobId;
|
||||
//
|
||||
// @SalaryForm(
|
||||
// label = "核算账套",
|
||||
// labelId = 95824,
|
||||
// items = @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true)
|
||||
// )
|
||||
// @ApiModelProperty("薪资账套名称")
|
||||
// private String salarySobName;
|
||||
//
|
||||
// @SalaryForm(
|
||||
// label = "备注",
|
||||
// labelId = 84961,
|
||||
// items = @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "30")
|
||||
// )
|
||||
// @ApiModelProperty("备注")
|
||||
// private String description;
|
||||
//
|
||||
// @ApiModelProperty("周期提示信息")
|
||||
// private SalarySobCycleDTO cycleInfo;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 薪资核算基本信息详情
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryAcctRecordFormDTO {
|
||||
|
||||
private Long id;
|
||||
|
||||
//薪资所属月
|
||||
private String salaryMonth;
|
||||
|
||||
//薪资账套id
|
||||
private Long salarySobId;
|
||||
|
||||
//薪资账套名称
|
||||
private String salarySobName;
|
||||
|
||||
//备注
|
||||
private String description;
|
||||
|
||||
//周期提示信息
|
||||
private SalarySobCycleDTO cycleInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,6 @@ public interface EmployMapper {
|
|||
List<DataCollectionEmployee> getEmployeeByIdsAll(@Param("collection") List<Long> ids);
|
||||
|
||||
List<PositionInfo> listPositionInfo(@Param("collection") List<Long> ids);
|
||||
|
||||
List<DataCollectionEmployee> getAdminEmployeeByIds(@Param("collection") List<Long> list);
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
left join hrmdepartment d on e.departmentid = d.id
|
||||
left join hrmjobtitles c on e.jobtitle = c.id
|
||||
left join bill_hrmdismiss b on e.id = b.resource_n
|
||||
where 1 = 1
|
||||
where e.status not in (7)
|
||||
<if test="collection != null and collection.size()>0">
|
||||
AND e.id IN
|
||||
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -60,5 +60,18 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getAdminEmployeeByIds" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
||||
select e.id as employeeId,
|
||||
e.lastname as username
|
||||
from hrmresourcemanager e
|
||||
where e.status not in (7)
|
||||
<if test="collection != null and collection.size()>0">
|
||||
AND e.id IN
|
||||
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -105,11 +105,17 @@
|
|||
#{salarySobId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salaryMonths != null">
|
||||
AND (salary_month BETWEEN #{salaryMonths.fromDate} AND #{salaryMonths.endDate})
|
||||
<if test="salaryMonths != null and salaryMonths.fromDate != null">
|
||||
AND salary_month <![CDATA[ >= ]]> #{salaryMonths.fromDate}
|
||||
</if>
|
||||
<if test="taxCycleDateRange != null">
|
||||
AND (tax_cycle BETWEEN #{staxCycleDateRange.fromDate} AND #{taxCycleDateRange.endDate})
|
||||
<if test="salaryMonths != null and salaryMonths.endDate != null">
|
||||
AND salary_month <![CDATA[ <= ]]> #{salaryMonths.endDate})
|
||||
</if>
|
||||
<if test="taxCycleDateRange != null and taxCycleDateRange.fromDate != null">
|
||||
AND tax_cycle <![CDATA[ >= ]]> #{staxCycleDateRange.fromDate}
|
||||
</if>
|
||||
<if test="taxCycleDateRange != null and taxCycleDateRange.endDate != null">
|
||||
AND tax_cycle <![CDATA[ <= ]]> AND #{taxCycleDateRange.endDate})
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
|
@ -65,10 +67,9 @@ public interface SalaryAcctRecordService {
|
|||
* 根据列表查询条件查询薪资核算记录(分页)
|
||||
*
|
||||
* @param queryParam 列表查询条件
|
||||
* @param tenantKey 租户key
|
||||
* @return
|
||||
*/
|
||||
// Page<SalaryAcctRecordPO> listPageByParam(SalaryAcctRecordQueryParam queryParam);
|
||||
PageInfo<SalaryAcctRecordPO> listPageByParam(SalaryAcctRecordQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 根据id查询同一个账套上一个月的薪资核算记录
|
||||
|
|
@ -106,10 +107,9 @@ public interface SalaryAcctRecordService {
|
|||
* 保存
|
||||
*
|
||||
* @param saveParam 保存参数
|
||||
* @param employeeId 人员id
|
||||
* @return
|
||||
*/
|
||||
Long save(SalaryAcctRecordSaveParam saveParam, Long employeeId);
|
||||
Long save(SalaryAcctRecordSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 更新薪资核算记录的状态
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.service.impl;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
|
|
@ -21,7 +22,10 @@ import com.engine.salary.util.SalaryDateUtil;
|
|||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.SqlProxyHandle;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -99,34 +103,35 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
return salaryAcctRecordMapper.listSome(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Page<SalaryAcctRecordPO> listPageByParam(SalaryAcctRecordQueryParam queryParam, String tenantKey) {
|
||||
// // 分页参数
|
||||
// Page<SalaryAcctRecordPO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
// // 构建queryWrapper
|
||||
// LambdaQueryWrapper<SalaryAcctRecordPO> queryWrapper = Wrappers.lambdaQuery();
|
||||
// queryWrapper.eq(SalaryAcctRecordPO::getTenantKey, tenantKey);
|
||||
// queryWrapper.eq(SalaryAcctRecordPO::getDeleteType, 0);
|
||||
// if (StringUtils.isNotEmpty(queryParam.getName())) {
|
||||
// // 根据查询条件中的薪资账套名称查询薪资账套
|
||||
// List<SalarySobPO> salarySobPOS = salarySobService.listByNameLike(queryParam.getName(), tenantKey);
|
||||
// if (CollectionUtils.isEmpty(salarySobPOS)) {
|
||||
// return page;
|
||||
// }
|
||||
// // 过滤薪资账套
|
||||
// Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
|
||||
// queryWrapper.in(SalaryAcctRecordPO::getSalarySobId, salarySobIds);
|
||||
// }
|
||||
// if (Objects.nonNull(queryParam.getStartMonth())) {
|
||||
// queryWrapper.ge(SalaryAcctRecordPO::getSalaryMonth, queryParam.getStartMonth().atDay(1));
|
||||
// }
|
||||
// if (Objects.nonNull(queryParam.getEndMonth())) {
|
||||
// queryWrapper.le(SalaryAcctRecordPO::getSalaryMonth, queryParam.getEndMonth().atEndOfMonth());
|
||||
// }
|
||||
// queryWrapper.orderByDesc(SalaryAcctRecordPO::getId);
|
||||
// // 查询薪资核算记录
|
||||
// return salaryAcctRecordMapper.selectPage(page, queryWrapper);
|
||||
// }
|
||||
@Override
|
||||
public PageInfo<SalaryAcctRecordPO> listPageByParam(SalaryAcctRecordQueryParam queryParam) {
|
||||
SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class);
|
||||
// 分页参数
|
||||
// 构建queryWrapper
|
||||
SalaryAcctRecordPO po = SalaryAcctRecordPO.builder().build();
|
||||
PageInfo<SalaryAcctRecordPO> page = new PageInfo<>();
|
||||
if (StringUtils.isNotEmpty(queryParam.getName())) {
|
||||
// 根据查询条件中的薪资账套名称查询薪资账套
|
||||
List<SalarySobPO> salarySobPOS = salarySobService.listByNameLike(queryParam.getName());
|
||||
if (CollectionUtils.isEmpty(salarySobPOS)) {
|
||||
return page;
|
||||
}
|
||||
// 过滤薪资账套
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
|
||||
po.setSalarySobIds(salarySobIds);
|
||||
}
|
||||
if (Objects.nonNull(queryParam.getStartMonth())) {
|
||||
po.setSalaryMonths(LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(queryParam.getStartMonth().atDay(1))).build());
|
||||
}
|
||||
if (Objects.nonNull(queryParam.getEndMonth())) {
|
||||
po.setSalaryMonths(LocalDateRange.builder().endDate(SalaryDateUtil.localDateToDate(queryParam.getEndMonth().atEndOfMonth())).build());
|
||||
}
|
||||
// 查询薪资核算记录
|
||||
PageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = salaryAcctRecordMapper.listSome(po);
|
||||
page.setList(salaryAcctRecordPOS);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctRecordPO> listById4LastSalaryMonth(Long id) {
|
||||
|
|
@ -188,7 +193,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
}
|
||||
|
||||
@Override
|
||||
public Long save(SalaryAcctRecordSaveParam saveParam, Long employeeId) {
|
||||
public Long save(SalaryAcctRecordSaveParam saveParam) {
|
||||
// 薪资所属月所在年的日期范围(第一天~最后一天)
|
||||
LocalDateRange yearRange = SalaryDateUtil.localDate2YearRange(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)));
|
||||
if (Objects.isNull(yearRange)) {
|
||||
|
|
@ -237,7 +242,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
// 查询税款所属期
|
||||
SalarySobCycleDTO salarySobCycleDTO = salarySobService.getSalarySobCycle(saveParam.getSalarySobId(), saveParam.getSalaryMonth());
|
||||
// 转换成po
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = SalaryAcctRecordBO.convert2PO(saveParam, salarySobCycleDTO, (int) acctTimes, employeeId);
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = SalaryAcctRecordBO.convert2PO(saveParam, salarySobCycleDTO, (int) acctTimes, (long)user.getUID());
|
||||
// 保存薪资核算记录
|
||||
SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class);
|
||||
salaryAcctRecordMapper.insertIgnoreNull(salaryAcctRecordPO);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,21 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordFormDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SalaryAcctRecordWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
* 薪资核算
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -10,7 +26,11 @@ package com.engine.salary.web;
|
|||
**/
|
||||
public class SalaryAcctController {
|
||||
|
||||
// private SalaryAcctRecordWrapper salaryAcctRecordWrapper;
|
||||
private SalaryAcctRecordWrapper salaryAcctRecordWrapper;
|
||||
|
||||
private SalaryAcctRecordWrapper getSalaryAcctRecordWrapper(User user) {
|
||||
return (SalaryAcctRecordWrapper) ServiceUtil.getService(SalaryAcctRecordWrapper.class, user);
|
||||
}
|
||||
// private SalaryAcctEmployeeWrapper salaryAcctEmployeeWrapper;
|
||||
// private SalaryAcctResultWrapper salaryAcctResultWrapper;
|
||||
// private SalaryAcctCheckResultWrapper salaryAcctCheckResultWrapper;
|
||||
|
|
@ -20,22 +40,25 @@ public class SalaryAcctController {
|
|||
// private SalaryBatchService salaryBatchService;
|
||||
//
|
||||
// /**********************************薪资核算记录相关 start*********************************/
|
||||
//
|
||||
// @PostMapping("/list")
|
||||
// @ApiOperation("薪资核算列表")
|
||||
// @WeaPermission
|
||||
// public WeaResult<WeaTable<SalaryAcctRecordListDTO>> listSalaryAccounting(@RequestBody @Validated SalaryAcctRecordQueryParam queryParam) {
|
||||
// WeaTable<SalaryAcctRecordListDTO> weaTable = salaryAcctRecordWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(weaTable);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/getForm")
|
||||
// @ApiOperation("薪资核算详情")
|
||||
// @WeaPermission
|
||||
// public WeaResult<WeaForm> getForm(@RequestParam(value = "id", required = false) Long id) {
|
||||
// WeaForm weaForm = salaryAcctRecordWrapper.getForm(id, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(weaForm);
|
||||
// }
|
||||
|
||||
//薪资核算列表
|
||||
@POST
|
||||
@Path("/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctRecordQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctRecordQueryParam, PageInfo>().run(getSalaryAcctRecordWrapper(user)::listPage, queryParam);
|
||||
}
|
||||
|
||||
//薪资核算详情
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, SalaryAcctRecordFormDTO>().run(getSalaryAcctRecordWrapper(user)::getForm, id);
|
||||
}
|
||||
|
||||
//
|
||||
// @GetMapping("/getSalarySobCycle")
|
||||
// @ApiOperation(("获取薪资核算的薪资周期、考勤周期等"))
|
||||
|
|
|
|||
|
|
@ -1,72 +1,82 @@
|
|||
//package com.engine.salary.wrapper;
|
||||
//
|
||||
//import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
//import com.engine.core.impl.Service;
|
||||
//import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordListDTO;
|
||||
//import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
||||
//import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
//import com.engine.salary.service.SalaryAcctEmployeeService;
|
||||
//import com.engine.salary.service.SalaryAcctRecordService;
|
||||
//import com.engine.salary.service.SalarySobService;
|
||||
//import com.weaver.common.component.form.WeaForm;
|
||||
//import com.weaver.common.component.form.item.WeaFormOption;
|
||||
//import com.weaver.common.component.table.page.Page;
|
||||
//import com.weaver.common.component.table.permission.Permission;
|
||||
//import com.weaver.common.hrm.cache.HrmEmployeeComInfo;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryAcctRecordFormDTO;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobPO;
|
||||
//import com.weaver.hrm.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
//import com.weaver.hrm.salary.exception.SalaryRunTimeException;
|
||||
//import com.weaver.hrm.salary.util.SalaryDateUtil;
|
||||
//import com.weaver.hrm.salary.util.SalaryEntityUtil;
|
||||
//import com.weaver.hrm.salary.util.SalaryFormatUtil;
|
||||
//import com.weaver.hrm.salary.util.SalaryI18nUtil;
|
||||
//import org.apache.commons.collections4.CollectionUtils;
|
||||
//import org.apache.commons.lang3.math.NumberUtils;
|
||||
//
|
||||
//import java.util.*;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * 薪资核算记录
|
||||
// * <p>Copyright: Copyright (c) 2022</p>
|
||||
// * <p>Company: 泛微软件</p>
|
||||
// *
|
||||
// * @author qiantao
|
||||
// * @version 1.0
|
||||
// **/
|
||||
//public class SalaryAcctRecordWrapper extends Service {
|
||||
//
|
||||
// private SalaryAcctRecordService salaryAcctRecordService;
|
||||
// private SalarySobService salarySobService;
|
||||
// private SalaryAcctEmployeeService salaryAcctEmployeeService;
|
||||
//// private ComInfoCache comInfoCache;
|
||||
//
|
||||
// public WeaTable<SalaryAcctRecordListDTO> listPage(SalaryAcctRecordQueryParam queryParam) {
|
||||
// // 查询薪资核算记录(分页)
|
||||
// Page<SalaryAcctRecordPO> page = salaryAcctRecordService.listPageByParam(queryParam);
|
||||
// Page<SalaryAcctRecordListDTO> dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount());
|
||||
// if (CollectionUtils.isNotEmpty(page.getRecords())) {
|
||||
// // 查询薪资账套
|
||||
// Set<Long> salarySobIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getSalarySobId);
|
||||
// List<SalarySobPO> salarySobPOS = salarySobService.listByIds(salarySobIds, tenantKey);
|
||||
// // 查询薪资核算记录的创建人员的人员信息
|
||||
// List<Object> employeeIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getCreator, Collectors.toList());
|
||||
// List<HrmEmployeeComInfo> employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, employeeIds);
|
||||
// // 查询薪资核算人数的数量
|
||||
// Set<Long> salaryAcctRecordIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getId);
|
||||
// List<SalaryAcctEmployeeCountDTO> salaryAcctEmployeeCountDTOS = salaryAcctEmployeeService.countBySalaryAcctRecordId(salaryAcctRecordIds, tenantKey);
|
||||
// // 转换成列表dto
|
||||
// List<SalaryAcctRecordListDTO> salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(page.getRecords(), salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS);
|
||||
// dtoPage.setRecords(salaryAcctRecordListDTOS);
|
||||
// }
|
||||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.EmployBiz;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordFormDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordListDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.SalaryAcctEmployeeService;
|
||||
import com.engine.salary.service.SalaryAcctRecordService;
|
||||
import com.engine.salary.service.SalarySobService;
|
||||
import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl;
|
||||
import com.engine.salary.service.impl.SalarySobServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 薪资核算记录
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryAcctRecordWrapper extends Service {
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return (SalaryAcctRecordService) ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return (SalarySobService) ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
private SalaryAcctEmployeeService salaryAcctEmployeeService;
|
||||
// private ComInfoCache comInfoCache;
|
||||
|
||||
public PageInfo listPage(SalaryAcctRecordQueryParam queryParam) {
|
||||
EmployBiz employBiz = new EmployBiz();
|
||||
// 查询薪资核算记录(分页)
|
||||
PageInfo<SalaryAcctRecordPO> page = getSalaryAcctRecordService(user).listPageByParam(queryParam);
|
||||
PageInfo<SalaryAcctRecordListDTO> dtoPage = new PageInfo<SalaryAcctRecordListDTO>();
|
||||
dtoPage.setPageNum(queryParam.getCurrent());
|
||||
dtoPage.setPageSize(queryParam.getPageSize());
|
||||
List<SalaryAcctRecordPO> list = page.getList();
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 查询薪资账套
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getSalarySobId);
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByIds(salarySobIds);
|
||||
// 查询薪资核算记录的创建人员的人员信息
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getCreator, Collectors.toList());
|
||||
List<DataCollectionEmployee> employeeComInfos = employBiz.getEmployeeByIdsAll(employeeIds);
|
||||
// 查询薪资核算人数的数量
|
||||
Set<Long> salaryAcctRecordIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getId);
|
||||
List<SalaryAcctEmployeeCountDTO> salaryAcctEmployeeCountDTOS = salaryAcctEmployeeService.countBySalaryAcctRecordId(salaryAcctRecordIds);
|
||||
// 转换成列表dto
|
||||
List<SalaryAcctRecordListDTO> salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(list, salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS);
|
||||
dtoPage.setList(salaryAcctRecordListDTOS);
|
||||
}
|
||||
// WeaTable<SalaryAcctRecordListDTO> weaTable = SalaryFormatUtil.<SalaryAcctRecordListDTO>getInstance().buildTable(SalaryAcctRecordListDTO.class, dtoPage);
|
||||
// // 只有未归档时可以"核算"、"删除"、"归档"
|
||||
// // 归档后、申报后可以"查看"、"重新核算"
|
||||
// 只有未归档时可以"核算"、"删除"、"归档"
|
||||
// 归档后、申报后可以"查看"、"重新核算"
|
||||
// for (int i = 0; i < page.getRecords().size(); i++) {
|
||||
// SalaryAcctRecordPO salaryAcctRecord = page.getRecords().get(i);
|
||||
// List<Permission> permissions = weaTable.getOperatesPermission().get(i);
|
||||
|
|
@ -82,121 +92,97 @@
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
// return weaTable;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算记录详情
|
||||
// *
|
||||
// * @param id 薪资核算记录id
|
||||
// * @param tenantKey 租户key
|
||||
// * @return
|
||||
// */
|
||||
// public WeaForm getForm(Long id, String tenantKey) {
|
||||
// SalaryAcctRecordFormDTO formDTO = new SalaryAcctRecordFormDTO();
|
||||
// // 查询所有启用的薪资账套
|
||||
// List<SalarySobPO> salarySobPOS = salarySobService.listByDisable(NumberUtils.INTEGER_ZERO, tenantKey);
|
||||
// // 薪资核算详情表单中"薪资账套"的下拉选择项
|
||||
// List<WeaFormOption> weaFormOptions = CollectionUtils.emptyIfNull(salarySobPOS).stream()
|
||||
// .map(salarySobPO -> new WeaFormOption("" + salarySobPO.getId(), salarySobPO.getName()))
|
||||
// .collect(Collectors.toList());
|
||||
// if (Objects.nonNull(id)) {
|
||||
// // 查询薪资核算
|
||||
// SalaryAcctRecordPO salaryAcctRecordPO = salaryAcctRecordService.getById(id, tenantKey);
|
||||
// if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
// }
|
||||
// // 查询薪资账套
|
||||
// SalarySobPO salarySobPO = salarySobService.getById(salaryAcctRecordPO.getSalarySobId(), tenantKey);
|
||||
// if (Objects.isNull(salarySobPO)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98769, "薪资账套不存在或已被删除"));
|
||||
// }
|
||||
// // 转换成薪资核算记录详情dto
|
||||
// formDTO.setId(salaryAcctRecordPO.getId())
|
||||
// .setSalarySobId(salarySobPO.getId())
|
||||
// .setSalarySobName(salarySobPO.getName())
|
||||
// .setSalaryMonth(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString())
|
||||
// .setDescription(salaryAcctRecordPO.getDescription());
|
||||
// }
|
||||
// // 转换成前端所需的数据格式
|
||||
// WeaForm weaForm = SalaryFormatUtil.<SalaryAcctRecordFormDTO>getInstance().buildForm(SalaryAcctRecordFormDTO.class, formDTO);
|
||||
// weaForm.getItems().forEach((k, v) -> {
|
||||
// if (Objects.equals(k, "salarySobName")) {
|
||||
// v.setOptions(weaFormOptions);
|
||||
// }
|
||||
// // 薪资核算详情表单的薪资所属月只选择年月
|
||||
// if (Objects.equals(k, "salaryMonth")) {
|
||||
// Map<String, Object> otherParams = new HashMap<>();
|
||||
// otherParams.put("type", "month");
|
||||
// v.setOtherParams(otherParams);
|
||||
// }
|
||||
// });
|
||||
// return weaForm;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算记录所用的薪资账套薪资周期、考勤周期……
|
||||
// *
|
||||
// * @param id 薪资核算记录的id
|
||||
// * @param tenantKey 租户key
|
||||
// * @return
|
||||
// */
|
||||
// public SalarySobCycleDTO getSalarySobCycleById(Long id, String tenantKey) {
|
||||
// return salaryAcctRecordService.getSalarySobCycleById(id, tenantKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 保存
|
||||
// *
|
||||
// * @param saveParam 保存参数
|
||||
// * @param employeeId 人员id
|
||||
// * @param tenantKey 租户key
|
||||
// * @return
|
||||
// */
|
||||
// public Long save(SalaryAcctRecordSaveParam saveParam, Long employeeId, String tenantKey) {
|
||||
// return salaryAcctRecordService.save(saveParam, employeeId, tenantKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除
|
||||
// *
|
||||
// * @param ids 薪资核算记录的id
|
||||
// * @param tenantKey 租户key
|
||||
// */
|
||||
// public void delete(Collection<Long> ids, String tenantKey) {
|
||||
// salaryAcctRecordService.deleteByIds(ids, tenantKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 归档
|
||||
// *
|
||||
// * @param id 薪资核算记录的id
|
||||
// * @param employeeId 人员id
|
||||
// * @param tenantKey 租户key
|
||||
// */
|
||||
// public void file(Long id, Long employeeId, String tenantKey) {
|
||||
// salaryAcctRecordService.file(id, employeeId, tenantKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 重新归档
|
||||
// *
|
||||
// * @param id 薪资核算记录的id
|
||||
// * @param employeeId 人员id
|
||||
// * @param tenantKey 租户key
|
||||
// */
|
||||
// public void reCalculate(Long id, Long employeeId, String tenantKey) {
|
||||
// salaryAcctRecordService.reCalculate(id, employeeId, tenantKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 判断是否存在合并计税
|
||||
// *
|
||||
// * @param id 主键id
|
||||
// * @param tenantKey 租户key
|
||||
// * @return
|
||||
// */
|
||||
// public Integer hasConsolidatedTax(Long id, String tenantKey) {
|
||||
// return salaryAcctRecordService.hasConsolidatedTax(id, tenantKey);
|
||||
// }
|
||||
//}
|
||||
return dtoPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算记录详情
|
||||
*
|
||||
* @param id 薪资核算记录id
|
||||
* @return
|
||||
*/
|
||||
public SalaryAcctRecordFormDTO getForm(Long id) {
|
||||
SalaryAcctRecordFormDTO formDTO = new SalaryAcctRecordFormDTO();
|
||||
// 查询所有启用的薪资账套
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByDisable(NumberUtils.INTEGER_ZERO);
|
||||
// 薪资核算详情表单中"薪资账套"的下拉选择项
|
||||
|
||||
if (Objects.nonNull(id)) {
|
||||
// 查询薪资核算
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(id);
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
// 查询薪资账套
|
||||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId());
|
||||
if (Objects.isNull(salarySobPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98769, "薪资账套不存在或已被删除"));
|
||||
}
|
||||
// 转换成薪资核算记录详情dto
|
||||
formDTO.setId(salaryAcctRecordPO.getId())
|
||||
.setSalarySobId(salarySobPO.getId())
|
||||
.setSalarySobName(salarySobPO.getName())
|
||||
.setSalaryMonth(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString())
|
||||
.setDescription(salaryAcctRecordPO.getDescription());
|
||||
}
|
||||
// 转换成前端所需的数据格式
|
||||
return formDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算记录所用的薪资账套薪资周期、考勤周期……
|
||||
*
|
||||
* @param id 薪资核算记录的id
|
||||
* @return
|
||||
*/
|
||||
public SalarySobCycleDTO getSalarySobCycleById(Long id) {
|
||||
return getSalaryAcctRecordService(user).getSalarySobCycleById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param saveParam 保存参数
|
||||
* @return
|
||||
*/
|
||||
public Long save(SalaryAcctRecordSaveParam saveParam) {
|
||||
return getSalaryAcctRecordService(user).save(saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param ids 薪资核算记录的id
|
||||
*/
|
||||
public void delete(Collection<Long> ids) {
|
||||
getSalaryAcctRecordService(user).deleteByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 归档
|
||||
*
|
||||
* @param id 薪资核算记录的id
|
||||
*/
|
||||
public void file(Long id, Long employeeId) {
|
||||
getSalaryAcctRecordService(user).file(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新归档
|
||||
*
|
||||
* @param id 薪资核算记录的id
|
||||
*/
|
||||
public void reCalculate(Long id) {
|
||||
getSalaryAcctRecordService(user).reCalculate(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否存在合并计税
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return
|
||||
*/
|
||||
public Integer hasConsolidatedTax(Long id) {
|
||||
return getSalaryAcctRecordService(user).hasConsolidatedTax(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ public class SalaryArchiveTaxAgentWrapper extends Service {
|
|||
map.put("effectiveTime", effectiveTime);
|
||||
map.put("adjustBefore", adjustBefore);
|
||||
map.put("adjustAfter", adjustAfter);
|
||||
map.put("adjustReason", adjustReason);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue