作者主页:源码空间站2022
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
本项目为后台管理系统,分为管理员、用户、工作人员三种角色;
管理员角色包含以下功能:
登陆页面,收入查看,停车卡开卡等功能。
用户角色包含以下功能:
用户登录,停车卡管理,优惠券管理,发送站内信,查看停车记录等功能。
工作人员角色包含以下功能:
登陆首页,车辆入库,车辆出库,停车卡管理,优惠券管理,站内信查看,用户管理等功能。
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;
6.是否Maven项目:是;
1. 后端:Spring+SpringMVC+Mybatis
2. 前端:JSP+Bootstrap+Javascript
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中dbconfig.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入http://localhost:8080/ssm_depot_system/login/login 登录
注:Tomcat中配置项目路径必须为ssm_depot_system
- package com.depot.ex.admin.controller;
-
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.List;
-
- import javax.servlet.http.HttpSession;
-
- import org.apache.ibatis.annotations.Param;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.transaction.annotation.Transactional;
- import org.springframework.ui.Model;
- import org.springframework.util.StringUtils;
- import org.springframework.validation.BindingResult;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.ResponseBody;
-
- import com.depot.ex.admin.dto.CouponData;
- import com.depot.ex.admin.dto.DepotcardManagerData;
- import com.depot.ex.admin.entity.CardType;
- import com.depot.ex.admin.entity.Coupon;
- import com.depot.ex.admin.entity.Depotcard;
- import com.depot.ex.admin.entity.Income;
- import com.depot.ex.admin.entity.ParkInfo;
- import com.depot.ex.admin.entity.User;
- import com.depot.ex.admin.service.CardtypeService;
- import com.depot.ex.admin.service.CouponService;
- import com.depot.ex.admin.service.DepotcardService;
- import com.depot.ex.admin.service.IllegalInfoService;
- import com.depot.ex.admin.service.IncomeService;
- import com.depot.ex.admin.service.ParkinfoService;
- import com.depot.ex.admin.service.ParkinfoallService;
- import com.depot.ex.admin.service.UserService;
- import com.depot.ex.utils.Constants;
- import com.depot.ex.utils.Msg;
-
- /**
- * *
- *
- * @author 作者 E-mail: *
- * @date 创建时间:2019年08月27日 下午2:07:13 *
- * @version 1.0 *
- * @parameter *
- * @since *
- * @return
- */
- @Controller
- public class CardController {
-
- @Autowired
- private DepotcardService depotcardService;
- @Autowired
- private CardtypeService cardtypeService;
- @Autowired
- private UserService userService;
- @Autowired
- private ParkinfoService parkinfoService;
- @Autowired
- private IncomeService incomeService;
- @Autowired
- private CouponService couponService;
- @Autowired
- private IllegalInfoService illegalInfoService;
- @Autowired
- private ParkinfoallService parkinfoallService;
-
- @ResponseBody
- @RequestMapping("/index/card/findAllCardType")
- public Msg findAllCardType()
- {
- List
cardTypes=cardtypeService.findAllCardType(); - return Msg.success().add("cardTypes", cardTypes);
- }
- @ResponseBody
- @RequestMapping("/index/card/addDepotCard")
- @Transactional
- public Msg addDepotCard(DepotcardManagerData depotcardManagerData)
- {
- if(Integer.parseInt(depotcardManagerData.getType())!=1)
- {
- depotcardManagerData.setDeductedtime(new Date());
- }
- Depotcard depotcard=depotcardService.save(depotcardManagerData);
- double money=0;
- Income income=new Income();
- if(depotcard==null)
- {
- return Msg.fail().add("va_msg", "账号已存在!");
- }
- int type=Integer.parseInt(depotcardManagerData.getType());
- /*if(type==1)
- {
- income.setTrueincome(0);
- }else{
- income.setTrueincome(1);
- }*/
- if(type==2)
- {
- money=depotcard.getMoney();
- money-=Constants.MONTHCARD;
- depotcard.setMoney(money);
- depotcardService.updateDepotcardBycardnum(depotcard);
- income.setMoney(Constants.MONTHCARD);
- }
- if(type==3)
- {
- money=depotcard.getMoney();
- money-=Constants.YEARCARD;
- depotcard.setMoney(money);
- depotcardService.updateDepotcardBycardnum(depotcard);
- income.setMoney(Constants.YEARCARD);
- }
- income.setCardnum(depotcard.getCardnum());
- income.setType(type);
- income.setMethod(depotcardManagerData.getPayid());
- income.setSource(0);
- income.setTime(new Date());
- incomeService.save(income);
- userService.saveByaddDepotCard(depotcardManagerData.getUsername(),depotcardManagerData.getName(),depotcard.getId());
- return Msg.success().add("depotcard", depotcard).add("username", depotcardManagerData.getUsername());
- }
-
- @ResponseBody
- @RequestMapping("/index/card/findDepotCardByCardnum")
- public Msg findDepotCardByCardnum(@RequestParam("cardnum")String cardnum,HttpSession session)
- {
- User currentUser=(User) session.getAttribute("user");
- Depotcard depotcard=depotcardService.findByCardnum(cardnum);
- if(depotcard==null)
- {
- return Msg.fail();
- }
- int typeid=depotcard.getType();
- int cardid=depotcard.getId();
- User user=userService.findUserByCardid(cardid);
- CardType cardType=cardtypeService.findCardTypeByid(typeid);
- List
cardTypes=cardtypeService.findAllCardType(); - return Msg.success().add("depotcard", depotcard).add("cardType", cardType)
- .add("cardTypes", cardTypes).add("user", user).add("user_role", currentUser.getRole());
- }
- @ResponseBody
- @RequestMapping("/index/card/alertDepotCard")
- public Msg alertDepotCard(DepotcardManagerData depotcardManagerData)
- {
-
- Depotcard depotcard=depotcardService.findByCardnum(depotcardManagerData.getCardnum());
- if(depotcardManagerData.getType()==null)
- {
- depotcardManagerData.setType(Integer.toString(depotcard.getType()));
- }
- if(depotcardManagerData.getIslose()!=depotcard.getIslose()
- ||Integer.parseInt(depotcardManagerData.getType())!=depotcard.getType())
- {
- depotcard.setIslose(depotcardManagerData.getIslose());
- depotcard.setType(Integer.parseInt(depotcardManagerData.getType()));
- depotcardService.updateDepotcardBycardnum(depotcard);
- }else{
- return Msg.fail();
- }
- return Msg.success();
- }
- @ResponseBody
- @RequestMapping("/index/card/deleteDepotCard")
- @Transactional
- public Msg deleteDepotCard(@RequestParam("cardnum")String cardnum)
- {
- Depotcard depotcard=depotcardService.findByCardnum(cardnum);
- int cardid=depotcard.getId();
- ParkInfo parkInfo=parkinfoService.findParkinfoByCardnum(cardnum);
- //正在停车不能删
- if(parkInfo!=null)
- {
- return Msg.fail().add("va_msg", "有车辆在停车,不能删除!");
- }
- userService.deleteUserByCardid(cardid);
- depotcardService.deleteDepotCard(cardnum);
- return Msg.success();
- }
-
- @ResponseBody
- @RequestMapping("/index/card/findCoupon")
- public Msg findCoupon(@RequestParam("cardnum")String cardnum)
- {
- List
list=couponService.findAllCouponByCardNum(cardnum, ""); - if(list!=null&&list.size()>0)
- {
- return Msg.success().add("val", list.get(0).getMoney());
- }
- return Msg.fail();
- }
-
-
- /**
- * 充值提交
- */
- @ResponseBody
- @RequestMapping("/index/card/rechargeDepotCardSubmit")
- public Msg rechargeDepotCardSubmit(DepotcardManagerData depotcardManagerData){
- Depotcard depotcard=depotcardService.findByCardnum(depotcardManagerData.getCardnum());
- Income income=new Income();
- if(depotcard==null)
- {
- return Msg.fail().add("va_msg", "该停车卡不存在,请重新输入!");
- }
- double money=depotcard.getMoney()+depotcardManagerData.getMoney();
- List
list=couponService.findAllCouponByCardNum(depotcardManagerData.getCardnum(), ""); - if(list!=null&&list.size()>0)
- {
- couponService.deleteCoupon(list.get(0).getId());
- }
- try {
- depotcardService.addMoney(depotcardManagerData.getCardnum(),money);
- } catch (Exception e) {
- return Msg.fail().add("va_msg", "出现错误!");
- }
- income.setCardnum(depotcardManagerData.getCardnum());
- income.setType(depotcard.getType());
- income.setSource(0);
- income.setMethod(depotcardManagerData.getPayid());
- income.setMoney(money);
- income.setTime(new Date());
- incomeService.save(income);
- return Msg.success();
- }
-
- @ResponseBody
- @RequestMapping("/index/card/changeLoseCard")
- @Transactional
- public Msg changeLoseCard(DepotcardManagerData depotcardManagerData)
- {
- String cardnum=depotcardManagerData.getCardnum();
- Depotcard depotcard=depotcardService.findByCardnum(cardnum);
- User user=userService.findUserByCardid(depotcard.getId());
- if(StringUtils.isEmpty(cardnum))
- {
- return Msg.fail();
- }
- Date date=new Date();
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
- String trans=formatter.format(date);
- String dateStr=trans.replaceAll(" ", "").replaceAll("-", "");
- String cardnumNew=user.getUsername()+dateStr;
- Depotcard depotcardNew=depotcardService.findByCardnum(cardnumNew);
- if(depotcardNew!=null)
- {
- return Msg.fail();
- }
- depotcardService.updateCardnum(cardnum,cardnumNew);
- couponService.updateCardnum(cardnum,cardnumNew);
- illegalInfoService.updateCardnum(cardnum,cardnumNew);
- incomeService.updateCardnum(cardnum,cardnumNew);
- parkinfoService.updateCardnum(cardnum,cardnumNew);
- parkinfoallService.updateCardnum(cardnum,cardnumNew);
- depotcardNew=depotcardService.findByCardnum(cardnumNew);
- depotcardNew.setIslose(0);
- depotcardService.updateDepotcardBycardnum(depotcardNew);
- return Msg.success();
- }
- @ResponseBody
- @RequestMapping("/index/card/isAlertType")
- public Msg isAlertType(DepotcardManagerData depotcardManagerData)
- {
- Depotcard depotcard=depotcardService.findByCardnum(depotcardManagerData.getCardnum());
- if(depotcardManagerData.getType()==null)
- {
- depotcardManagerData.setType(Integer.toString(depotcard.getType()));
- }
- if(depotcard.getType()!=Integer.parseInt(depotcardManagerData.getType()))
- {
- if(Integer.parseInt(depotcardManagerData.getType())>1)
- {
- double money=depotcard.getMoney();
- List
listCou=couponService.findAllCouponByCardNum(depotcard.getCardnum(), ""); - if(listCou!=null&&listCou.size()>0)
- {
- money+=listCou.get(0).getMoney();
- }
- //假如是月卡
- if(Integer.parseInt(depotcardManagerData.getType())==2)
- {
-
- if(money
- {
- return Msg.fail().add("money_pay", Constants.MONTHCARD-money);
- }else{
- return Msg.success().add("money_pay", Constants.MONTHCARD);
- }
- }else{
- if(money
- {
- return Msg.fail().add("money_pay", Constants.YEARCARD-money);
- }else{
- return Msg.success().add("money_pay", Constants.MONTHCARD);
- }
- }
- }
- }
- return Msg.success().add("money_pay", 0);
- }
-
- }
CheckController
- package com.depot.ex.admin.controller;
-
- import static org.hamcrest.CoreMatchers.nullValue;
-
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.List;
-
- import javax.servlet.http.HttpSession;
-
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.transaction.annotation.Transactional;
- import org.springframework.ui.Model;
- import org.springframework.util.StringUtils;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.ResponseBody;
-
- import com.depot.ex.admin.dto.CouponData;
- import com.depot.ex.admin.dto.FormData;
- import com.depot.ex.admin.entity.Coupon;
- import com.depot.ex.admin.entity.Depotcard;
- import com.depot.ex.admin.entity.IllegalInfo;
- import com.depot.ex.admin.entity.Income;
- import com.depot.ex.admin.entity.ParkInfo;
- import com.depot.ex.admin.entity.Parkinfoall;
- import com.depot.ex.admin.entity.User;
- import com.depot.ex.admin.service.CouponService;
- import com.depot.ex.admin.service.DepotcardService;
- import com.depot.ex.admin.service.IllegalInfoService;
- import com.depot.ex.admin.service.IncomeService;
- import com.depot.ex.admin.service.ParkinfoService;
- import com.depot.ex.admin.service.ParkinfoallService;
- import com.depot.ex.admin.service.ParkspaceService;
- import com.depot.ex.admin.service.UserService;
- import com.depot.ex.utils.Constants;
- import com.depot.ex.utils.Msg;
-
- /**
- * *
- *
- * @author 作者 E-mail: *
- * @date 创建时间:2019年08月5日 下午12:00:13 *
- * @version 1.0 *
- * @parameter *
- * @since *
- * @return
- */
- @Controller
- public class CheckController {
-
- @Autowired
- private ParkinfoService parkinfoservice;
- @Autowired
- private ParkspaceService parkspaceService;
- @Autowired
- private DepotcardService depotcardService;
- @Autowired
- private UserService userService;
- @Autowired
- private IllegalInfoService illegalInfoService;
- @Autowired
- private ParkinfoallService parkinfoallService;
- @Autowired
- private IncomeService incomeService;
- @Autowired
- private CouponService couponService;
-
- @RequestMapping("/index/check/checkIn")
- @ResponseBody
- @Transactional
- // 入库操作
- public Msg checkIn(Model model, FormData data) {
- Depotcard depotcard=depotcardService.findByCardnum(data.getCardNum());
- if(data.getParkTem()!=1)
- {
- if(depotcard!=null)
- {
- if(depotcard.getIslose()==1)
- {
- return Msg.fail().add("va_msg", "该卡已挂失!");
- }
- }else{
- return Msg.fail().add("va_msg", "该卡不存在!");
- }
- }
- parkinfoservice.saveParkinfo(data);
- parkspaceService.changeStatus(data.getId(), 1);
- return Msg.success();
- }
-
- @RequestMapping("/index/check/checkOut")
- @ResponseBody
- @Transactional
- // 出库操作(0扣费,1不用扣费,9付钱)
- public Msg checkOut(Model model, FormData data) {
- int pay_money=data.getPay_money();
- Date parkout=new Date();
- Parkinfoall parkinfoall=new Parkinfoall();
- ParkInfo parkInfo=parkinfoservice.findParkinfoByParknum(data.getParkNum());
- if(data.getPay_type()==9)
- {
- Depotcard depotcard=depotcardService.findByCardnum(data.getCardNum());
- IllegalInfo illegalInfo=illegalInfoService.findByCardnumParkin(data.getCardNum(),parkInfo.getParkin());
- Income income=new Income();
- List
coupons=couponService.findAllCouponByCardNum(data.getCardNum(), ""); - if(coupons!=null&&coupons.size()>0)
- {
- couponService.deleteCoupon(coupons.get(0).getId());
- }
- depotcardService.addMoney(data.getCardNum(), 0);
- income.setMoney(pay_money);
- income.setMethod(data.getPayid());
- income.setCardnum(data.getCardNum());
- income.setCarnum(data.getCarNum());
- if(depotcard!=null)
- {
- income.setType(depotcard.getType());
- }
- if(illegalInfo!=null)
- {
- income.setIsillegal(1);
- }
- income.setSource(1);
- income.setTime(parkout);
- Date parkin=parkInfo.getParkin();
- long day=parkout.getTime()-parkin.getTime();
- long time=day/(1000*60);
- if(day%(1000*60)>0){
- time+=1;
- }
- income.setDuration(time);
- incomeService.save(income);
- }else{
- if(data.getPay_type()==9)
- {
- return Msg.fail().add("va_msg", "系统出错!");
- }else if(data.getPay_type()==0)
- {
- //正常扣费,月卡或年卡过期
- Depotcard depotcard=depotcardService.findByCardnum(data.getCardNum());
- IllegalInfo illegalInfo=illegalInfoService.findByCardnumParkin(data.getCardNum(),parkInfo.getParkin());
- double money=depotcard.getMoney();
- List
coupons=couponService.findAllCouponByCardNum(data.getCardNum(), ""); - if(coupons!=null&&coupons.size()>0)
- {
- money-=coupons.get(0).getMoney();
- couponService.deleteCoupon(coupons.get(0).getId());
- }
- money-=pay_money;
- depotcardService.addMoney(depotcard.getCardnum(),money);
- /*Income income=new Income();
- income.setMoney(pay_money);
- income.setMethod(data.getPayid());
- income.setCardnum(data.getCardNum());
- income.setCarnum(data.getCarNum());
- income.setType(depotcard.getType());
- if(illegalInfo!=null)
- {
- income.setIsillegal(1);
- }
- income.setSource(1);
- income.setTime(parkout);*/
- /*Date parkin=parkInfo.getParkin();
- long day=parkout.getTime()-parkin.getTime();
- long time=day/(1000*60);
- if(day%(1000*60)>0){
- time+=1;
- }
- income.setDuration(time);
- income.setTrueincome(1);
- incomeService.save(income);*/
- }else{
- //月卡或年卡在期
- }
- }
- parkinfoall.setCardnum(parkInfo.getCardnum());
- parkinfoall.setCarnum(parkInfo.getCarnum());
- parkinfoall.setParkin(parkInfo.getParkin());
- parkinfoall.setParknum(data.getParkNum());
- parkinfoall.setParkout(parkout);
- parkinfoall.setParktemp(parkInfo.getParktem());
- parkinfoallService.save(parkinfoall);
- parkspaceService.changeStatusByParkNum(data.getParkNum(),0);
- parkinfoservice.deleteParkinfoByParkNum(data.getParkNum());
- return Msg.success();
- }
-
- @RequestMapping("/index/check/findParkinfoByParknum")
- @ResponseBody
- // 根据停车位号查找停车位信息
- public Msg findParkinfoByParknum(@RequestParam("parkNum") int parknum) {
- ParkInfo parkInfo = parkinfoservice.findParkinfoByParknum(parknum);
- return Msg.success().add("parkInfo", parkInfo);
- }
-
- @RequestMapping("/index/check/findParkinfoByCardnum")
- @ResponseBody
- // 根据停车位号/车牌号查找停车位信息
- public Msg findParkinfoByCardnum(@RequestParam("cardnum") String cardnum) {
- ParkInfo parkInfo = parkinfoservice.findParkinfoByCardnum(cardnum);
- if(parkInfo!=null)
- {
- return Msg.success().add("parkInfo", parkInfo);
- }
- return Msg.fail();
- }
-
- @RequestMapping("/index/check/findParkinfoDetailByParknum")
- @ResponseBody
- //根据停车位号查找停车详细信息
- public Msg findParkinfoDetailByParknum(@RequestParam("parkNum") int parknum)
- {
- ParkInfo parkInfo = parkinfoservice.findParkinfoByParknum(parknum);
- if(parkInfo==null)
- {
- return Msg.fail();
- }
- Date date=parkInfo.getParkin();
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String parkin=formatter.format(date);
- System.out.println(parkInfo.toString());
- String cardnum=parkInfo.getCardnum();
- Depotcard depotcard=depotcardService.findByCardnum(cardnum);
- int cardid=0;
- User user =null;
- if(depotcard!=null)
- {
- cardid=depotcard.getId();
- user =userService.findUserByCardid(cardid);
- }
- return Msg.success().add("parkInfo", parkInfo).add("user", user).add("parkin", parkin);
- }
-
- @RequestMapping("/index/check/illegalSubmit")
- @ResponseBody
- //违规提交
- public Msg illegalSubmit(FormData data,HttpSession httpSession)
- {
- User currentUser=(User) httpSession.getAttribute("user");
- ParkInfo parkInfo=parkinfoservice.findParkinfoByCardnum(data.getCardNum());
- IllegalInfo info=new IllegalInfo();
- IllegalInfo illegalInfo=illegalInfoService.findByCardnumParkin(data.getCardNum(),parkInfo.getParkin());
- if(illegalInfo!=null)
- {
- return Msg.fail().add("va_msg", "添加失败,已经有违规!");
- }
- info.setCardnum(data.getCardNum());
- info.setCarnum(data.getCarNum());
- info.setIllegalInfo(data.getIllegalInfo());
- info.setUid(currentUser.getId());
- Date date=new Date();
- info.setTime(date);
- info.setParkin(parkInfo.getParkin());
- info.setDelete("N");
- try {
- illegalInfoService.save(info);
- } catch (Exception e) {
- e.printStackTrace();
- return Msg.fail().add("va_msg", "添加失败");
- }
- return Msg.success().add("va_msg", "添加成功");
- }
-
- /*是否需要支付
- * type:0是正常扣费
- * type:1是月卡年卡没到期*/
- @RequestMapping("/index/check/ispay")
- @ResponseBody
- public Msg ispay(@RequestParam("parknum") Integer parknum)
- {
- ParkInfo parkInfo=parkinfoservice.findParkinfoByParknum(parknum.intValue());
- Date date=new Date();
- Date parkin;
- long time=0;
- long day=0;
- int illegalmoney=0;
- //临时停车(10块)
- if(parkInfo==null)
- {
- return Msg.fail().add("type", 9);
- }
- //是否有违规需要缴费
- IllegalInfo illegalInfo=illegalInfoService.findByCarnum(parkInfo.getCarnum(),parkInfo.getParkin());
- if(illegalInfo!=null)
- {
- illegalmoney=Constants.ILLEGAL;
- }
- if(StringUtils.isEmpty(parkInfo.getCardnum()))
- {
- //需要现金或扫码支付,1小时10块
- parkin=parkInfo.getParkin();
- day=date.getTime()-parkin.getTime();
- time=day/(1000*60*60);
- if(day%(1000*60*60)>0){
- time+=1;
- }
- return Msg.success().add("money_pay", time*Constants.TEMPMONEY+illegalmoney).add("va_msg", "临时停车"+(illegalmoney>0? ",有违规:"+illegalInfo.getIllegalInfo():""));
- }
- String cardnum=parkInfo.getCardnum();
- Depotcard depotcard=depotcardService.findByCardnum(cardnum);
- //正常卡(8块)
- if(depotcard!=null&&depotcard.getType()==1)
- {
- //卡中余额
- double balance=depotcard.getMoney();
- int money=0;
- List
coupons=couponService.findAllCouponByCardNum(cardnum, ""); - if(coupons!=null&&coupons.size()>0)
- {
- money=coupons.get(0).getMoney();
- }
- parkin=parkInfo.getParkin();
- day=date.getTime()-parkin.getTime();
- time=day/(1000*60*60);
- if(day%(1000*60*60)>0){
- time+=1;
- }
- if(balance+money-illegalmoney
- {
- return Msg.success().add("money_pay", time*Constants.HOURMONEY+illegalmoney-money-balance).add("va_msg", "余额不足"+(illegalmoney>0? ",有违规:"+illegalInfo.getIllegalInfo():""));
- }else{
- return Msg.fail().add("type", 0).add("money_pay", time*Constants.HOURMONEY+illegalmoney-money);
- }
- }
- Date deductedtime=depotcard.getDeductedtime();
- if(depotcard.getType()>1)
- {
- day=date.getTime()-deductedtime.getTime();
- }
- if(depotcard.getType()==3){
- time=day/(1000*60*60*24*30);
- }
- if(depotcard.getType()==4){
- time=day/(1000*60*60*24*365);
- }
- //如果月卡或年卡没到期,直接出库
- if(time<1)
- {
- return Msg.fail().add("type", 1);
- }else{
- //否则查看停车卡余额是否足够扣费,不够则需要现金或扫码
- //卡中余额
- double balance=depotcard.getMoney();
- int money=0;
- List
coupons=couponService.findAllCouponByCardNum(cardnum, ""); - if(coupons!=null&&coupons.size()>0)
- {
- money=coupons.get(0).getMoney();
- }
- parkin=parkInfo.getParkin();
- day=date.getTime()-parkin.getTime();
- time=day/(1000*60*60);
- if(day%(1000*60*60)>0){
- time+=1;
- }
- if(balance+money-illegalmoney
- {
- return Msg.success().add("money_pay", time*Constants.HOURMONEY+illegalmoney-money-balance).add("va_msg", "余额不足"+(illegalmoney>0? ",有违规:"+illegalInfo.getIllegalInfo():""));
- }else{
- return Msg.fail().add("type", 0);
- }
- }
- }
-
- }
如果也想学习本系统,下面领取。关注并回复:080ssm
-
相关阅读:
【YashanDB知识库】数据变化率超过阈值统计信息失效
Wireshark抓包分析IP协议
PHP8的类与对象的基本操作之类常量-PHP8知识详解
MySQL 5.7到8.0数据迁移
使用WebDriver采样器将JMeter与Selenium集成
mysql基础面试题
【火猫体育】法甲:他背叛国米追求高薪,就要被新东家赶走
1985-2023年6月全球各国经济政策不确定性数据
java-php-python-ssm网上拍卖系统2021计算机毕业设计
【路径规划-多式联运】基于遗传算法求解多式联运冷链运输成本优化问题附matlab代码
-
原文地址:https://blog.csdn.net/m0_74967853/article/details/128179193