From d1abd1ef9c4b33d4c0fe9c15a43996b2f9f67048 Mon Sep 17 00:00:00 2001 From: whywhyo <1511349576@qq.com> Date: 星期三, 19 七月 2023 20:38:35 +0800 Subject: [PATCH] 4577 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthBaseController.java | 107 ++++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZRotationController.java | 2 zhang-content/src/main/java/com/ruoyi/service/ZHealthNoteService.java | 13 zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthBaseServiceImpl.java | 74 +++ zhang-content/src/main/java/com/ruoyi/domain/ZInfoUser.java | 11 zhang-content/src/main/java/com/ruoyi/service/ZInfoUserService.java | 4 zhang-content/src/main/java/com/ruoyi/domain/ZHealthNow.java | 40 + zhang-content/src/main/java/com/ruoyi/domain/ZfCode.java | 21 zhang-content/src/main/java/com/ruoyi/domain/ZHealthBase.java | 189 ------- ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAuthorityController.java | 61 ++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteController.java | 3 zhang-content/src/main/java/com/ruoyi/service/impl/ZInfoUserServiceImpl.java | 8 zhang-content/src/main/java/com/ruoyi/service/ZfFamilyService.java | 7 zhang-content/src/main/java/com/ruoyi/mapper/ZfCodeMapper.java | 15 zhang-content/src/main/java/com/ruoyi/service/ZAuthorityService.java | 6 zhang-content/src/main/java/com/ruoyi/domain/dto/EmpowerDto.java | 15 zhang-content/src/main/java/com/ruoyi/domain/dto/ZHealthBaseDto.java | 50 ++ zhang-content/src/main/java/com/ruoyi/service/impl/ZfCodeServiceImpl.java | 39 + zhang-content/src/main/java/com/ruoyi/service/ZfCodeService.java | 18 zhang-content/src/main/java/com/ruoyi/domain/ZHealthHabit.java | 133 ---- zhang-content/src/main/java/com/ruoyi/mapper/ZHealthNoteMapper.java | 15 ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthNoteController.java | 10 ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthNowController.java | 10 zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthNowServiceImpl.java | 17 zhang-content/src/main/java/com/ruoyi/domain/ZHealthInfo.java | 272 ---------- zhang-content/src/main/java/com/ruoyi/domain/health/GeneticDisease.java | 18 zhang-content/src/main/java/com/ruoyi/domain/dto/AuthorityDto.java | 30 + zhang-content/src/main/java/com/ruoyi/domain/health/AllergyHistory.java | 17 zhang-content/src/main/java/com/ruoyi/domain/ZHealthNote.java | 42 + zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthNoteServiceImpl.java | 17 zhang-content/src/main/java/com/ruoyi/service/impl/ZfFamilyServiceImpl.java | 7 zhang-content/src/main/java/com/ruoyi/service/impl/ZAuthorityServiceImpl.java | 71 ++ zhang-content/src/main/java/com/ruoyi/domain/health/BloodType.java | 21 zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretServiceImpl.java | 1 ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java | 18 zhang-content/src/main/java/com/ruoyi/service/ZHealthBaseService.java | 5 zhang-content/src/main/java/com/ruoyi/service/ZHealthNowService.java | 13 zhang-content/src/main/java/com/ruoyi/mapper/ZHealthNowMapper.java | 15 38 files changed, 835 insertions(+), 580 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAuthorityController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAuthorityController.java new file mode 100644 index 0000000..e62117a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZAuthorityController.java @@ -0,0 +1,61 @@ +package com.ruoyi.web.controller.zhang; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.domain.ZAuthority; +import com.ruoyi.domain.dto.AuthorityDto; +import com.ruoyi.service.ZAuthorityService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.websocket.server.PathParam; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-16 21:10 + * @Version 1.0.0 + **/ +@RestController +@RequestMapping("/authority") +public class ZAuthorityController { + @Resource + ZAuthorityService zAuthorityService; + +// /** +// * 鏌ョ湅鑷繁鐨勬潈闄� +// */ +// @GetMapping("/all") +// public AjaxResult getMyAuthority(){ +// return AjaxResult.success(zAuthorityService.getAuthority()); +// } +// +// /** +// * 鏌ョ湅鑷繁鏈夊摢浜涘搴殑鏉冮檺 +// */ +// @GetMapping("/familyName") +// public AjaxResult getFamilyName(){ +// return AjaxResult.success(zAuthorityService.getAuthorityFamilyName()); +// } + + /** + * 鏍规嵁鏉′欢鏌ョ湅鏉冮檺 + */ + @GetMapping("/condition") + public AjaxResult getAuthorityByCondition(@RequestBody AuthorityDto authorityDto){ + return AjaxResult.success(zAuthorityService.getByCondition(authorityDto)); + } + +// /** +// * 鎺堟潈(鍙湁瀹跺涵绠$悊鍛樻墠鑳借皟鐢ㄨ繖涓帴鍙�) +// */ +// @PostMapping("/empower") +// public AjaxResult empower(){ +// +// } + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthBaseController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthBaseController.java index e1aa3c2..a5b25cb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthBaseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthBaseController.java @@ -1,9 +1,26 @@ package com.ruoyi.web.controller.zhang; -import org.springframework.web.bind.annotation.RequestMapping; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.domain.ZHealthBase; +import com.ruoyi.domain.dto.ZHealthBaseDto; +import com.ruoyi.service.ZHealthBaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; +import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; /** * <p> @@ -16,6 +33,92 @@ @RestController @RequestMapping("/zHealthBase") public class ZHealthBaseController { + @Autowired + private ZHealthBaseService zHealthBaseService; + + /** + * 鏌ヨ鏁版嵁 + */ + @GetMapping("/all") + public AjaxResult listAll(){ + return AjaxResult.success(zHealthBaseService.selectData()); + } + +// /** +// * 鏍规嵁id鏌ヨ +// */ +// @GetMapping() +// public AjaxResult listById(Long id){ +// return AjaxResult.success(zHealthBaseService.getById(id)); +// } + +// /** +// * 妯℃澘 +// */ +// @GetMapping("/model") +// public void getModel(HttpServletResponse response){ +// ZHealthBase zHealthBase = new ZHealthBase(); +// List<ZHealthBase> emptyList = Collections.singletonList(zHealthBase); +// ExcelUtil<ZHealthBase> util = new ExcelUtil<>(ZHealthBase.class); +// util.exportExcel(response, emptyList, "鍋ュ悍鍩烘湰淇℃伅璁板綍鏁版嵁"); +// } +// +// /** +// * 瀵煎嚭鍋ュ悍鍩烘湰淇℃伅璁板綍鍒楄〃 +// */ +//// @PreAuthorize("@ss.hasPermi('system:property:export')") +// @Log(title = "鍋ュ悍鍩烘湰淇℃伅璁板綍", businessType = BusinessType.EXPORT) +// @PostMapping("/export/{ids}") +// public void export(HttpServletResponse response,@PathVariable Long[] ids) +// { +// List<ZHealthBase> list = zHealthBaseService.selectByIds(ids); +// ExcelUtil<ZHealthBase> util = new ExcelUtil<>(ZHealthBase.class); +// util.exportExcel(response, list, "鍋ュ悍鍩烘湰淇℃伅璁板綍鏁版嵁"); +// } + +// /** +// * 瀵煎叆鍋ュ悍鍩烘湰淇℃伅璁板綍鍒楄〃 +// */ +// @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.IMPORT) +// @PostMapping("/importData") +// public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception +// { +// return zHealthBaseService.importExcel(file); +// } + +// /** +// * 鏂板鍋ュ悍鍩烘湰淇℃伅璁板綍 +// */ +//// @PreAuthorize("@ss.hasPermi('system:property:add')") +// @Log(title = "鍋ュ悍鍩烘湰淇℃伅璁板綍", businessType = BusinessType.INSERT) +// @PostMapping +// public AjaxResult add(@RequestBody ZHealthBase zHealthBase) +// { +// return zHealthBaseService.addData(zHealthBase); +// } + + /** + * 鏂板鎴栦慨鏀瑰仴搴峰熀鏈俊鎭褰� + */ +// @PreAuthorize("@ss.hasPermi('system:property:edit')") + @Log(title = "鍋ュ悍鍩烘湰淇℃伅璁板綍", businessType = BusinessType.UPDATE) + @PostMapping + public AjaxResult edit(@RequestBody ZHealthBaseDto zHealthBaseDto) + { + return zHealthBaseService.saveOrUpdateData(zHealthBaseDto); + } + +//// +// /** +// * 鎵归噺鍒犻櫎鍋ュ悍鍩烘湰淇℃伅璁板綍 +// */ +//// @PreAuthorize("@ss.hasPermi('system:property:remove')") +// @Log(title = "鍋ュ悍鍩烘湰淇℃伅璁板綍", businessType = BusinessType.DELETE) +// @DeleteMapping("/{ids}") +// public AjaxResult remove(@PathVariable Long[] ids) +// { +// return zHealthBaseService.delete(Arrays.asList(ids)); +// } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthNoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthNoteController.java new file mode 100644 index 0000000..d5cf1b5 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthNoteController.java @@ -0,0 +1,10 @@ +package com.ruoyi.web.controller.zhang; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:30 + * @Version 1.0.0 + **/ +public class ZHealthNoteController { +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthNowController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthNowController.java new file mode 100644 index 0000000..bf94964 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZHealthNowController.java @@ -0,0 +1,10 @@ +package com.ruoyi.web.controller.zhang; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:30 + * @Version 1.0.0 + **/ +public class ZHealthNowController { +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java index 9ee14ef..a473bbe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java @@ -12,7 +12,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.domain.ZInfoUser; import com.ruoyi.domain.ZfRelation; -import com.ruoyi.domain.dto.EmpowerDto; + import com.ruoyi.domain.dto.Genealogy; import com.ruoyi.domain.dto.GenealogyExportDto; import com.ruoyi.domain.dto.RelationDto; @@ -182,14 +182,14 @@ } - /** - * 鎺堟潈 - */ - @PostMapping("/empower") - public AjaxResult empower(@RequestBody EmpowerDto empowerDto){ - - return zInfoUserService.empower(empowerDto); - } +// /** +// * 鎺堟潈 +// */ +// @PostMapping("/empower") +// public AjaxResult empower(@RequestBody EmpowerDto empowerDto){ +// +// return zInfoUserService.empower(empowerDto); +// } /** * 瀹舵牴缃� diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZRotationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZRotationController.java index 374441f..f12fe00 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZRotationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZRotationController.java @@ -33,7 +33,7 @@ } @PostMapping("/add") - public AjaxResult addRotation(ZRotation zRotation){ + public AjaxResult addRotation(@RequestBody ZRotation zRotation){ SysUser user = SecurityUtils.getLoginUser().getUser(); Long userId = user.getUserId(); zRotation.setUid(userId); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteController.java index aa5e2a4..bd4919f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZSelfNoteController.java @@ -16,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import javax.websocket.server.PathParam; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -52,7 +53,7 @@ * 鏍规嵁id鏌ヨ */ @GetMapping() - public AjaxResult listById(Long id){ + public AjaxResult listById(@PathParam("id") Long id){ return AjaxResult.success(zSelfNoteService.getById(id)); } diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZHealthBase.java b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthBase.java index 3c28234..282655e 100644 --- a/zhang-content/src/main/java/com/ruoyi/domain/ZHealthBase.java +++ b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthBase.java @@ -3,6 +3,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + import java.io.Serializable; /** @@ -13,195 +15,38 @@ * @author ojq * @since 2023-03-14 */ +@Data @TableName("z_health_base") public class ZHealthBase implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private Long id; - /** - * 鍚嶅瓧 - */ - private String nickName; + private Long uid; // 鎵�灞炵敤鎴穒d - /** - * 鎬у埆锛�0锛氬コ銆�1锛氱敺 - */ - private Integer sex; + private String name; // 濮撳悕 - /** - * 鏂囧寲绋嬪害 - */ - private String education; + private Integer sex; // 鎬у埆锛�1锛氱敺锛�0锛氬コ - /** - * 鑱屼笟 - */ - private String occupation; + private String educationLevel; // 鏂囧寲绋嬪害 - /** - * 鎵嬫満鍙� - */ - private String phoneNumber; + private String work; // 鑱屼笟 - /** - * 閭 - */ - private String email; + private String phone; // 鐢佃瘽 - /** - * 浣忓潃 - */ - private String address; + private String email; // 鐢靛瓙閭欢 - /** - * 琛�鍨� - */ - private Integer bloodType; + private String address; // 浣忓潃 - /** - * 杩囨晱鍙� - */ - private Integer allergy; + private String blood; // 琛�鍨�(json鏁扮粍) - /** - * 閬椾紶鐥呭彶 - */ - private Integer heritableDisease; + private String allergy; // 杩囨晱鍙�(json鏁扮粍) - /** - * 甯哥敤鑽墿 - */ - private String medicinal; + private String geneticDisease; // 閬椾紶鐥呭彶(json鏁扮粍) - /** - * 鐩墠鍩虹鐥� - */ - private String baseDisease; + private String medicine; // 甯哥敤鑽墿 - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getNickName() { - return nickName; - } - - public void setNickName(String nickName) { - this.nickName = nickName; - } - - public Integer getSex() { - return sex; - } - - public void setSex(Integer sex) { - this.sex = sex; - } - - public String getEducation() { - return education; - } - - public void setEducation(String education) { - this.education = education; - } - - public String getOccupation() { - return occupation; - } - - public void setOccupation(String occupation) { - this.occupation = occupation; - } - - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public Integer getBloodType() { - return bloodType; - } - - public void setBloodType(Integer bloodType) { - this.bloodType = bloodType; - } - - public Integer getAllergy() { - return allergy; - } - - public void setAllergy(Integer allergy) { - this.allergy = allergy; - } - - public Integer getHeritableDisease() { - return heritableDisease; - } - - public void setHeritableDisease(Integer heritableDisease) { - this.heritableDisease = heritableDisease; - } - - public String getMedicinal() { - return medicinal; - } - - public void setMedicinal(String medicinal) { - this.medicinal = medicinal; - } - - public String getBaseDisease() { - return baseDisease; - } - - public void setBaseDisease(String baseDisease) { - this.baseDisease = baseDisease; - } - - @Override - public String toString() { - return "ZHealthBase{" + - "id=" + id + - ", nickName=" + nickName + - ", sex=" + sex + - ", education=" + education + - ", occupation=" + occupation + - ", phoneNumber=" + phoneNumber + - ", email=" + email + - ", address=" + address + - ", bloodType=" + bloodType + - ", allergy=" + allergy + - ", heritableDisease=" + heritableDisease + - ", medicinal=" + medicinal + - ", baseDisease=" + baseDisease + - "}"; - } + private String baseDisease; // 鐩墠鍩虹鐥� } diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZHealthHabit.java b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthHabit.java index ffa517b..db8525a 100644 --- a/zhang-content/src/main/java/com/ruoyi/domain/ZHealthHabit.java +++ b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthHabit.java @@ -3,6 +3,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + import java.io.Serializable; /** @@ -14,138 +16,35 @@ * @since 2023-03-14 */ @TableName("z_health_habit") +@Data public class ZHealthHabit implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private Long id; - /** - * 鍋ュ悍琛ㄦ墍灞炶�卛d - */ - private Integer hid; + private Long uid; // 鎵�灞炵敤鎴穒d - /** - * 楗鍠滃ソ涓庡繉鍙� - */ - private String eat; + private String eatGood; // 楗(鍠�) - /** - * 鐖卞ソ涓庡棞濂� - */ - private String hobby; + private String eatBad; // 楗(蹇�) - /** - * 鐫$湢鐘舵�� - */ - private String sleep; + private String hobby; // 鐖卞ソ - /** - * 澶т究鐘舵�� - */ - private String bigEgestion; + private String addition; // 鍡滃ソ - /** - * 灏忎究鐘舵�� - */ - private String smallEgestion; + private String sleep; // 鐫$湢鐘舵��(json) - /** - * 楗涔犳儻 - */ - private String eatType; + private String bigEgestionStatus; // 澶т究瑙勫緥(json) - /** - * 鐢熸椿浜嬩欢 - */ - private String lifeType; + private String smallEgestionStatus; // 灏忎究瑙勫緥(json) + private String bigEgestion; // 澶т究 - public Integer getId() { - return id; - } + private String smallEgestion; // 灏忎究 - public void setId(Integer id) { - this.id = id; - } + private String eatType; // 楗涔犳儻(json) - public Integer getHid() { - return hid; - } - - public void setHid(Integer hid) { - this.hid = hid; - } - - public String getEat() { - return eat; - } - - public void setEat(String eat) { - this.eat = eat; - } - - public String getHobby() { - return hobby; - } - - public void setHobby(String hobby) { - this.hobby = hobby; - } - - public String getSleep() { - return sleep; - } - - public void setSleep(String sleep) { - this.sleep = sleep; - } - - public String getBigEgestion() { - return bigEgestion; - } - - public void setBigEgestion(String bigEgestion) { - this.bigEgestion = bigEgestion; - } - - public String getSmallEgestion() { - return smallEgestion; - } - - public void setSmallEgestion(String smallEgestion) { - this.smallEgestion = smallEgestion; - } - - public String getEatType() { - return eatType; - } - - public void setEatType(String eatType) { - this.eatType = eatType; - } - - public String getLifeType() { - return lifeType; - } - - public void setLifeType(String lifeType) { - this.lifeType = lifeType; - } - - @Override - public String toString() { - return "ZHealthHabit{" + - "id=" + id + - ", hid=" + hid + - ", eat=" + eat + - ", hobby=" + hobby + - ", sleep=" + sleep + - ", bigEgestion=" + bigEgestion + - ", smallEgestion=" + smallEgestion + - ", eatType=" + eatType + - ", lifeType=" + lifeType + - "}"; - } + private String lifeType; // 鐢熸椿浜嬩欢(json) } diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZHealthInfo.java b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthInfo.java index b1e0c40..18656d5 100644 --- a/zhang-content/src/main/java/com/ruoyi/domain/ZHealthInfo.java +++ b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthInfo.java @@ -3,6 +3,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + import java.io.Serializable; /** @@ -14,278 +16,34 @@ * @since 2023-03-14 */ @TableName("z_health_info") +@Data public class ZHealthInfo implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private Long id; - /** - * 鍋ュ悍琛ㄦ墍灞炶�卛d - */ - private Integer hid; + private Long uid; // 鍋ュ悍琛ㄦ墍灞炶�卛d - /** - * 浣撴俯 - */ - private String temperature; + private String temperature; // 浣撴俯 - /** - * 鑴夋悘 - */ - private String pulse; + private String pulse; // 鑴夋悘 - /** - * 鍛煎惛 - */ - private String breathe; + private String breathe; // 鍛煎惛 - /** - * 琛�鍘� - */ - private String bloodPressure; + private String bloodPressure; // 琛�鍘� - /** - * 浣撻噸kg - */ - private String weight; + private String weight; // 浣撻噸kg - /** - * 鍥涜偄娲诲姩鎯呭喌 - */ - private String movement; + private String movement; // 鍥涜偄娲诲姩鎯呭喌 - /** - * 鐨偆鎯呭喌 - */ - private String skinType; + private String skinType; // 鐨偆鎯呭喌 - /** - * 蹇冪悊鐘舵�� - */ - private String psychologyType; + private String psychologyType; // 蹇冪悊鐘舵�� - /** - * 闈㈠鐤剧梾鐨勬�佸害 - */ - private String attitude; + private String attitude; // 闈㈠鐤剧梾鐨勬�佸害 - /** - * 鍏ㄨ韩钀ュ吇鐘跺喌 - */ - private String nutrition; + private String nutrition; // 鍏ㄨ韩钀ュ吇鐘跺喌 - /** - * 鑴戣绠$柧鐥� - */ - private String brain; - - /** - * 蹇冭剰鐤剧梾 - */ - private String heart; - - /** - * 琛�绠$柧鐥� - */ - private String blood; - - /** - * 娑堝寲绯荤粺鐤剧梾 - */ - private String digestiveSystem; - - /** - * 鍛煎惛绯荤粺鐤剧梾 - */ - private String breathSystem; - - /** - * 鑲捐剰鐤剧梾 - */ - private String kidney; - - /** - * 鍏朵粬鐤剧梾 - */ - private String other; - - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getHid() { - return hid; - } - - public void setHid(Integer hid) { - this.hid = hid; - } - - public String getTemperature() { - return temperature; - } - - public void setTemperature(String temperature) { - this.temperature = temperature; - } - - public String getPulse() { - return pulse; - } - - public void setPulse(String pulse) { - this.pulse = pulse; - } - - public String getBreathe() { - return breathe; - } - - public void setBreathe(String breathe) { - this.breathe = breathe; - } - - public String getBloodPressure() { - return bloodPressure; - } - - public void setBloodPressure(String bloodPressure) { - this.bloodPressure = bloodPressure; - } - - public String getWeight() { - return weight; - } - - public void setWeight(String weight) { - this.weight = weight; - } - - public String getMovement() { - return movement; - } - - public void setMovement(String movement) { - this.movement = movement; - } - - public String getSkinType() { - return skinType; - } - - public void setSkinType(String skinType) { - this.skinType = skinType; - } - - public String getPsychologyType() { - return psychologyType; - } - - public void setPsychologyType(String psychologyType) { - this.psychologyType = psychologyType; - } - - public String getAttitude() { - return attitude; - } - - public void setAttitude(String attitude) { - this.attitude = attitude; - } - - public String getNutrition() { - return nutrition; - } - - public void setNutrition(String nutrition) { - this.nutrition = nutrition; - } - - public String getBrain() { - return brain; - } - - public void setBrain(String brain) { - this.brain = brain; - } - - public String getHeart() { - return heart; - } - - public void setHeart(String heart) { - this.heart = heart; - } - - public String getBlood() { - return blood; - } - - public void setBlood(String blood) { - this.blood = blood; - } - - public String getDigestiveSystem() { - return digestiveSystem; - } - - public void setDigestiveSystem(String digestiveSystem) { - this.digestiveSystem = digestiveSystem; - } - - public String getBreathSystem() { - return breathSystem; - } - - public void setBreathSystem(String breathSystem) { - this.breathSystem = breathSystem; - } - - public String getKidney() { - return kidney; - } - - public void setKidney(String kidney) { - this.kidney = kidney; - } - - public String getOther() { - return other; - } - - public void setOther(String other) { - this.other = other; - } - - @Override - public String toString() { - return "ZHealthInfo{" + - "id=" + id + - ", hid=" + hid + - ", temperature=" + temperature + - ", pulse=" + pulse + - ", breathe=" + breathe + - ", bloodPressure=" + bloodPressure + - ", weight=" + weight + - ", movement=" + movement + - ", skinType=" + skinType + - ", psychologyType=" + psychologyType + - ", attitude=" + attitude + - ", nutrition=" + nutrition + - ", brain=" + brain + - ", heart=" + heart + - ", blood=" + blood + - ", digestiveSystem=" + digestiveSystem + - ", breathSystem=" + breathSystem + - ", kidney=" + kidney + - ", other=" + other + - "}"; - } } diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZHealthNote.java b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthNote.java new file mode 100644 index 0000000..1fe6d46 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthNote.java @@ -0,0 +1,42 @@ +package com.ruoyi.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:19 + * @Version 1.0.0 + **/ +@Data +public class ZHealthNote implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long uid; // 鐢ㄦ埛id + + private String lifeHabits; // 鐢熸椿涔犳儻 + + private String historyDisease; // 浠ュ線鐥呭彶 + + private String treatmentInfo; // 璇婃不鎯呭喌 + + private String familyDisease; // 瀹舵棌鐥呭彶 + + private String nowDisease; // 鐜扮梾鍙� + + private String diseaseHappen; // 鐤剧梾鐨勫彂鐢� + + private String diseaseDevelop; // 鐤剧梾鐨勫彂灞� + + private String diseaseTreat; // 鐤剧梾鐨勬不鐤� + + private String diseaseBack; // 鐤剧梾鐨勮浆褰� +} diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZHealthNow.java b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthNow.java new file mode 100644 index 0000000..76e68a5 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/domain/ZHealthNow.java @@ -0,0 +1,40 @@ +package com.ruoyi.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:17 + * @Version 1.0.0 + **/ +@Data +public class ZHealthNow implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long uid; // 鐢ㄦ埛id + + private String brain; // 鑴戣绠$柧鐥� + + private String heart; // 蹇冭剰鐤剧梾 + + private String blood; // 琛�绠$柧鐥� + + + private String digestiveSystem; // 娑堝寲绯荤粺鐤剧梾 + + + private String breathSystem; // 鍛煎惛绯荤粺鐤剧梾 + + private String kidney; // 鑲捐剰鐤剧梾 + + private String other; // 鍏朵粬鐤剧梾 +} diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZInfoUser.java b/zhang-content/src/main/java/com/ruoyi/domain/ZInfoUser.java index 33cef64..699d7c5 100644 --- a/zhang-content/src/main/java/com/ruoyi/domain/ZInfoUser.java +++ b/zhang-content/src/main/java/com/ruoyi/domain/ZInfoUser.java @@ -188,6 +188,17 @@ private Date birth; /** + * 鍒涘缓鏃堕棿 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createTime; + + /** + * 閭 + */ + private String email; + + /** * 涓汉鑳屾櫙鍥剧墖銆佽棰� */ private String url; diff --git a/zhang-content/src/main/java/com/ruoyi/domain/ZfCode.java b/zhang-content/src/main/java/com/ruoyi/domain/ZfCode.java new file mode 100644 index 0000000..9042e3d --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/domain/ZfCode.java @@ -0,0 +1,21 @@ +package com.ruoyi.domain; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-16 23:28 + * @Version 1.0.0 + **/ +@Data +public class ZfCode implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private String name; + private Long code; + +} diff --git a/zhang-content/src/main/java/com/ruoyi/domain/dto/AuthorityDto.java b/zhang-content/src/main/java/com/ruoyi/domain/dto/AuthorityDto.java new file mode 100644 index 0000000..9e893bf --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/domain/dto/AuthorityDto.java @@ -0,0 +1,30 @@ +package com.ruoyi.domain.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-16 22:05 + * @Version 1.0.0 + **/ +@Data +public class AuthorityDto implements Serializable { + private static final long serialVersionUID = 1L; + + private String familyName; + + private String modelName; + + private Integer search = 0; + + private Integer insert = 0; + + private Integer update = 0; + + private Integer delete = 0; + + +} diff --git a/zhang-content/src/main/java/com/ruoyi/domain/dto/EmpowerDto.java b/zhang-content/src/main/java/com/ruoyi/domain/dto/EmpowerDto.java index 8a524db..735d325 100644 --- a/zhang-content/src/main/java/com/ruoyi/domain/dto/EmpowerDto.java +++ b/zhang-content/src/main/java/com/ruoyi/domain/dto/EmpowerDto.java @@ -15,20 +15,5 @@ public class EmpowerDto implements Serializable { private static final long serialVersionUID = 1L; - /** - * 鎺堟潈鐨勭敤鎴穒d - */ - private String userId; - - /** - * 鎺堟潈鐨勫搴彿 - */ - private String familyId; - - /** - * 鎺堟潈鐨勮彍鍗昳d - */ - private List<String> authorityList; - } diff --git a/zhang-content/src/main/java/com/ruoyi/domain/dto/ZHealthBaseDto.java b/zhang-content/src/main/java/com/ruoyi/domain/dto/ZHealthBaseDto.java new file mode 100644 index 0000000..4801792 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/domain/dto/ZHealthBaseDto.java @@ -0,0 +1,50 @@ +package com.ruoyi.domain.dto; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.ruoyi.domain.health.AllergyHistory; +import com.ruoyi.domain.health.BloodType; +import com.ruoyi.domain.health.GeneticDisease; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 14:35 + * @Version 1.0.0 + **/ +@Data +public class ZHealthBaseDto implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long uid; // 鎵�灞炵敤鎴穒d + + private String name; // 濮撳悕 + + private Integer sex; // 鎬у埆锛�1锛氱敺锛�0锛氬コ + + private String educationLevel; // 鏂囧寲绋嬪害 + + private String work; // 鑱屼笟 + + private String phone; // 鐢佃瘽 + + private String email; // 鐢靛瓙閭欢 + + private String address; // 浣忓潃 + + private BloodType bloodClass; // 琛�鍨�(json鏁扮粍) + + private AllergyHistory allergyClass; // 杩囨晱鍙�(json鏁扮粍) + + private GeneticDisease geneticDiseaseClass; // 閬椾紶鐥呭彶(json鏁扮粍) + + private String medicine; // 甯哥敤鑽墿 + + private String baseDisease; // 鐩墠鍩虹鐥� +} diff --git a/zhang-content/src/main/java/com/ruoyi/domain/health/AllergyHistory.java b/zhang-content/src/main/java/com/ruoyi/domain/health/AllergyHistory.java new file mode 100644 index 0000000..1addd62 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/domain/health/AllergyHistory.java @@ -0,0 +1,17 @@ +package com.ruoyi.domain.health; + +import lombok.Data; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 14:29 + * @Version 1.0.0 + **/ +@Data +public class AllergyHistory { + private Integer medicine = 0; + private Integer food = 0; + private Integer other = 0; + private String otherText = ""; +} diff --git a/zhang-content/src/main/java/com/ruoyi/domain/health/BloodType.java b/zhang-content/src/main/java/com/ruoyi/domain/health/BloodType.java new file mode 100644 index 0000000..fd9d7fc --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/domain/health/BloodType.java @@ -0,0 +1,21 @@ +package com.ruoyi.domain.health; + +import lombok.Data; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 14:28 + * @Version 1.0.0 + **/ +@Data +public class BloodType { + private Integer a = 0; + private Integer b = 0; + private Integer o = 0; + private Integer ab = 0; + private Integer rh = 0; + private Integer other = 0; + private String otherText = ""; + private Integer unknown= 0 ; +} diff --git a/zhang-content/src/main/java/com/ruoyi/domain/health/GeneticDisease.java b/zhang-content/src/main/java/com/ruoyi/domain/health/GeneticDisease.java new file mode 100644 index 0000000..fe6cec4 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/domain/health/GeneticDisease.java @@ -0,0 +1,18 @@ +package com.ruoyi.domain.health; + +import lombok.Data; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 14:31 + * @Version 1.0.0 + **/ +@Data +public class GeneticDisease { + private Integer hypertension = 0;//楂樿鍘� + private Integer diabetes = 0;//绯栧翱鐥� + private Integer tumor = 0;//鑲跨槫 + private Integer other = 0;//鍏跺畠 + private String otherText = ""; +} diff --git a/zhang-content/src/main/java/com/ruoyi/mapper/ZHealthNoteMapper.java b/zhang-content/src/main/java/com/ruoyi/mapper/ZHealthNoteMapper.java new file mode 100644 index 0000000..bce7406 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/mapper/ZHealthNoteMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.domain.ZHealthNote; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:22 + * @Version 1.0.0 + **/ +@Mapper +public interface ZHealthNoteMapper extends BaseMapper<ZHealthNote> { +} diff --git a/zhang-content/src/main/java/com/ruoyi/mapper/ZHealthNowMapper.java b/zhang-content/src/main/java/com/ruoyi/mapper/ZHealthNowMapper.java new file mode 100644 index 0000000..11e8163 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/mapper/ZHealthNowMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.domain.ZHealthNow; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:22 + * @Version 1.0.0 + **/ +@Mapper +public interface ZHealthNowMapper extends BaseMapper<ZHealthNow> { +} diff --git a/zhang-content/src/main/java/com/ruoyi/mapper/ZfCodeMapper.java b/zhang-content/src/main/java/com/ruoyi/mapper/ZfCodeMapper.java new file mode 100644 index 0000000..0d50fd6 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/mapper/ZfCodeMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.domain.ZfCode; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-16 23:31 + * @Version 1.0.0 + **/ +@Mapper +public interface ZfCodeMapper extends BaseMapper<ZfCode> { +} diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZAuthorityService.java b/zhang-content/src/main/java/com/ruoyi/service/ZAuthorityService.java index 6a228db..55223ad 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/ZAuthorityService.java +++ b/zhang-content/src/main/java/com/ruoyi/service/ZAuthorityService.java @@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.domain.ZAuthority; +import com.ruoyi.domain.dto.AuthorityDto; import java.util.List; @@ -13,4 +14,9 @@ **/ public interface ZAuthorityService extends IService<ZAuthority> { List<ZAuthority> getAuthority(); + + AuthorityDto getByCondition(AuthorityDto authorityDto); + + List<String> getAuthorityFamilyName(); + } diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZHealthBaseService.java b/zhang-content/src/main/java/com/ruoyi/service/ZHealthBaseService.java index 9c53476..a0b87a9 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/ZHealthBaseService.java +++ b/zhang-content/src/main/java/com/ruoyi/service/ZHealthBaseService.java @@ -2,7 +2,9 @@ import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.domain.ZHealthBase; +import com.ruoyi.domain.dto.ZHealthBaseDto; /** * <p> @@ -14,4 +16,7 @@ */ public interface ZHealthBaseService extends IService<ZHealthBase> { + ZHealthBaseDto selectData(); + + AjaxResult saveOrUpdateData(ZHealthBaseDto zHealthBaseDto); } diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZHealthNoteService.java b/zhang-content/src/main/java/com/ruoyi/service/ZHealthNoteService.java new file mode 100644 index 0000000..5e28eb4 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/service/ZHealthNoteService.java @@ -0,0 +1,13 @@ +package com.ruoyi.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.domain.ZHealthNote; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:24 + * @Version 1.0.0 + **/ +public interface ZHealthNoteService extends IService<ZHealthNote> { +} diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZHealthNowService.java b/zhang-content/src/main/java/com/ruoyi/service/ZHealthNowService.java new file mode 100644 index 0000000..06f6440 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/service/ZHealthNowService.java @@ -0,0 +1,13 @@ +package com.ruoyi.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.domain.ZHealthNow; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:25 + * @Version 1.0.0 + **/ +public interface ZHealthNowService extends IService<ZHealthNow> { +} diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZInfoUserService.java b/zhang-content/src/main/java/com/ruoyi/service/ZInfoUserService.java index 14df7a7..cb9bd92 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/ZInfoUserService.java +++ b/zhang-content/src/main/java/com/ruoyi/service/ZInfoUserService.java @@ -3,7 +3,7 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.domain.ZInfoUser; import com.ruoyi.domain.ZfRelation; -import com.ruoyi.domain.dto.EmpowerDto; + import com.ruoyi.domain.dto.Genealogy; import com.ruoyi.domain.dto.GenealogyExportDto; import com.ruoyi.domain.dto.RelationDto; @@ -32,7 +32,7 @@ AjaxResult deleteRelation(Long[] ids); - AjaxResult empower(EmpowerDto empowerDto); +// AjaxResult empower(EmpowerDto empowerDto); AjaxResult listWithTree(Integer depth); diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZfCodeService.java b/zhang-content/src/main/java/com/ruoyi/service/ZfCodeService.java new file mode 100644 index 0000000..a02671b --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/service/ZfCodeService.java @@ -0,0 +1,18 @@ +package com.ruoyi.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.domain.ZfCode; + +import java.util.List; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-16 23:32 + * @Version 1.0.0 + **/ +public interface ZfCodeService extends IService<ZfCode> { + List<ZfCode> likeGetByName(String name); + + List<String> getNameByCode(List<Long> codeList); +} diff --git a/zhang-content/src/main/java/com/ruoyi/service/ZfFamilyService.java b/zhang-content/src/main/java/com/ruoyi/service/ZfFamilyService.java index 27a2d65..5d4255d 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/ZfFamilyService.java +++ b/zhang-content/src/main/java/com/ruoyi/service/ZfFamilyService.java @@ -12,4 +12,11 @@ **/ @Service public interface ZfFamilyService extends IService<ZfFamily> { + + /** + * 鏍规嵁瀹跺涵鍚嶅瓧鏌ヨ瀹跺涵 + */ + ZfFamily getByName(String familyName); + + } diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZAuthorityServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAuthorityServiceImpl.java index 4fe8289..9feb3d5 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZAuthorityServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAuthorityServiceImpl.java @@ -5,11 +5,18 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.domain.ZAuthority; +import com.ruoyi.domain.ZfCode; +import com.ruoyi.domain.ZfFamily; +import com.ruoyi.domain.dto.AuthorityDto; import com.ruoyi.mapper.ZAuthorityMapper; import com.ruoyi.service.ZAuthorityService; +import com.ruoyi.service.ZfCodeService; +import com.ruoyi.service.ZfFamilyService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; /** * @Author Jinquan_Ou @@ -19,6 +26,13 @@ **/ @Service public class ZAuthorityServiceImpl extends ServiceImpl<ZAuthorityMapper, ZAuthority> implements ZAuthorityService { + + @Resource + private ZfFamilyService zfFamilyService; + + @Resource + private ZfCodeService zfCodeService; + /** * 鏌ヨ褰撳墠鐢ㄦ埛鐨勬潈闄� */ @@ -32,4 +46,61 @@ return list(lqw); } + + @Override + public AuthorityDto getByCondition(AuthorityDto authorityDto) { + SysUser user = SecurityUtils.getLoginUser().getUser(); + Long userId = user.getUserId(); + + String familyName = authorityDto.getFamilyName(); + String modelName = authorityDto.getModelName(); + + //鏍规嵁瀹跺涵鐨勫悕瀛楁煡鍑哄搴殑id + Long familyId = zfFamilyService.getByName(familyName).getId(); + + //鏍规嵁妯″潡鐨勫悕瀛楁煡鍑哄搴旂殑鏉冮檺鐮� + List<ZfCode> zfCodeList = zfCodeService.likeGetByName(modelName); + List<Long> allCodeList = zfCodeList.stream().map(ZfCode::getCode).collect(Collectors.toList());//鏉冮檺鐮佹暟缁� + + + //鎵惧埌瀵瑰簲瀹跺涵瀵瑰簲妯″潡鐨勬潈闄愭暟缁� + LambdaQueryWrapper<ZAuthority> lqw = new LambdaQueryWrapper<>(); + lqw.eq(ZAuthority::getFid,familyId) + .eq(ZAuthority::getUid,userId) + .in(ZAuthority::getAuthority,allCodeList); + List<ZAuthority> authorityList = list(lqw); + + List<Long> codeList = authorityList.stream().map(ZAuthority::getAuthority).collect(Collectors.toList());//鐪熸鎷ユ湁鏉冮檺鐨勬潈闄愮爜鏁扮粍 + List<String> nameList = zfCodeService.getNameByCode(codeList); + + AuthorityDto resultData = new AuthorityDto(); + nameList.forEach(name ->{ + if(name.contains("鏌ョ湅")){ + resultData.setSearch(1); + }else if(name.contains("鍒犻櫎")){ + resultData.setDelete(1); + }else if(name.contains("娣诲姞")){ + resultData.setInsert(1); + }else if(name.contains("淇敼")){ + resultData.setUpdate(1); + } + }); + + resultData.setModelName(modelName); + resultData.setFamilyName(familyName); + + return resultData; + + + + } + + @Override + public List<String> getAuthorityFamilyName() { + List<ZAuthority> authorityList = getAuthority(); + List<Long> familyIds = authorityList.stream().map(ZAuthority::getFid).distinct().collect(Collectors.toList()); + List<ZfFamily> familyList = zfFamilyService.listByIds(familyIds); + return familyList.stream().map(ZfFamily::getName).distinct().collect(Collectors.toList()); + } + } diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthBaseServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthBaseServiceImpl.java index aea4685..e273ee2 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthBaseServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthBaseServiceImpl.java @@ -1,8 +1,18 @@ package com.ruoyi.service.impl; +import com.alibaba.fastjson2.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.domain.ZHealthBase; +import com.ruoyi.domain.dto.ZHealthBaseDto; +import com.ruoyi.domain.health.AllergyHistory; +import com.ruoyi.domain.health.BloodType; +import com.ruoyi.domain.health.GeneticDisease; import com.ruoyi.mapper.ZHealthBaseMapper; import com.ruoyi.service.ZHealthBaseService; import org.springframework.stereotype.Service; @@ -18,4 +28,68 @@ @Service public class ZHealthBaseServiceImpl extends ServiceImpl<ZHealthBaseMapper, ZHealthBase> implements ZHealthBaseService { + @Override + public ZHealthBaseDto selectData() { + SysUser user = SecurityUtils.getLoginUser().getUser(); + Long userId = user.getUserId(); + + LambdaQueryWrapper<ZHealthBase> lqw = new LambdaQueryWrapper<>(); + lqw.eq(ZHealthBase::getUid,userId); + ZHealthBase zHealthBase = getOne(lqw); + + //濡傛灉鏄涓�娆¤繘鏉ワ紝涔嬪墠娌℃湁杩欎釜鐢ㄦ埛鐨勬暟鎹紝鎶涘紓甯歌鐢ㄦ埛鍏堟彃鍏ユ暟鎹� + if(zHealthBase == null){ + throw new RuntimeException("绗竴娆¤繘鏉�,璇峰厛濉啓濂芥暟鎹�"); + } + + //灏佽瑕佽繑鍥炵殑鏁版嵁 + ZHealthBaseDto returnData = new ZHealthBaseDto(); + BeanUtils.copyProperties(zHealthBase,returnData); + +// returnData.setName(zHealthBase.getName()); +// returnData.setSex(zHealthBase.getSex()); +// returnData.setEducationLevel(zHealthBase.getEducationLevel()); +// returnData.setWork(zHealthBase.getWork()); +// returnData.setPhone(zHealthBase.getPhone()); +// returnData.setEmail(zHealthBase.getEmail()); +// returnData.setMedicine(zHealthBase.getMedicine()); +// returnData.setBaseDisease(zHealthBase.getBaseDisease()); + + //灏唈son鏁扮粍杞崲鎴愬璞� + returnData.setBloodClass(JSON.parseObject(zHealthBase.getBlood(), BloodType.class)); + returnData.setAllergyClass(JSON.parseObject(zHealthBase.getAllergy(), AllergyHistory.class)); + returnData.setGeneticDiseaseClass(JSON.parseObject(zHealthBase.getGeneticDisease(), GeneticDisease.class)); + + return returnData; + } + + + @Override + public AjaxResult saveOrUpdateData(ZHealthBaseDto zHealthBaseDto) { + SysUser user = SecurityUtils.getLoginUser().getUser(); + Long userId = user.getUserId(); + + LambdaQueryWrapper<ZHealthBase> lqw = new LambdaQueryWrapper<>(); + lqw.eq(ZHealthBase::getUid,userId); + ZHealthBase getResult = getOne(lqw); + + ZHealthBase zHealthBase = new ZHealthBase(); + + BeanUtils.copyProperties(zHealthBaseDto,zHealthBase); + zHealthBase.setUid(userId); + zHealthBase.setBlood(JSON.toJSONString(zHealthBaseDto.getBloodClass())); + zHealthBase.setAllergy(JSON.toJSONString(zHealthBaseDto.getAllergyClass())); + zHealthBase.setGeneticDisease(JSON.toJSONString(zHealthBaseDto.getGeneticDiseaseClass())); + + if(getResult == null){ + //濡傛灉鏄涓�娆¤繘鏉ワ紝閭d箞鏄柊澧炴暟鎹� + save(zHealthBase); + }else { + //濡傛灉涓嶆槸绗竴娆★紝閭e氨鏄慨鏀规暟鎹簡 + zHealthBase.setId(getResult.getId()); + updateById(zHealthBase); + } + + return AjaxResult.success(); + } } diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthNoteServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthNoteServiceImpl.java new file mode 100644 index 0000000..8947d37 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthNoteServiceImpl.java @@ -0,0 +1,17 @@ +package com.ruoyi.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.domain.ZHealthNote; +import com.ruoyi.mapper.ZHealthNoteMapper; +import com.ruoyi.service.ZHealthNoteService; +import org.springframework.stereotype.Service; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:26 + * @Version 1.0.0 + **/ +@Service +public class ZHealthNoteServiceImpl extends ServiceImpl<ZHealthNoteMapper, ZHealthNote> implements ZHealthNoteService { +} diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthNowServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthNowServiceImpl.java new file mode 100644 index 0000000..9243746 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZHealthNowServiceImpl.java @@ -0,0 +1,17 @@ +package com.ruoyi.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.domain.ZHealthNow; +import com.ruoyi.mapper.ZHealthNowMapper; +import com.ruoyi.service.ZHealthNowService; +import org.springframework.stereotype.Service; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-17 13:28 + * @Version 1.0.0 + **/ +@Service +public class ZHealthNowServiceImpl extends ServiceImpl<ZHealthNowMapper, ZHealthNow> implements ZHealthNowService { +} diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZInfoUserServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZInfoUserServiceImpl.java index 514ecb0..4455abc 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZInfoUserServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZInfoUserServiceImpl.java @@ -137,10 +137,10 @@ return AjaxResult.success(); } - @Override - public AjaxResult empower(EmpowerDto empowerDto) { - return null; - } +// @Override +// public AjaxResult empower(EmpowerDto empowerDto) { +// return null; +// } // /** // * 缁欑敤鎴锋巿鏉冪殑鏂规硶 diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretServiceImpl.java index f91987a..650daf0 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZSecretServiceImpl.java @@ -57,6 +57,7 @@ lqw.eq(userId != null, ZSecret::getUserId, userId) .like(StringUtils.isNotEmpty(zSecret.getType()), ZSecret::getType, zSecret.getType()) .like(StringUtils.isNotEmpty(zSecret.getAccNo()), ZSecret::getAccNo, zSecret.getAccNo()) + .eq(zSecret.getIsFinger()!=null,ZSecret::getIsFinger,zSecret.getIsFinger()) .between(zSecret.getHappenStartTime() != null && zSecret.getHappenEndTime() != null, ZSecret::getHappenTime, zSecret.getHappenStartTime(), zSecret.getHappenEndTime()) .orderByDesc(ZSecret::getCreateTime); return lqw; diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfCodeServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfCodeServiceImpl.java new file mode 100644 index 0000000..25d5093 --- /dev/null +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfCodeServiceImpl.java @@ -0,0 +1,39 @@ +package com.ruoyi.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.domain.ZfCode; +import com.ruoyi.mapper.ZfCodeMapper; +import com.ruoyi.service.ZfCodeService; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @Author Jinquan_Ou + * @Description + * @Date 2023-07-16 23:32 + * @Version 1.0.0 + **/ +@Service +public class ZfCodeServiceImpl extends ServiceImpl<ZfCodeMapper, ZfCode> implements ZfCodeService { + @Override + public List<ZfCode> likeGetByName(String name) { + LambdaQueryWrapper<ZfCode> lqw = new LambdaQueryWrapper<>(); + lqw.like(ZfCode::getName,name); + return list(lqw); + } + + @Override + public List<String> getNameByCode(List<Long> codeList) { + if(codeList.size() == 0){ + return new ArrayList<>(); + } + LambdaQueryWrapper<ZfCode> lqw = new LambdaQueryWrapper<>(); + lqw.in(codeList.size()!=0,ZfCode::getCode,codeList); + List<ZfCode> zfCodeList = list(lqw); + return zfCodeList.stream().map(ZfCode::getName).collect(Collectors.toList()); + } +} diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfFamilyServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfFamilyServiceImpl.java index 2413f70..48cb8b8 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfFamilyServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfFamilyServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.domain.ZfEvent; import com.ruoyi.domain.ZfFamily; @@ -17,4 +18,10 @@ **/ @Service public class ZfFamilyServiceImpl extends ServiceImpl<ZfFamilyMapper, ZfFamily> implements ZfFamilyService { + @Override + public ZfFamily getByName(String familyName) { + LambdaQueryWrapper<ZfFamily> lqw = new LambdaQueryWrapper<>(); + lqw.eq(ZfFamily::getName,familyName); + return getOne(lqw); + } } -- Gitblit v1.9.1