| @@ -8,6 +8,7 @@ import com.simple.enums.EnumAppType; | |||||
| import com.simple.enums.EnumCarVendor; | import com.simple.enums.EnumCarVendor; | ||||
| import com.simple.mapper.*; | import com.simple.mapper.*; | ||||
| import com.simple.service.WxMerchantService; | import com.simple.service.WxMerchantService; | ||||
| import com.simple.service.WxProfitSharingReceiverService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| @@ -193,6 +194,14 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| user.setStatus(0); | user.setStatus(0); | ||||
| wxMerchantBUserMapper.insertSelective(user); | wxMerchantBUserMapper.insertSelective(user); | ||||
| } //添加商户的分账账户(不是必选) | |||||
| if(wxMerchant.getAccountId() != null && wxMerchant.getAccountName() != null) { | |||||
| WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); | |||||
| receiver.setReceiverAccount(wxMerchant.getAccountId()); | |||||
| receiver.setReceiverComments(wxMerchant.getName()); | |||||
| receiver.setReceiverType(wxMerchant.getAccountTypeValue()); | |||||
| receiver.setTrueName(wxMerchant.getAccountName()); | |||||
| wxRentContractMapperService.addReceiver(wxMerchant, receiver); | |||||
| } | } | ||||
| } else { | } else { | ||||
| @@ -291,11 +300,22 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxMerchantBUserMapper.updateByPrimaryKeySelective(user); | wxMerchantBUserMapper.updateByPrimaryKeySelective(user); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| //添加商户的分账账户(不是必选) | |||||
| if(wxMerchant.getAccountId() != null && wxMerchant.getAccountName() != null | |||||
| && !wxMerchant.getAccountId().isEmpty() && !wxMerchant.getAccountName().isEmpty()) { | |||||
| WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); | |||||
| receiver.setReceiverAccount(wxMerchant.getAccountId()); | |||||
| receiver.setReceiverComments(wxMerchant.getName()); | |||||
| receiver.setReceiverType(wxMerchant.getAccountTypeValue()); | |||||
| receiver.setTrueName(wxMerchant.getAccountName()); | |||||
| wxRentContractMapperService.updateReceiver(wxMerchant, receiver); | |||||
| } else { | |||||
| wxRentContractMapperService.delReceiver(wxMerchant); | |||||
| } | |||||
| } | |||||
| } | } | ||||