完善配餐功能修改
This commit is contained in:
parent
2cf46f7fc8
commit
33fe8c08bb
@ -9,8 +9,6 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.fantang.domain.FtCateringDao;
|
||||
import com.ruoyi.system.fantang.service.IFtCateringDaoService;
|
||||
import com.ruoyi.system.fantang.service.IFtDepartDaoService;
|
||||
import com.ruoyi.system.fantang.service.IFtPatientDaoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -33,10 +31,6 @@ public class FtCateringDaoController extends BaseController {
|
||||
|
||||
private final IFtCateringDaoService iFtCateringDaoService;
|
||||
|
||||
private final IFtDepartDaoService departDaoService;
|
||||
|
||||
private final IFtPatientDaoService patientDaoService;
|
||||
|
||||
/**
|
||||
* 查询配餐功能列表
|
||||
*/
|
||||
@ -44,21 +38,6 @@ public class FtCateringDaoController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FtCateringDao ftCateringDao) {
|
||||
startPage();
|
||||
// LambdaQueryWrapper<FtCateringDao> lqw = Wrappers.lambdaQuery(ftCateringDao);
|
||||
// if (ftCateringDao.getFlag() != null) {
|
||||
// lqw.eq(FtCateringDao::getFlag, ftCateringDao.getFlag());
|
||||
// }
|
||||
// List<FtCateringDao> list = iFtCateringDaoService.list(lqw);
|
||||
// List<FtCateringDao> listWithDepart = iFtCateringDaoService.list(lqw);
|
||||
// for (FtCateringDao cateringDao : list) {
|
||||
// FtPatientDao Patient = patientDaoService.getById(cateringDao.getPatientId());
|
||||
// Long departId = Patient.getDepartId();
|
||||
// String departName = departDaoService.getById(departId).getDepartName();
|
||||
// cateringDao.setDepartName(departName);
|
||||
// cateringDao.setName(Patient.getName());
|
||||
// cateringDao.setBedId(Patient.getBedId());
|
||||
// listWithDepart.add(cateringDao);
|
||||
// }
|
||||
List<FtCateringDao> list = iFtCateringDaoService.listNewFormatter(ftCateringDao);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -82,7 +61,8 @@ public class FtCateringDaoController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('fantang:catering:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iFtCateringDaoService.getById(id));
|
||||
FtCateringDao ftCateringDao = iFtCateringDaoService.getByIdNewFormatter(id);
|
||||
return AjaxResult.success(ftCateringDao);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,6 +103,4 @@ public class FtCateringDao extends FtCateringVo {
|
||||
*/
|
||||
@Excel(name = "描述")
|
||||
private String cateringDescribe;
|
||||
|
||||
private String hospitalId;
|
||||
}
|
||||
|
@ -14,4 +14,6 @@ import java.util.List;
|
||||
public interface FtCateringDaoMapper extends BaseMapper<FtCateringDao> {
|
||||
|
||||
List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao);
|
||||
|
||||
FtCateringDao getByIdNewFormatter(Long id);
|
||||
}
|
||||
|
@ -14,4 +14,6 @@ import java.util.List;
|
||||
public interface IFtCateringDaoService extends IService<FtCateringDao> {
|
||||
|
||||
List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao);
|
||||
|
||||
FtCateringDao getByIdNewFormatter(Long id);
|
||||
}
|
||||
|
@ -21,4 +21,9 @@ public class FtCateringDaoServiceImpl extends ServiceImpl<FtCateringDaoMapper, F
|
||||
public List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao) {
|
||||
return this.baseMapper.listNewFormatter(ftCateringDao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FtCateringDao getByIdNewFormatter(Long id) {
|
||||
return this.baseMapper.getByIdNewFormatter(id);
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,6 @@ public class FtCateringVo {
|
||||
@TableField(exist = false)
|
||||
private String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String hospitalId;
|
||||
}
|
||||
|
@ -29,4 +29,13 @@
|
||||
<if test="hospitalId != null">and b.hospital_id = #{hospitalId}</if>
|
||||
<if test="flag != null">and a.flag = #{flag}</if>
|
||||
</select>
|
||||
|
||||
<select id="getByIdNewFormatter" resultType="com.ruoyi.system.fantang.domain.FtCateringDao">
|
||||
select a.*, b.name, b.bed_id, b.patient_id,c.depart_name, b.hospital_id, c.depart_id
|
||||
from ft_catering a
|
||||
LEFT JOIN ft_patient b
|
||||
LEFT JOIN ft_depart c on b.depart_id = c.depart_id on a.patient_id = b.patient_id
|
||||
where b.off_flag = 0
|
||||
and a.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
@ -320,7 +320,8 @@
|
||||
<el-form-item label="科室" prop="departId">
|
||||
<el-select v-model="form.departId"
|
||||
placeholder="请选择科室"
|
||||
@change="changeDepart">
|
||||
@change="changeDepart"
|
||||
:disabled="true">
|
||||
<el-option
|
||||
v-for="item in departOptions"
|
||||
:key="item.departName"
|
||||
@ -330,14 +331,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="病人" prop="patientId">
|
||||
<el-select v-model="form.patientId" placeholder="请选择病人" @change="changePatient">
|
||||
<el-option
|
||||
v-for="item in patientOptions"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.patientId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-input v-model="form.name" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="床号" prop="bedId">
|
||||
<el-input v-model="form.bedId" placeholder="床号" :disabled="true"/>
|
||||
@ -348,9 +342,9 @@
|
||||
<el-select v-model="form.number" placeholder="请选择配餐号">
|
||||
<el-option
|
||||
v-for="item in numberOptions"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -370,11 +364,10 @@
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="正餐类型" prop="types">
|
||||
<el-select v-model="form.types"
|
||||
multiple
|
||||
@change="changeDinnerType"
|
||||
placeholder="请选择正餐类型">
|
||||
<el-form-item label="正餐类型" prop="type">
|
||||
<el-select v-model="form.type"
|
||||
placeholder="请选择正餐类型"
|
||||
:disabled="true">
|
||||
<el-option
|
||||
v-for="dict in typeOptions"
|
||||
:key="dict.dictValue"
|
||||
@ -418,6 +411,7 @@ import {
|
||||
} from "@/api/fantang/catering";
|
||||
import {listDepart} from "@/api/fantang/depart";
|
||||
import {getBedIdById, selectPatientByDepartId} from "@/api/fantang/patient";
|
||||
import {listNutritionFood} from "@/api/fantang/nutritionFood";
|
||||
|
||||
export default {
|
||||
name: "Catering",
|
||||
@ -425,16 +419,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
// 配餐列表
|
||||
numberOptions: [{
|
||||
value: 1,
|
||||
label: '配餐 1'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '配餐 2'
|
||||
}, {
|
||||
value: 3,
|
||||
label: '配餐 3'
|
||||
}],
|
||||
numberOptions: [],
|
||||
// 用法列表
|
||||
cateringUsageOptions: [{
|
||||
value: 1,
|
||||
@ -501,6 +486,10 @@ export default {
|
||||
listDepart().then(response => {
|
||||
this.departOptions = response.rows;
|
||||
})
|
||||
listNutritionFood().then(response => {
|
||||
console.log("yyc----",response)
|
||||
this.numberOptions = response.rows;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 响应营养配餐用餐安排多选列表
|
||||
@ -597,6 +586,7 @@ export default {
|
||||
const id = row.id || this.ids
|
||||
getCatering(id).then(response => {
|
||||
this.form = response.data;
|
||||
console.log(response.data);
|
||||
this.modifyItem = true;
|
||||
this.title = "修改配餐";
|
||||
});
|
||||
@ -608,7 +598,7 @@ export default {
|
||||
if (this.form.id != null) {
|
||||
updateCatering(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.modifyItem = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user