结算导出修改

This commit is contained in:
syruan 2025-10-21 18:00:57 +08:00
parent 594c725e02
commit 40c26fce29
2 changed files with 59 additions and 57 deletions

View File

@ -465,9 +465,7 @@ public class SltAgreementInfoController extends BaseController {
// 创建一个SimpleDateFormat对象定义日期格式 // 创建一个SimpleDateFormat对象定义日期格式
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Map<String, Object> maps = new LinkedHashMap<>(); Map<String, Object> maps = new LinkedHashMap<>();
if(type==1){ if (type == 1) {
// maps.put("unitName", bean.getUnitName());
// maps.put("projectName", bean.getProjectName());
if (flag==0){ if (flag==0){
maps.put("typeName", bean.getTypeName()); maps.put("typeName", bean.getTypeName());
maps.put("modelName", bean.getModelName()); maps.put("modelName", bean.getModelName());
@ -490,17 +488,19 @@ public class SltAgreementInfoController extends BaseController {
maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP)); maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP));
maps.put("t1", ""); maps.put("t1", "");
} }
}else if(type==2) { } else if(type == 2) {
if(flag==0){ if(flag==0){
maps.put("typeName", bean.getTypeName()); maps.put("typeName", bean.getTypeName());
maps.put("modelName", bean.getModelName()); maps.put("modelName", bean.getModelName());
maps.put("mtUnitName", bean.getMtUnitName()); maps.put("mtUnitName", bean.getMtUnitName());
maps.put("buyPrice", bean.getBuyPrice());
maps.put("num", bean.getNum()); maps.put("num", bean.getNum());
maps.put("costs", bean.getCosts()); maps.put("costs", bean.getCosts());
}else{ }else{
maps.put("typeName", bean.getTypeName()); maps.put("typeName", bean.getTypeName());
maps.put("modelName", bean.getModelName()); maps.put("modelName", bean.getModelName());
maps.put("mtUnitName", bean.getMtUnitName()); maps.put("mtUnitName", bean.getMtUnitName());
maps.put("buyPrice", bean.getBuyPrice());
maps.put("num", bean.getNum()); maps.put("num", bean.getNum());
maps.put("costs", bean.getCosts()); maps.put("costs", bean.getCosts());
maps.put("t1", ""); maps.put("t1", "");
@ -509,57 +509,59 @@ public class SltAgreementInfoController extends BaseController {
maps.put("t4", ""); maps.put("t4", "");
maps.put("t5", ""); maps.put("t5", "");
} }
}else if(type==3){ } else if (type == 3) {
if(flag==0){ if (flag==0) {
maps.put("typeName", bean.getTypeName()); maps.put("typeName", bean.getTypeName());
maps.put("modelName", bean.getModelName()); maps.put("modelName", bean.getModelName());
maps.put("mtUnitName", bean.getMtUnitName()); maps.put("mtUnitName", bean.getMtUnitName());
maps.put("num", bean.getNum()); maps.put("num", bean.getNum());
maps.put("partType", bean.getPartType()); maps.put("partType", bean.getPartType());
maps.put("costs", bean.getCosts()); maps.put("costs", bean.getCosts());
}else{ } else {
maps.put("typeName", bean.getTypeName()); maps.put("typeName", bean.getTypeName());
maps.put("modelName", bean.getModelName()); maps.put("modelName", bean.getModelName());
maps.put("mtUnitName", bean.getMtUnitName()); maps.put("mtUnitName", bean.getMtUnitName());
maps.put("num", bean.getNum()); maps.put("num", bean.getNum());
maps.put("partType", bean.getPartType()); maps.put("partType", bean.getPartType());
maps.put("costs", bean.getCosts()); maps.put("costs", bean.getCosts());
maps.put("t1", ""); maps.put("t1", "");
maps.put("t2", ""); maps.put("t2", "");
maps.put("t3", ""); maps.put("t3", "");
maps.put("t4", ""); maps.put("t4", "");
} }
}else if(type==4){ } else if (type == 4) {
if(flag==0){ if (flag == 0) {
maps.put("typeName", bean.getTypeName()); maps.put("typeName", bean.getTypeName());
maps.put("modelName", bean.getModelName()); maps.put("modelName", bean.getModelName());
maps.put("mtUnitName", bean.getMtUnitName()); maps.put("mtUnitName", bean.getMtUnitName());
maps.put("num", bean.getNum()); maps.put("buyPrice", bean.getBuyPrice());
maps.put("partType", bean.getPartType()); maps.put("num", bean.getNum());
maps.put("costs", bean.getCosts()); maps.put("partType", bean.getPartType());
}else{ maps.put("costs", bean.getCosts());
maps.put("typeName", bean.getTypeName()); } else {
maps.put("modelName", bean.getModelName()); maps.put("typeName", bean.getTypeName());
maps.put("mtUnitName", bean.getMtUnitName()); maps.put("modelName", bean.getModelName());
maps.put("num", bean.getNum()); maps.put("mtUnitName", bean.getMtUnitName());
maps.put("partType", bean.getPartType()); maps.put("buyPrice", bean.getBuyPrice());
maps.put("costs", bean.getCosts()); maps.put("num", bean.getNum());
maps.put("t1", ""); maps.put("partType", bean.getPartType());
maps.put("t2", ""); maps.put("costs", bean.getCosts());
maps.put("t3", ""); maps.put("t1", "");
maps.put("t4", ""); maps.put("t2", "");
} maps.put("t3", "");
} else if(type==5){ maps.put("t4", "");
maps.put("typeName", bean.getTypeName()); }
maps.put("modelName", bean.getModelName()); } else if (type == 5) {
maps.put("mtUnitName", bean.getUnitName()); maps.put("typeName", bean.getTypeName());
maps.put("leasePrice", bean.getLeasePrice()); maps.put("modelName", bean.getModelName());
maps.put("num", bean.getReduceNum()); maps.put("mtUnitName", bean.getUnitName());
maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime())); maps.put("leasePrice", bean.getLeasePrice());
maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime())); maps.put("num", bean.getReduceNum());
maps.put("leaseDays", bean.getDays()); maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime()));
maps.put("remark", bean.getRemark()); maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime()));
maps.put("costs", bean.getLeaseMoney().setScale(2, RoundingMode.HALF_UP)); maps.put("leaseDays", bean.getDays());
maps.put("remark", bean.getRemark());
maps.put("costs", bean.getLeaseMoney().setScale(2, RoundingMode.HALF_UP));
} }
return maps; return maps;
} }
@ -571,9 +573,6 @@ public class SltAgreementInfoController extends BaseController {
private List<String> receiveDetailsHeader(int type,int flag) { private List<String> receiveDetailsHeader(int type,int flag) {
ArrayList<String> list = new ArrayList<String>(); ArrayList<String> list = new ArrayList<String>();
if(type==1){ if(type==1){
// list.add("结算单位");
// list.add("结算工程");
if (flag==0){ if (flag==0){
list.add("设备名称"); list.add("设备名称");
list.add("规格型号"); list.add("规格型号");
@ -601,12 +600,14 @@ public class SltAgreementInfoController extends BaseController {
list.add("设备名称"); list.add("设备名称");
list.add("规格型号"); list.add("规格型号");
list.add("计量单位"); list.add("计量单位");
list.add("扣款单价");
list.add("丢失数量"); list.add("丢失数量");
list.add("丢失费用(元)"); list.add("丢失费用(元)");
}else{ }else{
list.add("设备名称"); list.add("设备名称");
list.add("规格型号"); list.add("规格型号");
list.add("计量单位"); list.add("计量单位");
list.add("扣款单价");
list.add("丢失数量"); list.add("丢失数量");
list.add("丢失费用(元)"); list.add("丢失费用(元)");
list.add(" "); list.add(" ");
@ -641,6 +642,7 @@ public class SltAgreementInfoController extends BaseController {
list.add("设备名称"); list.add("设备名称");
list.add("规格型号"); list.add("规格型号");
list.add("计量单位"); list.add("计量单位");
list.add("扣款单价");
list.add("报废数量"); list.add("报废数量");
list.add("是否收费"); list.add("是否收费");
list.add("报废费用(元)"); list.add("报废费用(元)");
@ -648,6 +650,7 @@ public class SltAgreementInfoController extends BaseController {
list.add("设备名称"); list.add("设备名称");
list.add("规格型号"); list.add("规格型号");
list.add("计量单位"); list.add("计量单位");
list.add("扣款单价");
list.add("报废数量"); list.add("报废数量");
list.add("是否收费"); list.add("是否收费");
list.add("报废费用(元)"); list.add("报废费用(元)");
@ -747,21 +750,19 @@ public class SltAgreementInfoController extends BaseController {
} }
String projectName = handleData(projectNames); String projectName = handleData(projectNames);
String unitName = handleData(unitNames); String unitName = handleData(unitNames);
BigDecimal totalCost = BigDecimal.valueOf(0.00); BigDecimal totalCost = BigDecimal.ZERO;
for (SltAgreementInfo bean : loseList) { for (SltAgreementInfo bean : loseList) {
if (null == bean.getBuyPrice()) { if (null == bean.getBuyPrice()) {
bean.setBuyPrice(BigDecimal.valueOf(0.00)); bean.setBuyPrice(BigDecimal.ZERO);
} }
if (null == bean.getNum()) { if (null == bean.getNum()) {
bean.setNum(BigDecimal.valueOf(0L)); bean.setNum(BigDecimal.ZERO);
} }
BigDecimal buyPrice = bean.getBuyPrice(); BigDecimal buyPrice = bean.getBuyPrice();
BigDecimal num = bean.getNum(); BigDecimal num = bean.getNum();
// 原价 x 数量 // 原价 x 数量
BigDecimal costs = buyPrice.multiply(num); BigDecimal costs = buyPrice.multiply(num);
if(costs!=null){ totalCost = totalCost.add(costs);
totalCost = totalCost.add(costs);
}
//计算租赁费用 //计算租赁费用
bean.setCosts(costs); bean.setCosts(costs);
} }

View File

@ -135,6 +135,7 @@ public class SltLeaseInfo extends BaseEntity {
/** 原值 */ /** 原值 */
@ApiModelProperty(value = "原值") @ApiModelProperty(value = "原值")
@Excel(name = "扣款单价")
private BigDecimal buyPrice; private BigDecimal buyPrice;
private BigDecimal reduceNum; private BigDecimal reduceNum;