更新
This commit is contained in:
parent
aba4f32efa
commit
26e5fe05f4
@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO;
|
||||
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO;
|
||||
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -122,6 +123,21 @@ public class RepairOrderInfoController {
|
||||
return success(repairOrderInfoService.payTransactionsCode(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description : 新增发票信息(根据id进行修改)
|
||||
* @author xyc
|
||||
* @date 15:07 2025/11/13
|
||||
* @param [orderInfo]
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@PostMapping("/updateBilled")
|
||||
public CommonResult<?> updateBilled(@RequestBody RepairOrderInfo orderInfo) {
|
||||
RepairOrderInfo one = repairOrderInfoService.getOne(Wrappers.<RepairOrderInfo>lambdaQuery()
|
||||
.eq(RepairOrderInfo::getGoodsId, orderInfo.getId()));
|
||||
orderInfo.setId(one.getId());
|
||||
return CommonResult.success(repairOrderInfoService.updateById(orderInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
|
||||
@ -161,5 +161,16 @@ public class RepairOrderInfo extends TenantBaseDO {
|
||||
*/
|
||||
private String activeId;
|
||||
|
||||
/** 是否开票 */
|
||||
private String ifBilled;
|
||||
/** 开票人名字 */
|
||||
private String billedUsername;
|
||||
/** 开票人Id */
|
||||
private Long billedUserid;
|
||||
/** 开票二维码 */
|
||||
private String billedQrcode;
|
||||
/** 开票备注 */
|
||||
private String billedRemark;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -7,6 +7,13 @@ package cn.iocoder.yudao.common;
|
||||
* @date 16:51 2024/10/12
|
||||
**/
|
||||
public class RepairConstants {
|
||||
/**
|
||||
* 维修类型A
|
||||
*/
|
||||
public static final String REPAIR_TYPE_A = "01";
|
||||
|
||||
|
||||
/**
|
||||
* 维修类型B
|
||||
*/
|
||||
public static final String REPAIR_TYPE_B = "02";
|
||||
}
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.common;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @ClassName TicketsPayStatusEnum
|
||||
* @Description : 维修工单收款状态
|
||||
* @Author 许
|
||||
* @Date 2025/11/13 10:47
|
||||
* @Version 1.0.0
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum TicketsPayStatusEnum {
|
||||
/**
|
||||
* 待结算
|
||||
*/
|
||||
WAITING_SETTLEMENT("01","待结算"),
|
||||
/**
|
||||
* 待收款
|
||||
*/
|
||||
WAITING_PAY("02","待收款"),
|
||||
/**
|
||||
* 已收款
|
||||
*/
|
||||
RECEIVED("03","已收款"),
|
||||
/**
|
||||
* 反结算
|
||||
*/
|
||||
REVERSE_SETTLEMENT("04","反结算"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 角色code
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 根据角色code返回对应的枚举
|
||||
* @author vinjor-M
|
||||
* @date 14:23 2024/10/16
|
||||
* @param code 角色code
|
||||
* @return cn.iocoder.yudao.common.SystemEnum
|
||||
**/
|
||||
public static TicketsPayStatusEnum getRepairRole(String code) {
|
||||
for (TicketsPayStatusEnum roleEnum : TicketsPayStatusEnum.values()) {
|
||||
if (roleEnum.getCode().equalsIgnoreCase(code)) {
|
||||
// 找到对应的枚举
|
||||
return roleEnum;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("无效的角色code:" + code);
|
||||
}
|
||||
|
||||
}
|
||||
@ -125,6 +125,11 @@ public class DlRepairSo extends TenantBaseDO {
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String licenseNumber;
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ticketNo;
|
||||
|
||||
/** 用户记录那些人可以看这条记录 */
|
||||
private String userIds;
|
||||
|
||||
@ -309,10 +309,19 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
List<DlRepairTitem> itemList = ticketsRespVO.getItemList();
|
||||
List<DlRepairTitem> collect = itemList.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList());
|
||||
ticketsRespVO.setPartStatus(CollectionUtil.isEmpty(collect) ? "01" : "02");
|
||||
// 工单进行状态 默认是等待接单
|
||||
ticketsRespVO.setTicketsWorkStatus(TicketsWorkStatusEnum.WAITING_RECEIVING.getCode());
|
||||
// 工单状态 默认是待派工
|
||||
ticketsRespVO.setTicketsStatus(TicketsStatusEnum.NO_WORK.getCode());
|
||||
if(RepairConstants.REPAIR_TYPE_A.equals(ticketsRespVO.getRepairType())) {
|
||||
// 工单进行状态 默认是等待接单
|
||||
ticketsRespVO.setTicketsWorkStatus(TicketsWorkStatusEnum.WAITING_RECEIVING.getCode());
|
||||
// 工单状态 默认是待派工
|
||||
ticketsRespVO.setTicketsStatus(TicketsStatusEnum.NO_WORK.getCode());
|
||||
} else {
|
||||
// 工单进行状态 默认是已完成
|
||||
ticketsRespVO.setTicketsWorkStatus(TicketsWorkStatusEnum.END.getCode());
|
||||
// 工单状态 默认是已完成
|
||||
ticketsRespVO.setTicketsStatus(TicketsStatusEnum.OVER.getCode());
|
||||
// 支付状态 默认是已收款
|
||||
ticketsRespVO.setPayStatus(TicketsPayStatusEnum.RECEIVED.getCode());
|
||||
}
|
||||
|
||||
// 新增主表
|
||||
baseMapper.insert(ticketsRespVO);
|
||||
|
||||
@ -88,6 +88,12 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
|
||||
.ifPresent(bean::setWares);
|
||||
bean.setTypeName(typeMap.get(bean.getWares().getType()));
|
||||
bean.getWares().setUnit(unitMap.get(bean.getWares().getUnit()));
|
||||
// 增强健壮性:检查wares和price是否为空
|
||||
if (bean.getWares() != null && bean.getWares().getPrice() != null) {
|
||||
bean.setSalePrice(bean.getWares().getPrice());
|
||||
} else {
|
||||
bean.setSalePrice(null);
|
||||
}
|
||||
return bean;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@ -102,4 +102,14 @@ public class DlRepairTicketsRespVO extends DlRepairTickets {
|
||||
* 实收金额
|
||||
*/
|
||||
private BigDecimal realActualMoney;
|
||||
/** 是否开票 */
|
||||
private String ifBilled;
|
||||
/** 开票人名字 */
|
||||
private String billedUsername;
|
||||
/** 开票人Id */
|
||||
private Long billedUserid;
|
||||
/** 开票二维码 */
|
||||
private String billedQrcode;
|
||||
/** 开票备注 */
|
||||
private String billedRemark;
|
||||
}
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
<result property="twId" column="tw_id" />
|
||||
<result property="licenseNumber" column="license_number" />
|
||||
<result property="userIds" column="user_ids" />
|
||||
<result property="ticketNo" column="ticket_no" />
|
||||
|
||||
<!-- 子表集合 -->
|
||||
<collection property="items" ofType="cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi">
|
||||
@ -184,12 +185,14 @@
|
||||
wares.remark AS wares_remark,
|
||||
wares.status,
|
||||
wares.data_form,
|
||||
bw.name
|
||||
bw.name,
|
||||
drt.ticket_no
|
||||
FROM dl_repair_so so
|
||||
LEFT JOIN dl_ticket_wares dtw ON so.tw_id = dtw.id
|
||||
LEFT JOIN dl_repair_soi soi ON so.id = soi.so_id AND soi.deleted = '0'
|
||||
LEFT JOIN dl_repair_wares wares ON soi.goods_id = wares.id AND wares.deleted = '0'
|
||||
LEFT JOIN dl_base_warehouse bw ON soi.ware_id = bw.id AND bw.deleted = '0'
|
||||
LEFT JOIN dl_repair_tickets drt ON drt.id = dtw.ticket_id AND drt.deleted = '0'
|
||||
WHERE so.deleted = '0'
|
||||
<if test="map.soType != null and map.soType">
|
||||
and so.so_type = #{map.soType}
|
||||
|
||||
@ -131,6 +131,11 @@
|
||||
<result property="handleMobile" column="handle_mobile" />
|
||||
<result property="settlementTime" column="settlementTime" />
|
||||
<result property="accessoriesMoney" column="accessoriesMoney" />
|
||||
<result property="ifBilled" column="if_billed" />
|
||||
<result property="billedUserid" column="billed_userid" />
|
||||
<result property="billedUsername" column="billed_username" />
|
||||
<result property="billedQrcode" column="billed_qrcode" />
|
||||
<result property="billedRemark" column="billed_remark" />
|
||||
<association property="booking" javaType="cn.iocoder.yudao.module.booking.entity.DlRepairBooking" select="selectBookingById" column="id"/>
|
||||
<collection property="itemList" column="id" ofType="cn.iocoder.yudao.module.tickets.entity.DlRepairTitem" select="selectItemList" />
|
||||
</resultMap>
|
||||
@ -430,7 +435,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getPageTypeAll" resultMap="APPBaseResultMap">
|
||||
SELECT drt.*,drr.create_time AS settlementTime,
|
||||
SELECT drt.*,drr.create_time AS settlementTime,roi.if_billed,roi.billed_userid,roi.billed_username,roi.billed_qrcode,roi.billed_remark,
|
||||
/* 统计配件的成本 */
|
||||
(
|
||||
SELECT SUM(item_money - item_profit) FROM dl_repair_titem
|
||||
@ -442,7 +447,7 @@
|
||||
LEFT JOIN dl_repair_worker drw
|
||||
ON FIND_IN_SET(drw.user_id, drti.repair_ids) > 0 AND drw.deleted = '0'
|
||||
LEFT JOIN repair_order_info roi
|
||||
ON drt.ticket_no = roi.order_no AND roi.deleted = '0'
|
||||
ON drt.id = roi.goods_id AND roi.deleted = '0'
|
||||
LEFT JOIN dl_repair_records drr
|
||||
ON drr.ticket_id = drt.id AND drr.deleted = '0' AND drr.type = 'jssp'
|
||||
LEFT JOIN base_car_main bcm ON drt.car_id = bcm.id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user