| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.asyncmessage.AsyncMessageManager; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.MoneyCardUseFlowDao; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.pojo.CzXkVo; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | | |
| | | @Autowired |
| | | private RabiitMqTemplate rabiitMqTemplate; |
| | | |
| | | |
| | | private AsyncMessageManager asyncMessageManager; |
| | | /** |
| | | * 跳转 充值页面 |
| | | * |
| | |
| | | //发送微信公众号提醒 |
| | | UniformMsgParam uniformMsgParam=new UniformMsgParam(order.getCompanyId(),UniformMsgParam.GZH_CZCG); |
| | | uniformMsgParam.put("orderId",order.getId()); |
| | | rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG+evn,uniformMsgParam.toJSONString()); |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); |
| | | |
| | | result.putInMap("orderId",order.getId()); |
| | | return result; |
| | |
| | | @RequestMapping(value = "/showCardFlowList") |
| | | public @ResponseBody |
| | | AjaxResult showCardFlowList(MoneyCardUseFlow moneyCardUseFlow, PaginationVO pageVo) { |
| | | MoneyCardUse vipCard = cardUseService.findByVipId(moneyCardUseFlow.getVipId()); |
| | | if (vipCard != null) { |
| | | moneyCardUseFlowDao.updateVipCardId(moneyCardUseFlow.getVipId(), vipCard.getId()); |
| | | } |
| | | List<MoneyCardUseFlow> dataList = moneyCardUseFlowDao.selectInPage(moneyCardUseFlow, pageVo); |
| | | return AjaxResult.buildSuccessInstance(dataList, moneyCardUseFlowDao.selectTotalRecord(moneyCardUseFlow)); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 补交 |
| | | * |
| | | * @throws GlobleException |
| | | * @author jyy |
| | | */ |
| | | @RequestMapping(value = "/bj") |
| | | public @ResponseBody |
| | | AjaxResult bj(@RequestBody SysOrder order) throws GlobleException { |
| | | AjaxResult bj(@RequestBody SysOrder order){ |
| | | |
| | | orderService.updateAfterMoney(order); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "补交成功"); |
| | |
| | | @RequestMapping(value = "/active") |
| | | public @ResponseBody |
| | | AjaxResult active(MoneyCardUse moneyCardUse) { |
| | | MoneyCardUse proj = moneyCardUseDao.selectById(moneyCardUse.getId()); |
| | | String status = proj.getStatus(); |
| | | Date failTime = proj.getFailTime(); |
| | | MoneyCardUse cardUse = moneyCardUseDao.selectById(moneyCardUse.getId()); |
| | | String status = cardUse.getStatus(); |
| | | Date failTime = cardUse.getFailTime(); |
| | | Date today = new Date(); |
| | | Date newDate = null; |
| | | newDate = moneyCardUse.getFailTime(); |
| | |
| | | break; |
| | | //如果是冻结状态则要算出冻结的天数,延长有效期 |
| | | case Dictionary.TAOCAN_STATUS_DJ: |
| | | MoneyCardUseFreeze freeze = new MoneyCardUseFreeze(); |
| | | freeze = moneyCardUseFreezeService.findByMoneyCardUseId(proj.getId()); |
| | | proj.setFailTime(DateUtil.nextNDate(failTime, freeze.getGapDays())); |
| | | |
| | | break; |
| | | default: |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择无效或者冻结的充值卡"); |
| | | } |
| | | proj.setFailTime(moneyCardUse.getFailTime()); |
| | | cardUseService.active(proj); |
| | | cardUse.setFailTime(moneyCardUse.getFailTime()); |
| | | cardUseService.active(cardUse); |
| | | |
| | | |
| | | MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | moneyCardUseFlow.setCarUseId(cardUse.getId()); |
| | | moneyCardUseFlow.setVipId(cardUse.getVipId()); |
| | | moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY); |
| | | moneyCardUseFlow.setCreateTime(new Date()); |
| | | moneyCardUseFlow.setOperationId(user.getSuId()); |
| | | moneyCardUseFlow.setContent("设置为有效"); |
| | | moneyCardUseFlowDao.insert(moneyCardUseFlow); |
| | | |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已设置为有效"); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/invalid") |
| | | public @ResponseBody |
| | | AjaxResult invalidTc(MoneyCardUse moneyCardUse) { |
| | | MoneyCardUse proj = cardUseService.findById(moneyCardUse.getId()); |
| | | MoneyCardUse cardUse = cardUseService.findById(moneyCardUse.getId()); |
| | | //以及转让或者退款的不能在设置为无效 |
| | | String status = proj.getStatus(); |
| | | String status = cardUse.getStatus(); |
| | | switch (status) { |
| | | case Dictionary.TAOCAN_STATUS_TK: |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "充值卡已退款"); |
| | |
| | | case Dictionary.TAOCAN_STATUS_DJ: |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "充值卡已冻结"); |
| | | } |
| | | cardUseService.invalid(proj); |
| | | cardUseService.invalid(cardUse); |
| | | MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | moneyCardUseFlow.setCarUseId(cardUse.getId()); |
| | | moneyCardUseFlow.setVipId(cardUse.getVipId()); |
| | | moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY); |
| | | moneyCardUseFlow.setCreateTime(new Date()); |
| | | moneyCardUseFlow.setOperationId(user.getSuId()); |
| | | moneyCardUseFlow.setContent("设置为无效"); |
| | | moneyCardUseFlowDao.insert(moneyCardUseFlow); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已设置为无效"); |
| | | } |
| | | |
| | |
| | | public @ResponseBody |
| | | AjaxResult freeze(MoneyCardUse moneyCardUse) { |
| | | int i = cardUseService.freeze(moneyCardUse); |
| | | cardUseService.invalid(moneyCardUse); |
| | | |
| | | MoneyCardUse cardUse = cardUseService.findById(moneyCardUse.getId()); |
| | | MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | moneyCardUseFlow.setCarUseId(cardUse.getId()); |
| | | moneyCardUseFlow.setVipId(cardUse.getVipId()); |
| | | moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY); |
| | | moneyCardUseFlow.setCreateTime(new Date()); |
| | | moneyCardUseFlow.setOperationId(user.getSuId()); |
| | | moneyCardUseFlow.setContent("冻结会员卡"); |
| | | moneyCardUseFlowDao.insert(moneyCardUseFlow); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "冻结成功"); |
| | | } |