Merge branch 'release/2.19.1.2501.01' into custom/金华交投
This commit is contained in:
commit
14953f4bb1
|
|
@ -267,7 +267,7 @@ public class SalaryBillBO {
|
|||
}
|
||||
Util_Message.store(messageBean);
|
||||
} catch (IOException e) {
|
||||
log.error("消息发送失败",e);
|
||||
log.error("消息发送失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -649,7 +649,8 @@ public class SalaryBillBO {
|
|||
} else {
|
||||
for (Object keyName : e.keySet()) {
|
||||
if ((salaryItem.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX).equals(keyName.toString())) {
|
||||
boolean isHide = (isHideNull && StringUtils.isEmpty(e.getOrDefault(keyName.toString(), StringUtils.EMPTY).toString()))
|
||||
String itemValue = Util.null2String(e.get(keyName.toString()));
|
||||
boolean isHide = (isHideNull && StringUtils.isEmpty(itemValue))
|
||||
||
|
||||
(isHideZero && NumberUtils.isCreatable(e.getOrDefault(keyName.toString(), "0").toString())
|
||||
&& BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString())) == 0);
|
||||
|
|
@ -660,7 +661,7 @@ public class SalaryBillBO {
|
|||
emailContent.append("</th>");
|
||||
|
||||
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
|
||||
emailContent.append(e.get(keyName.toString()));
|
||||
emailContent.append(itemValue.replaceAll("null", ""));
|
||||
emailContent.append("</td>");
|
||||
}
|
||||
break;
|
||||
|
|
@ -729,7 +730,8 @@ public class SalaryBillBO {
|
|||
SalaryTemplateSalaryItemListDTO salaryItem = itemPartition.get(i);
|
||||
for (Object keyName : e.keySet()) {
|
||||
if ((salaryItem.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX).equals(keyName.toString())) {
|
||||
boolean isHide = (isHideNull && StringUtils.isEmpty(e.getOrDefault(keyName.toString(), StringUtils.EMPTY).toString()))
|
||||
String itemValue = Util.null2String(e.get(keyName.toString()));
|
||||
boolean isHide = (isHideNull && StringUtils.isEmpty(itemValue))
|
||||
||
|
||||
(isHideZero && NumberUtils.isCreatable(e.getOrDefault(keyName.toString(), "0").toString())
|
||||
&& BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString())) == 0);
|
||||
|
|
@ -740,7 +742,7 @@ public class SalaryBillBO {
|
|||
emailContent.append("</th>");
|
||||
|
||||
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
|
||||
emailContent.append(e.get(keyName.toString()));
|
||||
emailContent.append(itemValue.replaceAll("null", ""));
|
||||
emailContent.append("</td>");
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.engine.salary.constant.TaxDeclarationDataIndexConstant;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
|
|
@ -73,6 +74,9 @@ public class SalaryAcctConsolidatedTaxBO {
|
|||
.filter(e -> Objects.equals(e.getSalaryItemId(), optional.get()))
|
||||
.map(e -> SalaryEntityUtil.empty2Zero(e.getResultValue()))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
if (StrUtil.isBlank(resultValue)) {
|
||||
resultValue = "0.00";
|
||||
}
|
||||
return new BigDecimal(resultValue).add(income).toPlainString();
|
||||
}
|
||||
// 个税调差为0
|
||||
|
|
@ -98,6 +102,9 @@ public class SalaryAcctConsolidatedTaxBO {
|
|||
.map(e -> SalaryEntityUtil.empty2Zero(e.getResultValue()))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (StrUtil.isBlank(resultValue)) {
|
||||
resultValue = "0.00";
|
||||
}
|
||||
return new BigDecimal(resultValue).add(refundedOrSupplementedTax).subtract(taxAdjustment).toPlainString();
|
||||
}
|
||||
return resultValue;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import java.util.Collection;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryAcctCalculateParam {
|
||||
public class SalaryAcctCalculateParam {
|
||||
|
||||
//核算人员的id,不是employeeId而是salaryAcctEmpId
|
||||
private Collection<Long> ids;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.YearMonth;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资核算列表查询参数
|
||||
|
|
@ -34,6 +35,11 @@ public class SalaryAcctRecordQueryParam extends BaseQueryParam {
|
|||
//账套名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 扣缴义务人id集合
|
||||
*/
|
||||
private List<Long> taxAgentIds;
|
||||
|
||||
private String startMonthStr;
|
||||
private String endMonthStr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ public class TaxDeclarationListDTO {
|
|||
@TableTitle(title = "薪资类型", dataIndex = "incomeCategory", key = "incomeCategory")
|
||||
private String incomeCategory;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
|
||||
@TableTitle(title = "税款所属期", dataIndex = "taxCycle", key = "taxCycle")
|
||||
private Date taxCycle;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
|
||||
@TableTitle(title = "薪资所属月", dataIndex = "salaryMonth", key = "salaryMonth")
|
||||
private Date salaryMonth;
|
||||
|
|
@ -47,10 +51,6 @@ public class TaxDeclarationListDTO {
|
|||
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
|
||||
private String taxAgentName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
|
||||
@TableTitle(title = "税款所属期", dataIndex = "taxCycle", key = "taxCycle")
|
||||
private Date taxCycle;
|
||||
|
||||
//@TableTitle(title = "操作人id", dataIndex = "operateEmployeeId", key = "operateEmployeeId")
|
||||
private Long operateEmployeeId;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
package com.engine.salary.entity.taxdeclaration.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import lombok.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.YearMonth;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 个税申报记录查询条件
|
||||
|
|
@ -20,12 +25,13 @@ import java.time.YearMonth;
|
|||
public class TaxDeclarationListQueryParam extends BaseQueryParam {
|
||||
|
||||
//薪资所属月范围起点
|
||||
private YearMonth fromSalaryMonth;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date fromSalaryMonth;
|
||||
|
||||
//薪资所属月范围终点
|
||||
private YearMonth endSalaryMonth;
|
||||
//薪资所属月范围终点
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date endSalaryMonth;
|
||||
|
||||
private String fromSalaryMonthStr;
|
||||
|
||||
private String endSalaryMonthStr;
|
||||
//个税扣缴义务人菜单")
|
||||
private String taxAgentName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,13 @@ public class TaxDeclarationPO {
|
|||
LocalDateRange salaryMonths;
|
||||
|
||||
|
||||
//"开始日期
|
||||
private Date taxCycleFromDate;
|
||||
|
||||
//结束日期
|
||||
private Date taxCycleEndDate;
|
||||
|
||||
|
||||
|
||||
private Collection<Long> taxAgentIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,12 @@
|
|||
<if test="salaryMonths != null and salaryMonths.endDate != null">
|
||||
AND salary_month <![CDATA[ <= ]]> #{salaryMonths.endDate}
|
||||
</if>
|
||||
<if test="taxCycleFromDate != null">
|
||||
AND tax_cycle <![CDATA[ >= ]]> #{taxCycleFromDate}
|
||||
</if>
|
||||
<if test="taxCycleEndDate != null">
|
||||
AND tax_cycle <![CDATA[ <= ]]> #{taxCycleEndDate}
|
||||
</if>
|
||||
<if test="taxAgentIds != null and taxAgentIds.size()>0">
|
||||
AND tax_agent_id IN
|
||||
<foreach collection="taxAgentIds" open="(" item="id" separator="," close=")">
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ public class SalaryStatisticsDataPerspectiveQueryParam extends BaseQueryParam {
|
|||
//个税扣缴义务人配置
|
||||
private List<Long> taxAgent;
|
||||
|
||||
@JsonIgnore
|
||||
private List<Long> salarySob;
|
||||
|
||||
@JsonIgnore
|
||||
//收入所得项目配置
|
||||
private List<Integer> incomeCategory;
|
||||
|
|
|
|||
|
|
@ -469,12 +469,21 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
if (reportPO.getTaxAgentSetting() != null) {
|
||||
param.setTaxAgent(((List<Map>) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
}
|
||||
if (reportPO.getSalarySobSetting() != null) {
|
||||
param.setSalarySob(((List<Map>) JSON.parseArray(reportPO.getSalarySobSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
}
|
||||
if (reportPO.getSubCompanySetting() != null) {
|
||||
param.setSubCompany(((List<Map>) JSON.parseArray(reportPO.getSubCompanySetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
}
|
||||
if (reportPO.getDepartSetting() != null) {
|
||||
param.setDepart(((List<Map>) JSON.parseArray(reportPO.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
}
|
||||
if (reportPO.getPositionSetting() != null) {
|
||||
param.setPosition(((List<Map>) JSON.parseArray(reportPO.getPositionSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
}
|
||||
if (reportPO.getStatusSetting() != null) {
|
||||
param.setStatus(((List<Map>) JSON.parseArray(reportPO.getStatusSetting(), Map.class)).stream().map(m -> m.get(key).toString()).collect(Collectors.toList()));
|
||||
}
|
||||
if (reportPO.getEmployeeSetting() != null) {
|
||||
param.setEmployee(((List<Map>) JSON.parseArray(reportPO.getEmployeeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,7 +172,8 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
|
|||
List<InsuranceArchivesBaseInfoPO> baseInfoPOList = getInsuranceBaseInfoMapper().listAll();
|
||||
List<Long> canAccountIds = baseInfoPOList.stream()
|
||||
.filter(f->f.getPaymentOrganization().toString().equals(queryParam.getPaymentOrganization())
|
||||
&& (f.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()) || f.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())))
|
||||
&& !f.getRunStatus().equals(EmployeeStatusEnum.STAY_ADD.getValue())
|
||||
)
|
||||
.map(InsuranceArchivesBaseInfoPO::getEmployeeId)
|
||||
.collect(Collectors.toList());
|
||||
accountExportPOS = accountExportPOS.stream().filter(v -> canAccountIds.contains(v.getEmployeeId())).collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
|
|
@ -179,6 +180,21 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
|
||||
po.setSalarySobIds(salarySobIds);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(queryParam.getTaxAgentIds())) {
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByTaxAgentIds(queryParam.getTaxAgentIds());
|
||||
if (CollectionUtils.isEmpty(salarySobPOS)) {
|
||||
return page;
|
||||
}
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
|
||||
|
||||
Collection<Long> existIds = po.getSalarySobIds();
|
||||
if (CollectionUtils.isNotEmpty(existIds)) {
|
||||
existIds = SalaryEntityUtil.intersectionForList(existIds, salarySobIds);
|
||||
po.setSalarySobIds(existIds);
|
||||
} else {
|
||||
po.setSalarySobIds(salarySobIds);
|
||||
}
|
||||
}
|
||||
LocalDateRange localDateRange = new LocalDateRange();
|
||||
if (Objects.nonNull(queryParam.getStartMonth())) {
|
||||
localDateRange.setFromDate(SalaryDateUtil.localDateToDate(queryParam.getStartMonth().atDay(1)));
|
||||
|
|
@ -857,6 +873,6 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
|
||||
@Override
|
||||
public void updateDate(Long id, Date updateTime) {
|
||||
getSalaryAcctRecordMapper().updateDate(id,updateTime);
|
||||
getSalaryAcctRecordMapper().updateDate(id, updateTime);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -485,6 +485,11 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
if (salarySendInfo == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "工资单信息不存在"));
|
||||
}
|
||||
|
||||
if (!Objects.equals(salarySendInfo.getSendStatus(), 1)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "工资单信息不存在"));
|
||||
}
|
||||
|
||||
Long employeeId = salarySendInfo.getEmployeeId();
|
||||
if (currentEmployeeId.compareTo(employeeId) != 0) {
|
||||
|
||||
|
|
@ -1343,7 +1348,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> withdraw(SalarySendWithdrawParam param) {
|
||||
if (param.getSalarySendId() == null) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
|
|
@ -9,6 +10,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||
|
|
@ -114,15 +116,12 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
|
||||
// 分页参数
|
||||
TaxDeclarationPO po = TaxDeclarationPO.builder().build();
|
||||
LocalDateRange localDateRange = new LocalDateRange();
|
||||
if (Objects.nonNull(queryParam.getFromSalaryMonth())) {
|
||||
localDateRange.setFromDate(SalaryDateUtil.localDateToDate(queryParam.getFromSalaryMonth().atDay(1)));
|
||||
po.setTaxCycleFromDate(queryParam.getFromSalaryMonth());
|
||||
}
|
||||
if (Objects.nonNull(queryParam.getEndSalaryMonth())) {
|
||||
localDateRange.setEndDate(SalaryDateUtil.localDateToDate(queryParam.getEndSalaryMonth().atEndOfMonth()));
|
||||
po.setTaxCycleEndDate(queryParam.getEndSalaryMonth());
|
||||
}
|
||||
po.setSalaryMonths(localDateRange);
|
||||
|
||||
|
||||
// 分权
|
||||
Boolean openDevolution = getTaxAgentService(user).isNeedAuth(currentEmployeeId);
|
||||
|
|
@ -138,6 +137,15 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
|
||||
// 查询个税申报表
|
||||
List<TaxDeclarationPO> taxDeclarationPOS = getTaxDeclarationMapper().listSome(po);
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(queryParam.getTaxAgentName())) {
|
||||
List<TaxAgentPO> taxAgentPOs = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(queryParam.getTaxAgentName()).build());
|
||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOs, TaxAgentPO::getId);
|
||||
taxDeclarationPOS = taxDeclarationPOS.stream().filter(tax -> taxAgentIds.contains(tax.getTaxAgentId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
|
||||
taxDeclarationPOS, TaxDeclarationPO.class);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.util.excel;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
|
@ -139,8 +140,10 @@ public class ExcelUtil {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof BigDecimal) {
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
|
||||
|
|
@ -235,8 +238,10 @@ public class ExcelUtil {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof BigDecimal) {
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
|
||||
|
|
@ -311,8 +316,10 @@ public class ExcelUtil {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof BigDecimal) {
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
|
||||
|
|
@ -377,8 +384,10 @@ public class ExcelUtil {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof Boolean) {
|
||||
cell.setCellType(CellType.BOOLEAN);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
|
|
@ -458,8 +467,10 @@ public class ExcelUtil {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof Boolean) {
|
||||
cell.setCellType(CellType.BOOLEAN);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.engine.salary.util.excel;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.usermodel.*;
|
||||
import weaver.wechat.util.Utils;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -131,10 +133,10 @@ public class ExcelUtilPlus {
|
|||
for (int i = 0; i < header.size(); i++) {
|
||||
WeaTableColumnGroup columnGroupItem = (WeaTableColumnGroup) header.get(i);
|
||||
XSSFCell rowZeroCell = row0.createCell(i, CellType.STRING);
|
||||
rowZeroCell.setCellValue(columnGroupItem.getText().toString());
|
||||
rowZeroCell.setCellValue(columnGroupItem.getText());
|
||||
rowZeroCell.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, columnGroupItem.getText().length() * 4)) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, Utils.null2String(columnGroupItem.getText()).length() * 4)) * 256);
|
||||
patternList.add(columnGroupItem.getPattern());
|
||||
}
|
||||
|
||||
|
|
@ -190,8 +192,10 @@ public class ExcelUtilPlus {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof BigDecimal) {
|
||||
if (lastRowRed && rowIndex == rowList.size() - 1) {
|
||||
cell.setCellStyle(numberRedCellStyleMap.get(patternList.get(cellIndex)));
|
||||
|
|
@ -199,8 +203,7 @@ public class ExcelUtilPlus {
|
|||
cell.setCellStyle(numberCellStyleMap.get(patternList.get(cellIndex)));
|
||||
}
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
double value = o == null ? 0 : ((BigDecimal) o).doubleValue();
|
||||
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
|
||||
cell.setCellValue(((BigDecimal) o).doubleValue());
|
||||
} else if (o instanceof Boolean) {
|
||||
cell.setCellType(CellType.BOOLEAN);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
|
|
@ -220,6 +223,7 @@ public class ExcelUtilPlus {
|
|||
}
|
||||
return workbook;
|
||||
}
|
||||
|
||||
public static XSSFWorkbook genWorkbookV2(List<List<Object>> rowList, String sheetName) {
|
||||
XSSFWorkbook workbook = new XSSFWorkbook();
|
||||
|
||||
|
|
@ -280,11 +284,13 @@ public class ExcelUtilPlus {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof BigDecimal) {
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
|
||||
cell.setCellValue(((BigDecimal) o).doubleValue());
|
||||
} else if (o instanceof Boolean) {
|
||||
cell.setCellType(CellType.BOOLEAN);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
|
|
@ -367,8 +373,10 @@ public class ExcelUtilPlus {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof Boolean) {
|
||||
cell.setCellType(CellType.BOOLEAN);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
|
|
@ -476,11 +484,13 @@ public class ExcelUtilPlus {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof BigDecimal) {
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
|
||||
cell.setCellValue(((BigDecimal) o).doubleValue());
|
||||
} else if (o instanceof Boolean) {
|
||||
cell.setCellType(CellType.BOOLEAN);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
|
|
@ -674,8 +684,10 @@ public class ExcelUtilPlus {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof BigDecimal) {
|
||||
if (lastRowRed && rowIndex == rowList.size() - 1) {
|
||||
cell.setCellStyle(numberRedCellStyleMap.get(patternList.get(cellIndex)));
|
||||
|
|
@ -839,8 +851,10 @@ public class ExcelUtilPlus {
|
|||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
if (StrUtil.isNotBlank(String.valueOf(o))) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
}
|
||||
} else if (o instanceof BigDecimal) {
|
||||
cell.setCellType(CellType.NUMERIC);
|
||||
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
|
||||
|
|
|
|||
|
|
@ -250,7 +250,9 @@ public class ValidUtil {
|
|||
.replace("between", "between")
|
||||
.replace("BETWEEN", "BETWEEN")
|
||||
.replace("union", "union")
|
||||
.replace("UNION", "UNION");
|
||||
.replace("UNION", "UNION")
|
||||
.replace("substr", "substr")
|
||||
.replace("SUBSTR", "SUBSTR");
|
||||
}
|
||||
setValue(t, field.getName(), result);
|
||||
} else if (valueTypeEnum == ValueTypeEnum.OBJECT) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import javax.ws.rs.core.Response;
|
|||
import javax.ws.rs.core.StreamingOutput;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.time.LocalDate;
|
||||
|
||||
|
||||
|
|
@ -58,10 +57,8 @@ public class TaxDeclarationController {
|
|||
@POST
|
||||
@Path("/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) throws ParseException {
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam){
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
queryParam.setFromSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr()));
|
||||
queryParam.setEndSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr()));
|
||||
return new ResponseResult<TaxDeclarationListQueryParam, PageInfo<TaxDeclarationListDTO>>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,10 @@ public class SalarySobRangeWrapper extends Service {
|
|||
.replace("between", "between")
|
||||
.replace("BETWEEN", "BETWEEN")
|
||||
.replace("union", "union")
|
||||
.replace("UNION", "UNION"));
|
||||
.replace("UNION", "UNION")
|
||||
.replace("substr", "substr")
|
||||
.replace("SUBSTR", "SUBSTR")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -127,7 +130,10 @@ public class SalarySobRangeWrapper extends Service {
|
|||
.replace("between", "between")
|
||||
.replace("BETWEEN", "BETWEEN")
|
||||
.replace("union", "union")
|
||||
.replace("UNION", "UNION"));
|
||||
.replace("UNION", "UNION")
|
||||
.replace("substr", "substr")
|
||||
.replace("SUBSTR", "SUBSTR")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -365,7 +365,10 @@ public class TaxAgentWrapper extends Service {
|
|||
.replace("between", "between")
|
||||
.replace("BETWEEN", "BETWEEN")
|
||||
.replace("union", "union")
|
||||
.replace("UNION", "UNION"));
|
||||
.replace("UNION", "UNION")
|
||||
.replace("substr", "substr")
|
||||
.replace("SUBSTR", "SUBSTR")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -399,7 +402,10 @@ public class TaxAgentWrapper extends Service {
|
|||
.replace("between", "between")
|
||||
.replace("BETWEEN", "BETWEEN")
|
||||
.replace("union", "union")
|
||||
.replace("UNION", "UNION"));
|
||||
.replace("UNION", "UNION")
|
||||
.replace("substr", "substr")
|
||||
.replace("SUBSTR", "SUBSTR")
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue