Merge remote-tracking branch 'remotes/origin/develop' into feature/checkImport
This commit is contained in:
commit
8eb769ee05
|
|
@ -97,12 +97,12 @@ public class SalaryArchiveBO {
|
|||
Date end = localDateRange.getEndDate();
|
||||
|
||||
List<SalaryArchiveDataDTO> list = new ArrayList<>();
|
||||
allEmployeeIds.forEach(e->{
|
||||
allEmployeeIds.forEach(e -> {
|
||||
// 同一个人的档案数据
|
||||
List<SalaryArchivePO> salaryArchives = salaryArchiveList.stream().filter(f->f.getEmployeeId().equals(e)).collect(Collectors.toList());
|
||||
List<SalaryArchivePO> salaryArchives = salaryArchiveList.stream().filter(f -> f.getEmployeeId().equals(e)).collect(Collectors.toList());
|
||||
List<Long> salaryArchiveIds = salaryArchives.stream().map(SalaryArchivePO::getId).collect(Collectors.toList());
|
||||
// 同一个人的薪资项目调整历史数据
|
||||
List<SalaryArchiveItemPO> salaryArchiveItems = salaryArchiveItemDataList.stream().filter(d->salaryArchiveIds.contains(d.getSalaryArchiveId())).collect(Collectors.toList());
|
||||
List<SalaryArchiveItemPO> salaryArchiveItems = salaryArchiveItemDataList.stream().filter(d -> salaryArchiveIds.contains(d.getSalaryArchiveId())).collect(Collectors.toList());
|
||||
List<Long> salaryArchiveItemIds = salaryArchiveItems.stream().map(SalaryArchiveItemPO::getSalaryItemId).distinct().collect(Collectors.toList());
|
||||
|
||||
SalaryArchiveDataDTO salaryArchiveData = new SalaryArchiveDataDTO();
|
||||
|
|
@ -118,7 +118,7 @@ public class SalaryArchiveBO {
|
|||
SalaryArchiveTaxAgentDataDTO taxAgent = new SalaryArchiveTaxAgentDataDTO();
|
||||
taxAgent.setTaxAgentId(salaryArchive.getTaxAgentId());
|
||||
// taxAgent.setIncomeCategory(salaryArchive.getIncomeCategory());
|
||||
taxAgent.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDate.before(start)?start:fromDate)).endDate(endDate == null || endDate.after(end)?end:endDate).build());
|
||||
taxAgent.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDate.before(start) ? start : fromDate)).endDate(endDate == null || endDate.after(end) ? end : endDate).build());
|
||||
// 薪资项目数据按个税扣缴义务人切割
|
||||
if (!isOnlyTaxAgent) {
|
||||
// 开始日期
|
||||
|
|
@ -133,11 +133,15 @@ public class SalaryArchiveBO {
|
|||
continue;
|
||||
}
|
||||
Date fromDateItem = salaryArchiveItem.getEffectiveTime();
|
||||
if (fromDateItem.after(endTempItem) || (!endTempItem.after(startItem) && !endTempItem.equals(startItem) ) ) {
|
||||
if (fromDateItem.after(endTempItem) || (!endTempItem.after(startItem) && !endTempItem.equals(startItem))) {
|
||||
continue;
|
||||
}
|
||||
SalaryArchiveItemDataDTO salaryArchiveItemData = new SalaryArchiveItemDataDTO();
|
||||
salaryArchiveItemData.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDateItem.before(startItem)?startItem:fromDateItem)).endDate(endTempItem).build());
|
||||
salaryArchiveItemData.setEffectiveDateRange(LocalDateRange.builder().fromDate((fromDateItem.before(startItem) ? startItem : fromDateItem)).endDate(endTempItem).build());
|
||||
//排除1号调薪,之前的历史周期为2022-01-01-2022-01-01这种情况
|
||||
if (!salaryArchiveItemData.getEffectiveDateRange().getFromDate().before(salaryArchiveItemData.getEffectiveDateRange().getEndDate())) {
|
||||
continue;
|
||||
}
|
||||
salaryArchiveItemData.setSalaryItemId(salaryArchiveItem.getSalaryItemId());
|
||||
salaryArchiveItemData.setValue(salaryArchiveItem.getItemValue());
|
||||
salaryItemValues.add(salaryArchiveItemData);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
ORDER BY order_weight DESC
|
||||
ORDER BY create_time,order_weight DESC
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.salary.sys.entity.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalarySysConfQueryParam extends BaseQueryParam {
|
||||
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
private String confKey;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private String confValue;
|
||||
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
private String module;
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package com.engine.salary.sys.entity.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalarySysQueryParam {
|
||||
|
||||
Collection<Long> ids;
|
||||
|
||||
/**
|
||||
* 生效时间
|
||||
*/
|
||||
private Date effectiveTime;
|
||||
|
||||
Collection<Long> salaryItemIds;
|
||||
|
||||
Collection<Long> salaryArchivesIds;
|
||||
|
||||
Collection<Long> employeeIds;
|
||||
|
||||
Long salaryArchiveId;
|
||||
|
||||
Long salaryItemId;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.sys.entity.po;
|
||||
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -18,14 +19,17 @@ public class SalarySysConfPO {
|
|||
/**
|
||||
* 标识
|
||||
*/
|
||||
@TableTitle(title = "标识", dataIndex = "confKey", key = "confKey")
|
||||
private String confKey;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@TableTitle(title = "值", dataIndex = "confValue", key = "confValue")
|
||||
private String confValue;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@TableTitle(title = "标题", dataIndex = "title", key = "title")
|
||||
private String title;
|
||||
/**
|
||||
* 所属模块
|
||||
|
|
@ -44,8 +48,12 @@ public class SalarySysConfPO {
|
|||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/** 创建时间 */
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/** 修改时间 */
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@ package com.engine.salary.sys.service;
|
|||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪酬系统配置类
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -23,4 +25,6 @@ public interface SalarySysConfService {
|
|||
boolean operateTaxDeclarationFunction(TaxDeclarationFunctionEnum flag);
|
||||
|
||||
SalarySysConfPO getOneByCode(String code);
|
||||
|
||||
List<SalarySysConfPO> listSome(SalarySysConfPO build);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.engine.salary.sys.service.SalarySysConfService;
|
|||
import dm.jdbc.util.IdGenerator;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪酬系统配置类
|
||||
|
|
@ -64,4 +65,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
public SalarySysConfPO getOneByCode(String code) {
|
||||
return getSalarySysConfMapper().getOneByCode(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySysConfPO> listSome(SalarySysConfPO po) {
|
||||
return getSalarySysConfMapper().listSome(po);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SalarySystemConfigWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -57,6 +60,7 @@ public class SalarySystemConfigController {
|
|||
|
||||
/**
|
||||
* 获取系统配置
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param code
|
||||
|
|
@ -70,5 +74,20 @@ public class SalarySystemConfigController {
|
|||
return new ResponseResult<String, String>(user).run(getSalarySystemConfigWrapper(user)::getOneByCode, code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统配置
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String info(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySysConfQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySysConfQueryParam, PageInfo<SalarySysConfPO>>(user).run(getSalarySystemConfigWrapper(user)::list, param);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,19 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -67,7 +70,15 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
public PageInfo<SalarySysConfPO> list() {
|
||||
return null;
|
||||
public PageInfo<SalarySysConfPO> list(SalarySysConfQueryParam param) {
|
||||
List<SalarySysConfPO> salarySysConfPOS = getSalarySysConfService(user).listSome(SalarySysConfPO.builder().build());
|
||||
|
||||
List<SalarySysConfPO> list = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), salarySysConfPOS);
|
||||
PageInfo<SalarySysConfPO> page = new PageInfo<>(list, SalarySysConfPO.class);
|
||||
|
||||
page.setTotal(salarySysConfPOS.size());
|
||||
page.setPageNum(param.getCurrent());
|
||||
page.setPageSize(param.getPageSize());
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue