Browse Source

无用代码删除

java8
han\hanst 5 months ago
parent
commit
d3e3353406
  1. 10
      src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java
  2. 4
      src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java
  3. 4
      src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java
  4. 209
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java
  5. 34
      src/main/resources/mapper/ecss/CoDelMapper.xml

10
src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java

@ -61,8 +61,8 @@ public class CoDelController {
@PostMapping("/saveEcssCoDelNotifyByExcel")
public R saveEcssCoDelNotifyByExcel(@RequestParam(value = "file") MultipartFile file, @ModelAttribute EcssCoDelNotifyHeaderData data){
coDelService.saveEcssCoDelNotifyByExcel(file, data);
return R.ok();
Map<String, List<String>> resultMap = coDelService.saveEcssCoDelNotifyByExcel(file, data);
return R.ok().put("resultMap", resultMap);
}
@PostMapping("/modifyNotifyDetailByExcel")
@ -199,12 +199,6 @@ public class CoDelController {
return R.ok();
}
@PostMapping("/searchCoDelPalletData")
@ResponseBody
public R searchCoDelPalletData(@RequestBody EcssCoDelNotifyHeaderData inData){
List<EcssCoDelPalletData> rows =coDelService.searchCoDelPalletData(inData);
return R.ok().put("rows", rows);
}
@PostMapping("/selectBoxList")
@ResponseBody

4
src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java

@ -97,8 +97,6 @@ public interface CoDelMapper {
@Param("codeType")String codeType,
@Param("list") List<String> list);
List<EcssCoDelPalletData> searchCoDelPalletData(EcssCoDelNotifyHeaderData inData);
List<EcssCoDelPalletData> searchCoDelPalletDataNew(EcssCoDelNotifyHeaderData inData);
void saveCodelPalletHeader(EcssCoDelPalletHeader inData);
@ -175,8 +173,6 @@ public interface CoDelMapper {
List<Map> exportCoDelPalletDetail(EcssCoDelNotifyHeaderData data);
List<Map> exportPalletHeaderData(EcssCoDelNotifyHeaderData inData);
void updateEcssDeclarationHeader(EcssDeclarationHeaderData data);
void updateEcssCoDelNotifyDetail(EcssCoDelNotifyDetailData data);

4
src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java

@ -22,7 +22,7 @@ public interface CoDelService {
PageUtils searchEcssCoDelNotifyHeaderForCK(EcssCoDelNotifyHeaderData data);
PageUtils searchEcssCoDelNotifyHeaderForDanZheng(EcssCoDelNotifyHeaderData data);
List<EcssCoDelNotifyDetailData> searchEcssCoDelNotifyDetail(EcssCoDelNotifyHeaderData data);
void saveEcssCoDelNotifyByExcel(MultipartFile file, EcssCoDelNotifyHeaderData data);
Map<String, List<String>> saveEcssCoDelNotifyByExcel(MultipartFile file, EcssCoDelNotifyHeaderData data);
void updateEcssDelHeader(EcssCoDelNotifyHeaderData data);
@ -54,8 +54,6 @@ public interface CoDelService {
void deleteHsCode(EcssHsCodeData data);
List<EcssCoDelPalletData> searchCoDelPalletData(EcssCoDelNotifyHeaderData inData);
List<EcssCoDelPalletData> searchCoDelPalletDataNew(EcssCoDelNotifyHeaderData inData);
List<Map> selectBoxList(EcssCoDelNotifyHeaderData inData);

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

@ -31,7 +31,6 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;
@ -92,14 +91,12 @@ public class CoDelServiceImpl implements CoDelService {
@Override
@Transactional
public void saveEcssCoDelNotifyByExcel(MultipartFile file, EcssCoDelNotifyHeaderData inData) {
public Map<String, List<String>> saveEcssCoDelNotifyByExcel(MultipartFile file, EcssCoDelNotifyHeaderData inData) {
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
String site = coDelMapper.getSiteByBu(inData.getBuNo());
List<EcssCoDelNotifyData> excelList = new ArrayList<>();
try {
// 转流
InputStream is = file.getInputStream();
// 读取工作簿
try (InputStream is = file.getInputStream()) {
XSSFWorkbook workbook = new XSSFWorkbook(is);
importNotifyExcel(inData, workbook, site, currentUser, excelList);
} catch (NullPointerException e) {
@ -108,19 +105,32 @@ public class CoDelServiceImpl implements CoDelService {
throw new RuntimeException("导入失败:" + e.getMessage());
}
// 使用 groupingBy 进行分组
// 成功和失败列表
List<String> successList = new ArrayList<>();
List<String> failList = new ArrayList<>();
// 使用 groupingBy 分组
Map<String, List<EcssCoDelNotifyData>> groupedByReadyDateAndCmcInvoice = excelList.stream()
.collect(Collectors.groupingBy(data -> data.getReadyDate() + "-" + data.getCmcInvoice()));
// 每个分组创建一个销售发货单
groupedByReadyDateAndCmcInvoice.forEach((key, list) -> {
String cmcInvoice = list.get(0).getCmcInvoice();
String transNo;
//测试下有没有发票号已经录入并且转化了
List<EcssCoDelNotifyHeaderData> checkIfHasHeader = coDelMapper.checkIfHasHeader(list.get(0).getCmcInvoice());
if (checkIfHasHeader.size() == 0) {
// 检查是否已经存在
List<EcssCoDelNotifyHeaderData> checkIfHasHeader = coDelMapper.checkIfHasHeader(cmcInvoice);
if (!checkIfHasHeader.isEmpty()) {
failList.add("发票号:" + cmcInvoice + " 已经生成发货通知单");
return; // 跳过当前分组继续下一个
}
try {
// 新建头
EcssCoDelNotifyHeader headerList = new EcssCoDelNotifyHeader();
coDelMapper.updateTransNo(list.get(0).getSite(), "EC");
transNo = coDelMapper.getTransNo(list.get(0).getSite(), "EC");
headerList.setDelNo(transNo);
headerList.setSite(list.get(0).getSite());
headerList.setBuNo(list.get(0).getBuNo());
@ -134,25 +144,32 @@ public class CoDelServiceImpl implements CoDelService {
headerList.setOverseasShipper(inData.getOverseasShipper());
headerList.setOverseasAddress(inData.getOverseasAddress());
headerList.setCnative(inData.getCnative());
headerList.setCmcInvoice(list.get(0).getCmcInvoice());
headerList.setCmcInvoice(cmcInvoice);
headerList.setCreateBy(inData.getUsername());
coDelMapper.saveEcssCoDelNotifyHeader(headerList);
} else {
// if("Y".equals(checkIfHasHeader.get(0).getErpFlag())){
throw new RuntimeException("发票号:" + list.get(0).getCmcInvoice() + "已经生成了发货通知单,请先删除!");
// }
}
// 明细
for (int i = 0; i < list.size(); i++) {
list.get(i).setDelNo(transNo);
list.get(i).setItemNo(i + 1);
}
coDelMapper.batchSaveEcssCoDelNotifyDetail(list);
for (int i = 0; i < list.size(); i++) {
list.get(i).setDelNo(transNo);
list.get(i).setItemNo(i + 1);
// 加入成功列表
successList.add("发票号:" + cmcInvoice + " 导入成功");
} catch (Exception e) {
failList.add("发票号:" + cmcInvoice + " 导入失败,原因:" + e.getMessage());
}
coDelMapper.batchSaveEcssCoDelNotifyDetail(list);
});
// 返回结果
Map<String, List<String>> resultMap = new HashMap<>();
resultMap.put("success", successList);
resultMap.put("fail", failList);
return resultMap;
}
private void importNotifyExcel(EcssCoDelNotifyHeaderData inData, XSSFWorkbook workbook, String site,
SysUserEntity currentUser, List<EcssCoDelNotifyData> excelList) {
for (int s = 0; s < workbook.getNumberOfSheets(); s++) {
@ -294,9 +311,6 @@ public class CoDelServiceImpl implements CoDelService {
@Override
public void deleteEcssDelHeader(EcssCoDelNotifyHeaderData data) {
List<EcssCoDelNotifyDetailData> checkEcssCoDelNotifyDetail = coDelMapper.searchEcssCoDelNotifyDetail(data);
/* if (checkEcssCoDelNotifyDetail.size() > 0) {
throw new RuntimeException("该发货通知单下有明细无法删除!");
}*/
coDelMapper.deleteEcssDelHeader(data);
for (EcssCoDelNotifyDetailData detailData : checkEcssCoDelNotifyDetail){
coDelMapper.deleteEcssDelDetail(detailData);
@ -419,9 +433,6 @@ public class CoDelServiceImpl implements CoDelService {
if (checkHeader.isEmpty()) {
throw new RuntimeException("不存在该发货通知单请刷新界面");
}
/* if (!"已计划".equals(checkHeader.get(0).getNotifyStatus())) {
throw new RuntimeException("发货通知单状态不为已计划,无法修改。");
}*/
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
List<PartData> parts = coDelMapper.getPartNo(data.getSite(), data.getPn(),currentUser.getUsername(),data.getBuNo());
if (parts.isEmpty()) {
@ -485,9 +496,6 @@ public class CoDelServiceImpl implements CoDelService {
if (checkHeader.isEmpty()) {
throw new RuntimeException("不存在该发货通知单请刷新界面");
}
/* if (!"已计划".equals(checkHeader.get(0).getNotifyStatus())) {
throw new RuntimeException("发货通知单状态不为已计划,无法删除。");
}*/
data.setQty(BigDecimal.ZERO);
data.setModifyFlag(true);
data.setStatus("取消发货");
@ -622,9 +630,6 @@ public class CoDelServiceImpl implements CoDelService {
if (checkHeader.isEmpty()) {
throw new RuntimeException("不存在该发货通知单请刷新界面");
}
/* if (!"仓库已确认".equals(checkHeader.get(0).getNotifyStatus())) {
throw new RuntimeException("发货通知单状态不为仓库已确认,请刷新页面。");
}*/
coDelMapper.updateEcssDel(data);
}
@ -788,11 +793,6 @@ public class CoDelServiceImpl implements CoDelService {
}
}
@Override
public List<EcssCoDelPalletData> searchCoDelPalletData(EcssCoDelNotifyHeaderData inData) {
return coDelMapper.searchCoDelPalletData(inData);
}
@Override
public List<Map> selectBoxList(EcssCoDelNotifyHeaderData inData) {
return coDelMapper.selectBoxList(inData);
@ -832,9 +832,6 @@ public class CoDelServiceImpl implements CoDelService {
EcssCoDelPalletData excelData = new EcssCoDelPalletData();
// 获得该行
XSSFRow row = sheet.getRow(j);
/* if ((inData.getWalMartOrderFlag()==null || inData.getWalMartOrderFlag().equals("N")) && row.getCell(0) == null) {
throw new RuntimeException("第" + j + "行的序号不能为空!");
}*/
if (row.getCell(1) != null && !inData.getCmcInvoice().equals(row.getCell(1).getStringCellValue())) {
throw new RuntimeException("第" + j + "行的发票号与发货通知单的发票号不一致!");
}
@ -844,12 +841,10 @@ public class CoDelServiceImpl implements CoDelService {
if (row.getCell(7) == null) {
throw new RuntimeException("第" + j + "行的数量不能为空!");
}
//excelData.setSeqNo((inData.getWalMartOrderFlag()!=null && inData.getWalMartOrderFlag().equals("Y"))?j:getIntegerCellValue(row, 0));
// 为对象赋值
excelData.setSite(inData.getSite()); // site
excelData.setBuNo(inData.getBuNo()); // bu
excelData.setDelNo(inData.getDelNo());
// excelData.setPalletRemark(getStringCellValue(row, 2));
excelData.setPoNo(getStringCellValue(row, 5));
excelData.setPn(getStringCellValue(row, 6));
List<PartData> parts = coDelMapper.getPartNo(excelData.getSite(), excelData.getPn(),currentUser.getUsername(),inData.getBuNo());
@ -860,11 +855,6 @@ public class CoDelServiceImpl implements CoDelService {
excelData.setQty(getNumericCellValueOrDefault(row, 7));
excelData.setBoxQty(getNumericCellValueOrDefault(row, 2));
excelData.setRolls(getNumericCellValueOrDefault(row, 8));
//excelData.setPalletQty(getIntegerCellValue(row, 8));
//excelData.setLength(getNumericCellValueOrDefault(row, 9));
//excelData.setWidth(getNumericCellValueOrDefault(row, 10));
//excelData.setHeight(getNumericCellValueOrDefault(row, 11));
//excelData.setVolume(getNumericCellValueOrDefault(row, 12));
excelData.setGrossWeight(getNumericCellValueOrDefault(row, 3));
excelData.setNetWeight(getNumericCellValueOrDefault(row, 4));
if (excelData.getBoxQty() == null && excelData.getGrossWeight() == null && excelData.getNetWeight() == null) {
@ -903,98 +893,11 @@ public class CoDelServiceImpl implements CoDelService {
palletListMap2.put(itemData.getGroupSeqNo(),palletDataList);
}
}
/*if (inData.getWalMartOrderFlag()!=null && inData.getWalMartOrderFlag().equals("Y")) {
for (EcssCoDelPalletData itemData : excelList){
if (palletListMap.containsKey(itemData.getSeqNo())) {
palletListMap.get(itemData.getSeqNo()).add(itemData);
} else {
List<EcssCoDelPalletData> palletDataList = new ArrayList<>();
palletDataList.add(itemData);
palletListMap.put(itemData.getSeqNo(),palletDataList);
}
}
} else {
*//* if (excelList.get(0).getPalletQty() == null || excelList.get(0).getPalletQty() == 0) {
throw new RuntimeException("导入失败:第一行的托数不能为0!");
}*//*
for (EcssCoDelPalletData itemData : excelList){
if (palletListMap2.containsKey(itemData.getGroupSeqNo())) {
palletListMap2.get(itemData.getGroupSeqNo()).add(itemData);
} else {
List<EcssCoDelPalletData> palletDataList = new ArrayList<>();
palletDataList.add(itemData);
palletListMap2.put(itemData.getGroupSeqNo(),palletDataList);
}
}
}*/
EcssWalMartOrder task = new EcssWalMartOrder();
List<EcssCoDelPalletHeaderData> headerList = new ArrayList<>();
List<EcssCoDelBoxListData> boxList = new ArrayList<>();
List<EcssCoDelPalletDetailData> detailList = new ArrayList<>();
int seqNo = 0;
// palletListMap里每一个key生成一个EcssCoDelPalletHeaderData每一个value生成一组EcssCoDelPalletDetailData
/*for (Map.Entry<Integer, List<EcssCoDelPalletData>> entry : palletListMap.entrySet()) {
seqNo++;
EcssCoDelPalletHeaderData headerData = new EcssCoDelPalletHeaderData();
headerData.setSite(inData.getSite());
headerData.setBuNo(inData.getBuNo());
headerData.setDelNo(inData.getDelNo());
headerData.setSeqNo(seqNo);
headerData.setPalletNo(inData.getDelNo() + "-" + String.format("%03d", seqNo));
headerData.setPalletQty(entry.getValue().get(0).getPalletQty());
headerData.setPalletRemark(entry.getValue().get(0).getPalletRemark());
headerData.setLength(entry.getValue().get(0).getLength());
headerData.setWidth(entry.getValue().get(0).getWidth());
headerData.setHeight(entry.getValue().get(0).getHeight());
headerData.setVolume(entry.getValue().get(0).getVolume());
headerData.setCreateBy(currentUser.getUsername());
int i=0;
BigDecimal totalGrossWeight = new BigDecimal(0);
BigDecimal boxQty = new BigDecimal(0);
for (EcssCoDelPalletData thisData : entry.getValue()) {
EcssCoDelPalletDetailData detailData = new EcssCoDelPalletDetailData();
detailData.setSite(thisData.getSite());
detailData.setBuNo(thisData.getBuNo());
detailData.setDelNo(thisData.getDelNo());
detailData.setSeqNo(seqNo);
detailData.setItemNo(i + 1);
i++;
detailData.setPartNo(thisData.getPartNo());
detailData.setPn(thisData.getPn());
detailData.setQty(thisData.getQty());
task.setSku(detailData.getPn());
task.setQty(detailData.getQty());
List<EcssWalMartOrder> orderDataList = sqlSession.selectList("ecssMapper" + "." + "searchWalMartOrderList", task);
totalGrossWeight = totalGrossWeight.add(orderDataList.isEmpty()? new BigDecimal(0):orderDataList.get(0).getGrossWeight());
detailData.setPoNo(thisData.getPoNo());
if (thisData.getBoxQty()!=null && thisData.getBoxQty().intValue()>0) {
detailData.setBoxQty(thisData.getBoxQty());
} else {
String partNo = thisData.getPartNo();
// 关务物料属性
List<PartSubPropertiesValueData> propertiesValues = coDelMapper.getPropertiesListByTypeAndCodeNo(
inData.getSite(), "ECSSPART","BG001",inData.getBuNo(),partNo);
// 每一个物料加属性对应一个属性用来下面遍历发货通知单明细时获取具体属性值
Map<String, List<PartSubPropertiesValueData>> partNoAndItemNoMap = propertiesValues.stream()
.collect(Collectors.groupingBy(PartSubPropertiesValue::getPropertiesItemNo));
PartSubPropertiesValueData propertiesRollQty = partNoAndItemNoMap.get("ROLLQTY")==null? null:partNoAndItemNoMap.get("ROLLQTY").get(0);//每卷数量
PartSubPropertiesValueData propertiesBoxRolls = partNoAndItemNoMap.get("BOXROLLS")==null? null:partNoAndItemNoMap.get("BOXROLLS").get(0);//每箱卷数
if (propertiesRollQty==null||propertiesBoxRolls==null) {
throw new RuntimeException("请先维护物料["+detailData.getPn()+"]的每卷数量和每箱卷数!");
}
detailData.setBoxQty(detailData.getQty().divide(
BigDecimal.valueOf(((double) propertiesRollQty.getNumValue().intValue() * propertiesBoxRolls.getNumValue().intValue())),2, BigDecimal.ROUND_HALF_UP));
}
detailData.setRolls(thisData.getRolls());
detailData.setCreateBy(currentUser.getUsername());
detailList.add(detailData);
boxQty = boxQty.add(detailData.getBoxQty()!=null?detailData.getBoxQty():new BigDecimal(0));
}
BigDecimal netWeight = totalGrossWeight.intValue()>0?totalGrossWeight.subtract(boxQty.divide(BigDecimal.valueOf(2),2,RoundingMode.HALF_UP)):new BigDecimal(0);
headerData.setGrossWeight(totalGrossWeight);
headerData.setNetWeight(netWeight);
headerList.add(headerData);
}*/
for (Map.Entry<Integer, List<EcssCoDelPalletData>> entry : palletListMap2.entrySet()) {
seqNo++;
EcssCoDelBoxListData boxListData = new EcssCoDelBoxListData();
@ -1026,9 +929,6 @@ public class CoDelServiceImpl implements CoDelService {
detailList.add(detailData);
}
}
/*for (EcssCoDelPalletHeaderData ecssCoDelPalletHeaderData : headerList) {
coDelMapper.saveCodelPalletHeader(ecssCoDelPalletHeaderData);
}*/
for (EcssCoDelBoxListData boxData : boxList) {
coDelMapper.saveCodelBoxList(boxData);
}
@ -2262,7 +2162,6 @@ public class CoDelServiceImpl implements CoDelService {
list.add(detailData);
palletListMap.put(detailData.getPartNo(), list);
}
//totalQty = totalQty + detailData.getQty().intValue();
}
int seqNo = 1;
StringBuilder partNos = new StringBuilder();
@ -2294,36 +2193,6 @@ public class CoDelServiceImpl implements CoDelService {
PartSubPropertiesValueData propertiesRollQty = partNoAndItemNoMap.get("ROLLQTY").get(0);//每卷数量
PartSubPropertiesValueData propertiesBoxRolls = partNoAndItemNoMap.get("BOXROLLS").get(0);//每箱卷数
PartSubPropertiesValueData propertiesBoxWeight = partNoAndItemNoMap.get("BOXWEIGHT").get(0);//箱重量
/*EcssCoDelPalletHeaderData headerData = new EcssCoDelPalletHeaderData();
BeanUtils.copyProperties(inData, headerData);
headerData.setSeqNo(seqNo+seq);
seq++;
headerData.setPalletNo(inData.getDelNo() + "-" + String.format("%03d", headerData.getSeqNo()));
headerData.setCreateBy(currentUser.getUsername());
headerData.setCreateDate(new Date());
headerData.setUpdateBy(currentUser.getUsername());
headerData.setUpdateDate(new Date());
headerData.setAddFlag(0);
headerData.setLength(palletData.getLength());
headerData.setWidth(palletData.getWidth());
headerData.setHeight(inData.getHeight());
int totalQty = 0;
for (EcssCoDelNotifyDetailData detailData : palletListMap.get(partNo)) {
totalQty = totalQty + detailData.getQty().intValue();
}
// 每托层数*箱高+底座高
headerData.setVolume(headerData.getLength().multiply(headerData.getWidth()).multiply(headerData.getHeight()));
BigDecimal boxWeight = BigDecimal.valueOf(propertiesBoxWeight.getNumValue());// 箱的重量
// Total Qty / 每箱EA
BigDecimal noCartons = BigDecimal.valueOf(totalQty/((double) propertiesRollQty.getNumValue().intValue() * propertiesBoxRolls.getNumValue().intValue()));
// 箱重量物料维护里取
BigDecimal grossWeight = noCartons.multiply(boxWeight);
// Net Weight = Gross Weight - No of Cartons/2
BigDecimal netWeight = grossWeight.subtract(noCartons.divide(BigDecimal.valueOf(2)));
// 如果是沃尔玛订单可以根据料号和发货数量直接取维护好的净重毛重
headerData.setGrossWeight(grossWeight);
headerData.setNetWeight(netWeight);
coDelMapper.saveCodelPalletHeader(headerData);*/
int totalQty = 0;
for (EcssCoDelNotifyDetailData detailData : palletListMap.get(partNo)) {
totalQty = totalQty + detailData.getQty().intValue();
@ -2463,10 +2332,6 @@ public class CoDelServiceImpl implements CoDelService {
}
}
// 处理栈板记录
/* palletHeaderSave(inData.getSite(), inData.getBuNo(), inData.getDelNo(),
inData.getPalletRecords(), currentUser);*/
//将发货通知单modifyFlag变更为false
notifyHeader.setModifyFlag(false);
coDelMapper.updateEcssDelHeaderForModify(notifyHeader);
coDelMapper.updateEcssDelDetailForModify(notifyHeader);

34
src/main/resources/mapper/ecss/CoDelMapper.xml

@ -1,27 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xujie.sys.modules.ecss.mapper.CoDelMapper">
<!-- <select id="searchEcssCoDelNotify" parameterType="EcssCoDelNotifyData" resultType="EcssCoDelNotifyData">-->
<!-- select a.site,a.bu_no,a.delNo,a.item_no,a.notifyDate,a.salesOrder,a.ready_date,a.customer_name,a.customerPO,a.line,a.version,-->
<!--a.status,a.family,a.part_no,a.part_description,a.qty,a.lt,a.cmc_invoice,a.cmc_comment,a.Destination,a.saleType,-->
<!--a.awb_bl,a.shipping_number,a.shipping_mode,a.forwarder_info,a.currency,a.tp,a.ttl_amount,a.sum_price,a.so,a.upc,-->
<!--a.remark,a.erp_flag,a.notify_status,a.erp_delNo,a.erp_delItemNo,dbo.get_bu_desc(a.site,a.bu_no ) buDesc-->
<!-- from ecss_CoDelNotify a-->
<!-- <where>-->
<!-- <if test="query.username != null and query.username != ''">-->
<!-- AND a.NotifyNo = #{query.username}-->
<!-- </if>-->
<!-- </where>-->
<!-- order by a.ready_date desc-->
<!-- </select>-->
<select id="searchEcssCoDelNotifyHeader" resultType="EcssCoDelNotifyHeaderData">
select a.site,a.bu_no,a.delNo,a.erp_delNo,a.ready_date,a.notifyDate,a.customer_name,a.Destination,a.shipping_mode,a.erp_flag,
a.notify_status,a.remark,a.createDate,a.createBy,a.cmc_invoice,a.updateDate,a.updateBy,dbo.get_bu_desc(a.site,a.bu_no) as buDesc,
a.modifyFlag,a.overseasShipper,a.overseasAddress,a.cnative,a.localShipAddress
a.modifyFlag,a.overseasShipper,a.overseasAddress,a.cnative,a.localShipAddress,a.walMartOrderFlag
from ecss_CoDelNotifyHeader a
left join accessBu D on A.site=D.site and A.bu_no=d.bu_no and D.username=#{query.username}
@ -464,14 +447,6 @@ create_by,create_date,update_by,update_date
</if>
</select>
<select id="searchCoDelPalletData" resultType="EcssCoDelPalletData">
select a.site,a.bu_no,a.delNo,a.seq_no,a.pallet_no,a.pallet_qty,a.[length],a.width,a.height,a.volume,a.gross_weight,a.net_weight,
a.pallet_remark,a.create_by,a.create_date,a.update_by,a.update_date,b.item_no,b.po_no,b.part_no,b.qty,b.box_qty,b.rolls,b.pn
from ecss_CoDelPalletHeader a
left join ecss_CoDelPalletDetail b on a.site=b.site and a.bu_no=b.bu_no and a.delNo=b.delNo and a.seq_no=b.seq_no
where a.site=#{site} and a.bu_no=#{buNo} and a.delNo=#{delNo} and b.site is not null
</select>
<insert id="saveCodelPalletHeader">
insert into ecss_CoDelPalletHeader (site,bu_no,delNo,seq_no,pallet_no,pallet_qty,[length],width,height,volume,gross_weight,net_weight,pallet_remark,create_by,
create_date,pallet)
@ -828,13 +803,6 @@ left join ecss_CoDelNotifyHeader noHeader on a.site=noHeader.site and a.delNo=no
where a.site=#{site} and a.bu_no=#{buNo} and a.delNo=#{delNo} and b.site is not null GROUP BY b.part_no
</select>
<select id="exportPalletHeaderData" resultType="java.util.Map">
select b.part_no,a.pallet_remark,b.item_no
from ecss_CoDelPalletHeader a
left join ecss_CoDelPalletDetail b on a.site=b.site and a.bu_no=b.bu_no and a.delNo=b.delNo and a.seq_no=b.seq_no
where a.site=#{site} and a.bu_no=#{buNo} and a.delNo=#{delNo} and b.site is not null
</select>
<update id="updateEcssDeclarationHeader" >
update ecss_declaration_header set
upc=#{upc},so=#{so},origin=#{origin},pallet_weight=#{palletWeight},material=#{material},

Loading…
Cancel
Save