|
|
|
@@ -3,10 +3,11 @@ package com.iformall.service.impl; |
|
|
|
import java.util.*; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.domain.po.WxMall; |
|
|
|
import com.iformall.domain.po.WxPark; |
|
|
|
import com.iformall.domain.po.WxProjectConfig; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumCarVendor; |
|
|
|
import com.iformall.mapper.WxMerchantMapper; |
|
|
|
import com.iformall.mapper.WxParkMapper; |
|
|
|
import com.iformall.mapper.WxProfitSharingReceiverMapper; |
|
|
|
import com.iformall.service.WxMallService; |
|
|
|
import com.iformall.service.WxParkService; |
|
|
|
import org.slf4j.Logger; |
|
|
|
@@ -14,6 +15,7 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.iformall.common.IdWorker; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxParkServiceImpl implements WxParkService { |
|
|
|
@@ -25,6 +27,12 @@ public class WxParkServiceImpl implements WxParkService { |
|
|
|
@Autowired |
|
|
|
WxMallService wxMallService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMerchantMapper wxMerchantMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public void wxParkInit(String tenantId, WxProjectConfig wxProjectConfig) { |
|
|
|
WxMall byTenantId = wxMallService.getByTenantId(tenantId); |
|
|
|
@@ -61,13 +69,45 @@ public class WxParkServiceImpl implements WxParkService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void saveOrUpdate(WxPark record) { |
|
|
|
Date now = new Date(); |
|
|
|
if (record.getId() == null) { |
|
|
|
//record.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setCreateDate(now); |
|
|
|
record.setUpdateDate(now); |
|
|
|
wxParkMapper.insert(record); |
|
|
|
|
|
|
|
WxMerchant wxMerchant = new WxMerchant(); |
|
|
|
wxMerchant.setId(idWorker.nextId()); |
|
|
|
wxMerchant.setTenantId(record.getTenantId()); |
|
|
|
wxMerchant.setImgUrl("baseImgUrl"); |
|
|
|
wxMerchant.setName(EnumCarVendor.getEnum(record.getVendorType()).getMessage() + "停车商户"); |
|
|
|
wxMerchant.setLinkPhone("0000-0000000"); |
|
|
|
wxMerchant.setCarVendorType(record.getVendorType()); |
|
|
|
wxMerchant.setCarParams(record.getVendorParams()); |
|
|
|
wxMerchant.setStatus(1); |
|
|
|
wxMerchant.setCreateDate(now); |
|
|
|
wxMerchant.setUpdateDate(now); |
|
|
|
wxMerchantMapper.insert(wxMerchant); |
|
|
|
WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver(); |
|
|
|
wxProfitSharingReceiver.setId(idWorker.nextId()); |
|
|
|
wxProfitSharingReceiver.setTenantId(record.getTenantId()); |
|
|
|
wxProfitSharingReceiver.setMerchantId(wxMerchant.getId()); |
|
|
|
wxProfitSharingReceiver.setReceiverType(1); |
|
|
|
wxProfitSharingReceiver.setReceiverAccount("wxid_ppufk303mdrs12"); |
|
|
|
wxProfitSharingReceiver.setReceiverComments(wxMerchant.getName()); |
|
|
|
wxProfitSharingReceiver.setSharingType(1); |
|
|
|
wxProfitSharingReceiver.setTrueName(wxMerchant.getName()); |
|
|
|
wxProfitSharingReceiver.setStatus(0); |
|
|
|
wxProfitSharingReceiver.setCreateTime(now); |
|
|
|
wxProfitSharingReceiver.setUpdateTime(now); |
|
|
|
wxProfitSharingReceiverMapper.insert(wxProfitSharingReceiver); |
|
|
|
|
|
|
|
} else { |
|
|
|
record.setUpdateDate(now); |
|
|
|
wxParkMapper.updateById(record); |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -77,11 +117,5 @@ public class WxParkServiceImpl implements WxParkService { |
|
|
|
wxParkMapper.deleteById(id); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |