Commit 671ce618 by zhanghj

V1.3.0--提交订单进度列表相关代码

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@22695 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent f6e5fb4f
......@@ -99,5 +99,10 @@ public interface BizConstants {
* 没关注工单
*/
public static final int IS_NOT_CONCERN = 0;
/**
* 订单进度是否显示,0:不展示,1:展示
*/
public static byte ORDER_PROGRESS_SHOW = 1;
}
......@@ -11,6 +11,9 @@ package com.glsx.ordercenter.constants;
*/
public enum OrderActiveStatusEnum {
/*
* 订单状态相关
*/
ORDER_ACTIVE_STATUS_MERCHANT_HAS_SENT(1, "商户已派单"),
ORDER_ACTIVE_STATUS_NOT_ASSIGN_MECHANIC(2, "服务商已接单 ,未指派给技工"),
ORDER_ACTIVE_STATUS_MERCHANT_REFUSE(3, "服务商拒单"),
......@@ -20,8 +23,17 @@ public enum OrderActiveStatusEnum {
ORDER_ACTIVE_STATUS_MECHANIC_NOT_FINISH(7, "技工已预约,未完成"),
ORDER_ACTIVE_STATUS_FINISH(8, "完成"),
ORDER_ACTIVE_STATUS_CANCEL(0, "已取消"),
ORDER_ACTIVE_STATUS_DELETED(9, "已删除");
ORDER_ACTIVE_STATUS_DELETED(9, "已删除"),
/*
* 记录订单进度用到
*
*/
ORDER_PROGRESS_REASSIGN_MECHANIC(110, "重新指派技工"),
ORDER_PROGRESS_EDIT_INSTALL_LOCATION(115, "修改安装地址"),
ORDER_PROGRESS_RESCHEDULE(120, "重新预约"),
ORDER_PROGRESS_DROP_IN(125, "已上门"),
;
/**
* 订单活跃状态
......
package com.glsx.ordercenter.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.glsx.common.annotation.AuthCheck;
import com.glsx.common.constants.ResultObject;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.service.IOrderStatusService;
/**
*
* @Title OrderStatusController.java
* @Package com.glsx.ordercenter.controller
* @Description TODO 订单状态变化流水controller
* @author zhanghj
* @date 2019年7月15日 上午10:08:27
* @version 1.0.0
*/
@RestController
@RequestMapping(value="/orderStatus")
public class OrderStatusController {
@Autowired
private IOrderStatusService orderStatusService;
/**
*
* @author zhanghj
* @Title: getOrderProgress
* @Description: TODO 获取订单进度列表
* @param orderId
* @return
* ResultObject
*
*/
@AuthCheck
@RequestMapping(value="/getOrderProgress", method=RequestMethod.GET)
public ResultObject getOrderProgress(Integer orderId) {
if (orderId == null) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
}
Map<String, Object> result = new HashMap<String, Object>();
List<SysOrderStatus> list = orderStatusService.getOrderProgress(orderId);
result.put("items", list);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result);
}
}
......@@ -2,11 +2,11 @@ package com.glsx.ordercenter.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.pojo.SysOrderStatusExample;
public interface SysOrderStatusMapper {
long countByExample(SysOrderStatusExample example);
int deleteByPrimaryKey(Integer id);
......@@ -14,11 +14,21 @@ public interface SysOrderStatusMapper {
int insertSelective(SysOrderStatus record);
List<SysOrderStatus> selectByExample(SysOrderStatusExample example);
SysOrderStatus selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysOrderStatus record);
int updateByPrimaryKey(SysOrderStatus record);
/**
*
* @author zhanghj
* @Title: getOrderProgress
* @Description: TODO 获取订单进度列表
* @param orderId
* @return
* List<SysOrderStatus>
*
*/
List<SysOrderStatus> getOrderProgress(@Param("orderId")Integer orderId);
}
\ No newline at end of file
......@@ -11,8 +11,22 @@ public class SysOrderStatus {
private Date updateTime;
private Integer updateBy;
private String reason;
private String property1;
private String property2;
private String phone1;
private String phone2;
private String remark;
private Byte isShow;
public Integer getId() {
return id;
}
......@@ -45,6 +59,54 @@ public class SysOrderStatus {
this.updateTime = updateTime;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason == null ? null : reason.trim();
}
public String getProperty1() {
return property1;
}
public void setProperty1(String property1) {
this.property1 = property1 == null ? null : property1.trim();
}
public String getProperty2() {
return property2;
}
public void setProperty2(String property2) {
this.property2 = property2 == null ? null : property2.trim();
}
public String getPhone1() {
return phone1;
}
public void setPhone1(String phone1) {
this.phone1 = phone1 == null ? null : phone1.trim();
}
public String getPhone2() {
return phone2;
}
public void setPhone2(String phone2) {
this.phone2 = phone2 == null ? null : phone2.trim();
}
public String getRemark() {
return remark;
}
......@@ -52,4 +114,12 @@ public class SysOrderStatus {
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Byte getIsShow() {
return isShow;
}
public void setIsShow(Byte isShow) {
this.isShow = isShow;
}
}
\ No newline at end of file
package com.glsx.ordercenter.service;
import java.util.List;
import com.glsx.ordercenter.pojo.SysOrderStatus;
/**
*
* @Title IOrderStatusService.java
* @Package com.glsx.ordercenter.service
* @Description TODO 订单状态变化流水service
* @author zhanghj
* @date 2019年7月15日 上午10:48:50
* @version 1.0.0
*/
public interface IOrderStatusService {
/**
*
* @author zhanghj
* @Title: getOrderProgress
* @Description: TODO 获取订单进度列表
* @param orderId
* @return
* List<SysOrderStatus>
*
*/
List<SysOrderStatus> getOrderProgress(Integer orderId);
}
......@@ -2448,8 +2448,10 @@ public class OrderServiceImpl implements IOrderService {
if (i == 1) {
SysOrderStatus sysOrderStatus = new SysOrderStatus();
sysOrderStatus.setOrderId(sysOrder.getId());
sysOrderStatus.setUpdateBy(userId);
sysOrderStatus.setUpdateTime(sysOrder.getCreateTime());
sysOrderStatus.setActiveStatus(sysOrder.getActiveStatus());
sysOrderStatus.setIsShow(BizConstants.ORDER_PROGRESS_SHOW);
insertOrderStatus(sysOrderStatus);
}
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
......
package com.glsx.ordercenter.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.glsx.ordercenter.mapper.SysOrderStatusMapper;
import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.service.IOrderStatusService;
/**
*
* @Title OrderStatusServiceImpl.java
* @Package com.glsx.ordercenter.service.impl
* @Description TODO 订单状态变化流水
* @author zhanghj
* @date 2019年7月15日 上午10:50:09
* @version 1.0.0
*/
@Service
public class OrderStatusServiceImpl implements IOrderStatusService{
@Autowired
private SysOrderStatusMapper orderStatusDao;
@Override
public List<SysOrderStatus> getOrderProgress(Integer orderId) {
// TODO Auto-generated method stub
return orderStatusDao.getOrderProgress(orderId);
}
}
......@@ -6,74 +6,47 @@
<result column="order_id" jdbcType="INTEGER" property="orderId" />
<result column="active_status" jdbcType="TINYINT" property="activeStatus" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="property1" jdbcType="VARCHAR" property="property1" />
<result column="property2" jdbcType="VARCHAR" property="property2" />
<result column="phone1" jdbcType="VARCHAR" property="phone1" />
<result column="phone2" jdbcType="VARCHAR" property="phone2" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="is_show" jdbcType="TINYINT" property="isShow" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, order_id, active_status, update_time, remark
id, order_id, active_status, update_time, update_by, reason, property1, property2,
phone1, phone2, remark, is_show
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderStatusExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_order_status
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_order_status
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_order_status
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysOrderStatus">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_order_status (order_id, active_status, update_time,
remark)
update_by, reason, property1,
property2, phone1, phone2,
remark, is_show)
values (#{orderId,jdbcType=INTEGER}, #{activeStatus,jdbcType=TINYINT}, #{updateTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR})
#{updateBy,jdbcType=INTEGER}, #{reason,jdbcType=VARCHAR}, #{property1,jdbcType=VARCHAR},
#{property2,jdbcType=VARCHAR}, #{phone1,jdbcType=VARCHAR}, #{phone2,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{isShow,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysOrderStatus">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
......@@ -89,9 +62,30 @@
<if test="updateTime != null">
update_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="reason != null">
reason,
</if>
<if test="property1 != null">
property1,
</if>
<if test="property2 != null">
property2,
</if>
<if test="phone1 != null">
phone1,
</if>
<if test="phone2 != null">
phone2,
</if>
<if test="remark != null">
remark,
</if>
<if test="isShow != null">
is_show,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">
......@@ -103,17 +97,33 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
<if test="property1 != null">
#{property1,jdbcType=VARCHAR},
</if>
<if test="property2 != null">
#{property2,jdbcType=VARCHAR},
</if>
<if test="phone1 != null">
#{phone1,jdbcType=VARCHAR},
</if>
<if test="phone2 != null">
#{phone2,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="isShow != null">
#{isShow,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderStatusExample" resultType="java.lang.Long">
select count(*) from sys_order_status
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysOrderStatus">
update sys_order_status
<set>
......@@ -126,18 +136,56 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
<if test="property1 != null">
property1 = #{property1,jdbcType=VARCHAR},
</if>
<if test="property2 != null">
property2 = #{property2,jdbcType=VARCHAR},
</if>
<if test="phone1 != null">
phone1 = #{phone1,jdbcType=VARCHAR},
</if>
<if test="phone2 != null">
phone2 = #{phone2,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="isShow != null">
is_show = #{isShow,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOrderStatus">
update sys_order_status
set order_id = #{orderId,jdbcType=INTEGER},
active_status = #{activeStatus,jdbcType=TINYINT},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}
update_by = #{updateBy,jdbcType=INTEGER},
reason = #{reason,jdbcType=VARCHAR},
property1 = #{property1,jdbcType=VARCHAR},
property2 = #{property2,jdbcType=VARCHAR},
phone1 = #{phone1,jdbcType=VARCHAR},
phone2 = #{phone2,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
is_show = #{isShow,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getOrderProgress" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_order_status
where order_id = #{orderId}
and is_show = 1
</select>
</mapper>
\ No newline at end of file
......@@ -33,3 +33,7 @@ CREATE TABLE `sys_user_order` (
ALTER TABLE `sys_order`
MODIFY COLUMN `merchant_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '标准接口传的商户名称';
ALTER TABLE `sys_order_status`
MODIFY COLUMN `active_status` tinyint(4) NOT NULL COMMENT '订单进度:1.商户已派单。2.服务商已接单,未指派给技工。3.服务商拒单4.服务商已派单,技工未接单。5.技工拒单。6.技工接单未预约。7.技工已预约,未完成 。8.完成。110:重新指派技工,115:修改安装地址,120:重新预约,125:已上门' AFTER `order_id`,
ADD COLUMN `is_show` tinyint(2) NULL DEFAULT 0 COMMENT '是否显示,0:不展示,1:展示' AFTER `remark`;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!