admin
2020-07-04 f862a844ea7e212f8cc0622b858308e2b91dca2e
fanli/src/main/java/com/yeshi/fanli/controller/admin/redpack/RedPackAdminController.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.yeshi.fanli.entity.accept.AdminAcceptData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
@@ -54,7 +55,7 @@
    * @param out
    */
   @RequestMapping(value = "query")
   public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
   public void query(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
      if (pageIndex == null || pageIndex < 1) {
         pageIndex = 1;
      }
@@ -111,7 +112,7 @@
    * @param out
    */
   @RequestMapping(value = "getApplyInfo")
   public void getAuditInfo(String callback, Long id, PrintWriter out) {
   public void getAuditInfo(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
      RedPackExchange exchange = redPackExchangeService.selectByPrimaryKey(id);
      if (exchange == null) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("申请记录不存在"));
@@ -147,7 +148,7 @@
    * @param request
    */
   @RequestMapping(value = "passExchange")
   public void passExchange(String callback, Long id, String code, PrintWriter out, HttpServletRequest request) {
   public void passExchange(AdminAcceptData acceptData,String callback, Long id, String code, PrintWriter out, HttpServletRequest request) {
      try {
         /* 检验是否登陆 */
         AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
@@ -186,7 +187,7 @@
    * @param request
    */
   @RequestMapping(value = "rejectExchange")
   public void rejectExchange(String callback, Long id, String code, String reason, PrintWriter out,
   public void rejectExchange(AdminAcceptData acceptData,String callback, Long id, String code, String reason, PrintWriter out,
         HttpServletRequest request) {
      try {
         /* 检验是否登陆 */
@@ -216,5 +217,25 @@
      }
   }
   /**
    * 红包统计
    * @param callback
    * @param uid
    * @param out
    */
   @RequestMapping(value = "statisticsRedPack")
   public void statisticsRedPack(AdminAcceptData acceptData,String callback, Long uid, PrintWriter out) {
      try {
         JSONObject data = new JSONObject();
         data.put("balance", redPackBalanceService.getBalance(uid));
         data.put("exchanging", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_INIT));
         data.put("exchangeSucceed", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_SUCCESS));
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
      } catch (Exception e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
         e.printStackTrace();
      }
   }
}