|
|
@ -92,6 +92,8 @@ import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static org.bouncycastle.math.ec.custom.gm.SM2P256V1Curve.q; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 提货单 服务实现类 |
|
|
|
* 提货单 服务实现类 |
|
|
|
* |
|
|
|
* |
|
|
@ -2081,6 +2083,87 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb |
|
|
|
return Resp.scanSuccess("签收成功!","签收成功!"); |
|
|
|
return Resp.scanSuccess("签收成功!","签收成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 添加自提图片 |
|
|
|
|
|
|
|
* @param billLadingAppDTO |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R updateReceivedImage(BillLadingAppDTO billLadingAppDTO) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询全部的图片
|
|
|
|
|
|
|
|
List<DistributionPrintEntity> printEntityList = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DistributionPrintEntity::getBillLadingId, billLadingAppDTO.getBillLadingId()) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
List<BillLadingAppDTO.Print> addList = new ArrayList<>(); //添加的图片
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ListIterator<DistributionPrintEntity> distributionPrintEntityListIterator = printEntityList.listIterator(); |
|
|
|
|
|
|
|
//添加图片
|
|
|
|
|
|
|
|
billLadingAppDTO.getPrintList().stream().collect(Collectors.groupingBy(BillLadingAppDTO.Print::getState)) |
|
|
|
|
|
|
|
.forEach((k,v) ->{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<BillLadingAppDTO.Print> aid = v.stream().filter(i -> ObjectUtils.isNull(i.getId())).collect(Collectors.toList());//添加的图片
|
|
|
|
|
|
|
|
addList.addAll(aid); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<BillLadingAppDTO.Print> uid = v.stream().filter(i -> ObjectUtils.isNotNull(i.getId())).collect(Collectors.toList()); //保存的图片
|
|
|
|
|
|
|
|
uid.forEach(q ->{ |
|
|
|
|
|
|
|
//处理不需要的图片
|
|
|
|
|
|
|
|
while (distributionPrintEntityListIterator.hasNext()){ |
|
|
|
|
|
|
|
DistributionPrintEntity next = distributionPrintEntityListIterator.next(); |
|
|
|
|
|
|
|
if(q.getId().equals(next.getId())){ |
|
|
|
|
|
|
|
distributionPrintEntityListIterator.remove(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
//清除需要删除的图片
|
|
|
|
|
|
|
|
if(!printEntityList.isEmpty()){ |
|
|
|
|
|
|
|
List<Long> collect = printEntityList.stream().map(DistributionPrintEntity::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
distributionPrintService.deleteLogic(collect); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//新增
|
|
|
|
|
|
|
|
List<DistributionPrintEntity> list2 = new ArrayList<>(); |
|
|
|
|
|
|
|
billLadingAppDTO.getPrintList().forEach(print -> { |
|
|
|
|
|
|
|
DistributionPrintEntity distributionPrintEntity = new DistributionPrintEntity(); |
|
|
|
|
|
|
|
distributionPrintEntity.setBillLadingId(billLadingAppDTO.getBillLadingId()); |
|
|
|
|
|
|
|
distributionPrintEntity.setGenre(Integer.parseInt(print.getState())); |
|
|
|
|
|
|
|
distributionPrintEntity.setSite(print.getUrl()); |
|
|
|
|
|
|
|
distributionPrintEntity.setSiteName(print.getName()); |
|
|
|
|
|
|
|
list2.add(distributionPrintEntity); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.status(distributionPrintService.saveBatch(list2)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询自提签收图片 |
|
|
|
|
|
|
|
* @param billLadingAppDTO |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R getReceivedImage(BillLadingAppDTO billLadingAppDTO) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DistributionPrintEntity> list = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DistributionPrintEntity::getBillLadingId, billLadingAppDTO.getBillLadingId()) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
Map<String,List<BillLadingAppDTO.Print>> map = new HashMap<>(); |
|
|
|
|
|
|
|
if(!list.isEmpty()){ |
|
|
|
|
|
|
|
List<BillLadingAppDTO.Print> list1 = new ArrayList<>(); |
|
|
|
|
|
|
|
list.forEach(i ->{ |
|
|
|
|
|
|
|
BillLadingAppDTO.Print print = new BillLadingAppDTO.Print(); |
|
|
|
|
|
|
|
print.setId(i.getId()); |
|
|
|
|
|
|
|
print.setUrl(i.getSite()); |
|
|
|
|
|
|
|
print.setName(i.getSiteName()); |
|
|
|
|
|
|
|
print.setState(String.valueOf(i.getGenre())); |
|
|
|
|
|
|
|
list1.add(print); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
map.put("list",list1); |
|
|
|
|
|
|
|
return R.data(map); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
map.put("list",null); |
|
|
|
|
|
|
|
return R.data(map); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 修改订单状态 |
|
|
|
* 修改订单状态 |
|
|
|