Commit bcad3f14 by zhanghj

V1.2.0--增加服务商获取技工订货单列表接口

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21989 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent cb429b9c
...@@ -236,6 +236,48 @@ public class IndentController extends BaseController{ ...@@ -236,6 +236,48 @@ public class IndentController extends BaseController{
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result);
} }
/**
*
* @author zhanghj
* @Title: getMechanicIndentListByPage
* @Description: TODO 获取服务商下技工订货单列表
* @param request
* @param pageIndex
* @param pageSize
* @param indent
* @return
* ResultObject
*
*/
@AuthCheck
@RequestMapping(value="/getMechanicIndentListByPage", method=RequestMethod.GET)
public ResultObject getMechanicIndentListByPage(HttpServletRequest request, @RequestParam(defaultValue = "1") int pageIndex, @RequestParam(defaultValue = "10") int pageSize, SysIndent indent) {
Map<String, Object> result = new HashMap<String, Object>();
if(indent!=null){
logger.info("服务商端获取技工订货单列表搜索传递的参数:"+JSONObject.toJSONString(indent));
}
Integer indentStatus = indent.getIndentStatus();
/**
* 50定义为取消
*/
if (indentStatus != null && 50 == indentStatus) {
indent.setIsCanceled(1);
indent.setIndentStatus(null);
}
Page page = new Page(pageIndex, pageSize);
List<SysIndent> list = indentService.getMechanicIndentListByPage(request, page, indent);
com.github.pagehelper.Page<SysIndent> pages = (com.github.pagehelper.Page<SysIndent>) list;
page.setTotalCount((int) pages.getTotal());
result.put("page", page);
result.put("items", list);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result);
}
/** /**
* *
* @author zhanghj * @author zhanghj
......
...@@ -84,4 +84,16 @@ public interface SysIndentMapper { ...@@ -84,4 +84,16 @@ public interface SysIndentMapper {
* *
*/ */
List<SysIndent> getSPIndentList(SysIndent indent); List<SysIndent> getSPIndentList(SysIndent indent);
/**
*
* @author zhanghj
* @Title: getMechanicIndentListByPage
* @Description: TODO 获取服务商下技工订货单列表
* @param indent
* @return
* List<SysIndent>
*
*/
List<SysIndent> getMechanicIndentListByPage(SysIndent indent);
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,6 +6,7 @@ import javax.validation.constraints.NotNull; ...@@ -6,6 +6,7 @@ import javax.validation.constraints.NotNull;
import javax.validation.groups.Default; import javax.validation.groups.Default;
import com.glsx.ordercenter.dto.Traces; import com.glsx.ordercenter.dto.Traces;
import com.glsx.ordercenter.pojo.user.SysUser;
public class SysIndent extends BaseModel{ public class SysIndent extends BaseModel{
...@@ -81,6 +82,10 @@ public class SysIndent extends BaseModel{ ...@@ -81,6 +82,10 @@ public class SysIndent extends BaseModel{
* 物流轨迹 * 物流轨迹
*/ */
private Traces traces; private Traces traces;
/**
* 用户信息
*/
private SysUser user;
public Integer getId() { public Integer getId() {
return id; return id;
...@@ -258,6 +263,14 @@ public class SysIndent extends BaseModel{ ...@@ -258,6 +263,14 @@ public class SysIndent extends BaseModel{
this.traces = traces; this.traces = traces;
} }
public SysUser getUser() {
return user;
}
public void setUser(SysUser user) {
this.user = user;
}
@Override @Override
public String toString() { public String toString() {
return "SysIndent [id=" + id + ", indentNo=" + indentNo + ", sendType=" return "SysIndent [id=" + id + ", indentNo=" + indentNo + ", sendType="
......
...@@ -156,4 +156,19 @@ public interface IndentService { ...@@ -156,4 +156,19 @@ public interface IndentService {
* *
*/ */
ResultObject confirmReceipt(HttpServletRequest request, Integer id); ResultObject confirmReceipt(HttpServletRequest request, Integer id);
/**
*
* @author zhanghj
* @Title: getMechanicIndentListByPage
* @Description: TODO 获取服务商下技工订货单列表
* @param request
* @param page
* @param indent
* @return
* List<SysIndent>
*
*/
List<SysIndent> getMechanicIndentListByPage(HttpServletRequest request,
Page page, SysIndent indent);
} }
...@@ -636,5 +636,17 @@ public class IndentServiceImpl implements IndentService { ...@@ -636,5 +636,17 @@ public class IndentServiceImpl implements IndentService {
return result; return result;
} }
@Override
public List<SysIndent> getMechanicIndentListByPage(
HttpServletRequest request, Page page, SysIndent indent) {
int pageIndex = page.getPageIndex();
int pageSize = page.getPageSize();
PageHelper.startPage(pageIndex, pageSize, true);
Integer currentUserId = UserUtils.getUserId(request);
indent.setUserId(currentUserId);
List<SysIndent> list = indentDao.getMechanicIndentListByPage(indent);;
return list;
}
} }
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="username" jdbcType="VARCHAR" property="username" /> <result column="username" jdbcType="VARCHAR" property="username" />
<result column="deviceName" jdbcType="VARCHAR" property="deviceName" /> <result column="deviceName" jdbcType="VARCHAR" property="deviceName" />
<association property="user" javaType="com.glsx.ordercenter.pojo.user.SysUser">
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
</association>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, indent_no, user_id, device_type, device_amount, indent_status, is_canceled, district_code, id, indent_no, user_id, device_type, device_amount, indent_status, is_canceled, district_code,
...@@ -404,10 +408,6 @@ ...@@ -404,10 +408,6 @@
<if test="queryContent != null and queryContent != ''"> <if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'"/> <bind name="queryContent" value="'%' + queryContent + '%'"/>
</if> </if>
SELECT
*
FROM
(
select select
si.id, si.indent_no, si.send_type, si.user_id, si.device_type, si.id, si.indent_no, si.send_type, si.user_id, si.device_type,
si.device_amount, si.indent_status, si.is_canceled, si.phone, si.device_amount, si.indent_status, si.is_canceled, si.phone,
...@@ -420,37 +420,42 @@ ...@@ -420,37 +420,42 @@
LEFT JOIN sys_user su ON si.user_id = su.id LEFT JOIN sys_user su ON si.user_id = su.id
LEFT JOIN sys_dict_data sdd ON si.device_type = sdd.data_key LEFT JOIN sys_dict_data sdd ON si.device_type = sdd.data_key
<where> <where>
<if test="userId != null"> <if test="userId != null">
and si.user_id = #{userId} and si.user_id = #{userId}
</if> </if>
<if test="indentStatus != null"> <if test="indentStatus != null">
and si.indent_status = #{indentStatus} and si.indent_status = #{indentStatus}
</if> </if>
<if test="isCanceled != null"> <if test="isCanceled != null">
and si.is_canceled = #{isCanceled} and si.is_canceled = #{isCanceled}
</if> </if>
<if test="beginDate != null and beginDate != ''"> <if test="beginDate != null and beginDate != ''">
and date_format(si.create_time, '%Y-%m') = #{beginDate} and date_format(si.create_time, '%Y-%m') = #{beginDate}
</if> </if>
<if test="queryContent != null"> <if test="queryContent != null">
and si.indent_no like #{queryContent} and si.indent_no like #{queryContent}
</if> </if>
</where> </where>
ORDER BY si.create_time DESC, si.id DESC
UNION
</select>
<select id="getMechanicIndentListByPage" parameterType="com.glsx.ordercenter.pojo.SysIndent" resultMap="BaseResultMap">
<if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'"/>
</if>
select select
si.id, si.indent_no, si.send_type, si.user_id, si.device_type, si.id, si.indent_no, si.send_type, si.user_id, si.device_type,
si.device_amount, si.indent_status, si.is_canceled, si.phone, si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.receiver_name, si.district_code, si.address, si.remark, si.receiver_name, si.district_code, si.address, si.remark,
si.create_by, si.create_time, si.update_by, si.update_time, si.create_by, si.create_time, si.update_by, si.update_time,
su.username, su.username, su.name, su.phone_number,
sdd.data_value as deviceName sdd.data_value as deviceName
FROM FROM
sys_indent si sys_indent si
LEFT JOIN sys_user su ON si.user_id = su.id LEFT JOIN sys_user su ON si.user_id = su.id
LEFT JOIN sys_dict_data sdd ON si.device_type = sdd.data_key LEFT JOIN sys_dict_data sdd ON si.device_type = sdd.data_key
LEFT JOIN sys_service_mechanic ssm ON si.user_id = ssm.mechanic_id LEFT JOIN sys_service_mechanic ssm ON si.user_id = ssm.mechanic_id
<where> <where>
si.send_type = 1 si.send_type = 1
<if test="userId != null"> <if test="userId != null">
...@@ -466,12 +471,10 @@ ...@@ -466,12 +471,10 @@
and date_format(si.create_time, '%Y-%m') = #{beginDate} and date_format(si.create_time, '%Y-%m') = #{beginDate}
</if> </if>
<if test="queryContent != null"> <if test="queryContent != null">
and si.indent_no like #{queryContent} and (si.indent_no like #{queryContent} or su.name like #{queryContent})
</if> </if>
</where> </where>
) t ORDER BY si.create_time DESC, si.id DESC
ORDER BY t.create_time DESC, t.id DESC </select>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!