1.增加添加用户逻辑校验,分仓查询用户添加条件,查询非禁用用户

fengcang
x_z 3 years ago
parent 727e9481c6
commit 0522c48aff

@ -51,8 +51,6 @@ import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -1177,9 +1175,14 @@ public class WareHouseController {
public BaseResponse saveWarehouseUser(@RequestBody Map<String, Object> params) { public BaseResponse saveWarehouseUser(@RequestBody Map<String, Object> params) {
String code = String.valueOf(params.get("code")); String code = String.valueOf(params.get("code"));
String userListJson = String.valueOf(params.get("userList")); String userListJson = String.valueOf(params.get("userList"));
if (StrUtil.isBlank(code) || StrUtil.isBlank(userListJson)) if (StrUtil.isBlank(code) || StrUtil.isBlank(userListJson)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
warehouseUserService.saveWarehouseUser(code, JSONUtil.toList(userListJson, AuthAdmin.class)); }
List<AuthAdmin> userList = JSONUtil.toList(userListJson, AuthAdmin.class);
if (CollUtil.isEmpty(userList)) {
return ResultVOUtils.error(500, "用户列表不能为空");
}
warehouseUserService.saveWarehouseUser(code, userList);
invWarehouseService.updateTime(code, new Date()); invWarehouseService.updateTime(code, new Date());
return ResultVOUtils.success(); return ResultVOUtils.success();
} }

@ -117,6 +117,7 @@ public class AuthAdminServiceImpl implements AuthAdminService {
@Override @Override
public List<AuthAdmin> getHospitalUserList() { public List<AuthAdmin> getHospitalUserList() {
//查询未被禁用的医院用户
List<AuthAdmin> userList = authAdminDao.selectHospitalUser(); List<AuthAdmin> userList = authAdminDao.selectHospitalUser();
if (CollUtil.isEmpty(userList)) { if (CollUtil.isEmpty(userList)) {
return Collections.emptyList(); return Collections.emptyList();

@ -137,5 +137,6 @@
<select id="selectHospitalUser" resultType="com.glxp.api.admin.entity.auth.AuthAdmin"> <select id="selectHospitalUser" resultType="com.glxp.api.admin.entity.auth.AuthAdmin">
select * select *
from auth_user from auth_user
where userFlag != 0
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save