体尺测量部分逻辑修改

This commit is contained in:
zyh
2025-12-27 20:01:07 +08:00
parent 5e54877119
commit 4e19076782
5 changed files with 30 additions and 12 deletions

View File

@@ -70,6 +70,10 @@ public class BasSheep extends BaseEntity
@Excel(name = "出生体重")
private Long birthWeight;
/** 出生体重 */
@Excel(name = "当前体重")
private Long currentWeight;
/** 胎次 */
@Excel(name = "胎次")
private Long parity;

View File

@@ -89,7 +89,8 @@ public class ScBodyMeasure extends BaseEntity {
/**
* 当前体重
*/
private BigDecimal currentWeight;
@Excel(name = "当前体重")
private Long currentWeight;
/**
* 体高

View File

@@ -51,13 +51,9 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
/**
* 新增体尺测量
*
* @param scBodyMeasure 体尺测量
* @return 结果
*/
@Override
public int insertScBodyMeasure(ScBodyMeasure scBodyMeasure)
{
public int insertScBodyMeasure(ScBodyMeasure scBodyMeasure) {
String manageTags = scBodyMeasure.getManageTags();
if (StringUtils.isNotBlank(manageTags)) {
BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags);
@@ -66,6 +62,14 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
}
scBodyMeasure.setSheepId(sheep.getId());
}
if (scBodyMeasure.getCurrentWeight() != null) {
BasSheep updateSheep = new BasSheep();
updateSheep.setId(scBodyMeasure.getSheepId());
updateSheep.setCurrentWeight(scBodyMeasure.getCurrentWeight());
basSheepService.updateBasSheep(updateSheep);
}
scBodyMeasure.setCreateTime(DateUtils.getNowDate());
scBodyMeasure.setCreateBy(SecurityUtils.getUsername());
return scBodyMeasureMapper.insertScBodyMeasure(scBodyMeasure);
@@ -73,13 +77,9 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
/**
* 修改体尺测量
*
* @param scBodyMeasure 体尺测量
* @return 结果
*/
@Override
public int updateScBodyMeasure(ScBodyMeasure scBodyMeasure)
{
public int updateScBodyMeasure(ScBodyMeasure scBodyMeasure) {
String manageTags = scBodyMeasure.getManageTags();
if (StringUtils.isNotBlank(manageTags)) {
BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags);
@@ -88,6 +88,14 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
}
scBodyMeasure.setSheepId(sheep.getId());
}
if (scBodyMeasure.getCurrentWeight() != null) {
BasSheep updateSheep = new BasSheep();
updateSheep.setId(scBodyMeasure.getSheepId());
updateSheep.setCurrentWeight(scBodyMeasure.getCurrentWeight());
basSheepService.updateBasSheep(updateSheep);
}
return scBodyMeasureMapper.updateScBodyMeasure(scBodyMeasure);
}

View File

@@ -104,6 +104,7 @@
<if test="gender != null ">and gender = #{gender}</if>
<if test="birthday != null ">and birthday = #{birthday}</if>
<if test="birthWeight != null ">and birth_weight = #{birthWeight}</if>
<if test="currentWeight != null">current_weight = #{currentWeight},</if>
<if test="parity != null ">and parity = #{parity}</if>
<if test="statusId != null ">and status_id = #{statusId}</if>
<if test="weaningDate != null ">and weaning_date = #{weaningDate}</if>
@@ -278,6 +279,7 @@
<if test="gender != null">gender = #{gender},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="birthWeight != null">birth_weight = #{birthWeight},</if>
<if test="currentWeight != null">current_weight = #{currentWeight},</if>
<if test="parity != null">parity = #{parity},</if>
<if test="statusId != null">status_id = #{statusId},</if>
<if test="weaningDate != null">weaning_date = #{weaningDate},</if>

View File

@@ -55,7 +55,7 @@
bs.parity,
bs.birth_weight as birth_weight,
bs.weaning_weight as weaning_weight,
bs.current_weight as current_weight,
sm.current_weight as current_weight,
sm.height,
sm.bust,
sm.body_length,
@@ -123,6 +123,7 @@
<if test="hipHeight != null">hip_height,</if>
<if test="rumpWidth != null">rump_width,</if>
<if test="rumpHeignt != null">rump_heignt,</if>
<if test="currentWeight != null">current_weight,</if>
<if test="hipWidth != null">hip_width,</if>
<if test="hipCrossHeight != null">hip_cross_height,</if>
<if test="comment != null">comment,</if>
@@ -141,6 +142,7 @@
<if test="hipHeight != null">#{hipHeight},</if>
<if test="rumpWidth != null">#{rumpWidth},</if>
<if test="rumpHeignt != null">#{rumpHeignt},</if>
<if test="currentWeight != null">#{currentWeight},</if>
<if test="hipWidth != null">#{hipWidth},</if>
<if test="hipCrossHeight != null">#{hipCrossHeight},</if>
<if test="comment != null">#{comment},</if>
@@ -163,6 +165,7 @@
<if test="hipHeight != null">hip_height = #{hipHeight},</if>
<if test="rumpWidth != null">rump_width = #{rumpWidth},</if>
<if test="rumpHeignt != null">rump_heignt = #{rumpHeignt},</if>
<if test="currentWeight != null">current_weight = #{currentWeight},</if>
<if test="hipWidth != null">hip_width = #{hipWidth},</if>
<if test="hipCrossHeight != null">hip_cross_height = #{hipCrossHeight},</if>
<if test="comment != null">comment = #{comment},</if>