| @@ -307,9 +307,6 @@ public class WxFinanceController extends BaseController { | |||
| @PostMapping("createReceive") | |||
| public ResultData createReceive(@RequestBody WxFinanceReceive record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| if (null == record.getMerchantId()) { | |||
| return new ResultData(Result.ERROR,"请选择商户"); | |||
| } | |||
| if (null == record.getBills() || null == record.getPayWays()) { | |||
| return new ResultData(Result.ERROR,"请选择账单和支付方式"); | |||
| } | |||
| @@ -356,9 +353,6 @@ public class WxFinanceController extends BaseController { | |||
| @PostMapping("createCut") | |||
| public ResultData createCut(@RequestBody WxFinanceReceive record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| if (null == record.getMerchantId()) { | |||
| return new ResultData(Result.ERROR,"请选择商户"); | |||
| } | |||
| if (null == record.getBills()) { | |||
| return new ResultData(Result.ERROR,"请选择账单"); | |||
| } | |||
| @@ -370,9 +364,6 @@ public class WxFinanceController extends BaseController { | |||
| @PostMapping("createPay") | |||
| public ResultData createPay(@RequestBody WxFinanceReceive record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| if (null == record.getMerchantId()) { | |||
| return new ResultData(Result.ERROR,"请选择商户"); | |||
| } | |||
| if (null == record.getBills() || null == record.getPayWays()) { | |||
| return new ResultData(Result.ERROR,"请选择账单和支付方式"); | |||
| } | |||
| @@ -393,9 +384,6 @@ public class WxFinanceController extends BaseController { | |||
| if (null == record.getEnergyFeesId()) { | |||
| return new ResultData(Result.ERROR,"请选择科目"); | |||
| } | |||
| if (null == record.getMerchantId()) { | |||
| return new ResultData(Result.ERROR,"请选择商户"); | |||
| } | |||
| // if (!this.isValidPayTime(record.getReceiveDate())) { | |||
| // return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | |||
| // } | |||
| @@ -481,8 +469,8 @@ public class WxFinanceController extends BaseController { | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData receiveList(@ModelAttribute WxFinanceReceive record, Integer pageNum, Integer pageSize) { | |||
| if (StringUtils.isNotBlank(record.getMerchantName())) { | |||
| record.setMerchantName(StringContentUtils.unescapeHtml(record.getMerchantName())); | |||
| if (StringUtils.isNotBlank(record.getBillCusName())) { | |||
| record.setBillCusName(StringContentUtils.unescapeHtml(record.getBillCusName())); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| @@ -55,6 +55,9 @@ alter table wx_rent_contract_revenue_sales drop column bill_id; | |||
| alter table wx_rent_contract_revenue_sales drop column bill_money; | |||
| 去掉唯一索引,增加 contract_id, starttime,endtime 联合唯一索引 | |||
| alter table wx_rent_contract_agile_un_deposit_item drop column merchant_id; | |||
| alter table wx_rent_contract_agile_un_deposit_item drop column shop_number; | |||
| alter table wx_shop_users change shop_id create_shop_id bigint(20) not null; | |||
| alter table wx_shop_users drop column status; | |||
| alter table wx_shop_users drop column begin_date; | |||
| @@ -33,15 +33,9 @@ public class WxRentContractAgileUnDepositItem extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="费用编号",name="unDepositId") | |||
| private Long unDepositId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户编号",name="merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="铺位编号",name="shopId") | |||
| private Long shopId; | |||
| @io.swagger.annotations.ApiModelProperty(value="铺位号",name="shopNumber") | |||
| private String shopNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="科目编号",name="feesId") | |||
| private Long feesId; | |||
| @@ -230,6 +230,4 @@ public interface WxMerchantService { | |||
| Map<Long,WxMerchant> getShopMerchantMap(WxShop wxShop); | |||
| List<Long> getShopMerchantIds(WxShop wxShop); | |||
| String getPrivateMerchantUser(Long merchantId); | |||
| } | |||
| @@ -53,6 +53,7 @@ import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxFlowRecordService; | |||
| import com.iformall.service.WxMallService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxShopService; | |||
| import com.iformall.service.helper.WxRentContractAgileHelper; | |||
| import com.iformall.service.helper.WxRentContractHelper; | |||
| import com.iformall.utils.DateUtils; | |||
| @@ -110,7 +111,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| @Lazy | |||
| @Autowired | |||
| WxMerchantService wxMerchantService; | |||
| WxShopService wxShopService; | |||
| @Lazy | |||
| @Autowired | |||
| @@ -467,15 +468,13 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| EnumRentDayPriceCalcute dayPriceCalcute = EnumRentDayPriceCalcute.getEnum(contract.getDayPriceCalcute()); | |||
| List<Date> yearsBeginList = WxRentContractAgileHelper.getYearsBeginList(contract.getRentalStartDate(), contract.getRentalEndDate()); | |||
| List | |||
| List<WxAllBill> insertList = new ArrayList<WxAllBill>(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| for (int i = 0 ; i < unDeposit.getItems().size(); i++) { | |||
| WxRentContractAgileUnDepositItem item = unDeposit.getItems().get(i); | |||
| if (item.getIsFree() == EnumYesOrNo.NO.getCode()) { | |||
| String shopNumber = item.getShopNumber(); | |||
| if (StringUtils.isBlank(shopNumber)) { | |||
| shopNumber = contract.getShopName(); | |||
| } | |||
| EnumRentContractAgilPriceUnit itemPriceUnit = EnumRentContractAgilPriceUnit.getEnum(item.getPriceUnit()); | |||
| //如果是租赁期,则不按周期生成费用。 | |||
| if (timeUnit == EnumRentContractAgilTimeUnit.RENT_PERIOD) { | |||
| @@ -510,7 +509,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| } | |||
| private WxAllBill generateUnDepositBill(final IdWorker idWorker,WxRentContractAgileUnDeposit unDeposit,WxEnergyFees fees, | |||
| Date start,Date end,Date receiveDate,String needpay,WxRentContractAgileUnDepositItem item,String shopNumber,MallUserInfo user) { | |||
| Date start,Date end,Date receiveDate,String needpay,WxRentContractAgileUnDepositItem item,MallUserInfo user) { | |||
| WxAllBill wxBillRent = new WxAllBill(); | |||
| wxBillRent.setIsPreview(EnumYesOrNo.YES.getCode()); | |||
| wxBillRent.setId(idWorker.nextId()); | |||
| @@ -529,12 +528,8 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| //截止收租日在当前时间之前 | |||
| Date date = new Date(); | |||
| wxBillRent.updateTenantInfo(unDeposit); | |||
| //wxBillRent.setMerchantId(unDeposit.getMerchantId()); | |||
| wxBillRent.setShopId(item.getShopId()); | |||
| wxBillRent.setShopNumber(shopNumber); | |||
| wxBillRent.setCusName(shopNumber); | |||
| wxBillRent.setRentArea(item.getRentArea()); | |||
| wxBillRent.setCreatetime(date); | |||
| wxBillRent.setCreateBy(user.getId()); | |||
| @@ -130,17 +130,17 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| } | |||
| } | |||
| //List<Long> _sids = (List<Long>) CollectionUtils.intersection(shopIds, wxBillRent.getShopIdList()); | |||
| if (StringUtils.isNotBlank(wxBillRent.getCusName())) { | |||
| WxShopUsersInfo suq = new WxShopUsersInfo(); | |||
| suq.updateTenantInfo(wxBillRent); | |||
| suq.setName(wxBillRent.getCusName()); | |||
| List<Long> shopIds = wxShopService.getUserShopIds(suq); | |||
| if (null != shopIds && shopIds.size() > 0 ) { | |||
| wxBillRent.setCusNameShopIdList(shopIds);; | |||
| }else { | |||
| wxBillRent.setId(-1L); | |||
| } | |||
| } | |||
| // if (StringUtils.isNotBlank(wxBillRent.getCusName())) { | |||
| // WxShopUsers suq = new WxShopUsers(); | |||
| // suq.updateTenantInfo(wxBillRent); | |||
| // suq.setName(wxBillRent.getCusName()); | |||
| // List<Long> shopIds = wxShopService.getUserShopIds(suq); | |||
| // if (null != shopIds && shopIds.size() > 0 ) { | |||
| // wxBillRent.setCusNameShopIdList(shopIds);; | |||
| // }else { | |||
| // wxBillRent.setId(-1L); | |||
| // } | |||
| // } | |||
| } | |||
| @Override | |||
| @@ -239,11 +239,11 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| WxAllBill bill = wxAllBillMapper.selectById(id, tenantEntity.getTenantId()); | |||
| if (null != bill && null != bill.getShopId()) { | |||
| WxShop shop = wxShopService.getById(bill.getShopId()); | |||
| WxShopUsersInfo suq = new WxShopUsersInfo(); | |||
| WxShopUsers suq = new WxShopUsers(); | |||
| suq.updateTenantInfo(tenantEntity); | |||
| suq.setShopId(bill.getShopId()); | |||
| suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); | |||
| WxShopUsersInfo su = wxShopService.getOneShopUsers(suq); | |||
| WxShopUsers su = wxShopService.getOneShopUsers(suq); | |||
| if (null != shop) { | |||
| bill.setShopNumber(shop.getShopNumber()); | |||
| } | |||
| @@ -2338,30 +2338,4 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| return wxMerchantShopMapper.findMerchantIdList(merchantShopQ); | |||
| } | |||
| @Override | |||
| public String getPrivateMerchantUser(Long merchantId) { | |||
| WxMerchant m = this.selectById(merchantId); | |||
| if (null == m || m.getIsPrivate() != EnumYesOrNo.YES.getCode()){ | |||
| return null; | |||
| } | |||
| WxMerchantShop merchantShopQ = new WxMerchantShop(); | |||
| merchantShopQ.updateTenantInfo(m); | |||
| merchantShopQ.setMerchantId(merchantId); | |||
| merchantShopQ.setIsDel(0); | |||
| List<WxMerchantShop> merchantShopList = wxMerchantShopMapper.findList(merchantShopQ); | |||
| if (null == merchantShopList || merchantShopList.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| WxMerchantShop ms = merchantShopList.get(0); | |||
| WxShopUsersInfo suq = new WxShopUsersInfo(); | |||
| suq.updateTenantInfo(m); | |||
| suq.setShopId(ms.getShopId()); | |||
| suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); | |||
| suq.setSortColumn(" type desc"); | |||
| List<WxShopUsersInfo> userList = wxShopUsersMapper.findList(suq); | |||
| if (null == userList || userList.size() <= 0 ){ | |||
| return null; | |||
| } | |||
| return userList.get(0).getName(); | |||
| } | |||
| } | |||
| @@ -14,11 +14,14 @@ import com.iformall.enums.EnumContractType; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| 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.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -54,15 +57,19 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||
| @Lazy | |||
| @Autowired | |||
| WxMerchantService wxMerchantService; | |||
| WxShopService wxShopService; | |||
| @Lazy | |||
| @Autowired | |||
| WxAgileContractService wxAgileContractService; | |||
| @Override | |||
| public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | |||
| List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(record, record.getFloorForRule() , null, null,record.getShopTypeForRule(), 0, 0,null); | |||
| if (null == mids || mids.size() <= 0 ) { | |||
| List<Long> ids = wxAgileContractService.findBuildingFloorContractIds(record, record.getFloorForRule(), null, null, null, 0); | |||
| if (null == ids || ids.size() <= 0 ) { | |||
| record.setId(-1L); | |||
| } else { | |||
| record.setMerchantIds(mids); | |||
| }else { | |||
| record.setIds(ids); | |||
| } | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); | |||
| } | |||
| @@ -8,7 +8,6 @@ | |||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | |||
| <result column="un_deposit_id" jdbcType="BIGINT" property="unDepositId"/> | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId"/> | |||
| <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/> | |||
| <result column="fees_id" jdbcType="BIGINT" property="feesId"/> | |||
| <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime"/> | |||
| <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/> | |||
| @@ -22,7 +21,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`un_deposit_id`,`shop_id`,`shop_number`, | |||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`un_deposit_id`,`shop_id`, | |||
| `fees_id`,`begin_time`,`end_time`,`price`,`price_unit`,`createtime`,`updatetime`,`is_free`,`rent_area`,`is_father` | |||
| </sql> | |||
| @@ -37,6 +36,7 @@ | |||
| </if> | |||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | |||
| <if test=" null != shopId ">and `shop_id` = #{shopId}</if> | |||
| <if test=" null != unDepositId ">and `un_deposit_id` = #{unDepositId}</if> | |||
| <if test=" null != isFather ">and `is_father` = #{isFather}</if> | |||
| <if test=" null != ids "> | |||
| @@ -314,9 +314,12 @@ | |||
| <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 != businessForRule and '' != businessForRule "> | |||
| and rc.business_id in (${businessForRule}) | |||
| </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> | |||