薪资回算,薪资账套中薪资回算项目展示
This commit is contained in:
parent
94f3c9720a
commit
1e307e2f87
|
|
@ -0,0 +1,52 @@
|
|||
package com.engine.salary.entity.salarysob.dto;
|
||||
|
||||
import com.engine.salary.enums.SalaryRoundingModeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @date 2022/11/16 14:42
|
||||
* @description 薪资账套下的回算薪资项目详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalarySobBackItemFormDTO {
|
||||
|
||||
// 主键id
|
||||
private Long id;
|
||||
|
||||
// 薪资项目
|
||||
private List<Map<String, Object>> salaryItem;
|
||||
|
||||
// 字段类型
|
||||
private SalaryDataTypeEnum dataType;
|
||||
|
||||
// 舍入规则
|
||||
private SalaryRoundingModeEnum roundingMode;
|
||||
|
||||
// 保留小数位
|
||||
private String pattern;
|
||||
|
||||
// 取值方式
|
||||
private SalaryValueTypeEnum valueType;
|
||||
|
||||
// 公式id
|
||||
private Long formulaId;
|
||||
|
||||
// 公式内容
|
||||
private String formulaContent;
|
||||
|
||||
// 个税申报表对应字段
|
||||
private String taxDeclarationColumn;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.engine.salary.entity.salarysob.param;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @date 2022/11/16 15:14
|
||||
* @description 薪资项目回算项目保存参数
|
||||
*/
|
||||
public class SalarySobBackItemSaveParam {
|
||||
// @ApiModelProperty("主键id")
|
||||
// @NotNull(message = "主键id不允许为空")
|
||||
// @JsonSerialize(using = ToStringSerializer.class)
|
||||
// private Long id;
|
||||
//
|
||||
// @NotNull(message = "薪资账套id不允许为空")
|
||||
// @ApiModelProperty("薪资账套id")
|
||||
// private Long salarySobId;
|
||||
//
|
||||
// @NotNull(message = "薪资项目id不允许为空")
|
||||
// @ApiModelProperty("薪资项目")
|
||||
// private Long salaryItemId;
|
||||
//
|
||||
// @ApiModelProperty("字段类型")
|
||||
// @NotNull(message = "LABEL:105096")
|
||||
// private SalaryDataTypeEnum dataType;
|
||||
//
|
||||
// @ApiModelProperty("舍入规则")
|
||||
// private SalaryRoundingModeEnum roundingMode;
|
||||
//
|
||||
// @ApiModelProperty("保留小数位")
|
||||
// @Max(value = 5, message = "LABEL:85611")
|
||||
// private Integer pattern;
|
||||
//
|
||||
// @ApiModelProperty("取值方式")
|
||||
// @NotNull(message = "LABEL:85612")
|
||||
// private SalaryValueTypeEnum valueType;
|
||||
//
|
||||
// @ApiModelProperty("公式")
|
||||
// private Long formulaId;
|
||||
//
|
||||
// @ApiModelProperty("备注")
|
||||
// private String description;
|
||||
}
|
||||
|
|
@ -20,4 +20,12 @@ public interface SalarySobBackItemService {
|
|||
List<SalarySobBackItemPO> listBySalarySobId(Long salarySobId);
|
||||
|
||||
void batchInsert(List<SalarySobBackItemPO> needInsertSalarySobBackItems);
|
||||
|
||||
/**
|
||||
* @description 获取薪资回算项目
|
||||
* @return SalarySobBackItemPO
|
||||
* @author Harryxzy
|
||||
* @date 2022/11/16 14:36
|
||||
*/
|
||||
SalarySobBackItemPO getById(Long salarySobBackItemId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,4 +29,9 @@ public class SalarySobBackItemServiceImpl extends Service implements SalarySobBa
|
|||
getSalarySobBackItemMapper().batchInsert(needInsertSalarySobBackItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalarySobBackItemPO getById(Long salarySobBackItemId) {
|
||||
return getSalarySobBackItemMapper().getById(salarySobBackItemId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,19 +303,24 @@ public class SalarySobController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalarySobBackItemForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value ="id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long,SalarySobBackItemAggregateDTO>(user).run(getSalarySobBackItemWrapper(user)::getAggregate, id);
|
||||
// WeaForm weaForm = salarySobBackItemWrapper.getForm(id, TenantContext.getCurrentTenantKey());
|
||||
return new ResponseResult<Long,SalarySobBackItemFormDTO>(user).run(getSalarySobBackItemWrapper(user)::getForm, id);
|
||||
|
||||
}
|
||||
|
||||
// @POST
|
||||
// @Path("/backitem/save")
|
||||
// @ApiOperation("保存薪资账套回算项目")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String saveSalarySobBackItem(@RequestBody @Validated SalarySobBackItemSaveParam saveParam) {
|
||||
// List<SalarySobBackItemDTO> dtos = salarySobBackItemWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(dtos);
|
||||
// }
|
||||
/**
|
||||
* @description 保存薪资账套回算项目
|
||||
* @return String
|
||||
* @author Harryxzy
|
||||
* @date 2022/11/16 15:05
|
||||
*/
|
||||
@POST
|
||||
@Path("/backitem/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSalarySobBackItem(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalarySobBackItemSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<SalarySobBackItemSaveParam,List<SalarySobBackItemDTO>>(user).run(getSalarySobBackItemWrapper(user)::save, saveParam);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**********************************薪资账套的回算项目 end*********************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -3,16 +3,25 @@ package com.engine.salary.wrapper;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryitem.bo.SalaryItemBO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobBackItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobBackItemFormDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
|
||||
import com.engine.salary.enums.SalaryRoundingModeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.service.SalaryFormulaService;
|
||||
import com.engine.salary.service.SalaryItemService;
|
||||
import com.engine.salary.service.SalarySobBackItemService;
|
||||
import com.engine.salary.service.SysSalaryItemService;
|
||||
import com.engine.salary.service.impl.SalaryFormulaServiceImpl;
|
||||
import com.engine.salary.service.impl.SalaryItemServiceImpl;
|
||||
import com.engine.salary.service.impl.SalarySobBackItemServiceImpl;
|
||||
import com.engine.salary.service.impl.SysSalaryItemServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.wbi.util.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -37,6 +46,10 @@ public class SalarySobBackItemWrapper extends Service {
|
|||
return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SysSalaryItemService getSysSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SysSalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 查看详情
|
||||
* @return SalarySobBackItemAggregateDTO
|
||||
|
|
@ -89,4 +102,24 @@ public class SalarySobBackItemWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
public SalarySobBackItemFormDTO getForm(Long salarySobBackItemId) {
|
||||
// 查询薪资账套的薪资回算项目
|
||||
SalarySobBackItemPO salarySobBackItem = getSalarySobBackItemService(user).getById(salarySobBackItemId);
|
||||
// 查询薪资项目
|
||||
SalaryItemPO salaryItem = getSalaryItemService(user).getById(salarySobBackItem.getSalaryItemId());
|
||||
// 查询公式
|
||||
ExpressFormula expressFormula = getSalaryFormulaService(user).getExpressFormula(salarySobBackItem.getFormulaId());
|
||||
// 转换为dto
|
||||
SalarySobBackItemFormDTO salarySobBackItemFormDTO = SalarySobBackItemFormDTO.builder()
|
||||
.id(salarySobBackItem.getId())
|
||||
.salaryItem(Collections.singletonList((Map<String, Object>) ImmutableMap.of("id", Util.null2String(salaryItem.getId()), "name", salaryItem.getName())))
|
||||
.dataType(SalaryDataTypeEnum.parseByValue(salaryItem.getDataType()))
|
||||
.roundingMode(SalaryRoundingModeEnum.parseByValue(salarySobBackItem.getValueType()))
|
||||
.pattern(Util.null2String(salarySobBackItem.getPattern()))
|
||||
.valueType(SalaryValueTypeEnum.parseByValue(salarySobBackItem.getValueType()))
|
||||
.formulaId(salarySobBackItem.getFormulaId())
|
||||
.formulaContent(expressFormula == null ? "" : expressFormula.getFormula())
|
||||
.taxDeclarationColumn(SalaryItemBO.buildTaxDeclarationColumn(salaryItem.getCode())).build();
|
||||
return salarySobBackItemFormDTO;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue