fix
This commit is contained in:
parent
cc8fe8f4cf
commit
56fa00ea09
|
|
@ -112,7 +112,7 @@ public class OrderInfoController extends BaseController
|
||||||
@RequiresPermissions("order:info:add")
|
@RequiresPermissions("order:info:add")
|
||||||
@Log(title = "订单信息", businessType = BusinessType.INSERT)
|
@Log(title = "订单信息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody OrderInfo orderInfo)
|
public AjaxResult add(@RequestBody OrderInfoVo orderInfo)
|
||||||
{
|
{
|
||||||
return toAjax(orderInfoService.insertOrderInfo(orderInfo));
|
return toAjax(orderInfoService.insertOrderInfo(orderInfo));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,9 @@ public interface OrderInfoMapper
|
||||||
* @param orderInfo 订单信息
|
* @param orderInfo 订单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertOrderInfo(OrderInfo orderInfo);
|
public int insertOrderInfo(OrderInfoVo orderInfo);
|
||||||
|
|
||||||
|
public int insertOrderDetails(OrderInfoVo orderInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改订单信息
|
* 修改订单信息
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public interface IOrderInfoService
|
||||||
* @param orderInfo 订单信息
|
* @param orderInfo 订单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertOrderInfo(OrderInfo orderInfo);
|
public int insertOrderInfo(OrderInfoVo orderInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改订单信息
|
* 修改订单信息
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ package com.bonus.zlpt.order.service.impl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
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.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.zlpt.order.mapper.OrderDetailsMapper;
|
||||||
|
import com.bonus.zlpt.system.api.model.LoginUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.zlpt.order.mapper.OrderInfoMapper;
|
import com.bonus.zlpt.order.mapper.OrderInfoMapper;
|
||||||
|
|
@ -52,9 +55,15 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertOrderInfo(OrderInfo orderInfo)
|
public int insertOrderInfo(OrderInfoVo orderInfo)
|
||||||
{
|
{
|
||||||
return orderInfoMapper.insertOrderInfo(orderInfo);
|
LoginUser user = SecurityUtils.getLoginUser();
|
||||||
|
orderInfo.setOrderUser(user.getUserid());
|
||||||
|
orderInfoMapper.insertOrderInfo(orderInfo);
|
||||||
|
Long orderId = orderInfo.getOrderId();
|
||||||
|
System.out.println("xxxx" + orderId);
|
||||||
|
orderInfo.setOrderId(orderId);
|
||||||
|
return orderInfoMapper.insertOrderDetails(orderInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where o.order_id = #{orderId}
|
where o.order_id = #{orderId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertOrderInfo" parameterType="com.bonus.zlpt.common.core.domain.order.OrderInfo">
|
<insert id="insertOrderInfo" parameterType="com.bonus.zlpt.common.core.domain.order.vo.OrderInfoVo">
|
||||||
insert into ma_order_info
|
insert into ma_order_info
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="orderId != null">order_id,</if>
|
<if test="orderId != null">order_id,</if>
|
||||||
|
|
@ -79,6 +79,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertOrderDetails" parameterType="com.bonus.zlpt.common.core.domain.order.vo.OrderInfoVo">
|
||||||
|
insert into ma_order_details
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="orderId != null">order_id,</if>
|
||||||
|
<if test="needCompany != null">need_company,</if>
|
||||||
|
<if test="planStartTime != null">plan_start_time,</if>
|
||||||
|
<if test="isMachinist != null">is_machinist,</if>
|
||||||
|
<if test="addressId != null">address_id,</if>
|
||||||
|
<if test="address != null">address,</if>
|
||||||
|
<if test="duration != null">duration,</if>
|
||||||
|
<if test="invoiceType != null">invoice_type,</if>
|
||||||
|
<if test="description != null">description,</if>
|
||||||
|
<if test="maId != null">ma_id,</if>
|
||||||
|
<if test="leaseType != null">lease_type,</if>
|
||||||
|
<if test="leasePrice != null">lease_price,</if>
|
||||||
|
<if test="machinistPrice != null">machinist_price,</if>
|
||||||
|
<if test="orderContract != null">order_contract,</if>
|
||||||
|
<if test="machinistName != null">machinist_name,</if>
|
||||||
|
<if test="phone != null">phone,</if>
|
||||||
|
<if test="logisticsPhone != null">logistics_phone,</if>
|
||||||
|
<if test="realStartTime != null">real_start_time,</if>
|
||||||
|
<if test="renterName != null">renter_name,</if>
|
||||||
|
<if test="tenantName != null">tenant_name,</if>
|
||||||
|
<if test="entryAttachment != null">entry_attachment,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="orderId != null">#{orderId},</if>
|
||||||
|
<if test="needCompany != null">#{needCompany},</if>
|
||||||
|
<if test="planStartTime != null">#{planStartTime},</if>
|
||||||
|
<if test="isMachinist != null">#{isMachinist},</if>
|
||||||
|
<if test="addressId != null">#{addressId},</if>
|
||||||
|
<if test="address != null">#{address},</if>
|
||||||
|
<if test="duration != null">#{duration},</if>
|
||||||
|
<if test="invoiceType != null">#{invoiceType},</if>
|
||||||
|
<if test="description != null">#{description},</if>
|
||||||
|
<if test="maId != null">#{maId},</if>
|
||||||
|
<if test="leaseType != null">#{leaseType},</if>
|
||||||
|
<if test="leasePrice != null">#{leasePrice},</if>
|
||||||
|
<if test="machinistPrice != null">#{machinistPrice},</if>
|
||||||
|
<if test="orderContract != null">#{orderContract},</if>
|
||||||
|
<if test="machinistName != null">#{machinistName},</if>
|
||||||
|
<if test="phone != null">#{phone},</if>
|
||||||
|
<if test="logisticsPhone != null">#{logisticsPhone},</if>
|
||||||
|
<if test="realStartTime != null">#{realStartTime},</if>
|
||||||
|
<if test="renterName != null">#{renterName},</if>
|
||||||
|
<if test="tenantName != null">#{tenantName},</if>
|
||||||
|
<if test="entryAttachment != null">#{entryAttachment},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateOrderInfo" parameterType="com.bonus.zlpt.common.core.domain.order.OrderInfo">
|
<update id="updateOrderInfo" parameterType="com.bonus.zlpt.common.core.domain.order.OrderInfo">
|
||||||
update ma_order_info
|
update ma_order_info
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue