Browse Source

修改Bug。

master
刘忱 2 years ago
parent
commit
cc1943045b
  1. 14
      win-module-system/win-module-system-biz/src/main/java/com/win/module/system/service/permission/PermissionServiceImpl.java
  2. 11
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inspectRequest/vo/InspectRequestMainBaseVO.java
  3. 16
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRequest/vo/PutawayRequestMainBaseVO.java
  4. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentsetting/DocumentsettingServiceImpl.java
  5. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestMainServiceImpl.java
  6. 7
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchase/PurchaseMainServiceImpl.java
  7. 49
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptJob/PurchasereceiptJobMainServiceImpl.java
  8. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchasereceiptRecordMainServiceImpl.java
  9. 10
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestMainServiceImpl.java
  10. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/requestsetting/RequestsettingServiceImpl.java
  11. 120
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/util/JobUtils.java

14
win-module-system/win-module-system-biz/src/main/java/com/win/module/system/service/permission/PermissionServiceImpl.java

@ -4,6 +4,9 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Suppliers;
import com.google.common.collect.Sets;
import com.win.framework.common.enums.CommonStatusEnum;
import com.win.framework.common.util.collection.CollectionUtils;
import com.win.framework.datapermission.core.annotation.DataPermission;
@ -18,10 +21,6 @@ import com.win.module.system.dal.redis.RedisKeyConstants;
import com.win.module.system.enums.permission.DataScopeEnum;
import com.win.module.system.service.dept.DeptService;
import com.win.module.system.service.user.AdminUserService;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Suppliers;
import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
@ -131,9 +130,8 @@ public class PermissionServiceImpl implements PermissionService {
// ========== 角色-菜单的相关方法 ==========
@Override
@DSTransactional // 多数据源,使用 @DSTransactional 保证本地事务,以及数据源的切换
@CacheEvict(value = RedisKeyConstants.MENU_ROLE_ID_LIST,
allEntries = true) // allEntries 清空所有缓存,主要一次更新涉及到的 menuIds 较多,反倒批量会更快
@Transactional
@CacheEvict(value = RedisKeyConstants.MENU_ROLE_ID_LIST, allEntries = true) // allEntries 清空所有缓存,主要一次更新涉及到的 menuIds 较多,反倒批量会更快
public void assignRoleMenu(Long roleId, Set<Long> menuIds) {
// 获得角色拥有菜单编号
Set<Long> dbMenuIds = convertSet(roleMenuMapper.selectListByRoleId(roleId), RoleMenuDO::getMenuId);
@ -198,7 +196,7 @@ public class PermissionServiceImpl implements PermissionService {
// ========== 用户-角色的相关方法 ==========
@Override
@DSTransactional // 多数据源,使用 @DSTransactional 保证本地事务,以及数据源的切换
@Transactional
@CacheEvict(value = RedisKeyConstants.USER_ROLE_ID_LIST, key = "#userId")
public void assignUserRole(Long userId, Set<Long> roleIds) {
// 获得角色拥有角色编号

11
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/inspectRequest/vo/InspectRequestMainBaseVO.java

@ -35,7 +35,6 @@ public class InspectRequestMainBaseVO {
private String number;
@Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "业务类型不能为空")
private String businessType;
@Schema(description = "从仓库代码", requiredMode = Schema.RequiredMode.REQUIRED)
@ -46,14 +45,12 @@ public class InspectRequestMainBaseVO {
private String fromAreaCodes;
@Schema(description = "从库位类型范围", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "从库位类型范围不能为空")
private String fromLocationTypes;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "创建时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTime;
@ -69,7 +66,6 @@ public class InspectRequestMainBaseVO {
private LocalDateTime dueTime;
@Schema(description = "部门", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "部门不能为空")
private String departmentCode;
@Schema(description = "状态")
@ -98,14 +94,12 @@ public class InspectRequestMainBaseVO {
private String itemCode;
@Schema(description = "检验类型", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "检验类型不能为空")
private String inspectType;
@Schema(description = "下一步检验动作")
private String nextAction;
@Schema(description = "抽检方式", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "抽检方式不能为空")
private String sampleMethod;
@Schema(description = "计量单位")
@ -116,26 +110,21 @@ public class InspectRequestMainBaseVO {
private BigDecimal receiveQty;
@Schema(description = "样品数量", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "样品数量不能为空")
private BigDecimal sampleQty;
@Schema(description = "货主代码")
private String ownerCode;
@Schema(description = "自动提交", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "自动提交不能为空")
private String autoCommit;
@Schema(description = "自动通过", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "自动通过不能为空")
private String autoAgree;
@Schema(description = "自动执行", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "自动执行不能为空")
private String autoExecute;
@Schema(description = "直接生成记录", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "直接生成记录不能为空")
private String directCreateRecord;
}

16
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/putawayRequest/vo/PutawayRequestMainBaseVO.java

@ -2,15 +2,12 @@ package com.win.module.wms.controller.putawayRequest.vo;
import com.win.framework.excel.core.annotations.OnlyOne;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
@ -23,7 +20,6 @@ public class PutawayRequestMainBaseVO {
@Schema(description = "id", example = "id")
private Long id;
@Schema(description = "供应商代码")
private String supplierCode;
@ -88,19 +84,15 @@ public class PutawayRequestMainBaseVO {
private String toAreaCodes;
@Schema(description = "自动提交", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "自动提交不能为空")
private String autoCommit;
@Schema(description = "自动通过", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "自动通过不能为空")
private String autoAgree;
@Schema(description = "自动执行", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "自动执行不能为空")
private String autoExecute;
@Schema(description = "直接生成记录", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "直接生成记录不能为空")
private String directCreateRecord;
}

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentsetting/DocumentsettingServiceImpl.java

@ -287,7 +287,7 @@ public class DocumentsettingServiceImpl implements DocumentsettingService {
}
@Override
public DocumentsettingDO selectDocumentsettingExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
QueryWrapper<DocumentsettingDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code",pcode);
DocumentsettingDO documentsettingDO = documentsettingMapper.selectOne(queryWrapper);
if(documentsettingDO != null && "TRUE".equals(documentsettingDO.getAvailable())){

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/inspectRequest/InspectRequestMainServiceImpl.java

@ -467,12 +467,11 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService
if (inspect == null) {
throw new UtilException("未找到该策略");
}
JSONArray condition = JSONUtil.parseArray(inspect.getCondition());
JSONObject configuration = JSONUtil.parseObj(inspect.getConfiguration());
HashMap<String, String> mapRule = new HashMap<>();
for (Object o : condition) {
JSONObject entries = JSONUtil.parseObj(o);
mapRule.put(entries.get("ParamCode").toString(), entries.get("Value").toString());
}
mapRule.put("InspectType", configuration.get("InspectType").toString());
mapRule.put("SampleMethod", configuration.get("SampleMethod").toString());
mapRule.put("AqList", configuration.get("AqList").toString());
String aqlList = mapRule.get("AqlList");
if (aqlList != null) {
JSONArray objects = JSONUtil.parseArray(aqlList);

7
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchase/PurchaseMainServiceImpl.java

@ -191,9 +191,8 @@ public class PurchaseMainServiceImpl implements PurchaseMainService {
if (purchaseMainDO != null && "TRUE".equals(purchaseMainDO.getAvailable())) {
if (!"CLOSED".equals(purchaseMainDO.getStatus())) {
QueryWrapper<PurchaseDetailDO> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("master_id", purchaseMainDO.getId());
queryWrapper1.eq("number", pnumber);
queryWrapper1.eq("po_line", poLine);
queryWrapper1.eq("line_number", poLine);
queryWrapper1.eq("item_code", pitemCode);
PurchaseDetailDO purchaseDetailDO = purchaseDetailMapper.selectOne(queryWrapper1);
if (purchaseDetailDO != null && "TRUE".equals(purchaseDetailDO.getAvailable())) {
@ -626,8 +625,8 @@ public class PurchaseMainServiceImpl implements PurchaseMainService {
for (PurchaseMainDO purchaseMainDO : purchaseMainDOList) {
QueryWrapper<PurchaseDetailDO> purchaseDetailDOQueryWrapper = new QueryWrapper<>();
purchaseDetailDOQueryWrapper.eq("number", poNumber);
purchaseDetailDOQueryWrapper.eq("line_number", poNumber);
purchaseDetailDOQueryWrapper.eq("item_code", poNumber);
purchaseDetailDOQueryWrapper.eq("line_number", poLine);
purchaseDetailDOQueryWrapper.eq("item_code", itemCode);
purchaseDetailDOQueryWrapper.eq("available", "TRUE");
List<PurchaseDetailDO> purchaseDetailDOList = purchaseDetailMapper.selectList(purchaseDetailDOQueryWrapper);
boolean res = false;

49
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptJob/PurchasereceiptJobMainServiceImpl.java

@ -18,6 +18,8 @@ import com.win.module.wms.controller.purchasereceiptJob.vo.PurchasereceiptJobDet
import com.win.module.wms.controller.purchasereceiptJob.vo.PurchasereceiptJobMainExportReqVO;
import com.win.module.wms.controller.purchasereceiptJob.vo.PurchasereceiptJobMainPageReqVO;
import com.win.module.wms.controller.purchasereceiptJob.vo.PurchasereceiptJobMainUpdateReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestDetailCreateReqVO;
import com.win.module.wms.controller.putawayRequest.vo.PutawayRequestMainCreateReqVO;
import com.win.module.wms.controller.rule.vo.RuleRespVO;
import com.win.module.wms.controller.transaction.vo.TransactionCreateReqVO;
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO;
@ -47,6 +49,8 @@ import com.win.module.wms.service.inspectRequest.InspectRequestMainService;
import com.win.module.wms.service.location.LocationService;
import com.win.module.wms.service.purchase.PurchaseDetailService;
import com.win.module.wms.service.purchase.PurchaseMainService;
import com.win.module.wms.service.putawayRequest.PutawayRequestMainService;
import com.win.module.wms.service.requestsetting.RequestsettingService;
import com.win.module.wms.service.rule.RuleService;
import com.win.module.wms.service.supplierdeliverRecord.SupplierdeliverRecordMainService;
import com.win.module.wms.service.transaction.TransactionService;
@ -57,6 +61,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
@ -113,6 +118,10 @@ public class PurchasereceiptJobMainServiceImpl implements PurchasereceiptJobMain
private LocationService locationService;
@Resource
private PurchaseDetailService purchaseDetailService;
@Resource
private PutawayRequestMainService putawayRequestMainService;
@Resource
private RequestsettingService requestsettingService;
@Override
public PageResult<PurchasereceiptJobMainDO> getPurchasereceiptJobMainSenior(CustomConditions conditions) {
@ -408,7 +417,8 @@ public class PurchasereceiptJobMainServiceImpl implements PurchasereceiptJobMain
inspectRequestMainCreateReqVO.setPoNumber(recordDetailDO.getPoNumber());
inspectRequestMainCreateReqVO.setPoLine(recordDetailDO.getPoLine());
inspectRequestMainCreateReqVO.setUom(recordDetailDO.getUom());
inspectRequestMainCreateReqVO.setReceiveQty(recordDetailDO.getQty());
inspectRequestMainCreateReqVO.setReceiveQty(BigDecimal.ZERO);
inspectRequestMainCreateReqVO.setFromWarehouseCode(purchasereceiptRecordMainDO.getToWarehouseCode());
//创建子表信息
for(PurchasereceiptRecordDetailDO purchasereceiptRecordDetailDO : purchasereceiptRecordDetailDOList1) {
InspectRequestDetailCreateReqVO inspectRequestDetailCreateReqVO = new InspectRequestDetailCreateReqVO();
@ -429,15 +439,42 @@ public class PurchasereceiptJobMainServiceImpl implements PurchasereceiptJobMain
inspectRequestDetailCreateReqVOList.add(inspectRequestDetailCreateReqVO);
}
inspectRequestMainCreateReqVO.setSubList(inspectRequestDetailCreateReqVOList);
//创建检验申请
inspectRequestMainService.createInspectRequestMain(inspectRequestMainCreateReqVO);
}
}
//采购收货记录 生成后免检物品 创建 上架申请
if(switchDO2.getEffectiveSetValue().equals("TRUE") && "EXAMPT".equals(String.valueOf(jsonObject.get("InspectType")))) {
InspectRequestMainCreateReqVO inspectRequestMainCreateReqVO = new InspectRequestMainCreateReqVO();
BeanUtils.copyProperties(purchasereceiptRecordMainDO, inspectRequestMainCreateReqVO);
inspectRequestMainCreateReqVO.setId(null);
inspectRequestMainCreateReqVO.setSubList(inspectRequestDetailCreateReqVOList);
inspectRequestMainService.createInspectRequestMain(inspectRequestMainCreateReqVO);
PutawayRequestMainCreateReqVO putawayRequestMainCreateReqVO = new PutawayRequestMainCreateReqVO();
BeanUtils.copyProperties(purchasereceiptRecordMainDO, putawayRequestMainCreateReqVO);
List<PutawayRequestDetailCreateReqVO> putawayRequestDetailCreateReqVOList = new ArrayList<>();
for(PurchasereceiptRecordDetailDO purchasereceiptRecordDetailDO : purchasereceiptRecordDetailDOList) {
PutawayRequestDetailCreateReqVO putawayRequestDetailCreateReqVO = new PutawayRequestDetailCreateReqVO();
BeanUtils.copyProperties(purchasereceiptRecordDetailDO, putawayRequestDetailCreateReqVO);
putawayRequestDetailCreateReqVO.setPackingNumber(purchasereceiptRecordDetailDO.getToPackingNumber());
putawayRequestDetailCreateReqVO.setContainerNumber(purchasereceiptRecordDetailDO.getToContainerNumber());
putawayRequestDetailCreateReqVO.setBatch(purchasereceiptRecordDetailDO.getToBatch());
putawayRequestDetailCreateReqVO.setFromLocationCode(purchasereceiptRecordDetailDO.getToLocationCode());
putawayRequestDetailCreateReqVO.setInventoryStatus("OK");
putawayRequestDetailCreateReqVO.setId(null);
putawayRequestDetailCreateReqVO.setCreateTime(null);
putawayRequestDetailCreateReqVO.setCreator(null);
putawayRequestDetailCreateReqVO.setUpdateTime(null);
putawayRequestDetailCreateReqVO.setUpdater(null);
putawayRequestDetailCreateReqVOList.add(putawayRequestDetailCreateReqVO);
}
putawayRequestMainCreateReqVO.setId(null);
putawayRequestMainCreateReqVO.setCreateTime(null);
putawayRequestMainCreateReqVO.setCreator(null);
putawayRequestMainCreateReqVO.setUpdateTime(null);
putawayRequestMainCreateReqVO.setUpdater(null);
putawayRequestMainCreateReqVO.setSubList(putawayRequestDetailCreateReqVOList);
putawayRequestMainService.createPutawayRequestMain(putawayRequestMainCreateReqVO);
}
if("EXAMPT".equals(String.valueOf(jsonObject.get("InspectType")))) {
for(TransactionCreateReqVO transactionCreateReqVO : transactionCreateReqVOList) {
transactionCreateReqVO.setInventoryStatus("OK");
}
}
//增加库存事务
transactionService.createTransaction(transactionCreateReqVOList);

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchasereceiptRecordMainServiceImpl.java

@ -55,7 +55,9 @@ public class PurchasereceiptRecordMainServiceImpl implements PurchasereceiptReco
public PurchasereceiptRecordDetailDO selectPurchasereceiptExist(String ppoNumber,String psupplierCode,String pNumber,String ppoLine,String pitemCode){
QueryWrapper<PurchasereceiptRecordMainDO> queryWrapperMain = new QueryWrapper<>();
queryWrapperMain.eq("number",pNumber);
queryWrapperMain.eq("supplier_code",psupplierCode);
if(psupplierCode != null && !psupplierCode.isEmpty()) {
queryWrapperMain.eq("supplier_code", psupplierCode);
}
queryWrapperMain.eq("available","TRUE");
PurchasereceiptRecordMainDO purchasereceiptRecordMainDO = purchasereceiptRecordMainMapper.selectOne(queryWrapperMain);
if(purchasereceiptRecordMainDO != null) {

10
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/putawayRequest/PutawayRequestMainServiceImpl.java

@ -109,12 +109,12 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
@Override
@Transactional
public Long createPutawayRequestMain(PutawayRequestMainCreateReqVO createReqVO) {
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("PutawayRequest");
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("PutawayRequest");
RequestsettingDO requestsettingDO = requestsettingService.selectRequestsettingExist("PurchasePutawayRequest");
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("PurchasePutawayRequest");
PutawayRequestMainDO putawayRequestMainDO = validatorToCreate(createReqVO, businesstypeDO, requestsettingDO);
//调用自动执行方法
if (RequestStatusEnum.HANDLING.getCode().equals(putawayRequestMainDO.getStatus())) {
this.generateJob(putawayRequestMainDO, putawayRequestDetailMapper.selectList(putawayRequestMainDO.getId()));
}
trendsApi.createTrends(requestsettingDO.getId(), "PutawayRequest", "增加了上架申请", TrendsTypeEnum.CREATE);
return putawayRequestMainDO.getId();
@ -413,7 +413,7 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
validatorIfOutInventoryStatuses(detailDo.getInventoryStatus(), businesstypeDO);
validatorIfInToLocationType(detailDo.getFromLocationCode(), businesstypeDO);
ArrayList<String> inventoryStatus = new ArrayList<>();
inventoryStatus.set(0, detailDo.getInventoryStatus());
inventoryStatus.add(detailDo.getInventoryStatus());
validatorManagementAccuracy(detailDo.getItemCode(), detailDo.getPackingNumber(), detailDo.getBatch(), detailDo.getFromLocationCode(), inventoryStatus);
}
@ -538,7 +538,7 @@ public class PutawayRequestMainServiceImpl implements PutawayRequestMainService
}
private void validatorIfInToLocationType(String fromLocationCode, BusinesstypeDO businesstypeDO) {
jobUtils.ifInType(fromLocationCode, businesstypeDO);
jobUtils.ifInFromLocationType(fromLocationCode, businesstypeDO);
}
private void validatorManagementAccuracy(String itemCode, String packingNumber, String batch, String fromLocationCode, List<String> inventoryStatus) {

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/requestsetting/RequestsettingServiceImpl.java

@ -244,7 +244,7 @@ public class RequestsettingServiceImpl implements RequestsettingService {
}
@Override
public RequestsettingDO selectRequestsettingExist(String pcode){
QueryWrapper<RequestsettingDO> queryWrapper = new QueryWrapper();
QueryWrapper<RequestsettingDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code",pcode);
queryWrapper.eq("available","TRUE");
RequestsettingDO requestsettingDO = requestsettingMapper.selectOne(queryWrapper);

120
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/util/JobUtils.java

@ -2,7 +2,6 @@ package com.win.module.wms.util;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.win.module.wms.controller.rule.vo.RuleRespVO;
import com.win.module.wms.dal.dataobject.balance.BalanceDO;
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO;
@ -130,13 +129,13 @@ public class JobUtils {
if ("TRUE".equals(allowBiggerQty)) {
result = true;
} else {
throw exception(QTY_EXCEPTION,"实际数量" + handleQty + " 不允许大于推荐数量" + recommendQty);
throw exception(QTY_EXCEPTION, "实际数量" + handleQty + " 不允许大于推荐数量" + recommendQty);
}
} else if (handleQty.compareTo(recommendQty) == -1) {
if ("TRUE".equals(allowSmallerQty)) {
result = true;
} else {
throw exception(QTY_EXCEPTION,"实际数量" + handleQty + " 不允许小于推荐数量" + recommendQty);
throw exception(QTY_EXCEPTION, "实际数量" + handleQty + " 不允许小于推荐数量" + recommendQty);
}
} else if (handleQty.compareTo(recommendQty) == 0) {
result = true;
@ -157,13 +156,13 @@ public class JobUtils {
if ("TRUE".equals(allowModifyBatch)) {
result = true;
} else {
throw exception(QTY_EXCEPTION,"实际数量" + jobDetailBatch + " 不允许大于推荐数量" + recordDetailBatch);
throw exception(QTY_EXCEPTION, "实际数量" + jobDetailBatch + " 不允许大于推荐数量" + recordDetailBatch);
}
} else if (jobDetailBatch.compareTo(recordDetailBatch) == -1) {
if ("TRUE".equals(allowModifyBatch)) {
result = true;
} else {
throw exception(QTY_EXCEPTION,"实际数量" + jobDetailBatch + " 不允许小于推荐数量" + recordDetailBatch);
throw exception(QTY_EXCEPTION, "实际数量" + jobDetailBatch + " 不允许小于推荐数量" + recordDetailBatch);
}
}
if (jobDetailBatch.compareTo(recordDetailBatch) == 0) {
@ -172,7 +171,7 @@ public class JobUtils {
if ("TRUE".equals(allowModifyBatch)) {
result = true;
} else {
throw exception(BATCH_EXCEPTION,"实际批次" + jobDetailBatch + " 与任务推荐批次" + recordDetailBatch + "不一致");
throw exception(BATCH_EXCEPTION, "实际批次" + jobDetailBatch + " 与任务推荐批次" + recordDetailBatch + "不一致");
}
}
return result;
@ -288,8 +287,8 @@ public class JobUtils {
if (ifInType) {
return true;
} else {
throw exception(ITEMBASIC_EXCEPTION,"物料类型" + pitemCode + "的类型" + itembasicDO.getType() + " 与业务类型" + businesstypeDO.getName()
+ "的物料类型" + businesstypeDO.getItemTypes() +"不一致");
throw exception(ITEMBASIC_EXCEPTION, "物料类型" + pitemCode + "的类型" + itembasicDO.getType() + " 与业务类型" + businesstypeDO.getName()
+ "的物料类型" + businesstypeDO.getItemTypes() + "不一致");
}
}
@ -306,9 +305,10 @@ public class JobUtils {
if (ifInType) {
return true;
} else {
throw exception(ITEMBASIC_EXCEPTION,"物料类型" + pitemType + " 与业务类型" + businesstypeDO.getName() + "的物料类型" + businesstypeDO.getItemTypes() +"不一致");
throw exception(ITEMBASIC_EXCEPTION, "物料类型" + pitemType + " 与业务类型" + businesstypeDO.getName() + "的物料类型" + businesstypeDO.getItemTypes() + "不一致");
}
}
//DBT---DBT2---IS 物料状态检验是否一致
public boolean ifInStatus(String pitemCode, BusinesstypeDO businesstypeDO) {
ItembasicDO itembasicDO = itembasicService.selectItembasic(pitemCode);
@ -320,13 +320,13 @@ public class JobUtils {
ifInStatus = true;
}
}
}else {
throw exception(ITEMBASIC_EXCEPTION,"物料代码" + pitemCode + "无效");
} else {
throw exception(ITEMBASIC_EXCEPTION, "物料代码" + pitemCode + "无效");
}
if (ifInStatus == true) {
if (ifInStatus) {
return true;
} else {
throw exception(ITEMBASIC_EXCEPTION,"物料" + pitemCode + "的状态" + itembasicDO.getStatus() + "与业务类型" +
throw exception(ITEMBASIC_EXCEPTION, "物料" + pitemCode + "的状态" + itembasicDO.getStatus() + "与业务类型" +
businesstypeDO.getName() + "的物料状态" + businesstypeDO.getItemStatuses() + "不一致");
}
}
@ -342,14 +342,13 @@ public class JobUtils {
ifInLocationType = true;
}
}
} else {
throw exception(LOCATION_EXCEPTION, "库位" + plocationCode + "无效");
}
else {
throw exception(LOCATION_EXCEPTION,"库位" + plocationCode + "无效");
}
if (ifInLocationType == true) {
if (ifInLocationType) {
return true;
} else {
throw exception(LOCATION_EXCEPTION,"入库库位" + plocationCode + "的库位类型" + locationDO.getType() + "与业务类型" +
throw exception(LOCATION_EXCEPTION, "入库库位" + plocationCode + "的库位类型" + locationDO.getType() + "与业务类型" +
businesstypeDO.getName() + "的入库库位类型" + businesstypeDO.getInLocationTypes() + "不一致");
}
}
@ -365,14 +364,13 @@ public class JobUtils {
ifOutLocationType = true;
}
}
} else {
throw exception(LOCATION_EXCEPTION, "库位" + plocationCode + "无效");
}
else {
throw exception(LOCATION_EXCEPTION,"库位" + plocationCode + "无效");
}
if (ifOutLocationType == true) {
if (ifOutLocationType) {
return true;
} else {
throw exception(LOCATION_EXCEPTION,"出库库位" + plocationCode + "的库位类型" + locationDO.getType() + "与业务类型与业务类型" +
throw exception(LOCATION_EXCEPTION, "出库库位" + plocationCode + "的库位类型" + locationDO.getType() + "与业务类型与业务类型" +
businesstypeDO.getName() + "的出库库位类型" + businesstypeDO.getOutLocationTypes() + "不一致");
}
}
@ -387,14 +385,13 @@ public class JobUtils {
ifInInventoryStatuses = true;
}
}
} else {
throw exception(WAREHOUSE_STOCK_EXCEPTION, "入库库存状态" + pinventoryStatus + "为空");
}
else {
throw exception(WAREHOUSE_STOCK_EXCEPTION,"入库库存状态" + pinventoryStatus + "为空");
}
if (ifInInventoryStatuses == true) {
if (ifInInventoryStatuses) {
return true;
} else {
throw exception(LOCATION_INVENTORY_EXCEPTION,"入库库存状态" + pinventoryStatus + "与业务类型" +
throw exception(LOCATION_INVENTORY_EXCEPTION, "入库库存状态" + pinventoryStatus + "与业务类型" +
businesstypeDO.getName() + "的入库库存状态" + businesstypeDO.getInInventoryStatuses() + "不一致");
}
}
@ -409,14 +406,13 @@ public class JobUtils {
ifOutInventoryStatuses = true;
}
}
} else {
throw exception(LOCATION_INVENTORY_EXCEPTION, "出库库存状态" + pinventoryStatus + "为空");
}
else {
throw exception(LOCATION_INVENTORY_EXCEPTION,"出库库存状态" + pinventoryStatus + "为空");
}
if (ifOutInventoryStatuses == true) {
if (ifOutInventoryStatuses) {
return true;
} else {
throw exception(LOCATION_INVENTORY_EXCEPTION,"出库库存状态" + pinventoryStatus + "与业务类型" +
throw exception(LOCATION_INVENTORY_EXCEPTION, "出库库存状态" + pinventoryStatus + "与业务类型" +
businesstypeDO.getName() + "的出库库存状态" + businesstypeDO.getOutInventoryStatuses() + "不一致");
}
}
@ -424,6 +420,7 @@ public class JobUtils {
/**
* TB------TB4
* 先获取管理模式再根据管理模式查询库存余额返回查询结果
*
* @param itemcode 零件号
* @param packingnumber 包装号
* @param batch 批次
@ -437,19 +434,21 @@ public class JobUtils {
List<BalanceDO> balanceDO = null;
if ("{\"ManagementPrecision\":\"BY_QUANTITY\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectNumber(itemcode, inventoryStatus, locationcode);
}else if ("{\"ManagementPrecision\":\"BY_BATCH\"}".equals(managementtRule.getConfiguration())) {
} else if ("{\"ManagementPrecision\":\"BY_BATCH\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectBatch(itemcode, batch, inventoryStatus, locationcode);
}else if("{\"ManagementPrecision\":\"BY_PACKAGING\"}".equals(managementtRule.getConfiguration())) {
} else if ("{\"ManagementPrecision\":\"BY_PACKAGING\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectPackaging(itemcode, packingnumber, batch, inventoryStatus, locationcode);
}else if("{\"ManagementPrecision\":\"BY_UNIQUE_ID\"}".equals(managementtRule.getConfiguration())) {
} else if ("{\"ManagementPrecision\":\"BY_UNIQUE_ID\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectUniqueId(packingnumber, locationcode, inventoryStatus);
}
return balanceDO;
}
/**
* TB-------TB1
* 查询库存返回管理精度
* 先获取管理模式再根据管理模式查询库存余额返回校验结果
*
* @param itemcode 零件号
* @param packingnumber 包装号
* @param batch 批次
@ -464,30 +463,30 @@ public class JobUtils {
List<BalanceDO> balanceDO = null;
if ("{\"ManagementPrecision\":\"BY_QUANTITY\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectNumber(itemcode, inventoryStatus, locationcode);
if(balanceDO == null){
if (balanceDO == null) {
throw exception(MANAGEMENTPRECISION_EXCEPTION, "物品代码" + itemcode + "库存状态" + inventoryStatus + "在" + locationcode + "库位中未查找到库存记录");
}else {
} else {
return balanceDO;
}
}else if ("{\"ManagementPrecision\":\"BY_BATCH\"}".equals(managementtRule.getConfiguration())) {
} else if ("{\"ManagementPrecision\":\"BY_BATCH\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectBatch(itemcode, batch, inventoryStatus, locationcode);
if(balanceDO == null){
if (balanceDO == null) {
throw exception(MANAGEMENTPRECISION_EXCEPTION, "物品代码" + itemcode + "批次" + batch + "库存状态" + inventoryStatus + "在" + locationcode + "库位中未查找到库存记录");
}else {
} else {
return balanceDO;
}
}else if("{\"ManagementPrecision\":\"BY_PACKAGING\"}".equals(managementtRule.getConfiguration())) {
} else if ("{\"ManagementPrecision\":\"BY_PACKAGING\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectPackaging(itemcode, packingnumber, batch, inventoryStatus, locationcode);
if(balanceDO == null){
throw exception(MANAGEMENTPRECISION_EXCEPTION,"物品代码" + itemcode + "箱码" + packingnumber + "批次" + batch + "库存状态" + inventoryStatus + "在" + locationcode + "库位中未查找到库存记录");
}else {
if (balanceDO == null) {
throw exception(MANAGEMENTPRECISION_EXCEPTION, "物品代码" + itemcode + "箱码" + packingnumber + "批次" + batch + "库存状态" + inventoryStatus + "在" + locationcode + "库位中未查找到库存记录");
} else {
return balanceDO;
}
}else if("{\"ManagementPrecision\":\"BY_UNIQUE_ID\"}".equals(managementtRule.getConfiguration())) {
} else if ("{\"ManagementPrecision\":\"BY_UNIQUE_ID\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectUniqueId(packingnumber, locationcode, inventoryStatus);
if(balanceDO == null){
if (balanceDO == null) {
throw exception(MANAGEMENTPRECISION_EXCEPTION, "唯一码" + packingnumber + "库存状态" + inventoryStatus + "在" + locationcode + "库位中未查找到库存记录");
}else {
} else {
return balanceDO;
}
}
@ -587,7 +586,7 @@ public class JobUtils {
if ("{\"ManagementPrecision\":\"BY_UNIQUE_ID\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectUniqueId(packingnumber, locationcode, inventoryStatus);
return balanceDO;
}else {
} else {
return null;
}
}
@ -600,7 +599,7 @@ public class JobUtils {
if (locationService.selectLocation(fromlocationcode) != null) {
return warehouseStockExist(itemcode, packingnumber, batch, fromlocationcode, inventoryStatus, requstqty);
} else {
throw exception(LOCATION_NOT_CUST,fromlocationcode);
throw exception(LOCATION_NOT_CUST, fromlocationcode);
}
}
@ -670,20 +669,20 @@ public class JobUtils {
* @return
*/
public List<BalanceDO> fromInventoryEffective(String itemCode, String packingNumber, String batch, String locationCode, List<String> inventoryStatus) {
List<BalanceDO> balanceDOList = selectlocationReturnManagementAccuracy(itemCode, packingNumber, batch, locationCode, inventoryStatus);
return balanceDOList;
return selectlocationReturnManagementAccuracy(itemCode, packingNumber, batch, locationCode, inventoryStatus);
}
/**
* DBT3
* 根据单据设置查询业务类型
* @author chenfang
*
* @param pcode
* @return
* @author chenfang
*/
public BusinesstypeDO selectDocumentSettingFromBusinessType(String pcode){
public BusinesstypeDO selectDocumentSettingFromBusinessType(String pcode) {
DocumentsettingDO documentsettingDO = documentsettingService.selectDocumentsettingExist(pcode);
if(documentsettingDO == null || documentsettingDO.getBusinessType() == null) {
if (documentsettingDO == null || documentsettingDO.getBusinessType() == null) {
return null;
}
return businesstypeService.selectBusinesstypeExist(documentsettingDO.getBusinessType());
@ -692,13 +691,14 @@ public class JobUtils {
/**
* DBT4
* 根据单据设置查询业务类型
* @author chenfang
*
* @param pcode
* @return
* @author chenfang
*/
public TransactiontypeDO selectDocumentFromTransactionType(String pcode){
public TransactiontypeDO selectDocumentFromTransactionType(String pcode) {
TransactiontypeDO transactionType = transactiontypeService.selectTransactiontype(pcode);
if(transactionType == null || transactionType.getCode() == null) {
if (transactionType == null || transactionType.getCode() == null) {
return null;
}
return transactionType;
@ -717,9 +717,9 @@ public class JobUtils {
*/
public Boolean fromInventoryEffectiveCustomer(String locationCode, String itemCode, String packingNumber, String batch, List<String> inventoryStatus) {
Boolean returnRes = false;
if (locationService.selectLocation(locationCode) != null) {
if (locationService.selectLocation(locationCode) != null) {
fromInventoryEffective(itemCode, packingNumber, batch, locationCode, inventoryStatus);
} else{
} else {
return returnRes;
}
return true;

Loading…
Cancel
Save