|
|
|
@ -47,6 +47,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
import com.gaotao.modules.sys.entity.SysUserEntity; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
@ -185,7 +186,9 @@ public class ProductionReturnServiceImpl implements ProductionReturnService { |
|
|
|
if (!validateWorkOrderStatus(returnDto.getWorkOrderNo(), returnDto.getSite())) { |
|
|
|
throw new XJException("工单状态不允许发料"); |
|
|
|
} |
|
|
|
validateLocal(returnDto.getSelectedMaterials(),returnDto.getSite()); |
|
|
|
String loginSite = returnDto.getLoginSite(); |
|
|
|
Assert.hasText(loginSite, "缺少 PDA 登录工厂,请重新登录后再试"); |
|
|
|
validateLocal(returnDto.getSelectedMaterials(), loginSite); |
|
|
|
List<WorkOrderMaterialDto> newSelectMaterials = new ArrayList<>(); |
|
|
|
//如果时NEW的HU,改变他的unit |
|
|
|
for(WorkOrderMaterialDto material : returnDto.getSelectedMaterials()){ |
|
|
|
@ -212,7 +215,7 @@ public class ProductionReturnServiceImpl implements ProductionReturnService { |
|
|
|
huRequest.setOrderNo(returnDto.getWorkOrderNo()); |
|
|
|
huRequest.setUmid(returnDto.getUmId()); |
|
|
|
huRequest.setEngChgLevel(material.getEngChgLevel()); |
|
|
|
String unitId = createNewReturnHandlingUnits(huRequest); |
|
|
|
String unitId = createNewReturnHandlingUnits(huRequest, loginSite); |
|
|
|
material.setLabelCode(unitId); |
|
|
|
newSelectMaterials.add(material); |
|
|
|
}else{ |
|
|
|
@ -239,7 +242,7 @@ public class ProductionReturnServiceImpl implements ProductionReturnService { |
|
|
|
transCommonRequestDto.setSourceNo(returnDto.getWorkOrderNo()); |
|
|
|
|
|
|
|
Double seqNo = 1.0; |
|
|
|
List<Location> allLocation = productionReturnMapper.getAllLocation(returnDto.getSite()); |
|
|
|
List<Location> allLocation = productionReturnMapper.getAllLocation(loginSite); |
|
|
|
Map<String, String> locationWarehouseMap = allLocation.stream() |
|
|
|
.filter(loc -> loc != null |
|
|
|
&& loc.getLocationId() != null |
|
|
|
@ -596,9 +599,12 @@ public class ProductionReturnServiceImpl implements ProductionReturnService { |
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
public String createNewReturnHandlingUnits(CreateHuRequestReturnIssueDto request) throws Exception{ |
|
|
|
public String createNewReturnHandlingUnits(CreateHuRequestReturnIssueDto request) throws Exception { |
|
|
|
return createNewReturnHandlingUnits(request, request.getSite()); |
|
|
|
} |
|
|
|
|
|
|
|
Location location = productionReturnMapper.getLocation(request.getLocationId(), request.getSite()); |
|
|
|
private String createNewReturnHandlingUnits(CreateHuRequestReturnIssueDto request, String locationSite) throws Exception { |
|
|
|
Location location = productionReturnMapper.getLocation(request.getLocationId(), locationSite); |
|
|
|
if(location == null){ |
|
|
|
throw new Exception("库位不存在,请确认"); |
|
|
|
} |
|
|
|
|