Commit 4c6bef56 by jiang'yun

修改

parent 3b840c0c
......@@ -677,6 +677,9 @@ public class SjDjjcController extends BaseController
gdfdcs.setGjm(Double.parseDouble(gjm));
}
//计算视平移
double spy = calculateApparentDisplacement(Double.parseDouble(bhfw), Double.parseDouble(nbwy), Double.parseDouble(dxwy));
gdfdcs.setSpy(spy);
sjJygjGdsjgdcsList.add(gdfdcs);
}
......@@ -1136,6 +1139,24 @@ public class SjDjjcController extends BaseController
}
/**
* 计算指定方向上的视平移
* @param closureAzimuth 闭合方位角(度)
* @param nsDisplacement 南北位移(米)
* @param ewDisplacement 东西位移(米)
* @return 视平移(米)
*/
public double calculateApparentDisplacement(double closureAzimuth,
double nsDisplacement,
double ewDisplacement) {
// 将角度转换为弧度(Java 的三角函数使用弧度)
double azimuthRadians = Math.toRadians(closureAzimuth);
// 计算视平移
return nsDisplacement * Math.cos(azimuthRadians) +
ewDisplacement * Math.sin(azimuthRadians);
}
......
......@@ -2,6 +2,7 @@ package com.ruoyi.project.zjsgfa.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
......@@ -13,6 +14,7 @@ import com.ruoyi.framework.web.domain.BaseEntity;
* @author ruoyi
* @date 2025-06-26
*/
@Data
public class SjJygjGdsjgdcs extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -72,6 +74,10 @@ public class SjJygjGdsjgdcs extends BaseEntity
@Excel(name = "工具面")
private Double gjm;
@Excel(name = "视平移")
private Double spy;
/** 备注 */
@Excel(name = "备注")
private String bz;
......
package com.ruoyi.project.zjsgfa.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -99,7 +102,31 @@ public class SjJsjgServiceImpl implements ISjJsjgService
public Map selectJsjgt(SjJsjg sjJsjg) {
List<SjJsjg> sjJsjgs = sjJsjgMapper.selectSjJsjgList(sjJsjg);
Map jsJgmap =new HashMap();
Double maxY = sjJsjgs.stream().map(SjJsjg::getJs).max(Double::compare).get();
Double maxX = sjJsjgs.stream().map(SjJsjg::getZtzj).max(Double::compare).get();
jsJgmap.put("maxY",Math.ceil(maxY+500));
jsJgmap.put("maxX",Math.ceil(maxX+1000));
List zxList = new ArrayList<>();
for(int i=0;i<sjJsjgs.size();i++){
SjJsjg sjJsjg1 = sjJsjgs.get(i);
Double cs1 = sjJsjg1.getJs();
Double spy1 = sjJsjg1.getZtzj();
//填充中心线
Map zxmap =new HashMap();
zxmap.put("x",Math.ceil(spy1+500));
zxmap.put("y",cs1);
if(i==0){
zxmap.put("y",new BigDecimal(0));
}
zxList.add(zxmap);
}
jsJgmap.put("zx",zxList);
return null;
......
......@@ -24,10 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createdTime" column="created_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="spy" column="spy" />
</resultMap>
<sql id="selectSjJygjGdsjgdcsVo">
select id, jh, js, jx, fw, bhfw, cs, bhj, nbwy, dxwy, zxl, fwbhl, qjbhl, gjm, bz, created_by, created_time, update_by, update_time from sj_jygj_gdsjgdcs
select id, jh, js, jx, fw, bhfw, cs, bhj, nbwy, dxwy, zxl, fwbhl, qjbhl, gjm, bz, created_by, created_time, update_by, update_time,spy from sj_jygj_gdsjgdcs
</sql>
<select id="selectSjJygjGdsjgdcsList" parameterType="SjJygjGdsjgdcs" resultMap="SjJygjGdsjgdcsResult">
......@@ -78,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="spy != null">spy,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jh != null">#{jh},</if>
......@@ -98,11 +100,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">#{createdTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="spy != null">#{spy},</if>
</trim>
</insert>
<insert id="insertSjJygjGdsjgdcsBatch">
INSERT INTO sj_jygj_gdsjgdcs
(jh, js, jx, fw, bhfw, cs, bhj, nbwy, dxwy, zxl, fwbhl, qjbhl, gjm, bz)
(jh, js, jx, fw, bhfw, cs, bhj, nbwy, dxwy, zxl, fwbhl, qjbhl, gjm, bz, spy)
VALUES
<foreach collection="list" item="item" separator=",">
(
......@@ -119,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.fwbhl},
#{item.qjbhl},
#{item.gjm},
#{item.bz}
#{item.bz},
#{item.spy}
)
</foreach>
</insert>
......@@ -145,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="spy != null">spy = #{spy},</if>
</trim>
where id = #{id}
</update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment