修改1.0
This commit is contained in:
parent
02634eb7b6
commit
137b0e80e2
@ -80,6 +80,18 @@ public class DiagnosisController extends BaseController
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改诊疗结果
|
||||
*/
|
||||
|
||||
@ -27,6 +27,7 @@ public class Diagnosis extends BaseEntity
|
||||
/** 治疗记录id */
|
||||
@Excel(name = "治疗记录")
|
||||
private Long treatId;
|
||||
private Integer[] treatIds;
|
||||
|
||||
/** 羊只id */
|
||||
@Excel(name = "羊只耳号")
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.zhyc.module.biosafety.domain;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -28,6 +30,18 @@ public class SwMedicineUsage extends BaseEntity
|
||||
@Excel(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 = "使用类型")
|
||||
private String useType;
|
||||
|
||||
@ -59,4 +59,6 @@ public interface IDiagnosisService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDiagnosisById(Long id);
|
||||
|
||||
int insertDiagnosisList(Diagnosis diagnosis);
|
||||
}
|
||||
|
||||
@ -78,6 +78,7 @@ public class DewormServiceImpl implements IDewormService
|
||||
medicineUsage.setSwMedicineUsageDetailsList(deworm.getUsageDetails());
|
||||
medicineUsage.setName("羊只驱虫");
|
||||
medicineUsage.setUseType("1");
|
||||
medicineUsage.setDatetime(deworm.getDatetime());
|
||||
|
||||
List<Deworm> deworms = new ArrayList<>();
|
||||
|
||||
@ -95,6 +96,8 @@ public class DewormServiceImpl implements IDewormService
|
||||
dew.setGender(String.valueOf(sheepFile.getGender()));
|
||||
dew.setBreed(sheepFile.getBreed());
|
||||
dew.setParity(sheepFile.getParity());
|
||||
|
||||
medicineUsage.setSheepId(sheepId);
|
||||
// 获取药品使用记录的id
|
||||
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
dew.setUsageId(usageId);
|
||||
|
||||
@ -85,6 +85,13 @@ public class DiagnosisServiceImpl implements IDiagnosisService
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -79,6 +79,7 @@ public class DisinfectServiceImpl implements IDisinfectService
|
||||
medicineUsage.setSwMedicineUsageDetailsList(disinfect.getUsageDetails());
|
||||
medicineUsage.setName("羊舍消毒");
|
||||
medicineUsage.setUseType("3");
|
||||
medicineUsage.setDatetime(disinfect.getDatetime());
|
||||
|
||||
|
||||
List<Disinfect> disinfects = new ArrayList<>();
|
||||
@ -90,6 +91,8 @@ public class DisinfectServiceImpl implements IDisinfectService
|
||||
Disinfect dis = new Disinfect();
|
||||
BeanUtils.copyProperties(disinfect,dis);
|
||||
dis.setSheepfoldId(sheepfold);
|
||||
|
||||
medicineUsage.setSheepfoldId(sheepfold);
|
||||
// 获取药品使用记录的id
|
||||
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
dis.setUsageId(usageId);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhyc.module.biosafety.service.impl;
|
||||
|
||||
import java.beans.Transient;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
@ -70,6 +71,7 @@ public class HealthServiceImpl implements IHealthService
|
||||
* @param health 保健
|
||||
* @return 结果
|
||||
*/
|
||||
@Transient
|
||||
@Override
|
||||
public int insertHealth(Health health)
|
||||
{
|
||||
@ -80,6 +82,7 @@ public class HealthServiceImpl implements IHealthService
|
||||
medicineUsage.setSwMedicineUsageDetailsList(health.getUsageDetails());
|
||||
medicineUsage.setName("羊只保健");
|
||||
medicineUsage.setUseType("2");
|
||||
medicineUsage.setDatetime(health.getDatetime());
|
||||
|
||||
List<Health> healths = new ArrayList<>();
|
||||
health.setCreateBy(username);
|
||||
@ -96,6 +99,7 @@ public class HealthServiceImpl implements IHealthService
|
||||
heal.setBreed(sheepFile.getBreed());
|
||||
heal.setParity(sheepFile.getParity());
|
||||
|
||||
medicineUsage.setSheepId(sheepId);
|
||||
// 获取药品使用记录的id
|
||||
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
|
||||
|
||||
@ -82,8 +82,10 @@ public class ImmunityServiceImpl implements IImmunityService
|
||||
medicineUsage.setSwMedicineUsageDetailsList(immunity.getUsageDetails());
|
||||
medicineUsage.setName("羊只免疫");
|
||||
medicineUsage.setUseType("0");
|
||||
medicineUsage.setDatetime(immunity.getDatetime());
|
||||
medicineUsage.setCreateBy(username);
|
||||
|
||||
|
||||
List<Immunity> immunities = new ArrayList<>();
|
||||
|
||||
immunity.setUpdateBy(username);
|
||||
@ -101,6 +103,8 @@ public class ImmunityServiceImpl implements IImmunityService
|
||||
imm.setGender(String.valueOf(sheepFile.getGender()));
|
||||
imm.setBreed(sheepFile.getBreed());
|
||||
imm.setParity(sheepFile.getParity());
|
||||
|
||||
medicineUsage.setSheepId(sheepId);
|
||||
// 获取药品使用记录的id
|
||||
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
|
||||
|
||||
@ -79,10 +79,12 @@ public class TreatmentServiceImpl implements ITreatmentService
|
||||
medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails());
|
||||
medicineUsage.setName("羊只治疗");
|
||||
medicineUsage.setUseType("4");
|
||||
medicineUsage.setDatetime(treatment.getDatetime());
|
||||
medicineUsage.setCreateBy(username);
|
||||
medicineUsage.setCreateTime(DateUtils.getNowDate());
|
||||
// 新增单挑数据
|
||||
if (treatment.getSheepId()!=null){
|
||||
medicineUsage.setSheepId(Math.toIntExact(treatment.getSheepId()));
|
||||
// 药品使用记录
|
||||
Integer id=medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
// 药品使用记录id
|
||||
@ -108,6 +110,8 @@ public class TreatmentServiceImpl implements ITreatmentService
|
||||
treat.setParity(sheepFile.getParity());
|
||||
treat.setLactDay(sheepFile.getLactationDay());
|
||||
treat.setGestDay(sheepFile.getGestationDay());
|
||||
|
||||
medicineUsage.setSheepId(Integer.valueOf(sheepId));
|
||||
// 获取药品使用记录的id
|
||||
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||
System.out.println(medicineUsage);
|
||||
|
||||
@ -114,7 +114,6 @@ public class ScSheepDeathServiceImpl implements IScSheepDeathService
|
||||
scSheepDeath.setSheepId(sheepInfo.get("sheepId") != null ? Long.valueOf(sheepInfo.get("sheepId").toString()) : null);
|
||||
}
|
||||
}
|
||||
|
||||
scSheepDeath.setCreateTime(DateUtils.getNowDate());
|
||||
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.setUpdateTime(DateUtils.getNowDate());
|
||||
return scSheepDeathMapper.updateScSheepDeath(scSheepDeath);
|
||||
}
|
||||
|
||||
@ -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="technical != null and technical != ''"> and technical = #{technical}</if>
|
||||
</where>
|
||||
ORDER BY datetime DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDewormById" parameterType="Long" resultMap="DewormResult">
|
||||
|
||||
@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="treatDay != null "> and treat_day = #{treatDay}</if>
|
||||
<if test="sheepfoldId != null "> and sd.sheepfold_id = #{sheepfoldId}</if>
|
||||
</where>
|
||||
ORDER BY datetime DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDiagnosisById" parameterType="Long" resultMap="DiagnosisResult">
|
||||
|
||||
@ -61,6 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND sm.name like concat('%',#{mediName},'%')
|
||||
)
|
||||
</if>
|
||||
ORDER BY datetime DESC
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult">
|
||||
|
||||
@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="datetime != null "> and datetime = #{datetime}</if>
|
||||
<if test="technical != null and technical != ''"> and technical = #{technical}</if>
|
||||
</where>
|
||||
ORDER BY datetime DESC
|
||||
</select>
|
||||
|
||||
<select id="selectHealthById" parameterType="Long" resultMap="HealthResult">
|
||||
|
||||
@ -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="technical != null and technical != ''"> and technical = #{technical}</if>
|
||||
</where>
|
||||
ORDER BY datetime DESC
|
||||
</select>
|
||||
|
||||
<select id="selectImmunityById" parameterType="Long" resultMap="ImmunityResult">
|
||||
|
||||
@ -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 sheep_file sf on sqr.sheep_id = sf.id
|
||||
where sqr.id = #{id}
|
||||
ORDER BY datetime DESC
|
||||
</select>
|
||||
|
||||
<insert id="insertQuarantineReport" parameterType="java.util.List">
|
||||
|
||||
@ -7,6 +7,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="SwMedicineUsage" id="SwMedicineUsageResult">
|
||||
<result property="id" column="id" />
|
||||
<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="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
@ -31,7 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<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>
|
||||
|
||||
<select id="selectSwMedicineUsageList" parameterType="SwMedicineUsage" resultMap="SwMedicineUsageResult">
|
||||
@ -39,8 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<where>
|
||||
<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="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>
|
||||
ORDER BY datetime DESC
|
||||
</select>
|
||||
|
||||
<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
|
||||
join sw_medicine sm on smud.medi_id = sm.id
|
||||
where medi_usage = #{medi_usage}
|
||||
|
||||
</select>
|
||||
|
||||
<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=",">
|
||||
<if test="name != null">name,</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="updateTime != null">update_time,</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=",">
|
||||
<if test="name != null">#{name},</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="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
|
||||
@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="diseaseId != null "> and disease_id = #{diseaseId}</if>
|
||||
<if test="veterinary != null and veterinary != ''"> and veterinary = #{veterinary}</if>
|
||||
</where>
|
||||
ORDER BY datetime DESC
|
||||
</select>
|
||||
|
||||
<select id="selectTreatmentById" parameterType="Long" resultMap="TreatmentResult">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user