Commit 4c6bef56 by jiang'yun

修改

parent 3b840c0c
...@@ -677,6 +677,9 @@ public class SjDjjcController extends BaseController ...@@ -677,6 +677,9 @@ public class SjDjjcController extends BaseController
gdfdcs.setGjm(Double.parseDouble(gjm)); gdfdcs.setGjm(Double.parseDouble(gjm));
} }
//计算视平移
double spy = calculateApparentDisplacement(Double.parseDouble(bhfw), Double.parseDouble(nbwy), Double.parseDouble(dxwy));
gdfdcs.setSpy(spy);
sjJygjGdsjgdcsList.add(gdfdcs); sjJygjGdsjgdcsList.add(gdfdcs);
} }
...@@ -1136,6 +1139,24 @@ public class SjDjjcController extends BaseController ...@@ -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; ...@@ -2,6 +2,7 @@ package com.ruoyi.project.zjsgfa.domain;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.framework.aspectj.lang.annotation.Excel;
...@@ -13,6 +14,7 @@ import com.ruoyi.framework.web.domain.BaseEntity; ...@@ -13,6 +14,7 @@ import com.ruoyi.framework.web.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2025-06-26 * @date 2025-06-26
*/ */
@Data
public class SjJygjGdsjgdcs extends BaseEntity public class SjJygjGdsjgdcs extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -72,6 +74,10 @@ public class SjJygjGdsjgdcs extends BaseEntity ...@@ -72,6 +74,10 @@ public class SjJygjGdsjgdcs extends BaseEntity
@Excel(name = "工具面") @Excel(name = "工具面")
private Double gjm; private Double gjm;
@Excel(name = "视平移")
private Double spy;
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
private String bz; private String bz;
......
package com.ruoyi.project.zjsgfa.service.impl; 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.List;
import java.util.Map; import java.util.Map;
...@@ -99,6 +102,30 @@ public class SjJsjgServiceImpl implements ISjJsjgService ...@@ -99,6 +102,30 @@ public class SjJsjgServiceImpl implements ISjJsjgService
public Map selectJsjgt(SjJsjg sjJsjg) { public Map selectJsjgt(SjJsjg sjJsjg) {
List<SjJsjg> sjJsjgs = sjJsjgMapper.selectSjJsjgList(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);
......
...@@ -24,10 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -24,10 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createdTime" column="created_time" /> <result property="createdTime" column="created_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="spy" column="spy" />
</resultMap> </resultMap>
<sql id="selectSjJygjGdsjgdcsVo"> <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> </sql>
<select id="selectSjJygjGdsjgdcsList" parameterType="SjJygjGdsjgdcs" resultMap="SjJygjGdsjgdcsResult"> <select id="selectSjJygjGdsjgdcsList" parameterType="SjJygjGdsjgdcs" resultMap="SjJygjGdsjgdcsResult">
...@@ -78,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -78,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time,</if> <if test="createdTime != null">created_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="spy != null">spy,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jh != null">#{jh},</if> <if test="jh != null">#{jh},</if>
...@@ -98,11 +100,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -98,11 +100,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">#{createdTime},</if> <if test="createdTime != null">#{createdTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="spy != null">#{spy},</if>
</trim> </trim>
</insert> </insert>
<insert id="insertSjJygjGdsjgdcsBatch"> <insert id="insertSjJygjGdsjgdcsBatch">
INSERT INTO sj_jygj_gdsjgdcs 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 VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -119,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -119,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.fwbhl}, #{item.fwbhl},
#{item.qjbhl}, #{item.qjbhl},
#{item.gjm}, #{item.gjm},
#{item.bz} #{item.bz},
#{item.spy}
) )
</foreach> </foreach>
</insert> </insert>
...@@ -145,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -145,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time = #{createdTime},</if> <if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="spy != null">spy = #{spy},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </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