| @@ -267,7 +267,7 @@ public class WxMerchantController extends BaseController { | |||||
| @SystemControllerLog(description = "商户-停用") | @SystemControllerLog(description = "商户-停用") | ||||
| public ResultData disable(Long id) { | public ResultData disable(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::disable"); | logger.debug("[" + getIpAddr() + "] WxMerchantController::disable"); | ||||
| wxMerchantService.disable(id); | |||||
| wxMerchantService.disable(id,this.getUser()); | |||||
| return new ResultData(Result.SUCCESS, "停用成功"); | return new ResultData(Result.SUCCESS, "停用成功"); | ||||
| } | } | ||||
| @@ -42,7 +42,8 @@ public interface WxBillPropertyMapper extends CommonMapper<WxBillProperty, Long> | |||||
| void updateInvalidStatusByRent(WxRentContract wxRentContract); | void updateInvalidStatusByRent(WxRentContract wxRentContract); | ||||
| void deletePreviewBill(WxPropertyContract wxPropertyContract); | |||||
| void deleteBillByContract(WxPropertyContract wxPropertyContract); | |||||
| void deletePreviewBill(WxBillProperty wxBillProperty); | |||||
| void updateForReceivePay(WxBillProperty record); | void updateForReceivePay(WxBillProperty record); | ||||
| @@ -37,7 +37,8 @@ public interface WxBillRentMapper extends CommonMapper<WxBillRent, Long> { | |||||
| void updateInvalidStatus(WxBillRent wxBillRent); | void updateInvalidStatus(WxBillRent wxBillRent); | ||||
| void deletePreviewBill(WxRentContract wxRentContract); | |||||
| void deleteBillByContract(WxRentContract wxRentContract); | |||||
| void deletePreviewBill(WxBillRent wxBillRent); | |||||
| void updateForReceiverPay(WxBillRent record); | void updateForReceiverPay(WxBillRent record); | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillDaily; | import com.iformall.domain.po.WxBillDaily; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillDailyVo; | import com.iformall.domain.vo.WxBillDailyVo; | ||||
| @@ -81,5 +82,6 @@ public interface WxBillDailyService { | |||||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | public void updatePay(WxBillPayDTO dto, MallUserInfo user); | ||||
| public void updatePayByMerchant(WxBillPayDTO dto, WxMerchantBUser user,boolean isOnline); | public void updatePayByMerchant(WxBillPayDTO dto, WxMerchantBUser user,boolean isOnline); | ||||
| public void bad(WxBillPayDTO dto,MallUserInfo user); | public void bad(WxBillPayDTO dto,MallUserInfo user); | ||||
| public void stopMerchantBills(WxMerchant wxMerchant,MallUserInfo userInfo); | |||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillOtherDeposit; | import com.iformall.domain.po.WxBillOtherDeposit; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | import com.iformall.domain.vo.WxBillHotNotify; | ||||
| @@ -81,4 +82,5 @@ public interface WxBillOtherDepositService { | |||||
| public void updatePayByMerchant(WxBillPayDTO dto, WxMerchantBUser user,boolean isOnline); | public void updatePayByMerchant(WxBillPayDTO dto, WxMerchantBUser user,boolean isOnline); | ||||
| public void returnDeposit(WxBillPayDTO dto, MallUserInfo user); | public void returnDeposit(WxBillPayDTO dto, MallUserInfo user); | ||||
| public void bad(WxBillPayDTO dto,MallUserInfo user); | public void bad(WxBillPayDTO dto,MallUserInfo user); | ||||
| public void stopMerchantBills(WxMerchant wxMerchant,MallUserInfo userInfo); | |||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillOther; | import com.iformall.domain.po.WxBillOther; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | import com.iformall.domain.vo.WxBillHotNotify; | ||||
| @@ -76,5 +77,6 @@ public interface WxBillOtherService { | |||||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | public void updatePay(WxBillPayDTO dto, MallUserInfo user); | ||||
| public void updatePayByMerchant(WxBillPayDTO dto, WxMerchantBUser user ,boolean isOnline); | public void updatePayByMerchant(WxBillPayDTO dto, WxMerchantBUser user ,boolean isOnline); | ||||
| public void bad(WxBillPayDTO dto,MallUserInfo user); | public void bad(WxBillPayDTO dto,MallUserInfo user); | ||||
| public void stopMerchantBills(WxMerchant wxMerchant,MallUserInfo userInfo); | |||||
| } | } | ||||
| @@ -125,7 +125,7 @@ public interface WxMerchantService { | |||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| void disable(Long id); | |||||
| void disable(Long id,MallUserInfo userInfo); | |||||
| ResultData addMerchant(WxMerchant wxMerchant, Long userId); | ResultData addMerchant(WxMerchant wxMerchant, Long userId); | ||||
| @@ -1114,8 +1114,10 @@ public class WxBillAllHelper { | |||||
| } | } | ||||
| //终止商户除了租赁账单以外的 | //终止商户除了租赁账单以外的 | ||||
| public void stopMerchantOtherBills(WxMerchant wxMerchant) { | |||||
| public void stopMerchantOtherBills(WxMerchant wxMerchant,MallUserInfo user) { | |||||
| wxBillDailyService.stopMerchantBills(wxMerchant, user); | |||||
| wxBillOtherService.stopMerchantBills(wxMerchant, user); | |||||
| wxBillOtherDepositService.stopMerchantBills(wxMerchant, user); | |||||
| } | } | ||||
| } | } | ||||
| @@ -28,6 +28,7 @@ import com.iformall.service.WxBillActionService; | |||||
| import com.iformall.service.WxBillDailyService; | import com.iformall.service.WxBillDailyService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxPayAccountBillService; | import com.iformall.service.WxPayAccountBillService; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| @@ -75,6 +76,10 @@ public class WxBillDailyServiceImpl extends WxBillBaseService implements WxBillD | |||||
| @Lazy | @Lazy | ||||
| @Autowired | @Autowired | ||||
| WxMerchantService wxMerchantService; | WxMerchantService wxMerchantService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxBillAllHelper wxBillAllHelper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillDaily> listAsPage(WxBillDaily record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillDaily> listAsPage(WxBillDaily record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -613,4 +618,36 @@ public class WxBillDailyServiceImpl extends WxBillBaseService implements WxBillD | |||||
| badMoney, badMoney,null,null,dto.getRemark(), user); | badMoney, badMoney,null,null,dto.getRemark(), user); | ||||
| } | } | ||||
| @Override | |||||
| public void stopMerchantBills(WxMerchant wxMerchant, MallUserInfo userInfo) { | |||||
| WxBillDaily wxBillRent = new WxBillDaily(); | |||||
| wxBillRent.setMerchantId(wxMerchant.getId()); | |||||
| wxBillRent.updateTenantInfo(wxMerchant); | |||||
| List<WxBillDaily> brList = wxBillDailyMapper.findList(wxBillRent); | |||||
| List<WxBillDaily> realRentList = new ArrayList<WxBillDaily>(); | |||||
| List<WxBillAction> actionList = new ArrayList<WxBillAction>(); | |||||
| Date current = DateUtils.getDayEnd(new Date()); | |||||
| if (null != brList && brList.size() > 0 ) { | |||||
| for (int i = 0 ; i < brList.size() ; i ++ ) { | |||||
| WxBillDaily brent = brList.get(i); | |||||
| WxBillAction action = new WxBillAction(); | |||||
| boolean isUpdate = wxBillAllHelper.billEndCalcute(2,current, brent, action, false); | |||||
| if (isUpdate) { | |||||
| realRentList.add(brent); | |||||
| actionList.add(action); | |||||
| } | |||||
| } | |||||
| } | |||||
| for (int i = 0 ; i < realRentList.size() ; i ++) { | |||||
| WxBillDaily rbrent = realRentList.get(i); | |||||
| wxBillDailyMapper.updateById(rbrent); | |||||
| } | |||||
| for (int i = 0 ; i < actionList.size() ; i ++) { | |||||
| WxBillAction ba = actionList.get(i); | |||||
| this.addBillAction(ba, userInfo); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -30,6 +30,7 @@ import com.iformall.enums.EnumBillStatus; | |||||
| import com.iformall.enums.EnumDelStatus; | import com.iformall.enums.EnumDelStatus; | ||||
| import com.iformall.enums.EnumRentContractType; | import com.iformall.enums.EnumRentContractType; | ||||
| import com.iformall.enums.EnumRentShopType; | import com.iformall.enums.EnumRentShopType; | ||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillDepositMapper; | import com.iformall.mapper.WxBillDepositMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| @@ -32,6 +32,7 @@ import com.iformall.service.WxBillActionService; | |||||
| import com.iformall.service.WxBillOtherDepositService; | import com.iformall.service.WxBillOtherDepositService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxPayAccountBillService; | import com.iformall.service.WxPayAccountBillService; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| @@ -80,6 +81,10 @@ public class WxBillOtherDepositServiceImpl extends WxBillBaseService implements | |||||
| @Lazy | @Lazy | ||||
| @Autowired | @Autowired | ||||
| WxMerchantService wxMerchantService; | WxMerchantService wxMerchantService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxBillAllHelper wxBillAllHelper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillOtherDeposit> listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillOtherDeposit> listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -570,5 +575,37 @@ public class WxBillOtherDepositServiceImpl extends WxBillBaseService implements | |||||
| this.addBillAction(EnumBillAction.BAD, dto.getBillTypeValue(),dto.getId(), | this.addBillAction(EnumBillAction.BAD, dto.getBillTypeValue(),dto.getId(), | ||||
| badMoney, badMoney,null,null,dto.getRemark(), user); | badMoney, badMoney,null,null,dto.getRemark(), user); | ||||
| } | } | ||||
| @Override | |||||
| public void stopMerchantBills(WxMerchant wxMerchant, MallUserInfo userInfo) { | |||||
| WxBillOtherDeposit wxBillRent = new WxBillOtherDeposit(); | |||||
| wxBillRent.setMerchantId(wxMerchant.getId()); | |||||
| wxBillRent.updateTenantInfo(wxMerchant); | |||||
| List<WxBillOtherDeposit> brList = wxBillOtherDepositMapper.findList(wxBillRent); | |||||
| List<WxBillOtherDeposit> realRentList = new ArrayList<WxBillOtherDeposit>(); | |||||
| List<WxBillAction> actionList = new ArrayList<WxBillAction>(); | |||||
| Date current = DateUtils.getDayEnd(new Date()); | |||||
| if (null != brList && brList.size() > 0 ) { | |||||
| for (int i = 0 ; i < brList.size() ; i ++ ) { | |||||
| WxBillOtherDeposit brent = brList.get(i); | |||||
| WxBillAction action = new WxBillAction(); | |||||
| boolean isUpdate = wxBillAllHelper.billEndCalcute(2,current, brent, action, true); | |||||
| if (isUpdate) { | |||||
| realRentList.add(brent); | |||||
| actionList.add(action); | |||||
| } | |||||
| } | |||||
| } | |||||
| for (int i = 0 ; i < realRentList.size() ; i ++) { | |||||
| WxBillOtherDeposit rbrent = realRentList.get(i); | |||||
| wxBillOtherDepositMapper.updateById(rbrent); | |||||
| } | |||||
| for (int i = 0 ; i < actionList.size() ; i ++) { | |||||
| WxBillAction ba = actionList.get(i); | |||||
| this.addBillAction(ba, userInfo); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -31,6 +31,7 @@ import com.iformall.service.WxBillActionService; | |||||
| import com.iformall.service.WxBillOtherService; | import com.iformall.service.WxBillOtherService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxPayAccountBillService; | import com.iformall.service.WxPayAccountBillService; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| @@ -79,6 +80,10 @@ public class WxBillOtherServiceImpl extends WxBillBaseService implements WxBillO | |||||
| @Lazy | @Lazy | ||||
| @Autowired | @Autowired | ||||
| WxMerchantService wxMerchantService; | WxMerchantService wxMerchantService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxBillAllHelper wxBillAllHelper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillOther> listAsPage(WxBillOther record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillOther> listAsPage(WxBillOther record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -496,4 +501,36 @@ public class WxBillOtherServiceImpl extends WxBillBaseService implements WxBillO | |||||
| this.addBillAction(EnumBillAction.BAD, dto.getBillTypeValue(),dto.getId(), | this.addBillAction(EnumBillAction.BAD, dto.getBillTypeValue(),dto.getId(), | ||||
| badMoney, badMoney,null,null,dto.getRemark(), user); | badMoney, badMoney,null,null,dto.getRemark(), user); | ||||
| } | } | ||||
| @Override | |||||
| public void stopMerchantBills(WxMerchant wxMerchant, MallUserInfo userInfo) { | |||||
| WxBillOther wxBillRent = new WxBillOther(); | |||||
| wxBillRent.setMerchantId(wxMerchant.getId()); | |||||
| wxBillRent.updateTenantInfo(wxMerchant); | |||||
| List<WxBillOther> brList = wxBillOtherMapper.findList(wxBillRent); | |||||
| List<WxBillOther> realRentList = new ArrayList<WxBillOther>(); | |||||
| List<WxBillAction> actionList = new ArrayList<WxBillAction>(); | |||||
| Date current = DateUtils.getDayEnd(new Date()); | |||||
| if (null != brList && brList.size() > 0 ) { | |||||
| for (int i = 0 ; i < brList.size() ; i ++ ) { | |||||
| WxBillOther brent = brList.get(i); | |||||
| WxBillAction action = new WxBillAction(); | |||||
| boolean isUpdate = wxBillAllHelper.billEndCalcute(2,current, brent, action, false); | |||||
| if (isUpdate) { | |||||
| realRentList.add(brent); | |||||
| actionList.add(action); | |||||
| } | |||||
| } | |||||
| } | |||||
| for (int i = 0 ; i < realRentList.size() ; i ++) { | |||||
| WxBillOther rbrent = realRentList.get(i); | |||||
| wxBillOtherMapper.updateById(rbrent); | |||||
| } | |||||
| for (int i = 0 ; i < actionList.size() ; i ++) { | |||||
| WxBillAction ba = actionList.get(i); | |||||
| this.addBillAction(ba, userInfo); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -645,8 +645,15 @@ public class WxBillPropertyServiceImpl extends WxBillBaseService implements WxBi | |||||
| @Override | @Override | ||||
| public void propertyContractStop(WxPropertyContract propertyContract, MallUserInfo user) { | public void propertyContractStop(WxPropertyContract propertyContract, MallUserInfo user) { | ||||
| WxBillProperty brDel = new WxBillProperty(); | |||||
| brDel.setPropertyContractId(propertyContract.getId()); | |||||
| brDel.setIsPreview(EnumYesOrNo.YES.getCode()); | |||||
| brDel.updateTenantInfo(propertyContract); | |||||
| wxBillPropertyMapper.deletePreviewBill(brDel); | |||||
| WxBillProperty br = new WxBillProperty(); | WxBillProperty br = new WxBillProperty(); | ||||
| br.setPropertyContractId(propertyContract.getId()); | br.setPropertyContractId(propertyContract.getId()); | ||||
| br.setIsPreview(EnumYesOrNo.NO.getCode()); | |||||
| br.updateTenantInfo(propertyContract); | br.updateTenantInfo(propertyContract); | ||||
| List<WxBillProperty> brList = wxBillPropertyMapper.findList(br); | List<WxBillProperty> brList = wxBillPropertyMapper.findList(br); | ||||
| List<WxBillProperty> realRentList = new ArrayList<WxBillProperty>(); | List<WxBillProperty> realRentList = new ArrayList<WxBillProperty>(); | ||||
| @@ -575,6 +575,13 @@ public class WxBillRentManageServiceImpl extends WxBillBaseService implements W | |||||
| @Override | @Override | ||||
| public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | ||||
| //删掉草稿状态的账单 | |||||
| WxBillRentManage brDel = new WxBillRentManage(); | |||||
| brDel.setRentContractId(rentContract.getId()); | |||||
| brDel.updateTenantInfo(rentContract); | |||||
| brDel.setIsPreview(EnumIsPreview.YES.getCode()); | |||||
| wxBillRentManageMapper.deletePreviewBill(brDel); | |||||
| WxBillRentManage br = new WxBillRentManage(); | WxBillRentManage br = new WxBillRentManage(); | ||||
| br.setRentContractId(rentContract.getId()); | br.setRentContractId(rentContract.getId()); | ||||
| br.updateTenantInfo(rentContract); | br.updateTenantInfo(rentContract); | ||||
| @@ -739,6 +739,13 @@ public class WxBillRentServiceImpl extends WxBillBaseService implements WxBillRe | |||||
| @Override | @Override | ||||
| public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | ||||
| //删除草稿状态的账单 | |||||
| WxBillRent brDel = new WxBillRent(); | |||||
| brDel.setRentContractId(rentContract.getId()); | |||||
| brDel.updateTenantInfo(rentContract); | |||||
| brDel.setIsPreview(EnumYesOrNo.YES.getCode()); | |||||
| wxBillRentMapper.deletePreviewBill(brDel); | |||||
| WxBillRent br = new WxBillRent(); | WxBillRent br = new WxBillRent(); | ||||
| br.setRentContractId(rentContract.getId()); | br.setRentContractId(rentContract.getId()); | ||||
| br.updateTenantInfo(rentContract); | br.updateTenantInfo(rentContract); | ||||
| @@ -19,6 +19,7 @@ import com.iformall.enums.*; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | |||||
| import com.iformall.service.util.CouponCacheUtils; | import com.iformall.service.util.CouponCacheUtils; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| @@ -164,6 +165,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantBUserService wxMerchantBUserService; | private WxMerchantBUserService wxMerchantBUserService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxBillAllHelper wxBillAllHelper; | |||||
| @Autowired | @Autowired | ||||
| @Qualifier("objectCommonRedisTemplate") | @Qualifier("objectCommonRedisTemplate") | ||||
| RedisTemplate<String, Object> redisTemplate; | RedisTemplate<String, Object> redisTemplate; | ||||
| @@ -459,7 +464,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Override | @Override | ||||
| @Transactional(rollbackFor = {Exception.class}) | @Transactional(rollbackFor = {Exception.class}) | ||||
| public void disable(Long id) { | |||||
| public void disable(Long id,MallUserInfo userInfo) { | |||||
| WxMerchant wxMerchant = wxMerchantMapper.selectById(id); | WxMerchant wxMerchant = wxMerchantMapper.selectById(id); | ||||
| if (wxMerchant == null) { | if (wxMerchant == null) { | ||||
| logger.info("未发现要停用的商户"); | logger.info("未发现要停用的商户"); | ||||
| @@ -531,6 +536,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxCouponService.disable(wxMerchant,cid, null); | wxCouponService.disable(wxMerchant,cid, null); | ||||
| CouponCacheUtils.removeCouponMerchantCache(redisTemplate, cid,null); | CouponCacheUtils.removeCouponMerchantCache(redisTemplate, cid,null); | ||||
| }); | }); | ||||
| //处理商户非租赁账单 | |||||
| wxBillAllHelper.stopMerchantOtherBills(wxMerchant, userInfo); | |||||
| } | } | ||||
| } | } | ||||
| @@ -254,7 +254,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| if(CollectionUtils.isEmpty(record.getPreviewBillRentList())){ | if(CollectionUtils.isEmpty(record.getPreviewBillRentList())){ | ||||
| return; | return; | ||||
| } | } | ||||
| wxBillPropertyMapper.deletePreviewBill(record); | |||||
| wxBillPropertyMapper.deleteBillByContract(record); | |||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| int count = 1; | int count = 1; | ||||
| @@ -389,7 +389,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | ||||
| } | } | ||||
| //生成预览账单 | //生成预览账单 | ||||
| wxBillPropertyMapper.deletePreviewBill(record); | |||||
| wxBillPropertyMapper.deleteBillByContract(record); | |||||
| //重新生成 | //重新生成 | ||||
| List<WxBillProperty> billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode(),true); | List<WxBillProperty> billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode(),true); | ||||
| record.setPreviewBillRentList(billList); | record.setPreviewBillRentList(billList); | ||||
| @@ -409,7 +409,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null | if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null | ||||
| && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals("0")) { | && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals("0")) { | ||||
| //删除预账单,重新生成 | //删除预账单,重新生成 | ||||
| wxBillPropertyMapper.deletePreviewBill(record); | |||||
| wxBillPropertyMapper.deleteBillByContract(record); | |||||
| //重新生成 | //重新生成 | ||||
| billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode(),true); | billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode(),true); | ||||
| record.setPreviewBillRentList(billList); | record.setPreviewBillRentList(billList); | ||||
| @@ -597,7 +597,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if (record.getReceivePeriod() != null && record.getLease() != null | if (record.getReceivePeriod() != null && record.getLease() != null | ||||
| && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0)) { | && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0)) { | ||||
| //删除预账单,重新生成 | //删除预账单,重新生成 | ||||
| wxBillRentMapper.deletePreviewBill(record); | |||||
| wxBillRentMapper.deleteBillByContract(record); | |||||
| //删除商业管理费账单 | //删除商业管理费账单 | ||||
| WxBillRentManage wxBillRentManage = new WxBillRentManage(); | WxBillRentManage wxBillRentManage = new WxBillRentManage(); | ||||
| wxBillRentManage.setRentContractId(record.getId()); | wxBillRentManage.setRentContractId(record.getId()); | ||||
| @@ -666,7 +666,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if (null == record.getDecimalSize()) { | if (null == record.getDecimalSize()) { | ||||
| record.setDecimalSize(Constant.default_short_decimal_size); | record.setDecimalSize(Constant.default_short_decimal_size); | ||||
| } | } | ||||
| wxBillRentMapper.deletePreviewBill(record); | |||||
| wxBillRentMapper.deleteBillByContract(record); | |||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| int count = 1; | int count = 1; | ||||
| @@ -326,9 +326,14 @@ | |||||
| and status != 3 | and status != 3 | ||||
| </update> | </update> | ||||
| <delete id="deletePreviewBill" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||||
| <delete id="deleteBillByContract" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||||
| delete from wx_bill_property where property_contract_id = #{id} | delete from wx_bill_property where property_contract_id = #{id} | ||||
| </delete> | </delete> | ||||
| <delete id="deletePreviewBill" parameterType="com.iformall.domain.po.WxBillProperty"> | |||||
| delete from wx_bill_property where property_contract_id = #{propertyContractId} | |||||
| <if test=" null != isPreview "> and is_preview = #{isPreview}</if> | |||||
| </delete> | |||||
| <update id="updateForReceivePay" parameterType="com.iformall.domain.po.WxBillProperty"> | <update id="updateForReceivePay" parameterType="com.iformall.domain.po.WxBillProperty"> | ||||
| update wx_bill_property set updatetime = now() | update wx_bill_property set updatetime = now() | ||||
| @@ -275,6 +275,7 @@ | |||||
| <delete id="deletePreviewBill" parameterType="com.iformall.domain.po.WxBillRentManage"> | <delete id="deletePreviewBill" parameterType="com.iformall.domain.po.WxBillRentManage"> | ||||
| delete from wx_bill_rent_manage where rent_contract_id = #{rentContractId} and manage_fee_type = #{manageFeeType} | delete from wx_bill_rent_manage where rent_contract_id = #{rentContractId} and manage_fee_type = #{manageFeeType} | ||||
| <if test=" null != isPreview ">and `is_preview` = #{isPreview}</if> | |||||
| </delete> | </delete> | ||||
| <select id="oweBillCount" parameterType="java.lang.Long" resultType="java.lang.Long"> | <select id="oweBillCount" parameterType="java.lang.Long" resultType="java.lang.Long"> | ||||
| @@ -327,9 +327,14 @@ | |||||
| and status != 3 | and status != 3 | ||||
| </update> | </update> | ||||
| <delete id="deletePreviewBill" parameterType="com.iformall.domain.po.WxRentContract"> | |||||
| <delete id="deleteBillByContract" parameterType="com.iformall.domain.po.WxRentContract"> | |||||
| delete from wx_bill_rent where rent_contract_id = #{id} | delete from wx_bill_rent where rent_contract_id = #{id} | ||||
| </delete> | </delete> | ||||
| <delete id="deletePreviewBill" parameterType="com.iformall.domain.po.WxBillRent"> | |||||
| delete from wx_bill_rent where rent_contract_id = #{rentContractId} | |||||
| <if test=" null != isPreview "> and is_preview = #{isPreview}</if> | |||||
| </delete> | |||||
| <update id="updateForReceiverPay" parameterType="com.iformall.domain.po.WxBillRent"> | <update id="updateForReceiverPay" parameterType="com.iformall.domain.po.WxBillRent"> | ||||
| update wx_bill_rent set updatetime = now() | update wx_bill_rent set updatetime = now() | ||||
| @@ -153,7 +153,7 @@ public class WxMerchantController extends BaseController { | |||||
| @SystemControllerLog(description = "商户-停用") | @SystemControllerLog(description = "商户-停用") | ||||
| public ResultData disable(Long id) { | public ResultData disable(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::disable"); | logger.debug("[" + getIpAddr() + "] WxMerchantController::disable"); | ||||
| wxMerchantService.disable(id); | |||||
| wxMerchantService.disable(id,this.getUser()); | |||||
| return new ResultData(Result.SUCCESS, "停用成功"); | return new ResultData(Result.SUCCESS, "停用成功"); | ||||
| } | } | ||||