Browse Source

bug修正

java8
han\hanst 9 months ago
parent
commit
e62e97ec6b
  1. 11
      src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java
  2. 10
      src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java
  3. 6
      src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java
  4. 146
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java
  5. 40
      src/main/resources/mapper/ecss/CoDelMapper.xml
  6. BIN
      src/main/resources/templates/declaration-contract-template.xlsx
  7. BIN
      src/main/resources/templates/declaration-template.xlsx

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

@ -9,6 +9,8 @@ import com.xujie.sys.modules.ecss.entity.*;
import com.xujie.sys.modules.ecss.service.CoDelService;
import com.xujie.sys.modules.factory.entity.vo.BusinessRoleVo;
import com.xujie.sys.modules.orderIssure.entity.SOIssueNotifyHeaderData;
import com.xujie.sys.modules.part.entity.ComponentPartData;
import com.xujie.sys.modules.part.entity.PartInformationEntity;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValue;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValueData;
import com.xujie.sys.modules.part.service.PartInformationService;
@ -228,7 +230,7 @@ public class CoDelController {
@PostMapping("/savePalletDetail")
public R savePalletDetail(@RequestBody EcssCoDelPalletDetailData inData){
public R savePalletDetail(@RequestBody EcssCoDelPalletData inData){
coDelService.savePalletDetail(inData);
return R.ok();
}
@ -441,4 +443,11 @@ public class CoDelController {
List<Map> rows = coDelService.getPropertiesListByDeclaration(inData);
return R.ok().put("rows", rows);
}
@PostMapping(value="/queryPartListAll")
@ResponseBody
public R queryPartListAll(@RequestBody PartInformationEntity data) {
PageUtils page = coDelService.queryPartListAll(data);
return R.ok().put("page", page);
}
}

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

@ -7,8 +7,7 @@ import com.xujie.sys.modules.attrbute.entity.PropertyModelHeader;
import com.xujie.sys.modules.ecss.data.*;
import com.xujie.sys.modules.ecss.entity.*;
import com.xujie.sys.modules.orderIssure.entity.PartData;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValue;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValueData;
import com.xujie.sys.modules.part.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -37,7 +36,7 @@ public interface CoDelMapper {
void batchSaveEcssCoDelNotifyDetail(List<EcssCoDelNotifyData> list );
List<PartData> checkPart(@Param("site") String site, @Param("partNo") String partNo);
List<PartData> getPartNo(@Param("site") String site, @Param("partNo") String partNo, @Param("userName") String userName);
List<PartData> getPartNo(@Param("site") String site, @Param("partNo") String partNo, @Param("userName") String userName, @Param("buNo") String buNo);
List<PartData> getPartInfo(@Param("site") String site, @Param("partNo") String partNo);
@ -101,6 +100,7 @@ public interface CoDelMapper {
int getCoDelPalletHeaderSeqNo(EcssCoDelPalletHeaderData inData);
int getCoDelPalletDetailItem(EcssCoDelPalletDetail inData);
void updateCodelPalletHeader(EcssCoDelPalletHeaderData inData);
void updateCodelPalletHeader2(EcssCoDelPalletData inData);
void updateCodelPalletDetail(EcssCoDelPalletDetail inData);
void deletePalletHeader(EcssCoDelPalletHeaderData inData);
void deletePalletDetail(EcssCoDelPalletDetail inData);
@ -170,6 +170,8 @@ public interface CoDelMapper {
List<Map> getNotifyPartDetail(EcssDeclarationHeaderData inData);
List<Map> getNotifyDetailGroup(EcssDeclarationHeaderData data);
List<PartSubPropertiesValueData> getPropertiesListByTypeAndCodeNo(@Param("site") String site,@Param("recordType") String recordType,
@Param("codeNo") String codeNo,@Param("buNo") String buNo);
@ -204,4 +206,6 @@ public interface CoDelMapper {
void deleteWalMartOrder(EcssWalMartOrder inData);
void batchSaveWalMartOrder(List<EcssWalMartOrder> list );
IPage<PartInformationEntity> queryPartListAll(Page<PartInformationEntity> componentPartDataPage, @Param("query") PartInformationEntity data);
}

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

@ -4,6 +4,8 @@ import com.xujie.sys.common.utils.PageUtils;
import com.xujie.sys.modules.ecss.data.*;
import com.xujie.sys.modules.ecss.entity.*;
import com.xujie.sys.modules.part.entity.ComponentPartData;
import com.xujie.sys.modules.part.entity.PartInformationEntity;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValue;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValueData;
import org.apache.ibatis.annotations.Param;
@ -63,7 +65,7 @@ public interface CoDelService {
void deletePalletHeader(EcssCoDelPalletHeaderData inData);
void savePalletDetail(EcssCoDelPalletDetailData inData);
void savePalletDetail(EcssCoDelPalletData inData);
void deletePalletDetail(EcssCoDelPalletDetailData inData);
@ -128,4 +130,6 @@ public interface CoDelService {
void deleteWalMartOrder(EcssWalMartOrder data);
List<Map> getPropertiesListByDeclaration(EcssDeclarationHeaderData inData);
PageUtils queryPartListAll(PartInformationEntity data);
}

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

@ -12,10 +12,7 @@ import com.xujie.sys.modules.ecss.entity.*;
import com.xujie.sys.modules.ecss.mapper.CoDelMapper;
import com.xujie.sys.modules.ecss.service.CoDelService;
import com.xujie.sys.modules.orderIssure.entity.PartData;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValue;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValueData;
import com.xujie.sys.modules.part.entity.PartSubPropertiesValueHeaderData;
import com.xujie.sys.modules.part.entity.PlmPropertiesItemAvailableData;
import com.xujie.sys.modules.part.entity.*;
import com.xujie.sys.modules.part.mapper.PartInformationMapper;
import com.xujie.sys.modules.pms.mapper.EamMapper;
import com.xujie.sys.modules.sys.entity.SysUserEntity;
@ -171,7 +168,7 @@ public class CoDelServiceImpl implements CoDelService {
task.setStatus(getStringCellValue(row, 6));
task.setFamily(getStringCellValue(row, 7));
task.setPn(getStringCellValue(row, 8));
List<PartData> parts = coDelMapper.getPartNo(site, task.getPn(),currentUser.getUsername());
List<PartData> parts = coDelMapper.getPartNo(site, task.getPn(),currentUser.getUsername(),inData.getBuNo());
if (parts.isEmpty()) {
throw new RuntimeException("导入失败:物料:" + task.getPn() + "不存在!");
}
@ -316,6 +313,12 @@ public class CoDelServiceImpl implements CoDelService {
@Override
public void changeEcssDelStatus(EcssCoDelNotifyHeaderData data) {
if (data.getNotifyStatus().equals("已下达")) {
List<EcssCoDelNotifyDetailData> checkEcssCoDelNotifyDetail = coDelMapper.searchEcssCoDelNotifyDetail(data);
if (checkEcssCoDelNotifyDetail.isEmpty()) {
throw new RuntimeException("该发货通知单下没有明细无法下达!");
}
}
coDelMapper.changeEcssDelStatus(data);
}
@ -328,6 +331,11 @@ public class CoDelServiceImpl implements CoDelService {
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()) {
throw new RuntimeException("修改失败:物料:" + data.getPn() + "不存在!");
}
coDelMapper.updateEcssDelDetail(data);
}
@ -534,6 +542,7 @@ public class CoDelServiceImpl implements CoDelService {
}
@Override
@Transactional
public void saveCoDelPalletDataByExcel(MultipartFile file, EcssCoDelNotifyHeaderData inData) {
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
List<EcssCoDelPalletData> excelList = new ArrayList<>();
@ -582,7 +591,7 @@ public class CoDelServiceImpl implements CoDelService {
excelData.setPalletRemark(getStringCellValue(row, 2));
excelData.setPoNo(getStringCellValue(row, 3));
excelData.setPn(getStringCellValue(row, 4));
List<PartData> parts = coDelMapper.getPartNo(excelData.getSite(), excelData.getPn(),currentUser.getUsername());
List<PartData> parts = coDelMapper.getPartNo(excelData.getSite(), excelData.getPn(),currentUser.getUsername(),inData.getBuNo());
if (parts.isEmpty()) {
throw new RuntimeException("导入失败:物料:" + excelData.getPn() + "不存在!");
}
@ -680,12 +689,12 @@ public class CoDelServiceImpl implements CoDelService {
// 每一个物料加属性对应一个属性用来下面遍历发货通知单明细时获取具体属性值
Map<String, PartSubPropertiesValueData> partNoAndItemNoMap = propertiesValues.stream()
.collect(Collectors.toMap(o -> o.getPartNo() + "$" + o.getPropertiesItemNo(), o -> o));
PartSubPropertiesValueData propertiesWeight = partNoAndItemNoMap.get(partNo + "$ROLLWEIGHT");//每卷重量
//PartSubPropertiesValueData propertiesWeight = partNoAndItemNoMap.get(partNo + "$ROLLWEIGHT");//每卷重量
PartSubPropertiesValueData propertiesRollQty = partNoAndItemNoMap.get(partNo + "$ROLLQTY");//每卷数量
PartSubPropertiesValueData propertiesBoxRolls = partNoAndItemNoMap.get(partNo + "$BOXROLLS");//每箱卷数
PartSubPropertiesValueData propertiesBoxWeight = partNoAndItemNoMap.get(partNo + "$BOXWEIGHT");//箱重量
if (propertiesWeight==null||propertiesRollQty==null||propertiesBoxRolls==null||propertiesBoxWeight==null) {
throw new RuntimeException("请先维护物料["+partNo+"]基本信息!");
//PartSubPropertiesValueData propertiesBoxWeight = partNoAndItemNoMap.get(partNo + "$BOXWEIGHT");//箱重量
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));
@ -740,8 +749,28 @@ public class CoDelServiceImpl implements CoDelService {
for (int i = 0; i < headerList.size(); i++) {
coDelMapper.saveCodelPalletHeader(headerList.get(i));
}
Map<String, BigDecimal> palletDetailMap = new HashMap<>();
for (int i = 0; i < detailList.size(); i++) {
coDelMapper.saveCodelPalletDetail(detailList.get(i));
if (!palletDetailMap.containsKey(detailList.get(i).getPn())) {
palletDetailMap.put(detailList.get(i).getPn(), detailList.get(i).getQty());
} else {
palletDetailMap.put(detailList.get(i).getPn(), palletDetailMap.get(detailList.get(i).getPn()).add(detailList.get(i).getQty()));
}
}
List<EcssCoDelNotifyDetailData> ecssCoDelNotifyDetail = coDelMapper.searchEcssCoDelNotifyDetail(inData);
Map<String, BigDecimal> notifyDetailMap = new HashMap<>();
for (EcssCoDelNotifyDetailData detailData : ecssCoDelNotifyDetail) {
if (!notifyDetailMap.containsKey(detailData.getPn())) {
notifyDetailMap.put(detailData.getPn(), detailData.getQty());
} else {
notifyDetailMap.put(detailData.getPn(), notifyDetailMap.get(detailData.getPn()).add(detailData.getQty()));
}
}
for (Map.Entry<String, BigDecimal> entry : palletDetailMap.entrySet()) {
if (notifyDetailMap.get(entry.getKey()).compareTo(entry.getValue())!=0) {
throw new RuntimeException("物料["+entry.getKey()+"]的数量和发货通知单数量不一致!");
}
}
} catch (Exception e) {
throw new RuntimeException("导入失败:" + e.getMessage());
@ -886,7 +915,8 @@ public class CoDelServiceImpl implements CoDelService {
@Override
public void savePalletDetail(EcssCoDelPalletDetailData inData) {
@Transactional
public void savePalletDetail(EcssCoDelPalletData inData) {
List<PartData> checkPart = coDelMapper.checkPart(inData.getSite(), inData.getPartNo());
if (checkPart.size() == 0) {
throw new RuntimeException("导入失败:物料:" + inData.getPartNo() + "在当前工厂不存在!");
@ -900,6 +930,7 @@ public class CoDelServiceImpl implements CoDelService {
} else {
inData.setUpdateBy(currentUser.getUsername());
coDelMapper.updateCodelPalletDetail(inData);
coDelMapper.updateCodelPalletHeader2(inData);
}
}
@ -1263,7 +1294,7 @@ public class CoDelServiceImpl implements CoDelService {
template.addVar("dateStr", DateUtils.format(notifyHeader.getReadyDate(), "yyyy-MM-dd"));
template.addVar("Currency", "CNY");
template.addVar("Incoterm", "EXW ");
template.addVar("shippingMode", notifyHeader.getShippingMode());
template.addVar("shippingMode", stringInput(notifyHeader.getShippingMode()));
Map<String, EcssCoDelNotifyDetailData> notifyDetailMap = notifyDetailList.stream().collect(
Collectors.toMap(EcssCoDelNotifyDetailData::getPartNo,e->e));
// 装箱明细
@ -1323,12 +1354,12 @@ public class CoDelServiceImpl implements CoDelService {
}
// RFID需要的
if (notifyHeader.getBuNo().equals("01-Label") || notifyHeader.getBuNo().equals("03-RFID")) {
template.addVar("madein", data.getOrigin());
template.addVar("madein", stringInput(data.getOrigin()));
}
// 孟加拉需要的
if (data.getMaterial()!=null && data.getMaterial()) {
template.addVar("RFIDBase", "RFID Base Material");
template.addVar("HSCode", "& H.S.Code:"+data.getHsCode());
template.addVar("HSCode", "& H.S.Code:"+stringInput(data.getHsCode()));
}
// 欧洲地区需要
if (ecHeader.getPackaging()!=null && ecHeader.getPackaging()) {
@ -1496,7 +1527,7 @@ public class CoDelServiceImpl implements CoDelService {
// 孟加拉需要的
if (data.getMaterial()!=null && data.getMaterial()) {
template.addVar("RFIDBase", "RFID Base Material");
template.addVar("HSCode", "& H.S.Code:"+data.getHsCode());
template.addVar("HSCode", "& H.S.Code:"+stringInput(data.getHsCode()));
template.addVar("volume", palletHeaderData.map(ecssCoDelPalletHeaderData ->
ecssCoDelPalletHeaderData.getLength().setScale(2, RoundingMode.HALF_UP)
+ "*" + ecssCoDelPalletHeaderData.getWidth().setScale(2, RoundingMode.HALF_UP) + "*"
@ -1515,7 +1546,7 @@ public class CoDelServiceImpl implements CoDelService {
template.addVar("originLabel", "Origin of goods Made in China");
template.addVar("sellerLabel", "Name of seller Checkpoint Commercial (Shanghai) Co.. Ltd.");
}
template.addVar("Shipping_Mark", data.getShippingMark());
template.addVar("Shipping_Mark", stringInput(data.getShippingMark()));
template.addVar("Measurement", palletHeaderData.get().getLength().
multiply(palletHeaderData.get().getWidth()).multiply(palletHeaderData.get().getHeight()).
multiply(BigDecimal.valueOf(totalPlt)).setScale(2, RoundingMode.HALF_UP));
@ -1636,14 +1667,14 @@ public class CoDelServiceImpl implements CoDelService {
template.addVar("shipping_port", stringInput(notifyHeader.getDestination()));
template.addVar("cmc_invoice", stringInput(notifyHeader.getCmcInvoice()));
// 导出时默认可编辑的栏目
template.addVar("sales_method", data.getSalesMethod());//贸易方式
template.addVar("currency", data.getCurrency());//币制
template.addVar("made_area", data.getMadeArea());//货物产地
template.addVar("send_port", data.getSendPort());//发货港
template.addVar("shipper", data.getShipper());//发货人
template.addVar("voyage", data.getVoyage());//航次
template.addVar("delivery_goods_date", data.getDeliveryGoodsDate());//提货日期
template.addVar("shipping_date", data.getShippingDate());//船期
template.addVar("sales_method", stringInput(data.getSalesMethod()));//贸易方式
template.addVar("currency", stringInput(data.getCurrency()));//币制
template.addVar("made_area", stringInput(data.getMadeArea()));//货物产地
template.addVar("send_port", stringInput(data.getSendPort()));//发货港
template.addVar("shipper", stringInput(data.getShipper()));//发货人
template.addVar("voyage", stringInput(data.getVoyage()));//航次
template.addVar("delivery_goods_date", stringInput(data.getDeliveryGoodsDate()));//提货日期
template.addVar("shipping_date", stringInput(data.getShippingDate()));//船期
// 需要计算的
// 总托数
Integer totalPlt = palletHeaderDataList.get(0).getPalletQty();
@ -1686,49 +1717,22 @@ public class CoDelServiceImpl implements CoDelService {
@Override
public void downloadContract(HttpServletResponse response, EcssDeclarationHeaderData data) {
try {
ExcelTemplate template = ExcelTemplate.load(new ClassPathResource("templates/declaration-elements-template.xlsx").getInputStream());
template.addVar("brandType", data.getBrandType());
// 获取partNo列表
List<Map> partNos = coDelMapper.getDeclarationElements(data);
List<String> partNoList = partNos.stream().map(map -> map.get("partNo").toString()).collect(Collectors.toList());
// 根据partNo获取hsCode
List<Map> hsCodes = coDelMapper.getHsCodeByPartNo(data.getSite(), partNoList);
Map<String, Map> hsCodeMap = new HashMap<>();
for (int i = 0; i < hsCodes.size(); i++) {
Map eorder = hsCodes.get(i);
String key = eorder.get("hsCode")+"&"+eorder.get("hsCodeDesc");
if (hsCodeMap.containsKey(key)) {
hsCodeMap.get(key).put("sku", hsCodeMap.get(key).get("sku")+"\n "+eorder.get("sku"));
} else {
// hscode所有属性
PartSubPropertiesValueData inData = new PartSubPropertiesValueData();
inData.setSite(data.getSite());
inData.setBuNo(eorder.get("BuNo").toString());
inData.setCodeNo(eorder.get("codeNo").toString());
inData.setPartNo(eorder.get("hsCodeDesc").toString());
inData.setRecordType("ECSS");
List<PartSubPropertiesValueData> propertiesList = coDelMapper.getPropertiesListByPartAndCodeNo(inData);
StringBuilder properties = new StringBuilder();
for (int j = 0; j < propertiesList.size(); j++) {
if (j == propertiesList.size() - 1) {
properties.append(propertiesList.get(j).getItemDesc()).append(": ").append(propertiesList.get(j).getTextValue());
} else {
properties.append(propertiesList.get(j).getItemDesc()).append(": ").append(propertiesList.get(j).getTextValue()).append("\n");
}
}
eorder.put("properties",properties);
hsCodeMap.put(key, eorder);
}
}
List<Map> list = new ArrayList<>(hsCodeMap.values());
for (int i = 0; i < list.size(); i++) {
Map fMap = list.get(i);
fMap.put("content", "HS Code: "+fMap.get("hsCode")+
"\n品名: "+(data.getHsCodeDescType()!=null&&data.getHsCodeDescType().equals("N")?fMap.get("hsCodeDescEn"):fMap.get("hsCodeDesc"))+
"\n"+fMap.get("properties")+
"\n型号: "+fMap.get("sku"));
ExcelTemplate template = ExcelTemplate.load(new ClassPathResource("templates/declaration-contract-template.xlsx").getInputStream());
EcssDeclarationHeaderData ecHeader = coDelMapper.getDeclarationHeader(data);
// 发货通知单
EcssCoDelNotifyHeaderData notifyHeader = coDelMapper.getEcssCoDelNotifyHeader(data.getSite(), data.getDelNo());
template.addVar("cmcInvoice", notifyHeader.getCmcInvoice());
List<Map> notifyDetailGroup = coDelMapper.getNotifyDetailGroup(data);
BigDecimal totalQty = BigDecimal.ZERO;
BigDecimal totalAmount = BigDecimal.ZERO;
for (int i = 0; i < notifyDetailGroup.size(); i++) {
Map notifyDetail = notifyDetailGroup.get(i);
totalQty = totalQty.add((BigDecimal) notifyDetail.get("total_qty"));
totalAmount = totalAmount.add((BigDecimal) notifyDetail.get("ttl_amount"));
}
template.addListVarAll(list);
template.addVar("totalQty", totalQty);
template.addVar("totalAmount", totalAmount);
template.addListVarAll(notifyDetailGroup);
template.render(response.getOutputStream());
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader("Content-Disposition", "attachment; filename=\"合同.xlsx\"");
@ -1786,10 +1790,10 @@ public class CoDelServiceImpl implements CoDelService {
int seqNo = coDelMapper.getCoDelPalletHeaderSeqNo(inData);
for (String partNo : palletItemMap.keySet()) {
List<PartData> partList = coDelMapper.getPartInfo(inData.getSite(),partNo);
List<EcssPackageData> packageDataList = coDelMapper.getPackage(inData.getSite(),inData.getBuNo(),partList.get(0).getPackageNo());
/* List<EcssPackageData> packageDataList = coDelMapper.getPackage(inData.getSite(),inData.getBuNo(),partList.get(0).getPackageNo());
if (packageDataList.isEmpty()) {
throw new RuntimeException("物料["+partList.get(0).getSku()+"]未维护包装箱信息!");
}
}*/
PartSubPropertiesValueData propertiesWeight = partNoAndItemNoMap.get(partNo + "$ROLLWEIGHT");//每卷重量
PartSubPropertiesValueData propertiesRollQty = partNoAndItemNoMap.get(partNo + "$ROLLQTY");//每卷数量
PartSubPropertiesValueData propertiesBoxRolls = partNoAndItemNoMap.get(partNo + "$BOXROLLS");//每箱卷数
@ -2022,4 +2026,10 @@ public class CoDelServiceImpl implements CoDelService {
});
return list;
}
@Override
public PageUtils queryPartListAll(PartInformationEntity data) {
IPage<PartInformationEntity> list = this.coDelMapper.queryPartListAll(new Page<PartInformationEntity>(data.getPage(), data.getLimit()), data);
return new PageUtils(list);
}
}

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

@ -126,7 +126,7 @@
select a.site,a.bu_no,a.delNo,a.item_no,a.salesOrder,a.salesOrder_item_no,a.customerPO,a.line,a.version,a.status,a.family,
a.part_no,a.part_description,a.qty,a.lt,a.cmc_comment,a.saleType,a.awb_bl,a.shipping_number,a.forwarder_info,
a.currency,a.tp,a.ttl_amount,a.sum_price,a.so,a.upc,a.remark,a.erp_delItemNo,a.pn,CONVERT(DECIMAL(20, 0),a.nocartons) as nocartons,
c.num_value as boxrolls,d.num_value as rollqty
c.num_value as boxrolls,d.num_value as rollqty,#{cmcInvoice} as cmcInvoice
from ecss_CoDelNotifydetail a
left join part_sub_properties_value c on a.part_no=c.part_no and c.site=a.site and c.bu_no=a.bu_no
and c.record_type='ECSSPART' and c.code_no='BG001' and c.properties_item_no='BOXROLLS'
@ -188,7 +188,7 @@
</select>
<select id="getPartNo" resultType="PartData">
select top 1 site,part_no from Part where site=#{site,jdbcType=VARCHAR} and sku=#{partNo} and
select top 1 site,part_no from Part where site=#{site,jdbcType=VARCHAR} and sku=#{partNo} and sourceBu=#{buNo} and
site in (select site from eam_access_site where username = #{userName})
and (site + '-' + sourceBu) in (select * from dbo.query_bu(#{userName}))
</select>
@ -218,7 +218,7 @@
update ecss_CoDelNotifyDetail
set salesOrder=#{salesOrder},customerPO=#{customerPO},line=#{line},version=#{version},
status=#{status},family=#{family},part_no=#{partNo},part_description=#{partDescription},qty=#{qty,jdbcType=DECIMAL},
lt=#{lt,jdbcType=DECIMAL},cmc_comment=#{cmcComment},saleType=#{saleType},
lt=#{lt,jdbcType=DECIMAL},cmc_comment=#{cmcComment},saleType=#{saleType},pn=#{pn},
awb_bl=#{awbBl},shipping_number=#{shippingNumber},forwarder_info=#{forwarderInfo},currency=#{currency},
tp=#{tp,jdbcType=DECIMAL},ttl_amount=#{ttlAmount,jdbcType=DECIMAL},sum_price=#{sumPrice,jdbcType=DECIMAL},
so=#{so},upc=#{upc},remark=#{remark}
@ -448,6 +448,11 @@ create_by,create_date,update_by,update_date
update_by=#{updateBy},update_date=GetDate()
where site =#{site} and bu_no=#{buNo} and delNo=#{delNo} and seq_no=#{seqNo}
</update>
<update id="updateCodelPalletHeader2">
update ecss_CoDelPalletHeader set gross_weight=#{grossWeight,jdbcType=DECIMAL},net_weight=#{netWeight,jdbcType=DECIMAL},
update_by=#{updateBy},update_date=GetDate()
where site =#{site} and bu_no=#{buNo} and delNo=#{delNo} and seq_no=#{seqNo}
</update>
<update id="updateCodelPalletDetail">
update ecss_CoDelPalletDetail set part_no=#{partNo},qty=#{qty,jdbcType=DECIMAL},po_no=#{poNo},
box_qty=#{boxQty,jdbcType=DECIMAL},update_by=#{updateBy},update_date=GetDate(),rolls=#{rolls},pn=#{pn}
@ -715,7 +720,7 @@ left join ecss_CoDelNotifyHeader noHeader on a.site=noHeader.site and a.delNo=no
<select id="exportEcssCoDelNotifyDetail" resultType="java.util.Map">
select a.customerPO,a.part_no,a.part_description,
CONVERT(DECIMAL(20, 0), a.qty) as qty,CONVERT(DECIMAL(20, 4), a.tp) as unitPrice,b.hsCode,
a.upc,a.so,a.ttl_amount,a.pn,h.hsCodeDescEn
a.upc,a.so,a.ttl_amount,a.pn,h.hsCodeDesc,h.hsCodeDescEn
from ecss_CoDelNotifydetail a
left join part b on a.site=b.site and a.part_no=b.part_no
left join ecss_hsCode h on b.hsCode=h.HsCode and a.site=h.site and b.hsCodeDesc=h.hsCodeDesc
@ -769,6 +774,15 @@ left join ecss_CoDelNotifyHeader noHeader on a.site=noHeader.site and a.delNo=no
group by a.part_no,b.hsCode,a.site,a.delNo,a.lossratio,a.ehundred,b.part_desc,a.pn
</select>
<select id="getNotifyDetailGroup" resultType="java.util.Map">
select b.hsCodeDesc,CONVERT(DECIMAL(20, 2),sum(a.qty)) as total_qty,
CONVERT(DECIMAL(20, 2),sum(a.ttl_amount)) as ttl_amount
from ecss_CoDelNotifydetail a
left join part b on a.site=b.site and a.part_no=b.part_no
where a.site = #{site} AND a.delNo = #{delNo}
group by b.hsCodeDesc
</select>
<select id="getPropertiesListByTypeAndCodeNo" resultType="com.xujie.sys.modules.part.entity.PartSubPropertiesValueData">
SELECT a.part_no , a.Site, a.code_no, a.sub_code_seq_no, a.sub_code_desc
,a.bu_no,a.item_no, a.properties_item_no, a.text_value, a.num_value, a.record_type
@ -897,4 +911,22 @@ left join ecss_CoDelNotifyHeader noHeader on a.site=noHeader.site and a.delNo=no
<select id="deleteWalMartOrder" >
delete from ecss_walMartOrder where buNo=#{buNo} and sku=#{sku} and so=#{so} and qty=#{qty}
</select>
<!-- 查出所有类型的物料 -->
<select id="queryPartListAll" parameterType="PartInformationEntity" resultType="PartInformationEntity">
SELECT site, sourceBu as buNo, part_no, part_desc, sku
FROM part
<where> sourceBu=#{query.buNo} and
site = #{query.site} and active = 'Y'
<if test = "query.partNo != null and query.partNo != ''">
AND part_no like '%' + #{query.partNo} + '%'
</if>
<if test = "query.sku != null and query.sku != ''">
AND sku like '%' + #{query.sku} + '%'
</if>
<if test = "query.partDesc != null and query.partDesc != ''">
AND part_desc like '%' + #{query.partDesc} + '%'
</if>
</where>
</select>
</mapper>

BIN
src/main/resources/templates/declaration-contract-template.xlsx

BIN
src/main/resources/templates/declaration-template.xlsx

Loading…
Cancel
Save