| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | |
| | | @RequestMapping("/small") |
| | | public String small(Model model) { |
| | | //跨城小件物流 |
| | | TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", ShiroKit.getUser().getObjectId()).eq("state", 1)); |
| | | TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("state", 1)); |
| | | 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()).eq("state", 1)); |
| | | TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("state", 1)); |
| | | if (SinataUtil.isNotEmpty(two)){ |
| | | JSONObject json2 = JSONObject.fromObject(two.getContent()); |
| | | model.addAttribute("json2",json2); |
| | |
| | | |
| | | @RequestMapping("/taxi") |
| | | public String taxi(Model model) { |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 2).eq("companyId",id)); |
| | | Integer id = ShiroExtUtil.getUser().getId(); |
| | | TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 2).eq("companyId", id)); |
| | | if (SinataUtil.isNotEmpty(one)){ |
| | | JSONObject json1 = JSONObject.fromObject(one.getContent()); |
| | | model.addAttribute("json",json1); |
| | |
| | | @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<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", ShiroExtUtil.getUser().getObjectId()).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){ |
| | |
| | | model.addAttribute("contentPrice",JSONObject.fromObject(tSystemPrice.getContentPrice())); |
| | | |
| | | //查询所有快车车型 |
| | | List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", ShiroKit.getUser().getObjectId()).ne("state", 3)); |
| | | List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", ShiroExtUtil.getUser().getObjectId()).ne("state", 3)); |
| | | List<TServerCarmodel> modelList = tServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1) |
| | | .notIn("id",tSystemPrices.stream().map(TSystemPrice::getServerCarModelId).collect(Collectors.toList()))); |
| | | .notIn("id", tSystemPrices.stream().map(TSystemPrice::getServerCarModelId).collect(Collectors.toList()))); |
| | | List<TServerCarmodel> serverCarmodels = new ArrayList<>(); |
| | | |
| | | modelList.add(tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId())); |
| | |
| | | @ResponseBody |
| | | public Object list(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)); |
| | | page.setRecords(tSystemPriceService.getSpecialPriceList(page, ShiroExtUtil.getUser().getObjectId(), name, state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() |
| | | .eq("type", 1) |
| | | .eq("serverCarModelId", tSystemPrice.getServerCarModelId()) |
| | | .eq("companyId",ShiroKit.getUser().getObjectId()) |
| | | .eq("companyId", ShiroExtUtil.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.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | tSystemPrice.setType(1); |
| | | tSystemPrice.setState(1); |
| | | tSystemPriceService.insert(tSystemPrice); |
| | |
| | | @RequestMapping(value = "/taxiSet") |
| | | @ResponseBody |
| | | public Object taxiSet(String content) { |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | TSystemPrice tSystemPrice1 = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 2).eq("companyId",id)); |
| | | Integer id = ShiroExtUtil.getUser().getId(); |
| | | TSystemPrice tSystemPrice1 = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 2).eq("companyId", id)); |
| | | if (tSystemPrice1==null) { |
| | | TSystemPrice tSystemPrice = new TSystemPrice(); |
| | | tSystemPrice.setContent(content); |
| | |
| | | int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() |
| | | .eq("type", 1) |
| | | .eq("serverCarModelId", tSystemPrice.getServerCarModelId()) |
| | | .eq("companyId",ShiroKit.getUser().getObjectId()) |
| | | .eq("companyId", ShiroExtUtil.getUser().getObjectId()) |
| | | .last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); |
| | |
| | | @ResponseBody |
| | | public Object smallSubmit(String json1,String json2) { |
| | | //跨城小件物流 |
| | | TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", ShiroExtUtil.getUser().getObjectId())); |
| | | if (SinataUtil.isNotEmpty(one)){ |
| | | one.setContent(json1); |
| | | tSystemPriceService.updateById(one); |
| | |
| | | one = new TSystemPrice(); |
| | | one.setState(1); |
| | | one.setType(5); |
| | | one.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | one.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | one.setContent(json1); |
| | | tSystemPriceService.insert(one); |
| | | } |
| | | //同城小件物流 |
| | | TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", ShiroExtUtil.getUser().getObjectId())); |
| | | if (SinataUtil.isNotEmpty(two)){ |
| | | two.setContent(json2); |
| | | tSystemPriceService.updateById(two); |
| | |
| | | two = new TSystemPrice(); |
| | | two.setState(1); |
| | | two.setType(4); |
| | | two.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | two.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | two.setContent(json2); |
| | | tSystemPriceService.insert(two); |
| | | } |