diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/BabyEyeCheckMapper.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/BabyEyeCheckMapper.java index 995ed6e..b4ca433 100644 --- a/platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/BabyEyeCheckMapper.java +++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/BabyEyeCheckMapper.java @@ -1,4 +1,11 @@ package com.lyms.platform.permission.dao.master; +import com.lyms.platform.pojo.BabyEyeCheck; + public interface BabyEyeCheckMapper { + void save(BabyEyeCheck babyEyeCheck); + + void update(BabyEyeCheck babyEyeCheck); + + void deleteById(String id); } diff --git a/platform-biz-service/src/main/resources/mainOrm/master/BabyEyeCheckMapper.xml b/platform-biz-service/src/main/resources/mainOrm/master/BabyEyeCheckMapper.xml new file mode 100644 index 0000000..30463c1 --- /dev/null +++ b/platform-biz-service/src/main/resources/mainOrm/master/BabyEyeCheckMapper.xml @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,created,yn,operaterId,hospitalId,babyId,pid,checkMonthId,checkHospital,checkTime,riskFactor,extRightEyelook,extRightEyelookOther,blinkRightReflex,pupillaryRightReflex,redRightReflex,extLeftEyelook,extLeftEyelookOther,blinkLefttReflex,pupillaryLeftReflex,redLeftReflex,fundusResult,handleOpinionsId,guidanceOpinions,doctor,nextCheckMonthId,nextCheckTime,extEyelook,extEyelookOther,redReflex,redReflexOther,r1,r2,l1,l2,optometry,conjunctiva,conjunctivaOther,corneal,cornealOther,lacrimalApparatus,lacrimalApparatusOther,eyeMovementsId,eyePositionId,eyePositionOther,binocularVision,other,lVision,rVision,refractionL1,refractionL2,refractionR1,refractionR2,nystagmus,fixationCard + + + + + + and id = #{id} + + + and created = #{created} + + + and yn = #{yn} + + + and operaterId = #{operaterId} + + + and hospitalId = #{hospitalId} + + + and babyId = #{babyId} + + + and pid = #{pid} + + + and checkMonthId = #{checkMonthId} + + + and checkHospital = #{checkHospital} + + + and checkTime = #{checkTime} + + + and riskFactor = #{riskFactor} + + + and extRightEyelook = #{extRightEyelook} + + + and extRightEyelookOther = #{extRightEyelookOther} + + + and blinkRightReflex = #{blinkRightReflex} + + + and pupillaryRightReflex = #{pupillaryRightReflex} + + + and redRightReflex = #{redRightReflex} + + + and extLeftEyelook = #{extLeftEyelook} + + + and extLeftEyelookOther = #{extLeftEyelookOther} + + + and blinkLefttReflex = #{blinkLefttReflex} + + + and pupillaryLeftReflex = #{pupillaryLeftReflex} + + + and redLeftReflex = #{redLeftReflex} + + + and fundusResult = #{fundusResult} + + + and handleOpinionsId = #{handleOpinionsId} + + + and guidanceOpinions = #{guidanceOpinions} + + + and doctor = #{doctor} + + + and nextCheckMonthId = #{nextCheckMonthId} + + + and nextCheckTime = #{nextCheckTime} + + + and extEyelook = #{extEyelook} + + + and extEyelookOther = #{extEyelookOther} + + + and redReflex = #{redReflex} + + + and redReflexOther = #{redReflexOther} + + + and r1 = #{r1} + + + and r2 = #{r2} + + + and l1 = #{l1} + + + and l2 = #{l2} + + + and optometry = #{optometry} + + + and conjunctiva = #{conjunctiva} + + + and conjunctivaOther = #{conjunctivaOther} + + + and corneal = #{corneal} + + + and cornealOther = #{cornealOther} + + + and lacrimalApparatus = #{lacrimalApparatus} + + + and lacrimalApparatusOther = #{lacrimalApparatusOther} + + + and eyeMovementsId = #{eyeMovementsId} + + + and eyePositionId = #{eyePositionId} + + + and eyePositionOther = #{eyePositionOther} + + + and binocularVision = #{binocularVision} + + + and other = #{other} + + + and lVision = #{lVision} + + + and rVision = #{rVision} + + + and refractionL1 = #{refractionL1} + + + and refractionL2 = #{refractionL2} + + + and refractionR1 = #{refractionR1} + + + and refractionR2 = #{refractionR2} + + + and nystagmus = #{nystagmus} + + + and fixationCard = #{fixationCard} + + + + + + + + created = #{created}, + + + yn = #{yn}, + + + operaterId = #{operaterId}, + + + hospitalId = #{hospitalId}, + + + babyId = #{babyId}, + + + pid = #{pid}, + + + checkMonthId = #{checkMonthId}, + + + checkHospital = #{checkHospital}, + + + checkTime = #{checkTime}, + + + riskFactor = #{riskFactor}, + + + extRightEyelook = #{extRightEyelook}, + + + extRightEyelookOther = #{extRightEyelookOther}, + + + blinkRightReflex = #{blinkRightReflex}, + + + pupillaryRightReflex = #{pupillaryRightReflex}, + + + redRightReflex = #{redRightReflex}, + + + extLeftEyelook = #{extLeftEyelook}, + + + extLeftEyelookOther = #{extLeftEyelookOther}, + + + blinkLefttReflex = #{blinkLefttReflex}, + + + pupillaryLeftReflex = #{pupillaryLeftReflex}, + + + redLeftReflex = #{redLeftReflex}, + + + fundusResult = #{fundusResult}, + + + handleOpinionsId = #{handleOpinionsId}, + + + guidanceOpinions = #{guidanceOpinions}, + + + doctor = #{doctor}, + + + nextCheckMonthId = #{nextCheckMonthId}, + + + nextCheckTime = #{nextCheckTime}, + + + extEyelook = #{extEyelook}, + + + extEyelookOther = #{extEyelookOther}, + + + redReflex = #{redReflex}, + + + redReflexOther = #{redReflexOther}, + + + r1 = #{r1}, + + + r2 = #{r2}, + + + l1 = #{l1}, + + + l2 = #{l2}, + + + optometry = #{optometry}, + + + conjunctiva = #{conjunctiva}, + + + conjunctivaOther = #{conjunctivaOther}, + + + corneal = #{corneal}, + + + cornealOther = #{cornealOther}, + + + lacrimalApparatus = #{lacrimalApparatus}, + + + lacrimalApparatusOther = #{lacrimalApparatusOther}, + + + eyeMovementsId = #{eyeMovementsId}, + + + eyePositionId = #{eyePositionId}, + + + eyePositionOther = #{eyePositionOther}, + + + binocularVision = #{binocularVision}, + + + other = #{other}, + + + lVision = #{lVision}, + + + rVision = #{rVision}, + + + refractionL1 = #{refractionL1}, + + + refractionL2 = #{refractionL2}, + + + refractionR1 = #{refractionR1}, + + + refractionR2 = #{refractionR2}, + + + nystagmus = #{nystagmus}, + + + fixationCard = #{fixationCard} + + + + + + + + + + + + + + insert into baby_eye_check() values(#{id},#{created},#{yn},#{operaterId},#{hospitalId},#{babyId},#{pid},#{checkMonthId},#{checkHospital},#{checkTime},#{riskFactor},#{extRightEyelook},#{extRightEyelookOther},#{blinkRightReflex},#{pupillaryRightReflex},#{redRightReflex},#{extLeftEyelook},#{extLeftEyelookOther},#{blinkLefttReflex},#{pupillaryLeftReflex},#{redLeftReflex},#{fundusResult},#{handleOpinionsId},#{guidanceOpinions},#{doctor},#{nextCheckMonthId},#{nextCheckTime},#{extEyelook},#{extEyelookOther},#{redReflex},#{redReflexOther},#{r1},#{r2},#{l1},#{l2},#{optometry},#{conjunctiva},#{conjunctivaOther},#{corneal},#{cornealOther},#{lacrimalApparatus},#{lacrimalApparatusOther},#{eyeMovementsId},#{eyePositionId},#{eyePositionOther},#{binocularVision},#{other},#{lVision},#{rVision},#{refractionL1},#{refractionL2},#{refractionR1},#{refractionR2},#{nystagmus},#{fixationCard}) + + + + update baby_eye_check + set yn = 0 + where id = #{id} + + + + delete from baby_eye_check where id in + + #{id} + + + + + update baby_eye_check + + where id = #{id} + + \ No newline at end of file diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java b/platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java index b260c31..3a3fdea 100644 --- a/platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java @@ -46,6 +46,10 @@ public class BabyEyeCheck { * 眼病高危因素 */ private List riskFactorId; + /** + * 用于存储mysql 转义 + */ + private String riskFactor; /**================ 检查结果(左/右眼) ================*/ /**============== 右眼 ===============*/ @@ -216,6 +220,14 @@ public class BabyEyeCheck { */ private String fixationCard; + public String getRiskFactor() { + return riskFactor; + } + + public void setRiskFactor(String riskFactor) { + this.riskFactor = riskFactor; + } + public String getExtLeftEyelookOther() { return extLeftEyelookOther; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java index 1ebffb3..510dbd1 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java @@ -89,4 +89,10 @@ public class BabyEyeCheckController extends BaseController { return babyEyeCheckService.list(getUserId(request), startDate, endDate, doctor, key, currentMonth, chechMonth, positive, page, limit); } + @ResponseBody + @RequestMapping(value = "/list/init", method = RequestMethod.GET) + public BaseResponse listInit() { + return babyEyeCheckService.listInit(); + } + } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java index e3617ba..a7cb71b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java @@ -23,4 +23,6 @@ public interface BabyEyeCheckService extends IBaseService { BaseResponse list(Integer userId, Date startDate, Date endDate, String doctor, String key, String currentMonth, String chechMonth, boolean positive, Integer page, Integer limit); BaseResponse query(Integer userId, String babyId); + + BaseResponse listInit(); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java index 3361e22..6ceac55 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java @@ -80,10 +80,20 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEye babyEyeCheck.setPid(babyModel.getPid()); } mongoTemplate.save(babyEyeCheck); + if(CollectionUtils.isNotEmpty(babyEyeCheck.getRiskFactorId())) { + String riskFactor = org.apache.commons.lang3.StringUtils.join(babyEyeCheck.getRiskFactorId().toArray(), ","); + babyEyeCheck.setRiskFactor(riskFactor); + } + babyEyeCheckMapper.save(babyEyeCheck); } else { babyEyeCheck.setOperaterId(userId.toString()); Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(babyEyeCheck)); mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), update, BabyEyeCheck.class); + if(CollectionUtils.isNotEmpty(babyEyeCheck.getRiskFactorId())) { + String riskFactor = org.apache.commons.lang3.StringUtils.join(babyEyeCheck.getRiskFactorId().toArray(), ","); + babyEyeCheck.setRiskFactor(riskFactor); + } + babyEyeCheckMapper.update(babyEyeCheck); } return RespBuilder.buildSuccess(babyEyeCheck.getId()); } @@ -173,6 +183,7 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEye @Override public BaseResponse delete(String id) { mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(id)), Update.update("yn", "0"), BabyEyeCheck.class); + babyEyeCheckMapper.deleteById(id); return RespBuilder.buildSuccess(); } @@ -287,4 +298,72 @@ public class BabyEyeCheckServiceImpl extends BaseServiceImpl implements BabyEye } return RespBuilder.buildSuccess(rest); } + + @Override + public BaseResponse listInit() { + List> checkMonth = EnumUtil.toJson(CheckMonthEnums.class); /** 检查月龄 */ + List> positive = new ArrayList<>(); /** 阳性项目 */ + + Map extRightEyelookMap = new HashMap<>(); + extRightEyelookMap.put("id", "extRightEyelook"); + extRightEyelookMap.put("name", "外眼观察(右)"); + positive.add(extRightEyelookMap); + + Map extLeftEyelookMap = new HashMap<>(); + extLeftEyelookMap.put("id", "extLeftEyelook"); + extLeftEyelookMap.put("name", "外眼观察(左)"); + positive.add(extLeftEyelookMap); + + Map blinkRightReflexMap = new HashMap<>(); + blinkRightReflexMap.put("id", "blinkRightReflex"); + blinkRightReflexMap.put("name", "瞬目反射(右)"); + positive.add(blinkRightReflexMap); + + Map blinkLefttReflexapMap = new HashMap<>(); + blinkLefttReflexapMap.put("id", "blinkLefttReflex"); + blinkLefttReflexapMap.put("name", "瞬目反射(左)"); + positive.add(blinkLefttReflexapMap); + + Map pupillaryRightReflexMap = new HashMap<>(); + pupillaryRightReflexMap.put("id", "pupillaryRightReflex"); + pupillaryRightReflexMap.put("name", "瞳孔对光反射(右)"); + positive.add(pupillaryRightReflexMap); + + Map pupillaryLeftReflexMap = new HashMap<>(); + pupillaryLeftReflexMap.put("id", "pupillaryLeftReflex"); + pupillaryLeftReflexMap.put("name", "瞳孔对光反射(左)"); + positive.add(pupillaryLeftReflexMap); + + Map redRightReflexMap = new HashMap<>(); + redRightReflexMap.put("id", "redRightReflex"); + redRightReflexMap.put("name", "瞳孔红光反射(右)"); + positive.add(redRightReflexMap); + + Map redLeftReflexMap = new HashMap<>(); + redLeftReflexMap.put("id", "redLeftReflex"); + redLeftReflexMap.put("name", "瞳孔红光反射(左)"); + positive.add(redLeftReflexMap); + + Map redReflexMap = new HashMap<>(); + redReflexMap.put("id", "redReflex"); + redReflexMap.put("name", "红光反射"); + positive.add(redReflexMap); + + Map conjunctivaMap = new HashMap<>(); + conjunctivaMap.put("id", "conjunctiva"); + conjunctivaMap.put("name", "结膜"); + positive.add(conjunctivaMap); + + Map cornealMap = new HashMap<>(); + cornealMap.put("id", "corneal"); + cornealMap.put("name", "角膜"); + positive.add(cornealMap); + + Map lacrimalApparatusMap = new HashMap<>(); + lacrimalApparatusMap.put("id", "lacrimalApparatus"); + lacrimalApparatusMap.put("name", "泪器"); + positive.add(lacrimalApparatusMap); + + return RespBuilder.buildSuccess("checkMonth", checkMonth, "positive", positive); + } }