From 4a73a5d9f9f02e1f19d250914897cb09d3be96f3 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期四, 25 一月 2024 13:52:43 +0800
Subject: [PATCH] 单兵端查看通过的位置共享审批提示提交
---
ard-work/src/main/java/com/ruoyi/app/application/domain/ArdAppApplication.java | 68 ++++++----
ard-work/src/main/java/com/ruoyi/app/application/controller/ArdAppApplicationController.java | 43 +++++-
ard-work/src/main/java/com/ruoyi/app/application/mapper/ArdAppApplicationMapper.java | 20 ++-
ard-work/src/main/java/com/ruoyi/app/application/service/impl/ArdAppApplicationServiceImpl.java | 94 +++++++++++++--
ard-work/src/main/java/com/ruoyi/app/application/service/IArdAppApplicationService.java | 18 +-
ard-work/src/main/resources/mapper/app/ArdAppApplicationMapper.xml | 69 +++++++----
6 files changed, 222 insertions(+), 90 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/app/application/controller/ArdAppApplicationController.java b/ard-work/src/main/java/com/ruoyi/app/application/controller/ArdAppApplicationController.java
index 9ca3040..47c0851 100644
--- a/ard-work/src/main/java/com/ruoyi/app/application/controller/ArdAppApplicationController.java
+++ b/ard-work/src/main/java/com/ruoyi/app/application/controller/ArdAppApplicationController.java
@@ -4,6 +4,7 @@
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
+import com.ruoyi.app.application.domain.ArdAppApplication;
import com.ruoyi.common.utils.SecurityUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -20,7 +21,7 @@
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.app.application.domain.ArdAppApplication;
+
import com.ruoyi.app.application.service.IArdAppApplicationService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -29,7 +30,7 @@
* 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆Controller
*
* @author ard
- * @date 2024-01-23
+ * @date 2024-01-25
*/
@RestController
@RequestMapping("/app/application")
@@ -67,10 +68,10 @@
* 鑾峰彇鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆璇︾粏淇℃伅
*/
@PreAuthorize("@ss.hasPermi('app:application:query')")
- @GetMapping(value = "/{applicationId}")
- public AjaxResult getInfo(@PathVariable("applicationId") String applicationId)
+ @GetMapping(value = "/{soilderId}")
+ public AjaxResult getInfo(@PathVariable("soilderId") String soilderId)
{
- return success(ardAppApplicationService.selectArdAppApplicationByApplicationId(applicationId));
+ return success(ardAppApplicationService.selectArdAppApplicationBySoilderId(soilderId));
}
/**
@@ -100,10 +101,10 @@
*/
@PreAuthorize("@ss.hasPermi('app:application:remove')")
@Log(title = "鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆", businessType = BusinessType.DELETE)
- @DeleteMapping("/{applicationIds}")
- public AjaxResult remove(@PathVariable String[] applicationIds)
+ @DeleteMapping("/{soilderIds}")
+ public AjaxResult remove(@PathVariable String[] soilderIds)
{
- return toAjax(ardAppApplicationService.deleteArdAppApplicationByApplicationIds(applicationIds));
+ return toAjax(ardAppApplicationService.deleteArdAppApplicationBySoilderIds(soilderIds));
}
@PostMapping("/sendCheckCommandersPosition")
@@ -170,4 +171,30 @@
return AjaxResult.error();
}
}
+
+ @GetMapping("/getCheckPositionOwn")
+ @ApiOperation("鍗曞叺绔煡鐪嬪凡瀹℃壒鐨勭敵璇�")
+ public AjaxResult getCheckPositionOwn() {
+ String soilderId = SecurityUtils.getUserId();
+ try{
+ Map<String,List<Map<String,Object>>> result = ardAppApplicationService.getCheckPositionOwn(soilderId);
+ return AjaxResult.success(result);
+ }catch(Exception e){
+ e.printStackTrace();
+ return AjaxResult.error();
+ }
+ }
+
+ @PutMapping("/approvalCheckPositionOwn")
+ @ApiOperation("鍗曞叺绔鎵规洿鏀规煡鐪嬫爣璁�")
+ public AjaxResult approvalCheckPositionOwn(@RequestBody Map<String,String> para) {
+ String soilderId = SecurityUtils.getUserId();
+ try{
+ int result = ardAppApplicationService.approvalCheckPositionOwn(soilderId,para);
+ return result > 0 ? AjaxResult.success() : AjaxResult.error();
+ }catch(Exception e){
+ e.printStackTrace();
+ return AjaxResult.error();
+ }
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/application/domain/ArdAppApplication.java b/ard-work/src/main/java/com/ruoyi/app/application/domain/ArdAppApplication.java
index 42ed3d2..d72c3da 100644
--- a/ard-work/src/main/java/com/ruoyi/app/application/domain/ArdAppApplication.java
+++ b/ard-work/src/main/java/com/ruoyi/app/application/domain/ArdAppApplication.java
@@ -9,19 +9,11 @@
* 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆瀵硅薄 ard_app_application
*
* @author ard
- * @date 2024-01-23
+ * @date 2024-01-25
*/
public class ArdAppApplication extends BaseEntity
{
private static final long serialVersionUID = 1L;
-
- /** 鐢宠涓婚敭 */
- @Excel(name = "鐢宠涓婚敭")
- private String applicationId;
-
- /** 鎸囨尌绔垨PC绔富閿� */
- @Excel(name = "鎸囨尌绔垨PC绔富閿�")
- private String commanderId;
/** 鍗曞叺绔富閿� */
@Excel(name = "鍗曞叺绔富閿�")
@@ -43,24 +35,18 @@
@Excel(name = "瀹℃壒鐘舵��")
private String state;
- public void setApplicationId(String applicationId)
- {
- this.applicationId = applicationId;
- }
+ /** 鍗曞叺绔煡鐪嬫爣璁� */
+ @Excel(name = "鍗曞叺绔煡鐪嬫爣璁�")
+ private String soilderCheck;
- public String getApplicationId()
- {
- return applicationId;
- }
- public void setCommanderId(String commanderId)
- {
- this.commanderId = commanderId;
- }
+ /** 鐢宠涓婚敭 */
+ @Excel(name = "鐢宠涓婚敭")
+ private String applicationId;
- public String getCommanderId()
- {
- return commanderId;
- }
+ /** 鎸囨尌绔垨PC绔富閿� */
+ @Excel(name = "鎸囨尌绔垨PC绔富閿�")
+ private String commanderId;
+
public void setSoilderId(String soilderId)
{
this.soilderId = soilderId;
@@ -106,17 +92,45 @@
{
return state;
}
+ public void setSoilderCheck(String soilderCheck)
+ {
+ this.soilderCheck = soilderCheck;
+ }
+
+ public String getSoilderCheck()
+ {
+ return soilderCheck;
+ }
+ public void setApplicationId(String applicationId)
+ {
+ this.applicationId = applicationId;
+ }
+
+ public String getApplicationId()
+ {
+ return applicationId;
+ }
+ public void setCommanderId(String commanderId)
+ {
+ this.commanderId = commanderId;
+ }
+
+ public String getCommanderId()
+ {
+ return commanderId;
+ }
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
- .append("applicationId", getApplicationId())
- .append("commanderId", getCommanderId())
.append("soilderId", getSoilderId())
.append("reason", getReason())
.append("applicationType", getApplicationType())
.append("begin", getBegin())
.append("state", getState())
+ .append("soilderCheck", getSoilderCheck())
+ .append("applicationId", getApplicationId())
+ .append("commanderId", getCommanderId())
.toString();
}
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/application/mapper/ArdAppApplicationMapper.java b/ard-work/src/main/java/com/ruoyi/app/application/mapper/ArdAppApplicationMapper.java
index d965391..c5df2a4 100644
--- a/ard-work/src/main/java/com/ruoyi/app/application/mapper/ArdAppApplicationMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/app/application/mapper/ArdAppApplicationMapper.java
@@ -10,17 +10,17 @@
* 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆Mapper鎺ュ彛
*
* @author ard
- * @date 2024-01-23
+ * @date 2024-01-25
*/
public interface ArdAppApplicationMapper
{
/**
* 鏌ヨ鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*
- * @param applicationId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
+ * @param soilderId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
* @return 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*/
- public ArdAppApplication selectArdAppApplicationByApplicationId(String applicationId);
+ public ArdAppApplication selectArdAppApplicationBySoilderId(String soilderId);
/**
* 鏌ヨ鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆鍒楄〃
@@ -49,20 +49,20 @@
/**
* 鍒犻櫎鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*
- * @param applicationId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
+ * @param soilderId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
* @return 缁撴灉
*/
- public int deleteArdAppApplicationByApplicationId(String applicationId);
+ public int deleteArdAppApplicationBySoilderId(String soilderId);
/**
* 鎵归噺鍒犻櫎鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*
- * @param applicationIds 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+ * @param soilderIds 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
* @return 缁撴灉
*/
- public int deleteArdAppApplicationByApplicationIds(String[] applicationIds);
+ public int deleteArdAppApplicationBySoilderIds(String[] soilderIds);
- public int insertArdAppApplicationList(@Param("ardAppApplicationList")List<ArdAppApplication> ardAppApplicationList);
+ //public int insertArdAppApplicationList(@Param("ardAppApplicationList")List<ArdAppApplication> ardAppApplicationList);
public int updateArdAppApplicationByCommanderIdAndSoilderIdAndType(ArdAppApplication ardAppApplication);
@@ -72,4 +72,8 @@
@Param("applicationType")String applicationType,@Param("begin")String begin,@Param("state")String state);
public List<Map<String,Object>> selectArdAppApplicationByCommanderIdTrue(String commanderId);
+
+ public List<Map<String,Object>> selectArdAppApplicationBySoilderIdFalse(String soilderId);
+
+ public int updateSoilderCheckByCommanderIdAndSoilderIdAndType(@Param("soilderId")String soilderId,@Param("commanderId")String commanderId,@Param("applicationType")String applicationType);
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/application/service/IArdAppApplicationService.java b/ard-work/src/main/java/com/ruoyi/app/application/service/IArdAppApplicationService.java
index 1ab20f0..9fd02fb 100644
--- a/ard-work/src/main/java/com/ruoyi/app/application/service/IArdAppApplicationService.java
+++ b/ard-work/src/main/java/com/ruoyi/app/application/service/IArdAppApplicationService.java
@@ -9,17 +9,17 @@
* 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆Service鎺ュ彛
*
* @author ard
- * @date 2024-01-23
+ * @date 2024-01-25
*/
public interface IArdAppApplicationService
{
/**
* 鏌ヨ鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*
- * @param applicationId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
+ * @param soilderId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
* @return 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*/
- public ArdAppApplication selectArdAppApplicationByApplicationId(String applicationId);
+ public ArdAppApplication selectArdAppApplicationBySoilderId(String soilderId);
/**
* 鏌ヨ鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆鍒楄〃
@@ -48,18 +48,18 @@
/**
* 鎵归噺鍒犻櫎鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*
- * @param applicationIds 闇�瑕佸垹闄ょ殑鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭闆嗗悎
+ * @param soilderIds 闇�瑕佸垹闄ょ殑鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭闆嗗悎
* @return 缁撴灉
*/
- public int deleteArdAppApplicationByApplicationIds(String[] applicationIds);
+ public int deleteArdAppApplicationBySoilderIds(String[] soilderIds);
/**
* 鍒犻櫎鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆淇℃伅
*
- * @param applicationId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
+ * @param soilderId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
* @return 缁撴灉
*/
- public int deleteArdAppApplicationByApplicationId(String applicationId);
+ public int deleteArdAppApplicationBySoilderId(String soilderId);
public int sendCheckCommandersPosition(String usersId, Map<String,Object> para);
@@ -70,4 +70,8 @@
public int approvalCheckPosition(String commanderId,Map<String,String> para);
public Map<String,List<Map<String,Object>>> getCheckPositionTrue(String commanderId);
+
+ public Map<String,List<Map<String,Object>>> getCheckPositionOwn(String soilderId);
+
+ public int approvalCheckPositionOwn(String soilderId,Map<String,String> para);
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/application/service/impl/ArdAppApplicationServiceImpl.java b/ard-work/src/main/java/com/ruoyi/app/application/service/impl/ArdAppApplicationServiceImpl.java
index 14f8653..04a2dd7 100644
--- a/ard-work/src/main/java/com/ruoyi/app/application/service/impl/ArdAppApplicationServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/app/application/service/impl/ArdAppApplicationServiceImpl.java
@@ -2,8 +2,6 @@
import java.util.*;
-import com.alibaba.fastjson2.JSON;
-import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -21,7 +19,7 @@
* 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆Service涓氬姟灞傚鐞�
*
* @author ard
- * @date 2024-01-23
+ * @date 2024-01-25
*/
@Service
public class ArdAppApplicationServiceImpl implements IArdAppApplicationService {
@@ -75,12 +73,12 @@
/**
* 鏌ヨ鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*
- * @param applicationId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
+ * @param soilderId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
* @return 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*/
@Override
- public ArdAppApplication selectArdAppApplicationByApplicationId(String applicationId) {
- return ardAppApplicationMapper.selectArdAppApplicationByApplicationId(applicationId);
+ public ArdAppApplication selectArdAppApplicationBySoilderId(String soilderId) {
+ return ardAppApplicationMapper.selectArdAppApplicationBySoilderId(soilderId);
}
/**
@@ -119,23 +117,23 @@
/**
* 鎵归噺鍒犻櫎鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆
*
- * @param applicationIds 闇�瑕佸垹闄ょ殑鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
+ * @param soilderIds 闇�瑕佸垹闄ょ殑鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
* @return 缁撴灉
*/
@Override
- public int deleteArdAppApplicationByApplicationIds(String[] applicationIds) {
- return ardAppApplicationMapper.deleteArdAppApplicationByApplicationIds(applicationIds);
+ public int deleteArdAppApplicationBySoilderIds(String[] soilderIds) {
+ return ardAppApplicationMapper.deleteArdAppApplicationBySoilderIds(soilderIds);
}
/**
* 鍒犻櫎鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆淇℃伅
*
- * @param applicationId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
+ * @param soilderId 鍗曞叺绔敵璇锋煡鐪嬫寚鎸ョ浣嶇疆鎴栦笁涓�杞﹁締浣嶇疆涓婚敭
* @return 缁撴灉
*/
@Override
- public int deleteArdAppApplicationByApplicationId(String applicationId) {
- return ardAppApplicationMapper.deleteArdAppApplicationByApplicationId(applicationId);
+ public int deleteArdAppApplicationBySoilderId(String soilderId) {
+ return ardAppApplicationMapper.deleteArdAppApplicationBySoilderId(soilderId);
}
@Override
@@ -151,6 +149,7 @@
ardAppApplication.setApplicationType("Commander");
ardAppApplication.setBegin("");
ardAppApplication.setState("0");
+ ardAppApplication.setSoilderCheck("true");//鎸囨尌绔湭瀹℃壒涔熻涓簍rue,涓嶉渶瑕佸崟鍏电鏌ョ湅
int resultSingle = ardAppApplicationMapper.updateArdAppApplicationByCommanderIdAndSoilderIdAndType(ardAppApplication);
result = result + resultSingle;
if(resultSingle == 0){
@@ -175,6 +174,7 @@
ardAppApplication.setApplicationType("SYCar");
ardAppApplication.setBegin("");
ardAppApplication.setState("0");
+ ardAppApplication.setSoilderCheck("true");//鎸囨尌绔湭瀹℃壒涔熻涓簍rue,涓嶉渶瑕佸崟鍏电鏌ョ湅
int resultSingle = ardAppApplicationMapper.updateArdAppApplicationByCommanderIdAndSoilderIdAndType(ardAppApplication);
result = result + resultSingle;
if(resultSingle == 0){
@@ -264,7 +264,7 @@
List<Map<String,Object>> ardAppApplicationList = ardAppApplicationMapper.selectArdAppApplicationByCommanderIdTrue(commanderId);
Date date = new Date();
//鏌ョ湅鎸囨尌绔綅缃敵璇�
- List<Map<String, Object>> resultCommanderPosition = new ArrayList();
+ /*List<Map<String, Object>> resultCommanderPosition = new ArrayList();
for(Map<String, Object> map : ardAppApplicationList){
Long interval = date.getTime() - Long.parseLong((String)map.get("begin"));
interval = 24 * 60 * 60 * 1000 - interval;
@@ -274,9 +274,9 @@
if(((String)map.get("applicationType")).equals("Commander")){
resultCommanderPosition.add(map);
}
- }
+ }*/
//鏌ョ湅杞﹁締浣嶇疆鐢宠
- List<Map<String, Object>> resultSYCarsPosition = new ArrayList();
+ /*List<Map<String, Object>> resultSYCarsPosition = new ArrayList();
for(Map<String, Object> map : ardAppApplicationList){
Long interval = date.getTime() - Long.parseLong((String)map.get("begin"));
interval = 24 * 60 * 60 * 1000 - interval;
@@ -286,9 +286,73 @@
if(((String)map.get("applicationType")).equals("SYCar")){
resultSYCarsPosition.add(map);
}
+ }*/
+ //鏌ョ湅鎸囨尌绔綅缃敵璇�
+ List<Map<String, Object>> resultCommanderPosition = new ArrayList();
+ //鏌ョ湅杞﹁締浣嶇疆鐢宠
+ List<Map<String, Object>> resultSYCarsPosition = new ArrayList();
+ for(Map<String, Object> map : ardAppApplicationList){
+ Long interval = date.getTime() - Long.parseLong((String)map.get("begin"));
+ interval = 24 * 60 * 60 * 1000 - interval;
+ Long hour = interval / (60 * 60 * 1000);
+ Long min = (interval - hour * 60 * 60 * 1000) / (60 * 1000);
+ map.put("time",hour + "鏃�" + min + "鍒�");
+ if(((String)map.get("applicationType")).equals("Commander")){
+ resultCommanderPosition.add(map);
+ }else if(((String)map.get("applicationType")).equals("SYCar")){
+ resultSYCarsPosition.add(map);
+ }
}
result.put("commander",resultCommanderPosition);
result.put("SYCars",resultSYCarsPosition);
return result;
}
+
+ @Override
+ public Map<String, List<Map<String, Object>>> getCheckPositionOwn(String soilderId) {
+ Map<String, List<Map<String, Object>>> result = new HashMap();
+ List<Map<String,Object>> ardAppApplicationList = ardAppApplicationMapper.selectArdAppApplicationBySoilderIdFalse(soilderId);
+ Date date = new Date();
+ //鏌ョ湅鎸囨尌绔綅缃敵璇�
+ List<Map<String, Object>> resultCommanderPosition = new ArrayList();
+ //鏌ョ湅杞﹁締浣嶇疆鐢宠
+ List<Map<String, Object>> resultSYCarsPosition = new ArrayList();
+ for(Map<String, Object> map : ardAppApplicationList){
+ /*if(((String)map.get("state")).equals("1")){
+ Long interval = date.getTime() - Long.parseLong((String)map.get("begin"));
+ interval = 24 * 60 * 60 * 1000 - interval;
+ Long hour = interval / (60 * 60 * 1000);
+ Long min = (interval - hour * 60 * 60 * 1000) / (60 * 1000);
+ map.put("time",hour + "鏃�" + min + "鍒�");
+ if(((String)map.get("applicationType")).equals("Commander")){
+ resultCommanderPosition.add(map);
+ }else if(((String)map.get("applicationType")).equals("SYCar")){
+ resultSYCarsPosition.add(map);
+ }
+ }else{
+ map.put("time","");
+ if(((String)map.get("applicationType")).equals("Commander")){
+ resultCommanderPosition.add(map);
+ }else if(((String)map.get("applicationType")).equals("SYCar")){
+ resultSYCarsPosition.add(map);
+ }
+ }*/
+ if(((String)map.get("applicationType")).equals("Commander")){
+ resultCommanderPosition.add(map);
+ }else if(((String)map.get("applicationType")).equals("SYCar")){
+ resultSYCarsPosition.add(map);
+ }
+ }
+ result.put("commander",resultCommanderPosition);
+ result.put("SYCars",resultSYCarsPosition);
+ return result;
+ }
+
+ @Override
+ public int approvalCheckPositionOwn(String soilderId, Map<String, String> para) {
+ String applicationType = para.get("applicationType");
+ String commanderId = para.get("commanderId");
+ int result = ardAppApplicationMapper.updateSoilderCheckByCommanderIdAndSoilderIdAndType(soilderId,commanderId,applicationType);
+ return result;
+ }
}
diff --git a/ard-work/src/main/resources/mapper/app/ArdAppApplicationMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppApplicationMapper.xml
index 37c1dfb..5cf992a 100644
--- a/ard-work/src/main/resources/mapper/app/ArdAppApplicationMapper.xml
+++ b/ard-work/src/main/resources/mapper/app/ArdAppApplicationMapper.xml
@@ -5,84 +5,89 @@
<mapper namespace="com.ruoyi.app.application.mapper.ArdAppApplicationMapper">
<resultMap type="ArdAppApplication" id="ArdAppApplicationResult">
- <result property="applicationId" column="application_id" />
- <result property="commanderId" column="commander_id" />
<result property="soilderId" column="soilder_id" />
<result property="reason" column="reason" />
<result property="applicationType" column="application_type" />
<result property="begin" column="begin" />
<result property="state" column="state" />
+ <result property="soilderCheck" column="soilder_check" />
+ <result property="applicationId" column="application_id" />
+ <result property="commanderId" column="commander_id" />
</resultMap>
<sql id="selectArdAppApplicationVo">
- select application_id, commander_id, soilder_id, reason, application_type, begin, state from ard_app_application
+ select soilder_id, reason, application_type, begin, state, soilder_check, application_id, commander_id from ard_app_application
</sql>
<select id="selectArdAppApplicationList" parameterType="ArdAppApplication" resultMap="ArdAppApplicationResult">
<include refid="selectArdAppApplicationVo"/>
<where>
- <if test="applicationId != null and applicationId != ''"> and application_id = #{applicationId}</if>
- <if test="commanderId != null and commanderId != ''"> and commander_id = #{commanderId}</if>
<if test="soilderId != null and soilderId != ''"> and soilder_id = #{soilderId}</if>
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
<if test="applicationType != null and applicationType != ''"> and application_type = #{applicationType}</if>
<if test="begin != null and begin != ''"> and begin = #{begin}</if>
<if test="state != null and state != ''"> and state = #{state}</if>
+ <if test="soilderCheck != null and soilderCheck != ''"> and soilder_check = #{soilderCheck}</if>
+ <if test="applicationId != null and applicationId != ''"> and application_id = #{applicationId}</if>
+ <if test="commanderId != null and commanderId != ''"> and commander_id = #{commanderId}</if>
</where>
</select>
- <select id="selectArdAppApplicationByApplicationId" parameterType="String" resultMap="ArdAppApplicationResult">
+ <select id="selectArdAppApplicationBySoilderId" parameterType="String" resultMap="ArdAppApplicationResult">
<include refid="selectArdAppApplicationVo"/>
- where application_id = #{applicationId}
+ where soilder_id = #{soilderId}
</select>
<insert id="insertArdAppApplication" parameterType="ArdAppApplication">
insert into ard_app_application
<trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="applicationId != null">application_id,</if>
- <if test="commanderId != null">commander_id,</if>
<if test="soilderId != null">soilder_id,</if>
<if test="reason != null">reason,</if>
<if test="applicationType != null">application_type,</if>
<if test="begin != null">begin,</if>
<if test="state != null">state,</if>
+ <if test="soilderCheck != null">soilder_check,</if>
+ <if test="applicationId != null">application_id,</if>
+ <if test="commanderId != null">commander_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="applicationId != null">#{applicationId},</if>
- <if test="commanderId != null">#{commanderId},</if>
<if test="soilderId != null">#{soilderId},</if>
<if test="reason != null">#{reason},</if>
<if test="applicationType != null">#{applicationType},</if>
<if test="begin != null">#{begin},</if>
<if test="state != null">#{state},</if>
+ <if test="soilderCheck != null">#{soilderCheck},</if>
+ <if test="applicationId != null">#{applicationId},</if>
+ <if test="commanderId != null">#{commanderId},</if>
</trim>
</insert>
<update id="updateArdAppApplication" parameterType="ArdAppApplication">
update ard_app_application
<trim prefix="SET" suffixOverrides=",">
- <if test="commanderId != null">commander_id = #{commanderId},</if>
- <if test="soilderId != null">soilder_id = #{soilderId},</if>
<if test="reason != null">reason = #{reason},</if>
<if test="applicationType != null">application_type = #{applicationType},</if>
<if test="begin != null">begin = #{begin},</if>
<if test="state != null">state = #{state},</if>
+ <if test="soilderCheck != null">soilder_check = #{soilderCheck},</if>
+ <if test="applicationId != null">application_id = #{applicationId},</if>
+ <if test="commanderId != null">commander_id = #{commanderId},</if>
</trim>
- where application_id = #{applicationId}
+ where soilder_id = #{soilderId}
</update>
- <delete id="deleteArdAppApplicationByApplicationId" parameterType="String">
- delete from ard_app_application where application_id = #{applicationId}
+ <delete id="deleteArdAppApplicationBySoilderId" parameterType="String">
+ delete from ard_app_application where soilder_id = #{soilderId}
</delete>
- <delete id="deleteArdAppApplicationByApplicationIds" parameterType="String">
- delete from ard_app_application where application_id in
- <foreach item="applicationId" collection="array" open="(" separator="," close=")">
- #{applicationId}
+ <delete id="deleteArdAppApplicationBySoilderIds" parameterType="String">
+ delete from ard_app_application where soilder_id in
+ <foreach item="soilderId" collection="array" open="(" separator="," close=")">
+ #{soilderId}
</foreach>
</delete>
- <insert id="insertArdAppApplicationList" parameterType="com.ruoyi.app.application.domain.ArdAppApplication" >
+ <!--<insert id="insertArdAppApplicationList" parameterType="com.ruoyi.app.application.domain.ArdAppApplication" >
insert into ard_app_application (application_id,commander_id,soilder_id,
reason,application_type,begin,state)
values
@@ -90,10 +95,10 @@
(#{ardAppApplication.application_id},#{ardAppApplication.commander_id},#{ardAppApplication.soilder_id},
#{ardAppApplication.reason},#{ardAppApplication.application_type},#{ardAppApplication.begin},#{ardAppApplication.state})
</foreach >
- </insert>
+ </insert>-->
<update id="updateArdAppApplicationByCommanderIdAndSoilderIdAndType" parameterType="com.ruoyi.app.application.domain.ArdAppApplication">
- update ard_app_application set reason = #{reason},begin = #{begin},state = #{state}
+ update ard_app_application set reason = #{reason},begin = #{begin},state = #{state},soilder_check = #{soilderCheck}
where commander_id = #{commanderId} and soilder_id = #{soilderId} and application_type = #{applicationType}
</update>
@@ -106,7 +111,7 @@
</select>
<update id="updateArdAppApplicationBeginByCommanderIdAndSoilderIdAndType" parameterType="java.lang.String">
- update ard_app_application set begin = #{begin},state = #{state}
+ update ard_app_application set begin = #{begin},state = #{state},soilder_check = 'false'
where commander_id = #{commanderId} and soilder_id = #{soilderId} and application_type = #{applicationType}
</update>
@@ -115,6 +120,20 @@
aaa.reason,aaa.begin,aaa.state,aaa.application_type as "applicationType",
su.user_name as "userName",su.nick_name as "nickName" from ard_app_application aaa
inner join sys_user su on aaa.soilder_id = su.user_id
- where commander_id = #{usersId} and state = '1'
+ where commander_id = #{commanderId} and state = '1'
</select>
+
+ <select id="selectArdAppApplicationBySoilderIdFalse" parameterType="java.lang.String" resultType="java.util.Map">
+ select aaa.soilder_id as "soilderId",aaa.commander_id as "commanderId",
+ aaa.reason,aaa.begin,aaa.state,aaa.application_type as "applicationType",
+ su.user_name as "userName",su.nick_name as "nickName"from ard_app_application aaa
+ inner join sys_user su on aaa.commander_id = su.user_id
+ where aaa.soilder_id = #{soilderId} and aaa.soilder_check = 'false'
+ and aaa.state != '0'
+ </select>
+
+ <update id="updateSoilderCheckByCommanderIdAndSoilderIdAndType" parameterType="java.lang.String">
+ update ard_app_application set soilder_check = 'true'
+ where commander_id = #{commanderId} and soilder_id = #{soilderId} and application_type = #{applicationType}
+ </update>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3