| @@ -16,7 +16,6 @@ import com.iformall.domain.po.WxShopUsers; | |||
| import com.iformall.domain.po.WxUserDataRule; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity.SortField; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumCUserBaseInfoSex; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumShopSellStatus; | |||
| @@ -54,12 +54,8 @@ public class WxAgileContractController extends WxContractBaseController { | |||
| @Autowired | |||
| private WxRentContractMapper wxRentContractMapper; | |||
| @Autowired | |||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @Autowired | |||
| WxPropertyContractService wxPropertyContractService; | |||
| @Autowired | |||
| WxMallBuildingService buildingService; | |||
| @Autowired | |||
| WxMallFloorService floorService; | |||
| @@ -77,7 +73,7 @@ public class WxAgileContractController extends WxContractBaseController { | |||
| wxRentContract = new WxRentContract(); | |||
| } | |||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| wxRentContract.setAgileType(EnumRentAgileType.AGILE.getCode()); | |||
| //wxRentContract.setAgileType(EnumRentAgileType.AGILE.getCode()); | |||
| wxRentContract.setSortColumns(" updatetime desc"); | |||
| //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | |||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||
| @@ -142,18 +138,18 @@ public class WxAgileContractController extends WxContractBaseController { | |||
| public ResultData saveOrUpdate(@RequestBody WxRentContract wxRentContract) { | |||
| MallUserInfo user = getUser(); | |||
| wxRentContract.updateTenantInfo(user); | |||
| wxRentContract.setAgileType(EnumRentAgileType.AGILE.getCode()); | |||
| //wxRentContract.setAgileType(EnumRentAgileType.AGILE.getCode()); | |||
| if (null == wxRentContract.getDayPriceCalcute()) { | |||
| return new ResultData(Result.ERROR,"请选择日均单价计费规则"); | |||
| } | |||
| //以前合同必填的数据初始化 | |||
| wxRentContract.setDecimalSize(2); | |||
| wxRentContract.setReceivePeriodUnit(EnumContractReceivePeriodUnit.MONTH.getCode()); | |||
| wxRentContract.setRevenueRatio(EnumYesOrNo.NO.getCode()); | |||
| wxRentContract.setRevenueFixedRentPrice(EnumYesOrNo.NO.getCode()); | |||
| wxRentContract.setOutDateNotifyDays(0); | |||
| //wxRentContract.setRevenueRatio(EnumYesOrNo.NO.getCode()); | |||
| //wxRentContract.setRevenueFixedRentPrice(EnumYesOrNo.NO.getCode()); | |||
| //wxRentContract.setOutDateNotifyDays(0); | |||
| wxRentContract.setPayPeriodRate(1); | |||
| wxRentContract.setOperationType(EnumContractOperationType.PART.getCode()); | |||
| //wxRentContract.setOperationType(EnumContractOperationType.PART.getCode()); | |||
| if (null == wxRentContract.getRentalStartDate()) { | |||
| return new ResultData(Result.ERROR,"请选择合同开始日期"); | |||
| } | |||
| @@ -224,17 +220,12 @@ public class WxAgileContractController extends WxContractBaseController { | |||
| */ | |||
| @GetMapping("depositFeesList") | |||
| public ResultData depositFeesList() { | |||
| WxEnergyFees dt = new WxEnergyFees(); | |||
| WxFinanceFees dt = new WxFinanceFees(); | |||
| dt.updateTenantInfo(getTenantInfo()); | |||
| dt.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| List<Integer> billTypeList = new ArrayList<Integer>(); | |||
| billTypeList.add(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| billTypeList.add(EnumBillAllType.PROPERTY.getCode()); | |||
| billTypeList.add(EnumBillAllType.PROPERTY_DEPOSIT.getCode()); | |||
| dt.setBillTypeList(billTypeList); | |||
| dt.setIsDespoit(EnumYesOrNo.YES.getCode()); | |||
| dt.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(dt, 1, 100,false); | |||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(dt, 1, 100,false); | |||
| if (null == page) { | |||
| return new ResultData(); | |||
| } | |||
| @@ -243,19 +234,13 @@ public class WxAgileContractController extends WxContractBaseController { | |||
| @GetMapping("unDepositFeesList") | |||
| public ResultData unDepositFeesList() { | |||
| WxEnergyFees dt = new WxEnergyFees(); | |||
| WxFinanceFees dt = new WxFinanceFees(); | |||
| dt.updateTenantInfo(getTenantInfo()); | |||
| dt.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| List<Integer> billTypeList = new ArrayList<Integer>(); | |||
| billTypeList.add(EnumBillAllType.RENT.getCode()); | |||
| billTypeList.add(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| billTypeList.add(EnumBillAllType.RENT_OPERATION_MANAGE.getCode()); | |||
| billTypeList.add(EnumBillAllType.PROPERTY.getCode()); | |||
| dt.setBillTypeList(billTypeList); | |||
| dt.setIsDespoit(EnumYesOrNo.NO.getCode()); | |||
| dt.setIsPublic(EnumYesOrNo.NO.getCode()); | |||
| //dt.setIsPublic(EnumYesOrNo.NO.getCode()); | |||
| dt.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(dt, 1, 100,false); | |||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(dt, 1, 100,false); | |||
| if (null == page) { | |||
| return new ResultData(); | |||
| } | |||
| @@ -5,7 +5,6 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxContractCustomers; | |||
| import com.iformall.domain.po.WxFlowModel; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| @@ -20,7 +19,6 @@ import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxAgileContractService; | |||
| import com.iformall.service.WxFlowService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentContractService; | |||
| import com.iformall.service.WxShopService; | |||
| @@ -53,10 +51,8 @@ public class WxContractBaseController extends BaseController{ | |||
| @Autowired | |||
| private WxRentContractService wxRentContractService; | |||
| @Autowired | |||
| private WxPropertyContractService wxPropertyContractService; | |||
| protected Map<String,Object> generateFlowParams(WxContractCustomers contractCustomers,EnumFlowKey flowType,EnumFlowContractType contractType,EnumRentAgileType agileType,String remark,Long contractId,Long wholeProperyId) { | |||
| protected Map<String,Object> generateFlowParams(WxContractCustomers contractCustomers,EnumFlowKey flowType,EnumFlowContractType contractType,String remark,Long contractId,Long wholeProperyId) { | |||
| Map<String,Object> map = new HashMap<String,Object>(); | |||
| map.put("businessType", flowType.getCode()); | |||
| map.put("remark", remark); | |||
| @@ -83,13 +79,6 @@ public class WxContractBaseController extends BaseController{ | |||
| } | |||
| variablesList.add(contractNumberMap); | |||
| if (null != agileType) { | |||
| Map agileTypeMap = new HashMap<String,Object>(); | |||
| agileTypeMap.put("key","agileType"); | |||
| agileTypeMap.put("value",String.valueOf(agileType.getCode())); | |||
| variablesList.add(agileTypeMap); | |||
| } | |||
| Map rentNameMap = new HashMap<String,Object>(); | |||
| rentNameMap.put("key","rentName"); | |||
| rentNameMap.put("value",contractCustomers.getName()); | |||
| @@ -114,12 +103,7 @@ public class WxContractBaseController extends BaseController{ | |||
| protected boolean rentContractHasWorkFlow(WxRentContract wxRentContract) { | |||
| WxFlowModel wxFlowModel = new WxFlowModel(); | |||
| if(wxRentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue() || | |||
| wxRentContract.getOperationType().intValue() == EnumContractOperationType.JINMAO.getCode().intValue()) { | |||
| wxFlowModel.setFlowType(EnumFlowKey.NEW_RENT_CONTRACT.getCode()); | |||
| }else { | |||
| wxFlowModel.setFlowType(EnumFlowKey.NNEW_RENT_CONTRACT.getCode()); | |||
| } | |||
| wxFlowModel.setFlowType(EnumFlowKey.NEW_RENT_CONTRACT.getCode()); | |||
| wxFlowModel.updateTenantInfo(wxRentContract); | |||
| List<WxFlowModel> flows = wxFlowService.getModelBybusiness(wxFlowModel); | |||
| if (null != flows && flows.size() > 0) { | |||
| @@ -128,21 +112,6 @@ public class WxContractBaseController extends BaseController{ | |||
| return false; | |||
| } | |||
| protected boolean propertyContractHasWorkFlow(WxPropertyContract wxPropertyContract) { | |||
| WxFlowModel wxFlowModel = new WxFlowModel(); | |||
| if(wxPropertyContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { | |||
| wxFlowModel.setFlowType(EnumFlowKey.NEW_PRO_CONTRACT.getCode()); | |||
| }else { | |||
| wxFlowModel.setFlowType(EnumFlowKey.NNEW_RENT_CONTRACT.getCode()); | |||
| } | |||
| wxFlowModel.updateTenantInfo(wxPropertyContract); | |||
| List<WxFlowModel> flows = wxFlowService.getModelBybusiness(wxFlowModel); | |||
| if (null != flows && flows.size() > 0) { | |||
| return true; | |||
| } | |||
| return false; | |||
| } | |||
| public static boolean dateHasIntersection(Date startDate1, Date endDate1, Date startDate2, Date endDate2) { | |||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |||
| if (startDate1.compareTo(endDate2) <= 0 && startDate2.compareTo(endDate1) <= 0) { | |||
| @@ -194,27 +163,17 @@ public class WxContractBaseController extends BaseController{ | |||
| statusList.add(EnumRentContractStatus.READY_FOR_PAING.getCode()); | |||
| statusList.add(EnumRentContractStatus.PERFORMANCE.getCode()); | |||
| statusList.add(EnumRentContractStatus.UNWRITE.getCode()); | |||
| if (isRent) { | |||
| WxRentContract rc = new WxRentContract(); | |||
| rc.updateTenantInfo(tenantEntity); | |||
| rc.setIds(contractIds); | |||
| rc.setStatuss(statusList); | |||
| /**满足下面条件的都算 | |||
| * 1. 合同开始日期<=当前合同开始日期 && 合同结束日期 > 当前合同开始日期 | |||
| * 2. 合同开始日期 >= 当前合同开始日期 && 合同开始日期 <= 当前结束日期 | |||
| */ | |||
| rc.setUseStartTime(contractStartDate); | |||
| rc.setUseEndTime(contractEndDate); | |||
| usedContractIds = wxRentContractService.findIdList(rc); | |||
| }else { | |||
| WxPropertyContract rc = new WxPropertyContract(); | |||
| rc.updateTenantInfo(tenantEntity); | |||
| rc.setIds(contractIds); | |||
| rc.setStatuss(statusList); | |||
| rc.setUseStartTime(contractStartDate); | |||
| rc.setUseEndTime(contractEndDate); | |||
| usedContractIds = wxPropertyContractService.findIdList(rc); | |||
| } | |||
| WxRentContract rc = new WxRentContract(); | |||
| rc.updateTenantInfo(tenantEntity); | |||
| rc.setIds(contractIds); | |||
| rc.setStatuss(statusList); | |||
| /**满足下面条件的都算 | |||
| * 1. 合同开始日期<=当前合同开始日期 && 合同结束日期 > 当前合同开始日期 | |||
| * 2. 合同开始日期 >= 当前合同开始日期 && 合同开始日期 <= 当前结束日期 | |||
| */ | |||
| rc.setUseStartTime(contractStartDate); | |||
| rc.setUseEndTime(contractEndDate); | |||
| usedContractIds = wxRentContractService.findIdList(rc); | |||
| if (null != usedContractIds && usedContractIds.size() > 0 ) { | |||
| BigDecimal usedArea = wxAgileContractService.sumShopContractAreas(tenantEntity, shopId,usedContractIds); | |||
| BigDecimal totalUsedArea = usedArea.add(contractShopArea); | |||
| @@ -260,18 +219,4 @@ public class WxContractBaseController extends BaseController{ | |||
| rentContract.getRentShopArea(),true); | |||
| } | |||
| protected void propertyContractValidShop(WxPropertyContract propertyContract) throws Exception { | |||
| //当前的不能<=0 | |||
| Map<Long, BigDecimal> rentAreaMap = propertyContract.getRentShopArea(); | |||
| for (Iterator<Long> it = rentAreaMap.keySet().iterator();it.hasNext();) { | |||
| Long shopId= it.next(); | |||
| BigDecimal ra = rentAreaMap.get(shopId); | |||
| if (ra.compareTo(new BigDecimal(0)) <= 0 ) { | |||
| throw new MallinkException(Result.ERROR, "房间面积不能为0。"); | |||
| } | |||
| } | |||
| contractValidShop(propertyContract,propertyContract.getId(),propertyContract.getRentalStartDate(),propertyContract.getRentalEndDate(),propertyContract.shopIdsByShop(), | |||
| propertyContract.getRentShopArea(),false); | |||
| } | |||
| } | |||
| @@ -1,612 +0,0 @@ | |||
| package com.iformall.controller.contract; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxPropertyContractUpdateDto; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxContractCustomers; | |||
| import com.iformall.domain.po.WxContractShop; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.WxUserDataRule; | |||
| import com.iformall.domain.po.base.BaseEntity.SortField; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxContractCustomersMapper; | |||
| import com.iformall.mapper.WxContractShopMapper; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.service.*; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.math.BigDecimal; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("wxPropertyContract") | |||
| public class WxPropertyContractController extends WxContractBaseController { | |||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxPropertyContractService wxPropertyContractService; | |||
| @Autowired | |||
| private WxAllBillService wxAllBillService; | |||
| @Autowired | |||
| private WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||
| @Autowired | |||
| WxMallBuildingService buildingService; | |||
| @Autowired | |||
| WxMallFloorService floorService; | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @Autowired | |||
| private WxRentContractService rentContractService; | |||
| @Autowired | |||
| private WxAgileContractService wxAgileContractService; | |||
| @GetMapping("/list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute WxPropertyContract wxPropertyContract, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::list"); | |||
| if (null == wxPropertyContract) { | |||
| wxPropertyContract = new WxPropertyContract(); | |||
| } | |||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||
| Map<String, Object> result = new HashMap<>(); | |||
| wxPropertyContract.setSortColumns("updatetime desc"); | |||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||
| if (null != dataRule) { | |||
| wxPropertyContract.setFloorForRule(dataRule.getFloorIds()); | |||
| wxPropertyContract.setBusinessForRule(dataRule.getBussinessIds()); | |||
| wxPropertyContract.setShopTypeForRule(dataRule.getShopTypes()); | |||
| } | |||
| PageInfo<WxPropertyContract> pageInfo = wxPropertyContractService.listAsPage(wxPropertyContract, pageNum, pageSize); | |||
| Integer hasFlow = null; | |||
| if (null != pageInfo && null != pageInfo.getList()) { | |||
| for (WxPropertyContract wpc : pageInfo.getList()) { | |||
| if (null == hasFlow) { | |||
| if(propertyContractHasWorkFlow(wpc)) { | |||
| hasFlow = 1; | |||
| }else { | |||
| hasFlow = 0; | |||
| } | |||
| } | |||
| wpc.setFlowHas(hasFlow); | |||
| } | |||
| } | |||
| result.put("pageInfo", pageInfo); | |||
| return new ResultData(result); | |||
| } | |||
| //第一步 | |||
| @PostMapping("addBasic") | |||
| public ResultData addBasic(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| MallUserInfo user = getUser(); | |||
| wxPropertyContract.updateTenantInfo(user); | |||
| if (null == wxPropertyContract.getCreateType()) { | |||
| return new ResultData("createType参数不能为空"); | |||
| } | |||
| if (wxPropertyContract.getCreateType().intValue() == EnumPropertyCreateType.BY_SHOP.getCode().intValue()) { | |||
| if (StringUtils.isBlank(wxPropertyContract.getRentInfo())) { | |||
| return new ResultData(Result.ERROR,"请选择店铺"); | |||
| } | |||
| if (null == wxPropertyContract.getRentalStartDate()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "起租开始时间不能为空"); | |||
| } | |||
| if (null == wxPropertyContract.getRentalEndDate()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "起租结束时间不能为空"); | |||
| } | |||
| if (null == wxPropertyContract.getStartDate()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "计租日不能为空"); | |||
| } | |||
| if (null == wxPropertyContract.getLease()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "lease不能为空"); | |||
| } | |||
| if (null == wxPropertyContract.getOperationType()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "operationType不能为空"); | |||
| } | |||
| if (null == wxPropertyContract.getAdjustPeriod()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "adjustPeriod不能为空"); | |||
| } | |||
| List<Long> shopIds = wxPropertyContract.shopIdsByShop(); | |||
| if (null == shopIds || shopIds.size() <= 0 ) { | |||
| return new ResultData(Result.ERROR,"请选择店铺"); | |||
| } | |||
| String shopIdStr = ""; | |||
| for (int i = 0; i < shopIds.size(); i++) { | |||
| Long shopId = shopIds.get(i); | |||
| shopIdStr = shopIdStr +","+ shopId; | |||
| } | |||
| wxPropertyContract.setShopIdStr(shopIdStr); | |||
| }else { | |||
| WxRentContract rentContract = rentContractService.getSimpleDeatil(wxPropertyContract.getRentContractId()); | |||
| if (null == rentContract) { | |||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | |||
| } | |||
| if (rentContract.getStatus().equals(EnumRentContractStatus.OUT_DATE.getCode()) || | |||
| rentContract.getStatus().equals(EnumRentContractStatus.TERMINATE.getCode()) || | |||
| rentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { | |||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_TERMINATED); | |||
| } | |||
| wxPropertyContract.setRentArea(rentContract.getRentArea()); | |||
| wxPropertyContract.setOperationType(rentContract.getOperationType()); | |||
| wxPropertyContract.setAdjustPeriod(rentContract.getAdjustPeriod()); | |||
| wxPropertyContract.setLease(rentContract.getLease()); | |||
| wxPropertyContract.setRentalStartDate(rentContract.getRentalStartDate()); | |||
| wxPropertyContract.setRentalEndDate(rentContract.getRentalEndDate()); | |||
| wxPropertyContract.setStartDate(rentContract.getStartDate()); | |||
| wxPropertyContract.setEndDate(rentContract.getEndDate()); | |||
| wxPropertyContract.setSignDate(rentContract.getSignDate()); | |||
| wxPropertyContract.setRentInfo(rentContract.getRentInfo()); | |||
| wxPropertyContract.setCustomersId(rentContract.getCustomersId()); | |||
| wxPropertyContract.setShopIdStr(rentContract.getShopIdStr()); | |||
| //如果是租金+物业的,则租金和物业一一对应。 | |||
| if (wxPropertyContract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()){ | |||
| WxPropertyContract pq = new WxPropertyContract(); | |||
| pq.updateTenantInfo(rentContract); | |||
| pq.setRentContractId(rentContract.getId()); | |||
| pq.setOperationType(EnumContractOperationType.WHOLE.getCode()); | |||
| List<WxPropertyContract> plist = wxPropertyContractService.findList(pq); | |||
| if (null != plist && plist.size() > 0 ) { | |||
| wxPropertyContract.setId(plist.get(0).getId()); | |||
| } | |||
| } | |||
| } | |||
| wxPropertyContract.setRentStartType(EnumRentStartType.RENTTIME.getCode()); | |||
| try { | |||
| propertyContractValidShop(wxPropertyContract); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return wxPropertyContractService.save(wxPropertyContract, user, user.getName(),false); | |||
| } | |||
| //第二步,设置价格, | |||
| @PostMapping("add") | |||
| public ResultData addMoney(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| if (null == wxPropertyContract.getId()) { | |||
| return new ResultData(Result.ERROR,"id不能为空"); | |||
| } | |||
| MallUserInfo user = getUser(); | |||
| wxPropertyContract.updateTenantInfo(user); | |||
| wxPropertyContract.setAdjustPeriodHandle(); | |||
| //第一步已经设置过了,无需再设置 | |||
| wxPropertyContract.setLinkPerson(null); | |||
| wxPropertyContract.setLinkPhone(null); | |||
| if (null != wxPropertyContract.getFeeStandards() && wxPropertyContract.getFeeStandards().size() > 0 ) { | |||
| wxPropertyContract.setFeesStandardsInfo(JSON.toJSONString(wxPropertyContract.getFeeStandards())); | |||
| } | |||
| if (null == wxPropertyContract.getDayPriceCalcute()){ | |||
| wxPropertyContract.setDayPriceCalcute(EnumRentDayPriceCalcute.REAL_DAYS.getCode()); | |||
| } | |||
| if (wxPropertyContract.getDayPriceCalcute().intValue() == EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode().intValue() && null == wxPropertyContract.getMonthAverageDays()) { | |||
| return new ResultData(Result.ERROR,"请填写月平均天数"); | |||
| } | |||
| return wxPropertyContractService.updateMoney(wxPropertyContract, user, user.getName(),false); | |||
| } | |||
| //物业合同-最后一步切换 按什么日期生成账单 | |||
| @PostMapping("updateRentStartTime") | |||
| public ResultData updateRentStartTime(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| WxPropertyContract propertyContract = wxPropertyContractMapper.selectById(wxPropertyContract.getId()); | |||
| MallUserInfo user = getUser(); | |||
| propertyContract.updateTenantInfo(user); | |||
| propertyContract.setAdjustPeriodHandle(); | |||
| if (propertyContract.getCreateType().intValue() == EnumPropertyCreateType.BY_SHOP.getCode().intValue()) { | |||
| propertyContract.calcutePrice(propertyContract.getRentArea()); | |||
| }else { | |||
| WxRentContract rentContract = rentContractService.getSimpleDeatil(propertyContract.getRentContractId()); | |||
| wxPropertyContract.calcutePrice(rentContract.getRentArea()); | |||
| } | |||
| propertyContract.setRentStartType(wxPropertyContract.getRentStartType()); | |||
| if (null != wxPropertyContract.getFeeStandards() && wxPropertyContract.getFeeStandards().size() > 0 ) { | |||
| wxPropertyContract.setFeesStandardsInfo(JSON.toJSONString(wxPropertyContract.getFeeStandards())); | |||
| } | |||
| return wxPropertyContractService.updateMoney(propertyContract, user, user.getName(),false); | |||
| } | |||
| //第三步提交 | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxPropertyContractUpdateDto dto) { | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| MallUserInfo user = getUser(); | |||
| wxPropertyContract.setId(dto.getId()); | |||
| wxPropertyContract.updateTenantInfo(user); | |||
| wxPropertyContract.setFileNames(dto.getFileNames()); | |||
| wxPropertyContract.setFlowParams(dto.getFlowParams()); | |||
| return wxPropertyContractService.updateFile(wxPropertyContract, user, user.getName(),true); | |||
| } | |||
| /** | |||
| * 计算价格 | |||
| */ | |||
| @PostMapping("calcutePrice") | |||
| public ResultData calcutePrice(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| if (null == wxPropertyContract.getCreateType()) { | |||
| return new ResultData("createType参数不能为空"); | |||
| } | |||
| if (wxPropertyContract.getCreateType().intValue() == EnumPropertyCreateType.BY_SHOP.getCode().intValue()) { | |||
| if (StringUtils.isBlank(wxPropertyContract.getRentArea())) { | |||
| return new ResultData("rentArea,shopIds参数不能为空"); | |||
| } | |||
| wxPropertyContract.calcutePrice(wxPropertyContract.getRentArea()); | |||
| }else { | |||
| WxRentContract rentContract = rentContractService.getSimpleDeatil(wxPropertyContract.getRentContractId()); | |||
| wxPropertyContract.calcutePrice(rentContract.getRentArea()); | |||
| } | |||
| return new ResultData(wxPropertyContract.getPrice()); | |||
| } | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::findById"); | |||
| // WxBillProperty wxBillProperty = new WxBillProperty(); | |||
| // wxBillProperty.updateTenantInfo(getTenantInfo()); | |||
| // wxBillPropertyService.updateBillStatus(wxBillProperty); | |||
| try { | |||
| Map<String, Object> data = wxPropertyContractService.getById(id); | |||
| return new ResultData(data); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| } | |||
| /** | |||
| * 作废 | |||
| * @param wxRentContract | |||
| * @return | |||
| */ | |||
| @PostMapping("/unvalid") | |||
| public ResultData unvalid(@RequestBody WxPropertyContract proertyContract) { | |||
| WxPropertyContract contract = wxPropertyContractService.getSimpleDetail(proertyContract.getId()); | |||
| if (null == contract) { | |||
| return new ResultData(Result.ERROR, "合同不存在."); | |||
| } | |||
| MallUserInfo user = this.getUser(); | |||
| if (contract.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue() || | |||
| contract.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() || | |||
| (contract.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue() | |||
| && (contract.getApplyStatus().intValue() == EnumRentContractAppStatus.REJECT.getCode().intValue() || | |||
| contract.getApplyStatus().intValue() == EnumRentContractAppStatus.SETBACK.getCode().intValue()))) { | |||
| contract.setStatus(EnumRentContractStatus.INVALID.getCode()); | |||
| contract.setUpdatetime(new Date()); | |||
| contract.setUpdateBy(user.getId()); | |||
| try { | |||
| wxPropertyContractService.updatePropertyContract(contract); | |||
| return new ResultData(contract); | |||
| }catch(Exception e) { | |||
| logger.error(" WxPropertyContract unvalid error.",e); | |||
| return new ResultData(Result.ERROR,"系统错误"); | |||
| } | |||
| }else { | |||
| return new ResultData(Result.ERROR, "合同状态不允许作废.只能作废草稿或者履约拒绝的合同。"); | |||
| } | |||
| } | |||
| /** | |||
| * 终止 | |||
| * @param id | |||
| * @param status | |||
| * @return | |||
| */ | |||
| @PostMapping("endContract") | |||
| @SystemControllerLog(description = "物业合同-终止合同") | |||
| public ResultData endContract(@RequestBody WxPropertyContract proertyContract) { | |||
| proertyContract.updateTenantInfo(getTenantInfo()); | |||
| wxPropertyContractService.endContract(proertyContract,this.getUser()); | |||
| return new ResultData(proertyContract); | |||
| } | |||
| /** | |||
| * 设置定时终止时间 | |||
| * @return | |||
| */ | |||
| @PostMapping("setEndContractTime") | |||
| public ResultData setEndContractTime(@RequestBody WxPropertyContract proertyContract) { | |||
| wxPropertyContractService.setEndContractTime(proertyContract); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("effective") | |||
| @ApiImplicitParams({}) | |||
| public ResultData effective(@RequestBody WxPropertyContract proertyContract) { | |||
| WxPropertyContract contract = wxPropertyContractService.getSimpleDetail(proertyContract.getId()); | |||
| if (null == contract) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"物业合同不存在"); | |||
| } | |||
| //查询是否有审批流程 | |||
| if(propertyContractHasWorkFlow(contract)) { | |||
| return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"物业合同存在工作流,不允许直接生效。"); | |||
| } | |||
| if (contract.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"租赁合同状态为草稿才能进行此操作"); | |||
| } | |||
| if (contract.getCreateType().intValue() == EnumPropertyCreateType.BY_SHOP.getCode().intValue()) { | |||
| // if (shopHasValidProperty(contract)) { | |||
| // return new ResultData(Result.ERROR, "店铺存在有效或者审批中的物业合同。"); | |||
| // } | |||
| }else { | |||
| if (rentHasValidProperty(contract)) { | |||
| return new ResultData(Result.ERROR, "租金合同["+contract.getContractNumber()+"]存在有效或者审批中的物业合同。"); | |||
| } | |||
| } | |||
| try { | |||
| propertyContractValidShop(contract); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxPropertyContractService.updatePropertyContractStatus(proertyContract.getId()); | |||
| return new ResultData(Result.SUCCESS,"合同生效成功!"); | |||
| } | |||
| // private boolean shopHasValidProperty(WxPropertyContract contract) { | |||
| // List<Long> shopIds = contract.shopIdsByShop(); | |||
| // if (null == shopIds || shopIds.size() <= 0 ) { | |||
| // return false; | |||
| // } | |||
| // List<Long> contractIdList = wxAgileContractService.findShopContractIds(contract, shopIds); | |||
| // if (null == contractIdList || contractIdList.size() <= 0 ) { | |||
| // return false; | |||
| // } | |||
| // | |||
| // WxPropertyContract wpc = new WxPropertyContract(); | |||
| // wpc.setIds(contractIdList); | |||
| // List<Integer> statuss = EnumRentContractStatus.getValidStatus(); | |||
| // statuss.add(EnumRentContractStatus.PERFORMANCE.getCode()); | |||
| // wpc.setStatuss(statuss); | |||
| // List<WxPropertyContract> list = wxPropertyContractService.findList(wpc); | |||
| // if (null != list && list.size() > 0 ) { | |||
| // return true; | |||
| // } | |||
| // return false; | |||
| // } | |||
| private boolean rentHasValidProperty(WxPropertyContract contract) { | |||
| WxPropertyContract wpc = new WxPropertyContract(); | |||
| wpc.setRentContractId(contract.getRentContractId()); | |||
| List<Integer> statuss = EnumRentContractStatus.getValidStatus(); | |||
| statuss.add(EnumRentContractStatus.PERFORMANCE.getCode()); | |||
| wpc.setStatuss(statuss); | |||
| List<WxPropertyContract> list = wxPropertyContractService.findList(wpc); | |||
| if (null != list && list.size() > 0 ) { | |||
| return true; | |||
| } | |||
| return false; | |||
| } | |||
| @PostMapping("apply") | |||
| public ResultData apply(@RequestBody WxPropertyContract proertyContract) { | |||
| MallUserInfo user = getUser(); | |||
| WxPropertyContract contract = wxPropertyContractService.getSimpleDetail(proertyContract.getId()); | |||
| if (null == contract) { | |||
| return new ResultData(Result.ERROR, "编号["+contract.getContractNumber()+"]未找到租金合同"); | |||
| } | |||
| //查询是否有审批流程 | |||
| if(!propertyContractHasWorkFlow(contract)) { | |||
| return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"物业合同不存在工作流,不能提交审批。"); | |||
| } | |||
| if (contract.getCreateType().intValue() == EnumPropertyCreateType.BY_SHOP.getCode().intValue()) { | |||
| // if (shopHasValidProperty(contract)) { | |||
| // return new ResultData(Result.ERROR, "店铺存在有效或者审批中的物业合同。"); | |||
| // } | |||
| }else { | |||
| if (rentHasValidProperty(contract)) { | |||
| return new ResultData(Result.ERROR, "租金合同["+contract.getContractNumber()+"]存在有效或者审批中的物业合同。"); | |||
| } | |||
| } | |||
| try { | |||
| propertyContractValidShop(contract); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| String remark = ""; | |||
| Map<String, Object> map = contract.getFlowParams(); | |||
| if (null != map) { | |||
| remark = (String) map.get("remark"); | |||
| } | |||
| WxContractCustomers customers = wxAgileContractService.findCustomers(contract, contract.getCustomersId()); | |||
| if(contract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { | |||
| contract.setFlowParams(generateFlowParams(customers,EnumFlowKey.NEW_PRO_CONTRACT, EnumFlowContractType.PROPERTY,null, remark, contract.getId(),null)); | |||
| }else { | |||
| contract.setFlowParams(generateFlowParams(customers,EnumFlowKey.NEW_PRO_CONTRACT, EnumFlowContractType.WHOLE_SHOP,null, remark, contract.getId(),null)); | |||
| } | |||
| return wxPropertyContractService.apply(contract,user); | |||
| } | |||
| @PostMapping("renewal") | |||
| public ResultData renewal(@RequestBody WxPropertyContract proertyContract) { | |||
| MallUserInfo user = getUser(); | |||
| if (null == proertyContract.getId()){ | |||
| return new ResultData(Result.ERROR, "合同ID不能为空"); | |||
| } | |||
| if (null == proertyContract.getRentalStartDate() || null == proertyContract.getRentalEndDate()){ | |||
| return new ResultData(Result.ERROR, "请选择租赁开始日期和截止日期"); | |||
| } | |||
| if (null == proertyContract.getStartDate()){ | |||
| return new ResultData(Result.ERROR, "请选择计租日期"); | |||
| } | |||
| if (null == proertyContract.getSignDate()){ | |||
| return new ResultData(Result.ERROR, "请选择签约日期"); | |||
| } | |||
| WxPropertyContract contract = wxPropertyContractService.getSimpleDetail(proertyContract.getId()); | |||
| if (null == contract) { | |||
| return new ResultData(Result.ERROR, "未找到物业合同"); | |||
| } | |||
| if (contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR, "不能操作租金+物业合同"); | |||
| } | |||
| if (!(contract.getRentalEndDate().before(proertyContract.getRentalStartDate()))) { | |||
| return new ResultData(Result.ERROR, "续租合同开始日期要大于原合同截止日期"); | |||
| } | |||
| if (contract.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"租金合同未完善,请先完善。"); | |||
| } | |||
| contract.setRentalStartDate(proertyContract.getRentalStartDate()); | |||
| contract.setRentalEndDate(proertyContract.getRentalEndDate()); | |||
| contract.setSignDate(proertyContract.getSignDate()); | |||
| contract.setStartDate(proertyContract.getStartDate()); | |||
| contract.setEndDate(proertyContract.getStartDate()); | |||
| try { | |||
| propertyContractValidShop(contract); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| try { | |||
| wxPropertyContractService.renewal(contract,user,false); | |||
| }catch(Exception e) { | |||
| logger.error("renewal error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return new ResultData(contract); | |||
| } | |||
| @PostMapping("transfer") | |||
| public ResultData transfer(@RequestBody WxPropertyContract proertyContract) { | |||
| MallUserInfo user = getUser(); | |||
| if (null == proertyContract.getId() || null == proertyContract.getCustomerType() || | |||
| StringUtils.isBlank(proertyContract.getCustomerName()) || StringUtils.isBlank(proertyContract.getCustomerPhone())){ | |||
| return new ResultData(Result.ERROR, "缺少参数"); | |||
| } | |||
| WxPropertyContract contract = wxPropertyContractService.getSimpleDetail(proertyContract.getId()); | |||
| if (null == contract) { | |||
| return new ResultData(Result.ERROR, "未找到物业合同"); | |||
| } | |||
| if (contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR, "不能操作租金+物业合同"); | |||
| } | |||
| try { | |||
| contract.setCustomersId(proertyContract.getCustomersId()); | |||
| contract.setCustomerType(proertyContract.getCustomerType()); | |||
| contract.setCustomerName(proertyContract.getCustomerName()); | |||
| contract.setCustomerLinkPerson(proertyContract.getCustomerLinkPerson()); | |||
| contract.setCustomerPhone(proertyContract.getCustomerPhone()); | |||
| contract.setCustomerLegalPerson(proertyContract.getCustomerLegalPerson()); | |||
| wxPropertyContractService.transfer(contract,user); | |||
| }catch(Exception e) { | |||
| logger.error("transfer error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return new ResultData(contract); | |||
| } | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData delete(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::delete"); | |||
| wxPropertyContractService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @RequestMapping("/download") | |||
| public void download(HttpServletRequest request, HttpServletResponse response) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::download"); | |||
| wxPropertyContractService.download(request, response); | |||
| } | |||
| // @GetMapping("/getPropertyContractStatusInfo") | |||
| // @SystemControllerLog(description = "物业合同-状态信息") | |||
| // public ResultData getPropertyContractStatusInfo(@ModelAttribute WxPropertyContract wxPropertyContract) { | |||
| // logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getPropertyContractStatusInfo"); | |||
| // wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||
| // return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractStatusInfo(wxPropertyContract)); | |||
| // } | |||
| // @GetMapping("/getRentContractList") | |||
| // @SystemControllerLog(description = "物业合同-查询列表") | |||
| // public ResultData getRentContractList(@ModelAttribute WxPropertyContract wxPropertyContract) { | |||
| // logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getRentContractList"); | |||
| // wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||
| // return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractList(wxPropertyContract)); | |||
| // } | |||
| // @GetMapping("/endPropertyContractByRentContractId") | |||
| // @ApiImplicitParam(name = "rentContractId", value = "rentContractId", dataType = "Long", paramType = "query", required = true) | |||
| // @SystemControllerLog(description = "物业合同-根据租赁合同终止") | |||
| // public ResultData endPropertyContractByRentContractId(Long rentContractId) { | |||
| // logger.debug("[" + getIpAddr() + "] WxPropertyContractController::endPropertyContractByRentContractId"); | |||
| // return wxPropertyContractService.endPropertyContractByRentContractId(rentContractId); | |||
| // } | |||
| @GetMapping("/hasRentContract") | |||
| @ApiImplicitParam(name = "rentContractId", value = "rentContractId", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData hasRentContract(Long rentContractId) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::hasRentContract"); | |||
| //return wxPropertyContractService.hasRentContract(rentContractId); | |||
| return new ResultData(false); | |||
| } | |||
| @PostMapping("updatePropertyContractStatus") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData updatePropertyContractStatus(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::updateRentContractStatus"); | |||
| //return wxPropertyContractService.updatePropertyContractStatus(wxPropertyContract.getId()); | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -53,54 +53,50 @@ public class WxRentContractController extends WxContractBaseController { | |||
| @Autowired | |||
| private WxAgileContractService wxAgileContractService; | |||
| @Autowired | |||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @Autowired | |||
| WxPropertyContractService wxPropertyContractService; | |||
| @Autowired | |||
| WxMallBuildingService buildingService; | |||
| @Autowired | |||
| WxMallFloorService floorService; | |||
| @Autowired | |||
| WxBillAllHelper wxBillAllHelper; | |||
| @GetMapping("/list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::list"); | |||
| if (null == wxRentContract) { | |||
| wxRentContract = new WxRentContract(); | |||
| } | |||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| wxRentContract.setSortColumns(" updatetime desc"); | |||
| //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | |||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||
| if (null != dataRule) { | |||
| wxRentContract.setFloorForRule(dataRule.getFloorIds()); | |||
| wxRentContract.setBusinessForRule(dataRule.getBussinessIds()); | |||
| wxRentContract.setShopTypeForRule(dataRule.getShopTypes()); | |||
| } | |||
| wxRentContract.setAgileType(EnumRentAgileType.STANDARDS_YEAR.getCode()); | |||
| PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize); | |||
| Integer hasFlow = null; | |||
| if (null != page && null != page.getList()) { | |||
| for (WxRentContract wrc: page.getList()) { | |||
| if (null == hasFlow) { | |||
| if(rentContractHasWorkFlow(wrc)) { | |||
| hasFlow = 1; | |||
| }else { | |||
| hasFlow = 0; | |||
| } | |||
| } | |||
| wrc.setFlowHas(hasFlow); | |||
| } | |||
| } | |||
| return new ResultData(page); | |||
| } | |||
| // @GetMapping("/list") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| // public ResultData list(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::list"); | |||
| // if (null == wxRentContract) { | |||
| // wxRentContract = new WxRentContract(); | |||
| // } | |||
| // wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| // wxRentContract.setSortColumns(" updatetime desc"); | |||
| // //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | |||
| // WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||
| // if (null != dataRule) { | |||
| // wxRentContract.setFloorForRule(dataRule.getFloorIds()); | |||
| // wxRentContract.setBusinessForRule(dataRule.getBussinessIds()); | |||
| // wxRentContract.setShopTypeForRule(dataRule.getShopTypes()); | |||
| // } | |||
| // wxRentContract.setAgileType(EnumRentAgileType.STANDARDS_YEAR.getCode()); | |||
| // PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize); | |||
| // Integer hasFlow = null; | |||
| // if (null != page && null != page.getList()) { | |||
| // for (WxRentContract wrc: page.getList()) { | |||
| // if (null == hasFlow) { | |||
| // if(rentContractHasWorkFlow(wrc)) { | |||
| // hasFlow = 1; | |||
| // }else { | |||
| // hasFlow = 0; | |||
| // } | |||
| // } | |||
| // wrc.setFlowHas(hasFlow); | |||
| // } | |||
| // } | |||
| // | |||
| // return new ResultData(page); | |||
| // } | |||
| @GetMapping("getDateDiff") | |||
| @ApiImplicitParams({ | |||
| @@ -121,39 +117,39 @@ public class WxRentContractController extends WxContractBaseController { | |||
| * @param wxRentContract | |||
| * @return | |||
| */ | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | |||
| //WxMerchant wxMerchant = new WxMerchant(); | |||
| //wxMerchant.setName(wxRentContract.getMerchantName()); | |||
| //wxMerchant.setId(wxRentContract.getMerchantId()); | |||
| // if (wxMerchantService.hasMerchant(wxMerchant)) { | |||
| // return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | |||
| // } | |||
| MallUserInfo user = getUser(); | |||
| wxRentContract.updateTenantInfo(user); | |||
| wxRentContract.setAdjustPeriodHandle(); | |||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||
| wxRentContract.setRentStartType(EnumRentStartType.RENTTIME.getCode()); | |||
| // if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| // wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| // } | |||
| try { | |||
| rentContractValidShop(wxRentContract); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return wxRentContractService.save(wxRentContract, user,user.getName(),oldDate); | |||
| } | |||
| // @PostMapping("add") | |||
| // public ResultData add(@RequestBody WxRentContract wxRentContract) { | |||
| // //WxMerchant wxMerchant = new WxMerchant(); | |||
| // //wxMerchant.setName(wxRentContract.getMerchantName()); | |||
| // //wxMerchant.setId(wxRentContract.getMerchantId()); | |||
| //// if (wxMerchantService.hasMerchant(wxMerchant)) { | |||
| //// return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | |||
| //// } | |||
| // MallUserInfo user = getUser(); | |||
| // wxRentContract.updateTenantInfo(user); | |||
| // wxRentContract.setAdjustPeriodHandle(); | |||
| // Date oldDate = wxRentContract.getRentalStartDate(); | |||
| // wxRentContract.setRentStartType(EnumRentStartType.RENTTIME.getCode()); | |||
| //// if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| //// wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| //// } | |||
| // try { | |||
| // rentContractValidShop(wxRentContract); | |||
| // } catch (Exception e) { | |||
| // return new ResultData(Result.ERROR,e.getMessage()); | |||
| // } | |||
| // return wxRentContractService.save(wxRentContract, user,user.getName(),oldDate); | |||
| // } | |||
| /** | |||
| * 计算价格 | |||
| */ | |||
| @PostMapping("calcutePrice") | |||
| public ResultData calcutePrice(@RequestBody WxRentContract wxRentContract) { | |||
| wxRentContract.calcutePrice(); | |||
| return new ResultData(wxRentContract.getPrice()); | |||
| } | |||
| // /** | |||
| // * 计算价格 | |||
| // */ | |||
| // @PostMapping("calcutePrice") | |||
| // public ResultData calcutePrice(@RequestBody WxRentContract wxRentContract) { | |||
| // wxRentContract.calcutePrice(); | |||
| // return new ResultData(wxRentContract.getPrice()); | |||
| // } | |||
| /** | |||
| * 获取免租期 | |||
| @@ -165,142 +161,142 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(wxRentContractService.getFreePeriods(contract)); | |||
| } | |||
| /** | |||
| * 设置免租期 | |||
| * @param wxRentContract | |||
| * @return | |||
| */ | |||
| @PostMapping("setFreePeriod") | |||
| public ResultData setFreePeriod(@RequestBody WxRentContract wxRentContract) { | |||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| wxRentContractService.saveFreePeriods(wxRentContract); | |||
| return new ResultData(); | |||
| } | |||
| // /** | |||
| // * 设置免租期 | |||
| // * @param wxRentContract | |||
| // * @return | |||
| // */ | |||
| // @PostMapping("setFreePeriod") | |||
| // public ResultData setFreePeriod(@RequestBody WxRentContract wxRentContract) { | |||
| // wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| // wxRentContractService.saveFreePeriods(wxRentContract); | |||
| // return new ResultData(); | |||
| // } | |||
| // | |||
| /** | |||
| * 新增第二步 防止前端3秒重复提交 | |||
| * @param wxRentContract | |||
| * @return | |||
| */ | |||
| @PostMapping("updateMoney") | |||
| public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney"); | |||
| if (null != wxRentContract.getDecimalSize() && wxRentContract.getDecimalSize() <= 0 ) { | |||
| wxRentContract.setDecimalSize(Constant.default_short_decimal_size); | |||
| } | |||
| WxRentContract contract = wxRentContractService.selectById(wxRentContract.getId()); | |||
| wxRentContract.setRentArea(contract.getRentArea()); | |||
| MallUserInfo user = getUser(); | |||
| wxRentContract.updateTenantInfo(user); | |||
| wxRentContract.setAdjustPeriodHandle(); | |||
| wxRentContract.calcutePrice(); | |||
| //wxRentContract.setRentPriceHandle(); | |||
| wxRentContract.calcuteDepositTotal(); | |||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||
| if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| } | |||
| wxRentContract.setOperationType(null); | |||
| if (null == wxRentContract.getDayPriceCalcute()){ | |||
| wxRentContract.setDayPriceCalcute(EnumRentDayPriceCalcute.REAL_DAYS.getCode()); | |||
| } | |||
| if (wxRentContract.getDayPriceCalcute().intValue() == EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode().intValue() && null == wxRentContract.getMonthAverageDays()) { | |||
| return new ResultData(Result.ERROR,"请填写月平均天数"); | |||
| } | |||
| return wxRentContractService.update(wxRentContract, user,user.getName(),EnumFromType.OTHER.getCode(),oldDate,false,true); | |||
| } | |||
| // @PostMapping("updateMoney") | |||
| // public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney"); | |||
| // if (null != wxRentContract.getDecimalSize() && wxRentContract.getDecimalSize() <= 0 ) { | |||
| // wxRentContract.setDecimalSize(Constant.default_short_decimal_size); | |||
| // } | |||
| // WxRentContract contract = wxRentContractService.selectById(wxRentContract.getId()); | |||
| // wxRentContract.setRentArea(contract.getRentArea()); | |||
| // | |||
| // MallUserInfo user = getUser(); | |||
| // wxRentContract.updateTenantInfo(user); | |||
| // wxRentContract.setAdjustPeriodHandle(); | |||
| // wxRentContract.calcutePrice(); | |||
| // //wxRentContract.setRentPriceHandle(); | |||
| // wxRentContract.calcuteDepositTotal(); | |||
| // Date oldDate = wxRentContract.getRentalStartDate(); | |||
| // if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| // wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| // } | |||
| // wxRentContract.setOperationType(null); | |||
| // if (null == wxRentContract.getDayPriceCalcute()){ | |||
| // wxRentContract.setDayPriceCalcute(EnumRentDayPriceCalcute.REAL_DAYS.getCode()); | |||
| // } | |||
| // if (wxRentContract.getDayPriceCalcute().intValue() == EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode().intValue() && null == wxRentContract.getMonthAverageDays()) { | |||
| // return new ResultData(Result.ERROR,"请填写月平均天数"); | |||
| // } | |||
| // | |||
| // return wxRentContractService.update(wxRentContract, user,user.getName(),EnumFromType.OTHER.getCode(),oldDate,false,true); | |||
| // } | |||
| //切换生成账单方式 | |||
| @PostMapping("updateRentStartTime") | |||
| public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) { | |||
| MallUserInfo user = getUser(); | |||
| wxRentContract.updateTenantInfo(user); | |||
| return wxRentContractService.updateRentStartTime(wxRentContract, user); | |||
| } | |||
| // //切换生成账单方式 | |||
| // @PostMapping("updateRentStartTime") | |||
| // public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) { | |||
| // MallUserInfo user = getUser(); | |||
| // wxRentContract.updateTenantInfo(user); | |||
| // return wxRentContractService.updateRentStartTime(wxRentContract, user); | |||
| // } | |||
| /** | |||
| * 新增第三步 | |||
| * @param wxRentContract | |||
| * @return | |||
| */ | |||
| @PostMapping("updateFile") | |||
| public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile"); | |||
| MallUserInfo user = getUser(); | |||
| wxRentContract.updateTenantInfo(user); | |||
| //wxRentContract.setAdjustPeriodHandle(); | |||
| //wxRentContract.setRentPriceHandle(); | |||
| // Date oldDate = wxRentContract.getRentalStartDate(); | |||
| // if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| // wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| // @PostMapping("updateFile") | |||
| // public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile"); | |||
| // MallUserInfo user = getUser(); | |||
| // wxRentContract.updateTenantInfo(user); | |||
| // //wxRentContract.setAdjustPeriodHandle(); | |||
| // //wxRentContract.setRentPriceHandle(); | |||
| //// Date oldDate = wxRentContract.getRentalStartDate(); | |||
| //// if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| //// wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| //// } | |||
| // //wxRentContract.setRentShopType(null); | |||
| // //wxRentContract.setOperationType(null); | |||
| // | |||
| // return wxRentContractService.updateFile(wxRentContract, user,user.getName(),true); | |||
| // } | |||
| // @GetMapping("/findById") | |||
| // @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| // public ResultData findById(Long id,Integer noBillList) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::findById"); | |||
| // // 同步欠缴状态 | |||
| //// WxAllBill wxBillRent = new WxAllBill(); | |||
| //// wxBillRent.updateTenantInfo(getTenantInfo()); | |||
| //// wxBillRentService.updateBillStatus(wxBillRent); | |||
| // try { | |||
| // Map<String, Object> data = wxRentContractService.getById(id,noBillList); | |||
| // return new ResultData(data); | |||
| // } catch (MallinkException e) { | |||
| // logger.error(e.getMessage()); | |||
| // return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| // } | |||
| //wxRentContract.setRentShopType(null); | |||
| //wxRentContract.setOperationType(null); | |||
| return wxRentContractService.updateFile(wxRentContract, user,user.getName(),true); | |||
| } | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData findById(Long id,Integer noBillList) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::findById"); | |||
| // 同步欠缴状态 | |||
| // WxAllBill wxBillRent = new WxAllBill(); | |||
| // wxBillRent.updateTenantInfo(getTenantInfo()); | |||
| // wxBillRentService.updateBillStatus(wxBillRent); | |||
| try { | |||
| Map<String, Object> data = wxRentContractService.getById(id,noBillList); | |||
| return new ResultData(data); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| } | |||
| // } | |||
| @PostMapping("update") | |||
| @SystemControllerLog(description = "租赁合同-更新") | |||
| public ResultData update(@RequestBody WxRentContract rentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::update"); | |||
| WxRentContract cure = wxRentContractService.getSimpleDeatil(rentContract.getId()); | |||
| if (null == cure) { | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"租赁合同未查询到"); | |||
| } | |||
| if (cure.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()|| | |||
| cure.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() || | |||
| (cure.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue() | |||
| && (cure.getApplyStatus().intValue()== EnumRentContractAppStatus.REJECT.getCode().intValue() || | |||
| cure.getApplyStatus().intValue()== EnumRentContractAppStatus.SETBACK.getCode().intValue()))) { | |||
| MallUserInfo user = getUser(); | |||
| rentContract.updateTenantInfo(user); | |||
| rentContract.setAdjustPeriodHandle(); | |||
| //rentContract.setRentPriceHandle(); | |||
| Date oldDate = rentContract.getRentalStartDate(); | |||
| if(rentContract.getRentStartType()!=null && rentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| rentContract.setRentalStartDate(rentContract.getStartDate()); | |||
| } | |||
| try { | |||
| rentContractValidShop(rentContract); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| ResultData update = null; | |||
| try { | |||
| update = wxRentContractService.updateOneStep(rentContract, user, user.getName(), EnumFromType.OTHER.getCode(), oldDate,false); | |||
| } catch (MallinkException e) { | |||
| return new ResultData(update.code,update.message); | |||
| } | |||
| return update; | |||
| }else { | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"当前合同状态不允许修改"); | |||
| } | |||
| } | |||
| // @PostMapping("update") | |||
| // @SystemControllerLog(description = "租赁合同-更新") | |||
| // public ResultData update(@RequestBody WxRentContract rentContract) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::update"); | |||
| // | |||
| // WxRentContract cure = wxRentContractService.getSimpleDeatil(rentContract.getId()); | |||
| // if (null == cure) { | |||
| // return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"租赁合同未查询到"); | |||
| // } | |||
| // | |||
| // if (cure.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()|| | |||
| // cure.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() || | |||
| // (cure.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue() | |||
| // && (cure.getApplyStatus().intValue()== EnumRentContractAppStatus.REJECT.getCode().intValue() || | |||
| // cure.getApplyStatus().intValue()== EnumRentContractAppStatus.SETBACK.getCode().intValue()))) { | |||
| // MallUserInfo user = getUser(); | |||
| // rentContract.updateTenantInfo(user); | |||
| // rentContract.setAdjustPeriodHandle(); | |||
| // //rentContract.setRentPriceHandle(); | |||
| // Date oldDate = rentContract.getRentalStartDate(); | |||
| // if(rentContract.getRentStartType()!=null && rentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| // rentContract.setRentalStartDate(rentContract.getStartDate()); | |||
| // } | |||
| // | |||
| // try { | |||
| // rentContractValidShop(rentContract); | |||
| // } catch (Exception e) { | |||
| // return new ResultData(Result.ERROR,e.getMessage()); | |||
| // } | |||
| // | |||
| // ResultData update = null; | |||
| // try { | |||
| // update = wxRentContractService.updateOneStep(rentContract, user, user.getName(), EnumFromType.OTHER.getCode(), oldDate,false); | |||
| // } catch (MallinkException e) { | |||
| // return new ResultData(update.code,update.message); | |||
| // } | |||
| // return update; | |||
| // }else { | |||
| // return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"当前合同状态不允许修改"); | |||
| // } | |||
| // } | |||
| /** | |||
| * 作废 | |||
| @@ -326,20 +322,6 @@ public class WxRentContractController extends WxContractBaseController { | |||
| wxRentContractService.updateRentContract(contract); | |||
| //删除预览的账单 | |||
| wxRentContractService.deletePrewBill(contract); | |||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| if (null != wxRentContract.getPropertyId()) { | |||
| WxPropertyContract propertyContract = wxPropertyContractService.getSimpleDetail(wxRentContract.getPropertyId()); | |||
| propertyContract.setStatus(EnumRentContractStatus.INVALID.getCode()); | |||
| propertyContract.setUpdatetime(new Date()); | |||
| propertyContract.setUpdateBy(user.getId()); | |||
| wxPropertyContractService.updatePropertyContract(propertyContract); | |||
| //删除预览的账单 | |||
| wxPropertyContractService.deletePreviewBill(propertyContract); | |||
| } | |||
| } | |||
| return new ResultData(); | |||
| }else { | |||
| return new ResultData(Result.ERROR, "合同状态不允许作废.只能作废草稿或者履约拒绝的合同。"); | |||
| @@ -360,13 +342,6 @@ public class WxRentContractController extends WxContractBaseController { | |||
| } | |||
| wxRentContract.updateTenantInfo(contract); | |||
| wxRentContractService.endContract(wxRentContract,this.getUser()); | |||
| //租金+物业的终止 | |||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| WxPropertyContract wpc = new WxPropertyContract(); | |||
| wpc.setId(wxRentContract.getPropertyId()); | |||
| wpc.setEndContractTime(wxRentContract.getEndContractTime()); | |||
| wxPropertyContractService.endContract(wpc,this.getUser()); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @@ -410,17 +385,6 @@ public class WxRentContractController extends WxContractBaseController { | |||
| if (contract.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"租赁合同状态为草稿才能进行此操作"); | |||
| } | |||
| // //店铺是否存在其他有效合同里面 | |||
| // boolean result = wxRentContractService.hasOtherValidContractShop(contract); | |||
| // if (result) { | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"店铺已经在其他计租中或者已签约未到期的合同里面了。"); | |||
| // } | |||
| // try { | |||
| // validConfilit(contract); | |||
| // } catch (Exception e) { | |||
| // return new ResultData(Result.ERROR,e.getMessage()); | |||
| // } | |||
| try { | |||
| rentContractValidShop(contract); | |||
| @@ -428,50 +392,10 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| //如果是租金+物业合同,如果没有物业合同或者物业合同不是草稿状态,不能提交审核 | |||
| if (contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| if (null == wxRentContract.getPropertyId()) { | |||
| return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); | |||
| } | |||
| WxPropertyContract property = wxPropertyContractService.getSimpleDetail(wxRentContract.getPropertyId()); | |||
| if (null == property) { | |||
| return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); | |||
| } | |||
| if (property.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"物业合同未完善,请先完善。"); | |||
| } | |||
| if (property.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"物业合同当前状态不能直接生效。"); | |||
| } | |||
| } | |||
| wxRentContractService.updateRentContractStatus(wxRentContract.getId(),false); | |||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| wxPropertyContractService.updatePropertyContractStatus(wxRentContract.getPropertyId()); | |||
| } | |||
| return new ResultData(Result.SUCCESS,"合同生效成功!"); | |||
| } | |||
| // private void validConfilit(WxRentContract rentContract) throws Exception { | |||
| // //判断是否该合同的时间和有效的合同是否冲突 | |||
| // List<Long> shopIds = rentContract.shopIdsByRentInfo(); | |||
| // for (Long sid: shopIds) { | |||
| // WxRentContract rcq = new WxRentContract(); | |||
| // rcq.setStatuss(EnumRentContractStatus.getValidStatus()); | |||
| // rcq.setQueryShopId(sid); | |||
| // List<WxRentContract> crcs = wxRentContractService.findList(rcq); | |||
| // if (null != crcs) { | |||
| // for (WxRentContract crc : crcs) { | |||
| // if((rentContract.getRentalEndDate().before(crc.getRentalStartDate()) && rentContract.getRentalStartDate().after(new Date())) || | |||
| // rentContract.getRentalStartDate().after(crc.getRentalEndDate())) { | |||
| // }else { | |||
| // throw new MallinkException(Result.ERROR, "店铺["+sid+"]的计租时间区间与合同["+crc.getContractNumber()+"]有冲突。"); | |||
| // } | |||
| // } | |||
| // } | |||
| // } | |||
| // } | |||
| @PostMapping("apply") | |||
| public ResultData apply(@RequestBody WxRentContract wxRentContract) { | |||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||
| @@ -484,44 +408,14 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"租赁合同不存在工作流,不能提交审批。"); | |||
| } | |||
| // try { | |||
| // validConfilit(rentContract); | |||
| // } catch (Exception e) { | |||
| // return new ResultData(Result.ERROR,e.getMessage()); | |||
| // } | |||
| try { | |||
| rentContractValidShop(rentContract); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| //如果是租金+物业合同,如果没有物业合同或者物业合同不是草稿状态,不能提交审核 | |||
| if (rentContract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| if (null == wxRentContract.getPropertyId()) { | |||
| return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); | |||
| } | |||
| WxPropertyContract property = wxPropertyContractService.getSimpleDetail(wxRentContract.getPropertyId()); | |||
| if (null == property) { | |||
| return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); | |||
| } | |||
| if (property.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"物业合同未完善,请先完善。"); | |||
| } | |||
| if (property.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"物业合同当前状态不能提交审批。"); | |||
| } | |||
| } | |||
| WxContractCustomers customers = wxAgileContractService.findCustomers(rentContract, rentContract.getCustomersId()); | |||
| if(rentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue() || | |||
| rentContract.getOperationType().intValue() == EnumContractOperationType.JINMAO.getCode().intValue()) { | |||
| rentContract.setFlowParams(generateFlowParams(customers,EnumFlowKey.NEW_RENT_CONTRACT, EnumFlowContractType.RENT,EnumRentAgileType.getEnum(rentContract.getAgileType()), wxRentContract.getRemark(), wxRentContract.getId(),null)); | |||
| }else if(rentContract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()){ | |||
| rentContract.setFlowParams(generateFlowParams(customers,EnumFlowKey.NNEW_RENT_CONTRACT, EnumFlowContractType.WHOLE_SHOP, EnumRentAgileType.getEnum(rentContract.getAgileType()),wxRentContract.getRemark(), wxRentContract.getId(),wxRentContract.getPropertyId())); | |||
| }else { | |||
| return new ResultData(Result.ERROR,"合同操作类型非法。"); | |||
| } | |||
| rentContract.setFlowParams(generateFlowParams(customers,EnumFlowKey.NEW_RENT_CONTRACT, EnumFlowContractType.RENT, wxRentContract.getRemark(), wxRentContract.getId(),null)); | |||
| return wxRentContractService.apply(rentContract,user); | |||
| } | |||
| @@ -556,22 +450,6 @@ public class WxRentContractController extends WxContractBaseController { | |||
| if (rentContract.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"租金合同未完善,请先完善。"); | |||
| } | |||
| WxPropertyContract property = null; | |||
| if (rentContract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| WxPropertyContract pq = new WxPropertyContract(); | |||
| pq.updateTenantInfo(rentContract); | |||
| pq.setOperationType(EnumContractOperationType.WHOLE.getCode()); | |||
| pq.setRentContractId(wxRentContract.getId()); | |||
| List<WxPropertyContract> pclist = wxPropertyContractService.findList(pq); | |||
| if (null == pclist || pclist.size() <= 0 ) { | |||
| return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); | |||
| } | |||
| property = pclist.get(0); | |||
| if (property.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"物业合同未完善,请先完善。"); | |||
| } | |||
| } | |||
| MallUserInfo user = getUser(); | |||
| @@ -590,7 +468,7 @@ public class WxRentContractController extends WxContractBaseController { | |||
| } | |||
| try { | |||
| wxRentContractService.renewal(rentContract,property,user); | |||
| wxRentContractService.renewal(rentContract,user); | |||
| }catch(Exception e) { | |||
| logger.error("renewal error.",e); | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| @@ -632,40 +510,38 @@ public class WxRentContractController extends WxContractBaseController { | |||
| } | |||
| @GetMapping("getRentContractList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData getRentContractList(@ModelAttribute WxRentContract wxRentContract, Integer validStatus, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); | |||
| if (null == wxRentContract) wxRentContract = new WxRentContract(); | |||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| if (StringUtils.isNotBlank(wxRentContract.getOnlyPropertyContractId()) && (!"undefined".equals(wxRentContract.getOnlyPropertyContractId()))) { | |||
| try { | |||
| Long contractId = Long.parseLong(wxRentContract.getOnlyPropertyContractId()); | |||
| if (contractId > 0 ) { | |||
| wxRentContract.setId(contractId); | |||
| } | |||
| } catch (NumberFormatException e) { | |||
| } | |||
| } else { | |||
| //正常状态, 物业合同 | |||
| if (validStatus != null && 1 == validStatus) { | |||
| wxRentContract.setStatuss(EnumRentContractStatus.getValidStatus()); | |||
| //续签的合同,包括正常到期 | |||
| }else if (validStatus != null && 2== validStatus) { | |||
| List<Integer> statuss = EnumRentContractStatus.getValidStatus(); | |||
| statuss.add(EnumRentContractStatus.OUT_DATE.getCode()); | |||
| wxRentContract.setStatuss(statuss); | |||
| } | |||
| } | |||
| wxRentContract.setSortColumns(SortField.Createtime_DESC); | |||
| return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | |||
| } | |||
| // @GetMapping("getRentContractList") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| // public ResultData getRentContractList(@ModelAttribute WxRentContract wxRentContract, Integer validStatus, Integer pageNum, Integer pageSize) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); | |||
| // if (null == wxRentContract) wxRentContract = new WxRentContract(); | |||
| // wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| // if (StringUtils.isNotBlank(wxRentContract.getOnlyPropertyContractId()) && (!"undefined".equals(wxRentContract.getOnlyPropertyContractId()))) { | |||
| // try { | |||
| // Long contractId = Long.parseLong(wxRentContract.getOnlyPropertyContractId()); | |||
| // if (contractId > 0 ) { | |||
| // wxRentContract.setId(contractId); | |||
| // } | |||
| // } catch (NumberFormatException e) { | |||
| // } | |||
| // | |||
| // } else { | |||
| // //正常状态, 物业合同 | |||
| // if (validStatus != null && 1 == validStatus) { | |||
| // wxRentContract.setStatuss(EnumRentContractStatus.getValidStatus()); | |||
| // //续签的合同,包括正常到期 | |||
| // }else if (validStatus != null && 2== validStatus) { | |||
| // List<Integer> statuss = EnumRentContractStatus.getValidStatus(); | |||
| // statuss.add(EnumRentContractStatus.OUT_DATE.getCode()); | |||
| // wxRentContract.setStatuss(statuss); | |||
| // } | |||
| // } | |||
| // | |||
| // wxRentContract.setSortColumns(SortField.Createtime_DESC); | |||
| // return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | |||
| // } | |||
| @GetMapping("getPayAccountInfo") | |||
| @SystemControllerLog(description = "租赁合同-获取甲方账户") | |||
| @@ -689,30 +565,30 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(map); | |||
| } | |||
| @GetMapping("/hasRentStatus") | |||
| public ResultData hasRentStatus(@ModelAttribute WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::hasRentStatus"); | |||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| return wxRentContractService.hasRentStatus(wxRentContract); | |||
| } | |||
| // @GetMapping("/hasRentStatus") | |||
| // public ResultData hasRentStatus(@ModelAttribute WxRentContract wxRentContract) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::hasRentStatus"); | |||
| // wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| // return wxRentContractService.hasRentStatus(wxRentContract); | |||
| // } | |||
| @GetMapping("/hasContractNumber") | |||
| public ResultData hasContractNumber(@ModelAttribute WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::hasContractNumber"); | |||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| return wxRentContractService.hasContractNumber(wxRentContract); | |||
| } | |||
| @GetMapping("getMerchantList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "shopType", value = "店铺类型 1:店铺 2:多经点位", dataType = "Integer", paramType = "query", required = true)}) | |||
| public ResultData getMerchantList(Integer shopType) throws Exception{ | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.updateTenantInfo(getTenantInfo()); | |||
| wxMerchant.setRentShopType(shopType); | |||
| wxMerchant.setIsPrivate(EnumYesOrNo.NO.getCode()); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxMerchantService.getMerchantList(wxMerchant)); | |||
| } | |||
| // @GetMapping("/hasContractNumber") | |||
| // public ResultData hasContractNumber(@ModelAttribute WxRentContract wxRentContract) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::hasContractNumber"); | |||
| // wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| // return wxRentContractService.hasContractNumber(wxRentContract); | |||
| // } | |||
| // @GetMapping("getMerchantList") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "shopType", value = "店铺类型 1:店铺 2:多经点位", dataType = "Integer", paramType = "query", required = true)}) | |||
| // public ResultData getMerchantList(Integer shopType) throws Exception{ | |||
| // WxMerchant wxMerchant = new WxMerchant(); | |||
| // wxMerchant.updateTenantInfo(getTenantInfo()); | |||
| // wxMerchant.setRentShopType(shopType); | |||
| // wxMerchant.setIsPrivate(EnumYesOrNo.NO.getCode()); | |||
| // return new ResultData(Result.SUCCESS, "查询成功", wxMerchantService.getMerchantList(wxMerchant)); | |||
| // } | |||
| @PostMapping("savePayAccountInfo") | |||
| public ResultData savePayAccountInfo(@RequestBody WxPayAccountBill payAccountBill) { | |||
| @@ -736,34 +612,34 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(); | |||
| } | |||
| @GetMapping("/getContractByContractNumber") | |||
| public ResultData getContractByContractNumber(@ModelAttribute WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::getContractByContractNumber"); | |||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| return wxRentContractService.getContractByContractNumber(wxRentContract); | |||
| } | |||
| // @GetMapping("/getContractByContractNumber") | |||
| // public ResultData getContractByContractNumber(@ModelAttribute WxRentContract wxRentContract) { | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::getContractByContractNumber"); | |||
| // wxRentContract.updateTenantInfo(getTenantInfo()); | |||
| // return wxRentContractService.getContractByContractNumber(wxRentContract); | |||
| // } | |||
| @GetMapping("/init") | |||
| @TenantIgnore | |||
| public ResultData init() { | |||
| List<WxRentContract> clist = wxRentContractService.findList(new WxRentContract()); | |||
| for (WxRentContract wrc: clist) { | |||
| List<Long> shopIds = wrc.shopIdsByRentInfo(); | |||
| if (null != shopIds) { | |||
| List<WxShop> shops = wxShopService.getByIds(this.getTenantInfo(),shopIds); | |||
| String shopIdstr = ""; | |||
| for (WxShop shop : shops) { | |||
| shopIdstr = shopIdstr +","+shop.getId(); | |||
| } | |||
| if(!StringUtils.isBlank(shopIdstr)) { | |||
| wrc.setShopIdStr(shopIdstr); | |||
| wxRentContractService.updateRentContract(wrc); | |||
| } | |||
| } | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| // @GetMapping("/init") | |||
| // @TenantIgnore | |||
| // public ResultData init() { | |||
| // List<WxRentContract> clist = wxRentContractService.findList(new WxRentContract()); | |||
| // for (WxRentContract wrc: clist) { | |||
| // List<Long> shopIds = wrc.shopIdsByRentInfo(); | |||
| // if (null != shopIds) { | |||
| // List<WxShop> shops = wxShopService.getByIds(this.getTenantInfo(),shopIds); | |||
| // String shopIdstr = ""; | |||
| // for (WxShop shop : shops) { | |||
| // shopIdstr = shopIdstr +","+shop.getId(); | |||
| // } | |||
| // if(!StringUtils.isBlank(shopIdstr)) { | |||
| // wrc.setShopIdStr(shopIdstr); | |||
| // wxRentContractService.updateRentContract(wrc); | |||
| // } | |||
| // } | |||
| // } | |||
| // return new ResultData(); | |||
| // } | |||
| //查询联营扣点,联营取高的合同 | |||
| @GetMapping("getRevenueContractList") | |||
| @@ -783,7 +659,8 @@ public class WxRentContractController extends WxContractBaseController { | |||
| //statusList.add(EnumRentContractStatus.READY_FOR_PAING.getCode()); | |||
| wxRentContract.setStatuss(statusList); | |||
| wxRentContract.setSortColumns(SortField.Createtime_DESC); | |||
| return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | |||
| //return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | |||
| return new ResultData(); | |||
| } | |||
| //查询联营扣点,联营取高的合同账单周期 | |||
| @@ -874,32 +751,32 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(retMap); | |||
| } | |||
| //查询商户计租合同列表 | |||
| @GetMapping("revenuePropertyContract") | |||
| public ResultData revenuePropertyContract(@ModelAttribute WxRentContract rentContract) { | |||
| if (null == rentContract) rentContract = new WxRentContract(); | |||
| rentContract.updateTenantInfo(getTenantInfo()); | |||
| WxRentContract contract = wxRentContractService.selectById(rentContract.getId()); | |||
| //纯联营扣点方式,不能加物业费一起算 | |||
| if (contract.getType().intValue() == EnumRentContractType.RENT_BY_JOINT.getCode()) { | |||
| return new ResultData(); | |||
| } | |||
| WxPropertyContract bq = new WxPropertyContract(); | |||
| bq.updateTenantInfo(rentContract); | |||
| bq.setRentContractId(rentContract.getId()); | |||
| bq.setOperationType(EnumContractOperationType.WHOLE.getCode()); | |||
| //包括提前终止的,租金+物业合同是一对一的 | |||
| List<Integer> statusList = new ArrayList<Integer>(); | |||
| statusList.add(EnumRentContractStatus.PAING.getCode()); | |||
| statusList.add(EnumRentContractStatus.TERMINATE.getCode()); | |||
| //bq.setStatus(EnumRentContractStatus.PAING.getCode()); | |||
| bq.setStatuss(statusList); | |||
| List<WxPropertyContract> propertyList = wxPropertyContractService.findList(bq); | |||
| if (null != propertyList && propertyList.size() > 0 ) { | |||
| return new ResultData(propertyList.get(0)); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| // //查询商户计租合同列表 | |||
| // @GetMapping("revenuePropertyContract") | |||
| // public ResultData revenuePropertyContract(@ModelAttribute WxRentContract rentContract) { | |||
| // if (null == rentContract) rentContract = new WxRentContract(); | |||
| // rentContract.updateTenantInfo(getTenantInfo()); | |||
| // WxRentContract contract = wxRentContractService.selectById(rentContract.getId()); | |||
| // //纯联营扣点方式,不能加物业费一起算 | |||
| // if (contract.getType().intValue() == EnumRentContractType.RENT_BY_JOINT.getCode()) { | |||
| // return new ResultData(); | |||
| // } | |||
| // WxPropertyContract bq = new WxPropertyContract(); | |||
| // bq.updateTenantInfo(rentContract); | |||
| // bq.setRentContractId(rentContract.getId()); | |||
| // bq.setOperationType(EnumContractOperationType.WHOLE.getCode()); | |||
| // //包括提前终止的,租金+物业合同是一对一的 | |||
| // List<Integer> statusList = new ArrayList<Integer>(); | |||
| // statusList.add(EnumRentContractStatus.PAING.getCode()); | |||
| // statusList.add(EnumRentContractStatus.TERMINATE.getCode()); | |||
| // //bq.setStatus(EnumRentContractStatus.PAING.getCode()); | |||
| // bq.setStatuss(statusList); | |||
| // List<WxPropertyContract> propertyList = wxPropertyContractService.findList(bq); | |||
| // if (null != propertyList && propertyList.size() > 0 ) { | |||
| // return new ResultData(propertyList.get(0)); | |||
| // } | |||
| // return new ResultData(); | |||
| // } | |||
| /** | |||
| * 扣点设置销售额重新计算 | |||
| @@ -915,16 +792,16 @@ public class WxRentContractController extends WxContractBaseController { | |||
| if (null == wxRentContract.getSalesStartTime() || null == wxRentContract.getSalesEndTime()) { | |||
| return new ResultData(Result.ERROR, "时间不能为空"); | |||
| } | |||
| return new ResultData(wxRentContractService.setRevenueSales(this.getUser(),rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime(),wxRentContract.getPropertyContractId())); | |||
| return new ResultData(wxRentContractService.setRevenueSales(this.getUser(),rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime())); | |||
| } | |||
| //查询合同年限 | |||
| @GetMapping("getContractYears") | |||
| public ResultData getContractYears(@ModelAttribute WxRentContract wxRentContract) { | |||
| if (null == wxRentContract) wxRentContract = new WxRentContract(); | |||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||
| return new ResultData(wxRentContractService.getRentContractYears(rentContract)); | |||
| } | |||
| // //查询合同年限 | |||
| // @GetMapping("getContractYears") | |||
| // public ResultData getContractYears(@ModelAttribute WxRentContract wxRentContract) { | |||
| // if (null == wxRentContract) wxRentContract = new WxRentContract(); | |||
| // WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||
| // return new ResultData(wxRentContractService.getRentContractYears(rentContract)); | |||
| // } | |||
| //查询合同年限已输入销售额情况 | |||
| @PostMapping("getContractYearsSales") | |||
| @@ -968,7 +845,6 @@ public class WxRentContractController extends WxContractBaseController { | |||
| if (null == jumpList || jumpList.size() <= 0 ) { | |||
| return new ResultData(Result.ERROR, "合同未设置跳点,不用做汇算"); | |||
| } | |||
| rentContract.setPropertyContractId(wxRentContract.getPropertyContractId()); | |||
| return new ResultData(wxRentContractService.calcuteYearsRevenueRentUp(this.getUser(),rentContract)); | |||
| } | |||
| @@ -1,84 +0,0 @@ | |||
| package com.iformall.controller.contract; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFeesStandardsCalcuteUnit; | |||
| import com.iformall.enums.EnumFeesStandardsTimeUnit; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.*; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| /** | |||
| */ | |||
| @RestController | |||
| @RequestMapping("wxRentContractDepositType") | |||
| public class WxRentContractDepositTypeController extends WxContractBaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxEnergyService wxEnergyService; | |||
| /** | |||
| * 押金类型 | |||
| * @return | |||
| */ | |||
| @GetMapping("list") | |||
| public ResultData billTypes() { | |||
| WxEnergyFees dt = new WxEnergyFees(); | |||
| dt.updateTenantInfo(getTenantInfo()); | |||
| dt.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| dt.setBillType(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| dt.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(dt, 1, 100,false); | |||
| if (null == page) { | |||
| return new ResultData(); | |||
| } | |||
| return new ResultData(page.getList()); | |||
| } | |||
| @ApiOperation("查询物业合同计量单位列表") | |||
| @GetMapping("typeCalcuteUnitList") | |||
| public ResultData typeCalcuteUnitList() { | |||
| List<EnumFeesStandardsCalcuteUnit> enumList = EnumBillAllType.getCalucuteUnites(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| if (null != enumList) { | |||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| for (int i = 0 ; i < enumList.size(); i++) { | |||
| EnumFeesStandardsCalcuteUnit cu = enumList.get(i); | |||
| retMap.put(cu.getCode(), cu.getMessage()); | |||
| } | |||
| return new ResultData(retMap); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("查询物业合同时间单位列表") | |||
| @GetMapping("typeTimeUnitList") | |||
| public ResultData typeTimeUnitList() { | |||
| List<EnumFeesStandardsTimeUnit> enumList = EnumBillAllType.getTimeUnites(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| if (null != enumList) { | |||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| for (int i = 0 ; i < enumList.size(); i++) { | |||
| EnumFeesStandardsTimeUnit cu = enumList.get(i); | |||
| retMap.put(cu.getCode(), cu.getMessage()); | |||
| } | |||
| return new ResultData(retMap); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -1,142 +0,0 @@ | |||
| package com.iformall.controller.contract; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxUserDataRule; | |||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumShopSellStatus; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxMallBuildingService; | |||
| import com.iformall.service.WxMallFloorService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| import com.iformall.service.WxShopService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("wxRentPropertyContract") | |||
| public class WxRentPropertyContractController extends WxContractBaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||
| @Autowired | |||
| WxMallBuildingService buildingService; | |||
| @Autowired | |||
| WxMallFloorService floorService; | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @GetMapping("/list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::list"); | |||
| if (null == wxRentPropertyContractVo) { | |||
| wxRentPropertyContractVo = new WxRentPropertyContractVo(); | |||
| } | |||
| wxRentPropertyContractVo.updateTenantInfo(getTenantInfo()); | |||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||
| if (null != dataRule) { | |||
| wxRentPropertyContractVo.setFloorForRule(dataRule.getFloorIds()); | |||
| wxRentPropertyContractVo.setBusinessForRule(dataRule.getBussinessIds()); | |||
| wxRentPropertyContractVo.setShopTypeForRule(dataRule.getShopTypes()); | |||
| } | |||
| PageInfo<WxRentPropertyContractVo> page = wxRentPropertyContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | |||
| Integer hasFlow = null; | |||
| if (null != page && null != page.getList()) { | |||
| for (WxRentPropertyContractVo wrc: page.getList()) { | |||
| if (null == hasFlow) { | |||
| if(rentPropertyHasWorkFlow(wrc)) { | |||
| hasFlow = 1; | |||
| }else { | |||
| hasFlow = 0; | |||
| } | |||
| } | |||
| wrc.setFlowHas(hasFlow); | |||
| String renInfo = wrc.getRentInfo(); | |||
| if (!StringUtils.isBlank(renInfo)) { | |||
| String floorName = ""; | |||
| String buildingName = ""; | |||
| String shopNumber = ""; | |||
| JSONArray arrays = JSONArray.parseArray(renInfo); | |||
| if ( null != arrays) { | |||
| List<Long> floorIds = new ArrayList<Long>(); | |||
| List<Long> buildIds = new ArrayList<Long>(); | |||
| List<Long> shopIds = new ArrayList<Long>(); | |||
| wrc.setFloorName(floorName); | |||
| wrc.setBuildingName(buildingName); | |||
| wrc.setShopNumber(shopNumber); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "rentId", value = "租金合同编号", dataType = "Long", paramType = "query", required = false), | |||
| @ApiImplicitParam(name = "propertyId", value = "物业合同编号", dataType = "Long", paramType = "query", required = false), | |||
| @ApiImplicitParam(name = "id", value = "租金合同编号(工作流用)", dataType = "String", paramType = "query", required = false)}) | |||
| public ResultData findById(String id) { | |||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::findById"); | |||
| //if (null != rentId || null != propertyId) { | |||
| // return wxRentPropertyContractService.getContractInfo(rentId,propertyId); | |||
| //}else | |||
| if (!StringUtils.isBlank(id)) { | |||
| //租金+物业工作流查询会传此id | |||
| String[] ids = id.split("_RP_"); | |||
| if (ids.length == 2 ) { | |||
| Long rId = Long.parseLong(ids[0]); | |||
| Long pId = Long.parseLong(ids[1]); | |||
| return wxRentPropertyContractService.getContractInfo(rId,pId); | |||
| } | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("合同审批详情") | |||
| @GetMapping("/getContractApplyInfo") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "rentId", value = "租金合同编号", dataType = "Long", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "propertyId", value = "物业合同编号", dataType = "Long", paramType = "query", required = true)}) | |||
| public ResultData getContractApplyInfo(Long rentId,Long propertyId) { | |||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::getContractApplyInfo"); | |||
| return wxRentPropertyContractService.getContractApplyInfo(rentId,propertyId); | |||
| } | |||
| @PostMapping("insertRentForCreate") | |||
| @SystemControllerLog(description = "租赁合同-添加") | |||
| public ResultData insertRent(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::insertRentForCreate"); | |||
| MallUserInfo user = getUser(); | |||
| wxRentContract.updateTenantInfo(user); | |||
| return wxRentPropertyContractService.insertRentForCreate(wxRentContract); | |||
| } | |||
| } | |||
| @@ -5,8 +5,8 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxEnergyFeesShop; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFeesCalcuteShop; | |||
| import com.iformall.domain.po.WxEnergyFeesTime; | |||
| import com.iformall.domain.po.WxEnergyMeter; | |||
| import com.iformall.domain.po.WxEnergyMeterChild; | |||
| @@ -18,7 +18,6 @@ import com.iformall.domain.po.WxMallFloor; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.WxUserDataRule; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumEnergyMeterPhysicsType; | |||
| import com.iformall.enums.EnumEnergyMeterShopFloorType; | |||
| import com.iformall.enums.EnumEnergyMeterType; | |||
| @@ -376,7 +375,7 @@ public class WxEnergyController extends BaseController { | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData shopFeesList(@ModelAttribute WxEnergyFeesShop record, Integer pageNum, Integer pageSize) { | |||
| public ResultData shopFeesList(@ModelAttribute WxFeesCalcuteShop record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| if (StringUtils.isNotBlank(record.getFeesIdsStr())) { | |||
| @@ -389,7 +388,7 @@ public class WxEnergyController extends BaseController { | |||
| record.setFeesIds(feesIdList); | |||
| } | |||
| } | |||
| PageInfo<WxEnergyFeesShop> list = wxEnergyService.feesShopListAsPage(record,pageNum,pageSize); | |||
| PageInfo<WxFeesCalcuteShop> list = wxEnergyService.feesShopListAsPage(record,pageNum,pageSize); | |||
| return new ResultData(list); | |||
| } | |||
| @@ -415,21 +414,21 @@ public class WxEnergyController extends BaseController { | |||
| @ApiOperation("计费标准新增修改") | |||
| @PostMapping("calcuteFeesShopEndTime") | |||
| public ResultData calcuteFeesShopEndTime(@RequestBody WxEnergyFeesShop record) { | |||
| public ResultData calcuteFeesShopEndTime(@RequestBody WxFeesCalcuteShop record) { | |||
| return new ResultData(record.calcuteEndTime()); | |||
| } | |||
| @ApiOperation("计算公式组件") | |||
| @GetMapping("feesShopComponentList") | |||
| public ResultData shopFeesList(@ModelAttribute WxEnergyFeesShop record) { | |||
| public ResultData shopFeesList(@ModelAttribute WxFeesCalcuteShop record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return new ResultData(wxEnergyService.getFeesShopComponentList(record)); | |||
| } | |||
| @ApiOperation("计费标准新增修改") | |||
| @PostMapping("createFeesShop") | |||
| public ResultData createFeesShop(@RequestBody WxEnergyFeesShop record) { | |||
| public ResultData createFeesShop(@RequestBody WxFeesCalcuteShop record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxEnergyService.createFeesShop(record); | |||
| return new ResultData(); | |||
| @@ -437,21 +436,21 @@ public class WxEnergyController extends BaseController { | |||
| @ApiOperation("删除计费标准关联") | |||
| @PostMapping("deleteFeesShop") | |||
| public ResultData deleteFeesShop(@RequestBody WxEnergyFeesShop record) { | |||
| public ResultData deleteFeesShop(@RequestBody WxFeesCalcuteShop record) { | |||
| wxEnergyService.deleteFeesShop(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("店铺计费标准详情") | |||
| @GetMapping("feesShopDetail") | |||
| public ResultData feesShopDetail(@ModelAttribute WxEnergyFeesShop record) { | |||
| public ResultData feesShopDetail(@ModelAttribute WxFeesCalcuteShop record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return new ResultData(wxEnergyService.getFeesShop(record.getId(),record.getTenantId())); | |||
| } | |||
| @ApiOperation("店铺修改计费标准") | |||
| @PostMapping("updateFeesShop") | |||
| public ResultData updateFeesShop(@RequestBody WxEnergyFeesShop record) { | |||
| public ResultData updateFeesShop(@RequestBody WxFeesCalcuteShop record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxEnergyService.updateFeesShop(record); | |||
| return new ResultData(); | |||
| @@ -459,7 +458,7 @@ public class WxEnergyController extends BaseController { | |||
| @ApiOperation("计费标准记录导出") | |||
| @GetMapping("feesShopExport") | |||
| public void feesShopExport(@ModelAttribute WxEnergyFeesShop record, HttpServletRequest request, HttpServletResponse response) { | |||
| public void feesShopExport(@ModelAttribute WxFeesCalcuteShop record, HttpServletRequest request, HttpServletResponse response) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| if (StringUtils.isNotBlank(record.getFeesIdsStr())) { | |||
| @@ -585,87 +584,76 @@ public class WxEnergyController extends BaseController { | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData feesList(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| public ResultData feesList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| if (null != record.getIsFeesShopQuery() && record.getIsFeesShopQuery() == EnumYesOrNo.YES.getCode()) { | |||
| List<Integer> billTypeList = new ArrayList<Integer>(); | |||
| billTypeList.add(EnumBillAllType.PROPERTY.getCode()); | |||
| billTypeList.add(EnumBillAllType.DAILY.getCode()); | |||
| billTypeList.add(EnumBillAllType.OTHER.getCode()); | |||
| record.setBillTypeList(billTypeList); | |||
| record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| record.setFixedPrice(EnumYesOrNo.NO.getCode()); | |||
| //record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| //record.setFixedPrice(EnumYesOrNo.NO.getCode()); | |||
| }else { | |||
| record.setBillType(EnumBillAllType.DAILY.getCode()); | |||
| } | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("科目新增") | |||
| @PostMapping("saveFees") | |||
| public ResultData saveFees(@RequestBody WxEnergyFees record) { | |||
| public ResultData saveFees(@RequestBody WxFinanceFees record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setBillType(EnumBillAllType.DAILY.getCode()); | |||
| if (null == record.getType()) { | |||
| return new ResultData(Result.ERROR,"请选择能源表类型"); | |||
| } | |||
| if (null == record.getFixedPrice()) { | |||
| return new ResultData(Result.ERROR,"请选择是否是一次性费用"); | |||
| } | |||
| // if (null == record.getFixedPrice()) { | |||
| // return new ResultData(Result.ERROR,"请选择是否是一次性费用"); | |||
| // } | |||
| wxEnergyService.saveOrUpdateFees(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("临时付款给商户科目新增") | |||
| @PostMapping("saveToPayMerchantFees") | |||
| public ResultData saveToPayMerchantFees(@RequestBody WxEnergyFees record) { | |||
| public ResultData saveToPayMerchantFees(@RequestBody WxFinanceFees record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setBillType(EnumBillAllType.TEMP_TO_PAYMERCHANT.getCode()); | |||
| record.setCashierType(EnumFinanceCashierType.PAY.getCode()); | |||
| record.setFixedPrice(EnumYesOrNo.YES.getCode()); | |||
| //record.setCashierType(EnumFinanceCashierType.PAY.getCode()); | |||
| //record.setFixedPrice(EnumYesOrNo.YES.getCode()); | |||
| record.setIsDespoit(EnumYesOrNo.YES.getCode()); | |||
| wxEnergyService.saveOrUpdateFees(record); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("feesUpdateIsDel") | |||
| public ResultData feesUpdateIsDel(@RequestBody WxEnergyFees record) { | |||
| public ResultData feesUpdateIsDel(@RequestBody WxFinanceFees record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxEnergyService.setFeesIsDel(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("查询科目计量单位列表") | |||
| @GetMapping("feesCalcuteUnitList") | |||
| public ResultData typeCalcuteUnitList(Integer billType) { | |||
| List<EnumFeesStandardsCalcuteUnit> enumList = EnumBillAllType.getCalucuteUnites(billType); | |||
| if (null != enumList) { | |||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| for (int i = 0 ; i < enumList.size(); i++) { | |||
| EnumFeesStandardsCalcuteUnit cu = enumList.get(i); | |||
| retMap.put(cu.getCode(), cu.getMessage()); | |||
| } | |||
| return new ResultData(retMap); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("查询科目计算时间单位列表") | |||
| @GetMapping("feesTimeUnitList") | |||
| public ResultData typeTimeUnitList(Integer billType) { | |||
| List<EnumFeesStandardsTimeUnit> enumList = EnumBillAllType.getTimeUnites(billType); | |||
| if (null != enumList) { | |||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| for (int i = 0 ; i < enumList.size(); i++) { | |||
| EnumFeesStandardsTimeUnit cu = enumList.get(i); | |||
| retMap.put(cu.getCode(), cu.getMessage()); | |||
| } | |||
| return new ResultData(retMap); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| // @ApiOperation("查询科目计量单位列表") | |||
| // @GetMapping("feesCalcuteUnitList") | |||
| // public ResultData typeCalcuteUnitList(Integer billType) { | |||
| // List<EnumFeesStandardsCalcuteUnit> enumList = EnumBillAllType.getCalucuteUnites(billType); | |||
| // if (null != enumList) { | |||
| // Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| // for (int i = 0 ; i < enumList.size(); i++) { | |||
| // EnumFeesStandardsCalcuteUnit cu = enumList.get(i); | |||
| // retMap.put(cu.getCode(), cu.getMessage()); | |||
| // } | |||
| // return new ResultData(retMap); | |||
| // } | |||
| // return new ResultData(); | |||
| // } | |||
| // | |||
| // @ApiOperation("查询科目计算时间单位列表") | |||
| // @GetMapping("feesTimeUnitList") | |||
| // public ResultData typeTimeUnitList(Integer billType) { | |||
| // List<EnumFeesStandardsTimeUnit> enumList = EnumBillAllType.getTimeUnites(billType); | |||
| // if (null != enumList) { | |||
| // Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| // for (int i = 0 ; i < enumList.size(); i++) { | |||
| // EnumFeesStandardsTimeUnit cu = enumList.get(i); | |||
| // retMap.put(cu.getCode(), cu.getMessage()); | |||
| // } | |||
| // return new ResultData(retMap); | |||
| // } | |||
| // return new ResultData(); | |||
| // } | |||
| @ApiOperation("抄表数据分页列表接口") | |||
| @@ -1,104 +0,0 @@ | |||
| package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFeesStandardsCalcuteUnit; | |||
| import com.iformall.enums.EnumFeesStandardsTimeUnit; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxEnergyService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| /** | |||
| * 物业合同的其他费用 | |||
| * @author Administrator | |||
| * | |||
| */ | |||
| @RestController | |||
| @RequestMapping("feesStandars") | |||
| public class WxFeesStandardsController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxEnergyService wxEnergyService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData list(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| if (null == record) { | |||
| record = new WxEnergyFees(); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setBillType(EnumBillAllType.PROPERTY.getCode()); | |||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("查询物业合同费用标准列表") | |||
| @GetMapping("typeList") | |||
| public ResultData typeList() { | |||
| WxEnergyFees record = new WxEnergyFees(); | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setBillType(EnumBillAllType.PROPERTY.getCode()); | |||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| record.setIsSystem(EnumYesOrNo.NO.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, 1, 100,false); | |||
| if (null != page) { | |||
| return new ResultData(page.getList()); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("查询物业合同计量单位列表") | |||
| @GetMapping("typeCalcuteUnitList") | |||
| public ResultData typeCalcuteUnitList() { | |||
| List<EnumFeesStandardsCalcuteUnit> enumList = EnumBillAllType.getCalucuteUnites(EnumBillAllType.PROPERTY.getCode()); | |||
| if (null != enumList) { | |||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| for (int i = 0 ; i < enumList.size(); i++) { | |||
| EnumFeesStandardsCalcuteUnit cu = enumList.get(i); | |||
| retMap.put(cu.getCode(), cu.getMessage()); | |||
| } | |||
| return new ResultData(retMap); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("查询物业合同时间单位列表") | |||
| @GetMapping("typeTimeUnitList") | |||
| public ResultData typeTimeUnitList() { | |||
| List<EnumFeesStandardsTimeUnit> enumList = EnumBillAllType.getTimeUnites(EnumBillAllType.PROPERTY.getCode()); | |||
| if (null != enumList) { | |||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| for (int i = 0 ; i < enumList.size(); i++) { | |||
| EnumFeesStandardsTimeUnit cu = enumList.get(i); | |||
| retMap.put(cu.getCode(), cu.getMessage()); | |||
| } | |||
| return new ResultData(retMap); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -10,7 +10,7 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.SysConfig; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinanceCheckOut; | |||
| import com.iformall.domain.po.WxFinanceFinish; | |||
| import com.iformall.domain.po.WxFinanceFinishReceive; | |||
| @@ -28,7 +28,6 @@ import com.iformall.domain.vo.WxFinanceReceiveBillSum; | |||
| import com.iformall.domain.vo.WxFinanceReceiveCountVo; | |||
| import com.iformall.domain.vo.WxFinanceReceiveSumVo; | |||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFinanceCashierType; | |||
| import com.iformall.enums.EnumFinanceFinishStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| @@ -74,45 +73,45 @@ public class WxFinanceController extends BaseController { | |||
| @Autowired | |||
| WxFlowService wxFlowService; | |||
| /** | |||
| * 账单合同类型(可自定义的) | |||
| * @return | |||
| */ | |||
| @GetMapping("contractBillTypes") | |||
| public ResultData contractBillTypes() { | |||
| List<Map> list = new ArrayList<Map>(); | |||
| for (EnumBillAllType t : EnumBillAllType.values()) { | |||
| if (t == EnumBillAllType.RENT_DEPOSIT || t == EnumBillAllType.PROPERTY) { | |||
| Map m = new HashMap(); | |||
| m.put("id", t.getCode()); | |||
| m.put("name", t.getMessage()); | |||
| m.put("isFixedPrice", t.isFixedPrice()); | |||
| m.put("isDeposit", t.isDeposit()); | |||
| list.add(m); | |||
| } | |||
| } | |||
| return new ResultData(list); | |||
| } | |||
| /** | |||
| * 账单临时类型(可自定义的) | |||
| * @return | |||
| */ | |||
| @GetMapping("otherBillTypes") | |||
| public ResultData otherBillTypes() { | |||
| List<Map> list = new ArrayList<Map>(); | |||
| for (EnumBillAllType t : EnumBillAllType.values()) { | |||
| if (t == EnumBillAllType.OTHER || t == EnumBillAllType.OTHER_DEPOSIT) { | |||
| Map m = new HashMap(); | |||
| m.put("id", t.getCode()); | |||
| m.put("name", t.getMessage()); | |||
| m.put("isFixedPrice", t.isFixedPrice()); | |||
| m.put("isDeposit", t.isDeposit()); | |||
| list.add(m); | |||
| } | |||
| } | |||
| return new ResultData(list); | |||
| } | |||
| // /** | |||
| // * 账单合同类型(可自定义的) | |||
| // * @return | |||
| // */ | |||
| // @GetMapping("contractBillTypes") | |||
| // public ResultData contractBillTypes() { | |||
| // List<Map> list = new ArrayList<Map>(); | |||
| // for (EnumBillAllType t : EnumBillAllType.values()) { | |||
| // if (t == EnumBillAllType.RENT_DEPOSIT || t == EnumBillAllType.PROPERTY) { | |||
| // Map m = new HashMap(); | |||
| // m.put("id", t.getCode()); | |||
| // m.put("name", t.getMessage()); | |||
| // m.put("isFixedPrice", t.isFixedPrice()); | |||
| // m.put("isDeposit", t.isDeposit()); | |||
| // list.add(m); | |||
| // } | |||
| // } | |||
| // return new ResultData(list); | |||
| // } | |||
| // /** | |||
| // * 账单临时类型(可自定义的) | |||
| // * @return | |||
| // */ | |||
| // @GetMapping("otherBillTypes") | |||
| // public ResultData otherBillTypes() { | |||
| // List<Map> list = new ArrayList<Map>(); | |||
| // for (EnumBillAllType t : EnumBillAllType.values()) { | |||
| // if (t == EnumBillAllType.OTHER || t == EnumBillAllType.OTHER_DEPOSIT) { | |||
| // Map m = new HashMap(); | |||
| // m.put("id", t.getCode()); | |||
| // m.put("name", t.getMessage()); | |||
| // m.put("isFixedPrice", t.isFixedPrice()); | |||
| // m.put("isDeposit", t.isDeposit()); | |||
| // list.add(m); | |||
| // } | |||
| // } | |||
| // return new ResultData(list); | |||
| // } | |||
| @GetMapping("receiveCashierTypes") | |||
| public ResultData receiveCashierTypes() { | |||
| @@ -132,92 +131,73 @@ public class WxFinanceController extends BaseController { | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData contractFeesList(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| //查询非能源费用科目 | |||
| List<Integer> billTypeList = new ArrayList<Integer>(); | |||
| billTypeList.add(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| billTypeList.add(EnumBillAllType.PROPERTY.getCode()); | |||
| if (null != record.getIsAllList() && EnumYesOrNo.YES.getCode() == record.getIsAllList()) { | |||
| billTypeList.add(EnumBillAllType.RENT.getCode()); | |||
| billTypeList.add(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| billTypeList.add(EnumBillAllType.RENT_OPERATION_MANAGE.getCode()); | |||
| billTypeList.add(EnumBillAllType.PROPERTY_DEPOSIT.getCode()); | |||
| } | |||
| record.setBillTypeList(billTypeList); | |||
| record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("其他费用科目列表") | |||
| @GetMapping("otherFeesList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData otherFeesList(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| public ResultData contractFeesList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| //查询非能源费用科目 | |||
| List<Integer> billTypeList = new ArrayList<Integer>(); | |||
| billTypeList.add(EnumBillAllType.OTHER.getCode()); | |||
| billTypeList.add(EnumBillAllType.OTHER_DEPOSIT.getCode()); | |||
| record.setBillTypeList(billTypeList); | |||
| record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| //record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("预收科目列表") | |||
| @GetMapping("advanceFeesList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData advanceTypeList(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| record.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,true); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("临时付款科目列表") | |||
| @GetMapping("toPayMerchantFeesList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData toPayMerchantFeesList(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| record.setBillType(EnumBillAllType.TEMP_TO_PAYMERCHANT.getCode()); | |||
| record.setCashierType(EnumFinanceCashierType.PAY.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,true); | |||
| return new ResultData(page); | |||
| } | |||
| // @ApiOperation("其他费用科目列表") | |||
| // @GetMapping("otherFeesList") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| // }) | |||
| // public ResultData otherFeesList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||
| // record.updateTenantInfo(getTenantInfo()); | |||
| // record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| // record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| // PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| // return new ResultData(page); | |||
| // } | |||
| // | |||
| // @ApiOperation("预收科目列表") | |||
| // @GetMapping("advanceFeesList") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| // }) | |||
| // public ResultData advanceTypeList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||
| // record.updateTenantInfo(getTenantInfo()); | |||
| // record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| // record.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| // record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| // PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,true); | |||
| // return new ResultData(page); | |||
| // } | |||
| // | |||
| // @ApiOperation("临时付款科目列表") | |||
| // @GetMapping("toPayMerchantFeesList") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| // }) | |||
| // public ResultData toPayMerchantFeesList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||
| // record.updateTenantInfo(getTenantInfo()); | |||
| // record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| // record.setBillType(EnumBillAllType.TEMP_TO_PAYMERCHANT.getCode()); | |||
| // record.setCashierType(EnumFinanceCashierType.PAY.getCode()); | |||
| // PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,true); | |||
| // return new ResultData(page); | |||
| // } | |||
| @ApiOperation("费用区间列表") | |||
| @PostMapping("saveFees") | |||
| public ResultData saveFees(@RequestBody WxEnergyFees record) { | |||
| public ResultData saveFees(@RequestBody WxFinanceFees record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| if (null == record.getBillType()) { | |||
| return new ResultData(Result.ERROR,"请选择绑定账单类型"); | |||
| } | |||
| if (record.getBillType() == EnumBillAllType.RENT_DEPOSIT.getCode()) { | |||
| record.setIsDespoit(EnumYesOrNo.YES.getCode()); | |||
| record.setFixedPrice(EnumYesOrNo.YES.getCode()); | |||
| } | |||
| // if (record.getBillType() == EnumBillAllType.RENT_DEPOSIT.getCode()) { | |||
| // record.setIsDespoit(EnumYesOrNo.YES.getCode()); | |||
| // record.setFixedPrice(EnumYesOrNo.YES.getCode()); | |||
| // } | |||
| wxEnergyService.saveOrUpdateFees(record); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("feesUpdateIsDel") | |||
| public ResultData feesUpdateIsDel(@RequestBody WxEnergyFees record) { | |||
| public ResultData feesUpdateIsDel(@RequestBody WxFinanceFees record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxEnergyService.setFeesIsDel(record); | |||
| return new ResultData(); | |||
| @@ -254,10 +234,10 @@ public class WxFinanceController extends BaseController { | |||
| @ApiOperation("预收科目新增修改") | |||
| @PostMapping("saveAdvanceFees") | |||
| public ResultData saveAdvanceType(@RequestBody WxEnergyFees record) { | |||
| public ResultData saveAdvanceType(@RequestBody WxFinanceFees record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| record.setFixedPrice(EnumYesOrNo.YES.getCode()); | |||
| //record.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| //record.setFixedPrice(EnumYesOrNo.YES.getCode()); | |||
| wxEnergyService.saveOrUpdateFees(record); | |||
| return new ResultData(); | |||
| } | |||
| @@ -5,11 +5,10 @@ import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinancePrintData; | |||
| import com.iformall.domain.po.WxFinancePrintTemplate; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFinancePrintDataType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxFinancePrintService; | |||
| @@ -5,7 +5,6 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxSettleMerchant; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| @@ -16,9 +15,7 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxAgileContractService; | |||
| import com.iformall.service.WxAllBillService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentContractService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| import com.iformall.service.WxSettleMerchantService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -54,8 +51,6 @@ public class WxSettleMerchantController extends BaseController { | |||
| @Autowired | |||
| private WxAllBillService wxAllBillService; | |||
| @Autowired | |||
| WxPropertyContractService wxPropertyContractService; | |||
| @Autowired | |||
| WxAgileContractService wxAgileContractService; | |||
| @ApiOperation("分页列表接口") | |||
| @@ -217,22 +212,23 @@ public class WxSettleMerchantController extends BaseController { | |||
| return new ResultData(Result.ERROR,"未查询到合同"); | |||
| } | |||
| //查询计租中的合同 | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||
| wxPropertyContract.setIds(contractIds); | |||
| wxPropertyContract.setStatus(EnumRentContractStatus.PAING.getCode()); | |||
| List<WxPropertyContract> rlist = wxPropertyContractService.findList(wxPropertyContract); | |||
| if (null == rlist || rlist.size() <= 0 ) { | |||
| return new ResultData(Result.ERROR,"无计租中物业合同"); | |||
| } | |||
| WxPropertyContract property = rlist.get(0); | |||
| WxAllBill br = new WxAllBill(); | |||
| br.setShopIdList(shopIds); | |||
| br.setPropertyContractId(property.getId()); | |||
| br.setStarttime(wxSettleMerchant.getBeginTime()); | |||
| br.setEndtime(wxSettleMerchant.getEndTime()); | |||
| PageInfo<WxAllBill> blist = wxAllBillService.listAsPage(br,1, 10000); | |||
| // WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| // wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||
| // wxPropertyContract.setIds(contractIds); | |||
| // wxPropertyContract.setStatus(EnumRentContractStatus.PAING.getCode()); | |||
| // List<WxPropertyContract> rlist = wxPropertyContractService.findList(wxPropertyContract); | |||
| // if (null == rlist || rlist.size() <= 0 ) { | |||
| // return new ResultData(Result.ERROR,"无计租中物业合同"); | |||
| // } | |||
| // WxPropertyContract property = rlist.get(0); | |||
| // WxAllBill br = new WxAllBill(); | |||
| // br.setShopIdList(shopIds); | |||
| // br.setPropertyContractId(property.getId()); | |||
| // br.setStarttime(wxSettleMerchant.getBeginTime()); | |||
| // br.setEndtime(wxSettleMerchant.getEndTime()); | |||
| // | |||
| // PageInfo<WxAllBill> blist = wxAllBillService.listAsPage(br,1, 10000); | |||
| PageInfo<WxAllBill> blist = null; | |||
| if (null == blist || null == blist.getList() || blist.getList().size() <= 0 ) { | |||
| return new ResultData(Result.ERROR,"物业合同无对应账单"); | |||
| } | |||
| @@ -246,8 +242,8 @@ public class WxSettleMerchantController extends BaseController { | |||
| all = all.add(new BigDecimal(_np)); | |||
| } | |||
| Map retMap = new HashMap(); | |||
| retMap.put("property", property); | |||
| retMap.put("money", all.setScale(property.getDecimalSize(),BigDecimal.ROUND_HALF_UP)); | |||
| //retMap.put("property", property); | |||
| //retMap.put("money", all.setScale(property.getDecimalSize(),BigDecimal.ROUND_HALF_UP)); | |||
| return new ResultData(retMap); | |||
| } | |||
| @@ -16,7 +16,7 @@ import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.domain.po.WxShop; | |||
| @@ -30,7 +30,6 @@ import com.iformall.domain.vo.WxBillHotNotify; | |||
| import com.iformall.domain.vo.WxBillJianMian; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import com.iformall.domain.vo.WxShopBillVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillOweOrNearType; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| import com.iformall.enums.EnumCouponType; | |||
| @@ -301,9 +300,9 @@ public class WxAllBillController extends BillBaseController { | |||
| return null; | |||
| } | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(wxShop); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| BigDecimal needpay = new BigDecimal(0); | |||
| BigDecimal paid = new BigDecimal(0); | |||
| BigDecimal owe = new BigDecimal(0); | |||
| @@ -311,7 +310,7 @@ public class WxAllBillController extends BillBaseController { | |||
| for (int i = 0 ; i < sumList.size() ; i ++) { | |||
| WxBillSum s = sumList.get(i); | |||
| if (null != s.getEnergyFeesId() && null != feesMap) { | |||
| WxEnergyFees fees = feesMap.get(s.getEnergyFeesId()); | |||
| WxFinanceFees fees = feesMap.get(s.getEnergyFeesId()); | |||
| if (null != fees) { | |||
| s.setBillName(fees.getName()); | |||
| s.setEnergyFeesName(fees.getName()); | |||
| @@ -352,16 +351,16 @@ public class WxAllBillController extends BillBaseController { | |||
| * 账单类型 | |||
| * @return | |||
| */ | |||
| @GetMapping("billTypes") | |||
| public ResultData billTypes() { | |||
| Map<Integer,String> tmap = new HashMap<Integer,String>(); | |||
| for (EnumBillAllType t : EnumBillAllType.values()) { | |||
| if (t != EnumBillAllType.ADVANCE) { | |||
| tmap.put(t.getCode(), t.getMessage()); | |||
| } | |||
| } | |||
| return new ResultData(tmap); | |||
| } | |||
| // @GetMapping("billTypes") | |||
| // public ResultData billTypes() { | |||
| // Map<Integer,String> tmap = new HashMap<Integer,String>(); | |||
| // for (EnumBillAllType t : EnumBillAllType.values()) { | |||
| // if (t != EnumBillAllType.ADVANCE) { | |||
| // tmap.put(t.getCode(), t.getMessage()); | |||
| // } | |||
| // } | |||
| // return new ResultData(tmap); | |||
| // } | |||
| /** | |||
| * 账单查询范围 | |||
| @@ -395,10 +394,10 @@ public class WxAllBillController extends BillBaseController { | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData feesList(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| public ResultData feesList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -408,16 +407,11 @@ public class WxAllBillController extends BillBaseController { | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData otherFeesList(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| public ResultData otherFeesList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| List<Integer> typeList = new ArrayList<Integer>(); | |||
| typeList.add(EnumBillAllType.OTHER.getCode()); | |||
| typeList.add(EnumBillAllType.OTHER_DEPOSIT.getCode()); | |||
| typeList.add(EnumBillAllType.ADVANCE.getCode()); | |||
| record.setBillTypeList(typeList); | |||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -592,9 +586,9 @@ public class WxAllBillController extends BillBaseController { | |||
| public ResultData notify(@RequestBody WxBillPayDTO dto) { | |||
| dto.updateTenantInfo(getTenantInfo()); | |||
| //如果是管理费,默认一个商业管理费 | |||
| if (dto.getBillTypeValue().intValue() == Constant.bill_all_type_manage_fee) { | |||
| dto.setBillTypeValue(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| } | |||
| // if (dto.getBillTypeValue().intValue() == Constant.bill_all_type_manage_fee) { | |||
| // dto.setBillTypeValue(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| // } | |||
| billAllHelper.notify(dto, getUser()); | |||
| return new ResultData(); | |||
| } | |||
| @@ -603,9 +597,9 @@ public class WxAllBillController extends BillBaseController { | |||
| public ResultData updateReceivePay(@RequestBody WxBillReceiveUpdateDTO dto) { | |||
| dto.updateTenantInfo(getTenantInfo()); | |||
| //如果是管理费,默认一个商业管理费 | |||
| if (dto.getBillTypeValue().intValue() == Constant.bill_all_type_manage_fee) { | |||
| dto.setBillTypeValue(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| } | |||
| // if (dto.getBillTypeValue().intValue() == Constant.bill_all_type_manage_fee) { | |||
| // dto.setBillTypeValue(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| // } | |||
| billAllHelper.updateReceivePay(dto, getUser(), false); | |||
| return new ResultData(); | |||
| //return wxBillAllService.updateReceivePay(wxBillAll, getUser(),false); | |||
| @@ -615,9 +609,9 @@ public class WxAllBillController extends BillBaseController { | |||
| public ResultData pay(@RequestBody WxBillPayDTO dto) { | |||
| dto.updateTenantInfo(getTenantInfo()); | |||
| //如果是管理费,默认一个商业管理费 | |||
| if (dto.getBillTypeValue().intValue() == Constant.bill_all_type_manage_fee) { | |||
| dto.setBillTypeValue(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| } | |||
| // if (dto.getBillTypeValue().intValue() == Constant.bill_all_type_manage_fee) { | |||
| // dto.setBillTypeValue(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| // } | |||
| WxBillPayWay payWay = wxFinanceService.getPayWayById(dto, dto.getPayWay()); | |||
| if (null == payWay) { | |||
| return new ResultData(Result.ERROR,"支付方式未查询到"); | |||
| @@ -631,45 +625,45 @@ public class WxAllBillController extends BillBaseController { | |||
| //减免统计 | |||
| @GetMapping("jianmiantj") | |||
| public ResultData jianmiantj(@ModelAttribute WxBillAction wxBillAction) { | |||
| wxBillAction.updateTenantInfo(getTenantInfo()); | |||
| List<WxBillJianMian> jList = wxBillActionService.findJianMian(wxBillAction); | |||
| Map<Integer,String> map = new HashMap<Integer,String>(); | |||
| if (null != jList && jList.size() > 0 ) { | |||
| for (int i = 0 ; i < jList.size() ; i++) { | |||
| WxBillJianMian jm = jList.get(i); | |||
| map.put(jm.getBillType(), jm.getTotal()); | |||
| } | |||
| } | |||
| Map retMap = new HashMap(); | |||
| BigDecimal total = new BigDecimal("0.00"); | |||
| List<WxBillJianMian> retList = new ArrayList<WxBillJianMian>(); | |||
| for (EnumBillAllType at : EnumBillAllType.values()) { | |||
| String money = map.get(at.getCode()); | |||
| if (StringUtils.isBlank(money)) { | |||
| money = "0.00"; | |||
| } | |||
| WxBillJianMian bjm = new WxBillJianMian(); | |||
| bjm.setBillType(at.getCode()); | |||
| bjm.setTotal(money); | |||
| retList.add(bjm); | |||
| total = total.add(new BigDecimal(money)); | |||
| } | |||
| retMap.put("total", total.toPlainString()); | |||
| retMap.put("list", retList); | |||
| return new ResultData(retMap); | |||
| } | |||
| // @GetMapping("jianmiantj") | |||
| // public ResultData jianmiantj(@ModelAttribute WxBillAction wxBillAction) { | |||
| // wxBillAction.updateTenantInfo(getTenantInfo()); | |||
| // List<WxBillJianMian> jList = wxBillActionService.findJianMian(wxBillAction); | |||
| // Map<Integer,String> map = new HashMap<Integer,String>(); | |||
| // if (null != jList && jList.size() > 0 ) { | |||
| // for (int i = 0 ; i < jList.size() ; i++) { | |||
| // WxBillJianMian jm = jList.get(i); | |||
| // map.put(jm.getBillType(), jm.getTotal()); | |||
| // } | |||
| // } | |||
| // Map retMap = new HashMap(); | |||
| // BigDecimal total = new BigDecimal("0.00"); | |||
| // List<WxBillJianMian> retList = new ArrayList<WxBillJianMian>(); | |||
| // for (EnumBillAllType at : EnumBillAllType.values()) { | |||
| // String money = map.get(at.getCode()); | |||
| // if (StringUtils.isBlank(money)) { | |||
| // money = "0.00"; | |||
| // } | |||
| // WxBillJianMian bjm = new WxBillJianMian(); | |||
| // bjm.setBillType(at.getCode()); | |||
| // bjm.setTotal(money); | |||
| // retList.add(bjm); | |||
| // total = total.add(new BigDecimal(money)); | |||
| // } | |||
| // | |||
| // retMap.put("total", total.toPlainString()); | |||
| // retMap.put("list", retList); | |||
| // return new ResultData(retMap); | |||
| // } | |||
| //坏账 | |||
| @PostMapping("bad") | |||
| public ResultData bad(@RequestBody WxBillPayDTO dto) { | |||
| dto.updateTenantInfo(getTenantInfo()); | |||
| //如果是管理费,默认一个商业管理费 | |||
| if (dto.getBillTypeValue().intValue() == Constant.bill_all_type_manage_fee) { | |||
| dto.setBillTypeValue(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| } | |||
| // if (dto.getBillTypeValue().intValue() == Constant.bill_all_type_manage_fee) { | |||
| // dto.setBillTypeValue(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| // } | |||
| billAllHelper.bad(dto, getUser()); | |||
| return new ResultData(); | |||
| //return wxBillAllService.updateReceivePay(wxBillAll, getUser(),false); | |||
| @@ -745,9 +739,9 @@ public class WxAllBillController extends BillBaseController { | |||
| List<WxAllBill> list = billAllHelper.getMerchantBillList(wxShop); | |||
| if (null != list && list.size() > 0 ) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(wxShop); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < list.size(); i++) { | |||
| WxAllBill be = list.get(i); | |||
| if (null != shopMap) { | |||
| @@ -758,7 +752,7 @@ public class WxAllBillController extends BillBaseController { | |||
| } | |||
| if (null != feesMap) { | |||
| WxEnergyFees fees = feesMap.get(be.getEnergyFeesId()); | |||
| WxFinanceFees fees = feesMap.get(be.getEnergyFeesId()); | |||
| if (null != fees) { | |||
| be.setEnergyFeesName(fees.getName()); | |||
| } | |||
| @@ -816,9 +810,9 @@ public class WxAllBillController extends BillBaseController { | |||
| Map<Long, WxShop> shopMap = wxShopSerivce.findShopMap(sq); | |||
| if (null != list && list.size() > 0 ) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(wxShop); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < list.size(); i++) { | |||
| WxAllBill be = list.get(i); | |||
| if (null != shopMap) { | |||
| @@ -828,7 +822,7 @@ public class WxAllBillController extends BillBaseController { | |||
| } | |||
| } | |||
| if (null != feesMap) { | |||
| WxEnergyFees fees = feesMap.get(be.getEnergyFeesId()); | |||
| WxFinanceFees fees = feesMap.get(be.getEnergyFeesId()); | |||
| if (null != fees) { | |||
| be.setEnergyFeesName(fees.getName()); | |||
| } | |||
| @@ -1,7 +1,6 @@ | |||
| package com.iformall.flowable; | |||
| import com.iformall.service.WxFlowService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import org.flowable.engine.delegate.TaskListener; | |||
| import org.flowable.task.service.delegate.DelegateTask; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -15,8 +14,6 @@ import org.springframework.stereotype.Component; | |||
| public class ContractTaskFinishHandler implements TaskListener { | |||
| @Autowired | |||
| private WxFlowService wxFlowService; | |||
| @Autowired | |||
| private WxPropertyContractService wxPropertyContractService; | |||
| @Override | |||
| public void notify(DelegateTask delegateTask) { | |||
| @@ -0,0 +1,872 @@ | |||
| alter table wx_rent_contract drop column adjust_period; | |||
| alter table wx_rent_contract drop column operation_type; | |||
| alter table wx_rent_contract drop column cashtype_lsit; | |||
| alter table wx_rent_contract drop column adjust_ratio; | |||
| alter table wx_rent_contract drop column revenue_ratio_set; | |||
| alter table wx_rent_contract drop column pay_ratio; | |||
| alter table wx_rent_contract drop column revenue; | |||
| alter table wx_rent_contract drop column limit_revenue; | |||
| alter table wx_rent_contract drop column revenue_fixed_rent_price; | |||
| alter table wx_rent_contract drop column revenue_rent_price; | |||
| alter table wx_rent_contract drop column revenue_minimum_method; | |||
| alter table wx_rent_contract drop column revenue_ratio; | |||
| alter table wx_rent_contract drop column business_type; | |||
| alter table wx_rent_contract drop column filename; | |||
| alter table wx_rent_contract drop column price_unit; | |||
| alter table wx_rent_contract drop column rent_price; | |||
| alter table wx_rent_contract drop column price_detail; | |||
| alter table wx_rent_contract drop column other_rent_price_info; | |||
| alter table wx_rent_contract drop column subject_name; | |||
| alter table wx_rent_contract drop column rent_start_type; | |||
| alter table wx_rent_contract drop column rent_input_way; | |||
| alter table wx_rent_contract drop column adjust_ratio_way; | |||
| alter table wx_rent_contract drop column revenue_ratio_way; | |||
| alter table wx_rent_contract drop column late_pay_ratio; | |||
| alter table wx_rent_contract drop column late_pay_day; | |||
| alter table wx_rent_contract drop column bussiness_management_fee; | |||
| alter table wx_rent_contract drop column bussiness_management_fee_ratio_way; | |||
| alter table wx_rent_contract drop column bussiness_management_fee_ratio; | |||
| alter table wx_rent_contract drop column operating_management_fee; | |||
| alter table wx_rent_contract drop column operating_management_fee_ratio_way; | |||
| alter table wx_rent_contract drop column operating_management_fee_ratio; | |||
| alter table wx_rent_contract drop column out_date_notify_days; | |||
| alter table wx_rent_contract drop column out_date_notify_phone; | |||
| alter table wx_rent_contract drop column despoit; | |||
| alter table wx_rent_contract drop column price; | |||
| alter table wx_rent_contract drop column first_bill_date_start; | |||
| alter table wx_rent_contract drop column first_bill_date_end; | |||
| alter table wx_rent_contract drop column first_bill_receive_date; | |||
| alter table wx_rent_contract drop column agile_type; | |||
| alter table wx_energy_fees_0 drop column type; | |||
| alter table wx_energy_fees_0 drop column bill_type; | |||
| alter table wx_energy_fees_0 drop column is_public; | |||
| alter table wx_energy_fees_0 drop column is_system; | |||
| alter table wx_energy_fees_0 drop column price; | |||
| alter table wx_energy_fees_0 drop column fixed_price; | |||
| alter table wx_energy_fees_0 drop column calcute_unit; | |||
| alter table wx_energy_fees_0 drop column time_unit; | |||
| alter table wx_energy_fees_0 drop column cashier_type; | |||
| alter table wx_energy_fees_0 add column fees_type int(1) comment '类型'; | |||
| CREATE TABLE wx_finance_fees LIKE wx_energy_fees_0; | |||
| drop table wx_energy_fees_0 ; | |||
| drop table wx_energy_fees_1 ; | |||
| drop table wx_energy_fees_2 ; | |||
| drop table wx_energy_fees_3 ; | |||
| drop table wx_energy_fees_4 ; | |||
| drop table wx_energy_fees_5 ; | |||
| drop table wx_energy_fees_6 ; | |||
| drop table wx_energy_fees_7 ; | |||
| drop table wx_energy_fees_8 ; | |||
| drop table wx_energy_fees_9 ; | |||
| drop table wx_energy_fees_10 ; | |||
| drop table wx_energy_fees_11 ; | |||
| drop table wx_energy_fees_12 ; | |||
| drop table wx_energy_fees_13 ; | |||
| drop table wx_energy_fees_14 ; | |||
| drop table wx_energy_fees_15 ; | |||
| drop table wx_energy_fees_16 ; | |||
| drop table wx_energy_fees_17 ; | |||
| drop table wx_energy_fees_18 ; | |||
| drop table wx_energy_fees_19 ; | |||
| drop table wx_energy_fees_20 ; | |||
| drop table wx_energy_fees_21 ; | |||
| drop table wx_energy_fees_22 ; | |||
| drop table wx_energy_fees_23 ; | |||
| drop table wx_energy_fees_24 ; | |||
| drop table wx_energy_fees_25 ; | |||
| drop table wx_energy_fees_26 ; | |||
| drop table wx_energy_fees_27 ; | |||
| drop table wx_energy_fees_28 ; | |||
| drop table wx_energy_fees_29 ; | |||
| drop table wx_energy_fees_30 ; | |||
| drop table wx_energy_fees_31 ; | |||
| drop table wx_energy_fees_32 ; | |||
| drop table wx_energy_fees_33 ; | |||
| drop table wx_energy_fees_34 ; | |||
| drop table wx_energy_fees_35 ; | |||
| drop table wx_energy_fees_36 ; | |||
| drop table wx_energy_fees_37 ; | |||
| drop table wx_energy_fees_38 ; | |||
| drop table wx_energy_fees_39 ; | |||
| drop table wx_energy_fees_40 ; | |||
| drop table wx_energy_fees_41 ; | |||
| drop table wx_energy_fees_42 ; | |||
| drop table wx_energy_fees_43 ; | |||
| drop table wx_energy_fees_44 ; | |||
| drop table wx_energy_fees_45 ; | |||
| drop table wx_energy_fees_46 ; | |||
| drop table wx_energy_fees_47 ; | |||
| drop table wx_energy_fees_48 ; | |||
| drop table wx_energy_fees_49 ; | |||
| drop table wx_energy_fees_50 ; | |||
| drop table wx_energy_fees_51 ; | |||
| drop table wx_energy_fees_52 ; | |||
| drop table wx_energy_fees_53 ; | |||
| drop table wx_energy_fees_54 ; | |||
| drop table wx_energy_fees_55 ; | |||
| drop table wx_energy_fees_56 ; | |||
| drop table wx_energy_fees_57 ; | |||
| drop table wx_energy_fees_58 ; | |||
| drop table wx_energy_fees_59 ; | |||
| drop table wx_energy_fees_60 ; | |||
| drop table wx_energy_fees_61 ; | |||
| drop table wx_energy_fees_62 ; | |||
| drop table wx_energy_fees_63 ; | |||
| drop table wx_energy_fees_64 ; | |||
| drop table wx_energy_fees_65 ; | |||
| drop table wx_energy_fees_66 ; | |||
| drop table wx_energy_fees_67 ; | |||
| drop table wx_energy_fees_68 ; | |||
| drop table wx_energy_fees_69 ; | |||
| drop table wx_energy_fees_70 ; | |||
| drop table wx_energy_fees_71 ; | |||
| drop table wx_energy_fees_72 ; | |||
| drop table wx_energy_fees_73 ; | |||
| drop table wx_energy_fees_74 ; | |||
| drop table wx_energy_fees_75 ; | |||
| drop table wx_energy_fees_76 ; | |||
| drop table wx_energy_fees_77 ; | |||
| drop table wx_energy_fees_78 ; | |||
| drop table wx_energy_fees_79 ; | |||
| drop table wx_energy_fees_80 ; | |||
| drop table wx_energy_fees_81 ; | |||
| drop table wx_energy_fees_82 ; | |||
| drop table wx_energy_fees_83 ; | |||
| drop table wx_energy_fees_84 ; | |||
| drop table wx_energy_fees_85 ; | |||
| drop table wx_energy_fees_86 ; | |||
| drop table wx_energy_fees_87 ; | |||
| drop table wx_energy_fees_88 ; | |||
| drop table wx_energy_fees_89 ; | |||
| drop table wx_energy_fees_90 ; | |||
| drop table wx_energy_fees_91 ; | |||
| drop table wx_energy_fees_92 ; | |||
| drop table wx_energy_fees_93 ; | |||
| drop table wx_energy_fees_94 ; | |||
| drop table wx_energy_fees_95 ; | |||
| drop table wx_energy_fees_96 ; | |||
| drop table wx_energy_fees_97 ; | |||
| drop table wx_energy_fees_98 ; | |||
| drop table wx_energy_fees_99 ; | |||
| create table wx_finance_fees_0 like wx_finance_fees; | |||
| create table wx_finance_fees_1 like wx_finance_fees; | |||
| create table wx_finance_fees_2 like wx_finance_fees; | |||
| create table wx_finance_fees_3 like wx_finance_fees; | |||
| create table wx_finance_fees_4 like wx_finance_fees; | |||
| create table wx_finance_fees_5 like wx_finance_fees; | |||
| create table wx_finance_fees_6 like wx_finance_fees; | |||
| create table wx_finance_fees_7 like wx_finance_fees; | |||
| create table wx_finance_fees_8 like wx_finance_fees; | |||
| create table wx_finance_fees_9 like wx_finance_fees; | |||
| create table wx_finance_fees_10 like wx_finance_fees; | |||
| create table wx_finance_fees_11 like wx_finance_fees; | |||
| create table wx_finance_fees_12 like wx_finance_fees; | |||
| create table wx_finance_fees_13 like wx_finance_fees; | |||
| create table wx_finance_fees_14 like wx_finance_fees; | |||
| create table wx_finance_fees_15 like wx_finance_fees; | |||
| create table wx_finance_fees_16 like wx_finance_fees; | |||
| create table wx_finance_fees_17 like wx_finance_fees; | |||
| create table wx_finance_fees_18 like wx_finance_fees; | |||
| create table wx_finance_fees_19 like wx_finance_fees; | |||
| create table wx_finance_fees_20 like wx_finance_fees; | |||
| create table wx_finance_fees_21 like wx_finance_fees; | |||
| create table wx_finance_fees_22 like wx_finance_fees; | |||
| create table wx_finance_fees_23 like wx_finance_fees; | |||
| create table wx_finance_fees_24 like wx_finance_fees; | |||
| create table wx_finance_fees_25 like wx_finance_fees; | |||
| create table wx_finance_fees_26 like wx_finance_fees; | |||
| create table wx_finance_fees_27 like wx_finance_fees; | |||
| create table wx_finance_fees_28 like wx_finance_fees; | |||
| create table wx_finance_fees_29 like wx_finance_fees; | |||
| create table wx_finance_fees_30 like wx_finance_fees; | |||
| create table wx_finance_fees_31 like wx_finance_fees; | |||
| create table wx_finance_fees_32 like wx_finance_fees; | |||
| create table wx_finance_fees_33 like wx_finance_fees; | |||
| create table wx_finance_fees_34 like wx_finance_fees; | |||
| create table wx_finance_fees_35 like wx_finance_fees; | |||
| create table wx_finance_fees_36 like wx_finance_fees; | |||
| create table wx_finance_fees_37 like wx_finance_fees; | |||
| create table wx_finance_fees_38 like wx_finance_fees; | |||
| create table wx_finance_fees_39 like wx_finance_fees; | |||
| create table wx_finance_fees_40 like wx_finance_fees; | |||
| create table wx_finance_fees_41 like wx_finance_fees; | |||
| create table wx_finance_fees_42 like wx_finance_fees; | |||
| create table wx_finance_fees_43 like wx_finance_fees; | |||
| create table wx_finance_fees_44 like wx_finance_fees; | |||
| create table wx_finance_fees_45 like wx_finance_fees; | |||
| create table wx_finance_fees_46 like wx_finance_fees; | |||
| create table wx_finance_fees_47 like wx_finance_fees; | |||
| create table wx_finance_fees_48 like wx_finance_fees; | |||
| create table wx_finance_fees_49 like wx_finance_fees; | |||
| create table wx_finance_fees_50 like wx_finance_fees; | |||
| create table wx_finance_fees_51 like wx_finance_fees; | |||
| create table wx_finance_fees_52 like wx_finance_fees; | |||
| create table wx_finance_fees_53 like wx_finance_fees; | |||
| create table wx_finance_fees_54 like wx_finance_fees; | |||
| create table wx_finance_fees_55 like wx_finance_fees; | |||
| create table wx_finance_fees_56 like wx_finance_fees; | |||
| create table wx_finance_fees_57 like wx_finance_fees; | |||
| create table wx_finance_fees_58 like wx_finance_fees; | |||
| create table wx_finance_fees_59 like wx_finance_fees; | |||
| create table wx_finance_fees_60 like wx_finance_fees; | |||
| create table wx_finance_fees_61 like wx_finance_fees; | |||
| create table wx_finance_fees_62 like wx_finance_fees; | |||
| create table wx_finance_fees_63 like wx_finance_fees; | |||
| create table wx_finance_fees_64 like wx_finance_fees; | |||
| create table wx_finance_fees_65 like wx_finance_fees; | |||
| create table wx_finance_fees_66 like wx_finance_fees; | |||
| create table wx_finance_fees_67 like wx_finance_fees; | |||
| create table wx_finance_fees_68 like wx_finance_fees; | |||
| create table wx_finance_fees_69 like wx_finance_fees; | |||
| create table wx_finance_fees_70 like wx_finance_fees; | |||
| create table wx_finance_fees_71 like wx_finance_fees; | |||
| create table wx_finance_fees_72 like wx_finance_fees; | |||
| create table wx_finance_fees_73 like wx_finance_fees; | |||
| create table wx_finance_fees_74 like wx_finance_fees; | |||
| create table wx_finance_fees_75 like wx_finance_fees; | |||
| create table wx_finance_fees_76 like wx_finance_fees; | |||
| create table wx_finance_fees_77 like wx_finance_fees; | |||
| create table wx_finance_fees_78 like wx_finance_fees; | |||
| create table wx_finance_fees_79 like wx_finance_fees; | |||
| create table wx_finance_fees_80 like wx_finance_fees; | |||
| create table wx_finance_fees_81 like wx_finance_fees; | |||
| create table wx_finance_fees_82 like wx_finance_fees; | |||
| create table wx_finance_fees_83 like wx_finance_fees; | |||
| create table wx_finance_fees_84 like wx_finance_fees; | |||
| create table wx_finance_fees_85 like wx_finance_fees; | |||
| create table wx_finance_fees_86 like wx_finance_fees; | |||
| create table wx_finance_fees_87 like wx_finance_fees; | |||
| create table wx_finance_fees_88 like wx_finance_fees; | |||
| create table wx_finance_fees_89 like wx_finance_fees; | |||
| create table wx_finance_fees_90 like wx_finance_fees; | |||
| create table wx_finance_fees_91 like wx_finance_fees; | |||
| create table wx_finance_fees_92 like wx_finance_fees; | |||
| create table wx_finance_fees_93 like wx_finance_fees; | |||
| create table wx_finance_fees_94 like wx_finance_fees; | |||
| create table wx_finance_fees_95 like wx_finance_fees; | |||
| create table wx_finance_fees_96 like wx_finance_fees; | |||
| create table wx_finance_fees_97 like wx_finance_fees; | |||
| create table wx_finance_fees_98 like wx_finance_fees; | |||
| create table wx_finance_fees_99 like wx_finance_fees; | |||
| alter table wx_bill_action_0 drop column bill_type; | |||
| alter table wx_bill_action_1 drop column bill_type; | |||
| alter table wx_bill_action_2 drop column bill_type; | |||
| alter table wx_bill_action_3 drop column bill_type; | |||
| alter table wx_bill_action_4 drop column bill_type; | |||
| alter table wx_bill_action_5 drop column bill_type; | |||
| alter table wx_bill_action_6 drop column bill_type; | |||
| alter table wx_bill_action_7 drop column bill_type; | |||
| alter table wx_bill_action_8 drop column bill_type; | |||
| alter table wx_bill_action_9 drop column bill_type; | |||
| alter table wx_bill_action_10 drop column bill_type; | |||
| alter table wx_bill_action_11 drop column bill_type; | |||
| alter table wx_bill_action_12 drop column bill_type; | |||
| alter table wx_bill_action_13 drop column bill_type; | |||
| alter table wx_bill_action_14 drop column bill_type; | |||
| alter table wx_bill_action_15 drop column bill_type; | |||
| alter table wx_bill_action_16 drop column bill_type; | |||
| alter table wx_bill_action_17 drop column bill_type; | |||
| alter table wx_bill_action_18 drop column bill_type; | |||
| alter table wx_bill_action_19 drop column bill_type; | |||
| alter table wx_bill_action_20 drop column bill_type; | |||
| alter table wx_bill_action_21 drop column bill_type; | |||
| alter table wx_bill_action_22 drop column bill_type; | |||
| alter table wx_bill_action_23 drop column bill_type; | |||
| alter table wx_bill_action_24 drop column bill_type; | |||
| alter table wx_bill_action_25 drop column bill_type; | |||
| alter table wx_bill_action_26 drop column bill_type; | |||
| alter table wx_bill_action_27 drop column bill_type; | |||
| alter table wx_bill_action_28 drop column bill_type; | |||
| alter table wx_bill_action_29 drop column bill_type; | |||
| alter table wx_bill_action_30 drop column bill_type; | |||
| alter table wx_bill_action_31 drop column bill_type; | |||
| alter table wx_bill_action_32 drop column bill_type; | |||
| alter table wx_bill_action_33 drop column bill_type; | |||
| alter table wx_bill_action_34 drop column bill_type; | |||
| alter table wx_bill_action_35 drop column bill_type; | |||
| alter table wx_bill_action_36 drop column bill_type; | |||
| alter table wx_bill_action_37 drop column bill_type; | |||
| alter table wx_bill_action_38 drop column bill_type; | |||
| alter table wx_bill_action_39 drop column bill_type; | |||
| alter table wx_bill_action_40 drop column bill_type; | |||
| alter table wx_bill_action_41 drop column bill_type; | |||
| alter table wx_bill_action_42 drop column bill_type; | |||
| alter table wx_bill_action_43 drop column bill_type; | |||
| alter table wx_bill_action_44 drop column bill_type; | |||
| alter table wx_bill_action_45 drop column bill_type; | |||
| alter table wx_bill_action_46 drop column bill_type; | |||
| alter table wx_bill_action_47 drop column bill_type; | |||
| alter table wx_bill_action_48 drop column bill_type; | |||
| alter table wx_bill_action_49 drop column bill_type; | |||
| alter table wx_bill_action_50 drop column bill_type; | |||
| alter table wx_bill_action_51 drop column bill_type; | |||
| alter table wx_bill_action_52 drop column bill_type; | |||
| alter table wx_bill_action_53 drop column bill_type; | |||
| alter table wx_bill_action_54 drop column bill_type; | |||
| alter table wx_bill_action_55 drop column bill_type; | |||
| alter table wx_bill_action_56 drop column bill_type; | |||
| alter table wx_bill_action_57 drop column bill_type; | |||
| alter table wx_bill_action_58 drop column bill_type; | |||
| alter table wx_bill_action_59 drop column bill_type; | |||
| alter table wx_bill_action_60 drop column bill_type; | |||
| alter table wx_bill_action_61 drop column bill_type; | |||
| alter table wx_bill_action_62 drop column bill_type; | |||
| alter table wx_bill_action_63 drop column bill_type; | |||
| alter table wx_bill_action_64 drop column bill_type; | |||
| alter table wx_bill_action_65 drop column bill_type; | |||
| alter table wx_bill_action_66 drop column bill_type; | |||
| alter table wx_bill_action_67 drop column bill_type; | |||
| alter table wx_bill_action_68 drop column bill_type; | |||
| alter table wx_bill_action_69 drop column bill_type; | |||
| alter table wx_bill_action_70 drop column bill_type; | |||
| alter table wx_bill_action_71 drop column bill_type; | |||
| alter table wx_bill_action_72 drop column bill_type; | |||
| alter table wx_bill_action_73 drop column bill_type; | |||
| alter table wx_bill_action_74 drop column bill_type; | |||
| alter table wx_bill_action_75 drop column bill_type; | |||
| alter table wx_bill_action_76 drop column bill_type; | |||
| alter table wx_bill_action_77 drop column bill_type; | |||
| alter table wx_bill_action_78 drop column bill_type; | |||
| alter table wx_bill_action_79 drop column bill_type; | |||
| alter table wx_bill_action_80 drop column bill_type; | |||
| alter table wx_bill_action_81 drop column bill_type; | |||
| alter table wx_bill_action_82 drop column bill_type; | |||
| alter table wx_bill_action_83 drop column bill_type; | |||
| alter table wx_bill_action_84 drop column bill_type; | |||
| alter table wx_bill_action_85 drop column bill_type; | |||
| alter table wx_bill_action_86 drop column bill_type; | |||
| alter table wx_bill_action_87 drop column bill_type; | |||
| alter table wx_bill_action_88 drop column bill_type; | |||
| alter table wx_bill_action_89 drop column bill_type; | |||
| alter table wx_bill_action_90 drop column bill_type; | |||
| alter table wx_bill_action_91 drop column bill_type; | |||
| alter table wx_bill_action_92 drop column bill_type; | |||
| alter table wx_bill_action_93 drop column bill_type; | |||
| alter table wx_bill_action_94 drop column bill_type; | |||
| alter table wx_bill_action_95 drop column bill_type; | |||
| alter table wx_bill_action_96 drop column bill_type; | |||
| alter table wx_bill_action_97 drop column bill_type; | |||
| alter table wx_bill_action_98 drop column bill_type; | |||
| alter table wx_bill_action_99 drop column bill_type; | |||
| rename table wx_energy_fees_setoff_0 to wx_finance_fees_setoff_0 ; | |||
| rename table wx_energy_fees_setoff_1 to wx_finance_fees_setoff_1 ; | |||
| rename table wx_energy_fees_setoff_2 to wx_finance_fees_setoff_2 ; | |||
| rename table wx_energy_fees_setoff_3 to wx_finance_fees_setoff_3 ; | |||
| rename table wx_energy_fees_setoff_4 to wx_finance_fees_setoff_4 ; | |||
| rename table wx_energy_fees_setoff_5 to wx_finance_fees_setoff_5 ; | |||
| rename table wx_energy_fees_setoff_6 to wx_finance_fees_setoff_6 ; | |||
| rename table wx_energy_fees_setoff_7 to wx_finance_fees_setoff_7 ; | |||
| rename table wx_energy_fees_setoff_8 to wx_finance_fees_setoff_8 ; | |||
| rename table wx_energy_fees_setoff_9 to wx_finance_fees_setoff_9 ; | |||
| rename table wx_energy_fees_setoff_10 to wx_finance_fees_setoff_10 ; | |||
| rename table wx_energy_fees_setoff_11 to wx_finance_fees_setoff_11 ; | |||
| rename table wx_energy_fees_setoff_12 to wx_finance_fees_setoff_12 ; | |||
| rename table wx_energy_fees_setoff_13 to wx_finance_fees_setoff_13 ; | |||
| rename table wx_energy_fees_setoff_14 to wx_finance_fees_setoff_14 ; | |||
| rename table wx_energy_fees_setoff_15 to wx_finance_fees_setoff_15 ; | |||
| rename table wx_energy_fees_setoff_16 to wx_finance_fees_setoff_16 ; | |||
| rename table wx_energy_fees_setoff_17 to wx_finance_fees_setoff_17 ; | |||
| rename table wx_energy_fees_setoff_18 to wx_finance_fees_setoff_18 ; | |||
| rename table wx_energy_fees_setoff_19 to wx_finance_fees_setoff_19 ; | |||
| rename table wx_energy_fees_setoff_20 to wx_finance_fees_setoff_20 ; | |||
| rename table wx_energy_fees_setoff_21 to wx_finance_fees_setoff_21 ; | |||
| rename table wx_energy_fees_setoff_22 to wx_finance_fees_setoff_22 ; | |||
| rename table wx_energy_fees_setoff_23 to wx_finance_fees_setoff_23 ; | |||
| rename table wx_energy_fees_setoff_24 to wx_finance_fees_setoff_24 ; | |||
| rename table wx_energy_fees_setoff_25 to wx_finance_fees_setoff_25 ; | |||
| rename table wx_energy_fees_setoff_26 to wx_finance_fees_setoff_26 ; | |||
| rename table wx_energy_fees_setoff_27 to wx_finance_fees_setoff_27 ; | |||
| rename table wx_energy_fees_setoff_28 to wx_finance_fees_setoff_28 ; | |||
| rename table wx_energy_fees_setoff_29 to wx_finance_fees_setoff_29 ; | |||
| rename table wx_energy_fees_setoff_30 to wx_finance_fees_setoff_30 ; | |||
| rename table wx_energy_fees_setoff_31 to wx_finance_fees_setoff_31 ; | |||
| rename table wx_energy_fees_setoff_32 to wx_finance_fees_setoff_32 ; | |||
| rename table wx_energy_fees_setoff_33 to wx_finance_fees_setoff_33 ; | |||
| rename table wx_energy_fees_setoff_34 to wx_finance_fees_setoff_34 ; | |||
| rename table wx_energy_fees_setoff_35 to wx_finance_fees_setoff_35 ; | |||
| rename table wx_energy_fees_setoff_36 to wx_finance_fees_setoff_36 ; | |||
| rename table wx_energy_fees_setoff_37 to wx_finance_fees_setoff_37 ; | |||
| rename table wx_energy_fees_setoff_38 to wx_finance_fees_setoff_38 ; | |||
| rename table wx_energy_fees_setoff_39 to wx_finance_fees_setoff_39 ; | |||
| rename table wx_energy_fees_setoff_40 to wx_finance_fees_setoff_40 ; | |||
| rename table wx_energy_fees_setoff_41 to wx_finance_fees_setoff_41 ; | |||
| rename table wx_energy_fees_setoff_42 to wx_finance_fees_setoff_42 ; | |||
| rename table wx_energy_fees_setoff_43 to wx_finance_fees_setoff_43 ; | |||
| rename table wx_energy_fees_setoff_44 to wx_finance_fees_setoff_44 ; | |||
| rename table wx_energy_fees_setoff_45 to wx_finance_fees_setoff_45 ; | |||
| rename table wx_energy_fees_setoff_46 to wx_finance_fees_setoff_46 ; | |||
| rename table wx_energy_fees_setoff_47 to wx_finance_fees_setoff_47 ; | |||
| rename table wx_energy_fees_setoff_48 to wx_finance_fees_setoff_48 ; | |||
| rename table wx_energy_fees_setoff_49 to wx_finance_fees_setoff_49 ; | |||
| rename table wx_energy_fees_setoff_50 to wx_finance_fees_setoff_50 ; | |||
| rename table wx_energy_fees_setoff_51 to wx_finance_fees_setoff_51 ; | |||
| rename table wx_energy_fees_setoff_52 to wx_finance_fees_setoff_52 ; | |||
| rename table wx_energy_fees_setoff_53 to wx_finance_fees_setoff_53 ; | |||
| rename table wx_energy_fees_setoff_54 to wx_finance_fees_setoff_54 ; | |||
| rename table wx_energy_fees_setoff_55 to wx_finance_fees_setoff_55 ; | |||
| rename table wx_energy_fees_setoff_56 to wx_finance_fees_setoff_56 ; | |||
| rename table wx_energy_fees_setoff_57 to wx_finance_fees_setoff_57 ; | |||
| rename table wx_energy_fees_setoff_58 to wx_finance_fees_setoff_58 ; | |||
| rename table wx_energy_fees_setoff_59 to wx_finance_fees_setoff_59 ; | |||
| rename table wx_energy_fees_setoff_60 to wx_finance_fees_setoff_60 ; | |||
| rename table wx_energy_fees_setoff_61 to wx_finance_fees_setoff_61 ; | |||
| rename table wx_energy_fees_setoff_62 to wx_finance_fees_setoff_62 ; | |||
| rename table wx_energy_fees_setoff_63 to wx_finance_fees_setoff_63 ; | |||
| rename table wx_energy_fees_setoff_64 to wx_finance_fees_setoff_64 ; | |||
| rename table wx_energy_fees_setoff_65 to wx_finance_fees_setoff_65 ; | |||
| rename table wx_energy_fees_setoff_66 to wx_finance_fees_setoff_66 ; | |||
| rename table wx_energy_fees_setoff_67 to wx_finance_fees_setoff_67 ; | |||
| rename table wx_energy_fees_setoff_68 to wx_finance_fees_setoff_68 ; | |||
| rename table wx_energy_fees_setoff_69 to wx_finance_fees_setoff_69 ; | |||
| rename table wx_energy_fees_setoff_70 to wx_finance_fees_setoff_70 ; | |||
| rename table wx_energy_fees_setoff_71 to wx_finance_fees_setoff_71 ; | |||
| rename table wx_energy_fees_setoff_72 to wx_finance_fees_setoff_72 ; | |||
| rename table wx_energy_fees_setoff_73 to wx_finance_fees_setoff_73 ; | |||
| rename table wx_energy_fees_setoff_74 to wx_finance_fees_setoff_74 ; | |||
| rename table wx_energy_fees_setoff_75 to wx_finance_fees_setoff_75 ; | |||
| rename table wx_energy_fees_setoff_76 to wx_finance_fees_setoff_76 ; | |||
| rename table wx_energy_fees_setoff_77 to wx_finance_fees_setoff_77 ; | |||
| rename table wx_energy_fees_setoff_78 to wx_finance_fees_setoff_78 ; | |||
| rename table wx_energy_fees_setoff_79 to wx_finance_fees_setoff_79 ; | |||
| rename table wx_energy_fees_setoff_80 to wx_finance_fees_setoff_80 ; | |||
| rename table wx_energy_fees_setoff_81 to wx_finance_fees_setoff_81 ; | |||
| rename table wx_energy_fees_setoff_82 to wx_finance_fees_setoff_82 ; | |||
| rename table wx_energy_fees_setoff_83 to wx_finance_fees_setoff_83 ; | |||
| rename table wx_energy_fees_setoff_84 to wx_finance_fees_setoff_84 ; | |||
| rename table wx_energy_fees_setoff_85 to wx_finance_fees_setoff_85 ; | |||
| rename table wx_energy_fees_setoff_86 to wx_finance_fees_setoff_86 ; | |||
| rename table wx_energy_fees_setoff_87 to wx_finance_fees_setoff_87 ; | |||
| rename table wx_energy_fees_setoff_88 to wx_finance_fees_setoff_88 ; | |||
| rename table wx_energy_fees_setoff_89 to wx_finance_fees_setoff_89 ; | |||
| rename table wx_energy_fees_setoff_90 to wx_finance_fees_setoff_90 ; | |||
| rename table wx_energy_fees_setoff_91 to wx_finance_fees_setoff_91 ; | |||
| rename table wx_energy_fees_setoff_92 to wx_finance_fees_setoff_92 ; | |||
| rename table wx_energy_fees_setoff_93 to wx_finance_fees_setoff_93 ; | |||
| rename table wx_energy_fees_setoff_94 to wx_finance_fees_setoff_94 ; | |||
| rename table wx_energy_fees_setoff_95 to wx_finance_fees_setoff_95 ; | |||
| rename table wx_energy_fees_setoff_96 to wx_finance_fees_setoff_96 ; | |||
| rename table wx_energy_fees_setoff_97 to wx_finance_fees_setoff_97 ; | |||
| rename table wx_energy_fees_setoff_98 to wx_finance_fees_setoff_98 ; | |||
| rename table wx_energy_fees_setoff_99 to wx_finance_fees_setoff_99 ; | |||
| RENAME TABLE wx_energy_fees_shop TO wx_fees_calcute_shop; | |||
| alter table wx_all_bill_0 drop column bill_type; | |||
| alter table wx_all_bill_1 drop column bill_type; | |||
| alter table wx_all_bill_2 drop column bill_type; | |||
| alter table wx_all_bill_3 drop column bill_type; | |||
| alter table wx_all_bill_4 drop column bill_type; | |||
| alter table wx_all_bill_5 drop column bill_type; | |||
| alter table wx_all_bill_6 drop column bill_type; | |||
| alter table wx_all_bill_7 drop column bill_type; | |||
| alter table wx_all_bill_8 drop column bill_type; | |||
| alter table wx_all_bill_9 drop column bill_type; | |||
| alter table wx_all_bill_10 drop column bill_type; | |||
| alter table wx_all_bill_11 drop column bill_type; | |||
| alter table wx_all_bill_12 drop column bill_type; | |||
| alter table wx_all_bill_13 drop column bill_type; | |||
| alter table wx_all_bill_14 drop column bill_type; | |||
| alter table wx_all_bill_15 drop column bill_type; | |||
| alter table wx_all_bill_16 drop column bill_type; | |||
| alter table wx_all_bill_17 drop column bill_type; | |||
| alter table wx_all_bill_18 drop column bill_type; | |||
| alter table wx_all_bill_19 drop column bill_type; | |||
| alter table wx_all_bill_20 drop column bill_type; | |||
| alter table wx_all_bill_21 drop column bill_type; | |||
| alter table wx_all_bill_22 drop column bill_type; | |||
| alter table wx_all_bill_23 drop column bill_type; | |||
| alter table wx_all_bill_24 drop column bill_type; | |||
| alter table wx_all_bill_25 drop column bill_type; | |||
| alter table wx_all_bill_26 drop column bill_type; | |||
| alter table wx_all_bill_27 drop column bill_type; | |||
| alter table wx_all_bill_28 drop column bill_type; | |||
| alter table wx_all_bill_29 drop column bill_type; | |||
| alter table wx_all_bill_30 drop column bill_type; | |||
| alter table wx_all_bill_31 drop column bill_type; | |||
| alter table wx_all_bill_32 drop column bill_type; | |||
| alter table wx_all_bill_33 drop column bill_type; | |||
| alter table wx_all_bill_34 drop column bill_type; | |||
| alter table wx_all_bill_35 drop column bill_type; | |||
| alter table wx_all_bill_36 drop column bill_type; | |||
| alter table wx_all_bill_37 drop column bill_type; | |||
| alter table wx_all_bill_38 drop column bill_type; | |||
| alter table wx_all_bill_39 drop column bill_type; | |||
| alter table wx_all_bill_40 drop column bill_type; | |||
| alter table wx_all_bill_41 drop column bill_type; | |||
| alter table wx_all_bill_42 drop column bill_type; | |||
| alter table wx_all_bill_43 drop column bill_type; | |||
| alter table wx_all_bill_44 drop column bill_type; | |||
| alter table wx_all_bill_45 drop column bill_type; | |||
| alter table wx_all_bill_46 drop column bill_type; | |||
| alter table wx_all_bill_47 drop column bill_type; | |||
| alter table wx_all_bill_48 drop column bill_type; | |||
| alter table wx_all_bill_49 drop column bill_type; | |||
| alter table wx_all_bill_50 drop column bill_type; | |||
| alter table wx_all_bill_51 drop column bill_type; | |||
| alter table wx_all_bill_52 drop column bill_type; | |||
| alter table wx_all_bill_53 drop column bill_type; | |||
| alter table wx_all_bill_54 drop column bill_type; | |||
| alter table wx_all_bill_55 drop column bill_type; | |||
| alter table wx_all_bill_56 drop column bill_type; | |||
| alter table wx_all_bill_57 drop column bill_type; | |||
| alter table wx_all_bill_58 drop column bill_type; | |||
| alter table wx_all_bill_59 drop column bill_type; | |||
| alter table wx_all_bill_60 drop column bill_type; | |||
| alter table wx_all_bill_61 drop column bill_type; | |||
| alter table wx_all_bill_62 drop column bill_type; | |||
| alter table wx_all_bill_63 drop column bill_type; | |||
| alter table wx_all_bill_64 drop column bill_type; | |||
| alter table wx_all_bill_65 drop column bill_type; | |||
| alter table wx_all_bill_66 drop column bill_type; | |||
| alter table wx_all_bill_67 drop column bill_type; | |||
| alter table wx_all_bill_68 drop column bill_type; | |||
| alter table wx_all_bill_69 drop column bill_type; | |||
| alter table wx_all_bill_70 drop column bill_type; | |||
| alter table wx_all_bill_71 drop column bill_type; | |||
| alter table wx_all_bill_72 drop column bill_type; | |||
| alter table wx_all_bill_73 drop column bill_type; | |||
| alter table wx_all_bill_74 drop column bill_type; | |||
| alter table wx_all_bill_75 drop column bill_type; | |||
| alter table wx_all_bill_76 drop column bill_type; | |||
| alter table wx_all_bill_77 drop column bill_type; | |||
| alter table wx_all_bill_78 drop column bill_type; | |||
| alter table wx_all_bill_79 drop column bill_type; | |||
| alter table wx_all_bill_80 drop column bill_type; | |||
| alter table wx_all_bill_81 drop column bill_type; | |||
| alter table wx_all_bill_82 drop column bill_type; | |||
| alter table wx_all_bill_83 drop column bill_type; | |||
| alter table wx_all_bill_84 drop column bill_type; | |||
| alter table wx_all_bill_85 drop column bill_type; | |||
| alter table wx_all_bill_86 drop column bill_type; | |||
| alter table wx_all_bill_87 drop column bill_type; | |||
| alter table wx_all_bill_88 drop column bill_type; | |||
| alter table wx_all_bill_89 drop column bill_type; | |||
| alter table wx_all_bill_90 drop column bill_type; | |||
| alter table wx_all_bill_91 drop column bill_type; | |||
| alter table wx_all_bill_92 drop column bill_type; | |||
| alter table wx_all_bill_93 drop column bill_type; | |||
| alter table wx_all_bill_94 drop column bill_type; | |||
| alter table wx_all_bill_95 drop column bill_type; | |||
| alter table wx_all_bill_96 drop column bill_type; | |||
| alter table wx_all_bill_97 drop column bill_type; | |||
| alter table wx_all_bill_98 drop column bill_type; | |||
| alter table wx_all_bill_99 drop column bill_type; | |||
| alter table wx_finance_receive_bill_0 drop column bill_type; | |||
| alter table wx_finance_receive_bill_1 drop column bill_type; | |||
| alter table wx_finance_receive_bill_2 drop column bill_type; | |||
| alter table wx_finance_receive_bill_3 drop column bill_type; | |||
| alter table wx_finance_receive_bill_4 drop column bill_type; | |||
| alter table wx_finance_receive_bill_5 drop column bill_type; | |||
| alter table wx_finance_receive_bill_6 drop column bill_type; | |||
| alter table wx_finance_receive_bill_7 drop column bill_type; | |||
| alter table wx_finance_receive_bill_8 drop column bill_type; | |||
| alter table wx_finance_receive_bill_9 drop column bill_type; | |||
| alter table wx_finance_receive_bill_10 drop column bill_type; | |||
| alter table wx_finance_receive_bill_11 drop column bill_type; | |||
| alter table wx_finance_receive_bill_12 drop column bill_type; | |||
| alter table wx_finance_receive_bill_13 drop column bill_type; | |||
| alter table wx_finance_receive_bill_14 drop column bill_type; | |||
| alter table wx_finance_receive_bill_15 drop column bill_type; | |||
| alter table wx_finance_receive_bill_16 drop column bill_type; | |||
| alter table wx_finance_receive_bill_17 drop column bill_type; | |||
| alter table wx_finance_receive_bill_18 drop column bill_type; | |||
| alter table wx_finance_receive_bill_19 drop column bill_type; | |||
| alter table wx_finance_receive_bill_20 drop column bill_type; | |||
| alter table wx_finance_receive_bill_21 drop column bill_type; | |||
| alter table wx_finance_receive_bill_22 drop column bill_type; | |||
| alter table wx_finance_receive_bill_23 drop column bill_type; | |||
| alter table wx_finance_receive_bill_24 drop column bill_type; | |||
| alter table wx_finance_receive_bill_25 drop column bill_type; | |||
| alter table wx_finance_receive_bill_26 drop column bill_type; | |||
| alter table wx_finance_receive_bill_27 drop column bill_type; | |||
| alter table wx_finance_receive_bill_28 drop column bill_type; | |||
| alter table wx_finance_receive_bill_29 drop column bill_type; | |||
| alter table wx_finance_receive_bill_30 drop column bill_type; | |||
| alter table wx_finance_receive_bill_31 drop column bill_type; | |||
| alter table wx_finance_receive_bill_32 drop column bill_type; | |||
| alter table wx_finance_receive_bill_33 drop column bill_type; | |||
| alter table wx_finance_receive_bill_34 drop column bill_type; | |||
| alter table wx_finance_receive_bill_35 drop column bill_type; | |||
| alter table wx_finance_receive_bill_36 drop column bill_type; | |||
| alter table wx_finance_receive_bill_37 drop column bill_type; | |||
| alter table wx_finance_receive_bill_38 drop column bill_type; | |||
| alter table wx_finance_receive_bill_39 drop column bill_type; | |||
| alter table wx_finance_receive_bill_40 drop column bill_type; | |||
| alter table wx_finance_receive_bill_41 drop column bill_type; | |||
| alter table wx_finance_receive_bill_42 drop column bill_type; | |||
| alter table wx_finance_receive_bill_43 drop column bill_type; | |||
| alter table wx_finance_receive_bill_44 drop column bill_type; | |||
| alter table wx_finance_receive_bill_45 drop column bill_type; | |||
| alter table wx_finance_receive_bill_46 drop column bill_type; | |||
| alter table wx_finance_receive_bill_47 drop column bill_type; | |||
| alter table wx_finance_receive_bill_48 drop column bill_type; | |||
| alter table wx_finance_receive_bill_49 drop column bill_type; | |||
| alter table wx_finance_receive_bill_50 drop column bill_type; | |||
| alter table wx_finance_receive_bill_51 drop column bill_type; | |||
| alter table wx_finance_receive_bill_52 drop column bill_type; | |||
| alter table wx_finance_receive_bill_53 drop column bill_type; | |||
| alter table wx_finance_receive_bill_54 drop column bill_type; | |||
| alter table wx_finance_receive_bill_55 drop column bill_type; | |||
| alter table wx_finance_receive_bill_56 drop column bill_type; | |||
| alter table wx_finance_receive_bill_57 drop column bill_type; | |||
| alter table wx_finance_receive_bill_58 drop column bill_type; | |||
| alter table wx_finance_receive_bill_59 drop column bill_type; | |||
| alter table wx_finance_receive_bill_60 drop column bill_type; | |||
| alter table wx_finance_receive_bill_61 drop column bill_type; | |||
| alter table wx_finance_receive_bill_62 drop column bill_type; | |||
| alter table wx_finance_receive_bill_63 drop column bill_type; | |||
| alter table wx_finance_receive_bill_64 drop column bill_type; | |||
| alter table wx_finance_receive_bill_65 drop column bill_type; | |||
| alter table wx_finance_receive_bill_66 drop column bill_type; | |||
| alter table wx_finance_receive_bill_67 drop column bill_type; | |||
| alter table wx_finance_receive_bill_68 drop column bill_type; | |||
| alter table wx_finance_receive_bill_69 drop column bill_type; | |||
| alter table wx_finance_receive_bill_70 drop column bill_type; | |||
| alter table wx_finance_receive_bill_71 drop column bill_type; | |||
| alter table wx_finance_receive_bill_72 drop column bill_type; | |||
| alter table wx_finance_receive_bill_73 drop column bill_type; | |||
| alter table wx_finance_receive_bill_74 drop column bill_type; | |||
| alter table wx_finance_receive_bill_75 drop column bill_type; | |||
| alter table wx_finance_receive_bill_76 drop column bill_type; | |||
| alter table wx_finance_receive_bill_77 drop column bill_type; | |||
| alter table wx_finance_receive_bill_78 drop column bill_type; | |||
| alter table wx_finance_receive_bill_79 drop column bill_type; | |||
| alter table wx_finance_receive_bill_80 drop column bill_type; | |||
| alter table wx_finance_receive_bill_81 drop column bill_type; | |||
| alter table wx_finance_receive_bill_82 drop column bill_type; | |||
| alter table wx_finance_receive_bill_83 drop column bill_type; | |||
| alter table wx_finance_receive_bill_84 drop column bill_type; | |||
| alter table wx_finance_receive_bill_85 drop column bill_type; | |||
| alter table wx_finance_receive_bill_86 drop column bill_type; | |||
| alter table wx_finance_receive_bill_87 drop column bill_type; | |||
| alter table wx_finance_receive_bill_88 drop column bill_type; | |||
| alter table wx_finance_receive_bill_89 drop column bill_type; | |||
| alter table wx_finance_receive_bill_90 drop column bill_type; | |||
| alter table wx_finance_receive_bill_91 drop column bill_type; | |||
| alter table wx_finance_receive_bill_92 drop column bill_type; | |||
| alter table wx_finance_receive_bill_93 drop column bill_type; | |||
| alter table wx_finance_receive_bill_94 drop column bill_type; | |||
| alter table wx_finance_receive_bill_95 drop column bill_type; | |||
| alter table wx_finance_receive_bill_96 drop column bill_type; | |||
| alter table wx_finance_receive_bill_97 drop column bill_type; | |||
| alter table wx_finance_receive_bill_98 drop column bill_type; | |||
| alter table wx_finance_receive_bill_99 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_0 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_1 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_2 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_3 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_4 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_5 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_6 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_7 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_8 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_9 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_10 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_11 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_12 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_13 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_14 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_15 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_16 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_17 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_18 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_19 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_20 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_21 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_22 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_23 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_24 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_25 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_26 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_27 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_28 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_29 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_30 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_31 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_32 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_33 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_34 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_35 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_36 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_37 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_38 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_39 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_40 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_41 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_42 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_43 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_44 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_45 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_46 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_47 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_48 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_49 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_50 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_51 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_52 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_53 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_54 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_55 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_56 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_57 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_58 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_59 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_60 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_61 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_62 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_63 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_64 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_65 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_66 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_67 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_68 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_69 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_70 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_71 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_72 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_73 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_74 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_75 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_76 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_77 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_78 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_79 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_80 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_81 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_82 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_83 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_84 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_85 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_86 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_87 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_88 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_89 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_90 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_91 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_92 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_93 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_94 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_95 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_96 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_97 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_98 drop column bill_type; | |||
| alter table wx_finance_receive_setoff_99 drop column bill_type; | |||
| alter table wx_all_bill_0 add column fees_type int(1); | |||
| alter table wx_all_bill_1 add column fees_type int(1); | |||
| alter table wx_all_bill_2 add column fees_type int(1); | |||
| alter table wx_all_bill_3 add column fees_type int(1); | |||
| alter table wx_all_bill_4 add column fees_type int(1); | |||
| alter table wx_all_bill_5 add column fees_type int(1); | |||
| alter table wx_all_bill_6 add column fees_type int(1); | |||
| alter table wx_all_bill_7 add column fees_type int(1); | |||
| alter table wx_all_bill_8 add column fees_type int(1); | |||
| alter table wx_all_bill_9 add column fees_type int(1); | |||
| alter table wx_all_bill_10 add column fees_type int(1); | |||
| alter table wx_all_bill_11 add column fees_type int(1); | |||
| alter table wx_all_bill_12 add column fees_type int(1); | |||
| alter table wx_all_bill_13 add column fees_type int(1); | |||
| alter table wx_all_bill_14 add column fees_type int(1); | |||
| alter table wx_all_bill_15 add column fees_type int(1); | |||
| alter table wx_all_bill_16 add column fees_type int(1); | |||
| alter table wx_all_bill_17 add column fees_type int(1); | |||
| alter table wx_all_bill_18 add column fees_type int(1); | |||
| alter table wx_all_bill_19 add column fees_type int(1); | |||
| alter table wx_all_bill_20 add column fees_type int(1); | |||
| alter table wx_all_bill_21 add column fees_type int(1); | |||
| alter table wx_all_bill_22 add column fees_type int(1); | |||
| alter table wx_all_bill_23 add column fees_type int(1); | |||
| alter table wx_all_bill_24 add column fees_type int(1); | |||
| alter table wx_all_bill_25 add column fees_type int(1); | |||
| alter table wx_all_bill_26 add column fees_type int(1); | |||
| alter table wx_all_bill_27 add column fees_type int(1); | |||
| alter table wx_all_bill_28 add column fees_type int(1); | |||
| alter table wx_all_bill_29 add column fees_type int(1); | |||
| alter table wx_all_bill_30 add column fees_type int(1); | |||
| alter table wx_all_bill_31 add column fees_type int(1); | |||
| alter table wx_all_bill_32 add column fees_type int(1); | |||
| alter table wx_all_bill_33 add column fees_type int(1); | |||
| alter table wx_all_bill_34 add column fees_type int(1); | |||
| alter table wx_all_bill_35 add column fees_type int(1); | |||
| alter table wx_all_bill_36 add column fees_type int(1); | |||
| alter table wx_all_bill_37 add column fees_type int(1); | |||
| alter table wx_all_bill_38 add column fees_type int(1); | |||
| alter table wx_all_bill_39 add column fees_type int(1); | |||
| alter table wx_all_bill_40 add column fees_type int(1); | |||
| alter table wx_all_bill_41 add column fees_type int(1); | |||
| alter table wx_all_bill_42 add column fees_type int(1); | |||
| alter table wx_all_bill_43 add column fees_type int(1); | |||
| alter table wx_all_bill_44 add column fees_type int(1); | |||
| alter table wx_all_bill_45 add column fees_type int(1); | |||
| alter table wx_all_bill_46 add column fees_type int(1); | |||
| alter table wx_all_bill_47 add column fees_type int(1); | |||
| alter table wx_all_bill_48 add column fees_type int(1); | |||
| alter table wx_all_bill_49 add column fees_type int(1); | |||
| alter table wx_all_bill_50 add column fees_type int(1); | |||
| alter table wx_all_bill_51 add column fees_type int(1); | |||
| alter table wx_all_bill_52 add column fees_type int(1); | |||
| alter table wx_all_bill_53 add column fees_type int(1); | |||
| alter table wx_all_bill_54 add column fees_type int(1); | |||
| alter table wx_all_bill_55 add column fees_type int(1); | |||
| alter table wx_all_bill_56 add column fees_type int(1); | |||
| alter table wx_all_bill_57 add column fees_type int(1); | |||
| alter table wx_all_bill_58 add column fees_type int(1); | |||
| alter table wx_all_bill_59 add column fees_type int(1); | |||
| alter table wx_all_bill_60 add column fees_type int(1); | |||
| alter table wx_all_bill_61 add column fees_type int(1); | |||
| alter table wx_all_bill_62 add column fees_type int(1); | |||
| alter table wx_all_bill_63 add column fees_type int(1); | |||
| alter table wx_all_bill_64 add column fees_type int(1); | |||
| alter table wx_all_bill_65 add column fees_type int(1); | |||
| alter table wx_all_bill_66 add column fees_type int(1); | |||
| alter table wx_all_bill_67 add column fees_type int(1); | |||
| alter table wx_all_bill_68 add column fees_type int(1); | |||
| alter table wx_all_bill_69 add column fees_type int(1); | |||
| alter table wx_all_bill_70 add column fees_type int(1); | |||
| alter table wx_all_bill_71 add column fees_type int(1); | |||
| alter table wx_all_bill_72 add column fees_type int(1); | |||
| alter table wx_all_bill_73 add column fees_type int(1); | |||
| alter table wx_all_bill_74 add column fees_type int(1); | |||
| alter table wx_all_bill_75 add column fees_type int(1); | |||
| alter table wx_all_bill_76 add column fees_type int(1); | |||
| alter table wx_all_bill_77 add column fees_type int(1); | |||
| alter table wx_all_bill_78 add column fees_type int(1); | |||
| alter table wx_all_bill_79 add column fees_type int(1); | |||
| alter table wx_all_bill_80 add column fees_type int(1); | |||
| alter table wx_all_bill_81 add column fees_type int(1); | |||
| alter table wx_all_bill_82 add column fees_type int(1); | |||
| alter table wx_all_bill_83 add column fees_type int(1); | |||
| alter table wx_all_bill_84 add column fees_type int(1); | |||
| alter table wx_all_bill_85 add column fees_type int(1); | |||
| alter table wx_all_bill_86 add column fees_type int(1); | |||
| alter table wx_all_bill_87 add column fees_type int(1); | |||
| alter table wx_all_bill_88 add column fees_type int(1); | |||
| alter table wx_all_bill_89 add column fees_type int(1); | |||
| alter table wx_all_bill_90 add column fees_type int(1); | |||
| alter table wx_all_bill_91 add column fees_type int(1); | |||
| alter table wx_all_bill_92 add column fees_type int(1); | |||
| alter table wx_all_bill_93 add column fees_type int(1); | |||
| alter table wx_all_bill_94 add column fees_type int(1); | |||
| alter table wx_all_bill_95 add column fees_type int(1); | |||
| alter table wx_all_bill_96 add column fees_type int(1); | |||
| alter table wx_all_bill_97 add column fees_type int(1); | |||
| alter table wx_all_bill_98 add column fees_type int(1); | |||
| alter table wx_all_bill_99 add column fees_type int(1); | |||
| @@ -21,7 +21,6 @@ import com.iformall.domain.po.WxShopUsersInfo; | |||
| import com.iformall.domain.po.WxUserDataRule; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillHotNotify; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillOweOrNearType; | |||
| import com.iformall.enums.EnumBillPayChannel; | |||
| import com.iformall.enums.EnumBillUpdateType; | |||
| @@ -92,14 +91,14 @@ public class WxBillController extends BaseController { | |||
| * 账单类型 | |||
| * @return | |||
| */ | |||
| @GetMapping("billTypes") | |||
| public ResultData billTypes() { | |||
| Map<Integer,String> tmap = new HashMap<Integer,String>(); | |||
| for (EnumBillAllType t : EnumBillAllType.values()) { | |||
| tmap.put(t.getCode(), t.getMessage()); | |||
| } | |||
| return new ResultData(tmap); | |||
| } | |||
| // @GetMapping("billTypes") | |||
| // public ResultData billTypes() { | |||
| // Map<Integer,String> tmap = new HashMap<Integer,String>(); | |||
| // for (EnumBillAllType t : EnumBillAllType.values()) { | |||
| // tmap.put(t.getCode(), t.getMessage()); | |||
| // } | |||
| // return new ResultData(tmap); | |||
| // } | |||
| /** | |||
| * 账单查询范围 | |||
| @@ -276,15 +275,6 @@ public class WxBillController extends BaseController { | |||
| Integer billTypeValue = Integer.parseInt(billTypeValueStr); | |||
| Long billId = Long.parseLong(billIdStr); | |||
| EnumBillAllType btype; | |||
| if (billTypeValue.intValue() == Constant.bill_all_type_manage_fee) { | |||
| btype = EnumBillAllType.RENT_BUSSINESS_MANAGE; | |||
| }else { | |||
| btype = EnumBillAllType.getEnum(billTypeValue); | |||
| if (null == btype) { | |||
| return new ResultData(Result.ERROR,"分类非法"); | |||
| } | |||
| } | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| WxAllBill billdetail = billAllHelper.getBillDetail(tenantEntity,billId); | |||
| if (null == billdetail) { | |||
| @@ -29,7 +29,6 @@ import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillHotNotify; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import com.iformall.domain.vo.WxCouponOrderSumVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillDailyBuildWay; | |||
| import com.iformall.enums.EnumBillDailyType; | |||
| import com.iformall.enums.EnumBillOweOrNearType; | |||
| @@ -1,13 +1,11 @@ | |||
| package com.iformall.schedule; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.msg.WxMsgRecord; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.WxMallMapper; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentContractService; | |||
| import com.iformall.utils.DateUtils; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| @@ -29,9 +27,6 @@ public class ContractSchedule { | |||
| @Autowired | |||
| private WxRentContractService wxRentContractService; | |||
| @Autowired | |||
| private WxPropertyContractService wxPropertyContractService; | |||
| @Autowired | |||
| private WxMallMapper wxMallMapper; | |||
| @@ -41,32 +36,32 @@ public class ContractSchedule { | |||
| /** | |||
| * 凌晨5分 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 5 0 * * ?") | |||
| public void updateContractStatus() { | |||
| //更新合同状态,正常到期 | |||
| //查询计租中的合同,找到商户,然后根据商户,如果商户有到期的(租金、物业)合同,则合同状态更新为到期。 | |||
| //如果店铺没有有效合同,则不释放店铺,不停用商户 | |||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||
| for (WxMall wxMall : wxMalls) { | |||
| try { | |||
| //租金合同 | |||
| wxRentContractService.outDateContract(wxMall); | |||
| wxRentContractService.readyToNomal(wxMall); | |||
| }catch(Exception e) { | |||
| log.error("rentcontract outDate error.",e); | |||
| } | |||
| try { | |||
| //物业合同 | |||
| wxPropertyContractService.outDateContract(wxMall); | |||
| wxPropertyContractService.readyToNomal(wxMall); | |||
| }catch(Exception e) { | |||
| log.error("propertycontract outDate error.",e); | |||
| } | |||
| } | |||
| // @Async | |||
| // @Scheduled(cron = "0 5 0 * * ?") | |||
| // public void updateContractStatus() { | |||
| // //更新合同状态,正常到期 | |||
| // | |||
| // //查询计租中的合同,找到商户,然后根据商户,如果商户有到期的(租金、物业)合同,则合同状态更新为到期。 | |||
| // //如果店铺没有有效合同,则不释放店铺,不停用商户 | |||
| // List<WxMall> wxMalls = wxMallMapper.findList(null); | |||
| // for (WxMall wxMall : wxMalls) { | |||
| // try { | |||
| // //租金合同 | |||
| // wxRentContractService.outDateContract(wxMall); | |||
| // wxRentContractService.readyToNomal(wxMall); | |||
| // }catch(Exception e) { | |||
| // log.error("rentcontract outDate error.",e); | |||
| // } | |||
| // | |||
| // try { | |||
| // //物业合同 | |||
| // wxPropertyContractService.outDateContract(wxMall); | |||
| // wxPropertyContractService.readyToNomal(wxMall); | |||
| // }catch(Exception e) { | |||
| // log.error("propertycontract outDate error.",e); | |||
| // } | |||
| // | |||
| // } | |||
| // log.info("合同状态更新开始"); | |||
| // List<WxMall> wxMalls = wxMallMapper.findList(null); | |||
| @@ -84,8 +79,8 @@ public class ContractSchedule { | |||
| // wxPropertyContractService.updateStatus(wxPropertyContract); | |||
| // log.info("物业合同状态更新结束"); | |||
| // } | |||
| log.info("合同状态更新结束"); | |||
| } | |||
| // log.info("合同状态更新结束"); | |||
| // } | |||
| /** | |||
| * 凌晨5分,定时终止租金合同 | |||
| @@ -109,128 +104,40 @@ public class ContractSchedule { | |||
| } | |||
| } | |||
| /** | |||
| * 凌晨5分,定时终止物业合同 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 5 0 * * ?") | |||
| public void endProperyContract() { | |||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||
| for (WxMall wxMall : wxMalls) { | |||
| //物业合同 | |||
| WxPropertyContract record = new WxPropertyContract(); | |||
| record.updateTenantInfo(wxMall); | |||
| List<WxPropertyContract> contractList = wxPropertyContractService.findToEndContractList(record); | |||
| for (WxPropertyContract rent:contractList) { | |||
| try { | |||
| wxPropertyContractService.endContract(rent,null); | |||
| }catch(Exception e) { | |||
| log.error("rentcontract outDate error.",e); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| * 凌晨5分,定时过期提醒租金合同到期 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 5 0 * * ?") | |||
| public void notifyRentContractOutDate() { | |||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||
| Date date = new Date(); | |||
| for (WxMall wxMall : wxMalls) { | |||
| //物业合同 | |||
| List<WxRentContract> contractList = wxRentContractService.findToOutDateContracts(wxMall); | |||
| for (WxRentContract rent:contractList) { | |||
| try { | |||
| Date endDate = DateUtils.stringToDate(DateUtils.getTimeBefore(rent.getOutDateNotifyDays(),rent.getRentalEndDate(),DateUtils.DATE_TIME_PATTERN), DateUtils.DATE_TIME_PATTERN); | |||
| if (endDate.after(date)) { | |||
| continue; | |||
| } | |||
| WxMsgRecord msgRecord = new WxMsgRecord(); | |||
| msgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| msgRecord.updateTenantInfo(wxMall); | |||
| msgRecord.setReceiver(rent.getOutDateNotifyPhone()); | |||
| msgRecord.setModelType(32); | |||
| Map<String,String> dynamicContentMap = new HashMap<String,String>(); | |||
| dynamicContentMap.put("id", String.valueOf(rent.getId())); | |||
| dynamicContentMap.put("contractType", "租金"); | |||
| dynamicContentMap.put("contract", rent.getContractNumber()); | |||
| msgRecord.setDynamicContentMap(dynamicContentMap); | |||
| mqBaseProducer.sendMessage(msgRecord, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| }catch(Exception e) { | |||
| log.error("rentcontract outDate error.",e); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| * 凌晨5分,定时过期提醒物业合同到期 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 5 0 * * ?") | |||
| public void notifyPropertyContractOutDate() { | |||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||
| Date date = new Date(); | |||
| for (WxMall wxMall : wxMalls) { | |||
| //物业合同 | |||
| List<WxPropertyContract> contractList = wxPropertyContractService.findToOutDateContracts(wxMall); | |||
| for (WxPropertyContract rent:contractList) { | |||
| try { | |||
| Date endDate = DateUtils.stringToDate(DateUtils.getTimeBefore(rent.getOutDateNotifyDays(),rent.getRentalEndDate(),DateUtils.DATE_TIME_PATTERN), DateUtils.DATE_TIME_PATTERN); | |||
| if (endDate.after(date)) { | |||
| continue; | |||
| } | |||
| WxMsgRecord msgRecord = new WxMsgRecord(); | |||
| msgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| msgRecord.updateTenantInfo(wxMall); | |||
| msgRecord.setReceiver(rent.getOutDateNotifyPhone()); | |||
| msgRecord.setModelType(32); | |||
| Map<String,String> dynamicContentMap = new HashMap<String,String>(); | |||
| dynamicContentMap.put("id", String.valueOf(rent.getId())); | |||
| dynamicContentMap.put("contractType", "物业"); | |||
| dynamicContentMap.put("contract", rent.getContractNumber()); | |||
| msgRecord.setDynamicContentMap(dynamicContentMap); | |||
| mqBaseProducer.sendMessage(msgRecord, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| }catch(Exception e) { | |||
| log.error("rentcontract outDate error.",e); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| // /** | |||
| // * 凌晨5分,联营扣点和面积联营取高的需要根据接单数据来更新账单,取高的那一个 | |||
| // * 凌晨5分,定时过期提醒租金合同到期 | |||
| // */ | |||
| // @Async | |||
| // @Scheduled(cron = "0 5 0 * * ?") | |||
| // //@Scheduled(cron = "0 */2 * * * *?") | |||
| // public void updateRentBill() { | |||
| // //查询记租中的联营扣点或者取高的合同,每天更新账单截止时间为前一天的账单。 | |||
| // public void notifyRentContractOutDate() { | |||
| // List<WxMall> wxMalls = wxMallMapper.findList(null); | |||
| // Date date = new Date(); | |||
| // for (WxMall wxMall : wxMalls) { | |||
| // WxRentContract rentContract = new WxRentContract(); | |||
| // rentContract.updateTenantInfo(wxMall); | |||
| // List<Integer> typeList = new ArrayList<Integer>(); | |||
| // typeList.add(EnumRentContractType.RENT_BY_JOINT.getCode()); | |||
| // typeList.add(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode()); | |||
| // rentContract.setTypeList(typeList); | |||
| // rentContract.setStatus(EnumRentContractStatus.PAING.getCode()); | |||
| // List<WxRentContract> contractList = wxRentContractService.findList(rentContract); | |||
| // if (null != contractList && contractList.size() > 0 ) { | |||
| // for (int i = 0 ; i < contractList.size(); i++ ) { | |||
| // WxRentContract rc = contractList.get(i); | |||
| // try { | |||
| // wxRentContractService.calcuteByTradeDaily(rc); | |||
| // }catch(Exception e) { | |||
| // log.error("rentcontract updateRentBill error.",e); | |||
| // } | |||
| // } | |||
| // } | |||
| // //物业合同 | |||
| // List<WxRentContract> contractList = wxRentContractService.findToOutDateContracts(wxMall); | |||
| // for (WxRentContract rent:contractList) { | |||
| // try { | |||
| // Date endDate = DateUtils.stringToDate(DateUtils.getTimeBefore(rent.getOutDateNotifyDays(),rent.getRentalEndDate(),DateUtils.DATE_TIME_PATTERN), DateUtils.DATE_TIME_PATTERN); | |||
| // if (endDate.after(date)) { | |||
| // continue; | |||
| // } | |||
| // WxMsgRecord msgRecord = new WxMsgRecord(); | |||
| // msgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| // msgRecord.updateTenantInfo(wxMall); | |||
| // msgRecord.setReceiver(rent.getOutDateNotifyPhone()); | |||
| // msgRecord.setModelType(32); | |||
| // Map<String,String> dynamicContentMap = new HashMap<String,String>(); | |||
| // dynamicContentMap.put("id", String.valueOf(rent.getId())); | |||
| // dynamicContentMap.put("contractType", "租金"); | |||
| // dynamicContentMap.put("contract", rent.getContractNumber()); | |||
| // msgRecord.setDynamicContentMap(dynamicContentMap); | |||
| // mqBaseProducer.sendMessage(msgRecord, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| // }catch(Exception e) { | |||
| // log.error("rentcontract outDate error.",e); | |||
| // } | |||
| // } | |||
| // } | |||
| // } | |||
| } | |||
| @@ -388,14 +388,14 @@ public class BaseMyBatisConfiguration { | |||
| ShardingSphere wxEnergyFeesSharding = new ShardingSphere(); | |||
| wxEnergyFeesSharding.setColumn("tenant_id"); | |||
| wxEnergyFeesSharding.setTableName("wx_energy_fees"); | |||
| wxEnergyFeesSharding.setTableName("wx_finance_fees"); | |||
| wxEnergyFeesSharding.setCount(100); | |||
| wxEnergyFeesSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxEnergyFeesSharding); | |||
| ShardingSphere wxEnergyFeesSetoffSharding = new ShardingSphere(); | |||
| wxEnergyFeesSetoffSharding.setColumn("tenant_id"); | |||
| wxEnergyFeesSetoffSharding.setTableName("wx_energy_fees_setoff"); | |||
| wxEnergyFeesSetoffSharding.setTableName("wx_finance_fees_setoff"); | |||
| wxEnergyFeesSetoffSharding.setCount(100); | |||
| wxEnergyFeesSetoffSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxEnergyFeesSetoffSharding); | |||
| @@ -1,16 +1,12 @@ | |||
| package com.iformall.domain.po; | |||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.common.SortColumn; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.FinanceSetOffDetailVo; | |||
| import com.iformall.domain.vo.WxBillFeesStandardsListVo; | |||
| import com.iformall.enums.EnumBillAction; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| import com.iformall.enums.EnumFeesType; | |||
| import com.iformall.utils.DateUtils; | |||
| import lombok.Data; | |||
| @@ -89,17 +85,15 @@ public class WxAllBill extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="实收金额",name="pay") | |||
| public String pay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单类型EnumBillAllType", name = "billType") | |||
| public Integer billType; | |||
| @Excel(name = "账单类型名称", width = 20, orderNum = "8") | |||
| @io.swagger.annotations.ApiModelProperty(value="账单类型名称",name="billTypeName") | |||
| @TableField(exist = false) | |||
| public String billTypeName; | |||
| public String getBillTypeName() { | |||
| if (null != billType) { | |||
| billTypeName = EnumBillAllType.getEnum(billType).getMessage(); | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumFeesType", name = "feesType") | |||
| private Integer feesType; | |||
| @TableField(exist = false) | |||
| private String feesTypeName; | |||
| public String getFeesTypeName() { | |||
| if (null != feesType) { | |||
| return EnumFeesType.getEnum(feesType).getMessage(); | |||
| } | |||
| return billTypeName; | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "支付方式", name = "payWay") | |||
| @@ -189,24 +183,25 @@ public class WxAllBill extends TenantEntity { | |||
| if (StringUtils.isBlank(returnPay)) { | |||
| returnPay = "0"; | |||
| } | |||
| //如果是押金,则不计算已退金额 | |||
| boolean isDeposit = false; | |||
| if (null != billType) { | |||
| for (EnumBillAllType types : EnumBillAllType.getDepositTypes()) { | |||
| if (types.getCode().intValue() == billType.intValue()) { | |||
| isDeposit = true; | |||
| break; | |||
| } | |||
| } | |||
| } | |||
| // //如果是押金,则不计算已退金额 | |||
| // boolean isDeposit = false; | |||
| // if (null != billType) { | |||
| // for (EnumBillAllType types : EnumBillAllType.getDepositTypes()) { | |||
| // if (types.getCode().intValue() == billType.intValue()) { | |||
| // isDeposit = true; | |||
| // break; | |||
| // } | |||
| // } | |||
| // | |||
| // } | |||
| //退回的只记录,不算 | |||
| if (StringUtils.isNotBlank(receivePay) && StringUtils.isNotBlank(pay)) { | |||
| String o = "0"; | |||
| if (isDeposit) { | |||
| //if (isDeposit) { | |||
| o = new BigDecimal(receivePay).subtract(new BigDecimal(pay)).subtract(new BigDecimal(setOff)).toPlainString(); | |||
| }else { | |||
| o = new BigDecimal(receivePay).subtract(new BigDecimal(pay)).add(new BigDecimal(returnPay)).subtract(new BigDecimal(setOff)).toPlainString(); | |||
| } | |||
| // }else { | |||
| // o = new BigDecimal(receivePay).subtract(new BigDecimal(pay)).add(new BigDecimal(returnPay)).subtract(new BigDecimal(setOff)).toPlainString(); | |||
| // } | |||
| return o; | |||
| } | |||
| return "0"; | |||
| @@ -317,25 +312,20 @@ public class WxAllBill extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="楼座号",name="building") | |||
| @TableField(exist = false) | |||
| public Long building; | |||
| @io.swagger.annotations.ApiModelProperty(value="楼层号",name="floor") | |||
| @TableField(exist = false) | |||
| public Long floor; | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额(加上了滞纳金服务费等费用)",name="realReceivePay") | |||
| @TableField(exist = false) | |||
| public String realReceivePay; | |||
| //滞纳金 | |||
| @TableField(exist = false) | |||
| public String billLatePay; | |||
| //服务费 | |||
| @TableField(exist = false) | |||
| public String serviceChargePay; | |||
| @TableField(exist = false) | |||
| public String billAllNeedPay; | |||
| public String getBillAllNeedPay() { | |||
| String bl = this.getBillLatePay(); | |||
| if (StringUtils.isBlank(bl)) { | |||
| @@ -357,47 +347,34 @@ public class WxAllBill extends TenantEntity { | |||
| @TableField(exist = false) | |||
| public String month; | |||
| //EnumBillOweOrNearType 逾期 1, 临期 2 | |||
| @TableField(exist = false) | |||
| public Integer onlyOweOrNear; | |||
| //账单逾期计算截止时间 | |||
| @TableField(exist = false) | |||
| public Date oweBillLastTime; | |||
| //临期计算截止时间 | |||
| @TableField(exist = false) | |||
| public Date nearBillLastTime; | |||
| //临期计算截止时间 | |||
| @TableField(exist = false) | |||
| public Integer notifyed; | |||
| @TableField(exist = false) | |||
| private Date needPayStartDay; | |||
| @TableField(exist = false) | |||
| private List<FinanceSetOffDetailVo> setOffDetailList; | |||
| @TableField(exist = false) | |||
| private String currentSetOff; | |||
| @TableField(exist = false) | |||
| private String currentReceive; | |||
| @TableField(exist = false) | |||
| private String currentCut; | |||
| @TableField(exist = false) | |||
| private Date shopEndtime; | |||
| @TableField(exist = false) | |||
| public List<WxAllBill> childList; | |||
| @TableField(exist = false) | |||
| List<WxBillFeesStandardsListVo> unFixedbillFeesStandardsList; | |||
| @TableField(exist = false) | |||
| private Integer hasParentBillId; | |||
| @TableField(exist = false) | |||
| @@ -428,8 +405,8 @@ public class WxAllBill extends TenantEntity { | |||
| public List<Long> energyFeesIds; | |||
| @TableField(exist = false) | |||
| public Integer advanceHasMoney; | |||
| @TableField(exist = false) | |||
| private Integer depositHasMoney; | |||
| // @TableField(exist = false) | |||
| // private Integer depositHasMoney; | |||
| @TableField(exist = false) | |||
| private String energyFeesIdStr; | |||
| @TableField(exist = false) | |||
| @@ -18,9 +18,6 @@ public class WxBillAction extends TenantEntity { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单类型EnumBillAllType", name = "billType") | |||
| private Integer billType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单ID", name = "billId") | |||
| private Long billId; | |||
| @@ -1,190 +0,0 @@ | |||
| package com.iformall.domain.po; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumContractReceivePeriodUnit; | |||
| import com.iformall.enums.EnumEnergyMeterType; | |||
| import com.iformall.enums.EnumFeesStandardsCalcuteUnit; | |||
| import com.iformall.enums.EnumFeesStandardsTimeUnit; | |||
| import com.iformall.enums.EnumRentDayPriceCalcute; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.helper.WxRentContractHelper; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.math.BigDecimal; | |||
| import java.math.RoundingMode; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Calendar; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| */ | |||
| @TableName(value = "wx_energy_fees") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxEnergyFees extends TenantEntity { | |||
| private static final long serialVersionUID = 7009117540201976664L; | |||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="name",name="name") | |||
| private String name; | |||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||
| private Date createTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "isDel", name = "isDel") | |||
| private Integer isDel; | |||
| @io.swagger.annotations.ApiModelProperty(value = "收款还是付款EnumFinanceCashierType", name = "cashierType") | |||
| private Integer cashierType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "单价", name = "price") | |||
| private String price; | |||
| @io.swagger.annotations.ApiModelProperty(value = "税率", name = "taxRate") | |||
| private String taxRate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "表类型EnumEnergyMeterType", name = "type") | |||
| private Integer type; | |||
| @TableField(exist = false) | |||
| private String typeName; | |||
| public String getTypeName() { | |||
| if (null != type) { | |||
| return EnumEnergyMeterType.getEnum(type).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否公摊", name = "isPublic") | |||
| private Integer isPublic; | |||
| @io.swagger.annotations.ApiModelProperty(value = "所属账单类型EnumBillAllType", name = "billType") | |||
| private Integer billType; | |||
| @TableField(exist = false) | |||
| private String billTypeName; | |||
| public String getBillTypeName() { | |||
| if (null != billType) { | |||
| return EnumBillAllType.getEnum(billType).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否系统内置", name = "isSystem") | |||
| private Integer isSystem; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否一次性费用EnumYesOrNo", name = "fixedPrice") | |||
| private Integer fixedPrice; | |||
| @TableField(exist = false) | |||
| private String fixedPriceName; | |||
| public String getFixedPriceName() { | |||
| if (null != fixedPrice) { | |||
| if (fixedPrice.intValue() == EnumYesOrNo.YES.getCode().intValue()) { | |||
| return "一次性费用"; | |||
| }else { | |||
| return "非一次性费用"; | |||
| } | |||
| } | |||
| return ""; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "计量单位EnumFeesStandardsCalcuteUnit【非固定费用使用】", name = "calcuteUnit") | |||
| private Integer calcuteUnit; | |||
| @TableField(exist = false) | |||
| private String calcuteUnitName; | |||
| public String getCalcuteUnitName() { | |||
| if (null != calcuteUnit) { | |||
| return EnumFeesStandardsCalcuteUnit.getEnum(calcuteUnit).getMessage(); | |||
| } | |||
| return ""; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "时间单位EnumFeesStandardsTimeUnit【非固定费用使用】", name = "timeUnit") | |||
| private Integer timeUnit; | |||
| @TableField(exist = false) | |||
| private String timeUnitName; | |||
| public String getTimeUnitName() { | |||
| if (null != timeUnit) { | |||
| return EnumFeesStandardsTimeUnit.getEnum(timeUnit).getMessage(); | |||
| } | |||
| return ""; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否押金类,押金类是需要退回的", name = "isDespoit") | |||
| private Integer isDespoit; | |||
| public String calcuteTotalMoney(Integer decimalSize,Date start,Date end,String count,boolean isFixed,EnumRentDayPriceCalcute priceCalcute,Integer monthDays, | |||
| EnumContractReceivePeriodUnit dayType,Integer receivePeriod ) { | |||
| if (StringUtils.isBlank(count)) { | |||
| count = "1"; | |||
| } | |||
| if (isFixed) { | |||
| //如果是按计量单位计算的 | |||
| BigDecimal priceD = new BigDecimal(this.price); | |||
| priceD = priceD.multiply(new BigDecimal(count)); | |||
| return priceD.toPlainString(); | |||
| } | |||
| //按天计算 | |||
| if (this.timeUnit.intValue() == EnumFeesStandardsTimeUnit.DAY.getCode().intValue()) { | |||
| BigDecimal priceD = new BigDecimal(this.price); | |||
| priceD = priceD.multiply(new BigDecimal(count)); | |||
| return WxRentContractHelper.getNeedPay(null,decimalSize,priceD,start,end,priceCalcute,monthDays); | |||
| }else { | |||
| //按月计算 | |||
| BigDecimal priceMonth = new BigDecimal(this.price); | |||
| if (this.timeUnit.intValue() == EnumFeesStandardsTimeUnit.YEAR.getCode().intValue()) { | |||
| priceMonth = new BigDecimal(price).divide(new BigDecimal(12),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP); | |||
| } | |||
| priceMonth = priceMonth.multiply(new BigDecimal(count)); | |||
| return WxRentContractHelper.getMonthNeedPay(null,decimalSize,priceMonth, start, end,dayType.getCode(),receivePeriod,priceCalcute.getCode(),monthDays); | |||
| } | |||
| } | |||
| @TableField(exist = false) | |||
| private List<Long> feesIds;//冲抵科目 | |||
| @TableField(exist = false) | |||
| private String feesName; | |||
| public String getFeesIdsName(Map<Long, WxEnergyFees> feesMap) { | |||
| if (null != feesIds) { | |||
| StringBuffer sb= new StringBuffer(); | |||
| for (int i = 0 ; i < feesIds.size(); i++) { | |||
| Long feid = feesIds.get(i); | |||
| WxEnergyFees f = feesMap.get(feid); | |||
| if (null != f) { | |||
| sb.append(f.getName()).append(","); | |||
| } | |||
| } | |||
| return sb.toString(); | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| private Integer notSetOff; | |||
| @TableField(exist = false) | |||
| private List<Integer> billTypeList; | |||
| @TableField(exist = false) | |||
| private Integer isAllList; | |||
| @TableField(exist = false) | |||
| private Integer isFeesShopQuery; | |||
| } | |||
| @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillDailyBuildWay; | |||
| import com.iformall.enums.EnumBillRentApplyStatus; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.utils.DateUtils; | |||
| @@ -114,7 +113,7 @@ public class WxEnergyReadingCalcuteResult extends TenantEntity { | |||
| daily.setOwe(needPay); | |||
| daily.setShopId(this.shopId); | |||
| daily.setShopNumber(shop.getShopNumber()); | |||
| daily.setBillType(EnumBillAllType.DAILY.getCode()); | |||
| //daily.setBillType(EnumBillAllType.DAILY.getCode()); | |||
| daily.setEnergyFeesId(calcute.getFeesId()); | |||
| daily.setPriceDetail(detail); | |||
| daily.setServiceChargePay("0"); | |||
| @@ -23,11 +23,11 @@ import java.util.List; | |||
| /** | |||
| */ | |||
| @TableName(value = "wx_energy_fees_shop") | |||
| @TableName(value = "wx_fees_calcute_shop") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxEnergyFeesShop extends TenantEntity { | |||
| public class WxFeesCalcuteShop extends TenantEntity { | |||
| private static final long serialVersionUID = 7009117540201976664L; | |||
| @@ -99,13 +99,13 @@ public class WxEnergyFeesShop extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="endTime",name="endTime") | |||
| private Date endTime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "公摊计算公司", name = "formula") | |||
| @io.swagger.annotations.ApiModelProperty(value = "计算公司", name = "formula") | |||
| private String formula; | |||
| @io.swagger.annotations.ApiModelProperty(value = "公摊计算公式数组字符串", name = "formula") | |||
| @io.swagger.annotations.ApiModelProperty(value = "计算公式数组字符串", name = "formula") | |||
| private String formulaListStr; | |||
| @TableField(exist = false) | |||
| private List<String> formulaList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "公摊计算公司", name = "formulaContent") | |||
| @io.swagger.annotations.ApiModelProperty(value = "计算公司", name = "formulaContent") | |||
| private String formulaContent; | |||
| @TableField(exist = false) | |||
| private List<String> formulaContentList; | |||
| @@ -0,0 +1,114 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumFeesType; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| */ | |||
| @TableName(value = "wx_finance_fees") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxFinanceFees extends TenantEntity { | |||
| private static final long serialVersionUID = 7009117540201976664L; | |||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="name",name="name") | |||
| private String name; | |||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||
| private Date createTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "isDel", name = "isDel") | |||
| private Integer isDel; | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumFeesType", name = "feesType") | |||
| private Integer feesType; | |||
| @TableField(exist = false) | |||
| private String feesTypeName; | |||
| public String getFeesTypeName() { | |||
| if (null != feesType) { | |||
| return EnumFeesType.getEnum(feesType).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "税率", name = "taxRate") | |||
| private String taxRate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否押金类,押金类是需要退回的", name = "isDespoit") | |||
| private Integer isDespoit; | |||
| // public String calcuteTotalMoney(Integer decimalSize,Date start,Date end,String count,boolean isFixed,EnumRentDayPriceCalcute priceCalcute,Integer monthDays, | |||
| // EnumContractReceivePeriodUnit dayType,Integer receivePeriod ) { | |||
| // if (StringUtils.isBlank(count)) { | |||
| // count = "1"; | |||
| // } | |||
| // | |||
| // if (isFixed) { | |||
| // //如果是按计量单位计算的 | |||
| // BigDecimal priceD = new BigDecimal(this.price); | |||
| // priceD = priceD.multiply(new BigDecimal(count)); | |||
| // return priceD.toPlainString(); | |||
| // } | |||
| // //按天计算 | |||
| // if (this.timeUnit.intValue() == EnumFeesStandardsTimeUnit.DAY.getCode().intValue()) { | |||
| // BigDecimal priceD = new BigDecimal(this.price); | |||
| // priceD = priceD.multiply(new BigDecimal(count)); | |||
| // return WxRentContractHelper.getNeedPay(null,decimalSize,priceD,start,end,priceCalcute,monthDays); | |||
| // }else { | |||
| // //按月计算 | |||
| // BigDecimal priceMonth = new BigDecimal(this.price); | |||
| // if (this.timeUnit.intValue() == EnumFeesStandardsTimeUnit.YEAR.getCode().intValue()) { | |||
| // priceMonth = new BigDecimal(price).divide(new BigDecimal(12),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP); | |||
| // } | |||
| // priceMonth = priceMonth.multiply(new BigDecimal(count)); | |||
| // //return WxRentContractAgileHelper.getMonthNeedPay(null,decimalSize,priceMonth, start, end,dayType.getCode(),receivePeriod,priceCalcute.getCode(),monthDays); | |||
| // return ""; | |||
| // } | |||
| // } | |||
| @TableField(exist = false) | |||
| private List<Long> feesIds;//冲抵科目 | |||
| @TableField(exist = false) | |||
| private String feesName; | |||
| public String getFeesIdsName(Map<Long, WxFinanceFees> feesMap) { | |||
| if (null != feesIds) { | |||
| StringBuffer sb= new StringBuffer(); | |||
| for (int i = 0 ; i < feesIds.size(); i++) { | |||
| Long feid = feesIds.get(i); | |||
| WxFinanceFees f = feesMap.get(feid); | |||
| if (null != f) { | |||
| sb.append(f.getName()).append(","); | |||
| } | |||
| } | |||
| return sb.toString(); | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| private Integer notSetOff; | |||
| // @TableField(exist = false) | |||
| // private List<Integer> billTypeList; | |||
| @TableField(exist = false) | |||
| private Integer isAllList; | |||
| @TableField(exist = false) | |||
| private Integer isFeesShopQuery; | |||
| } | |||
| @@ -9,11 +9,11 @@ import java.util.Date; | |||
| /** | |||
| */ | |||
| @TableName(value = "wx_energy_fees_setoff") | |||
| @TableName(value = "wx_finance_fees_setoff") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxEnergyFeesSetoff extends TenantEntity { | |||
| public class WxFinanceFeesSetoff extends TenantEntity { | |||
| private static final long serialVersionUID = 7009117540201976664L; | |||
| @@ -4,7 +4,6 @@ import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFinanceCashierType; | |||
| import com.iformall.utils.Constant; | |||
| @@ -48,18 +47,6 @@ public class WxFinanceReceiveBill extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单编号", name = "billId") | |||
| private Long billId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单类型EnumBillAllType", name = "billType") | |||
| private Integer billType; | |||
| //@Excel(name = "账单类型", width = 20, orderNum = "9") | |||
| @TableField(exist = false) | |||
| private String billTypeName; | |||
| public String getBillTypeName() { | |||
| if (null != billType) { | |||
| return EnumBillAllType.getEnum(billType).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单客户名称", name = "billCusName") | |||
| private String billCusName; | |||
| @@ -3,7 +3,6 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -3,7 +3,6 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -38,14 +37,6 @@ public class WxFinanceReceiveSetoff extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单编号", name = "billId") | |||
| private Long billId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单类型EnumBillAllType", name = "billType") | |||
| private Integer billType; | |||
| @TableField(exist = false) | |||
| private String billTypeName; | |||
| public String getBillTypeName() { | |||
| return EnumBillAllType.getEnum(billType).getMessage(); | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="科目编号",name="feesId") | |||
| private Long feesId; | |||
| @TableField(exist = false) | |||
| @@ -1,387 +0,0 @@ | |||
| package com.iformall.domain.po; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.common.SortColumn; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumPriceUnit; | |||
| import com.iformall.enums.EnumPropertyCreateType; | |||
| import com.iformall.enums.EnumRentContractAdjustPeriod; | |||
| import com.iformall.enums.EnumRentContractStatus; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.utils.Constant; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.math.BigDecimal; | |||
| import java.math.RoundingMode; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.Iterator; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import org.apache.commons.compress.utils.Lists; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @TableName(value = "wx_property_contract") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxPropertyContract extends TenantEntity { | |||
| protected Long id; | |||
| private Long customersId; | |||
| @TableField(exist = false) | |||
| private Integer customerType; | |||
| @TableField(exist = false) | |||
| private String customerName; | |||
| @TableField(exist = false) | |||
| private String customerLinkPerson; | |||
| @TableField(exist = false) | |||
| private String customerPhone; | |||
| @TableField(exist = false) | |||
| private String customerLegalPerson; | |||
| @io.swagger.annotations.ApiModelProperty(value="审核状态,0未审核 1审核中 2审核完成 3驳回 4合同作废",name="applyStatus") | |||
| private Integer applyStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="审批流1合同2账单3终止审批",name="businessType") | |||
| private Integer businessType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "金额小数点位数", name = "decimalSize") | |||
| private Integer decimalSize = 2; | |||
| /*月租金/分成(分)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="物业费(分)",name="price") | |||
| private String price; | |||
| @io.swagger.annotations.ApiModelProperty(value="起租开始时间",name="rentalStartDate") | |||
| private Date rentalStartDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="起租结束时间",name="rentalEndDate") | |||
| private Date rentalEndDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="签定合同时间",name="signDate") | |||
| private Date signDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="计费周期",name="receivePeriod") | |||
| private Integer receivePeriod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "付款周期(计费周期的倍数)", name = "receivePeriod") | |||
| private Integer payPeriodRate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "计费周期单位EnumContractReceivePeriodUnit", name = "receivePeriodUnit") | |||
| private Integer receivePeriodUnit; | |||
| @io.swagger.annotations.ApiModelProperty(value="合同文件路径",name="filepath") | |||
| private String filepath; | |||
| @io.swagger.annotations.ApiModelProperty(value="合同进度状态1待签约2已签约未记租3计租中4提前终止5合同到期EnumRentContractStatus",name="status") | |||
| private Integer status; | |||
| @TableField(exist = false) | |||
| private List<Integer> statuss; | |||
| @TableField(exist = false) | |||
| private String statusName; | |||
| public String getStatusName() { | |||
| if (null != status) { | |||
| return EnumRentContractStatus.getEnum(status).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="是否固定价格",name="0:按面积计算,1:固定价格") | |||
| private Integer fixedPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="合同编号",name="contractNumber") | |||
| private String contractNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="押金",name="deposit") | |||
| private String deposit; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否删除1是0否",name="isDel") | |||
| private Integer isDel; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createBy") | |||
| private Long updateBy; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createBy") | |||
| private String updateByName; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||
| private Date createtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createBy") | |||
| private Long createBy; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createBy") | |||
| private String createByName; | |||
| @io.swagger.annotations.ApiModelProperty(value="计租面积",name="rentArea") | |||
| private String rentArea; | |||
| @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") | |||
| private String linkPerson; | |||
| @io.swagger.annotations.ApiModelProperty(value="联系电话",name="linkPhone") | |||
| private String linkPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付账号",name="payAccount") | |||
| private String payAccount; | |||
| @io.swagger.annotations.ApiModelProperty(value="上传文件名",name="filename") | |||
| private String filename; | |||
| @io.swagger.annotations.ApiModelProperty(value="租期:月",name="lease") | |||
| private Integer lease; | |||
| @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | |||
| private Long rentContractId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "计租日", name = "startDate") | |||
| private Date startDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "endDate") | |||
| private Date endDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "终止时间", name = "endContractTime") | |||
| private Date endContractTime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "计租周期EnumRentContractAdjustPeriod", name = "计租周期") | |||
| private Integer adjustPeriod; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||
| private Map<String, Object> flowParams; | |||
| @io.swagger.annotations.ApiModelProperty(value = "调整比例", name = "adjustRatio") | |||
| private String adjustRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "滞纳金费率", name = "latePayRatio") | |||
| private String latePayRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "n日后开始计算滞纳金", name = "latePayDay") | |||
| private Integer latePayDay; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "物业预账单列表", name = "previewBillRentList") | |||
| private List<WxAllBill> previewBillRentList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租金信息", name = "rentInfo") | |||
| private String rentInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "fileNames") | |||
| private String fileNames; | |||
| @io.swagger.annotations.ApiModelProperty(value = "每天价格计算规则EnumRentDayPriceCalcute", name = "dayPriceCalcute") | |||
| private Integer dayPriceCalcute; | |||
| @io.swagger.annotations.ApiModelProperty(value = "每月平均天数", name = "monthAverageDays") | |||
| private Integer monthAverageDays; | |||
| @TableField(exist = false) | |||
| private String building; | |||
| @TableField(exist = false) | |||
| private String floor; | |||
| @TableField(exist = false) | |||
| private String floorName; | |||
| @TableField(exist = false) | |||
| private String buildingName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租金单位1日2月3年EnumPriceUnit", name = "priceUnit") | |||
| private Integer priceUnit; | |||
| @TableField(exist = false) | |||
| private String priceUnitName; | |||
| public String getPriceUnitName() { | |||
| if (null != priceUnit) { | |||
| EnumPriceUnit eu = EnumPriceUnit.getEnum(priceUnit); | |||
| if (null != eu) { | |||
| return eu.getMessage(); | |||
| }else { | |||
| return null; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "多径租赁单价(其他放rentInfo)", name = "priceUnit") | |||
| private String rentPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "费用详细说明", name = "priceDetail") | |||
| private String priceDetail; | |||
| @io.swagger.annotations.ApiModelProperty(value = "主体名称", name = "subjectName") | |||
| private String subjectName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "1按租赁日生产2按计租日生成账单EnumRentStartType", name = "rentStartType") | |||
| private Integer rentStartType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作类型1区分租赁物业2合并租赁物业", name = "operationType") | |||
| private Integer operationType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租金录入方式1合铺录入2分铺录入", name = "rent_input_way") | |||
| private Integer rentInputWay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "年租金调整方式1按比例2按金额", name = "adjust_ratio_way") | |||
| private Integer adjustRatioWay; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批备注", name = "remark") | |||
| private String remark; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | |||
| @TableField(exist = false) | |||
| private Integer flowHas; | |||
| @io.swagger.annotations.ApiModelProperty(value = "其他标准费用信息", name = "feesStandardsInfo") | |||
| private String feesStandardsInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value = "到期提醒提前天数", name = "outDateNotifyDays") | |||
| private Integer outDateNotifyDays; | |||
| @io.swagger.annotations.ApiModelProperty(value = "到期提醒手机号", name = "outDateNotifyPhone") | |||
| private String outDateNotifyPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建方式EnumPropertyCreateType", name = "createType") | |||
| private Integer createType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单开始时间", name = "firstBillDateStart") | |||
| private Date firstBillDateStart; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单结束时间", name = "firstBillDateEnd") | |||
| private Date firstBillDateEnd; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单收款截止日期", name = "firstBillReceiveDate") | |||
| private Date firstBillReceiveDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "店铺编号串", name = "shopIdStr") | |||
| private String shopIdStr; | |||
| //查询过期提醒 | |||
| @TableField(exist = false) | |||
| private Integer outDateNofity; | |||
| public void setAdjustPeriodHandle() { | |||
| if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){ | |||
| this.adjustPeriod = EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode(); | |||
| } | |||
| } | |||
| public void calcutePrice(String rentArea) { | |||
| //如果是固定的,则不计算 | |||
| if (null != fixedPrice && fixedPrice.equals(EnumYesOrNo.YES.getCode())) { | |||
| }else { | |||
| if (StringUtils.isNotBlank(rentArea) && StringUtils.isNotBlank(this.rentPrice)) { | |||
| this.price = new BigDecimal(rentArea).multiply(new BigDecimal(this.rentPrice)).setScale(this.decimalSize, RoundingMode.HALF_UP).toPlainString(); | |||
| this.rentArea = rentArea; | |||
| } | |||
| } | |||
| } | |||
| public Map<Long,BigDecimal> getRentShopArea() { | |||
| String rentInfo = this.getRentInfo(); | |||
| if (!StringUtils.isBlank(rentInfo)) { | |||
| Map<Long,BigDecimal> shopAreaMap = new HashMap<Long,BigDecimal>(); | |||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | |||
| int size = rentInfoArray.size(); | |||
| BigDecimal total = new BigDecimal(0); | |||
| for (int i = 0; i < size; i++) { | |||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||
| Long shopId = rentInfoObject.getLong("id"); | |||
| String rentArea = rentInfoObject.getString("operationArea"); | |||
| if (StringUtils.isBlank(rentArea)) { | |||
| shopAreaMap.put(shopId, new BigDecimal("0")); | |||
| }else { | |||
| shopAreaMap.put(shopId, new BigDecimal(rentArea)); | |||
| total = total.add(new BigDecimal(rentArea)); | |||
| } | |||
| } | |||
| return shopAreaMap; | |||
| } | |||
| return null; | |||
| } | |||
| public List<Long> shopIdsByShop() { | |||
| String rentInfo = this.getRentInfo(); | |||
| if (!StringUtils.isBlank(rentInfo)) { | |||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | |||
| int size = rentInfoArray.size(); | |||
| List<Long> shopIdList = new ArrayList<Long>(); | |||
| for (int i = 0; i < size; i++) { | |||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||
| Long shopId = rentInfoObject.getLong("id"); | |||
| shopIdList.add(shopId); | |||
| } | |||
| return shopIdList; | |||
| } | |||
| return null; | |||
| } | |||
| public String getRentInfoShopNumber() { | |||
| StringBuffer sb = new StringBuffer(""); | |||
| String rentInfo = this.getRentInfo(); | |||
| if (!StringUtils.isBlank(rentInfo)) { | |||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | |||
| int size = rentInfoArray.size(); | |||
| for (int i = 0; i < size; i++) { | |||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||
| String shopNumber = rentInfoObject.getString("shopNumber"); | |||
| if (StringUtils.isNotBlank(shopNumber)) { | |||
| sb.append(shopNumber).append(","); | |||
| } | |||
| } | |||
| } | |||
| return sb.toString(); | |||
| } | |||
| public List<WxEnergyFees> getFeesStardarsList() { | |||
| if (StringUtils.isNotBlank(feesStandardsInfo)) { | |||
| return JSON.parseArray(feesStandardsInfo, WxEnergyFees.class); | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| List<WxEnergyFees> unFixedfeeStandards; | |||
| public List<WxEnergyFees> getUnFixedfeeStandards() { | |||
| List<WxEnergyFees> fees = this.getFeesStardarsList(); | |||
| if (null != fees && fees.size() > 0 ) { | |||
| List<WxEnergyFees> unfixed = new ArrayList<WxEnergyFees>(); | |||
| for (int i = 0 ; i < fees.size() ; i++ ) { | |||
| WxEnergyFees fs = fees.get(i); | |||
| if (fs.getFixedPrice().intValue() == EnumYesOrNo.NO.getCode().intValue()) { | |||
| unfixed.add(fs); | |||
| } | |||
| } | |||
| if (unfixed.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| return unfixed; | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| List<WxEnergyFees> feeStandards; | |||
| @TableField(exist = false) | |||
| private Long queryShopId; | |||
| @TableField(exist = false) | |||
| private String merchantName; | |||
| @TableField(exist = false) | |||
| private String queryShopIdStr; | |||
| @TableField(exist = false) | |||
| private List<Long> customersIdList; | |||
| @TableField(exist = false) | |||
| private String shopNumbers; | |||
| @TableField(exist = false) | |||
| private Date useStartTime; | |||
| @TableField(exist = false) | |||
| private Date useEndTime; | |||
| } | |||
| @@ -73,9 +73,6 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "租期总月数(月)", name = "lease") | |||
| private Integer lease; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单生成方式EnumRentContractAdjustPeriod", name = "adjustPeriod") | |||
| private Integer adjustPeriod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "来源ID,针对续签,从哪个合同续签", name = "fromId") | |||
| private Long fromId; | |||
| @@ -96,8 +93,6 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "金额小数点位数", name = "decimalSize") | |||
| private Integer decimalSize = Constant.default_short_decimal_size ; | |||
| @io.swagger.annotations.ApiModelProperty(value = "月租金/分成(元)", name = "price") | |||
| private String price; | |||
| @TableField(exist = false) | |||
| private String priceTwoDecimal;//2位小数 | |||
| @@ -109,7 +104,7 @@ public class WxRentContract extends TenantEntity { | |||
| private Integer receivePeriodUnit; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同文件路径", name = "filepath") | |||
| private String filepath; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同进度状态1待签约2已签约未记租3计租中4提前终止5合同到期EnumRentContractStatus", name = "status") | |||
| @io.swagger.annotations.ApiModelProperty(value = "EnumRentContractStatus", name = "status") | |||
| private Integer status; | |||
| @TableField(exist = false) | |||
| private List<Integer> statuss; | |||
| @@ -122,28 +117,23 @@ public class WxRentContract extends TenantEntity { | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "押金", name = "deposit") | |||
| private String deposit; | |||
| @io.swagger.annotations.ApiModelProperty(value = "押金金额详细", name = "cashtypeContentLsit") | |||
| private String cashtypeContentLsit; | |||
| @io.swagger.annotations.ApiModelProperty(value = "押金科目详细(弃用)", name = "cashtypeLsit") | |||
| private String cashtypeLsit; | |||
| public void calcuteDepositTotal() { | |||
| if (StringUtils.isNotBlank(cashtypeContentLsit)) { | |||
| JSONArray rentInfoArray = JSONArray.parseArray(cashtypeContentLsit); | |||
| int size = rentInfoArray.size(); | |||
| BigDecimal dt = new BigDecimal(0); | |||
| for (int i = 0; i < size; i++) { | |||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||
| String deposit = rentInfoObject.getString("deposit"); | |||
| if (StringUtils.isNotBlank(deposit)) { | |||
| dt = dt.add(new BigDecimal(deposit)); | |||
| } | |||
| } | |||
| this.deposit = dt.toPlainString(); | |||
| } | |||
| } | |||
| // public void calcuteDepositTotal() { | |||
| // if (StringUtils.isNotBlank(cashtypeContentLsit)) { | |||
| // JSONArray rentInfoArray = JSONArray.parseArray(cashtypeContentLsit); | |||
| // int size = rentInfoArray.size(); | |||
| // BigDecimal dt = new BigDecimal(0); | |||
| // for (int i = 0; i < size; i++) { | |||
| // JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||
| // String deposit = rentInfoObject.getString("deposit"); | |||
| // if (StringUtils.isNotBlank(deposit)) { | |||
| // dt = dt.add(new BigDecimal(deposit)); | |||
| // } | |||
| // } | |||
| // //this.deposit = dt.toPlainString(); | |||
| // } | |||
| // } | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") | |||
| @@ -162,17 +152,9 @@ public class WxRentContract extends TenantEntity { | |||
| private String createByName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "计租面积", name = "rentArea") | |||
| private String rentArea; | |||
| @TableField(exist = false) | |||
| private String operationArea; | |||
| public String getOperationArea() { | |||
| operationArea = rentArea; | |||
| return operationArea; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "店铺编号串", name = "shopIdStr") | |||
| private String shopIdStr; | |||
| @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "filename") | |||
| private String filename; | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumRentContractType", name = "type") | |||
| private Integer type; | |||
| @@ -181,49 +163,15 @@ public class WxRentContract extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private List<Integer> typeList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "调整比例", name = "adjustRatio") | |||
| private String adjustRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点调整比率", name = "revenueRatioSet") | |||
| private String revenueRatioSet; | |||
| @TableField(exist = false) | |||
| private String revenueYear; | |||
| public String getRevenueYear() { | |||
| return revenueRatioSet; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点比率", name = "payRatio") | |||
| private String payRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "保底营业额", name = "revenue") | |||
| private String revenue; | |||
| @io.swagger.annotations.ApiModelProperty(value = "最低扣点营业额(达到此营业额才会扣点)", name = "limitRevenue") | |||
| private String limitRevenue; | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点租金取高租金价格是否固定", name = "revenueFixedRentPrice") | |||
| private Integer revenueFixedRentPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点租金取高租金固定价格", name = "revenueRentPrice") | |||
| private String revenueRentPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "取高时保底方式EnumRentRenevueMinimunMethod", name = "revenueMinimumMethod") | |||
| private Integer revenueMinimumMethod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否设置保底营业额", name = "revenueRatio") | |||
| private Integer revenueRatio; | |||
| // @io.swagger.annotations.ApiModelProperty(value = "取高时保底方式EnumRentRenevueMinimunMethod", name = "revenueMinimumMethod") | |||
| // private Integer revenueMinimumMethod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "审核状态, 0未审核 1审核中 2审核通过 3驳回", name = "applyStatus") | |||
| private Integer applyStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批流类型: 审批流1合同2账单3终止审批", name = "businessType") | |||
| private Integer businessType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "终止时间", name = "endContractTime") | |||
| private Date endContractTime; | |||
| // @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| // private Integer rentShopType; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||
| private Map<String, Object> flowParams; | |||
| @@ -232,151 +180,24 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁合同预账单列表", name = "previewBillRentList") | |||
| private List<WxAllBill> previewBillRentList; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "物业合同预账单列表", name = "reviewBillPropertyPList") | |||
| private List<WxAllBill> reviewBillPropertyPList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批说明", name = "remark") | |||
| private String remark; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批时带的物业合同编号,租金+物业时用", name = "propertyId") | |||
| private Long propertyId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租金信息", name = "rentInfo") | |||
| private String rentInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "fileNames") | |||
| private String fileNames; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租金单位1日2月3年EnumPriceUnit", name = "priceUnit") | |||
| private Integer priceUnit; | |||
| @TableField(exist = false) | |||
| private String priceUnitName; | |||
| public String getPriceUnitName() { | |||
| if (null != priceUnit) { | |||
| return EnumPriceUnit.getEnum(priceUnit).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "租金租赁单价(其他放rentInfo)", name = "priceUnit") | |||
| private String rentPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "费用详细说明", name = "priceDetail") | |||
| private String priceDetail; | |||
| @io.swagger.annotations.ApiModelProperty(value = "其他多径租赁单价", name = "otherRentPriceInfo") | |||
| private String otherRentPriceInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value = "主体名称", name = "subjectName") | |||
| private String subjectName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "1按租赁日生产2按计租日生成账单EnumRentStartType", name = "rentStartType") | |||
| private Integer rentStartType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租金录入方式1合铺录入2分铺录入", name = "rent_input_way") | |||
| private Integer rentInputWay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "年租金调整方式1按比例2按金额", name = "adjust_ratio_way") | |||
| private Integer adjustRatioWay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点调整方式1按比例2按金额(仅联营面积取高时用)", name = "revenueRatioWay") | |||
| private Integer revenueRatioWay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作类型1区分租赁物业2合并租赁物业3金茂", name = "operationType") | |||
| private Integer operationType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "每天价格计算规则EnumRentDayPriceCalcute", name = "dayPriceCalcute") | |||
| private Integer dayPriceCalcute; | |||
| @io.swagger.annotations.ApiModelProperty(value = "每月平均天数", name = "monthAverageDays") | |||
| private Integer monthAverageDays; | |||
| @io.swagger.annotations.ApiModelProperty(value = "滞纳金费率", name = "latePayRatio") | |||
| private String latePayRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "n日后开始计算滞纳金", name = "latePayDay") | |||
| private Integer latePayDay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | |||
| @TableField(exist = false) | |||
| private Integer flowHas; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商业管理费单价", name = "bussinessManagementFee") | |||
| private String bussinessManagementFee; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商业管理费调整方式1按比例2按金额", name = "bussinessManagementFeeRatioWay") | |||
| private Integer bussinessManagementFeeRatioWay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商业管理费调整方式1按比例2按金额", name = "bussinessManagementFeeRatio") | |||
| private String bussinessManagementFeeRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "营业管理费单价", name = "operatingManagementFee") | |||
| private String operatingManagementFee; | |||
| @io.swagger.annotations.ApiModelProperty(value = "营业管理费调整方式1按比例2按金额", name = "operatingManagementFeeRatioWay") | |||
| private Integer operatingManagementFeeRatioWay; | |||
| @io.swagger.annotations.ApiModelProperty(value = "营业管理费调整方式1按比例2按金额", name = "operatingManagementFeeRatio") | |||
| private String operatingManagementFeeRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "到期提醒提前天数", name = "outDateNotifyDays") | |||
| private Integer outDateNotifyDays; | |||
| @io.swagger.annotations.ApiModelProperty(value = "到期提醒手机号", name = "outDateNotifyPhone") | |||
| private String outDateNotifyPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单开始时间", name = "firstBillDateStart") | |||
| private Date firstBillDateStart; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单结束时间", name = "firstBillDateEnd") | |||
| private Date firstBillDateEnd; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单收款截止日期", name = "firstBillReceiveDate") | |||
| private Date firstBillReceiveDate; | |||
| //查询过期提醒 | |||
| @TableField(exist = false) | |||
| private Integer outDateNofity; | |||
| public void setAdjustPeriodHandle() { | |||
| if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){ | |||
| this.adjustPeriod = EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode(); | |||
| } | |||
| } | |||
| // public void setRentPriceHandle() { | |||
| // if(StringUtils.isBlank(rentPrice)) { | |||
| // rentPrice = "0"; | |||
| // } | |||
| // } | |||
| public void calcutePrice() { | |||
| //如果是按铺位数算,price不用计算,是填写的值 | |||
| if (this.type.equals(EnumRentContractType.RENT_BY_AREA.getCode()) || this.type.equals(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode())) { | |||
| if (StringUtils.isNotBlank(this.rentArea) && StringUtils.isNotBlank(this.rentPrice)) { | |||
| this.price = new BigDecimal(this.rentArea).multiply(new BigDecimal(this.rentPrice)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| } | |||
| } | |||
| } | |||
| public String getPriceTwoDecimal() { | |||
| if (StringUtils.isNotBlank(price)) { | |||
| if (null == decimalSize || decimalSize <= 0 ) { | |||
| this.priceTwoDecimal = new BigDecimal(price).setScale(Constant.default_short_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| }else { | |||
| this.priceTwoDecimal = new BigDecimal(price).setScale(this.decimalSize, RoundingMode.HALF_UP).toPlainString(); | |||
| } | |||
| } | |||
| return priceTwoDecimal; | |||
| } | |||
| // @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") | |||
| // private Integer contractType; | |||
| //联营扣点跳点设置 | |||
| @TableField(exist = false) | |||
| private List<WxRentContractRevenueJump> revenueJumps; | |||
| @@ -386,16 +207,8 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "免租期说明", name = "freePeriodRemark") | |||
| private String freePeriodRemark; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同类型EnumRentAgileType", name = "agileType") | |||
| private Integer agileType; | |||
| @TableField(exist = false) | |||
| private String agileTypeName; | |||
| public String getAgileTypeName() { | |||
| if (null != agileType) { | |||
| return EnumRentAgileType.getEnum(agileType).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| // @io.swagger.annotations.ApiModelProperty(value = "合同类型EnumRentAgileType", name = "agileType") | |||
| // private Integer agileType = EnumRentAgileType.AGILE.getCode(); | |||
| public List<Long> shopIdsByRentInfo() { | |||
| @@ -471,35 +284,29 @@ public class WxRentContract extends TenantEntity { | |||
| } | |||
| public Map<Long,WxEnergyFees> getDepositEnergyFees(Map<Long,WxEnergyFees> feesMap) { | |||
| String dsdstr = this.getCashtypeContentLsit(); | |||
| if (!StringUtils.isBlank(dsdstr)) { | |||
| Map<Long,WxEnergyFees> retMap = new HashMap<Long,WxEnergyFees>(); | |||
| JSONArray rentInfoArray = JSONArray.parseArray(dsdstr); | |||
| int size = rentInfoArray.size(); | |||
| for (int i = 0; i < size; i++) { | |||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||
| String depositType = rentInfoObject.getString("value"); | |||
| String deposit = rentInfoObject.getString("deposit"); | |||
| Long dt = Long.parseLong(depositType); | |||
| WxEnergyFees fees = feesMap.get(dt); | |||
| WxEnergyFees nfees = new WxEnergyFees(); | |||
| nfees.setId(fees.getId()); | |||
| nfees.setName(fees.getName()); | |||
| nfees.setCalcuteUnit(fees.getCalcuteUnit()); | |||
| nfees.setPrice(deposit); | |||
| retMap.put(dt, nfees); | |||
| } | |||
| return retMap; | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| private String onlyPropertyContractId; | |||
| @TableField(exist = false) | |||
| private Long propertyContractId; | |||
| // public Map<Long,WxEnergyFees> getDepositEnergyFees(Map<Long,WxEnergyFees> feesMap) { | |||
| // String dsdstr = this.getCashtypeContentLsit(); | |||
| // if (!StringUtils.isBlank(dsdstr)) { | |||
| // Map<Long,WxEnergyFees> retMap = new HashMap<Long,WxEnergyFees>(); | |||
| // JSONArray rentInfoArray = JSONArray.parseArray(dsdstr); | |||
| // int size = rentInfoArray.size(); | |||
| // for (int i = 0; i < size; i++) { | |||
| // JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||
| // String depositType = rentInfoObject.getString("value"); | |||
| // String deposit = rentInfoObject.getString("deposit"); | |||
| // Long dt = Long.parseLong(depositType); | |||
| // WxEnergyFees fees = feesMap.get(dt); | |||
| // WxEnergyFees nfees = new WxEnergyFees(); | |||
| // nfees.setId(fees.getId()); | |||
| // nfees.setName(fees.getName()); | |||
| // nfees.setCalcuteUnit(fees.getCalcuteUnit()); | |||
| // nfees.setPrice(deposit); | |||
| // retMap.put(dt, nfees); | |||
| // } | |||
| // return retMap; | |||
| // } | |||
| // return null; | |||
| // } | |||
| @TableField(exist = false) | |||
| private List<RentContractFreePeriodVo> freePeriods; | |||
| @@ -553,13 +360,6 @@ public class WxRentContract extends TenantEntity { | |||
| private Integer owe; | |||
| @TableField(exist = false) | |||
| private String receiveDate; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "latePayPrice") | |||
| private Integer latePayPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否同时终止物业", name = "endProperty") | |||
| @TableField(exist = false) | |||
| private Integer endProperty; | |||
| @TableField(exist = false) | |||
| private String salesMoney; | |||
| @TableField(exist = false) | |||
| @@ -8,7 +8,6 @@ import java.util.Date; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| @Data | |||
| public class WxBillBad implements Serializable { | |||
| @@ -22,11 +21,11 @@ public class WxBillBad implements Serializable { | |||
| //减免总金额 | |||
| private String total = "0"; | |||
| public String getBillTypeName() { | |||
| if (null != billType) { | |||
| return EnumBillAllType.getEnum(billType).getMessage(); | |||
| } | |||
| return ""; | |||
| } | |||
| // public String getBillTypeName() { | |||
| // if (null != billType) { | |||
| // return EnumBillAllType.getEnum(billType).getMessage(); | |||
| // } | |||
| // return ""; | |||
| // } | |||
| } | |||
| @@ -4,7 +4,7 @@ import lombok.Data; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| @Data | |||
| public class WxBillFeesStandardsListVo implements Serializable { | |||
| @@ -14,7 +14,7 @@ public class WxBillFeesStandardsListVo implements Serializable { | |||
| private Date start; | |||
| private Date end; | |||
| private Date receiveDate; | |||
| private WxEnergyFees feeStandards; | |||
| private WxFinanceFees feeStandards; | |||
| private Long parentBillId; | |||
| private boolean isDeposit; | |||
| @@ -7,7 +7,6 @@ import java.math.RoundingMode; | |||
| import java.util.Date; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| @Data | |||
| public class WxBillHotNotify implements Serializable { | |||
| @@ -8,7 +8,6 @@ import java.util.Date; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| @Data | |||
| public class WxBillJianMian implements Serializable { | |||
| @@ -22,11 +21,11 @@ public class WxBillJianMian implements Serializable { | |||
| //减免总金额 | |||
| private String total = "0"; | |||
| public String getBillTypeName() { | |||
| if (null != billType) { | |||
| return EnumBillAllType.getEnum(billType).getMessage(); | |||
| } | |||
| return ""; | |||
| } | |||
| // public String getBillTypeName() { | |||
| // if (null != billType) { | |||
| // return EnumBillAllType.getEnum(billType).getMessage(); | |||
| // } | |||
| // return ""; | |||
| // } | |||
| } | |||
| @@ -7,7 +7,6 @@ import java.math.RoundingMode; | |||
| import java.util.Date; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| @Data | |||
| public class WxBillNotify implements Serializable { | |||
| @@ -15,8 +14,8 @@ public class WxBillNotify implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| //EnumBillAllType | |||
| private Integer billType; | |||
| private String billTypeName; | |||
| //private Integer billType; | |||
| //private String billTypeName; | |||
| private Long billId; | |||
| private Date starttime; | |||
| private Date endtime; | |||
| @@ -32,10 +31,10 @@ public class WxBillNotify implements Serializable { | |||
| return new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString(); | |||
| } | |||
| public String getBillTypeName() { | |||
| if (null != billType) { | |||
| return EnumBillAllType.getEnum(billType).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| // public String getBillTypeName() { | |||
| // if (null != billType) { | |||
| // return EnumBillAllType.getEnum(billType).getMessage(); | |||
| // } | |||
| // return null; | |||
| // } | |||
| } | |||
| @@ -8,7 +8,6 @@ import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxFinanceReceiveBill; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| import lombok.Data; | |||
| @@ -96,17 +95,6 @@ public class WxFinanceReceiveVo implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单编号", name = "billId") | |||
| private Long billId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单类型EnumBillAllType", name = "billType") | |||
| private Integer billType; | |||
| @TableField(exist = false) | |||
| private String billTypeName; | |||
| public String getBillTypeName() { | |||
| if (null != billType) { | |||
| return EnumBillAllType.getEnum(billType).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="科目编号",name="feesId") | |||
| private Long feesId; | |||
| @TableField(exist = false) | |||
| @@ -167,7 +155,7 @@ public class WxFinanceReceiveVo implements Serializable { | |||
| this.rid = receiveBill.getId(); | |||
| this.receiveId = receiveBill.getReceiveId(); | |||
| this.billId = receiveBill.getBillId(); | |||
| this.billType = receiveBill.getBillType(); | |||
| //this.billType = receiveBill.getBillType(); | |||
| this.feesId = receiveBill.getFeesId(); | |||
| this.payWay = receiveBill.getPayWay(); | |||
| this.billReceive = receiveBill.getReceive(); | |||
| @@ -1,102 +0,0 @@ | |||
| package com.iformall.enums; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| public enum EnumBillAllType { | |||
| RENT(1,"租金",1L,false,false), | |||
| RENT_BUSSINESS_MANAGE(11,"商业管理费",2L,false,false), | |||
| RENT_OPERATION_MANAGE(12,"运营管理费",3L,false,false), | |||
| RENT_DEPOSIT(13,"租赁押金",null,true,true), | |||
| PROPERTY(2,"物业",5L,false,false), | |||
| PROPERTY_DEPOSIT(21,"物业押金",6L,true,true), | |||
| DAILY(3, "能耗(水电空调)费",null,false,false), | |||
| OTHER(4, "临时费用",null,false,false), | |||
| OTHER_DEPOSIT(5, "临时押金",null,true,true), | |||
| ADVANCE(6,"预收",null,true,false), | |||
| TEMP_TO_PAYMERCHANT(7,"临时付款给商户",null,false,false) | |||
| ; | |||
| public static EnumBillAllType getEnum(Integer code) { | |||
| for (EnumBillAllType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| private Long energyFeesId;//wx_energy_fees(费用科目)里的id,不可配置的有这个 | |||
| private boolean isFixedPrice;//是否强制为一次性费用 | |||
| private boolean isDeposit;//是否强制是押金类型 | |||
| EnumBillAllType(Integer code, String message,Long energyFeesId,boolean isFixedPrice,boolean isDeposit) { | |||
| this.code = code; | |||
| this.message = message; | |||
| this.energyFeesId = energyFeesId; | |||
| this.isFixedPrice = isFixedPrice; | |||
| this.isDeposit = isDeposit; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| public Long getEnergyFeesId() { | |||
| return energyFeesId; | |||
| } | |||
| public boolean isFixedPrice() { | |||
| return isFixedPrice; | |||
| } | |||
| public boolean isDeposit() { | |||
| return isDeposit; | |||
| } | |||
| public static EnumBillAllType[] getDepositTypes() { | |||
| EnumBillAllType[] ret = new EnumBillAllType[] {RENT_DEPOSIT,PROPERTY_DEPOSIT,OTHER_DEPOSIT}; | |||
| return ret; | |||
| } | |||
| public static EnumBillAllType[] getSystemTypes() { | |||
| EnumBillAllType[] ret = new EnumBillAllType[] {RENT,RENT_BUSSINESS_MANAGE,RENT_OPERATION_MANAGE, | |||
| PROPERTY,PROPERTY_DEPOSIT}; | |||
| return ret; | |||
| } | |||
| public static List<EnumFeesStandardsCalcuteUnit> getCalucuteUnites(Integer type) { | |||
| //需要计算的费用,非一次性费用 | |||
| List<EnumFeesStandardsCalcuteUnit> retList = new ArrayList<EnumFeesStandardsCalcuteUnit>(); | |||
| if (type.intValue() == RENT.getCode().intValue() || type.intValue() == RENT_BUSSINESS_MANAGE.getCode().intValue() | |||
| || type.intValue() == RENT_OPERATION_MANAGE.getCode().intValue() || type.intValue() == PROPERTY.getCode().intValue() | |||
| || type.intValue() == RENT_DEPOSIT.getCode().intValue() || type.intValue() == OTHER.getCode().intValue() | |||
| || type.intValue() == OTHER_DEPOSIT.getCode().intValue()) { | |||
| retList.add(EnumFeesStandardsCalcuteUnit.MM); | |||
| retList.add(EnumFeesStandardsCalcuteUnit.HU); | |||
| }else if (type.intValue() == DAILY.getCode().intValue()) { | |||
| retList.add(EnumFeesStandardsCalcuteUnit.DIAN_DU); | |||
| retList.add(EnumFeesStandardsCalcuteUnit.SHUI_DUN); | |||
| } | |||
| if (retList.size() > 0 ) { | |||
| return retList; | |||
| } | |||
| return null; | |||
| } | |||
| public static List<EnumFeesStandardsTimeUnit> getTimeUnites(Integer type) { | |||
| List<EnumFeesStandardsTimeUnit> retList = new ArrayList<EnumFeesStandardsTimeUnit>(); | |||
| retList.add(EnumFeesStandardsTimeUnit.DAY); | |||
| retList.add(EnumFeesStandardsTimeUnit.MONTH); | |||
| retList.add(EnumFeesStandardsTimeUnit.YEAR); | |||
| return retList; | |||
| } | |||
| } | |||
| @@ -0,0 +1,36 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| */ | |||
| public enum EnumFeesType { | |||
| NOMAL(1,"常规科目"), | |||
| ADVANCE(2,"预收科目"); | |||
| public static EnumFeesType getEnum(Integer code) { | |||
| for (EnumFeesType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumFeesType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -2,7 +2,6 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.vo.WxBillHotNotify; | |||
| import com.iformall.domain.vo.WxBillNotify; | |||
| @@ -31,7 +30,6 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> { | |||
| List<WxBillNotify> getBillNotifyList(WxAllBill record); | |||
| void deleteBillByContract(WxRentContract wxRentContract); | |||
| void deleteBillByPropertyContract(WxPropertyContract wxPropertyContract); | |||
| void deletePreviewBill(WxAllBill wxBillRent); | |||
| void deleteNoNeedPayBill(WxAllBill wxBillRent); | |||
| void deleteByRentHuiSuan(WxAllBill wxBillRent); | |||
| @@ -17,7 +17,7 @@ public interface WxBillActionMapper extends CommonMapper<WxBillAction, Long> { | |||
| List<WxBillAction> findBillActionList(WxBillAction wxBillAction); | |||
| List<WxBillJianMian> findJianMian(WxBillAction record); | |||
| //List<WxBillJianMian> findJianMian(WxBillAction record); | |||
| List<WxBillBad> findBad(WxBillAction record); | |||
| //List<WxBillBad> findBad(WxBillAction record); | |||
| } | |||
| @@ -1,20 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxEnergyFeesMapper extends CommonMapper<WxEnergyFees, Long> { | |||
| List<WxEnergyFees> findList(WxEnergyFees wxBillRent); | |||
| WxEnergyFees selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void setIsDel(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isDel")Integer isDel); | |||
| List<Long> findIdList(WxEnergyFees wxBillRent); | |||
| } | |||
| @@ -1,23 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxEnergyFeesSetoff; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxEnergyFeesSetoffMapper extends CommonMapper<WxEnergyFeesSetoff, Long> { | |||
| List<WxEnergyFeesSetoff> findList(WxEnergyFeesSetoff wxBillRent); | |||
| List<Long> findFeesIdList(WxEnergyFeesSetoff wxBillRent); | |||
| List<Long> findadvanceFeesIdList(WxEnergyFeesSetoff wxBillRent); | |||
| WxEnergyFeesSetoff selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void deleteByAdvanceId(WxEnergyFeesSetoff wxBillRent); | |||
| } | |||
| @@ -1,21 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxEnergyFeesShop; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxEnergyFeesShopMapper extends CommonMapper<WxEnergyFeesShop, Long> { | |||
| List<WxEnergyFeesShop> findList(WxEnergyFeesShop wxBillRent); | |||
| List<Long> findFeesIdList(WxEnergyFeesShop wxBillRent); | |||
| WxEnergyFeesShop selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void updateTimes(@Param("tenantId")String tenantId, @Param("list")List<WxEnergyFeesShop> resultList); | |||
| } | |||
| @@ -0,0 +1,21 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxFeesCalcuteShop; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxFeesCalcuteShopMapper extends CommonMapper<WxFeesCalcuteShop, Long> { | |||
| List<WxFeesCalcuteShop> findList(WxFeesCalcuteShop wxBillRent); | |||
| List<Long> findFeesIdList(WxFeesCalcuteShop wxBillRent); | |||
| WxFeesCalcuteShop selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void updateTimes(@Param("tenantId")String tenantId, @Param("list")List<WxFeesCalcuteShop> resultList); | |||
| } | |||
| @@ -0,0 +1,20 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxFinanceFeesMapper extends CommonMapper<WxFinanceFees, Long> { | |||
| List<WxFinanceFees> findList(WxFinanceFees wxBillRent); | |||
| WxFinanceFees selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void setIsDel(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isDel")Integer isDel); | |||
| List<Long> findIdList(WxFinanceFees wxBillRent); | |||
| } | |||
| @@ -0,0 +1,23 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxFinanceFeesSetoff; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxFinanceFeesSetoffMapper extends CommonMapper<WxFinanceFeesSetoff, Long> { | |||
| List<WxFinanceFeesSetoff> findList(WxFinanceFeesSetoff wxBillRent); | |||
| List<Long> findFeesIdList(WxFinanceFeesSetoff wxBillRent); | |||
| List<Long> findadvanceFeesIdList(WxFinanceFeesSetoff wxBillRent); | |||
| WxFinanceFeesSetoff selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void deleteByAdvanceId(WxFinanceFeesSetoff wxBillRent); | |||
| } | |||
| @@ -1,60 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import java.util.List; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxPropertyContractMapper extends CommonMapper<WxPropertyContract, String> { | |||
| List<WxPropertyContract> findList(WxPropertyContract wxPropertyContract); | |||
| List<Long> findIdList(WxPropertyContract wxPropertyContract); | |||
| //List<Map<String,Object>> queryPropertyContractData(WxPropertyContract wxRentContract); | |||
| int queryRentContractWaitSignStatus(WxPropertyContract wxRentContract); | |||
| int queryRentContractEndSoonStatus(WxPropertyContract wxRentContract); | |||
| int queryRentContractPaidStatus(WxPropertyContract wxRentContract); | |||
| int queryRentContractEndStatus(WxPropertyContract wxRentContract); | |||
| int updateRentContractEndSoonStatus(WxPropertyContract wxRentContract); | |||
| int updateRentContractPaidStatus(WxPropertyContract wxRentContract); | |||
| int updateRentContractEndStatus(WxPropertyContract wxRentContract); | |||
| //void updateRentInvalidStatus(WxPropertyContract wxRentContract); | |||
| //List<WxRentContract> getRentContractListByShop(Map<String, Object> params); | |||
| //List<WxRentContract> getRentContractListByPoint(Map<String, Object> params); | |||
| void updateApplyStatus(WxPropertyContract wxPropertyContract); | |||
| void updateApplyStatusByRentContractId(WxPropertyContract wxPropertyContract); | |||
| void updateStatus(WxPropertyContract wxPropertyContract); | |||
| long queryOweCount(WxPropertyContract wxPropertyContract); | |||
| void updateStatusByRentContractId(WxPropertyContract wxPropertyContract); | |||
| WxPropertyContract findOneByRentId(WxRentContract wxRentContract); | |||
| WxPropertyContract getByBill(WxAllBill billRent); | |||
| void endContract(WxPropertyContract wxPropertyContract); | |||
| void setEndContractTime(WxPropertyContract wxPropertyContract); | |||
| List<WxPropertyContract> findToEndContractList(WxPropertyContract rentContract); | |||
| } | |||
| @@ -4,7 +4,6 @@ import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| @@ -28,8 +27,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||
| int hasContractNumber(WxRentContract wxRentContract); | |||
| List<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record); | |||
| WxRentContract getByBill(WxAllBill billRent); | |||
| int getShopCountMax(); | |||
| @@ -6,7 +6,7 @@ import org.springframework.stereotype.Service; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.print.data.PrintDataParser; | |||
| import com.iformall.utils.DateUtils; | |||
| @@ -18,7 +18,7 @@ public class PrintBillDataHandler implements PrintDataParser{ | |||
| @Override | |||
| public Object getObjectValue(String name, Object o,Object... params) { | |||
| Map<Long, WxMerchant> merchantMap = (Map<Long, WxMerchant>) params[0]; | |||
| Map<Long, WxEnergyFees> feesMap = (Map<Long, WxEnergyFees>) params[1]; | |||
| Map<Long, WxFinanceFees> feesMap = (Map<Long, WxFinanceFees>) params[1]; | |||
| Map<Long,String> shopNumber = (Map<Long, String>) params[2]; | |||
| WxAllBill receive = (WxAllBill) o; | |||
| if (name.equals("id")) { | |||
| @@ -57,7 +57,7 @@ public class PrintBillDataHandler implements PrintDataParser{ | |||
| return receive.getEnergyFeesName(); | |||
| } | |||
| if (null != feesMap && null != receive.getEnergyFeesId()) { | |||
| WxEnergyFees f = feesMap.get(receive.getEnergyFeesId()); | |||
| WxFinanceFees f = feesMap.get(receive.getEnergyFeesId()); | |||
| if (null != f) { | |||
| return f.getName(); | |||
| } | |||
| @@ -10,7 +10,7 @@ import org.springframework.stereotype.Service; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxShop; | |||
| @@ -33,7 +33,7 @@ public class PrintFinanceReceiveDataHandler implements PrintDataParser{ | |||
| @Override | |||
| public Object getObjectValue(String name, Object o, Object... params) { | |||
| Map<Long, WxShop> shopMap = (Map<Long, WxShop>) params[0]; | |||
| Map<Long, WxEnergyFees> feesMap = (Map<Long, WxEnergyFees>) params[1]; | |||
| Map<Long, WxFinanceFees> feesMap = (Map<Long, WxFinanceFees>) params[1]; | |||
| Map<Long, WxShopUsersInfo> shopUserMap = (Map<Long, WxShopUsersInfo>) params[2]; | |||
| WxFinanceReceive receive = (WxFinanceReceive) o; | |||
| if (name.equals("id")) { | |||
| @@ -6,7 +6,7 @@ import java.util.Map; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxShop; | |||
| @@ -21,7 +21,7 @@ public class PrintMerchantSettleDataHandler implements PrintDataParser{ | |||
| @Override | |||
| public Object getObjectValue(String name, Object o,Object... params) { | |||
| Map<Long, WxShop> shopMap = (Map<Long, WxShop>) params[0]; | |||
| Map<Long, WxEnergyFees> feesMap = (Map<Long, WxEnergyFees>) params[1]; | |||
| Map<Long, WxFinanceFees> feesMap = (Map<Long, WxFinanceFees>) params[1]; | |||
| Map<Long, WxShopUsersInfo> shopUserMap = (Map<Long, WxShopUsersInfo>) params[2]; | |||
| WxShopBillVo receive = (WxShopBillVo) o; | |||
| //根据科目来查询对应的信息 | |||
| @@ -6,7 +6,7 @@ import org.springframework.stereotype.Service; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinanceReceiveBill; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| @@ -20,12 +20,12 @@ public class PrintMerchantSettleItemDataHandler implements PrintDataParser{ | |||
| @Override | |||
| public Object getObjectValue(String name, Object o,Object... params) { | |||
| Map<Long, WxMerchant> merchantMap = (Map<Long, WxMerchant>) params[0]; | |||
| Map<Long, WxEnergyFees> feesMap = (Map<Long, WxEnergyFees>) params[1]; | |||
| Map<Long, WxFinanceFees> feesMap = (Map<Long, WxFinanceFees>) params[1]; | |||
| Map<Long,String> shopNumber = (Map<Long, String>) params[2]; | |||
| WxBillSum receive = (WxBillSum) o; | |||
| if (name.equals("energyFeesId")) { | |||
| if (null != feesMap && null != receive.getEnergyFeesId()) { | |||
| WxEnergyFees f = feesMap.get(receive.getEnergyFeesId()); | |||
| WxFinanceFees f = feesMap.get(receive.getEnergyFeesId()); | |||
| if (null != f) { | |||
| return f.getName(); | |||
| } | |||
| @@ -6,7 +6,7 @@ import org.springframework.stereotype.Service; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinanceReceiveBill; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.print.data.PrintDataParser; | |||
| @@ -19,7 +19,7 @@ public class PrintReceiveBillDataHandler implements PrintDataParser{ | |||
| @Override | |||
| public Object getObjectValue(String name, Object o,Object... params) { | |||
| Map<Long, WxMerchant> merchantMap = (Map<Long, WxMerchant>) params[0]; | |||
| Map<Long, WxEnergyFees> feesMap = (Map<Long, WxEnergyFees>) params[1]; | |||
| Map<Long, WxFinanceFees> feesMap = (Map<Long, WxFinanceFees>) params[1]; | |||
| Map<Long,String> shopNumber = (Map<Long, String>) params[2]; | |||
| WxFinanceReceiveBill receive = (WxFinanceReceiveBill) o; | |||
| if (name.equals("id")) { | |||
| @@ -38,7 +38,7 @@ public class PrintReceiveBillDataHandler implements PrintDataParser{ | |||
| return receive.getFeesName(); | |||
| } | |||
| if (null != feesMap && null != receive.getFeesId()) { | |||
| WxEnergyFees f = feesMap.get(receive.getFeesId()); | |||
| WxFinanceFees f = feesMap.get(receive.getFeesId()); | |||
| if (null != f) { | |||
| return f.getName(); | |||
| } | |||
| @@ -8,7 +8,6 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| @@ -76,8 +75,6 @@ public interface WxAllBillService { | |||
| void rentContractStop(WxRentContract rentContract,MallUserInfo user); | |||
| void propertyContractStop(WxPropertyContract propertyContract,MallUserInfo user); | |||
| void stopMerchantBills(WxMerchant wxMerchant,MallUserInfo userInfo); | |||
| void insertBills(String tenantId,List<WxAllBill> bills); | |||
| @@ -12,9 +12,9 @@ import org.springframework.web.multipart.MultipartFile; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxEnergyFeesSetoff; | |||
| import com.iformall.domain.po.WxEnergyFeesShop; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinanceFeesSetoff; | |||
| import com.iformall.domain.po.WxFeesCalcuteShop; | |||
| import com.iformall.domain.po.WxEnergyFeesTime; | |||
| import com.iformall.domain.po.WxEnergyMeter; | |||
| import com.iformall.domain.po.WxEnergyMeterChild; | |||
| @@ -53,23 +53,23 @@ public interface WxEnergyService { | |||
| List<Date> findLastTimeEndGroup(WxEnergyFeesTime record); | |||
| //费用科目 | |||
| PageInfo<WxEnergyFees> feesListAsPage(WxEnergyFees record, Integer pageIndex, Integer pageSize,boolean isSetOff); | |||
| void saveOrUpdateFees(WxEnergyFees record); | |||
| WxEnergyFees getFeesById(Long id,String tenantId); | |||
| void setFeesIsDel(WxEnergyFees record); | |||
| Map<Long,WxEnergyFees> getFeesMap(WxEnergyFees record); | |||
| PageInfo<WxFinanceFees> feesListAsPage(WxFinanceFees record, Integer pageIndex, Integer pageSize,boolean isSetOff); | |||
| void saveOrUpdateFees(WxFinanceFees record); | |||
| WxFinanceFees getFeesById(Long id,String tenantId); | |||
| void setFeesIsDel(WxFinanceFees record); | |||
| Map<Long,WxFinanceFees> getFeesMap(WxFinanceFees record); | |||
| void initEnergyFees(TenantEntity tenantEntity); | |||
| List<Long> getAdvanceSetoffFeesids(WxEnergyFeesSetoff setoff); | |||
| List<Long> getFeesIdList(WxEnergyFees record); | |||
| List<Long> getAdvanceSetoffFeesids(WxFinanceFeesSetoff setoff); | |||
| List<Long> getFeesIdList(WxFinanceFees record); | |||
| //计算标砖 | |||
| List<Map<String,String>> getFeesShopComponentList(WxEnergyFeesShop record); | |||
| void createFeesShop(WxEnergyFeesShop record); | |||
| void deleteFeesShop(WxEnergyFeesShop record); | |||
| WxEnergyFeesShop getFeesShop(Long id,String tenantId); | |||
| void updateFeesShop(WxEnergyFeesShop record); | |||
| PageInfo<WxEnergyFeesShop> feesShopListAsPage(WxEnergyFeesShop record, Integer pageIndex, Integer pageSize); | |||
| void exportFeesShop(WxEnergyFeesShop record,HttpServletRequest request, HttpServletResponse response); | |||
| List<Map<String,String>> getFeesShopComponentList(WxFeesCalcuteShop record); | |||
| void createFeesShop(WxFeesCalcuteShop record); | |||
| void deleteFeesShop(WxFeesCalcuteShop record); | |||
| WxFeesCalcuteShop getFeesShop(Long id,String tenantId); | |||
| void updateFeesShop(WxFeesCalcuteShop record); | |||
| PageInfo<WxFeesCalcuteShop> feesShopListAsPage(WxFeesCalcuteShop record, Integer pageIndex, Integer pageSize); | |||
| void exportFeesShop(WxFeesCalcuteShop record,HttpServletRequest request, HttpServletResponse response); | |||
| void importFeesShop(MultipartFile mFile, MallUserInfo user, HttpServletRequest request, HttpServletResponse response); | |||
| //抄表数据 | |||
| @@ -16,7 +16,7 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.SysConfig; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFeesShop; | |||
| import com.iformall.domain.po.WxFeesCalcuteShop; | |||
| import com.iformall.domain.po.WxFinanceCheckOut; | |||
| import com.iformall.domain.po.WxFinanceFinish; | |||
| import com.iformall.domain.po.WxFinanceFinishReceive; | |||
| @@ -1,98 +0,0 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.math.BigDecimal; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| */ | |||
| public interface WxPropertyContractService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize); | |||
| List<WxPropertyContract> findList(WxPropertyContract record); | |||
| List<Long> findIdList(WxPropertyContract record); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| Map<String, Object> getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * @param record | |||
| * @param userId | |||
| * @param userName | |||
| * @return | |||
| */ | |||
| ResultData save(WxPropertyContract record, MallUserInfo user, String userName,boolean writeComplate); | |||
| ResultData updateMoney(WxPropertyContract record, MallUserInfo user, String userName,boolean writeComplate); | |||
| ResultData updateFile(WxPropertyContract record, MallUserInfo user, String userName,boolean writeComplate); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| void download(HttpServletRequest request, HttpServletResponse response); | |||
| ResultData updatePropertyContractStatus(Long id); | |||
| void endContract(WxPropertyContract wxPropertyContract,MallUserInfo userInfo); | |||
| void updatePropertyPreviewBill(WxPropertyContract record); | |||
| List<WxAllBill> getWxBillPropertyPreview(TenantEntity tenantEntity,Long id); | |||
| WxPropertyContract getByBill(WxAllBill billRent); | |||
| ResultData apply(WxPropertyContract wxPropertyContract,MallUserInfo user); | |||
| void renewal(WxPropertyContract wxPropertyContract,MallUserInfo user,boolean aliasRentContract); | |||
| void transfer(WxPropertyContract wxPropertyContract,MallUserInfo user); | |||
| void outDateContract(WxMall wxMall); | |||
| void readyToNomal(WxMall wxMall); | |||
| WxPropertyContract getSimpleDetail(@Param("id") Long id); | |||
| void updatePropertyContract(WxPropertyContract record); | |||
| void deletePreviewBill(WxPropertyContract record); | |||
| void setEndContractTime(WxPropertyContract proertyContract); | |||
| List<WxPropertyContract> findToEndContractList(WxPropertyContract record); | |||
| //查询还有多少天到期的合同 | |||
| List<WxPropertyContract> findToOutDateContracts(TenantEntity tenantEntity); | |||
| BigDecimal calcuteContractUsedShopArea(WxPropertyContract record); | |||
| } | |||
| @@ -5,7 +5,6 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxRentContractFreePeriod; | |||
| import com.iformall.domain.po.WxRentContractRevenueJump; | |||
| @@ -49,7 +48,7 @@ public interface WxRentContractService { | |||
| * @param id | |||
| * @return | |||
| */ | |||
| Map<String, Object> getById(Long id,Integer noBillList); | |||
| //Map<String, Object> getById(Long id,Integer noBillList); | |||
| WxRentContract selectById(Long id); | |||
| /** | |||
| @@ -59,13 +58,13 @@ public interface WxRentContractService { | |||
| * @param userName | |||
| * @return | |||
| */ | |||
| ResultData save(WxRentContract record,MallUserInfo user,String userName,Date oldRentStartDate); | |||
| //ResultData save(WxRentContract record,MallUserInfo user,String userName,Date oldRentStartDate); | |||
| ResultData update(WxRentContract record, MallUserInfo user,String userName,int from,Date oldRentStartDate,boolean writeComplate,boolean setRevenJumps); | |||
| //ResultData update(WxRentContract record, MallUserInfo user,String userName,int from,Date oldRentStartDate,boolean writeComplate,boolean setRevenJumps); | |||
| ResultData updateOneStep(WxRentContract record, MallUserInfo user,String userName,int from,Date oldRentStartDate,boolean writeComplate); | |||
| //ResultData updateOneStep(WxRentContract record, MallUserInfo user,String userName,int from,Date oldRentStartDate,boolean writeComplate); | |||
| ResultData updateRentStartTime(WxRentContract record, MallUserInfo user); | |||
| //ResultData updateRentStartTime(WxRentContract record, MallUserInfo user); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -81,11 +80,11 @@ public interface WxRentContractService { | |||
| ResultData updateRentContract(WxRentContract wxRentContract); | |||
| PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize); | |||
| //PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize); | |||
| //void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId); | |||
| ResultData updateFile(WxRentContract wxRentContract, MallUserInfo user,String userName,boolean writeComplate); | |||
| //ResultData updateFile(WxRentContract wxRentContract, MallUserInfo user,String userName,boolean writeComplate); | |||
| ResultData updateRentContractStatus(Long id,boolean buildPropertyBill); | |||
| @@ -93,22 +92,22 @@ public interface WxRentContractService { | |||
| void updateApplyStatus(WxRentContract wxRentContract); | |||
| public List<Date> getYearList(int years,int month,Date rentalStartDate,Date endContractTime ); | |||
| List<WxAllBill> buildRent(MallUserInfo user,WxRentContract rentContract,Integer isPreview,boolean saveDb); | |||
| List<Date> getYearList(int years,int month,Date rentalStartDate,Date endContractTime ); | |||
| //List<WxAllBill> buildRent(MallUserInfo user,WxRentContract rentContract,Integer isPreview,boolean saveDb); | |||
| void buildDeposit( TenantEntity tenantEntity,MallUserInfo user,Long rentContractId); | |||
| //void buildDeposit( TenantEntity tenantEntity,MallUserInfo user,Long rentContractId); | |||
| //void updateInvalidContract(Long rentContractId); | |||
| ResultData hasRentStatus(WxRentContract wxRentContract); | |||
| //ResultData hasRentStatus(WxRentContract wxRentContract); | |||
| ResultData hasContractNumber(WxRentContract wxRentContract); | |||
| //ResultData hasContractNumber(WxRentContract wxRentContract); | |||
| //Integer getShopType(WxRentContract wxRentContract); | |||
| ResultData endContract(WxRentContract wxRentContract,MallUserInfo userInfo); | |||
| void updatePropertyPreviewBill(WxRentContract record); | |||
| //void updatePropertyPreviewBill(WxRentContract record); | |||
| //Map<String, Object> updateStatus(WxRentContract record); | |||
| @@ -118,11 +117,11 @@ public interface WxRentContractService { | |||
| //int selectContractCountByShopId(WxRentContract wxRentContract); | |||
| ResultData getContractByContractNumber(WxRentContract wxRentContract); | |||
| //ResultData getContractByContractNumber(WxRentContract wxRentContract); | |||
| ResultData apply(WxRentContract wxRentContract,MallUserInfo user); | |||
| void renewal(WxRentContract wxRentContract,WxPropertyContract property,MallUserInfo user); | |||
| void renewal(WxRentContract wxRentContract,MallUserInfo user); | |||
| void transfer(WxRentContract wxRentContract,MallUserInfo user); | |||
| @@ -133,7 +132,7 @@ public interface WxRentContractService { | |||
| void outDateContract(WxMall wxMall); | |||
| //查询还有多少天到期的合同 | |||
| List<WxRentContract> findToOutDateContracts(TenantEntity tenantEntity); | |||
| //List<WxRentContract> findToOutDateContracts(TenantEntity tenantEntity); | |||
| /** | |||
| * 已签约未计租 变为计租中 | |||
| @@ -155,11 +154,11 @@ public interface WxRentContractService { | |||
| List<RentContractFreePeriodVo> getFreePeriods(WxRentContract wxRentContract); | |||
| void saveFreePeriods(WxRentContract wxRentContract); | |||
| //void saveFreePeriods(WxRentContract wxRentContract); | |||
| List<WxRentContractRevenueSales> getContractSales(WxRentContract wxRentContract); | |||
| WxRentContractRevenueSetSalesVo setRevenueSales(MallUserInfo user,WxRentContract rentcontract,String sales,Date startime, Date endtime,Long propertyContractId); | |||
| WxRentContractRevenueSetSalesVo setRevenueSales(MallUserInfo user,WxRentContract rentcontract,String sales,Date startime, Date endtime); | |||
| void setContractSalesConfirm(WxRentContract wxRentContract); | |||
| @@ -167,7 +166,7 @@ public interface WxRentContractService { | |||
| List<WxRentContractRevenueJump> findJumpList(WxRentContractRevenueJump jump); | |||
| List<WxRentContractYearsVo> getRentContractYears(WxRentContract rentContract); | |||
| //List<WxRentContractYearsVo> getRentContractYears(WxRentContract rentContract); | |||
| BigDecimal calcuteContractUsedShopArea(WxRentContract wxRentContract,Long shopId); | |||
| @@ -1,21 +0,0 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxRentPropertyContractService { | |||
| PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize); | |||
| ResultData getContractInfo(Long rentId,Long propertyId); | |||
| ResultData getContractApplyInfo(Long rentId,Long propertyId); | |||
| ResultData insertRentForCreate(WxRentContract wxRentContract); | |||
| } | |||
| @@ -25,10 +25,10 @@ import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.SysConfig; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.WxShopUsers; | |||
| @@ -39,7 +39,6 @@ import com.iformall.domain.vo.WxBillNotify; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import com.iformall.domain.vo.WxShopVo; | |||
| import com.iformall.enums.EnumBillAction; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillDailyType; | |||
| import com.iformall.enums.EnumBillOweOrNearType; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| @@ -50,6 +49,7 @@ import com.iformall.enums.EnumSystemUserType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxAllBillService; | |||
| import com.iformall.service.WxBillActionService; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxMallService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxShopService; | |||
| @@ -76,6 +76,9 @@ public class WxBillAllHelper { | |||
| @Autowired | |||
| private WxMallService wxMallService; | |||
| @Autowired | |||
| private WxEnergyService wxEnergyService; | |||
| public Date getDateBefore(Integer afterDays) { | |||
| Date nowBegin = DateUtils.getDayBegin(new Date()); | |||
| //return DateUtils.getDateTimeBefore(afterDays*3600*24, nowBegin); | |||
| @@ -202,8 +205,8 @@ public class WxBillAllHelper { | |||
| bq.updateTenantInfo(tenantEntity); | |||
| bq.setRentContractId(rentContractId); | |||
| bq.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| bq.setBillType(EnumBillAllType.RENT.getCode()); | |||
| bq.setEnergyFeesId(EnumBillAllType.RENT.getEnergyFeesId()); | |||
| //bq.setBillType(EnumBillAllType.RENT.getCode()); | |||
| //bq.setEnergyFeesId(EnumBillAllType.RENT.getEnergyFeesId()); | |||
| //bq.setNoExtraCreateFrom(EnumYesOrNo.YES.getCode()); | |||
| bq.setStarttimeEqual(starttime); | |||
| bq.setEndtimeEqual(endtime); | |||
| @@ -311,8 +314,8 @@ public class WxBillAllHelper { | |||
| exportFileName = exportFileName+"_"+su.getName(); | |||
| } | |||
| } | |||
| result.put("billTypeName", bill.getBillTypeName()); | |||
| exportFileName = exportFileName +"_"+ bill.getBillTypeName(); | |||
| //result.put("billTypeName", bill.getName()); | |||
| //exportFileName = exportFileName +"_"+ bill.getBillTypeName(); | |||
| result.put("billRemark", bill.getBillRemark()); | |||
| result.put("receivePay", bill.getReceivePay()); | |||
| result.put("pay", bill.getPay()); | |||
| @@ -396,10 +399,11 @@ public class WxBillAllHelper { | |||
| String endTimeStr = DateUtils.date2String(endTime,DateUtils.DATE_TIME_PATTERN); | |||
| boolean isUpdate = false; | |||
| action.setBillId(bill.getId()); | |||
| action.setBillType(bill.getBillType()); | |||
| WxFinanceFees fees = wxEnergyService.getFeesById(bill.getEnergyFeesId(), bill.getTenantId()); | |||
| //action.setBillType(bill.getBillType()); | |||
| String oldReceivePay = bill.getReceivePay(); | |||
| boolean isAllReturn = false; | |||
| if (EnumBillAllType.getEnum(bill.getBillType()).isDeposit()) { | |||
| if (fees.getIsDespoit().intValue() == EnumYesOrNo.YES.getCode().intValue()) { | |||
| isAllReturn = true; | |||
| } | |||
| //如果账单的开始时间在结束时间之后,已经支付了的要退回。 | |||
| @@ -462,15 +466,6 @@ public class WxBillAllHelper { | |||
| wxAllBillService.rentContractStop(rentContract, user); | |||
| } | |||
| //物业合同终止,物业押金需全额退回,物业账单需重新计算 | |||
| public void propertyContractStop(WxPropertyContract propertyContract,MallUserInfo user) { | |||
| if (null == user) { | |||
| user = getSystemUser(propertyContract); | |||
| } | |||
| //物业账单 | |||
| wxAllBillService.propertyContractStop(propertyContract, user); | |||
| } | |||
| public void saveOrUpdateBill(WxAllBill bill,MallUserInfo user) { | |||
| wxAllBillService.saveOrUpdate(bill, user); | |||
| } | |||
| @@ -12,8 +12,8 @@ import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxEnergyFeesShop; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFeesCalcuteShop; | |||
| import com.iformall.domain.po.WxEnergyFeesTime; | |||
| import com.iformall.domain.po.WxEnergyMeter; | |||
| import com.iformall.domain.po.WxEnergyMeterReading; | |||
| @@ -21,7 +21,6 @@ import com.iformall.domain.po.WxMallBuilding; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumEnergyMeterPhysicsType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.mapper.WxEnergyMeterMapper; | |||
| @@ -194,60 +193,61 @@ public class WxEnergyHelper { | |||
| * @param shopfee | |||
| * @return | |||
| */ | |||
| public String calcuteMoney(StringBuffer sb,BigDecimal totalArea,WxShop shop,WxEnergyFeesTime time,WxEnergyFees fees, WxEnergyFeesShop shopfee, | |||
| public String calcuteMoney(StringBuffer sb,BigDecimal totalArea,WxShop shop,WxEnergyFeesTime time,WxFinanceFees fees, WxFeesCalcuteShop shopfee, | |||
| List<Long> userMeterList,Map<Long,List<Long>> summaryMeterMap,Map<Long,BigDecimal> buildingAreaMap,Map<Long, BigDecimal> floorAreaMap) { | |||
| if (StringUtils.isBlank(shopfee.getPrice())) { | |||
| return "0"; | |||
| } | |||
| //如果是公摊,或者非能源费用,则用公式计算 | |||
| if (shopfee.getIsPublic() == EnumYesOrNo.YES.getCode() || fees.getBillType() != EnumBillAllType.DAILY.getCode()) { | |||
| //替代占位符为真实数据 | |||
| //公摊总表数据,根据公摊总表下的公共表来查询所有的读数 | |||
| Map<Long,BigDecimal> meterNumberMap = null; | |||
| if (null != summaryMeterMap) { | |||
| meterNumberMap = new HashMap<Long,BigDecimal>(); | |||
| for (Iterator<Long> it = summaryMeterMap.keySet().iterator(); it.hasNext();) { | |||
| Long sumaryMeterId = it.next(); | |||
| List<Long> childmids = summaryMeterMap.get(sumaryMeterId); | |||
| //查询子表的总读数 | |||
| WxEnergyMeterReading mrq = new WxEnergyMeterReading(); | |||
| mrq.updateTenantInfo(shopfee); | |||
| mrq.setMeterIds(childmids); | |||
| mrq.setStartTime(time.getStartTime()); | |||
| mrq.setEndTime(time.getEndTime()); | |||
| mrq.setIsConfirm(EnumYesOrNo.YES.getCode()); | |||
| BigDecimal totalNumber = wxEnergyMeterReadingMapper.findNumberSum(mrq); | |||
| if (null == totalNumber || totalNumber.compareTo(new BigDecimal(0)) <= 0 ) { | |||
| totalNumber = new BigDecimal(0); | |||
| } | |||
| meterNumberMap.put(sumaryMeterId, totalNumber); | |||
| } | |||
| } | |||
| String formula = replaceFormulaData(shopfee.getFormula(),totalArea,shop,buildingAreaMap,floorAreaMap,meterNumberMap); | |||
| if (null != formula) { | |||
| return new BigDecimal(FormulaParser.evaluate(formula)).multiply(new BigDecimal(shopfee.getPrice())).setScale(2,BigDecimal.ROUND_HALF_UP).toPlainString(); | |||
| } | |||
| return "0"; | |||
| }else { | |||
| //如果是用户能耗 | |||
| if (null == userMeterList || userMeterList.size() <= 0 ) { | |||
| return "0"; | |||
| } | |||
| //根据表,区间的开始日期,结束日期来查询抄表数据。 | |||
| WxEnergyMeterReading mrq = new WxEnergyMeterReading(); | |||
| mrq.updateTenantInfo(shopfee); | |||
| mrq.setMeterIds(userMeterList); | |||
| mrq.setStartTime(time.getStartTime()); | |||
| mrq.setEndTime(time.getEndTime()); | |||
| mrq.setIsConfirm(EnumYesOrNo.YES.getCode()); | |||
| BigDecimal totalNumber = wxEnergyMeterReadingMapper.findNumberSum(mrq); | |||
| if (null == totalNumber || totalNumber.compareTo(new BigDecimal(0)) <= 0 ) { | |||
| return "0"; | |||
| } | |||
| sb.append("表总度数"+totalNumber.toPlainString()+",单价:"+shopfee.getPrice()); | |||
| return totalNumber.multiply(new BigDecimal(shopfee.getPrice())).setScale(2,BigDecimal.ROUND_HALF_UP).toPlainString(); | |||
| } | |||
| // //如果是公摊,或者非能源费用,则用公式计算 | |||
| // if (shopfee.getIsPublic() == EnumYesOrNo.YES.getCode() || fees.getBillType() != EnumBillAllType.DAILY.getCode()) { | |||
| // //替代占位符为真实数据 | |||
| // //公摊总表数据,根据公摊总表下的公共表来查询所有的读数 | |||
| // Map<Long,BigDecimal> meterNumberMap = null; | |||
| // if (null != summaryMeterMap) { | |||
| // meterNumberMap = new HashMap<Long,BigDecimal>(); | |||
| // for (Iterator<Long> it = summaryMeterMap.keySet().iterator(); it.hasNext();) { | |||
| // Long sumaryMeterId = it.next(); | |||
| // List<Long> childmids = summaryMeterMap.get(sumaryMeterId); | |||
| // //查询子表的总读数 | |||
| // WxEnergyMeterReading mrq = new WxEnergyMeterReading(); | |||
| // mrq.updateTenantInfo(shopfee); | |||
| // mrq.setMeterIds(childmids); | |||
| // mrq.setStartTime(time.getStartTime()); | |||
| // mrq.setEndTime(time.getEndTime()); | |||
| // mrq.setIsConfirm(EnumYesOrNo.YES.getCode()); | |||
| // BigDecimal totalNumber = wxEnergyMeterReadingMapper.findNumberSum(mrq); | |||
| // if (null == totalNumber || totalNumber.compareTo(new BigDecimal(0)) <= 0 ) { | |||
| // totalNumber = new BigDecimal(0); | |||
| // } | |||
| // meterNumberMap.put(sumaryMeterId, totalNumber); | |||
| // } | |||
| // } | |||
| // String formula = replaceFormulaData(shopfee.getFormula(),totalArea,shop,buildingAreaMap,floorAreaMap,meterNumberMap); | |||
| // if (null != formula) { | |||
| // return new BigDecimal(FormulaParser.evaluate(formula)).multiply(new BigDecimal(shopfee.getPrice())).setScale(2,BigDecimal.ROUND_HALF_UP).toPlainString(); | |||
| // } | |||
| // return "0"; | |||
| // }else { | |||
| // //如果是用户能耗 | |||
| // if (null == userMeterList || userMeterList.size() <= 0 ) { | |||
| // return "0"; | |||
| // } | |||
| // //根据表,区间的开始日期,结束日期来查询抄表数据。 | |||
| // WxEnergyMeterReading mrq = new WxEnergyMeterReading(); | |||
| // mrq.updateTenantInfo(shopfee); | |||
| // mrq.setMeterIds(userMeterList); | |||
| // mrq.setStartTime(time.getStartTime()); | |||
| // mrq.setEndTime(time.getEndTime()); | |||
| // mrq.setIsConfirm(EnumYesOrNo.YES.getCode()); | |||
| // BigDecimal totalNumber = wxEnergyMeterReadingMapper.findNumberSum(mrq); | |||
| // if (null == totalNumber || totalNumber.compareTo(new BigDecimal(0)) <= 0 ) { | |||
| // return "0"; | |||
| // } | |||
| // sb.append("表总度数"+totalNumber.toPlainString()+",单价:"+shopfee.getPrice()); | |||
| // return totalNumber.multiply(new BigDecimal(shopfee.getPrice())).setScale(2,BigDecimal.ROUND_HALF_UP).toPlainString(); | |||
| // | |||
| // } | |||
| return "0"; | |||
| } | |||
| @@ -20,8 +20,7 @@ import org.slf4j.LoggerFactory; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.domain.dto.NeedPayDTO; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.vo.BillTimeVo; | |||
| import com.iformall.domain.vo.WxBillFeesStandardsListVo; | |||
| @@ -12,9 +12,8 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxContractCustomers; | |||
| import com.iformall.domain.po.WxContractShop; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxRentContractAgileDeposit; | |||
| import com.iformall.domain.po.WxRentContractAgileDepositShop; | |||
| @@ -25,7 +24,6 @@ import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.WxShopUsers; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.BillTimeVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillExtraCreateFrom; | |||
| import com.iformall.enums.EnumContractCustomersStatus; | |||
| import com.iformall.enums.EnumFeesShopTimeType; | |||
| @@ -241,12 +239,6 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| record.setUpdatetime(new Date()); | |||
| record.setUpdateBy(user.getId()); | |||
| record.setUpdateByName(user.getName()); | |||
| if (StringUtils.isEmpty(record.getPrice())) { | |||
| record.setPrice("0"); | |||
| } | |||
| if (StringUtils.isEmpty(record.getDeposit())) { | |||
| record.setDeposit("0"); | |||
| } | |||
| List<Long> shopList = record.shopIdsByRentInfo(); | |||
| setShops(record,shopList); | |||
| //关联客户 | |||
| @@ -525,13 +517,13 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| if (null == list || list.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(unDeposit); | |||
| fq.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < list.size() ; i ++) { | |||
| WxRentContractAgileUnDeposit ud = list.get(i); | |||
| WxEnergyFees fees = feesMap.get(ud.getFeesId()); | |||
| WxFinanceFees fees = feesMap.get(ud.getFeesId()); | |||
| if (null != fees) { | |||
| ud.setFeesName(fees.getName()); | |||
| } | |||
| @@ -553,9 +545,9 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| if (null == depositList || depositList.size() <= 0 ) { | |||
| return; | |||
| } | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(wxRentContract); | |||
| Map<Long,WxEnergyFees> typeMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long,WxFinanceFees> typeMap = wxEnergyService.getFeesMap(fq); | |||
| //根据关联的店铺面积来分金额 | |||
| Map<Long, BigDecimal> shopAreaRateMap = wxRentContract.getRentShopArea(); | |||
| @@ -574,7 +566,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| for (int i = 0 ; i < depositList.size(); i++) { | |||
| WxRentContractAgileDeposit deposit = depositList.get(i); | |||
| WxEnergyFees fees = typeMap.get(deposit.getFeesId()); | |||
| WxFinanceFees fees = typeMap.get(deposit.getFeesId()); | |||
| List<Long> depositShopIdList = deposit.getShopIdList(); | |||
| for (int j = 0 ; j < depositShopIdList.size(); j++ ) { | |||
| @@ -598,7 +590,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| wxBillDeposit.setId(idWorker.nextId()); | |||
| wxBillDeposit.updateTenantInfo(wxRentContract); | |||
| wxBillDeposit.setRentContractId(wxRentContract.getId()); | |||
| wxBillDeposit.setBillType(fees.getBillType()); | |||
| //wxBillDeposit.setBillType(fees.getBillType()); | |||
| wxBillDeposit.setIsPreview(EnumYesOrNo.YES.getCode()); | |||
| wxBillDeposit.setCanEdit(EnumYesOrNo.NO.getCode()); | |||
| wxBillDeposit.setPriceDetail(fees.getName()); | |||
| @@ -649,7 +641,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| if (null == unDeposit.getItems() || unDeposit.getItems().size() <= 0 ) { | |||
| return; | |||
| } | |||
| WxEnergyFees fees = wxEnergyService.getFeesById(unDeposit.getFeesId(), unDeposit.getTenantId()); | |||
| WxFinanceFees fees = wxEnergyService.getFeesById(unDeposit.getFeesId(), unDeposit.getTenantId()); | |||
| EnumFeesShopTimeType creatRule = EnumFeesShopTimeType.getEnum(unDeposit.getFeesCreateRule()); | |||
| EnumRentContractAgilTimeUnit timeUnit = EnumRentContractAgilTimeUnit.getEnum(unDeposit.getTimeUnit()); | |||
| WxRentContract contract = wxRentContractMapper.selectById(unDeposit.getRentContractId()); | |||
| @@ -705,7 +697,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| } | |||
| private List<WxAllBill> generateUnDepositBill(List<Long> shopIdList,Map<Long, BigDecimal> shopAreaMap,Map<Long, WxShopUsers> shopUserMap,WxRentContract contract, | |||
| final IdWorker idWorker,WxRentContractAgileUnDeposit unDeposit,WxEnergyFees fees,Date start,Date end,Date receiveDate,String needpay, | |||
| final IdWorker idWorker,WxRentContractAgileUnDeposit unDeposit,WxFinanceFees fees,Date start,Date end,Date receiveDate,String needpay, | |||
| WxRentContractAgileUnDepositItem item,MallUserInfo user) { | |||
| List<WxAllBill> billList = new ArrayList<WxAllBill>(); | |||
| //如果是按合同,则按照铺来分 | |||
| @@ -740,7 +732,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| return billList; | |||
| } | |||
| private WxAllBill buildUnDepositBill(TenantEntity tenantEntity,final IdWorker idWorker,Long rentContractId,WxEnergyFees fees, | |||
| private WxAllBill buildUnDepositBill(TenantEntity tenantEntity,final IdWorker idWorker,Long rentContractId,WxFinanceFees fees, | |||
| Long shopId,String cusName,Date start,Date end,Date receiveDate,String needpay,String rentArea,MallUserInfo user) { | |||
| WxAllBill wxBillRent = new WxAllBill(); | |||
| wxBillRent.setIsPreview(EnumYesOrNo.YES.getCode()); | |||
| @@ -748,7 +740,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| wxBillRent.setRentContractId(rentContractId); | |||
| wxBillRent.setRentContractAgileFeesType(EnumRentContractAgileFeesType.UN_DEPOSIT.getCode()); | |||
| wxBillRent.setEnergyFeesId(fees.getId()); | |||
| wxBillRent.setBillType(fees.getBillType()); | |||
| //wxBillRent.setBillType(fees.getBillType()); | |||
| wxBillRent.setPay("0"); | |||
| wxBillRent.setStarttime(start); | |||
| wxBillRent.setEndtime(end); | |||
| @@ -926,9 +918,9 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| rentContract.setStatus(EnumRentContractStatus.DRAFT.getCode()); | |||
| rentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode()); | |||
| rentContract.setEndContractTime(null); | |||
| rentContract.setFirstBillDateStart(null); | |||
| rentContract.setFirstBillDateEnd(null); | |||
| rentContract.setFirstBillReceiveDate(null); | |||
| //rentContract.setFirstBillDateStart(null); | |||
| //rentContract.setFirstBillDateEnd(null); | |||
| //rentContract.setFirstBillReceiveDate(null); | |||
| int[] array = DateUtils.getDiff(rentContract.getRentalStartDate(),rentContract.getRentalEndDate()); | |||
| rentContract.setLease(array[0]); | |||
| //rentContract.setAdjustRatio(); | |||
| @@ -13,10 +13,9 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.WxShopUsers; | |||
| @@ -27,7 +26,6 @@ import com.iformall.domain.vo.WxBillHotNotify; | |||
| import com.iformall.domain.vo.WxBillNotify; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import com.iformall.enums.EnumBillAction; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumShopUsersStatus; | |||
| @@ -199,9 +197,9 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| shopUserMap = wxShopService.getShopUserMap(suq); | |||
| } | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < page.getList().size() ; i ++) { | |||
| WxAllBill e = page.getList().get(i); | |||
| if (null != e.getShopId()) { | |||
| @@ -224,7 +222,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| } | |||
| } | |||
| if (null != feesMap) { | |||
| WxEnergyFees f = feesMap.get(e.getEnergyFeesId()); | |||
| WxFinanceFees f = feesMap.get(e.getEnergyFeesId()); | |||
| if (null != f) { | |||
| e.setEnergyFeesName(f.getName()); | |||
| } | |||
| @@ -245,13 +243,13 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| updateQueryParam(wxBillRent); | |||
| List<WxBillHotNotify> list = wxAllBillMapper.getBillHotNotify(wxBillRent); | |||
| if (null != list && list.size() > 0 ){ | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(wxBillRent); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < list.size() ; i ++) { | |||
| WxBillHotNotify hn = list.get(i); | |||
| if (null != feesMap) { | |||
| WxEnergyFees fees = feesMap.get(hn.getEnergyFeesId()); | |||
| WxFinanceFees fees = feesMap.get(hn.getEnergyFeesId()); | |||
| if (null != fees) { | |||
| hn.setFeesName(fees.getName()); | |||
| } | |||
| @@ -534,7 +532,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(b.getId()); | |||
| wxBillAction.setBillType(b.getBillType()); | |||
| //wxBillAction.setBillType(b.getBillType()); | |||
| wxBillAction.setAction(EnumBillAction.STATUS_CHANGE.getCode()); | |||
| //wxBillAction.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null,null,null,EnumBillStatus.getEnum(b.getStatus()),EnumBillStatus.INVALID)); | |||
| wxBillAction.setRemark(wxShop.getBillCompleteRemark()); | |||
| @@ -688,47 +686,6 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| } | |||
| } | |||
| @Override | |||
| public void propertyContractStop(WxPropertyContract propertyContract, MallUserInfo user) { | |||
| WxAllBill brDel = new WxAllBill(); | |||
| brDel.setPropertyContractId(propertyContract.getId()); | |||
| brDel.setIsPreview(EnumYesOrNo.YES.getCode()); | |||
| brDel.updateTenantInfo(propertyContract); | |||
| wxAllBillMapper.deletePreviewBill(brDel); | |||
| brDel.setShopEndtime(propertyContract.getEndContractTime()); | |||
| wxAllBillMapper.deleteNoNeedPayBill(brDel); | |||
| WxAllBill br = new WxAllBill(); | |||
| br.setPropertyContractId(propertyContract.getId()); | |||
| //br.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| br.updateTenantInfo(propertyContract); | |||
| List<WxAllBill> brList = wxAllBillMapper.findList(br); | |||
| List<WxAllBill> realRentList = new ArrayList<WxAllBill>(); | |||
| List<WxBillAction> actionList = new ArrayList<WxBillAction>(); | |||
| if (null != brList && brList.size() > 0 ) { | |||
| for (int i = 0 ; i < brList.size() ; i ++ ) { | |||
| WxAllBill brent = brList.get(i); | |||
| WxBillAction action = new WxBillAction(); | |||
| boolean isUpdate = wxBillAllHelper.billEndCalcute(propertyContract.getDecimalSize() ,propertyContract.getEndContractTime(), brent, action); | |||
| if (isUpdate) { | |||
| realRentList.add(brent); | |||
| actionList.add(action); | |||
| } | |||
| } | |||
| } | |||
| for (int i = 0 ; i < realRentList.size() ; i ++) { | |||
| WxAllBill rbrent = realRentList.get(i); | |||
| rbrent.setEndtime(propertyContract.getEndContractTime()); | |||
| wxAllBillMapper.updateById(rbrent); | |||
| } | |||
| for (int i = 0 ; i < actionList.size() ; i ++) { | |||
| WxBillAction ba = actionList.get(i); | |||
| this.addBillAction(ba, user); | |||
| } | |||
| } | |||
| @Override | |||
| public void stopMerchantBills(WxMerchant wxMerchant, MallUserInfo userInfo) { | |||
| @@ -61,7 +61,7 @@ public class WxBillActionServiceImpl implements WxBillActionService { | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setId(idWorker.nextId()); | |||
| wxBillAction.setBillId(action.getBillId()); | |||
| wxBillAction.setBillType(action.getBillType()); | |||
| //wxBillAction.setBillType(action.getBillType()); | |||
| wxBillAction.setOldMoney(action.getOldMoney()); | |||
| wxBillAction.setNewMoney(action.getNewMoney()); | |||
| wxBillAction.setDetails(action.getDetails()); | |||
| @@ -87,12 +87,14 @@ public class WxBillActionServiceImpl implements WxBillActionService { | |||
| @Override | |||
| public List<WxBillJianMian> findJianMian(WxBillAction record) { | |||
| return wxBillActionMapper.findJianMian(record); | |||
| //return wxBillActionMapper.findJianMian(record); | |||
| return null; | |||
| } | |||
| @Override | |||
| public List<WxBillBad> findBad(WxBillAction record) { | |||
| return wxBillActionMapper.findBad(record); | |||
| //return wxBillActionMapper.findBad(record); | |||
| return null; | |||
| } | |||
| } | |||
| @@ -27,7 +27,7 @@ public class WxBillBaseService{ | |||
| protected void addBillAction(EnumBillAction billAction, Integer billType,Long billId, String oldMoney, String newMoney,String setoff,Date payDate,Long payWayId,String payWayName,String remark, EnumBillStatus oldStatus,EnumBillStatus newStatus,MallUserInfo mallUserInfo) { | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(billId); | |||
| wxBillAction.setBillType(billType); | |||
| //wxBillAction.setBillType(billType); | |||
| wxBillAction.setOldMoney(oldMoney); | |||
| wxBillAction.setNewMoney(newMoney); | |||
| wxBillAction.setDetails(billAction.getDescription(oldMoney, newMoney,setoff,payWayName,oldStatus,newStatus)); | |||
| @@ -42,7 +42,7 @@ public class WxBillBaseService{ | |||
| protected void addBillAction(EnumBillAction billAction, Integer billType,Long billId, String oldMoney, String newMoney,String setoff,Date payDate,Long payWayId,String payWayName,String remark,EnumBillStatus oldStatus,EnumBillStatus newStatus, WxMerchantBUser bUser) { | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(billId); | |||
| wxBillAction.setBillType(billType); | |||
| //wxBillAction.setBillType(billType); | |||
| wxBillAction.setOldMoney(oldMoney); | |||
| wxBillAction.setNewMoney(newMoney); | |||
| wxBillAction.setDetails(billAction.getDescription(oldMoney, newMoney,setoff,payWayName,oldStatus,newStatus)); | |||
| @@ -5,13 +5,11 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxScoreRules; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.WxBusinessMapper; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.WxMallService; | |||
| @@ -38,8 +36,6 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||
| WxBusinessMapper wxBusinessMapper; | |||
| @Autowired | |||
| private WxRentContractMapper wxRentContractMapper; | |||
| @Autowired | |||
| private WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| private WxMallService wxMallService; | |||
| @@ -14,9 +14,9 @@ import com.iformall.domain.dto.FloorBuildingIdDTO; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxShopBillVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumEnergyMeterPhysicsType; | |||
| import com.iformall.enums.EnumEnergyMeterShopFloorType; | |||
| import com.iformall.enums.EnumFeesType; | |||
| import com.iformall.enums.EnumFinanceCashierType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -67,11 +67,11 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| @Autowired | |||
| WxEnergyFeesTimeShopMapper wxEnergyFeesTimeShopMapper; | |||
| @Autowired | |||
| WxEnergyFeesMapper wxEnergyFeesMapper; | |||
| WxFinanceFeesMapper wxEnergyFeesMapper; | |||
| @Autowired | |||
| WxEnergyFeesShopMapper wxEnergyFeesShopMapper; | |||
| WxFeesCalcuteShopMapper wxEnergyFeesShopMapper; | |||
| @Autowired | |||
| WxEnergyFeesSetoffMapper wxEnergyFeesSetoffMapper; | |||
| WxFinanceFeesSetoffMapper wxEnergyFeesSetoffMapper; | |||
| @Autowired | |||
| WxEnergyReadingCalcuteMapper wxEnergyReadingCalcuteMapper; | |||
| @Autowired | |||
| @@ -576,21 +576,21 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| @Override | |||
| public PageInfo<WxEnergyFees> feesListAsPage(WxEnergyFees record, Integer pageIndex, Integer pageSize,boolean isSetOff) { | |||
| if (null == record.getCashierType()) { | |||
| record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| } | |||
| PageInfo<WxEnergyFees> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyFeesMapper.findList(record)); | |||
| public PageInfo<WxFinanceFees> feesListAsPage(WxFinanceFees record, Integer pageIndex, Integer pageSize,boolean isSetOff) { | |||
| // if (null == record.getCashierType()) { | |||
| // record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||
| // } | |||
| PageInfo<WxFinanceFees> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyFeesMapper.findList(record)); | |||
| //如果是预充费用,还需要查询可冲抵科目 | |||
| if (isSetOff) { | |||
| if (null != page && null != page.getList()) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> feesMap = this.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = this.getFeesMap(fq); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxEnergyFees at = page.getList().get(i); | |||
| WxFinanceFees at = page.getList().get(i); | |||
| WxEnergyFeesSetoff tf = new WxEnergyFeesSetoff(); | |||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||
| tf.updateTenantInfo(at); | |||
| tf.setAdvanceFeesId(at.getId()); | |||
| at.setFeesIds(wxEnergyFeesSetoffMapper.findFeesIdList(tf)); | |||
| @@ -602,25 +602,25 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| } | |||
| @Override | |||
| public void saveOrUpdateFees(WxEnergyFees record) { | |||
| public void saveOrUpdateFees(WxFinanceFees record) { | |||
| Date date = new Date(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| if (record.getId() == null) { | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateTime(date); | |||
| record.setUpdateTime(date); | |||
| record.setIsSystem(EnumYesOrNo.NO.getCode()); | |||
| //record.setIsSystem(EnumYesOrNo.NO.getCode()); | |||
| try { | |||
| wxEnergyFeesMapper.insert(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| if (record.getBillType().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | |||
| if (record.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()) { | |||
| if (null != record.getFeesIds()) { | |||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||
| Long feeid = record.getFeesIds().get(i); | |||
| WxEnergyFeesSetoff tf = new WxEnergyFeesSetoff(); | |||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||
| tf.updateTenantInfo(record); | |||
| tf.setId(idWorker.nextId()); | |||
| tf.setAdvanceFeesId(record.getId()); | |||
| @@ -632,71 +632,59 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| } | |||
| } | |||
| } else { | |||
| WxEnergyFees fees = this.getFeesById(record.getId(),record.getTenantId()); | |||
| WxFinanceFees fees = this.getFeesById(record.getId(),record.getTenantId()); | |||
| if (null == fees) { | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "记录未查询到"); | |||
| } | |||
| if (fees.getIsSystem().intValue() == EnumYesOrNo.YES.getCode().intValue() && StringUtils.isNotBlank(record.getTaxRate())) { | |||
| WxEnergyFees updatefees = new WxEnergyFees(); | |||
| updatefees.updateTenantInfo(record); | |||
| updatefees.setId(fees.getId()); | |||
| updatefees.setTaxRate(record.getTaxRate()); | |||
| updatefees.setUpdateTime(date); | |||
| wxEnergyFeesMapper.updateById(updatefees);; | |||
| }else { | |||
| record.setUpdateTime(date); | |||
| wxEnergyFeesMapper.updateById(record); | |||
| //如果是预充的,则需处理管理科目 | |||
| if (fees.getBillType().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | |||
| //先删掉之前的关联 | |||
| WxEnergyFeesSetoff fd = new WxEnergyFeesSetoff(); | |||
| fd.updateTenantInfo(record); | |||
| fd.setAdvanceFeesId(record.getId()); | |||
| wxEnergyFeesSetoffMapper.deleteByAdvanceId(fd); | |||
| if (null != record.getFeesIds()) { | |||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||
| Long feeid = record.getFeesIds().get(i); | |||
| WxEnergyFeesSetoff tf = new WxEnergyFeesSetoff(); | |||
| tf.updateTenantInfo(record); | |||
| tf.setId(idWorker.nextId()); | |||
| tf.setAdvanceFeesId(record.getId()); | |||
| tf.setFeesId(feeid); | |||
| tf.setCreateTime(new Date()); | |||
| tf.setUpdateTime(new Date()); | |||
| wxEnergyFeesSetoffMapper.insert(tf); | |||
| } | |||
| } | |||
| } | |||
| record.setUpdateTime(date); | |||
| wxEnergyFeesMapper.updateById(record); | |||
| //如果是预充的,则需处理管理科目 | |||
| if (fees.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()) { | |||
| //先删掉之前的关联 | |||
| WxFinanceFeesSetoff fd = new WxFinanceFeesSetoff(); | |||
| fd.updateTenantInfo(record); | |||
| fd.setAdvanceFeesId(record.getId()); | |||
| wxEnergyFeesSetoffMapper.deleteByAdvanceId(fd); | |||
| if (null != record.getFeesIds()) { | |||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||
| Long feeid = record.getFeesIds().get(i); | |||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||
| tf.updateTenantInfo(record); | |||
| tf.setId(idWorker.nextId()); | |||
| tf.setAdvanceFeesId(record.getId()); | |||
| tf.setFeesId(feeid); | |||
| tf.setCreateTime(new Date()); | |||
| tf.setUpdateTime(new Date()); | |||
| wxEnergyFeesSetoffMapper.insert(tf); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public WxEnergyFees getFeesById(Long id,String tenantId) { | |||
| public WxFinanceFees getFeesById(Long id,String tenantId) { | |||
| return wxEnergyFeesMapper.selectById(id, tenantId); | |||
| } | |||
| @Override | |||
| public void setFeesIsDel(WxEnergyFees record) { | |||
| WxEnergyFees fees = this.getFeesById(record.getId(),record.getTenantId()); | |||
| public void setFeesIsDel(WxFinanceFees record) { | |||
| WxFinanceFees fees = this.getFeesById(record.getId(),record.getTenantId()); | |||
| if (null == fees) { | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "记录未查询到"); | |||
| } | |||
| if (fees.getIsSystem().intValue() == EnumYesOrNo.YES.getCode().intValue()) { | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "系统内置不能修改"); | |||
| } | |||
| wxEnergyFeesMapper.setIsDel(record.getId(), record.getTenantId(), record.getIsDel()); | |||
| } | |||
| @Override | |||
| public Map<Long, WxEnergyFees> getFeesMap(WxEnergyFees record) { | |||
| List<WxEnergyFees> list = wxEnergyFeesMapper.findList(record); | |||
| public Map<Long, WxFinanceFees> getFeesMap(WxFinanceFees record) { | |||
| List<WxFinanceFees> list = wxEnergyFeesMapper.findList(record); | |||
| if (null != list && list.size() > 0 ) { | |||
| Map<Long,WxEnergyFees> retMap = new HashMap<Long,WxEnergyFees>(); | |||
| Map<Long,WxFinanceFees> retMap = new HashMap<Long,WxFinanceFees>(); | |||
| for (int i = 0 ; i<list.size() ; i ++) { | |||
| WxEnergyFees m = list.get(i); | |||
| WxFinanceFees m = list.get(i); | |||
| retMap.put(m.getId(), m); | |||
| } | |||
| return retMap; | |||
| @@ -706,36 +694,13 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| @Override | |||
| public void initEnergyFees(TenantEntity tenantEntity) { | |||
| for (EnumBillAllType t : EnumBillAllType.getSystemTypes()) { | |||
| WxEnergyFees fees = new WxEnergyFees(); | |||
| fees.updateTenantInfo(tenantEntity); | |||
| fees.setId(t.getEnergyFeesId()); | |||
| fees.setName(t.getMessage()); | |||
| fees.setIsSystem(EnumYesOrNo.YES.getCode()); | |||
| fees.setBillType(t.getCode()); | |||
| fees.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| if (t.isFixedPrice()) { | |||
| fees.setFixedPrice(EnumYesOrNo.YES.getCode()); | |||
| }else { | |||
| fees.setFixedPrice(EnumYesOrNo.NO.getCode()); | |||
| } | |||
| if (t.isDeposit()) { | |||
| fees.setIsDespoit(EnumYesOrNo.YES.getCode()); | |||
| }else { | |||
| fees.setIsDespoit(EnumYesOrNo.NO.getCode()); | |||
| } | |||
| Date date = new Date(); | |||
| fees.setCreateTime(date); | |||
| fees.setUpdateTime(date); | |||
| wxEnergyFeesMapper.insert(fees); | |||
| } | |||
| } | |||
| @Override | |||
| public List<Map<String,String>> getFeesShopComponentList(WxEnergyFeesShop record) { | |||
| public List<Map<String,String>> getFeesShopComponentList(WxFeesCalcuteShop record) { | |||
| WxShop shop = null; | |||
| if (null != record.getId()) { | |||
| WxEnergyFeesShop data = wxEnergyFeesShopMapper.selectById(record.getId(),record.getTenantId()); | |||
| WxFeesCalcuteShop data = wxEnergyFeesShopMapper.selectById(record.getId(),record.getTenantId()); | |||
| if (null != data) { | |||
| shop = wxShopService.getById(data.getShopId()); | |||
| } | |||
| @@ -760,11 +725,11 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| @Override | |||
| public void createFeesShop(WxEnergyFeesShop record) { | |||
| public void createFeesShop(WxFeesCalcuteShop record) { | |||
| //新增关联 | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Date date = new Date(); | |||
| WxEnergyFees fees = this.getFeesById(record.getFeesId(),record.getTenantId()); | |||
| WxFinanceFees fees = this.getFeesById(record.getFeesId(),record.getTenantId()); | |||
| WxShop sq = new WxShop(); | |||
| sq.updateTenantInfo(record); | |||
| sq.setIds(record.getShopIds()); | |||
| @@ -772,23 +737,23 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| for (int i = 0 ; i < record.getShopIds().size(); i ++) { | |||
| Long shopId = record.getShopIds().get(i); | |||
| WxShop shop = shopMap.get(shopId); | |||
| if (fees.getIsPublic() == EnumYesOrNo.YES.getCode() && StringUtils.isBlank(shop.getPulicRate())) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺未设置公摊系数"); | |||
| } | |||
| WxEnergyFeesShop msf = new WxEnergyFeesShop(); | |||
| // if (fees.getIsPublic() == EnumYesOrNo.YES.getCode() && StringUtils.isBlank(shop.getPulicRate())) { | |||
| // throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺未设置公摊系数"); | |||
| // } | |||
| WxFeesCalcuteShop msf = new WxFeesCalcuteShop(); | |||
| msf.updateTenantInfo(record); | |||
| msf.setId(idWorker.nextId()); | |||
| msf.setCreateTime(date); | |||
| msf.setUpdateTime(date); | |||
| msf.setShopId(shopId); | |||
| msf.setIsPublic(fees.getIsPublic()); | |||
| //msf.setIsPublic(fees.getIsPublic()); | |||
| msf.setFeesId(fees.getId()); | |||
| msf.setPrice(record.getPrice()); | |||
| if (fees.getIsPublic() == EnumYesOrNo.YES.getCode()) { | |||
| if (null == record.getFormulaList() || record.getFormulaList().size() <= 0 || StringUtils.isBlank(record.getFormula())) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请设置公式"); | |||
| } | |||
| } | |||
| // if (fees.getIsPublic() == EnumYesOrNo.YES.getCode()) { | |||
| // if (null == record.getFormulaList() || record.getFormulaList().size() <= 0 || StringUtils.isBlank(record.getFormula())) { | |||
| // throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请设置公式"); | |||
| // } | |||
| // } | |||
| if (null != record.getFormulaContentList() && record.getFormulaContentList().size() > 0 ) { | |||
| msf.setFormulaContent(JSON.toJSONString(record.getFormulaContentList())); | |||
| } | |||
| @@ -806,13 +771,13 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| } | |||
| @Override | |||
| public void deleteFeesShop(WxEnergyFeesShop record) { | |||
| public void deleteFeesShop(WxFeesCalcuteShop record) { | |||
| wxEnergyFeesShopMapper.deleteById(record.getId()); | |||
| } | |||
| @Override | |||
| public WxEnergyFeesShop getFeesShop(Long id,String tenantId) { | |||
| WxEnergyFeesShop fs = wxEnergyFeesShopMapper.selectById(id,tenantId); | |||
| public WxFeesCalcuteShop getFeesShop(Long id,String tenantId) { | |||
| WxFeesCalcuteShop fs = wxEnergyFeesShopMapper.selectById(id,tenantId); | |||
| if (StringUtils.isNotBlank(fs.getFormulaContent())) { | |||
| fs.setFormulaContentList(JSON.parseArray(fs.getFormulaContent(), String.class)); | |||
| } | |||
| @@ -823,8 +788,8 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| } | |||
| @Override | |||
| public void updateFeesShop(WxEnergyFeesShop record) { | |||
| WxEnergyFeesShop fessShop = wxEnergyFeesShopMapper.selectById(record.getId(), record.getTenantId()); | |||
| public void updateFeesShop(WxFeesCalcuteShop record) { | |||
| WxFeesCalcuteShop fessShop = wxEnergyFeesShopMapper.selectById(record.getId(), record.getTenantId()); | |||
| Date date = new Date(); | |||
| record.setUpdateTime(date); | |||
| if (record.getIsPublic() == EnumYesOrNo.YES.getCode()) { | |||
| @@ -851,20 +816,20 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| } | |||
| @Override | |||
| public PageInfo<WxEnergyFeesShop> feesShopListAsPage(WxEnergyFeesShop record, Integer pageIndex, Integer pageSize) { | |||
| PageInfo<WxEnergyFeesShop> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyFeesShopMapper.findList(record)); | |||
| public PageInfo<WxFeesCalcuteShop> feesShopListAsPage(WxFeesCalcuteShop record, Integer pageIndex, Integer pageSize) { | |||
| PageInfo<WxFeesCalcuteShop> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyFeesShopMapper.findList(record)); | |||
| if (null != page && null != page.getList() && page.getList().size() > 0 ) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| fq.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| Map<Long, WxEnergyFees> feesMap = this.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = this.getFeesMap(fq); | |||
| Map<Long, String> floorMap = wxMallFloorService.getFloorMap(record); | |||
| Map<Long, String> buildingMap = wxMallBuildingService.getBuildingMap(record); | |||
| List<Long> shopIdList = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxEnergyFeesShop fs = page.getList().get(i); | |||
| WxFeesCalcuteShop fs = page.getList().get(i); | |||
| if (null != feesMap && null != fs.getFeesId()) { | |||
| WxEnergyFees fee = feesMap.get(fs.getFeesId()); | |||
| WxFinanceFees fee = feesMap.get(fs.getFeesId()); | |||
| if (null != fee) { | |||
| fs.setFeesName(fee.getName()); | |||
| } | |||
| @@ -879,7 +844,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| shopMap = wxShopService.findShopMap(sq); | |||
| } | |||
| for (int i = 0 ; i < page.getList().size(); i++) { | |||
| WxEnergyFeesShop c = page.getList().get(i); | |||
| WxFeesCalcuteShop c = page.getList().get(i); | |||
| if (null != shopMap && null != c.getShopId()) { | |||
| WxShop s = shopMap.get(c.getShopId()); | |||
| if (null != s) { | |||
| @@ -898,15 +863,15 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| } | |||
| @Override | |||
| public void exportFeesShop(WxEnergyFeesShop record, HttpServletRequest request, HttpServletResponse response) { | |||
| PageInfo<WxEnergyFeesShop> page = feesShopListAsPage(record, 1, 10000); | |||
| List<WxEnergyFeesShop> list = null; | |||
| public void exportFeesShop(WxFeesCalcuteShop record, HttpServletRequest request, HttpServletResponse response) { | |||
| PageInfo<WxFeesCalcuteShop> page = feesShopListAsPage(record, 1, 10000); | |||
| List<WxFeesCalcuteShop> list = null; | |||
| if (null == page || null == page.getList()) { | |||
| list = new ArrayList<WxEnergyFeesShop>(); | |||
| list = new ArrayList<WxFeesCalcuteShop>(); | |||
| }else { | |||
| list = page.getList(); | |||
| } | |||
| excelService.exportExcel(list, null, "计算标准", WxEnergyFeesShop.class, "计算标准.xlsx", response, false); | |||
| excelService.exportExcel(list, null, "计算标准", WxFeesCalcuteShop.class, "计算标准.xlsx", response, false); | |||
| } | |||
| @Override | |||
| @@ -916,17 +881,17 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| // 需要验证 | |||
| String[] needFields = new String[]{"ID", "科目","店铺ID", "单价"}; | |||
| String[] allFields = new String[] {"ID","科目","店铺ID","店铺号","楼栋","楼层","单价","是否公摊","创建时间"}; | |||
| ExcelImportResult<WxEnergyFeesShop> datalist = handleImportFile(file,WxEnergyFeesShop.class,allFields,needFields,new ReadingExcelHandler()); | |||
| ExcelImportResult<WxFeesCalcuteShop> datalist = handleImportFile(file,WxFeesCalcuteShop.class,allFields,needFields,new ReadingExcelHandler()); | |||
| if (null == datalist) { | |||
| return ; | |||
| } | |||
| List<WxEnergyFeesShop> successList = datalist.getList(); | |||
| List<WxFeesCalcuteShop> successList = datalist.getList(); | |||
| if(successList.size() > 0) { | |||
| boolean allSuccess = true; | |||
| try { | |||
| successList.parallelStream().forEach(reading -> { | |||
| WxEnergyFeesShop r = new WxEnergyFeesShop(); | |||
| WxFeesCalcuteShop r = new WxFeesCalcuteShop(); | |||
| r.updateTenantInfo(user); | |||
| r.setId(reading.getId()); | |||
| r.setPrice(reading.getPrice()); | |||
| @@ -941,12 +906,12 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| } | |||
| @Override | |||
| public List<Long> getAdvanceSetoffFeesids(WxEnergyFeesSetoff setoff) { | |||
| public List<Long> getAdvanceSetoffFeesids(WxFinanceFeesSetoff setoff) { | |||
| return wxEnergyFeesSetoffMapper.findFeesIdList(setoff); | |||
| } | |||
| @Override | |||
| public List<Long> getFeesIdList(WxEnergyFees record) { | |||
| public List<Long> getFeesIdList(WxFinanceFees record) { | |||
| return wxEnergyFeesMapper.findIdList(record); | |||
| } | |||
| @@ -1179,13 +1144,13 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| Integer pageSize) { | |||
| PageInfo<WxEnergyReadingCalcute> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyReadingCalcuteMapper.findList(record)); | |||
| if (null != page && null != page.getList()) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> fessMap = this.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> fessMap = this.getFeesMap(fq); | |||
| for (int i = 0 ; i < page.getList().size(); i++) { | |||
| WxEnergyReadingCalcute c = page.getList().get(i); | |||
| if (null != fessMap) { | |||
| WxEnergyFees fees = fessMap.get(c.getFeesId()); | |||
| WxFinanceFees fees = fessMap.get(c.getFeesId()); | |||
| if (null != fees) { | |||
| c.setFeesName(fees.getName()); | |||
| c.setFeesPhysicsTypeName(null); | |||
| @@ -1232,7 +1197,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| record.setShop(JSON.toJSONString(record.getShopIds())); | |||
| try { | |||
| wxEnergyReadingCalcuteMapper.insert(record); | |||
| WxEnergyFees fees = this.getFeesById(record.getFeesId(),record.getTenantId()); | |||
| WxFinanceFees fees = this.getFeesById(record.getFeesId(),record.getTenantId()); | |||
| generateCalcuteResult(fees, record, record.getShopIds()); | |||
| } catch (Exception e) { | |||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | |||
| @@ -1253,150 +1218,150 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| * 如果是非能源科目数据,则从公式计算。按照费用标准的时间来设置账单的时间 | |||
| * | |||
| */ | |||
| public void generateCalcuteResult(WxEnergyFees fees,WxEnergyReadingCalcute record,List<Long> shopIds) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxShop shq = new WxShop(); | |||
| shq.updateTenantInfo(record); | |||
| shq.setIds(shopIds); | |||
| Map<Long, WxShop> shopMap = wxShopService.findShopMap(shq); | |||
| // 总共面积 | |||
| BigDecimal totalArea = new BigDecimal(0); | |||
| // 楼栋的面积 | |||
| Map<Long,BigDecimal> buildingAreaMap = null; | |||
| //楼层 | |||
| Map<Long, BigDecimal> floorAreaMap = null; | |||
| WxMallFloor fq = new WxMallFloor(); | |||
| fq.updateTenantInfo(record); | |||
| List<WxMallFloor> floorList = wxMallFloorService.getBudingFloorList(fq, null); | |||
| if (null != floorList && floorList.size() > 0 ) { | |||
| floorAreaMap = new HashMap<Long, BigDecimal>(); | |||
| buildingAreaMap = new HashMap<Long, BigDecimal>(); | |||
| for (int i = 0 ; i < floorList.size() ; i ++) { | |||
| WxMallFloor floor = floorList.get(i); | |||
| if (null != floor.getOperatingArea()) { | |||
| floorAreaMap.put(floor.getId(), floor.getOperatingArea()); | |||
| BigDecimal bud = buildingAreaMap.get(floor.getBuildingId()); | |||
| if (null == bud) { | |||
| bud = new BigDecimal(0); | |||
| } | |||
| bud = bud.add(floor.getOperatingArea()); | |||
| buildingAreaMap.put(floor.getBuildingId(), bud); | |||
| totalArea = totalArea.add(floor.getOperatingArea()); | |||
| } | |||
| } | |||
| } | |||
| //查询公摊表 | |||
| Map<Long,List<Long>> summaryMeterMap = null; | |||
| if (fees.getIsPublic() == EnumYesOrNo.YES.getCode()) { | |||
| WxEnergyMeter sumq = new WxEnergyMeter(); | |||
| sumq.updateTenantInfo(record); | |||
| sumq.setType(fees.getType()); | |||
| sumq.setPhysicsType(EnumEnergyMeterPhysicsType.SUMMARY.getCode()); | |||
| List<WxEnergyMeter> sumeterList = wxEnergyMeterMapper.findList(sumq); | |||
| if (null != sumeterList && sumeterList.size() > 0 ) { | |||
| summaryMeterMap = new HashMap<Long,List<Long>>(); | |||
| for (int i = 0 ; i < sumeterList.size(); i ++) { | |||
| WxEnergyMeter summaryMeter = sumeterList.get(i); | |||
| //查询总表下的子表 | |||
| WxEnergyMeterChild mcq = new WxEnergyMeterChild(); | |||
| mcq.updateTenantInfo(record); | |||
| mcq.setParentMeterId(summaryMeter.getId()); | |||
| List<Long> childMeterIds = wxEnergyMeterChildMapper.findChildMeterIdList(mcq); | |||
| if (null != childMeterIds && childMeterIds.size() > 0 ) { | |||
| summaryMeterMap.put(summaryMeter.getId(), childMeterIds); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| List<WxEnergyReadingCalcuteResult> resultList = new ArrayList<WxEnergyReadingCalcuteResult>(); | |||
| for (int i = 0 ; i < shopIds.size(); i ++) { | |||
| Long shopId= shopIds.get(i); | |||
| WxShop shop = shopMap.get(shopId); | |||
| //查询用户表 | |||
| WxEnergyMeterShopFloor sfq = new WxEnergyMeterShopFloor(); | |||
| sfq.updateTenantInfo(record); | |||
| sfq.setType(EnumEnergyMeterShopFloorType.SHOP.getCode()); | |||
| sfq.setAliseId(shopId); | |||
| List<Long> meterList = wxEnergyMeterShopFloorMapper.findMeterIdList(sfq); | |||
| //如果店铺已经存在了计算,则不允许重复 | |||
| WxEnergyReadingCalcuteResult crq = new WxEnergyReadingCalcuteResult(); | |||
| crq.updateTenantInfo(record); | |||
| crq.setShopId(shopId); | |||
| crq.setPeriod(record.getPeriod()); | |||
| crq.setFeesId(record.getFeesId()); | |||
| List<WxEnergyReadingCalcuteResult> list = wxEnergyReadingCalcuteResultMapper.findList(crq); | |||
| if (null != list && list.size() > 0 ) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"科目["+fees.getName()+"]该年月已存在计算记录,不能重复计算"); | |||
| } | |||
| //一个年月,一个店铺应该只有一个抄表周期 | |||
| WxEnergyFeesTime time = null; | |||
| if (fees.getBillType() == EnumBillAllType.DAILY.getCode()) { | |||
| //根据店铺,所属年月去查询时间区间.根据店铺,时间区间去查对应的抄表数据,根据表来计算总和 | |||
| WxEnergyFeesTimeShop sq = new WxEnergyFeesTimeShop(); | |||
| sq.updateTenantInfo(record); | |||
| sq.setShopId(shopId); | |||
| List<Long> timeIds = wxEnergyFeesTimeShopMapper.findTimeIdList(sq); | |||
| if (null == timeIds || timeIds.size() <= 0 ) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置抄表区间"); | |||
| } | |||
| WxEnergyFeesTime tq = new WxEnergyFeesTime(); | |||
| tq.updateTenantInfo(record); | |||
| tq.setIds(timeIds); | |||
| tq.setPeriod(record.getPeriod()); | |||
| List<WxEnergyFeesTime> timelist = wxEnergyFeesTimeMapper.findList(tq); | |||
| if (null == timelist || timelist.size() <= 0 ) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置抄表区间"); | |||
| } | |||
| time = timelist.get(0); | |||
| } | |||
| //根据店铺查询绑定的科目 | |||
| WxEnergyFeesShop csq = new WxEnergyFeesShop(); | |||
| csq.updateTenantInfo(record); | |||
| csq.setFeesId(fees.getId()); | |||
| csq.setShopId(shopId); | |||
| List<WxEnergyFeesShop> shopFeesList = wxEnergyFeesShopMapper.findList(csq); | |||
| if (null == shopFeesList || shopFeesList.size() <= 0 ) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置该科目费用标准"); | |||
| } | |||
| //循环店铺科目, | |||
| for (int j = 0 ; j < shopFeesList.size() ; j ++) { | |||
| WxEnergyFeesShop shopfee = shopFeesList.get(j); | |||
| WxEnergyReadingCalcuteResult cs = new WxEnergyReadingCalcuteResult(); | |||
| cs.updateTenantInfo(record); | |||
| cs.setId(idWorker.nextId()); | |||
| cs.setCalcuteId(record.getId()); | |||
| cs.setShopId(shopId); | |||
| cs.setCreateTime(new Date()); | |||
| cs.setUpdateTime(new Date()); | |||
| cs.setFeesId(shopfee.getFeesId()); | |||
| cs.setFeesPrice(shopfee.getPrice()); | |||
| cs.setFeesShopId(shopfee.getId()); | |||
| StringBuffer sb = new StringBuffer(); | |||
| cs.setMoney(wxEnergyHelper.calcuteMoney(sb,totalArea,shop,time, fees, shopfee,meterList,summaryMeterMap,buildingAreaMap,floorAreaMap)); | |||
| cs.setPeriod(record.getPeriod()); | |||
| cs.setMoneyDeail(sb.toString()); | |||
| //如果是能源的,从抄表周期里面取 | |||
| if (null != time) { | |||
| cs.setBeginTime(time.getStartTime()); | |||
| cs.setEndTime(time.getEndTime()); | |||
| }else { | |||
| cs.setBeginTime(shopfee.getBeginTime()); | |||
| cs.setEndTime(shopfee.getEndTime()); | |||
| } | |||
| resultList.add(cs); | |||
| } | |||
| } | |||
| if (resultList.size() > 0 ) { | |||
| wxEnergyReadingCalcuteResultMapper.insertResults(record.getTenantId(),resultList); | |||
| } | |||
| public void generateCalcuteResult(WxFinanceFees fees,WxEnergyReadingCalcute record,List<Long> shopIds) { | |||
| // final IdWorker idWorker = IdWorker.get(); | |||
| // WxShop shq = new WxShop(); | |||
| // shq.updateTenantInfo(record); | |||
| // shq.setIds(shopIds); | |||
| // Map<Long, WxShop> shopMap = wxShopService.findShopMap(shq); | |||
| // // 总共面积 | |||
| // BigDecimal totalArea = new BigDecimal(0); | |||
| // // 楼栋的面积 | |||
| // Map<Long,BigDecimal> buildingAreaMap = null; | |||
| // //楼层 | |||
| // Map<Long, BigDecimal> floorAreaMap = null; | |||
| // WxMallFloor fq = new WxMallFloor(); | |||
| // fq.updateTenantInfo(record); | |||
| // List<WxMallFloor> floorList = wxMallFloorService.getBudingFloorList(fq, null); | |||
| // if (null != floorList && floorList.size() > 0 ) { | |||
| // floorAreaMap = new HashMap<Long, BigDecimal>(); | |||
| // buildingAreaMap = new HashMap<Long, BigDecimal>(); | |||
| // for (int i = 0 ; i < floorList.size() ; i ++) { | |||
| // WxMallFloor floor = floorList.get(i); | |||
| // if (null != floor.getOperatingArea()) { | |||
| // floorAreaMap.put(floor.getId(), floor.getOperatingArea()); | |||
| // BigDecimal bud = buildingAreaMap.get(floor.getBuildingId()); | |||
| // if (null == bud) { | |||
| // bud = new BigDecimal(0); | |||
| // } | |||
| // bud = bud.add(floor.getOperatingArea()); | |||
| // buildingAreaMap.put(floor.getBuildingId(), bud); | |||
| // totalArea = totalArea.add(floor.getOperatingArea()); | |||
| // } | |||
| // } | |||
| // } | |||
| // //查询公摊表 | |||
| // Map<Long,List<Long>> summaryMeterMap = null; | |||
| // if (fees.getIsPublic() == EnumYesOrNo.YES.getCode()) { | |||
| // WxEnergyMeter sumq = new WxEnergyMeter(); | |||
| // sumq.updateTenantInfo(record); | |||
| // sumq.setType(fees.getType()); | |||
| // sumq.setPhysicsType(EnumEnergyMeterPhysicsType.SUMMARY.getCode()); | |||
| // List<WxEnergyMeter> sumeterList = wxEnergyMeterMapper.findList(sumq); | |||
| // if (null != sumeterList && sumeterList.size() > 0 ) { | |||
| // summaryMeterMap = new HashMap<Long,List<Long>>(); | |||
| // for (int i = 0 ; i < sumeterList.size(); i ++) { | |||
| // WxEnergyMeter summaryMeter = sumeterList.get(i); | |||
| // //查询总表下的子表 | |||
| // WxEnergyMeterChild mcq = new WxEnergyMeterChild(); | |||
| // mcq.updateTenantInfo(record); | |||
| // mcq.setParentMeterId(summaryMeter.getId()); | |||
| // List<Long> childMeterIds = wxEnergyMeterChildMapper.findChildMeterIdList(mcq); | |||
| // if (null != childMeterIds && childMeterIds.size() > 0 ) { | |||
| // summaryMeterMap.put(summaryMeter.getId(), childMeterIds); | |||
| // } | |||
| // } | |||
| // } | |||
| // } | |||
| // | |||
| // List<WxEnergyReadingCalcuteResult> resultList = new ArrayList<WxEnergyReadingCalcuteResult>(); | |||
| // for (int i = 0 ; i < shopIds.size(); i ++) { | |||
| // Long shopId= shopIds.get(i); | |||
| // WxShop shop = shopMap.get(shopId); | |||
| // | |||
| // //查询用户表 | |||
| // WxEnergyMeterShopFloor sfq = new WxEnergyMeterShopFloor(); | |||
| // sfq.updateTenantInfo(record); | |||
| // sfq.setType(EnumEnergyMeterShopFloorType.SHOP.getCode()); | |||
| // sfq.setAliseId(shopId); | |||
| // List<Long> meterList = wxEnergyMeterShopFloorMapper.findMeterIdList(sfq); | |||
| // | |||
| // //如果店铺已经存在了计算,则不允许重复 | |||
| // WxEnergyReadingCalcuteResult crq = new WxEnergyReadingCalcuteResult(); | |||
| // crq.updateTenantInfo(record); | |||
| // crq.setShopId(shopId); | |||
| // crq.setPeriod(record.getPeriod()); | |||
| // crq.setFeesId(record.getFeesId()); | |||
| // List<WxEnergyReadingCalcuteResult> list = wxEnergyReadingCalcuteResultMapper.findList(crq); | |||
| // if (null != list && list.size() > 0 ) { | |||
| // throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"科目["+fees.getName()+"]该年月已存在计算记录,不能重复计算"); | |||
| // } | |||
| // | |||
| // //一个年月,一个店铺应该只有一个抄表周期 | |||
| // WxEnergyFeesTime time = null; | |||
| // if (fees.getBillType() == EnumBillAllType.DAILY.getCode()) { | |||
| // | |||
| // //根据店铺,所属年月去查询时间区间.根据店铺,时间区间去查对应的抄表数据,根据表来计算总和 | |||
| // WxEnergyFeesTimeShop sq = new WxEnergyFeesTimeShop(); | |||
| // sq.updateTenantInfo(record); | |||
| // sq.setShopId(shopId); | |||
| // List<Long> timeIds = wxEnergyFeesTimeShopMapper.findTimeIdList(sq); | |||
| // if (null == timeIds || timeIds.size() <= 0 ) { | |||
| // throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置抄表区间"); | |||
| // } | |||
| // | |||
| // WxEnergyFeesTime tq = new WxEnergyFeesTime(); | |||
| // tq.updateTenantInfo(record); | |||
| // tq.setIds(timeIds); | |||
| // tq.setPeriod(record.getPeriod()); | |||
| // List<WxEnergyFeesTime> timelist = wxEnergyFeesTimeMapper.findList(tq); | |||
| // if (null == timelist || timelist.size() <= 0 ) { | |||
| // throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置抄表区间"); | |||
| // } | |||
| // time = timelist.get(0); | |||
| // } | |||
| // | |||
| // //根据店铺查询绑定的科目 | |||
| // WxFeesCalcuteShop csq = new WxFeesCalcuteShop(); | |||
| // csq.updateTenantInfo(record); | |||
| // csq.setFeesId(fees.getId()); | |||
| // csq.setShopId(shopId); | |||
| // List<WxFeesCalcuteShop> shopFeesList = wxEnergyFeesShopMapper.findList(csq); | |||
| // if (null == shopFeesList || shopFeesList.size() <= 0 ) { | |||
| // throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置该科目费用标准"); | |||
| // } | |||
| // | |||
| // //循环店铺科目, | |||
| // for (int j = 0 ; j < shopFeesList.size() ; j ++) { | |||
| // WxFeesCalcuteShop shopfee = shopFeesList.get(j); | |||
| // WxEnergyReadingCalcuteResult cs = new WxEnergyReadingCalcuteResult(); | |||
| // cs.updateTenantInfo(record); | |||
| // cs.setId(idWorker.nextId()); | |||
| // cs.setCalcuteId(record.getId()); | |||
| // cs.setShopId(shopId); | |||
| // cs.setCreateTime(new Date()); | |||
| // cs.setUpdateTime(new Date()); | |||
| // cs.setFeesId(shopfee.getFeesId()); | |||
| // cs.setFeesPrice(shopfee.getPrice()); | |||
| // cs.setFeesShopId(shopfee.getId()); | |||
| // StringBuffer sb = new StringBuffer(); | |||
| // cs.setMoney(wxEnergyHelper.calcuteMoney(sb,totalArea,shop,time, fees, shopfee,meterList,summaryMeterMap,buildingAreaMap,floorAreaMap)); | |||
| // cs.setPeriod(record.getPeriod()); | |||
| // cs.setMoneyDeail(sb.toString()); | |||
| // //如果是能源的,从抄表周期里面取 | |||
| // if (null != time) { | |||
| // cs.setBeginTime(time.getStartTime()); | |||
| // cs.setEndTime(time.getEndTime()); | |||
| // }else { | |||
| // cs.setBeginTime(shopfee.getBeginTime()); | |||
| // cs.setEndTime(shopfee.getEndTime()); | |||
| // } | |||
| // resultList.add(cs); | |||
| // } | |||
| // } | |||
| // if (resultList.size() > 0 ) { | |||
| // wxEnergyReadingCalcuteResultMapper.insertResults(record.getTenantId(),resultList); | |||
| // } | |||
| } | |||
| private void initReadingCalcuteResultQueryParam(WxEnergyReadingCalcuteResult record) { | |||
| @@ -1419,16 +1384,16 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| initReadingCalcuteResultQueryParam(record); | |||
| PageInfo<WxEnergyReadingCalcuteResult> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyReadingCalcuteResultMapper.findList(record)); | |||
| if (null != page && null != page.getList()) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> fessMap = this.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> fessMap = this.getFeesMap(fq); | |||
| Map<Long, String> floorMap = wxMallFloorService.getFloorMap(record); | |||
| Map<Long, String> buildingMap = wxMallBuildingService.getBuildingMap(record); | |||
| List<Long> shopIdList = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < page.getList().size(); i++) { | |||
| WxEnergyReadingCalcuteResult c = page.getList().get(i); | |||
| if (null != fessMap) { | |||
| WxEnergyFees fees = fessMap.get(c.getFeesId()); | |||
| WxFinanceFees fees = fessMap.get(c.getFeesId()); | |||
| if (null != fees) { | |||
| c.setFeesName(fees.getName()); | |||
| } | |||
| @@ -1577,12 +1542,12 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| shopMap = wxShopService.findShopMap(sq); | |||
| } | |||
| WxEnergyFees fees = this.getFeesById(calcute.getFeesId(), record.getTenantId()); | |||
| WxFinanceFees fees = this.getFeesById(calcute.getFeesId(), record.getTenantId()); | |||
| List<WxEnergyReadingCalcuteResult> resultList = wxEnergyReadingCalcuteResultMapper.findList(crq); | |||
| if (null != resultList && resultList.size() > 0 ) { | |||
| List<WxAllBill> billList = new ArrayList<WxAllBill>(); | |||
| List<WxEnergyFeesShop> feesShopList = new ArrayList<WxEnergyFeesShop>(); | |||
| List<WxFeesCalcuteShop> feesShopList = new ArrayList<WxFeesCalcuteShop>(); | |||
| for (int i = 0 ; i < resultList.size(); i++) { | |||
| WxEnergyReadingCalcuteResult result = resultList.get(i); | |||
| WxShop shop = null; | |||
| @@ -1592,17 +1557,17 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| if (null == shop) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺ID["+result.getShopId()+"]未查询到店铺"); | |||
| } | |||
| WxEnergyFeesShop feesShop = wxEnergyFeesShopMapper.selectById(result.getFeesShopId(), result.getTenantId()); | |||
| WxFeesCalcuteShop feesShop = wxEnergyFeesShopMapper.selectById(result.getFeesShopId(), result.getTenantId()); | |||
| if (null == feesShop) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"该科目费用标准未查询到"); | |||
| } | |||
| //非能耗费的费用标准更新开始日期和结束日期,能耗的是使用的抄表区间的时间。 | |||
| if (fees.getBillType() != EnumBillAllType.DAILY.getCode()) { | |||
| feesShop.setBeginTime(DateUtils.getSecondsTimeAfter(1, feesShop.getEndTime())); | |||
| feesShop.setEndTime(feesShop.calcuteEndTime()); | |||
| feesShopList.add(feesShop); | |||
| } | |||
| // if (fees.getBillType() != EnumBillAllType.DAILY.getCode()) { | |||
| // feesShop.setBeginTime(DateUtils.getSecondsTimeAfter(1, feesShop.getEndTime())); | |||
| // feesShop.setEndTime(feesShop.calcuteEndTime()); | |||
| // feesShopList.add(feesShop); | |||
| // } | |||
| WxAllBill bill = result.generateBill(calcute, shop, user,result.getBeginTime(),result.getEndTime(), result.getMoney(), result.getMoneyDeail(), "能源计算自动生成"); | |||
| billList.add(bill); | |||
| @@ -13,7 +13,7 @@ import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinancePrintData; | |||
| import com.iformall.domain.po.WxFinancePrintTemplate; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| @@ -265,9 +265,9 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||
| suq.setTenantId(tenantId); | |||
| suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); | |||
| Map<Long, WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq); | |||
| WxEnergyFees feq = new WxEnergyFees(); | |||
| WxFinanceFees feq = new WxFinanceFees(); | |||
| feq.setTenantId(tenantId); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(feq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(feq); | |||
| //收付款单 | |||
| if (printDatatype.getCode().intValue() == EnumFinancePrintDataType.FINANCE_RECEIVE.getCode()) { | |||
| WxFinanceReceive receiveq = new WxFinanceReceive(); | |||
| @@ -327,7 +327,7 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||
| for (int k = 0 ; k< bq.getBillSumList().size() ; k++) { | |||
| WxBillSum billSum = bq.getBillSumList().get(k); | |||
| if (feesId.contains(billSum.getEnergyFeesId())) { | |||
| WxEnergyFees fee = feesMap.get(billSum.getEnergyFeesId()); | |||
| WxFinanceFees fee = feesMap.get(billSum.getEnergyFeesId()); | |||
| billSum.setTaxRate(fee.getTaxRate()); | |||
| sumlist.add(billSum); | |||
| receiveTotal = receiveTotal.add(billSum.getNeedPayNumber()); | |||
| @@ -15,9 +15,9 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.SysConfig; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxEnergyFeesSetoff; | |||
| import com.iformall.domain.po.WxEnergyFeesShop; | |||
| import com.iformall.domain.po.WxFinanceFees; | |||
| import com.iformall.domain.po.WxFinanceFeesSetoff; | |||
| import com.iformall.domain.po.WxFeesCalcuteShop; | |||
| import com.iformall.domain.po.WxFinanceCheckOut; | |||
| import com.iformall.domain.po.WxFinanceFinish; | |||
| import com.iformall.domain.po.WxFinanceFinishReceive; | |||
| @@ -41,8 +41,8 @@ import com.iformall.domain.vo.WxFinanceReceiveBillSum; | |||
| import com.iformall.domain.vo.WxFinanceReceiveCountVo; | |||
| import com.iformall.domain.vo.WxFinanceReceiveSumVo; | |||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| import com.iformall.enums.EnumFeesType; | |||
| import com.iformall.enums.EnumFinanceCashierType; | |||
| import com.iformall.enums.EnumFinanceFinishStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| @@ -50,7 +50,7 @@ import com.iformall.enums.EnumShopUsersStatus; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillPayWayMapper; | |||
| import com.iformall.mapper.WxEnergyFeesSetoffMapper; | |||
| import com.iformall.mapper.WxFinanceFeesSetoffMapper; | |||
| import com.iformall.mapper.WxFinanceCheckOutMapper; | |||
| import com.iformall.mapper.WxFinanceFinishMapper; | |||
| import com.iformall.mapper.WxFinanceFinishReceiveMapper; | |||
| @@ -103,7 +103,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| @Autowired | |||
| WxBillPayWayMapper wxBillPayWayMapper; | |||
| @Autowired | |||
| WxEnergyFeesSetoffMapper wxEnergyFeesSetoffMapper; | |||
| WxFinanceFeesSetoffMapper wxEnergyFeesSetoffMapper; | |||
| @Autowired | |||
| WxFinanceReceiveMapper wxFinanceReceiveMapper; | |||
| @Autowired | |||
| @@ -260,7 +260,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxAllBill abq = new WxAllBill(); | |||
| abq.updateTenantInfo(record); | |||
| abq.setShopId(record.getId()); | |||
| abq.setDepositHasMoney(EnumYesOrNo.YES.getCode()); | |||
| //abq.setDepositHasMoney(EnumYesOrNo.YES.getCode()); | |||
| BigDecimal total = wxAllBillService.getRemainAdvanceSum(abq); | |||
| if (null == total) { | |||
| total = new BigDecimal(0); | |||
| @@ -274,7 +274,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| //查询预存账单 | |||
| WxAllBill abq = new WxAllBill(); | |||
| abq.updateTenantInfo(record); | |||
| abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| //TODO 查预存的科目 | |||
| //abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| abq.setShopId(record.getId()); | |||
| abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | |||
| BigDecimal total = wxAllBillService.getRemainAdvanceSum(abq); | |||
| @@ -301,21 +302,22 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| //查询预存账单 | |||
| WxAllBill abq = new WxAllBill(); | |||
| abq.updateTenantInfo(record); | |||
| abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| //TODO 查预存的科目 | |||
| //abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| abq.setShopId(record.getId()); | |||
| abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | |||
| List<WxAllBill> advanceList = wxAllBillService.getMerchantAdvanceGroupSumList(abq); | |||
| if (null != advanceList && advanceList.size() > 0 ) { | |||
| WxEnergyFees fat = new WxEnergyFees(); | |||
| WxFinanceFees fat = new WxFinanceFees(); | |||
| fat.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> advanceTypMap = wxEnergyService.getFeesMap(fat); | |||
| Map<Long, WxFinanceFees> advanceTypMap = wxEnergyService.getFeesMap(fat); | |||
| for (int i = 0 ; i < advanceList.size() ; i++) { | |||
| WxAllBill at = advanceList.get(i); | |||
| FinanceAdvanceBillVo vo = new FinanceAdvanceBillVo(); | |||
| vo.setFeesId(at.getEnergyFeesId()); | |||
| vo.setRemain(at.getRemain()); | |||
| if (null != at.getEnergyFeesId() && null != advanceTypMap) { | |||
| WxEnergyFees wfat = advanceTypMap.get(at.getEnergyFeesId()); | |||
| WxFinanceFees wfat = advanceTypMap.get(at.getEnergyFeesId()); | |||
| if (null != wfat) { | |||
| vo.setFeesName(wfat.getName()); | |||
| } | |||
| @@ -412,13 +414,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| List<WxAllBill> advanceList = null; | |||
| //如果是押金 | |||
| if (dto.getFeesId().longValue() == Constant.bill_all_deposit_id.longValue()){ | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(dto); | |||
| List<Integer> depositTypes = new ArrayList<Integer>(); | |||
| depositTypes.add(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| depositTypes.add(EnumBillAllType.PROPERTY_DEPOSIT.getCode()); | |||
| depositTypes.add(EnumBillAllType.OTHER_DEPOSIT.getCode()); | |||
| fq.setBillTypeList(depositTypes); | |||
| setOffFeesIds = wxEnergyService.getFeesIdList(fq); | |||
| if (null == setOffFeesIds || setOffFeesIds.size() <= 0 ) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"未查询到押金科目"); | |||
| @@ -427,7 +424,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxAllBill abq = new WxAllBill(); | |||
| abq.updateTenantInfo(dto); | |||
| abq.setNotInIds(billIdList); | |||
| abq.setDepositHasMoney(EnumYesOrNo.YES.getCode()); | |||
| //abq.setDepositHasMoney(EnumYesOrNo.YES.getCode()); | |||
| abq.setSortColumns(SortField.Createtime_ASC); | |||
| abq.setShopId(shopId);; | |||
| advanceList = wxAllBillService.list(abq); | |||
| @@ -436,7 +433,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| } | |||
| }else { | |||
| //查询预收科目可冲抵的科目 | |||
| WxEnergyFeesSetoff fsq = new WxEnergyFeesSetoff(); | |||
| WxFinanceFeesSetoff fsq = new WxFinanceFeesSetoff(); | |||
| fsq.updateTenantInfo(dto); | |||
| fsq.setAdvanceFeesId(dto.getFeesId()); | |||
| setOffFeesIds = wxEnergyService.getAdvanceSetoffFeesids(fsq); | |||
| @@ -448,7 +445,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxAllBill abq = new WxAllBill(); | |||
| abq.updateTenantInfo(dto); | |||
| abq.setEnergyFeesId(dto.getFeesId()); | |||
| abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| //TODO 查预存的科目 | |||
| //abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | |||
| abq.setSortColumns(SortField.Createtime_ASC); | |||
| abq.setShopId(shopId);; | |||
| @@ -519,9 +517,9 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| pq.updateTenantInfo(record); | |||
| Map<Long, WxBillPayWay> paywayMap = this.getPayWayMap(pq); | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> fmap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> fmap = wxEnergyService.getFeesMap(fq); | |||
| List<WxFinanceReceiveVo> volist = new ArrayList<WxFinanceReceiveVo>(); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxFinanceReceive fr = page.getList().get(i); | |||
| @@ -553,7 +551,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| } | |||
| } | |||
| if (null != fmap && null != vo.getFeesId()) { | |||
| WxEnergyFees ef = fmap.get(vo.getFeesId()); | |||
| WxFinanceFees ef = fmap.get(vo.getFeesId()); | |||
| if (null != ef) { | |||
| vo.setFeesName(ef.getName()); | |||
| } | |||
| @@ -597,9 +595,9 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| pq.updateTenantInfo(record); | |||
| Map<Long, WxBillPayWay> paywayMap = this.getPayWayMap(pq); | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> fmap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> fmap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxFinanceReceiveBill fr = page.getList().get(i); | |||
| if (null != shopMap) { | |||
| @@ -615,7 +613,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| } | |||
| } | |||
| if (null != fmap && null != fr.getFeesId()) { | |||
| WxEnergyFees ef = fmap.get(fr.getFeesId()); | |||
| WxFinanceFees ef = fmap.get(fr.getFeesId()); | |||
| if (null != ef) { | |||
| fr.setFeesName(ef.getName()); | |||
| } | |||
| @@ -894,7 +892,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxBillPayDTO payDto = new WxBillPayDTO(); | |||
| payDto.updateTenantInfo(addreceive); | |||
| payDto.setId(be.getId()); | |||
| payDto.setBillTypeValue(be.getBillType()); | |||
| //payDto.setBillTypeValue(be.getBillType()); | |||
| payDto.setAddpay(money); | |||
| payDto.setPayWay(payway0.getId()); | |||
| payDto.setPayWayName(payway0.getPayWayName()); | |||
| @@ -935,7 +933,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxBillPayDTO payDto = new WxBillPayDTO(); | |||
| payDto.updateTenantInfo(addreceive); | |||
| payDto.setId(be.getId()); | |||
| payDto.setBillTypeValue(be.getBillType()); | |||
| //payDto.setBillTypeValue(be.getBillType()); | |||
| payDto.setAddpay("0"); | |||
| payDto.setSetOff(be.getCurrentSetOff()); | |||
| payDto.setCut(be.getCurrentCut()); | |||
| @@ -979,7 +977,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| frbs.setReceiveId(addreceive.getId()); | |||
| frbs.setReceiveDate(addreceive.getReceiveDate()); | |||
| frbs.setBillId(bill.getId()); | |||
| frbs.setBillType(bill.getBillType()); | |||
| //frbs.setBillType(bill.getBillType()); | |||
| frbs.setFeesId(bill.getEnergyFeesId()); | |||
| frbs.setType(addreceive.getType()); | |||
| frbs.setPayWay(payway); | |||
| @@ -1000,19 +998,15 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| for (int j = 0 ; j < be.getSetOffDetailList().size(); j ++ ) { | |||
| FinanceSetOffDetailVo setoffdetail = be.getSetOffDetailList().get(j); | |||
| WxAllBill advance = wxAllBillService.getById(addreceive, setoffdetail.getAdvanceId()); | |||
| EnumBillAllType billType = EnumBillAllType.getEnum(advance.getBillType()); | |||
| WxFinanceFees fees = wxEnergyService.getFeesById(advance.getEnergyFeesId(), addreceive.getTenantId()); | |||
| //如果是预冲 | |||
| if (billType == EnumBillAllType.ADVANCE){ | |||
| if (fees.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()){ | |||
| advanceMoney = advanceMoney.add(new BigDecimal(setoffdetail.getSetoff())); | |||
| }else { | |||
| //如果是押金 | |||
| boolean isDeposit = false; | |||
| for (EnumBillAllType bt : EnumBillAllType.getDepositTypes()) { | |||
| if (bt == billType) { | |||
| isDeposit = true; | |||
| break; | |||
| } | |||
| if (fees.getIsDespoit().intValue() == EnumYesOrNo.YES.getCode().intValue()) { | |||
| isDeposit = true; | |||
| } | |||
| if (isDeposit) { | |||
| depositMoney = depositMoney.add(new BigDecimal(setoffdetail.getSetoff())); | |||
| @@ -1034,7 +1028,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| rb.setAdvanceId(advance.getId()); | |||
| rb.setReceiveId(addreceive.getId()); | |||
| rb.setBillId(bill.getId()); | |||
| rb.setBillType(bill.getBillType()); | |||
| //rb.setBillType(bill.getBillType()); | |||
| rb.setFeesId(bill.getEnergyFeesId()); | |||
| rb.setSetoff(setoffdetail.getSetoff()); | |||
| rb.setStarttime(bill.getStarttime()); | |||
| @@ -1140,7 +1134,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxBillPayDTO payDto = new WxBillPayDTO(); | |||
| payDto.updateTenantInfo(addreceive); | |||
| payDto.setId(be.getId()); | |||
| payDto.setBillTypeValue(be.getBillType()); | |||
| //payDto.setBillTypeValue(be.getBillType()); | |||
| payDto.setCut(be.getCurrentCut()); | |||
| payDto.setRemark("减免,关联收款单["+addreceive.getId()+"]"); | |||
| //创建一个减免收款单 | |||
| @@ -1324,7 +1318,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxBillPayDTO payDto = new WxBillPayDTO(); | |||
| payDto.updateTenantInfo(addreceive); | |||
| payDto.setId(be.getId()); | |||
| payDto.setBillTypeValue(be.getBillType()); | |||
| //payDto.setBillTypeValue(be.getBillType()); | |||
| payDto.setPayToMerchant(money); | |||
| payDto.setPayWay(payway0.getId()); | |||
| payDto.setPayWayName(payway0.getPayWayName()); | |||
| @@ -1353,27 +1347,21 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| @Override | |||
| public void createTempFees(WxAllBill record,MallUserInfo user) { | |||
| WxEnergyFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; | |||
| record.setBillType(fees.getBillType()); | |||
| //WxFinanceFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; | |||
| //record.setBillType(fees.getBillType()); | |||
| WxShop shop = wxShopService.getById(record.getShopId()); | |||
| if (fees.getBillType().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | |||
| generateTempBill(record, shop, user,EnumBillAllType.ADVANCE,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||
| }else if (fees.getBillType().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | |||
| generateTempBill(record, shop, user,EnumBillAllType.OTHER_DEPOSIT,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||
| }else if (fees.getBillType().intValue() == EnumBillAllType.OTHER.getCode().intValue()) { | |||
| generateTempBill(record, shop, user,EnumBillAllType.OTHER,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||
| } | |||
| generateTempBill(record, shop, user,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||
| } | |||
| @Override | |||
| public void createTempToPay(WxAllBill record,MallUserInfo user) { | |||
| WxEnergyFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; | |||
| record.setBillType(fees.getBillType()); | |||
| //WxFinanceFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; | |||
| //record.setBillType(fees.getBillType()); | |||
| WxShop shop = wxShopService.getById(record.getShopId()); | |||
| generateTempBill(record, shop, user,EnumBillAllType.TEMP_TO_PAYMERCHANT,"0",record.getReceivePay(),record.getStarttime(),record.getEndtime()); | |||
| generateTempBill(record, shop, user,"0",record.getReceivePay(),record.getStarttime(),record.getEndtime()); | |||
| } | |||
| public void generateTempBill(WxAllBill record,WxShop wxShop,MallUserInfo user, EnumBillAllType billType,String receivePay,String pay,Date starttime,Date endtime) { | |||
| public void generateTempBill(WxAllBill record,WxShop wxShop,MallUserInfo user, String receivePay,String pay,Date starttime,Date endtime) { | |||
| if (null == endtime) { | |||
| if (null == starttime) { | |||
| Date cur = new Date(); | |||
| @@ -1406,7 +1394,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| advanceBill.setReceivePay(receivePay); | |||
| advanceBill.setPay(pay); | |||
| advanceBill.setUseMoney("0"); | |||
| advanceBill.setBillType(billType.getCode()); | |||
| //advanceBill.setBillType(billType.getCode()); | |||
| //advanceBill.setPayWay(); | |||
| //advanceBill.setPayDate(new Date()); | |||
| advanceBill.setStarttime(starttime); | |||
| @@ -1478,7 +1466,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxFinanceReceiveSetoff rsq = new WxFinanceReceiveSetoff(); | |||
| rsq.updateTenantInfo(record); | |||
| rsq.setBillId(bill.getId()); | |||
| rsq.setBillType(bill.getBillType()); | |||
| //rsq.setBillType(bill.getBillType()); | |||
| rsq.setReceiveId(rb.getReceiveId()); | |||
| List<WxFinanceReceiveSetoff> setoffList = wxFinanceReceiveSetoffMapper.findList(rsq); | |||
| if (null != setoffList) { | |||
| @@ -1505,7 +1493,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxBillPayDTO payDto = new WxBillPayDTO(); | |||
| payDto.updateTenantInfo(record); | |||
| payDto.setId(bill.getId()); | |||
| payDto.setBillTypeValue(bill.getBillType()); | |||
| //payDto.setBillTypeValue(bill.getBillType()); | |||
| payDto.setAddpay("0"); | |||
| payDto.setSetOff(rb.getReceive()); | |||
| if (isRedSetoff) { | |||
| @@ -1523,7 +1511,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxBillPayDTO payDto = new WxBillPayDTO(); | |||
| payDto.updateTenantInfo(record); | |||
| payDto.setId(bill.getId()); | |||
| payDto.setBillTypeValue(bill.getBillType()); | |||
| //payDto.setBillTypeValue(bill.getBillType()); | |||
| if (record.getType().intValue() == EnumFinanceCashierType.RECEIVE.getCode().intValue()) { | |||
| payDto.setCut(rb.getReceive()); | |||
| if (isRedSetoff) { | |||
| @@ -1548,7 +1536,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| WxBillPayDTO payDto = new WxBillPayDTO(); | |||
| payDto.updateTenantInfo(record); | |||
| payDto.setId(bill.getId()); | |||
| payDto.setBillTypeValue(bill.getBillType()); | |||
| //payDto.setBillTypeValue(bill.getBillType()); | |||
| if (record.getType().intValue() == EnumFinanceCashierType.RECEIVE.getCode().intValue()) { | |||
| payDto.setAddpay(rb.getReceive()); | |||
| if (isRedSetoff) { | |||
| @@ -1676,13 +1664,13 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| rsq.setAdvanceId(record.getId()); | |||
| PageInfo<WxFinanceReceiveSetoff> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFinanceReceiveSetoffMapper.findList(rsq)); | |||
| if (null != page && null != page.getList()) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < page.getList().size(); i++ ) { | |||
| WxFinanceReceiveSetoff frs = page.getList().get(i); | |||
| if (null != feesMap && null != frs.getFeesId()) { | |||
| WxEnergyFees ef = feesMap.get(frs.getFeesId()); | |||
| WxFinanceFees ef = feesMap.get(frs.getFeesId()); | |||
| if (null != ef) { | |||
| frs.setFeesName(ef.getName()); | |||
| } | |||
| @@ -1911,13 +1899,13 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| pays = wxFinanceReceiveMapper.getReceiveFeesPaySum(fr); | |||
| } | |||
| if (null != pays) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| WxFinanceFees fq = new WxFinanceFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < pays.size() ; i ++) { | |||
| WxFinanceReceiveBill rpw = pays.get(i); | |||
| if (null != feesMap && null != rpw.getFeesId()) { | |||
| WxEnergyFees pw = feesMap.get(rpw.getFeesId()); | |||
| WxFinanceFees pw = feesMap.get(rpw.getFeesId()); | |||
| if (null != pw) { | |||
| rpw.setFeesName(pw.getName()); | |||
| } | |||
| @@ -73,10 +73,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| @Autowired | |||
| private MallUserInfoService mallUserInfoService; | |||
| @Autowired | |||
| private WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| private WxPropertyContractService wxPropertyContractService; | |||
| @Autowired | |||
| private WxFlowRecordMapper wxFlowRecordMapper; | |||
| @Autowired | |||
| private MqBaseProducer mqBaseProducer; | |||
| @@ -202,16 +198,16 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| rent.setId(bsId); | |||
| rent.setApplyStatus(applyStatus); | |||
| rent.setBusinessType(flowType); | |||
| //rent.setBusinessType(flowType); | |||
| WxRentContract record = wxRentContractMapper.selectById(bsId); | |||
| boolean isrentproperty = false; | |||
| Integer propertyStatus = null; | |||
| //合并的合同-审批时 物业合同的状态肯定不在 签约中 避免更新物业合同时提示店铺存在 | |||
| if(record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())){ | |||
| isrentproperty = true; | |||
| } | |||
| //if(record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())){ | |||
| // isrentproperty = true; | |||
| //} | |||
| //String wholeProperyId = (String)mapInfo.get("wholeProperyId"); | |||
| //如果是提交审批 , 审批驳回状态不变 | |||
| if (EnumRentContractAppStatus.APPLYING.getCode().intValue() == applyStatus.intValue()) { | |||
| @@ -227,7 +223,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| }else if (EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| wxRentContractService.updateRentContractStatus(bsId,false); | |||
| if (isrentproperty) { | |||
| wxPropertyContractService.updatePropertyContractStatus(propetyId); | |||
| //wxPropertyContractService.updatePropertyContractStatus(propetyId); | |||
| } | |||
| //如果是审批撤回,或者驳回,改回草稿状态 | |||
| }else if (EnumRentContractAppStatus.SETBACK.getCode().intValue() == applyStatus.intValue() | |||
| @@ -239,34 +235,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| } | |||
| wxRentContractService.updateApplyStatus(rent); | |||
| if (isrentproperty) { | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.setId(propetyId); | |||
| wxPropertyContract.setRentContractId(record.getId()); | |||
| wxPropertyContract.setStatus(propertyStatus); | |||
| wxPropertyContract.setApplyStatus(applyStatus); | |||
| wxPropertyContract.setBusinessType(flowType); | |||
| wxPropertyContractMapper.updateApplyStatusByRentContractId(wxPropertyContract); | |||
| } | |||
| }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType)){ | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.setId(Long.parseLong(businessId)); | |||
| wxPropertyContract.setApplyStatus(applyStatus); | |||
| wxPropertyContract.setBusinessType(flowType); | |||
| //如果是提交审批 | |||
| if (EnumRentContractAppStatus.APPLYING.getCode().intValue() == applyStatus.intValue()) { | |||
| wxPropertyContract.setStatus(EnumRentContractStatus.PERFORMANCE.getCode()); | |||
| // 审批完成 | |||
| }else if (EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| wxPropertyContractService.updatePropertyContractStatus(Long.parseLong(businessId)); | |||
| //如果是审批撤回,或者驳回,改回草稿状态 | |||
| }else if (EnumRentContractAppStatus.SETBACK.getCode().intValue() == applyStatus.intValue() | |||
| || EnumRentContractAppStatus.REJECT.getCode().intValue() == applyStatus.intValue()) { | |||
| wxPropertyContract.setStatus(EnumRentContractStatus.DRAFT.getCode()); | |||
| } | |||
| wxPropertyContractMapper.updateApplyStatus(wxPropertyContract); | |||
| } | |||
| }else if(EnumFlowKey.END_CONTRACT.getCode().equals(flowType) | |||
| @@ -289,30 +259,18 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| rent.setId(bsId); | |||
| rent.setApplyStatus(applyStatus); | |||
| rent.setBusinessType(flowType); | |||
| //rent.setBusinessType(flowType); | |||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| rent.setStatus(EnumRentContractStatus.TERMINATE.getCode()); | |||
| //终止租赁合同,同时终止物业合同 | |||
| Integer endProperty = getIngeter(getVariableByKey(variables,"endProperty")); | |||
| rent.setEndProperty(endProperty); | |||
| //rent.setEndProperty(endProperty); | |||
| wxRentContractService.endContract(rent,null); | |||
| } | |||
| wxRentContractService.updateApplyStatus(rent); | |||
| }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType)){ | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.setId(Long.parseLong(businessId)); | |||
| wxPropertyContract.setApplyStatus(applyStatus); | |||
| wxPropertyContract.setBusinessType(flowType); | |||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode()); | |||
| //账单失效 | |||
| wxPropertyContractService.endContract(wxPropertyContract,null); | |||
| } | |||
| wxPropertyContractMapper.updateApplyStatus(wxPropertyContract); | |||
| } | |||
| } else if (EnumFlowKey.BILL.getCode().equals(flowType) || EnumFlowKey.NEW_BILL_CHANGE.getCode().equals(flowType) | |||
| || EnumFlowKey.BILL_FINISH.getCode().equals(flowType)) { | |||
| @@ -110,16 +110,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| @Autowired | |||
| ExcelService excelService; | |||
| @Autowired | |||
| WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper; | |||
| @Lazy | |||
| @Autowired | |||
| WxPropertyContractService wxPropertyContractService; | |||
| @Lazy | |||
| @Autowired | |||
| WxMallService wxMallService; | |||
| @@ -1,221 +0,0 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxContractCustomers; | |||
| import com.iformall.domain.po.WxFlowRecord; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||
| import com.iformall.enums.EnumContract; | |||
| import com.iformall.enums.EnumContractOperationType; | |||
| import com.iformall.enums.EnumContractType; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.mapper.WxContractCustomersMapper; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.service.WxAgileContractService; | |||
| import com.iformall.service.WxFlowRecordService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentContractService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| import com.iformall.service.WxShopService; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxRentPropertyContractServiceImpl implements WxRentPropertyContractService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxRentContractMapper wxRentContractMapper; | |||
| @Autowired | |||
| WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| WxContractCustomersMapper wxContractCustomersMapper; | |||
| @Autowired | |||
| WxPropertyContractService wxPropertyContractService; | |||
| @Autowired | |||
| WxRentContractService wxRentContractService; | |||
| @Autowired | |||
| WxFlowRecordService wxFlowRecordService; | |||
| @Lazy | |||
| @Autowired | |||
| WxShopService wxShopService; | |||
| @Lazy | |||
| @Autowired | |||
| WxAgileContractService wxAgileContractService; | |||
| @Override | |||
| public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | |||
| if (StringUtils.isNotBlank(record.getFloorForRule()) || StringUtils.isNotBlank(record.getQueryShopIdStr())) { | |||
| List<Long> shopIdList = null; | |||
| if (StringUtils.isNotBlank(record.getQueryShopIdStr())) { | |||
| String[] qsids = record.getQueryShopIdStr().split(","); | |||
| if (null != qsids && qsids.length > 0 ) { | |||
| shopIdList = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < qsids.length ; i ++) { | |||
| String qsid = qsids[i]; | |||
| if (StringUtils.isNotBlank(qsid)) { | |||
| shopIdList.add(Long.parseLong(qsid)); | |||
| } | |||
| } | |||
| if (shopIdList.size() <= 0 ) { | |||
| shopIdList = null; | |||
| } | |||
| } | |||
| } | |||
| List<Long> contractIds = wxAgileContractService.findBuildingFloorContractIds(record, record.getFloorForRule(), null, null, shopIdList, 0); | |||
| //List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(rentContract, rentContract.getFloorForRule() , null, null,rentContract.getShopTypeForRule(), 0, 0,null); | |||
| if (null == contractIds || contractIds.size() <= 0 ) { | |||
| record.setId(-1L); | |||
| } else { | |||
| record.setIds(contractIds); | |||
| } | |||
| } | |||
| //根据客户名称查询 | |||
| if (StringUtils.isNotBlank(record.getMerchantName())) { | |||
| WxContractCustomers ccq = new WxContractCustomers(); | |||
| ccq.updateTenantInfo(record); | |||
| ccq.setName(record.getMerchantName()); | |||
| List<Long> customersIdList = wxContractCustomersMapper.findIdList(ccq); | |||
| if (null != customersIdList && customersIdList.size() > 0 ) { | |||
| record.setCustomersIdList(customersIdList); | |||
| }else { | |||
| record.setId(-1L); | |||
| } | |||
| } | |||
| PageInfo<WxRentPropertyContractVo> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); | |||
| if (null != pageInfo && null != pageInfo.getList() && pageInfo.getList().size() > 0 ) { | |||
| List<Long> customersIdList = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < pageInfo.getList().size(); i ++ ){ | |||
| WxRentPropertyContractVo contract = pageInfo.getList().get(i); | |||
| if (null != contract.getCustomersId()) { | |||
| customersIdList.add(contract.getCustomersId()); | |||
| } | |||
| } | |||
| Map<Long,WxContractCustomers> customersMap = getContractCustomersMap(record,customersIdList); | |||
| for (int i = 0 ; i < pageInfo.getList().size(); i ++ ) { | |||
| WxRentPropertyContractVo contract = pageInfo.getList().get(i); | |||
| String merchantName = ""; | |||
| if (null != customersMap && null != contract.getCustomersId()) { | |||
| WxContractCustomers cc = customersMap.get(contract.getCustomersId()); | |||
| if (null != cc) { | |||
| merchantName = merchantName + cc.getName(); | |||
| } | |||
| } | |||
| contract.setMerchantName(merchantName); | |||
| } | |||
| } | |||
| return pageInfo; | |||
| } | |||
| private Map<Long,WxContractCustomers> getContractCustomersMap(TenantEntity tenantEntity,List<Long> customerIds) { | |||
| WxContractCustomers ccq = new WxContractCustomers(); | |||
| ccq.updateTenantInfo(tenantEntity); | |||
| ccq.setIds(customerIds); | |||
| List<WxContractCustomers> cclist = wxContractCustomersMapper.findList(ccq); | |||
| if (null != cclist && cclist.size() > 0 ){ | |||
| Map<Long,WxContractCustomers> map = new HashMap<Long,WxContractCustomers>(); | |||
| for (int i = 0 ; i < cclist.size() ; i ++ ) { | |||
| WxContractCustomers cc = cclist.get(i); | |||
| if (null != cc) { | |||
| map.put(cc.getId(),cc); | |||
| } | |||
| } | |||
| return map; | |||
| } | |||
| return null; | |||
| } | |||
| @Override | |||
| public ResultData getContractInfo(Long rentId,Long propertyId) { | |||
| Map<String, Object> data = new HashMap<>(2); | |||
| if (null != rentId) { | |||
| Map<String, Object> rent = wxRentContractService.getById(rentId,EnumYesOrNo.YES.getCode()); | |||
| data.put("rent", rent); | |||
| } | |||
| //WxPropertyContract wxPropertyContractQuery = new WxPropertyContract(); | |||
| //wxPropertyContractQuery.setRentContractId(rentId); | |||
| //WxPropertyContract propertyContract = wxPropertyContractMapper.selectOne(new QueryWrapper(wxPropertyContractQuery)); | |||
| if (null != propertyId) { | |||
| WxPropertyContract propertyContract = wxPropertyContractMapper.selectById(propertyId); | |||
| if (propertyContract != null) { | |||
| List<WxAllBill> wxBillPropertyPreview = wxPropertyContractService.getWxBillPropertyPreview(propertyContract,propertyContract.getId()); | |||
| propertyContract.setPreviewBillRentList(wxBillPropertyPreview); | |||
| data.put("property", propertyContract); | |||
| } | |||
| } | |||
| return new ResultData(data); | |||
| } | |||
| @Override | |||
| public ResultData getContractApplyInfo(Long rentId,Long propertyId) { | |||
| List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(); | |||
| String bussinessId = null; | |||
| if (null != rentId && null == propertyId) { | |||
| bussinessId = String.valueOf(rentId); | |||
| }else if (null == rentId && null != propertyId) { | |||
| bussinessId = String.valueOf(propertyId); | |||
| }else { | |||
| bussinessId = String.valueOf(rentId)+"_RP_"+String.valueOf(propertyId); | |||
| } | |||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setBusinessId(bussinessId); | |||
| List<WxFlowRecord> flowRecordList = wxFlowRecordService.findList(wxFlowRecord); | |||
| for (WxFlowRecord wfr : flowRecordList) { | |||
| Map<String, Object> data = new HashMap<String, Object>(); | |||
| data.put("status", wfr.getStatus()); | |||
| data.put("userName", wfr.getUserName()); | |||
| data.put("remark", wfr.getRemark()); | |||
| data.put("updateDate",wfr.getUpdateDate()); | |||
| result.add(data); | |||
| } | |||
| return new ResultData(result); | |||
| } | |||
| @Override | |||
| public ResultData insertRentForCreate(WxRentContract wxRentContract) { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -19,7 +19,6 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxAllBillMapper; | |||
| import com.iformall.mapper.WxMerchantMapper; | |||
| import com.iformall.mapper.WxMerchantShopMapper; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.mapper.WxShopMapper; | |||
| import com.iformall.mapper.WxShopUsersInfoMapper; | |||
| @@ -84,9 +83,6 @@ public class WxShopServiceImpl implements WxShopService { | |||
| @Autowired | |||
| WxRentContractMapper wxRentContractMapper; | |||
| @Autowired | |||
| WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| WxAllBillMapper wxAllBillMapper; | |||
| @@ -472,14 +468,6 @@ public class WxShopServiceImpl implements WxShopService { | |||
| return new ResultData(Result.ERROR, "店铺存在有效或者审批中的租金合同,请先终止该合同或者审批退回作废合同"); | |||
| } | |||
| WxPropertyContract pcq = new WxPropertyContract(); | |||
| pcq.updateTenantInfo(wxShop); | |||
| pcq.setQueryShopId(wxShop.getId()); | |||
| pcq.setStatuss(status); | |||
| List<WxPropertyContract> plist = wxPropertyContractMapper.findList(pcq); | |||
| if (null != plist && plist.size() > 0 ) { | |||
| return new ResultData(Result.ERROR, "店铺存在有效或者审批中的物业合同,请先终止该合同或者审批退回作废合同"); | |||
| } | |||
| // WxAllBill abq = new WxAllBill(); | |||
| // abq.updateTenantInfo(wxShop); | |||
| // abq.setQueryShopNumber(wxShop.getShopNumber()); | |||
| @@ -808,14 +808,14 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| } | |||
| private void checkCustomer(InvestCustomerEntity customerEntity) { | |||
| if (Objects.equals(customerEntity.getType(), EnumCustomerType.COOPERATIVE)) { | |||
| InvestHelper.notNull(customerEntity.getContractNo(), "合同编号"); | |||
| WxRentContract contract = new WxRentContract(); | |||
| contract.updateTenantInfo(InvestUserContext.getUser()); | |||
| contract.setContractNumber(customerEntity.getContractNo()); | |||
| ResultData resultData = rentContractService.hasContractNumber(contract); | |||
| InvestHelper.isTrue(Objects.equals(resultData.data, true),ErrorCode.INVEST_RESULT_NOT_FOUND,"合同编号"); | |||
| } | |||
| // if (Objects.equals(customerEntity.getType(), EnumCustomerType.COOPERATIVE)) { | |||
| // InvestHelper.notNull(customerEntity.getContractNo(), "合同编号"); | |||
| // WxRentContract contract = new WxRentContract(); | |||
| // contract.updateTenantInfo(InvestUserContext.getUser()); | |||
| // contract.setContractNumber(customerEntity.getContractNo()); | |||
| // ResultData resultData = rentContractService.hasContractNumber(contract); | |||
| // InvestHelper.isTrue(Objects.equals(resultData.data, true),ErrorCode.INVEST_RESULT_NOT_FOUND,"合同编号"); | |||
| // } | |||
| } | |||
| @Transactional(rollbackFor = Exception.class) | |||
| @@ -6,7 +6,6 @@ import org.springframework.stereotype.Service; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.service.WxMerchantBUserService; | |||
| import com.iformall.service.helper.WxBillAllHelper; | |||
| @@ -18,11 +17,11 @@ public class PayBillBaseService { | |||
| @Autowired | |||
| WxMerchantBUserService wxMerchantBUserService; | |||
| public void updateBillPaid(String tenantId,Long merchantBUserId,EnumBillAllType billType,Long billId,String paid,WxBillPayWay payWay,String remark) { | |||
| public void updateBillPaid(String tenantId,Long merchantBUserId,Long billId,String paid,WxBillPayWay payWay,String remark) { | |||
| WxBillPayDTO dto = new WxBillPayDTO(); | |||
| dto.setTenantId(tenantId); | |||
| dto.setId(billId); | |||
| dto.setBillTypeValue(billType.getCode()); | |||
| //dto.setBillTypeValue(billType.getCode()); | |||
| dto.setAddpay(paid); | |||
| dto.setPayWay(payWay.getId()); | |||
| dto.setPayWayName(payWay.getName()); | |||
| @@ -19,7 +19,6 @@ import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxBuser; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.service.payBill.PayBillAdapterService; | |||
| import com.iformall.service.payBill.impl.PayBillBaseService; | |||
| import com.iformall.utils.DateUtils; | |||
| @@ -57,7 +56,7 @@ public class JianHangMaServiceImpl extends PayBillBaseService implements PayBill | |||
| Long billId = Long.parseLong(remark1_args[1]); | |||
| Long merchantBUserId = Long.parseLong((String)paramMap.get("REMARK2")); | |||
| String orderId = (String) paramMap.get("ORDERID"); | |||
| this.updateBillPaid(tenantId, merchantBUserId, EnumBillAllType.getEnum(billType), billId, | |||
| this.updateBillPaid(tenantId, merchantBUserId, billId, | |||
| money, payWay, "商户单号"+orderId); | |||
| } | |||
| } | |||
| @@ -20,7 +20,6 @@ import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxBuser; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.mapper.WxBuserMapper; | |||
| import com.iformall.service.payBill.PayBillAdapterService; | |||
| import com.iformall.service.payBill.impl.PayBillBaseService; | |||
| @@ -62,7 +61,7 @@ public class JianHangWxMiniProgramServiceImpl extends PayBillBaseService impleme | |||
| Long billId = Long.parseLong(remark1_args[1]); | |||
| Long merchantBUserId = Long.parseLong((String)paramMap.get("REMARK2")); | |||
| String orderId = (String) paramMap.get("ORDERID"); | |||
| this.updateBillPaid(tenantId, merchantBUserId, EnumBillAllType.getEnum(billType), billId, | |||
| this.updateBillPaid(tenantId, merchantBUserId, billId, | |||
| money, payWay, "商户单号"+orderId); | |||
| } | |||
| } | |||
| @@ -24,11 +24,13 @@ public class MiniProgramDemo { | |||
| String POSID = wxPayAccountBill.getPayConfigString("POSID"); | |||
| String BRANCHID = wxPayAccountBill.getPayConfigString("BRANCHID"); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| String ORDERID = billdetail.getBillType()+"_"+idWorker.nextId(); | |||
| //String ORDERID = billdetail.getBillType()+"_"+idWorker.nextId(); | |||
| String ORDERID = "_"+idWorker.nextId(); | |||
| String PAYMENT= money.toString(); | |||
| String CURCODE="01"; | |||
| String TXCODE = "530590"; | |||
| String REMARK1 = billdetail.getBillType()+"_"+billdetail.getId(); | |||
| //String REMARK1 = billdetail.getBillType()+"_"+billdetail.getId(); | |||
| String REMARK1 = "_"+billdetail.getId(); | |||
| String REMARK2 = String.valueOf(buser.getId()); | |||
| String TYPE = "1"; | |||
| String GATEWAY="0"; | |||
| @@ -25,11 +25,13 @@ public class QrDemo { | |||
| String POSID = wxPayAccountBill.getPayConfigString("POSID"); | |||
| String BRANCHID = wxPayAccountBill.getPayConfigString("BRANCHID"); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| String ORDERID = billdetail.getBillType()+"_"+idWorker.nextId(); | |||
| //String ORDERID = billdetail.getBillType()+"_"+idWorker.nextId(); | |||
| String ORDERID = "_"+idWorker.nextId(); | |||
| String PAYMENT= money.toString(); | |||
| String CURCODE="01"; | |||
| String TXCODE = "530550"; | |||
| String REMARK1 = billdetail.getBillType()+"_"+billdetail.getId(); | |||
| //String REMARK1 = billdetail.getBillType()+"_"+billdetail.getId(); | |||
| String REMARK1 = "_"+billdetail.getId(); | |||
| String REMARK2 = String.valueOf(buser.getId()); | |||
| String RETURNTYPE="3"; | |||
| String TIMEOUT = DateUtils.date2String(DateUtils.getSecondsTimeAfter(10*60, new Date()), DateUtils.DATE_PATTERN_ALL_NOSPACE); | |||
| @@ -21,7 +21,6 @@ import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.enums.EnumAppPlat; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxAppinfoService; | |||
| import com.iformall.service.WxPayAccountService; | |||
| @@ -58,7 +57,8 @@ public class WxMiniProgramServiceImpl extends PayBillBaseService implements PayB | |||
| throw new MallinkException(ErrorCode.API_KEY_NOT_FOUND.getCode(),"未查询到payAccount."); | |||
| } | |||
| StringBuffer attachSb = new StringBuffer() | |||
| .append(billdetail.getBillType()).append(",") | |||
| //.append(billdetail.getBillType()).append(",") | |||
| .append("").append(",") | |||
| .append(billdetail.getId()).append(",") | |||
| .append(buser.getId()).append(",") | |||
| ; | |||
| @@ -67,8 +67,9 @@ public class WxMiniProgramServiceImpl extends PayBillBaseService implements PayB | |||
| Integer fee = m1.intValue(); | |||
| try { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| String uniquePayOrderNo = billdetail.getBillType()+"_"+idWorker.nextId(); | |||
| PayAdapterResult wxResult = wxMiniAppPayAdapterService.payIsv(payAccount, bAppInfo, payAccount.getSubMchId(), openId, billdetail.getBillTypeName(), attach, uniquePayOrderNo, | |||
| //String uniquePayOrderNo = billdetail.getBillType()+"_"+idWorker.nextId(); | |||
| String uniquePayOrderNo = "_"+idWorker.nextId(); | |||
| PayAdapterResult wxResult = wxMiniAppPayAdapterService.payIsv(payAccount, bAppInfo, payAccount.getSubMchId(), openId, "", attach, uniquePayOrderNo, | |||
| fee, "127.0.0.1", wxPayAccountBill.getPaidCallBack()+"/"+wxPayAccountBill.getTenantId(), new Date(), false); | |||
| if (wxResult.isSuccess()) { | |||
| return wxResult; | |||
| @@ -106,7 +107,7 @@ public class WxMiniProgramServiceImpl extends PayBillBaseService implements PayB | |||
| Long billId = Long.parseLong(attrs[1]); | |||
| Long merchantBUserId = Long.parseLong(attrs[2]); | |||
| String paid = new BigDecimal(cashFee).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP).toPlainString(); | |||
| this.updateBillPaid(tenantId, merchantBUserId, EnumBillAllType.getEnum(billType), billId, | |||
| this.updateBillPaid(tenantId, merchantBUserId, billId, | |||
| paid, payWay, "微信支付单号"+transcationId); | |||
| }else { | |||
| throw new MallinkException(ErrorCode.API_KEY_NOT_FOUND.getCode(),"attach参数错误"); | |||
| @@ -17,7 +17,6 @@ | |||
| <result column="receive_pay" jdbcType="VARCHAR" property="receivePay"/> | |||
| <result column="history_receive_pay" jdbcType="VARCHAR" property="historyReceivePay"/> | |||
| <result column="pay" jdbcType="VARCHAR" property="pay"/> | |||
| <result column="bill_type" jdbcType="INTEGER" property="billType"/> | |||
| <result column="pay_way" jdbcType="BIGINT" property="payWay"/> | |||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | |||
| <result column="set_off" jdbcType="VARCHAR" property="setOff"/> | |||
| @@ -49,14 +48,15 @@ | |||
| <result column="rent_area" jdbcType="VARCHAR" property="rentArea" /> | |||
| <result column="can_edit" jdbcType="INTEGER" property="canEdit" /> | |||
| <result column="cus_name" jdbcType="VARCHAR" property="cusName" /> | |||
| <result column="fees_type" jdbcType="INTEGER" property="feesType"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`createtime`,`create_by`,`create_by_name`,`updatetime`,`update_by`,`update_by_name`, | |||
| `price_detail`,`need_pay`,`receive_pay`,`history_receive_pay`,`pay`,`bill_type`,`pay_way`,`pay_date`,`set_off`,`use_money`,`starttime`,`endtime`,`status`,`energy_fees_id`, | |||
| `price_detail`,`need_pay`,`receive_pay`,`history_receive_pay`,`pay`,`pay_way`,`pay_date`,`set_off`,`use_money`,`starttime`,`endtime`,`status`,`energy_fees_id`, | |||
| `return_pay`,`bill_remark`,`last_owe_call_time`,`last_owe_call_user`,`bussiness_manage_fee_need_pay`,`operating_manage_fee_need_pay`,`receive_date`,`period`, | |||
| `is_preview`,`shop_info`,`rent_contract_id`,`rent_contract_agile_fees_type`,`property_contract_id`,`parent_bill_id`,`virtual_compose_id`,`parent_virtual_compose_id`, | |||
| `energy_reading_calcuteId`,`energy_reading_id`,`extra_create_from`,`rent_area`,`can_edit`,`cus_name` | |||
| `energy_reading_calcuteId`,`energy_reading_id`,`extra_create_from`,`rent_area`,`can_edit`,`cus_name`,`fees_type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -66,9 +66,9 @@ | |||
| <if test=" null != shopId ">and `shop_id` = #{shopId}</if> | |||
| <if test=" null != createBy ">and `create_by` = #{createBy}</if> | |||
| <if test=" null != createByName and '' != createByName"> and `create_by_name` like concat('%',#{createByName},'%')</if> | |||
| <if test=" null != billType ">and `bill_type` = #{billType}</if> | |||
| <if test=" null != payWay ">and `pay_way` = #{payWay}</if> | |||
| <if test=" null != status ">and `status` = #{status}</if> | |||
| <if test=" null != feesType ">and `fees_type` = #{feesType}</if> | |||
| <if test=" null != energyFeesId ">and `energy_fees_id` = #{energyFeesId}</if> | |||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != rentContractAgileFeesType ">and `rent_contract_agile_fees_type` = #{rentContractAgileFeesType}</if> | |||
| @@ -84,53 +84,33 @@ | |||
| <if test=" null != endtimeEqual">and `endtime` = #{endtimeEqual}</if> | |||
| <if test=" null != extraCreateFrom">and `extra_create_from` = #{extraCreateFrom}</if> | |||
| <if test=" null != noExtraCreateFrom">and `extra_create_from` is null</if> | |||
| <if test=" null != advanceHasMoney">and bill_type = 6 and IFNULL(`pay`,'0') -IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0</if> | |||
| <if test=" null != depositHasMoney">and IFNULL(`pay`,'0') - IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0 and bill_type in (13,21,5)</if> | |||
| <if test=" null != advanceHasMoney">and fees_type = 2 and IFNULL(`pay`,'0') -IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0</if> | |||
| <!-- <if test=" null != depositHasMoney">and IFNULL(`pay`,'0') - IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0 and bill_type in (13,21,5)</if>--> | |||
| <if test=" null != canEdit">and `can_edit` = #{canEdit}</if> | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(starttime,'%Y-%m') <= #{month} and date_format(endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null == nearBillLastTime and null != oweBillLastTime"> | |||
| and ( | |||
| (`receive_date` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,7)) | |||
| or | |||
| (`receive_date` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5,7)) | |||
| ) | |||
| and (`receive_date` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and fees_type = 1) | |||
| </if> | |||
| <if test=" null != nearBillLastTime and null != oweBillLastTime"> | |||
| and ( | |||
| (`receive_date` > #{oweBillLastTime} and `receive_date` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,7)) | |||
| or | |||
| (`receive_date` > #{oweBillLastTime} and `receive_date` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5,7)) | |||
| ) | |||
| and (`receive_date` > #{oweBillLastTime} and `receive_date` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and fees_type = 1) | |||
| </if> | |||
| <if test=" null != needPayStartDay"> | |||
| and ( | |||
| (`receive_date` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,7)) | |||
| or | |||
| (`receive_date` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5,7)) | |||
| ) | |||
| and (`receive_date` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and fees_type = 1) | |||
| </if> | |||
| <if test=" null != needPayNoDays"> | |||
| and ( | |||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,6,7)) | |||
| or | |||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5,6,7)) | |||
| ) | |||
| and ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and fees_type = 1) | |||
| </if> | |||
| <if test=" null != toPayMerchant"> | |||
| and ( | |||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') < 0 and bill_type not in (13,21,5,6,7)) | |||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') < 0 and fees_type = 1) | |||
| or | |||
| ( `pay` - IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0 and bill_type in (13,21,5,7)) | |||
| ( `pay` - IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0 and fees_type = 2) | |||
| ) | |||
| </if> | |||
| <if test=" 1 == notifyed "> | |||
| and ( | |||
| (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,7)) | |||
| or | |||
| (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5,7)) | |||
| ) | |||
| and (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') > 0 ) | |||
| </if> | |||
| <if test=" 1 == hasParentBillId ">and `parent_bill_id` is not null</if> | |||
| <if test=" 0 == hasParentBillId ">and `parent_bill_id` is null</if> | |||
| @@ -321,16 +301,13 @@ | |||
| select | |||
| energy_fees_id, | |||
| count(1) total_count , | |||
| case when bill_type in (13,21,5,7) then sum(CAST(`receive_pay` AS DECIMAL(20,2)) - CAST(`pay` AS DECIMAL(20,2)) - CAST(IFNULL(`set_off`,'0') AS DECIMAL(20,2))) | |||
| else sum(CAST(`receive_pay` AS DECIMAL(20,2)) - CAST(`pay` AS DECIMAL(20,2)) - CAST(IFNULL(`set_off`,'0') AS DECIMAL(20,2)) + CAST(IFNULL(`return_pay`,'0') AS DECIMAL(20,2))) | |||
| end as total_money, | |||
| sum(CAST(`receive_pay` AS DECIMAL(20,2)) - CAST(`pay` AS DECIMAL(20,2)) - CAST(IFNULL(`set_off`,'0') AS DECIMAL(20,2))) as total_money, | |||
| MIN(starttime) min_begin_time from wx_all_bill | |||
| <include refid="dynamicWhereConditions"/> | |||
| group by energy_fees_id | |||
| </select> | |||
| <resultMap id="NotifyResultMap" type="com.iformall.domain.vo.WxBillNotify"> | |||
| <result column="bill_type" jdbcType="INTEGER" property="billType"/> | |||
| <result column="bill_id" jdbcType="BIGINT" property="billId" /> | |||
| <result column="starttime" jdbcType="TIMESTAMP" property="starttime"/> | |||
| <result column="endtime" jdbcType="TIMESTAMP" property="endtime"/> | |||
| @@ -339,7 +316,7 @@ | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId"/> | |||
| </resultMap> | |||
| <select id="getBillNotifyList" parameterType="com.iformall.domain.po.WxAllBill" resultMap="NotifyResultMap"> | |||
| select bill_type,br.id as bill_id, br.starttime,br.endtime,br.receive_pay,br.pay,br.shop_id from wx_all_bill br | |||
| select br.id as bill_id, br.starttime,br.endtime,br.receive_pay,br.pay,br.shop_id from wx_all_bill br | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| @@ -347,10 +324,6 @@ | |||
| delete from wx_all_bill where rent_contract_id = #{id} | |||
| </delete> | |||
| <delete id="deleteBillByPropertyContract" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| delete from wx_all_bill where property_contract_id = #{id} | |||
| </delete> | |||
| <delete id="deletePreviewBill" parameterType="com.iformall.domain.po.WxAllBill"> | |||
| delete from wx_all_bill where is_preview = 1 | |||
| <if test=" null != rentContractId"> | |||
| @@ -434,9 +407,9 @@ | |||
| <delete id = "deleteById" parameterType="HashMap"> | |||
| delete from wx_all_bill where id = #{id} and tenant_id = #{tenantId} | |||
| and ( | |||
| (bill_type != 7 and pay <= 0 and IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 and IFNULL(`use_money`,'0') <= 0) | |||
| ( pay <= 0 and IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 and IFNULL(`use_money`,'0') <= 0) | |||
| or | |||
| (bill_type = 7 and IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 and IFNULL(`use_money`,'0') <= 0) | |||
| ( IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 and IFNULL(`use_money`,'0') <= 0) | |||
| ) | |||
| </delete> | |||
| @@ -468,15 +441,15 @@ | |||
| ( | |||
| IFNULL(`pay`,'0') <= 0 | |||
| or | |||
| ( starttime >= #{starttime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,6,7)) | |||
| ( starttime >= #{starttime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 ) | |||
| or | |||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5,6,7)) | |||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 ) | |||
| ) | |||
| <!-- 应fu --> | |||
| or ( | |||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') < 0 and bill_type not in (13,21,5,6,7)) | |||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') < 0 ) | |||
| or | |||
| ( `pay` - IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0 and bill_type in (13,21,5,7)) | |||
| ( `pay` - IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0 ) | |||
| ) | |||
| ) | |||
| @@ -5,7 +5,6 @@ | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="bill_type" jdbcType="INTEGER" property="billType"/> | |||
| <result column="bill_id" jdbcType="BIGINT" property="billId"/> | |||
| <result column="old_money" jdbcType="VARCHAR" property="oldMoney"/> | |||
| <result column="new_money" jdbcType="VARCHAR" property="newMoney"/> | |||
| @@ -23,7 +22,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`bill_type`,`bill_id`,`old_money`,`new_money`,`user_Type`,`user_id`,`user_name`,`phone`,`action`,`details`,`createtime`,`updatetime`,`pay_date`,`pay_way`,`remark` | |||
| `id`,`tenant_id`,`parent_tenant_id`,`bill_id`,`old_money`,`new_money`,`user_Type`,`user_id`,`user_name`,`phone`,`action`,`details`,`createtime`,`updatetime`,`pay_date`,`pay_way`,`remark` | |||
| </sql> | |||
| @@ -41,10 +40,6 @@ | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != billType "> | |||
| and `bill_type` = #{billType} | |||
| </if> | |||
| <if test=" null != action "> | |||
| and `action` = #{action} | |||
| </if> | |||
| @@ -85,6 +80,7 @@ | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <!-- | |||
| <resultMap id="JianMianResultMap" type="com.iformall.domain.vo.WxBillJianMian"> | |||
| <result column="bill_type" jdbcType="INTEGER" property="billType"/> | |||
| <result column="total" jdbcType="VARCHAR" property="total"/> | |||
| @@ -116,5 +112,5 @@ | |||
| </if> | |||
| group by bill_type | |||
| </select> | |||
| --> | |||
| </mapper> | |||
| @@ -1,7 +1,7 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxEnergyFeesShopMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyFeesShop"> | |||
| <mapper namespace="com.iformall.mapper.WxFeesCalcuteShopMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFeesCalcuteShop"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| @@ -58,28 +58,28 @@ | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxEnergyFeesShop" resultMap="BaseResultMap"> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxFeesCalcuteShop" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_energy_fees_shop | |||
| from wx_fees_calcute_shop | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_energy_fees_shop where id = #{id} and `tenant_id` = #{tenantId} | |||
| from wx_fees_calcute_shop where id = #{id} and `tenant_id` = #{tenantId} | |||
| </select> | |||
| <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxEnergyFeesShop" resultType="Long"> | |||
| <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxFeesCalcuteShop" resultType="Long"> | |||
| select distinct fees_id | |||
| from wx_energy_fees_shop | |||
| from wx_fees_calcute_shop | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <insert id="updateTimes" parameterType="HashMap"> | |||
| <foreach collection="list" item="item" index="index" separator=";"> | |||
| update wx_energy_fees_shop set begin_time = #{item.beginTime}, end_time = #{item.endTime} where id = #{item.id} | |||
| update wx_fees_calcute_shop set begin_time = #{item.beginTime}, end_time = #{item.endTime} where id = #{item.id} | |||
| </foreach> | |||
| </insert> | |||
| @@ -1,7 +1,7 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxEnergyFeesMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyFees"> | |||
| <mapper namespace="com.iformall.mapper.WxFinanceFeesMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFinanceFees"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| @@ -9,22 +9,14 @@ | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| <result column="price" jdbcType="VARCHAR" property="price"/> | |||
| <result column="cashier_type" jdbcType="INTEGER" property="cashierType"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="bill_type" jdbcType="INTEGER" property="billType"/> | |||
| <result column="is_system" jdbcType="INTEGER" property="isSystem"/> | |||
| <result column="fixed_price" jdbcType="INTEGER" property="fixedPrice"/> | |||
| <result column="calcute_unit" jdbcType="INTEGER" property="calcuteUnit"/> | |||
| <result column="time_unit" jdbcType="INTEGER" property="timeUnit"/> | |||
| <result column="tax_rate" jdbcType="VARCHAR" property="taxRate"/> | |||
| <result column="is_despoit" jdbcType="INTEGER" property="isDespoit"/> | |||
| <result column="is_public" jdbcType="INTEGER" property="isPublic"/> | |||
| <result column="fees_type" jdbcType="INTEGER" property="feesType"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`is_del`,`name`,`price`,`cashier_type`,`type`,`bill_type`,`is_system`, | |||
| `fixed_price`,`calcute_unit`,`time_unit`,`tax_rate`,`is_despoit`,`is_public` | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`is_del`,`name`, | |||
| `tax_rate`,`is_despoit`,`fees_type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -37,23 +29,9 @@ | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | |||
| <if test=" null != cashierType ">and `cashier_type` = #{cashierType}</if> | |||
| <if test=" null != type ">and `type` = #{type}</if> | |||
| <if test=" null != billType ">and `bill_type` = #{billType}</if> | |||
| <if test=" null != notSetOff ">and `bill_type` != 6</if> | |||
| <if test=" null != isSystem ">and `is_system` = #{isSystem}</if> | |||
| <if test=" null != fixedPrice ">and `fixed_price` = #{fixedPrice}</if> | |||
| <if test=" null != calcuteUnit ">and `calcute_unit` = #{calcuteUnit}</if> | |||
| <if test=" null != timeUnit ">and `time_unit` = #{timeUnit}</if> | |||
| <if test=" null != name and '' != name ">and name like concat('%', #{name},'%')</if> | |||
| <if test=" null != isDespoit ">and `is_despoit` = #{isDespoit}</if> | |||
| <if test=" null != isPublic ">and `is_public` = #{isPublic}</if> | |||
| <if test=" null != billTypeList "> | |||
| and bill_type in | |||
| <foreach collection="billTypeList" index="index" item="billTypeItem" open="(" separator="," close=")"> | |||
| #{billTypeItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != feesType ">and `fees_type` = #{feesType}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -63,27 +41,27 @@ | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxEnergyFees" resultMap="BaseResultMap"> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxFinanceFees" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_energy_fees | |||
| from wx_finance_fees | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxEnergyFees" resultType="Long"> | |||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxFinanceFees" resultType="Long"> | |||
| select id | |||
| from wx_energy_fees | |||
| from wx_finance_fees | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_energy_fees where id = #{id} and `tenant_id` = #{tenantId} | |||
| from wx_finance_fees where id = #{id} and `tenant_id` = #{tenantId} | |||
| </select> | |||
| <update id = "setIsDel" parameterType="HashMap"> | |||
| update wx_energy_fees set is_del = #{isDel} where id = #{id} and `tenant_id` = #{tenantId} | |||
| update wx_finance_fees set is_del = #{isDel} where id = #{id} and `tenant_id` = #{tenantId} | |||
| </update> | |||
| </mapper> | |||
| @@ -1,7 +1,7 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxEnergyFeesSetoffMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyFeesSetoff"> | |||
| <mapper namespace="com.iformall.mapper.WxFinanceFeesSetoffMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFinanceFeesSetoff"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| @@ -35,33 +35,33 @@ | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" resultMap="BaseResultMap"> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxFinanceFeesSetoff" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_energy_fees_setoff | |||
| from wx_finance_fees_setoff | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" resultType="Long"> | |||
| <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxFinanceFeesSetoff" resultType="Long"> | |||
| select distinct fees_id | |||
| from wx_energy_fees_setoff | |||
| from wx_finance_fees_setoff | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findadvanceFeesIdList" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" resultType="Long"> | |||
| <select id="findadvanceFeesIdList" parameterType="com.iformall.domain.po.WxFinanceFeesSetoff" resultType="Long"> | |||
| select distinct advance_fees_id | |||
| from wx_energy_fees_setoff | |||
| from wx_finance_fees_setoff | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_energy_fees_setoff where id = #{id} and `tenant_id` = #{tenantId} | |||
| from wx_finance_fees_setoff where id = #{id} and `tenant_id` = #{tenantId} | |||
| </select> | |||
| <delete id="deleteByAdvanceId" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" > | |||
| delete from wx_energy_fees_setoff where `tenant_id` = #{tenantId} and advance_fees_id = #{advanceFeesId} | |||
| <delete id="deleteByAdvanceId" parameterType="com.iformall.domain.po.WxFinanceFeesSetoff" > | |||
| delete from wx_finance_fees_setoff where `tenant_id` = #{tenantId} and advance_fees_id = #{advanceFeesId} | |||
| </delete> | |||
| </mapper> | |||
| @@ -8,7 +8,6 @@ | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="bill_id" jdbcType="BIGINT" property="billId"/> | |||
| <result column="bill_type" jdbcType="INTEGER" property="billType"/> | |||
| <result column="bill_cus_name" jdbcType="VARCHAR" property="billCusName"/> | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId"/> | |||
| <result column="fees_id" jdbcType="BIGINT" property="feesId"/> | |||
| @@ -24,7 +23,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`bill_id`,`bill_type`,`bill_cus_name`,`shop_id`,`fees_id`, | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`bill_id`,`bill_cus_name`,`shop_id`,`fees_id`, | |||
| `pay_way`,`receive_id`,`receive`,`pay`,`starttime`,`endtime`,`is_del`,`type`,`receive_date` | |||
| </sql> | |||
| @@ -38,7 +37,6 @@ | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != billId ">and `bill_id` = #{billId}</if> | |||
| <if test=" null != billType ">and `bill_type` = #{billType}</if> | |||
| <if test=" null != billCusName and '' != billCusName"> | |||
| and `bill_cus_name` like concat('%',#{billCusName},'%') | |||
| </if> | |||
| @@ -9,7 +9,6 @@ | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="receive_id" jdbcType="BIGINT" property="receiveId"/> | |||
| <result column="bill_id" jdbcType="BIGINT" property="billId"/> | |||
| <result column="bill_type" jdbcType="INTEGER" property="billType"/> | |||
| <result column="fees_id" jdbcType="BIGINT" property="feesId"/> | |||
| <result column="advance_id" jdbcType="BIGINT" property="advanceId"/> | |||
| <result column="setoff" jdbcType="VARCHAR" property="setoff"/> | |||
| @@ -20,7 +19,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`bill_id`,`bill_type`,`fees_id`, | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`bill_id`,`fees_id`, | |||
| `receive_id`,`advance_id`,`setoff`,`shop_id`,`starttime`,`endtime`,`is_del` | |||
| </sql> | |||
| @@ -35,7 +34,6 @@ | |||
| </if> | |||
| <if test=" null != billId ">and `bill_id` = #{billId}</if> | |||
| <if test=" null != receiveId ">and `receive_id` = #{receiveId}</if> | |||
| <if test=" null != billType ">and `bill_type` = #{billType}</if> | |||
| <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | |||
| <if test=" null != advanceId ">and `advance_id` = #{advanceId}</if> | |||
| <if test=" null != shopId ">and `shop_id` = #{shopId}</if> | |||
| @@ -1,308 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxPropertyContractMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPropertyContract"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="customers_id" jdbcType="BIGINT" property="customersId"/> | |||
| <result column="decimal_size" jdbcType="INTEGER" property="decimalSize"/> | |||
| <result column="price" jdbcType="VARCHAR" property="price"/> | |||
| <result column="rental_start_date" jdbcType="TIMESTAMP" property="rentalStartDate"/> | |||
| <result column="rental_end_date" jdbcType="TIMESTAMP" property="rentalEndDate"/> | |||
| <result column="sign_date" jdbcType="TIMESTAMP" property="signDate"/> | |||
| <result column="receive_period" jdbcType="INTEGER" property="receivePeriod"/> | |||
| <result column="receive_period_unit" jdbcType="INTEGER" property="receivePeriodUnit"/> | |||
| <result column="pay_period_rate" jdbcType="INTEGER" property="payPeriodRate"/> | |||
| <result column="filepath" jdbcType="VARCHAR" property="filepath"/> | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="contract_number" jdbcType="VARCHAR" property="contractNumber"/> | |||
| <result column="deposit" jdbcType="VARCHAR" property="deposit"/> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | |||
| <result column="rent_area" jdbcType="VARCHAR" property="rentArea"/> | |||
| <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/> | |||
| <result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/> | |||
| <result column="pay_account" jdbcType="VARCHAR" property="payAccount"/> | |||
| <result column="filename" jdbcType="VARCHAR" property="filename"/> | |||
| <result column="lease" jdbcType="INTEGER" property="lease"/> | |||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | |||
| <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/> | |||
| <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/> | |||
| <result column="apply_status" property="applyStatus"/> | |||
| <result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/> | |||
| <result column="business_type" property="businessType"/> | |||
| <result column="adjust_ratio" property="adjustRatio"/> | |||
| <result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/> | |||
| <result column="file_names" jdbcType="VARCHAR" property="fileNames"/> | |||
| <result column="price_unit" property="priceUnit"/> | |||
| <result column="rent_price" property="rentPrice"/> | |||
| <result column="subject_name" property="subjectName"/> | |||
| <result column="rent_start_type" property="rentStartType"/> | |||
| <result column="fixed_price" jdbcType="INTEGER" property="fixedPrice"/> | |||
| <result column="create_by" jdbcType="BIGINT" property="createBy"/> | |||
| <result column="create_by_name" jdbcType="VARCHAR" property="createByName"/> | |||
| <result column="update_by" jdbcType="BIGINT" property="updateBy"/> | |||
| <result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/> | |||
| <result column="operation_type" property="operationType"/> | |||
| <result column="late_pay_ratio" property="latePayRatio"/> | |||
| <result column="late_pay_day" property="latePayDay"/> | |||
| <result column="end_contract_time" jdbcType="TIMESTAMP" property="endContractTime"/> | |||
| <result column="out_date_notify_days" jdbcType="INTEGER" property="outDateNotifyDays"/> | |||
| <result column="out_date_notify_phone" jdbcType="VARCHAR" property="outDateNotifyPhone"/> | |||
| <result column="create_type" jdbcType="INTEGER" property="createType"/> | |||
| <result column="price_detail" jdbcType="VARCHAR" property="priceDetail"/> | |||
| <result column="fees_standards_info" jdbcType="VARCHAR" property="feesStandardsInfo"/> | |||
| <result column="day_price_calcute" jdbcType="INTEGER" property="dayPriceCalcute"/> | |||
| <result column="month_average_days" jdbcType="INTEGER" property="monthAverageDays"/> | |||
| <result column="first_bill_date_start" jdbcType="TIMESTAMP" property="firstBillDateStart"/> | |||
| <result column="first_bill_date_end" jdbcType="TIMESTAMP" property="firstBillDateEnd"/> | |||
| <result column="first_bill_receive_date" jdbcType="TIMESTAMP" property="firstBillReceiveDate"/> | |||
| <result column="shop_id_str" jdbcType="VARCHAR" property="shopIdStr"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`customers_id`,`decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`create_type`, | |||
| `sign_date`,`receive_period`,`filepath`,`status`,`contract_number`,`price_detail`,`create_by_name`,`update_by_name`, | |||
| `deposit`,`is_del`,`receive_period_unit`,`create_by`,`update_by`,`first_bill_receive_date`,`shop_id_str`, | |||
| `updatetime`,`createtime`,`rent_area`,`fees_standards_info`,`first_bill_date_start`,`first_bill_date_end`, | |||
| `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`,`day_price_calcute`,`month_average_days`, | |||
| `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,fixed_price,`pay_period_rate`, | |||
| `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day,end_contract_time,out_date_notify_days,out_date_notify_phone | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id ">and `id` = #{id}</if> | |||
| <if test=" null != customersId ">and `customers_id` = #{customersId}</if> | |||
| <if test=" null != price ">and `price` = #{price}</if> | |||
| <if test=" null != rentalStartDate ">and `rental_start_date` = #{rentalStartDate}</if> | |||
| <if test=" null != rentalEndDate ">and `rental_end_date` = #{rentalEndDate}</if> | |||
| <if test=" null != useStartTime and null != useEndTime"> | |||
| and ( | |||
| (`rental_start_date` <= #{useStartTime} and rental_end_date > #{useStartTime}) | |||
| or | |||
| (`rental_start_date` >= #{useStartTime} and rental_start_date < #{useEndTime}) | |||
| ) | |||
| </if> | |||
| <if test=" null != outDateNofity ">and out_date_notify_phone is not null and out_date_notify_phone != '' and and out_date_notify_days is not null and out_date_notify_days > 0 </if> | |||
| <if test=" null != signDate ">and `sign_date` = #{signDate}</if> | |||
| <if test=" null != receivePeriod ">and `receive_period` = #{receivePeriod}</if> | |||
| <if test=" null != receivePeriodUnit ">and `receive_period_unit` = #{receivePeriodUnit}</if> | |||
| <if test=" null != payPeriodRate ">and `pay_period_rate` = #{payPeriodRate}</if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != filepath ">and `filepath` = #{filepath}</if> | |||
| <if test=" null != status ">and `status` = #{status}</if> | |||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | |||
| <if test=" null != contractNumber and '' != contractNumber">and `contract_number` = #{contractNumber}</if> | |||
| <if test=" null != deposit ">and `deposit` = #{deposit}</if> | |||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | |||
| <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != createtime ">and `createtime` = #{createtime}</if> | |||
| <if test=" null != rentArea ">and `rent_area` = #{rentArea}</if> | |||
| <if test=" null != linkPerson ">and `link_person` = #{linkPerson}</if> | |||
| <if test=" null != linkPhone ">and `link_phone` = #{linkPhone}</if> | |||
| <if test=" null != payAccount ">and `pay_account` = #{payAccount}</if> | |||
| <if test=" null != filename ">and `filename` = #{filename}</if> | |||
| <if test=" null != lease ">and `lease` = #{lease}</if> | |||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != startDate ">and `start_date` = #{startDate}</if> | |||
| <if test=" null != endDate ">and `end_date` = #{endDate}</if> | |||
| <if test=" null != operationType ">and `operation_type` = #{operationType}</if> | |||
| <if test=" null != createType ">and `create_type` = #{createType}</if> | |||
| <if test=" null != dayPriceCalcute ">and `day_price_calcute` = #{dayPriceCalcute}</if> | |||
| <if test=" null != monthAverageDays ">and `month_average_days` = #{monthAverageDays}</if> | |||
| <if test=" null != queryShopId"> | |||
| and concat(',',shop_id_str,',') like concat('%,',#{queryShopId},',%') | |||
| </if> | |||
| <if test=" null != businessForRule and '' != businessForRule "> | |||
| and business_id in (${businessForRule}) | |||
| </if> | |||
| <if test=" null != customersIdList "> | |||
| and customers_id in | |||
| <foreach collection="customersIdList" index="index" item="cusItem" open="(" separator="," close=")"> | |||
| #{cusItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != statuss "> | |||
| and status in | |||
| <foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")"> | |||
| #{statusItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxPropertyContract" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_property_contract | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxPropertyContract" resultType="Long"> | |||
| select id | |||
| from wx_property_contract | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="queryRentContractWaitSignStatus" resultType="int" | |||
| parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| select count(id) from wx_property_contract where status=#{status} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </select> | |||
| <select id="queryRentContractEndSoonStatus" resultType="int" | |||
| parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| select count(id) from wx_property_contract where status=4 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </select> | |||
| <select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| select count(id) from wx_property_contract where status in (2,3,4) | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </select> | |||
| <select id="queryRentContractEndStatus" resultType="int" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| select count(id) from wx_property_contract where status!=1 and status!=6 and status!=7 and rental_end_date <now() | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </select> | |||
| <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set status=#{status} where status!=1 and status!=5 and status!=6 and status!=7 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||
| </update> | |||
| <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set status=#{status} where status!=1 and status!=5 and status!=6 and status!=7 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| and rental_start_date <= now() and rental_end_date >= now() | |||
| </update> | |||
| <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set status=#{status} where status!=1 and status!=5 and status!=6 and status!=7 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| and rental_end_date <now() | |||
| </update> | |||
| <update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set apply_status=#{applyStatus} | |||
| <if test=" null != businessType ">,business_type=#{businessType}</if> | |||
| <if test=" null != status ">,status=#{status}</if> | |||
| where id=#{id} | |||
| </update> | |||
| <update id="updateApplyStatusByRentContractId" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set apply_status=#{applyStatus} | |||
| <if test=" null != businessType ">,business_type=#{businessType}</if> | |||
| <if test=" null != status ">,status=#{status}</if> | |||
| where rent_contract_id=#{rentContractId} and id = #{id} | |||
| </update> | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set status=#{status} | |||
| <if test=" null != endContractTime "> | |||
| ,end_contract_time = #{endContractTime} | |||
| </if> | |||
| where id=#{id} | |||
| </update> | |||
| <update id="updateStatusByRentContractId" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set status=#{status} where rent_contract_id=#{rentContractId} | |||
| </update> | |||
| <select id="queryOweCount" parameterType="com.iformall.domain.po.WxPropertyContract" resultType="Long"> | |||
| select count(1) from wx_property_contract r,wx_bill_property b | |||
| where b.property_contract_id = r.id and b.status = 1 | |||
| <if test=" null != id ">and r.id = #{id}</if> | |||
| <if test=" null != rentContractId ">and r.rent_contract_id = #{rentContractId}</if> | |||
| </select> | |||
| <select id="findOneByRentId" parameterType="com.iformall.domain.po.WxRentContract" resultType="com.iformall.domain.po.WxPropertyContract"> | |||
| select * from wx_property_contract where rent_contract_id =#{id} order by createtime desc limit 1 | |||
| </select> | |||
| <select id="getByBill" parameterType="com.iformall.domain.po.WxAllBill" resultMap="BaseResultMap"> | |||
| select * from wx_property_contract where id in( | |||
| select property_contract_id from wx_all_bill id = #{id} | |||
| ) | |||
| </select> | |||
| <update id="endContract" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set status=#{status},updatetime = #{updatetime},update_by = #{updateBy} where rent_contract_id =#{rentContractId} | |||
| <if test=" null != statuss "> | |||
| and status in | |||
| <foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")"> | |||
| #{statusItem} | |||
| </foreach> | |||
| </if> | |||
| </update> | |||
| <update id = "setEndContractTime" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||
| update wx_property_contract set end_contract_time = #{endContractTime} where id = #{id} | |||
| </update> | |||
| <select id = "findToEndContractList" parameterType="com.iformall.domain.po.WxPropertyContract" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_property_contract | |||
| where `tenant_id` = #{tenantId} and status = 3 and end_contract_time <= now(); | |||
| </select> | |||
| </mapper> | |||
| @@ -5,10 +5,8 @@ | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="agile_type" jdbcType="INTEGER" property="agileType"/> | |||
| <result column="customers_id" jdbcType="BIGINT" property="customersId"/> | |||
| <result column="decimal_size" jdbcType="INTEGER" property="decimalSize"/> | |||
| <result column="price" jdbcType="VARCHAR" property="price"/> | |||
| <result column="rental_start_date" jdbcType="TIMESTAMP" property="rentalStartDate"/> | |||
| <result column="rental_end_date" jdbcType="TIMESTAMP" property="rentalEndDate"/> | |||
| <result column="sign_date" jdbcType="TIMESTAMP" property="signDate"/> | |||
| @@ -24,85 +22,46 @@ | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||
| <result column="update_by" jdbcType="BIGINT" property="updateBy"/> | |||
| <result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/> | |||
| <result column="deposit" jdbcType="VARCHAR" property="deposit"/> | |||
| <result column="cashtype_content_lsit" jdbcType="VARCHAR" property="cashtypeContentLsit"/> | |||
| <result column="cashtype_lsit" jdbcType="VARCHAR" property="cashtypeLsit"/> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | |||
| <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/> | |||
| <result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/> | |||
| <result column="pay_account" jdbcType="VARCHAR" property="payAccount"/> | |||
| <result column="link_address" jdbcType="VARCHAR" property="linkAddress"/> | |||
| <result column="filename" jdbcType="VARCHAR" property="filename"/> | |||
| <result column="lease" jdbcType="INTEGER" property="lease"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="revenue" jdbcType="VARCHAR" property="revenue"/> | |||
| <result column="limit_revenue" jdbcType="VARCHAR" property="limitRevenue"/> | |||
| <result column="revenue_ratio" jdbcType="INTEGER" property="revenueRatio"/> | |||
| <result column="revenue_ratio_way" jdbcType="INTEGER" property="revenueRatioWay"/> | |||
| <result column="revenue_ratio_set" jdbcType="VARCHAR" property="revenueRatioSet"/> | |||
| <result column="adjust_ratio" jdbcType="VARCHAR" property="adjustRatio"/> | |||
| <result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/> | |||
| <result column="pay_ratio" jdbcType="INTEGER" property="payRatio"/> | |||
| <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/> | |||
| <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/> | |||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | |||
| <result column="bank_name" jdbcType="VARCHAR" property="bankName"/> | |||
| <result column="fix_start_date" property="fixStartDate"/> | |||
| <result column="fix_end_date" property="fixEndDate"/> | |||
| <result column="business_type" property="businessType"/> | |||
| <result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/> | |||
| <result column="file_names" jdbcType="VARCHAR" property="fileNames"/> | |||
| <result column="price_unit" property="priceUnit"/> | |||
| <result column="rent_price" property="rentPrice"/> | |||
| <result column="other_rent_price_info" jdbcType="VARCHAR" property="otherRentPriceInfo"/> | |||
| <result column="subject_name" property="subjectName"/> | |||
| <result column="rent_start_type" property="rentStartType"/> | |||
| <result column="from_id" property="fromId"/> | |||
| <result column="rent_input_way" property="rentInputWay"/> | |||
| <result column="adjust_ratio_way" property="adjustRatioWay"/> | |||
| <result column="operation_type" property="operationType"/> | |||
| <result column="late_pay_ratio" property="latePayRatio"/> | |||
| <result column="late_pay_day" property="latePayDay"/> | |||
| <result column="end_contract_time" jdbcType="TIMESTAMP" property="endContractTime"/> | |||
| <result column="bussiness_management_fee" jdbcType="VARCHAR" property="bussinessManagementFee"/> | |||
| <result column="bussiness_management_fee_ratio_way" jdbcType="INTEGER" property="bussinessManagementFeeRatioWay"/> | |||
| <result column="bussiness_management_fee_ratio" jdbcType="VARCHAR" property="bussinessManagementFeeRatio"/> | |||
| <result column="operating_management_fee" jdbcType="VARCHAR" property="operatingManagementFee"/> | |||
| <result column="operating_management_fee_ratio_way" jdbcType="INTEGER" property="operatingManagementFeeRatioWay"/> | |||
| <result column="operating_management_fee_ratio" jdbcType="VARCHAR" property="operatingManagementFeeRatio"/> | |||
| <result column="out_date_notify_days" jdbcType="INTEGER" property="outDateNotifyDays"/> | |||
| <result column="out_date_notify_phone" jdbcType="VARCHAR" property="outDateNotifyPhone"/> | |||
| <result column="design_file" jdbcType="VARCHAR" property="designFile"/> | |||
| <result column="price_detail" jdbcType="VARCHAR" property="priceDetail"/> | |||
| <result column="day_price_calcute" jdbcType="INTEGER" property="dayPriceCalcute"/> | |||
| <result column="month_average_days" jdbcType="INTEGER" property="monthAverageDays"/> | |||
| <result column="revenue_fixed_rent_price" jdbcType="INTEGER" property="revenueFixedRentPrice"/> | |||
| <result column="revenue_rent_price" jdbcType="VARCHAR" property="revenueRentPrice"/> | |||
| <result column="revenue_jumps_remark" jdbcType="VARCHAR" property="revenueJumpsRemark"/> | |||
| <result column="free_period_remark" jdbcType="VARCHAR" property="freePeriodRemark"/> | |||
| <result column="first_bill_date_start" jdbcType="TIMESTAMP" property="firstBillDateStart"/> | |||
| <result column="first_bill_date_end" jdbcType="TIMESTAMP" property="firstBillDateEnd"/> | |||
| <result column="first_bill_receive_date" jdbcType="TIMESTAMP" property="firstBillReceiveDate"/> | |||
| <result column="shop_id_str" jdbcType="VARCHAR" property="shopIdStr"/> | |||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | |||
| <result column="revenue_minimum_method" jdbcType="INTEGER" property="revenueMinimumMethod"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`agile_type`,`customers_id`,`tenant_id`,`parent_tenant_id`, | |||
| `decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`receive_period_unit`, | |||
| `filepath`,`status`,`contract_number`,`price_detail`,`create_by`,`update_by`, | |||
| `day_price_calcute`,`first_bill_date_start`,`first_bill_date_end`,`month_average_days`,`free_period_remark`, | |||
| `deposit`,cashtype_content_lsit,cashtype_lsit,`is_del`,`revenue_jumps_remark`, | |||
| `id`,`customers_id`,`tenant_id`,`parent_tenant_id`, | |||
| `decimal_size`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`receive_period_unit`, | |||
| `filepath`,`status`,`contract_number`,`create_by`,`update_by`, | |||
| `day_price_calcute`,`month_average_days`,`free_period_remark`, | |||
| cashtype_content_lsit,`is_del`,`revenue_jumps_remark`, | |||
| `updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`, | |||
| `pay_account`,`filename`,`lease`,`type`,`revenue`,`limit_revenue`,`revenue_ratio`,`revenue_ratio_way`,`revenue_ratio_set`,`adjust_ratio`,`adjust_period`,`pay_ratio`, | |||
| `start_date`,`end_date`,`from_id`,`end_contract_time`,`revenue_fixed_rent_price`,`revenue_rent_price`, | |||
| `pay_account`,`lease`,`type`, | |||
| `start_date`,`end_date`,`from_id`,`end_contract_time`, | |||
| `apply_status`,`bank_name`,`fix_start_date`,`fix_end_date`,`pay_period_rate`,`create_by_name`,`update_by_name`, | |||
| `business_type`,`rent_info`, `file_names`,price_unit,rent_price,other_rent_price_info,`subject_name`,rent_start_type, | |||
| `rent_input_way`,`adjust_ratio_way`,`operation_type`,late_pay_ratio,late_pay_day,first_bill_receive_date, | |||
| bussiness_management_fee,bussiness_management_fee_ratio_way,bussiness_management_fee_ratio,shop_id_str, | |||
| operating_management_fee,operating_management_fee_ratio_way,operating_management_fee_ratio,out_date_notify_days, | |||
| out_date_notify_phone,design_file,remark,revenue_minimum_method | |||
| `rent_info`, `file_names`, | |||
| shop_id_str, | |||
| design_file,remark | |||
| </sql> | |||
| @@ -110,9 +69,7 @@ | |||
| where 1 = 1 | |||
| <if test=" null != id ">and `id` = #{id}</if> | |||
| <if test=" null != fromId ">and `from_id` = #{fromId}</if> | |||
| <if test=" null != agileType">and `agile_type` = #{agileType}</if> | |||
| <if test=" null != customersId ">and `customers_id` = #{customersId}</if> | |||
| <if test=" null != price and '' != price">and `price` = #{price}</if> | |||
| <if test=" null != rentalStartDate and '' != rentalStartDate">and `rental_start_date` = #{rentalStartDate}</if> | |||
| <if test=" null != rentalEndDate and '' != rentalEndDate">and `rental_end_date` = #{rentalEndDate}</if> | |||
| <if test=" null != useStartTime and null != useEndTime"> | |||
| @@ -122,7 +79,6 @@ | |||
| (`rental_start_date` >= #{useStartTime} and rental_start_date < #{useEndTime}) | |||
| ) | |||
| </if> | |||
| <if test=" null != outDateNofity ">and out_date_notify_phone is not null and out_date_notify_phone != '' and out_date_notify_days is not null and out_date_notify_days > 0 </if> | |||
| <if test=" null != signDate and '' != signDate">and `sign_date` = #{signDate}</if> | |||
| <if test=" null != receivePeriod and '' != receivePeriod">and `receive_period` = #{receivePeriod}</if> | |||
| <if test=" null != receivePeriodUnit and '' != receivePeriodUnit">and `receive_period_unit` = #{receivePeriodUnit}</if> | |||
| @@ -137,23 +93,19 @@ | |||
| <if test=" null != status and '' != status">and `status` = #{status}</if> | |||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | |||
| <if test=" null != contractNumber and '' != contractNumber">and `contract_number` = #{contractNumber}</if> | |||
| <if test=" null != deposit and '' != deposit">and `deposit` = #{deposit}</if> | |||
| <if test=" null != isDel and '' != isDel">and `is_del` = #{isDel}</if> | |||
| <if test=" null != updatetime and '' != updatetime">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != createtime and '' != createtime">and `createtime` = #{createtime}</if> | |||
| <if test=" null != linkPerson and '' != linkPerson">and `link_person` = #{linkPerson}</if> | |||
| <if test=" null != linkPhone and '' != linkPhone">and `link_phone` = #{linkPhone}</if> | |||
| <if test=" null != payAccount and '' != payAccount">and `pay_account` = #{payAccount}</if> | |||
| <if test=" null != filename and '' != filename">and `filename` = #{filename}</if> | |||
| <if test=" null != lease and '' != lease">and `lease` = #{lease}</if> | |||
| <if test=" null != type and '' != type">and `type` = #{type}</if> | |||
| <if test=" null != startDate and '' != startDate">and `start_date` = #{startDate}</if> | |||
| <if test=" null != endDate and '' != endDate">and `end_date` = #{endDate}</if> | |||
| <if test=" null != operationType and '' != operationType">and `operation_type` = #{operationType}</if> | |||
| <if test=" null != queryShopId and '' != queryShopId">and json_contains(json_extract(rent_info,'$[*].id'),concat('"',#{queryShopId},'"'))</if> | |||
| <if test=" null != dayPriceCalcute ">and `day_price_calcute` = #{dayPriceCalcute}</if> | |||
| <if test=" null != monthAverageDays ">and `month_average_days` = #{monthAverageDays}</if> | |||
| <if test=" null != revenueFixedRentPrice ">and `revenue_fixed_rent_price` = #{revenueFixedRentPrice}</if> | |||
| <if test=" null != queryShopId"> | |||
| and concat(',',shop_id_str,',') like concat('%,',#{queryShopId},',%') | |||
| </if> | |||
| @@ -214,7 +166,6 @@ | |||
| <update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| update wx_rent_contract | |||
| set apply_status=#{applyStatus} | |||
| <if test=" null != businessType ">,business_type=#{businessType}</if> | |||
| <if test=" null != status ">,status=#{status}</if> | |||
| where id=#{id} | |||
| </update> | |||
| @@ -270,90 +221,6 @@ | |||
| </where> | |||
| </select> | |||
| <resultMap id="contractMap" type="com.iformall.domain.vo.WxRentPropertyContractVo"> | |||
| <id column="id" property="id"/> | |||
| <result column="tenant_id" property="tenantId"/> | |||
| <result column="parent_tenant_id" property="parentTenantId"/> | |||
| <result column="customers_id" jdbcType="BIGINT" property="customersId"/> | |||
| <result column="rent_id" property="rentId"/> | |||
| <result column="property_id" property="propertyId"/> | |||
| <result column="rent_info" property="rentInfo"/> | |||
| <result column="rental_start_date" property="rentalStartDate"/> | |||
| <result column="rental_end_date" property="rentalEndDate"/> | |||
| <result column="rent_price" property="rentPrice"/> | |||
| <result column="price_detail" property="priceDetail"/> | |||
| <result column="property_price" property="propertyPrice"/> | |||
| <result column="type" property="type"/> | |||
| <result column="status" property="status"/> | |||
| <result column="apply_status" property="applyStatus"/> | |||
| <result column="operation_type" property="operationType"/> | |||
| <result column="property_status" property="propertyStatus"/> | |||
| <result column="rent_price_unit" property="rentPriceUnit"/> | |||
| <result column="property_price_unit" property="propertyPriceUnit"/> | |||
| <result column="day_price_calcute" property="dayPriceCalcute"/> | |||
| <result column="month_average_days" property="monthAverageDays"/> | |||
| <result column="revenue_fixed_rent_price" jdbcType="INTEGER" property="revenueFixedRentPrice"/> | |||
| <result column="revenue_rent_price" jdbcType="VARCHAR" property="revenueRentPrice"/> | |||
| <result column="revenue_jumps_remark" jdbcType="VARCHAR" property="revenueJumpsRemark"/> | |||
| <result column="free_period_remark" jdbcType="VARCHAR" property="freePeriodRemark"/> | |||
| <result column="first_bill_date_start" jdbcType="TIMESTAMP" property="firstBillDateStart"/> | |||
| <result column="first_bill_date_end" jdbcType="TIMESTAMP" property="firstBillDateEnd"/> | |||
| </resultMap> | |||
| <select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap"> | |||
| select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.customers_id,rc.id as rent_id, pc.id as property_id, rc.rental_start_date,rc.rental_end_date,rc.`status`, | |||
| rc.price as rent_price,rc.contract_number,rc.type,rc.apply_status,rc.price_detail,rc.revenue_fixed_rent_price,rc.revenue_rent_price, | |||
| rc.rent_info,pc.price as property_price,pc.`status` as property_status, | |||
| rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,rc.day_price_calcute,rc.free_period_remark, | |||
| rc.business_type businessType,rc.month_average_days,rc.revenue_jumps_remark,rc.first_bill_date_start,rc.first_bill_date_end | |||
| from wx_rent_contract rc left join wx_property_contract pc on rc.id=pc.rent_contract_id | |||
| <where> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and rc.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and rc.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != contractNumber and '' != contractNumber"> | |||
| and rc.`contract_number` = #{contractNumber} | |||
| </if> | |||
| <if test=" null != rentId and '' != rentId"> | |||
| and rc.`id` = #{rentId} | |||
| </if> | |||
| <if test=" null != propertyId and '' != propertyId"> | |||
| and pc.`id` = #{propertyId} | |||
| </if> | |||
| <if test=" null != customersIdList "> | |||
| and rc.customers_id in | |||
| <foreach collection="customersIdList" index="index" item="cusItem" open="(" separator="," close=")"> | |||
| #{cusItem} | |||
| </foreach> | |||
| </if> | |||
| <!-- <if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==1"> | |||
| and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%') | |||
| </if> | |||
| <if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==2"> | |||
| and s.`shop_number` like concat('%',#{shopNumber},'%') | |||
| </if> --> | |||
| <if test=" null != status ">and rc.`status` = #{status}</if> | |||
| <if test=" null != type ">and rc.`type` = #{type}</if> | |||
| <if test=" null != applyStatus ">and rc.`apply_status` = #{applyStatus}</if> | |||
| <if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if> | |||
| <if test=" null != dayPriceCalcute ">and rc.`day_price_calcute` = #{dayPriceCalcute}</if> | |||
| <if test=" null != monthAverageDays ">and rc.`month_average_days` = #{monthAverageDays}</if> | |||
| <if test=" null != ids "> | |||
| and rc.id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| </where> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| <if test=" null == sortColumns">order by rc.createtime desc,rc.id desc</if> | |||
| </select> | |||
| <select id="getByBill" parameterType="com.iformall.domain.po.WxAllBill" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns"/> from wx_rent_contract | |||
| where id in( | |||
| @@ -1,7 +1,6 @@ | |||
| package com.iformall.flowable; | |||
| import com.iformall.service.WxFlowService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import org.flowable.engine.delegate.TaskListener; | |||
| import org.flowable.task.service.delegate.DelegateTask; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -15,8 +14,6 @@ import org.springframework.stereotype.Component; | |||
| public class ContractTaskFinishHandler implements TaskListener { | |||
| @Autowired | |||
| private WxFlowService wxFlowService; | |||
| @Autowired | |||
| private WxPropertyContractService wxPropertyContractService; | |||
| @Override | |||
| public void notify(DelegateTask delegateTask) { | |||