|
|
|
@ -22,6 +22,7 @@ import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inout.WarehouseEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inout.WarehouseUserEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.InvProductDetailEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity;
|
|
|
|
|
import com.glxp.api.admin.exception.JsonException;
|
|
|
|
|
import com.glxp.api.admin.httpclient.SpsDirectClient;
|
|
|
|
|
import com.glxp.api.admin.req.basic.CompanyProductRelevanceRequest;
|
|
|
|
@ -45,12 +46,15 @@ import com.glxp.api.admin.service.inout.*;
|
|
|
|
|
import com.glxp.api.admin.service.inventory.InvPreInProductDetailService;
|
|
|
|
|
import com.glxp.api.admin.service.inventory.InvPreProductDetailService;
|
|
|
|
|
import com.glxp.api.admin.service.inventory.InvProductDetailService;
|
|
|
|
|
import com.glxp.api.admin.service.inventory.InvSubWarehouseService;
|
|
|
|
|
import com.glxp.api.admin.thread.IoTransInoutService;
|
|
|
|
|
import com.glxp.api.admin.util.*;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@ -108,6 +112,8 @@ public class WareHouseController {
|
|
|
|
|
@Resource
|
|
|
|
|
InvWarehouseDao invWarehouseService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvSubWarehouseService invSubWarehouseService;
|
|
|
|
|
@Resource
|
|
|
|
|
private UdiInfoService udiInfoService;
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@ -1175,15 +1181,17 @@ public class WareHouseController {
|
|
|
|
|
public BaseResponse saveWarehouseUser(@RequestBody Map<String, Object> params) {
|
|
|
|
|
String code = String.valueOf(params.get("code"));
|
|
|
|
|
String userListJson = String.valueOf(params.get("userList"));
|
|
|
|
|
if (StrUtil.isBlank(code) || StrUtil.isBlank(userListJson)) {
|
|
|
|
|
if (StrUtil.isBlank(code) || StrUtil.isBlank(userListJson))
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
}
|
|
|
|
|
List<AuthAdmin> userList = JSONUtil.toList(userListJson, AuthAdmin.class);
|
|
|
|
|
if (CollUtil.isEmpty(userList)) {
|
|
|
|
|
return ResultVOUtils.error(500, "用户列表不能为空");
|
|
|
|
|
}
|
|
|
|
|
warehouseUserService.saveWarehouseUser(code, userList);
|
|
|
|
|
invWarehouseService.updateTime(code, new Date());
|
|
|
|
|
|
|
|
|
|
warehouseUserService.saveWarehouseUser(code, JSONUtil.toList(userListJson, AuthAdmin.class));
|
|
|
|
|
InvSubWarehouseEntity invSubWarehouseEntity =
|
|
|
|
|
invSubWarehouseService.findByInvSubByCode(code);
|
|
|
|
|
invWarehouseService.updateTime(invSubWarehouseEntity.getParentId(), new Date());
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1195,7 +1203,9 @@ public class WareHouseController {
|
|
|
|
|
if (StrUtil.isBlank(code) || StrUtil.isBlank(bussinessTypeJson))
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
warehouseBussinessTypeService.saveWarehouseBussinessType(code, JSONUtil.toList(bussinessTypeJson, BussinessTypResponse.class));
|
|
|
|
|
invWarehouseService.updateTime(code, new Date());
|
|
|
|
|
InvSubWarehouseEntity invSubWarehouseEntity =
|
|
|
|
|
invSubWarehouseService.findByInvSubByCode(code);
|
|
|
|
|
invWarehouseService.updateTime(invSubWarehouseEntity.getParentId(), new Date());
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1215,7 +1225,9 @@ public class WareHouseController {
|
|
|
|
|
if (null == id)
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
WarehouseUserEntity warehouseUserEntity = warehouseUserService.selectById(id);
|
|
|
|
|
invWarehouseService.updateTime(warehouseUserEntity.getCode(), new Date());
|
|
|
|
|
InvSubWarehouseEntity invSubWarehouseEntity =
|
|
|
|
|
invSubWarehouseService.findByInvSubByCode(warehouseUserEntity.getCode());
|
|
|
|
|
invWarehouseService.updateTime(invSubWarehouseEntity.getParentId(), new Date());
|
|
|
|
|
warehouseUserService.deleteWarehouseUser(id);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
@ -1226,7 +1238,10 @@ public class WareHouseController {
|
|
|
|
|
if (null == id)
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
WarehouseBussinessTypeEntity warehouseBussinessTypeEntity = warehouseBussinessTypeService.selectById(id);
|
|
|
|
|
invWarehouseService.updateTime(warehouseBussinessTypeEntity.getCode(), new Date());
|
|
|
|
|
|
|
|
|
|
InvSubWarehouseEntity invSubWarehouseEntity =
|
|
|
|
|
invSubWarehouseService.findByInvSubByCode(warehouseBussinessTypeEntity.getCode());
|
|
|
|
|
invWarehouseService.updateTime(invSubWarehouseEntity.getParentId(), new Date());
|
|
|
|
|
warehouseBussinessTypeService.deleteWarehouseByssuinessType(id);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|