@ -47,231 +47,246 @@ public class OpSignDataHandler {
public void opSignDataHandler ( Map map , Message message , Channel channel ) throws IOException {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
log . info ( "##################opSignDataHandler: 处理欧派收货数据到新系统" ) ;
OpOrderStatusLogEntity opOrderStatusLogEntity = ( OpOrderStatusLogEntity ) map . get ( "messageData" ) ;
String args = opOrderStatusLogEntity . getArgs ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( args ) ;
JSONArray jsonArray = jsonObject . getJSONArray ( "value" ) ;
for ( int i = 0 ; i < jsonArray . size ( ) ; i + + ) {
JSONObject valueObject = jsonArray . getJSONObject ( i ) ;
JSONObject outGoingOrder = valueObject . getJSONObject ( "OutGoingOrder" ) ;
String outGoingOrderCode = outGoingOrder . getString ( "Code" ) ;
JSONObject store = valueObject . getJSONObject ( "Store" ) ;
JSONArray packages = valueObject . getJSONArray ( "Packages" ) ;
String status = outGoingOrder . getString ( "Status" ) ;
//先查询是否已经有数据存在系统中
OpOutGoingOrderEntity opOutGoingOrderEntity = opOutGoingOrderService . getEntityByCode ( outGoingOrderCode ) ;
Long outGoingOrderId = null ;
if ( Objects . isNull ( opOutGoingOrderEntity ) ) {
//如果是空则新增
opOutGoingOrderEntity = new OpOutGoingOrderEntity ( ) ;
opOutGoingOrderEntity . setCode ( outGoingOrderCode ) ;
if ( "新建" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 0 ) ;
} else if ( "已调度" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 1 ) ;
} else if ( "已发运" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 2 ) ;
} else if ( "已签收" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 3 ) ;
} else if ( "部分签收" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 4 ) ;
} else if ( "待处理" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 5 ) ;
}
JSONObject warehouse = outGoingOrder . getJSONObject ( "Warehouse" ) ;
if ( ! Objects . isNull ( warehouse ) ) {
opOutGoingOrderEntity . setWarehouseCode ( warehouse . getString ( "Code" ) ) ;
opOutGoingOrderEntity . setWarehouseName ( warehouse . getString ( "Name" ) ) ;
opOutGoingOrderEntity . setWarehouseAddress ( warehouse . getString ( "Address" ) ) ;
}
JSONObject truck = outGoingOrder . getJSONObject ( "Truck" ) ;
if ( ! Objects . isNull ( truck ) ) {
opOutGoingOrderEntity . setTruckPlate ( truck . getString ( "Plate" ) ) ;
}
opOutGoingOrderEntity . setDeliveryDate ( CommonUtil . StringToDateByT ( outGoingOrder . getString ( "DeliveryDate" ) ) ) ;
opOutGoingOrderEntity . setCreator ( outGoingOrder . getString ( "Creator" ) ) ;
opOutGoingOrderEntity . setCreateTime ( CommonUtil . StringToDateByT ( outGoingOrder . getString ( "CreateTime" ) ) ) ;
try {
if ( Objects . isNull ( map ) ) {
log . error ( "##################opSignDataHandler: 处理欧派收货数据到新系统,map为空" ) ;
return ;
}
// 获取消息id
String messageId = message . getMessageProperties ( ) . getMessageId ( ) ;
// 获取消息id
String messageData = new String ( message . getBody ( ) ) ;
if ( ! Objects . isNull ( store ) ) {
JSONObject shop = store . getJSONObject ( "Shop" ) ;
if ( ! Objects . isNull ( shop ) ) {
opOutGoingOrderEntity . setShopCode ( shop . getString ( "Code" ) ) ;
opOutGoingOrderEntity . setShopName ( shop . getString ( "Name" ) ) ;
OpOrderStatusLogEntity opOrderStatusLogEntity = ( OpOrderStatusLogEntity ) map . get ( "messageData" ) ;
String args = opOrderStatusLogEntity . getArgs ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( args ) ;
JSONArray jsonArray = jsonObject . getJSONArray ( "value" ) ;
for ( int i = 0 ; i < jsonArray . size ( ) ; i + + ) {
JSONObject valueObject = jsonArray . getJSONObject ( i ) ;
JSONObject outGoingOrder = valueObject . getJSONObject ( "OutGoingOrder" ) ;
String outGoingOrderCode = outGoingOrder . getString ( "Code" ) ;
JSONObject store = valueObject . getJSONObject ( "Store" ) ;
JSONArray packages = valueObject . getJSONArray ( "Packages" ) ;
String status = outGoingOrder . getString ( "Status" ) ;
//先查询是否已经有数据存在系统中
OpOutGoingOrderEntity opOutGoingOrderEntity = opOutGoingOrderService . getEntityByCode ( outGoingOrderCode ) ;
Long outGoingOrderId = null ;
if ( Objects . isNull ( opOutGoingOrderEntity ) ) {
//如果是空则新增
opOutGoingOrderEntity = new OpOutGoingOrderEntity ( ) ;
opOutGoingOrderEntity . setCode ( outGoingOrderCode ) ;
if ( "新建" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 0 ) ;
} else if ( "已调度" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 1 ) ;
} else if ( "已发运" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 2 ) ;
} else if ( "已签收" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 3 ) ;
} else if ( "部分签收" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 4 ) ;
} else if ( "待处理" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 5 ) ;
}
opOutGoingOrderEntity . setStoreCode ( store . getString ( "Code" ) ) ;
opOutGoingOrderEntity . setStoreName ( store . getString ( "Name" ) ) ;
}
opOutGoingOrderEntity . setSendTime ( CommonUtil . StringToDateByT ( outGoingOrder . getString ( "SendTime" ) ) ) ;
opOutGoingOrderService . save ( opOutGoingOrderEntity ) ;
outGoingOrderId = opOutGoingOrderEntity . getId ( ) ;
} else {
if ( "新建" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 0 ) ;
} else if ( "已调度" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 1 ) ;
} else if ( "已发运" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 2 ) ;
} else if ( "已签收" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 3 ) ;
} else if ( "部分签收" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 4 ) ;
} else if ( "待处理" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 5 ) ;
}
opOutGoingOrderService . updateById ( opOutGoingOrderEntity ) ;
outGoingOrderId = opOutGoingOrderEntity . getId ( ) ;
}
JSONObject warehouse = outGoingOrder . getJSONObject ( "Warehouse" ) ;
if ( ! Objects . isNull ( warehouse ) ) {
opOutGoingOrderEntity . setWarehouseCode ( warehouse . getString ( "Code" ) ) ;
opOutGoingOrderEntity . setWarehouseName ( warehouse . getString ( "Name" ) ) ;
opOutGoingOrderEntity . setWarehouseAddress ( warehouse . getString ( "Address" ) ) ;
}
JSONObject truck = outGoingOrder . getJSONObject ( "Truck" ) ;
if ( ! Objects . isNull ( truck ) ) {
opOutGoingOrderEntity . setTruckPlate ( truck . getString ( "Plate" ) ) ;
}
opOutGoingOrderEntity . setDeliveryDate ( CommonUtil . StringToDateByT ( outGoingOrder . getString ( "DeliveryDate" ) ) ) ;
opOutGoingOrderEntity . setCreator ( outGoingOrder . getString ( "Creator" ) ) ;
opOutGoingOrderEntity . setCreateTime ( CommonUtil . StringToDateByT ( outGoingOrder . getString ( "CreateTime" ) ) ) ;
//处理签收单数据
Long signBillId = null ;
String recevierCode = valueObject . getString ( "Code" ) ;
String SignBillStatus = valueObject . getString ( "Status" ) ;
OpSignBillEntity signBillEntity = opSignBillService . findEntityByCode ( recevierCode ) ;
if ( Objects . isNull ( signBillEntity ) ) {
signBillEntity = new OpSignBillEntity ( ) ;
signBillEntity . setOutGoingOrderId ( outGoingOrderId ) ;
signBillEntity . setCode ( recevierCode ) ;
if ( "新建" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 0 ) ;
} else if ( "已签收" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 1 ) ;
} else if ( "部分签收" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 2 ) ;
}
signBillEntity . setSignPerson ( valueObject . getString ( "SignPerson" ) ) ;
signBillEntity . setSignPhone ( valueObject . getString ( "SignPhone" ) ) ;
signBillEntity . setSignAddress ( valueObject . getString ( "SignAddress" ) ) ;
String da = valueObject . getString ( "SignTime" ) ;
Date signTime = CommonUtil . StringToDateByT ( da ) ;
signBillEntity . setSignTime ( signTime ) ;
signBillEntity . setRemark ( valueObject . getString ( "Remark" ) ) ;
signBillEntity . setOutGoingOrderCode ( outGoingOrderCode ) ;
signBillEntity . setAgainsendReason ( valueObject . getString ( "AgainsendReason" ) ) ;
signBillEntity . setDescription ( valueObject . getString ( "Description" ) ) ;
Boolean isAgainsend = valueObject . getBoolean ( "IsAgainsend" ) ;
if ( isAgainsend ) {
signBillEntity . setIsAgainsend ( 1 ) ;
} else {
signBillEntity . setIsAgainsend ( 0 ) ;
}
signBillEntity . setCreator ( valueObject . getString ( "Creator" ) ) ;
signBillEntity . setCreateTime ( CommonUtil . StringToDateByT ( valueObject . getString ( "CreateTime" ) ) ) ;
signBillEntity . setCustomerRate ( valueObject . getBigDecimal ( "CustomerRate" ) ) ;
signBillEntity . setCustomerFeedback ( valueObject . getString ( "CustomerFeedback" ) ) ;
if ( ! Objects . isNull ( store ) ) {
JSONObject shop = store . getJSONObject ( "Shop" ) ;
if ( ! Objects . isNull ( shop ) ) {
signBillEntity . setShopCode ( shop . getString ( "Code" ) ) ;
signBillEntity . setShopName ( shop . getString ( "Name" ) ) ;
if ( ! Objects . isNull ( store ) ) {
JSONObject shop = store . getJSONObject ( "Shop" ) ;
if ( ! Objects . isNull ( shop ) ) {
opOutGoingOrderEntity . setShopCode ( shop . getString ( "Code" ) ) ;
opOutGoingOrderEntity . setShopName ( shop . getString ( "Name" ) ) ;
}
opOutGoingOrderEntity . setStoreCode ( store . getString ( "Code" ) ) ;
opOutGoingOrderEntity . setStoreName ( store . getString ( "Name" ) ) ;
}
signBillEntity . setStoreCode ( store . getString ( "Code" ) ) ;
signBillEntity . setStoreName ( store . getString ( "Name" ) ) ;
}
signBillEntity . setDriverPhone ( valueObject . getString ( "DriverPhone" ) ) ;
signBillEntity . setDriverName ( valueObject . getString ( "DriverName" ) ) ;
signBillEntity . setDeliveryTime ( CommonUtil . StringToDateByT ( valueObject . getString ( "DeliveryTime" ) ) ) ;
opSignBillService . save ( signBillEntity ) ;
signBillId = signBillEntity . getId ( ) ;
} else {
if ( "新建" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 0 ) ;
} else if ( "已签收" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 1 ) ;
} else if ( "部分签收" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 2 ) ;
opOutGoingOrderEntity . setSendTime ( CommonUtil . StringToDateByT ( outGoingOrder . getString ( "SendTime" ) ) ) ;
opOutGoingOrderService . save ( opOutGoingOrderEntity ) ;
outGoingOrderId = opOutGoingOrderEntity . getId ( ) ;
} else {
if ( "新建" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 0 ) ;
} else if ( "已调度" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 1 ) ;
} else if ( "已发运" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 2 ) ;
} else if ( "已签收" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 3 ) ;
} else if ( "部分签收" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 4 ) ;
} else if ( "待处理" . equals ( status ) ) {
opOutGoingOrderEntity . setOutGoingOrderStatus ( 5 ) ;
}
opOutGoingOrderService . updateById ( opOutGoingOrderEntity ) ;
outGoingOrderId = opOutGoingOrderEntity . getId ( ) ;
}
opSignBillService . updateById ( signBillEntity ) ;
signBillId = signBillEntity . getId ( ) ;
}
//存入包件数据
for ( int j = 0 ; j < packages . size ( ) ; j + + ) {
JSONObject packagesJSONObject = packages . getJSONObject ( j ) ;
String code = packagesJSONObject . getString ( "Code" ) ;
String packageStatus = packagesJSONObject . getString ( "PackageStatus" ) ;
OpSignPackageEntity signPackageEntity = opSignPackageService . findEntityByOrderPackageCode ( code ) ;
if ( Objects . isNull ( signPackageEntity ) ) {
signPackageEntity = new OpSignPackageEntity ( ) ;
signPackageEntity . setSignBillId ( signBillId ) ;
signPackageEntity . setOrderPackageCode ( code ) ;
if ( "已调度" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 1 ) ;
} else if ( "已装车" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 2 ) ;
} else if ( "待收货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 3 ) ;
} else if ( "已收货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 4 ) ;
} else if ( "已在库" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 5 ) ;
} else if ( "待理货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 6 ) ;
} else if ( "待上架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 7 ) ;
} else if ( "已上架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 8 ) ;
} else if ( "已下架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 9 ) ;
} else if ( "已发运" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 10 ) ;
} else if ( "已签收" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 11 ) ;
} else if ( "待返货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 12 ) ;
} else if ( "已提件" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 13 ) ;
} else if ( "已拒收" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 14 ) ;
} else if ( "异常" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( - 1 ) ;
//处理签收单数据
Long signBillId = null ;
String recevierCode = valueObject . getString ( "Code" ) ;
String SignBillStatus = valueObject . getString ( "Status" ) ;
OpSignBillEntity signBillEntity = opSignBillService . findEntityByCode ( recevierCode ) ;
if ( Objects . isNull ( signBillEntity ) ) {
signBillEntity = new OpSignBillEntity ( ) ;
signBillEntity . setOutGoingOrderId ( outGoingOrderId ) ;
signBillEntity . setCode ( recevierCode ) ;
if ( "新建" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 0 ) ;
} else if ( "已签收" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 1 ) ;
} else if ( "部分签收" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 2 ) ;
}
signBillEntity . setSignPerson ( valueObject . getString ( "SignPerson" ) ) ;
signBillEntity . setSignPhone ( valueObject . getString ( "SignPhone" ) ) ;
signBillEntity . setSignAddress ( valueObject . getString ( "SignAddress" ) ) ;
String da = valueObject . getString ( "SignTime" ) ;
Date signTime = CommonUtil . StringToDateByT ( da ) ;
signBillEntity . setSignTime ( signTime ) ;
signBillEntity . setRemark ( valueObject . getString ( "Remark" ) ) ;
signBillEntity . setOutGoingOrderCode ( outGoingOrderCode ) ;
signBillEntity . setAgainsendReason ( valueObject . getString ( "AgainsendReason" ) ) ;
signBillEntity . setDescription ( valueObject . getString ( "Description" ) ) ;
Boolean isAgainsend = valueObject . getBoolean ( "IsAgainsend" ) ;
if ( isAgainsend ) {
signBillEntity . setIsAgainsend ( 1 ) ;
} else {
signPackageEntity . setPackageStatus ( 0 ) ;
signBillEntity . setIsAgainsend ( 0 ) ;
}
Boolean isInventory = packagesJSONObject . getBoolean ( "IsInventory" ) ;
if ( isInventory ) {
signPackageEntity . setIsInventory ( 1 ) ;
} else {
signPackageEntity . setIsInventory ( 0 ) ;
signBillEntity . setCreator ( valueObject . getString ( "Creator" ) ) ;
signBillEntity . setCreateTime ( CommonUtil . StringToDateByT ( valueObject . getString ( "CreateTime" ) ) ) ;
signBillEntity . setCustomerRate ( valueObject . getBigDecimal ( "CustomerRate" ) ) ;
signBillEntity . setCustomerFeedback ( valueObject . getString ( "CustomerFeedback" ) ) ;
if ( ! Objects . isNull ( store ) ) {
JSONObject shop = store . getJSONObject ( "Shop" ) ;
if ( ! Objects . isNull ( shop ) ) {
signBillEntity . setShopCode ( shop . getString ( "Code" ) ) ;
signBillEntity . setShopName ( shop . getString ( "Name" ) ) ;
}
signBillEntity . setStoreCode ( store . getString ( "Code" ) ) ;
signBillEntity . setStoreName ( store . getString ( "Name" ) ) ;
}
signBillEntity . setDriverPhone ( valueObject . getString ( "DriverPhone" ) ) ;
signBillEntity . setDriverName ( valueObject . getString ( "DriverName" ) ) ;
signBillEntity . setDeliveryTime ( CommonUtil . StringToDateByT ( valueObject . getString ( "DeliveryTime" ) ) ) ;
opSignBillService . save ( signBillEntity ) ;
signBillId = signBillEntity . getId ( ) ;
} else {
if ( "新建" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 0 ) ;
} else if ( "已签收" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 1 ) ;
} else if ( "部分签收" . equals ( SignBillStatus ) ) {
signBillEntity . setSignBillStatus ( 2 ) ;
}
opSignPackageService . save ( signPackageEntity ) ;
} else {
if ( "已调度" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 1 ) ;
} else if ( "已装车" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 2 ) ;
} else if ( "待收货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 3 ) ;
} else if ( "已收货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 4 ) ;
} else if ( "已在库" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 5 ) ;
} else if ( "待理货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 6 ) ;
} else if ( "待上架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 7 ) ;
} else if ( "已上架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 8 ) ;
} else if ( "已下架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 9 ) ;
} else if ( "已发运" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 10 ) ;
} else if ( "已签收" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 11 ) ;
} else if ( "待返货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 12 ) ;
} else if ( "已提件" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 13 ) ;
} else if ( "已拒收" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 14 ) ;
} else if ( "异常" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( - 1 ) ;
opSignBillService . updateById ( signBillEntity ) ;
signBillId = signBillEntity . getId ( ) ;
}
//存入包件数据
for ( int j = 0 ; j < packages . size ( ) ; j + + ) {
JSONObject packagesJSONObject = packages . getJSONObject ( j ) ;
String code = packagesJSONObject . getString ( "Code" ) ;
String packageStatus = packagesJSONObject . getString ( "PackageStatus" ) ;
OpSignPackageEntity signPackageEntity = opSignPackageService . findEntityByOrderPackageCode ( code ) ;
if ( Objects . isNull ( signPackageEntity ) ) {
signPackageEntity = new OpSignPackageEntity ( ) ;
signPackageEntity . setSignBillId ( signBillId ) ;
signPackageEntity . setOrderPackageCode ( code ) ;
if ( "已调度" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 1 ) ;
} else if ( "已装车" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 2 ) ;
} else if ( "待收货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 3 ) ;
} else if ( "已收货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 4 ) ;
} else if ( "已在库" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 5 ) ;
} else if ( "待理货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 6 ) ;
} else if ( "待上架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 7 ) ;
} else if ( "已上架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 8 ) ;
} else if ( "已下架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 9 ) ;
} else if ( "已发运" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 10 ) ;
} else if ( "已签收" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 11 ) ;
} else if ( "待返货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 12 ) ;
} else if ( "已提件" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 13 ) ;
} else if ( "已拒收" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 14 ) ;
} else if ( "异常" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( - 1 ) ;
} else {
signPackageEntity . setPackageStatus ( 0 ) ;
}
Boolean isInventory = packagesJSONObject . getBoolean ( "IsInventory" ) ;
if ( isInventory ) {
signPackageEntity . setIsInventory ( 1 ) ;
} else {
signPackageEntity . setIsInventory ( 0 ) ;
}
opSignPackageService . save ( signPackageEntity ) ;
} else {
signPackageEntity . setPackageStatus ( 0 ) ;
if ( "已调度" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 1 ) ;
} else if ( "已装车" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 2 ) ;
} else if ( "待收货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 3 ) ;
} else if ( "已收货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 4 ) ;
} else if ( "已在库" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 5 ) ;
} else if ( "待理货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 6 ) ;
} else if ( "待上架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 7 ) ;
} else if ( "已上架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 8 ) ;
} else if ( "已下架" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 9 ) ;
} else if ( "已发运" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 10 ) ;
} else if ( "已签收" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 11 ) ;
} else if ( "待返货" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 12 ) ;
} else if ( "已提件" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 13 ) ;
} else if ( "已拒收" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( 14 ) ;
} else if ( "异常" . equals ( packageStatus ) ) {
signPackageEntity . setPackageStatus ( - 1 ) ;
} else {
signPackageEntity . setPackageStatus ( 0 ) ;
}
opSignPackageService . updateById ( signPackageEntity ) ;
}
opSignPackageService . updateById ( signPackageEntity ) ;
}
}
} catch ( Exception e ) {
log . error ( "opSignDataHandler error {}" , e . getMessage ( ) ) ;
}
}
}