Commit 0c89d793 by zhanghj

V1.5.1--新增服务商端获取商户的服务项目列表接口

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@25500 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent c98dd139
...@@ -12,6 +12,8 @@ public class SysResourceMatching { ...@@ -12,6 +12,8 @@ public class SysResourceMatching {
* 用户类型(0:系统管理员,1:服务商,2:门店,3:技工) * 用户类型(0:系统管理员,1:服务商,2:门店,3:技工)
*/ */
private Integer userType; private Integer userType;
private String serviceItemName;
public Integer getId() { public Integer getId() {
return id; return id;
...@@ -52,5 +54,13 @@ public class SysResourceMatching { ...@@ -52,5 +54,13 @@ public class SysResourceMatching {
public void setUserType(Integer userType) { public void setUserType(Integer userType) {
this.userType = userType; this.userType = userType;
} }
public String getServiceItemName() {
return serviceItemName;
}
public void setServiceItemName(String serviceItemName) {
this.serviceItemName = serviceItemName;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -1524,4 +1524,24 @@ public class UserController extends BaseController { ...@@ -1524,4 +1524,24 @@ public class UserController extends BaseController {
List<SysResourceMatching> list = sysUserService.getSPResourceMatchingMerchantList(); List<SysResourceMatching> list = sysUserService.getSPResourceMatchingMerchantList();
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), list); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), list);
} }
/**
*
* @author zhanghj
* @Title: getSPResourceMatchingServiceItemList
* @Description: TODO 获取当前服务商,对应商户的资源匹配服务项目列表
* @param merchantId
* @return
* ResultObject
* @version
*/
@RequestMapping(value = "/getSPResourceMatchingServiceItemList", method = { RequestMethod.GET })
public ResultObject getSPResourceMatchingServiceItemList(Integer merchantId) {
if (merchantId == null) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
}
Integer serviceId = ShiroUtil.getUserId();
List<SysResourceMatching> list = sysUserService.getSPResourceMatchingServiceItemList(serviceId, merchantId);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), list);
}
} }
...@@ -44,4 +44,18 @@ public interface SysResourceMatchingMapper { ...@@ -44,4 +44,18 @@ public interface SysResourceMatchingMapper {
*/ */
List<SysResourceMatching> getSPResourceMatchingMerchantList( List<SysResourceMatching> getSPResourceMatchingMerchantList(
@Param("serviceId")Integer serviceId); @Param("serviceId")Integer serviceId);
/**
*
* @author zhanghj
* @Title: getSPResourceMatchingServiceItemList
* @Description: TODO 获取服务商,对应商户的资源匹配服务项目列表
* @param serviceId
* @param merchantId
* @return
* List<SysResourceMatching>
* @version
*/
List<SysResourceMatching> getSPResourceMatchingServiceItemList(
@Param("serviceId")Integer serviceId, @Param("merchantId")Integer merchantId);
} }
\ No newline at end of file \ No newline at end of file
...@@ -11,6 +11,11 @@ public class SysResourceMatching { ...@@ -11,6 +11,11 @@ public class SysResourceMatching {
private String merchantName; private String merchantName;
/**
* 服务项目名称
*/
private String serviceItemName;
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -50,5 +55,13 @@ public class SysResourceMatching { ...@@ -50,5 +55,13 @@ public class SysResourceMatching {
public void setMerchantName(String merchantName) { public void setMerchantName(String merchantName) {
this.merchantName = merchantName; this.merchantName = merchantName;
} }
public String getServiceItemName() {
return serviceItemName;
}
public void setServiceItemName(String serviceItemName) {
this.serviceItemName = serviceItemName;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -423,4 +423,18 @@ public interface SysUserService { ...@@ -423,4 +423,18 @@ public interface SysUserService {
* @version * @version
*/ */
List<SysUserServiceItems> getUserServiceItemList(Integer merchantId); List<SysUserServiceItems> getUserServiceItemList(Integer merchantId);
/**
*
* @author zhanghj
* @Title: getSPResourceMatchingServiceItemList
* @Description: TODO 获取服务商,对应商户的资源匹配服务项目列表
* @param serviceId
* @param merchantId
* @return
* List<SysResourceMatching>
* @version
*/
List<SysResourceMatching> getSPResourceMatchingServiceItemList(
Integer serviceId, Integer merchantId);
} }
...@@ -1290,4 +1290,11 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -1290,4 +1290,11 @@ public class SysUserServiceImpl implements SysUserService {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return userServiceItemsMapper.selectByUserId(merchantId); return userServiceItemsMapper.selectByUserId(merchantId);
} }
@Override
public List<SysResourceMatching> getSPResourceMatchingServiceItemList(
Integer serviceId, Integer merchantId) {
// TODO Auto-generated method stub
return sysResourceMatchingMapper.getSPResourceMatchingServiceItemList(serviceId, merchantId);
}
} }
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<result column="user_id" jdbcType="INTEGER" property="userId" /> <result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="service_key" jdbcType="VARCHAR" property="serviceKey" /> <result column="service_key" jdbcType="VARCHAR" property="serviceKey" />
<result column="shop_name" jdbcType="VARCHAR" property="merchantName" /> <result column="shop_name" jdbcType="VARCHAR" property="merchantName" />
<result column="service_name" jdbcType="VARCHAR" property="serviceItemName" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -206,4 +207,13 @@ ...@@ -206,4 +207,13 @@
WHERE srm.user_id = #{serviceId } WHERE srm.user_id = #{serviceId }
AND su.user_status = 'sys_user_status_normal' AND su.user_status = 'sys_user_status_normal'
</select> </select>
<select id="getSPResourceMatchingServiceItemList" resultMap="BaseResultMap">
SELECT
srm.id, srm.merchant_id, srm.service_key, srm.user_id, ssi.service_name
FROM sys_resource_matching srm
LEFT JOIN sys_service_item ssi ON srm.service_key = ssi.service_code
WHERE srm.user_id = #{serviceId}
AND srm.merchant_id = #{merchantId}
</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!