| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 快车价格设置控制器 |
| | | * 专车价格设置控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-08-29 10:50:13 |
| | |
| | | |
| | | |
| | | /** |
| | | * 跳转到快车价格设置首页 |
| | | * 跳转到专车价格设置首页 |
| | | */ |
| | | @RequestMapping("/special") |
| | | public String index() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加快车价格设置 |
| | | * 跳转到添加专车价格设置 |
| | | */ |
| | | @RequestMapping("/tSystemPrice_add") |
| | | public String tSystemPriceAdd(Model model) { |
| | | //查询所有快车车型 |
| | | //查询所有专车车型 |
| | | List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", ShiroKit.getUser().getObjectId()).ne("state", 3)); |
| | | List<TServerCarmodel> modelList = tServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1)); |
| | | List<TServerCarmodel> serverCarmodels = new ArrayList<>(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改快车价格设置 |
| | | * 跳转到修改专车价格设置 |
| | | */ |
| | | @RequestMapping("/tSystemPrice_update/{tSystemPriceId}") |
| | | public String tSystemPriceUpdate(@PathVariable Integer tSystemPriceId, Model model) { |
| | |
| | | LogObjectHolder.me().set(tSystemPrice); |
| | | |
| | | JSONObject json = JSONObject.fromObject(tSystemPrice.getContent()); |
| | | model.addAttribute("content",json); |
| | | model.addAttribute("json",json); |
| | | |
| | | model.addAttribute("contentPutOne",JSONObject.fromObject(tSystemPrice.getContentPutOne())); |
| | | model.addAttribute("contentNotOne",JSONObject.fromObject(tSystemPrice.getContentNotOne())); |
| | | model.addAttribute("contentPutTwo",JSONObject.fromObject(tSystemPrice.getContentPutTwo())); |
| | | model.addAttribute("contentNotTwo",JSONObject.fromObject(tSystemPrice.getContentNotTwo())); |
| | | model.addAttribute("contentPutThree",JSONObject.fromObject(tSystemPrice.getContentPutThree())); |
| | | model.addAttribute("contentNotThree",JSONObject.fromObject(tSystemPrice.getContentNotThree())); |
| | | model.addAttribute("contentExclusive",JSONObject.fromObject(tSystemPrice.getContentExclusive())); |
| | | model.addAttribute("contentPrice",JSONObject.fromObject(tSystemPrice.getContentPrice())); |
| | | |
| | | //查询所有快车车型 |
| | | //查询所有专车车型 |
| | | List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).ne("state", 3)); |
| | | List<TServerCarmodel> modelList = tServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1)); |
| | | List<TServerCarmodel> serverCarmodels = new ArrayList<>(); |
| | | for(TServerCarmodel tsc : modelList){ |
| | | boolean b = true; |
| | | for(TSystemPrice tsp : tSystemPrices){ |
| | | if(tsc.getId() == tsp.getServerCarModelId() && tsp.getId() != tSystemPriceId){ |
| | | if(tsc.getId() == tsp.getServerCarModelId() && tsc.getId() != tSystemPriceId){ |
| | | b = false; |
| | | break; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取快车价格设置列表 |
| | | * 获取专车价格设置列表 |
| | | */ |
| | | @RequestMapping(value = "/listSpecial") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增快车价格设置 |
| | | * 新增专车价格设置 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TSystemPrice tSystemPrice) { |
| | | //判断当前公司是否添加过该快车车型价格配置 |
| | | //判断当前公司是否添加过该专车车型价格配置 |
| | | int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() |
| | | .eq("type", 1) |
| | | .eq("serverCarModelId", tSystemPrice.getServerCarModelId()) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改快车价格设置 |
| | | * 修改专车价格设置 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TSystemPrice tSystemPrice) { |
| | | TSystemPrice obj = tSystemPriceService.selectById(tSystemPrice.getId()); |
| | | if (obj.getServerCarModelId() != tSystemPrice.getServerCarModelId()){ |
| | | //判断当前公司是否添加过该快车车型价格配置 |
| | | //判断当前公司是否添加过该专车车型价格配置 |
| | | int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() |
| | | .eq("type", 1) |
| | | .eq("serverCarModelId", tSystemPrice.getServerCarModelId()) |