diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/auth/AuthAdminController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/auth/AuthAdminController.java index 38d08c10..421b1598 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/auth/AuthAdminController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/auth/AuthAdminController.java @@ -211,6 +211,28 @@ public class AuthAdminController { return ResultVOUtils.success(); } + @AuthRuleAnnotation("admin/auth/admin/updateInv") + @PostMapping("/admin/auth/admin/updateInv") + public BaseResponse updateInv(@RequestBody @Valid AuthAdminSaveRequest authAdminSaveRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + + if (authAdminSaveRequest.getId() == null) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数错误!"); + } + AuthAdmin authAdmin = new AuthAdmin(); + BeanUtils.copyProperties(authAdminSaveRequest, authAdmin); + authAdmin.setLastModifyTime(new Date()); + boolean b = authAdminService.updateAuthAdmin(authAdmin); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + return ResultVOUtils.success(); + } + /** * 删除 * diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/auth/LoginController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/auth/LoginController.java index 76a38eaf..78a29e2a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/auth/LoginController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/auth/LoginController.java @@ -3,11 +3,15 @@ package com.glxp.api.admin.controller.auth; import cn.hutool.core.util.StrUtil; import com.glxp.api.admin.entity.auth.AuthCheckEntity; import com.glxp.api.admin.entity.info.DeviceKeyEntity; +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; +import com.glxp.api.admin.entity.inventory.InvWarehouseEntity; import com.glxp.api.admin.req.auth.LoginRequest; import com.glxp.api.admin.req.auth.PCLoginRequest; import com.glxp.api.admin.req.auth.UpdatePasswordRequest; import com.glxp.api.admin.service.auth.AuthCheckService; import com.glxp.api.admin.service.auth.DeviceKeyService; +import com.glxp.api.admin.service.inventory.InvSubWarehouseService; +import com.glxp.api.admin.service.inventory.InvWarehouseService; import com.glxp.api.admin.util.*; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; @@ -174,6 +178,25 @@ public class LoginController { return ResultVOUtils.success(map); } + @Resource + InvWarehouseService invWarehouseService; + @Resource + InvSubWarehouseService invSubWarehouseService; + + @AuthRuleAnnotation("") + @GetMapping("/admin/auth/login/getInv") + public BaseResponse getInv(HttpServletRequest request) { + String adminId = request.getHeader("ADMIN_ID"); + Long id = Long.valueOf(adminId); + AuthAdmin authAdmin = authAdminService.findById(id); + LoginUserInfoResponse loginUserInfoResponse = new LoginUserInfoResponse(); + BeanUtils.copyProperties(authAdmin, loginUserInfoResponse); + InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(authAdmin.getLocInvCode()); + InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.findByInvSubByCode(authAdmin.getLocSubInvCode()); + loginUserInfoResponse.setLocInvName(invWarehouseEntity.getName()); + loginUserInfoResponse.setLocSubInvName(invSubWarehouseEntity.getName()); + return ResultVOUtils.success(loginUserInfoResponse); + } /** * 获取登录用户信息 diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java index b5e3cb19..49df79e3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java @@ -139,6 +139,7 @@ public class StockOrderController { stockOrderEntity.setStatus(ConstantStatus.SORDER_DRAFT);//未处理 stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印 stockOrderEntity.setSourceType(ConstantStatus.ST_THIRD_SEL);//外部提交 + stockOrderEntity.setInvWarehouseCode(stockOrderPostRequest.getInvWarehouseCode()); // stockOrderEntity.setId(String.valueOf(new Date().getTime())); stockOrderEntity.setBilldate(DateUtil.formatDate(new Date())); boolean b = stockOrderService.insertStockOrder(stockOrderEntity); @@ -164,6 +165,7 @@ public class StockOrderController { Integer userId = customerService.getUserId(); StockOrderEntity stockOrderEntity = new StockOrderEntity(); BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity); + stockOrderEntity.setInvWarehouseCode(stockOrderPostRequest.getInvWarehouseCode()); stockOrderEntity.setCreateUser(userId); stockOrderEntity.setStatus( StringUtils.isBlank(stockOrderEntity.getStatus()) ? 501 + ""//未提交 @@ -195,6 +197,7 @@ public class StockOrderController { basicUnitMaintainEntity.setErpId(CustomUtil.getUnitId()); stockOrderPostRequest.setCorpId(basicUnitMaintainEntity.getErpId()); basicUnitMaintainEntity.setCorpType(ConstantStatus.CORP_SICK); + basicUnitMaintainEntity.setUpdateTime(new Date()); basicUnitMaintainEntity.setOutType(ConstantStatus.CORP_SICK_SICK); basicUnitMaintainEntity.setName(stockOrderPostRequest.getCorpName()); basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity); @@ -364,7 +367,6 @@ public class StockOrderController { erpOrderResponses.add(erpOrderResponse); } } - PageInfo pageInfo; pageInfo = new PageInfo<>(stockOrderEntityList); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); @@ -400,6 +402,7 @@ public class StockOrderController { String replicateNo = originOrder.getReplicateNo(); //复制单号 List originCodes = codesService.findByReceiptId(originOrder.getId()); originOrder.setActDate(DateUtil.formatDate(new Date())); + originOrder.setCreateTime(originOrder.getActDate()); originOrder.setFromCorp(addStockOrderChangeRequest.getFromCorp()); originOrder.setFromCorpId(addStockOrderChangeRequest.getFromCorpId()); originOrder.setCorpOrderId(CustomUtil.getId() + "x"); @@ -414,7 +417,6 @@ public class StockOrderController { BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(originOrder.getAction()); String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + MyStrUtil.trim(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); String supplementOrderNo = orderNo; - originOrder.setId(supplementOrderNo); if (StrUtil.isBlank(replicateNo)) { replicateNo = supplementOrderNo; //此单据第一条复制单号 } else { @@ -428,6 +430,7 @@ public class StockOrderController { List products = addStockOrderChangeRequest.getProducts(); originCodes.forEach( code -> { + //复制选中的产品 for (WarehouseEntity product : products) { if (product.getRelId().equals(code.getRelId())) { if ((StrUtil.isNotBlank(product.getBatchNo()) && StrUtil.isNotBlank(code.getBatchNo()) && product.getBatchNo().equals(code.getBatchNo())) diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java index 598637cd..75e4df13 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/OrderController.java @@ -25,6 +25,7 @@ import com.glxp.api.admin.req.basic.BasicEntrustRecRequest; import com.glxp.api.admin.req.business.StockOrderFilterRequest; import com.glxp.api.admin.req.inout.*; import com.glxp.api.admin.req.inventory.FilterInvUserRequest; +import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.service.auth.CustomerService; import com.glxp.api.admin.service.basic.BussinessTypeService; @@ -73,6 +74,8 @@ public class OrderController { @Resource BussinessTypeService bussinessTypeService; @Resource + SystemParamConfigService systemParamConfigService; + @Resource CompanyService companyService; @Value("${file_path}") private String filePath; @@ -94,8 +97,6 @@ public class OrderController { CodesTempDao codesTempDao; @Resource SpsDirectClient spsDirectClient; - @Resource - SystemParamConfigService systemParamConfigService; @AuthRuleAnnotation("") @@ -263,10 +264,21 @@ public class OrderController { } else if (stockOrderEntity.getStatus().equals(ConstantStatus.SORDER_CHECKED)) { if (StrUtil.isNotEmpty(stockOrderEntity.getLocStorageCode())) { InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(stockOrderEntity.getLocStorageCode()); - FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest(); - filterInvUserRequest.setCode(invWarehouseEntity.getCode()); - filterInvUserRequest.setUserid(userId.longValue()); - List warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest); + List warehouseUserEntities = new ArrayList<>(); + List invWarehouseEntities = new ArrayList<>(); + if (StrUtil.isNotEmpty(stockOrderEntity.getInvWarehouseCode())) { + FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest(); + filterInvUserRequest.setCode(stockOrderEntity.getInvWarehouseCode()); + filterInvUserRequest.setUserid(userId.longValue()); + warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest); + } else { + FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); + filterInvWarehouseRequest.setCode(stockOrderEntity.getLocStorageCode()); + filterInvWarehouseRequest.setUserId(userId ); + invWarehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest); + } + + List entrustReceEntities = null; if (!stockOrderEntity.isEntrustEnd()) { BasicEntrustRecRequest basicEntrustRecRequest = new BasicEntrustRecRequest(); @@ -357,10 +369,7 @@ public class OrderController { } else return updateReview(authAdmin, updateExportStatusRequest); - } - - } else return updateReview(authAdmin, updateExportStatusRequest); } @@ -376,7 +385,13 @@ public class OrderController { String supplementOrderNo = orderNo; supplementOrder.setOriginUllageSupNo(orderEntity.getId()); supplementOrder.setId(supplementOrderNo); - supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); + + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); + if ("1".equals(systemParamConfigEntity.getParamValue())) { + supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); //设置状态为补录单据 + } else { + supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); //设置状态为补录单据 + } supplementOrder.setExportStatus(0); //设置导出状态为未导出 @@ -385,7 +400,8 @@ public class OrderController { supplementOrder.setCorpOrderId(CustomUtil.getId() + "x"); //修改往来单位及当前库存号 supplementOrder.setFromCorpId(orderEntity.getLocStorageCode()); - supplementOrder.setLocStorageCode(orderEntity.getFromCorpId()); + supplementOrder.setLocStorageCode(entrustReceEntity.getEntrustInv()); + supplementOrder.setInvWarehouseCode(entrustReceEntity.getInvWarehouseCode()); String name = invWarehouseDao.getNameByCode(supplementOrder.getFromCorpId()); supplementOrder.setFromCorp(name); supplementOrder.setFromType(ConstantStatus.FROM_PEACE_CHANGE); @@ -402,6 +418,7 @@ public class OrderController { supplementCode.setFromCorpId(supplementOrder.getFromCorpId()); supplementCode.setFromCorp(supplementOrder.getFromCorp()); supplementCode.setLocStorageCode(supplementOrder.getLocStorageCode()); + supplementCode.setInvWarehouseCode(supplementOrder.getInvWarehouseCode()); supplementCode.setOrderId(supplementOrderNo); //查询补单设置 supplementCode.setAction(bussinessTypeEntity.getSupplementOrderType()); @@ -438,6 +455,9 @@ public class OrderController { stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER); stockOrderEntity.setReviewUser(authAdmin.getId().intValue()); stockOrderEntity.setAuditTime(new Date()); + if (StrUtil.isEmpty(stockOrderEntity.getInvWarehouseCode())) { + stockOrderEntity.setInvWarehouseCode(authAdmin.getLocSubInvCode()); + } stockOrderEntity.setEntrustEnd(true); stockOrderService.updateById(stockOrderEntity); } @@ -449,6 +469,9 @@ public class OrderController { for (StockOrderEntity stockOrderEntity : stockOrderEntityLit) { stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER); stockOrderEntity.setReviewUser(authAdmin.getId().intValue()); + if (StrUtil.isEmpty(stockOrderEntity.getInvWarehouseCode())) { + stockOrderEntity.setInvWarehouseCode(authAdmin.getLocSubInvCode()); + } stockOrderEntity.setAuditTime(new Date()); stockOrderService.updateById(stockOrderEntity); } @@ -729,5 +752,4 @@ public class OrderController { return ResultVOUtils.success(orderEntity); } - } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java index 4ab9ed30..bf2ad941 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java @@ -31,6 +31,7 @@ import com.glxp.api.admin.res.basic.BussinessTypResponse; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import com.glxp.api.admin.res.info.CompanyProductRelevanceResponse; import com.glxp.api.admin.res.inout.WarehouseResponse; +import com.glxp.api.admin.res.inout.WarehouseUserResponse; import com.glxp.api.admin.service.auth.AuthAdminService; import com.glxp.api.admin.service.auth.CustomerService; import com.glxp.api.admin.service.basic.BasicUnitMaintainService; @@ -50,6 +51,8 @@ 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.*; @@ -454,7 +457,6 @@ public class WareHouseController { } } } - BaseResponse baseResponse = ResultVOUtils.error(501, "UDI码格式错误"); baseResponse.setData(originCode); return baseResponse; @@ -544,6 +546,12 @@ public class WareHouseController { return null; } + @Resource + InvPreProductDetailService invPreProductDetailService; + @Resource + InvProductDetailService invProductDetailService; + + //网页端数据上传调用接口 @AuthRuleAnnotation("") @PostMapping("warehouse/inout/addOrderWeb") @@ -589,10 +597,12 @@ public class WareHouseController { } String orderId = addOrderRequest.getOrderId(); // String isCheck = systemParamConfigService.selectValueByParamKey("code_fill_check"); + //三期校验 if (addOrderRequest.isCodeFillCheck()) { + BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity); - if (checkOriginCodeRes != null) + if (checkOriginCodeRes != null) { if (StrUtil.isNotEmpty(orderId)) { WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest(); warehouseQueryRequest.setOrderId(orderId); @@ -603,8 +613,10 @@ public class WareHouseController { } } else return checkOriginCodeRes; + } } + //过期提醒: SystemParamConfigEntity expireParamConfigEntity = systemParamConfigService.selectByParamKey("expire_date_tip"); if (expireParamConfigEntity.getParamValue().equals("1") && !addOrderRequest.isIgnoreExpire()) { @@ -724,6 +736,8 @@ public class WareHouseController { } } } + + if (exitLocalEntity == null) { warehouseEntity.setCode(code); warehouseEntity.setOrderId(orderId); @@ -736,6 +750,7 @@ public class WareHouseController { warehouseEntity.setFromCorp(addOrderRequest.getFromCorp()); warehouseEntity.setBatchNo(udiEntity.getBatchNo()); warehouseEntity.setProduceDate(udiEntity.getProduceDate()); + warehouseEntity.setInvWarehouseCode(addOrderRequest.getInvWarehouseCode()); warehouseEntity.setNameCode(udiEntity.getUdi()); warehouseEntity.setExpireDate(udiEntity.getExpireDate()); warehouseEntity.setSerialNo(udiEntity.getSerialNo()); @@ -779,6 +794,7 @@ public class WareHouseController { orderSaveRequest.setId(orderId); if (addOrderRequest.getActDate() != null) { orderSaveRequest.setActDate(addOrderRequest.getActDate()); + orderSaveRequest.setCreateTime(orderSaveRequest.getActDate()); } Integer userId = customerService.getUserId(); @@ -796,7 +812,9 @@ public class WareHouseController { orderSaveRequest.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); orderSaveRequest.setSignStatus(ConstantStatus.ORDER_SIGN_UN); orderSaveRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN); - orderSaveRequest.setCreateUser(userId); + orderSaveRequest.setInvWarehouseCode(addOrderRequest.getInvWarehouseCode()); + orderSaveRequest.setFromSubInvCode(addOrderRequest.getFromSubInvCode()); + orderService.insertOrder(orderSaveRequest); } @@ -822,20 +840,6 @@ public class WareHouseController { return ResultVOUtils.success(addCodeResult); } - //校验供应商是否配送此产品 - public BaseResponse checkCorp(WarehouseEntity warehouseEntity, BussinessTypeEntity bussinessTypeEntity) { - if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { - CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest(); - companyProductRelevanceRequest.setUnitFk(warehouseEntity.getFromCorpId()); - UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); - companyProductRelevanceRequest.setNameCode(udiEntity.getUdi()); - List datas = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest); - if (datas.size() <= 0) { - return ResultVOUtils.error(500, "当前供应商不存在此配送产品!"); - } - } - return null; - } //判断本单是否存在 public WarehouseEntity isExitLocal(String code, List warehouseEntityList) { @@ -850,7 +854,6 @@ public class WareHouseController { if (!StrUtil.emptyIfNull(originUdiEntity.getUdi()).equals(StrUtil.emptyIfNull(udiEntity.getUdi()))) { continue; } - if (!StrUtil.emptyIfNull(originUdiEntity.getBatchNo()).equals(StrUtil.emptyIfNull(udiEntity.getBatchNo()))) { continue; } @@ -868,6 +871,21 @@ public class WareHouseController { return null; } + //校验供应商是否配送此产品 + public BaseResponse checkCorp(WarehouseEntity warehouseEntity, BussinessTypeEntity bussinessTypeEntity) { + if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { + CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest(); + companyProductRelevanceRequest.setUnitFk(warehouseEntity.getFromCorpId()); + UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); + companyProductRelevanceRequest.setNameCode(udiEntity.getUdi()); + List datas = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest); + if (datas.size() <= 0) { + return ResultVOUtils.error(500, "当前供应商不存在此配送产品!"); + } + } + return null; + } + //校验产品ID唯一性 public BaseResponse checkRelId(BussinessTypeEntity bussinessTypeEntity, WarehouseEntity warehouseEntity) { @@ -1006,11 +1024,6 @@ public class WareHouseController { return ResultVOUtils.success("绑定成功"); } - @Resource - InvPreProductDetailService invPreProductDetailService; - @Resource - InvProductDetailService invProductDetailService; - //网页端数据上传调用接口 @AuthRuleAnnotation("") @@ -1140,7 +1153,15 @@ public class WareHouseController { public BaseResponse getWarehouseUserList(String code) { if (StringUtils.isBlank(code)) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); - return ResultVOUtils.success(warehouseUserService.getListByCode(code)); + List warehouseUserEntities = warehouseUserService.getListByCode(code); + List result = new ArrayList<>(); + warehouseUserEntities.forEach(warehouseUserEntity -> { + WarehouseUserResponse warehouseUserResponse = new WarehouseUserResponse(); + BeanUtils.copyProperties(warehouseUserEntity, warehouseUserResponse); + warehouseUserResponse.setUserid(warehouseUserEntity.getUserid() + ""); + result.add(warehouseUserResponse); + }); + return ResultVOUtils.success(result); } @AuthRuleAnnotation("") @@ -1172,7 +1193,6 @@ public class WareHouseController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); warehouseBussinessTypeService.saveWarehouseBussinessType(code, JSONUtil.toList(bussinessTypeJson, BussinessTypResponse.class)); invWarehouseService.updateTime(code, new Date()); - return ResultVOUtils.success(); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java new file mode 100644 index 00000000..ff790367 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java @@ -0,0 +1,116 @@ +package com.glxp.api.admin.controller.inventory; + +import cn.hutool.core.util.IdUtil; +import com.glxp.api.admin.annotation.AuthRuleAnnotation; +import com.glxp.api.admin.entity.auth.AuthAdmin; +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; +import com.glxp.api.admin.entity.inventory.InvWarehouseEntity; +import com.glxp.api.admin.req.inout.DeleteRequest; +import com.glxp.api.admin.req.inventory.FilterInvSubWarehouseRequest; +import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest; +import com.glxp.api.admin.service.auth.CustomerService; +import com.glxp.api.admin.service.inventory.InvSubWarehouseService; +import com.glxp.api.admin.service.inventory.InvWarehouseService; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +@RestController +public class InvSubWarehouseController { + + @Resource + InvSubWarehouseService invSubWarehouseService; + @Resource + InvWarehouseService invWarehouseService; + @Resource + CustomerService customerService; + + @AuthRuleAnnotation("") + @GetMapping("spms/sub/inv/warehouse/filter") + public BaseResponse filterInvWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest) { + List invSubWarehouseEntities = invSubWarehouseService.filterInvSubWarehouse(filterInvSubWarehouseRequest); + return ResultVOUtils.success(invSubWarehouseEntities); + } + + + @AuthRuleAnnotation("") + @GetMapping("spms/sub/inv/warehouse/findByInv") + public BaseResponse findByInv(FilterInvWarehouseRequest filterInvWarehouseRequest) { + AuthAdmin authAdmin = customerService.getUserBean(); + filterInvWarehouseRequest.setUserId(authAdmin.getId().intValue()); + List invSubWarehouseEntities = invSubWarehouseService.filterGroupInvSub(filterInvWarehouseRequest); + return ResultVOUtils.success(invSubWarehouseEntities); + } + + + @AuthRuleAnnotation("") + @PostMapping("/spms/sub/inv/warehouse/save") + public BaseResponse save(@RequestBody @Valid InvSubWarehouseEntity invSubWarehouseEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + + + FilterInvSubWarehouseRequest filterInvWarehouseRequest = new FilterInvSubWarehouseRequest(); + filterInvWarehouseRequest.setParentId(invSubWarehouseEntity.getParentId()); + InvSubWarehouseEntity codeEntity = invSubWarehouseService.selectMaxCode(filterInvWarehouseRequest); + InvWarehouseEntity pEntity = invWarehouseService.selectByCode(invSubWarehouseEntity.getParentId()); + if (codeEntity == null) { + int code = Integer.parseInt(pEntity.getCode()) * 1000; + invSubWarehouseEntity.setCode(code + ""); + } else { + invSubWarehouseEntity.setCode(Integer.parseInt(codeEntity.getCode()) + 1 + ""); + } + invSubWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + ""); + boolean b = invSubWarehouseService.insertInvSubWarehouse(invSubWarehouseEntity); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + return ResultVOUtils.success("添加成功!"); + } + + @AuthRuleAnnotation("") + @PostMapping("/spms/sub/inv/warehouse/edit") + public BaseResponse edit(@RequestBody @Valid InvSubWarehouseEntity invSubWarehouseEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + if (invSubWarehouseEntity.getId() == null) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); + } + boolean b = invSubWarehouseService.updateInvSubWarehouse(invSubWarehouseEntity); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + + return ResultVOUtils.success(); + } + + @AuthRuleAnnotation("") + @PostMapping("/spms/sub/inv/warehouse/delete") + public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) { + + if (deleteRequest.getId() == null) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); + } + boolean b = invSubWarehouseService.deleteById(deleteRequest.getId()); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + return ResultVOUtils.success(); + } + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java index ffab5b1c..7b09d322 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java @@ -1,6 +1,7 @@ package com.glxp.api.admin.controller.inventory; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -12,6 +13,7 @@ import com.glxp.api.admin.entity.basic.BasicExportStatusEntity; import com.glxp.api.admin.entity.info.SystemParamConfigEntity; import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity; import com.glxp.api.admin.entity.inventory.InvProductDetailEntity; +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; import com.glxp.api.admin.entity.inventory.InvWarehouseEntity; import com.glxp.api.admin.entity.thrsys.ThrInvWarehouseEntity; import com.glxp.api.admin.req.basic.BasicExportStatusRequest; @@ -28,6 +30,7 @@ import com.glxp.api.admin.service.basic.BussinessTypeService; import com.glxp.api.admin.service.info.SystemParamConfigService; import com.glxp.api.admin.service.inout.WarehouseBussinessTypeService; import com.glxp.api.admin.service.inventory.InvProductDetailService; +import com.glxp.api.admin.service.inventory.InvSubWarehouseService; import com.glxp.api.admin.service.inventory.InvWarehouseService; import com.glxp.api.admin.service.thrsys.ThrInvWarehouseService; import com.glxp.api.admin.util.CustomUtil; @@ -55,6 +58,8 @@ public class InvWarehouseController { @Resource InvWarehouseService invWarehouseService; @Resource + InvSubWarehouseService invSubWarehouseService; + @Resource ThrInvWarehouseService thrInvWarehouseService; @Resource CustomerService customerService; @@ -89,6 +94,7 @@ public class InvWarehouseController { return ResultVOUtils.success(invWarehouseEntities); } + @AuthRuleAnnotation("") @GetMapping("spms/inv/warehouse/filterNext") public BaseResponse filterNext(FilterInvWarehouseRequest filterInvWarehouseRequest) { @@ -111,6 +117,7 @@ public class InvWarehouseController { return ResultVOUtils.success(mInvWarehouseEntities); } + @AuthRuleAnnotation("") @GetMapping("spms/inv/warehouse/filterAllLocInv") public BaseResponse filterAllLocInv(FilterInvWarehouseRequest filterInvWarehouseRequest) { @@ -203,7 +210,6 @@ public class InvWarehouseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - if (invWarehouseEntity.getPid() == null) {//仓库 invWarehouseEntity.setPid(0); // 默认设置 FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); @@ -214,7 +220,6 @@ public class InvWarehouseController { invWarehouseEntity.setPcode("0"); } } else {//货位 - FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); filterInvWarehouseRequest.setPid(invWarehouseEntity.getPid()); InvWarehouseEntity codeEntity = invWarehouseService.selectMaxCode(filterInvWarehouseRequest); @@ -231,6 +236,13 @@ public class InvWarehouseController { } invWarehouseEntity.setUpdateTime(new Date()); boolean b = invWarehouseService.insertInvWarehouse(invWarehouseEntity); + InvSubWarehouseEntity invSubWarehouseEntity = new InvSubWarehouseEntity(); + invSubWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + ""); + invSubWarehouseEntity.setParentId(invWarehouseEntity.getCode()); + invSubWarehouseEntity.setName(invWarehouseEntity.getName()); + invSubWarehouseEntity.setCode(Integer.parseInt(invWarehouseEntity.getCode()) * 1000 + ""); + invSubWarehouseEntity.setDefaultInv(true); + invSubWarehouseService.insertInvSubWarehouse(invSubWarehouseEntity); if (!b) { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); } @@ -302,11 +314,6 @@ public class InvWarehouseController { } InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(request.getCode()); -// InvProductDetailEntity invProductDetailEntity = invProductDetailService.isExit(invWarehouseEntity.getCode()); -// if (invProductDetailEntity != null) { -// return ResultVOUtils.error(500, "该仓库已有库存,不能删除!"); -// } - FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); filterInvWarehouseRequest.setCode(invWarehouseEntity.getCode()); List warehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest); @@ -475,4 +482,6 @@ public class InvWarehouseController { pageSimpleResponse.setList(list); return ResultVOUtils.success(pageSimpleResponse); } + + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/EntrustReceDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/EntrustReceDao.java index 6123e60e..247624e1 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/EntrustReceDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/EntrustReceDao.java @@ -28,5 +28,4 @@ public interface EntrustReceDao { boolean deleteAll(); boolean updateEntrustRec(EntrustReceEntity warehouseEntity); - } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvSubWarehouseDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvSubWarehouseDao.java new file mode 100644 index 00000000..4462f4b7 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvSubWarehouseDao.java @@ -0,0 +1,28 @@ +package com.glxp.api.admin.dao.inventory; + +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; +import com.glxp.api.admin.req.inventory.FilterInvSubWarehouseRequest; +import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface InvSubWarehouseDao { + + List filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest); + + List filterGroupInvSub(FilterInvWarehouseRequest filterInvSubWarehouseRequest); + + InvSubWarehouseEntity selectMaxCode(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest); + + boolean insertInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity); + + boolean updateInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity); + + void importInvSubWarehouse(@Param("invWarehouseEntities") List invSubWarehouseEntities); + + boolean deleteById(String id); + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/auth/AuthAdmin.java b/api-admin/src/main/java/com/glxp/api/admin/entity/auth/AuthAdmin.java index 3513b59d..52ccad11 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/auth/AuthAdmin.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/auth/AuthAdmin.java @@ -6,7 +6,7 @@ import java.util.Date; @Data public class AuthAdmin { - + // 主键 private Long id; // 昵称 @@ -27,5 +27,6 @@ public class AuthAdmin { private String comments; private String employeeName; private Integer CustomerId; - + private String locInvCode; + private String locSubInvCode; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/BussinessTypeEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/BussinessTypeEntity.java index a927d8de..572a9d02 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/BussinessTypeEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/BussinessTypeEntity.java @@ -64,4 +64,5 @@ public class BussinessTypeEntity { private boolean entrutSpms; private boolean codeFillCheck; + private String defaultSubInv; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/EntrustReceEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/EntrustReceEntity.java index e0621483..86e39f81 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/EntrustReceEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/EntrustReceEntity.java @@ -18,4 +18,7 @@ public class EntrustReceEntity { private String remark; private boolean finishRece; private String lastUpdateTime; + + private String entrustSubInv; + private String invWarehouseCode; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/business/StockOrderEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/business/StockOrderEntity.java index 9b4df919..b30a57ad 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/business/StockOrderEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/business/StockOrderEntity.java @@ -28,7 +28,8 @@ public class StockOrderEntity { private String orderIdFk; private BigDecimal totalPrice; private String locStorageCode; - + private String invWarehouseCode; + private String fromSubInvCode; //补单单号 private String supplementNo; diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/inout/OrderEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/inout/OrderEntity.java index e25481af..10a74b67 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/inout/OrderEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/inout/OrderEntity.java @@ -56,5 +56,6 @@ public class OrderEntity { private String replicateNo; private boolean syncOutChange; - + private String createTime; + private String fromSubInvCode; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/inout/WarehouseEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/inout/WarehouseEntity.java index 6b592a3e..6175c1f3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/inout/WarehouseEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/inout/WarehouseEntity.java @@ -32,7 +32,7 @@ public class WarehouseEntity { private String relId; private Integer status; private String locStorageCode; - + private String fromSubInvCode; private String mySupId; @@ -40,7 +40,7 @@ public class WarehouseEntity { if (supId == null) { return null; - }else if(supId.equals("")) + } else if (supId.equals("")) return null; return supId; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/inventory/InvSubWarehouseEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/inventory/InvSubWarehouseEntity.java new file mode 100644 index 00000000..aae33544 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/inventory/InvSubWarehouseEntity.java @@ -0,0 +1,16 @@ +package com.glxp.api.admin.entity.inventory; + +import lombok.Data; + +@Data +public class InvSubWarehouseEntity { + + private String id; + private String code; + private String name; + private String parentId; + private String remark; + private boolean defaultInv; + + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthAdminSaveRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthAdminSaveRequest.java index 58c217bf..f96d06fe 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthAdminSaveRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthAdminSaveRequest.java @@ -35,4 +35,6 @@ public class AuthAdminSaveRequest { private String comments; // 角色ids private List roles; + private String locInvCode; + private String locSubInvCode; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderFilterRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderFilterRequest.java index 99f7a4ce..7a832a8a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderFilterRequest.java @@ -30,9 +30,12 @@ public class StockOrderFilterRequest extends ListPageRequest { private String orderIdFk; private BigDecimal totalPrice; private String locStorageCode; + private String invWarehouseCode; private Integer createUser; private Integer reviewUser; private Integer userId; private Integer unionUser; + private String entrustUser; + private boolean entrustEnd; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderPostRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderPostRequest.java index 1ee6b0a2..5973bbe0 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderPostRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/business/StockOrderPostRequest.java @@ -25,7 +25,7 @@ public class StockOrderPostRequest { private List subErpOrders; private String customerId; - + private String invWarehouseCode; private String locStorageCode; private BigDecimal price; private String unitIdFk; diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inout/AddOrderRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inout/AddOrderRequest.java index fa8eda57..a8ccf9b3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inout/AddOrderRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inout/AddOrderRequest.java @@ -15,6 +15,7 @@ public class AddOrderRequest { private String actDate; private String billType; private String locStorageCode; + private String invWarehouseCode; private String orderId; private String customerId; private boolean outChangeEnable; @@ -22,6 +23,8 @@ public class AddOrderRequest { private boolean ignoreRecentExpire; private boolean ignoreCode; private boolean preCheck; + private String fromSubInvCode; + private String batchNo; private String produceDate; private String expireDate; diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inout/FilterOrderRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inout/FilterOrderRequest.java index b7d39581..054eb8e5 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inout/FilterOrderRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inout/FilterOrderRequest.java @@ -21,6 +21,7 @@ public class FilterOrderRequest { private Boolean isLocal; private String localAction; private String locStorageCode; + private String invWarehouseCode; //第三方系统ID private String thirdSys; private Integer editStatus; @@ -28,4 +29,7 @@ public class FilterOrderRequest { private String action; private String thirdAction; private String thirdOrderFk; + + + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inout/OrderFilterRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inout/OrderFilterRequest.java index 18ba2923..14a8f648 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inout/OrderFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inout/OrderFilterRequest.java @@ -45,5 +45,5 @@ public class OrderFilterRequest extends ListPageRequest { private String stockOrderId; private Integer entrustId; private boolean entrust; - + private String invWarehouseCode; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvSubWarehouseRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvSubWarehouseRequest.java new file mode 100644 index 00000000..7a9b4bbd --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvSubWarehouseRequest.java @@ -0,0 +1,14 @@ +package com.glxp.api.admin.req.inventory; + +import com.glxp.api.admin.req.ListPageRequest; +import lombok.Data; + +@Data +public class FilterInvSubWarehouseRequest extends ListPageRequest { + + private Integer id; + private String code; + private String name; + private String parentId; + private Boolean defaultInv; +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvWarehouseRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvWarehouseRequest.java index 74359c9b..d36bed4c 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvWarehouseRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvWarehouseRequest.java @@ -25,4 +25,5 @@ public class FilterInvWarehouseRequest extends ListPageRequest { private List ids; private Boolean spUse; + private Integer filter; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/receipt/BussinessTypeFilterRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/receipt/BussinessTypeFilterRequest.java index 68099676..3ec2ffb4 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/receipt/BussinessTypeFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/receipt/BussinessTypeFilterRequest.java @@ -25,6 +25,7 @@ public class BussinessTypeFilterRequest extends ListPageRequest { private Integer userId; private String locInvCode; + private String locSubInvCode; private String lastUpdateTime; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/auth/LoginUserInfoResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/auth/LoginUserInfoResponse.java index e0b698f5..f6db2d61 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/auth/LoginUserInfoResponse.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/auth/LoginUserInfoResponse.java @@ -16,4 +16,9 @@ public class LoginUserInfoResponse { private String employeeName; // 权限列表 private List authRules; + private String locInvCode; + private String locSubInvCode; + + private String locInvName; + private String locSubInvName; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/basic/BussinessTypResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/basic/BussinessTypResponse.java index 5552244f..c69fc8f3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/basic/BussinessTypResponse.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/basic/BussinessTypResponse.java @@ -67,4 +67,5 @@ public class BussinessTypResponse { private boolean entrutSpms; private boolean codeFillCheck; + private String defaultSubInv; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceRespose.java b/api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceRespose.java index 04841822..8170b6b5 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceRespose.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceRespose.java @@ -21,5 +21,6 @@ public class EntrustReceRespose { private String entrustInvName; private String curInv; private String curInvName; - + private String entrustSubInv; + private String invWarehouseCode; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/basic/SpsSyncDataResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/basic/SpsSyncDataResponse.java index e2743888..fe1c8326 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/basic/SpsSyncDataResponse.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/basic/SpsSyncDataResponse.java @@ -7,6 +7,7 @@ import com.glxp.api.admin.entity.basic.UdiInfoEntity; import com.glxp.api.admin.entity.basic.UdiRelevanceEntity; import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity; import com.glxp.api.admin.entity.inout.WarehouseUserEntity; +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; import com.glxp.api.admin.entity.inventory.InvWarehouseEntity; import com.glxp.api.admin.entity.thrsys.*; import lombok.Data; @@ -29,7 +30,7 @@ public class SpsSyncDataResponse { List companyProductRelevanceEntities; List udiRelevanceEntities; - + List invSubWarehouseEntities; List warehouseBussinessTypeEntities; List warehouseUserEntities; List authAdminList; diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/inout/WarehouseUserResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/inout/WarehouseUserResponse.java new file mode 100644 index 00000000..062d22a0 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/res/inout/WarehouseUserResponse.java @@ -0,0 +1,34 @@ +package com.glxp.api.admin.res.inout; + +import lombok.Data; + +@Data +public class WarehouseUserResponse { + + /** + * id + */ + private Integer id; + + /** + * 仓位码 + */ + private String code; + + /** + * 用户id + */ + private String userid; + + /** + * 用户名/登录账号 + */ + private String username; + + /** + * 是否是仓库主管 + */ + private boolean isDirector; + + private String employeeName; +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/inventory/InvProductResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/inventory/InvProductResponse.java index e8b9aacd..2f33dea2 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/inventory/InvProductResponse.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/inventory/InvProductResponse.java @@ -23,6 +23,7 @@ public class InvProductResponse { private String unitFk; private String invStorageCode; private String invStorageName; + private String invSubStorageName; private String price; diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java index 3f5073dd..2a6718be 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java @@ -27,6 +27,7 @@ import com.glxp.api.admin.entity.inout.OrderEntity; import com.glxp.api.admin.entity.inout.WarehouseEntity; import com.glxp.api.admin.entity.inventory.InvProductDetailEntity; import com.glxp.api.admin.entity.inventory.InvProductEntity; +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; import com.glxp.api.admin.req.business.StockOrderFilterRequest; import com.glxp.api.admin.req.inout.OrderFilterRequest; import com.glxp.api.admin.req.inout.OrderQueryRequest; @@ -36,6 +37,7 @@ import com.glxp.api.admin.res.inout.OrderNoResult; import com.glxp.api.admin.res.inout.StockOrderResponse; import com.glxp.api.admin.service.info.SystemParamConfigService; import com.glxp.api.admin.service.inout.OrderService; +import com.glxp.api.admin.service.inventory.InvSubWarehouseService; import com.glxp.api.admin.util.*; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; @@ -62,6 +64,8 @@ public class OrderServiceImpl implements OrderService { @Resource InvWarehouseDao invWarehouseDao; @Resource + InvSubWarehouseService invSubWarehouseService; + @Resource CodesDao codesDao; @Resource CodesTempDao codesTempDao; @@ -262,7 +266,18 @@ public class OrderServiceImpl implements OrderService { //修改往来单位及当前库存号 supplementOrder.setFromCorpId(order.getLocStorageCode()); supplementOrder.setLocStorageCode(order.getFromCorpId()); + supplementOrder.setInvWarehouseCode(null); String name = invWarehouseDao.getNameByCode(supplementOrder.getFromCorpId()); + if (StrUtil.isNotEmpty(order.getFromSubInvCode())) { + supplementOrder.setInvWarehouseCode(order.getFromSubInvCode()); + } else { + List invSubWarehouseEntities = invSubWarehouseService.findByParentId(supplementOrder.getLocStorageCode()); + if (CollUtil.isNotEmpty(invSubWarehouseEntities) && invSubWarehouseEntities.size() == 1) { + supplementOrder.setInvWarehouseCode(invSubWarehouseEntities.get(0).getCode()); + } + } + + supplementOrder.setFromCorp(name); supplementOrder.setFromType(ConstantStatus.FROM_PEACE_CHANGE); @@ -283,6 +298,7 @@ public class OrderServiceImpl implements OrderService { supplementCode.setFromCorpId(supplementOrder.getFromCorpId()); supplementCode.setFromCorp(supplementOrder.getFromCorp()); supplementCode.setLocStorageCode(supplementOrder.getLocStorageCode()); + supplementCode.setInvWarehouseCode(supplementOrder.getInvWarehouseCode()); supplementCode.setOrderId(supplementOrderNo); //查询补单设置 supplementCode.setAction(bussinessTypeEntity.getSupplementOrderType()); @@ -417,7 +433,6 @@ public class OrderServiceImpl implements OrderService { * 查询指定单据关联的所有单据 * * @param orderEntity - * @param orders */ @Override public List getAllOrder(OrderEntity orderEntity) { @@ -446,6 +461,7 @@ public class OrderServiceImpl implements OrderService { return orders; } + @Transactional(rollbackFor = Exception.class) @Override public void deleteOrders(List ids) { @@ -510,8 +526,8 @@ public class OrderServiceImpl implements OrderService { } //删除码详情 codesDao.deleteByOrderId(id); - StockOrderFilterRequest stockOrderFilterRequest = new StockOrderFilterRequest(); //查询业务单据 + StockOrderFilterRequest stockOrderFilterRequest = new StockOrderFilterRequest(); if (StrUtil.isNotEmpty(orderEntity.getErpFk())) { stockOrderFilterRequest.setBillNo(orderEntity.getErpFk()); StockOrderEntity stockOrderEntity = stockOrderDao.findOne(stockOrderFilterRequest); @@ -536,7 +552,6 @@ public class OrderServiceImpl implements OrderService { try { orderDao.deleteById(id); orderDetailDao.deleteByOrderId(id); - //查询业务单据 if (StrUtil.isNotEmpty(orderEntity.getErpFk())) { StockOrderFilterRequest stockOrderFilterRequest = new StockOrderFilterRequest(); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvSubWarehouseService.java b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvSubWarehouseService.java new file mode 100644 index 00000000..f3eb9aff --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvSubWarehouseService.java @@ -0,0 +1,29 @@ +package com.glxp.api.admin.service.inventory; + + +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; +import com.glxp.api.admin.req.inventory.FilterInvSubWarehouseRequest; +import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest; + +import java.util.List; + +public interface InvSubWarehouseService { + + List filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest); + + List filterGroupInvSub(FilterInvWarehouseRequest filterInvSubWarehouseRequest); + + InvSubWarehouseEntity selectMaxCode(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest); + + List findByParentId(String code); + + InvSubWarehouseEntity findByInvSubByCode(String code); + + boolean insertInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity); + + boolean updateInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity); + + boolean deleteById(String id); + + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvSubWarehouseServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvSubWarehouseServiceImpl.java new file mode 100644 index 00000000..d4d17825 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvSubWarehouseServiceImpl.java @@ -0,0 +1,87 @@ +package com.glxp.api.admin.service.inventory.impl; + +import cn.hutool.core.collection.CollUtil; +import com.github.pagehelper.PageHelper; +import com.glxp.api.admin.dao.inventory.InvSubWarehouseDao; +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; +import com.glxp.api.admin.req.inventory.FilterInvSubWarehouseRequest; +import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest; +import com.glxp.api.admin.service.inventory.InvSubWarehouseService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Service +public class InvSubWarehouseServiceImpl implements InvSubWarehouseService { + + + @Resource + InvSubWarehouseDao invSubWarehouseDao; + + @Override + public List filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest) { + if (filterInvSubWarehouseRequest == null) { + return Collections.emptyList(); + } + if (filterInvSubWarehouseRequest.getPage() != null) { + int offset = (filterInvSubWarehouseRequest.getPage() - 1) * filterInvSubWarehouseRequest.getLimit(); + PageHelper.offsetPage(offset, filterInvSubWarehouseRequest.getLimit()); + } + List data = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest); + return data; + } + + @Override + public List filterGroupInvSub(FilterInvWarehouseRequest filterInvWarehouseRequest) { + if (filterInvWarehouseRequest == null) { + return Collections.emptyList(); + } + if (filterInvWarehouseRequest.getPage() != null) { + int offset = (filterInvWarehouseRequest.getPage() - 1) * filterInvWarehouseRequest.getLimit(); + PageHelper.offsetPage(offset, filterInvWarehouseRequest.getLimit()); + } + List data = invSubWarehouseDao.filterGroupInvSub(filterInvWarehouseRequest); + return data; + } + + @Override + public InvSubWarehouseEntity selectMaxCode(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest) { + return invSubWarehouseDao.selectMaxCode(filterInvSubWarehouseRequest); + } + + @Override + public List findByParentId(String code) { + FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest(); + filterInvSubWarehouseRequest.setParentId(code); + List invSubWarehouseEntities = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest); + return invSubWarehouseEntities; + } + + @Override + public InvSubWarehouseEntity findByInvSubByCode(String code) { + FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest(); + filterInvSubWarehouseRequest.setCode(code); + List invSubWarehouseEntities = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest); + if (CollUtil.isNotEmpty(invSubWarehouseEntities)) { + return invSubWarehouseEntities.get(0); + } + return null; + } + + @Override + public boolean insertInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity) { + return invSubWarehouseDao.insertInvSubWarehouse(invSubWarehouseEntity); + } + + @Override + public boolean updateInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity) { + return invSubWarehouseDao.updateInvSubWarehouse(invSubWarehouseEntity); + } + + @Override + public boolean deleteById(String id) { + return invSubWarehouseDao.deleteById(id); + } +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java index 21067e89..a08d1f38 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java @@ -492,6 +492,7 @@ public class InvProductsTrService { OrderEntity outOrder = new OrderEntity(); BeanUtils.copyProperties(orderEntity, outOrder); outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime())); + outOrder.setCreateTime(outOrder.getActDate()); outOrder.setAction(bussinessChangeTypeEntity.getScAction()); outOrder.setMainAction(ConstantType.TYPE_OUT); SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); @@ -562,6 +563,7 @@ public class InvProductsTrService { OrderEntity outOrder = new OrderEntity(); BeanUtils.copyProperties(orderEntity, outOrder); outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime())); + outOrder.setCreateTime(outOrder.getActDate()); outOrder.setAction(bussinessChangeTypeEntity.getScAction()); outOrder.setMainAction(ConstantType.TYPE_PUT); SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); @@ -608,6 +610,7 @@ public class InvProductsTrService { OrderEntity outOrder = new OrderEntity(); BeanUtils.copyProperties(orderEntity, outOrder); outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime())); + outOrder.setCreateTime(outOrder.getActDate()); outOrder.setAction(bussinessChangeTypeEntity.getScAction()); outOrder.setMainAction(ConstantType.TYPE_PUT); SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); @@ -681,6 +684,7 @@ public class InvProductsTrService { BeanUtils.copyProperties(orderEntity, outOrder); outOrder.setSupplementNo(null);//补单需置空 outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime())); + outOrder.setCreateTime(outOrder.getActDate()); outOrder.setAction(bussinessChangeTypeEntity.getScAction()); outOrder.setMainAction(ConstantType.TYPE_PUT); outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); @@ -691,8 +695,19 @@ public class InvProductsTrService { outOrder.setId(orderNo); outOrder.setFromCorpId(corpName); outOrder.setFromCorp(temps.get(0).getFromCorp()); + + BussinessTypeEntity originBT = bussinessTypeService.findBTByAction(orderEntity.getAction()); + if (StrUtil.isNotEmpty(originBT.getDefaultSubInv())) { + outOrder.setFromSubInvCode(originBT.getDefaultSubInv()); + } + if (StrUtil.isNotEmpty(bussinessTypeEntity.getDefaultSubInv())) { + outOrder.setFromSubInvCode(bussinessTypeEntity.getDefaultSubInv()); + } + outOrder.setCorpOrderId(CustomUtil.getId() + "x"); outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); + + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); if ("1".equals(systemParamConfigEntity.getParamValue())) { outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); @@ -716,6 +731,7 @@ public class InvProductsTrService { warehouseEntity.setFromCorp(outOrder.getFromCorp()); warehouseEntity.setFromCorpId(outOrder.getFromCorpId()); warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode()); + warehouseEntity.setInvWarehouseCode(outOrder.getInvWarehouseCode()); warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction()); warehouseEntity.setMainAction(ConstantType.TYPE_PUT); } @@ -756,6 +772,7 @@ public class InvProductsTrService { OrderEntity outOrder = new OrderEntity(); BeanUtils.copyProperties(orderEntity, outOrder); outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime())); + outOrder.setCreateTime(outOrder.getActDate()); outOrder.setAction(bussinessChangeTypeEntity.getScAction()); outOrder.setMainAction(ConstantType.TYPE_PUT); if (orderEntity.isError()) { @@ -870,7 +887,7 @@ public class InvProductsTrService { invProductDetailEntity.setAction(warehouseEntity.getAction()); invProductDetailEntity.setMainAction(orderEntity.getMainAction()); invProductDetailEntity.setInvStorageCode(warehouseEntity.getLocStorageCode()); - invProductDetailEntity.setInvWarehouseCode(warehouseEntity.getWarehouseCode()); + invProductDetailEntity.setInvWarehouseCode(warehouseEntity.getInvWarehouseCode()); invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId()); invProductDetailEntity.setCount(actCount * warehouseEntity.getCount()); if (purchaseType != null) { diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/IoTransInoutService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/IoTransInoutService.java index 4de94d7c..cd05f595 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/IoTransInoutService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/IoTransInoutService.java @@ -38,10 +38,7 @@ import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest; import com.glxp.api.admin.res.basic.BussinessOriginTypeResponse; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; import com.glxp.api.admin.res.info.CompanyProductRelevanceResponse; -import com.glxp.api.admin.service.basic.BasicUnitMaintainService; -import com.glxp.api.admin.service.basic.BussinessTypeService; -import com.glxp.api.admin.service.basic.UdiInfoService; -import com.glxp.api.admin.service.basic.UdiRelevanceService; +import com.glxp.api.admin.service.basic.*; import com.glxp.api.admin.service.business.StockOrderDetailService; import com.glxp.api.admin.service.business.StockOrderService; import com.glxp.api.admin.service.info.CompanyProductRelevanceService; @@ -59,9 +56,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -81,11 +76,14 @@ public class IoTransInoutService { @Resource private OrderDetailService myErpOrderService; - + @Resource + BussinessLocalTypeService bussinessLocalTypeService; @Resource UdiRelevanceService udiRelevanceService; @Resource private UdiInfoService udiInfoService; + @Value("${UDI_SERVER_URL}") + private String udiUrl; @Resource private CodesTempService codesTempService; @@ -136,11 +134,14 @@ public class IoTransInoutService { } WarehouseEntity warehouseEntity = warehouseEntityList.get(0); BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(warehouseEntity.getAction()); - String orderId = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean("MS" + MyStrUtil.trim(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); + String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + MyStrUtil.trim(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); + String orderId = orderNo; + OrderEntity orderSaveRequest = new OrderEntity(); orderSaveRequest.setId(orderId); if (warehouseEntity.getActDate() != null) { orderSaveRequest.setActDate(warehouseEntity.getActDate()); + orderSaveRequest.setCreateTime(orderSaveRequest.getActDate()); } orderSaveRequest.setAction(warehouseEntity.getAction()); orderSaveRequest.setActor(warehouseEntity.getActor()); @@ -149,6 +150,8 @@ public class IoTransInoutService { orderSaveRequest.setOutChangeEnable(postOrder.isOutChangeEnable()); orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId()); orderSaveRequest.setLocStorageCode(warehouseEntity.getLocStorageCode()); + orderSaveRequest.setInvWarehouseCode(warehouseEntity.getInvWarehouseCode()); + orderSaveRequest.setFromSubInvCode(warehouseEntity.getFromSubInvCode()); orderSaveRequest.setMainAction(warehouseEntity.getMainAction()); orderSaveRequest.setReceiveStatus(0); orderSaveRequest.setPreCheck(postOrder.isPreCheck()); @@ -198,12 +201,15 @@ public class IoTransInoutService { myErpOrderService.deleteByOrderId(postOrderRequest.getOldOrderId()); } WarehouseEntity warehouseEntity = warehouseEntityList.get(0); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(warehouseEntity.getAction()); - String orderId = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean("MS" + MyStrUtil.trim(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); + String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + MyStrUtil.trim(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); + String orderId = orderNo; OrderEntity orderSaveRequest = new OrderEntity(); orderSaveRequest.setId(orderId); if (warehouseEntity.getActDate() != null) { orderSaveRequest.setActDate(warehouseEntity.getActDate()); + orderSaveRequest.setCreateTime(orderSaveRequest.getActDate()); } orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId()); orderSaveRequest.setAction(warehouseEntity.getAction()); @@ -245,6 +251,7 @@ public class IoTransInoutService { } + //查找等待处理单据,转入正式表 @Async public void transInout() { @@ -261,6 +268,10 @@ public class IoTransInoutService { } } + public void transInout(String orderId) { + OrderEntity orderEntity = orderService.findById(orderId); + transInout(orderEntity); + } public void transInout(OrderEntity orderEntity) { @@ -353,8 +364,6 @@ public class IoTransInoutService { insertList.clear(); return; } - - //三期校验 String checkOriginMsg = checkOriginCode(warehouseEntity, bussinessTypeEntity); if (StrUtil.isNotEmpty(checkOriginMsg)) { @@ -364,7 +373,6 @@ public class IoTransInoutService { return; } - //校验是否是当前供应商 if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest(); @@ -386,9 +394,10 @@ public class IoTransInoutService { return; } } + } - } + } //产品是否已维护已关联 if (StrUtil.isEmpty(warehouseEntity.getRelId())) { orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL); @@ -500,6 +509,7 @@ public class IoTransInoutService { //转入正式表后,更换单据状态,等待校验或已完成 public void transStatus(String orderId) { + //todo 改成等待校验,选择校验 OrderEntity orderEntity = orderService.findById(orderId); String action = orderEntity.getAction(); @@ -833,10 +843,9 @@ public class IoTransInoutService { } stockOrderDetailService.insertStockOrderDetails(stockOrderDetailEntities); orderEntity.setRemark(""); + orderEntity.setErpFk(stockOrderEntity.getBillNo()); orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); orderEntity.setUpdateTime(new Date()); - orderEntity.setErpFk(stockOrderEntity.getBillNo()); - orderService.updateOrder(orderEntity); if (stockOrderEntity.getStatus().equals(ConstantStatus.SORDER_DELIVER)) { orderEntity.setReceiveStatus(1); invProductsTrService.genInvProducts(orderEntity.getId()); @@ -909,13 +918,13 @@ public class IoTransInoutService { } } else { stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER); + orderEntity.setReceiveStatus(1); - orderEntity.setUpdateTime(new Date()); - orderService.updateOrder(orderEntity); // invProductsTrService.genInvProducts(orderEntity.getId()); } stockOrderEntity.setSupplementNo(orderEntity.getSupplementNo()); stockOrderEntity.setCorpName(orderEntity.getFromCorp()); + stockOrderEntity.setInvWarehouseCode(orderEntity.getInvWarehouseCode()); stockOrderEntity.setOrderIdFk(orderEntity.getId()); stockOrderService.insertStockOrder(stockOrderEntity); @@ -924,9 +933,11 @@ public class IoTransInoutService { stockOrderFilterRequest.setBillNo(stockOrderEntity.getBillNo()); stockOrderEntity = stockOrderService.findOne(stockOrderFilterRequest); stockOrderDetailService.deleteByOrderIdFk(stockOrderEntity.getId()); - + orderEntity.setUpdateTime(new Date()); + orderService.updateOrder(orderEntity); return stockOrderEntity; } - } + + diff --git a/api-admin/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml b/api-admin/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml index 28083649..af703fb6 100644 --- a/api-admin/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml @@ -57,7 +57,7 @@ INSERT INTO auth_user(id,userName,passWord,lastLoginIp, - lastLoginTime,createTime,userFlag,lastModifyTime,employeeName) + lastLoginTime,createTime,userFlag,lastModifyTime,employeeName,locInvCode,locSubInvCode) values (#{id},#{userName}, @@ -89,13 +89,13 @@ #{createTime}, #{userFlag,jdbcType=INTEGER}, #{lastModifyTime}, - #{employeeName}) + #{employeeName},#{locInvCode},#{locSubInvCode})) replace INTO auth_user(id, userName, passWord, lastLoginIp, - lastLoginTime, createTime, userFlag, lastModifyTime, employeeName) + lastLoginTime, createTime, userFlag, lastModifyTime, employeeName,CustomerId,locInvCode,locSubInvCode) values ( #{id}, #{userName}, @@ -105,7 +105,10 @@ #{createTime}, #{userFlag,jdbcType=INTEGER}, #{lastModifyTime}, - #{employeeName} + #{employeeName}, + #{CustomerId}, + #{locInvCode}, + #{locSubInvCode} ) @@ -120,6 +123,8 @@ lastModifyTime=#{lastModifyTime}, userFlag=#{userFlag}, employeeName=#{employeeName} + locInvCode=#{locInvCode}, + locSubInvCode=#{locSubInvCode}, WHERE id=#{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml index 46af03fb..5eb91231 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessLocalTypeDao.xml @@ -73,8 +73,8 @@ localAction,originAction, basic_bussiness_type.name , basic_bussiness_type.action,basic_bussiness_type.checkEnable,basic_bustype_local.advanceType,basic_bustype_local.changeEnable, - basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.corpType,basic_bussiness_type.mainAction,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix - ,basic_bustype_local.preIn, + basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.corpType,basic_bussiness_type.mainAction + ,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix,basic_bustype_local.preIn, basic_bussiness_type.ullageFill, basic_bussiness_type.scanPreIn, basic_bussiness_type.vailInv, basic_bussiness_type.codeFillCheck FROM basic_bustype_local inner join basic_bussiness_type diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml index 80304d65..f3b92029 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml @@ -10,17 +10,16 @@ basic_bussiness_type.enable,basic_bussiness_type.remark,basic_bussiness_type.mainAction, basic_bussiness_type.thirdSysFk,basic_bussiness_type.localAction,basic_bussiness_type.secCheckEnable, basic_bussiness_type.checkUdims,basic_bussiness_type.checkPdaEd,basic_bussiness_type.checkPdaUn,basic_bussiness_type.checkPc, - basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange, + basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange,basic_bussiness_type.codeFillCheck, basic_bussiness_type.secCheckUdims, basic_bussiness_type.secCheckPdaEd, basic_bussiness_type.secCheckPdaUn, basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange, - basic_bussiness_type.entrutSpms,basic_bussiness_type.codeFillCheck, basic_bussiness_type.ullageFill, basic_bussiness_type.scanPreIn, basic_bussiness_type.vailInv, basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType, - basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,basic_bussiness_type.outTospms, + basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder, basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne, basic_bussiness_type.secCheckBalacne, defaultUnit,basic_bustype_origin.action - thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.useDyCount,basic_bussiness_type.expireTip, - basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix,basic_bustype_local.preIn + thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.useDyCount,basic_bussiness_type.expireTip,basic_bussiness_type.prefix,basic_bustype_local.prefix + localPrefix,basic_bustype_local.preIn,basic_bussiness_type.defaultSubInv FROM basic_bussiness_type LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction = basic_bustype_local.action left join basic_bustype_origin on basic_bustype_local.originAction = basic_bustype_origin.action @@ -45,8 +44,6 @@ GROUP BY basic_bussiness_type.id - - @@ -85,8 +82,7 @@ basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType, basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,defaultUnit, basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.expireTip, - basic_bustype_local.prefix localPrefix,basic_bustype_local.preIn - from + basic_bustype_local.prefix localPrefix ,basic_bustype_local.preIn from basic_bussiness_type LEFT JOIN basic_third_sys on basic_bussiness_type.thirdSysFk = basic_third_sys.thirdId LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction = @@ -119,7 +115,6 @@ order by basic_bussiness_type.`index` - + replace @@ -184,8 +186,8 @@ checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange ,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew, secCheckChange,corpType,basic_bussiness_type.storageCode,checkBalacne, - secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms -,ullageFill,scanPreIn,vailInv,entrutSpms,codeFillCheck) + secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix + ,ullageFill,scanPreIn,vailInv,codeFillCheck,defaultSubInv,outTospms,entrutSpms) values ( #{action}, @@ -221,14 +223,13 @@ #{expireTip}, #{updateTime}, #{prefix}, - #{outTospms} , #{ullageFill}, #{scanPreIn}, - #{vailInv}, - #{entrutSpms},#{codeFillCheck} + #{vailInv},#{codeFillCheck},#{defaultSubInv},#{outTospms},#{entrutSpms} ) + insert @@ -238,9 +239,8 @@ checkEnable,genUnit,innerOrder,secCheckEnable, checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange ,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew, - secCheckChange,corpType,storageCode,checkBalacne,secCheckBalacne,supplementOrderType, -defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms -,ullageFill,scanPreIn,vailInv,entrutSpms,codeFillCheck) + secCheckChange,corpType,storageCode,checkBalacne,secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix + ,ullageFill,scanPreIn,vailInv,codeFillCheck,defaultSubInv,outTospms,entrutSpms) values ( #{index}, @@ -277,11 +277,9 @@ defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms #{expireTip}, #{updateTime}, #{prefix}, - #{outTospms}, #{ullageFill}, #{scanPreIn}, - #{vailInv}, - #{entrutSpms},#{codeFillCheck} + #{vailInv},#{codeFillCheck},#{defaultSubInv},#{outTospms},#{entrutSpms} ) @@ -321,19 +319,18 @@ defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms useDyCount=#{useDyCount}, expireTip=#{expireTip}, updateTime=#{updateTime}, - prefix=#{prefix}, - outTospms=#{outTospms}, ullageFill=#{ullageFill}, scanPreIn=#{scanPreIn}, vailInv=#{vailInv}, - entrutSpms=#{entrutSpms}, + prefix=#{prefix}, codeFillCheck=#{codeFillCheck}, - + defaultSubInv=#{defaultSubInv}, + outTospms=#{outTospms}, + entrutSpms=#{entrutSpms}, thirdSysFk=#{thirdSysFk}, WHERE id = #{id} - update basic_bussiness_type set supplementOrderType = #{action} @@ -359,7 +356,6 @@ defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms from basic_bussiness_type where action = #{action} - @@ -103,7 +103,8 @@ replace - INTO basic_entrust_accept(`action`, entrustInv, `entrustUser`, userId, updateTime, remark,entrustAction,finishRece,curInv) + INTO basic_entrust_accept(`action`, entrustInv, `entrustUser`, userId, + updateTime, remark,entrustAction,finishRece,curInv,entrustSubInv,invWarehouseCode) values ( #{action}, #{entrustInv}, @@ -113,15 +114,15 @@ #{remark}, #{entrustAction}, #{finishRece}, - #{curInv} + #{curInv},#{entrustSubInv},#{invWarehouseCode} ) - replace - INTO basic_entrust_accept(id,`action`, entrustInv, `entrustUser`, userId, updateTime, remark,entrustAction,finishRece,curInv) + INTO basic_entrust_accept(id,`action`, entrustInv, `entrustUser`, userId, updateTime, remark, + entrustAction,finishRece,curInv,entrustSubInv,invWarehouseCode) values ( #{id}, #{action}, @@ -132,7 +133,7 @@ #{remark}, #{entrustAction}, #{finishRece}, - #{curInv} + #{curInv},#{entrustSubInv},#{invWarehouseCode} ) @@ -148,6 +149,8 @@ remark=#{remark}, finishRece=#{finishRece}, entrustAction=#{entrustAction}, + entrustSubInv=#{entrustSubInv}, + invWarehouseCode=#{invWarehouseCode}, WHERE id = #{id} @@ -157,11 +160,9 @@ WHERE id = #{id} - DELETE FROM basic_entrust_accept - \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml index 84465bbd..94882242 100644 --- a/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml @@ -29,7 +29,8 @@ insert INTO stock_order(id, billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, status, statusInfo, type, sourceType, printStatus, unitIdFk, customerId, thirdOrderFk, orderIdFk, - totalPrice, locStorageCode, supplementNo, createUser, reviewUser, entrustEnd) + totalPrice, locStorageCode, supplementNo, createUser, reviewUser, entrustEnd, auditTime, + updateTime, invWarehouseCode, fromSubInvCode) values (#{id}, #{billNo}, #{billdate}, @@ -43,7 +44,8 @@ #{type}, #{sourceType}, #{printStatus}, #{unitIdFk}, #{customerId}, #{thirdOrderFk}, #{orderIdFk}, #{totalPrice}, - #{locStorageCode}, #{supplementNo}, #{createUser}, #{reviewUser}, #{entrustEnd}) + #{locStorageCode}, #{supplementNo}, #{createUser}, #{reviewUser}, #{entrustEnd}, #{auditTime}, + #{updateTime}, #{invWarehouseCode}, #{fromSubInvCode}) UPDATE stock_order @@ -70,6 +72,10 @@ createUser=#{createUser}, reviewUser=#{reviewUser}, entrustEnd=#{entrustEnd}, + auditTime=#{auditTime}, + updateTime=#{updateTime}, + invWarehouseCode=#{invWarehouseCode}, + fromSubInvCode=#{fromSubInvCode}, WHERE id = #{id} @@ -100,7 +106,9 @@ @@ -251,7 +266,9 @@ stock_order_detail on stock_order.id = stock_order_detail.orderIdFk - left join inv_warehouse on inv_warehouse.code = stock_order.locStorageCode + LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code` + LEFT JOIN inv_warehouse_sub ON inv_warehouse_sub.parentId = inv_warehouse.`code` + LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code` and stock_order.id =#{id} @@ -265,6 +282,13 @@ and stock_order.customerId =#{customerId} + + and invWarehouseCode = #{invWarehouseCode} + + + and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or + invWarehouseCode is null) + group by stock_order_detail.id diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml index 0f0ed4b1..c8f96225 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/CodesDao.xml @@ -33,7 +33,6 @@ and relId =#{relId} - ORDER BY actDate @@ -114,7 +113,6 @@ or SUBSTRING(`code`, 1, 14) = #{code} or SUBSTRING(`code`, 2, 14) = #{code} or SUBSTRING(`code`, 3, 14) = #{code} - SELECT io_order.* FROM io_order - INNER JOIN inv_warehouse_user on io_order.locStorageCode = inv_warehouse_user.`code` + LEFT JOIN inv_warehouse ON io_order.locStorageCode = inv_warehouse.`code` + LEFT JOIN inv_warehouse_sub ON inv_warehouse_sub.parentId = inv_warehouse.`code` + LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code` and io_order.id =#{id} @@ -209,10 +218,10 @@ and exportStatus = #{exportStatus} - and status = #{status} + and io_order.status = #{status} - and ( status = 1 or status=-1) + and ( io_order.status = 1 or io_order.status=-1) and (contrastStatus = 0 or contrastStatus = 2) @@ -235,27 +244,31 @@ + + and customerId =#{customerId} + and createUser =#{createUser} and reviewUser =#{reviewUser} - - and ((createUser =#{unionUser} or reviewUser =#{unionUser}) or (reviewUser is null and createUser is - null) ) + + and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or + invWarehouseCode is null) + and ullageSupNo =#{ullageSupNo} - + and inv_warehouse_user.userId =#{userId} - + and locStorageCode =#{locStorageCode} - - and thirdBillNo =#{thirdBillNo} + + and invWarehouseCode =#{invWarehouseCode} @@ -267,7 +280,9 @@ SELECT io_order.* FROM io_order - INNER JOIN inv_warehouse_user on io_order.locStorageCode = inv_warehouse_user.`code` + LEFT JOIN inv_warehouse ON io_order.locStorageCode = inv_warehouse.`code` + LEFT JOIN inv_warehouse_sub ON inv_warehouse_sub.parentId = inv_warehouse.`code` + LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code` and io_order.id =#{id} @@ -356,10 +381,10 @@ and `action` ]]> 'StockCheck' - and status = #{status} + and io_order.status = #{status} - and ( status = 1 or status=-1) + and ( io_order.status = 1 or io_order.status=-1) and exportStatus = #{exportStatus} @@ -385,21 +410,29 @@ and customerId =#{customerId} - + and createUser =#{createUser} - + and reviewUser =#{reviewUser} and ullageSupNo =#{ullageSupNo} - + and inv_warehouse_user.userId =#{userId} - + + and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or + invWarehouseCode is null) + + + and locStorageCode =#{locStorageCode} + + and invWarehouseCode =#{invWarehouseCode} + group by io_order.id ORDER BY actDate DESC @@ -408,7 +441,9 @@ diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml index 1a48a5e7..bf164549 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml @@ -121,12 +121,13 @@ inv_prein_product.inCount,inv_prein_product.outCount ,inv_prein_product.reCount,inv_prein_product.customerId, basic_corp.name companyName,inv_prein_product.supId,inv_prein_product.unitFk ,inv_warehouse.name - invStorageName,inv_prein_product.invStorageCode,inv_prein_product.price + invStorageName,inv_prein_product.invStorageCode,inv_prein_product.price,inv_warehouse_sub.name invSubStorageName FROM inv_prein_product inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id inner join basic_products on basic_udirel.uuid = basic_products.uuid left join basic_corp on inv_prein_product.supId=basic_corp.erpId left join inv_warehouse on inv_warehouse.code=inv_prein_product.invStorageCode + left join inv_warehouse_sub on inv_warehouse_sub.parentId = inv_warehouse.code basic_products.diType=1 diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDao.xml index 33e2837c..0c43a6fb 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDao.xml @@ -120,12 +120,13 @@ inv_pre_product.inCount,inv_pre_product.outCount ,inv_pre_product.reCount,inv_pre_product.customerId, basic_corp.name companyName,inv_pre_product.supId,inv_pre_product.unitFk ,inv_warehouse.name - invStorageName,inv_pre_product.invStorageCode,inv_pre_product.price + invStorageName,inv_pre_product.invStorageCode,inv_pre_product.price,inv_warehouse_sub.name invSubStorageName FROM inv_pre_product inner join basic_udirel on inv_pre_product.relIdFk = basic_udirel.id inner join basic_products on basic_udirel.uuid = basic_products.uuid left join basic_corp on inv_pre_product.supId=basic_corp.erpId left join inv_warehouse on inv_warehouse.code=inv_pre_product.invStorageCode + left join inv_warehouse_sub on inv_warehouse_sub.parentId = inv_warehouse.code basic_products.diType=1 diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml index 02780c06..d3e26e67 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml @@ -117,12 +117,13 @@ basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh, inv_product.inCount,inv_product.outCount ,inv_product.reCount,inv_product.customerId,basic_corp.name companyName,inv_product.unitFk,inv_product.supId - ,inv_warehouse.name invStorageName,inv_product.invStorageCode,inv_product.price + ,inv_warehouse.name invStorageName,inv_product.invStorageCode,inv_product.price,inv_warehouse_sub.name invSubStorageName FROM inv_product inner join basic_udirel on inv_product.relIdFk = basic_udirel.id inner join basic_products on basic_udirel.uuid = basic_products.uuid left join basic_corp on inv_product.supId=basic_corp.erpId left join inv_warehouse on inv_warehouse.code=inv_product.invStorageCode + left join inv_warehouse_sub on inv_warehouse_sub.parentId = inv_warehouse.code basic_products.diType=1 diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvSubWarehouseDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvSubWarehouseDao.xml new file mode 100644 index 00000000..f68285c8 --- /dev/null +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvSubWarehouseDao.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + replace + INTO inv_warehouse_sub + (id, code, `name`, parentId, remark,defaultInv) + values ( + #{id}, + #{code}, + #{name}, + #{parentId}, + #{remark}, + #{defaultInv} + ) + + + + + DELETE + FROM inv_warehouse_sub + WHERE id = #{id} + + + + UPDATE inv_warehouse_sub + + name=#{name}, + code=#{code}, + parentId=#{parentId}, + remark=#{remark}, + defaultInv=#{defaultInv}, + + WHERE id = #{id} + + + + replace into inv_warehouse_sub + (id, code, `name`, parentId, remark,defaultInv) + values + + ( + #{item.id}, + #{item.code}, + #{item.name}, + #{item.parentId}, + #{item.remark},#{item.defaultInv}) + + + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml index bdf5ff32..8e18b1e4 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml @@ -45,8 +45,9 @@ - - replace INTO inv_warehouse - (pid, code, name, advanceType, isDefault, - status, updateTime, remark,`level`,pcode, spUse,thirdId, thirdId1, thirdId2, thirdId3, thirdId4) + (pid, code, `name`, advanceType, isDefault, + status, updateTime, remark,`level`,pcode,spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4) values ( #{pid}, #{code},