Commit 8c857255 by zhengxj

finish 订单激活 on 20190220 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@17493 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 4ca94b62
...@@ -231,4 +231,32 @@ public class OrderController extends BaseController{ ...@@ -231,4 +231,32 @@ public class OrderController extends BaseController{
} }
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg()); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
} }
@RequestMapping(value = "/activate", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject activate(HttpServletRequest request, Integer orderId) {
SysOrderExample example = new SysOrderExample();
example.createCriteria().andIdEqualTo(orderId);
SysOrder sysOrder = orderService.selectByPrimaryKey(orderId);
if (sysOrder != null) {
sysOrder.setActiveStatus((byte) 8);
sysOrder.setActiveStatusArray(DateUtil.formatDate(DateUtil.getCurrentTime()) + ":" + "拆除设备" + ";"
+ sysOrder.getActiveStatusArray());
orderService.updateByPrimaryKeySelective(sysOrder);
}
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
}
@RequestMapping(value = "/repair", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject repair(HttpServletRequest request, Integer orderId) {
SysOrderExample example = new SysOrderExample();
example.createCriteria().andIdEqualTo(orderId);
SysOrder sysOrder = orderService.selectByPrimaryKey(orderId);
if (sysOrder != null) {
sysOrder.setActiveStatus((byte) 8);
sysOrder.setActiveStatusArray(DateUtil.formatDate(DateUtil.getCurrentTime()) + ":" + "拆除设备" + ";"
+ sysOrder.getActiveStatusArray());
orderService.updateByPrimaryKeySelective(sysOrder);
}
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
}
} }
...@@ -140,6 +140,17 @@ public class SysOrder { ...@@ -140,6 +140,17 @@ public class SysOrder {
*/ */
private String endDate; private String endDate;
private String installRemark;
public String getInstallRemark() {
return installRemark;
}
public void setInstallRemark(String installRemark) {
this.installRemark = installRemark;
}
public SysArea getArea() { public SysArea getArea() {
return area; return area;
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glsx.ordercenter.mapper.SysOrderMapper"> <mapper namespace="com.glsx.ordercenter.mapper.SysOrderMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysOrder"> <resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysOrder">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
<result column="vin_no_picture" jdbcType="VARCHAR" property="vinNoPicture" /> <result column="vin_no_picture" jdbcType="VARCHAR" property="vinNoPicture" />
<result column="install_location_picture" jdbcType="VARCHAR" property="installLocationPicture" /> <result column="install_location_picture" jdbcType="VARCHAR" property="installLocationPicture" />
<result column="complete_time" jdbcType="TIMESTAMP" property="completeTime" /> <result column="complete_time" jdbcType="TIMESTAMP" property="completeTime" />
<result column="install_remark" jdbcType="VARCHAR" property="installRemark" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -54,11 +56,14 @@ ...@@ -54,11 +56,14 @@
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value} and #
{criterion.secondValue}
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem"
open="(" separator=",">
#{listItem} #{listItem}
</foreach> </foreach>
</when> </when>
...@@ -70,12 +75,12 @@ ...@@ -70,12 +75,12 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, order_sn, active_status, canceled, order_type, shop_id, district, address, contact, id, order_sn, active_status, canceled, order_type, shop_id, district,
phone_number, car_brand, car_series, car_type, vin_no, car_color, expect_install_time, service_type, address ,contact, phone_number, car_brand, car_series, car_type, vin_no, car_color,
car_owner, car_owner_phone, cancel_time, active_status_array, merchant_id, mechanic_id, expect_install_time, service_type, car_owner, car_owner_phone, cancel_time, active_status_array, merchant_id,
repair_reason, remark, create_time, update_time, create_by, update_by, device_no, mechanic_id, repair_reason, remark, create_time, update_time, create_by, update_by, device_no,
install_location, overdue_reason, repair_type, car_picture, vin_no_picture, install_location_picture, install_location, overdue_reason, repair_type, car_picture, vin_no_picture, install_location_picture,
complete_time complete_time,install_remark
</sql> </sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" resultMap="BaseResultMap">
select select
...@@ -120,7 +125,7 @@ ...@@ -120,7 +125,7 @@
install_location_picture, complete_time) install_location_picture, complete_time)
values (#{orderSn,jdbcType=VARCHAR}, #{activeStatus,jdbcType=TINYINT}, #{canceled,jdbcType=TINYINT}, values (#{orderSn,jdbcType=VARCHAR}, #{activeStatus,jdbcType=TINYINT}, #{canceled,jdbcType=TINYINT},
#{orderType,jdbcType=TINYINT}, #{shopId,jdbcType=INTEGER}, #{district,jdbcType=INTEGER}, #{orderType,jdbcType=TINYINT}, #{shopId,jdbcType=INTEGER}, #{district,jdbcType=INTEGER},
#{address,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, #{phoneNumber,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, # {phoneNumber,jdbcType=VARCHAR},
#{carBrand,jdbcType=INTEGER}, #{carSeries,jdbcType=INTEGER}, #{carType,jdbcType=VARCHAR}, #{vinNo,jdbcType=VARCHAR}, #{carBrand,jdbcType=INTEGER}, #{carSeries,jdbcType=INTEGER}, #{carType,jdbcType=VARCHAR}, #{vinNo,jdbcType=VARCHAR},
#{carColor,jdbcType=VARCHAR}, #{expectInstallTime,jdbcType=TIMESTAMP}, #{serviceType,jdbcType=VARCHAR}, #{carColor,jdbcType=VARCHAR}, #{expectInstallTime,jdbcType=TIMESTAMP}, #{serviceType,jdbcType=VARCHAR},
#{carOwner,jdbcType=VARCHAR}, #{carOwnerPhone,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{carOwner,jdbcType=VARCHAR}, #{carOwnerPhone,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP},
...@@ -245,6 +250,9 @@ ...@@ -245,6 +250,9 @@
<if test="completeTime != null"> <if test="completeTime != null">
complete_time, complete_time,
</if> </if>
<if test="installRemark != null">
install_remark,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderSn != null"> <if test="orderSn != null">
...@@ -355,9 +363,14 @@ ...@@ -355,9 +363,14 @@
<if test="completeTime != null"> <if test="completeTime != null">
#{completeTime,jdbcType=TIMESTAMP}, #{completeTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="installRemark != null">
#{installRemark,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderExample"
resultType="java.lang.Long">
select count(*) from sys_order select count(*) from sys_order
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
...@@ -474,6 +487,9 @@ ...@@ -474,6 +487,9 @@
<if test="completeTime != null"> <if test="completeTime != null">
complete_time = #{completeTime,jdbcType=TIMESTAMP}, complete_time = #{completeTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="installRemark != null">
install_remark = #{installRemark,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
...@@ -527,21 +543,12 @@ ...@@ -527,21 +543,12 @@
<result column="biz_amount" jdbcType="BIGINT" property="bizAmount" /> <result column="biz_amount" jdbcType="BIGINT" property="bizAmount" />
</resultMap> </resultMap>
<!-- <select id="selectByParams" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" <!-- <select id="selectByParams" parameterType="com.glsx.ordercenter.pojo.SysOrderExample"
resultMap="OrderDetailResultMap"> resultMap="OrderDetailResultMap"> SELECT so.*,sm.shop_name,su.`name`,su.phone_number
SELECT FROM sys_order so LEFT JOIN sys_merchant sm ON so.merchant_id = sm.id LEFT
so.*,sm.shop_name,su.`name`,su.phone_number JOIN sys_user su ON sm.user_id = su.id LEFT JOIN sys_mechanic smc ON so.mechanic_id
FROM = smc.id and smc.user_id = su.id <if test="_parameter != null"> <include
sys_order so refid="Example_Where_Clause" /> </if> <if test="orderByClause != null"> order
LEFT JOIN sys_merchant sm ON so.merchant_id = sm.id by ${orderByClause} </if> </select> -->
LEFT JOIN sys_user su ON sm.user_id = su.id
LEFT JOIN sys_mechanic smc ON so.mechanic_id = smc.id and smc.user_id = su.id
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select> -->
<select id="selectByParams" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" <select id="selectByParams" parameterType="com.glsx.ordercenter.pojo.SysOrderExample"
resultMap="OrderDetailResultMap"> resultMap="OrderDetailResultMap">
...@@ -549,7 +556,8 @@ ...@@ -549,7 +556,8 @@
so.*, sm.shop_name so.*, sm.shop_name
FROM FROM
sys_order so sys_order so
LEFT JOIN sys_merchant sm ON so.merchant_id = sm.id LEFT JOIN sys_merchant sm ON
so.merchant_id = sm.id
LEFT JOIN sys_user su ON sm.user_id = su.id LEFT JOIN sys_user su ON sm.user_id = su.id
<where> <where>
<if test="id != null"> <if test="id != null">
...@@ -561,7 +569,9 @@ ...@@ -561,7 +569,9 @@
</where> </where>
</select> </select>
<select id="countByParams" parameterType="java.util.Map" resultMap="OrderCountResultMap"> <select id="countByParams" parameterType="java.util.Map"
resultMap="OrderCountResultMap">
SELECT SELECT
sm.shop_name, sm.shop_name,
count(1) AS biz_amount count(1) AS biz_amount
...@@ -571,7 +581,8 @@ ...@@ -571,7 +581,8 @@
sys_merchant sm ON so.shop_id = sm.id sys_merchant sm ON so.shop_id = sm.id
<where> <where>
so.active_status = 8 so.active_status = 8
and so.merchant_id = #{merchantId,jdbcType=INTEGER} and so.merchant_id =
#{merchantId,jdbcType=INTEGER}
<if test="beginTime != null"> <if test="beginTime != null">
and so.create_time &gt;= #{beginTime} and so.create_time &gt;= #{beginTime}
</if> </if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!