Merge pull request 'develop' (#185) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/185
This commit is contained in:
commit
732fe19a0c
@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Project: emis
|
* @Project: emis
|
||||||
* @Title: EmisCommissionProfitController.java
|
* @Title: EmisCommissionProfitController.java
|
||||||
* @author linfso
|
* @author linfso
|
||||||
* @date 2024-10-24 01:46:36
|
* @date 2024-10-24 01:46:36
|
||||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||||
* @version v1.0
|
* @version v1.0
|
||||||
* @Description: <p> 员工提成表 控制器 </p>
|
* @Description: <p> 员工提成表 控制器 </p>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ import com.xdadan.erp.emis.utils.WaybillHelper;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -53,7 +54,7 @@ import com.xdadan.erp.emis.service.IEmisCommissionProfitService;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工提成表Controller
|
* 员工提成表Controller
|
||||||
*
|
*
|
||||||
* @author linfso
|
* @author linfso
|
||||||
* @date 2024-10-24 01:46:36
|
* @date 2024-10-24 01:46:36
|
||||||
*/
|
*/
|
||||||
@ -75,9 +76,9 @@ public class EmisCommissionProfitController extends BaseController
|
|||||||
private EmisBaseService emisBaseService;
|
private EmisBaseService emisBaseService;
|
||||||
|
|
||||||
@GetMapping(value = "/reCalcByBillCode")
|
@GetMapping(value = "/reCalcByBillCode")
|
||||||
public AjaxResult reCalcByBillCode(String billCode)
|
@Async
|
||||||
{
|
public AjaxResult reCalcByBillCode(String billCode) {
|
||||||
if(StringUtils.isEmpty(billCode)){
|
if (StringUtils.isEmpty(billCode)) {
|
||||||
return AjaxResult.error("计算失败-单号不能为空");
|
return AjaxResult.error("计算失败-单号不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,6 +106,7 @@ public class EmisCommissionProfitController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/reCalcByBillMonth")
|
@GetMapping(value = "/reCalcByBillMonth")
|
||||||
|
@Async
|
||||||
public AjaxResult reCalcByBillMonth(String billMonth)
|
public AjaxResult reCalcByBillMonth(String billMonth)
|
||||||
{
|
{
|
||||||
if(StringUtils.isEmpty(billMonth)){
|
if(StringUtils.isEmpty(billMonth)){
|
||||||
@ -263,8 +265,8 @@ public class EmisCommissionProfitController extends BaseController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查是否重复
|
* 检查是否重复
|
||||||
*
|
*
|
||||||
* @param emisCommissionProfit
|
* @param emisCommissionProfit
|
||||||
* @return 数量
|
* @return 数量
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('emis:emisCommissionProfit:list')")
|
@PreAuthorize("@ss.hasPermi('emis:emisCommissionProfit:list')")
|
||||||
|
|||||||
@ -95,41 +95,53 @@ public class EmisSettlePayRecordCustomExcelUtil {
|
|||||||
createCell(row, 6, data.getBillCodes() != null ? data.getBillCodes() : "", dataStyle);
|
createCell(row, 6, data.getBillCodes() != null ? data.getBillCodes() : "", dataStyle);
|
||||||
|
|
||||||
// 账单金额
|
// 账单金额
|
||||||
BigDecimal billAmount = data.getBillAmount() != null ? data.getBillAmount() : BigDecimal.ZERO;
|
BigDecimal billAmount = data.getBillAmount();
|
||||||
createCell(row, 7, billAmount, numberStyle);
|
createCell(row, 7, billAmount, numberStyle);
|
||||||
totalBillAmount = totalBillAmount.add(billAmount);
|
if (billAmount != null && billAmount.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
totalBillAmount = totalBillAmount.add(billAmount);
|
||||||
|
}
|
||||||
|
|
||||||
// 开票金额
|
// 开票金额
|
||||||
BigDecimal invoiceAmount = data.getInvoiceAmount() != null ? data.getInvoiceAmount() : BigDecimal.ZERO;
|
BigDecimal invoiceAmount = data.getInvoiceAmount();
|
||||||
createCell(row, 8, invoiceAmount, numberStyle);
|
createCell(row, 8, invoiceAmount, numberStyle);
|
||||||
totalInvoiceAmount = totalInvoiceAmount.add(invoiceAmount);
|
if (invoiceAmount != null && invoiceAmount.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
totalInvoiceAmount = totalInvoiceAmount.add(invoiceAmount);
|
||||||
|
}
|
||||||
|
|
||||||
// 支付金额
|
// 支付金额
|
||||||
BigDecimal payMoney = data.getPayMoney() != null ? data.getPayMoney() : BigDecimal.ZERO;
|
BigDecimal payMoney = data.getPayMoney();
|
||||||
createCell(row, 9, payMoney, numberStyle);
|
createCell(row, 9, payMoney, numberStyle);
|
||||||
totalPayMoney = totalPayMoney.add(payMoney);
|
if (payMoney != null && payMoney.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
totalPayMoney = totalPayMoney.add(payMoney);
|
||||||
|
}
|
||||||
|
|
||||||
// 理赔金额
|
// 理赔金额
|
||||||
BigDecimal satisfyMoney = data.getSatisfyMoney() != null ? data.getSatisfyMoney() : BigDecimal.ZERO;
|
BigDecimal satisfyMoney = data.getSatisfyMoney();
|
||||||
createCell(row, 10, satisfyMoney, numberStyle);
|
createCell(row, 10, satisfyMoney, numberStyle);
|
||||||
totalSatisfyMoney = totalSatisfyMoney.add(satisfyMoney);
|
if (satisfyMoney != null && satisfyMoney.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
totalSatisfyMoney = totalSatisfyMoney.add(satisfyMoney);
|
||||||
|
}
|
||||||
|
|
||||||
// 折让金额
|
// 折让金额
|
||||||
BigDecimal allowanceMoney = data.getAllowanceMoney() != null ? data.getAllowanceMoney()
|
BigDecimal allowanceMoney = data.getAllowanceMoney();
|
||||||
: BigDecimal.ZERO;
|
|
||||||
createCell(row, 11, allowanceMoney, numberStyle);
|
createCell(row, 11, allowanceMoney, numberStyle);
|
||||||
totalAllowanceMoney = totalAllowanceMoney.add(allowanceMoney);
|
if (allowanceMoney != null && allowanceMoney.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
totalAllowanceMoney = totalAllowanceMoney.add(allowanceMoney);
|
||||||
|
}
|
||||||
|
|
||||||
// 抵扣金额
|
// 抵扣金额
|
||||||
BigDecimal deductionMoney = data.getDeductionMoney() != null ? data.getDeductionMoney()
|
BigDecimal deductionMoney = data.getDeductionMoney();
|
||||||
: BigDecimal.ZERO;
|
|
||||||
createCell(row, 12, deductionMoney, numberStyle);
|
createCell(row, 12, deductionMoney, numberStyle);
|
||||||
totalDeductionMoney = totalDeductionMoney.add(deductionMoney);
|
if (deductionMoney != null && deductionMoney.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
totalDeductionMoney = totalDeductionMoney.add(deductionMoney);
|
||||||
|
}
|
||||||
|
|
||||||
// 其他收费
|
// 其他收费
|
||||||
BigDecimal otherMoney = data.getOtherMoney() != null ? data.getOtherMoney() : BigDecimal.ZERO;
|
BigDecimal otherMoney = data.getOtherMoney();
|
||||||
createCell(row, 13, otherMoney, numberStyle);
|
createCell(row, 13, otherMoney, numberStyle);
|
||||||
totalOtherMoney = totalOtherMoney.add(otherMoney);
|
if (otherMoney != null && otherMoney.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
totalOtherMoney = totalOtherMoney.add(otherMoney);
|
||||||
|
}
|
||||||
|
|
||||||
// 理赔原因
|
// 理赔原因
|
||||||
createCell(row, 14, data.getSatisfyReason() != null ? data.getSatisfyReason() : "", dataStyle);
|
createCell(row, 14, data.getSatisfyReason() != null ? data.getSatisfyReason() : "", dataStyle);
|
||||||
@ -367,9 +379,14 @@ public class EmisSettlePayRecordCustomExcelUtil {
|
|||||||
*/
|
*/
|
||||||
private static void createCell(Row row, int columnIndex, BigDecimal value, CellStyle style) {
|
private static void createCell(Row row, int columnIndex, BigDecimal value, CellStyle style) {
|
||||||
Cell cell = row.createCell(columnIndex);
|
Cell cell = row.createCell(columnIndex);
|
||||||
BigDecimal formattedValue = formatBigDecimal(value);
|
// 如果BigDecimal值为null或为0,则设置为空字符串
|
||||||
// 使用toPlainString()避免科学计数法,然后转换为double
|
if (value == null || value.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
cell.setCellValue(formattedValue.toPlainString());
|
cell.setCellValue("");
|
||||||
|
} else {
|
||||||
|
BigDecimal formattedValue = formatBigDecimal(value);
|
||||||
|
// 使用toPlainString()避免科学计数法,然后转换为double
|
||||||
|
cell.setCellValue(formattedValue.toPlainString());
|
||||||
|
}
|
||||||
cell.setCellStyle(style);
|
cell.setCellStyle(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user