|
|
|
@@ -4,9 +4,7 @@ import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.common.IdWorker; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumAppType; |
|
|
|
import com.iformall.enums.EnumCarVendor; |
|
|
|
import com.iformall.enums.EnumShopStatus; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxMerchantService; |
|
|
|
import com.iformall.service.WxProfitSharingReceiverService; |
|
|
|
@@ -49,7 +47,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
|
|
|
|
WxMerchantShop merchantShop = new WxMerchantShop(); |
|
|
|
merchantShop.setTenantId(record.getTenantId()); |
|
|
|
merchantShop.setIsDel(0); |
|
|
|
merchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); |
|
|
|
List<WxMerchantShop> merchantShops = wxMerchantShopMapper.findList(merchantShop); |
|
|
|
|
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
@@ -76,7 +74,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(id); |
|
|
|
WxMerchantShop wxMerchantShop=new WxMerchantShop(); |
|
|
|
wxMerchantShop.setMerchantId(wxMerchant.getId()); |
|
|
|
wxMerchantShop.setIsDel(0); |
|
|
|
wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); |
|
|
|
List<WxShop> shops = new ArrayList<>(); |
|
|
|
|
|
|
|
WxRentContract wxRentContract = new WxRentContract(); |
|
|
|
@@ -101,7 +99,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
|
|
|
|
WxMerchantBUser wxMerchantBUser = new WxMerchantBUser(); |
|
|
|
wxMerchantBUser.setMerchantId(wxMerchant.getId()); |
|
|
|
wxMerchantBUser.setStatus(0); |
|
|
|
wxMerchantBUser.setStatus(EnumMerchantBUserStatus.BOUND.getCode()); |
|
|
|
List<WxMerchantBUser> bUserList = wxMerchantBUserMapper.findList(wxMerchantBUser); |
|
|
|
wxMerchant.setbUsers(bUserList); |
|
|
|
return wxMerchant; |
|
|
|
@@ -116,7 +114,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
@Override |
|
|
|
public void disable(Long id) { |
|
|
|
WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(id); |
|
|
|
wxMerchant.setStatus(0); |
|
|
|
wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode()); |
|
|
|
wxMerchantMapper.updateByPrimaryKeySelective(wxMerchant); |
|
|
|
|
|
|
|
//解绑商铺 |
|
|
|
@@ -125,7 +123,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
wxMerchantShopQuery.setMerchantId(wxMerchant.getId()); |
|
|
|
List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShopQuery); |
|
|
|
for(WxMerchantShop merchantShop:wxMerchantShopList){ |
|
|
|
merchantShop.setIsDel(1); |
|
|
|
merchantShop.setIsDel(EnumDelStatus.DEL.getCode()); |
|
|
|
wxMerchantShopMapper.updateByPrimaryKeySelective(merchantShop); |
|
|
|
|
|
|
|
//更新商铺状态 |
|
|
|
@@ -151,7 +149,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
long merchantid = idWorker.nextId(); |
|
|
|
wxMerchant.setId(merchantid); |
|
|
|
Date date = new Date(); |
|
|
|
wxMerchant.setStatus(1); |
|
|
|
wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); |
|
|
|
wxMerchant.setUpdateDate(date); |
|
|
|
wxMerchant.setCreateDate(date); |
|
|
|
wxMerchantMapper.insertSelective(wxMerchant); |
|
|
|
@@ -185,7 +183,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
Date shopdate = new Date(); |
|
|
|
wxMerchantShop.setUpdateDate(shopdate); |
|
|
|
wxMerchantShop.setCreateDate(shopdate); |
|
|
|
wxMerchantShop.setIsDel(0); |
|
|
|
wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); |
|
|
|
wxMerchantShop.setRentalStartDate(wxMerchant.getRentalStartDate()); |
|
|
|
wxMerchantShop.setRentalEndDate(wxMerchant.getRentalEndDate()); |
|
|
|
wxMerchantShopMapper.insertSelective(wxMerchantShop); |
|
|
|
@@ -210,7 +208,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
date = new Date(); |
|
|
|
user.setCreateDate(date); |
|
|
|
user.setUpdateDate(date); |
|
|
|
user.setStatus(0); |
|
|
|
user.setStatus(EnumMerchantBUserStatus.NOT_BOUND.getCode()); |
|
|
|
wxMerchantBUserMapper.insertSelective(user); |
|
|
|
|
|
|
|
} //添加商户的分账账户(不是必选) |
|
|
|
@@ -249,7 +247,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
wxMerchantShopQuery.setMerchantId(wxMerchant.getId()); |
|
|
|
List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShopQuery); |
|
|
|
for(WxMerchantShop merchantShop:wxMerchantShopList){ |
|
|
|
merchantShop.setIsDel(1); |
|
|
|
merchantShop.setIsDel(EnumDelStatus.DEL.getCode()); |
|
|
|
wxMerchantShopMapper.updateByPrimaryKeySelective(merchantShop); |
|
|
|
|
|
|
|
//更新商铺状态 |
|
|
|
@@ -272,7 +270,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
wxMerchantShop.setCreateDate(shopdate); |
|
|
|
wxMerchantShop.setRentalStartDate(wxMerchant.getRentalStartDate()); |
|
|
|
wxMerchantShop.setRentalEndDate(wxMerchant.getRentalEndDate()); |
|
|
|
wxMerchantShop.setIsDel(0); |
|
|
|
wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); |
|
|
|
wxMerchantShopMapper.insertSelective(wxMerchantShop); |
|
|
|
|
|
|
|
//更新商铺状态 |
|
|
|
@@ -289,7 +287,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
bUser.setMerchantId(wxMerchant.getId()); |
|
|
|
List<WxMerchantBUser> wxMerchantBUserMapperList = wxMerchantBUserMapper.findList(bUser); |
|
|
|
for(WxMerchantBUser wxMerchantBUser:wxMerchantBUserMapperList){ |
|
|
|
wxMerchantBUser.setStatus(1); |
|
|
|
wxMerchantBUser.setStatus(EnumMerchantBUserStatus.NOT_BOUND.getCode()); |
|
|
|
wxMerchantBUserMapper.updateByPrimaryKeySelective(wxMerchantBUser); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -306,7 +304,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
date = new Date(); |
|
|
|
user.setCreateDate(date); |
|
|
|
user.setUpdateDate(date); |
|
|
|
user.setStatus(0); |
|
|
|
user.setStatus(EnumMerchantBUserStatus.BOUND.getCode()); |
|
|
|
wxMerchantBUserMapper.insertSelective(user); |
|
|
|
}else{//有id的更新 |
|
|
|
user.setBUserId(user.getId()); |
|
|
|
@@ -315,7 +313,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
user.setAppId(wxAppinfo.getAppId()); |
|
|
|
date = new Date(); |
|
|
|
user.setUpdateDate(date); |
|
|
|
user.setStatus(0); |
|
|
|
user.setStatus(EnumMerchantBUserStatus.BOUND.getCode()); |
|
|
|
wxMerchantBUserMapper.updateByPrimaryKeySelective(user); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -351,7 +349,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setId(idWorker.nextId()); |
|
|
|
wxBillRent.setShopId(wxshop.getId()); |
|
|
|
wxBillRent.setPayStatus(0); |
|
|
|
wxBillRent.setPayStatus(EnumBillRentStatus.NOT_PAID.getCode()); |
|
|
|
wxBillRent.setPay(new BigDecimal(0)); |
|
|
|
wxBillRent.setTenantId(wxshop.getTenantId()); |
|
|
|
BigDecimal needpay = wxRentContract.getPayArea().multiply(wxRentContract.getPrice()); |
|
|
|
@@ -359,7 +357,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
wxBillRent.setExpiredDay(0); |
|
|
|
wxBillRent.setOwe(new BigDecimal(0)); |
|
|
|
wxBillRent.setPayDate(rentalStartDate); |
|
|
|
wxBillRent.setPayWay(4); |
|
|
|
wxBillRent.setPayWay(EnumBillRentPayWay.CASH.getCode()); |
|
|
|
wxBillRent.setPrice(wxRentContract.getPrice()); |
|
|
|
wxBillRent.setReceiptNum(""); |
|
|
|
wxBillRent.setReceiveDate(rentalStartDate); |
|
|
|
@@ -383,14 +381,14 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setId(idWorker.nextId()); |
|
|
|
wxBillRent.setShopId(wxshop.getId()); |
|
|
|
wxBillRent.setPayStatus(0); |
|
|
|
wxBillRent.setPayStatus(EnumBillRentStatus.NOT_PAID.getCode()); |
|
|
|
wxBillRent.setPay(new BigDecimal(0)); |
|
|
|
wxBillRent.setTenantId(wxshop.getTenantId()); |
|
|
|
wxBillRent.setNeedPay(needpaymoney); |
|
|
|
wxBillRent.setExpiredDay(0); |
|
|
|
wxBillRent.setOwe(new BigDecimal(0)); |
|
|
|
wxBillRent.setPayDate(rentalStartDate); |
|
|
|
wxBillRent.setPayWay(4); |
|
|
|
wxBillRent.setPayWay(EnumBillRentPayWay.CASH.getCode()); |
|
|
|
wxBillRent.setPrice(wxRentContract.getPrice()); |
|
|
|
wxBillRent.setReceiptNum(""); |
|
|
|
wxBillRent.setReceiveDate(rentalStartDate); |
|
|
|
@@ -416,14 +414,14 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setId(idWorker.nextId()); |
|
|
|
wxBillRent.setShopId(wxshop.getId()); |
|
|
|
wxBillRent.setPayStatus(0); |
|
|
|
wxBillRent.setPayStatus(EnumBillRentStatus.NOT_PAID.getCode()); |
|
|
|
wxBillRent.setPay(new BigDecimal(0)); |
|
|
|
wxBillRent.setTenantId(wxshop.getTenantId()); |
|
|
|
wxBillRent.setNeedPay(needpaymoney); |
|
|
|
wxBillRent.setExpiredDay(0); |
|
|
|
wxBillRent.setOwe(new BigDecimal(0)); |
|
|
|
wxBillRent.setPayDate(rentalStartDate); |
|
|
|
wxBillRent.setPayWay(4); |
|
|
|
wxBillRent.setPayWay(EnumBillRentPayWay.CASH.getCode()); |
|
|
|
wxBillRent.setPrice(wxRentContract.getPrice()); |
|
|
|
wxBillRent.setReceiptNum(""); |
|
|
|
wxBillRent.setReceiveDate(rentalStartDate); |
|
|
|
@@ -448,14 +446,14 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setId(idWorker.nextId()); |
|
|
|
wxBillRent.setShopId(wxshop.getId()); |
|
|
|
wxBillRent.setPayStatus(0); |
|
|
|
wxBillRent.setPayStatus(EnumBillRentStatus.NOT_PAID.getCode()); |
|
|
|
wxBillRent.setPay(new BigDecimal(0)); |
|
|
|
wxBillRent.setTenantId(wxshop.getTenantId()); |
|
|
|
wxBillRent.setNeedPay(needpaymoney); |
|
|
|
wxBillRent.setExpiredDay(0); |
|
|
|
wxBillRent.setOwe(new BigDecimal(0)); |
|
|
|
wxBillRent.setPayDate(rentalStartDate); |
|
|
|
wxBillRent.setPayWay(4); |
|
|
|
wxBillRent.setPayWay(EnumBillRentPayWay.CASH.getCode()); |
|
|
|
wxBillRent.setPrice(wxRentContract.getPrice()); |
|
|
|
wxBillRent.setReceiptNum(""); |
|
|
|
wxBillRent.setReceiveDate(rentalStartDate); |
|
|
|
|