| | |
| | | @Value("${syCar.enabled}") |
| | | private Boolean syCarEnabled; |
| | | |
| | | @Value("${syCar.userId}") |
| | | private String userId; |
| | | |
| | | @Value("${syCar.password}") |
| | | private String password; |
| | | |
| | | @PostConstruct |
| | | public void init(){ |
| | | ardSyCarController = this; |
| | |
| | | { |
| | | return; |
| | | } |
| | | PushClientImplPosition pushClientImplPosition = new PushClientImplPosition(ip,ardSyUserList.get(0).getUserId(),ardSyUserList.get(0).getPassword()); |
| | | //PushClientImplPosition pushClientImplPosition = new PushClientImplPosition(ip,ardSyUserList.get(0).getUserId(),ardSyUserList.get(0).getPassword()); |
| | | PushClientImplPosition pushClientImplPosition = new PushClientImplPosition(ip,userId,password); |
| | | Thread pushClientImplPositionThread = new Thread(pushClientImplPosition); |
| | | pushClientImplPositionThread.start(); |
| | | |
| | |
| | | }; |
| | | //carPositionTimer.scheduleAtFixedRate(carPositionTask,date,3*1000);//å¼ç¨ |
| | | //车è¾å®æ¶æ¥è¦çº¿ç¨ |
| | | PushClientImplAlarm pushClientImplAlarm = new PushClientImplAlarm(ip,ardSyUserList.get(0).getUserId(),ardSyUserList.get(0).getPassword()); |
| | | //PushClientImplAlarm pushClientImplAlarm = new PushClientImplAlarm(ip,ardSyUserList.get(0).getUserId(),ardSyUserList.get(0).getPassword()); |
| | | PushClientImplAlarm pushClientImplAlarm = new PushClientImplAlarm(ip,userId,password); |
| | | Thread pushClientImplAlarmThread = new Thread(pushClientImplAlarm); |
| | | pushClientImplAlarmThread.start(); |
| | | } |
| | |
| | | package com.ruoyi.sy.controller; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.utils.result.Results; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | * çµç£éController |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | * @date 2024-07-01 |
| | | */ |
| | | @Api(tags = "çµç£é") |
| | | @RestController |
| | |
| | | @Log(title = "çµç£é" , businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdTankLock ardTankLock) { |
| | | String id = IdUtils.simpleUUID(); |
| | | ardTankLock.setId(id); |
| | | return toAjax(ardTankLockService.insertArdTankLock(ardTankLock)); |
| | | } |
| | | |
| | |
| | | /** |
| | | * å é¤çµç£é |
| | | */ |
| | | @ApiOperation("å é¤çµç£é") |
| | | /*@ApiOperation("å é¤çµç£é") |
| | | @PreAuthorize("@ss.hasPermi('sy:lock:remove')") |
| | | @Log(title = "çµç£é" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardTankLockService.deleteArdTankLockByIds(ids)); |
| | | }*/ |
| | | |
| | | /** |
| | | * å é¤çµç£é |
| | | */ |
| | | @ApiOperation("å é¤åä¸çµç£é") |
| | | @PreAuthorize("@ss.hasPermi('sy:lock:remove')") |
| | | @Log(title = "çµç£é" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable String id) { |
| | | return toAjax(ardTankLockService.deleteArdTankLockById(id)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢å
¨é¨çµç£é") |
| | | @PreAuthorize("@ss.hasPermi('sy:lock:getAll')") |
| | | @GetMapping("/getAll") |
| | | public Results getAll() { |
| | | String userId = SecurityUtils.getUserId(); |
| | | Results result = ardTankLockService.getAll(userId); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | * çµç£é对象 ard_tank_lock |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | * @date 2024-07-01 |
| | | */ |
| | | public class ArdTankLock extends BaseEntity |
| | | { |
| | |
| | | /** ä½¿è½ */ |
| | | @Excel(name = "使è½") |
| | | private String enable; |
| | | |
| | | /** éå¯ç¶æï¼å¼æå
³ */ |
| | | @Excel(name = "éå¯ç¶æï¼å¼æå
³") |
| | | private String restartState; |
| | | |
| | | /** å¨çº¿æ¶é´ */ |
| | | @Excel(name = "å¨çº¿æ¶é´") |
| | |
| | | { |
| | | return enable; |
| | | } |
| | | public void setRestartState(String restartState) |
| | | { |
| | | this.restartState = restartState; |
| | | } |
| | | |
| | | public String getRestartState() |
| | | { |
| | | return restartState; |
| | | } |
| | | public void setOnlineTime(String onlineTime) |
| | | { |
| | | this.onlineTime = onlineTime; |
| | |
| | | .append("imgPositionLeft", getImgPositionLeft()) |
| | | .append("carId", getCarId()) |
| | | .append("enable", getEnable()) |
| | | .append("restartState", getRestartState()) |
| | | .append("onlineTime", getOnlineTime()) |
| | | .toString(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * çµåå´æ çµç£é对象 ard_tank_wall_lock |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | */ |
| | | public class ArdTankWallLock extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** æä½ç±»å */ |
| | | @Excel(name = "æä½ç±»å") |
| | | private String processType; |
| | | |
| | | /** ä¸»é® */ |
| | | private String id; |
| | | |
| | | /** çµåå´æ ä¸»é® */ |
| | | @Excel(name = "çµåå´æ 主é®") |
| | | private String wallId; |
| | | |
| | | /** éä¸»é® */ |
| | | @Excel(name = "é主é®") |
| | | private String lockId; |
| | | |
| | | public void setProcessType(String processType) |
| | | { |
| | | this.processType = processType; |
| | | } |
| | | |
| | | public String getProcessType() |
| | | { |
| | | return processType; |
| | | } |
| | | public void setId(String id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setWallId(String wallId) |
| | | { |
| | | this.wallId = wallId; |
| | | } |
| | | |
| | | public String getWallId() |
| | | { |
| | | return wallId; |
| | | } |
| | | public void setLockId(String lockId) |
| | | { |
| | | this.lockId = lockId; |
| | | } |
| | | |
| | | public String getLockId() |
| | | { |
| | | return lockId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("processType", getProcessType()) |
| | | .append("id", getId()) |
| | | .append("wallId", getWallId()) |
| | | .append("lockId", getLockId()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 临æ¶çµåå´æ çµç£é对象 ard_tank_wall_lock_temporary |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-01 |
| | | */ |
| | | public class ArdTankWallLockTemporary extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | private String id; |
| | | |
| | | /** å´æ ä¸»é® */ |
| | | @Excel(name = "å´æ 主é®") |
| | | private String wallId; |
| | | |
| | | /** éä¸»é® */ |
| | | @Excel(name = "é主é®") |
| | | private String lockId; |
| | | |
| | | /** æä½ç±»å */ |
| | | @Excel(name = "æä½ç±»å") |
| | | private String processType; |
| | | |
| | | public void setId(String id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setWallId(String wallId) |
| | | { |
| | | this.wallId = wallId; |
| | | } |
| | | |
| | | public String getWallId() |
| | | { |
| | | return wallId; |
| | | } |
| | | public void setLockId(String lockId) |
| | | { |
| | | this.lockId = lockId; |
| | | } |
| | | |
| | | public String getLockId() |
| | | { |
| | | return lockId; |
| | | } |
| | | public void setProcessType(String processType) |
| | | { |
| | | this.processType = processType; |
| | | } |
| | | |
| | | public String getProcessType() |
| | | { |
| | | return processType; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("wallId", getWallId()) |
| | | .append("lockId", getLockId()) |
| | | .append("processType", getProcessType()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | * çµç£éMapperæ¥å£ |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | * @date 2024-07-01 |
| | | */ |
| | | public interface ArdTankLockMapper |
| | | { |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankLockByIds(String[] ids); |
| | | |
| | | public List<ArdTankLock> getAll(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.sy.domain.ArdTankWallLock; |
| | | |
| | | /** |
| | | * çµåå´æ çµç£éMapperæ¥å£ |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | */ |
| | | public interface ArdTankWallLockMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢çµåå´æ çµç£é |
| | | * |
| | | * @param processType çµåå´æ çµç£éä¸»é® |
| | | * @return çµåå´æ çµç£é |
| | | */ |
| | | public ArdTankWallLock selectArdTankWallLockByProcessType(String processType); |
| | | |
| | | /** |
| | | * æ¥è¯¢çµåå´æ çµç£éå表 |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return çµåå´æ çµç£ééå |
| | | */ |
| | | public List<ArdTankWallLock> selectArdTankWallLockList(ArdTankWallLock ardTankWallLock); |
| | | |
| | | /** |
| | | * æ°å¢çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | public int insertArdTankWallLock(ArdTankWallLock ardTankWallLock); |
| | | |
| | | /** |
| | | * ä¿®æ¹çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | public int updateArdTankWallLock(ArdTankWallLock ardTankWallLock); |
| | | |
| | | /** |
| | | * å é¤çµåå´æ çµç£é |
| | | * |
| | | * @param processType çµåå´æ çµç£éä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankWallLockByProcessType(String processType); |
| | | |
| | | /** |
| | | * æ¹éå é¤çµåå´æ çµç£é |
| | | * |
| | | * @param processTypes éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankWallLockByProcessTypes(String[] processTypes); |
| | | |
| | | /** |
| | | *æ ¹æ®çµç£é主é®å é¤çµç£é |
| | | * |
| | | */ |
| | | public int deleteArdTankWallLockByLockId(String lockId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.sy.domain.ArdTankWallLockTemporary; |
| | | |
| | | /** |
| | | * 临æ¶çµåå´æ çµç£éMapperæ¥å£ |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-01 |
| | | */ |
| | | public interface ArdTankWallLockTemporaryMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param id 临æ¶çµåå´æ çµç£éä¸»é® |
| | | * @return 临æ¶çµåå´æ çµç£é |
| | | */ |
| | | public ArdTankWallLockTemporary selectArdTankWallLockTemporaryById(String id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¸´æ¶çµåå´æ çµç£éå表 |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return 临æ¶çµåå´æ çµç£ééå |
| | | */ |
| | | public List<ArdTankWallLockTemporary> selectArdTankWallLockTemporaryList(ArdTankWallLockTemporary ardTankWallLockTemporary); |
| | | |
| | | /** |
| | | * æ°å¢ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | public int insertArdTankWallLockTemporary(ArdTankWallLockTemporary ardTankWallLockTemporary); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | public int updateArdTankWallLockTemporary(ArdTankWallLockTemporary ardTankWallLockTemporary); |
| | | |
| | | /** |
| | | * å é¤ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param id 临æ¶çµåå´æ çµç£éä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankWallLockTemporaryById(String id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankWallLockTemporaryByIds(String[] ids); |
| | | |
| | | public int deleteArdTankWallLockTemporaryByLockId(String lockId); |
| | | } |
| | |
| | | package com.ruoyi.sy.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.sy.domain.ArdTankLock; |
| | | import com.ruoyi.utils.result.Results; |
| | | |
| | | /** |
| | | * çµç£éServiceæ¥å£ |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | * @date 2024-07-01 |
| | | */ |
| | | public interface IArdTankLockService |
| | | { |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankLockById(String id); |
| | | |
| | | public Results getAll(String usersId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.sy.domain.ArdTankWallLock; |
| | | |
| | | /** |
| | | * çµåå´æ çµç£éServiceæ¥å£ |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | */ |
| | | public interface IArdTankWallLockService |
| | | { |
| | | /** |
| | | * æ¥è¯¢çµåå´æ çµç£é |
| | | * |
| | | * @param processType çµåå´æ çµç£éä¸»é® |
| | | * @return çµåå´æ çµç£é |
| | | */ |
| | | public ArdTankWallLock selectArdTankWallLockByProcessType(String processType); |
| | | |
| | | /** |
| | | * æ¥è¯¢çµåå´æ çµç£éå表 |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return çµåå´æ çµç£ééå |
| | | */ |
| | | public List<ArdTankWallLock> selectArdTankWallLockList(ArdTankWallLock ardTankWallLock); |
| | | |
| | | /** |
| | | * æ°å¢çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | public int insertArdTankWallLock(ArdTankWallLock ardTankWallLock); |
| | | |
| | | /** |
| | | * ä¿®æ¹çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | public int updateArdTankWallLock(ArdTankWallLock ardTankWallLock); |
| | | |
| | | /** |
| | | * æ¹éå é¤çµåå´æ çµç£é |
| | | * |
| | | * @param processTypes éè¦å é¤ççµåå´æ çµç£é主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankWallLockByProcessTypes(String[] processTypes); |
| | | |
| | | /** |
| | | * å é¤çµåå´æ çµç£éä¿¡æ¯ |
| | | * |
| | | * @param processType çµåå´æ çµç£éä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankWallLockByProcessType(String processType); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.sy.domain.ArdTankWallLockTemporary; |
| | | |
| | | /** |
| | | * 临æ¶çµåå´æ çµç£éServiceæ¥å£ |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-01 |
| | | */ |
| | | public interface IArdTankWallLockTemporaryService |
| | | { |
| | | /** |
| | | * æ¥è¯¢ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param id 临æ¶çµåå´æ çµç£éä¸»é® |
| | | * @return 临æ¶çµåå´æ çµç£é |
| | | */ |
| | | public ArdTankWallLockTemporary selectArdTankWallLockTemporaryById(String id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¸´æ¶çµåå´æ çµç£éå表 |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return 临æ¶çµåå´æ çµç£ééå |
| | | */ |
| | | public List<ArdTankWallLockTemporary> selectArdTankWallLockTemporaryList(ArdTankWallLockTemporary ardTankWallLockTemporary); |
| | | |
| | | /** |
| | | * æ°å¢ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | public int insertArdTankWallLockTemporary(ArdTankWallLockTemporary ardTankWallLockTemporary); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | public int updateArdTankWallLockTemporary(ArdTankWallLockTemporary ardTankWallLockTemporary); |
| | | |
| | | /** |
| | | * æ¹éå é¤ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ids éè¦å é¤ç临æ¶çµåå´æ çµç£é主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankWallLockTemporaryByIds(String[] ids); |
| | | |
| | | /** |
| | | * å é¤ä¸´æ¶çµåå´æ çµç£éä¿¡æ¯ |
| | | * |
| | | * @param id 临æ¶çµåå´æ çµç£éä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteArdTankWallLockTemporaryById(String id); |
| | | } |
| | |
| | | package com.ruoyi.sy.service.impl; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import com.dtflys.forest.annotation.Var; |
| | | import com.ruoyi.common.core.domain.entity.SysConfig; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.sy.domain.ArdSyUser; |
| | | import com.ruoyi.sy.mapper.ArdSyUserMapper; |
| | | import com.ruoyi.sy.mapper.ArdTankWallLockMapper; |
| | | import com.ruoyi.sy.mapper.ArdTankWallLockTemporaryMapper; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.utils.forest.SYClient; |
| | | import com.ruoyi.utils.result.Results; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.ArrayList; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.sy.mapper.ArdTankLockMapper; |
| | | import com.ruoyi.sy.domain.ArdTankLock; |
| | | import com.ruoyi.sy.service.IArdTankLockService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * çµç£éServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | * @date 2024-07-01 |
| | | */ |
| | | @Service |
| | | public class ArdTankLockServiceImpl implements IArdTankLockService { |
| | | @Autowired |
| | | @Resource |
| | | private ArdTankLockMapper ardTankLockMapper; |
| | | |
| | | @Resource |
| | | private ArdTankWallLockMapper ardTankWallLockMapper; |
| | | |
| | | @Resource |
| | | private ArdTankWallLockTemporaryMapper ardTankWallLockTemporaryMapper; |
| | | |
| | | @Resource |
| | | private ArdSyUserMapper ardSyUserMapper; |
| | | |
| | | @Resource |
| | | private SysConfigMapper sysConfigMapper; |
| | | |
| | | @Resource |
| | | private SYClient sYClient; |
| | | |
| | | /** |
| | | * æ¥è¯¢çµç£é |
| | |
| | | */ |
| | | @Override |
| | | public int deleteArdTankLockById(String id) { |
| | | try{ |
| | | return ardTankLockMapper.deleteArdTankLockById(id); |
| | | } finally { |
| | | ardTankWallLockMapper.deleteArdTankWallLockByLockId(id);//å 餿°¸ä¹
çµåå´æ ä¸é´è¡¨ |
| | | ardTankWallLockTemporaryMapper.deleteArdTankWallLockTemporaryByLockId(id);//å é¤ä¸´æ¶çµåå´æ ä¸é´è¡¨ |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Results getAll(String usersId) { |
| | | ArdSyUser ardSyUser = ardSyUserMapper.userById(usersId); |
| | | if(ardSyUser == null){ |
| | | return Results.error("æ²¡æææ¥ä¸ä¸è½¦è¾ç¨æ·"); |
| | | } |
| | | List<SysConfig> syURLResult = sysConfigMapper.selectByType("syCarPT"); |
| | | String syURL = ""; |
| | | if(syURLResult.size() != 0){ |
| | | syURL = syURLResult.get(0).getConfigValue(); |
| | | }else{ |
| | | return Results.error("ä¸ä¸è½¦è¾å°åæªå½å
¥"); |
| | | } |
| | | String passwordMd5 = DigestUtils.md5Hex(ardSyUser.getPassword()); |
| | | Map<String, Object> LogInResult = sYClient.logIn(syURL, passwordMd5, ardSyUser.getUserId()); |
| | | String sessionId = (String) LogInResult.get("sessionId"); |
| | | List<ArdTankLock> ardTankLockList = ardTankLockMapper.getAll(); |
| | | List<Map<String,Object>> result = new ArrayList(); |
| | | for(ArdTankLock ardTankLock : ardTankLockList){ |
| | | Map<String,Object> map = new HashMap(); |
| | | map.put("id",ardTankLock.getId()); |
| | | map.put("lockNum",ardTankLock.getLockNum()); |
| | | map.put("lockName",ardTankLock.getLockName()); |
| | | map.put("imgPositionTop",ardTankLock.getImgPositionTop()); |
| | | map.put("imgPositionLeft",ardTankLock.getImgPositionLeft()); |
| | | map.put("carId",ardTankLock.getCarId()); |
| | | map.put("enable",ardTankLock.getEnable()); |
| | | map.put("restartState",ardTankLock.getRestartState()); |
| | | if(ardTankLock.getOnlineTime() == null){ |
| | | map.put("onlineTime",""); |
| | | }else{ |
| | | map.put("onlineTime",ardTankLock.getOnlineTime()); |
| | | } |
| | | Map<String,Object> syResult = sYClient.getCarNearPositionByCarId(syURL, ardTankLock.getCarId(), ardSyUser.getUserId(), sessionId); |
| | | if(((String)syResult.get("rspCode")).equals("1")){ |
| | | Map<String,Object> carMap = ((List<Map<String,Object>>)syResult.get("list")).get(0); |
| | | map.put("carPlate",carMap.get("carPlate")); |
| | | } |
| | | result.add(map); |
| | | } |
| | | return Results.succeed(result); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.ArrayList; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.sy.mapper.ArdTankWallLockMapper; |
| | | import com.ruoyi.sy.domain.ArdTankWallLock; |
| | | import com.ruoyi.sy.service.IArdTankWallLockService; |
| | | |
| | | /** |
| | | * çµåå´æ çµç£éServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author ard |
| | | * @date 2024-06-29 |
| | | */ |
| | | @Service |
| | | public class ArdTankWallLockServiceImpl implements IArdTankWallLockService { |
| | | @Autowired |
| | | private ArdTankWallLockMapper ardTankWallLockMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢çµåå´æ çµç£é |
| | | * |
| | | * @param processType çµåå´æ çµç£éä¸»é® |
| | | * @return çµåå´æ çµç£é |
| | | */ |
| | | @Override |
| | | public ArdTankWallLock selectArdTankWallLockByProcessType(String processType) { |
| | | return ardTankWallLockMapper.selectArdTankWallLockByProcessType(processType); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢çµåå´æ çµç£éå表 |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return çµåå´æ çµç£é |
| | | */ |
| | | @Override |
| | | public List<ArdTankWallLock> selectArdTankWallLockList(ArdTankWallLock ardTankWallLock) { |
| | | return ardTankWallLockMapper.selectArdTankWallLockList(ardTankWallLock); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertArdTankWallLock(ArdTankWallLock ardTankWallLock) { |
| | | ardTankWallLock.setId(IdUtils.simpleUUID()); |
| | | return ardTankWallLockMapper.insertArdTankWallLock(ardTankWallLock); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLock çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateArdTankWallLock(ArdTankWallLock ardTankWallLock) { |
| | | return ardTankWallLockMapper.updateArdTankWallLock(ardTankWallLock); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤çµåå´æ çµç£é |
| | | * |
| | | * @param processTypes éè¦å é¤ççµåå´æ çµç£éä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteArdTankWallLockByProcessTypes(String[] processTypes) { |
| | | return ardTankWallLockMapper.deleteArdTankWallLockByProcessTypes(processTypes); |
| | | } |
| | | |
| | | /** |
| | | * å é¤çµåå´æ çµç£éä¿¡æ¯ |
| | | * |
| | | * @param processType çµåå´æ çµç£éä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteArdTankWallLockByProcessType(String processType) { |
| | | return ardTankWallLockMapper.deleteArdTankWallLockByProcessType(processType); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sy.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.ArrayList; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.sy.mapper.ArdTankWallLockTemporaryMapper; |
| | | import com.ruoyi.sy.domain.ArdTankWallLockTemporary; |
| | | import com.ruoyi.sy.service.IArdTankWallLockTemporaryService; |
| | | |
| | | /** |
| | | * 临æ¶çµåå´æ çµç£éServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-01 |
| | | */ |
| | | @Service |
| | | public class ArdTankWallLockTemporaryServiceImpl implements IArdTankWallLockTemporaryService { |
| | | @Autowired |
| | | private ArdTankWallLockTemporaryMapper ardTankWallLockTemporaryMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param id 临æ¶çµåå´æ çµç£éä¸»é® |
| | | * @return 临æ¶çµåå´æ çµç£é |
| | | */ |
| | | @Override |
| | | public ArdTankWallLockTemporary selectArdTankWallLockTemporaryById(String id) { |
| | | return ardTankWallLockTemporaryMapper.selectArdTankWallLockTemporaryById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¸´æ¶çµåå´æ çµç£éå表 |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return 临æ¶çµåå´æ çµç£é |
| | | */ |
| | | @Override |
| | | public List<ArdTankWallLockTemporary> selectArdTankWallLockTemporaryList(ArdTankWallLockTemporary ardTankWallLockTemporary) { |
| | | return ardTankWallLockTemporaryMapper.selectArdTankWallLockTemporaryList(ardTankWallLockTemporary); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertArdTankWallLockTemporary(ArdTankWallLockTemporary ardTankWallLockTemporary) { |
| | | ardTankWallLockTemporary.setId(IdUtils.simpleUUID()); |
| | | return ardTankWallLockTemporaryMapper.insertArdTankWallLockTemporary(ardTankWallLockTemporary); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ardTankWallLockTemporary 临æ¶çµåå´æ çµç£é |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateArdTankWallLockTemporary(ArdTankWallLockTemporary ardTankWallLockTemporary) { |
| | | return ardTankWallLockTemporaryMapper.updateArdTankWallLockTemporary(ardTankWallLockTemporary); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ä¸´æ¶çµåå´æ çµç£é |
| | | * |
| | | * @param ids éè¦å é¤ç临æ¶çµåå´æ çµç£éä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteArdTankWallLockTemporaryByIds(String[] ids) { |
| | | return ardTankWallLockTemporaryMapper.deleteArdTankWallLockTemporaryByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¸´æ¶çµåå´æ çµç£éä¿¡æ¯ |
| | | * |
| | | * @param id 临æ¶çµåå´æ çµç£éä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteArdTankWallLockTemporaryById(String id) { |
| | | return ardTankWallLockTemporaryMapper.deleteArdTankWallLockTemporaryById(id); |
| | | } |
| | | } |
| | |
| | | <result property="imgPositionLeft" column="img_position_left" /> |
| | | <result property="carId" column="car_id" /> |
| | | <result property="enable" column="enable" /> |
| | | <result property="restartState" column="restart_state" /> |
| | | <result property="onlineTime" column="online_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdTankLockVo"> |
| | | select id, lock_num, lock_name, img_position_top, img_position_left, car_id, enable, online_time from ard_tank_lock |
| | | select id, lock_num, lock_name, img_position_top, img_position_left, car_id, enable, restart_state, online_time from ard_tank_lock |
| | | </sql> |
| | | |
| | | <select id="selectArdTankLockList" parameterType="ArdTankLock" resultMap="ArdTankLockResult"> |
| | |
| | | <if test="imgPositionLeft != null and imgPositionLeft != ''"> and img_position_left = #{imgPositionLeft}</if> |
| | | <if test="carId != null and carId != ''"> and car_id = #{carId}</if> |
| | | <if test="enable != null and enable != ''"> and enable = #{enable}</if> |
| | | <if test="restartState != null and restartState != ''"> and restart_state = #{restartState}</if> |
| | | <if test="onlineTime != null and onlineTime != ''"> and online_time = #{onlineTime}</if> |
| | | </where> |
| | | </select> |
| | |
| | | <if test="imgPositionLeft != null">img_position_left,</if> |
| | | <if test="carId != null">car_id,</if> |
| | | <if test="enable != null">enable,</if> |
| | | <if test="restartState != null">restart_state,</if> |
| | | <if test="onlineTime != null">online_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="imgPositionLeft != null">#{imgPositionLeft},</if> |
| | | <if test="carId != null">#{carId},</if> |
| | | <if test="enable != null">#{enable},</if> |
| | | <if test="restartState != null">#{restartState},</if> |
| | | <if test="onlineTime != null">#{onlineTime},</if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <if test="imgPositionLeft != null">img_position_left = #{imgPositionLeft},</if> |
| | | <if test="carId != null">car_id = #{carId},</if> |
| | | <if test="enable != null">enable = #{enable},</if> |
| | | <if test="restartState != null">restart_state = #{restartState},</if> |
| | | <if test="onlineTime != null">online_time = #{onlineTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="getAll" resultMap="ArdTankLockResult"> |
| | | select * from ard_tank_lock atl order by atl.car_id |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.sy.mapper.ArdTankWallLockMapper"> |
| | | |
| | | <resultMap type="ArdTankWallLock" id="ArdTankWallLockResult"> |
| | | <result property="processType" column="process_type" /> |
| | | <result property="id" column="id" /> |
| | | <result property="wallId" column="wall_id" /> |
| | | <result property="lockId" column="lock_id" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdTankWallLockVo"> |
| | | select process_type, id, wall_id, lock_id from ard_tank_wall_lock |
| | | </sql> |
| | | |
| | | <select id="selectArdTankWallLockList" parameterType="ArdTankWallLock" resultMap="ArdTankWallLockResult"> |
| | | <include refid="selectArdTankWallLockVo"/> |
| | | <where> |
| | | <if test="processType != null and processType != ''"> and process_type = #{processType}</if> |
| | | <if test="wallId != null and wallId != ''"> and wall_id = #{wallId}</if> |
| | | <if test="lockId != null and lockId != ''"> and lock_id = #{lockId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdTankWallLockByProcessType" parameterType="String" resultMap="ArdTankWallLockResult"> |
| | | <include refid="selectArdTankWallLockVo"/> |
| | | where process_type = #{processType} |
| | | </select> |
| | | |
| | | <insert id="insertArdTankWallLock" parameterType="ArdTankWallLock"> |
| | | insert into ard_tank_wall_lock |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="processType != null">process_type,</if> |
| | | <if test="id != null">id,</if> |
| | | <if test="wallId != null">wall_id,</if> |
| | | <if test="lockId != null">lock_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="processType != null">#{processType},</if> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="wallId != null">#{wallId},</if> |
| | | <if test="lockId != null">#{lockId},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdTankWallLock" parameterType="ArdTankWallLock"> |
| | | update ard_tank_wall_lock |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="id != null">id = #{id},</if> |
| | | <if test="wallId != null">wall_id = #{wallId},</if> |
| | | <if test="lockId != null">lock_id = #{lockId},</if> |
| | | </trim> |
| | | where process_type = #{processType} |
| | | </update> |
| | | |
| | | <delete id="deleteArdTankWallLockByProcessType" parameterType="String"> |
| | | delete from ard_tank_wall_lock where process_type = #{processType} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdTankWallLockByProcessTypes" parameterType="String"> |
| | | delete from ard_tank_wall_lock where process_type in |
| | | <foreach item="processType" collection="array" open="(" separator="," close=")"> |
| | | #{processType} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteArdTankWallLockByLockId" parameterType="java.lang.String"> |
| | | delete from ard_tank_wall_lock where lock_id = #{lockId} |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.sy.mapper.ArdTankWallLockTemporaryMapper"> |
| | | |
| | | <resultMap type="ArdTankWallLockTemporary" id="ArdTankWallLockTemporaryResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="wallId" column="wall_id" /> |
| | | <result property="lockId" column="lock_id" /> |
| | | <result property="processType" column="process_type" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdTankWallLockTemporaryVo"> |
| | | select id, wall_id, lock_id, process_type from ard_tank_wall_lock_temporary |
| | | </sql> |
| | | |
| | | <select id="selectArdTankWallLockTemporaryList" parameterType="ArdTankWallLockTemporary" resultMap="ArdTankWallLockTemporaryResult"> |
| | | <include refid="selectArdTankWallLockTemporaryVo"/> |
| | | <where> |
| | | <if test="wallId != null and wallId != ''"> and wall_id = #{wallId}</if> |
| | | <if test="lockId != null and lockId != ''"> and lock_id = #{lockId}</if> |
| | | <if test="processType != null and processType != ''"> and process_type = #{processType}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdTankWallLockTemporaryById" parameterType="String" resultMap="ArdTankWallLockTemporaryResult"> |
| | | <include refid="selectArdTankWallLockTemporaryVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdTankWallLockTemporary" parameterType="ArdTankWallLockTemporary"> |
| | | insert into ard_tank_wall_lock_temporary |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="wallId != null">wall_id,</if> |
| | | <if test="lockId != null">lock_id,</if> |
| | | <if test="processType != null">process_type,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="wallId != null">#{wallId},</if> |
| | | <if test="lockId != null">#{lockId},</if> |
| | | <if test="processType != null">#{processType},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdTankWallLockTemporary" parameterType="ArdTankWallLockTemporary"> |
| | | update ard_tank_wall_lock_temporary |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="wallId != null">wall_id = #{wallId},</if> |
| | | <if test="lockId != null">lock_id = #{lockId},</if> |
| | | <if test="processType != null">process_type = #{processType},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdTankWallLockTemporaryById" parameterType="String"> |
| | | delete from ard_tank_wall_lock_temporary where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdTankWallLockTemporaryByIds" parameterType="String"> |
| | | delete from ard_tank_wall_lock_temporary where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteArdTankWallLockTemporaryByLockId" parameterType="java.lang.String"> |
| | | delete from ard_tank_wall_lock_temporary where lock_id = #{lockId} |
| | | </delete> |
| | | </mapper> |
| | |
| | | #ä¸ä¸è½¦è¾å¼å
³ |
| | | syCar: |
| | | enabled: true |
| | | userId: admin |
| | | password: 654321 |
| | | #æ 人æºå¼å
³ |
| | | uav: |
| | | enabled: true |