# Conflicts: # mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.javarelease_toaliyun_real
| @@ -176,20 +176,25 @@ public class WxCouponController extends BaseController { | |||
| WxCoupon coupon = wxCouponService.findById(wxCoupon); | |||
| if(coupon!=null){ | |||
| if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ | |||
| return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); | |||
| } | |||
| if(wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getValidDays().intValue() <= coupon.getValidDays().intValue()){ | |||
| return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); | |||
| } | |||
| if((wxCoupon.getValidEndDate()!=null&&coupon.getValidEndDate()!=null && DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) | |||
| && wxCoupon.getInventory().equals(coupon.getInventory())) | |||
| || | |||
| (wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getInventory().equals(coupon.getInventory()) && | |||
| wxCoupon.getValidDays().equals(coupon.getValidDays())) | |||
| wxCoupon.getValidDays().equals(coupon.getValidDays())) | |||
| ){ | |||
| return new ResultData(ErrorCode.COUPON_STOCK_VALID_DATE_SETTING_ERR); | |||
| } | |||
| if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ | |||
| return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); | |||
| } | |||
| if(wxCoupon.getInventory()!=null && wxCoupon.getInventory().intValue() <= coupon.getInventory().intValue() ){ | |||
| return new ResultData(ErrorCode.COUPON_STOCK_INV_ERR); | |||
| } | |||
| if(wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getValidDays().intValue() < coupon.getValidDays().intValue()){ | |||
| return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); | |||
| } | |||
| } | |||
| //启动审批流 | |||
| @@ -0,0 +1 @@ | |||
| alter table wx_activity modify column is_expired smallint(2) default 0 comment '是否过期1是0否'; | |||
| @@ -6,6 +6,7 @@ import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.enums.EnumCouponChannelActivityStatus; | |||
| import com.iformall.enums.EnumCouponChannelStatus; | |||
| import com.iformall.enums.EnumCouponChannelType; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| import com.iformall.service.WxMerchantService; | |||
| import io.swagger.annotations.Api; | |||
| import org.apache.commons.collections.map.HashedMap; | |||
| @@ -47,6 +48,8 @@ public class WxCouponChannelController extends BaseController { | |||
| wxCouponChannel.setTenantId(getTenantId()); | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC, WxCouponChannel.Field.Id_DESC); | |||
| //过滤已作废 | |||
| wxCouponChannel.setStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()); | |||
| PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); | |||
| filterTimed(wxCouponChannel, page); | |||
| @@ -114,6 +114,7 @@ public enum ErrorCode{ | |||
| COUPON_SCORE_NOT_IN_RANGE(2038, "您的成长值/等级与要求不符"), | |||
| COUPON_STOCK_NO_EQUAL_ERR(2039, "券库存设置要保证同增同减"), | |||
| COUPON_STOCK_ENDTIME_ERR(2043, "抱歉,有效期截止时间只能增加不能减少!"), | |||
| COUPON_STOCK_INV_ERR(20144, "抱歉,库存只能增加不能减少!"), | |||
| PUSH_LIMIT_UP_TO_1DAYLIMIT(2040, "此用户一天内发券到达疲劳度限制"), | |||
| PUSH_LIMIT_UP_TO_COUPONLIMIT(2041, "此用户发此券到达疲劳度限制"), | |||
| @@ -36,7 +36,7 @@ public interface WxCreditHistoryService { | |||
| */ | |||
| WxCreditHistory getById(Long id); | |||
| /** | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| @@ -180,58 +180,58 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| @Override | |||
| public void updateBill(Map<String, Object> bill) { | |||
| int billTypeValue = ((Long) bill.get("billTypeValue")).intValue(); | |||
| logger.info(">>>>>>>>>>>>>>>>>>>>账单回调修改数据:" + JSONObject.toJSONString(bill)); | |||
| if (billTypeValue==EnumBillTypeParam.RENT.getCode().intValue()) { | |||
| //更新租金账单 | |||
| logger.info("更新租金账单"); | |||
| WxBillRent billRent = wxBillRentMapper.selectByPrimaryKey(bill.get("id")); | |||
| if(billRent!=null && !billRent.getStatus().equals(EnumBillRentStatus.PAID.getCode())){ | |||
| updateBillRent(bill); | |||
| } | |||
| } else if (billTypeValue==EnumBillTypeParam.RENT_DEPOSIT.getCode().intValue()) { | |||
| //更新租金押金账单 | |||
| logger.info("更新租金押金账单"); | |||
| WxBillDeposit billDeposit = wxBillDepositMapper.selectByPrimaryKey(bill.get("id")); | |||
| if(billDeposit!=null && !billDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())){ | |||
| updateBillRentDeposit(bill); | |||
| } | |||
| } else if (billTypeValue==EnumBillTypeParam.PROPERTY.getCode().intValue()) { | |||
| //更新物业账单 | |||
| logger.info("更新物业账单"); | |||
| WxBillProperty property = wxBillPropertyMapper.selectByPrimaryKey(bill.get("id")); | |||
| if(property!=null && !property.getStatus().equals(EnumBillRentStatus.PAID.getCode())){ | |||
| updateBillProperty(bill); | |||
| } | |||
| } else if (billTypeValue==EnumBillTypeParam.PROPERTY_DEPOSIT.getCode().intValue()) { | |||
| //更新物业押金账单 | |||
| logger.info("更新物业押金账单"); | |||
| WxBillPropertyDeposit wxBillPropertyDeposit = wxBillPropertyDepositMapper.selectByPrimaryKey(bill.get("id")); | |||
| if(wxBillPropertyDeposit!=null && !wxBillPropertyDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())){ | |||
| updateBillPropertyDeposit(bill); | |||
| } | |||
| } else if (billTypeValue==EnumBillTypeParam.WATER.getCode().intValue()) { | |||
| //更新水费账单 | |||
| logger.info("更新水费账单"); | |||
| WxBillDaily wxBillDaily = wxBillDailyMapper.selectByPrimaryKey(bill.get("id")); | |||
| if(wxBillDaily!=null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())){ | |||
| updateBillDaily(bill); | |||
| } | |||
| } else if (billTypeValue==EnumBillTypeParam.POWER.getCode().intValue()) { | |||
| //更新电费账单 | |||
| logger.info("更新电费账单"); | |||
| WxBillDaily wxBillDaily = wxBillDailyMapper.selectByPrimaryKey(bill.get("id")); | |||
| if(wxBillDaily!=null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())){ | |||
| updateBillDaily(bill); | |||
| } | |||
| } else if (billTypeValue == EnumBillTypeParam.AIR_CONDITIONING.getCode().intValue()) { | |||
| //更新空调费账单 | |||
| logger.info("更新空调费账单"); | |||
| WxBillDaily wxBillDaily = wxBillDailyMapper.selectByPrimaryKey(bill.get("id")); | |||
| if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||
| updateBillDaily(bill); | |||
| } | |||
| } else if (billTypeValue==EnumBillTypeParam.ROUTINE.getCode().intValue()) { | |||
| //更新其他账单 | |||
| logger.info("更新其他账单"); | |||
| WxBillOther wxBillOther = wxBillOtherMapper.selectByPrimaryKey(bill.get("id")); | |||
| if(wxBillOther!=null && !wxBillOther.getStatus().equals(EnumBillRentStatus.PAID.getCode())){ | |||
| updateBillOther(bill); | |||
| } | |||
| } else if (billTypeValue == EnumBillTypeParam.ATHER_DEPOSIT.getCode().intValue()) { | |||
| //更新其他押金账单 | |||
| logger.info("更新其他押金账单"); | |||
| WxBillOtherDeposit wxBillOtherDeposit = wxBillOtherDepositMapper.selectByPrimaryKey(bill.get("id")); | |||
| if (wxBillOtherDeposit != null && !wxBillOtherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||
| updateBillOtherDeposit(bill); | |||
| @@ -302,6 +302,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| wxBillAction.setUserName(wxMerchantBUser.getName()); | |||
| wxBillAction.setPhone(wxMerchantBUser.getPhone()); | |||
| wxBillAction.setTenantId(wxMerchantBUser.getTenantId()); | |||
| wxBillAction.setPayDate(date); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -345,6 +346,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| wxBillAction.setUserName(wxMerchantBUser.getName()); | |||
| wxBillAction.setPhone(wxMerchantBUser.getPhone()); | |||
| wxBillAction.setTenantId(wxMerchantBUser.getTenantId()); | |||
| wxBillAction.setPayDate(date); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -389,6 +391,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| wxBillAction.setUserName(wxMerchantBUser.getName()); | |||
| wxBillAction.setPhone(wxMerchantBUser.getPhone()); | |||
| wxBillAction.setTenantId(wxMerchantBUser.getTenantId()); | |||
| wxBillAction.setPayDate(date); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -433,6 +436,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| wxBillAction.setUserName(wxMerchantBUser.getName()); | |||
| wxBillAction.setPhone(wxMerchantBUser.getPhone()); | |||
| wxBillAction.setTenantId(wxMerchantBUser.getTenantId()); | |||
| wxBillAction.setPayDate(date); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -477,6 +481,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| wxBillAction.setUserName(wxMerchantBUser.getName()); | |||
| wxBillAction.setPhone(wxMerchantBUser.getPhone()); | |||
| wxBillAction.setTenantId(wxMerchantBUser.getTenantId()); | |||
| wxBillAction.setPayDate(date); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -521,6 +526,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| wxBillAction.setUserName(wxMerchantBUser.getName()); | |||
| wxBillAction.setPhone(wxMerchantBUser.getPhone()); | |||
| wxBillAction.setTenantId(wxMerchantBUser.getTenantId()); | |||
| wxBillAction.setPayDate(date); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -565,6 +571,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| wxBillAction.setUserName(wxMerchantBUser.getName()); | |||
| wxBillAction.setPhone(wxMerchantBUser.getPhone()); | |||
| wxBillAction.setTenantId(wxMerchantBUser.getTenantId()); | |||
| wxBillAction.setPayDate(date); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| @@ -345,6 +345,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| Map<String,Object> query = new HashedMap(); | |||
| query.put("tenantId",tenantId); | |||
| query.put("id",paramsMap.get("id")); | |||
| query.put("buildingId",paramsMap.get("buildingId")); | |||
| List<Map<String,Object>> mapList = wxMerchantMapper.findBusByFloorId(query); | |||
| for (Map<String,Object> map:mapList) { | |||
| resultMap.put((String)map.get("btitle"),(Long)map.get("count")); | |||
| @@ -208,7 +208,6 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| } | |||
| } | |||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | |||
| wxCouponChannel.setEndTime(endTime); | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| @@ -207,11 +207,11 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| //减库存 | |||
| if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { | |||
| Integer inventory = (Integer) getVariableByKey(variables, "inventory"); | |||
| Integer remainInventory = (Integer) getVariableByKey(variables, "remainInventory"); | |||
| Integer type = (Integer) getVariableByKey(variables, "type"); | |||
| Integer validDays = (Integer) getVariableByKey(variables, "validDays"); | |||
| Integer validType = (Integer) getVariableByKey(variables, "validType"); | |||
| Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); | |||
| Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); | |||
| Integer type = getIngeter(getVariableByKey(variables, "type")); | |||
| Integer validDays = getIngeter(getVariableByKey(variables, "validDays")); | |||
| Integer validType = getIngeter(getVariableByKey(variables, "validType")); | |||
| wxCoupon.setInventory(inventory); | |||
| wxCoupon.setRemainInventory(remainInventory); | |||
| @@ -220,11 +220,11 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxCoupon.setValidType(validType); | |||
| wxCouponService.updateCouponStockAndEndTime(wxCoupon); | |||
| }else if(EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType)){ | |||
| Integer remainInventory = (Integer) getVariableByKey(variables, "remainInventory"); | |||
| Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); | |||
| wxCoupon.setRemainInventory(remainInventory); | |||
| wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); | |||
| }else if(EnumFlowKey.NEW_PRESS_UPLINE.getCode().equals(flowType)){ | |||
| Integer inventory = (Integer) getVariableByKey(variables, "inventory"); | |||
| Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); | |||
| wxCoupon.setInventory(inventory); | |||
| wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); | |||
| } | |||
| @@ -275,12 +275,12 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| } | |||
| public Integer getBusinessType(Object businessType){ | |||
| if(businessType == null) return null; | |||
| if(businessType instanceof String){ | |||
| return Integer.parseInt((String)businessType); | |||
| }else if(businessType instanceof Integer){ | |||
| return (Integer)businessType; | |||
| public Integer getIngeter(Object obj){ | |||
| if(obj == null) return null; | |||
| if(obj instanceof String){ | |||
| return Integer.parseInt((String)obj); | |||
| }else if(obj instanceof Integer){ | |||
| return (Integer)obj; | |||
| } | |||
| return null; | |||
| } | |||
| @@ -290,7 +290,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| public ResultData start(Map<String, Object> params,Long userId,String userName,String tenantId) { | |||
| String remark = (String)params.get("remark"); | |||
| Long businessId = Long.parseLong(params.get("businessId").toString()); | |||
| Integer flowType = getBusinessType(params.get("businessType")); | |||
| Integer flowType = getIngeter(params.get("businessType")); | |||
| List<Map<String,Object>> variables = (List)params.get("variables"); | |||
| Boolean supplement = (Boolean)params.get("supplement"); | |||
| @@ -359,7 +359,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| dynamicContentMap.put("bustype","账单"); | |||
| dynamicContentMap.put("contract", businessId.toString()); | |||
| }else if(isCoupon(flowType)){ | |||
| dynamicContentMap.put("bustype","有价卷"); | |||
| dynamicContentMap.put("bustype","有价券"); | |||
| dynamicContentMap.put("contract",businessId.toString()); | |||
| } | |||
| wxMsgRecord.setDynamicContentMap(dynamicContentMap); | |||
| @@ -438,7 +438,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| msgReplaceMap.put("bustype","账单"); | |||
| msgReplaceMap.put("contract", businessId.toString()); | |||
| }else if(isCoupon(flowType)){ | |||
| msgReplaceMap.put("bustype","有价卷"); | |||
| msgReplaceMap.put("bustype","有价券"); | |||
| msgReplaceMap.put("contract",businessId.toString()); | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| @@ -863,7 +863,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| msgReplaceMap.put("bustype","账单"); | |||
| msgReplaceMap.put("contract", businessId.toString()); | |||
| }else if(isCoupon(flowType)){ | |||
| msgReplaceMap.put("bustype","有价卷"); | |||
| msgReplaceMap.put("bustype","有价券"); | |||
| msgReplaceMap.put("contract",businessId.toString()); | |||
| } | |||
| wxMsgRecord.setDynamicContentMap(msgReplaceMap); | |||
| @@ -885,7 +885,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| msgReplaceMap.put("bustype","账单"); | |||
| msgReplaceMap.put("contract", businessId.toString()); | |||
| }else if(isCoupon(flowType)){ | |||
| msgReplaceMap.put("bustype","有价卷"); | |||
| msgReplaceMap.put("bustype","有价券"); | |||
| msgReplaceMap.put("contract",businessId.toString()); | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| @@ -917,7 +917,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| msgReplaceMap.put("bustype","账单"); | |||
| msgReplaceMap.put("contract", businessId.toString()); | |||
| }else if(isCoupon(flowType)){ | |||
| msgReplaceMap.put("bustype","有价卷"); | |||
| msgReplaceMap.put("bustype","有价券"); | |||
| msgReplaceMap.put("contract",businessId.toString()); | |||
| } | |||
| wxMsgRecord.setDynamicContentMap(msgReplaceMap); | |||
| @@ -939,7 +939,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| msgReplaceMap.put("bustype","账单"); | |||
| msgReplaceMap.put("contract", businessId.toString()); | |||
| }else if(isCoupon(flowType)){ | |||
| msgReplaceMap.put("bustype","有价卷"); | |||
| msgReplaceMap.put("bustype","有价券"); | |||
| msgReplaceMap.put("contract",businessId.toString()); | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| @@ -1087,7 +1087,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| msgReplaceMap.put("bustype","账单"); | |||
| msgReplaceMap.put("contract", businessId.toString()); | |||
| }else if(isCoupon(flowType)){ | |||
| msgReplaceMap.put("bustype","有价卷"); | |||
| msgReplaceMap.put("bustype","有价券"); | |||
| msgReplaceMap.put("contract",businessId.toString()); | |||
| } | |||
| mailMsg.setDynamicContentMap(msgReplaceMap); | |||
| @@ -253,7 +253,11 @@ public class WxGameServiceImpl implements WxGameService { | |||
| JSONObject obj = (JSONObject)couponIds.get(i); | |||
| Long couponId = obj.getLong("couponId"); | |||
| int weight = obj.getIntValue("weight"); | |||
| saveOrUpdateCouponChannel(couponId, wxCouponChannelsMap, record); | |||
| try { | |||
| saveOrUpdateCouponChannel(couponId, wxCouponChannelsMap, record); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| // 下架更新 | |||
| @@ -313,7 +313,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| long time = System.currentTimeMillis() + RedisLock.TIMEOUT; | |||
| String timeStr = String.valueOf(time); | |||
| // 库存加锁 | |||
| if (!redisLock.lock(couponIdStr, timeStr)) { | |||
| if (!redisLock.lock(couponIdStr, timeStr)) { | |||
| logger.error("此券被锁定, couponId: " + couponIdStr); | |||
| throw new MallinkException(ErrorCode.TOO_MANY_REQUEST); | |||
| } | |||
| @@ -680,6 +680,7 @@ public class WxPayBillServiceImpl implements WxPayBillService { | |||
| } | |||
| WxBillAll wxBillAll = new WxBillAll(); | |||
| wxBillAll.setId(record.getBillId()); | |||
| wxBillAll.setTenantId(record.getTenantId()); | |||
| List<Map<String, Object>> bills = wxBillAllMapper.listData(wxBillAll); | |||
| if (bills.size()==0) { | |||
| logger.error("pay success handle, bill " + record.getBillId() + " not found , payBillNo : " + record.getPayBillNo()); | |||
| @@ -229,7 +229,7 @@ | |||
| rentShopType from ( | |||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type | |||
| from wx_bill_rent where is_preview = 0 and tenant_id=#{tenantId}and rent_contract_id in (select id from | |||
| from wx_bill_rent where is_preview = 0 and tenant_id=#{tenantId} and rent_contract_id in (select id from | |||
| wx_rent_contract where status in | |||
| (2,3,4)) | |||
| union all | |||
| @@ -568,37 +568,37 @@ | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent where is_preview = 0 and tenant_id = #{tenantId} | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property where is_preview = 0 and tenant_id = #{tenantId} | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| union | |||
| union all | |||
| select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, | |||
| res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from( | |||
| select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent_deposit where tenant_id = #{tenantId} | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property_deposit where tenant_id = #{tenantId} | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other_deposit where tenant_id = #{tenantId} | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| ) res | |||
| union | |||
| union all | |||
| select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, | |||
| res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from( | |||
| select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type in(1,2,3) and tenant_id = #{tenantId} | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other where tenant_id = #{tenantId} | |||
| @@ -135,7 +135,7 @@ | |||
| LEFT JOIN wx_merchant merchant ON credit.merchant_id = merchant.id | |||
| <include refid="customWhereConditions"/> | |||
| ORDER BY | |||
| credit.id DESC | |||
| credit.create_date desc,credit.id DESC | |||
| </select> | |||
| <select id="loginCount" parameterType="com.iformall.domain.po.WxCreditHistory" resultType="java.lang.Integer"> | |||
| @@ -241,8 +241,15 @@ | |||
| left join wx_merchant_shop ms on(m.id = ms.merchant_id) | |||
| left join wx_shop s on(ms.shop_id = s.id) | |||
| left join wx_mall_floor f on(s.floor = f.id) | |||
| left join wx_mall_building mb on(f.building_id = mb.id) | |||
| left join wx_business b on(m.business_id = b.id) | |||
| where f.id = #{id} | |||
| where 1=1 | |||
| <if test=" null != id"> | |||
| and f.id = #{id} | |||
| </if> | |||
| <if test=" null != buildingId"> | |||
| and mb.id = #{buildingId} | |||
| </if> | |||
| and m.tenant_id = #{tenantId} | |||
| and s.is_del = 0 | |||
| and ms.is_del = 0 | |||