Commit 6f4cc382 authored by 周健威's avatar 周健威

扩展信息

parent cbd7cefd
...@@ -180,6 +180,13 @@ public class UserBiz extends BaseBiz<UserMapper,User> { ...@@ -180,6 +180,13 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
return mapper.select(user); return mapper.select(user);
} }
public List<User> getCountByUsernameBiz(String username, Integer bizType){
User user = new User();
user.setUsername(username);
user.setBizType(bizType);
return mapper.select(user);
}
public User getUserByUid(Integer userId){ public User getUserByUid(Integer userId){
return mapper.selectByPrimaryKey(userId); return mapper.selectByPrimaryKey(userId);
} }
......
...@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import static com.github.wxiaoqi.security.admin.entity.User.BIZ_TYPE_BUSINESS;
import static com.github.wxiaoqi.security.admin.entity.User.BIZ_TYPE_OPERATE; import static com.github.wxiaoqi.security.admin.entity.User.BIZ_TYPE_OPERATE;
import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_FALSE; import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_FALSE;
import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_TRUE; import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_TRUE;
...@@ -102,7 +103,25 @@ public class ChwUserController extends CommonBaseController implements UserRestI ...@@ -102,7 +103,25 @@ public class ChwUserController extends CommonBaseController implements UserRestI
vo.setBizType(BIZ_TYPE_OPERATE); vo.setBizType(BIZ_TYPE_OPERATE);
vo.setStatus(SYS_TRUE); vo.setStatus(SYS_TRUE);
if (StringUtils.isNotBlank(username)) { if (StringUtils.isNotBlank(username)) {
List<User> list = userBiz.getCountByUsername(username); List<User> list = userBiz.getCountByUsernameBiz(username, BIZ_TYPE_OPERATE);
if (list.size() > 0) {
return ObjectRestResponse.createFailedResult(ResCode.USER_IS_EXIST.getCode(), ResCode.USER_IS_EXIST.getDesc());
}
}
userBiz.insertSelective(vo);
//添加权限关系
groupBiz.modifyUserGroups(vo.getId(), vo.getMembers());
return ObjectRestResponse.succ();
}
@RequestMapping(value = "/business/addUser", method = RequestMethod.POST)
@IgnoreClientToken
public ObjectRestResponse<User> businessAdd(@RequestBody UserController.UserVO vo) {
String username = vo.getUsername();
vo.setBizType(BIZ_TYPE_BUSINESS);
vo.setStatus(SYS_TRUE);
if (StringUtils.isNotBlank(username)) {
List<User> list = userBiz.getCountByUsernameBiz(username, BIZ_TYPE_BUSINESS);
if (list.size() > 0) { if (list.size() > 0) {
return ObjectRestResponse.createFailedResult(ResCode.USER_IS_EXIST.getCode(), ResCode.USER_IS_EXIST.getDesc()); return ObjectRestResponse.createFailedResult(ResCode.USER_IS_EXIST.getCode(), ResCode.USER_IS_EXIST.getDesc());
} }
......
...@@ -85,4 +85,9 @@ public class VehiclePlatCata implements Serializable { ...@@ -85,4 +85,9 @@ public class VehiclePlatCata implements Serializable {
@Column(name = "is_input_more") @Column(name = "is_input_more")
@ApiModelProperty(value = "商家录入是否多选 0--否;1--是" ) @ApiModelProperty(value = "商家录入是否多选 0--否;1--是" )
private Integer isInputMore; private Integer isInputMore;
//类型 1--房车;2--机车;3--游艇
@Column(name = "goods_type")
@ApiModelProperty(value = "类型 1--房车;2--机车;3--游艇" )
private Integer goodsType;
} }
...@@ -200,11 +200,11 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl ...@@ -200,11 +200,11 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
* @param limit * @param limit
* @return * @return
*/ */
public ObjectRestResponse getCascades(Integer page, Integer limit, Integer sort) { public ObjectRestResponse getCascades(Integer page, Integer limit, Integer sort, Integer goodsType) {
try { try {
//标签列表页面 //标签列表页面
if (sort == null || sort == 0) { if (sort == null || sort == 0) {
return getPage(page, limit); return getPage(page, limit, goodsType);
} }
//增加车型页面 //增加车型页面
...@@ -236,12 +236,16 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl ...@@ -236,12 +236,16 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
} }
@Cache(key = RedisKey.BRANCH_COMPANY_CATA_PAGE) @Cache(key = RedisKey.BRANCH_COMPANY_CATA_PAGE)
private ObjectRestResponse getPage(Integer page, Integer limit) { private ObjectRestResponse getPage(Integer page, Integer limit, Integer goodsType) {
//获取一级标签 //获取一级标签
WeekendSqls<VehiclePlatCata> weekendSqls = WeekendSqls.<VehiclePlatCata>custom();
if(null != goodsType){
weekendSqls.andEqualTo(VehiclePlatCata::getGoodsType, goodsType);
}
weekendSqls.andEqualTo(VehiclePlatCata::getParentId, 0)
.andEqualTo(VehiclePlatCata::getState, 0);
Example example = Example.builder(VehiclePlatCata.class) Example example = Example.builder(VehiclePlatCata.class)
.where(WeekendSqls.<VehiclePlatCata>custom() .where(weekendSqls)
.andEqualTo(VehiclePlatCata::getParentId, 0)
.andEqualTo(VehiclePlatCata::getState, 0))
.orderByAsc("rank") .orderByAsc("rank")
.build(); .build();
......
...@@ -98,7 +98,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata ...@@ -98,7 +98,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
,@PathVariable Integer limit ,@PathVariable Integer limit
,@PathVariable Integer sort){ ,@PathVariable Integer sort){
return baseBiz.getCascades(page,limit,sort); return baseBiz.getCascades(page,limit,sort,null);
} }
......
...@@ -90,12 +90,13 @@ public class BgVehicleCataController extends VehicleBaseController<VehiclePlatCa ...@@ -90,12 +90,13 @@ public class BgVehicleCataController extends VehicleBaseController<VehiclePlatCa
*/ */
@GetMapping(value = "/operation/getCascades") @GetMapping(value = "/operation/getCascades")
public ObjectRestResponse getCascades(PageDTO dto){ public ObjectRestResponse getCascades(PageDTO dto){
return baseBiz.getCascades(dto.getPage(), dto.getLimit(), dto.getSort()); return baseBiz.getCascades(dto.getPage(), dto.getLimit(), dto.getSort(), dto.getGoodsType());
} }
@Data @Data
public static class PageDTO extends PageParam { public static class PageDTO extends PageParam {
Integer sort; Integer sort;
Integer goodsType;
} }
......
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