|
|
@ -7,6 +7,8 @@ import com.gaotao.common.exception.XJException; |
|
|
import com.gaotao.common.utils.DateUtils; |
|
|
import com.gaotao.common.utils.DateUtils; |
|
|
import com.gaotao.common.utils.ErrorLogUtils; |
|
|
import com.gaotao.common.utils.ErrorLogUtils; |
|
|
import com.gaotao.common.utils.HttpUtils; |
|
|
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.entity.HandlingUnit; |
|
|
import com.gaotao.modules.handlingunit.service.HandlingUnitIdGeneratorService; |
|
|
import com.gaotao.modules.handlingunit.service.HandlingUnitIdGeneratorService; |
|
|
import com.gaotao.modules.handlingunit.service.HandlingUnitService; |
|
|
import com.gaotao.modules.handlingunit.service.HandlingUnitService; |
|
|
@ -56,6 +58,9 @@ public class SalesReturnServiceImpl implements SalesReturnService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private TransNoControlService transNoService; |
|
|
private TransNoControlService transNoService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IfsApiIssueAndReturnService ifsApiIssueAndReturnService; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private HandlingUnitService handlingUnitService; |
|
|
private HandlingUnitService handlingUnitService; |
|
|
|
|
|
|
|
|
@ -158,6 +163,17 @@ public class SalesReturnServiceImpl implements SalesReturnService { |
|
|
List<String> unitIds = new ArrayList<>(); |
|
|
List<String> unitIds = new ArrayList<>(); |
|
|
|
|
|
|
|
|
try { |
|
|
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(); |
|
|
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
// 1. 生成事务号 |
|
|
// 1. 生成事务号 |
|
|
TransNoControl transTrans = transNoService.getTransNo(dto.getSite(), "SRI", 10); |
|
|
TransNoControl transTrans = transNoService.getTransNo(dto.getSite(), "SRI", 10); |
|
|
|