Merge remote-tracking branch 'origin/release/2.14.4.2406.02' into release/2.14.4.2406.02
This commit is contained in:
commit
a27716ae72
|
|
@ -18,4 +18,4 @@ left join hrmresource e on e.id= result.employee_id
|
|||
left join hrsa_tax_agent t on a.tax_agent_id=t.id
|
||||
where a.delete_type=0 and i.delete_type=0 and t.delete_type=0 and c.delete_type=0
|
||||
and a.employee_id=人员id and t.name=扣缴义务人名称
|
||||
and effective_time <= now() and c.name='基本工资' order by effective_time desc
|
||||
c.name='基本工资' order by effective_time desc
|
||||
|
|
@ -980,7 +980,31 @@
|
|||
"infinite": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "DAYSINMONTH",
|
||||
"chineseName": "返回指定月的天数",
|
||||
"description": "返回指定月的天数。",
|
||||
"example": "DAYSINMONTH('2024-01-01')",
|
||||
"result": "31",
|
||||
"paramDescs": [
|
||||
"*日期*(必选)"
|
||||
],
|
||||
"formatString": "DAYSINMONTH(日期)",
|
||||
"paramArray": [],
|
||||
"paramData": [],
|
||||
"returnType": "number",
|
||||
"type": "function",
|
||||
"validForm": "days_in_month",
|
||||
"paramCount": -1,
|
||||
"paramStatuses": [
|
||||
{
|
||||
"dataType": "date",
|
||||
"must": true,
|
||||
"infinite": true
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
"dataType": "date",
|
||||
"name": "日期函数",
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ public class SalaryItemBO {
|
|||
|
||||
private static final BaseBean baseBean = new BaseBean();
|
||||
|
||||
//强制开启账套的公式配置
|
||||
private static final Boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
|
||||
|
||||
|
||||
|
||||
|
|
@ -86,6 +84,10 @@ public class SalaryItemBO {
|
|||
if (CollectionUtils.isEmpty(salaryItems)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
//强制开启账套的公式配置
|
||||
boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
|
||||
|
||||
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
||||
Map<Long, String> sysSalaryItemNameMap = SalaryEntityUtil.convert2Map(sysSalaryItemPOS, SysSalaryItemPO::getId, SysSalaryItemPO::getName);
|
||||
return salaryItems.stream().map(salaryItemPO -> {
|
||||
|
|
@ -134,6 +136,9 @@ public class SalaryItemBO {
|
|||
if (CollectionUtils.isEmpty(salaryItems)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//强制开启账套的公式配置
|
||||
boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
|
||||
|
||||
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
||||
Map<Long, String> sysSalaryItemNameMap = SalaryEntityUtil.convert2Map(sysSalaryItemPOS, SysSalaryItemPO::getId, SysSalaryItemPO::getName);
|
||||
return salaryItems.stream().map(salaryItemPO -> {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class SalaryItemSaveParam {
|
|||
private Integer roundingMode;
|
||||
|
||||
//保留小数位
|
||||
@DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 8, message = "小数位最多为8")
|
||||
@DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 10, message = "小数位最多为10")
|
||||
private Integer pattern;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class SalarySobItemFormDTO {
|
|||
private Integer roundingMode;
|
||||
|
||||
//保留小数位")
|
||||
@DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 8, message = "小数位最多为8")
|
||||
@DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 10, message = "小数位最多为10")
|
||||
private Integer pattern;
|
||||
|
||||
//取值方式")
|
||||
|
|
|
|||
|
|
@ -985,7 +985,31 @@ public class FormluaConstant {
|
|||
" \"infinite\": true\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"name\": \"DAYSINMONTH\",\n" +
|
||||
" \"chineseName\": \"返回指定月的天数\",\n" +
|
||||
" \"description\": \"返回指定月的天数。\",\n" +
|
||||
" \"example\": \"DAYSINMONTH('2024-01-01')\",\n" +
|
||||
" \"result\": \"31\",\n" +
|
||||
" \"paramDescs\": [\n" +
|
||||
" \"*日期*(必选)\"\n" +
|
||||
" ],\n" +
|
||||
" \"formatString\": \"DAYSINMONTH(日期)\",\n" +
|
||||
" \"paramArray\": [],\n" +
|
||||
" \"paramData\": [],\n" +
|
||||
" \"returnType\": \"number\",\n" +
|
||||
" \"type\": \"function\",\n" +
|
||||
" \"validForm\": \"days_in_month\",\n" +
|
||||
" \"paramCount\": -1,\n" +
|
||||
" \"paramStatuses\": [\n" +
|
||||
" {\n" +
|
||||
" \"dataType\": \"date\",\n" +
|
||||
" \"must\": true,\n" +
|
||||
" \"infinite\": true\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" ],\n" +
|
||||
" \"dataType\": \"date\",\n" +
|
||||
" \"name\": \"日期函数\",\n" +
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ public class QlExpress {
|
|||
runner.addFunctionOfServiceMethod("CURRSECOND", dateTimeService, "currSecond", new Class[]{Object[].class}, "");
|
||||
runner.addFunctionOfServiceMethod("MAXDATE", dateTimeService, "maxDate", new Class[]{Object[].class}, "");
|
||||
runner.addFunctionOfServiceMethod("MINDATE", dateTimeService, "minDate", new Class[]{Object[].class}, "");
|
||||
runner.addFunctionOfServiceMethod("DAYSINMONTH", dateTimeService, "daysInMonth", new Class[]{Object[].class}, "");
|
||||
// runner.addFunctionOfServiceMethod("DAYOFMONTH", dateTimeService, "dayOfMonth", new Class[]{Object[].class}, "");
|
||||
|
||||
//聚合函数
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.salary.formlua.func.compare;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.salary.formlua.core.exception.ErrorType;
|
||||
import com.engine.salary.formlua.entity.parameter.DataType;
|
||||
import com.engine.salary.formlua.util.CompareUtil;
|
||||
|
|
@ -37,7 +36,6 @@ public class EqOperator extends OperatorEqualsLessMore {
|
|||
public Object executeInner(Object... list) throws Exception {
|
||||
DataType result=new DataType();
|
||||
result.setDataType(DataType.BOOL);
|
||||
logger.info("等于号参数:"+JSON.toJSONString(list));
|
||||
String oper="=";
|
||||
if(list.length!=2){
|
||||
throw new RuntimeException("[=]"+ ErrorType.MAX_VAR_COUNT.name());
|
||||
|
|
@ -75,7 +73,6 @@ public class EqOperator extends OperatorEqualsLessMore {
|
|||
int i=0;
|
||||
for (;i<firstOptions.length;i++){
|
||||
boolean loopresult=OperatorEqualsLessMore.executeInner("=",firstOptions[i],secondOptions[i]);
|
||||
logger.info("比较选项结果"+loopresult);
|
||||
if(!loopresult){
|
||||
result.setContent(false);
|
||||
break;
|
||||
|
|
@ -138,7 +135,6 @@ public class EqOperator extends OperatorEqualsLessMore {
|
|||
}else {
|
||||
Object firstParam=ExcelParamUtil.getParamContent(dataList.get(0),"");
|
||||
Object secondParam=ExcelParamUtil.getParamContent(dataList.get(1),"");
|
||||
logger.info("等于号比较:"+firstParam+"-->"+secondParam);
|
||||
if((firstParam instanceof String || firstParam instanceof Character) && (secondParam instanceof String || secondParam instanceof Character)){
|
||||
if(firstParam.toString().length()==1&&secondParam.toString().length()==1){
|
||||
boolean r=firstParam.toString().equals(secondParam.toString());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.salary.formlua.func.compare;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.salary.formlua.entity.parameter.DataType;
|
||||
import com.engine.salary.formlua.util.CompareUtil;
|
||||
import com.engine.salary.formlua.util.DateUtil;
|
||||
|
|
@ -22,7 +21,6 @@ public class GreaterOperator extends OperatorEqualsLessMore {
|
|||
result.setDataType(DataType.BOOL);
|
||||
// IgnoreParamFilter.filterCompareFunc(op1,op2,">");
|
||||
String datatype = ExcelParamUtil.checkParamType(op1);
|
||||
logger.info("大于号比较:" + JSON.toJSONString(op1) + "-->" + JSON.toJSONString(op2));
|
||||
//对option的特殊处理,获取option的字符串后根据逗号分割,然后排序数组,数组长度不一致返回false,一致则循环对比直到同样下标的数据不一致返回false,否则为true
|
||||
try {
|
||||
if (datatype.equals(DataType.OPTION)) {
|
||||
|
|
@ -77,8 +75,6 @@ public class GreaterOperator extends OperatorEqualsLessMore {
|
|||
}
|
||||
result.setContent(dateResult);
|
||||
} else {
|
||||
logger.info("参数1:" + ExcelParamUtil.convertParamValToNumber(op1) + "");
|
||||
logger.info("参数2:" + ExcelParamUtil.convertParamValToNumber(op2) + "");
|
||||
boolean r;
|
||||
if (ExcelParamUtil.getParamType(op1).toLowerCase().equals("double") || ExcelParamUtil.getParamType(op2).toLowerCase().equals("double")) {
|
||||
r = OperatorEqualsLessMore.executeInner(">", ExcelParamUtil.convertParamValToNumber(op1), ExcelParamUtil.convertParamValToNumber(op2));
|
||||
|
|
|
|||
|
|
@ -52,10 +52,9 @@ public class WOperatorDiv extends OperatorMultiDiv {
|
|||
newList[1] = secondParam;
|
||||
try {
|
||||
Object r = super.executeInner(newList);
|
||||
logger.info("乘法运算:" + r.toString());
|
||||
result.setContent(new BigDecimal(r + ""));
|
||||
} catch (Exception e) {
|
||||
logger.info("除法计算异常返回0:" + e.getMessage());
|
||||
logger.error("除法计算异常返回0:" + e.getMessage());
|
||||
result.setContent(0);
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -89,4 +89,11 @@ import com.engine.salary.formlua.entity.parameter.DataType;
|
|||
*/
|
||||
DataType currSecond(Object... objects);
|
||||
|
||||
/**
|
||||
* 获取月有多少天
|
||||
* @param objects
|
||||
* @return
|
||||
*/
|
||||
DataType daysInMonth(Object... objects);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.YearMonth;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
|
@ -549,7 +550,6 @@ public class DateTimeServiceImpl implements DateTimeService {
|
|||
date = lastday;
|
||||
break;
|
||||
}
|
||||
logger.info("firstday:" + firstday + " lastday:" + lastday);
|
||||
return new DataType(DataType.STRING, date);
|
||||
}
|
||||
|
||||
|
|
@ -998,6 +998,37 @@ public class DateTimeServiceImpl implements DateTimeService {
|
|||
int year = cal.get(Calendar.SECOND);
|
||||
return new DataType(DataType.NUMBER, year);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType daysInMonth(Object... objects) {
|
||||
Class[] typeObjects = new Class[]{DateAndString.class};
|
||||
IgnoreParamFilter.commonFilter("YEAR", 1, 1, typeObjects, objects);
|
||||
Object obj = objects[0];
|
||||
Object date = DateUtil.getContent(obj, formatter);
|
||||
if (ExcelParamUtil.checkIsNull(date, ExcelParamUtil.CHECKLEVEL_STRING)) {
|
||||
return new DataType(DataType.NUMBER, 0);
|
||||
}
|
||||
int year = 0;
|
||||
try {
|
||||
year = getDateTimeValue(date, "Y", "YEAR");
|
||||
} catch (ParseException e) {
|
||||
logger.error("err", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
IgnoreParamFilter.commonFilter("MONTH", 1, 1, typeObjects, objects);
|
||||
int month = 0;
|
||||
try {
|
||||
month = getDateTimeValue(date, "M", "MONTH") + 1;
|
||||
} catch (ParseException e) {
|
||||
logger.error("err", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
YearMonth yearMonth = YearMonth.of(year, month);
|
||||
int daysInMonth = yearMonth.lengthOfMonth();
|
||||
return new DataType(DataType.NUMBER, daysInMonth);
|
||||
}
|
||||
/*******以下为日期函数的一些公共逻辑********/
|
||||
|
||||
|
||||
|
|
@ -1256,7 +1287,7 @@ public class DateTimeServiceImpl implements DateTimeService {
|
|||
r = true;
|
||||
break;
|
||||
} catch (ParseException e) {
|
||||
logger.info(e.getMessage());
|
||||
logger.error(e.getMessage());
|
||||
r = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ public class FinanceServiceImpl implements FinanceService{
|
|||
int intLen = integerNum.length();
|
||||
for (int i = 0; i < intLen; i++) {
|
||||
String n = integerNum.substring(i, i+1);
|
||||
logger.info("转换中文:"+n);
|
||||
int p = intLen - i - 1;
|
||||
int q = p / 4;
|
||||
int m = p % 4;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.salary.formlua.func.logic;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.salary.formlua.core.exception.ExcelRunTimeException;
|
||||
import com.engine.salary.formlua.entity.parameter.DataType;
|
||||
|
|
@ -26,7 +25,6 @@ public class IfOperator extends OperatorIf {
|
|||
throw new ExcelRunTimeException("IF函数只允许三个参数");
|
||||
}
|
||||
Object obj = list.get(0).getObject(parent);
|
||||
logger.info("IF参数:" + JSON.toJSONString(obj));
|
||||
boolean isDataTypeBool = false;
|
||||
DataType boolDtaType = null;
|
||||
if (obj != null && obj instanceof DataType) {
|
||||
|
|
|
|||
|
|
@ -477,7 +477,6 @@ public class LogicServiceImpl implements LogicService {
|
|||
Object obj = objects[i - 1];
|
||||
String typeStr = ExcelParamUtil.getParamType(obj);
|
||||
typeStr = ExcelParamUtil.checkParamType(typeStr);
|
||||
logger.info(typeStr);
|
||||
if (type == null) {
|
||||
type = typeStr;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -236,7 +236,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
|
|||
int replaceLength=(repIdx-1)+repLenth;
|
||||
if(replaceLength>sourceStr.length()){
|
||||
// throw new RunTimeException(errorJson.getString("msg"));
|
||||
logger.info("REPLACE函数替换位置超过了字符长度");
|
||||
replaceLength=sourceStr.length();
|
||||
}
|
||||
String cutStr=sourceStr.substring(repIdx-1,replaceLength);
|
||||
|
|
@ -463,7 +462,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
|
|||
sex = "男";
|
||||
}
|
||||
}
|
||||
logger.info(sex);
|
||||
return new DataType(DataType.STRING,sex);
|
||||
}
|
||||
|
||||
|
|
@ -471,7 +469,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
|
|||
public DataType nativePlace(String idCard){
|
||||
int nativePlaceCode=Integer.parseInt(idCard.substring(0, 6));
|
||||
String nativePlace= NativePlace.getNativePlace(nativePlaceCode);
|
||||
logger.info("您所在的地区为:\n" + nativePlace);
|
||||
return new DataType(DataType.STRING,nativePlace);
|
||||
}
|
||||
|
||||
|
|
@ -489,7 +486,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
|
|||
if(dataType!=null && dataType.getContent()!=null){
|
||||
age=dataType.getContent();
|
||||
}
|
||||
logger.info("年龄:"+age);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
logger.error("err",e);
|
||||
|
|
@ -526,7 +522,6 @@ public class StringFormulaServiceImpl implements StringFormulaService {
|
|||
}
|
||||
|
||||
String birth=year+"-"+month+"-"+day;
|
||||
logger.info("生日为:"+birth);
|
||||
result=birth;
|
||||
break;
|
||||
|
||||
|
|
@ -756,12 +751,10 @@ public class StringFormulaServiceImpl implements StringFormulaService {
|
|||
if(fieldType.equalsIgnoreCase("string")){
|
||||
if(content!=null){
|
||||
try {
|
||||
logger.info("isJson函数的JSON字符转换:"+content+"");
|
||||
JSON.parseObject(content+"");
|
||||
resultDataType=new DataType(DataType.BOOL,true);
|
||||
} catch (Exception e) {
|
||||
logger.info("err",e);
|
||||
logger.info("不是正常的JSON字符");
|
||||
logger.error("err",e);
|
||||
resultDataType=new DataType(DataType.BOOL,false);
|
||||
}
|
||||
}else{
|
||||
|
|
@ -800,13 +793,11 @@ public class StringFormulaServiceImpl implements StringFormulaService {
|
|||
if(fieldType.equalsIgnoreCase("string")){
|
||||
if(content!=null){
|
||||
try {
|
||||
logger.info("isJson函数的JSON字符转换:"+content+"");
|
||||
JSONObject jsonObject=JSON.parseObject(content+"");
|
||||
Object jsonValue=jsonObject.get(objectKey+"");
|
||||
resultDataType=new DataType(DataType.STRING,jsonValue==null?"":jsonValue.toString());
|
||||
} catch (Exception e) {
|
||||
logger.info("err",e);
|
||||
logger.info("不是正常的JSON字符");
|
||||
resultDataType=new DataType(DataType.STRING,"");
|
||||
}
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ public class DateUtil {
|
|||
try {
|
||||
format.setLenient(false);
|
||||
format.parse(dateString);
|
||||
logger.info(dateString);
|
||||
} catch (ParseException e) {
|
||||
// logger.error("err",e);
|
||||
convertSuccess=false;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.salary.formlua.util;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.salary.formlua.core.exception.ErrorType;
|
||||
import com.engine.salary.formlua.entity.parameter.DataType;
|
||||
|
|
@ -39,7 +38,6 @@ public class IgnoreParamFilter {
|
|||
* @return
|
||||
*/
|
||||
public static boolean isEmployee(Object object) {
|
||||
logger.info("校验人员参数" + JSON.toJSONString(object));
|
||||
// if (object instanceof DataType) {
|
||||
// DataType dataType = (DataType) object;
|
||||
// if (dataType.getComponentKey() != null && dataType.getComponentKey().equalsIgnoreCase(ComponentType.Employee.toString())) {
|
||||
|
|
@ -227,7 +225,6 @@ public class IgnoreParamFilter {
|
|||
* @throws RuntimeException
|
||||
*/
|
||||
public static void filterAggFunc(String func, Object... objects) throws RuntimeException {
|
||||
logger.info("聚合参数:" + JSON.toJSONString(objects));
|
||||
Integer number = getSetFuncNumber(func);
|
||||
Map<String, String> map = new HashMap<>();
|
||||
boolean mustNumber = false;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -137,6 +138,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 获取员工发薪明细列表
|
||||
*
|
||||
* @param queryParam
|
||||
*/
|
||||
public Map<String, Object> salaryList(SalaryStatisticsEmployeeSalaryQueryParam queryParam) {
|
||||
|
|
@ -147,7 +149,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
// 获取发薪人员
|
||||
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
|
||||
// 获取薪资核算结果
|
||||
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList());
|
||||
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList());
|
||||
List<Map<String, Object>> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null);
|
||||
|
||||
Map<String, Object> countResultMap = Maps.newHashMap();
|
||||
|
|
@ -183,7 +185,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
// 结果
|
||||
if (queryParam.isExport()) {
|
||||
resultMap.put("columns", weaTableColumns);
|
||||
resultMap.put("salaryItems",salaryStatisticsEmployeeDetailResult.getSalaryItemList());
|
||||
resultMap.put("salaryItems", salaryStatisticsEmployeeDetailResult.getSalaryItemList());
|
||||
resultMap.put("countResult", countResultMap);
|
||||
} else {
|
||||
WeaTable table = new WeaTable();
|
||||
|
|
@ -205,6 +207,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 获取员工发薪明细列表
|
||||
*
|
||||
* @param queryParam
|
||||
*/
|
||||
public Map<String, Object> salaryListSum(SalaryStatisticsEmployeeSalaryQueryParam queryParam) {
|
||||
|
|
@ -215,25 +218,37 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
queryParam.setExport(true);
|
||||
// 获取发薪人员
|
||||
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
|
||||
// 获取薪资核算结果
|
||||
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList());
|
||||
List<Map<String, Object>> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null);
|
||||
List<SalaryAcctEmployeePO> employeePOS = salaryAcctEmployeePageInfo.getList();
|
||||
|
||||
Map<String, Object> sumResultMap = Maps.newHashMap();
|
||||
if (CollectionUtils.isNotEmpty(records)) {
|
||||
List<SalaryItemPO> salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList();
|
||||
for (SalaryItemPO item : salaryItems) {
|
||||
BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.ZERO);
|
||||
String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX;
|
||||
for (Map<String, Object> record : records) {
|
||||
if (record.containsKey(itemKey)) {
|
||||
if (Objects.nonNull(record.get(itemKey)) && StringUtils.isNotEmpty(record.get(itemKey).toString()) && NumberUtils.isCreatable(record.get(itemKey).toString())) {
|
||||
sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString()));
|
||||
|
||||
List<List<SalaryAcctEmployeePO>> empParts = Lists.partition(employeePOS, 500);
|
||||
|
||||
for (int i = 0; i < empParts.size(); i++) {
|
||||
// 获取薪资核算结果
|
||||
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(empParts.get(i));
|
||||
List<Map<String, Object>> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(records)) {
|
||||
List<SalaryItemPO> salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList();
|
||||
for (SalaryItemPO item : salaryItems) {
|
||||
BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.ZERO);
|
||||
String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX;
|
||||
for (Map<String, Object> record : records) {
|
||||
if (record.containsKey(itemKey)) {
|
||||
if (Objects.nonNull(record.get(itemKey)) && StringUtils.isNotEmpty(record.get(itemKey).toString()) && NumberUtils.isCreatable(record.get(itemKey).toString())) {
|
||||
sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Object o = sumResultMap.get(itemKey + "_n");
|
||||
if (o != null) {
|
||||
sumBigDecimal = sumBigDecimal.add((BigDecimal) o);
|
||||
}
|
||||
sumResultMap.put(itemKey + "_n", sumBigDecimal);
|
||||
// 薪资项目合计
|
||||
sumResultMap.put(itemKey, ReportDataUtil.thousandthConvert(sumBigDecimal.toString()));
|
||||
}
|
||||
// 薪资项目合计
|
||||
sumResultMap.put(itemKey, ReportDataUtil.thousandthConvert(sumBigDecimal.toString()));
|
||||
}
|
||||
}
|
||||
resultMap.put("sumRow", sumResultMap);
|
||||
|
|
@ -263,12 +278,12 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
// 合计
|
||||
List<Object> sumRow = new ArrayList<>();
|
||||
sumRow.add("总计");
|
||||
for (int i=1; i<columns.size(); i++) {
|
||||
for (int i = 1; i < columns.size(); i++) {
|
||||
sumRow.add(Util.null2String(countResult.get(columns.get(i).getColumn())));
|
||||
}
|
||||
rowList.add(sumRow);
|
||||
|
||||
return ExcelUtilPlus.genWorkbookV2(rowList,"薪资明细",true);
|
||||
return ExcelUtilPlus.genWorkbookV2(rowList, "薪资明细", true);
|
||||
}
|
||||
|
||||
// public Map<String, Object> exportDetailList(SalaryStatisticsEmployeeDetailQueryParam queryParam) {
|
||||
|
|
|
|||
|
|
@ -219,10 +219,11 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
List<List<Long>> partition = Lists.partition((List<Long>) salaryAcctEmployeeIds, 500);
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = new ArrayList<>();
|
||||
partition.forEach(empIds -> {
|
||||
salaryAcctResultPOS.addAll(getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(empIds).build()));
|
||||
List<SalaryAcctResultPO> resultPOS = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(empIds).build());
|
||||
encryptUtil.decryptList(resultPOS, SalaryAcctResultPO.class);
|
||||
salaryAcctResultPOS.addAll(resultPOS);
|
||||
});
|
||||
// 解密
|
||||
encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class);
|
||||
return salaryAcctResultPOS;
|
||||
}
|
||||
|
||||
|
|
@ -789,7 +790,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
acctResults = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().filter(po -> lockSalaryItemIds.contains(po.getSalaryItemId())).collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a));
|
||||
}
|
||||
List<Long> lockEmpIds = salaryAcctEmployeePOS.stream().filter(po -> LockStatusEnum.LOCK.getValue().equals(po.getLockStatus())).map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(lockEmpIds)){
|
||||
if (CollUtil.isNotEmpty(lockEmpIds)) {
|
||||
List<SalaryAcctResultPO> acctResultPOS = listBySalaryAcctEmployeeIds(lockEmpIds);
|
||||
Map<String, SalaryAcctResultPO> acctResultMaps = Optional.ofNullable(acctResultPOS).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(po -> po.getSalaryItemId() + "_" + po.getSalaryAcctEmpId(), a -> a, (a, b) -> a));
|
||||
acctResults.putAll(acctResultMaps);
|
||||
|
|
|
|||
Loading…
Reference in New Issue