|
|
|
@ -1,6 +1,11 @@
|
|
|
|
|
package com.glxp.api.controller.basic;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import com.glxp.api.dto.DictDto;
|
|
|
|
|
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.api.req.auth.FilterInvSubWarehouseRequest;
|
|
|
|
|
import com.glxp.api.res.basic.FromCorpResponse;
|
|
|
|
|
import com.glxp.api.service.auth.InvWarehouseService;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
@ -589,5 +594,49 @@ public class BasicCorpController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success(getCorpList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
InvWarehouseService invWarehouseService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 往来单位类型:1.客户,2:供应商,3:内部科室,4.特殊单据
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/basic/collect/fromCorp")
|
|
|
|
|
public BaseResponse getFromCorp(@RequestBody BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest) {
|
|
|
|
|
List<FromCorpResponse> fromCorpResponses = new ArrayList<>();
|
|
|
|
|
if (basicUnitMaintainFilterRequest.getCorpType() == 3) {
|
|
|
|
|
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
|
|
|
|
|
BeanUtils.copyProperties(basicUnitMaintainFilterRequest, filterInvSubWarehouseRequest);
|
|
|
|
|
filterInvSubWarehouseRequest.setAdvanceType(1);
|
|
|
|
|
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
|
|
|
|
|
List<InvWarehouseEntity> results = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(invWarehouseEntities)) {
|
|
|
|
|
invWarehouseEntities.forEach(invWarehouseEntity -> {
|
|
|
|
|
if (!invWarehouseEntity.getCode().equals(basicUnitMaintainFilterRequest.getInvCode())) {
|
|
|
|
|
results.add(invWarehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
for (InvWarehouseEntity invWarehouseEntity : results) {
|
|
|
|
|
FromCorpResponse fromCorpResponse = new FromCorpResponse();
|
|
|
|
|
fromCorpResponse.setCode(invWarehouseEntity.getCode());
|
|
|
|
|
fromCorpResponse.setName(invWarehouseEntity.getName());
|
|
|
|
|
fromCorpResponses.add(fromCorpResponse);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
List<BasicCorpEntity> getCorpList = basicUnitMaintainService.selectCorpList(basicUnitMaintainFilterRequest);
|
|
|
|
|
for (BasicCorpEntity basicCorpEntity : getCorpList) {
|
|
|
|
|
FromCorpResponse fromCorpResponse = new FromCorpResponse();
|
|
|
|
|
fromCorpResponse.setCode(basicCorpEntity.getErpId());
|
|
|
|
|
fromCorpResponse.setName(basicCorpEntity.getName());
|
|
|
|
|
fromCorpResponses.add(fromCorpResponse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success(fromCorpResponses);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|