Compare commits
2 Commits
2640cde8a3
...
3af62e205c
| Author | SHA1 | Date | |
|---|---|---|---|
| 3af62e205c | |||
| 5f5d5ef2b0 |
@ -1,5 +1,6 @@
|
||||
package com.zhyc.module.biosafety.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -56,8 +57,13 @@ public class SwMedicineUsageController extends BaseController
|
||||
public void export(HttpServletResponse response, SwMedicineUsage swMedicineUsage)
|
||||
{
|
||||
List<SwMedicineUsage> list = swMedicineUsageService.selectSwMedicineUsageList(swMedicineUsage);
|
||||
List<SwMedicineUsage> resultList = new ArrayList<>();
|
||||
for (SwMedicineUsage medicineUsage : list) {
|
||||
medicineUsage.setSwMedicineUsageDetailsList(swMedicineUsageService.selectSwMedicineUsageDetailsById(medicineUsage.getId()));
|
||||
resultList.add(medicineUsage);
|
||||
}
|
||||
ExcelUtil<SwMedicineUsage> util = new ExcelUtil<SwMedicineUsage>(SwMedicineUsage.class);
|
||||
util.exportExcel(response, list, "药品使用记录数据");
|
||||
util.exportExcel(response, resultList, "药品使用记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -28,27 +28,28 @@ public class SwMedicineUsage extends BaseEntity
|
||||
private Integer id;
|
||||
|
||||
/** 使用名称 */
|
||||
@Excel(name = "使用名称")
|
||||
@Excel(name = "使用名称",width = 20, needMerge = true)
|
||||
private String name;
|
||||
|
||||
/** 羊舍名称 */
|
||||
@Excel(name = "使用名称")
|
||||
@Excel(name = "使用名称" ,width = 20, needMerge = true)
|
||||
private String sheepfoldName;
|
||||
private Integer sheepfoldId;
|
||||
/** 耳号 */
|
||||
@Excel(name = "耳号")
|
||||
@Excel(name = "耳号",width = 20, needMerge = true)
|
||||
private String sheepNo;
|
||||
private Integer sheepId;
|
||||
/** 使用时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "使用日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@Excel(name = "使用日期", width = 30, dateFormat = "yyyy-MM-dd", needMerge = true)
|
||||
private Date datetime;
|
||||
|
||||
/** 使用类型 */
|
||||
@Excel(name = "使用类型")
|
||||
@Excel(name = "使用类型",width = 20, needMerge = true)
|
||||
private String useType;
|
||||
|
||||
/** 药品使用记录详情信息 */
|
||||
@Excel
|
||||
private List<SwMedicineUsageDetails> swMedicineUsageDetailsList;
|
||||
|
||||
|
||||
|
||||
@ -26,40 +26,40 @@ public class SwMedicineUsageDetails extends BaseEntity
|
||||
private Long id;
|
||||
|
||||
/** 药品使用记录id */
|
||||
@Excel(name = "药品使用记录id")
|
||||
// @Excel(name = "药品使用记录id")
|
||||
private Integer mediUsage;
|
||||
|
||||
/** 药品id */
|
||||
@Excel(name = "药品id")
|
||||
// @Excel(name = "药品id")
|
||||
private Long mediId;
|
||||
|
||||
/** 药品名称*/
|
||||
@Excel(name = "药品名称")
|
||||
@Excel(name = "药品名称",cellType = Excel.ColumnType.STRING)
|
||||
private String mediName;
|
||||
|
||||
/** 用量 */
|
||||
@Excel(name = "用量")
|
||||
@Excel(name = "用量",cellType = Excel.ColumnType.STRING)
|
||||
private String dosage;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
@Excel(name = "单位",cellType = Excel.ColumnType.STRING)
|
||||
private String unit;
|
||||
|
||||
/** 使用方法 */
|
||||
@Excel(name = "使用方法")
|
||||
@Excel(name = "使用方法",cellType = Excel.ColumnType.STRING)
|
||||
private String usageId;
|
||||
|
||||
/** 使用时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
// @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date usetime;
|
||||
|
||||
/** 生产厂家 */
|
||||
@Excel(name = "生产厂家")
|
||||
@Excel(name = "生产厂家",cellType = Excel.ColumnType.STRING)
|
||||
private String manufacturer;
|
||||
|
||||
/** 生产批号 */
|
||||
@Excel(name = "生产批号")
|
||||
@Excel(name = "生产批号",cellType = Excel.ColumnType.STRING)
|
||||
private String batchNumber;
|
||||
|
||||
}
|
||||
|
||||
@ -87,4 +87,6 @@ public interface SwMedicineUsageMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSwMedicineUsageDetailsByMediUsage(Integer id);
|
||||
|
||||
List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhyc.module.biosafety.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
||||
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
|
||||
|
||||
/**
|
||||
* 药品使用记录Service接口
|
||||
@ -58,4 +59,6 @@ public interface ISwMedicineUsageService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSwMedicineUsageById(Integer id);
|
||||
|
||||
List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id);
|
||||
}
|
||||
|
||||
@ -113,6 +113,11 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
|
||||
return swMedicineUsageMapper.deleteSwMedicineUsageById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SwMedicineUsageDetails> selectSwMedicineUsageDetailsById(Integer id) {
|
||||
return swMedicineUsageMapper.selectSwMedicineUsageDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增药品使用记录详情信息
|
||||
*
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
package com.zhyc.module.enums;
|
||||
|
||||
public enum UseType {
|
||||
}
|
||||
@ -111,6 +111,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where medi_usage = #{medi_usage}
|
||||
|
||||
</select>
|
||||
<select id="selectSwMedicineUsageDetailsById" resultMap="SwMedicineUsageDetailsResult">
|
||||
SELECT
|
||||
smud.id,
|
||||
smud.medi_usage,
|
||||
smud.medi_id,
|
||||
smud.dosage,
|
||||
smud.usetime,
|
||||
smud.manufacturer,
|
||||
smud.batch_number,
|
||||
sm.name AS name,
|
||||
su.name AS usageId,
|
||||
sunit.unit AS unit
|
||||
FROM
|
||||
sw_medicine_usage_details smud
|
||||
JOIN sw_medicine sm ON smud.medi_id = sm.id
|
||||
LEFT JOIN sw_usage su ON smud.usageId = su.id
|
||||
LEFT JOIN sw_unit sunit ON smud.unit = sunit.id
|
||||
WHERE
|
||||
smud.medi_usage = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSwMedicineUsage" parameterType="SwMedicineUsage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sw_medicine_usage
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user