|
@@ -1,5 +1,8 @@
|
|
package org.jeecg.modules.saleCode.service.impl;
|
|
package org.jeecg.modules.saleCode.service.impl;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import org.jeecg.modules.baseCode.entity.BaseShipArchive;
|
|
|
|
+import org.jeecg.modules.baseCode.mapper.BaseShipArchiveMapper;
|
|
import org.jeecg.modules.saleCode.entity.SaleOrder;
|
|
import org.jeecg.modules.saleCode.entity.SaleOrder;
|
|
import org.jeecg.modules.saleCode.entity.SaleOrderShip;
|
|
import org.jeecg.modules.saleCode.entity.SaleOrderShip;
|
|
import org.jeecg.modules.saleCode.entity.SaleOrderProduct;
|
|
import org.jeecg.modules.saleCode.entity.SaleOrderProduct;
|
|
@@ -7,6 +10,7 @@ import org.jeecg.modules.saleCode.mapper.SaleOrderShipMapper;
|
|
import org.jeecg.modules.saleCode.mapper.SaleOrderProductMapper;
|
|
import org.jeecg.modules.saleCode.mapper.SaleOrderProductMapper;
|
|
import org.jeecg.modules.saleCode.mapper.SaleOrderMapper;
|
|
import org.jeecg.modules.saleCode.mapper.SaleOrderMapper;
|
|
import org.jeecg.modules.saleCode.service.ISaleOrderService;
|
|
import org.jeecg.modules.saleCode.service.ISaleOrderService;
|
|
|
|
+import org.jeecg.modules.system.entity.SysUser;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -31,12 +35,25 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
|
|
private SaleOrderShipMapper saleOrderShipMapper;
|
|
private SaleOrderShipMapper saleOrderShipMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private SaleOrderProductMapper saleOrderProductMapper;
|
|
private SaleOrderProductMapper saleOrderProductMapper;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private BaseShipArchiveMapper baseShipArchiveMapper;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void saveMain(SaleOrder saleOrder, List<SaleOrderShip> saleOrderShipList,List<SaleOrderProduct> saleOrderProductList) {
|
|
public void saveMain(SaleOrder saleOrder, List<SaleOrderShip> saleOrderShipList,List<SaleOrderProduct> saleOrderProductList) {
|
|
|
|
|
|
if(saleOrderShipList!=null && saleOrderShipList.size()>0) {
|
|
if(saleOrderShipList!=null && saleOrderShipList.size()>0) {
|
|
|
|
+
|
|
|
|
+ List<String> shipIds = saleOrderShipList.stream().map(SaleOrderShip::getId).collect(Collectors.toList());
|
|
|
|
+ QueryWrapper<BaseShipArchive> queryShip = new QueryWrapper<>();
|
|
|
|
+ queryShip.eq("id",shipIds);
|
|
|
|
+ queryShip.eq("del_flag",0);
|
|
|
|
+ List<BaseShipArchive> shipList = baseShipArchiveMapper.selectList(queryShip);
|
|
|
|
+ if(shipList.size() > 0){
|
|
|
|
+ String imos = shipList.stream().map(BaseShipArchive::getImo).collect(Collectors.joining(","));
|
|
|
|
+ saleOrder.setImo(imos);
|
|
|
|
+ }
|
|
|
|
+
|
|
String names = saleOrderShipList.stream().map(SaleOrderShip::getShipName).collect(Collectors.joining(","));
|
|
String names = saleOrderShipList.stream().map(SaleOrderShip::getShipName).collect(Collectors.joining(","));
|
|
saleOrder.setShipName(names);
|
|
saleOrder.setShipName(names);
|
|
}
|
|
}
|
|
@@ -64,7 +81,19 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void updateMain(SaleOrder saleOrder,List<SaleOrderShip> saleOrderShipList,List<SaleOrderProduct> saleOrderProductList) {
|
|
public void updateMain(SaleOrder saleOrder,List<SaleOrderShip> saleOrderShipList,List<SaleOrderProduct> saleOrderProductList) {
|
|
|
|
|
|
|
|
+
|
|
if(saleOrderShipList!=null && saleOrderShipList.size()>0) {
|
|
if(saleOrderShipList!=null && saleOrderShipList.size()>0) {
|
|
|
|
+
|
|
|
|
+ List<String> shipIds = saleOrderShipList.stream().map(SaleOrderShip::getId).collect(Collectors.toList());
|
|
|
|
+ QueryWrapper<BaseShipArchive> queryShip = new QueryWrapper<>();
|
|
|
|
+ queryShip.eq("id",shipIds);
|
|
|
|
+ queryShip.eq("del_flag",0);
|
|
|
|
+ List<BaseShipArchive> shipList = baseShipArchiveMapper.selectList(queryShip);
|
|
|
|
+ if(shipList.size() > 0){
|
|
|
|
+ String imos = shipList.stream().map(BaseShipArchive::getImo).collect(Collectors.joining(","));
|
|
|
|
+ saleOrder.setImo(imos);
|
|
|
|
+ }
|
|
|
|
+
|
|
String names = saleOrderShipList.stream().map(SaleOrderShip::getShipName).collect(Collectors.joining(","));
|
|
String names = saleOrderShipList.stream().map(SaleOrderShip::getShipName).collect(Collectors.joining(","));
|
|
saleOrder.setShipName(names);
|
|
saleOrder.setShipName(names);
|
|
}
|
|
}
|