核算列表求和
This commit is contained in:
parent
1d635f1423
commit
23a1396c12
|
|
@ -237,7 +237,6 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<SalaryAcctEmployeePO> listPageByParam4Reduce(SalaryAcctEmployeeQueryParam queryParam) {
|
||||
|
||||
|
|
@ -301,8 +300,8 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
// Set<String> keySet = SalaryEntityUtil.properties(salaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
Map<String, SalaryAcctEmployeePO> thisMonthSalaryAcctEmployeePOMap = SalaryEntityUtil.convert2Map(salaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
List<SalaryAcctEmployeePO> resultList = Lists.newArrayList();
|
||||
thisMonthSalaryAcctEmployeePOMap.forEach((k,v)->{
|
||||
if(!lastMonthSalaryAcctEmployeePOMap.containsKey(k)){
|
||||
thisMonthSalaryAcctEmployeePOMap.forEach((k, v) -> {
|
||||
if (!lastMonthSalaryAcctEmployeePOMap.containsKey(k)) {
|
||||
resultList.add(v);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1016,6 +1016,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
SalarySendInfoQueryParam.checkParam(queryParam);
|
||||
|
||||
// 获取行数据
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
queryParam.setOrderRule(orderRule);
|
||||
List<SalarySendInfoListDTO> list = salarySendInfoMapper.list(queryParam);
|
||||
list.forEach(e -> {
|
||||
// 发放状态
|
||||
|
|
|
|||
|
|
@ -26,4 +26,9 @@ public class SalarySysConstant {
|
|||
* 定位人员规则标识
|
||||
*/
|
||||
public static final String MATCH_EMPLOYEE_MODE = "matchEmployeeMode";
|
||||
|
||||
/**
|
||||
* 核算合计功能开启标识
|
||||
*/
|
||||
public static final String OPEN_ACCT_RESULT_SUM = "OPEN_ACCT_RESULT_SUM";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package com.engine.salary.sys.entity.param;
|
||||
|
||||
import com.engine.salary.sys.enums.OpenEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 保存应用设置参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AppSettingSaveParam {
|
||||
|
||||
/**
|
||||
* 是否打印日志
|
||||
*
|
||||
* @see OpenEnum
|
||||
*/
|
||||
private String isLog;
|
||||
|
||||
/**
|
||||
* 是否开启核算结果合计列
|
||||
*
|
||||
* @see OpenEnum
|
||||
*/
|
||||
private String openAcctResultSum;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.engine.salary.sys.enums;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 排序枚举
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum OpenEnum implements BaseEnum<String> {
|
||||
|
||||
OFF("0", "关闭", 1),
|
||||
OPEN("1", "开启", 1);
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
|
||||
OpenEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static OpenEnum parseByValue(String value) {
|
||||
for (OpenEnum openEnum : OpenEnum.values()) {
|
||||
if (StringUtils.equals(openEnum.getValue(), value)) {
|
||||
return openEnum;
|
||||
}
|
||||
}
|
||||
return OFF;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.sys.service;
|
||||
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
import com.engine.salary.sys.entity.param.OrderRuleParam;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
|
|
@ -45,4 +46,9 @@ public interface SalarySysConfService {
|
|||
void saveMatchEmployeeModeRule(String rule);
|
||||
|
||||
|
||||
/**
|
||||
* 保存应用设置
|
||||
* @param param
|
||||
*/
|
||||
void saveAppSetting(AppSettingSaveParam param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
import com.engine.salary.sys.entity.param.OrderRuleParam;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
|
|
@ -216,4 +217,29 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveAppSetting(AppSettingSaveParam param) {
|
||||
|
||||
String openAcctResultSum = param.getOpenAcctResultSum();
|
||||
SalarySysConfPO po = getOneByCode(OPEN_ACCT_RESULT_SUM);
|
||||
if (po == null) {
|
||||
SalarySysConfPO build = SalarySysConfPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.confKey(OPEN_ACCT_RESULT_SUM)
|
||||
.confValue(openAcctResultSum)
|
||||
.title("开启核算结果合并")
|
||||
.orderWeight(0)
|
||||
.module("app")
|
||||
.updateTime(new Date())
|
||||
.createTime(new Date())
|
||||
.deleteType(0)
|
||||
.build();
|
||||
getSalarySysConfMapper().insertIgnoreNull(build);
|
||||
} else {
|
||||
po.setConfValue(openAcctResultSum);
|
||||
po.setUpdateTime(new Date());
|
||||
getSalarySysConfMapper().updateIgnoreNull(po);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ public class SalaryBillController {
|
|||
|
||||
XSSFWorkbook workbook = getSalarySendWrapper(user).exportInfoList(queryParam);
|
||||
|
||||
String fileName = "工资单发放信息列表";
|
||||
String fileName = "工资单发放信息" + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
|
@ -393,15 +393,15 @@ public class SalaryBillController {
|
|||
SalarySendDetailQueryParam queryParam = new SalarySendDetailQueryParam();
|
||||
String salarySendId = request.getParameter("salarySendId");
|
||||
String ids = request.getParameter("ids");
|
||||
if(StringUtils.isNotBlank(ids)) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
queryParam.setIds(Arrays.asList(ids.split(",")).stream().map(Long::new).collect(Collectors.toList()));
|
||||
}
|
||||
if(StringUtils.isNotBlank(salarySendId)) {
|
||||
if (StringUtils.isNotBlank(salarySendId)) {
|
||||
queryParam.setSalarySendId(Long.parseLong(salarySendId));
|
||||
}
|
||||
XSSFWorkbook workbook = getSalarySendWrapper(user).exportDetailList(queryParam);
|
||||
|
||||
String fileName = "工资单发放详情列表"+ LocalDate.now();
|
||||
String fileName = "工资单发放详情列表" + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
import com.engine.salary.sys.entity.param.MatchEmployeeModeSaveParam;
|
||||
import com.engine.salary.sys.entity.param.OrderRuleParam;
|
||||
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
|
||||
|
|
@ -178,4 +179,20 @@ public class SalarySystemConfigController {
|
|||
return new ResponseResult<MatchEmployeeModeSaveParam, String>(user).run(getSalarySystemConfigWrapper(user)::saveMatchEmployeeModeRule, param);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 应用设置
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/app/setting/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveAppSetting(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AppSettingSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AppSettingSaveParam, String>(user).run(getSalarySystemConfigWrapper(user)::saveAppSetting, param);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
|||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.enums.OpenEnum;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
|
@ -28,6 +32,8 @@ import weaver.hrm.User;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.OPEN_ACCT_RESULT_SUM;
|
||||
|
||||
/**
|
||||
* 薪资核算结果
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -70,6 +76,10 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
return ServiceUtil.getService(SalaryAcctExcelServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算列表
|
||||
*
|
||||
|
|
@ -86,7 +96,6 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
|
||||
// 查询薪资核算结果(分页)
|
||||
PageInfo<Map<String, Object>> page = getSalaryAcctResultService(user).listPageByParam(queryParam);
|
||||
Map<String, Object> sumRow = getSalaryAcctResultService(user).sumRow(queryParam);
|
||||
|
||||
// 构建薪资核算结果列表的表头
|
||||
List<WeaTableColumnGroup> columns = getSalaryAcctExcelService(user).listWeaTableColumn(salaryAcctRecordPO);
|
||||
|
|
@ -94,8 +103,13 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
Map<String, Object> datas = new HashMap<>();
|
||||
datas.put("pageInfo", page);
|
||||
datas.put("columns", columns);
|
||||
datas.put("sumRow", sumRow);
|
||||
|
||||
//合计
|
||||
SalarySysConfPO openSum = getSalarySysConfService(user).getOneByCode(OPEN_ACCT_RESULT_SUM);
|
||||
if (openSum != null && StringUtils.isNotBlank(openSum.getConfValue()) && OpenEnum.parseByValue(openSum.getConfValue()) == OpenEnum.OPEN) {
|
||||
Map<String, Object> sumRow = getSalaryAcctResultService(user).sumRow(queryParam);
|
||||
datas.put("sumRow", sumRow);
|
||||
}
|
||||
return datas;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
import com.engine.salary.sys.entity.param.MatchEmployeeModeSaveParam;
|
||||
import com.engine.salary.sys.entity.param.OrderRuleParam;
|
||||
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
|
||||
|
|
@ -118,4 +119,9 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
ValidUtil.doValidator(param);
|
||||
getSalarySysConfService(user).saveMatchEmployeeModeRule(param.getRule());
|
||||
}
|
||||
|
||||
public void saveAppSetting(AppSettingSaveParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
getSalarySysConfService(user).saveAppSetting(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue