Commit 9b62498f by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-auth into developer
parents 54ab6a70 9c2866fe
......@@ -79,4 +79,14 @@ public interface UserApiService {
* @throws
*/
ServiceResponse<List<UserListDTO>> listUser(UserListQO params);
/**
* 根据用户ID list查询用户信息
* @Title: listUserByIdList

* @Description:

 * @author guojuxing
* @param userIdList

* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.UserDTO>>


 */
ServiceResponse<List<UserDTO>> listUserByIdList(List<Integer> userIdList);
}
......@@ -96,4 +96,6 @@ public interface TabSysUserMapper {
Integer getFirstNotInUserId(@Param("enterpriseId") Integer enterpriseId, @Param("ids") List<Integer> userIdList);
Integer countUserByUserIds(@Param("ids") List<Integer> userIdList);
List<TabSysUser> listUserByIdList(@Param("ids")List<Integer> userIdList);
}
\ No newline at end of file
......@@ -79,4 +79,14 @@ public interface UserService {
Integer getAllCheckValue(Integer enterpriseId, List<Integer> userIdList);
boolean validUserIsNotExist(List<Integer> userIdList);
/**
* 用户ID list查询用户信息
* @Title: listUserByIdList

* @Description:

 * @author guojuxing
* @param userIdList

* @return java.util.List<com.gic.auth.entity.TabSysUser>


 */
List<TabSysUser> listUserByIdList(List<Integer> userIdList);
}
......@@ -97,4 +97,9 @@ public class UserServiceImpl implements UserService {
Integer count = tabSysUserMapper.countUserByUserIds(userIdList);
return count != userIdList.size();
}
@Override
public List<TabSysUser> listUserByIdList(List<Integer> userIdList) {
return tabSysUserMapper.listUserByIdList(userIdList);
}
}
......@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -230,6 +231,15 @@ public class UserApiServiceImpl implements UserApiService {
return ServiceResponse.success(list);
}
@Override
public ServiceResponse<List<UserDTO>> listUserByIdList(List<Integer> userIdList) {
List<TabSysUser> list = userService.listUserByIdList(userIdList);
if (CollectionUtils.isNotEmpty(list)) {
return ServiceResponse.success(EntityUtil.changeEntityListNew(UserDTO.class, list));
}
return ServiceResponse.success(new ArrayList<>());
}
/**
* 保存关联数据,角色关联、资源关联
* @Title: saveRole

......
......@@ -287,4 +287,18 @@
#{item}
</foreach>
</select>
<select id="listUserByIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_user
where status = 1
<if test="ids != null and ids.size() > 0">
and user_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -6,10 +6,15 @@ import com.gic.auth.dto.ResourceDTO;
import com.gic.auth.service.ResourceApiService;
import com.gic.auth.web.qo.PageQO;
import com.gic.auth.web.qo.ResourceQO;
import com.gic.auth.web.vo.ResourceVO;
import com.gic.auth.web.vo.StoreResouceVO;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.response.EnterpriseRestResponse;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.dto.StoreWidgetDTO;
import com.gic.store.service.StoreWidgetApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -25,13 +30,28 @@ public class ResourceController {
@Autowired
private ResourceApiService resourceApiService;
@Autowired
private StoreWidgetApiService storeWidgetApiService;
@RequestMapping("/save-resource")
public RestResponse saveResource(ResourceQO resourceQO) {
ResourceDTO resourceDTO = EntityUtil.changeEntityByOrika(ResourceDTO.class, resourceQO);
resourceDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
ServiceResponse<Integer> serviceResponse = resourceApiService.saveOrUpdateResource(resourceDTO);
return ResultControllerUtils.commonResult(serviceResponse);
StoreWidgetDTO storeWidgetDTO = new StoreWidgetDTO();
storeWidgetDTO.setAuthMode(resourceQO.getStoreResouce().getAuthMode());
storeWidgetDTO.setSearchParam(resourceQO.getStoreResouce().getSearchParam());
storeWidgetDTO.setStoreWidgetId(resourceQO.getStoreResouce().getStoreResourceId());
storeWidgetDTO.setWriteBackParam(resourceQO.getStoreResouce().getWriteBackParam());
ServiceResponse<Integer> storeWidgetResponse = this.storeWidgetApiService.saveAuthStoreWidget(storeWidgetDTO);
if(storeWidgetResponse.isSuccess()){
resourceDTO.setStoreResource(storeWidgetResponse.getResult().longValue());
ServiceResponse<Integer> response = resourceApiService.saveOrUpdateResource(resourceDTO);
if(response.isSuccess()){
return RestResponse.success(response.getResult());
}
return EnterpriseRestResponse.failure(response);
}
return EnterpriseRestResponse.failure(storeWidgetResponse);
}
@RequestMapping("/del-resource")
......@@ -50,8 +70,23 @@ public class ResourceController {
@RequestMapping("/get-resource")
public RestResponse getResource(Integer resourceId){
ServiceResponse<ResourceDTO> serviceResponse = resourceApiService.getResource(resourceId);
return ResultControllerUtils.commonResult(serviceResponse);
ServiceResponse<ResourceDTO> response = resourceApiService.getResource(resourceId);
if (response.isSuccess()) {
ResourceVO vo = EntityUtil.changeEntityByJSON(ResourceVO.class, response.getResult());
ServiceResponse<StoreWidgetDTO> storeWidget = this.storeWidgetApiService.getStoreWidget(response.getResult().getStoreResource().intValue());
if(storeWidget.isSuccess()) {
if (storeWidget.getResult() != null) {
StoreResouceVO storeResouceVO = new StoreResouceVO();
storeResouceVO.setStoreResourceId(response.getResult().getStoreResource().intValue());
storeResouceVO.setAuthMode(storeWidget.getResult().getAuthMode());
storeResouceVO.setSearchParam(storeWidget.getResult().getSearchParam());
storeResouceVO.setWriteBackParam(storeWidget.getResult().getWriteBackParam());
vo.setStoreResouce(storeResouceVO);
}
}
return RestResponse.success(vo);
}
return EnterpriseRestResponse.failure(response);
}
}
......@@ -48,7 +48,8 @@ public class ResourceQO implements Serializable {
/**
* 门店资源
*/
private Long storeResource;
// private Long storeResource;
private StoreResouceQO storeResouce;
/**
* 商品资源
......@@ -59,6 +60,7 @@ public class ResourceQO implements Serializable {
* 订单资源
*/
private Long orderResource;
public Integer getResourceId() {
return resourceId;
}
......@@ -107,12 +109,12 @@ public class ResourceQO implements Serializable {
this.appletResource = appletResource;
}
public Long getStoreResource() {
return storeResource;
public StoreResouceQO getStoreResouce() {
return storeResouce;
}
public void setStoreResource(Long storeResource) {
this.storeResource = storeResource;
public void setStoreResouce(StoreResouceQO storeResouce) {
this.storeResouce = storeResouce;
}
public Long getGoodsResource() {
......
package com.gic.auth.web.vo;
import java.io.Serializable;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-24 17:41
*/
public class ResourceVO implements Serializable{
private static final long serialVersionUID = 7757529718726436352L;
/**
*
*/
private Integer resourceId;
/**
* 资源名称
*/
private String resourceName;
/**
*
*/
private Integer enterpriseId;
/**
* 会员卡资源控件id
*/
private Long memberCardResource;
/**
* 服务号资源
*/
private Long fwhResource;
/**
* 小程序资源
*/
private Long appletResource;
/**
* 门店资源
*/
private Long storeResource;
/**
* 订单资源
[
{
"channel":1, // 渠道 1:线下门店, 2:达摩微商城, 3:微盟微商城
"storeContent":1 // 门店id或门店选择器id, 多个逗号隔开
}
]
*/
private String orderResource;
/**
* 应用资源
[
{
appId:1, // 应用id
appName:微商城 // 应用名称
child:[
appId: 10, // 子应用id
appName: 短信发送 // 子应用名称
]
}
]
*/
private String appResource;
private Integer userResourceCount;
private StoreResouceVO storeResouce;
public Integer getResourceId() {
return resourceId;
}
public void setResourceId(Integer resourceId) {
this.resourceId = resourceId;
}
public String getResourceName() {
return resourceName;
}
public void setResourceName(String resourceName) {
this.resourceName = resourceName;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
public Long getMemberCardResource() {
return memberCardResource;
}
public void setMemberCardResource(Long memberCardResource) {
this.memberCardResource = memberCardResource;
}
public Long getFwhResource() {
return fwhResource;
}
public void setFwhResource(Long fwhResource) {
this.fwhResource = fwhResource;
}
public Long getAppletResource() {
return appletResource;
}
public void setAppletResource(Long appletResource) {
this.appletResource = appletResource;
}
public Long getStoreResource() {
return storeResource;
}
public void setStoreResource(Long storeResource) {
this.storeResource = storeResource;
}
public String getOrderResource() {
return orderResource;
}
public void setOrderResource(String orderResource) {
this.orderResource = orderResource;
}
public String getAppResource() {
return appResource;
}
public void setAppResource(String appResource) {
this.appResource = appResource;
}
public Integer getUserResourceCount() {
return userResourceCount;
}
public void setUserResourceCount(Integer userResourceCount) {
this.userResourceCount = userResourceCount;
}
public void setStoreResouce(StoreResouceVO storeResouce) {
this.storeResouce = storeResouce;
}
public StoreResouceVO getStoreResouce() {
return storeResouce;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment