完善配餐功能修改

This commit is contained in:
ryoeiken 2020-12-08 11:31:29 +08:00
parent 2cf46f7fc8
commit 33fe8c08bb
8 changed files with 40 additions and 52 deletions

View File

@ -9,8 +9,6 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtCateringDao; import com.ruoyi.system.fantang.domain.FtCateringDao;
import com.ruoyi.system.fantang.service.IFtCateringDaoService; 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 lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -33,10 +31,6 @@ public class FtCateringDaoController extends BaseController {
private final IFtCateringDaoService iFtCateringDaoService; private final IFtCateringDaoService iFtCateringDaoService;
private final IFtDepartDaoService departDaoService;
private final IFtPatientDaoService patientDaoService;
/** /**
* 查询配餐功能列表 * 查询配餐功能列表
*/ */
@ -44,21 +38,6 @@ public class FtCateringDaoController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(FtCateringDao ftCateringDao) { public TableDataInfo list(FtCateringDao ftCateringDao) {
startPage(); 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); List<FtCateringDao> list = iFtCateringDaoService.listNewFormatter(ftCateringDao);
return getDataTable(list); return getDataTable(list);
} }
@ -82,7 +61,8 @@ public class FtCateringDaoController extends BaseController {
@PreAuthorize("@ss.hasPermi('fantang:catering:query')") @PreAuthorize("@ss.hasPermi('fantang:catering:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtCateringDaoService.getById(id)); FtCateringDao ftCateringDao = iFtCateringDaoService.getByIdNewFormatter(id);
return AjaxResult.success(ftCateringDao);
} }
/** /**

View File

@ -103,6 +103,4 @@ public class FtCateringDao extends FtCateringVo {
*/ */
@Excel(name = "描述") @Excel(name = "描述")
private String cateringDescribe; private String cateringDescribe;
private String hospitalId;
} }

View File

@ -14,4 +14,6 @@ import java.util.List;
public interface FtCateringDaoMapper extends BaseMapper<FtCateringDao> { public interface FtCateringDaoMapper extends BaseMapper<FtCateringDao> {
List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao); List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao);
FtCateringDao getByIdNewFormatter(Long id);
} }

View File

@ -14,4 +14,6 @@ import java.util.List;
public interface IFtCateringDaoService extends IService<FtCateringDao> { public interface IFtCateringDaoService extends IService<FtCateringDao> {
List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao); List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao);
FtCateringDao getByIdNewFormatter(Long id);
} }

View File

@ -21,4 +21,9 @@ public class FtCateringDaoServiceImpl extends ServiceImpl<FtCateringDaoMapper, F
public List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao) { public List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao) {
return this.baseMapper.listNewFormatter(ftCateringDao); return this.baseMapper.listNewFormatter(ftCateringDao);
} }
@Override
public FtCateringDao getByIdNewFormatter(Long id) {
return this.baseMapper.getByIdNewFormatter(id);
}
} }

View File

@ -27,4 +27,6 @@ public class FtCateringVo {
@TableField(exist = false) @TableField(exist = false)
private String name; private String name;
@TableField(exist = false)
private String hospitalId;
} }

View File

@ -29,4 +29,13 @@
<if test="hospitalId != null">and b.hospital_id = #{hospitalId}</if> <if test="hospitalId != null">and b.hospital_id = #{hospitalId}</if>
<if test="flag != null">and a.flag = #{flag}</if> <if test="flag != null">and a.flag = #{flag}</if>
</select> </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> </mapper>

View File

@ -320,7 +320,8 @@
<el-form-item label="科室" prop="departId"> <el-form-item label="科室" prop="departId">
<el-select v-model="form.departId" <el-select v-model="form.departId"
placeholder="请选择科室" placeholder="请选择科室"
@change="changeDepart"> @change="changeDepart"
:disabled="true">
<el-option <el-option
v-for="item in departOptions" v-for="item in departOptions"
:key="item.departName" :key="item.departName"
@ -330,14 +331,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="病人" prop="patientId"> <el-form-item label="病人" prop="patientId">
<el-select v-model="form.patientId" placeholder="请选择病人" @change="changePatient"> <el-input v-model="form.name" :disabled="true"></el-input>
<el-option
v-for="item in patientOptions"
:key="item.name"
:label="item.name"
:value="item.patientId"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="床号" prop="bedId"> <el-form-item label="床号" prop="bedId">
<el-input v-model="form.bedId" placeholder="床号" :disabled="true"/> <el-input v-model="form.bedId" placeholder="床号" :disabled="true"/>
@ -348,9 +342,9 @@
<el-select v-model="form.number" placeholder="请选择配餐号"> <el-select v-model="form.number" placeholder="请选择配餐号">
<el-option <el-option
v-for="item in numberOptions" v-for="item in numberOptions"
:key="item.label" :key="item.name"
:label="item.label" :label="item.name"
:value="item.value" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -370,11 +364,10 @@
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="正餐类型" prop="types"> <el-form-item label="正餐类型" prop="type">
<el-select v-model="form.types" <el-select v-model="form.type"
multiple placeholder="请选择正餐类型"
@change="changeDinnerType" :disabled="true">
placeholder="请选择正餐类型">
<el-option <el-option
v-for="dict in typeOptions" v-for="dict in typeOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -418,6 +411,7 @@ import {
} from "@/api/fantang/catering"; } from "@/api/fantang/catering";
import {listDepart} from "@/api/fantang/depart"; import {listDepart} from "@/api/fantang/depart";
import {getBedIdById, selectPatientByDepartId} from "@/api/fantang/patient"; import {getBedIdById, selectPatientByDepartId} from "@/api/fantang/patient";
import {listNutritionFood} from "@/api/fantang/nutritionFood";
export default { export default {
name: "Catering", name: "Catering",
@ -425,16 +419,7 @@ export default {
data() { data() {
return { return {
// //
numberOptions: [{ numberOptions: [],
value: 1,
label: '配餐 1'
}, {
value: 2,
label: '配餐 2'
}, {
value: 3,
label: '配餐 3'
}],
// //
cateringUsageOptions: [{ cateringUsageOptions: [{
value: 1, value: 1,
@ -501,6 +486,10 @@ export default {
listDepart().then(response => { listDepart().then(response => {
this.departOptions = response.rows; this.departOptions = response.rows;
}) })
listNutritionFood().then(response => {
console.log("yyc----",response)
this.numberOptions = response.rows;
})
}, },
methods: { methods: {
// //
@ -597,6 +586,7 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getCatering(id).then(response => { getCatering(id).then(response => {
this.form = response.data; this.form = response.data;
console.log(response.data);
this.modifyItem = true; this.modifyItem = true;
this.title = "修改配餐"; this.title = "修改配餐";
}); });
@ -608,7 +598,7 @@ export default {
if (this.form.id != null) { if (this.form.id != null) {
updateCatering(this.form).then(response => { updateCatering(this.form).then(response => {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.modifyItem = false;
this.getList(); this.getList();
}); });
} else { } else {