国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文

這篇具有很好參考價(jià)值的文章主要介紹了基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

網(wǎng)絡(luò)的廣泛應(yīng)用給生活帶來了十分的便利。所以把休閑娛樂代理售票管理與現(xiàn)在網(wǎng)絡(luò)相結(jié)合,利用java技術(shù)建設(shè)休閑娛樂代理售票系統(tǒng),實(shí)現(xiàn)休閑娛樂代理售票的信息化。則對于進(jìn)一步提高休閑娛樂代理售票管理發(fā)展,豐富休閑娛樂代理售票管理經(jīng)驗(yàn)?zāi)芷鸬讲簧俚拇龠M(jìn)作用。

休閑娛樂代理售票系統(tǒng)能夠通過互聯(lián)網(wǎng)得到廣泛的、全面的宣傳,讓盡可能多的用戶了解和熟知休閑娛樂代理售票系統(tǒng)的便捷高效,不僅為群眾提供了服務(wù),而且也推廣了自己,讓更多的群眾了解自己。對于休閑娛樂代理售票而言,若擁有自己的系統(tǒng),通過系統(tǒng)得到更好的管理,同時(shí)提升了形象。

本系統(tǒng)設(shè)計(jì)的現(xiàn)狀和趨勢,從需求、結(jié)構(gòu)、數(shù)據(jù)庫等方面的設(shè)計(jì)到系統(tǒng)的實(shí)現(xiàn),分別為管理員和用戶的實(shí)現(xiàn)。論文的內(nèi)容從系統(tǒng)的設(shè)計(jì)、描述、實(shí)現(xiàn)、分析、測試方面來表明開發(fā)的過程。本系統(tǒng)根據(jù)現(xiàn)實(shí)情況來選擇一種可行的開發(fā)方案,借助java編程語言和MySQL數(shù)據(jù)庫等實(shí)現(xiàn)系統(tǒng)的全部功能,接下來對系統(tǒng)進(jìn)行測試,測試系統(tǒng)是否有漏洞和測試用戶權(quán)限來完善系統(tǒng),最終系統(tǒng)完成達(dá)到相關(guān)標(biāo)準(zhǔn)。

關(guān)鍵字:休閑娛樂代理售票系統(tǒng)java ?MySQL數(shù)據(jù)庫

基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文382

基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂

Abstract

The wide application of network has brought great convenience to life. So the leisure and entertainment agent ticketing management and the current network combined, using Java technology to build leisure and entertainment agent ticketing system, to achieve leisure and entertainment agent ticketing information. It can further improve the management development of leisure and entertainment agents and enrich the management experience of leisure and entertainment agents.

Leisure and entertainment agent ticketing system can be widely and comprehensively publicized through the Internet, so that as many users as possible to understand and be familiar with the convenience and efficiency of leisure and entertainment agent ticketing system, not only to provide services for the masses, but also to promote themselves, so that more people understand themselves. For leisure and entertainment agent ticketing, if you have your own system, through the system to get better management, while improving the image.

The present situation and trend of the system design, from the requirements, structure, database and other aspects of the design to the realization of the system, respectively for the realization of administrators and users. The content of the paper shows the development process from the aspects of system design, description, implementation, analysis and testing. The system according to the reality to choose a feasible development plan, with the help of Java programming language and MySQL database to achieve all the functions of the system, then the system is tested, test whether the system has vulnerabilities and test user permissions to improve the system, the final system to achieve relevant standards.

Keywords:recreational agent ticketing system Java MySQL database

基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文,娛樂文章來源地址http://www.zghlxwxcb.cn/news/detail-833381.html


package com.controller;

import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;

import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;

/**
 * 用戶
 * 后端接口
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("/yonghu")
public class YonghuController {
    private static final Logger logger = LoggerFactory.getLogger(YonghuController.class);

    private static final String TABLE_NAME = "yonghu";

    @Autowired
    private YonghuService yonghuService;


    @Autowired
    private TokenService tokenService;

    @Autowired
    private DictionaryService dictionaryService;//字典
    @Autowired
    private ForumService forumService;//交流論壇
    @Autowired
    private GonggaoService gonggaoService;//公告資訊
    @Autowired
    private HanfuService hanfuService;//漢服信息
    @Autowired
    private HanfuCollectionService hanfuCollectionService;//漢服收藏
    @Autowired
    private HanfuCommentbackService hanfuCommentbackService;//漢服評價(jià)
    @Autowired
    private HanfuOrderService hanfuOrderService;//漢服租賃
    @Autowired
    private UsersService usersService;//管理員


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永不會進(jìn)入");
        else if("用戶".equals(role))
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        CommonUtil.checkMap(params);
        PageUtils page = yonghuService.queryPage(params);

        //字典表數(shù)據(jù)轉(zhuǎn)換
        List<YonghuView> list =(List<YonghuView>)page.getList();
        for(YonghuView c:list){
            //修改對應(yīng)字典表字段
            dictionaryService.dictionaryConvert(c, request);
        }
        return R.ok().put("data", page);
    }

    /**
    * 后端詳情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        YonghuEntity yonghu = yonghuService.selectById(id);
        if(yonghu !=null){
            //entity轉(zhuǎn)view
            YonghuView view = new YonghuView();
            BeanUtils.copyProperties( yonghu , view );//把實(shí)體數(shù)據(jù)重構(gòu)到view中
            //修改對應(yīng)字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到數(shù)據(jù)");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永遠(yuǎn)不會進(jìn)入");

        Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
            .eq("username", yonghu.getUsername())
            .or()
            .eq("yonghu_phone", yonghu.getYonghuPhone())
            .or()
            .eq("yonghu_id_number", yonghu.getYonghuIdNumber())
            ;

        logger.info("sql語句:"+queryWrapper.getSqlSegment());
        YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
        if(yonghuEntity==null){
            yonghu.setCreateTime(new Date());
            yonghu.setPassword("123456");
            yonghuService.insert(yonghu);
            return R.ok();
        }else {
            return R.error(511,"賬戶或者用戶手機(jī)號或者用戶身份證號已經(jīng)被使用");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
        YonghuEntity oldYonghuEntity = yonghuService.selectById(yonghu.getId());//查詢原先數(shù)據(jù)

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永遠(yuǎn)不會進(jìn)入");
        if("".equals(yonghu.getYonghuPhoto()) || "null".equals(yonghu.getYonghuPhoto())){
                yonghu.setYonghuPhoto(null);
        }

            yonghuService.updateById(yonghu);//根據(jù)id更新
            return R.ok();
    }



    /**
    * 刪除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<YonghuEntity> oldYonghuList =yonghuService.selectBatchIds(Arrays.asList(ids));//要?jiǎng)h除的數(shù)據(jù)
        yonghuService.deleteBatchIds(Arrays.asList(ids));

        return R.ok();
    }


    /**
     * 批量上傳
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName, HttpServletRequest request){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
        try {
            List<YonghuEntity> yonghuList = new ArrayList<>();//上傳的東西
            Map<String, List<String>> seachFields= new HashMap<>();//要查詢的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"該文件沒有后綴");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后綴為xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//獲取文件路徑
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上傳文件,請聯(lián)系管理員");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//讀取xls文件
                        dataList.remove(0);//刪除第一行,因?yàn)榈谝恍惺翘崾?                        for(List<String> data:dataList){
                            //循環(huán)
                            YonghuEntity yonghuEntity = new YonghuEntity();
//                            yonghuEntity.setUsername(data.get(0));                    //賬戶 要改的
//                            yonghuEntity.setPassword("123456");//密碼
//                            yonghuEntity.setYonghuUuidNumber(data.get(0));                    //用戶編號 要改的
//                            yonghuEntity.setYonghuName(data.get(0));                    //用戶姓名 要改的
//                            yonghuEntity.setYonghuPhone(data.get(0));                    //用戶手機(jī)號 要改的
//                            yonghuEntity.setYonghuIdNumber(data.get(0));                    //用戶身份證號 要改的
//                            yonghuEntity.setYonghuPhoto("");//詳情和圖片
//                            yonghuEntity.setSexTypes(Integer.valueOf(data.get(0)));   //性別 要改的
//                            yonghuEntity.setNewMoney(data.get(0));                    //余額 要改的
//                            yonghuEntity.setYonghuEmail(data.get(0));                    //用戶郵箱 要改的
//                            yonghuEntity.setCreateTime(date);//時(shí)間
                            yonghuList.add(yonghuEntity);


                            //把要查詢是否重復(fù)的字段放入map中
                                //賬戶
                                if(seachFields.containsKey("username")){
                                    List<String> username = seachFields.get("username");
                                    username.add(data.get(0));//要改的
                                }else{
                                    List<String> username = new ArrayList<>();
                                    username.add(data.get(0));//要改的
                                    seachFields.put("username",username);
                                }
                                //用戶編號
                                if(seachFields.containsKey("yonghuUuidNumber")){
                                    List<String> yonghuUuidNumber = seachFields.get("yonghuUuidNumber");
                                    yonghuUuidNumber.add(data.get(0));//要改的
                                }else{
                                    List<String> yonghuUuidNumber = new ArrayList<>();
                                    yonghuUuidNumber.add(data.get(0));//要改的
                                    seachFields.put("yonghuUuidNumber",yonghuUuidNumber);
                                }
                                //用戶手機(jī)號
                                if(seachFields.containsKey("yonghuPhone")){
                                    List<String> yonghuPhone = seachFields.get("yonghuPhone");
                                    yonghuPhone.add(data.get(0));//要改的
                                }else{
                                    List<String> yonghuPhone = new ArrayList<>();
                                    yonghuPhone.add(data.get(0));//要改的
                                    seachFields.put("yonghuPhone",yonghuPhone);
                                }
                                //用戶身份證號
                                if(seachFields.containsKey("yonghuIdNumber")){
                                    List<String> yonghuIdNumber = seachFields.get("yonghuIdNumber");
                                    yonghuIdNumber.add(data.get(0));//要改的
                                }else{
                                    List<String> yonghuIdNumber = new ArrayList<>();
                                    yonghuIdNumber.add(data.get(0));//要改的
                                    seachFields.put("yonghuIdNumber",yonghuIdNumber);
                                }
                        }

                        //查詢是否重復(fù)
                         //賬戶
                        List<YonghuEntity> yonghuEntities_username = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("username", seachFields.get("username")));
                        if(yonghuEntities_username.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(YonghuEntity s:yonghuEntities_username){
                                repeatFields.add(s.getUsername());
                            }
                            return R.error(511,"數(shù)據(jù)庫的該表中的 [賬戶] 字段已經(jīng)存在 存在數(shù)據(jù)為:"+repeatFields.toString());
                        }
                         //用戶編號
                        List<YonghuEntity> yonghuEntities_yonghuUuidNumber = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_uuid_number", seachFields.get("yonghuUuidNumber")));
                        if(yonghuEntities_yonghuUuidNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(YonghuEntity s:yonghuEntities_yonghuUuidNumber){
                                repeatFields.add(s.getYonghuUuidNumber());
                            }
                            return R.error(511,"數(shù)據(jù)庫的該表中的 [用戶編號] 字段已經(jīng)存在 存在數(shù)據(jù)為:"+repeatFields.toString());
                        }
                         //用戶手機(jī)號
                        List<YonghuEntity> yonghuEntities_yonghuPhone = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_phone", seachFields.get("yonghuPhone")));
                        if(yonghuEntities_yonghuPhone.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(YonghuEntity s:yonghuEntities_yonghuPhone){
                                repeatFields.add(s.getYonghuPhone());
                            }
                            return R.error(511,"數(shù)據(jù)庫的該表中的 [用戶手機(jī)號] 字段已經(jīng)存在 存在數(shù)據(jù)為:"+repeatFields.toString());
                        }
                         //用戶身份證號
                        List<YonghuEntity> yonghuEntities_yonghuIdNumber = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_id_number", seachFields.get("yonghuIdNumber")));
                        if(yonghuEntities_yonghuIdNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(YonghuEntity s:yonghuEntities_yonghuIdNumber){
                                repeatFields.add(s.getYonghuIdNumber());
                            }
                            return R.error(511,"數(shù)據(jù)庫的該表中的 [用戶身份證號] 字段已經(jīng)存在 存在數(shù)據(jù)為:"+repeatFields.toString());
                        }
                        yonghuService.insertBatch(yonghuList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入數(shù)據(jù)異常,請聯(lián)系管理員");
        }
    }

    /**
    * 登錄
    */
    @IgnoreAuth
    @RequestMapping(value = "/login")
    public R login(String username, String password, String captcha, HttpServletRequest request) {
        YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
        if(yonghu==null || !yonghu.getPassword().equals(password))
            return R.error("賬號或密碼不正確");
        String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "用戶");
        R r = R.ok();
        r.put("token", token);
        r.put("role","用戶");
        r.put("username",yonghu.getYonghuName());
        r.put("tableName","yonghu");
        r.put("userId",yonghu.getId());
        return r;
    }

    /**
    * 注冊
    */
    @IgnoreAuth
    @PostMapping(value = "/register")
    public R register(@RequestBody YonghuEntity yonghu, HttpServletRequest request) {
//    	ValidatorUtils.validateEntity(user);
        Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
            .eq("username", yonghu.getUsername())
            .or()
            .eq("yonghu_phone", yonghu.getYonghuPhone())
            .or()
            .eq("yonghu_id_number", yonghu.getYonghuIdNumber())
            ;
        YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
        if(yonghuEntity != null)
            return R.error("賬戶或者用戶手機(jī)號或者用戶身份證號已經(jīng)被使用");
        yonghu.setYonghuUuidNumber(String.valueOf(new Date().getTime()));
        yonghu.setNewMoney(0.0);
        yonghu.setCreateTime(new Date());
        yonghuService.insert(yonghu);

        return R.ok();
    }

    /**
     * 重置密碼
     */
    @GetMapping(value = "/resetPassword")
    public R resetPassword(Integer  id, HttpServletRequest request) {
        YonghuEntity yonghu = yonghuService.selectById(id);
        yonghu.setPassword("123456");
        yonghuService.updateById(yonghu);
        return R.ok();
    }

	/**
	 * 修改密碼
	 */
	@GetMapping(value = "/updatePassword")
	public R updatePassword(String  oldPassword, String  newPassword, HttpServletRequest request) {
        YonghuEntity yonghu = yonghuService.selectById((Integer)request.getSession().getAttribute("userId"));
		if(newPassword == null){
			return R.error("新密碼不能為空") ;
		}
		if(!oldPassword.equals(yonghu.getPassword())){
			return R.error("原密碼輸入錯(cuò)誤");
		}
		if(newPassword.equals(yonghu.getPassword())){
			return R.error("新密碼不能和原密碼一致") ;
		}
        yonghu.setPassword(newPassword);
		yonghuService.updateById(yonghu);
		return R.ok();
	}



    /**
     * 忘記密碼
     */
    @IgnoreAuth
    @RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request) {
        YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
        if(yonghu!=null){
            yonghu.setPassword("123456");
            yonghuService.updateById(yonghu);
            return R.ok();
        }else{
           return R.error("賬號不存在");
        }
    }


    /**
    * 獲取用戶的session用戶信息
    */
    @RequestMapping("/session")
    public R getCurrYonghu(HttpServletRequest request){
        Integer id = (Integer)request.getSession().getAttribute("userId");
        YonghuEntity yonghu = yonghuService.selectById(id);
        if(yonghu !=null){
            //entity轉(zhuǎn)view
            YonghuView view = new YonghuView();
            BeanUtils.copyProperties( yonghu , view );//把實(shí)體數(shù)據(jù)重構(gòu)到view中

            //修改對應(yīng)字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到數(shù)據(jù)");
        }
    }


    /**
    * 退出
    */
    @GetMapping(value = "logout")
    public R logout(HttpServletRequest request) {
        request.getSession().invalidate();
        return R.ok("退出成功");
    }



    /**
    * 前端列表
    */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        CommonUtil.checkMap(params);
        PageUtils page = yonghuService.queryPage(params);

        //字典表數(shù)據(jù)轉(zhuǎn)換
        List<YonghuView> list =(List<YonghuView>)page.getList();
        for(YonghuView c:list)
            dictionaryService.dictionaryConvert(c, request); //修改對應(yīng)字典表字段

        return R.ok().put("data", page);
    }

    /**
    * 前端詳情
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Integer id, HttpServletRequest request){
        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        YonghuEntity yonghu = yonghuService.selectById(id);
            if(yonghu !=null){


                //entity轉(zhuǎn)view
                YonghuView view = new YonghuView();
                BeanUtils.copyProperties( yonghu , view );//把實(shí)體數(shù)據(jù)重構(gòu)到view中

                //修改對應(yīng)字典表字段
                dictionaryService.dictionaryConvert(view, request);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到數(shù)據(jù)");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());
        Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
            .eq("username", yonghu.getUsername())
            .or()
            .eq("yonghu_phone", yonghu.getYonghuPhone())
            .or()
            .eq("yonghu_id_number", yonghu.getYonghuIdNumber())
//            .notIn("yonghu_types", new Integer[]{102})
            ;
        logger.info("sql語句:"+queryWrapper.getSqlSegment());
        YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
        if(yonghuEntity==null){
            yonghu.setCreateTime(new Date());
            yonghu.setPassword("123456");
        yonghuService.insert(yonghu);

            return R.ok();
        }else {
            return R.error(511,"賬戶或者用戶手機(jī)號或者用戶身份證號已經(jīng)被使用");
        }
    }

}

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.AddressEntity;
import com.entity.view.AddressView;

import com.service.AddressService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;

/**
 * 地址
 * 后端接口
 * @author 
 * @email 
 * @date 2022-04-06 15:28:34
 */
@RestController
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private AddressService addressService;


    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,AddressEntity address,
		HttpServletRequest request){
    	if(!request.getSession().getAttribute("role").toString().equals("管理員")) {
    		address.setUserid((Long)request.getSession().getAttribute("userId"));
    	}
        EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
		PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,AddressEntity address, 
		HttpServletRequest request){
    	if(!request.getSession().getAttribute("role").toString().equals("管理員")) {
    		address.setUserid((Long)request.getSession().getAttribute("userId"));
    	}
        EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
		PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( AddressEntity address){
       	EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
      	ew.allEq(MPUtil.allEQMapPre( address, "address")); 
        return R.ok().put("data", addressService.selectListView(ew));
    }

	 /**
     * 查詢
     */
    @RequestMapping("/query")
    public R query(AddressEntity address){
        EntityWrapper< AddressEntity> ew = new EntityWrapper< AddressEntity>();
 		ew.allEq(MPUtil.allEQMapPre( address, "address")); 
		AddressView addressView =  addressService.selectView(ew);
		return R.ok("查詢地址成功").put("data", addressView);
    }
	
    /**
     * 后端詳情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        AddressEntity address = addressService.selectById(id);
        return R.ok().put("data", address);
    }

    /**
     * 前端詳情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        AddressEntity address = addressService.selectById(id);
        return R.ok().put("data", address);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody AddressEntity address, HttpServletRequest request){
    	address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(address);
    	address.setUserid((Long)request.getSession().getAttribute("userId"));
		Long userId = (Long)request.getSession().getAttribute("userId");
    	if(address.getIsdefault().equals("是")) {
    		addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
    	}
    	address.setUserid(userId);
        addressService.insert(address);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody AddressEntity address, HttpServletRequest request){
    	address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(address);
    	address.setUserid((Long)request.getSession().getAttribute("userId"));
		Long userId = (Long)request.getSession().getAttribute("userId");
    	if(address.getIsdefault().equals("是")) {
    		addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
    	}
    	address.setUserid(userId);
        addressService.insert(address);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody AddressEntity address, HttpServletRequest request){
        //ValidatorUtils.validateEntity(address);
        if(address.getIsdefault().equals("是")) {
    		addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", request.getSession().getAttribute("userId")));
    	}
        addressService.updateById(address);//全部更新
        return R.ok();
    }
    
    /**
     * 獲取默認(rèn)地址
     */
    @RequestMapping("/default")
    public R defaultAddress(HttpServletRequest request){
    	Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>().eq("isdefault", "是").eq("userid", request.getSession().getAttribute("userId"));
        AddressEntity address = addressService.selectOne(wrapper);
        return R.ok().put("data", address);
    }

    /**
     * 刪除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        addressService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}
		if(!request.getSession().getAttribute("role").toString().equals("管理員")) {
    		wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
    	}


		int count = addressService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	







}

到了這里,關(guān)于基于springboot休閑娛樂代理售票系統(tǒng)源碼和論文的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包