Compare commits
No commits in common. "33b2b79663b3177db1da89eae62b16e65f6f3dd5" and "baf972df52f9335335cd24bc87b11bedb71ee3f8" have entirely different histories.
33b2b79663
...
baf972df52
@ -21,7 +21,5 @@ public class RepairCons {
|
|||||||
/**数据字典常量-repair_unit-*/
|
/**数据字典常量-repair_unit-*/
|
||||||
public static final String DICT_REPAIR_WORK_TYPE = "repair_work_type";
|
public static final String DICT_REPAIR_WORK_TYPE = "repair_work_type";
|
||||||
/** 数据字典常量-repair_part_disposal */
|
/** 数据字典常量-repair_part_disposal */
|
||||||
public static final String DICT_REPAIR_PART_DISPOSAL = "repair_part_disposal";
|
public static final String REPAIR_PART_DISPOSAL = "repair_part_disposal";
|
||||||
/** 数据字典常量-repair_pay_type */
|
|
||||||
public static final String DICT_REPAIR_PAY_TYPE = "repair_pay_type";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -205,8 +205,6 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 门店信息
|
// 门店信息
|
||||||
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||||
DeptRespDTO dept = deptApi.getDept(deptId);
|
DeptRespDTO dept = deptApi.getDept(deptId);
|
||||||
@ -512,7 +510,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
params.put("mileage", "未知");
|
params.put("mileage", "未知");
|
||||||
// 旧件处理
|
// 旧件处理
|
||||||
// 获取字典数据
|
// 获取字典数据
|
||||||
List<DictDataRespDTO> dataList = dictDataApi.getDictDataList(DICT_REPAIR_PART_DISPOSAL);
|
List<DictDataRespDTO> dataList = dictDataApi.getDictDataList(REPAIR_PART_DISPOSAL);
|
||||||
// 找到对应的处理方式
|
// 找到对应的处理方式
|
||||||
DictDataRespDTO dictDataRespDTO = dataList.stream().filter(item -> item.getValue().equals(tickets.getPartDisposal())).findFirst().orElse(null);
|
DictDataRespDTO dictDataRespDTO = dataList.stream().filter(item -> item.getValue().equals(tickets.getPartDisposal())).findFirst().orElse(null);
|
||||||
params.put("oldhandle", Objects.requireNonNull(dictDataRespDTO).getLabel());
|
params.put("oldhandle", Objects.requireNonNull(dictDataRespDTO).getLabel());
|
||||||
@ -550,14 +548,10 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
project.put("repItem", item.getItemName());
|
project.put("repItem", item.getItemName());
|
||||||
project.put("repPrice", item.getItemPrice());
|
project.put("repPrice", item.getItemPrice());
|
||||||
project.put("repCount", item.getItemCount());
|
project.put("repCount", item.getItemCount());
|
||||||
BigDecimal itemDiscount = item.getItemDiscount();
|
project.put("repDiscount", item.getItemDiscount() == null ? "无折扣" : item.getItemDiscount());
|
||||||
if (ObjectUtil.isEmpty(item.getItemDiscount())) {
|
// todo 工时费
|
||||||
itemDiscount = new BigDecimal("1.00");
|
|
||||||
}
|
|
||||||
project.put("repDiscount", itemDiscount.equals(new BigDecimal("1.00")) ? "无折扣" : item.getItemDiscount());
|
|
||||||
// 工时费 项目打折后的费用
|
|
||||||
// 取不到先给0
|
// 取不到先给0
|
||||||
project.put("labourAmount", item.getItemMoney());
|
project.put("labourAmount", 0.00);
|
||||||
project.put("major", item.getRepairNames());
|
project.put("major", item.getRepairNames());
|
||||||
project.put("repRemark", item.getRemark());
|
project.put("repRemark", item.getRemark());
|
||||||
if (ObjectUtil.isNotEmpty(item.getItemTypeId())) {
|
if (ObjectUtil.isNotEmpty(item.getItemTypeId())) {
|
||||||
@ -568,6 +562,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
configureBuilder.bind("projects", new HackLoopTableRenderPolicy());
|
configureBuilder.bind("projects", new HackLoopTableRenderPolicy());
|
||||||
|
// todo 有问题,不渲染
|
||||||
params.put("projects", projects);
|
params.put("projects", projects);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -576,38 +571,18 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
// 取出维修工单子表的配件
|
// 取出维修工单子表的配件
|
||||||
List<DlRepairTitem> waresList = titems.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList());
|
List<DlRepairTitem> waresList = titems.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList());
|
||||||
List<Map<String, Object>> wares = new ArrayList<>();
|
List<Map<String, Object>> wares = new ArrayList<>();
|
||||||
// 取出对应需要的其他表的数据备用
|
|
||||||
List<DictDataRespDTO> unitDataList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT);
|
|
||||||
if (CollectionUtil.isNotEmpty(waresList)) {
|
if (CollectionUtil.isNotEmpty(waresList)) {
|
||||||
waresList.forEach(item -> {
|
waresList.forEach(item -> {
|
||||||
Map<String, Object> ware = new HashMap<>();
|
Map<String, Object> ware = new HashMap<>();
|
||||||
ware.put("matRort", wares.size() + 1);
|
ware.put("matRort", wares.size() + 1);
|
||||||
// 配件号
|
// todo 配件号
|
||||||
// 先取配件
|
ware.put("matNum", "");
|
||||||
RepairWares wareById = waresService.getOne(new LambdaQueryWrapper<RepairWares>().eq(RepairWares::getId, item.getPartId()));
|
|
||||||
String matNum = "";
|
|
||||||
if (ObjectUtil.isNotEmpty(wareById)) {
|
|
||||||
matNum = wareById.getCode();
|
|
||||||
}
|
|
||||||
ware.put("matNum", matNum);
|
|
||||||
ware.put("matName", item.getItemName());
|
ware.put("matName", item.getItemName());
|
||||||
// 单位
|
// todo 单位
|
||||||
// 先取单位字典
|
ware.put("matUnit", item.getItemUnit());
|
||||||
String matUnit = "";
|
|
||||||
if (CollectionUtil.isNotEmpty(unitDataList) && ObjectUtil.isNotEmpty(item.getItemUnit())) {
|
|
||||||
DictDataRespDTO unit = unitDataList.stream().filter(i -> i.getValue().equals(item.getItemUnit())).findFirst().orElse(null);
|
|
||||||
if (unit != null) {
|
|
||||||
matUnit = unit.getLabel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ware.put("matUnit", matUnit);
|
|
||||||
ware.put("matPrice", item.getItemPrice());
|
ware.put("matPrice", item.getItemPrice());
|
||||||
ware.put("matCount", item.getItemCount());
|
ware.put("matCount", item.getItemCount());
|
||||||
BigDecimal itemDiscount = item.getItemDiscount();
|
ware.put("matDiscount", item.getItemDiscount() == null ? "无折扣" : item.getItemDiscount());
|
||||||
if (ObjectUtil.isEmpty(item.getItemDiscount())) {
|
|
||||||
itemDiscount = new BigDecimal("1.00");
|
|
||||||
}
|
|
||||||
ware.put("matDiscount", itemDiscount.equals(new BigDecimal("1.00")) ? "无折扣" : item.getItemDiscount());
|
|
||||||
ware.put("matAmount", item.getItemMoney());
|
ware.put("matAmount", item.getItemMoney());
|
||||||
ware.put("matRemark", item.getRemark());
|
ware.put("matRemark", item.getRemark());
|
||||||
if (ObjectUtil.isNotEmpty(item.getItemTypeId())) {
|
if (ObjectUtil.isNotEmpty(item.getItemTypeId())) {
|
||||||
@ -618,6 +593,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
configureBuilder.bind("wares", new HackLoopTableRenderPolicy());
|
configureBuilder.bind("wares", new HackLoopTableRenderPolicy());
|
||||||
|
// todo 同样是不渲染
|
||||||
params.put("wares", wares);
|
params.put("wares", wares);
|
||||||
// 小计
|
// 小计
|
||||||
params.put("matTotalAmount", tickets.getPartPrice());
|
params.put("matTotalAmount", tickets.getPartPrice());
|
||||||
@ -625,15 +601,14 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
/*
|
/*
|
||||||
4、其他信息
|
4、其他信息
|
||||||
*/
|
*/
|
||||||
// 目前能取到:材料费、材料费优惠、总费用、应收费、大写、工单备注、工时费、工时费优惠、其他费、材料工时优惠
|
// 目前能取到:材料费、材料费优惠、总费用、应收费、大写、工单备注
|
||||||
// 计算配件没打折的总金额
|
// 计算配件没打折的总金额
|
||||||
BigDecimal matCost = waresList.stream()
|
BigDecimal matCost = waresList.stream()
|
||||||
.map(item -> item.getItemPrice().multiply(BigDecimal.valueOf(item.getItemCount())))
|
.map(item -> item.getItemPrice().multiply(BigDecimal.valueOf(item.getItemCount())))
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
params.put("matCost", matCost);
|
params.put("matCost", matCost);
|
||||||
// 没打折的金额减去打折后的总金额得到优惠了多少钱
|
// 没打折的金额减去打折后的总金额得到优惠了多少钱
|
||||||
BigDecimal matFavorable = matCost.subtract(ObjectUtil.isNotEmpty(tickets.getPartPrice()) ? tickets.getPartPrice() : BigDecimal.ZERO);
|
params.put("matFavorable", matCost.subtract(tickets.getPartPrice()));
|
||||||
params.put("matFavorable", matFavorable);
|
|
||||||
// 计算没打折的工单总价
|
// 计算没打折的工单总价
|
||||||
BigDecimal matTotalCost = titems.stream().map(item -> item.getItemPrice().multiply(BigDecimal.valueOf(item.getItemCount()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal matTotalCost = titems.stream().map(item -> item.getItemPrice().multiply(BigDecimal.valueOf(item.getItemCount()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
params.put("matTotalCost", matTotalCost);
|
params.put("matTotalCost", matTotalCost);
|
||||||
@ -644,20 +619,13 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
params.put("bigAllCost", bigAllCost);
|
params.put("bigAllCost", bigAllCost);
|
||||||
// 这个备注现在是工单备注
|
// 这个备注现在是工单备注
|
||||||
params.put("paperRemark", tickets.getRemark());
|
params.put("paperRemark", tickets.getRemark());
|
||||||
// 项目没打折的总价
|
// todo 目前取不到:管理费、工时费、工时费优惠、其他费、材料工时优惠、救援费、三包费、定损费、付款情况、结算备注(这个是因为和工单备注用的同一个)、客户签字
|
||||||
BigDecimal labourCost = projectList.stream().map(item -> item.getItemPrice().multiply(BigDecimal.valueOf(item.getItemCount()))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
params.put("labourCost", labourCost);
|
|
||||||
// 项目没打折的总价减打折后的总价就是优惠
|
|
||||||
BigDecimal labourFavorable = labourCost.subtract(ObjectUtil.isNotEmpty(tickets.getProjectPrice()) ? tickets.getProjectPrice() : BigDecimal.ZERO);
|
|
||||||
params.put("labourFavorable", labourFavorable);
|
|
||||||
// 其他费用 维修工单的其他子项的费用
|
|
||||||
params.put("otherCost", ObjectUtil.isNotEmpty(tickets.getOtherPrice()) ? tickets.getOtherPrice() : 0.00);
|
|
||||||
// 材料工时优惠 材料优惠+工时优惠
|
|
||||||
params.put("matlabourFavorable", matFavorable.add(labourFavorable));
|
|
||||||
|
|
||||||
// todo 目前取不到:管理费、救援费、三包费、定损费、结算备注(这个是因为和工单备注用的同一个)、客户签字
|
|
||||||
// 取不到的先默认为0或未知
|
// 取不到的先默认为0或未知
|
||||||
params.put("manageCost", 0.00);
|
params.put("manageCost", 0.00);
|
||||||
|
params.put("labourCost", 0.00);
|
||||||
|
params.put("labourFavorable", 0.00);
|
||||||
|
params.put("otherCost", 0.00);
|
||||||
|
params.put("matlabourFavorable", 0.00);
|
||||||
params.put("rescueCost", 0.00);
|
params.put("rescueCost", 0.00);
|
||||||
params.put("tripleCost", 0.00);
|
params.put("tripleCost", 0.00);
|
||||||
params.put("lossCost", 0.00);
|
params.put("lossCost", 0.00);
|
||||||
@ -666,30 +634,16 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
/*
|
/*
|
||||||
5、最后结尾
|
5、最后结尾
|
||||||
*/
|
*/
|
||||||
// 目前能取到:服务顾问、联系电话、结算日期、付款情况
|
// 目前能取到:服务顾问、联系电话、结算日期
|
||||||
params.put("serviceConsultant", tickets.getAdviserName());
|
params.put("serviceConsultant", tickets.getAdviserName());
|
||||||
AdminUserRespDTO adviser = adminUserApi.getUser(Long.valueOf(tickets.getAdviserId()));
|
AdminUserRespDTO adviser = adminUserApi.getUser(Long.valueOf(tickets.getAdviserId()));
|
||||||
if (ObjectUtil.isNotEmpty(adviser) && ObjectUtil.isNotEmpty(adviser.getMobile())) {
|
if (ObjectUtil.isNotEmpty(adviser) && ObjectUtil.isNotEmpty(adviser.getMobile())) {
|
||||||
params.put("serviceTelephone", adviser.getMobile());
|
params.put("serviceTelephone", adviser.getMobile());
|
||||||
}
|
}
|
||||||
RepairOrderInfo orderInfo = repairOrderInfoService.getOne(new LambdaQueryWrapper<RepairOrderInfo>().eq(RepairOrderInfo::getGoodsId, tickets.getId()));
|
RepairOrderInfo orderInfo = repairOrderInfoService.getOne(new LambdaQueryWrapper<RepairOrderInfo>().eq(RepairOrderInfo::getGoodsId, tickets.getId()));
|
||||||
if (ObjectUtil.isNotEmpty(orderInfo)) {
|
if (ObjectUtil.isNotEmpty(orderInfo) && ObjectUtil.isNotEmpty(orderInfo.getPayTime())) {
|
||||||
if (ObjectUtil.isNotEmpty(orderInfo.getPayTime())) {
|
params.put("settleDate", date.format(orderInfo.getPayTime()));
|
||||||
params.put("settleDate", date.format(orderInfo.getPayTime()));
|
|
||||||
}
|
|
||||||
// 付款情况
|
|
||||||
// 先取支付字典
|
|
||||||
List<DictDataRespDTO> payTypes = dictDataApi.getDictDataList(DICT_REPAIR_PAY_TYPE);
|
|
||||||
String costCondition = "未支付";
|
|
||||||
if (ObjectUtil.isNotEmpty(payTypes) && ObjectUtil.isNotEmpty(orderInfo.getPayType())) {
|
|
||||||
DictDataRespDTO payType = payTypes.stream().filter(item -> item.getValue().equals(orderInfo.getPayType())).findFirst().orElse(null);
|
|
||||||
if (payType != null) {
|
|
||||||
costCondition = payType.getLabel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params.put("costCondition", costCondition);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo 目前取不到:单位、开户行、地址、账号
|
// todo 目前取不到:单位、开户行、地址、账号
|
||||||
// 取不到的先给未知
|
// 取不到的先给未知
|
||||||
params.put("corporation", "未知");
|
params.put("corporation", "未知");
|
||||||
@ -699,7 +653,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
|
|
||||||
Configure config = configureBuilder.build();
|
Configure config = configureBuilder.build();
|
||||||
try {
|
try {
|
||||||
InputStream inputStream = XWPFTemplate.class.getResourceAsStream("/templates/ticketTemplate.docx");
|
InputStream inputStream = XWPFTemplate.class.getResourceAsStream("/templates/gdmb.docx");
|
||||||
XWPFTemplate template = XWPFTemplate.compile(inputStream, config);
|
XWPFTemplate template = XWPFTemplate.compile(inputStream, config);
|
||||||
template.render(params);
|
template.render(params);
|
||||||
FileOutputStream fos = new FileOutputStream(tmpPath);
|
FileOutputStream fos = new FileOutputStream(tmpPath);
|
||||||
|
|||||||
@ -35,8 +35,7 @@
|
|||||||
主修人
|
主修人
|
||||||
备注
|
备注
|
||||||
性质
|
性质
|
||||||
[repPort
|
[report]
|
||||||
]
|
|
||||||
[repItem]
|
[repItem]
|
||||||
[repPrice]
|
[repPrice]
|
||||||
[repCount]
|
[repCount]
|
||||||
|
|||||||
@ -1,97 +0,0 @@
|
|||||||
泸州市蓝安汽车销售有限公司
|
|
||||||
车辆维修结算单
|
|
||||||
工号:{{jobNumber}}
|
|
||||||
客户名称:
|
|
||||||
{{customerName}}
|
|
||||||
送修人:
|
|
||||||
{{repairer}}
|
|
||||||
送修人电话:
|
|
||||||
{{repairerTelephone}}
|
|
||||||
车牌:
|
|
||||||
{{plate}}
|
|
||||||
车型:
|
|
||||||
{{carType}}
|
|
||||||
发动机号码:
|
|
||||||
{{engineNumber}}
|
|
||||||
车架号:
|
|
||||||
{{frameNumber}}
|
|
||||||
开单时间:
|
|
||||||
{{billingTime}}
|
|
||||||
已行里程:
|
|
||||||
{{mileage}}
|
|
||||||
三包单位:
|
|
||||||
{{tripleUnit}}
|
|
||||||
保险名称:
|
|
||||||
{{insuranceName}}
|
|
||||||
旧件处理:
|
|
||||||
{{oldhandle}}
|
|
||||||
维修内容
|
|
||||||
{{projects}}序号
|
|
||||||
维修项目
|
|
||||||
单价
|
|
||||||
数量
|
|
||||||
折扣率
|
|
||||||
工时费
|
|
||||||
主修人
|
|
||||||
备注
|
|
||||||
性质
|
|
||||||
[repRort]
|
|
||||||
[repItem]
|
|
||||||
[repPrice]
|
|
||||||
[repCount]
|
|
||||||
[repDiscount]
|
|
||||||
[labourAmount]
|
|
||||||
[major]
|
|
||||||
[repRemark]
|
|
||||||
[repNature]
|
|
||||||
材料清单
|
|
||||||
{{wares}}序号
|
|
||||||
配件件号
|
|
||||||
名称
|
|
||||||
单位
|
|
||||||
单价
|
|
||||||
数量
|
|
||||||
折扣率
|
|
||||||
金额
|
|
||||||
备注
|
|
||||||
性质
|
|
||||||
[matRort]
|
|
||||||
[matNum]
|
|
||||||
[matName]
|
|
||||||
[matUnit]
|
|
||||||
[matPrice]
|
|
||||||
[matCount]
|
|
||||||
[matDiscount]
|
|
||||||
[matAmount]
|
|
||||||
[matRemark]
|
|
||||||
[matNature]
|
|
||||||
小计
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{matTotalAmount}}
|
|
||||||
|
|
||||||
|
|
||||||
材料费:{{matCost}}
|
|
||||||
材料费优惠:{{matFavorable}}
|
|
||||||
管理费:{{manageCost}}
|
|
||||||
总费用:{{matTotalCost}}
|
|
||||||
工时费:{{labourCost}}
|
|
||||||
工时费优惠:{{labourFavorable}}
|
|
||||||
其他费:{{otherCost}}
|
|
||||||
材料工时优惠:{{matlabourFavorable}}
|
|
||||||
救援费:{{rescueCost}}
|
|
||||||
三包费:{{tripleCost}}
|
|
||||||
定损费:{{lossCost}}
|
|
||||||
应收费:{{allCost}}
|
|
||||||
大写:{{bigAllCost}}
|
|
||||||
付款情况:
|
|
||||||
{{costCondition}}
|
|
||||||
工单备注:{{paperRemark}}
|
|
||||||
客户签字:
|
|
||||||
结算备注:{{costRemark}}
|
|
||||||
|
|
||||||
单位:{{corporation}} 服务顾问:{{serviceConsultant}} 联系电话:{{serviceTelephone}}
|
|
||||||
开户行:{{bank}} 地址:{{bankAddress}}
|
|
||||||
账号:{{account}} 结算日期:{{settleDate}}
|
|
||||||
Loading…
Reference in New Issue
Block a user