| | |
| | | */ |
| | | @RequestMapping("/small") |
| | | public String small(Model model) { |
| | | //跨城小件物流 |
| | | TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | if (SinataUtil.isNotEmpty(one)){ |
| | | JSONObject json1 = JSONObject.fromObject(one.getContent()); |
| | | model.addAttribute("json1",json1); |
| | | } |
| | | //同城小件物流 |
| | | TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | if (SinataUtil.isNotEmpty(two)){ |
| | | JSONObject json2 = JSONObject.fromObject(two.getContent()); |
| | | model.addAttribute("json2",json2); |
| | | } |
| | | return PREFIX + "small.html"; |
| | | // //跨城小件物流 |
| | | // TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | // if (SinataUtil.isNotEmpty(one)){ |
| | | // JSONObject json1 = JSONObject.fromObject(one.getContent()); |
| | | // model.addAttribute("json1",json1); |
| | | // } |
| | | // //同城小件物流 |
| | | // TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | // if (SinataUtil.isNotEmpty(two)){ |
| | | // JSONObject json2 = JSONObject.fromObject(two.getContent()); |
| | | // model.addAttribute("json2",json2); |
| | | // } |
| | | // return PREFIX + "small.html"; |
| | | return PREFIX + "tSmall.html"; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | model.addAttribute("modelList",serverCarmodels); |
| | | return PREFIX + "tSystemPrice_add.html"; |
| | | } |
| | | |
| | | @RequestMapping("/tSmallPrice_add") |
| | | public String tSmallPriceAdd(Model model) { |
| | | //查询所有专车车型 |
| | | Integer objectId = ShiroKit.getUser().getObjectId(); |
| | | List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", objectId).ne("state", 3)); |
| | | List<TServerCarmodel> modelList = tServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("isPackage", 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()){ |
| | | b = false; |
| | | break; |
| | | } |
| | | } |
| | | if(b){ |
| | | serverCarmodels.add(tsc); |
| | | } |
| | | } |
| | | model.addAttribute("modelList",serverCarmodels); |
| | | return PREFIX + "tSmallPrice_add.html"; |
| | | } |
| | | |
| | | /** |
| | |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | @RequestMapping(value = "/listSmall") |
| | | @ResponseBody |
| | | public Object listSmall(String name,Integer state) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tSystemPriceService.getSpecialPriceList(page,ShiroKit.getUser().getObjectId(),name,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增专车价格设置 |
| | | */ |
| | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | @RequestMapping(value = "/smalladd") |
| | | @ResponseBody |
| | | public Object smalladd(TSystemPrice tSystemPrice) { |
| | | //判断当前公司是否添加过该专车车型价格配置 |
| | | int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() |
| | | .eq("type", 1) |
| | | .eq("serverCarModelId", tSystemPrice.getServerCarModelId()) |
| | | .eq("companyId",ShiroKit.getUser().getObjectId()) |
| | | .last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); |
| | | return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择"); |
| | | } |
| | | tSystemPrice.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | tSystemPrice.setType(4); |
| | | tSystemPrice.setState(1); |
| | | tSystemPriceService.insert(tSystemPrice); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改专车价格设置 |
| | | */ |
| | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | @RequestMapping(value = "/smallupdate") |
| | | @ResponseBody |
| | | public Object smallupdate(TSystemPrice tSystemPrice) { |
| | | TSystemPrice obj = tSystemPriceService.selectById(tSystemPrice.getId()); |
| | | if (obj.getServerCarModelId() != tSystemPrice.getServerCarModelId()){ |
| | | //判断当前公司是否添加过该专车车型价格配置 |
| | | int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() |
| | | .eq("isPackage", 1) |
| | | .eq("serverCarModelId", tSystemPrice.getServerCarModelId()) |
| | | .eq("companyId",ShiroKit.getUser().getObjectId()) |
| | | .last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); |
| | | return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择"); |
| | | } |
| | | } |
| | | tSystemPriceService.updateById(tSystemPrice); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改状态 |
| | | */ |