|
|
|
@ -8,20 +8,20 @@ import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
|
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.ConstantType;
|
|
|
|
|
import com.glxp.api.entity.auth.*;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SystemParamConfigEntity;
|
|
|
|
|
import com.glxp.api.req.auth.BussinessTypeFilterRequest;
|
|
|
|
|
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.auth.*;
|
|
|
|
|
import com.glxp.api.req.basic.FilterBussinessTypeRequest;
|
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
|
import com.glxp.api.req.thrsys.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.res.basic.BasicBussinessTypeResponse;
|
|
|
|
|
import com.glxp.api.service.auth.*;
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
|
import com.glxp.api.service.system.SystemParamConfigService;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
@ -52,6 +52,8 @@ public class InvWarehouseController {
|
|
|
|
|
private SystemParamConfigService systemParamConfigService;
|
|
|
|
|
@Resource
|
|
|
|
|
private WarehouseBussinessTypeService warehouseBussinessTypeService;
|
|
|
|
|
@Resource
|
|
|
|
|
private IBasicBussinessTypeService basicBussinessTypeService;
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("spms/sub/inv/warehouse/filter")
|
|
|
|
@ -340,6 +342,65 @@ public class InvWarehouseController {
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//仓库关联单据类型管理页面数据
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/warehouse/invRelBusType/manageList")
|
|
|
|
|
public BaseResponse getManageList(@RequestBody @Valid FilterInvLinkDataRequest filterInvLinkDataRequest, BindingResult bindingResult) {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//1.获取所有单据类型
|
|
|
|
|
FilterBussinessTypeRequest filterBussinessTypeRequest = new FilterBussinessTypeRequest();
|
|
|
|
|
filterBussinessTypeRequest.setEnable(true);
|
|
|
|
|
List<BasicBussinessTypeEntity> basicBussinessTypeEntities = basicBussinessTypeService.findList(filterBussinessTypeRequest);
|
|
|
|
|
|
|
|
|
|
//获取仓库关联单据类型
|
|
|
|
|
if (StrUtil.isEmpty(filterInvLinkDataRequest.getCode()))
|
|
|
|
|
return ResultVOUtils.error(500, "仓库编码不能为空!");
|
|
|
|
|
List<WarehouseBussinessTypeEntity> warehouseBussniessTypeList = warehouseBussinessTypeService.getWarehouseBussniessTypeList(filterInvLinkDataRequest);
|
|
|
|
|
|
|
|
|
|
basicBussinessTypeEntities.forEach(basicBussinessTypeEntity ->
|
|
|
|
|
{
|
|
|
|
|
for (WarehouseBussinessTypeEntity warehouseBussinessTypeEntity : warehouseBussniessTypeList) {
|
|
|
|
|
if (warehouseBussinessTypeEntity.getAction().equals(basicBussinessTypeEntity.getAction())) {
|
|
|
|
|
basicBussinessTypeEntity.setSelect(true);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return ResultVOUtils.success(basicBussinessTypeEntities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/spms/invRelBusType/warehouse/post")
|
|
|
|
|
public BaseResponse postRes(@RequestBody UpdateInvRelBusRequest relBusRequset) {
|
|
|
|
|
if (StrUtil.isEmpty(relBusRequset.getInvCode()))
|
|
|
|
|
return ResultVOUtils.error(500, "仓库编码不能为空!");
|
|
|
|
|
boolean b = warehouseBussinessTypeService.deleteByCode(relBusRequset.getInvCode());
|
|
|
|
|
if (CollUtil.isNotEmpty(relBusRequset.getSelectActions())) {
|
|
|
|
|
List<BasicBussinessTypeResponse> basicBussinessTypeResponses = new ArrayList<>();
|
|
|
|
|
relBusRequset.getSelectActions().forEach(action ->
|
|
|
|
|
{
|
|
|
|
|
BasicBussinessTypeResponse basicBussinessTypeResponse = new BasicBussinessTypeResponse();
|
|
|
|
|
basicBussinessTypeResponse.setAction(action);
|
|
|
|
|
basicBussinessTypeResponses.add(basicBussinessTypeResponse);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
warehouseBussinessTypeService.saveWarehouseBussinessType(relBusRequset.getInvCode(), basicBussinessTypeResponses);
|
|
|
|
|
}
|
|
|
|
|
//更新仓库修改时间
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(relBusRequset.getInvCode());
|
|
|
|
|
DeptEntity pEntity = deptService.selectByCode(invWarehouseEntity.getParentId());
|
|
|
|
|
pEntity.setUpdateTime(new Date());
|
|
|
|
|
deptService.updateInvWarehouse(pEntity);
|
|
|
|
|
return ResultVOUtils.success("修改成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/bussinessType/joinFilter")
|
|
|
|
|
public BaseResponse filterJoinBussinessType(BussinessTypeFilterRequest bussinessTypeFilterRequest,
|
|
|
|
|