@ -47,7 +47,7 @@ public class HighTestController {
@RequestMapping ( value = "/initTYMerchantStore" , method = RequestMethod . GET )
@ResponseBody
@ApiOperation ( value = "根据id查询订单详情 " )
@ApiOperation ( value = "根据" )
public ResponseData initTYMerchantStore ( @RequestParam ( name = "merchantId" , required = true ) Long merchantId ) {
try {
@ -64,6 +64,52 @@ public class HighTestController {
for ( Object gasObject : jsonArray ) {
JSONObject object = JSONObject . parseObject ( JSONObject . toJSONString ( gasObject ) ) ;
if ( object . getInteger ( "gasStatus" ) = = 1 ) {
HighMerchantStoreModel store = highMerchantStoreService . getMerchantStoreByKey ( object . getString ( "gasId" ) ) ;
if ( store ! = null ) {
store . setType ( 1 ) ;
store . setMerchantId ( merchant . getId ( ) ) ;
store . setCompanyId ( merchant . getCompanyId ( ) ) ;
store . setStoreKey ( object . getString ( "gasId" ) ) ;
store . setStoreName ( object . getString ( "gasName" ) ) ;
store . setStoreLogo ( object . getString ( "gasLogoSmall" ) ) ;
store . setRegionId ( object . getLong ( "provinceCode" ) ) ;
store . setRegionName ( object . getString ( "provinceName" ) ) ;
store . setAddress ( object . getString ( "gasAddress" ) ) ;
store . setLongitude ( object . getString ( "gasAddressLongitude" ) ) ;
store . setLatitude ( object . getString ( "gasAddressLatitude" ) ) ;
store . setOperatorId ( 0L ) ;
store . setOperatorName ( "系统创建" ) ;
store . setUpdateTime ( new Date ( ) ) ;
store . setExt1 ( object . getString ( "gasSourceId" ) ) ;
highMerchantStoreService . updateMerchantStoreDetail ( store ) ;
JSONArray oilPriceList = object . getJSONArray ( "oilPriceList" ) ;
for ( Object oilPrice : oilPriceList ) {
JSONObject oilPriceObject = JSONObject . parseObject ( JSONObject . toJSONString ( oilPrice ) ) ;
// 查询门店油号
highGasOilPrice = highGasOilPriceService . getGasOilPriceByStoreAndOilNo ( store . getId ( ) , oilPriceObject . getInteger ( "oilNo" ) ) ;
if ( highGasOilPrice = = null ) {
highGasOilPrice . setMerchantStoreId ( store . getId ( ) ) ;
highGasOilPrice . setOilNo ( oilPriceObject . getInteger ( "oilNo" ) ) ;
highGasOilPrice . setOilNoName ( oilPriceObject . getString ( "oilNoName" ) ) ;
highGasOilPrice . setPriceVip ( oilPriceObject . getBigDecimal ( "priceVip" ) ) ;
highGasOilPrice . setPriceGun ( oilPriceObject . getBigDecimal ( "priceGun" ) ) ;
highGasOilPrice . setPriceOfficial ( oilPriceObject . getBigDecimal ( "priceOfficial" ) ) ;
highGasOilPrice . setOilType ( oilPriceObject . getInteger ( "oilType" ) ) ;
highGasOilPrice . setOilTypeName ( oilPriceObject . getString ( "oilTypeName" ) ) ;
} else {
highGasOilPrice . setMerchantStoreId ( store . getId ( ) ) ;
highGasOilPrice . setOilNo ( oilPriceObject . getInteger ( "oilNo" ) ) ;
highGasOilPrice . setOilNoName ( oilPriceObject . getString ( "oilNoName" ) ) ;
highGasOilPrice . setPriceVip ( oilPriceObject . getBigDecimal ( "priceVip" ) ) ;
highGasOilPrice . setPriceGun ( oilPriceObject . getBigDecimal ( "priceGun" ) ) ;
highGasOilPrice . setPriceOfficial ( oilPriceObject . getBigDecimal ( "priceOfficial" ) ) ;
highGasOilPrice . setOilType ( oilPriceObject . getInteger ( "oilType" ) ) ;
highGasOilPrice . setOilTypeName ( oilPriceObject . getString ( "oilTypeName" ) ) ;
}
highGasOilPriceService . editGasOilPrice ( highGasOilPrice ) ;
}
} else {
highMerchantStore = new HighMerchantStore ( ) ;
highMerchantStore . setType ( 1 ) ;
highMerchantStore . setMerchantId ( merchant . getId ( ) ) ;
@ -81,11 +127,11 @@ public class HighTestController {
highMerchantStore . setOperatorName ( "系统创建" ) ;
highMerchantStore . setCreateTime ( new Date ( ) ) ;
highMerchantStore . setUpdateTime ( new Date ( ) ) ;
highMerchantStore . setExt1 ( object . getString ( "gasSourceId" ) ) ;
HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel ( ) ;
BeanUtils . copyProperties ( highMerchantStore , merchantStoreModel ) ;
highMerchantStoreService . insertMerchantStore ( merchantStoreModel ) ;
JSONArray oilPriceList = object . getJSONArray ( "oilPriceList" ) ;
for ( Object oilPrice : oilPriceList ) {
JSONObject oilPriceObject = JSONObject . parseObject ( JSONObject . toJSONString ( oilPrice ) ) ;
@ -100,7 +146,7 @@ public class HighTestController {
highGasOilPrice . setOilTypeName ( oilPriceObject . getString ( "oilTypeName" ) ) ;
highGasOilPriceService . editGasOilPrice ( highGasOilPrice ) ;
}
}
}
}
return ResponseMsgUtil . success ( jsonArray ) ;