Commit 373ff592 by xiaoyj

增加服务商技工列表按技工接单状态排序以及技工创建时间降序,增加指派不接单技工的状态码以及提示

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@19791 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent e7d8a3c4
...@@ -67,4 +67,10 @@ public interface BizConstants { ...@@ -67,4 +67,10 @@ public interface BizConstants {
public static final byte USER_TYPE_SHOP = 2; public static final byte USER_TYPE_SHOP = 2;
public static final byte USER_TYPE_MECHANIC = 3; public static final byte USER_TYPE_MECHANIC = 3;
/**
* 技工工作状态
*/
public static final int SYSMERCHANT_WOKE_STATUS = 1;
public static final int SYSMERCHANT_UNWOKE_STATUS = 2;
} }
...@@ -17,6 +17,7 @@ public enum ResultCodeEnum { ...@@ -17,6 +17,7 @@ public enum ResultCodeEnum {
PARAM_ERROR(100, "参数错误"), PARAM_ERROR(100, "参数错误"),
NOT_LOGIN(101, "用户未登录"), NOT_LOGIN(101, "用户未登录"),
TRY_AGAIN(102, "失败,请重试"), TRY_AGAIN(102, "失败,请重试"),
SYSMERCHANT_UNWORK(103,"该技工暂不接单,技工不可接收服务商指派订单"),
/** /**
* 订单相关 * 订单相关
......
...@@ -21,4 +21,6 @@ public interface SysMechanicMapper { ...@@ -21,4 +21,6 @@ public interface SysMechanicMapper {
int updateByPrimaryKeySelective(SysMechanic record); int updateByPrimaryKeySelective(SysMechanic record);
int updateByPrimaryKey(SysMechanic record); int updateByPrimaryKey(SysMechanic record);
SysMechanic selectByUserId(Integer userId);
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,6 +21,8 @@ public class SysMechanic { ...@@ -21,6 +21,8 @@ public class SysMechanic {
private String mechanicStatus; private String mechanicStatus;
private Integer workStatus;
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -100,4 +102,12 @@ public class SysMechanic { ...@@ -100,4 +102,12 @@ public class SysMechanic {
public void setMechanicStatus(String mechanicStatus) { public void setMechanicStatus(String mechanicStatus) {
this.mechanicStatus = mechanicStatus; this.mechanicStatus = mechanicStatus;
} }
public Integer getWorkStatus() {
return workStatus;
}
public void setWorkStatus(Integer workStatus) {
this.workStatus = workStatus;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -2297,6 +2297,13 @@ public class OrderServiceImpl implements IOrderService { ...@@ -2297,6 +2297,13 @@ public class OrderServiceImpl implements IOrderService {
if (result != null) { if (result != null) {
return result; return result;
} }
SysMechanic sysMechanic=sysMechanicDao.selectByUserId(userId);
/**
* 判断技工接单状态不可接单直接返回
*/
if(sysMechanic!=null && BizConstants.SYSMERCHANT_UNWOKE_STATUS==sysMechanic.getWorkStatus()){
return new ResultObject(ResultCodeEnum.SYSMERCHANT_UNWORK.getCode(), ResultCodeEnum.SYSMERCHANT_UNWORK.getMsg());
}
/* /*
* 指派技工 * 指派技工
*/ */
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result column="service_type" jdbcType="TINYINT" property="serviceType" /> <result column="service_type" jdbcType="TINYINT" property="serviceType" />
<result column="IDCard" jdbcType="VARCHAR" property="idcard" /> <result column="IDCard" jdbcType="VARCHAR" property="idcard" />
<result column="mechanic_status" jdbcType="TINYINT" property="mechanicStatus" /> <result column="mechanic_status" jdbcType="TINYINT" property="mechanicStatus" />
<result column="work_status" jdbcType="TINYINT" property="workStatus" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -200,4 +201,8 @@ ...@@ -200,4 +201,8 @@
mechanic_status = #{mechanicStatus,jdbcType=TINYINT} mechanic_status = #{mechanicStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="selectByUserId" resultMap="BaseResultMap">
select * from sys_mechanic where user_id=#{userId}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -1209,7 +1209,7 @@ ...@@ -1209,7 +1209,7 @@
and u.user_status = 'sys_user_status_normal' and u.user_status = 'sys_user_status_normal'
</where> </where>
GROUP BY u.id GROUP BY u.id
ORDER BY u.create_time DESC, u.id DESC ORDER BY m.work_status ASC, u.create_time DESC, u.id DESC
) d ) d
<where> <where>
<if test="queryContent != null and queryContent != ''"> <if test="queryContent != null and queryContent != ''">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!