0925
This commit is contained in:
parent
174eff8028
commit
f4bbc51fdd
@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
|
||||
import cn.iocoder.yudao.module.rescue.domain.*;
|
||||
import cn.iocoder.yudao.module.rescue.service.*;
|
||||
import cn.iocoder.yudao.module.rescue.vo.SetMoneyVO;
|
||||
import cn.iocoder.yudao.util.RedisCache;
|
||||
import cn.iocoder.yudao.module.rescue.core.text.HttpStatus;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
@ -173,15 +174,8 @@ public class RescueDriverController extends BaseController {
|
||||
|
||||
//设置应收金额
|
||||
@PostMapping("/setOrderMoneyNew")
|
||||
public CommonResult setOrderMoneyNew(@RequestParam("rescueId") String rescueId,
|
||||
@RequestParam("setMoney") Double setMoney,
|
||||
@RequestParam("autoRemark") String autoRemark,
|
||||
@RequestParam(name = "images" ,required = false) String images,
|
||||
@RequestParam(name = "remark" ,required = false) String remark,
|
||||
@RequestParam(name = "payType", required = false) String payType,
|
||||
@RequestParam(name = "orderSigningPersonId" ,required = false) Long orderSigningPersonId,
|
||||
@RequestParam(name = "orderSigningPersonName" ,required = false) String orderSigningPersonName) throws Exception {
|
||||
rescueDriverInfoService.setOrderMoneyNew(Long.parseLong(rescueId), setMoney, remark, autoRemark, images, orderSigningPersonId, orderSigningPersonName, payType);
|
||||
public CommonResult setOrderMoneyNew(@RequestBody SetMoneyVO setMoneyVO) throws Exception {
|
||||
rescueDriverInfoService.setOrderMoneyNew(setMoneyVO);
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
|
@ -121,6 +121,7 @@ public class RescueCarInfo extends TenantBaseDO {
|
||||
/**
|
||||
* 司机id
|
||||
*/
|
||||
private String driverId;
|
||||
@TableField(exist = false)
|
||||
private Long driverId;
|
||||
|
||||
}
|
||||
|
@ -422,6 +422,12 @@ public class RescueInfo extends TenantBaseDO
|
||||
@TableField(exist = false)
|
||||
private String confirmPaymentPersonRemark;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String paymentName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Date paymentTime;
|
||||
|
||||
/**
|
||||
* 调度等级
|
||||
*/
|
||||
|
@ -201,6 +201,7 @@ public class RescueOrderInfo extends TenantBaseDO
|
||||
/** 其他费用备注 */
|
||||
private String otherFeeRemark;
|
||||
|
||||
|
||||
/** 调度设置的拖车费用 */
|
||||
private Long dispatchTowingFee;
|
||||
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.rescue.service;
|
||||
|
||||
import cn.iocoder.yudao.module.rescue.domain.*;
|
||||
|
||||
import cn.iocoder.yudao.module.rescue.vo.SetMoneyVO;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -48,7 +49,7 @@ public interface IRescueDriverInfoService extends IService<RescueDriverInfo>
|
||||
void uploadDetailByDriver(RescueInfoDetail rescueInfoDetail) throws Exception;
|
||||
void uploadDispatchDetailByDriver(RescueInfoDispatchDetail rescueInfoDispatchDetail) throws Exception;
|
||||
void setOrderMoney(Long rescueId,Double setMoney) throws Exception;
|
||||
void setOrderMoneyNew(Long rescueId,Double setMoney,String remark,String autoRemark,String images,Long orderSigningPersonId,String orderSigningPersonName,String payType) throws Exception;
|
||||
void setOrderMoneyNew(SetMoneyVO setMoneyVO) throws Exception;
|
||||
void endRescue(Long rescueId) throws Exception;
|
||||
void addRefuelRecord(RescueRefuelRecord rescueRefuelRecord) throws Exception;
|
||||
IPage<RescueRefuelRecord> listRefuelRecord(RescueRefuelRecord rescueRefuelRecord, Page<RescueRefuelRecord> page);
|
||||
|
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.CoordinateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.custom.entity.CarMain;
|
||||
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
|
||||
import cn.iocoder.yudao.module.custom.service.CustomerCarService;
|
||||
@ -15,6 +16,7 @@ import cn.iocoder.yudao.module.partner.service.IPartnerCustomerInfoService;
|
||||
import cn.iocoder.yudao.module.rescue.domain.*;
|
||||
import cn.iocoder.yudao.module.rescue.mapper.RescueDriverInfoMapper;
|
||||
import cn.iocoder.yudao.module.rescue.utils.RedissonDelayQueue;
|
||||
import cn.iocoder.yudao.module.rescue.vo.SetMoneyVO;
|
||||
import cn.iocoder.yudao.module.shop.entity.ShopUserCar;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
@ -96,6 +98,9 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl<RescueDriverInfoMap
|
||||
@Resource
|
||||
private IRescueDriverCarRelationService rescueDriverCarRelationService;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
public static String Redis_Driver_Key = "Rescue:Driver:";
|
||||
public static String Redis_Driver_Position_Key = "DriverPosition:";
|
||||
public static Map<String, Object> driverInfoMap = new HashMap<>();
|
||||
@ -136,7 +141,7 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl<RescueDriverInfoMap
|
||||
//已完成
|
||||
LambdaQueryWrapper<RescueInfo> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.eq(RescueInfo::getDriverId, driverId).and(item -> {
|
||||
item.eq(RescueInfo::getRescueStatus, "5").or().eq(RescueInfo::getRescueStatus, "6");
|
||||
item.eq(RescueInfo::getRescueStatus, "4").or().eq(RescueInfo::getRescueStatus, "5").or().eq(RescueInfo::getRescueStatus, "6");
|
||||
});
|
||||
long count2 = rescueInfoService.count(queryWrapper2);
|
||||
driverInfo.setWcNum(count2);
|
||||
@ -754,33 +759,50 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl<RescueDriverInfoMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrderMoneyNew(Long rescueId, Double setMoney, String remark, String autoRemark, String images, Long orderSigningPersonId, String orderSigningPersonName, String payType) throws Exception {
|
||||
Double temp = setMoney * 100;
|
||||
public void setOrderMoneyNew(SetMoneyVO setMoneyVO) throws Exception {
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO loginUser = userApi.getUser(userId);
|
||||
Double temp = setMoneyVO.getSetMoney() * 100;
|
||||
long setMoneyRes = temp.longValue();
|
||||
LambdaQueryWrapper<RescueOrderInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(RescueOrderInfo::getRescueInfoId, rescueId);
|
||||
queryWrapper.eq(RescueOrderInfo::getRescueInfoId, setMoneyVO.getRescueId());
|
||||
RescueOrderInfo one = rescueOrderInfoService.getOne(queryWrapper);
|
||||
if (Integer.parseInt(one.getOrderStatus()) > 1) {
|
||||
throw new Exception("订单已完结不可更改");
|
||||
}
|
||||
one.setSetMoney(setMoneyRes);
|
||||
if (orderSigningPersonId != null) {
|
||||
one.setOrderSigningPersonId(orderSigningPersonId);
|
||||
if (setMoneyVO.getOrderSigningPersonId() != null) {
|
||||
one.setOrderSigningPersonId(setMoneyVO.getOrderSigningPersonId());
|
||||
}
|
||||
if (orderSigningPersonName != null) {
|
||||
one.setOrderSigningPersonName(orderSigningPersonName);
|
||||
if (setMoneyVO.getOrderSigningPersonName() != null) {
|
||||
one.setOrderSigningPersonName(setMoneyVO.getOrderSigningPersonName());
|
||||
}
|
||||
if (payType != null) {
|
||||
one.setPayType(payType);
|
||||
if (setMoneyVO.getPayType() != null) {
|
||||
one.setPayType(setMoneyVO.getPayType());
|
||||
}
|
||||
one.setPaymentId(userId);
|
||||
if(loginUser != null){
|
||||
one.setPaymentName(loginUser.getNickname());
|
||||
}
|
||||
one.setPaymentTime(new Date());
|
||||
one.setOrderStatus("1");
|
||||
if(setMoneyVO.getTowingFee() != null){
|
||||
one.setTowingFee(setMoneyVO.getTowingFee().longValue());
|
||||
}
|
||||
if(setMoneyVO.getCraneFee() != null){
|
||||
one.setCraneFee(setMoneyVO.getCraneFee().longValue());
|
||||
}
|
||||
if(setMoneyVO.getOtherFee() != null){
|
||||
one.setOtherFee(setMoneyVO.getOtherFee().longValue());
|
||||
}
|
||||
one.setOtherFeeRemark(setMoneyVO.getOtherFeeRemark());
|
||||
rescueOrderInfoService.updateById(one);
|
||||
RescueInfoDetail rescueInfoDetail = new RescueInfoDetail();
|
||||
rescueInfoDetail.setRescueInfoId(rescueId);
|
||||
rescueInfoDetail.setRescueInfoId(setMoneyVO.getRescueId());
|
||||
rescueInfoDetail.setTitle("费用核算");
|
||||
rescueInfoDetail.setAutoRemark("司机核算救援费用为" + setMoney + "元, " + autoRemark);
|
||||
rescueInfoDetail.setRemark(remark);
|
||||
rescueInfoDetail.setImages(images);
|
||||
rescueInfoDetail.setAutoRemark("司机核算救援费用为" + setMoneyVO.getSetMoney() + "元, " + setMoneyVO.getAutoRemark());
|
||||
rescueInfoDetail.setRemark(setMoneyVO.getRemark());
|
||||
rescueInfoDetail.setImages(setMoneyVO.getImages());
|
||||
detailService.save(rescueInfoDetail);
|
||||
RescueOrderDetail rescueOrderDetail = new RescueOrderDetail();
|
||||
rescueOrderDetail.setRecordTime(new Date());
|
||||
|
@ -1149,11 +1149,11 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper, RescueI
|
||||
|
||||
|
||||
// 判断是否存在订单(rescueOrderInfo)信息,如果存在需要修改订单状态
|
||||
RescueOrderInfo rescueOrderInfo = rescueOrderInfoService.selectRescueOrderInfoByRescueInfoId(id);
|
||||
/*RescueOrderInfo rescueOrderInfo = rescueOrderInfoService.selectRescueOrderInfoByRescueInfoId(id);
|
||||
if(rescueOrderInfo != null){
|
||||
rescueOrderInfo.setOrderStatus("5");
|
||||
rescueOrderInfoService.updateById(rescueOrderInfo);
|
||||
}
|
||||
}*/
|
||||
|
||||
// 流程中增加撤销信息
|
||||
detailService.save(rescueInfoDetail);
|
||||
|
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.rescue.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Data
|
||||
public class SetMoneyVO {
|
||||
|
||||
/** 救援工单id */
|
||||
private Long rescueId;
|
||||
|
||||
/** 司机设置的金额 */
|
||||
private Double setMoney;
|
||||
|
||||
/** 流程中的备注 */
|
||||
private String remark;
|
||||
|
||||
/** 流程中的备注 */
|
||||
private String autoRemark;
|
||||
|
||||
/** 流程中的图片 */
|
||||
private String images;
|
||||
|
||||
/** 支付方式 */
|
||||
private String payType;
|
||||
|
||||
/** 挂账负责人id */
|
||||
private Long orderSigningPersonId;
|
||||
|
||||
/** 挂账负责人姓名 */
|
||||
private String orderSigningPersonName;
|
||||
|
||||
/** 司机设置的拖车费 */
|
||||
private Double towingFee;
|
||||
|
||||
/** 司机设置的吊车费 */
|
||||
private Double craneFee;
|
||||
|
||||
/** 司机设置的其他费用 */
|
||||
private Double otherFee;
|
||||
|
||||
/** 司机设置的其他费用备注 */
|
||||
private String otherFeeRemark;
|
||||
}
|
@ -136,7 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and ri.rescue_status = #{map.rescueStatus}
|
||||
</if>
|
||||
<if test="map.rescueStatus == '5'.toString()">
|
||||
and (ri.rescue_status = '5' or ri.rescue_status = '6')
|
||||
and (ri.rescue_status = '4' or ri.rescue_status = '5' or ri.rescue_status = '6')
|
||||
</if>
|
||||
<if test="map.connectionName != null and map.connectionName != ''">
|
||||
and (ri.connection_name like concat('%', #{map.connectionName}, '%')
|
||||
|
@ -14,9 +14,11 @@
|
||||
roi.order_signing_charge_id AS orderSigningChargeId,
|
||||
roi.order_signing_charge_name AS orderSigningChargeName,
|
||||
roi.validation_real_name AS orderSigningRealName,
|
||||
roi.payment_name AS paymentName,
|
||||
roi.payment_time AS paymentTime,
|
||||
roi.order_signing_remark AS orderSigningRemark
|
||||
FROM rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id and roi.deleted = '0'
|
||||
<where>
|
||||
1 = 1
|
||||
and ri.deleted = '0' AND ri.is_revoke = '0'
|
||||
@ -93,9 +95,11 @@
|
||||
roi.order_signing_person_name AS orderSigningPersonName,
|
||||
roi.order_signing_charge_id AS orderSigningChargeId,
|
||||
roi.order_signing_charge_name AS orderSigningChargeName,
|
||||
roi.payment_name AS paymentName,
|
||||
roi.payment_time AS paymentTime,
|
||||
roi.validation_real_name AS orderSigningRealName
|
||||
FROM rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id and roi.deleted = '0'
|
||||
<where>
|
||||
1 = 1
|
||||
and ri.deleted = '0' AND ri.is_revoke = '0'
|
||||
@ -784,15 +788,15 @@
|
||||
or connection_phone = #{connectionPhone}
|
||||
</select>
|
||||
<select id="getRescueStatisticsByAdmin" resultType="java.util.Map">
|
||||
SELECT IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3' or ri.rescue_status = '4'), 0) as jyzNum,
|
||||
SELECT IFNULL(sum(ri.rescue_status = '3' or ri.rescue_status = '4'), 0) as jyzNum,
|
||||
IFNULL(sum(roi.order_status = '1'), 0) as dzfNum,
|
||||
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
|
||||
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum,
|
||||
IFNULL(sum(ri.is_wei_xiu = '1'), 0) as zwxNum,
|
||||
IFNULL(count(roi.id), 0) as yjdNum,
|
||||
IFNULL(count(ri.id), 0) as yjdNum,
|
||||
IFNULL(sum(roi.set_money), 0) as yingskNum,
|
||||
IFNULL(sum(roi.pay_money), 0) as yiskNum,
|
||||
IFNULL(sum(CASE WHEN roi.order_status = '1' THEN roi.set_money ELSE 0 END), 0) as dskNum
|
||||
IFNULL(sum(CASE WHEN roi.if_confirm_pay = '1' THEN roi.pay_money ELSE 0 END), 0) as yiskNum,
|
||||
IFNULL(sum(CASE WHEN roi.if_confirm_pay = '0' THEN roi.set_money ELSE 0 END), 0) as dskNum
|
||||
FROM rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id AND roi.deleted = 0
|
||||
where 1 = 1 AND ri.deleted = 0 AND ri.is_revoke = 0
|
||||
@ -803,23 +807,22 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="map.startTimeStr!=null and map.startTimeStr!='' ">
|
||||
AND roi.create_time >= #{map.startTimeStr}
|
||||
AND ri.create_time >= #{map.startTimeStr}
|
||||
</if>
|
||||
<if test="map.endTimeStr!=null and map.endTimeStr!='' ">
|
||||
AND roi.create_time <= #{map.endTimeStr}
|
||||
AND ri.create_time <= #{map.endTimeStr}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getRescueStatisticsBySecondDispatcher" resultType="java.util.Map">
|
||||
SELECT IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3' or ri.rescue_status = '4'), 0) as jyzNum,
|
||||
SELECT IFNULL(sum(ri.rescue_status = '3' or ri.rescue_status = '4'), 0) as jyzNum,
|
||||
IFNULL(sum(roi.order_status = '1'), 0) as dzfNum,
|
||||
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
|
||||
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum,
|
||||
IFNULL(sum(ri.is_wei_xiu = '1'), 0) as zwxNum,
|
||||
IFNULL(count(roi.id), 0) as yjdNum,
|
||||
IFNULL(sum(roi.set_money), 0) as yingskNum,
|
||||
IFNULL(sum(roi.pay_money), 0) as yiskNum,
|
||||
IFNULL(sum(CASE WHEN roi.order_status = '1' THEN roi.set_money ELSE 0 END), 0) as dskNum
|
||||
IFNULL(count(ri.id), 0) as yjdNum,
|
||||
IFNULL(sum(CASE WHEN roi.if_confirm_pay = '1' THEN roi.pay_money ELSE 0 END), 0) as yiskNum,
|
||||
IFNULL(sum(CASE WHEN roi.if_confirm_pay = '0' THEN roi.set_money ELSE 0 END), 0) as dskNum
|
||||
FROM rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id AND roi.deleted = 0
|
||||
where 1 = 1 AND ri.deleted = 0 AND ri.is_revoke = 0
|
||||
@ -831,10 +834,10 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="map.startTimeStr!=null and map.startTimeStr!='' ">
|
||||
AND roi.create_time >= #{map.startTimeStr}
|
||||
AND ri.create_time >= #{map.startTimeStr}
|
||||
</if>
|
||||
<if test="map.endTimeStr!=null and map.endTimeStr!='' ">
|
||||
AND roi.create_time <= #{map.endTimeStr}
|
||||
AND ri.create_time <= #{map.endTimeStr}
|
||||
</if>
|
||||
</select>
|
||||
<delete id="deleteOtherInfo1">
|
||||
|
Loading…
Reference in New Issue
Block a user