仓库-用户

master
anthonywj 2 years ago
parent 3b8455ebe6
commit 64ae05af65

@ -1,5 +1,6 @@
package com.glxp.api.controller.auth;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
@ -10,7 +11,9 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.DeptEntity;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.auth.WarehouseUserEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.req.auth.FilterInvLinkDataRequest;
import com.glxp.api.req.auth.FilterInvSubWarehouseRequest;
import com.glxp.api.req.auth.FilterInvWarehouseRequest;
import com.glxp.api.req.system.DeleteRequest;
@ -18,11 +21,13 @@ import com.glxp.api.req.system.FilterBasicThirdSysRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.InvSubWarehouseResponse;
import com.glxp.api.res.auth.InvWarehouseThirdSysResponse;
import com.glxp.api.res.auth.WarehouseUserResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.auth.DeptService;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.auth.WarehouseUserService;
import com.glxp.api.service.system.SystemParamConfigService;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -31,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -45,8 +51,6 @@ public class InvWarehouseController {
CustomerService customerService;
@Resource
private WarehouseUserService warehouseUserService;
// @Resource
// private InvSpaceService invSpaceService;
@Resource
private SystemParamConfigService systemParamConfigService;
@ -294,4 +298,32 @@ public class InvWarehouseController {
return ResultVOUtils.success(responses);
}
/**
*
*/
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/warehouseUserList")
public BaseResponse getWarehouseUserList(@RequestBody @Valid FilterInvLinkDataRequest filterInvLinkDataRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.getWarehouseUserList(filterInvLinkDataRequest);
PageInfo<WarehouseUserEntity> pageInfo = new PageInfo<>(warehouseUserEntities);
List<WarehouseUserResponse> result = new ArrayList<>();
if (CollUtil.isNotEmpty(pageInfo.getList())) {
pageInfo.getList().forEach(warehouseUserEntity -> {
WarehouseUserResponse warehouseUserResponse = new WarehouseUserResponse();
BeanUtils.copyProperties(warehouseUserEntity, warehouseUserResponse);
warehouseUserResponse.setUserid(warehouseUserEntity.getUserid() + "");
result.add(warehouseUserResponse);
});
}
PageSimpleResponse<WarehouseUserResponse> response = new PageSimpleResponse<>();
response.setList(result);
response.setTotal(pageInfo.getTotal());
return ResultVOUtils.success(response);
}
}

@ -2,10 +2,12 @@ package com.glxp.api.dao.auth;
import com.glxp.api.entity.auth.WarehouseUserEntity;
import com.glxp.api.req.auth.FilterInvUserRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface WarehouseUserDao {
int deleteByPrimaryKey(Integer id);

@ -0,0 +1,34 @@
package com.glxp.api.res.auth;
import lombok.Data;
@Data
public class WarehouseUserResponse {
/**
* id
*/
private Integer id;
/**
*
*/
private String code;
/**
* id
*/
private String userid;
/**
* /
*/
private String username;
/**
*
*/
private boolean isDirector;
private String employeeName;
}

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.inout.WarehouseUserDao">
<mapper namespace="com.glxp.api.dao.auth.WarehouseUserDao">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.auth.WarehouseUserEntity">
<!--@mbg.generated-->
<!--@Table auth_warehouse_user-->

Loading…
Cancel
Save