|
@@ -27,12 +27,12 @@ import com.zfire.jiasm.syncdata.service.RepairProduceDataUploadService;
|
|
|
import com.zfire.jiasm.syncdata.utils.*;
|
|
|
import com.zfire.jiasm.syncdata.utils.oss.OSSUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
@@ -314,37 +314,45 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
|
|
|
public void upOutId(OrderBase orderBase) {
|
|
|
List<OrderReAppointment> upList = new ArrayList<>();
|
|
|
|
|
|
+ List<OrderReAppointment> detaillisto = orderReAppointmentService.lambdaQuery()
|
|
|
+ .eq(OrderReAppointment::getOrderBaseId, orderBase.getId())
|
|
|
+ .eq(OrderReAppointment::getOutId, 0).list();
|
|
|
+ if (CollectionUtils.isEmpty(detaillisto)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
List<OrderReAppointment> detaillist = orderReAppointmentService.lambdaQuery()
|
|
|
.eq(OrderReAppointment::getOrderBaseId, orderBase.getId())
|
|
|
+ .ne(OrderReAppointment::getOutId, 0)
|
|
|
.orderByAsc(OrderReAppointment::getCreateTime).list();
|
|
|
|
|
|
int outId=0;
|
|
|
- if (detaillist!=null && detaillist.size()>0){
|
|
|
+ if (CollectionUtils.isNotEmpty(detaillist)){
|
|
|
// 找出最大的序 默认值为0
|
|
|
for (OrderReAppointment item:detaillist){
|
|
|
if (outId<item.getOutId()){
|
|
|
outId = item.getOutId();
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- for (OrderReAppointment ite:detaillist){
|
|
|
- if (ite.getOutId() == 0){
|
|
|
- outId++;
|
|
|
- OrderReAppointment n = new OrderReAppointment();
|
|
|
- n.setId(ite.getId());
|
|
|
- n.setOutId(outId);
|
|
|
- n.setUpdateTime(new Date());
|
|
|
- if (StringUtils.isNotEmpty(orderBase.getPgid())){
|
|
|
- n.setPgid(orderBase.getPgid());
|
|
|
- }
|
|
|
- upList.add(n);
|
|
|
+ for (OrderReAppointment ite:detaillist){
|
|
|
+ if (ite.getOutId() == 0){
|
|
|
+ outId++;
|
|
|
+ OrderReAppointment n = new OrderReAppointment();
|
|
|
+ n.setId(ite.getId());
|
|
|
+ n.setOutId(outId);
|
|
|
+ n.setUpdateTime(new Date());
|
|
|
+ if (StringUtils.isNotEmpty(orderBase.getPgid())){
|
|
|
+ n.setPgid(orderBase.getPgid());
|
|
|
}
|
|
|
+ upList.add(n);
|
|
|
}
|
|
|
- // 修改序
|
|
|
- if (upList.size()>0){
|
|
|
- orderReAppointmentService.updateBatchById(upList);
|
|
|
- upList.clear();
|
|
|
- }
|
|
|
+ }
|
|
|
+ // 修改序
|
|
|
+ if (upList.size()>0){
|
|
|
+ orderReAppointmentService.updateBatchById(upList);
|
|
|
+ upList.clear();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -493,21 +501,22 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
|
|
|
outId = item.getOutId();
|
|
|
}
|
|
|
}
|
|
|
- for (OrderProduct ite:ops){
|
|
|
- outId++;
|
|
|
- OrderProduct n = new OrderProduct();
|
|
|
- MyBeanUtils.copyProperties(ite,n);
|
|
|
- n.setOutId(outId);
|
|
|
- n.setUpdateTime(new Date());
|
|
|
- upList.add(n);
|
|
|
- }
|
|
|
- // 修改序
|
|
|
- if (upList.size()>0){
|
|
|
- orderProductService.updateBatchById(upList);
|
|
|
- upList.clear();
|
|
|
- }
|
|
|
- oplist.clear();
|
|
|
}
|
|
|
+
|
|
|
+ for (OrderProduct ite:ops){
|
|
|
+ outId++;
|
|
|
+ OrderProduct n = new OrderProduct();
|
|
|
+ MyBeanUtils.copyProperties(ite,n);
|
|
|
+ n.setOutId(outId);
|
|
|
+ n.setUpdateTime(new Date());
|
|
|
+ upList.add(n);
|
|
|
+ }
|
|
|
+ // 修改序
|
|
|
+ if (upList.size()>0){
|
|
|
+ orderProductService.updateBatchById(upList);
|
|
|
+ upList.clear();
|
|
|
+ }
|
|
|
+ oplist.clear();
|
|
|
}
|
|
|
|
|
|
public void getItfTblAssignMxUpload(Brand brand, OutJiasmToGreeUploadTaskList sourceData) {
|
|
@@ -1065,32 +1074,36 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
|
|
|
.eq(OrderDetailFile::getOrderBaseId, orderBaseId)
|
|
|
.eq(OrderDetailFile::getOutId, 0)
|
|
|
.list();
|
|
|
+ if (CollectionUtils.isEmpty(oids)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
List<OrderDetailFile> detaillist = orderDetailFileService.lambdaQuery()
|
|
|
.eq(OrderDetailFile::getOrderBaseId, orderBaseId)
|
|
|
.list();
|
|
|
// 找出最大的序 默认值为0
|
|
|
int outId=0;
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(detaillist) && org.apache.commons.collections4.CollectionUtils.isNotEmpty(oids)){
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(detaillist)){
|
|
|
for (OrderDetailFile item:detaillist){
|
|
|
if (outId<item.getOutId()){
|
|
|
outId = item.getOutId();
|
|
|
}
|
|
|
}
|
|
|
- for (OrderDetailFile ite:detaillist){
|
|
|
- if (ite.getOutId() == 0){
|
|
|
- outId++;
|
|
|
- ite.setOutId(outId);
|
|
|
- upList.add(ite);
|
|
|
- }
|
|
|
- }
|
|
|
- // 修改序
|
|
|
- if (upList.size()>0){
|
|
|
- orderDetailFileService.updateBatchById(upList);
|
|
|
- upList.clear();
|
|
|
+ }
|
|
|
+
|
|
|
+ for (OrderDetailFile ite:detaillist){
|
|
|
+ if (ite.getOutId() == 0){
|
|
|
+ outId++;
|
|
|
+ ite.setOutId(outId);
|
|
|
+ upList.add(ite);
|
|
|
}
|
|
|
- detaillist.clear();
|
|
|
}
|
|
|
+ // 修改序
|
|
|
+ if (upList.size()>0){
|
|
|
+ orderDetailFileService.updateBatchById(upList);
|
|
|
+ upList.clear();
|
|
|
+ }
|
|
|
+ detaillist.clear();
|
|
|
}
|
|
|
|
|
|
public void upOrderRepairDetailReasonOutId(String orderBaseId) {
|
|
@@ -1100,33 +1113,37 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
|
|
|
.eq(OrderRepairDetailReason::getOrderBaseId, orderBaseId)
|
|
|
.eq(OrderRepairDetailReason::getOutId, 0)
|
|
|
.list();
|
|
|
+ if (CollectionUtils.isEmpty(oids)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
List<OrderRepairDetailReason> detaillist = orderRepairDetailReasonService.lambdaQuery()
|
|
|
.eq(OrderRepairDetailReason::getOrderBaseId, orderBaseId)
|
|
|
.list();
|
|
|
// 找出最大的序 默认值为0
|
|
|
int outId=0;
|
|
|
- if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(detaillist) && org.apache.commons.collections4.CollectionUtils.isNotEmpty(oids)){
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(detaillist)){
|
|
|
for (OrderRepairDetailReason item:detaillist){
|
|
|
if (outId<item.getOutId()){
|
|
|
outId = item.getOutId();
|
|
|
}
|
|
|
}
|
|
|
- for (OrderRepairDetailReason ite:detaillist){
|
|
|
- if (ite.getOutId() == 0){
|
|
|
- outId++;
|
|
|
- ite.setOutId(outId);
|
|
|
- ite.setXxyyguid(IdWorker.getIdStr());
|
|
|
- upList.add(ite);
|
|
|
- }
|
|
|
- }
|
|
|
- // 修改序
|
|
|
- if (upList.size()>0){
|
|
|
- orderRepairDetailReasonService.updateBatchById(upList);
|
|
|
- upList.clear();
|
|
|
+ }
|
|
|
+
|
|
|
+ for (OrderRepairDetailReason ite:detaillist){
|
|
|
+ if (ite.getOutId() == 0){
|
|
|
+ outId++;
|
|
|
+ ite.setOutId(outId);
|
|
|
+ ite.setXxyyguid(IdWorker.getIdStr());
|
|
|
+ upList.add(ite);
|
|
|
}
|
|
|
- detaillist.clear();
|
|
|
}
|
|
|
+ // 修改序
|
|
|
+ if (upList.size()>0){
|
|
|
+ orderRepairDetailReasonService.updateBatchById(upList);
|
|
|
+ upList.clear();
|
|
|
+ }
|
|
|
+ detaillist.clear();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1668,22 +1685,23 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
|
|
|
outId = item.getOutId();
|
|
|
}
|
|
|
}
|
|
|
- for (OrderRepairDetail ite:detaillistz){
|
|
|
- if (ite.getOutId() == 0){
|
|
|
- outId++;
|
|
|
- OrderRepairDetail n = new OrderRepairDetail();
|
|
|
- n.setId(ite.getId());
|
|
|
- n.setOutId(outId);
|
|
|
- upList.add(n);
|
|
|
- }
|
|
|
- }
|
|
|
- // 修改序
|
|
|
- if (upList.size()>0){
|
|
|
- orderRepairDetailService.updateBatchById(upList);
|
|
|
- upList.clear();
|
|
|
+ }
|
|
|
+
|
|
|
+ for (OrderRepairDetail ite:detaillistz){
|
|
|
+ if (ite.getOutId() == 0){
|
|
|
+ outId++;
|
|
|
+ OrderRepairDetail n = new OrderRepairDetail();
|
|
|
+ n.setId(ite.getId());
|
|
|
+ n.setOutId(outId);
|
|
|
+ upList.add(n);
|
|
|
}
|
|
|
- detaillist.clear();
|
|
|
}
|
|
|
+ // 修改序
|
|
|
+ if (upList.size()>0){
|
|
|
+ orderRepairDetailService.updateBatchById(upList);
|
|
|
+ upList.clear();
|
|
|
+ }
|
|
|
+ detaillist.clear();
|
|
|
}
|
|
|
|
|
|
public void upBrandPgid(OrderBase orderBase) {
|