Merge remote-tracking branch 'origin/master'
# Conflicts:
# ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
# ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
| | |
| | | <artifactId>forest-spring-boot-starter</artifactId> |
| | | <version>1.5.28</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common</artifactId> |
| | | </dependency> |
| | | <!--lombokä¾èµ--> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.alarm.steal.domain.ArdAlarmStealelec; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | |
| | | import com.ruoyi.app.task.service.IArdAppTaskService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * appä»»å¡ç®¡çController |
| | |
| | | /** |
| | | * è·åappä»»å¡ç®¡ç详ç»ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("è·åappä»»å¡ç®¡ç详ç»ä¿¡æ¯(å¾ç)") |
| | | @ApiOperation("è·åappä»»å¡ç®¡ç详ç»ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('app:task:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfoWithPic(@PathVariable("id") String id) |
| | |
| | | * @param id appä»»å¡ç®¡çä¸»é® |
| | | * @return appä»»å¡ç®¡ç |
| | | */ |
| | | public ArdAppTask selectArdAppTaskById(String id); |
| | | public ArdAppTask selectArdAppTaskByIdWithPic(String id); |
| | | public ArdAppTask selectArdAppTaskByIdWithDetail(String id); |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public ArdAppTask selectArdAppTaskById(String id) { |
| | | ArdAppTask task = ardAppTaskMapper.selectArdAppTaskByIdWithPic(id); |
| | | ArdAppTask temp = ardAppTaskMapper.selectArdAppTaskByIdWithDetail(id); |
| | | task.setArdAppTaskDetailList(temp.getArdAppTaskDetailList()); |
| | | return task; |
| | | return ardAppTaskMapper.selectArdAppTaskById(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public int deleteArdAppTaskByIds(String[] ids) { |
| | | ardAppTaskMapper.deleteArdAppTaskPicByTaskIds(ids); |
| | | ardAppTaskMapper.deleteArdAppTaskDetailByTaskIds(ids); |
| | | return ardAppTaskMapper.deleteArdAppTaskByIds(ids); |
| | | } |
| | | |
| | |
| | | import okhttp3.Response; |
| | | import okhttp3.ResponseBody; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class ARDCarGPSLogInClient { |
| | | |
| | | public static Map<String,Object> loginIn(String syURL,String userId,String password){ |
| | | public static Map<String, Object> loginIn(String syURL, String userId, String password) { |
| | | OkHttpClient okHttpClient = new OkHttpClient(); |
| | | |
| | | String passwordMd5 = DigestUtils.md5Hex(password); |
| | |
| | | .url("http://116.182.15.14:9999/gps-web/api/login.jsp?"+"password="+passwordMd5+"&userId="+userId+"&loginType=user&loginWay=interface&loginLang=zh_CN") |
| | | .build();*/ |
| | | Request request = new Request.Builder() |
| | | .url(syURL + "/gps-web/api/login.jsp?"+"password="+passwordMd5+"&userId="+userId+"&loginType=user&loginWay=interface&loginLang=zh_CN") |
| | | .url(syURL + "/gps-web/api/login.jsp?" + "password=" + passwordMd5 + "&userId=" + userId + "&loginType=user&loginWay=interface&loginLang=zh_CN") |
| | | .build(); |
| | | Response response = null; |
| | | try { |
| | |
| | | |
| | | try { |
| | | String message = responseBody.string();// ååºä½ |
| | | Map<String,Object> map = (Map<String, Object>) JSON.parse(message); |
| | | Map<String, Object> map = (Map<String, Object>) JSON.parse(message); |
| | | map.put("passwordMd5", passwordMd5); |
| | | //System.out.println(message); |
| | | return map; |
| | |
| | | package com.ruoyi.sy.controller; |
| | | |
| | | import java.text.Collator; |
| | | import java.util.*; |
| | | import java.util.*; |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.sy.domain.ArdSyUser; |
| | | import com.ruoyi.sy.gps31.PushClientImplAlarm; |
| | | import com.ruoyi.sy.gps31.PushClientImplPosition; |
| | | import com.ruoyi.sy.service.IArdSyUserService; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.utils.forest.RongCloudClient; |
| | | import com.ruoyi.utils.forest.SYClient; |
| | | import com.ruoyi.utils.httpclient.SYCarClient; |
| | | import com.ruoyi.utils.result.Results; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Autowired |
| | | private ISysDeptService sysDeptService; |
| | | |
| | | @Resource |
| | | private SYClient sYClient; |
| | | |
| | | private ArdSyCarController ardSyCarController; |
| | | |
| | |
| | | } |
| | | }; |
| | | carPositionTimer.scheduleAtFixedRate(carPositionTask,date,3*1000);//å¯ç¨ |
| | | |
| | | //车è¾å®æ¶ä½ç½®çº¿ç¨ |
| | | PushClientImplAlarm pushClientImplAlarm = new PushClientImplAlarm(ip,ardSyUserList.get(0).getUserId(),ardSyUserList.get(0).getPassword()); |
| | | Thread pushClientImplAlarmThread = new Thread(pushClientImplAlarm); |
| | | pushClientImplAlarmThread.start(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return error("ä¸ä¸è½¦è¾url没æå½å
¥"); |
| | | }else{ |
| | | syURL = sysConfigResult.get(0).getConfigValue(); |
| | | Map<String,Object> result = SYCarClient.logIn(syURL,userId, password); |
| | | //Map<String,Object> result = SYCarClient.logIn(syURL,userId, password); |
| | | String passwordMd5 = DigestUtils.md5Hex(password); |
| | | Map<String,Object> result = sYClient.logIn(syURL,passwordMd5,userId); |
| | | return success(result); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * <p>Description: </p> |
| | | * <p>Copyright: Copyright (c) 2020</p> |
| | | * <p>Company: www.31gps.net</p> |
| | | * @author chencq |
| | | * @version 1.0 |
| | | */ |
| | | package com.ruoyi.sy.gps31; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.gps31.push.netty.PushClient; |
| | | import com.gps31.push.netty.PushMsg; |
| | | import com.gps31.push.netty.client.TcpClient; |
| | | import com.gps31.push.util.MapUtil; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.ruoyi.sy.service.impl.ArdSyCarServiceImpl; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p>Description: </p> |
| | | * <p>Copyright: Copyright (c) 2020</p> |
| | | * <p>Company: www.31gps.net</p> |
| | | * @author chencq |
| | | * @version 1.0 |
| | | */ |
| | | public class PushClientImplAlarm extends PushClient implements Runnable { |
| | | |
| | | private static final Log log = LogFactory.getLog(PushClientImplAlarm.class); |
| | | |
| | | private String ip; |
| | | |
| | | private String userId; |
| | | |
| | | private String password; |
| | | |
| | | public PushClientImplAlarm(String ip, String userId, String password) { |
| | | this.ip = ip; |
| | | this.userId = userId; |
| | | this.password = password; |
| | | } |
| | | |
| | | public PushClientImplAlarm() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void messageReceived(TcpClient tcpClient, PushMsg pushMsg) |
| | | throws Exception { |
| | | if("8001".equals(pushMsg.getCmd())) {//ç»å½åºç |
| | | String rspResult = MapUtil.getStrVal(pushMsg.getJsonMap(),"rspResult","1"); |
| | | if("0".equals(rspResult)) {//ç»å½æåï¼å®é
å¨ææ¶æ¯ |
| | | Map<String,Object> map = new HashMap<String,Object>(); |
| | | map.put("seq", "1"); |
| | | map.put("action", "add"); |
| | | map.put("msgIds", JSON.toJSONString(getSubCmdSet())); |
| | | PushMsg subMsg = getInstance("0003",map); |
| | | sendMsg(subMsg); |
| | | } |
| | | }else if("8002".equals(pushMsg.getCmd())){//å¿è·³åºç |
| | | |
| | | }else if("8003".equals(pushMsg.getCmd())){//订é
å¨ææ¶æ¯åºç |
| | | String rspResult = MapUtil.getStrVal(pushMsg.getJsonMap(),"rspResult","1"); |
| | | //log.error(String.format(" 订é
åºç:%s", "0".equals(rspResult)?"æå":"失败")); |
| | | }else if("0200".equals(pushMsg.getCmd())) {//å®ä½ä¿¡æ¯ |
| | | Map<String,Object> gpsMap = pushMsg.getJsonMap(); |
| | | String carName = MapUtil.getStrVal(gpsMap, "carName","");//è·å车çå· |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | System.out.println(sdf.format(new Date())); |
| | | //log.error(String.format(" ---->æ¶å°å®ä½æ°æ®:%s",JSON.toJSONString(gpsMap))); |
| | | /** |
| | | * |
| | | * 请å å
¥ä¸æ¹éææ¹çä¸å¡é»è¾ |
| | | * |
| | | */ |
| | | }else if("0300".equals(pushMsg.getCmd())) {//æ¥è¦æ¶æ¯ |
| | | Map<String,Object> alarmMap = pushMsg.getJsonMap(); |
| | | /*String carName = MapUtil.getStrVal(alarmMap, "carName","");//è·å车çå· |
| | | log.error(String.format(" ---->æ¶å°æ¥è¦æ°æ®:%s",JSON.toJSONString(alarmMap)));*/ |
| | | String carId = (String)alarmMap.get("carId"); |
| | | Map<String,Object> result = ((ArdSyCarServiceImpl) SpringUtils.getBean("ardSyCarServiceImpl")).getArdSyCarAndDeptByCarId(carId);//æ¥è¯¢è½¦è¾åé¨é¨ |
| | | if(result != null){ |
| | | alarmMap.putAll(result); |
| | | } |
| | | Map<Integer,Object> data = new HashMap(); |
| | | data.put(40000, alarmMap); |
| | | ((ArdSyCarServiceImpl) SpringUtils.getBean("ardSyCarServiceImpl")).sendArdSyCarAlarmByCarId(carId,data);//æ¥è¯¢è½¦è¾åé¨é¨ |
| | | }else if("0401".equals(pushMsg.getCmd())) {//éä¼ æ¶æ¯ |
| | | Map<String,Object> dataMap = pushMsg.getJsonMap(); |
| | | String carName = MapUtil.getStrVal(dataMap, "carName","");//è·å车çå· |
| | | //log.error(String.format(" ---->æ¶å°éä¼ æ°æ®:%s",JSON.toJSONString(dataMap))); |
| | | /** |
| | | * |
| | | * 请å å
¥ä¸æ¹éææ¹çä¸å¡é»è¾ |
| | | * |
| | | */ |
| | | } |
| | | } |
| | | |
| | | public void sendMassage() { |
| | | try { |
| | | PushClientImplPosition client = new PushClientImplPosition(); |
| | | client.setLog(false);//æ¯å¦æå°ææ |
| | | client.setHost(this.ip);//æå¡å¨IP |
| | | client.setPort(10100);//æå¡å¨ç«¯å£ |
| | | client.setUserName(this.userId);//ç³»ç»ç¨æ·å |
| | | client.setPwd(this.password);//ç³»ç»ç¨æ·å¯ç |
| | | client.setSubMsgIds("0300");//订é
çå¨ææ¶æ¯ï¼å¤ä¸ªå¨ææ¶æ¯ä½¿ç¨|è¾åï¼å½åç¤ºä¾æ¯è®¢é
å®ä½æ¶æ¯(0x0200)åæ¥è¦æ¶æ¯(0x0300) |
| | | client.setDesc("æµè¯å®¢æ·ç«¯");//客æ·ç«¯çæè¿°ï¼ |
| | | client.start(); |
| | | while(true) { |
| | | Thread.sleep(1000); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | sendMassage(); |
| | | } |
| | | } |
| | |
| | | public void sendMassage() { |
| | | try { |
| | | PushClientImplPosition client = new PushClientImplPosition(); |
| | | client.setLog(true);//æ¯å¦æå°ææ |
| | | client.setLog(false);//æ¯å¦æå°ææ |
| | | client.setHost(this.ip);//æå¡å¨IP |
| | | client.setPort(10100);//æå¡å¨ç«¯å£ |
| | | client.setUserName(this.userId);//ç³»ç»ç¨æ·å |
| | |
| | | * æ ¹æ®é¨é¨åé车è¾å®æ¶ä½ç½® |
| | | */ |
| | | public void sendArdSyCarPosition(); |
| | | |
| | | /** |
| | | * æ ¹æ®é¨é¨åé车è¾å®æ¶æ¥è¦ |
| | | */ |
| | | public void sendArdSyCarAlarmByCarId(String carId, Map<Integer,Object> data); |
| | | // List<ArdSyCar> getArdSyCarWithRightByCarIdList(List<String> carIdList); |
| | | Results carListById(String id); |
| | | |
| | |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.utils.forest.SYClient; |
| | | import com.ruoyi.utils.httpclient.SYCarClient; |
| | | import com.ruoyi.utils.result.Constants; |
| | | import com.ruoyi.utils.result.Results; |
| | |
| | | @Resource |
| | | private SysUserMapper userMapper; |
| | | |
| | | @Resource |
| | | private SYClient sYClient; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¸ä¸è½¦è¾ |
| | |
| | | return result; |
| | | }else{ |
| | | ArdSyUser ardSyUser = ardSyUserList.get(0); |
| | | Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword()); |
| | | //Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword()); |
| | | String passwordMd5 = DigestUtils.md5Hex(ardSyUser.getPassword()); |
| | | Map<String,Object> LogInResult = sYClient.logIn(syURL,passwordMd5,ardSyUser.getUserId()); |
| | | String sessionId = (String) LogInResult.get("sessionId"); |
| | | Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId); |
| | | //Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId); |
| | | Map<String,Object> carListMap = sYClient.getCarList(syURL,sessionId); |
| | | if(((String)carListMap.get("rspCode")).equals("1")){ |
| | | List<Map<String,Object>> list = (List<Map<String,Object>>) carListMap.get("list"); |
| | | ArdSyCar ardSyCar = new ArdSyCar(); |
| | |
| | | return result; |
| | | }else{ |
| | | ArdSyUser ardSyUser = ardSyUserList.get(0); |
| | | Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword()); |
| | | //Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword()); |
| | | String passwordMd5 = DigestUtils.md5Hex(ardSyUser.getPassword()); |
| | | Map<String,Object> LogInResult = sYClient.logIn(syURL,passwordMd5,ardSyUser.getUserId()); |
| | | String sessionId = (String) LogInResult.get("sessionId"); |
| | | Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId); |
| | | //Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId); |
| | | Map<String,Object> carListMap = sYClient.getCarList(syURL,sessionId); |
| | | if(((String)carListMap.get("rspCode")).equals("1")){ |
| | | List<Map<String,Object>> list = (List<Map<String,Object>>) carListMap.get("list"); |
| | | /*ArdSyCar ardSyCar = new ArdSyCar(); |
| | | List<ArdSyCar> ardSyCarList = ardSyCarMapper.selectArdSyCarList(ardSyCar); |
| | | List<String> carIdList = new ArrayList(); |
| | | for(ArdSyCar innerArdSyCar : ardSyCarList){ |
| | | carIdList.add(innerArdSyCar.getCarId()); |
| | | } |
| | | |
| | | List<Map<String,Object>> carList = list.stream().filter(new Predicate<Map<String,Object>>(){ |
| | | @Override |
| | | public boolean test(Map<String,Object> map) { |
| | | return !carIdList.contains((String)map.get("carId")); |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | result.put("data",carList);*/ |
| | | result.put("data",list); |
| | | result.put("code","200"); |
| | | return result; |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void sendArdSyCarAlarmByCarId(String carId, Map<Integer,Object> data) { |
| | | List<SysUser> result = userMapper.getSysUserByCarId(carId); |
| | | for(SysUser sysUser : result){ |
| | | WebSocketUtils.sendMessage(ONLINE_USER_SESSIONS.get(sysUser.getUserId()), JSON.toJSONString(data)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®deptéåæ¥è¯¢åºææå¯¹åºçcarId |
| | | * @param deptList |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.utils.forest; |
| | | |
| | | import com.dtflys.forest.annotation.Get; |
| | | import com.dtflys.forest.annotation.Var; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public interface SYClient { |
| | | @Get(url = "${syURL}/gps-web/api/login.jsp?password=${password}&userId=${userId}&loginType=user&loginWay=interface&loginLang=zh_CN") |
| | | Map<String,Object> logIn(@Var("syURL") String syURL, @Var("password") String password, @Var("userId") String userId); |
| | | |
| | | @Get(url = "${syURL}/gps-web/api/get_car_list.jsp?teamId=&detail=false&sessionId=${sessionId}") |
| | | Map<String,Object> getCarList(@Var("syURL") String syURL, @Var("sessionId") String sessionId); |
| | | } |
| | |
| | | public class UavAuthLifeCircle implements MethodAnnotationLifeCycle<UavAuth, Object> { |
| | | |
| | | |
| | | |
| | | /** |
| | | * åé请æ±åæ§è¡æ¤æ¹æ³ |
| | | */ |
| | |
| | | |
| | | public static String IP = "http://112.98.126.2:6100/"; |
| | | |
| | | |
| | | @UavAuth(token = "${token}") |
| | | @Get(IP + "${url}") |
| | | String GET(@DataVariable("url") String url, @DataVariable("token") String token, @JSONBody String body); |
| | |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ArdAppTaskSubResult" type="ArdAppTask" extends="ArdAppTaskResult"> |
| | | <collection property="ardAppTaskPicList" notNullColumn="sub2_id" javaType="java.util.List" |
| | | resultMap="ArdAppTaskPicResult"/> |
| | | <collection property="ardAppTaskDetailList" notNullColumn="sub1_id" javaType="java.util.List" |
| | | resultMap="ArdAppTaskDetailResult"/> |
| | | </resultMap> |
| | | <resultMap type="ArdAppTaskDetail" id="ArdAppTaskDetailResult"> |
| | | <result property="id" column="sub1_id"/> |
| | | <result property="name" column="sub1_name"/> |
| | | <result property="longitude" column="sub1_longitude"/> |
| | | <result property="latitude" column="sub1_latitude"/> |
| | | <result property="altitude" column="sub1_altitude"/> |
| | | <result property="userId" column="sub1_user_id"/> |
| | | <result property="text" column="sub1_text"/> |
| | | <result property="voice" column="sub1_voice"/> |
| | | <result property="taskId" column="sub1_task_id"/> |
| | | </resultMap> |
| | | <resultMap type="ArdAppTaskPic" id="ArdAppTaskPicResult"> |
| | | <result property="id" column="sub2_id"/> |
| | | <result property="taskId" column="sub2_task_id"/> |
| | | <result property="picUrl" column="sub2_pic_url"/> |
| | | </resultMap> |
| | | <resultMap id="ArdAppTaskArdAppTaskPicResult" type="ArdAppTask" extends="ArdAppTaskResult"> |
| | | <collection property="ardAppTaskPicList" notNullColumn="sub_id" javaType="java.util.List" |
| | | resultMap="ArdAppTaskPicResult"/> |
| | |
| | | <resultMap id="ArdAppTaskArdAppTaskDetailResult" type="ArdAppTask" extends="ArdAppTaskResult"> |
| | | <collection property="ardAppTaskDetailList" notNullColumn="sub_id" javaType="java.util.List" |
| | | resultMap="ArdAppTaskDetailResult"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="ArdAppTaskDetail" id="ArdAppTaskDetailResult"> |
| | | <result property="id" column="sub_id"/> |
| | | <result property="name" column="sub_name"/> |
| | | <result property="longitude" column="sub_longitude"/> |
| | | <result property="latitude" column="sub_latitude"/> |
| | | <result property="altitude" column="sub_altitude"/> |
| | | <result property="userId" column="sub_user_id"/> |
| | | <result property="text" column="sub_text"/> |
| | | <result property="voice" column="sub_voice"/> |
| | | <result property="taskId" column="sub_task_id"/> |
| | | </resultMap> |
| | | <resultMap type="ArdAppTaskPic" id="ArdAppTaskPicResult"> |
| | | <result property="id" column="sub_id"/> |
| | | <result property="taskId" column="sub_task_id"/> |
| | | <result property="picUrl" column="sub_pic_url"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdAppTaskVo"> |
| | |
| | | <if test="name != null and name != ''">and name like '%'||#{name}||'%'</if> |
| | | <if test="text != null and text != ''">and text = #{text}</if> |
| | | <if test="voice != null and voice != ''">and voice = #{voice}</if> |
| | | <if test="deptId != null ">and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t |
| | | <if test="deptId != null and deptId != 0 "> |
| | | and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t |
| | | WHERE cast(#{deptId} as varchar) = any(string_to_array(ancestors,',')) )) |
| | | </if> |
| | | <if test="userId != null and userId != ''">and user_id = #{userId}</if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | </where> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | </select> |
| | | |
| | | <select id="selectArdAppTaskById" parameterType="String" resultMap="ArdAppTaskSubResult"> |
| | | select a.id, |
| | | a.name, |
| | | a.text, |
| | | a.voice, |
| | | a.dept_id, |
| | | a.user_id, |
| | | a.create_by, |
| | | a.create_time, |
| | | a.update_by, |
| | | a.update_time, |
| | | b.id as sub2_id, |
| | | b.task_id as sub2_task_id, |
| | | b.pic_url as sub2_pic_url, |
| | | c.id as sub1_id, |
| | | c.name as sub1_name, |
| | | c.longitude as sub1_longitude, |
| | | c.latitude as sub1_latitde, |
| | | c.altitude as sub1_altitude, |
| | | c.user_id as sub1_user_id, |
| | | c.text as sub1_text, |
| | | c.voice as sub1_voice |
| | | from ard_app_task a |
| | | left join ard_app_task_pic b on b.task_id = a.id |
| | | left join ard_app_task_detail c on c.task_id = a.id |
| | | where a.id = #{id} |
| | | </select> |
| | | <select id="selectArdAppTaskByIdWithPic" parameterType="String" resultMap="ArdAppTaskArdAppTaskPicResult"> |
| | | select a.id, |
| | | a.name, |
| | |
| | | left join ard_app_task_detail c on c.task_id = a.id |
| | | where a.id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdAppTask" parameterType="ArdAppTask"> |
| | | insert into ard_app_task |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | /** |
| | | * è·åç¨æ·å表 |
| | | */ |
| | | @ApiOperation("è·åç¨æ·å表") |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysUser user) { |
| | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("æ ¹æ®ç¨æ·ç¼å·è·å详ç»ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping(value = {"/", "/{userId}"}) |
| | | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) String userId) { |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public SysUser checkEmailUnique(String email); |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦è¾ä¸»é®æ¥è¯¢ç´å±åä¸çº§ç¨æ· |
| | | * |
| | | */ |
| | | public List<SysUser> getSysUserByCarId(String carId); |
| | | } |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="getSysUserByCarId" parameterType="java.lang.String" resultMap="SysUserResult"> |
| | | select * from sys_user su where su.dept_id in ( |
| | | select cast(unnest(array_append(string_to_array(sd.ancestors,','), |
| | | cast(sd.dept_id as text))) as int) from ard_sy_car asy |
| | | inner join sys_dept sd on asy.dept_id = sd.dept_id |
| | | where asy.car_id = #{carId}) |
| | | </select> |
| | | </mapper> |