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