# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
wuweihua
2026-11-03 18:16:08 +08:00
27 changed files with 1962 additions and 11 deletions
@@ -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;
}
@@ -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();
}
@@ -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);
}
@@ -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());
bill.setChargeWeight(resolvePersistChargeWeight(weight, result.getChargeWeight()));
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,14 +3029,11 @@ 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());
}
bill.setChargeWeight(request.getWeight());
}
if (creating)
{
@@ -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);
@@ -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 &gt;= #{shippingDateBegin}
</if>
<if test="shippingDateEnd != null and shippingDateEnd != ''">
AND t.shipping_date &lt;= #{shippingDateEnd}
</if>
<if test="createTimeBegin != null and createTimeBegin != ''">
AND a.create_time &gt;= #{createTimeBegin}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
AND a.create_time &lt;= #{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>