| | |
| | | |
| | | 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; |
| | |
| | | * 单兵端申请查看指挥端位置或三一车辆位置Service业务层处理 |
| | | * |
| | | * @author ard |
| | | * @date 2024-01-23 |
| | | * @date 2024-01-25 |
| | | */ |
| | | @Service |
| | | public class ArdAppApplicationServiceImpl implements IArdAppApplicationService { |
| | |
| | | /** |
| | | * 查询单兵端申请查看指挥端位置或三一车辆位置 |
| | | * |
| | | * @param applicationId 单兵端申请查看指挥端位置或三一车辆位置主键 |
| | | * @param soilderId 单兵端申请查看指挥端位置或三一车辆位置主键 |
| | | * @return 单兵端申请查看指挥端位置或三一车辆位置 |
| | | */ |
| | | @Override |
| | | public ArdAppApplication selectArdAppApplicationByApplicationId(String applicationId) { |
| | | return ardAppApplicationMapper.selectArdAppApplicationByApplicationId(applicationId); |
| | | public ArdAppApplication selectArdAppApplicationBySoilderId(String soilderId) { |
| | | return ardAppApplicationMapper.selectArdAppApplicationBySoilderId(soilderId); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 批量删除单兵端申请查看指挥端位置或三一车辆位置 |
| | | * |
| | | * @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 |
| | |
| | | ardAppApplication.setApplicationType("Commander"); |
| | | ardAppApplication.setBegin(""); |
| | | ardAppApplication.setState("0"); |
| | | ardAppApplication.setSoilderCheck("true");//指挥端未审批也设为true,不需要单兵端查看 |
| | | int resultSingle = ardAppApplicationMapper.updateArdAppApplicationByCommanderIdAndSoilderIdAndType(ardAppApplication); |
| | | result = result + resultSingle; |
| | | if(resultSingle == 0){ |
| | |
| | | ardAppApplication.setApplicationType("SYCar"); |
| | | ardAppApplication.setBegin(""); |
| | | ardAppApplication.setState("0"); |
| | | ardAppApplication.setSoilderCheck("true");//指挥端未审批也设为true,不需要单兵端查看 |
| | | int resultSingle = ardAppApplicationMapper.updateArdAppApplicationByCommanderIdAndSoilderIdAndType(ardAppApplication); |
| | | result = result + resultSingle; |
| | | if(resultSingle == 0){ |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | | } |