|
|
|
@ -7,11 +7,14 @@ import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicCorpEntity;
|
|
|
|
|
import com.glxp.api.exception.JsonException;
|
|
|
|
|
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
|
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.basic.BasicCorpResponse;
|
|
|
|
|
import com.glxp.api.service.auth.AuthAdminService;
|
|
|
|
|
import com.glxp.api.service.basic.BasicCorpService;
|
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
@ -37,6 +40,8 @@ public class BasicCorpController {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private BasicCorpService basicUnitMaintainService;
|
|
|
|
|
@Resource
|
|
|
|
|
private AuthAdminService authAdminService;
|
|
|
|
|
|
|
|
|
|
@GetMapping("/udiwms/basic/unit/maintain/filter")
|
|
|
|
|
public BaseResponse filterBasicUnitMaintain(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest,
|
|
|
|
@ -45,10 +50,10 @@ public class BasicCorpController {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
List<BasicCorpEntity> basicUnitMaintainEntities;
|
|
|
|
|
List<BasicCorpResponse> basicUnitMaintainEntities;
|
|
|
|
|
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
|
|
|
|
|
PageInfo<BasicCorpEntity> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
|
|
|
|
|
PageSimpleResponse<BasicCorpEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
PageInfo<BasicCorpResponse> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
|
|
|
|
|
PageSimpleResponse<BasicCorpResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
|
pageSimpleResponse.setList(basicUnitMaintainEntities);
|
|
|
|
|
|
|
|
|
@ -66,10 +71,10 @@ public class BasicCorpController {
|
|
|
|
|
if (basicUnitMaintainFilterRequest.getCompanyIdFk() == null)
|
|
|
|
|
return ResultVOUtils.error(500, "企业ID不能为空!");
|
|
|
|
|
|
|
|
|
|
List<BasicCorpEntity> basicUnitMaintainEntities;
|
|
|
|
|
List<BasicCorpResponse> basicUnitMaintainEntities;
|
|
|
|
|
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
|
|
|
|
|
PageInfo<BasicCorpEntity> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
|
|
|
|
|
PageSimpleResponse<BasicCorpEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
PageInfo<BasicCorpResponse> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
|
|
|
|
|
PageSimpleResponse<BasicCorpResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
|
pageSimpleResponse.setList(basicUnitMaintainEntities);
|
|
|
|
|
|
|
|
|
@ -161,4 +166,14 @@ public class BasicCorpController {
|
|
|
|
|
String companyId = request.getHeader("companyId");
|
|
|
|
|
return companyId;
|
|
|
|
|
}
|
|
|
|
|
public String getCustomerId() {
|
|
|
|
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
|
|
|
if (attributes == null) {
|
|
|
|
|
throw new JsonException(ResultEnum.NOT_NETWORK);
|
|
|
|
|
}
|
|
|
|
|
HttpServletRequest request = attributes.getRequest();
|
|
|
|
|
String userId = request.getHeader("ADMIN_ID");
|
|
|
|
|
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
|
|
|
|
|
return authAdmin.getCustomerId() + "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|