更新0812

This commit is contained in:
xyc 2025-08-12 14:39:56 +08:00
parent b0bb97d65f
commit 5e2d58e758
8 changed files with 101 additions and 12 deletions

View File

@ -182,7 +182,7 @@ public class InspectionMallPartnersController extends BaseController {
Map<String, Object> stringObjectMap = orderInfoService.workOrderData(query);
rows.add(CollUtil.newArrayList("公示价格汇总:", "", String.valueOf(Double.parseDouble(stringObjectMap.get("goodsPriceSum").toString()) / 100d) + "", "实付金额汇总:", "", String.valueOf(Double.parseDouble(stringObjectMap.get("payMoneySum").toString()) / 100d) + ""));
rows.add(CollUtil.newArrayList("车牌号", "检测车型", "检测类型", "业务渠道", "客户来源", "经办人", "承保公司", "交强到期时间", "商业到期时间", "公示价格", "实收金额", "付款时间", "客户手机号", "支付方式", "开始时间", "结束时间", "检测结果", "出纳是否确认"));
rows.add(CollUtil.newArrayList("车牌号", "检测车型", "检测类型", "业务渠道", "客户来源", "经办人", "承保公司", "交强到期时间", "商业到期时间", "公示价格", "实收金额", "优惠金额","付款时间", "客户手机号", "支付方式", "开始时间", "结束时间", "检测结果", "出纳是否确认"));
List<DictDataDO> sysDictData = dictDataService.getDictDataListByDictType("pay_type");
@ -225,7 +225,8 @@ public class InspectionMallPartnersController extends BaseController {
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
.toString(), ObjectUtil.isEmpty(item.getRealPayMoney()) ? "暂未支付" : BigDecimal.valueOf(item.getRealPayMoney())
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
.toString(), ObjectUtil.isEmpty(item.getPayTime()) ? "暂未支付" : DateUtil.format(item.getPayTime(), "yyyy-MM-dd hh:mm"),
.toString(), ObjectUtil.isEmpty(item.getReduceMoney()) ? "" : BigDecimal.valueOf(item.getReduceMoney())
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP).toString(),ObjectUtil.isEmpty(item.getPayTime()) ? "暂未支付" : DateUtil.format(item.getPayTime(), "yyyy-MM-dd hh:mm"),
Optional.ofNullable(item.getBuyPhone()).orElse(""), payTypeStr, ObjectUtil.isEmpty(item.getStartTime()) ? "" : DateUtil.format(item.getStartTime(), "yyyy-MM-dd hh:mm"), ObjectUtil.isEmpty(item.getEndTime()) ? "" : DateUtil.format(item.getEndTime(), "yyyy-MM-dd hh:mm"), isPassStr, cashier));
}
@ -331,7 +332,7 @@ public class InspectionMallPartnersController extends BaseController {
}
// ====== 合并单元格写标题 ======
writer.merge(17, titleBuilder.toString());
writer.merge(18, titleBuilder.toString());
// ====== 设置标题行高 ======
writer.setRowHeight(0, 30);

View File

@ -643,6 +643,19 @@ public class PartnerOwnController extends BaseController {
return success();
}
/**
* @description: 结算订单
* @param infoVo 订单信息
* @return: cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
* @author
* @date: 2025/8/12 11:28
*/
@PostMapping("/settlement")
public CommonResult<?> settlement(@RequestBody InspectionInfoVo infoVo) {
partnerList.settlement(infoVo);
return success();
}
/**
* 批量结算
*

View File

@ -119,6 +119,9 @@ public class InspectionInfo extends TenantBaseDO
/** 检查工手机号 */
@TableField(exist = false)
private Long realPayMoney;
/** 检查工手机号 */
@TableField(exist = false)
private Long reduceMoney;
/** 订单号 */
@TableField(exist = false)
private String orderNo;
@ -260,4 +263,25 @@ public class InspectionInfo extends TenantBaseDO
private String insuranceCompanyName;
@TableField(exist = false)
private List<String> datetimeRange;
/**
* 结算金额
*/
@TableField(exist = false)
private Long settlementAmount;
/**
* 结算人
*/
@TableField(exist = false)
private Long settlementUser;
/**
* 结算优惠金额
*/
@TableField(exist = false)
private Long settlementDiscount;
/**
* 结算账户
*/
@TableField(exist = false)
private String receivablesAccount;
}

View File

@ -290,4 +290,13 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
* @param query
*/
void batchSettlement(OrderTableQuery query);
/**
* @description: 结算订单
* @param infoVo
* @return: void
* @author
* @date: 2025/8/12 11:28
*/
void settlement(InspectionInfoVo infoVo);
}

View File

@ -1736,10 +1736,11 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
AdminUserDO meetMan = userMap.get(info.getMeetManId());
InspectionInfoVo res = new InspectionInfoVo();
BeanUtils.copyProperties(order, res); // 建议手动复制必要字段
BeanUtils.copyProperties(info, res);
BeanUtils.copyProperties(order, res); // 建议手动复制必要字段
res.setInspectionId(info.getId());
res.setSettlementAmount(order.getSettlementAmount());
res.setBuyUserName(buyUser != null ? buyUser.getNickname() : "");
res.setBuyUserPhone(buyUser != null ? buyUser.getMobile() : "");
res.setReturnCarUserId(info.getReturnCarUserId());
@ -1843,6 +1844,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
}
InspectionStepInfo latest = stepInfoService.getOne(Wrappers.<InspectionStepInfo>lambdaQuery()
.eq(InspectionStepInfo::getInspectionInfoId, info.getId())
.isNotNull(InspectionStepInfo::getUpdateTime)
.orderByDesc(InspectionStepInfo::getCreateTime).last("LIMIT 1"));
return latest != null ? DateUtil.betweenMs(info.getStartTime(), latest.getUpdateTime()) : 0;
}
@ -2517,7 +2519,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
public List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject) {
List<Map<String, Object>> staffCount = inspectionWorkNodeService.getStaffCount(dlInspectionProject);
// 根据userId查询检测工单表 接车人
List<InspectionInfo> list = inspectionInfoService.selectMeetCarList(dlInspectionProject.getDatetimeRange(),null);
List<InspectionInfo> list = inspectionInfoService.selectMeetCarList(dlInspectionProject.getDatetimeRange(), null);
// 统计每个 meetManId 的数量避免 null key 异常
Map<Long, List<InspectionInfo>> meetManIdCountMap = list.stream()
.filter(info -> info.getMeetManId() != null) // 过滤 null
@ -2769,9 +2771,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
/**
* 文件统计列表
*
* @param servicePackageId
* @param startTime 开始时间
* @param endTime 结束时间
* @param startTime 开始时间
* @param endTime 结束时间
* @return 结果
*/
@Override
@ -2802,8 +2803,6 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
/**
* 批量结算
*
* @param query
*/
@Override
@Transactional
@ -2878,4 +2877,22 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
.set(OrderInfo::getAccountingConfirmUser, SecurityFrameworkUtils.getLoginUserId()));
}
}
/**
* @description: 结算订单
* @return: void
* @author
* @date: 2025/8/12 11:28
*/
@Override
public void settlement(InspectionInfoVo infoVo) {
/* 1.查询订单id*/
InspectionInfo info = inspectionInfoService.getById(infoVo.getInspectionId());
/* 2.更新订单表*/
orderService.update(Wrappers.<OrderInfo>lambdaUpdate()
.eq(OrderInfo::getId, info.getInspectionOrderId())
.set(OrderInfo::getSettlementAmount, infoVo.getSettlementAmount() * 100)
.set(OrderInfo::getSettlementUser, SecurityFrameworkUtils.getLoginUserId())
.set(OrderInfo::getSettlementReduceMoney, infoVo.getSettlementReduceMoney() * 100));
}
}

View File

@ -157,4 +157,16 @@ public class InspectionInfoVo {
/** 保险公司名称 */
private String insuranceCompanyName;
/**
* 结算金额
*/
private Long settlementAmount;
/**
* 结算人
*/
private Long settlementUser;
/**
* 结算优惠金额
*/
private Long settlementReduceMoney;
}

View File

@ -103,6 +103,18 @@ public class OrderInfo extends TenantBaseDO {
* 文件
*/
private String files;
/**
* 结算金额
*/
private Long settlementAmount;
/**
* 结算人
*/
private Long settlementUser;
/**
* 结算优惠金额
*/
private Long settlementReduceMoney;
/**
* 出纳是否确认 0-未到账 1-已到账 null-待确认
*/

View File

@ -716,14 +716,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
realPayMoney
,oi.pay_type,oi.order_status as
orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,oi.cashier_confirm,oi.cashier_confirm_remark,oi.cashier_confirm_time
,oi.accounting_confirm,oi.accounting_confirm_remark,
,oi.accounting_confirm,oi.accounting_confirm_remark,oi.reduce_money as reduceMoney,oi.settlement_amount,oi.settlement_reduce_money,oi.settlement_user,oi.receivables_account,
car.next_inspection_date,car.insurance_company_name,car.insurance_expiry_date,car.vehicle_insurance_expiry_date
from inspection_info ins
left join order_info oi on oi.id = ins.inspection_order_id
left join system_users su on su.id = ins.user_id
left join system_user_role sur on sur.user_id = su.id
LEFT JOIN shop_user_car car on car.car_no = ins.car_num
where 1=1 AND ins.deleted = 0
where 1=1 AND ins.deleted = 0 AND oi.deleted = 0
<if test="query.carModelOrCarYear!=null and query.carModelOrCarYear!=''">
and (ins.car_num like concat('%',#{query.carModelOrCarYear},'%')
OR ins.certificate_num like concat('%',#{query.carModelOrCarYear},'%'))
@ -772,6 +772,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and oi.cashier_confirm = 1
and (oi.accounting_confirm is null or oi.accounting_confirm != 1)
</if>
GROUP BY ins.id
order by ins.start_time desc
</select>
<select id="workOrderDataNew" resultType="java.util.Map">