| | |
| | | SpringApplication.run(GunsApplication.class, args); |
| | | logger.info("GunsApplication is success!"); |
| | | |
| | | GDFalconUtil gdFalconUtil = new GDFalconUtil(); |
| | | gdFalconUtil.init();//初始化猎鹰服务 |
| | | // GDFalconUtil gdFalconUtil = new GDFalconUtil(); |
| | | // gdFalconUtil.init();//初始化猎鹰服务 |
| | | } |
| | | |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(phone); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(phone); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | <artifactId>dom4j</artifactId> |
| | | <version>1.6.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-mongodb</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | <!--引入本地工行支付jar start--> |
| | |
| | | TReassign tReassign = tReassignService.selectById(tReassignId); |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | if (1 == optType){ |
| | | //增加推送 |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("id", tReassignId.toString()); |
| | | map.put("uid", ShiroKit.getUser().getId().toString()); |
| | | String result = HttpRequestUtil.postRequest(PushURL.refuseReassign, map); |
| | | System.out.println("拒绝改派调用接口:"+result); |
| | | tReassign.setState(5); |
| | | tReassign.setReviewer(user.getId()); |
| | | tReassign.setReviewerType(2); |
| | | tReassignService.updateById(tReassign); |
| | | |
| | | //还原订单状态 |
| | | TOrderCrossCity tOrderCrossCity = itOrderCrossCityService.selectById(tReassign.getOrderId()); |
| | | tOrderCrossCity.setState(tOrderCrossCity.getOldState()); |
| | | itOrderCrossCityService.updateById(tOrderCrossCity); |
| | | |
| | | }else if (2 == optType){ |
| | | tReassign.setState(4); |
| | | tReassign.setReviewer(user.getId()); |
| | |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.IdGenerator; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TDriverLine; |
| | |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import com.stylefeng.guns.modular.system.util.model.GeoFencingPolygon; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.data.geo.Point; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPolygon;import org.springframework.data.mongodb.core.query.Criteria;import org.springframework.data.mongodb.core.query.Query;import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | |
| | | @Controller |
| | | @RequestMapping("/tSite") |
| | | public class TSiteController extends BaseController { |
| | | |
| | | |
| | | private String PREFIX = "/system/tSite/"; |
| | | |
| | | |
| | | @Autowired |
| | | private ITSiteService tSiteService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITLocationService itLocationService; |
| | | |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | /** |
| | | * 跳转到跨城站点管理首页 |
| | | */ |
| | |
| | | public String index() { |
| | | return PREFIX + "tSite.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到添加跨城站点管理 |
| | | */ |
| | |
| | | public String tSiteAdd(Model model) { |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | model.addAttribute("provinceList", provinceList); |
| | | return PREFIX + "tSite_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改跨城站点管理 |
| | | */ |
| | | @RequestMapping("/tSite_update/{tSiteId}") |
| | | public String tSiteUpdate(@PathVariable Integer tSiteId, Model model) { |
| | | TSite tSite = tSiteService.selectById(tSiteId); |
| | | model.addAttribute("item",tSite); |
| | | model.addAttribute("item", tSite); |
| | | LogObjectHolder.me().set(tSite); |
| | | |
| | | |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | |
| | | model.addAttribute("provinceList", provinceList); |
| | | |
| | | TRegion province = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tSite.getProvinceCode())); |
| | | //市 |
| | | List<TRegion> cityList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", province.getId())); |
| | | model.addAttribute("cityList",cityList); |
| | | |
| | | if (SinataUtil.isNotEmpty(tSite.getCityCode())){ |
| | | model.addAttribute("cityList", cityList); |
| | | |
| | | if (SinataUtil.isNotEmpty(tSite.getCityCode())) { |
| | | TRegion city = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tSite.getCityCode())); |
| | | //区 |
| | | List<TRegion> areaList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", city.getId())); |
| | | model.addAttribute("areaList",areaList); |
| | | }else{ |
| | | model.addAttribute("areaList",null); |
| | | model.addAttribute("areaList", areaList); |
| | | } else { |
| | | model.addAttribute("areaList", new ArrayList<>()); |
| | | } |
| | | |
| | | if (SinataUtil.isNotEmpty(tSite.getDistrictCode())) { |
| | | TRegion area = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tSite.getDistrictCode())); |
| | | //乡镇街道 |
| | | List<TRegion> townList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", area.getId())); |
| | | model.addAttribute("townList", townList); |
| | | } else { |
| | | model.addAttribute("townList", new ArrayList<>()); |
| | | } |
| | | //查询所有的站点区域 |
| | | List<TLocation> locationList = itLocationService.selectList(new EntityWrapper<TLocation>().eq("siteId", tSite.getId()).ne("state", 3)); |
| | | model.addAttribute("locationList",locationList); |
| | | model.addAttribute("disabled","disabled"); |
| | | |
| | | Integer type = itLocationService.selectList(new EntityWrapper<TLocation>().eq("siteId", tSite.getId())).get(0).getType(); |
| | | model.addAttribute("type1", type == 1 ? "block" : "none"); |
| | | model.addAttribute("type2", type == 1 ? "none" : "block"); |
| | | model.addAttribute("checked1", type == 1 ? "checked" : ""); |
| | | model.addAttribute("checked2", type == 1 ? "" : "checked"); |
| | | model.addAttribute("locationList", locationList); |
| | | model.addAttribute("locationList1", JSON.toJSONString(locationList)); |
| | | model.addAttribute("disabled", "disabled"); |
| | | |
| | | if (CollectionUtils.isNotEmpty(locationList)) { |
| | | Integer type = locationList.get(0).getType(); |
| | | model.addAttribute("type1", type == 1 ? "block" : "none"); |
| | | model.addAttribute("type2", type == 1 ? "none" : "block"); |
| | | model.addAttribute("checked1", type == 1 ? "checked" : ""); |
| | | model.addAttribute("checked2", type == 1 ? "" : "checked"); |
| | | } |
| | | return PREFIX + "tSite_edit.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取跨城站点管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String name,String insertUser,String city,Integer state) { |
| | | public Object list(String insertTime, String name, String insertUser, String city, Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | | if (SinataUtil.isNotEmpty(insertTime)) { |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tSiteService.getSiteList(page,beginTime,endTime,name,insertUser,city,state)); |
| | | if (ShiroKit.getUser().getRoleType() != 1) { |
| | | if (ShiroKit.getUser().getRoleType() == 2){ |
| | | page.setRecords(tSiteService.getCompanySiteList(page, beginTime, endTime, name, insertUser, city, state,ShiroKit.getUser().getId())); |
| | | } |
| | | } else { |
| | | page.setRecords(tSiteService.getSiteList(page, beginTime, endTime, name, insertUser, city, state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增跨城站点管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TSite tSite,@RequestParam String subArr) { |
| | | public Object add(TSite tSite, @RequestParam String subArr) { |
| | | tSite.setInsertTime(new Date()); |
| | | tSite.setInsertUserId(ShiroKit.getUser().getId()); |
| | | tSite.setState(1); |
| | | tSiteService.insert(tSite); |
| | | |
| | | |
| | | //添加站点区域 |
| | | addLocation(subArr,tSite.getId()); |
| | | addLocation(subArr, tSite.getId()); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加站点区域 |
| | | * |
| | | * @param subArr |
| | | * @param id |
| | | */ |
| | | public void addLocation(String subArr,Integer id){ |
| | | public void addLocation(String subArr, Integer id) { |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++){ |
| | | for (int i = 0; i < size; i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TLocation location = new TLocation(); |
| | | location.setSiteId(id); |
| | |
| | | location.setUpdateTime(new Date()); |
| | | Integer type = jsonObject.getInteger("areaType"); |
| | | location.setType(type); |
| | | if (1 == type){ |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("provinceCode"))){ |
| | | if (1 == type) { |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("provinceCode"))) { |
| | | location.setProvince(jsonObject.getString("province")); |
| | | location.setProvinceCode(jsonObject.getString("provinceCode")); |
| | | } |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("cityCode"))){ |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("cityCode"))) { |
| | | location.setCity(jsonObject.getString("city")); |
| | | location.setCityCode(jsonObject.getString("cityCode")); |
| | | } |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("districtCode"))){ |
| | | if (SinataUtil.isNotEmpty(jsonObject.getString("districtCode"))) { |
| | | location.setDistrict(jsonObject.getString("district")); |
| | | location.setDistrictCode(jsonObject.getString("districtCode")); |
| | | } |
| | | }else if (2 == type){ |
| | | } else if (2 == type) { |
| | | String coordinate = jsonObject.getString("coordinate"); |
| | | coordinate = coordinate.substring(0, coordinate.length() - 1); |
| | | location.setCoordinate(coordinate); |
| | | //将电子围栏坐标信息存储到MongoDB |
| | | GeoFencingPolygon gfp = new GeoFencingPolygon(); |
| | | gfp.setId(IdGenerator.getId()); |
| | | gfp.setSiteId(id); |
| | | gfp.setName(jsonObject.getString("name")); |
| | | String[] split = coordinate.split(";"); |
| | | List<Point> points = new ArrayList<>(); |
| | | for (String s : split) { |
| | | String[] str = s.split(","); |
| | | Point point = new Point(Double.parseDouble(str[0]), Double.parseDouble(str[1])); |
| | | points.add(point); |
| | | } |
| | | //最后一个点要和第一个点相同 |
| | | points.add(new Point(points.get(0).getX(), points.get(0).getY())); |
| | | gfp.setGeoJsonPolygon(new GeoJsonPolygon(points)); |
| | | mongoTemplate.save(gfp); |
| | | } |
| | | itLocationService.insert(location); |
| | | |
| | | if(type == 2){ |
| | | List<String> fence = gdMapElectricFenceUtil.createFence(location.getId().toString(), location.getCoordinate()); |
| | | TLocation location1 = itLocationService.selectById(location.getId()); |
| | | String s = ""; |
| | | for(String gid : fence){ |
| | | s += gid + "_"; |
| | | } |
| | | location1.setGid(s.substring(0, s.length() - 1)); |
| | | location1.setUpdateTime(new Date()); |
| | | itLocationService.updateById(location1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 操作跨城站点管理 |
| | | * optType 1=删除 2=冻结 3=解冻 |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object opt(@RequestParam Integer tSiteId,@RequestParam Integer optType) { |
| | | public Object opt(@RequestParam Integer tSiteId, @RequestParam Integer optType) { |
| | | TSite tSite = tSiteService.selectById(tSiteId); |
| | | if (1 == optType){ |
| | | if (1 == optType) { |
| | | tSite.setState(3); |
| | | }else if (2 == optType){ |
| | | //删除mongoDB的区域信息 |
| | | Criteria criteria =Criteria.where("siteId").is(tSite.getId()); |
| | | Query query = new Query(criteria); |
| | | mongoTemplate.remove(query,GeoFencingPolygon.class); |
| | | } else if (2 == optType) { |
| | | tSite.setState(2); |
| | | }else if (3 == optType){ |
| | | } else if (3 == optType) { |
| | | tSite.setState(1); |
| | | } |
| | | tSiteService.updateById(tSite); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改跨城站点管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TSite tSite,@RequestParam String subArr) { |
| | | public Object update(TSite tSite, @RequestParam String subArr) { |
| | | tSiteService.updateById(tSite); |
| | | |
| | | |
| | | //删除站点区域 |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | //查询站点对应区域数据 |
| | | List<TLocation> siteId = itLocationService.selectList(new EntityWrapper<TLocation>().eq("siteId", tSite.getId())); |
| | | List<TLocation> del = new ArrayList<>(); |
| | | List<Object> add = new ArrayList<>(); |
| | | for(TLocation location : siteId){ |
| | | //遍历区域数据 |
| | | for (TLocation location : siteId) { |
| | | boolean b = true; |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | | if(jsonArray.getJSONObject(i).getIntValue("id") == location.getId()){ |
| | | b = false; |
| | | } |
| | | } |
| | | if(b){ |
| | | if (b) { |
| | | del.add(location); |
| | | continue; |
| | | } |
| | | } |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | | if(jsonArray.getJSONObject(i).getInteger("id") == null){ |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | if (jsonArray.getJSONObject(i).getInteger("id") == null) { |
| | | add.add(jsonArray.get(i)); |
| | | } |
| | | } |
| | | for(TLocation location : del){ |
| | | if(location.getType() == 2){ |
| | | String[] s = location.getGid().split("_"); |
| | | for(String gid : s){ |
| | | gdMapElectricFenceUtil.deleteElectricFenc(gid); |
| | | } |
| | | for (TLocation location : del) { |
| | | if (location.getType() == 2) { |
| | | //删除mongoDB的区域信息 |
| | | Criteria criteria =Criteria.where("siteId").is(tSite.getId()); |
| | | Query query = new Query(criteria); |
| | | mongoTemplate.remove(query,GeoFencingPolygon.class); |
| | | } |
| | | itLocationService.deleteById(location.getId()); |
| | | } |
| | | |
| | | |
| | | //添加站点区域 |
| | | addLocation(JSON.toJSONString(add),tSite.getId()); |
| | | addLocation(JSON.toJSONString(add), tSite.getId()); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跨城站点管理详情 |
| | | */ |
| | |
| | | * @since 2020-09-04 |
| | | */ |
| | | public interface TSiteMapper extends BaseMapper<TSite> { |
| | | |
| | | |
| | | /** |
| | | * 根据条件查询站点列表 |
| | | * @return |
| | |
| | | @Param("insertUser") String insertUser, |
| | | @Param("city") String city, |
| | | @Param("state") Integer state); |
| | | |
| | | |
| | | |
| | | |
| | | List<TSite> query(@Param("provinceCode") String provinceCode, @Param("cityCode")String cityCode, |
| | | @Param("districtCode")String districtCode); |
| | | @Param("districtCode")String districtCode); |
| | | |
| | | List<Map<String, Object>> getCompanySiteList(@Param("page") Page<Map<String, Object>> page, |
| | | @Param("beginTime") String beginTime, |
| | | @Param("endTime") String endTime, |
| | | @Param("name") String name, |
| | | @Param("insertUser") String insertUser, |
| | | @Param("city") String city, |
| | | @Param("state") Integer state,@Param("id") Integer id); |
| | | } |
| | |
| | | LEFT JOIN t_car_brand as cb on cb.id = ci.carBrandId |
| | | LEFT JOIN t_company as cc on cc.id = ot.companyId |
| | | LEFT JOIN t_server_carmodel as sc on sc.id = ot.serverCarModelId |
| | | LEFT JOIN (SELECT ii.money,ii.incomeId,cc.type FROM t_income as ii |
| | | LEFT JOIN t_company as cc on ii.objectId = cc.id |
| | | where ii.userType = 1 and ii.type = 2 and ii.orderType = 1 GROUP BY ii.incomeId) as income1 on income1.incomeId = ot.id |
| | | LEFT JOIN (SELECT * FROM t_income where userType = 2 and type = 2 and orderType = 1 GROUP BY incomeId) as income2 on income2.incomeId = ot.id |
| | | LEFT JOIN (SELECT sum(ii.money) as money,ii.incomeId,cc.type FROM t_income as ii |
| | | LEFT JOIN t_company as cc on ii.objectId = cc.id |
| | | where ii.userType = 1 and ii.type = 2 and ii.orderType = 1 GROUP BY ii.incomeId,cc.type) as income1 on income1.incomeId = ot.id |
| | | LEFT JOIN (SELECT sum(money) as money,incomeId FROM t_income where userType = 2 and type = 2 and orderType = 1 GROUP BY incomeId) as income2 on income2.incomeId = ot.id |
| | | where ot.id = #{orderId} |
| | | </select> |
| | | |
| | |
| | | </where> |
| | | order by o.id desc |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="query" resultType="TSite"> |
| | | select |
| | | id as id, |
| | |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | <select id="getCompanySiteList" resultType="java.util.Map"> |
| | | SELECT * FROM (SELECT uu.`name` as insertUser,IFNULL(ls.num,0) as lineNum,ss.* FROM t_site as ss |
| | | RIGHT JOIN (select * from sys_user where id=#{id}) as uu on uu.id = ss.insertUserId |
| | | LEFT JOIN (SELECT COUNT(a.id) as num,siteId FROM t_line_site a left join t_line b on (a.lineId = b.id) where b.state != 3 GROUP BY a.siteId) as ls on ls.siteId = ss.id) as o |
| | | <where> |
| | | o.state != 3 |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND (o.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and o.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="insertUser != null and insertUser != ''"> |
| | | and o.insertUser LIKE CONCAT('%',#{insertUser},'%') |
| | | </if> |
| | | <if test="city != null and city != ''"> |
| | | and (o.province LIKE CONCAT('%',#{city},'%') or o.city LIKE CONCAT('%',#{city},'%') or o.district LIKE CONCAT('%',#{city},'%')) |
| | | </if> |
| | | <if test="state != null and state != ''"> |
| | | and o.state = #{state} |
| | | </if> |
| | | </where> |
| | | order by o.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="getUserDetailById" resultType="java.util.Map"> |
| | | SELECT DATE_FORMAT(ui.insertTime,'%Y-%m-%d %H:%i') as insertTimeStr,ci.`name` as companyName, |
| | | case when ui.isAuth = 1 then '否' else '是' end as isAuthStr, |
| | | IFNULL(0,0) as zcNum, |
| | | IFNULL(ot.num,0) as czNum, |
| | | IFNULL(0,0) as kcNum, |
| | | IFNULL(0,0) as wlNum, |
| | | IFNULL(op.num,0) as zcNum, |
| | | IFNULL(0,0) as czNum, |
| | | IFNULL(oc.num,0) as kcNum, |
| | | IFNULL(ol.num,0) as wlNum, |
| | | IFNULL(td.num,0) as consumptionNum, |
| | | IFNULL(ui.balance,0) as balanceStr, |
| | | ui.* from t_user as ui |
| | | LEFT JOIN (select * from t_company where flag != 3) as ci on ci.id = ui.companyId |
| | | LEFT JOIN (SELECT sum(money) as num,userId from t_pub_transaction_details where userType = 1 and type = 1 and state = 2 GROUP BY userId) as td on td.userId = ui.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_taxi where FIND_IN_SET(state,'8,9') GROUP BY userId) as ot on ot.userId = ui.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_private_car where FIND_IN_SET(state,'8,9') GROUP BY userId) as op on op.userId = ui.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_cross_city where FIND_IN_SET(state,'8,9') GROUP BY userId) as oc on oc.userId = ui.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_logistics where FIND_IN_SET(state,'6') GROUP BY userId) as ol on ol.userId = ui.id |
| | | where ui.id = #{userId} |
| | | </select> |
| | | |
| | |
| | | * @since 2020-09-04 |
| | | */ |
| | | public interface ITSiteService extends IService<TSite> { |
| | | |
| | | |
| | | /** |
| | | * 根据条件查询站点列表 |
| | | * @return |
| | |
| | | @Param("insertUser") String insertUser, |
| | | @Param("city") String city, |
| | | @Param("state") Integer state); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | List<TSite> query(@Param("provinceCode") String provinceCode, @Param("cityCode")String cityCode, |
| | | @Param("districtCode")String districtCode); |
| | | @Param("districtCode")String districtCode); |
| | | |
| | | List<Map<String, Object>> getCompanySiteList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, String insertUser, String city, Integer state, Integer id); |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private TSiteMapper siteMapper; |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getSiteList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, String insertUser, String city, Integer state) { |
| | | return this.baseMapper.getSiteList(page, beginTime, endTime, name, insertUser, city, state); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<TSite> query(String provinceCode, String cityCode, String districtCode) { |
| | | return siteMapper.query(provinceCode, cityCode, districtCode); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getCompanySiteList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, String insertUser, String city, Integer state, Integer id) { |
| | | return this.baseMapper.getCompanySiteList(page, beginTime, endTime, name, insertUser, city, state,id); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 每天的凌晨执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | public void taskDay(){ |
| | | try { |
| | | locationService.updateFence();//更新线上电子围栏 |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.model; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPolygon; |
| | | import org.springframework.data.mongodb.core.index.GeoSpatialIndexType; |
| | | import org.springframework.data.mongodb.core.index.GeoSpatialIndexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 地理围栏-多边形 |
| | | * @author zhibing.pu |
| | | * @date 2023/4/29 23:53 |
| | | */ |
| | | @Data |
| | | @Document(collection = "geo_fencing") |
| | | public class GeoFencingPolygon implements Serializable { |
| | | private static final long serialVersionUID = 4508868382007529971L; |
| | | |
| | | private String id; |
| | | /** |
| | | * 站点id |
| | | */ |
| | | private Integer siteId; |
| | | /** |
| | | * 站点名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 多边形经纬度 |
| | | */ |
| | | @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE) |
| | | private GeoJsonPolygon geoJsonPolygon; |
| | | |
| | | } |
| | |
| | | alipayPublicKey: 11 #应用公钥 |
| | | alipay_public_key: 111 #支付宝公钥 |
| | | |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | |
| | | |
| | | --- |
| | | filePath: /root/server/app/orderPostionFile/ #存储订单轨迹文件路径 |
| | | #filePath: C:/orderPostionFile/ #存储订单轨迹文件路径 |
| | |
| | | </div> |
| | | <#avatar id="imgUrl" name="封面:" /> |
| | | <#input id="title" name="标题"/> |
| | | <#select id="isBroadcast" name="是否播报:" > |
| | | <option value="">选择是否播报</option> |
| | | <option value="1">是</option> |
| | | <option value="2">否</option> |
| | | </#select> |
| | | <!-- <#select id="isBroadcast" name="是否播报:" >--> |
| | | <!-- <option value="">选择是否播报</option>--> |
| | | <!-- <option value="1">是</option>--> |
| | | <!-- <option value="2">否</option>--> |
| | | <!-- </#select>--> |
| | | <div class="form-group" id="contentDiv"> |
| | | <label class="col-sm-3 control-label">公告内容:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | <div class="col-sm-11"> |
| | | <#avatar id="imgUrl" name="封面:" avatarImg="${item.imgUrl}"/> |
| | | <#input id="title" name="标题" value="${item.title}"/> |
| | | <#select id="isBroadcast" name="是否播报:" > |
| | | <option value="">选择是否播报</option> |
| | | <option value="1" ${1 == item.isBroadcast ? 'selected=selected' : ''}>是</option> |
| | | <option value="2" ${2 == item.isBroadcast ? 'selected=selected' : ''}>否</option> |
| | | </#select> |
| | | <!-- <#select id="isBroadcast" name="是否播报:" >--> |
| | | <!-- <option value="">选择是否播报</option>--> |
| | | <!-- <option value="1" ${1 == item.isBroadcast ? 'selected=selected' : ''}>是</option>--> |
| | | <!-- <option value="2" ${2 == item.isBroadcast ? 'selected=selected' : ''}>否</option>--> |
| | | <!-- </#select>--> |
| | | <div class="form-group" id="contentDiv"> |
| | | <label class="col-sm-3 control-label">公告内容:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | @if(isNotEmpty(item.orderMoney) && item.orderMoney > 0){ |
| | | <div class="col-sm-6 b-r"> |
| | | <#label id="orderMoney" name="订单总价" value="${item.orderMoney}元"/> |
| | | <#label id="couponMoney" name="优惠券抵扣费用" value="${item.couponMoney}元"/> |
| | | @if(isNotEmpty(item.couponMoney)){ |
| | | <#label id="couponMoney" name="优惠券抵扣费用" value="${item.couponMoney}元"/> |
| | | @}else{ |
| | | <#label id="couponMoney" name="优惠券抵扣费用" value="0.00元"/> |
| | | @} |
| | | @if(isNotEmpty(item.discountMoney)){ |
| | | <#label id="couponMoney" name="活动优惠金额" value="${item.discountMoney}元"/> |
| | | @}else{ |
| | | <#label id="couponMoney" name="活动优惠金额" value="0.00元"/> |
| | | @} |
| | | @if(isNotEmpty(item.redPacketMoney)){ |
| | | <#label id="couponMoney" name="红包优惠" value="${item.redPacketMoney}元"/> |
| | | @}else{ |
| | | <#label id="couponMoney" name="红包优惠" value="0.00元"/> |
| | | @} |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | @if(isNotEmpty(item.payMoney)){ |
| | |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#label id="typeStr" name="订单类型" value="${item.typeStr}"/> |
| | | <#label id="orderNum" name="订单编号" value="${item.orderNum}"/> |
| | | <#label id="travelTimeStr" name="乘车时间" value="${item.travelTimeStr}"/> |
| | | <#label id="userPhone" name="下单用户手机号" value="${item.userPhone}"/> |
| | |
| | | <!--<input type="radio" name='func' value='polyline'><span class="input-text">画折线</span> --> |
| | | <input type="radio" name='func' value='polygon'><span class="input-text" style='width:5rem;'>画多边形</span> |
| | | <!--<input type="radio" name='func' value='rectangle'><span class="input-text" style='width:5rem;'>画矩形</span> --> |
| | | <input type="radio" name='func' value='circle'><span class="input-text" style='width:5rem;'>画圆</span> |
| | | <!-- <input type="radio" name='func' value='circle'><span class="input-text" style='width:5rem;'>画圆</span>--> |
| | | </div> |
| | | <div class="input-item"> |
| | | <input id="clear" type="button" class="btn" value="清除" /> |
| | |
| | | <!--<input type="radio" name='func' value='polyline'><span class="input-text">画折线</span> --> |
| | | <input type="radio" name='func' value='polygon'><span class="input-text" style='width:5rem;'>画多边形</span> |
| | | <!--<input type="radio" name='func' value='rectangle'><span class="input-text" style='width:5rem;'>画矩形</span> --> |
| | | <input type="radio" name='func' value='circle'><span class="input-text" style='width:5rem;'>画圆</span> |
| | | <!-- <input type="radio" name='func' value='circle'><span class="input-text" style='width:5rem;'>画圆</span>--> |
| | | </div> |
| | | <div class="input-item"> |
| | | <input id="clear" type="button" class="btn" value="清除" /> |
| | |
| | | <input type="radio" id="type2" value="2" name="type" > |
| | | <label for="type2"> 司机端 </label> |
| | | </div> |
| | | <div class="radio radio-primary radio-inline"> |
| | | <input type="radio" id="type3" value="3" name="type" > |
| | | <label for="type3"> 车载端 </label> |
| | | </div> |
| | | <div class="radio radio-primary radio-inline"> |
| | | <input type="radio" id="type4" value="4" name="type" > |
| | | <label for="type4"> 调度端 </label> |
| | | </div> |
| | | <!-- <div class="radio radio-primary radio-inline">--> |
| | | <!-- <input type="radio" id="type3" value="3" name="type" >--> |
| | | <!-- <label for="type3"> 车载端 </label>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="radio radio-primary radio-inline">--> |
| | | <!-- <input type="radio" id="type4" value="4" name="type" >--> |
| | | <!-- <label for="type4"> 调度端 </label>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | <div id="androidDiv"> |
| | |
| | | case 'circle':{//圆行 |
| | | var center = e.obj.getCenter(); |
| | | var radius = e.obj.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | coordinate = center.lng + ',' + center.lat + ';' + radius; |
| | | break; |
| | | } |
| | |
| | | Feng.error("请输入正确金额数!"); |
| | | return; |
| | | } |
| | | if (!re.test($("#num7").val())) { |
| | | Feng.error("请输入正确金额数!"); |
| | | return; |
| | | } |
| | | // if (!re.test($("#num7").val())) { |
| | | // Feng.error("请输入正确金额数!"); |
| | | // return; |
| | | // } |
| | | if (!re.test($("#num9").val())) { |
| | | Feng.error("请输入正确金额数!"); |
| | | return; |
| | |
| | | Feng.error("请输入正确小时数!"); |
| | | return; |
| | | } |
| | | if (!/^[1-9]\d*$/.test($("#num6").val())) { |
| | | Feng.error("请输入正确小时数!"); |
| | | return; |
| | | } |
| | | // if (!/^[1-9]\d*$/.test($("#num6").val())) { |
| | | // Feng.error("请输入正确小时数!"); |
| | | // return; |
| | | // } |
| | | if (!/^[1-9]\d*$/.test($("#num8").val())) { |
| | | Feng.error("请输入正确小时数!"); |
| | | return; |
| | |
| | | ajax.set("num3",$("#num3").val()); |
| | | ajax.set("num4",$("#num4").val()); |
| | | ajax.set("num5",$("#num5").val()); |
| | | ajax.set("num6",$("#num6").val()); |
| | | ajax.set("num7",$("#num7").val()); |
| | | ajax.set("num6",0); |
| | | ajax.set("num7",0); |
| | | ajax.set("num8",$("#num8").val()); |
| | | ajax.set("num9",$("#num9").val()); |
| | | ajax.set("num10",$("#num10").val()); |
| | |
| | | Feng.error("请输入正确金额数!"); |
| | | return; |
| | | } |
| | | if (!re.test($("#num7").val())) { |
| | | Feng.error("请输入正确金额数!"); |
| | | return; |
| | | } |
| | | // if (!re.test($("#num7").val())) { |
| | | // Feng.error("请输入正确金额数!"); |
| | | // return; |
| | | // } |
| | | if (!re.test($("#num9").val())) { |
| | | Feng.error("请输入正确金额数!"); |
| | | return; |
| | |
| | | Feng.error("请输入正确小时数!"); |
| | | return; |
| | | } |
| | | if (!/^[1-9]\d*$/.test($("#num6").val())) { |
| | | Feng.error("请输入正确小时数!"); |
| | | return; |
| | | } |
| | | // if (!/^[1-9]\d*$/.test($("#num6").val())) { |
| | | // Feng.error("请输入正确小时数!"); |
| | | // return; |
| | | // } |
| | | if (!/^[1-9]\d*$/.test($("#num8").val())) { |
| | | Feng.error("请输入正确小时数!"); |
| | | return; |
| | |
| | | ajax.set("num3",$("#num3").val()); |
| | | ajax.set("num4",$("#num4").val()); |
| | | ajax.set("num5",$("#num5").val()); |
| | | ajax.set("num6",$("#num6").val()); |
| | | ajax.set("num7",$("#num7").val()); |
| | | ajax.set("num6",0); |
| | | ajax.set("num7",0); |
| | | ajax.set("num8",$("#num8").val()); |
| | | ajax.set("num9",$("#num9").val()); |
| | | ajax.set("num10",$("#num10").val()); |
| | |
| | | } |
| | | } |
| | | }, |
| | | isBroadcast: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '选择是否播报' |
| | | } |
| | | } |
| | | }, |
| | | // isBroadcast: { |
| | | // validators: { |
| | | // notEmpty: { |
| | | // message: '选择是否播报' |
| | | // } |
| | | // } |
| | | // }, |
| | | isShow: { |
| | | validators: { |
| | | notEmpty: { |
| | |
| | | .set('title') |
| | | .set('sort') |
| | | .set('isShow') |
| | | .set('isBroadcast') |
| | | // .set('isBroadcast') |
| | | .set('type') |
| | | .set('imgUrl') |
| | | .set('flag') |
| | |
| | | case 'circle':{//圆形 |
| | | var center = e.obj.getCenter(); |
| | | var radius = e.obj.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | coordinate += center.lng + ',' + center.lat + ';' + radius + "_"; |
| | | objs.circle.push(e.obj); |
| | | break; |
| | |
| | | |
| | | circleEditor.on('adjust', function(e) { |
| | | var radius = e.target.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | }) |
| | | |
| | | circleEditor.on('end', function(e) { |
| | |
| | | <artifactId>geodesy</artifactId> |
| | | <version>1.1.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-mongodb</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | |
| | | <!--引入本地工行支付jar start--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>com.icbc</groupId>--> |
| | |
| | | left join t_car_model f on (d.carModelId = f.id) |
| | | left join t_car_service g on (d.id = g.carId and g.`type` = 3) |
| | | left join t_line_price h on (g.serverCarModelId = h.serverCarModelId and a.lineId = h.lineId) |
| | | where 1 = 1 |
| | | where b.driverId in (select driverId from t_driver_work where state = 1 and type like '%3%') |
| | | <if test="null != lineId"> |
| | | and a.lineId = #{lineId} |
| | | </if> |
| | |
| | | orderCrossCity.setRemark(orderCrossCityWarpper.getRemark()); |
| | | orderCrossCity.setIsReassign(1); |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderCrossCity.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderCrossCity.setTrackId(track); |
| | | if(orderCrossCity.getTravelMode() == 2){//包车 |
| | | orderCrossCity.setSeatNumber(lineShiftDriver.getLaveSeatNumber()); |
| | | orderCrossCity.setPeopleNumber(lineShiftDriver.getLaveSeat()); |
| | |
| | | import com.stylefeng.guns.modular.crossCity.server.ISiteService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.SiteWarpper; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.model.GeoFencingPolygon; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | |
| | | @Resource |
| | | private LocationMapper locationMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | if(Integer.valueOf(map.get("type").toString()) == 2){//电子围栏 |
| | | String gid = map.get("gid").toString(); |
| | | List<String> list1 = gdMapElectricFenceUtil.monitorElectricFenc("", lonLat); |
| | | if(list1.contains(gid)){ |
| | | String[] split = lonLat.split(","); |
| | | GeoJsonPoint point = new GeoJsonPoint(Double.valueOf(split[0]), Double.valueOf(split[1])); |
| | | Query query = Query.query(Criteria.where("geoJsonPolygon").intersects(point)); |
| | | List<GeoFencingPolygon> geoFencingPolygons = mongoTemplate.find(query, GeoFencingPolygon.class); |
| | | List<Integer> s_sites = geoFencingPolygons.stream().map(GeoFencingPolygon::getSiteId).collect(Collectors.toList()); |
| | | if(s_sites.contains(siteId)){ |
| | | return true; |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | return false; |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SysIntegralMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Autowired |
| | | private IUserRedPacketRecordService userRedPacketRecordService; |
| | | |
| | | @Resource |
| | | private UserActivityDiscount1Mapper userActivityDiscount1Mapper; |
| | | |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | |
| | | if(dist.compareTo(jsonObject.getDouble("num20")) >= 0 && dist.compareTo(jsonObject.getDouble("num21")) < 0){ |
| | | price2 = jsonObject.getDouble("num22"); |
| | | } |
| | | if(dist.compareTo(jsonObject.getDouble("num10")) >= 0){ |
| | | price1 = jsonObject.getDouble("num11"); |
| | | } |
| | | if(dist.compareTo(jsonObject.getDouble("num21")) >= 0){ |
| | | price2 = jsonObject.getDouble("num22"); |
| | | } |
| | | }else{ |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | String content = String.valueOf(query1.get("content")); |
| | |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | orderLogistics.setCouponMoney(0D);//初始化历史数据 |
| | | orderLogistics.setCouponId(null); |
| | | |
| | | //计算折扣 |
| | | UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderLogistics.getCompanyId()); |
| | | if(null != query2){ |
| | | Double special = query2.getLogistics(); |
| | | orderLogistics.setDiscount(special); |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | if(orderMoney.compareTo(v) > 0){ |
| | | orderLogistics.setDiscountMoney(orderMoney - v); |
| | | orderLogistics.setActivityId(query2.getId()); |
| | | orderMoney = v; |
| | | } |
| | | } |
| | | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | |
| | | if(null == orderLogistics){ |
| | | return ResultUtil.error("取消订单失败,订单信息有误"); |
| | | } |
| | | if(orderLogistics.getState() > 5 && orderLogistics.getState() != 7 && orderLogistics.getState() != 8 && orderLogistics.getState() != 11){ |
| | | if(orderLogistics.getState() >= 5 && orderLogistics.getState() != 7 && orderLogistics.getState() != 8 && orderLogistics.getState() != 11){ |
| | | return ResultUtil.error("取消订单失败,不合法的操作"); |
| | | } |
| | | |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | orderPrivateCar.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderPrivateCar.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderPrivateCar.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | OrderServerWarpper orderServerWarpper = new OrderServerWarpper(); |
| | | orderServerWarpper.setOrderId(orderPrivateCar.getId()); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | orderServerWarpper.setReservationMileage("0"); |
| | | orderServerWarpper.setReservationTime("0"); |
| | |
| | | a.headImgUrl as avatar, |
| | | a.phone as phone, |
| | | c.carLicensePlate as carCode, |
| | | CONCAT(F.`name`, d.`name`, '.', c.carColor) as carName, |
| | | CONCAT(f.`name`, d.`name`, '.', c.carColor) as carName, |
| | | (select sum(fraction) / count(id) from t_order_evaluate where driverId = a.id) as score, |
| | | ( |
| | | (select count(id) from t_order_private_car where state in (7, 8, 9) and driverId = a.id) + |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.model; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPolygon; |
| | | import org.springframework.data.mongodb.core.index.GeoSpatialIndexType; |
| | | import org.springframework.data.mongodb.core.index.GeoSpatialIndexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 地理围栏-多边形 |
| | | * @author zhibing.pu |
| | | * @date 2023/4/29 23:53 |
| | | */ |
| | | @Data |
| | | @Document(collection = "geo_fencing") |
| | | public class GeoFencingPolygon implements Serializable { |
| | | private static final long serialVersionUID = 4508868382007529971L; |
| | | |
| | | private String id; |
| | | /** |
| | | * 站点id |
| | | */ |
| | | private Integer siteId; |
| | | /** |
| | | * 站点名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 多边形经纬度 |
| | | */ |
| | | @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE) |
| | | private GeoJsonPolygon geoJsonPolygon; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GeoJson { |
| | | private String type; |
| | | private Double[] coordinates; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class LocationQuery { |
| | | /** |
| | | * 当前经纬度[xxx,xxx] |
| | | **/ |
| | | private Double[] coordinates; |
| | | /** |
| | | * 距离,如:200,500,1,3,5,10,20 |
| | | **/ |
| | | private Double distance; |
| | | /** |
| | | * 距离单位,如:m,km |
| | | **/ |
| | | private String unit; |
| | | /** |
| | | * 位置类型:1-景点,2-加油站,3-酒店 |
| | | **/ |
| | | private Integer type; |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | |
| | | orderTaxi.setState(2);//待出发 |
| | | orderTaxi.setSnatchOrderTime(new Date()); |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderTaxi.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderTaxi.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | OrderServerWarpper orderServerWarpper = new OrderServerWarpper(); |
| | | orderServerWarpper.setOrderId(orderTaxi.getId()); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | orderServerWarpper.setReservationMileage("0"); |
| | | orderServerWarpper.setReservationTime("0"); |
| | |
| | | dataSourceNames: |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | --- |
| | | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | --- |
| | | |
| | | |