分库功能修改,beta版

fengcang
anthonyywj2 3 years ago
parent 752dc93d98
commit 001fe3190d

@ -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();
}
/**
*
*

@ -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);
}
/**
*

@ -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<StockOrderEntity> pageInfo;
pageInfo = new PageInfo<>(stockOrderEntityList);
PageSimpleResponse<ErpOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
@ -400,6 +402,7 @@ public class StockOrderController {
String replicateNo = originOrder.getReplicateNo(); //复制单号
List<WarehouseEntity> 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<WarehouseEntity> 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()))

@ -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<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest);
List<WarehouseUserEntity> warehouseUserEntities = new ArrayList<>();
List<InvWarehouseEntity> 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<EntrustReceEntity> 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);
}
}

@ -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<CompanyProductRelevanceResponse> datas = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest);
if (datas.size() <= 0) {
return ResultVOUtils.error(500, "当前供应商不存在此配送产品!");
}
}
return null;
}
//判断本单是否存在
public WarehouseEntity isExitLocal(String code, List<WarehouseEntity> 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<CompanyProductRelevanceResponse> 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<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.getListByCode(code);
List<WarehouseUserResponse> 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();
}

@ -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<InvSubWarehouseEntity> 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<InvSubWarehouseEntity> 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();
}
}

@ -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<InvWarehouseEntity> warehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest);
@ -475,4 +482,6 @@ public class InvWarehouseController {
pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -28,5 +28,4 @@ public interface EntrustReceDao {
boolean deleteAll();
boolean updateEntrustRec(EntrustReceEntity warehouseEntity);
}

@ -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<InvSubWarehouseEntity> filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest);
List<InvSubWarehouseEntity> filterGroupInvSub(FilterInvWarehouseRequest filterInvSubWarehouseRequest);
InvSubWarehouseEntity selectMaxCode(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest);
boolean insertInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity);
boolean updateInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity);
void importInvSubWarehouse(@Param("invWarehouseEntities") List<InvSubWarehouseEntity> invSubWarehouseEntities);
boolean deleteById(String id);
}

@ -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;
}

@ -64,4 +64,5 @@ public class BussinessTypeEntity {
private boolean entrutSpms;
private boolean codeFillCheck;
private String defaultSubInv;
}

@ -18,4 +18,7 @@ public class EntrustReceEntity {
private String remark;
private boolean finishRece;
private String lastUpdateTime;
private String entrustSubInv;
private String invWarehouseCode;
}

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

@ -56,5 +56,6 @@ public class OrderEntity {
private String replicateNo;
private boolean syncOutChange;
private String createTime;
private String fromSubInvCode;
}

@ -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;
}

@ -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;
}

@ -35,4 +35,6 @@ public class AuthAdminSaveRequest {
private String comments;
// 角色ids
private List<Long> roles;
private String locInvCode;
private String locSubInvCode;
}

@ -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;
}

@ -25,7 +25,7 @@ public class StockOrderPostRequest {
private List<StockOrderDetailEntity> subErpOrders;
private String customerId;
private String invWarehouseCode;
private String locStorageCode;
private BigDecimal price;
private String unitIdFk;

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

@ -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;
}

@ -45,5 +45,5 @@ public class OrderFilterRequest extends ListPageRequest {
private String stockOrderId;
private Integer entrustId;
private boolean entrust;
private String invWarehouseCode;
}

@ -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;
}

@ -25,4 +25,5 @@ public class FilterInvWarehouseRequest extends ListPageRequest {
private List<Integer> ids;
private Boolean spUse;
private Integer filter;
}

@ -25,6 +25,7 @@ public class BussinessTypeFilterRequest extends ListPageRequest {
private Integer userId;
private String locInvCode;
private String locSubInvCode;
private String lastUpdateTime;
}

@ -16,4 +16,9 @@ public class LoginUserInfoResponse {
private String employeeName;
// 权限列表
private List<String> authRules;
private String locInvCode;
private String locSubInvCode;
private String locInvName;
private String locSubInvName;
}

@ -67,4 +67,5 @@ public class BussinessTypResponse {
private boolean entrutSpms;
private boolean codeFillCheck;
private String defaultSubInv;
}

@ -21,5 +21,6 @@ public class EntrustReceRespose {
private String entrustInvName;
private String curInv;
private String curInvName;
private String entrustSubInv;
private String invWarehouseCode;
}

@ -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<CompanyProductRelevanceEntity> companyProductRelevanceEntities;
List<UdiRelevanceEntity> udiRelevanceEntities;
List<InvSubWarehouseEntity> invSubWarehouseEntities;
List<WarehouseBussinessTypeEntity> warehouseBussinessTypeEntities;
List<WarehouseUserEntity> warehouseUserEntities;
List<AuthAdmin> authAdminList;

@ -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;
}

@ -23,6 +23,7 @@ public class InvProductResponse {
private String unitFk;
private String invStorageCode;
private String invStorageName;
private String invSubStorageName;
private String price;

@ -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<InvSubWarehouseEntity> 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<OrderEntity> getAllOrder(OrderEntity orderEntity) {
@ -446,6 +461,7 @@ public class OrderServiceImpl implements OrderService {
return orders;
}
@Transactional(rollbackFor = Exception.class)
@Override
public void deleteOrders(List<String> 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();

@ -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<InvSubWarehouseEntity> filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest);
List<InvSubWarehouseEntity> filterGroupInvSub(FilterInvWarehouseRequest filterInvSubWarehouseRequest);
InvSubWarehouseEntity selectMaxCode(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest);
List<InvSubWarehouseEntity> findByParentId(String code);
InvSubWarehouseEntity findByInvSubByCode(String code);
boolean insertInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity);
boolean updateInvSubWarehouse(InvSubWarehouseEntity invSubWarehouseEntity);
boolean deleteById(String id);
}

@ -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<InvSubWarehouseEntity> 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<InvSubWarehouseEntity> data = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
return data;
}
@Override
public List<InvSubWarehouseEntity> 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<InvSubWarehouseEntity> data = invSubWarehouseDao.filterGroupInvSub(filterInvWarehouseRequest);
return data;
}
@Override
public InvSubWarehouseEntity selectMaxCode(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest) {
return invSubWarehouseDao.selectMaxCode(filterInvSubWarehouseRequest);
}
@Override
public List<InvSubWarehouseEntity> findByParentId(String code) {
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
filterInvSubWarehouseRequest.setParentId(code);
List<InvSubWarehouseEntity> invSubWarehouseEntities = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
return invSubWarehouseEntities;
}
@Override
public InvSubWarehouseEntity findByInvSubByCode(String code) {
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
filterInvSubWarehouseRequest.setCode(code);
List<InvSubWarehouseEntity> 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);
}
}

@ -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) {

@ -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;
}
}

@ -57,7 +57,7 @@
<insert id="insertAuthAdmin" keyProperty="id" parameterType="com.glxp.api.admin.entity.auth.AuthAdmin">
INSERT INTO auth_user(id,userName,passWord,lastLoginIp,
lastLoginTime,createTime,userFlag,lastModifyTime,employeeName)
lastLoginTime,createTime,userFlag,lastModifyTime,employeeName,locInvCode,locSubInvCode)
values
(#{id},#{userName},
<choose>
@ -89,13 +89,13 @@
#{createTime},
#{userFlag,jdbcType=INTEGER},
#{lastModifyTime},
#{employeeName})
#{employeeName},#{locInvCode},#{locSubInvCode}))
</insert>
<insert id="replaceAuthAdmin" keyProperty="id" parameterType="com.glxp.api.admin.entity.auth.AuthAdmin">
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}
)
</insert>
@ -120,6 +123,8 @@
<if test="lastModifyTime != null">lastModifyTime=#{lastModifyTime},</if>
<if test="userFlag != null">userFlag=#{userFlag},</if>
<if test="employeeName != null">employeeName=#{employeeName}</if>
<if test="locInvCode != null">locInvCode=#{locInvCode},</if>
<if test="locSubInvCode != null">locSubInvCode=#{locSubInvCode},</if>
</set>
WHERE id=#{id}
</update>

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

@ -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 @@
</if>
</where>
GROUP BY basic_bussiness_type.id
</select>
@ -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 @@
</where>
order by basic_bussiness_type.`index`
</select>
<select id="filterAllByUser" parameterType="com.glxp.api.admin.req.receipt.BussinessTypeFilterRequest"
@ -130,22 +125,22 @@
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.entrutSpms,basic_bussiness_type.codeFillCheck,
basic_bussiness_type.ullageFill, basic_bussiness_type.scanPreIn, basic_bussiness_type.vailInv,
basic_bussiness_type.secCheckUdims, basic_bussiness_type.secCheckPdaEd, basic_bussiness_type.secCheckPdaUn,
basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange,basic_bussiness_type.outTospms,
basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange,,basic_bussiness_type.outTospms,
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_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,defaultUnit,
basic_bussiness_type.secCheckBalacne,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys,useDyCount,basic_bussiness_type.expireTip,basic_bussiness_type.prefix,basic_bustype_local.prefix
localPrefix
,basic_bustype_local.preIn
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
INNER JOIN inv_warehouse_bussiness_type on basic_bussiness_type.action = inv_warehouse_bussiness_type.action
INNER JOIN inv_warehouse on inv_warehouse_bussiness_type.`code` = inv_warehouse.`code`
INNER JOIN inv_warehouse_user on inv_warehouse.`code` =inv_warehouse_user.`code`
INNER JOIN inv_warehouse_sub on inv_warehouse_sub.`code` = inv_warehouse_bussiness_type.code
INNER JOIN inv_warehouse on inv_warehouse_sub.parentId = inv_warehouse.`code`
INNER JOIN inv_warehouse_user on inv_warehouse_sub.`code` =inv_warehouse_user.`code`
<where>
<if test="name != ''and name != null">
AND basic_bussiness_type.name LIKE concat('%',#{name},'%')
@ -168,13 +163,20 @@
<if test="locInvCode != ''and locInvCode != null">
AND inv_warehouse.`code` =#{locInvCode}
</if>
<if test="locSubInvCode != ''and locSubInvCode != null">
AND inv_warehouse_sub.`code` =#{locSubInvCode}
</if>
<if test="userId != null">
AND inv_warehouse_user.userId = #{userId}
</if>
</where>
group by basic_bussiness_type.action
</select>
</select>
<insert id="insertBussinessType" keyProperty="id"
parameterType="com.glxp.api.admin.entity.basic.BussinessTypeEntity">
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>
<insert id="insertIgnoreBussinessType" keyProperty="id"
parameterType="com.glxp.api.admin.entity.basic.BussinessTypeEntity">
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}
)
</insert>
@ -321,19 +319,18 @@ defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms
<if test="useDyCount != null">useDyCount=#{useDyCount},</if>
<if test="expireTip != null">expireTip=#{expireTip},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="prefix != null">prefix=#{prefix},</if>
<if test="outTospms != null">outTospms=#{outTospms},</if>
<if test="ullageFill != null">ullageFill=#{ullageFill},</if>
<if test="scanPreIn != null">scanPreIn=#{scanPreIn},</if>
<if test="vailInv != null">vailInv=#{vailInv},</if>
<if test="entrutSpms != null">entrutSpms=#{entrutSpms},</if>
<if test="prefix != null">prefix=#{prefix},</if>
<if test="codeFillCheck != null">codeFillCheck=#{codeFillCheck},</if>
<if test="defaultSubInv != null">defaultSubInv=#{defaultSubInv},</if>
<if test="outTospms != null">outTospms=#{outTospms},
<if test="entrutSpms != null">entrutSpms=#{entrutSpms},</if></if>
thirdSysFk=#{thirdSysFk},
</trim>
WHERE id = #{id}
</update>
<update id="updateSupplementOrderType">
update basic_bussiness_type
set supplementOrderType = #{action}
@ -359,7 +356,6 @@ defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms
from basic_bussiness_type
where action = #{action}
</select>
<select id="selectEnableSupplementOrder" resultType="java.lang.String">
select supplementOrderType
from basic_bussiness_type

@ -25,7 +25,6 @@
<if test="curInv!=null">
and curInv = #{curInv}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
@ -96,6 +95,7 @@
and curInv = #{curInv}
</if>
</where>
group by basic_entrust_accept.id
order by updateTime desc
</select>
@ -103,7 +103,8 @@
<insert id="insertEntrustRec" keyProperty="id"
parameterType="com.glxp.api.admin.entity.basic.EntrustReceEntity">
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}
)
</insert>
<insert id="replaceEntrustRec" keyProperty="id"
parameterType="com.glxp.api.admin.entity.basic.EntrustReceEntity">
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}
)
</insert>
@ -148,6 +149,8 @@
<if test="remark != null">remark=#{remark},</if>
<if test="finishRece != null">finishRece=#{finishRece},</if>
<if test="entrustAction != null">entrustAction=#{entrustAction},</if>
<if test="entrustSubInv != null">entrustSubInv=#{entrustSubInv},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
</trim>
WHERE id = #{id}
</update>
@ -157,11 +160,9 @@
WHERE id = #{id}
</delete>
<delete id="deleteAll" parameterType="Map">
DELETE
FROM basic_entrust_accept
</delete>
</mapper>

@ -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})
</insert>
<update id="updateById" parameterType="com.glxp.api.admin.entity.business.StockOrderEntity">
UPDATE stock_order
@ -70,6 +72,10 @@
<if test="createUser != null">createUser=#{createUser},</if>
<if test="reviewUser != null">reviewUser=#{reviewUser},</if>
<if test="entrustEnd != null">entrustEnd=#{entrustEnd},</if>
<if test="auditTime != null">auditTime=#{auditTime},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
<if test="fromSubInvCode != null">fromSubInvCode=#{fromSubInvCode},</if>
</trim>
WHERE id = #{id}
</update>
@ -100,7 +106,9 @@
<select id="filterListOr" parameterType="com.glxp.api.admin.req.business.StockOrderFilterRequest"
resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
SELECT stock_order.* FROM stock_order
INNER JOIN inv_warehouse_user on stock_order.locStorageCode = inv_warehouse_user.`code`
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`
<where>
<if test="id != '' and id!=null">
and id =#{id}
@ -127,7 +135,7 @@
and thirdSysFk = #{thirdSysFk}
</if>
<if test="status != '' and status!=null">
and status = #{status}
and stock_order.status = #{status}
</if>
<if test="statusInfo != '' and statusInfo!=null">
and statusInfo = #{statusInfo}
@ -144,6 +152,12 @@
<if test="unitIdFk != '' and unitIdFk!=null">
and unitIdFk = #{unitIdFk}
</if>
<if test="userId!=null">
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
invWarehouseCode is null)
</if>
<if test="customerId != '' and customerId!=null">
and customerId = #{customerId}
</if>
@ -159,9 +173,8 @@
<if test="locStorageCode != '' and locStorageCode!=null">
and locStorageCode = #{locStorageCode}
</if>
<if test="unionUser != '' and unionUser!=null">
and ((createUser =#{unionUser} or reviewUser =#{unionUser}) or (reviewUser is null and createUser is
null) )
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode = #{invWarehouseCode}
</if>
<if test="createUser!=null">
and createUser = #{createUser}
@ -178,7 +191,6 @@
<if test="userId!=null">
and inv_warehouse_user.userId =#{userId}
</if>
</where>
group by stock_order.id
ORDER BY id DESC
@ -222,8 +234,9 @@
<if test="billType != '' and billType !=null">
and billType =#{billType}
</if>
<if test="customerId != '' and customerId !=null">
and customerId =#{customerId}
</if>
<if test="thirdOrderFk != '' and thirdOrderFk !=null">
and thirdOrderFk =#{thirdOrderFk}
</if>
@ -236,7 +249,9 @@
<if test="reviewUser!=null">
and reviewUser = #{reviewUser}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode = #{invWarehouseCode}
</if>
</where>
limit 1
</select>
@ -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`
<where>
<if test="id != '' and id!=null">
and stock_order.id =#{id}
@ -265,6 +282,13 @@
<if test="customerId != '' and customerId !=null">
and stock_order.customerId =#{customerId}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode = #{invWarehouseCode}
</if>
<if test="userId!=null">
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
invWarehouseCode is null)
</if>
</where>
group by stock_order_detail.id

@ -33,7 +33,6 @@
<if test="relId != '' and relId!=null">
and relId =#{relId}
</if>
</where>
ORDER BY actDate
</select>
@ -114,7 +113,6 @@
or SUBSTRING(`code`, 1, 14) = #{code}
or SUBSTRING(`code`, 2, 14) = #{code}
or SUBSTRING(`code`, 3, 14) = #{code}
</select>
<select id="findCodesById" parameterType="Map"
@ -129,7 +127,6 @@
from io_codes
where corpOrderId = #{corpOrderId}
</select>
<update id="updateOrderId" parameterType="Map">
UPDATE io_codes
SET orderId = #{newOrderId}
@ -141,6 +138,8 @@
where nameCode = #{nameCode}
and orderId = #{orderId}
</update>
<update id="updateSupId" parameterType="Map">
UPDATE io_codes
SET supId = #{supId}
@ -148,10 +147,17 @@
and orderId = #{orderId}
</update>
<delete id="deleteByOrderId" parameterType="Map">
DELETE
FROM io_codes
WHERE orderId = #{orderId}
</delete>
<update id="updateCode" parameterType="Map">
UPDATE io_codes
<trim prefix="set" suffixOverrides=",">
<if test="relId != null">relId=#{relId},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
<if test="fromCorp != null">fromCorp=#{fromCorp},</if>
<if test="fromCorpId != null">fromCorpId=#{fromCorpId},</if>
<if test="count != null">`count`=#{count},</if>
@ -163,18 +169,17 @@
</trim>
WHERE id=#{id}
</update>
<update id="updateUnit" parameterType="Map">
UPDATE io_codes
SET fromCorpId = #{fromCorpId},
fromCorp = #{fromCorp}
WHERE orderId = #{orderId}
</update>
<delete id="deleteByOrderId" parameterType="Map">
DELETE
FROM io_codes
WHERE orderId = #{orderId}
<delete id="deleteByOrderIdAndCode">
delete
from io_codes
where orderId = #{orderId}
and code = #{code}
</delete>
<delete id="deleteById">
@ -182,4 +187,5 @@
from io_codes
where id = #{id}
</delete>
</mapper>

@ -136,6 +136,10 @@
<if test="fromCorpId != null">`fromCorpId`=#{fromCorpId},</if>
<if test="fromCorp != null">`fromCorp`=#{fromCorp},</if>
<if test="locStorageCode != null">`locStorageCode`=#{locStorageCode},</if>
<if test="produceDate != null">`produceDate`=#{produceDate},</if>
<if test="expireDate != null">`expireDate`=#{expireDate},</if>
<if test="batchNo != null">`batchNo`=#{batchNo},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
<if test="supId != null">`supId`=#{supId},</if>
<if test="relId != null">`relId`=#{relId},</if>
</set>
@ -152,6 +156,10 @@
<if test="fromCorp != null">`fromCorp`=#{fromCorp},</if>
<if test="locStorageCode != null">`locStorageCode`=#{locStorageCode},</if>
<if test="supId != null">`supId`=#{supId},</if>
<if test="produceDate != null">`produceDate`=#{produceDate},</if>
<if test="expireDate != null">`expireDate`=#{expireDate},</if>
<if test="batchNo != null">`batchNo`=#{batchNo},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
<if test="relId != null">`relId`=#{relId},</if>
</set>
WHERE id=#{id}
@ -166,6 +174,10 @@
<if test="fromCorp != null">`fromCorp`=#{fromCorp},</if>
<if test="locStorageCode != null">`locStorageCode`=#{locStorageCode},</if>
<if test="supId != null">`supId`=#{supId},</if>
<if test="produceDate != null">`produceDate`=#{produceDate},</if>
<if test="expireDate != null">`expireDate`=#{expireDate},</if>
<if test="batchNo != null">`batchNo`=#{batchNo},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
<if test="relId != null">`relId`=#{relId},</if>
</set>
WHERE orderId=#{orderId}
@ -189,6 +201,4 @@
FROM io_codes_temp
WHERE id = #{id}
</delete>
</mapper>

@ -31,9 +31,10 @@
<insert id="insertOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.inout.OrderEntity">
insert INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction,
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, supId,
receiveStatus, erpFk, stockCheckFk, thirdBillNo, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo, preCheck, thirdBillNo, updateTime)
outChangeEnable, originUllageSupNo, preCheck, updateTime, replicateNo, invWarehouseCode,
fromSubInvCode, createTime)
values (#{id},
#{action},
#{corpOrderId},
@ -51,19 +52,19 @@
#{receiveStatus},
#{erpFk},
#{stockCheckFk},
#{supId}, #{exportFilePath}, #{locStorageCode}, #{supplementNo}
, #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo},
#{preCheck}, #{thirdBillNo}, #{updateTime})
#{thirdBillNo}, #{supId}, #{exportFilePath}, #{locStorageCode}, #{supplementNo},
#{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo}, #{preCheck},
#{updateTime}, #{replicateNo}, #{invWarehouseCode}, #{fromSubInvCode}, #{createTime})
</insert>
<insert id="importOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.inout.OrderEntity">
insert
ignore
INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction,
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo,preCheck,thirdBillNo,updateTime)
INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction,
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, thirdBillNo, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo, preCheck,updateTime,replicateNo,invWarehouseCode,fromSubInvCode,createTime)
values (
#{id},
#{action},
@ -82,6 +83,7 @@
#{receiveStatus},
#{erpFk},
#{stockCheckFk},
#{thirdBillNo},
#{supId},
#{exportFilePath},
#{locStorageCode},
@ -92,8 +94,10 @@
#{outChangeEnable},
#{originUllageSupNo},
#{preCheck},
#{thirdBillNo},
#{updateTime}
#{updateTime},
#{replicateNo},
#{invWarehouseCode},
#{fromSubInvCode},#{createTime}
)
</insert>
@ -132,6 +136,10 @@
<if test="preCheck != null">preCheck=#{preCheck},</if>
<if test="thirdBillNo != null">thirdBillNo=#{thirdBillNo},</if>
<if test="auditTime != null">auditTime=#{auditTime},</if>
<if test="replicateNo != null and replicateNo != ''">replicateNo=#{replicateNo}</if>
<if test="fromSubInvCode != null and fromSubInvCode != ''">fromSubInvCode=#{fromSubInvCode}</if>
<if test="createTime != null and createTime != ''">createTime=#{createTime}</if>
</trim>
WHERE id = #{id}
</update>
@ -142,7 +150,6 @@
WHERE id = #{id}
</delete>
<delete id="deleteByOrderId" parameterType="Map">
DELETE
FROM io_order
@ -185,7 +192,9 @@
<select id="filterListOr" parameterType="com.glxp.api.admin.req.inout.OrderFilterRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
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`
<where>
<if test="id != '' and id!=null">
and io_order.id =#{id}
@ -209,10 +218,10 @@
and exportStatus = #{exportStatus}
</if>
<if test="status != '' and status!=null and status!=10">
and status = #{status}
and io_order.status = #{status}
</if>
<if test="status ==10">
and ( status = 1 or status=-1)
and ( io_order.status = 1 or io_order.status=-1)
</if>
<if test="unionCtrStatus != '' and unionCtrStatus!=null">
and (contrastStatus = 0 or contrastStatus = 2)
@ -235,27 +244,31 @@
<if test="endTime!=null and endTime!=''">
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
</if>
<if test="customerId != '' and customerId!=null">
and customerId =#{customerId}
</if>
<if test="createUser!=null">
and createUser =#{createUser}
</if>
<if test="reviewUser!=null">
and reviewUser =#{reviewUser}
</if>
<if test="unionUser != '' and unionUser!=null">
and ((createUser =#{unionUser} or reviewUser =#{unionUser}) or (reviewUser is null and createUser is
null) )
<if test="userId != '' and userId!=null">
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
invWarehouseCode is null)
</if>
<if test="ullageSupNo != '' and ullageSupNo!=null">
and ullageSupNo =#{ullageSupNo}
</if>
<if test="userId!=null">
<if test="userId != '' and userId!=null">
and inv_warehouse_user.userId =#{userId}
</if>
<if test="locStorageCode!=null">
<if test="locStorageCode != '' and locStorageCode!=null">
and locStorageCode =#{locStorageCode}
</if>
<if test="thirdBillNo!=null">
and thirdBillNo =#{thirdBillNo}
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode =#{invWarehouseCode}
</if>
</where>
@ -267,7 +280,9 @@
<select id="filterList" parameterType="com.glxp.api.admin.req.inout.OrderFilterRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
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`
<where>
<if test="id != '' and id!=null">
and io_order.id =#{id}
@ -281,14 +296,11 @@
<if test="action != '' and action!=null">
and action = #{action}
</if>
<if test="action==null or action == ''">
and `action` <![CDATA[ <> ]]> 'StockCheck'
</if>
<if test="status != '' and status!=null and status!=10">
and status = #{status}
and io_order.status = #{status}
</if>
<if test="status ==10">
and ( status = 1 or status=-1)
and ( io_order.status = 1 or io_order.status=-1)
</if>
<if test="exportStatus != '' and exportStatus!=null">
and exportStatus = #{exportStatus}
@ -314,10 +326,13 @@
<if test="endTime!=null and endTime!=''">
<![CDATA[ and DATE_FORMAT(actDate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
</if>
<if test="customerId != '' and customerId!=null">
and customerId =#{customerId}
</if>
<if test="createUser!=null">
and createUser =#{createUser}
</if>
<if test=" reviewUser!=null">
<if test="reviewUser!=null">
and reviewUser =#{reviewUser}
</if>
<if test="ullageSupNo != '' and ullageSupNo!=null">
@ -329,6 +344,14 @@
<if test="locStorageCode!=null">
and locStorageCode =#{locStorageCode}
</if>
<if test="invWarehouseCode!=null">
and invWarehouseCode =#{invWarehouseCode}
</if>
<if test="userId!=null">
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
invWarehouseCode is null)
</if>
</where>
group by io_order.id
ORDER BY actDate DESC
@ -338,7 +361,9 @@
<select id="filterListByUser" parameterType="com.glxp.api.admin.req.inout.OrderFilterRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
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`
<where>
<if test="id != '' and id!=null">
and io_order.id =#{id}
@ -356,10 +381,10 @@
and `action` <![CDATA[ <> ]]> 'StockCheck'
</if>
<if test="status != '' and status!=null and status!=10">
and status = #{status}
and io_order.status = #{status}
</if>
<if test="status ==10">
and ( status = 1 or status=-1)
and ( io_order.status = 1 or io_order.status=-1)
</if>
<if test="exportStatus != '' and exportStatus!=null">
and exportStatus = #{exportStatus}
@ -385,21 +410,29 @@
<if test="customerId != '' and customerId!=null">
and customerId =#{customerId}
</if>
<if test=" createUser!=null">
<if test="createUser!=null">
and createUser =#{createUser}
</if>
<if test=" reviewUser!=null">
<if test="reviewUser!=null">
and reviewUser =#{reviewUser}
</if>
<if test="ullageSupNo != '' and ullageSupNo!=null">
and ullageSupNo =#{ullageSupNo}
</if>
<if test="userId!=null">
<if test="userId != '' and userId!=null">
and inv_warehouse_user.userId =#{userId}
</if>
<if test="locStorageCode!=null">
<if test="userId != '' and userId!=null">
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
invWarehouseCode is null)
</if>
<if test="locStorageCode != '' and locStorageCode!=null">
and locStorageCode =#{locStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode =#{invWarehouseCode}
</if>
</where>
group by io_order.id
ORDER BY actDate DESC
@ -408,7 +441,9 @@
<select id="filterNoSort" parameterType="com.glxp.api.admin.req.inout.OrderFilterRequest"
resultType="com.glxp.api.admin.entity.inout.OrderEntity">
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`
<where>
<if test="id != '' and id!=null">
and io_order.id =#{id}
@ -423,7 +458,7 @@
and `action` <![CDATA[ <> ]]> 'StockCheck'
</if>
<if test="status != '' and status!=null">
and status = #{status}
and io_order.status = #{status}
</if>
<if test="exportStatus != '' and exportStatus!=null">
and exportStatus = #{exportStatus}
@ -458,12 +493,20 @@
<if test="ullageSupNo != '' and ullageSupNo!=null">
and ullageSupNo =#{ullageSupNo}
</if>
<if test="userId!=null">
<if test="userId != '' and userId!=null">
and inv_warehouse_user.userId =#{userId}
</if>
<if test="locStorageCode!=null">
<if test="userId != '' and userId!=null">
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
invWarehouseCode is null)
</if>
<if test="locStorageCode != '' and locStorageCode!=null">
and locStorageCode =#{locStorageCode}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode =#{invWarehouseCode}
</if>
</where>
group by io_order.id
</select>

@ -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
<where>
basic_products.diType=1
<if test="cpmctymc != '' and cpmctymc != null">

@ -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
<where>
basic_products.diType=1
<if test="cpmctymc != '' and cpmctymc != null">

@ -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
<where>
basic_products.diType=1
<if test="productsName != '' and productsName != null">

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.admin.dao.inventory.InvSubWarehouseDao">
<select id="filterInvSubWarehouse" parameterType="com.glxp.api.admin.req.inventory.FilterInvSubWarehouseRequest"
resultType="com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity">
select *
FROM inv_warehouse_sub a
<where>
<if test="id != '' and id != null">
AND a.id = #{id}
</if>
<if test="code != '' and code != null">
AND a.code = #{code}
</if>
<if test="name != '' and name != null">
AND a.name like concat('%',#{name},'%')
</if>
<if test="parentId != '' and parentId != null">
AND a.parentId = #{parentId}
</if>
<if test="defaultInv != '' and defaultInv != null">
AND a.defaultInv = #{defaultInv}
</if>
</where>
</select>
<select id="filterGroupInvSub" parameterType="com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest"
resultType="com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity">
select inv_warehouse_sub.* from inv_warehouse_sub INNER JOIN inv_warehouse
on inv_warehouse_sub.parentId = inv_warehouse.code
INNER JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.code
<where>
<if test="userId != '' and userId != null">
AND inv_warehouse_user.userId = #{userId}
</if>
<if test="pcode != '' and pcode != null">
AND inv_warehouse.code = #{pcode}
</if>
</where>
group by inv_warehouse_sub.id
</select>
<select id="selectMaxCode" parameterType="com.glxp.api.admin.req.inventory.FilterInvSubWarehouseRequest"
resultType="com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity">
select max(code) as code from inv_warehouse_sub
<where>
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="name != '' and name != null">
AND name = #{name}
</if>
<if test="parentId != '' and parentId != null">
AND parentId = #{parentId}
</if>
</where>
</select>
<insert id="insertInvSubWarehouse" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity">
replace
INTO inv_warehouse_sub
(id, code, `name`, parentId, remark,defaultInv)
values (
#{id},
#{code},
#{name},
#{parentId},
#{remark},
#{defaultInv}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM inv_warehouse_sub
WHERE id = #{id}
</delete>
<update id="updateInvSubWarehouse" parameterType="com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity">
UPDATE inv_warehouse_sub
<trim prefix="set" suffixOverrides=",">
<if test="name != null">name=#{name},</if>
<if test="code != null">code=#{code},</if>
<if test="parentId != null">parentId=#{parentId},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="defaultInv != null">defaultInv=#{defaultInv},</if>
</trim>
WHERE id = #{id}
</update>
<insert id="importInvSubWarehouse" parameterType="java.util.List">
replace into inv_warehouse_sub
(id, code, `name`, parentId, remark,defaultInv)
values
<foreach collection="invWarehouseEntities" item="item" index="index" separator=",">
(
#{item.id},
#{item.code},
#{item.name},
#{item.parentId},
#{item.remark},#{item.defaultInv})
</foreach>
</insert>
</mapper>

@ -45,8 +45,9 @@
<select id="filterAllByUser" parameterType="com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest"
resultType="com.glxp.api.admin.entity.inventory.InvWarehouseEntity">
select inv_warehouse.* from inv_warehouse INNER JOIN inv_warehouse_user
on inv_warehouse.`code` =inv_warehouse_user.code
select inv_warehouse.* from inv_warehouse INNER JOIN inv_warehouse_sub
on inv_warehouse.`code` =inv_warehouse_sub.parentId
INNER JOIN inv_warehouse_user on inv_warehouse_user.`code` = inv_warehouse_sub.code
<where>
<if test="id != '' and id != null">
AND id = #{id}
@ -171,14 +172,12 @@
from inv_warehouse
where code = #{fromCorpId}
</select>
<insert id="insertInvWarehouse" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvWarehouseEntity">
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},

Loading…
Cancel
Save