|
|
|
@ -445,6 +445,26 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void recoverEcssDelHeader(EcssCoDelNotifyHeaderData data) { |
|
|
|
data.setNotifyStatus("已计划"); |
|
|
|
coDelMapper.changeEcssDelStatus(data); |
|
|
|
// 恢复明细状态为正常 |
|
|
|
coDelMapper.recoverEcssDelDetailStatus(data); |
|
|
|
// 取消废弃 通知仓库和单证人员 |
|
|
|
//设置邮件内容 |
|
|
|
String text = "<!DOCTYPE>" + "<div>发货通知单" +data.getDelNo()+"【发票:"+ |
|
|
|
data.getCmcInvoice()+"】<span style='color:green'>取消废弃,恢复正常</span>" + "</div>"; |
|
|
|
String textHead = data.getCmcInvoice()+"【发票:"+ data.getCmcInvoice()+"】取消废弃"; |
|
|
|
String[] mailAddress = coDelMapper.queryUsersByRoleName("关务仓库",data.getSite()).stream().map(SysUserEntity::getEmail).toArray(String[]::new); |
|
|
|
String[] mailAddress2 = new String[]{coDelMapper.queryByUserName(data.getCreateBy()).getEmail()}; |
|
|
|
String[] mailAddressAll = ArrayUtils.addAll(mailAddress, mailAddress2); |
|
|
|
if (mailAddressAll.length>0) { |
|
|
|
sendMailUtil(textHead, text,mailAddressAll, data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private String getStringCellValue(XSSFRow row, int columnIndex) { |
|
|
|
Cell cell = row.getCell(columnIndex); |
|
|
|
if (cell == null || cell.getCellType() == CellType.BLANK) { |
|
|
|
@ -660,11 +680,14 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException("导入失败:" + e.getMessage()); |
|
|
|
} |
|
|
|
for (EcssCoDelNotifyData data:excelList) { |
|
|
|
if (!inData.getCmcInvoice().equals(data.getCmcInvoice())) { |
|
|
|
throw new RuntimeException("导入失败:Excel中存在与发货通知单["+inData.getCmcInvoice()+"]不一致的发票号"); |
|
|
|
} |
|
|
|
// 过滤掉发票号不一致的数据 |
|
|
|
excelList.removeIf(data -> !inData.getCmcInvoice().equals(data.getCmcInvoice())); |
|
|
|
|
|
|
|
// 检查过滤后是否还有数据 |
|
|
|
if (excelList.isEmpty()) { |
|
|
|
throw new RuntimeException("导入失败:Excel中没有与发货通知单["+inData.getCmcInvoice()+"]一致的发票号数据"); |
|
|
|
} |
|
|
|
|
|
|
|
List<EcssCoDelNotifyHeaderData> notifyHeader = coDelMapper.checkIfHasHeader(excelList.get(0).getCmcInvoice()); |
|
|
|
EcssCoDelNotifyHeaderData headerData; |
|
|
|
if (notifyHeader.isEmpty()) { |
|
|
|
@ -2035,7 +2058,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
if (!palletHeaderDataList.isEmpty()) { |
|
|
|
plt = "PLT"; |
|
|
|
} else { |
|
|
|
totalPlt = totalQty; |
|
|
|
totalPlt = totalCartons.setScale(0, RoundingMode.HALF_UP).intValue(); |
|
|
|
} |
|
|
|
template.addVar("total_plt", totalPlt+plt); |
|
|
|
template.addVar("total:", "total:"); |
|
|
|
|