master
parent
3185a33c63
commit
f17be1d164
|
@ -52,6 +52,13 @@ public class DiseaseDetatilController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加病症详情
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/10/31 21:28
|
||||
* @param: [diseaseDetatil]
|
||||
* @return: com.grail.common.core.domain.R
|
||||
**/
|
||||
@PostMapping("/DrseaseDetaillAdd")
|
||||
public R DrseaseDetaillAdd (@RequestBody DiseaseDetatil diseaseDetatil){
|
||||
log.info("功能:添加病症,URI:{},方法:{},参数;{}",request.getRequestURI(),request.getMethod(),JSON.toJSONString(diseaseDetatil));
|
||||
|
@ -64,6 +71,18 @@ public class DiseaseDetatilController {
|
|||
}
|
||||
|
||||
|
||||
@PostMapping("/updateDsease")
|
||||
public R updateDsease(@RequestBody DiseaseDetatil diseaseDetatil){
|
||||
log.info("功能:修改病症,URI:{},方法:{},参数:{}",request.getRequestURI(),request.getMethod(),JSON.toJSONString(diseaseDetatil));
|
||||
|
||||
R r = diseaseDetatilServer.updateDsease(diseaseDetatil);
|
||||
|
||||
log.info("功能:修改病症,URI:{},方法:{},响应:{}",request.getRequestURI(),request.getMethod(),JSON.toJSONString(r.getMsg()));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -42,4 +42,6 @@ public class MedicineDetailController {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -20,4 +20,6 @@ public interface DiseaseDetatilMapper {
|
|||
|
||||
List<DiseaseDetatil> diseaseList(@Param("homepageName") String homepageName);
|
||||
|
||||
int updateDsease(DiseaseDetatil diseaseDetatil);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.grail.interrogation.service;
|
||||
|
||||
import com.grail.common.core.domain.R;
|
||||
import com.grail.interrogation.domain.DiseaseDetatil;
|
||||
import com.grail.interrogation.domain.HealthType;
|
||||
|
||||
|
@ -31,4 +32,6 @@ public interface DiseaseDetatilServer {
|
|||
* @return: int
|
||||
*/
|
||||
int DrseaseDetaillAdd(DiseaseDetatil diseaseDetatil);
|
||||
|
||||
R updateDsease(DiseaseDetatil diseaseDetatil);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.grail.interrogation.service.impl;
|
||||
|
||||
import com.grail.common.core.domain.R;
|
||||
import com.grail.common.security.utils.SecurityUtils;
|
||||
import com.grail.interrogation.domain.DiseaseDetatil;
|
||||
import com.grail.interrogation.domain.HealthType;
|
||||
import com.grail.interrogation.mapper.DiseaseDetatilMapper;
|
||||
|
@ -34,7 +35,22 @@ public class DiseaseDetatilServerImpl implements DiseaseDetatilServer {
|
|||
|
||||
@Override
|
||||
public int DrseaseDetaillAdd(DiseaseDetatil diseaseDetatil) {
|
||||
diseaseDetatil.setCreateId(
|
||||
Math.toIntExact(SecurityUtils.getUserId())
|
||||
);
|
||||
int i = diseaseDetatilMapper.DrseaseDetaillAdd(diseaseDetatil);
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R updateDsease(DiseaseDetatil diseaseDetatil) {
|
||||
|
||||
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||
|
||||
diseaseDetatil.setUpdateId(Math.toIntExact(userId));
|
||||
|
||||
int i = diseaseDetatilMapper.updateDsease(diseaseDetatil);
|
||||
|
||||
return i>0?R.ok("修改成功"):R.fail("修改失败");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.grail.interrogation.service.impl;
|
||||
|
||||
import com.grail.common.core.domain.R;
|
||||
import com.grail.interrogation.domain.DiseaseDetatil;
|
||||
import com.grail.interrogation.domain.Homepage;
|
||||
import com.grail.interrogation.domain.ListHomepage;
|
||||
|
@ -49,7 +48,9 @@ public class HomepageServerImpl implements HomepageServer {
|
|||
**/
|
||||
@Override
|
||||
public List<Homepage> homepageList() {
|
||||
// 根据redis 来进行试发正确
|
||||
if(redisService.hasKey(REDIS_HOMEPAGE)){
|
||||
// 查询出来,并删除
|
||||
List<Homepage> cacheList = redisService.getCacheList(REDIS_HOMEPAGE);
|
||||
return cacheList;
|
||||
}
|
||||
|
@ -72,16 +73,20 @@ public class HomepageServerImpl implements HomepageServer {
|
|||
**/
|
||||
@Override
|
||||
public Homepage homepageMedicineDiseaseList(HomepageRequest homepageRequest) {
|
||||
// 进行一个查询
|
||||
Homepage homepage = homepageMapper.homepageId(homepageRequest);
|
||||
|
||||
// pid进行一个判断,是否对应 1 , 2
|
||||
if(1 == homepage.getPid()){
|
||||
// 查序id 是不是有对应的数据
|
||||
List<MedicineDetail> list = medicineDetailMapper.List(homepage.getId());
|
||||
homepage.setMedicineDetailList(list);
|
||||
}else {
|
||||
// 判断是为错误的,联查的数据添加
|
||||
List<DiseaseDetatil> list = diseaseDetatilMapper.List(homepage.getId());
|
||||
// 赋值进去
|
||||
homepage.setDiseaseDetatilList(list);
|
||||
}
|
||||
|
||||
// 回显出去
|
||||
return homepage;
|
||||
}
|
||||
|
||||
|
@ -95,10 +100,15 @@ public class HomepageServerImpl implements HomepageServer {
|
|||
**/
|
||||
@Override
|
||||
public DiseaseMedicineResponse medicineDiseaseList(HomepageRequest homepageRequest) {
|
||||
// 创建一个为空的数据
|
||||
DiseaseMedicineResponse list = new DiseaseMedicineResponse();
|
||||
// 查询是否为空
|
||||
List<MedicineDetail> medicineDetailList = medicineDetailMapper.medicineList(homepageRequest.getHomepageName());
|
||||
// 更新操作
|
||||
List<DiseaseDetatil> diseaseDetatils = diseaseDetatilMapper.diseaseList(homepageRequest.getHomepageName());
|
||||
// 赋值上去
|
||||
list.setMedicineDetailList(medicineDetailList);
|
||||
// 赋值上去
|
||||
list.setDiseaseDetatils(diseaseDetatils);
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -54,4 +54,39 @@
|
|||
a.`status` = 3
|
||||
AND b.disease_name = #{homepageName}
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateDsease">
|
||||
update tb_disease_detatil
|
||||
from
|
||||
<if test="diseaseName!='' and diseaseName!=null">
|
||||
disease_name = #{diseaseName},
|
||||
</if>
|
||||
<if test="pathology!='' and pathology!=null">
|
||||
pathology = #{pathology},
|
||||
</if>
|
||||
<if test="symptom!='' and symptom!=null">
|
||||
symptom = #{symptom},
|
||||
</if>
|
||||
<if test="attention!='' and attention!=null">
|
||||
attention = #{attention},
|
||||
</if>
|
||||
<if test="westernTreatment != '' and westernTreatment != null">
|
||||
western_treatment = #{westernTreatment},
|
||||
</if>
|
||||
<if test="updateId != '' and updateId !=null">
|
||||
update_id = #{updateId},
|
||||
</if>
|
||||
<if test="image != '' and image!= null">
|
||||
image = #{image},
|
||||
</if>
|
||||
<if test="status != null and status!= ''">
|
||||
status = #{status},
|
||||
</if>
|
||||
updateDate = now()
|
||||
where update_id = #{updateId}
|
||||
|
||||
|
||||
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue