仓库关联单据类型修改

master
anthonywj 2 years ago
parent 05aaaee797
commit 7f5c21cc64

@ -11,7 +11,7 @@ import com.glxp.api.entity.auth.InvBusUserEntity;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity;
import com.glxp.api.req.auth.FilterInvBusUserRequest;
import com.glxp.api.req.auth.UpdateRelBusRequset;
import com.glxp.api.req.auth.UpdateUserRelBusRequset;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.auth.DeptService;
@ -106,7 +106,7 @@ public class InvBusUserController {
@AuthRuleAnnotation("")
@PostMapping("/spms/bus/user/warehouse/update")
public BaseResponse updateRes(@RequestBody UpdateRelBusRequset relBusRequset) {
public BaseResponse updateRes(@RequestBody UpdateUserRelBusRequset relBusRequset) {
boolean b = invBusUserService.deleteByUnion(relBusRequset.getUserId(), relBusRequset.getSubInvCode());
if (CollUtil.isNotEmpty(relBusRequset.getInvBusUserEntities())) {
relBusRequset.getInvBusUserEntities().forEach(warehouseBussinessTypeEntity ->
@ -126,7 +126,7 @@ public class InvBusUserController {
@AuthRuleAnnotation("")
@PostMapping("/spms/bus/user/warehouse/post")
public BaseResponse postRes(@RequestBody UpdateRelBusRequset relBusRequset) {
public BaseResponse postRes(@RequestBody UpdateUserRelBusRequset relBusRequset) {
boolean b = invBusUserService.deleteByUnion(relBusRequset.getUserId(), relBusRequset.getSubInvCode());
if (CollUtil.isNotEmpty(relBusRequset.getSelectActions())) {
relBusRequset.getSelectActions().forEach(action ->

@ -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,

@ -37,7 +37,7 @@ public interface WarehouseBussinessTypeDao {
List<WarehouseBussinessTypeEntity> filterList(FilterInvBusTypeRequest filterInvBusTypeRequest);
void deleteByCode(@Param("code") String code);
boolean deleteByCode(@Param("code") String code);
/**

@ -338,4 +338,6 @@ public class BasicBussinessTypeEntity {
*/
@TableField(value = "createTime")
private Date createTime;
private boolean select;
}

@ -9,8 +9,6 @@ import lombok.Data;
@Data
public class FilterInvLinkDataRequest extends ListPageRequest {
//分仓码
private String code;
}

@ -0,0 +1,15 @@
package com.glxp.api.req.auth;
import lombok.Data;
import java.util.List;
@Data
public class UpdateInvRelBusRequest {
private String invCode;
private List<String> selectActions;
}

@ -6,7 +6,7 @@ import lombok.Data;
import java.util.List;
@Data
public class UpdateRelBusRequset {
public class UpdateUserRelBusRequset {
private String userId;
private String subInvCode;
private List<String> selectActions;

@ -33,6 +33,8 @@ public interface WarehouseBussinessTypeService {
*/
void deleteWarehouseByssuinessType(Integer id);
boolean deleteByCode(String code);
/**
*
*

@ -76,6 +76,11 @@ public class WarehouseBussinessTypeServiceImpl implements WarehouseBussinessType
}
}
@Override
public boolean deleteByCode(String code) {
return warehouseBussinessTypeDao.deleteByCode(code);
}
@Override
public List<WarehouseBussinessTypeEntity> getWarehouseBussniessTypeList(FilterInvLinkDataRequest filterInvLinkDataRequest) {
if (filterInvLinkDataRequest == null) {

@ -1,6 +1,6 @@
spring:
profiles:
active: dev
active: pro
jmx:
enabled: true

Loading…
Cancel
Save