Browse Source

客户地址

java8
han\hanst 7 months ago
parent
commit
326942ffa5
  1. 3
      src/main/java/com/xujie/sys/modules/ecss/data/EcssCoDelPalletHeaderData.java
  2. 88
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java
  3. 2
      src/main/resources/mapper/ecss/EcssCommonMapper.xml

3
src/main/java/com/xujie/sys/modules/ecss/data/EcssCoDelPalletHeaderData.java

@ -5,6 +5,7 @@ import lombok.Data;
import org.apache.ibatis.type.Alias;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Data
@ -12,7 +13,7 @@ import java.util.List;
public class EcssCoDelPalletHeaderData extends EcssCoDelPalletHeader {
private Integer addFlag;
private List<EcssCoDelNotifyDetailData> notifyDetailList;
private List<EcssCoDelNotifyDetailData> notifyDetailList = new ArrayList<>();
private String walMartOrderFlag;
}

88
src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java

@ -96,6 +96,8 @@ public class CoDelServiceImpl implements CoDelService {
// 读取工作簿
XSSFWorkbook workbook = new XSSFWorkbook(is);
importNotifyExcel(inData, workbook, site, currentUser, excelList);
} catch (NullPointerException e) {
throw new RuntimeException("导入失败:网络错误,请重新上传文档");
} catch (Exception e) {
throw new RuntimeException("导入失败:" + e.getMessage());
}
@ -151,22 +153,7 @@ public class CoDelServiceImpl implements CoDelService {
// 读取工作表
XSSFSheet sheet = workbook.getSheetAt(s);
// 剔除空行
for (int i = 0; i <= sheet.getLastRowNum(); i++) {
XSSFRow row = sheet.getRow(i);
boolean isEmptyRow = true;
if (row != null) {
for (Cell cell : row) {
if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR &&
!StringUtils.isBlank(String.valueOf(cell))) {
isEmptyRow = false;
break;
}
}
if (isEmptyRow) {
sheet.removeRow(row); // 删除空行
}
}
}
deleteEmptyRow(sheet);
// 获取行数
int rows = sheet.getPhysicalNumberOfRows();
// 遍历每一行从第二行开始
@ -528,6 +515,8 @@ public class CoDelServiceImpl implements CoDelService {
// 读取工作簿
XSSFWorkbook workbook = new XSSFWorkbook(is);
importNotifyExcel(inData, workbook, site, currentUser, excelList);
} catch (NullPointerException e) {
throw new RuntimeException("导入失败:网络错误,请重新上传文档");
} catch (Exception e) {
throw new RuntimeException("导入失败:" + e.getMessage());
}
@ -792,22 +781,7 @@ public class CoDelServiceImpl implements CoDelService {
// 读取工作表
XSSFSheet sheet = workbook.getSheetAt(0);
// 剔除空行
for (int i = 0; i <= sheet.getLastRowNum(); i++) {
XSSFRow row = sheet.getRow(i);
boolean isEmptyRow = true;
if (row != null) {
for (Cell cell : row) {
if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR &&
!StringUtils.isBlank(String.valueOf(cell))) {
isEmptyRow = false;
break;
}
}
if (isEmptyRow) {
sheet.removeRow(row); // 删除空行
}
}
}
deleteEmptyRow(sheet);
// 获取行数
int rows = sheet.getPhysicalNumberOfRows();
// 遍历每一行从第二行开始
@ -857,6 +831,8 @@ public class CoDelServiceImpl implements CoDelService {
}
excelList.add(excelData);
}
} catch (NullPointerException e) {
throw new RuntimeException("导入失败:网络错误,请重新上传文档");
} catch (Exception e) {
throw new RuntimeException("导入失败:" + e.getMessage());
}
@ -1044,7 +1020,7 @@ public class CoDelServiceImpl implements CoDelService {
BigDecimal totalGrossWeight = new BigDecimal(0);
EcssWalMartOrder task = new EcssWalMartOrder();
for (EcssCoDelNotifyDetailData detailData : notifys) {
totalQty = totalQty + detailData.getQty().intValue();
totalQty = totalQty + (detailData.getQty()!=null?detailData.getQty().intValue():0);
if (inData.getWalMartOrderFlag()!=null && inData.getWalMartOrderFlag().equals("Y")) {
task.setSku(detailData.getPn());
task.setQty(detailData.getQty());
@ -1066,8 +1042,7 @@ public class CoDelServiceImpl implements CoDelService {
// 根据partNo获取hsCode
List<Map> packageNoList = coDelMapper.getPackageNoByPartNo(inData.getSite(), partNoList);
Map<String, String> partPackageMap = new HashMap<>();
for (int i = 0; i < packageNoList.size(); i++) {
Map eorder = packageNoList.get(i);
for (Map eorder : packageNoList) {
if (!partPackageMap.containsKey(eorder.get("packageNo"))) {
partPackageMap.put((String) eorder.get("packageNo"), (String) eorder.get("partNo"));
}
@ -1079,7 +1054,7 @@ public class CoDelServiceImpl implements CoDelService {
if (!packageData.isPresent()) {
throw new RuntimeException("箱号信息不存在!");
}
String partNo = partPackageMap.get(packageData.get().getPackageNo()).toString();
String partNo = partPackageMap.get(packageData.get().getPackageNo());
// 关务物料属性
List<PartSubPropertiesValueData> propertiesValues = coDelMapper.getPropertiesListByTypeAndCodeNo(
inData.getSite(), "ECSSPART","BG001",inData.getBuNo(), partNo);
@ -1876,7 +1851,8 @@ public class CoDelServiceImpl implements CoDelService {
boolean hasDicimal = false;
if (pm!=null && !pm.isEmpty()) {
totalQty = Integer.parseInt(pm.get("total_qty").toString());
BigDecimal noCartons = (BigDecimal) pm.get("box_qty");
BigDecimal noCartons = pm.get("box_qty")!=null?(BigDecimal) pm.get("box_qty"):BigDecimal.ZERO;
// 显示箱数零头 有小数
if (ecHeader.getBoxChange()!=null && ecHeader.getBoxChange() && noCartons.stripTrailingZeros().scale()>0) {
noCartons = noCartons.setScale(0, RoundingMode.DOWN);
hasDicimal = true;
@ -1988,7 +1964,8 @@ public class CoDelServiceImpl implements CoDelService {
int totalQty=palletDetailList.stream().mapToInt(o -> Integer.parseInt(o.get("total_qty").toString())).sum();
Map<Object, Map> palletMap = palletDetailList.stream().collect(Collectors.toMap( o -> o.get("part_no"), o -> o));
template.addVar("hs_code_desc", stringInput(data.getHsCodeDescType()!=null&& data.getHsCodeDescType().equals("N")?
nodifyDetailList.get(0).get("hsCodeDescEn").toString():nodifyDetailList.get(0).get("hsCodeDesc").toString()));
(nodifyDetailList.get(0).get("hsCodeDescEn")!=null?nodifyDetailList.get(0).get("hsCodeDescEn").toString():""):
(nodifyDetailList.get(0).get("hsCodeDesc")!=null?nodifyDetailList.get(0).get("hsCodeDesc").toString():"")));
template.addVar("hs_code", stringInput(nodifyDetailList.get(0).get("hsCode").toString()));
Map<Object, Object> poNoMap = new HashMap<>();
BigDecimal ttlAmount = BigDecimal.ZERO;
@ -2352,21 +2329,7 @@ public class CoDelServiceImpl implements CoDelService {
// 读取工作表
XSSFSheet sheet = workbook.getSheetAt(0);
// 剔除空行
for (int i = 0; i <= sheet.getLastRowNum(); i++) {
XSSFRow row = sheet.getRow(i);
boolean isEmptyRow = true;
if (row != null) {
for (Cell cell : row) {
if (cell.getCellType() != CellType.BLANK) {
isEmptyRow = false;
break;
}
}
if (isEmptyRow) {
sheet.removeRow(row); // 删除空行
}
}
}
deleteEmptyRow(sheet);
// 获取行数
int rows = sheet.getPhysicalNumberOfRows();
// 遍历每一行从第二行开始
@ -2415,6 +2378,25 @@ public class CoDelServiceImpl implements CoDelService {
}
}
private static void deleteEmptyRow(XSSFSheet sheet) {
for (int i = 0; i <= sheet.getLastRowNum(); i++) {
XSSFRow row = sheet.getRow(i);
boolean isEmptyRow = true;
if (row != null) {
for (Cell cell : row) {
if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR &&
!StringUtils.isBlank(String.valueOf(cell))) {
isEmptyRow = false;
break;
}
}
if (isEmptyRow) {
sheet.removeRow(row); // 删除空行
}
}
}
}
@Override
public List<Map> getPropertiesListByDeclaration(EcssDeclarationHeaderData data) {
// 获取partNo列表

2
src/main/resources/mapper/ecss/EcssCommonMapper.xml

@ -46,7 +46,7 @@
</select>
<select id="getCustomerAdd" resultType="java.util.Map">
select DISTINCT vcus.ccusname,vcusa.cDeliverAdd
select DISTINCT vcus.ccusname,vcusa.cDeliverAdd,vcusa.cDeliverUnit, vcusa.country
from view_custdev_mes_cmc_customer vcus
left join view_custdev_mes_cmc_customer_addr vcusa on vcus.ccuscode=vcusa.ccuscode
where vcus.ccusname=#{ccusname}

Loading…
Cancel
Save