diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index 1bd3537e4..a6065f9ee 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -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); + } } //启动审批流 diff --git a/mallinkAdmin/src/main/resources/db/migration/V201907081500__G_ALTER_ACTIVITY.sql b/mallinkAdmin/src/main/resources/db/migration/V201907081500__G_ALTER_ACTIVITY.sql new file mode 100644 index 000000000..299111ec5 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201907081500__G_ALTER_ACTIVITY.sql @@ -0,0 +1 @@ +alter table wx_activity modify column is_expired smallint(2) default 0 comment '是否过期1是0否'; \ No newline at end of file diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 4bbaac6e4..85f43d823 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -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 page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); filterTimed(wxCouponChannel, page); diff --git a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java index de8d35768..fbd871021 100644 --- a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java +++ b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java @@ -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, "此用户发此券到达疲劳度限制"), diff --git a/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java b/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java index a1bec2513..1716adfe8 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java @@ -36,7 +36,7 @@ public interface WxCreditHistoryService { */ WxCreditHistory getById(Long id); - /** + /** * 保存或更新实体 * * @param record diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index c2168ccb0..b567bd70b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -180,58 +180,58 @@ public class WxBillAllServiceImpl implements WxBillAllService { @Override public void updateBill(Map 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) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java index 58684f185..92b6c7b4c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java @@ -345,6 +345,7 @@ public class WxChartServiceImpl implements WxChartDataService { Map query = new HashedMap(); query.put("tenantId",tenantId); query.put("id",paramsMap.get("id")); + query.put("buildingId",paramsMap.get("buildingId")); List> mapList = wxMerchantMapper.findBusByFloorId(query); for (Map map:mapList) { resultMap.put((String)map.get("btitle"),(Long)map.get("count")); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index c55231e77..111e98205 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -208,7 +208,6 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { } } - WxCouponChannel wxCouponChannel = new WxCouponChannel(); wxCouponChannel.setEndTime(endTime); wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index fae2b2921..9c6c18c05 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -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 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> 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); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java index d21c7111b..be7e1426c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java @@ -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()); + } } // 下架更新 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index 0c763ad50..5dcb28107 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -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); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java index 6ee9def84..8ef5aec62 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java @@ -680,6 +680,7 @@ public class WxPayBillServiceImpl implements WxPayBillService { } WxBillAll wxBillAll = new WxBillAll(); wxBillAll.setId(record.getBillId()); + wxBillAll.setTenantId(record.getTenantId()); List> bills = wxBillAllMapper.listData(wxBillAll); if (bills.size()==0) { logger.error("pay success handle, bill " + record.getBillId() + " not found , payBillNo : " + record.getPayBillNo()); diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index f85307324..7ecc9dd79 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -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} - 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} - 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} - 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} - 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} ) 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} - 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} diff --git a/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml b/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml index 5680934bf..0468a353e 100644 --- a/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml @@ -135,7 +135,7 @@ LEFT JOIN wx_merchant merchant ON credit.merchant_id = merchant.id ORDER BY - credit.id DESC + credit.create_date desc,credit.id DESC