Browse Source

如果用户没有选择过期日期,则为当前时间+料号的默认保质期(如果有的话)设置过期日期

master
han\hanst 3 weeks ago
parent
commit
16711d6bba
  1. 4
      src/main/java/com/gaotao/modules/production/service/impl/ProductionInboundServiceImpl.java
  2. 16
      src/main/java/com/gaotao/modules/salesreturn/service/impl/SalesReturnServiceImpl.java

4
src/main/java/com/gaotao/modules/production/service/impl/ProductionInboundServiceImpl.java

@ -571,8 +571,8 @@ public class ProductionInboundServiceImpl implements ProductionInboundService {
log.info("工单号: {}, 料号: {}, 入库数量: {}", dto.getOrderNo(), dto.getPartNo(), dto.getTransQty());
if (dto.getIfsExpiryDate() == null) {
List<InventoryPartVo> parts = ifsApiIssueAndReturnService.getInventoryPart(dto.getPartNo(),dto.getSite());
// 如果用户没有选择过期日期分切物料尝试从IFS获取过期日期成品物料直接设置为当前时间+365天
if (!parts.isEmpty()) {
// 如果用户没有选择过期日期为当前时间+料号的默认保质期如果有的话设置过期日期
if (!parts.isEmpty() && parts.getFirst().getDurabilityDays() > 0) {
// 当前时间+365天作为过期日期
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());

16
src/main/java/com/gaotao/modules/salesreturn/service/impl/SalesReturnServiceImpl.java

@ -7,6 +7,8 @@ import com.gaotao.common.exception.XJException;
import com.gaotao.common.utils.DateUtils;
import com.gaotao.common.utils.ErrorLogUtils;
import com.gaotao.common.utils.HttpUtils;
import com.gaotao.modules.api.entity.issueAndReturnVo.InventoryPartVo;
import com.gaotao.modules.api.service.IfsApiIssueAndReturnService;
import com.gaotao.modules.handlingunit.entity.HandlingUnit;
import com.gaotao.modules.handlingunit.service.HandlingUnitIdGeneratorService;
import com.gaotao.modules.handlingunit.service.HandlingUnitService;
@ -56,6 +58,9 @@ public class SalesReturnServiceImpl implements SalesReturnService {
@Autowired
private TransNoControlService transNoService;
@Autowired
private IfsApiIssueAndReturnService ifsApiIssueAndReturnService;
@Autowired
private HandlingUnitService handlingUnitService;
@ -158,6 +163,17 @@ public class SalesReturnServiceImpl implements SalesReturnService {
List<String> unitIds = new ArrayList<>();
try {
if (dto.getExpiryDate() == null) {
List<InventoryPartVo> parts = ifsApiIssueAndReturnService.getInventoryPart(dto.getPartNo(),dto.getSite());
// 如果用户没有选择过期日期则为当前时间+料号的默认保质期如果有的话设置过期日期
if (!parts.isEmpty() && parts.getFirst().getDurabilityDays() > 0) {
// 当前时间+365天作为过期日期
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DAY_OF_YEAR, parts.getFirst().getDurabilityDays());
dto.setExpiryDate(calendar.getTime());
}
}
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
// 1. 生成事务号
TransNoControl transTrans = transNoService.getTransNo(dto.getSite(), "SRI", 10);

Loading…
Cancel
Save