体尺测量部分逻辑修改
This commit is contained in:
@@ -70,6 +70,10 @@ public class BasSheep extends BaseEntity
|
|||||||
@Excel(name = "出生体重")
|
@Excel(name = "出生体重")
|
||||||
private Long birthWeight;
|
private Long birthWeight;
|
||||||
|
|
||||||
|
/** 出生体重 */
|
||||||
|
@Excel(name = "当前体重")
|
||||||
|
private Long currentWeight;
|
||||||
|
|
||||||
/** 胎次 */
|
/** 胎次 */
|
||||||
@Excel(name = "胎次")
|
@Excel(name = "胎次")
|
||||||
private Long parity;
|
private Long parity;
|
||||||
|
|||||||
@@ -89,7 +89,8 @@ public class ScBodyMeasure extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 当前体重
|
* 当前体重
|
||||||
*/
|
*/
|
||||||
private BigDecimal currentWeight;
|
@Excel(name = "当前体重")
|
||||||
|
private Long currentWeight;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 体高
|
* 体高
|
||||||
|
|||||||
@@ -51,13 +51,9 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增体尺测量
|
* 新增体尺测量
|
||||||
*
|
|
||||||
* @param scBodyMeasure 体尺测量
|
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertScBodyMeasure(ScBodyMeasure scBodyMeasure)
|
public int insertScBodyMeasure(ScBodyMeasure scBodyMeasure) {
|
||||||
{
|
|
||||||
String manageTags = scBodyMeasure.getManageTags();
|
String manageTags = scBodyMeasure.getManageTags();
|
||||||
if (StringUtils.isNotBlank(manageTags)) {
|
if (StringUtils.isNotBlank(manageTags)) {
|
||||||
BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags);
|
BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags);
|
||||||
@@ -66,6 +62,14 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
|
|||||||
}
|
}
|
||||||
scBodyMeasure.setSheepId(sheep.getId());
|
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.setCreateTime(DateUtils.getNowDate());
|
||||||
scBodyMeasure.setCreateBy(SecurityUtils.getUsername());
|
scBodyMeasure.setCreateBy(SecurityUtils.getUsername());
|
||||||
return scBodyMeasureMapper.insertScBodyMeasure(scBodyMeasure);
|
return scBodyMeasureMapper.insertScBodyMeasure(scBodyMeasure);
|
||||||
@@ -73,13 +77,9 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改体尺测量
|
* 修改体尺测量
|
||||||
*
|
|
||||||
* @param scBodyMeasure 体尺测量
|
|
||||||
* @return 结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateScBodyMeasure(ScBodyMeasure scBodyMeasure)
|
public int updateScBodyMeasure(ScBodyMeasure scBodyMeasure) {
|
||||||
{
|
|
||||||
String manageTags = scBodyMeasure.getManageTags();
|
String manageTags = scBodyMeasure.getManageTags();
|
||||||
if (StringUtils.isNotBlank(manageTags)) {
|
if (StringUtils.isNotBlank(manageTags)) {
|
||||||
BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags);
|
BasSheep sheep = basSheepService.selectBasSheepByManageTags(manageTags);
|
||||||
@@ -88,6 +88,14 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
|
|||||||
}
|
}
|
||||||
scBodyMeasure.setSheepId(sheep.getId());
|
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);
|
return scBodyMeasureMapper.updateScBodyMeasure(scBodyMeasure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,7 @@
|
|||||||
<if test="gender != null ">and gender = #{gender}</if>
|
<if test="gender != null ">and gender = #{gender}</if>
|
||||||
<if test="birthday != null ">and birthday = #{birthday}</if>
|
<if test="birthday != null ">and birthday = #{birthday}</if>
|
||||||
<if test="birthWeight != null ">and birth_weight = #{birthWeight}</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="parity != null ">and parity = #{parity}</if>
|
||||||
<if test="statusId != null ">and status_id = #{statusId}</if>
|
<if test="statusId != null ">and status_id = #{statusId}</if>
|
||||||
<if test="weaningDate != null ">and weaning_date = #{weaningDate}</if>
|
<if test="weaningDate != null ">and weaning_date = #{weaningDate}</if>
|
||||||
@@ -278,6 +279,7 @@
|
|||||||
<if test="gender != null">gender = #{gender},</if>
|
<if test="gender != null">gender = #{gender},</if>
|
||||||
<if test="birthday != null">birthday = #{birthday},</if>
|
<if test="birthday != null">birthday = #{birthday},</if>
|
||||||
<if test="birthWeight != null">birth_weight = #{birthWeight},</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="parity != null">parity = #{parity},</if>
|
||||||
<if test="statusId != null">status_id = #{statusId},</if>
|
<if test="statusId != null">status_id = #{statusId},</if>
|
||||||
<if test="weaningDate != null">weaning_date = #{weaningDate},</if>
|
<if test="weaningDate != null">weaning_date = #{weaningDate},</if>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
bs.parity,
|
bs.parity,
|
||||||
bs.birth_weight as birth_weight,
|
bs.birth_weight as birth_weight,
|
||||||
bs.weaning_weight as weaning_weight,
|
bs.weaning_weight as weaning_weight,
|
||||||
bs.current_weight as current_weight,
|
sm.current_weight as current_weight,
|
||||||
sm.height,
|
sm.height,
|
||||||
sm.bust,
|
sm.bust,
|
||||||
sm.body_length,
|
sm.body_length,
|
||||||
@@ -123,6 +123,7 @@
|
|||||||
<if test="hipHeight != null">hip_height,</if>
|
<if test="hipHeight != null">hip_height,</if>
|
||||||
<if test="rumpWidth != null">rump_width,</if>
|
<if test="rumpWidth != null">rump_width,</if>
|
||||||
<if test="rumpHeignt != null">rump_heignt,</if>
|
<if test="rumpHeignt != null">rump_heignt,</if>
|
||||||
|
<if test="currentWeight != null">current_weight,</if>
|
||||||
<if test="hipWidth != null">hip_width,</if>
|
<if test="hipWidth != null">hip_width,</if>
|
||||||
<if test="hipCrossHeight != null">hip_cross_height,</if>
|
<if test="hipCrossHeight != null">hip_cross_height,</if>
|
||||||
<if test="comment != null">comment,</if>
|
<if test="comment != null">comment,</if>
|
||||||
@@ -141,6 +142,7 @@
|
|||||||
<if test="hipHeight != null">#{hipHeight},</if>
|
<if test="hipHeight != null">#{hipHeight},</if>
|
||||||
<if test="rumpWidth != null">#{rumpWidth},</if>
|
<if test="rumpWidth != null">#{rumpWidth},</if>
|
||||||
<if test="rumpHeignt != null">#{rumpHeignt},</if>
|
<if test="rumpHeignt != null">#{rumpHeignt},</if>
|
||||||
|
<if test="currentWeight != null">#{currentWeight},</if>
|
||||||
<if test="hipWidth != null">#{hipWidth},</if>
|
<if test="hipWidth != null">#{hipWidth},</if>
|
||||||
<if test="hipCrossHeight != null">#{hipCrossHeight},</if>
|
<if test="hipCrossHeight != null">#{hipCrossHeight},</if>
|
||||||
<if test="comment != null">#{comment},</if>
|
<if test="comment != null">#{comment},</if>
|
||||||
@@ -163,6 +165,7 @@
|
|||||||
<if test="hipHeight != null">hip_height = #{hipHeight},</if>
|
<if test="hipHeight != null">hip_height = #{hipHeight},</if>
|
||||||
<if test="rumpWidth != null">rump_width = #{rumpWidth},</if>
|
<if test="rumpWidth != null">rump_width = #{rumpWidth},</if>
|
||||||
<if test="rumpHeignt != null">rump_heignt = #{rumpHeignt},</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="hipWidth != null">hip_width = #{hipWidth},</if>
|
||||||
<if test="hipCrossHeight != null">hip_cross_height = #{hipCrossHeight},</if>
|
<if test="hipCrossHeight != null">hip_cross_height = #{hipCrossHeight},</if>
|
||||||
<if test="comment != null">comment = #{comment},</if>
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user