fix
This commit is contained in:
parent
eeffaa0491
commit
a4e0d5422c
|
|
@ -39,4 +39,6 @@ public class OrderInfoVo extends OrderInfo {
|
||||||
private String renterName;
|
private String renterName;
|
||||||
private String tenantName;
|
private String tenantName;
|
||||||
private String entryAttachment;
|
private String entryAttachment;
|
||||||
|
/* 合同附件 */
|
||||||
|
private String contractUrl;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ public class OrderInfoController extends BaseController
|
||||||
@RequiresPermissions("order:info:edit")
|
@RequiresPermissions("order:info:edit")
|
||||||
@Log(title = "订单信息", businessType = BusinessType.UPDATE)
|
@Log(title = "订单信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody OrderInfo orderInfo)
|
public AjaxResult edit(@RequestBody OrderInfoVo orderInfo)
|
||||||
{
|
{
|
||||||
return toAjax(orderInfoService.updateOrderInfo(orderInfo));
|
return toAjax(orderInfoService.updateOrderInfo(orderInfo));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ public interface OrderInfoMapper
|
||||||
* @param orderInfo 订单信息
|
* @param orderInfo 订单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateOrderInfo(OrderInfo orderInfo);
|
public int updateOrderInfo(OrderInfoVo orderInfo);
|
||||||
|
|
||||||
|
public int updateOrderDetails(OrderInfoVo orderInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除订单信息
|
* 删除订单信息
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public interface IOrderInfoService
|
||||||
* @param orderInfo 订单信息
|
* @param orderInfo 订单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateOrderInfo(OrderInfo orderInfo);
|
public int updateOrderInfo(OrderInfoVo orderInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除订单信息
|
* 批量删除订单信息
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ package com.bonus.zlpt.order.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.zlpt.common.core.domain.order.dto.FileInfoDto;
|
||||||
import com.bonus.zlpt.common.core.domain.order.vo.OrderInfoVo;
|
import com.bonus.zlpt.common.core.domain.order.vo.OrderInfoVo;
|
||||||
|
import com.bonus.zlpt.common.core.utils.StringUtils;
|
||||||
import com.bonus.zlpt.common.security.utils.SecurityUtils;
|
import com.bonus.zlpt.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.zlpt.order.mapper.OrderDetailsMapper;
|
import com.bonus.zlpt.order.mapper.OrderDetailsMapper;
|
||||||
import com.bonus.zlpt.system.api.model.LoginUser;
|
import com.bonus.zlpt.system.api.model.LoginUser;
|
||||||
|
|
@ -21,8 +23,11 @@ import com.bonus.zlpt.order.service.IOrderInfoService;
|
||||||
@Service
|
@Service
|
||||||
public class OrderInfoServiceImpl implements IOrderInfoService
|
public class OrderInfoServiceImpl implements IOrderInfoService
|
||||||
{
|
{
|
||||||
|
private final Integer ORDER_ATTACHMENT_DIC_ID = 21;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrderInfoMapper orderInfoMapper;
|
private OrderInfoMapper orderInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
OrderDetailsMapper orderDetailsMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单信息
|
* 查询订单信息
|
||||||
|
|
@ -72,8 +77,21 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateOrderInfo(OrderInfo orderInfo)
|
public int updateOrderInfo(OrderInfoVo orderInfo)
|
||||||
{
|
{
|
||||||
|
if (StringUtils.isNotEmpty(orderInfo.getContractUrl())) {
|
||||||
|
FileInfoDto fileInfoDto = new FileInfoDto();
|
||||||
|
fileInfoDto.setModelId(Math.toIntExact(orderInfo.getOrderId()));
|
||||||
|
fileInfoDto.setFileUrl(orderInfo.getContractUrl());
|
||||||
|
fileInfoDto.setDicId(ORDER_ATTACHMENT_DIC_ID);
|
||||||
|
LoginUser user = SecurityUtils.getLoginUser();
|
||||||
|
fileInfoDto.setCreator(String.valueOf(user.getUserid()));
|
||||||
|
orderDetailsMapper.deleteAttachment(fileInfoDto);
|
||||||
|
orderDetailsMapper.insertAttachment(fileInfoDto);
|
||||||
|
}
|
||||||
|
orderInfoMapper.updateOrderDetails(orderInfo);
|
||||||
|
LoginUser user = SecurityUtils.getLoginUser();
|
||||||
|
orderInfo.setOrderUser(user.getUserid());
|
||||||
return orderInfoMapper.updateOrderInfo(orderInfo);
|
return orderInfoMapper.updateOrderInfo(orderInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateOrderInfo" parameterType="com.bonus.zlpt.common.core.domain.order.OrderInfo">
|
<update id="updateOrderInfo" parameterType="com.bonus.zlpt.common.core.domain.order.vo.OrderInfoVo">
|
||||||
update ma_order_info
|
update ma_order_info
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="pId != null">p_id = #{pId},</if>
|
<if test="pId != null">p_id = #{pId},</if>
|
||||||
|
|
@ -146,6 +146,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where order_id = #{orderId}
|
where order_id = #{orderId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateOrderDetails" parameterType="com.bonus.zlpt.common.core.domain.order.vo.OrderInfoVo">
|
||||||
|
update ma_order_details
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="orderId != null">order_id = #{orderId},</if>
|
||||||
|
<if test="needCompany != null">need_company = #{needCompany},</if>
|
||||||
|
<if test="planStartTime != null">plan_start_time = #{planStartTime},</if>
|
||||||
|
<if test="isMachinist != null">is_machinist = #{isMachinist},</if>
|
||||||
|
<if test="addressId != null">address_id = #{addressId},</if>
|
||||||
|
<if test="address != null">address = #{address},</if>
|
||||||
|
<if test="duration != null">duration = #{duration},</if>
|
||||||
|
<if test="invoiceType != null">invoice_type = #{invoiceType},</if>
|
||||||
|
<if test="description != null">description = #{description},</if>
|
||||||
|
<if test="maId != null">ma_id = #{maId},</if>
|
||||||
|
<if test="leaseType != null">lease_type = #{leaseType},</if>
|
||||||
|
<if test="leasePrice != null">lease_price = #{leasePrice},</if>
|
||||||
|
<if test="machinistPrice != null">machinist_price = #{machinistPrice},</if>
|
||||||
|
<if test="orderContract != null">order_contract = #{orderContract},</if>
|
||||||
|
<if test="machinistName != null">machinist_name = #{machinistName},</if>
|
||||||
|
<if test="phone != null">phone = #{phone},</if>
|
||||||
|
<if test="logisticsPhone != null">logistics_phone = #{logisticsPhone},</if>
|
||||||
|
<if test="realStartTime != null">real_start_time = #{realStartTime},</if>
|
||||||
|
<if test="renterName != null">renter_name = #{renterName},</if>
|
||||||
|
<if test="tenantName != null">tenant_name = #{tenantName},</if>
|
||||||
|
<if test="entryAttachment != null">entry_attachment = #{entryAttachment},</if>
|
||||||
|
</trim>
|
||||||
|
where order_id = #{orderId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteOrderInfoByOrderId" parameterType="Long">
|
<delete id="deleteOrderInfoByOrderId" parameterType="Long">
|
||||||
delete from ma_order_info where order_id = #{orderId}
|
delete from ma_order_info where order_id = #{orderId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue