This commit is contained in:
linfso 2024-06-19 18:04:19 +08:00
parent 4d636bc23a
commit 84ad5a609e
4 changed files with 312 additions and 103 deletions

View File

@ -62,6 +62,15 @@ public interface EmisTmsPackMapper extends BaseMapper<EmisTmsPack>
*/
public int updateEmisTmsPack(EmisTmsPack emisTmsPack);
/**
* 更新
* @param emisTmsPack
* @return
*/
public int updateEmisTmsPackByPackNo(EmisTmsPack emisTmsPack);
/**
* 删除
*

View File

@ -466,24 +466,41 @@ public class EmisBaseService {
}
String scanType=scanRecord.getScanType();
String scanDateStr="";
String dispatchOrSendManStr="";
String preOrNextStationStr="";
if(scanRecord.getScanDate()!=null){
scanDateStr=DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate());
}
if(!StringUtils.isEmpty(scanRecord.getDispatchOrSendMan())){
dispatchOrSendManStr=scanRecord.getDispatchOrSendMan();
}
if(!StringUtils.isEmpty(scanRecord.getPreOrNextStation())){
preOrNextStationStr=scanRecord.getPreOrNextStation();
}
// 揽收扫描
if(ScanType.GOT.opCode.equals(scanType)){
content="已揽收 快件在【"+scanRecord.getScanSite()+"】已收件,取件员【"+scanRecord.getDispatchOrSendMan()+"】";
content="已揽收 快件在【"+scanRecord.getScanSite()+"】已收件,取件员【"+dispatchOrSendManStr+"】";
if(isInner){
// 南通,丁诗涵,收件,2024-05-23 13:08:15,快件在[南通]已做收件扫描,收件员是[薛明聪]
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",收件,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",收件,"+scanDateStr+","+content;
}
}
// 发件扫描
else if(ScanType.DEPARTURE.opCode.equals(scanType)){
content="发件 快件已离开【"+scanRecord.getScanSite() +"】 下一站发往【"+scanRecord.getPreOrNextStation()+"】";
content="发件 快件已离开【"+scanRecord.getScanSite() +"】 下一站发往【"+preOrNextStationStr+"】";
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",发件,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",发件,"+scanDateStr+","+content;
}
}
@ -492,22 +509,22 @@ public class EmisBaseService {
content="到件 快件已到达【"+scanRecord.getScanSite()+"】";
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",到件,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",到件,"+scanDateStr+","+content;
}
}
// 派送扫描
else if(ScanType.SENT.opCode.equals(scanType)){
content="派件 快件在【"+scanRecord.getScanSite()+"】开始派送,已分配派件员【"+scanRecord.getDispatchOrSendMan()+"】";
content="派件 快件在【"+scanRecord.getScanSite()+"】开始派送,已分配派件员【"+dispatchOrSendManStr+"】";
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",派件,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",派件,"+scanDateStr+","+content;
}
}
// 签收扫描
else if(ScanType.SIGNED.opCode.equals(scanType)){
content="签收 快件在【"+scanRecord.getScanSite()+"】,签收人["+scanRecord.getSignMan()+"]";
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",签收,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",签收,"+scanDateStr+","+content;
}
}
// 留仓
@ -532,7 +549,7 @@ public class EmisBaseService {
content="问题件 "+waybill.getProblemTypeName()+"("+waybill.getProblemCause()+")";
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",问题件,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",问题件,"+scanDateStr+","+content;
}
}
@ -545,10 +562,10 @@ public class EmisBaseService {
}
// 装车
else if(ScanType.LOADING.opCode.equals(scanType)){
content="装车 快件已装车【"+scanRecord.getScanSite() +"】 下一站发往【"+scanRecord.getPreOrNextStation()+"】车牌号:"+scanRecord.getCarNo();
content="装车 快件已装车【"+scanRecord.getScanSite() +"】 下一站发往【"+preOrNextStationStr+"】车牌号:"+scanRecord.getCarNo();
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",装车,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",装车,"+scanDateStr+","+content;
}
}
@ -557,23 +574,23 @@ public class EmisBaseService {
content="卸车 快件已【"+scanRecord.getScanSite() +"】卸车";
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",卸车,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",卸车,"+scanDateStr+","+content;
}
}
// 报关扫描
else if(ScanType.DECLEARE.opCode.equals(scanType)){
content="报关扫描 快件已报关,下站发往【"+scanRecord.getPreOrNextStation()+"】";
content="报关扫描 快件已报关,下站发往【"+preOrNextStationStr+"】";
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",报关扫描,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",报关扫描,"+scanDateStr+","+content;
}
}
// 清关扫描
else if(ScanType.CLEARANCE.opCode.equals(scanType)){
content="清关扫描 快件已清关,下站发往【"+scanRecord.getPreOrNextStation()+"】";
content="清关扫描 快件已清关,下站发往【"+preOrNextStationStr+"】";
if(isInner){
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",清关扫描,"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,scanRecord.getScanDate())+","+content;
content=scanRecord.getScanSite()+","+scanRecord.getScanMan()+",清关扫描,"+scanDateStr+","+content;
}
}

View File

@ -148,84 +148,99 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
public List<ScanResultItem> doScanCheck(String scanType,Map<String,Object> scanDataItem) throws EmisBizError {
List<ScanResultItem> itemList = new ArrayList<>();
// 检查数据
// 扫描时间,扫描单号必填
String scanDateStr=MapUtils.getString(scanDataItem,"scanDate",null);
String billCodeInStr = MapUtils.getString(scanDataItem,"billCode",null);
if(StringUtils.isEmpty(scanDateStr)){
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(billCodeInStr);
scanResultItem.setResult("fail");
scanResultItem.setMessage("scanDate为空");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS,"扫描时间必填");
}
if(StringUtils.isEmpty(billCodeInStr)){
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(billCodeInStr);
scanResultItem.setResult("fail");
scanResultItem.setMessage("billCode为空");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"扫描单号不能为空");
}
// 开始检查数据
Date scanDate = null;
String scanDateStr = MapUtils.getString(scanDataItem,"scanDate",null);
if(!StringUtils.isEmpty(scanDateStr)){
scanDate = DateUtils.parseDate(scanDateStr);;
}
if(scanDate ==null){
scanDate = new Date();
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1,"扫描单号必填");
}
// 开始检查数据
String[] billCodeArr = billCodeInStr.split(",");
for (String scanBillCode:billCodeArr) {
// 原始数据返回
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(scanBillCode);
scanResultItem.getData().putAll(scanDataItem);
// 合包和拆包需单独处理
if(ScanType.CO_PACKING.opCode.equals(scanType)){
// 合包扫描
return doPackScanCheck(itemList,billCodeArr,scanDataItem);
}
// 拆包
else if(ScanType.UN_PACKING.opCode.equals(scanType)){
return doUnPackScanCheck(itemList,billCodeArr,scanDataItem);
}
else {
for (String scanBillCode : billCodeArr) {
// 获取主单号
String mainBillCode=getMainBillCode(scanBillCode);
// 原始数据返回
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(scanBillCode);
scanResultItem.getData().putAll(scanDataItem);
// 判断是主单还是子单
boolean isExists=checkWaybillIsExists(mainBillCode);
// 检查运单号是否存在
if(!isExists){
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单号不存在");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS,"运单号不存在");
}
// 获取主单号
String mainBillCode = getMainBillCode(scanBillCode);
// 已签收不允许扫描
boolean isSign=checkWaybillIsSign(mainBillCode);
if(isSign){
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单已签收");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS,"运单已签收");
}
// 判断是主单还是子单
boolean isExists = checkWaybillIsExists(mainBillCode);
// 检查运单号是否存在
if (!isExists) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单号不存在");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "运单号不存在");
}
// 已签收不允许扫描
boolean isSign = checkWaybillIsSign(mainBillCode);
if (isSign) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单已签收");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS, "运单已签收");
}
// 重复扫描
// 同站点,同动作,同一天不允许重复扫描
int scanCnt=emisTmsScanRecordMapper.checkSiteScanUnique(scanBillCode,scanType,getCurrentUser().getOwnerSiteCode(),scanDate);
if(scanCnt>0){
scanResultItem.setResult("fail");
scanResultItem.setMessage("单号["+scanBillCode+"]重复扫描");
itemList.add(scanResultItem);
String scanTypeLabel=DictUtils.getDictLabel("emis_scan_type",scanType);
throw new EmisBizError(EmisBizErrorType.EXISTS,""+scanBillCode+"已["+scanTypeLabel+"]");
// 重复扫描
// 同站点,同动作,同一天不允许重复扫描
int scanCnt = emisTmsScanRecordMapper.checkSiteScanUnique(scanBillCode, scanType, getCurrentUser().getOwnerSiteCode(), scanDate);
if (scanCnt > 0) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("单号[" + scanBillCode + "]重复扫描");
itemList.add(scanResultItem);
String scanTypeLabel = DictUtils.getDictLabel("emis_scan_type", scanType);
throw new EmisBizError(EmisBizErrorType.EXISTS, "" + scanBillCode + "已[" + scanTypeLabel + "]");
// continue;
}
EmisWaybill emisWaybill = getWaybillByBillCode(mainBillCode);
// 返回数据
scanResultItem.getData().put("billWeight", emisWaybill.getBillWeight());
scanResultItem.getData().put("totalVolume", emisWaybill.getTotalVolume());
scanResultItem.getData().put("parcelQty", emisWaybill.getParcelQty());
scanResultItem.setResult("success");
scanResultItem.setMessage("允许操作");
itemList.add(scanResultItem);
}
EmisWaybill emisWaybill = getWaybillByBillCode(mainBillCode);
// 返回数据
scanResultItem.getData().put("billWeight",emisWaybill.getBillWeight());
scanResultItem.getData().put("totalVolume",emisWaybill.getTotalVolume());
scanResultItem.getData().put("parcelQty",emisWaybill.getParcelQty());
scanResultItem.setResult("success");
scanResultItem.setMessage("允许操作");
itemList.add(scanResultItem);
}
return itemList;
@ -276,13 +291,6 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 拆包
else if(ScanType.UN_PACKING.opCode.equals(scanType)){
return doUnPackScan(itemList,billCodeArr,scanDataItem,scanDate,dataFrom);
// "billCode": "T001,T002,T002",
// "scanDate": "2024-05-02 12:03:05",
// "scanWeight": "0.2"
// String packNo = (String)scanDataItem.get("bagNo");
// emisTmsScanRecord.setBagNo(packNo);
}
else {
// 其他扫描方式
@ -291,10 +299,8 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(scanBillCode);
scanResultItem.getData().putAll(scanDataItem);
// 获取主单号
String mainBillCode = getMainBillCode(scanBillCode);
// 判断是主单还是子单
boolean isExists = checkWaybillIsExists(mainBillCode);
// 检查运单号是否存在
@ -368,6 +374,97 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
return itemList;
}
public List<ScanResultItem> doPackScanCheck(List<ScanResultItem> itemList,String[] billCodeArr,Map<String,Object> scanDataItem) throws EmisBizError {
// 子单号处理
for (String scanBillCode : billCodeArr) {
// 返回原始数据返回
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(scanBillCode);
scanResultItem.getData().putAll(scanDataItem);
// 获取主单号
String mainBillCode = getMainBillCode(scanBillCode);
// 判断是主单还是子单
boolean isExists = checkWaybillIsExists(mainBillCode);
// 检查运单号是否存在
if (!isExists) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单不存在");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "运单不存在");
}
// 已签收不允许扫描
boolean isSign = checkWaybillIsSign(mainBillCode);
if (isSign) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("已签收");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS, "已签收");
}
// 已组包,不允许再组包
int scanCnt=emisTmsPackDtlMapper.checkIsExists(scanBillCode);
if (scanCnt > 0) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("[" + scanBillCode + "]已组包");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS, "[" + scanBillCode + "]已组包");
}
// 获取订单数据
EmisWaybill emisWaybill = getWaybillByBillCode(mainBillCode);
// 如果是缅甸允许主单扫描,其他都不允许
if("0095".equals(emisWaybill.getReceiveCountry()) ){
// 缅甸只允许主单
if (!mainBillCode.equals(scanBillCode))) {
throw new EmisBizError(EmisBizErrorType.EXISTS, "缅甸只允许主单");
}
}else{
if (mainBillCode.equals(scanBillCode))) {
throw new EmisBizError(EmisBizErrorType.EXISTS, "主单不能组包");
}
}
// 修改主运单状态,子单做合包扫描,主单不变化
scanResultItem.getData().put("billWeight", emisWaybill.getBillWeight());
scanResultItem.getData().put("totalVolume", emisWaybill.getTotalVolume());
scanResultItem.getData().put("parcelQty", emisWaybill.getParcelQty());
scanResultItem.setResult("success");
scanResultItem.setMessage("允许操作");
itemList.add(scanResultItem);
}
return itemList;
}
public List<ScanResultItem> doUnPackScanCheck(List<ScanResultItem> itemList,String[] billCodeArr,Map<String,Object> scanDataItem) throws EmisBizError {
// 子单号处理
for (String scanBillCode : billCodeArr) {
// 返回原始数据返回
ScanResultItem scanResultItem = new ScanResultItem();
scanResultItem.setBillCode(scanBillCode);
scanResultItem.getData().putAll(scanDataItem);
// 检查组包信息是否存在
int scanCnt=emisTmsPackDtlMapper.checkIsExists(scanBillCode);
if (scanCnt == 0) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("未组包");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS, "未组包");
}
scanResultItem.getData().put("billWeight", 0f);
scanResultItem.getData().put("totalVolume", 0f);
scanResultItem.getData().put("parcelQty", 0f);
scanResultItem.setResult("success");
scanResultItem.setMessage("允许操作");
itemList.add(scanResultItem);
}
return itemList;
}
public List<ScanResultItem> doPackScan(List<ScanResultItem> itemList,String[] billCodeArr,Map<String,Object> scanDataItem,Date scanDate,String dataFrom) throws EmisBizError {
// 检查数据 合包号,重量
@ -399,43 +496,44 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
// 检查运单号是否存在
if (!isExists) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单号不存在");
scanResultItem.setMessage("运单不存在");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "运单号不存在");
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS, "运单不存在");
}
// 已签收不允许扫描
boolean isSign = checkWaybillIsSign(mainBillCode);
if (isSign) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("运单已签收");
scanResultItem.setMessage("已签收");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS, "运单已签收");
}
EmisTmsPackDtl emisTmsPackDtl = new EmisTmsPackDtl();
emisTmsPackDtl.setBillCode(scanBillCode);
emisTmsPackDtl.setMainBillCode(mainBillCode);
if(scanBillCode.equals(mainBillCode)){
emisTmsPackDtl.setBlSubBill("1");
throw new EmisBizError(EmisBizErrorType.EXISTS, "已签收");
}
// 已组包,不允许再组包
int scanCnt=emisTmsPackDtlMapper.checkUnique(emisTmsPackDtl);
int scanCnt=emisTmsPackDtlMapper.checkIsExists(scanBillCode);
if (scanCnt > 0) {
scanResultItem.setResult("fail");
scanResultItem.setMessage("[" + scanBillCode + "]已组包,不允许再组包");
scanResultItem.setMessage("[" + scanBillCode + "]已组包");
itemList.add(scanResultItem);
throw new EmisBizError(EmisBizErrorType.EXISTS, "[" + scanBillCode + "]已组包,不允许再组包");
throw new EmisBizError(EmisBizErrorType.EXISTS, "[" + scanBillCode + "]已组包");
}
// 获取订单数据
EmisWaybill emisWaybill = getWaybillByBillCode(mainBillCode);
// 如果是缅甸允许主单扫描,其他都不允许
if(!"0095".equals(emisWaybill.getReceiveCountry()) && !"1".equals(emisTmsPackDtl.getBlSubBill() ) ){
throw new EmisBizError(EmisBizErrorType.EXISTS, "非缅甸不允许主单组包");
if("0095".equals(emisWaybill.getReceiveCountry()) ){
// 缅甸只允许主单
if (!mainBillCode.equals(scanBillCode))) {
throw new EmisBizError(EmisBizErrorType.EXISTS, "缅甸只允许主单");
}
}else{
if (mainBillCode.equals(scanBillCode))) {
throw new EmisBizError(EmisBizErrorType.EXISTS, "主单不能组包");
}
}
// 记录总票数
if(!mainBillMap.containsKey(mainBillCode)){
mainBillMap.put(mainBillCode,1);
}
@ -457,6 +555,12 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
emisTmsScanRecordMapper.insertEmisTmsScanRecord(emisTmsScanRecord);
// 合包数据插入
EmisTmsPackDtl emisTmsPackDtl = new EmisTmsPackDtl();
emisTmsPackDtl.setBillCode(scanBillCode);
emisTmsPackDtl.setMainBillCode(mainBillCode);
if(scanBillCode.equals(mainBillCode)){
emisTmsPackDtl.setBlSubBill("1");
}
emisTmsPackDtl.setPackNo(packNo);
emisTmsPackDtl.setPackStatus("1");
emisTmsPackDtl.setScanStatus("1");
@ -483,7 +587,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
int eCnt=emisTmsPackMapper.checkUnique(emisTmsPack);
if(eCnt>0){
emisTmsPackMapper.updateEmisTmsPack(emisTmsPack);
emisTmsPackMapper.updateEmisTmsPackByPackNo(emisTmsPack);
}else{
emisTmsPackMapper.insertEmisTmsPack(emisTmsPack);
}

View File

@ -234,12 +234,91 @@
where id = #{id}
</update>
<update id="updateEmisTmsPackByPackNo" parameterType="EmisTmsPack">
update emis_tms_pack
<trim prefix="SET" suffixOverrides=",">
<if test="packName != null and packName != ''">pack_name = #{packName},</if>
<if test="packDate != null">pack_date = #{packDate},</if>
<if test="destCountry != null and destCountry != ''">dest_country = #{destCountry},</if>
<if test="destCountryName != null and destCountryName != ''">dest_country_name = #{destCountryName},</if>
<if test="blUnpack != null and blUnpack != ''">bl_unpack = #{blUnpack},</if>
<if test="sendStiteCode != null and sendStiteCode != ''">send_stite_code = #{sendStiteCode},</if>
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code = #{nextSiteCode},</if>
<if test="nextStation != null and nextStation != ''">next_station = #{nextStation},</if>
<if test="totalParcelQty != null">total_parcel_qty = #{totalParcelQty},</if>
<if test="totalWaybillQty != null">total_waybill_qty = #{totalWaybillQty},</if>
<if test="totalVolume != null">total_volume = #{totalVolume},</if>
<if test="totalWeight != null">total_weight = #{totalWeight},</if>
<if test="packStatus != null and packStatus != ''">pack_status = #{packStatus},</if>
<if test="printStatus != null and printStatus != ''">print_status = #{printStatus},</if>
<if test="printCount != null">print_count = #{printCount},</if>
<if test="printDate != null">print_date = #{printDate},</if>
<if test="extData != null and extData != ''">ext_data = #{extData},</if>
<if test="opMan != null and opMan != ''">op_man = #{opMan},</if>
<if test="ext1 != null and ext1 != ''">ext1 = #{ext1},</if>
<if test="ext2 != null and ext2 != ''">ext2 = #{ext2},</if>
<if test="ext3 != null and ext3 != ''">ext3 = #{ext3},</if>
<if test="ext4 != null and ext4 != ''">ext4 = #{ext4},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where pack_no = #{packNo} and del_flag='0'
</update>
<update id="updateEmisTmsPack" parameterType="EmisTmsPack">
update emis_tms_pack
<trim prefix="SET" suffixOverrides=",">
<if test="packNo != null and packNo != ''">pack_no = #{packNo},</if>
<if test="packName != null and packName != ''">pack_name = #{packName},</if>
<if test="packDate != null">pack_date = #{packDate},</if>
<if test="destCountry != null and destCountry != ''">dest_country = #{destCountry},</if>
<if test="destCountryName != null and destCountryName != ''">dest_country_name = #{destCountryName},</if>
<if test="blUnpack != null and blUnpack != ''">bl_unpack = #{blUnpack},</if>
<if test="sendStiteCode != null and sendStiteCode != ''">send_stite_code = #{sendStiteCode},</if>
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code = #{nextSiteCode},</if>
<if test="nextStation != null and nextStation != ''">next_station = #{nextStation},</if>
<if test="totalParcelQty != null">total_parcel_qty = #{totalParcelQty},</if>
<if test="totalWaybillQty != null">total_waybill_qty = #{totalWaybillQty},</if>
<if test="totalVolume != null">total_volume = #{totalVolume},</if>
<if test="totalWeight != null">total_weight = #{totalWeight},</if>
<if test="packStatus != null and packStatus != ''">pack_status = #{packStatus},</if>
<if test="printStatus != null and printStatus != ''">print_status = #{printStatus},</if>
<if test="printCount != null">print_count = #{printCount},</if>
<if test="printDate != null">print_date = #{printDate},</if>
<if test="extData != null and extData != ''">ext_data = #{extData},</if>
<if test="opMan != null and opMan != ''">op_man = #{opMan},</if>
<if test="ext1 != null and ext1 != ''">ext1 = #{ext1},</if>
<if test="ext2 != null and ext2 != ''">ext2 = #{ext2},</if>
<if test="ext3 != null and ext3 != ''">ext3 = #{ext3},</if>
<if test="ext4 != null and ext4 != ''">ext4 = #{ext4},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisTmsPackById" parameterType="Long">
delete from emis_tms_pack where id = #{id}
update emis_tms_pack set del_flag='1' where id = #{id}
</delete>
<delete id="deleteEmisTmsPackByIds" parameterType="String">
delete from emis_tms_pack where id in
update emis_tms_pack set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>