修改1.0

This commit is contained in:
漂泊 2025-08-24 00:03:46 +08:00
parent 02634eb7b6
commit 137b0e80e2
19 changed files with 85 additions and 4 deletions

View File

@ -80,6 +80,18 @@ public class DiagnosisController extends BaseController
return toAjax(diagnosisService.insertDiagnosis(diagnosis)); return toAjax(diagnosisService.insertDiagnosis(diagnosis));
} }
/**
* 新增批量诊疗结果
*/
@PreAuthorize("@ss.hasPermi('diagnosis:diagnosis:add')")
@Log(title = "诊疗结果", businessType = BusinessType.INSERT)
@PostMapping("/adds")
public AjaxResult adds(@RequestBody Diagnosis diagnosis)
{
System.out.println(diagnosis);
return toAjax(diagnosisService.insertDiagnosisList(diagnosis));
}
/** /**
* 修改诊疗结果 * 修改诊疗结果
*/ */

View File

@ -27,6 +27,7 @@ public class Diagnosis extends BaseEntity
/** 治疗记录id */ /** 治疗记录id */
@Excel(name = "治疗记录") @Excel(name = "治疗记录")
private Long treatId; private Long treatId;
private Integer[] treatIds;
/** 羊只id */ /** 羊只id */
@Excel(name = "羊只耳号") @Excel(name = "羊只耳号")

View File

@ -1,5 +1,7 @@
package com.zhyc.module.biosafety.domain; package com.zhyc.module.biosafety.domain;
import java.util.Date;
import java.util.List; import java.util.List;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -28,6 +30,18 @@ public class SwMedicineUsage extends BaseEntity
@Excel(name = "使用名称") @Excel(name = "使用名称")
private String name; private String name;
/** 羊舍名称 */
@Excel(name = "使用名称")
private String sheepfoldName;
private Integer sheepfoldId;
/** 耳号 */
@Excel(name = "耳号")
private String sheepNo;
private Integer sheepId;
/** 使用时间 */
@Excel(name = "使用时间")
private Date datetime;
/** 使用类型 */ /** 使用类型 */
@Excel(name = "使用类型") @Excel(name = "使用类型")
private String useType; private String useType;

View File

@ -59,4 +59,6 @@ public interface IDiagnosisService
* @return 结果 * @return 结果
*/ */
public int deleteDiagnosisById(Long id); public int deleteDiagnosisById(Long id);
int insertDiagnosisList(Diagnosis diagnosis);
} }

View File

@ -78,6 +78,7 @@ public class DewormServiceImpl implements IDewormService
medicineUsage.setSwMedicineUsageDetailsList(deworm.getUsageDetails()); medicineUsage.setSwMedicineUsageDetailsList(deworm.getUsageDetails());
medicineUsage.setName("羊只驱虫"); medicineUsage.setName("羊只驱虫");
medicineUsage.setUseType("1"); medicineUsage.setUseType("1");
medicineUsage.setDatetime(deworm.getDatetime());
List<Deworm> deworms = new ArrayList<>(); List<Deworm> deworms = new ArrayList<>();
@ -95,6 +96,8 @@ public class DewormServiceImpl implements IDewormService
dew.setGender(String.valueOf(sheepFile.getGender())); dew.setGender(String.valueOf(sheepFile.getGender()));
dew.setBreed(sheepFile.getBreed()); dew.setBreed(sheepFile.getBreed());
dew.setParity(sheepFile.getParity()); dew.setParity(sheepFile.getParity());
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id // 获取药品使用记录的id
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
dew.setUsageId(usageId); dew.setUsageId(usageId);

View File

@ -85,6 +85,13 @@ public class DiagnosisServiceImpl implements IDiagnosisService
return diagnosisMapper.insertDiagnosis(diagnosis); return diagnosisMapper.insertDiagnosis(diagnosis);
} }
@Override
public int insertDiagnosisList(Diagnosis diagnosis) {
return 0;
}
/** /**
* 修改诊疗结果 * 修改诊疗结果
* *
@ -130,4 +137,5 @@ public class DiagnosisServiceImpl implements IDiagnosisService
{ {
return diagnosisMapper.deleteDiagnosisById(id); return diagnosisMapper.deleteDiagnosisById(id);
} }
} }

View File

@ -79,6 +79,7 @@ public class DisinfectServiceImpl implements IDisinfectService
medicineUsage.setSwMedicineUsageDetailsList(disinfect.getUsageDetails()); medicineUsage.setSwMedicineUsageDetailsList(disinfect.getUsageDetails());
medicineUsage.setName("羊舍消毒"); medicineUsage.setName("羊舍消毒");
medicineUsage.setUseType("3"); medicineUsage.setUseType("3");
medicineUsage.setDatetime(disinfect.getDatetime());
List<Disinfect> disinfects = new ArrayList<>(); List<Disinfect> disinfects = new ArrayList<>();
@ -90,6 +91,8 @@ public class DisinfectServiceImpl implements IDisinfectService
Disinfect dis = new Disinfect(); Disinfect dis = new Disinfect();
BeanUtils.copyProperties(disinfect,dis); BeanUtils.copyProperties(disinfect,dis);
dis.setSheepfoldId(sheepfold); dis.setSheepfoldId(sheepfold);
medicineUsage.setSheepfoldId(sheepfold);
// 获取药品使用记录的id // 获取药品使用记录的id
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
dis.setUsageId(usageId); dis.setUsageId(usageId);

View File

@ -1,5 +1,6 @@
package com.zhyc.module.biosafety.service.impl; package com.zhyc.module.biosafety.service.impl;
import java.beans.Transient;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.zhyc.common.utils.DateUtils; import com.zhyc.common.utils.DateUtils;
@ -70,6 +71,7 @@ public class HealthServiceImpl implements IHealthService
* @param health 保健 * @param health 保健
* @return 结果 * @return 结果
*/ */
@Transient
@Override @Override
public int insertHealth(Health health) public int insertHealth(Health health)
{ {
@ -80,6 +82,7 @@ public class HealthServiceImpl implements IHealthService
medicineUsage.setSwMedicineUsageDetailsList(health.getUsageDetails()); medicineUsage.setSwMedicineUsageDetailsList(health.getUsageDetails());
medicineUsage.setName("羊只保健"); medicineUsage.setName("羊只保健");
medicineUsage.setUseType("2"); medicineUsage.setUseType("2");
medicineUsage.setDatetime(health.getDatetime());
List<Health> healths = new ArrayList<>(); List<Health> healths = new ArrayList<>();
health.setCreateBy(username); health.setCreateBy(username);
@ -96,6 +99,7 @@ public class HealthServiceImpl implements IHealthService
heal.setBreed(sheepFile.getBreed()); heal.setBreed(sheepFile.getBreed());
heal.setParity(sheepFile.getParity()); heal.setParity(sheepFile.getParity());
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id // 获取药品使用记录的id
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);

View File

@ -82,8 +82,10 @@ public class ImmunityServiceImpl implements IImmunityService
medicineUsage.setSwMedicineUsageDetailsList(immunity.getUsageDetails()); medicineUsage.setSwMedicineUsageDetailsList(immunity.getUsageDetails());
medicineUsage.setName("羊只免疫"); medicineUsage.setName("羊只免疫");
medicineUsage.setUseType("0"); medicineUsage.setUseType("0");
medicineUsage.setDatetime(immunity.getDatetime());
medicineUsage.setCreateBy(username); medicineUsage.setCreateBy(username);
List<Immunity> immunities = new ArrayList<>(); List<Immunity> immunities = new ArrayList<>();
immunity.setUpdateBy(username); immunity.setUpdateBy(username);
@ -101,6 +103,8 @@ public class ImmunityServiceImpl implements IImmunityService
imm.setGender(String.valueOf(sheepFile.getGender())); imm.setGender(String.valueOf(sheepFile.getGender()));
imm.setBreed(sheepFile.getBreed()); imm.setBreed(sheepFile.getBreed());
imm.setParity(sheepFile.getParity()); imm.setParity(sheepFile.getParity());
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id // 获取药品使用记录的id
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);

View File

@ -79,10 +79,12 @@ public class TreatmentServiceImpl implements ITreatmentService
medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails()); medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails());
medicineUsage.setName("羊只治疗"); medicineUsage.setName("羊只治疗");
medicineUsage.setUseType("4"); medicineUsage.setUseType("4");
medicineUsage.setDatetime(treatment.getDatetime());
medicineUsage.setCreateBy(username); medicineUsage.setCreateBy(username);
medicineUsage.setCreateTime(DateUtils.getNowDate()); medicineUsage.setCreateTime(DateUtils.getNowDate());
// 新增单挑数据 // 新增单挑数据
if (treatment.getSheepId()!=null){ if (treatment.getSheepId()!=null){
medicineUsage.setSheepId(Math.toIntExact(treatment.getSheepId()));
// 药品使用记录 // 药品使用记录
Integer id=medicineUsageService.insertSwMedicineUsage(medicineUsage); Integer id=medicineUsageService.insertSwMedicineUsage(medicineUsage);
// 药品使用记录id // 药品使用记录id
@ -108,6 +110,8 @@ public class TreatmentServiceImpl implements ITreatmentService
treat.setParity(sheepFile.getParity()); treat.setParity(sheepFile.getParity());
treat.setLactDay(sheepFile.getLactationDay()); treat.setLactDay(sheepFile.getLactationDay());
treat.setGestDay(sheepFile.getGestationDay()); treat.setGestDay(sheepFile.getGestationDay());
medicineUsage.setSheepId(Integer.valueOf(sheepId));
// 获取药品使用记录的id // 获取药品使用记录的id
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage); Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
System.out.println(medicineUsage); System.out.println(medicineUsage);

View File

@ -114,7 +114,6 @@ public class ScSheepDeathServiceImpl implements IScSheepDeathService
scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null); scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null);
} }
} }
scSheepDeath.setCreateTime(DateUtils.getNowDate()); scSheepDeath.setCreateTime(DateUtils.getNowDate());
return scSheepDeathMapper.insertScSheepDeath(scSheepDeath); return scSheepDeathMapper.insertScSheepDeath(scSheepDeath);
} }
@ -135,7 +134,6 @@ public class ScSheepDeathServiceImpl implements IScSheepDeathService
scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null); scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null);
} }
} }
scSheepDeath.setUpdateTime(DateUtils.getNowDate()); scSheepDeath.setUpdateTime(DateUtils.getNowDate());
return scSheepDeathMapper.updateScSheepDeath(scSheepDeath); return scSheepDeathMapper.updateScSheepDeath(scSheepDeath);
} }

View File

@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if> <if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
<if test="technical != null and technical != ''"> and technical = #{technical}</if> <if test="technical != null and technical != ''"> and technical = #{technical}</if>
</where> </where>
ORDER BY datetime DESC
</select> </select>
<select id="selectDewormById" parameterType="Long" resultMap="DewormResult"> <select id="selectDewormById" parameterType="Long" resultMap="DewormResult">

View File

@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="treatDay != null "> and treat_day = #{treatDay}</if> <if test="treatDay != null "> and treat_day = #{treatDay}</if>
<if test="sheepfoldId != null "> and sd.sheepfold_id = #{sheepfoldId}</if> <if test="sheepfoldId != null "> and sd.sheepfold_id = #{sheepfoldId}</if>
</where> </where>
ORDER BY datetime DESC
</select> </select>
<select id="selectDiagnosisById" parameterType="Long" resultMap="DiagnosisResult"> <select id="selectDiagnosisById" parameterType="Long" resultMap="DiagnosisResult">

View File

@ -61,6 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND sm.name like concat('%',#{mediName},'%') AND sm.name like concat('%',#{mediName},'%')
) )
</if> </if>
ORDER BY datetime DESC
</select> </select>
<select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult"> <select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult">

View File

@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="datetime != null "> and datetime = #{datetime}</if> <if test="datetime != null "> and datetime = #{datetime}</if>
<if test="technical != null and technical != ''"> and technical = #{technical}</if> <if test="technical != null and technical != ''"> and technical = #{technical}</if>
</where> </where>
ORDER BY datetime DESC
</select> </select>
<select id="selectHealthById" parameterType="Long" resultMap="HealthResult"> <select id="selectHealthById" parameterType="Long" resultMap="HealthResult">

View File

@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if> <if test="params.beginDatetime != null and params.beginDatetime != '' and params.endDatetime != null and params.endDatetime != ''"> and datetime between #{params.beginDatetime} and #{params.endDatetime}</if>
<if test="technical != null and technical != ''"> and technical = #{technical}</if> <if test="technical != null and technical != ''"> and technical = #{technical}</if>
</where> </where>
ORDER BY datetime DESC
</select> </select>
<select id="selectImmunityById" parameterType="Long" resultMap="ImmunityResult"> <select id="selectImmunityById" parameterType="Long" resultMap="ImmunityResult">

View File

@ -68,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sw_quarantine_sample sqs on sqr.sample_type = sqs.id left join sw_quarantine_sample sqs on sqr.sample_type = sqs.id
left join sheep_file sf on sqr.sheep_id = sf.id left join sheep_file sf on sqr.sheep_id = sf.id
where sqr.id = #{id} where sqr.id = #{id}
ORDER BY datetime DESC
</select> </select>
<insert id="insertQuarantineReport" parameterType="java.util.List"> <insert id="insertQuarantineReport" parameterType="java.util.List">

View File

@ -7,6 +7,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SwMedicineUsage" id="SwMedicineUsageResult"> <resultMap type="SwMedicineUsage" id="SwMedicineUsageResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="sheepfoldId" column="sheepfold_id"/>
<result property="sheepfoldName" column="sheepfold_name"/>
<result property="sheepId" column="sheep_id"/>
<result property="sheepNo" column="sheep_no"/>
<result property="datetime" column="datetime"/>
<result property="useType" column="use_type" /> <result property="useType" column="use_type" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
@ -31,7 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSwMedicineUsageVo"> <sql id="selectSwMedicineUsageVo">
select id, name, use_type, update_by, update_time, create_by, create_time from sw_medicine_usage select smu.id, sheepfold as sheepfold_id,sheep sheep_id,name, datetime,use_type, smu.update_by, smu.update_time, smu.create_by, smu.create_time,
ds.sheepfold_name,
bs.manage_tags sheep_no
from sw_medicine_usage smu
left join da_sheepfold ds on ds.id = smu.sheepfold
left join bas_sheep bs on bs.id = smu.sheep
</sql> </sql>
<select id="selectSwMedicineUsageList" parameterType="SwMedicineUsage" resultMap="SwMedicineUsageResult"> <select id="selectSwMedicineUsageList" parameterType="SwMedicineUsage" resultMap="SwMedicineUsageResult">
@ -39,8 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="useType != null and useType != ''"> and use_type = #{useType}</if> <if test="useType != null and useType != ''"> and use_type = #{useType}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> <if test="sheepNo != null and sheepNo != ''"> and bs.manage_tags like concat('%', #{sheepNo}, '%')</if>
<if test="params.beginUseTime != null and params.beginUseTime != '' and params.endUseTime != null and params.endUseTime != ''"> and smu.datetime between #{params.beginUseTime} and #{params.endUseTime}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and smu.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and smu.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where> </where>
ORDER BY datetime DESC
</select> </select>
<select id="selectSwMedicineUsageById" parameterType="Integer" resultMap="SwMedicineUsageSwMedicineUsageDetailsResult"> <select id="selectSwMedicineUsageById" parameterType="Integer" resultMap="SwMedicineUsageSwMedicineUsageDetailsResult">
@ -55,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sw_medicine_usage_details smud from sw_medicine_usage_details smud
join sw_medicine sm on smud.medi_id = sm.id join sw_medicine sm on smud.medi_id = sm.id
where medi_usage = #{medi_usage} where medi_usage = #{medi_usage}
</select> </select>
<insert id="insertSwMedicineUsage" parameterType="SwMedicineUsage" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSwMedicineUsage" parameterType="SwMedicineUsage" useGeneratedKeys="true" keyProperty="id">
@ -62,6 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if> <if test="name != null">name,</if>
<if test="useType != null">use_type,</if> <if test="useType != null">use_type,</if>
<if test="sheepfoldId != null">sheepfold,</if>
<if test="sheepId != null">sheep,</if>
<if test="datetime != null">datetime,</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="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
@ -70,6 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
<if test="useType != null">#{useType},</if> <if test="useType != null">#{useType},</if>
<if test="sheepfoldId != null">#{sheepfoldId},</if>
<if test="sheepId != null">#{sheepId},</if>
<if test="datetime != null">#{datetime},</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="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>

View File

@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="diseaseId != null "> and disease_id = #{diseaseId}</if> <if test="diseaseId != null "> and disease_id = #{diseaseId}</if>
<if test="veterinary != null and veterinary != ''"> and veterinary = #{veterinary}</if> <if test="veterinary != null and veterinary != ''"> and veterinary = #{veterinary}</if>
</where> </where>
ORDER BY datetime DESC
</select> </select>
<select id="selectTreatmentById" parameterType="Long" resultMap="TreatmentResult"> <select id="selectTreatmentById" parameterType="Long" resultMap="TreatmentResult">