|
|
@ -6,12 +6,13 @@ 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 com.glxp.api.entity.basic.BasicBusTypePreEntity;
|
|
|
|
import com.glxp.api.entity.basic.BasicBusTypePreEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
|
|
|
|
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
|
|
|
|
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
|
|
|
|
import com.glxp.api.req.basic.FilterBusTypePreRequest;
|
|
|
|
import com.glxp.api.req.basic.FilterBusTypePreRequest;
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
|
|
|
import com.glxp.api.service.auth.InvWarehouseService;
|
|
|
|
import com.glxp.api.service.auth.InvWarehouseService;
|
|
|
|
import com.glxp.api.service.basic.IBasicBusTypePreService;
|
|
|
|
import com.glxp.api.service.basic.IBasicBusTypePreService;
|
|
|
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@ -32,11 +33,20 @@ public class BasicBusTypePreController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private IBasicBusTypePreService basicBusTypePreService;
|
|
|
|
private IBasicBusTypePreService basicBusTypePreService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private IBasicBussinessTypeService basicBussinessTypeService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
private InvWarehouseService invWarehouseService;
|
|
|
|
private InvWarehouseService invWarehouseService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 补单单据类型差查询
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param filterBusTypePreRequest
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
@GetMapping("/spms/bussinessChangeType/filter")
|
|
|
|
@GetMapping("/spms/bussinessChangeType/filter")
|
|
|
|
public BaseResponse filterBussinessType(FilterBusTypePreRequest bussinessTypeFilterRequest) {
|
|
|
|
public BaseResponse filterBussinessType(FilterBusTypePreRequest filterBusTypePreRequest) {
|
|
|
|
|
|
|
|
//查询扫码单据类型
|
|
|
|
|
|
|
|
BasicBussinessTypeEntity basicBussinessType = basicBussinessTypeService.findByAction(filterBusTypePreRequest.getAction());
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success(null);
|
|
|
|
return ResultVOUtils.success(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -46,15 +56,18 @@ public class BasicBusTypePreController {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<BasicBusTypePreEntity> bussinessTypeEntities = basicBusTypePreService.filterAll(busTypeChangeFilterRequest);
|
|
|
|
List<BasicBusTypePreEntity> basicBusTypePreEntities = basicBusTypePreService.filterAll(busTypeChangeFilterRequest);
|
|
|
|
PageInfo<BasicBusTypePreEntity> pageInfo;
|
|
|
|
PageInfo<BasicBusTypePreEntity> pageInfo = new PageInfo<>(basicBusTypePreEntities);
|
|
|
|
pageInfo = new PageInfo<>(bussinessTypeEntities);
|
|
|
|
return ResultVOUtils.page(pageInfo);
|
|
|
|
PageSimpleResponse<BasicBusTypePreEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
|
|
|
|
pageSimpleResponse.setList(bussinessTypeEntities);
|
|
|
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据补单单据类型编码或ID删除补单单据类型
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param basicBusTypePreEntity
|
|
|
|
|
|
|
|
* @param bindingResult
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
@PostMapping("/spms/bussinessChangeType/remove")
|
|
|
|
@PostMapping("/spms/bussinessChangeType/remove")
|
|
|
|
public BaseResponse removeBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) {
|
|
|
|
public BaseResponse removeBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
|
@ -70,6 +83,13 @@ public class BasicBusTypePreController {
|
|
|
|
return ResultVOUtils.success("删除成功");
|
|
|
|
return ResultVOUtils.success("删除成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据补单单据类型ID删除数据
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param deleteRequest
|
|
|
|
|
|
|
|
* @param bindingResult
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
@PostMapping("/spms/bussinessChangeType/delete")
|
|
|
|
@PostMapping("/spms/bussinessChangeType/delete")
|
|
|
|
public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
|
|
|
|
public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
@ -80,40 +100,52 @@ public class BasicBusTypePreController {
|
|
|
|
return ResultVOUtils.success("删除成功");
|
|
|
|
return ResultVOUtils.success("删除成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 更新补单单据类型
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param basicBusTypePreEntity
|
|
|
|
|
|
|
|
* @param bindingResult
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
@PostMapping("/spms/bussinessChangeType/update")
|
|
|
|
@PostMapping("/spms/bussinessChangeType/update")
|
|
|
|
public BaseResponse updateBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) {
|
|
|
|
public BaseResponse updateBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*if (basicBusTypePreEntity != null) {
|
|
|
|
if (basicBusTypePreEntity != null) {
|
|
|
|
bussinessChangeTypeService.updateBusChangeType(basicBusTypePreEntity);
|
|
|
|
basicBusTypePreService.updateBusChangeType(basicBusTypePreEntity);
|
|
|
|
BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findByAction(basicBusTypePreEntity.getAction());
|
|
|
|
|
|
|
|
bussinessLocalTypeEntity.setUpdateTime(new Date());
|
|
|
|
|
|
|
|
bussinessLocalTypeService.updateBusLocalType(bussinessLocalTypeEntity);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ResultVOUtils.error(999, "参数错误");
|
|
|
|
ResultVOUtils.error(999, "参数错误");
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success("更新成功");
|
|
|
|
return ResultVOUtils.success("更新成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 新增补单单据类型
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param basicBusTypePreEntity
|
|
|
|
|
|
|
|
* @param bindingResult
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
@PostMapping("/spms/bussinessChangeType/insert")
|
|
|
|
@PostMapping("/spms/bussinessChangeType/insert")
|
|
|
|
public BaseResponse insertBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) {
|
|
|
|
public BaseResponse insertBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*if (basicBusTypePreEntity != null) {
|
|
|
|
if (basicBusTypePreEntity != null) {
|
|
|
|
if (StrUtil.isNotEmpty(basicBusTypePreEntity.getDefaultSubInv())) {
|
|
|
|
//TODO 补充补单单据类型仓库信息
|
|
|
|
InvWarehouseEntity byInvSubByCode = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultSubInv());
|
|
|
|
//if (StrUtil.isNotEmpty(basicBusTypePreEntity.getDefaultSubInv())) {
|
|
|
|
basicBusTypePreEntity.setDefaultInv(invSubWarehouseEntity.getParentId());
|
|
|
|
// InvWarehouseEntity byInvSubByCode = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultSubInv());
|
|
|
|
}
|
|
|
|
// basicBusTypePreEntity.setDefaultInv(invSubWarehouseEntity.getParentId());
|
|
|
|
if (StrUtil.isNotEmpty(basicBusTypePreEntity.getLocSubInv())) {
|
|
|
|
//}
|
|
|
|
InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getLocSubInv());
|
|
|
|
//if (StrUtil.isNotEmpty(basicBusTypePreEntity.getLocSubInv())) {
|
|
|
|
basicBusTypePreEntity.setLocInv(invSubWarehouseEntity.getParentId());
|
|
|
|
// InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getLocSubInv());
|
|
|
|
}
|
|
|
|
// basicBusTypePreEntity.setLocInv(invSubWarehouseEntity.getParentId());
|
|
|
|
basicBusTypePreService.insertBusChangeTypee(basicBusTypePreEntity);
|
|
|
|
//}
|
|
|
|
|
|
|
|
basicBusTypePreService.insertBusChangeType(basicBusTypePreEntity);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ResultVOUtils.error(999, "参数错误");
|
|
|
|
ResultVOUtils.error(999, "参数错误");
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success("添加成功");
|
|
|
|
return ResultVOUtils.success("添加成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|