Compare commits
4 Commits
43299e5329
...
039c0d4858
| Author | SHA1 | Date | |
|---|---|---|---|
| 039c0d4858 | |||
| f0012ac563 | |||
| 98ae525403 | |||
| c87f49a14b |
+58
@@ -0,0 +1,58 @@
|
||||
package com.bms.web.controller.price;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bms.common.core.controller.BaseController;
|
||||
import com.bms.common.core.domain.AjaxResult;
|
||||
import com.bms.common.core.page.TableDataInfo;
|
||||
import com.bms.common.utils.StringUtils;
|
||||
import com.bms.price.domain.vo.SrvBillAirQuery;
|
||||
import com.bms.price.domain.vo.SrvBillAirVo;
|
||||
import com.bms.price.service.ISrvBillAirService;
|
||||
|
||||
/**
|
||||
* 空运提单(计费中心)
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/price/airBill")
|
||||
public class SrvBillAirController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISrvBillAirService srvBillAirService;
|
||||
|
||||
/**
|
||||
* 提单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:airBill:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SrvBillAirQuery query)
|
||||
{
|
||||
startPage();
|
||||
List<SrvBillAirVo> list = srvBillAirService.selectSrvBillAirList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提单详情(按提单号)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasAnyPermi('price:airBill:list,price:airBill:query')")
|
||||
@GetMapping("/detail")
|
||||
public AjaxResult getInfo(@RequestParam("billCode") String billCode)
|
||||
{
|
||||
if (StringUtils.isEmpty(billCode))
|
||||
{
|
||||
return error("提单号不能为空");
|
||||
}
|
||||
SrvBillAirVo vo = srvBillAirService.selectSrvBillAirByBillCode(billCode);
|
||||
if (vo == null)
|
||||
{
|
||||
return error("提单不存在");
|
||||
}
|
||||
return success(vo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.bms.price.airbill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/** 空运提单主表 srv_bill_air */
|
||||
@Data
|
||||
public class SrvBillAir
|
||||
{
|
||||
private String guid;
|
||||
private String billCode;
|
||||
private Integer billType;
|
||||
private Integer blStatus;
|
||||
private Integer warningStatus;
|
||||
private Integer warningCount;
|
||||
private String startAirport;
|
||||
private String endAirport;
|
||||
private String desPort;
|
||||
private String routeName;
|
||||
private String airType;
|
||||
private Integer pieceNumber;
|
||||
private BigDecimal volume;
|
||||
private BigDecimal actualWeight;
|
||||
private BigDecimal actualVolume;
|
||||
private BigDecimal volumeWeight;
|
||||
private String airCompany;
|
||||
private String sendManCode;
|
||||
private String acceptManCode;
|
||||
private String dataFrom;
|
||||
private String createManCode;
|
||||
private Date createTime;
|
||||
private String modifierCode;
|
||||
private Date modifyTime;
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.bms.price.airbill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/** 空运提单财务表 srv_bill_air_finance */
|
||||
@Data
|
||||
public class SrvBillAirFinance
|
||||
{
|
||||
private String guid;
|
||||
private String billCode;
|
||||
private Integer blCheck;
|
||||
private String checkRemark;
|
||||
private Integer blConfirm;
|
||||
private String confirmManCode;
|
||||
private Date confirmTime;
|
||||
private BigDecimal price;
|
||||
private BigDecimal amount;
|
||||
private String calcExp;
|
||||
private String calcRe;
|
||||
private String priceRemark;
|
||||
private BigDecimal baoguanFee;
|
||||
private BigDecimal baoguanOtherFee;
|
||||
private BigDecimal stockFee;
|
||||
private BigDecimal desPortAgentFee;
|
||||
private BigDecimal airOtherFee;
|
||||
private BigDecimal otherFee;
|
||||
private String compensateRemark;
|
||||
private String chargeManCode;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.bms.price.airbill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/** 空运航班干线表 srv_bill_air_flight */
|
||||
@Data
|
||||
public class SrvBillAirFlight
|
||||
{
|
||||
private String guid;
|
||||
private String billCode;
|
||||
private String airNo;
|
||||
private String actualAirNo;
|
||||
private String airOmpanyAgent;
|
||||
private String desPortAgentCode;
|
||||
private String boardNo;
|
||||
private Integer bandBoxCount;
|
||||
private BigDecimal bandVolume;
|
||||
private BigDecimal bandBoxWeight;
|
||||
private BigDecimal divisorValue;
|
||||
private Date firstLandingTime;
|
||||
private Date secondTakeoffTime;
|
||||
private Date airDelayTime;
|
||||
private String trunkDestinations;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.bms.price.airbill.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/** 空运提单操作派送表 srv_bill_air_op */
|
||||
@Data
|
||||
public class SrvBillAirOp
|
||||
{
|
||||
private String guid;
|
||||
private String billCode;
|
||||
private Integer blRetrieval;
|
||||
private Date retrievalDate;
|
||||
private String retrievalManCode;
|
||||
private Integer pickBoxCount;
|
||||
private Integer pickCountReal;
|
||||
private String declareCode;
|
||||
private String clearanceCode;
|
||||
private String qingguanAgent;
|
||||
private String clearanceOpCode;
|
||||
private String stockAddr;
|
||||
private String stockOutRemark;
|
||||
private Integer deliverCount;
|
||||
private Integer firstDeliverCount;
|
||||
private Integer lastDeliverCount;
|
||||
private String acDeliverDiff;
|
||||
private String deliverEndDiff;
|
||||
private Integer checkOrderCount;
|
||||
private Integer checkLeaveCount;
|
||||
private Date internalCheckTime;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.bms.price.airbill.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/** 空运提单时效轨迹表 srv_bill_air_track */
|
||||
@Data
|
||||
public class SrvBillAirTrack
|
||||
{
|
||||
private String guid;
|
||||
private String billCode;
|
||||
private Date startTimePlan;
|
||||
private Date arriveTimePlan;
|
||||
private Date shippingDate;
|
||||
private Date startTime;
|
||||
private Date arriveTime;
|
||||
private Date arriveStockTime;
|
||||
private Date clearanceTime;
|
||||
private Date endOprateTime;
|
||||
private Integer blBgfx;
|
||||
private Date bgfxTime;
|
||||
private Date updateTimeBgfx;
|
||||
private Integer blSjqf;
|
||||
private Date sjqfTime;
|
||||
private Date updateTimeSjqf;
|
||||
private Integer blSjdd;
|
||||
private Date sjddTime;
|
||||
private Date updateTimeSjdd;
|
||||
private Integer blTzdc;
|
||||
private Date tzdcTime;
|
||||
private String updateTimeTzdc;
|
||||
private Integer blThdc;
|
||||
private Date thdcTime;
|
||||
private Date updateTimeThdc;
|
||||
private Integer blQgwc;
|
||||
private Date qgwcTime;
|
||||
private Date updateTimeQgwc;
|
||||
private Integer blGxfc;
|
||||
private Date gxfcTime;
|
||||
private String updateTimeGxfc;
|
||||
private Integer blFjh;
|
||||
private Date fjhTime;
|
||||
private String updateTimeFjh;
|
||||
private Integer blTrackGenBg;
|
||||
private Integer blTrackGenBgfx;
|
||||
private Integer blTrackGenQf;
|
||||
private Integer blTrackGenDd;
|
||||
private Integer blTrackGenQg;
|
||||
private Integer blTrackGenDc;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.bms.price.airbill.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Oracle WEISHI_USER.TAB_BILL_AIR 只读
|
||||
*/
|
||||
public interface OracleBillAirMapper
|
||||
{
|
||||
List<Map<String, Object>> selectAllBillAir();
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.bms.price.airbill.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.price.airbill.domain.SrvBillAir;
|
||||
import com.bms.price.airbill.domain.SrvBillAirFinance;
|
||||
import com.bms.price.airbill.domain.SrvBillAirFlight;
|
||||
import com.bms.price.airbill.domain.SrvBillAirOp;
|
||||
import com.bms.price.airbill.domain.SrvBillAirTrack;
|
||||
|
||||
/**
|
||||
* 空运提单镜像表 upsert
|
||||
*/
|
||||
public interface SrvBillAirSyncMapper
|
||||
{
|
||||
int upsertBillAir(@Param("list") List<SrvBillAir> list);
|
||||
|
||||
int upsertBillAirFinance(@Param("list") List<SrvBillAirFinance> list);
|
||||
|
||||
int upsertBillAirFlight(@Param("list") List<SrvBillAirFlight> list);
|
||||
|
||||
int upsertBillAirOp(@Param("list") List<SrvBillAirOp> list);
|
||||
|
||||
int upsertBillAirTrack(@Param("list") List<SrvBillAirTrack> list);
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
package com.bms.price.airbill.sync;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bms.price.airbill.domain.SrvBillAir;
|
||||
import com.bms.price.airbill.domain.SrvBillAirFinance;
|
||||
import com.bms.price.airbill.domain.SrvBillAirFlight;
|
||||
import com.bms.price.airbill.domain.SrvBillAirOp;
|
||||
import com.bms.price.airbill.domain.SrvBillAirTrack;
|
||||
|
||||
/**
|
||||
* Oracle TAB_BILL_AIR -> srv_bill_air* 全量同步编排(按 guid 幂等 upsert)
|
||||
*/
|
||||
@Service
|
||||
public class BillAirSyncService
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(BillAirSyncService.class);
|
||||
|
||||
@Autowired
|
||||
private OracleBillAirReader reader;
|
||||
|
||||
@Autowired
|
||||
private BillAirSyncWriter writer;
|
||||
|
||||
public String syncFromOracle()
|
||||
{
|
||||
long start = System.currentTimeMillis();
|
||||
List<Map<String, Object>> rows = reader.readAll();
|
||||
List<SrvBillAir> airList = new ArrayList<>(rows.size());
|
||||
List<SrvBillAirFinance> financeList = new ArrayList<>(rows.size());
|
||||
List<SrvBillAirFlight> flightList = new ArrayList<>(rows.size());
|
||||
List<SrvBillAirOp> opList = new ArrayList<>(rows.size());
|
||||
List<SrvBillAirTrack> trackList = new ArrayList<>(rows.size());
|
||||
int skip = 0;
|
||||
for (Map<String, Object> row : rows)
|
||||
{
|
||||
String guid = str(row, "GUID");
|
||||
String billCode = str(row, "BILL_CODE");
|
||||
if (guid == null || billCode == null)
|
||||
{
|
||||
skip++;
|
||||
continue;
|
||||
}
|
||||
airList.add(toAir(row, guid, billCode));
|
||||
financeList.add(toFinance(row, guid, billCode));
|
||||
flightList.add(toFlight(row, guid, billCode));
|
||||
opList.add(toOp(row, guid, billCode));
|
||||
trackList.add(toTrack(row, guid, billCode));
|
||||
}
|
||||
int airN = writer.writeAir(airList);
|
||||
int finN = writer.writeFinance(financeList);
|
||||
int flightN = writer.writeFlight(flightList);
|
||||
int opN = writer.writeOp(opList);
|
||||
int trackN = writer.writeTrack(trackList);
|
||||
String summary = String.format(
|
||||
"billAir sync done: oracle=%d skip=%d air=%d finance=%d flight=%d op=%d track=%d costMs=%d",
|
||||
rows.size(), skip, airN, finN, flightN, opN, trackN, System.currentTimeMillis() - start);
|
||||
log.info(summary);
|
||||
return summary;
|
||||
}
|
||||
|
||||
private static SrvBillAir toAir(Map<String, Object> row, String guid, String billCode)
|
||||
{
|
||||
SrvBillAir a = new SrvBillAir();
|
||||
a.setGuid(guid);
|
||||
a.setBillCode(billCode);
|
||||
a.setBillType(integer(row, "BILL_TYPE"));
|
||||
a.setBlStatus(integer(row, "BL_STATUS"));
|
||||
a.setWarningStatus(integer(row, "WARNING_STATUS"));
|
||||
a.setWarningCount(integer(row, "WARNING_COUNT"));
|
||||
a.setStartAirport(str(row, "START_AIRPORT"));
|
||||
a.setEndAirport(str(row, "END_AIRPORT"));
|
||||
a.setDesPort(str(row, "DES_PORT"));
|
||||
a.setRouteName(str(row, "ROUTE_NAME"));
|
||||
a.setAirType(str(row, "AIR_TYPE"));
|
||||
a.setPieceNumber(integer(row, "PIECE_NUMBER"));
|
||||
a.setVolume(decimal(row, "VOLUME"));
|
||||
a.setActualWeight(decimal(row, "ACTUAL_WEIGHT"));
|
||||
a.setActualVolume(decimal(row, "ACTUAL_VOLUME"));
|
||||
a.setVolumeWeight(decimal(row, "VOLUME_WEIGHT"));
|
||||
a.setAirCompany(str(row, "AIR_COMPANY"));
|
||||
a.setSendManCode(str(row, "SEND_MAN_CODE"));
|
||||
a.setAcceptManCode(str(row, "ACCEPT_MAN_CODE"));
|
||||
a.setDataFrom(str(row, "DATA_FROM"));
|
||||
a.setCreateManCode(str(row, "CREATE_MAN_CODE"));
|
||||
a.setCreateTime(date(row, "CREATE_TIME"));
|
||||
a.setModifierCode(str(row, "MODIFIER_CODE"));
|
||||
a.setModifyTime(date(row, "MODIFY_TIME"));
|
||||
a.setRemark(str(row, "REMARK"));
|
||||
return a;
|
||||
}
|
||||
|
||||
private static SrvBillAirFinance toFinance(Map<String, Object> row, String guid, String billCode)
|
||||
{
|
||||
SrvBillAirFinance f = new SrvBillAirFinance();
|
||||
f.setGuid(guid);
|
||||
f.setBillCode(billCode);
|
||||
f.setBlCheck(integer(row, "BL_CHECK"));
|
||||
f.setCheckRemark(str(row, "CHECK_REMARK"));
|
||||
f.setBlConfirm(integer(row, "BL_CONFIRM"));
|
||||
f.setConfirmManCode(str(row, "CONFIRM_MAN_CODE"));
|
||||
f.setConfirmTime(date(row, "CONFIRM_TIME"));
|
||||
f.setPrice(decimal(row, "PRICE"));
|
||||
f.setAmount(decimal(row, "AMOUNT"));
|
||||
f.setCalcExp(str(row, "CALC_EXP"));
|
||||
f.setCalcRe(asText(row, "CALC_RE"));
|
||||
f.setPriceRemark(str(row, "PRICE_REMARK"));
|
||||
f.setBaoguanFee(decimal(row, "BAOGUAN_FEE"));
|
||||
f.setBaoguanOtherFee(decimal(row, "BAOGUAN_OTHER_FEE"));
|
||||
f.setStockFee(decimal(row, "STOCK_FEE"));
|
||||
f.setDesPortAgentFee(decimal(row, "DES_PORT_AGENT_FEE"));
|
||||
f.setAirOtherFee(decimal(row, "AIR_OTHER_FEE"));
|
||||
f.setOtherFee(decimal(row, "OTHER_FEE"));
|
||||
f.setCompensateRemark(str(row, "COMPENSATE_REMARK"));
|
||||
f.setChargeManCode(str(row, "CHARGE_MAN_CODE"));
|
||||
return f;
|
||||
}
|
||||
|
||||
private static SrvBillAirFlight toFlight(Map<String, Object> row, String guid, String billCode)
|
||||
{
|
||||
SrvBillAirFlight fl = new SrvBillAirFlight();
|
||||
fl.setGuid(guid);
|
||||
fl.setBillCode(billCode);
|
||||
fl.setAirNo(str(row, "AIR_NO"));
|
||||
fl.setActualAirNo(str(row, "ACTUAL_AIR_NO"));
|
||||
fl.setAirOmpanyAgent(str(row, "AIR_OMPANY_AGENT"));
|
||||
fl.setDesPortAgentCode(str(row, "DES_PORT_AGENT"));
|
||||
fl.setBoardNo(str(row, "BOARD_NO"));
|
||||
fl.setBandBoxCount(integer(row, "BAND_BOX_COUNT"));
|
||||
fl.setBandVolume(decimal(row, "BAND_VOLUME"));
|
||||
fl.setBandBoxWeight(decimal(row, "BAND_BOX_WEIGHT"));
|
||||
fl.setDivisorValue(decimal(row, "DIVISOR_VALUE"));
|
||||
fl.setFirstLandingTime(date(row, "FIRST_LANDING_TIME"));
|
||||
fl.setSecondTakeoffTime(date(row, "SECOND_TAKEOFF_TIME"));
|
||||
fl.setAirDelayTime(date(row, "AIR_DELAY_TIME"));
|
||||
fl.setTrunkDestinations(str(row, "TRUNK_DESTINATIONS"));
|
||||
return fl;
|
||||
}
|
||||
|
||||
private static SrvBillAirOp toOp(Map<String, Object> row, String guid, String billCode)
|
||||
{
|
||||
SrvBillAirOp o = new SrvBillAirOp();
|
||||
o.setGuid(guid);
|
||||
o.setBillCode(billCode);
|
||||
o.setBlRetrieval(integer(row, "BL_RETRIEVAL"));
|
||||
o.setRetrievalDate(date(row, "RETRIEVAL_DATE"));
|
||||
o.setRetrievalManCode(str(row, "RETRIEVAL_MAN_CODE"));
|
||||
o.setPickBoxCount(integer(row, "PICK_BOX_COUNT"));
|
||||
o.setPickCountReal(integer(row, "PICK_COUNT_REAL"));
|
||||
o.setDeclareCode(str(row, "DECLARE_CODE"));
|
||||
o.setClearanceCode(str(row, "CLEARANCE_CODE"));
|
||||
o.setQingguanAgent(str(row, "QINGGUAN_AGENT"));
|
||||
o.setClearanceOpCode(str(row, "CLEARANCE_OP_CODE"));
|
||||
o.setStockAddr(str(row, "STOCK_ADDR"));
|
||||
o.setStockOutRemark(str(row, "STOCK_OUT_REMARK"));
|
||||
o.setDeliverCount(integer(row, "DELIVER_COUNT"));
|
||||
o.setFirstDeliverCount(integer(row, "FIRST_DELIVER_COUNT"));
|
||||
o.setLastDeliverCount(integer(row, "LAST_DELIVER_COUNT"));
|
||||
o.setAcDeliverDiff(asText(row, "AC_DELIVER_DIFF"));
|
||||
o.setDeliverEndDiff(asText(row, "DELIVER_END_DIFF"));
|
||||
o.setCheckOrderCount(integer(row, "CHECK_ORDER_COUNT"));
|
||||
o.setCheckLeaveCount(integer(row, "CHECK_LEAVE_COUNT"));
|
||||
o.setInternalCheckTime(date(row, "INTERNAL_CHECK_TIME"));
|
||||
return o;
|
||||
}
|
||||
|
||||
private static SrvBillAirTrack toTrack(Map<String, Object> row, String guid, String billCode)
|
||||
{
|
||||
SrvBillAirTrack t = new SrvBillAirTrack();
|
||||
t.setGuid(guid);
|
||||
t.setBillCode(billCode);
|
||||
t.setStartTimePlan(date(row, "START_TIME_PLAN"));
|
||||
t.setArriveTimePlan(date(row, "ARRIVE_TIME_PLAN"));
|
||||
t.setShippingDate(date(row, "SHIPPING_DATE"));
|
||||
t.setStartTime(date(row, "START_TIME"));
|
||||
t.setArriveTime(date(row, "ARRIVE_TIME"));
|
||||
t.setArriveStockTime(date(row, "ARRIVE_STOCK_TIME"));
|
||||
t.setClearanceTime(date(row, "CLEARANCE_TIME"));
|
||||
t.setEndOprateTime(date(row, "END_OPRATE_TIME"));
|
||||
t.setBlBgfx(integer(row, "BL_BGFX"));
|
||||
t.setBgfxTime(date(row, "BGFX_TIME"));
|
||||
t.setUpdateTimeBgfx(date(row, "UPDATE_TIME_BGFX"));
|
||||
t.setBlSjqf(integer(row, "BL_SJQF"));
|
||||
t.setSjqfTime(date(row, "SJQF_TIME"));
|
||||
t.setUpdateTimeSjqf(date(row, "UPDATE_TIME_SJQF"));
|
||||
t.setBlSjdd(integer(row, "BL_SJDD"));
|
||||
t.setSjddTime(date(row, "SJDD_TIME"));
|
||||
t.setUpdateTimeSjdd(date(row, "UPDATE_TIME_SJDD"));
|
||||
t.setBlTzdc(integer(row, "BL_TZDC"));
|
||||
t.setTzdcTime(date(row, "TZDC_TIME"));
|
||||
t.setUpdateTimeTzdc(dateText(row, "UPDATE_TIME_TZDC"));
|
||||
t.setBlThdc(integer(row, "BL_THDC"));
|
||||
t.setThdcTime(date(row, "THDC_TIME"));
|
||||
t.setUpdateTimeThdc(date(row, "UPDATE_TIME_THDC"));
|
||||
t.setBlQgwc(integer(row, "BL_QGWC"));
|
||||
t.setQgwcTime(date(row, "QGWC_TIME"));
|
||||
t.setUpdateTimeQgwc(date(row, "UPDATE_TIME_QGWC"));
|
||||
t.setBlGxfc(integer(row, "BL_GXFC"));
|
||||
t.setGxfcTime(date(row, "GXFC_TIME"));
|
||||
t.setUpdateTimeGxfc(dateText(row, "UPDATE_TIME_GXFC"));
|
||||
t.setBlFjh(integer(row, "BL_FJH"));
|
||||
t.setFjhTime(date(row, "FJH_TIME"));
|
||||
t.setUpdateTimeFjh(dateText(row, "UPDATE_TIME_FJH"));
|
||||
t.setBlTrackGenBg(integer(row, "BL_TRACK_GEN_BG"));
|
||||
t.setBlTrackGenBgfx(integer(row, "BL_TRACK_GEN_BGFX"));
|
||||
t.setBlTrackGenQf(integer(row, "BL_TRACK_GEN_QF"));
|
||||
t.setBlTrackGenDd(integer(row, "BL_TRACK_GEN_DD"));
|
||||
t.setBlTrackGenQg(integer(row, "BL_TRACK_GEN_QG"));
|
||||
t.setBlTrackGenDc(integer(row, "BL_TRACK_GEN_DC"));
|
||||
return t;
|
||||
}
|
||||
|
||||
private static String str(Map<String, Object> row, String key)
|
||||
{
|
||||
Object v = row.get(key);
|
||||
if (v == null)
|
||||
{
|
||||
v = row.get(key.toLowerCase());
|
||||
}
|
||||
if (v == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
String s = String.valueOf(v).trim();
|
||||
return s.isEmpty() ? null : s;
|
||||
}
|
||||
|
||||
private static String asText(Map<String, Object> row, String key)
|
||||
{
|
||||
Object v = get(row, key);
|
||||
if (v == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return String.valueOf(v);
|
||||
}
|
||||
|
||||
private static String dateText(Map<String, Object> row, String key)
|
||||
{
|
||||
Date d = date(row, key);
|
||||
if (d == null)
|
||||
{
|
||||
String s = str(row, key);
|
||||
return s;
|
||||
}
|
||||
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(d);
|
||||
}
|
||||
|
||||
private static Object get(Map<String, Object> row, String key)
|
||||
{
|
||||
Object v = row.get(key);
|
||||
return v != null ? v : row.get(key.toLowerCase());
|
||||
}
|
||||
|
||||
private static Integer integer(Map<String, Object> row, String key)
|
||||
{
|
||||
Object v = get(row, key);
|
||||
if (v == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (v instanceof Number)
|
||||
{
|
||||
return ((Number) v).intValue();
|
||||
}
|
||||
try
|
||||
{
|
||||
return Integer.valueOf(String.valueOf(v).trim());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static BigDecimal decimal(Map<String, Object> row, String key)
|
||||
{
|
||||
Object v = get(row, key);
|
||||
if (v == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (v instanceof BigDecimal)
|
||||
{
|
||||
return (BigDecimal) v;
|
||||
}
|
||||
if (v instanceof Number)
|
||||
{
|
||||
return BigDecimal.valueOf(((Number) v).doubleValue());
|
||||
}
|
||||
try
|
||||
{
|
||||
return new BigDecimal(String.valueOf(v).trim());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Date date(Map<String, Object> row, String key)
|
||||
{
|
||||
Object v = get(row, key);
|
||||
if (v == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (v instanceof Date)
|
||||
{
|
||||
return (Date) v;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.bms.price.airbill.sync;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.bms.price.airbill.domain.SrvBillAir;
|
||||
import com.bms.price.airbill.domain.SrvBillAirFinance;
|
||||
import com.bms.price.airbill.domain.SrvBillAirFlight;
|
||||
import com.bms.price.airbill.domain.SrvBillAirOp;
|
||||
import com.bms.price.airbill.domain.SrvBillAirTrack;
|
||||
import com.bms.price.airbill.mapper.SrvBillAirSyncMapper;
|
||||
|
||||
/**
|
||||
* 空运提单镜像表写库(MASTER,分批 upsert)
|
||||
*/
|
||||
@Service
|
||||
public class BillAirSyncWriter
|
||||
{
|
||||
private static final int BATCH_SIZE = 200;
|
||||
|
||||
@Autowired
|
||||
private SrvBillAirSyncMapper mapper;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int writeAir(List<SrvBillAir> list)
|
||||
{
|
||||
return batch(list, mapper::upsertBillAir);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int writeFinance(List<SrvBillAirFinance> list)
|
||||
{
|
||||
return batch(list, mapper::upsertBillAirFinance);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int writeFlight(List<SrvBillAirFlight> list)
|
||||
{
|
||||
return batch(list, mapper::upsertBillAirFlight);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int writeOp(List<SrvBillAirOp> list)
|
||||
{
|
||||
return batch(list, mapper::upsertBillAirOp);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int writeTrack(List<SrvBillAirTrack> list)
|
||||
{
|
||||
return batch(list, mapper::upsertBillAirTrack);
|
||||
}
|
||||
|
||||
private <T> int batch(List<T> list, java.util.function.ToIntFunction<List<T>> fn)
|
||||
{
|
||||
int rows = 0;
|
||||
for (int from = 0; from < list.size(); from += BATCH_SIZE)
|
||||
{
|
||||
rows += fn.applyAsInt(list.subList(from, Math.min(from + BATCH_SIZE, list.size())));
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.bms.price.airbill.sync;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.bms.common.annotation.DataSource;
|
||||
import com.bms.common.enums.DataSourceType;
|
||||
import com.bms.price.airbill.mapper.OracleBillAirMapper;
|
||||
|
||||
/**
|
||||
* Oracle 空运提单只读(SLAVE)。独立 Bean,保证 @DataSource 切面生效。
|
||||
*/
|
||||
@Service
|
||||
public class OracleBillAirReader
|
||||
{
|
||||
@Autowired
|
||||
private OracleBillAirMapper oracleBillAirMapper;
|
||||
|
||||
@DataSource(DataSourceType.SLAVE)
|
||||
public List<Map<String, Object>> readAll()
|
||||
{
|
||||
try
|
||||
{
|
||||
PageHelper.clearPage();
|
||||
return oracleBillAirMapper.selectAllBillAir();
|
||||
}
|
||||
finally
|
||||
{
|
||||
PageHelper.clearPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.bms.price.airbill.task;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.bms.common.utils.StringUtils;
|
||||
import com.bms.price.airbill.sync.BillAirSyncService;
|
||||
|
||||
/**
|
||||
* 老系统空运提单每日同步任务。
|
||||
* sys_job.invoke_target = billAirSyncTask.syncFromOracle()
|
||||
*/
|
||||
@Component("billAirSyncTask")
|
||||
public class BillAirSyncTask
|
||||
{
|
||||
@Autowired
|
||||
private BillAirSyncService billAirSyncService;
|
||||
|
||||
/**
|
||||
* 全量同步 Oracle TAB_BILL_AIR -> srv_bill_air / finance / flight / op / track
|
||||
*/
|
||||
public void syncFromOracle()
|
||||
{
|
||||
String summary = billAirSyncService.syncFromOracle();
|
||||
if (StringUtils.isEmpty(summary))
|
||||
{
|
||||
throw new RuntimeException("老系统空运提单同步未返回结果");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.bms.price.domain.vo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空运提单查询条件
|
||||
*/
|
||||
@Data
|
||||
public class SrvBillAirQuery
|
||||
{
|
||||
/** 提单号(单个,模糊) */
|
||||
private String billCode;
|
||||
|
||||
/** 提单号列表(精确) */
|
||||
private List<String> billCodes;
|
||||
|
||||
/** 提单类型 */
|
||||
private Integer billType;
|
||||
|
||||
/** 始发机场 */
|
||||
private String startAirport;
|
||||
|
||||
/** 目的机场 */
|
||||
private String endAirport;
|
||||
|
||||
/** 目的港 */
|
||||
private String desPort;
|
||||
|
||||
/** 航线名称 */
|
||||
private String routeName;
|
||||
|
||||
/** 航空公司 */
|
||||
private String airCompany;
|
||||
|
||||
/** 航班号 */
|
||||
private String airNo;
|
||||
|
||||
/** 发货日期起 */
|
||||
private String shippingDateBegin;
|
||||
|
||||
/** 发货日期止 */
|
||||
private String shippingDateEnd;
|
||||
|
||||
/** 创建时间起 */
|
||||
private String createTimeBegin;
|
||||
|
||||
/** 创建时间止 */
|
||||
private String createTimeEnd;
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.bms.price.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 空运提单列表/详情视图(srv_bill_air + finance/flight/op/track)
|
||||
*/
|
||||
@Data
|
||||
public class SrvBillAirVo
|
||||
{
|
||||
/** 主键 */
|
||||
private String guid;
|
||||
|
||||
/** 提单号 */
|
||||
private String billCode;
|
||||
|
||||
/** 提单类型 */
|
||||
private Integer billType;
|
||||
|
||||
/** 状态 */
|
||||
private Integer blStatus;
|
||||
|
||||
/** 始发机场 */
|
||||
private String startAirport;
|
||||
|
||||
/** 目的机场 */
|
||||
private String endAirport;
|
||||
|
||||
/** 目的港 */
|
||||
private String desPort;
|
||||
|
||||
/** 航线名称 */
|
||||
private String routeName;
|
||||
|
||||
/** 航空公司 */
|
||||
private String airCompany;
|
||||
|
||||
/** 报关费 */
|
||||
private BigDecimal baoguanFee;
|
||||
|
||||
/** 报关其他费用 */
|
||||
private BigDecimal baoguanOtherFee;
|
||||
|
||||
/** 仓储费 */
|
||||
private BigDecimal stockFee;
|
||||
|
||||
/** 目的港代理费 */
|
||||
private BigDecimal desPortAgentFee;
|
||||
|
||||
/** 空运其他费用 */
|
||||
private BigDecimal airOtherFee;
|
||||
|
||||
/** 其他费用 */
|
||||
private BigDecimal otherFee;
|
||||
|
||||
/** 总件数 */
|
||||
private Integer pieceNumber;
|
||||
|
||||
/** 总体积 */
|
||||
private BigDecimal volume;
|
||||
|
||||
/** 实际重量 */
|
||||
private BigDecimal actualWeight;
|
||||
|
||||
/** 实际体积 */
|
||||
private BigDecimal actualVolume;
|
||||
|
||||
/** 体积重 */
|
||||
private BigDecimal volumeWeight;
|
||||
|
||||
/** 首程落地时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date firstLandingTime;
|
||||
|
||||
/** 航班号 */
|
||||
private String airNo;
|
||||
|
||||
/** 实际航班号 */
|
||||
private String actualAirNo;
|
||||
|
||||
/** 航空公司代理 */
|
||||
private String airCompanyAgent;
|
||||
|
||||
/** 目的港代理编码 */
|
||||
private String desPortAgentCode;
|
||||
|
||||
/** 报关公司编码 */
|
||||
private String declareCode;
|
||||
|
||||
/** 清关编码 */
|
||||
private String clearanceCode;
|
||||
|
||||
/** 清关代理 */
|
||||
private String qingguanAgent;
|
||||
|
||||
/** 出仓仓库地址 */
|
||||
private String stockAddr;
|
||||
|
||||
/** 发货日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date shippingDate;
|
||||
|
||||
/** 起飞时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 到达时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date arriveTime;
|
||||
|
||||
/** 到仓时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date arriveStockTime;
|
||||
|
||||
/** 清关时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date clearanceTime;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 修改时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
/** 总备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.bms.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.price.domain.vo.SrvBillAirQuery;
|
||||
import com.bms.price.domain.vo.SrvBillAirVo;
|
||||
|
||||
/**
|
||||
* 空运提单 Mapper
|
||||
*/
|
||||
public interface SrvBillAirMapper
|
||||
{
|
||||
List<SrvBillAirVo> selectSrvBillAirList(SrvBillAirQuery query);
|
||||
|
||||
SrvBillAirVo selectSrvBillAirByBillCode(String billCode);
|
||||
|
||||
SrvBillAirVo selectSrvBillAirByGuid(String guid);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.bms.price.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.price.domain.vo.SrvBillAirQuery;
|
||||
import com.bms.price.domain.vo.SrvBillAirVo;
|
||||
|
||||
/**
|
||||
* 空运提单 Service
|
||||
*/
|
||||
public interface ISrvBillAirService
|
||||
{
|
||||
List<SrvBillAirVo> selectSrvBillAirList(SrvBillAirQuery query);
|
||||
|
||||
SrvBillAirVo selectSrvBillAirByBillCode(String billCode);
|
||||
|
||||
SrvBillAirVo selectSrvBillAirByGuid(String guid);
|
||||
}
|
||||
+29
-9
@@ -207,7 +207,11 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
assertOrderBillEditable(request.getOrderNo());
|
||||
PrcOrderBill existed = orderBillMapper.selectPrcOrderBillByOrderNo(request.getOrderNo());
|
||||
BigDecimal systemWeight = request.getWeight();
|
||||
BigDecimal calcWeight = resolveCalcWeight(existed, systemWeight);
|
||||
// Upstream Oracle sync: always use TAB_ORDER weight (same overwrite as weight/charge_weight).
|
||||
// Local rebill / manual charge_weight edit: keep resolveCalcWeight preference.
|
||||
BigDecimal calcWeight = isUpstreamSyncRequest(request)
|
||||
? systemWeight
|
||||
: resolveCalcWeight(existed, systemWeight);
|
||||
// Three-side sum rule disabled: upstream already applies it.
|
||||
// Manual charge_weight wins; otherwise apply active biz rules (e.g. three-side).
|
||||
// if (!isManualChargeWeight(existed))
|
||||
@@ -1755,7 +1759,7 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
}
|
||||
bill.setBillKey(billKey);
|
||||
bill.setOrderNo(orderNo);
|
||||
// Upstream header overwrite (no validate); charge_weight kept via resolvePersistChargeWeight below.
|
||||
// Upstream header overwrite (no validate).
|
||||
applyUpstreamBillHeaderFields(bill, request);
|
||||
Long customerId = request.getCustomerId();
|
||||
if (customerId == null && result != null)
|
||||
@@ -1798,7 +1802,8 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
{
|
||||
bill.setCountryName(result.getCountryName());
|
||||
}
|
||||
// weight = system/original; charge_weight = effective (may be manual override)
|
||||
// weight = system/original; charge_weight follows weight on upstream sync,
|
||||
// otherwise may keep manual override via resolvePersistChargeWeight.
|
||||
bill.setWeight(weight);
|
||||
bill.setBizDate(bizDate);
|
||||
bill.setTmsId(request.getTmsId() == null ? null : Long.valueOf(request.getTmsId()));
|
||||
@@ -1816,7 +1821,14 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
bill.setWeightMax(result.getWeightMax());
|
||||
bill.setWeightLabel(result.getWeightLabel());
|
||||
bill.setEffectiveDate(result.getEffectiveDate());
|
||||
if (isUpstreamSyncRequest(request))
|
||||
{
|
||||
bill.setChargeWeight(weight);
|
||||
}
|
||||
else
|
||||
{
|
||||
bill.setChargeWeight(resolvePersistChargeWeight(weight, result.getChargeWeight()));
|
||||
}
|
||||
Integer billingFailStatus = result.getBillingFailStatus();
|
||||
if (billingFailStatus == null)
|
||||
{
|
||||
@@ -2797,6 +2809,12 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
payBillFeeMapper.selectByBillId(bill.getBillId()));
|
||||
}
|
||||
|
||||
/** Upstream Oracle row present => sync/billing path that overwrites weight & charge_weight together. */
|
||||
private static boolean isUpstreamSyncRequest(TmsPriceBillRequest request)
|
||||
{
|
||||
return request != null && request.getUpstreamRow() != null && !request.getUpstreamRow().isEmpty();
|
||||
}
|
||||
|
||||
/** charge_weight differs from weight => treated as manual override. */
|
||||
private static boolean isManualChargeWeight(PrcOrderBill bill)
|
||||
{
|
||||
@@ -3011,15 +3029,12 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
applyProductCodeMapping(bill, request);
|
||||
Long customerId = resolveCustomerIdByCode(request.getCustomerCode(), bill.getCustomerId());
|
||||
bill.setCustomerId(customerId == null ? Long.valueOf(0L) : customerId);
|
||||
// System weight overwrite; charge_weight keeps existing manual override when present.
|
||||
// Order-source sync: overwrite weight and charge_weight the same way from upstream.
|
||||
if (request.getWeight() != null)
|
||||
{
|
||||
bill.setWeight(request.getWeight());
|
||||
if (creating || bill.getChargeWeight() == null)
|
||||
{
|
||||
bill.setChargeWeight(request.getWeight());
|
||||
}
|
||||
}
|
||||
if (creating)
|
||||
{
|
||||
Date bizDate = request.getPickupDate() != null ? request.getPickupDate() : new Date();
|
||||
@@ -3131,8 +3146,12 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
{
|
||||
bill.setCustomerActiveStatus(BillCustomerActiveStatus.ACTIVE.getCode());
|
||||
}
|
||||
// Soft-fail snapshot: overwrite system weight; do not touch charge_weight (keep current logic).
|
||||
// Soft-fail snapshot: overwrite weight and charge_weight the same way from upstream.
|
||||
bill.setWeight(request.getWeight());
|
||||
if (request.getWeight() != null)
|
||||
{
|
||||
bill.setChargeWeight(request.getWeight());
|
||||
}
|
||||
Date bizDate = StringUtils.isEmpty(request.getBizDate()) ? new Date() : resolveBizDate(request.getBizDate());
|
||||
bill.setBizDate(bizDate);
|
||||
if (StringUtils.isEmpty(bill.getCurrency()))
|
||||
@@ -3191,7 +3210,7 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
}
|
||||
|
||||
/**
|
||||
* Locked by AR bill: overwrite upstream header + ext; keep amounts / fees / charge_weight.
|
||||
* Locked by AR bill: overwrite upstream header + ext + weight/charge_weight; keep amounts / fees.
|
||||
*/
|
||||
private void persistFailedSnapshotWhenLocked(PrcOrderBill bill, TmsPriceBillRequest request,
|
||||
int billingFailStatus, String errorMessage)
|
||||
@@ -3203,6 +3222,7 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
if (request.getWeight() != null)
|
||||
{
|
||||
bill.setWeight(request.getWeight());
|
||||
bill.setChargeWeight(request.getWeight());
|
||||
}
|
||||
}
|
||||
applyBillingFailText(bill, billingFailStatus, errorMessage);
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.bms.price.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bms.price.domain.vo.SrvBillAirQuery;
|
||||
import com.bms.price.domain.vo.SrvBillAirVo;
|
||||
import com.bms.price.mapper.SrvBillAirMapper;
|
||||
import com.bms.price.service.ISrvBillAirService;
|
||||
|
||||
/**
|
||||
* 空运提单 Service 实现
|
||||
*/
|
||||
@Service
|
||||
public class SrvBillAirServiceImpl implements ISrvBillAirService
|
||||
{
|
||||
@Autowired
|
||||
private SrvBillAirMapper srvBillAirMapper;
|
||||
|
||||
@Override
|
||||
public List<SrvBillAirVo> selectSrvBillAirList(SrvBillAirQuery query)
|
||||
{
|
||||
return srvBillAirMapper.selectSrvBillAirList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SrvBillAirVo selectSrvBillAirByBillCode(String billCode)
|
||||
{
|
||||
return srvBillAirMapper.selectSrvBillAirByBillCode(billCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SrvBillAirVo selectSrvBillAirByGuid(String guid)
|
||||
{
|
||||
return srvBillAirMapper.selectSrvBillAirByGuid(guid);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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.bms.price.airbill.mapper.OracleBillAirMapper">
|
||||
|
||||
<select id="selectAllBillAir" resultType="java.util.HashMap" fetchSize="500">
|
||||
SELECT GUID, BILL_CODE, BILL_TYPE, BL_STATUS, WARNING_STATUS, WARNING_COUNT,
|
||||
START_AIRPORT, END_AIRPORT, DES_PORT, ROUTE_NAME, AIR_TYPE,
|
||||
PIECE_NUMBER, VOLUME, ACTUAL_WEIGHT, ACTUAL_VOLUME, VOLUME_WEIGHT,
|
||||
AIR_COMPANY, SEND_MAN_CODE, ACCEPT_MAN_CODE, DATA_FROM,
|
||||
CREATE_MAN_CODE, CREATE_TIME, MODIFIER_CODE, MODIFY_TIME, REMARK,
|
||||
BL_CHECK, CHECK_REMARK, BL_CONFIRM, CONFIRM_MAN_CODE, CONFIRM_TIME,
|
||||
PRICE, AMOUNT, CALC_EXP, CALC_RE, PRICE_REMARK,
|
||||
BAOGUAN_FEE, BAOGUAN_OTHER_FEE, STOCK_FEE, DES_PORT_AGENT_FEE,
|
||||
AIR_OTHER_FEE, OTHER_FEE, COMPENSATE_REMARK, CHARGE_MAN_CODE,
|
||||
AIR_NO, ACTUAL_AIR_NO, AIR_OMPANY_AGENT, DES_PORT_AGENT, BOARD_NO,
|
||||
BAND_BOX_COUNT, BAND_VOLUME, BAND_BOX_WEIGHT, DIVISOR_VALUE,
|
||||
FIRST_LANDING_TIME, SECOND_TAKEOFF_TIME, AIR_DELAY_TIME, TRUNK_DESTINATIONS,
|
||||
BL_RETRIEVAL, RETRIEVAL_DATE, RETRIEVAL_MAN_CODE, PICK_BOX_COUNT, PICK_COUNT_REAL,
|
||||
DECLARE_CODE, CLEARANCE_CODE, QINGGUAN_AGENT, CLEARANCE_OP_CODE,
|
||||
STOCK_ADDR, STOCK_OUT_REMARK, DELIVER_COUNT, FIRST_DELIVER_COUNT, LAST_DELIVER_COUNT,
|
||||
AC_DELIVER_DIFF, DELIVER_END_DIFF, CHECK_ORDER_COUNT, CHECK_LEAVE_COUNT, INTERNAL_CHECK_TIME,
|
||||
START_TIME_PLAN, ARRIVE_TIME_PLAN, SHIPPING_DATE, START_TIME, ARRIVE_TIME,
|
||||
ARRIVE_STOCK_TIME, CLEARANCE_TIME, END_OPRATE_TIME,
|
||||
BL_BGFX, BGFX_TIME, UPDATE_TIME_BGFX,
|
||||
BL_SJQF, SJQF_TIME, UPDATE_TIME_SJQF,
|
||||
BL_SJDD, SJDD_TIME, UPDATE_TIME_SJDD,
|
||||
BL_TZDC, TZDC_TIME, UPDATE_TIME_TZDC,
|
||||
BL_THDC, THDC_TIME, UPDATE_TIME_THDC,
|
||||
BL_QGWC, QGWC_TIME, UPDATE_TIME_QGWC,
|
||||
BL_GXFC, GXFC_TIME, UPDATE_TIME_GXFC,
|
||||
BL_FJH, FJH_TIME, UPDATE_TIME_FJH,
|
||||
BL_TRACK_GEN_BG, BL_TRACK_GEN_BGFX, BL_TRACK_GEN_QF, BL_TRACK_GEN_DD,
|
||||
BL_TRACK_GEN_QG, BL_TRACK_GEN_DC
|
||||
FROM WEISHI_USER.TAB_BILL_AIR
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,156 @@
|
||||
<?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.bms.price.mapper.SrvBillAirMapper">
|
||||
|
||||
<resultMap id="SrvBillAirResult" type="com.bms.price.domain.vo.SrvBillAirVo">
|
||||
<result property="guid" column="guid"/>
|
||||
<result property="billCode" column="bill_code"/>
|
||||
<result property="billType" column="bill_type"/>
|
||||
<result property="blStatus" column="bl_status"/>
|
||||
<result property="startAirport" column="start_airport"/>
|
||||
<result property="endAirport" column="end_airport"/>
|
||||
<result property="desPort" column="des_port"/>
|
||||
<result property="routeName" column="route_name"/>
|
||||
<result property="airCompany" column="air_company"/>
|
||||
<result property="baoguanFee" column="baoguan_fee"/>
|
||||
<result property="baoguanOtherFee" column="baoguan_other_fee"/>
|
||||
<result property="stockFee" column="stock_fee"/>
|
||||
<result property="desPortAgentFee" column="des_port_agent_fee"/>
|
||||
<result property="airOtherFee" column="air_other_fee"/>
|
||||
<result property="otherFee" column="other_fee"/>
|
||||
<result property="pieceNumber" column="piece_number"/>
|
||||
<result property="volume" column="volume"/>
|
||||
<result property="actualWeight" column="actual_weight"/>
|
||||
<result property="actualVolume" column="actual_volume"/>
|
||||
<result property="volumeWeight" column="volume_weight"/>
|
||||
<result property="firstLandingTime" column="first_landing_time"/>
|
||||
<result property="airNo" column="air_no"/>
|
||||
<result property="actualAirNo" column="actual_air_no"/>
|
||||
<result property="airCompanyAgent" column="air_ompany_agent"/>
|
||||
<result property="desPortAgentCode" column="des_port_agent_code"/>
|
||||
<result property="declareCode" column="declare_code"/>
|
||||
<result property="clearanceCode" column="clearance_code"/>
|
||||
<result property="qingguanAgent" column="qingguan_agent"/>
|
||||
<result property="stockAddr" column="stock_addr"/>
|
||||
<result property="shippingDate" column="shipping_date"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="arriveTime" column="arrive_time"/>
|
||||
<result property="arriveStockTime" column="arrive_stock_time"/>
|
||||
<result property="clearanceTime" column="clearance_time"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="modifyTime" column="modify_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAirBillVo">
|
||||
select a.guid,
|
||||
a.bill_code,
|
||||
a.bill_type,
|
||||
a.bl_status,
|
||||
a.start_airport,
|
||||
a.end_airport,
|
||||
a.des_port,
|
||||
a.route_name,
|
||||
a.air_company,
|
||||
f.baoguan_fee,
|
||||
f.baoguan_other_fee,
|
||||
f.stock_fee,
|
||||
f.des_port_agent_fee,
|
||||
f.air_other_fee,
|
||||
f.other_fee,
|
||||
a.piece_number,
|
||||
a.volume,
|
||||
a.actual_weight,
|
||||
a.actual_volume,
|
||||
a.volume_weight,
|
||||
fl.first_landing_time,
|
||||
fl.air_no,
|
||||
fl.actual_air_no,
|
||||
fl.air_ompany_agent,
|
||||
fl.des_port_agent_code,
|
||||
o.declare_code,
|
||||
o.clearance_code,
|
||||
o.qingguan_agent,
|
||||
o.stock_addr,
|
||||
t.shipping_date,
|
||||
t.start_time,
|
||||
t.arrive_time,
|
||||
t.arrive_stock_time,
|
||||
t.clearance_time,
|
||||
a.create_time,
|
||||
a.modify_time,
|
||||
a.remark
|
||||
from srv_bill_air a
|
||||
left join srv_bill_air_finance f on f.bill_code = a.bill_code
|
||||
left join srv_bill_air_flight fl on fl.bill_code = a.bill_code
|
||||
left join srv_bill_air_op o on o.bill_code = a.bill_code
|
||||
left join srv_bill_air_track t on t.bill_code = a.bill_code
|
||||
</sql>
|
||||
|
||||
<sql id="airBillWhere">
|
||||
<where>
|
||||
<if test="billCode != null and billCode != ''">
|
||||
AND a.bill_code like concat('%', #{billCode}, '%')
|
||||
</if>
|
||||
<if test="billCodes != null and billCodes.size() > 0">
|
||||
AND a.bill_code in
|
||||
<foreach collection="billCodes" item="code" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="billType != null">
|
||||
AND a.bill_type = #{billType}
|
||||
</if>
|
||||
<if test="startAirport != null and startAirport != ''">
|
||||
AND a.start_airport like concat('%', #{startAirport}, '%')
|
||||
</if>
|
||||
<if test="endAirport != null and endAirport != ''">
|
||||
AND a.end_airport like concat('%', #{endAirport}, '%')
|
||||
</if>
|
||||
<if test="desPort != null and desPort != ''">
|
||||
AND a.des_port like concat('%', #{desPort}, '%')
|
||||
</if>
|
||||
<if test="routeName != null and routeName != ''">
|
||||
AND a.route_name like concat('%', #{routeName}, '%')
|
||||
</if>
|
||||
<if test="airCompany != null and airCompany != ''">
|
||||
AND a.air_company like concat('%', #{airCompany}, '%')
|
||||
</if>
|
||||
<if test="airNo != null and airNo != ''">
|
||||
AND fl.air_no like concat('%', #{airNo}, '%')
|
||||
</if>
|
||||
<if test="shippingDateBegin != null and shippingDateBegin != ''">
|
||||
AND t.shipping_date >= #{shippingDateBegin}
|
||||
</if>
|
||||
<if test="shippingDateEnd != null and shippingDateEnd != ''">
|
||||
AND t.shipping_date <= #{shippingDateEnd}
|
||||
</if>
|
||||
<if test="createTimeBegin != null and createTimeBegin != ''">
|
||||
AND a.create_time >= #{createTimeBegin}
|
||||
</if>
|
||||
<if test="createTimeEnd != null and createTimeEnd != ''">
|
||||
AND a.create_time <= #{createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="selectSrvBillAirList" parameterType="com.bms.price.domain.vo.SrvBillAirQuery" resultMap="SrvBillAirResult">
|
||||
<include refid="selectAirBillVo"/>
|
||||
<include refid="airBillWhere"/>
|
||||
order by a.create_time desc, a.bill_code desc
|
||||
</select>
|
||||
|
||||
<select id="selectSrvBillAirByBillCode" parameterType="String" resultMap="SrvBillAirResult">
|
||||
<include refid="selectAirBillVo"/>
|
||||
where a.bill_code = #{billCode}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectSrvBillAirByGuid" parameterType="String" resultMap="SrvBillAirResult">
|
||||
<include refid="selectAirBillVo"/>
|
||||
where a.guid = #{guid}
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,220 @@
|
||||
<?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.bms.price.airbill.mapper.SrvBillAirSyncMapper">
|
||||
|
||||
<insert id="upsertBillAir">
|
||||
INSERT INTO srv_bill_air (
|
||||
guid, bill_code, bill_type, bl_status, warning_status, warning_count,
|
||||
start_airport, end_airport, des_port, route_name, air_type,
|
||||
piece_number, volume, actual_weight, actual_volume, volume_weight,
|
||||
air_company, send_man_code, accept_man_code, data_from,
|
||||
create_man_code, create_time, modifier_code, modify_time, remark
|
||||
) VALUES
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(#{it.guid}, #{it.billCode}, #{it.billType}, #{it.blStatus}, #{it.warningStatus}, #{it.warningCount},
|
||||
#{it.startAirport}, #{it.endAirport}, #{it.desPort}, #{it.routeName}, #{it.airType},
|
||||
#{it.pieceNumber}, #{it.volume}, #{it.actualWeight}, #{it.actualVolume}, #{it.volumeWeight},
|
||||
#{it.airCompany}, #{it.sendManCode}, #{it.acceptManCode}, #{it.dataFrom},
|
||||
#{it.createManCode}, #{it.createTime}, #{it.modifierCode}, #{it.modifyTime}, #{it.remark})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
bill_code = VALUES(bill_code),
|
||||
bill_type = VALUES(bill_type),
|
||||
bl_status = VALUES(bl_status),
|
||||
warning_status = VALUES(warning_status),
|
||||
warning_count = VALUES(warning_count),
|
||||
start_airport = VALUES(start_airport),
|
||||
end_airport = VALUES(end_airport),
|
||||
des_port = VALUES(des_port),
|
||||
route_name = VALUES(route_name),
|
||||
air_type = VALUES(air_type),
|
||||
piece_number = VALUES(piece_number),
|
||||
volume = VALUES(volume),
|
||||
actual_weight = VALUES(actual_weight),
|
||||
actual_volume = VALUES(actual_volume),
|
||||
volume_weight = VALUES(volume_weight),
|
||||
air_company = VALUES(air_company),
|
||||
send_man_code = VALUES(send_man_code),
|
||||
accept_man_code = VALUES(accept_man_code),
|
||||
data_from = VALUES(data_from),
|
||||
create_man_code = VALUES(create_man_code),
|
||||
create_time = VALUES(create_time),
|
||||
modifier_code = VALUES(modifier_code),
|
||||
modify_time = VALUES(modify_time),
|
||||
remark = VALUES(remark)
|
||||
</insert>
|
||||
|
||||
<insert id="upsertBillAirFinance">
|
||||
INSERT INTO srv_bill_air_finance (
|
||||
guid, bill_code, bl_check, check_remark, bl_confirm, confirm_man_code, confirm_time,
|
||||
price, amount, calc_exp, calc_re, price_remark,
|
||||
baoguan_fee, baoguan_other_fee, stock_fee, des_port_agent_fee,
|
||||
air_other_fee, other_fee, compensate_remark, charge_man_code
|
||||
) VALUES
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(#{it.guid}, #{it.billCode}, #{it.blCheck}, #{it.checkRemark}, #{it.blConfirm}, #{it.confirmManCode}, #{it.confirmTime},
|
||||
#{it.price}, #{it.amount}, #{it.calcExp}, #{it.calcRe}, #{it.priceRemark},
|
||||
#{it.baoguanFee}, #{it.baoguanOtherFee}, #{it.stockFee}, #{it.desPortAgentFee},
|
||||
#{it.airOtherFee}, #{it.otherFee}, #{it.compensateRemark}, #{it.chargeManCode})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
bill_code = VALUES(bill_code),
|
||||
bl_check = VALUES(bl_check),
|
||||
check_remark = VALUES(check_remark),
|
||||
bl_confirm = VALUES(bl_confirm),
|
||||
confirm_man_code = VALUES(confirm_man_code),
|
||||
confirm_time = VALUES(confirm_time),
|
||||
price = VALUES(price),
|
||||
amount = VALUES(amount),
|
||||
calc_exp = VALUES(calc_exp),
|
||||
calc_re = VALUES(calc_re),
|
||||
price_remark = VALUES(price_remark),
|
||||
baoguan_fee = VALUES(baoguan_fee),
|
||||
baoguan_other_fee = VALUES(baoguan_other_fee),
|
||||
stock_fee = VALUES(stock_fee),
|
||||
des_port_agent_fee = VALUES(des_port_agent_fee),
|
||||
air_other_fee = VALUES(air_other_fee),
|
||||
other_fee = VALUES(other_fee),
|
||||
compensate_remark = VALUES(compensate_remark),
|
||||
charge_man_code = VALUES(charge_man_code)
|
||||
</insert>
|
||||
|
||||
<insert id="upsertBillAirFlight">
|
||||
INSERT INTO srv_bill_air_flight (
|
||||
guid, bill_code, air_no, actual_air_no, air_ompany_agent, des_port_agent_code,
|
||||
board_no, band_box_count, band_volume, band_box_weight, divisor_value,
|
||||
first_landing_time, second_takeoff_time, air_delay_time, trunk_destinations
|
||||
) VALUES
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(#{it.guid}, #{it.billCode}, #{it.airNo}, #{it.actualAirNo}, #{it.airOmpanyAgent}, #{it.desPortAgentCode},
|
||||
#{it.boardNo}, #{it.bandBoxCount}, #{it.bandVolume}, #{it.bandBoxWeight}, #{it.divisorValue},
|
||||
#{it.firstLandingTime}, #{it.secondTakeoffTime}, #{it.airDelayTime}, #{it.trunkDestinations})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
bill_code = VALUES(bill_code),
|
||||
air_no = VALUES(air_no),
|
||||
actual_air_no = VALUES(actual_air_no),
|
||||
air_ompany_agent = VALUES(air_ompany_agent),
|
||||
des_port_agent_code = VALUES(des_port_agent_code),
|
||||
board_no = VALUES(board_no),
|
||||
band_box_count = VALUES(band_box_count),
|
||||
band_volume = VALUES(band_volume),
|
||||
band_box_weight = VALUES(band_box_weight),
|
||||
divisor_value = VALUES(divisor_value),
|
||||
first_landing_time = VALUES(first_landing_time),
|
||||
second_takeoff_time = VALUES(second_takeoff_time),
|
||||
air_delay_time = VALUES(air_delay_time),
|
||||
trunk_destinations = VALUES(trunk_destinations)
|
||||
</insert>
|
||||
|
||||
<insert id="upsertBillAirOp">
|
||||
INSERT INTO srv_bill_air_op (
|
||||
guid, bill_code, bl_retrieval, retrieval_date, retrieval_man_code,
|
||||
pick_box_count, pick_count_real, declare_code, clearance_code, qingguan_agent,
|
||||
clearance_op_code, stock_addr, stock_out_remark, deliver_count,
|
||||
first_deliver_count, last_deliver_count, ac_deliver_diff, deliver_end_diff,
|
||||
check_order_count, check_leave_count, internal_check_time
|
||||
) VALUES
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(#{it.guid}, #{it.billCode}, #{it.blRetrieval}, #{it.retrievalDate}, #{it.retrievalManCode},
|
||||
#{it.pickBoxCount}, #{it.pickCountReal}, #{it.declareCode}, #{it.clearanceCode}, #{it.qingguanAgent},
|
||||
#{it.clearanceOpCode}, #{it.stockAddr}, #{it.stockOutRemark}, #{it.deliverCount},
|
||||
#{it.firstDeliverCount}, #{it.lastDeliverCount}, #{it.acDeliverDiff}, #{it.deliverEndDiff},
|
||||
#{it.checkOrderCount}, #{it.checkLeaveCount}, #{it.internalCheckTime})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
bill_code = VALUES(bill_code),
|
||||
bl_retrieval = VALUES(bl_retrieval),
|
||||
retrieval_date = VALUES(retrieval_date),
|
||||
retrieval_man_code = VALUES(retrieval_man_code),
|
||||
pick_box_count = VALUES(pick_box_count),
|
||||
pick_count_real = VALUES(pick_count_real),
|
||||
declare_code = VALUES(declare_code),
|
||||
clearance_code = VALUES(clearance_code),
|
||||
qingguan_agent = VALUES(qingguan_agent),
|
||||
clearance_op_code = VALUES(clearance_op_code),
|
||||
stock_addr = VALUES(stock_addr),
|
||||
stock_out_remark = VALUES(stock_out_remark),
|
||||
deliver_count = VALUES(deliver_count),
|
||||
first_deliver_count = VALUES(first_deliver_count),
|
||||
last_deliver_count = VALUES(last_deliver_count),
|
||||
ac_deliver_diff = VALUES(ac_deliver_diff),
|
||||
deliver_end_diff = VALUES(deliver_end_diff),
|
||||
check_order_count = VALUES(check_order_count),
|
||||
check_leave_count = VALUES(check_leave_count),
|
||||
internal_check_time = VALUES(internal_check_time)
|
||||
</insert>
|
||||
|
||||
<insert id="upsertBillAirTrack">
|
||||
INSERT INTO srv_bill_air_track (
|
||||
guid, bill_code, start_time_plan, arrive_time_plan, shipping_date,
|
||||
start_time, arrive_time, arrive_stock_time, clearance_time, end_oprate_time,
|
||||
bl_bgfx, bgfx_time, update_time_bgfx,
|
||||
bl_sjqf, sjqf_time, update_time_sjqf,
|
||||
bl_sjdd, sjdd_time, update_time_sjdd,
|
||||
bl_tzdc, tzdc_time, update_time_tzdc,
|
||||
bl_thdc, thdc_time, update_time_thdc,
|
||||
bl_qgwc, qgwc_time, update_time_qgwc,
|
||||
bl_gxfc, gxfc_time, update_time_gxfc,
|
||||
bl_fjh, fjh_time, update_time_fjh,
|
||||
bl_track_gen_bg, bl_track_gen_bgfx, bl_track_gen_qf, bl_track_gen_dd,
|
||||
bl_track_gen_qg, bl_track_gen_dc
|
||||
) VALUES
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(#{it.guid}, #{it.billCode}, #{it.startTimePlan}, #{it.arriveTimePlan}, #{it.shippingDate},
|
||||
#{it.startTime}, #{it.arriveTime}, #{it.arriveStockTime}, #{it.clearanceTime}, #{it.endOprateTime},
|
||||
#{it.blBgfx}, #{it.bgfxTime}, #{it.updateTimeBgfx},
|
||||
#{it.blSjqf}, #{it.sjqfTime}, #{it.updateTimeSjqf},
|
||||
#{it.blSjdd}, #{it.sjddTime}, #{it.updateTimeSjdd},
|
||||
#{it.blTzdc}, #{it.tzdcTime}, #{it.updateTimeTzdc},
|
||||
#{it.blThdc}, #{it.thdcTime}, #{it.updateTimeThdc},
|
||||
#{it.blQgwc}, #{it.qgwcTime}, #{it.updateTimeQgwc},
|
||||
#{it.blGxfc}, #{it.gxfcTime}, #{it.updateTimeGxfc},
|
||||
#{it.blFjh}, #{it.fjhTime}, #{it.updateTimeFjh},
|
||||
#{it.blTrackGenBg}, #{it.blTrackGenBgfx}, #{it.blTrackGenQf}, #{it.blTrackGenDd},
|
||||
#{it.blTrackGenQg}, #{it.blTrackGenDc})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
bill_code = VALUES(bill_code),
|
||||
start_time_plan = VALUES(start_time_plan),
|
||||
arrive_time_plan = VALUES(arrive_time_plan),
|
||||
shipping_date = VALUES(shipping_date),
|
||||
start_time = VALUES(start_time),
|
||||
arrive_time = VALUES(arrive_time),
|
||||
arrive_stock_time = VALUES(arrive_stock_time),
|
||||
clearance_time = VALUES(clearance_time),
|
||||
end_oprate_time = VALUES(end_oprate_time),
|
||||
bl_bgfx = VALUES(bl_bgfx),
|
||||
bgfx_time = VALUES(bgfx_time),
|
||||
update_time_bgfx = VALUES(update_time_bgfx),
|
||||
bl_sjqf = VALUES(bl_sjqf),
|
||||
sjqf_time = VALUES(sjqf_time),
|
||||
update_time_sjqf = VALUES(update_time_sjqf),
|
||||
bl_sjdd = VALUES(bl_sjdd),
|
||||
sjdd_time = VALUES(sjdd_time),
|
||||
update_time_sjdd = VALUES(update_time_sjdd),
|
||||
bl_tzdc = VALUES(bl_tzdc),
|
||||
tzdc_time = VALUES(tzdc_time),
|
||||
update_time_tzdc = VALUES(update_time_tzdc),
|
||||
bl_thdc = VALUES(bl_thdc),
|
||||
thdc_time = VALUES(thdc_time),
|
||||
update_time_thdc = VALUES(update_time_thdc),
|
||||
bl_qgwc = VALUES(bl_qgwc),
|
||||
qgwc_time = VALUES(qgwc_time),
|
||||
update_time_qgwc = VALUES(update_time_qgwc),
|
||||
bl_gxfc = VALUES(bl_gxfc),
|
||||
gxfc_time = VALUES(gxfc_time),
|
||||
update_time_gxfc = VALUES(update_time_gxfc),
|
||||
bl_fjh = VALUES(bl_fjh),
|
||||
fjh_time = VALUES(fjh_time),
|
||||
update_time_fjh = VALUES(update_time_fjh),
|
||||
bl_track_gen_bg = VALUES(bl_track_gen_bg),
|
||||
bl_track_gen_bgfx = VALUES(bl_track_gen_bgfx),
|
||||
bl_track_gen_qf = VALUES(bl_track_gen_qf),
|
||||
bl_track_gen_dd = VALUES(bl_track_gen_dd),
|
||||
bl_track_gen_qg = VALUES(bl_track_gen_qg),
|
||||
bl_track_gen_dc = VALUES(bl_track_gen_dc)
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
-- 空运提单列表: under 计费中心
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2520, N'提单列表', 2300, 2, 'airBill', 'price/billing/airBill', '', 'AirBill', 1, 0, 'C', '0', '0',
|
||||
'price:airBill:list', 'list', 'admin', sysdate(), N'查看空运提单列表与详情(srv_bill_air*)'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2520 OR perms = 'price:airBill:list');
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2521, N'查询', 2520, 1, '', NULL, 1, 0, 'F', '0', '0', 'price:airBill:list', '#', 'admin', sysdate(), N'提单列表查询'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2521);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2522, N'详情', 2520, 2, '', NULL, 1, 0, 'F', '0', '0', 'price:airBill:query', '#', 'admin', sysdate(), N'提单详情'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2522 OR perms = 'price:airBill:query');
|
||||
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
SELECT 1, m.menu_id FROM (SELECT 2520 AS menu_id UNION SELECT 2521 UNION SELECT 2522) m
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu rm WHERE rm.role_id = 1 AND rm.menu_id = m.menu_id);
|
||||
@@ -0,0 +1,18 @@
|
||||
-- 空运提单类型字典 srv_air_bill_type
|
||||
-- 0=整板 1=散板 2=其他(对应 srv_bill_air.bill_type)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, remark)
|
||||
SELECT N'提单类型', 'srv_air_bill_type', '0', 'admin', sysdate(), N'空运提单 bill_type:整板/散板/其他'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_dict_type WHERE dict_type = 'srv_air_bill_type');
|
||||
|
||||
INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
|
||||
SELECT v.dict_sort, v.dict_label, v.dict_value, 'srv_air_bill_type', '', v.list_class, 'N', '0', 'admin', sysdate(), v.remark
|
||||
FROM (
|
||||
SELECT 1 AS dict_sort, N'整板' AS dict_label, '0' AS dict_value, 'primary' AS list_class, N'bill_type=0' AS remark
|
||||
UNION ALL SELECT 2, N'散板', '1', 'success', N'bill_type=1'
|
||||
UNION ALL SELECT 3, N'其他', '2', 'info', N'bill_type=2'
|
||||
) v
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM sys_dict_data d WHERE d.dict_type = 'srv_air_bill_type' AND d.dict_value = v.dict_value
|
||||
);
|
||||
@@ -0,0 +1,169 @@
|
||||
-- =====================================================================
|
||||
-- 空运提单:镜像表 + 每日 02:00 同步任务(生产库执行)
|
||||
-- 来源:Oracle WEISHI_USER.TAB_BILL_AIR,按 guid / bill_code 1:1 拆分
|
||||
-- 相关脚本(可选执行):
|
||||
-- sql/price/air_bill_type_dict.sql
|
||||
-- sql/price/air_bill_menu.sql
|
||||
-- =====================================================================
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `srv_bill_air` (
|
||||
`guid` varchar(64) NOT NULL COMMENT '主键',
|
||||
`bill_code` varchar(64) NOT NULL COMMENT '提单号',
|
||||
`bill_type` int(11) DEFAULT NULL COMMENT '提单类型',
|
||||
`bl_status` int(11) DEFAULT NULL COMMENT '状态',
|
||||
`warning_status` tinyint(4) DEFAULT NULL COMMENT '预警状态',
|
||||
`warning_count` int(11) DEFAULT NULL COMMENT '预警次数',
|
||||
`start_airport` varchar(64) DEFAULT NULL COMMENT '始发机场',
|
||||
`end_airport` varchar(64) DEFAULT NULL COMMENT '目的机场',
|
||||
`des_port` varchar(64) DEFAULT NULL COMMENT '目的港',
|
||||
`route_name` varchar(64) DEFAULT NULL COMMENT '航线名称',
|
||||
`air_type` varchar(64) DEFAULT NULL COMMENT '空运类型',
|
||||
`piece_number` int(11) DEFAULT NULL COMMENT '总件数',
|
||||
`volume` decimal(20,3) DEFAULT NULL COMMENT '总体积',
|
||||
`actual_weight` decimal(20,2) DEFAULT NULL COMMENT '实际重量',
|
||||
`actual_volume` decimal(20,3) DEFAULT NULL COMMENT '实际体积',
|
||||
`volume_weight` decimal(20,3) DEFAULT NULL COMMENT '体积重',
|
||||
`air_company` varchar(64) DEFAULT NULL COMMENT '航空公司',
|
||||
`send_man_code` varchar(64) DEFAULT NULL COMMENT '发货人编码',
|
||||
`accept_man_code` varchar(64) DEFAULT NULL COMMENT '收货人编码',
|
||||
`data_from` varchar(64) DEFAULT NULL COMMENT '数据来源',
|
||||
`create_man_code` varchar(64) DEFAULT NULL COMMENT '创建人工号',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`modifier_code` varchar(64) DEFAULT NULL COMMENT '修改人工号',
|
||||
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '总备注',
|
||||
PRIMARY KEY (`guid`),
|
||||
UNIQUE KEY `uk_bill_code` (`bill_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='空运提单主表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `srv_bill_air_finance` (
|
||||
`guid` varchar(64) NOT NULL COMMENT '主键',
|
||||
`bill_code` varchar(64) NOT NULL COMMENT '提单号',
|
||||
`bl_check` tinyint(4) DEFAULT NULL COMMENT '是否核对',
|
||||
`check_remark` varchar(64) DEFAULT NULL COMMENT '核对备注',
|
||||
`bl_confirm` int(11) DEFAULT NULL COMMENT '是否确认',
|
||||
`confirm_man_code` varchar(64) DEFAULT NULL COMMENT '确认人工号',
|
||||
`confirm_time` datetime DEFAULT NULL COMMENT '确认时间',
|
||||
`price` decimal(20,2) DEFAULT NULL COMMENT '单价',
|
||||
`amount` decimal(20,2) DEFAULT NULL COMMENT '金额',
|
||||
`calc_exp` varchar(64) DEFAULT NULL COMMENT '应付计算',
|
||||
`calc_re` varchar(64) DEFAULT NULL COMMENT '应收计算',
|
||||
`price_remark` varchar(128) DEFAULT NULL COMMENT '价格备注',
|
||||
`baoguan_fee` decimal(20,4) DEFAULT NULL COMMENT '报关费',
|
||||
`baoguan_other_fee` decimal(20,4) DEFAULT NULL COMMENT '报关其他费用',
|
||||
`stock_fee` decimal(20,4) DEFAULT NULL COMMENT '仓储费',
|
||||
`des_port_agent_fee` decimal(20,4) DEFAULT NULL COMMENT '目的港代理费',
|
||||
`air_other_fee` decimal(20,4) DEFAULT NULL COMMENT '空运其他费用',
|
||||
`other_fee` decimal(20,4) DEFAULT NULL COMMENT '其他费用',
|
||||
`compensate_remark` varchar(64) DEFAULT NULL COMMENT '索赔备注',
|
||||
`charge_man_code` varchar(64) DEFAULT NULL COMMENT '计费人工号',
|
||||
PRIMARY KEY (`guid`),
|
||||
UNIQUE KEY `uk_bill_code` (`bill_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='空运提单财务费用表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `srv_bill_air_flight` (
|
||||
`guid` varchar(64) NOT NULL COMMENT '主键',
|
||||
`bill_code` varchar(64) NOT NULL COMMENT '提单号',
|
||||
`air_no` varchar(64) DEFAULT NULL COMMENT '航班号',
|
||||
`actual_air_no` varchar(64) DEFAULT NULL COMMENT '实际航班号',
|
||||
`air_ompany_agent` varchar(128) DEFAULT NULL COMMENT '航空公司代理',
|
||||
`des_port_agent_code` varchar(64) DEFAULT NULL COMMENT '目的港代理编码',
|
||||
`board_no` varchar(64) DEFAULT NULL COMMENT '板号',
|
||||
`band_box_count` int(11) DEFAULT NULL COMMENT '打板箱数',
|
||||
`band_volume` decimal(20,2) DEFAULT NULL COMMENT '打板体积',
|
||||
`band_box_weight` decimal(20,2) DEFAULT NULL COMMENT '打板重量',
|
||||
`divisor_value` decimal(20,3) DEFAULT NULL COMMENT '体积系数',
|
||||
`first_landing_time` datetime DEFAULT NULL COMMENT '首程落地时间',
|
||||
`second_takeoff_time` datetime DEFAULT NULL COMMENT '二程起飞时间',
|
||||
`air_delay_time` datetime DEFAULT NULL COMMENT '航班延误时间',
|
||||
`trunk_destinations` varchar(64) DEFAULT NULL COMMENT '干线目的地',
|
||||
PRIMARY KEY (`guid`),
|
||||
UNIQUE KEY `uk_bill_code` (`bill_code`),
|
||||
KEY `idx_air_no` (`air_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='空运航班干线表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `srv_bill_air_op` (
|
||||
`guid` varchar(64) NOT NULL COMMENT '主键',
|
||||
`bill_code` varchar(64) NOT NULL COMMENT '提单号',
|
||||
`bl_retrieval` tinyint(4) DEFAULT NULL COMMENT '是否提货',
|
||||
`retrieval_date` datetime DEFAULT NULL COMMENT '提货日期',
|
||||
`retrieval_man_code` varchar(64) DEFAULT NULL COMMENT '提货人工号',
|
||||
`pick_box_count` int(11) DEFAULT NULL COMMENT '提货箱数',
|
||||
`pick_count_real` int(11) DEFAULT NULL COMMENT '实际提货件数',
|
||||
`declare_code` varchar(64) DEFAULT NULL COMMENT '报关公司编码',
|
||||
`clearance_code` varchar(64) DEFAULT NULL COMMENT '清关编码',
|
||||
`qingguan_agent` varchar(64) DEFAULT NULL COMMENT '清关代理',
|
||||
`clearance_op_code` varchar(64) DEFAULT NULL COMMENT '清关操作人工号',
|
||||
`stock_addr` varchar(64) DEFAULT NULL COMMENT '出仓仓库地址',
|
||||
`stock_out_remark` varchar(500) DEFAULT NULL COMMENT '出库备注',
|
||||
`deliver_count` int(11) DEFAULT NULL COMMENT '派送件数',
|
||||
`first_deliver_count` int(11) DEFAULT NULL COMMENT '首批派送件数',
|
||||
`last_deliver_count` int(11) DEFAULT NULL COMMENT '末批派送件数',
|
||||
`ac_deliver_diff` varchar(64) DEFAULT NULL COMMENT '派送差异',
|
||||
`deliver_end_diff` varchar(64) DEFAULT NULL COMMENT '派送完成差异',
|
||||
`check_order_count` int(11) DEFAULT NULL COMMENT '查验订单数',
|
||||
`check_leave_count` int(11) DEFAULT NULL COMMENT '查验放行数',
|
||||
`internal_check_time` datetime DEFAULT NULL COMMENT '内部查验时间',
|
||||
PRIMARY KEY (`guid`),
|
||||
UNIQUE KEY `uk_bill_code` (`bill_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='空运提单操作派送表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `srv_bill_air_track` (
|
||||
`guid` varchar(64) NOT NULL COMMENT '主键',
|
||||
`bill_code` varchar(64) NOT NULL COMMENT '提单号',
|
||||
`start_time_plan` datetime DEFAULT NULL COMMENT '计划起飞时间',
|
||||
`arrive_time_plan` datetime DEFAULT NULL COMMENT '计划到达时间',
|
||||
`shipping_date` datetime DEFAULT NULL COMMENT '发货日期',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '起飞时间',
|
||||
`arrive_time` datetime DEFAULT NULL COMMENT '到达时间',
|
||||
`arrive_stock_time` datetime DEFAULT NULL COMMENT '到仓时间',
|
||||
`clearance_time` datetime DEFAULT NULL COMMENT '清关时间',
|
||||
`end_oprate_time` datetime DEFAULT NULL COMMENT '结束操作时间',
|
||||
`bl_bgfx` tinyint(4) DEFAULT NULL,
|
||||
`bgfx_time` datetime DEFAULT NULL,
|
||||
`update_time_bgfx` datetime DEFAULT NULL,
|
||||
`bl_sjqf` tinyint(4) DEFAULT NULL,
|
||||
`sjqf_time` datetime DEFAULT NULL,
|
||||
`update_time_sjqf` datetime DEFAULT NULL,
|
||||
`bl_sjdd` tinyint(4) DEFAULT NULL,
|
||||
`sjdd_time` datetime DEFAULT NULL,
|
||||
`update_time_sjdd` datetime DEFAULT NULL,
|
||||
`bl_tzdc` tinyint(4) DEFAULT NULL,
|
||||
`tzdc_time` datetime DEFAULT NULL,
|
||||
`update_time_tzdc` varchar(64) DEFAULT NULL,
|
||||
`bl_thdc` tinyint(4) DEFAULT NULL,
|
||||
`thdc_time` datetime DEFAULT NULL,
|
||||
`update_time_thdc` datetime DEFAULT NULL,
|
||||
`bl_qgwc` tinyint(4) DEFAULT NULL,
|
||||
`qgwc_time` datetime DEFAULT NULL,
|
||||
`update_time_qgwc` datetime DEFAULT NULL,
|
||||
`bl_gxfc` tinyint(4) DEFAULT NULL,
|
||||
`gxfc_time` datetime DEFAULT NULL,
|
||||
`update_time_gxfc` varchar(64) DEFAULT NULL,
|
||||
`bl_fjh` tinyint(4) DEFAULT NULL,
|
||||
`fjh_time` datetime DEFAULT NULL,
|
||||
`update_time_fjh` varchar(64) DEFAULT NULL,
|
||||
`bl_track_gen_bg` tinyint(4) DEFAULT NULL,
|
||||
`bl_track_gen_bgfx` tinyint(4) DEFAULT NULL,
|
||||
`bl_track_gen_qf` tinyint(4) DEFAULT NULL,
|
||||
`bl_track_gen_dd` tinyint(4) DEFAULT NULL,
|
||||
`bl_track_gen_qg` tinyint(4) DEFAULT NULL,
|
||||
`bl_track_gen_dc` tinyint(4) DEFAULT NULL,
|
||||
PRIMARY KEY (`guid`),
|
||||
UNIQUE KEY `uk_bill_code` (`bill_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='空运提单时效轨迹表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 定时任务:老系统 Oracle TAB_BILL_AIR -> srv_bill_air* 提单每日同步
|
||||
-- 调用目标:billAirSyncTask.syncFromOracle()
|
||||
-- cron 0 0 2 * * ? = 每天 02:00:00;concurrent=1 禁止并发;misfire=3 放弃错过的执行
|
||||
-- 幂等:按 guid upsert,可重复执行
|
||||
-- ----------------------------
|
||||
INSERT INTO sys_job (job_name, job_group, invoke_target, cron_expression,
|
||||
misfire_policy, concurrent, status, create_by, create_time, remark)
|
||||
SELECT N'老系统空运提单每日同步', 'DEFAULT', 'billAirSyncTask.syncFromOracle()', '0 0 2 * * ?',
|
||||
'3', '1', '0', 'admin', NOW(),
|
||||
N'每天02:00从Oracle(WEISHI_USER.TAB_BILL_AIR,只读账号)全量同步到srv_bill_air/finance/flight/op/track;按guid upsert,可重复执行'
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_job WHERE invoke_target = 'billAirSyncTask.syncFromOracle()');
|
||||
@@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/** Air bill list */
|
||||
export function listAirBill(query) {
|
||||
return request({
|
||||
url: '/price/airBill/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/** Air bill detail by bill code */
|
||||
export function getAirBill(billCode) {
|
||||
return request({
|
||||
url: '/price/airBill/detail',
|
||||
method: 'get',
|
||||
params: { billCode }
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="app-container air-bill-page">
|
||||
<basic-table
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:search-columns="searchColumns"
|
||||
:query="queryList"
|
||||
row-key="billCode"
|
||||
:search-per-row="4"
|
||||
:page-sizes="[50, 100, 200, 300]"
|
||||
:page-size="100"
|
||||
:height="tableHeight"
|
||||
virtual
|
||||
>
|
||||
<template #search-billCodes="{ model }">
|
||||
<el-input
|
||||
v-model="model.billCodes"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
resize="none"
|
||||
placeholder="提单号,多个用逗号/换行分隔"
|
||||
clearable
|
||||
/>
|
||||
</template>
|
||||
<template #search-shippingDateRange="{ model }">
|
||||
<el-date-picker
|
||||
v-model="model.shippingDateRange"
|
||||
type="datetimerange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
range-separator="-"
|
||||
start-placeholder="开始"
|
||||
end-placeholder="结束"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
<template #search-createTimeRange="{ model }">
|
||||
<el-date-picker
|
||||
v-model="model.createTimeRange"
|
||||
type="datetimerange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
range-separator="-"
|
||||
start-placeholder="开始"
|
||||
end-placeholder="结束"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
<template #col-billCode="{ row }">
|
||||
<el-button link type="primary" @click="openDetail(row)">{{ row.billCode || '-' }}</el-button>
|
||||
</template>
|
||||
<template #col-action="{ row }">
|
||||
<el-button link type="primary" v-hasPermi="['price:airBill:query']" @click="openDetail(row)">详情</el-button>
|
||||
</template>
|
||||
</basic-table>
|
||||
|
||||
<air-bill-detail v-model="open" :title="title" :loading="loading" :detail="detail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="AirBill">
|
||||
import { listAirBill, getAirBill } from '@/api/price/airBill'
|
||||
import AirBillDetail from './components/AirBillDetail.vue'
|
||||
|
||||
const tableRef = ref()
|
||||
const tableHeight = ref(480)
|
||||
let tableResizeObserver = null
|
||||
|
||||
const open = ref(false)
|
||||
const title = ref('提单详情')
|
||||
const loading = ref(false)
|
||||
const detail = ref(null)
|
||||
|
||||
const columns = [
|
||||
{ label: '提单号', prop: 'billCode', minWidth: 150, fixed: 'left', slot: 'billCode', showOverflowTooltip: true },
|
||||
{ label: '首程落地时间', prop: 'firstLandingTime', width: 170, parseTime: true },
|
||||
{ label: '航班号', prop: 'airNo', minWidth: 120, showOverflowTooltip: true },
|
||||
{ label: '实际航班号', prop: 'actualAirNo', minWidth: 120, showOverflowTooltip: true },
|
||||
{ label: '航空公司代理', prop: 'airCompanyAgent', minWidth: 160, showOverflowTooltip: true },
|
||||
{ label: '目的港代理编码', prop: 'desPortAgentCode', width: 130 },
|
||||
{ label: '报关公司编码', prop: 'declareCode', width: 120 },
|
||||
{ label: '清关编码', prop: 'clearanceCode', width: 110 },
|
||||
{ label: '清关代理', prop: 'qingguanAgent', minWidth: 120, showOverflowTooltip: true },
|
||||
{ label: '出仓仓库地址', prop: 'stockAddr', minWidth: 140, showOverflowTooltip: true },
|
||||
{ label: '提单类型', prop: 'billType', width: 100, align: 'center', dict: 'srv_air_bill_type' },
|
||||
{ label: '始发机场', prop: 'startAirport', width: 100 },
|
||||
{ label: '目的机场', prop: 'endAirport', width: 100 },
|
||||
{ label: '目的港', prop: 'desPort', width: 100 },
|
||||
{ label: '航线名称', prop: 'routeName', minWidth: 120, showOverflowTooltip: true },
|
||||
{ label: '航空公司', prop: 'airCompany', minWidth: 110, showOverflowTooltip: true },
|
||||
{ label: '报关费', prop: 'baoguanFee', width: 100, align: 'right' },
|
||||
{ label: '报关其他费用', prop: 'baoguanOtherFee', width: 120, align: 'right' },
|
||||
{ label: '仓储费', prop: 'stockFee', width: 100, align: 'right' },
|
||||
{ label: '目的港代理费', prop: 'desPortAgentFee', width: 120, align: 'right' },
|
||||
{ label: '空运其他费用', prop: 'airOtherFee', width: 120, align: 'right' },
|
||||
{ label: '其他费用', prop: 'otherFee', width: 100, align: 'right' },
|
||||
{ label: '总件数', prop: 'pieceNumber', width: 90, align: 'center' },
|
||||
{ label: '总体积', prop: 'volume', width: 100, align: 'right' },
|
||||
{ label: '实际重量', prop: 'actualWeight', width: 100, align: 'right' },
|
||||
{ label: '实际体积', prop: 'actualVolume', width: 100, align: 'right' },
|
||||
{ label: '体积重', prop: 'volumeWeight', width: 100, align: 'right' },
|
||||
{ label: '发货日期', prop: 'shippingDate', width: 170, parseTime: true },
|
||||
{ label: '起飞时间', prop: 'startTime', width: 170, parseTime: true },
|
||||
{ label: '到达时间', prop: 'arriveTime', width: 170, parseTime: true },
|
||||
{ label: '到仓时间', prop: 'arriveStockTime', width: 170, parseTime: true },
|
||||
{ label: '清关时间', prop: 'clearanceTime', width: 170, parseTime: true },
|
||||
{ label: '操作', prop: 'action', align: 'center', width: 90, fixed: 'right', slot: 'action', showInToolbar: false, showOverflowTooltip: false }
|
||||
]
|
||||
|
||||
const searchColumns = [
|
||||
{ label: '提单号', prop: 'billCodes', span: 6, slot: 'billCodes' },
|
||||
{ label: '始发机场', prop: 'startAirport', span: 6 },
|
||||
{ label: '目的机场', prop: 'endAirport', span: 6 },
|
||||
{ label: '目的港', prop: 'desPort', span: 6 },
|
||||
{ label: '航线名称', prop: 'routeName', span: 6 },
|
||||
{ label: '航空公司', prop: 'airCompany', span: 6 },
|
||||
{ label: '航班号', prop: 'airNo', span: 6 },
|
||||
{ label: '提单类型', prop: 'billType', span: 6, component: 'select', dict: 'srv_air_bill_type', placeholder: '请选择' },
|
||||
{ label: '发货日期', prop: 'shippingDateRange', span: 12, slot: 'shippingDateRange' },
|
||||
{ label: '创建时间', prop: 'createTimeRange', span: 12, slot: 'createTimeRange' }
|
||||
]
|
||||
|
||||
function parseBillCodes(raw) {
|
||||
const values = Array.isArray(raw) ? raw : [raw]
|
||||
return [...new Set(
|
||||
values
|
||||
.filter(v => v !== null && v !== undefined)
|
||||
.flatMap(v => String(v).split(/[\s,,;;]+/))
|
||||
.map(v => v.trim())
|
||||
.filter(Boolean)
|
||||
)]
|
||||
}
|
||||
|
||||
function normalizeQuery(params = {}) {
|
||||
const query = { ...params }
|
||||
const codes = parseBillCodes(query.billCodes)
|
||||
if (codes.length === 1) {
|
||||
query.billCode = codes[0]
|
||||
delete query.billCodes
|
||||
} else if (codes.length > 1) {
|
||||
query.billCodes = codes
|
||||
} else {
|
||||
delete query.billCodes
|
||||
delete query.billCode
|
||||
}
|
||||
const ship = query.shippingDateRange
|
||||
if (Array.isArray(ship) && ship.length === 2) {
|
||||
query.shippingDateBegin = ship[0]
|
||||
query.shippingDateEnd = ship[1]
|
||||
}
|
||||
delete query.shippingDateRange
|
||||
const create = query.createTimeRange
|
||||
if (Array.isArray(create) && create.length === 2) {
|
||||
query.createTimeBegin = create[0]
|
||||
query.createTimeEnd = create[1]
|
||||
}
|
||||
delete query.createTimeRange
|
||||
if (query.billType === '' || query.billType === null || query.billType === undefined) {
|
||||
delete query.billType
|
||||
}
|
||||
return query
|
||||
}
|
||||
|
||||
function queryList(params) {
|
||||
return listAirBill(normalizeQuery(params))
|
||||
}
|
||||
|
||||
function openDetail(row) {
|
||||
if (!row?.billCode) return
|
||||
open.value = true
|
||||
title.value = '提单详情 - ' + row.billCode
|
||||
loading.value = true
|
||||
detail.value = null
|
||||
getAirBill(row.billCode).then(res => {
|
||||
detail.value = res.data || null
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function updateTableHeight() {
|
||||
const tableEl = document.querySelector('.air-bill-page > .basic-table .el-table, .air-bill-page > .basic-table .basic-table-virtual')
|
||||
if (!tableEl) return
|
||||
const top = tableEl.getBoundingClientRect().top
|
||||
tableHeight.value = Math.max(240, Math.floor(window.innerHeight - top - 70))
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
updateTableHeight()
|
||||
const form = document.querySelector('.air-bill-page > .basic-table .basic-form')
|
||||
if (form && typeof ResizeObserver !== 'undefined') {
|
||||
tableResizeObserver = new ResizeObserver(() => updateTableHeight())
|
||||
tableResizeObserver.observe(form)
|
||||
}
|
||||
})
|
||||
window.addEventListener('resize', updateTableHeight)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', updateTableHeight)
|
||||
if (tableResizeObserver) {
|
||||
tableResizeObserver.disconnect()
|
||||
tableResizeObserver = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
:model-value="modelValue"
|
||||
:title="title"
|
||||
size="840px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
class="air-bill-detail-drawer"
|
||||
@update:model-value="$emit('update:modelValue', $event)"
|
||||
>
|
||||
<div v-loading="loading" class="air-bill-detail-wrap">
|
||||
<el-empty v-if="!detail" description="暂无详情" />
|
||||
<div v-else class="air-bill-detail">
|
||||
<section class="detail-block">
|
||||
<div class="sec-title">基本信息</div>
|
||||
<el-descriptions class="detail-desc" :column="2" border size="small">
|
||||
<el-descriptions-item label="提单号">{{ detail.billCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="提单类型"><dict-tag :options="srv_air_bill_type" :value="detail.billType" /></el-descriptions-item>
|
||||
<el-descriptions-item label="始发机场">{{ detail.startAirport || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="目的机场">{{ detail.endAirport || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="目的港">{{ detail.desPort || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="航线名称">{{ detail.routeName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="航空公司">{{ detail.airCompany || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总件数">{{ numOrDash(detail.pieceNumber) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总体积">{{ numOrDash(detail.volume) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实际重量">{{ numOrDash(detail.actualWeight) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实际体积">{{ numOrDash(detail.actualVolume) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="体积重">{{ numOrDash(detail.volumeWeight) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</section>
|
||||
|
||||
<section class="detail-block">
|
||||
<div class="sec-title">费用信息</div>
|
||||
<el-descriptions class="detail-desc" :column="2" border size="small">
|
||||
<el-descriptions-item label="报关费">{{ money(detail.baoguanFee) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="报关其他费用">{{ money(detail.baoguanOtherFee) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="仓储费">{{ money(detail.stockFee) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="目的港代理费">{{ money(detail.desPortAgentFee) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="空运其他费用">{{ money(detail.airOtherFee) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="其他费用">{{ money(detail.otherFee) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</section>
|
||||
|
||||
<section class="detail-block">
|
||||
<div class="sec-title">航班与代理</div>
|
||||
<el-descriptions class="detail-desc" :column="2" border size="small">
|
||||
<el-descriptions-item label="航班号">{{ detail.airNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实际航班号">{{ detail.actualAirNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="航空公司代理">{{ detail.airCompanyAgent || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="目的港代理编码">{{ detail.desPortAgentCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="报关公司编码">{{ detail.declareCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="清关编码">{{ detail.clearanceCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="清关代理">{{ detail.qingguanAgent || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="出仓仓库地址">{{ detail.stockAddr || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</section>
|
||||
|
||||
<section class="detail-block">
|
||||
<div class="sec-title">时效信息</div>
|
||||
<el-descriptions class="detail-desc" :column="2" border size="small">
|
||||
<el-descriptions-item label="首程落地时间">{{ formatDateTime(detail.firstLandingTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发货日期">{{ formatDateTime(detail.shippingDate) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="起飞时间">{{ formatDateTime(detail.startTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="到达时间">{{ formatDateTime(detail.arriveTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="到仓时间">{{ formatDateTime(detail.arriveStockTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="清关时间">{{ formatDateTime(detail.clearanceTime) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup name="AirBillDetail">
|
||||
import { parseTime } from '@/utils/bms'
|
||||
|
||||
const { srv_air_bill_type } = useDict('srv_air_bill_type')
|
||||
|
||||
defineProps({
|
||||
modelValue: { type: Boolean, default: false },
|
||||
title: { type: String, default: '提单详情' },
|
||||
loading: { type: Boolean, default: false },
|
||||
detail: { type: Object, default: null }
|
||||
})
|
||||
|
||||
defineEmits(['update:modelValue'])
|
||||
|
||||
function numOrDash(v) {
|
||||
return v === null || v === undefined || v === '' ? '-' : v
|
||||
}
|
||||
|
||||
function money(v) {
|
||||
if (v === null || v === undefined || v === '') return '-'
|
||||
const n = Number(v)
|
||||
if (Number.isNaN(n)) return String(v)
|
||||
return n.toFixed(4)
|
||||
}
|
||||
|
||||
function formatDateTime(v) {
|
||||
return v ? parseTime(v) : '-'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.air-bill-detail-wrap {
|
||||
min-height: 200px;
|
||||
}
|
||||
.detail-block + .detail-block {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.sec-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user