|
|
|
@@ -4,16 +4,19 @@ import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.common.IdWorker; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.MallUserInfo; |
|
|
|
import com.iformall.domain.po.WxBillSettle; |
|
|
|
import com.iformall.mapper.WxBillSettleMapper; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumBillRentStatus; |
|
|
|
import com.iformall.enums.EnumBillType; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxBillSettleService; |
|
|
|
import com.iformall.service.WxFlowService; |
|
|
|
import org.checkerframework.checker.units.qual.A; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author luozukai |
|
|
|
@@ -25,6 +28,22 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
private WxBillSettleMapper wxBillSettleMapper; |
|
|
|
@Autowired |
|
|
|
private WxFlowService wxFlowService; |
|
|
|
@Autowired |
|
|
|
private WxBillSettleBillMapper wxBillSettleBillMapper; |
|
|
|
@Autowired |
|
|
|
private WxBillRentMapper wxBillRentMapper; |
|
|
|
@Autowired |
|
|
|
private WxBillDepositMapper wxBillDepositMapper; |
|
|
|
@Autowired |
|
|
|
private WxBillPropertyMapper wxBillPropertyMapper; |
|
|
|
@Autowired |
|
|
|
private WxBillDailyMapper wxBillDailyMapper; |
|
|
|
@Autowired |
|
|
|
private WxBillOtherMapper wxBillOtherMapper; |
|
|
|
@Autowired |
|
|
|
private WxBillPropertyDepositMapper wxBillPropertyDepositMapper; |
|
|
|
@Autowired |
|
|
|
private WxBillOtherDepositMapper wxBillOtherDepositMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { |
|
|
|
@@ -36,16 +55,73 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
return wxBillSettleMapper.selectByPrimaryKey(id); |
|
|
|
} |
|
|
|
|
|
|
|
public void updateFreeze(List<WxBillSettleBill> billList){ |
|
|
|
for (WxBillSettleBill bill:billList) { |
|
|
|
if(EnumBillType.RENT.getCode().equals(bill.getBillType())) { |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setId(bill.getBillId()); |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.FREEZE.getCode()); |
|
|
|
wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
}else if(EnumBillType.DEPOSIT.getCode().equals(bill.getBillType())) { |
|
|
|
WxBillDeposit wxBillRent = new WxBillDeposit(); |
|
|
|
wxBillRent.setId(bill.getBillId()); |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.FREEZE.getCode()); |
|
|
|
wxBillDepositMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
}else if(EnumBillType.PROPERTY.getCode().equals(bill.getBillType())) { |
|
|
|
WxBillProperty wxBillRent = new WxBillProperty(); |
|
|
|
wxBillRent.setId(bill.getBillId()); |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.FREEZE.getCode()); |
|
|
|
wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
|
|
|
|
WxBillPropertyDeposit propertyDeposit = new WxBillPropertyDeposit(); |
|
|
|
propertyDeposit.setId(bill.getBillId()); |
|
|
|
propertyDeposit.setStatus(EnumBillRentStatus.FREEZE.getCode()); |
|
|
|
wxBillPropertyDepositMapper.updateByPrimaryKeySelective(propertyDeposit); |
|
|
|
}else if(EnumBillType.ROUTINE.getCode().equals(bill.getBillType())) { |
|
|
|
WxBillOther wxBillRent = new WxBillOther(); |
|
|
|
wxBillRent.setId(bill.getBillId()); |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.FREEZE.getCode()); |
|
|
|
wxBillOtherMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
}else if(EnumBillType.OTHER_DEPOSIT.getCode().equals(bill.getBillType())) { |
|
|
|
WxBillOtherDeposit wxBillRent = new WxBillOtherDeposit(); |
|
|
|
wxBillRent.setId(bill.getBillId()); |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.FREEZE.getCode()); |
|
|
|
wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
}else{ |
|
|
|
WxBillDaily wxBillRent = new WxBillDaily(); |
|
|
|
wxBillRent.setId(bill.getBillId()); |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.FREEZE.getCode()); |
|
|
|
wxBillDailyMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public ResultData saveOrUpdate(WxBillSettle record, MallUserInfo userInfo) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
if (record.getId() == null) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
wxBillSettleMapper.insertSelective(record); |
|
|
|
} else { |
|
|
|
}else{ |
|
|
|
wxBillSettleMapper.updateByPrimaryKeySelective(record); |
|
|
|
} |
|
|
|
|
|
|
|
wxBillSettleBillMapper.delBySettleId(record); |
|
|
|
//保存中间表 |
|
|
|
for (WxBillSettleBill bill:record.getReceiveBillIds()) { |
|
|
|
bill.setId(idWorker.nextId()); |
|
|
|
bill.setSettleId(record.getId()); |
|
|
|
bill.setTenantId(record.getTenantId()); |
|
|
|
wxBillSettleBillMapper.insertSelective(bill); |
|
|
|
} |
|
|
|
|
|
|
|
//改为冻结状态 |
|
|
|
if (record.getFlowParams() != null && record.getFlowParams().size() > 0) { |
|
|
|
updateFreeze(record.getReceiveBillIds()); |
|
|
|
updateFreeze(record.getPayBillIds()); |
|
|
|
} |
|
|
|
|
|
|
|
//启动审批流 |
|
|
|
record.getFlowParams().put("businessId",record.getId()); |
|
|
|
if (record.getFlowParams() != null && record.getFlowParams().size() > 0) { |
|
|
|
|