| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AdminAcceptData;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | |
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | 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.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRankings;
|
| | | import com.yeshi.fanli.exception.UserRankingsException;
|
| | | import com.yeshi.fanli.exception.user.UserRankingsException;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankingsService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.common.entity.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/rankings")
|
| | |
| | |
|
| | |
|
| | |
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveAdd")
|
| | | public void saveAdd(String callback, UserRankings userRankings, HttpServletRequest request, PrintWriter out, HttpServletResponse response) {
|
| | | public void saveAdd(AdminAcceptData acceptData, String callback, UserRankings userRankings, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | try {
|
| | | |
| | | /*String showId = userRankings.getShowId();
|
| | | List<UserRankings> list = userRankingsService.selectByShowId(showId);
|
| | | if (list != null && list.size() > 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ showId +"] 此ID已存在"));
|
| | | return;
|
| | | }*/
|
| | |
|
| | | String nickName = userRankings.getNickName();
|
| | |
|
| | |
| | |
|
| | |
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, UserRankings userRankings, HttpServletRequest request, |
| | | PrintWriter out) {
|
| | | public void saveModify(AdminAcceptData acceptData,String callback, UserRankings userRankings, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | Long id = userRankings.getId();
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("数据不存在或已被删除"));
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | | /*String showId = userRankings.getShowId();
|
| | | List<UserRankings> list = userRankingsService.selectByShowId(showId);
|
| | | if (list != null && list.size() > 0) {
|
| | | boolean proess = false;
|
| | | for (UserRankings userRanking: list) {
|
| | | Long objid = userRanking.getId();
|
| | | if (id.equals(objid)){
|
| | | proess = true;
|
| | | }
|
| | | }
|
| | | |
| | | if (!proess){
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ showId +"] 此ID已存在"));
|
| | | return;
|
| | | }
|
| | | }*/
|
| | | |
| | |
|
| | | String nickName = userRankings.getNickName();
|
| | | if (!StringUtil.isNullOrEmpty(nickName)) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (!proess){
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ nickName +"] 此昵称已存在"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | Integer shareState = userRankings.getShareState();
|
| | | if (shareState != null && (shareState.equals(1) || shareState == 1)){
|
| | |
| | |
|
| | |
|
| | | @RequestMapping(value = "deleteBatch")
|
| | | public void deleteBatch(String callback, String idArray, PrintWriter out) {
|
| | | public void deleteBatch(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPicture")
|
| | | public void uploadImg(String callback, Long id, @RequestParam("file") CommonsMultipartFile file, |
| | | HttpServletRequest request, PrintWriter out, HttpServletResponse response) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | public void uploadImg(AdminAcceptData acceptData,String callback, Long id, @RequestParam("file") CommonsMultipartFile file,
|
| | | PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (file == null) {
|
| | |
| | |
|
| | |
|
| | | @RequestMapping(value = "removePicture")
|
| | | public void uploadImg(String callback, Long id, PrintWriter out) {
|
| | | public void uploadImg(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key,
|
| | | public void query(AdminAcceptData acceptData,String callback, Integer pageIndex, Integer pageSize, String key,
|
| | | Integer tradeState, Integer shareState, Integer sort, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
| | | * @param 小值
|
| | | */
|
| | | @RequestMapping(value = "setRewardtBatch")
|
| | | public void setRewardtBatch(String callback,String ids, Integer type, Double reward,
|
| | | public void setRewardtBatch(AdminAcceptData acceptData,String callback,String ids, Integer type, Double reward,
|
| | | Double startReward, Double endReward, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
| | | * @param 小值
|
| | | */
|
| | | @RequestMapping(value = "setStateBatch")
|
| | | public void setStateBatch(String callback, String ids, Integer type, Integer state, PrintWriter out) {
|
| | | public void setStateBatch(AdminAcceptData acceptData,String callback, String ids, Integer type, Integer state, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "batchUpFile")
|
| | | public void batchUpFile(PrintWriter out) {
|
| | | public void batchUpFile(AdminAcceptData acceptData,PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | |
| | |
|
| | |
|
| | | @RequestMapping(value = "batchUpShowID")
|
| | | public void batchUpShowID(PrintWriter out) {
|
| | | public void batchUpShowID(AdminAcceptData acceptData,PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping(value = "batchUpNickName")
|
| | | public void batchUpNickName(PrintWriter out) {
|
| | | public void batchUpNickName(AdminAcceptData acceptData,PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | |
| | |
|
| | |
|
| | | @RequestMapping(value = "downPic")
|
| | | public void downPic(PrintWriter out) {
|
| | | public void downPic(AdminAcceptData acceptData,PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|