yujian
2019-03-14 093140f0d3d2e1258ca109dc3657b2d5333c4332
Controller 代码删减
3个文件已修改
942 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java 589 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/JumpDetailAdminController.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemClientParamsAdminController.java 281 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
@@ -5,7 +5,6 @@
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,7 +12,6 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
@@ -24,24 +22,16 @@
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.entity.taobao.ScanHistory;
import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.UserInfoCountService;
import com.yeshi.fanli.service.inter.goods.ShareService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ExtractService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.ScanHistoryService;
import com.yeshi.fanli.service.inter.user.UserActiveLogService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
@@ -63,24 +53,8 @@
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private OrderService orderService;
    @Resource
    private ScanHistoryService scanHistoryService;
    @Resource
    private ConfigService configService;
    @Resource
    private ExtractService extractService;
    @Resource
    private ThreeSaleSerivce threeSaleService;
    @Resource
    private ShareService shareService;
    @Resource
    private BindingAccountService bindingAccountService;
@@ -88,8 +62,6 @@
    @Resource
    private UserInfoCountService userInfoCountService;
    @Resource
    private UserActiveLogService userActiveLogService;
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
@@ -105,158 +77,6 @@
    
    @Resource
    private UserMoneyDetailService userMoneyDetailService;
    @RequestMapping(value = "getUserList", method = RequestMethod.POST)
    public void getUserList(int pageIndex, String key, PrintWriter out) {
        List<UserInfo> userList = userInfoService.getUserList(pageIndex - 1, key);
        int count = userInfoService.getUserCount(key);
        int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
        PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
        Map<String, String> map = new HashMap<String, String>();
        map.put("key", key);
        pe.setParams(map);
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        data.put("userList", userList);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     *
     * 方法说明: 三级分销
     *
     * @author mawurui createTime 2018年5月21日 下午4:55:07
     * @param pageIndex
     * @param key
     * @param out
     */
    @RequestMapping(value = "getThreeSaleList", method = RequestMethod.POST)
    public void getThreeSaleList(int pageIndex, String key, PrintWriter out) {
        List<ThreeSale> list = threeSaleService.getLastestThreeSaleList(pageIndex, key);
        int count = threeSaleService.getLastestThreeSaleCount(key);
        int totalPage = (int) (count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE
                : count / Constant.PAGE_SIZE + 1);
        PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
        Map<String, String> map = new HashMap<String, String>();
        map.put("key", key);
        pe.setParams(map);
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        data.put("threeSaleList", list);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     *
     * @param pageIndex
     * @param type
     *            1- 1级分销 2-2级分销
     * @param uid
     * @param key
     * @param out
     */
    @RequestMapping(value = "getThreeSaleDetailList", method = RequestMethod.POST)
    public void getThreeSaleDetailList(int pageIndex, int type, long uid, String key, PrintWriter out) {
        List<UserInfo> userList = null;
        long count = 0;
        if (type == 1) {
            userList = threeSaleService.getFirstUsers(uid, pageIndex);
            count = threeSaleService.getFirstUsersCount(uid);
        } else if (type == 2) {
            userList = threeSaleService.getSecondUsers(uid, pageIndex);
            count = threeSaleService.getSecondUsersCount(uid);
        }
        int totalPage = (int) (count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE
                : count / Constant.PAGE_SIZE + 1);
        PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
        Map<String, String> map = new HashMap<String, String>();
        map.put("key", key);
        pe.setParams(map);
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        data.put("userList", userList);
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "getUserListByUid", method = RequestMethod.POST)
    public void getUserListByUid(long uid, PrintWriter out) {
        List<UserInfo> userList = userInfoService.getUserListByUid(uid);
        int count = userList.size();
        int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
        PageEntity pe = new PageEntity(1, Constant.PAGE_SIZE, count, totalPage);
        Map<String, String> map = new HashMap<String, String>();
        pe.setParams(map);
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        data.put("userList", userList);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     *
     * 方法说明: 查询用户订单状态
     *
     * @author mawurui createTime 2018年5月17日 上午10:55:41
     * @param pageIndex
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getUserOrderList", method = RequestMethod.POST)
    public void getUserOrderList(int pageIndex, long uid, PrintWriter out) {
        List<Order> orderList = orderService.getOrderByUid(pageIndex - 1, uid);
        int count = orderService.getCount(uid);
        int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
        PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        data.put("orderList", JsonUtil.getSimpleGsonWithDateAndSerialization().toJson(orderList));
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     *
     * 方法说明: 清除用户手势密码
     *
     * @author mawurui createTime 2018年5月4日 下午4:47:29
     * @param uid
     * @param out
     */
    @RequestMapping(value = "cleanPassword", method = RequestMethod.POST)
    public void cleanPassword(long id, PrintWriter out) {
        userInfoService.cleanPassword(id);
        out.print(JsonUtil.loadTrueResult("清除成功"));
    }
    @RequestMapping(value = "getScanHistoryList", method = RequestMethod.POST)
    public void getScanHistoryList(int pageIndex, long uid, PrintWriter out) {
        List<ScanHistory> scanHistoryList = scanHistoryService.getScanHistoryByUid(pageIndex - 1, uid);
        int count = scanHistoryService.getCountByUid(uid);
        int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
        PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        data.put("scanHistoryList", GsonUtil.toDFJson(scanHistoryList));
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "getAssets", method = RequestMethod.POST)
    public void getAssets(PrintWriter out) {
        String minMoney = configService.get(Constant.EXTRACT_MIN_MONEY);
        double min = Double.parseDouble(minMoney);
        double freeze = userInfoService.getFreezeAssets(min);
        double canAssets = userInfoService.getCanAssets(min);
        JSONObject data = new JSONObject();
        data.put("freeze", freeze);
        data.put("can", canAssets);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
@@ -528,6 +348,215 @@
        }
    }
    /**
     * 封禁用户ID
     * @param callback
     * @param uid
     * @param out
     */
    @RequestMapping(value = "forbiddenUser")
    public void forbiddenUser(String callback, Long uid, PrintWriter out) {
        try {
            if (uid == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
                return;
            }
            UserInfo currentInfo = userInfoService.selectByPKey(uid);
            if (currentInfo == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该用户已不存在"));
                return;
            }
            currentInfo.setState(UserInfo.STATE_FORBIDDEN);
            currentInfo.setStateDesc("管理员封禁");
            userInfoService.updateByPrimaryKeySelective(currentInfo);
            // 加入封禁的账号列表
            ForbiddenUserIdentifyCode forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
            forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId);
            forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getWxUnionId());
            forbiddenUserIdentifyCode.setBeiZhu(currentInfo.getWxName());
            try {
                forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
            } catch (ForbiddenUserIdentifyCodeException e) {
                e.printStackTrace();
            }
            // 电话号码
            forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
            forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.phone);
            forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getPhone());
            try {
                forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
            } catch (ForbiddenUserIdentifyCodeException e) {
                e.printStackTrace();
            }
            // 淘宝
            UserExtraTaoBaoInfo taoBao = userExtraTaoBaoInfoService.getByUid(uid);
            if (taoBao != null && !StringUtil.isNullOrEmpty(taoBao.getTaoBaoUid())) {
                forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
                forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid);
                forbiddenUserIdentifyCode.setIdentifyCode(taoBao.getTaoBaoUid());
                try {
                    forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
                } catch (ForbiddenUserIdentifyCodeException e) {
                    e.printStackTrace();
                }
            }
            // 查询支付宝绑定
            List<BindingAccount> list = bindingAccountService.getBindingAccountByUid(uid);
            if (list != null) {
                for (BindingAccount ba : list) {
                    forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
                    forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount);
                    forbiddenUserIdentifyCode.setIdentifyCode(ba.getAccount());
                    forbiddenUserIdentifyCode.setBeiZhu(ba.getName());
                    try {
                        forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
                    } catch (ForbiddenUserIdentifyCodeException e) {
                        e.printStackTrace();
                    }
                }
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("用户封禁成功"));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
        }
    }
    /**
     * 解除封禁用户ID
     * @param callback
     * @param uid
     * @param out
     */
    @RequestMapping(value = "relieveForbiddenUser")
    public void relieveForbiddenUser(String callback, Long uid, PrintWriter out) {
        try {
            if (uid == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
                return;
            }
            UserInfo currentInfo = userInfoService.selectByPKey(uid);
            if (currentInfo == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该用户已不存在"));
                return;
            }
            currentInfo.setState(UserInfo.STATE_NORMAL);
            currentInfo.setStateDesc("管理员已解封");
            userInfoService.updateByPrimaryKeySelective(currentInfo);
            // 解封微信
            ForbiddenUserIdentifyCode forbiddenUserIdentifyCode = forbiddenUserIdentifyCodeService
                    .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, currentInfo.getWxUnionId());
            if (forbiddenUserIdentifyCode != null)
                forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
            // 解封手机
            forbiddenUserIdentifyCode = forbiddenUserIdentifyCodeService
                    .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, currentInfo.getPhone());
            if (forbiddenUserIdentifyCode != null)
                forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
            // 解封淘宝
            UserExtraTaoBaoInfo taoBao = userExtraTaoBaoInfoService.getByUid(uid);
            if (taoBao != null && !StringUtil.isNullOrEmpty(taoBao.getTaoBaoUid())) {
                forbiddenUserIdentifyCode = forbiddenUserIdentifyCodeService
                        .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBao.getTaoBaoUid());
                if (forbiddenUserIdentifyCode != null)
                    forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
            }
            // 解封支付宝
            List<BindingAccount> list = bindingAccountService.getBindingAccountByUid(uid);
            if (list != null) {
                for (BindingAccount ba : list) {
                    forbiddenUserIdentifyCode = forbiddenUserIdentifyCodeService.listByTypeAndIdentifyCode(
                            ForbiddenUserIdentifyCodeTypeEnum.alipayAccount, ba.getAccount());
                    if (forbiddenUserIdentifyCode != null)
                        forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
                }
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("用户解封成功"));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
        }
    }
    /**
     * 用户账号- 封禁/解封
     * @param callback
     * @param code
     * @param type 1("微信unionId"), 2("淘宝ID"), 3("手机号"), 4("支付宝账号");
     * @param out
     */
    @RequestMapping(value = "saveForbiddenInfo")
    public void saveForbiddenInfo(String callback, String code, Integer type, PrintWriter out) {
        try {
            if (code == null || code.trim().length() == 0 || type == null ||"NULL".equalsIgnoreCase(code)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
                return;
            }
            forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (ForbiddenUserIdentifyCodeException e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     *  删除队员关系
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "deleteThreeSale")
    public void deleteThreeSale(String callback, Long id, PrintWriter out) {
        try {
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
                return;
            }
            int count = threeSaleService.deleteByPrimaryKey(id);
            if (count > 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
            } else {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            }
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    @RequestMapping(value = "queryMyFirstTeams")
    public void queryMyFirstTeams(String callback, Integer pageIndex, Integer pageSize, String key, Long bossId,
            PrintWriter out) {
@@ -650,28 +679,6 @@
        }
    }
    @RequestMapping(value = "deleteThreeSale")
    public void deleteThreeSale(String callback, Long id, PrintWriter out) {
        try {
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
                return;
            }
            int count = threeSaleService.deleteByPrimaryKey(id);
            if (count > 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
            } else {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            }
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     * 队员关系
@@ -1127,183 +1134,5 @@
    
    /**
     * 封禁用户ID
     * @param callback
     * @param uid
     * @param out
     */
    @RequestMapping(value = "forbiddenUser")
    public void forbiddenUser(String callback, Long uid, PrintWriter out) {
        try {
            if (uid == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
                return;
            }
            UserInfo currentInfo = userInfoService.selectByPKey(uid);
            if (currentInfo == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该用户已不存在"));
                return;
            }
            currentInfo.setState(UserInfo.STATE_FORBIDDEN);
            currentInfo.setStateDesc("管理员封禁");
            userInfoService.updateByPrimaryKeySelective(currentInfo);
            // 加入封禁的账号列表
            ForbiddenUserIdentifyCode forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
            forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId);
            forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getWxUnionId());
            forbiddenUserIdentifyCode.setBeiZhu(currentInfo.getWxName());
            try {
                forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
            } catch (ForbiddenUserIdentifyCodeException e) {
                e.printStackTrace();
            }
            // 电话号码
            forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
            forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.phone);
            forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getPhone());
            try {
                forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
            } catch (ForbiddenUserIdentifyCodeException e) {
                e.printStackTrace();
            }
            // 淘宝
            UserExtraTaoBaoInfo taoBao = userExtraTaoBaoInfoService.getByUid(uid);
            if (taoBao != null && !StringUtil.isNullOrEmpty(taoBao.getTaoBaoUid())) {
                forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
                forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid);
                forbiddenUserIdentifyCode.setIdentifyCode(taoBao.getTaoBaoUid());
                try {
                    forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
                } catch (ForbiddenUserIdentifyCodeException e) {
                    e.printStackTrace();
                }
            }
            // 查询支付宝绑定
            List<BindingAccount> list = bindingAccountService.getBindingAccountByUid(uid);
            if (list != null) {
                for (BindingAccount ba : list) {
                    forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
                    forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount);
                    forbiddenUserIdentifyCode.setIdentifyCode(ba.getAccount());
                    forbiddenUserIdentifyCode.setBeiZhu(ba.getName());
                    try {
                        forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
                    } catch (ForbiddenUserIdentifyCodeException e) {
                        e.printStackTrace();
                    }
                }
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("用户封禁成功"));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
        }
    }
    /**
     * 解除封禁用户ID
     * @param callback
     * @param uid
     * @param out
     */
    @RequestMapping(value = "relieveForbiddenUser")
    public void relieveForbiddenUser(String callback, Long uid, PrintWriter out) {
        try {
            if (uid == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
                return;
            }
            UserInfo currentInfo = userInfoService.selectByPKey(uid);
            if (currentInfo == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该用户已不存在"));
                return;
            }
            currentInfo.setState(UserInfo.STATE_NORMAL);
            currentInfo.setStateDesc("管理员已解封");
            userInfoService.updateByPrimaryKeySelective(currentInfo);
            // 解封微信
            ForbiddenUserIdentifyCode forbiddenUserIdentifyCode = forbiddenUserIdentifyCodeService
                    .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, currentInfo.getWxUnionId());
            if (forbiddenUserIdentifyCode != null)
                forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
            // 解封手机
            forbiddenUserIdentifyCode = forbiddenUserIdentifyCodeService
                    .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, currentInfo.getPhone());
            if (forbiddenUserIdentifyCode != null)
                forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
            // 解封淘宝
            UserExtraTaoBaoInfo taoBao = userExtraTaoBaoInfoService.getByUid(uid);
            if (taoBao != null && !StringUtil.isNullOrEmpty(taoBao.getTaoBaoUid())) {
                forbiddenUserIdentifyCode = forbiddenUserIdentifyCodeService
                        .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBao.getTaoBaoUid());
                if (forbiddenUserIdentifyCode != null)
                    forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
            }
            // 解封支付宝
            List<BindingAccount> list = bindingAccountService.getBindingAccountByUid(uid);
            if (list != null) {
                for (BindingAccount ba : list) {
                    forbiddenUserIdentifyCode = forbiddenUserIdentifyCodeService.listByTypeAndIdentifyCode(
                            ForbiddenUserIdentifyCodeTypeEnum.alipayAccount, ba.getAccount());
                    if (forbiddenUserIdentifyCode != null)
                        forbiddenUserIdentifyCodeService.delete(forbiddenUserIdentifyCode);
                }
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("用户解封成功"));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
        }
    }
    /**
     * 用户账号- 封禁/解封
     * @param callback
     * @param code
     * @param type 1("微信unionId"), 2("淘宝ID"), 3("手机号"), 4("支付宝账号");
     * @param out
     */
    @RequestMapping(value = "saveForbiddenInfo")
    public void saveForbiddenInfo(String callback, String code, Integer type, PrintWriter out) {
        try {
            if (code == null || code.trim().length() == 0 || type == null ||"NULL".equalsIgnoreCase(code)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
                return;
            }
            forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (ForbiddenUserIdentifyCodeException e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/JumpDetailAdminController.java
@@ -2,101 +2,33 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.common.JumpDetail;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.exception.NotExistObjectException;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.JumpDetailService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/jumpDetail")
public class JumpDetailAdminController {
    @Resource
    private JumpDetailService jumpDetailService;
    @Resource
    private JumpDetailV2Service JumpDetailV2Service;
    
    @RequestMapping(value="getJumpDetailList",method=RequestMethod.POST)
    public void getJumpDetailList(int pageIndex,String key,PrintWriter out){
        List<JumpDetail> jumpDetailList = jumpDetailService.getJumpDetailList(pageIndex-1,key);
        int count = jumpDetailService.getCount(key);
         int totalPage = count % Constant.PAGE_SIZE == 0 ? count
                 / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
         PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count,
                 totalPage);
         Map<String, String> map = new HashMap<String, String>();
         map.put("key", key);
         pe.setParams(map);
         JSONObject data = new JSONObject();
         data.put("pe", pe);
         data.put("jumpDetailList", jumpDetailList);
         out.print(JsonUtil.loadTrueResult(data));
         return;
    }
    @RequestMapping(value="getJumpDetailAllList",method=RequestMethod.POST)
    public void getJumpDetailAllList(PrintWriter out){
        List<JumpDetail> jumpDetailList = jumpDetailService.getJumpDetailAllList();
         JSONObject data = new JSONObject();
         data.put("jumpDetailList", jumpDetailList);
         out.print(JsonUtil.loadTrueResult(data));
         return;
    }
    @RequestMapping(value="addJumpDetail",method=RequestMethod.POST)
    public void addJumpDetail(JumpDetail jd,PrintWriter out){
        jumpDetailService.addJumpDetail(jd);
        out.print(JsonUtil.loadTrueResult("添加成功"));
    }
    @RequestMapping(value="updateJumpDetail",method=RequestMethod.POST)
    public void updateJumpDetail(JumpDetail jd,PrintWriter out){
        try {
            jumpDetailService.updateJumpDetail(jd);
            out.print(JsonUtil.loadTrueResult("修改成功"));
        } catch (NotExistObjectException e) {
            out.append(JsonUtil.loadFalseResult(e.getMessage()));
        }
    }
    @RequestMapping(value="getJumpDetail",method=RequestMethod.POST)
    public void getJumpDetail(long id,PrintWriter out){
        JumpDetail jumpDetail =jumpDetailService.getJumpDetail(id);
        if(jumpDetail ==null){
            out.append(JsonUtil.loadFalseResult("不存在该对象"));
            return;
        }
        out.print(JsonUtil.loadTrueResult(jumpDetail));
    }
    @RequestMapping(value="deleteJumpDetail",method=RequestMethod.POST)
    public void deleteJumpDetail(long[] ids,PrintWriter out){
        for (long id : ids) {
            jumpDetailService.deleteJumpDetail(id);
        }
        out.print(JsonUtil.loadTrueResult("删除成功"));
    }
    @RequestMapping({ "getJumpOption" })
    public void getJumpOption(String callback, PrintWriter out) {
        try {
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemClientParamsAdminController.java
@@ -2,34 +2,23 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.admin.SystemClientParamsAdmin;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.entity.system.CustomerName;
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.GsonUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.Utils;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/clientParams")
@@ -38,272 +27,6 @@
    
    @Resource
    private SystemClientParamsService systemClientParamsService;
    @Resource
    private SystemService systemService;
//    @InitBinder("oscp")
//    public void initBinder1(WebDataBinder binder) {
//            binder.setFieldDefaultPrefix("oscp.");
//    }
//   @InitBinder("nscp")
//    public void initBinder2(WebDataBinder binder) {
//            binder.setFieldDefaultPrefix("nscp.");
//   }
    @RequestMapping(value="getSystemClientParamsList",method=RequestMethod.POST)
    public void getSystemClientParamsList(int pageIndex,String platform,String packages,String key,PrintWriter out){
        platform=Utils.getMap().get(platform);
        System system = systemService.getSystem(platform, packages);
        List<SystemClientParamsAdmin> clientParamsList = systemClientParamsService.getAdminList(system,key);
        int count =clientParamsList.size();
         int totalPage = count % Constant.PAGE_SIZE == 0 ? count
                 / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
         PageEntity pe = new PageEntity(pageIndex,count, count,
                 totalPage);
         Map<String, String> map = new HashMap<String, String>();
         map.put("platform", platform);
         map.put("packages", packages);
         map.put("key", key);
         pe.setParams(map);
         JSONObject data = new JSONObject();
         data.put("pe", pe);
         List<System> systemList = systemService.getSystems();
         data.put("systemList", systemList);
         data.put("clientParamsList", clientParamsList);
         out.print(JsonUtil.loadTrueResult(data));
         return;
    }
    @RequestMapping(value="getSystemClientParams",method=RequestMethod.POST)
    public void getSystemClientParams(SystemClientParams scp,PrintWriter out){
        SystemClientParamsAdmin scpa = systemClientParamsService.getSystemClientParamsAdmin(scp);
        out.append(JsonUtil.loadTrueResult(scpa));
    }
    @RequestMapping(value="addSystemClientParamsList",method=RequestMethod.POST)
    public void addSystemClientParamsList(@RequestBody List<SystemClientParams> scps,PrintWriter out){
        List<System> list = new ArrayList<System>();
        for (SystemClientParams scp : scps) {
            System system = scp.getSystem();
            int platformInt = system.getPlatform();
            String packages = system.getPackageName();
            String platform = Utils.getMap().get(String.valueOf(platformInt));
            System find = systemService.getSystem(platform, packages);
            if(find != null){
                list.add(find);
            }
        }
        try {
            systemClientParamsService.addSystemClientParamsList(scps.get(0),list);
            out.print(JsonUtil.loadTrueResult("添加成功"));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(e.getMessage()));
        }
    }
    @RequestMapping(value="setSystemClientParamsSystem",method=RequestMethod.POST)
    public void setSystemClientParamsSystem(SystemClientParams scp,String type,String platform,String packages,PrintWriter out){
        platform = Utils.getMap().get(platform);
        System system = systemService.getSystem(platform, packages);
        if(system==null){
            out.append(JsonUtil.loadFalseResult("系统不能为空"));
            return;
        }
        if(Constant.DEL.equals(type)){
            systemClientParamsService.deleteSystemClientParams(scp,system);
        }else{
            systemClientParamsService.addSystemClientParams(scp,system);
        }
            out.print(JsonUtil.loadTrueResult("操作成功"));
    }
    @RequestMapping(value="deleteSystemClientParams",method=RequestMethod.POST)
    public void deleteSystemClientParams(@RequestBody List<SystemClientParams> scps,PrintWriter out){
        for (SystemClientParams scp : scps) {
            systemClientParamsService.deleteSystemClientParams(scp);
        }
        out.append(JsonUtil.loadTrueResult("删除成功"));
    }
    @RequestMapping(value="updateSystemClientParams",method=RequestMethod.POST)
    public void updateSystemClientParams(@RequestBody List<SystemClientParams> scps,PrintWriter out){
        SystemClientParams oscp = scps.get(0);
        SystemClientParams nscp = scps.get(1);
        systemClientParamsService.update(oscp,nscp);
        out.print(JsonUtil.loadTrueResult("修改成功"));
    }
    /**
     *
     * 方法说明: 获取帮助中心列表等其他列表
     * @author mawurui
     * createTime 2018年4月8日 下午3:30:33
     * @param pageIndex
     * @param key
     * @param out
     */
    @RequestMapping(value="getHelpList",method=RequestMethod.POST)
    public void getHelpList(int pageIndex, String key, PrintWriter out, int type) {
        //查询列表总数
        Integer totalCount = systemClientParamsService.getCount(type);
        int totalPage = totalCount % Constant.PAGE_SIZE == 0 ? totalCount
                 / Constant.PAGE_SIZE : totalCount / Constant.PAGE_SIZE + 1;
         PageEntity pageEntity = new PageEntity(pageIndex, Constant.PAGE_SIZE, totalCount,
                 totalPage);
         Map<String, String> map = new HashMap<String, String>();
         map.put("key", key);
         pageEntity.setParams(map);
         //分页查询所有问题
         List<CustomerName> customerNameList = systemClientParamsService.customerNameList(pageIndex-1, key, type);
        JSONObject data=new JSONObject();
        data.put("pageEntity", JsonUtil.getSimpleGsonWithDate().toJson(pageEntity));
        data.put("customerNameList", JsonUtil.getSimpleGsonWithDate().toJson(customerNameList));
        out.print(JsonUtil.loadTrue(0, JsonUtil.getSimpleGson().toJson(data), "成功"));
    }
    /**
     *
     * 方法说明: 删除帮助中心等其他列表(真删除)
     * @author mawurui
     * createTime 2018年3月29日 下午6:22:21
     * @param ids
     * @param out
     */
    @RequestMapping(value="deleteHelp",method=RequestMethod.POST)
    public void deleteHelp(long[] ids, PrintWriter out){
        for (long id : ids) {
            systemClientParamsService.deleteHelp(id);
        }
        out.print(JsonUtil.loadTrueResult("删除成功"));
    }
    /**
     *
     * 方法说明: 查询帮助中心等其他列表详情(页面反显)
     * @author mawurui
     * createTime 2018年4月8日 下午5:26:36
     * @param id
     * @param out
     */
    @RequestMapping(value="getHelpCenter",method=RequestMethod.POST)
    public void getHelpCenter(int type, PrintWriter out) {
        CustomerName customerName = systemClientParamsService.getHelpCenter(type);
        JSONObject data = new JSONObject();
        data.put("customerName", GsonUtil.toDFJson(customerName));
        out.print(JsonUtil.loadTrueResult(0, data));
    }
    /**
     *
     * 方法说明: 根据一级问题名称查询二级问题列表
     * @author mawurui
     * createTime 2018年4月9日 上午9:05:28
     * @param pageIndex
     * @param key
     * @param out
     * @param type
     */
    @RequestMapping(value="getSecondProblemList",method=RequestMethod.POST)
    public void getSecondProblemList(int pageIndex, String key, PrintWriter out, long id) {
        //查询列表总数
        Integer totalCount = systemClientParamsService.getProblemCount(id);
        int totalPage = totalCount % Constant.PAGE_SIZE == 0 ? totalCount
                 / Constant.PAGE_SIZE : totalCount / Constant.PAGE_SIZE + 1;
         PageEntity pageEntity = new PageEntity(pageIndex, Constant.PAGE_SIZE, totalCount,
                 totalPage);
         Map<String, String> map = new HashMap<String, String>();
         map.put("key", key);
         pageEntity.setParams(map);
         //分页查询所有问题
         List<CustomerContent> getSecondProblemList = systemClientParamsService.getSecondProblemList(pageIndex-1, key, id);
        JSONObject data=new JSONObject();
        data.put("pageEntity", JsonUtil.getSimpleGsonWithDate().toJson(pageEntity));
        data.put("getSecondProblemList", JsonUtil.getSimpleGsonWithDate().toJson(getSecondProblemList));
        out.print(JsonUtil.loadTrue(0, JsonUtil.getSimpleGson().toJson(data), "成功"));
    }
    /**
     *
     * 方法说明: 删除二级问题列表(真删除)
     * @author mawurui
     * createTime 2018年4月9日 上午9:47:12
     * @param ids
     * @param out
     */
    @RequestMapping(value="deleteSecondProblem",method=RequestMethod.POST)
    public void deleteSecondProblem(long[] ids, PrintWriter out){
        for (long id : ids) {
            systemClientParamsService.deleteSecondProblem(id);
        }
        out.print(JsonUtil.loadTrueResult("删除成功"));
    }
    /**
     *
     * 方法说明: 查看回答详情(页面反显)
     * @author mawurui
     * createTime 2018年4月9日 上午11:05:04
     * @param id
     * @param out
     */
    @RequestMapping(value="answerDetail",method=RequestMethod.POST)
    public void getCustomerContent(long id, PrintWriter out) {
        CustomerContent customerContent = systemClientParamsService.getCustomerContent(id);
        JSONObject data = new JSONObject();
        data.put("customerContent", GsonUtil.toDFJson(customerContent));
        out.print(JsonUtil.loadTrueResult(0, data));
    }
    /**
     *
     * 方法说明: 修改回答内容
     * @author mawurui
     * createTime 2018年4月9日 上午11:25:19
     * @param InviteGetMoney
     * @param out
     */
    @RequestMapping(value="/updateAnswerDetail", method=RequestMethod.POST)
    public void updateAnswerDetail(CustomerContent customerContent , PrintWriter out) {
        systemClientParamsService.updateAnswerDetail(customerContent);
        out.print(JsonUtil.loadTrueResult("修改成功"));
    }
    /**
     *
     * 方法说明: 添加一级问题菜单
     * @author mawurui
     * createTime 2018年4月9日 下午12:11:08
     * @param CustomerName
     */
    @RequestMapping(value="/addFirstMenu", method=RequestMethod.POST)
    public void addFirstMenu(CustomerName CustomerName, PrintWriter out, int type) {
        systemClientParamsService.addFirstMenu(CustomerName, type);
        out.print(JsonUtil.loadTrueResult("添加成功"));
    }
    /**
     *
     * 方法说明: 添加二级菜单
     * @author mawurui
     * createTime 2018年4月9日 下午12:17:51
     * @param CustomerName
     * @param out
     * @param type
     */
    @RequestMapping(value="/addSecondMenu", method=RequestMethod.POST)
    public void addSecondMenu(CustomerContent customerContent, PrintWriter out, long cnId) {
        systemClientParamsService.addSecondMenu(customerContent, cnId);
        out.print(JsonUtil.loadTrueResult("添加成功"));
    }
    
    /**