进件关联
This commit is contained in:
@@ -8,6 +8,7 @@ import com.czg.order.dto.ShopMerchantDTO;
|
|||||||
import com.czg.order.entity.ShopDirectMerchant;
|
import com.czg.order.entity.ShopDirectMerchant;
|
||||||
import com.czg.order.entity.ShopMerchant;
|
import com.czg.order.entity.ShopMerchant;
|
||||||
import com.czg.order.service.ShopMerchantService;
|
import com.czg.order.service.ShopMerchantService;
|
||||||
|
import com.czg.pay.AlipayAuthInfoDto;
|
||||||
import com.czg.pay.NativeMerchantDTO;
|
import com.czg.pay.NativeMerchantDTO;
|
||||||
import com.czg.pay.PolyMerchantDTO;
|
import com.czg.pay.PolyMerchantDTO;
|
||||||
import com.czg.service.order.mapper.ShopMerchantMapper;
|
import com.czg.service.order.mapper.ShopMerchantMapper;
|
||||||
@@ -82,8 +83,22 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
|
|||||||
if (isUp) {
|
if (isUp) {
|
||||||
shopMerchant.setChannel(CzgStrUtils.getStrOrNull(shopMerchantParam.getChannel()));
|
shopMerchant.setChannel(CzgStrUtils.getStrOrNull(shopMerchantParam.getChannel()));
|
||||||
shopMerchant.setRelatedId(shopMerchantParam.getRelatedId());
|
shopMerchant.setRelatedId(shopMerchantParam.getRelatedId());
|
||||||
if (shopMerchantParam.getNativeMerchantDTO() != null) {
|
if (shopMerchantParam.getRelatedId() == null || !shopMerchantParam.getRelatedId().equals(shopMerchant.getRelatedId())) {
|
||||||
shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
|
ShopDirectMerchant shopDirectMerchant = shopDirectMerchantService.getById(shopMerchantParam.getRelatedId());
|
||||||
|
if (shopDirectMerchant != null) {
|
||||||
|
NativeMerchantDTO nativeMerchantDTO = new NativeMerchantDTO();
|
||||||
|
nativeMerchantDTO.setWechatMerchantId(shopDirectMerchant.getWechatMerchantId());
|
||||||
|
nativeMerchantDTO.setAlipayMerchantId(shopDirectMerchant.getAlipayMerchantId());
|
||||||
|
if (StrUtil.isNotBlank(shopDirectMerchant.getAlipayAuthInfo())) {
|
||||||
|
AlipayAuthInfoDto alipayAuthInfoDto = JSONObject.parseObject(shopDirectMerchant.getAlipayAuthInfo(), AlipayAuthInfoDto.class);
|
||||||
|
nativeMerchantDTO.setAlipayAuthInfo(alipayAuthInfoDto);
|
||||||
|
}
|
||||||
|
shopMerchant.setNativePayJson(JSONObject.toJSONString(nativeMerchantDTO));
|
||||||
|
} else {
|
||||||
|
shopMerchant.setNativePayJson(null);
|
||||||
|
shopMerchant.setWechatAppId(null);
|
||||||
|
shopMerchant.setAlipayAppId(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (shopMerchantParam.getPolyMerchantDTO() != null) {
|
if (shopMerchantParam.getPolyMerchantDTO() != null) {
|
||||||
shopMerchant.setPolyPayJson(JSONObject.toJSONString(shopMerchantParam.getPolyMerchantDTO()));
|
shopMerchant.setPolyPayJson(JSONObject.toJSONString(shopMerchantParam.getPolyMerchantDTO()));
|
||||||
@@ -97,7 +112,11 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
|
|||||||
shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
|
shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return saveOrUpdate(shopMerchant);
|
if (shopMerchant.getId() == null) {
|
||||||
|
return save(shopMerchant);
|
||||||
|
} else {
|
||||||
|
return updateById(shopMerchant, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user