字段修改
This commit is contained in:
parent
1a69288d3b
commit
f981612884
|
|
@ -68,4 +68,20 @@ public class OrderController extends BaseController {
|
||||||
return error("参数错误");
|
return error("参数错误");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态流转修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "订单状态流转修改")
|
||||||
|
@PostMapping("/updateOrderStatus")
|
||||||
|
public AjaxResult updateOrderStatus(@RequestBody OrderDetailDto orderInfoDto) {
|
||||||
|
Integer i = orderMapper.updateOrderStatus(orderInfoDto.getIds(), orderInfoDto.getOrderStatus());
|
||||||
|
if (i > 0) {
|
||||||
|
return success();
|
||||||
|
} else {
|
||||||
|
return error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:liang.chao
|
* @Author:liang.chao
|
||||||
|
|
@ -17,6 +18,9 @@ public class OrderDetailDto {
|
||||||
@ApiModelProperty(value = "主键id")
|
@ApiModelProperty(value = "主键id")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ids")
|
||||||
|
private List<Integer> ids;
|
||||||
|
|
||||||
@ApiModelProperty(value = "订单id")
|
@ApiModelProperty(value = "订单id")
|
||||||
private Integer orderId;
|
private Integer orderId;
|
||||||
|
|
||||||
|
|
@ -52,7 +56,7 @@ public class OrderDetailDto {
|
||||||
@ApiModelProperty(value = "日租金")
|
@ApiModelProperty(value = "日租金")
|
||||||
private BigDecimal dayLeasePrice;
|
private BigDecimal dayLeasePrice;
|
||||||
|
|
||||||
@ApiModelProperty(value = "订单状态")
|
@ApiModelProperty(value = "订单状态(0未下单 1已下单 2待出库 3待收货 4租赁中 5已退租 6已完成)")
|
||||||
private String orderStatus;
|
private String orderStatus;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建日期")
|
@ApiModelProperty(value = "创建日期")
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.order.mapper;
|
||||||
import com.bonus.material.device.domain.DevInfo;
|
import com.bonus.material.device.domain.DevInfo;
|
||||||
import com.bonus.material.order.domain.OrderDetailDto;
|
import com.bonus.material.order.domain.OrderDetailDto;
|
||||||
import com.bonus.material.order.domain.OrderInfoDto;
|
import com.bonus.material.order.domain.OrderInfoDto;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -25,4 +26,6 @@ public interface OrderMapper {
|
||||||
OrderDetailDto selectOrderDetailsById(String id);
|
OrderDetailDto selectOrderDetailsById(String id);
|
||||||
|
|
||||||
void updateMaStatus(OrderDetailDto orderDetailDto);
|
void updateMaStatus(OrderDetailDto orderDetailDto);
|
||||||
|
|
||||||
|
Integer updateOrderStatus(@Param("ids") List<Integer> ids, @Param("orderStatus") String orderStatus);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ public class OrderServiceImpl implements OrderService {
|
||||||
}
|
}
|
||||||
//生成订单信息
|
//生成订单信息
|
||||||
String code = "D" + System.currentTimeMillis();
|
String code = "D" + System.currentTimeMillis();
|
||||||
orderInfoDto.setOrderStatus("2");
|
|
||||||
orderInfoDto.setCode(code);
|
orderInfoDto.setCode(code);
|
||||||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||||
orderInfoDto.setOrderUser(userid);
|
orderInfoDto.setOrderUser(userid);
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<mapper namespace="com.bonus.material.order.mapper.OrderMapper">
|
<mapper namespace="com.bonus.material.order.mapper.OrderMapper">
|
||||||
|
|
||||||
<insert id="insertOrderInfo" parameterType="com.bonus.material.order.domain.OrderInfoDto" useGeneratedKeys="true" keyProperty="orderId">
|
<insert id="insertOrderInfo" parameterType="com.bonus.material.order.domain.OrderInfoDto" useGeneratedKeys="true" keyProperty="orderId">
|
||||||
insert into ma_order_info (code, order_time, cost, order_status, order_user, address, creater, create_time)
|
insert into ma_order_info (code, order_time, cost, order_user, address, creater, create_time)
|
||||||
values
|
values
|
||||||
(#{code}, now(), #{cost}, #{orderStatus}, #{orderUser}, #{address}, #{creater}, now())
|
(#{code}, now(), #{cost}, #{orderUser}, #{address}, #{creater}, now())
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertOrderDetail">
|
<insert id="insertOrderDetail">
|
||||||
INSERT INTO `ma_order_details` (
|
INSERT INTO `ma_order_details` (
|
||||||
|
|
@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
`days`,
|
`days`,
|
||||||
`num`,
|
`num`,
|
||||||
`costs`,
|
`costs`,
|
||||||
|
`order_status`,
|
||||||
`create_time`,
|
`create_time`,
|
||||||
`update_time`
|
`update_time`
|
||||||
) VALUES (
|
) VALUES (
|
||||||
|
|
@ -28,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{days},
|
#{days},
|
||||||
#{num},
|
#{num},
|
||||||
#{costs},
|
#{costs},
|
||||||
|
2,
|
||||||
now(),
|
now(),
|
||||||
#{updateTime})
|
#{updateTime})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
@ -37,6 +39,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="updateMaStatus">
|
<update id="updateMaStatus">
|
||||||
update book_car_detail set order_status = 1 where id = #{id}
|
update book_car_detail set order_status = 1 where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateOrderStatus">
|
||||||
|
update ma_order_details set order_status = #{orderStatus} where id in
|
||||||
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
<select id="getdeviceCount" resultType="com.bonus.material.device.domain.DevInfo">
|
<select id="getdeviceCount" resultType="com.bonus.material.device.domain.DevInfo">
|
||||||
select device_count,device_name from ma_dev_info where ma_id = #{maId} and is_active = 1
|
select device_count,device_name from ma_dev_info where ma_id = #{maId} and is_active = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -72,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND mdi.device_name like concat('%',#{deviceName},'%')
|
AND mdi.device_name like concat('%',#{deviceName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="orderStatus != null and orderStatus != ''">
|
<if test="orderStatus != null and orderStatus != ''">
|
||||||
AND moi.order_status = #{orderStatus}
|
AND hh.order_status = #{orderStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
|
||||||
AND moi.order_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
AND moi.order_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||||
|
|
@ -97,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
mdi.device_name,
|
mdi.device_name,
|
||||||
mdi.day_lease_price,
|
mdi.day_lease_price,
|
||||||
moi.order_status,
|
hh.order_status,
|
||||||
hh.days,
|
hh.days,
|
||||||
bfi.url,
|
bfi.url,
|
||||||
hh.id,
|
hh.id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue