|
@@ -81,9 +81,11 @@ public class ApsServiceImpl implements ApsService {
|
|
|
* @param apsType cd:插单
|
|
|
*/
|
|
|
@Override
|
|
|
- public void apsSchedule(List<ApsBlankOrderVo> apsBlankOrders,String apsType) {
|
|
|
+ public void apsSchedule(List<ApsBlankOrderVo> apsBlankOrders,String apsType,SysUserVo currentUser) {
|
|
|
// 当前等路人所属工厂
|
|
|
- SysUserVo currentUser = CXCommonUtils.getCurrentUser();
|
|
|
+ if(currentUser == null){
|
|
|
+ currentUser = CXCommonUtils.getCurrentUser();
|
|
|
+ }
|
|
|
String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
|
|
|
if (StringUtils.isBlank(tenantId)) {
|
|
|
throw new CustomException("所属工厂不能为空");
|
|
@@ -451,9 +453,13 @@ public class ApsServiceImpl implements ApsService {
|
|
|
if(alloystatus1 == null || alloystatus2 == null || alloystatus1.compareTo(alloystatus2) == 0){
|
|
|
// 重量
|
|
|
if(singlerollweight1.compareTo(singlerollweight2) == 0){
|
|
|
-// a = 0;
|
|
|
- // 卷数从大到小
|
|
|
- a = v2.getRollnum().compareTo(v1.getRollnum());
|
|
|
+ // 按照订单排序
|
|
|
+ if(v1.getProductionorderid().compareTo(v2.getProductionorderid()) == 0){
|
|
|
+ // 卷数从大到小
|
|
|
+ a = v2.getRollnum().compareTo(v1.getRollnum());
|
|
|
+ }else{
|
|
|
+ a = v1.getProductionorderid().compareTo(v2.getProductionorderid());
|
|
|
+ }
|
|
|
}else if(singlerollweight1.compareTo(singlerollweight2) > 0){
|
|
|
a = -1;
|
|
|
}else{
|