From 8391d68a6d9c712cecd8c4bfe1a7401aaaef2c97 Mon Sep 17 00:00:00 2001 From: piaobo <1913856125@qq.com> Date: Thu, 17 Jul 2025 17:31:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E7=96=AB=E6=A8=A1=E5=9D=97=E7=9A=84?= =?UTF-8?q?=E6=B2=BB=E7=96=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TreatmentController.java | 2 +- .../biosafety/domain/SwPrescription.java | 2 +- .../module/biosafety/domain/Treatment.java | 204 +----------------- .../service/impl/TreatmentServiceImpl.java | 12 ++ 4 files changed, 22 insertions(+), 198 deletions(-) diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/TreatmentController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/TreatmentController.java index 0e7605e..85d5591 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/TreatmentController.java +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/TreatmentController.java @@ -97,7 +97,7 @@ public class TreatmentController extends BaseController */ @PreAuthorize("@ss.hasPermi('treatment:treatment:remove')") @Log(title = "治疗记录", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(treatmentService.deleteTreatmentByIds(ids)); diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPrescription.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPrescription.java index 9afe41d..b8466e1 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPrescription.java +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwPrescription.java @@ -28,7 +28,7 @@ public class SwPrescription extends BaseEntity private String name; /** 类型(免疫/保健/驱虫/消毒/疾病治疗) */ - @Excel(name = "类型", readConverterExp = "免=疫/保健/驱虫/消毒/疾病治疗") + @Excel(name = "类型", readConverterExp = "免疫/保健/驱虫/消毒/疾病治疗") private Integer persType; /** 备注 */ diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Treatment.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Treatment.java index 4ace5d1..67777b8 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Treatment.java +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/Treatment.java @@ -1,7 +1,11 @@ package com.zhyc.module.biosafety.domain; +import java.util.ArrayList; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.zhyc.common.annotation.Excel; @@ -13,6 +17,7 @@ import com.zhyc.common.core.domain.BaseEntity; * @author ruoyi * @date 2025-07-15 */ +@Data public class Treatment extends BaseEntity { private static final long serialVersionUID = 1L; @@ -80,204 +85,11 @@ public class Treatment extends BaseEntity @Excel(name = "药品使用记录id") private Long usageId; +// 药品使用 + private List usageDetails; + /** 备注 */ @Excel(name = "备注") private String comment; - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setDiagId(Long diagId) - { - this.diagId = diagId; - } - - public Long getDiagId() - { - return diagId; - } - - public void setSheepId(Long sheepId) - { - this.sheepId = sheepId; - } - - public Long getSheepId() - { - return sheepId; - } - - public void setVariety(String variety) - { - this.variety = variety; - } - - public String getVariety() - { - return variety; - } - - public void setSheepType(String sheepType) - { - this.sheepType = sheepType; - } - - public String getSheepType() - { - return sheepType; - } - - public void setMonthAge(Long monthAge) - { - this.monthAge = monthAge; - } - - public Long getMonthAge() - { - return monthAge; - } - - public void setGender(String gender) - { - this.gender = gender; - } - - public String getGender() - { - return gender; - } - - public void setParity(Long parity) - { - this.parity = parity; - } - - public Long getParity() - { - return parity; - } - - public void setBreed(String breed) - { - this.breed = breed; - } - - public String getBreed() - { - return breed; - } - - public void setLactDay(Long lactDay) - { - this.lactDay = lactDay; - } - - public Long getLactDay() - { - return lactDay; - } - - public void setGestDay(Long gestDay) - { - this.gestDay = gestDay; - } - - public Long getGestDay() - { - return gestDay; - } - - public void setDatetime(Date datetime) - { - this.datetime = datetime; - } - - public Date getDatetime() - { - return datetime; - } - - public void setDiseaseId(Long diseaseId) - { - this.diseaseId = diseaseId; - } - - public Long getDiseaseId() - { - return diseaseId; - } - - public void setDiseasePid(String diseasePid) - { - this.diseasePid = diseasePid; - } - - public String getDiseasePid() - { - return diseasePid; - } - - public void setVeterinary(String veterinary) - { - this.veterinary = veterinary; - } - - public String getVeterinary() - { - return veterinary; - } - - public void setUsageId(Long usageId) - { - this.usageId = usageId; - } - - public Long getUsageId() - { - return usageId; - } - - public void setComment(String comment) - { - this.comment = comment; - } - - public String getComment() - { - return comment; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("diagId", getDiagId()) - .append("sheepId", getSheepId()) - .append("variety", getVariety()) - .append("sheepType", getSheepType()) - .append("monthAge", getMonthAge()) - .append("gender", getGender()) - .append("parity", getParity()) - .append("breed", getBreed()) - .append("lactDay", getLactDay()) - .append("gestDay", getGestDay()) - .append("datetime", getDatetime()) - .append("diseaseId", getDiseaseId()) - .append("diseasePid", getDiseasePid()) - .append("veterinary", getVeterinary()) - .append("usageId", getUsageId()) - .append("comment", getComment()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .toString(); - } } diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/TreatmentServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/TreatmentServiceImpl.java index 502a05b..1d576f5 100644 --- a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/TreatmentServiceImpl.java +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/TreatmentServiceImpl.java @@ -2,11 +2,14 @@ package com.zhyc.module.biosafety.service.impl; import java.util.List; import com.zhyc.common.utils.DateUtils; +import com.zhyc.module.biosafety.domain.SwMedicineUsage; +import com.zhyc.module.biosafety.domain.SwPrescription; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.zhyc.module.biosafety.mapper.TreatmentMapper; import com.zhyc.module.biosafety.domain.Treatment; import com.zhyc.module.biosafety.service.ITreatmentService; +import org.springframework.transaction.annotation.Transactional; /** * 治疗记录Service业务层处理 @@ -19,6 +22,8 @@ public class TreatmentServiceImpl implements ITreatmentService { @Autowired private TreatmentMapper treatmentMapper; + @Autowired + private SwMedicineUsageServiceImpl medicineUsageService; /** * 查询治疗记录 @@ -51,8 +56,15 @@ public class TreatmentServiceImpl implements ITreatmentService * @return 结果 */ @Override + @Transactional public int insertTreatment(Treatment treatment) { + SwMedicineUsage medicineUsage = new SwMedicineUsage(); + medicineUsage.setName("羊只治疗"); + medicineUsage.setUseType("4"); +// 药品使用记录 + medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails()); + medicineUsageService.insertSwMedicineUsage(medicineUsage); treatment.setCreateTime(DateUtils.getNowDate()); return treatmentMapper.insertTreatment(treatment); }