| | |
| | | package com.hx.phip.service.treat.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.common.dao.CommonDao; |
| | | import com.hx.common.service.CommonService; |
| | | import com.hx.exception.TipsException; |
| | |
| | | import com.hx.phiappt.model.*; |
| | | import com.hx.phiappt.model.guide.VisitOrder; |
| | | import com.hx.phiappt.model.treat.*; |
| | | import com.hx.phiappt.vo.treat.TreatProjectModeDataVo; |
| | | import com.hx.phip.common.wx.corp.WeiXinCorpMpUtil; |
| | | import com.hx.phip.common.wx.corp.WeiXinMpUtil; |
| | | import com.hx.phip.config.CustomParameter; |
| | |
| | | private UserBeChangeLogMapper userBeChangeLogMapper; |
| | | @Resource |
| | | private TreatSingleSignMapper treatSingleSignMapper; |
| | | |
| | | @Resource |
| | | private SystemParameterMapper systemParameterMapper; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** 处理治疗单模式数据 */ |
| | | public void handleModeData(List<TreatProject> treatProjectList){ |
| | | //先过滤出打法不为空的治疗单项目:项目名,打法 |
| | | Map<String, String> dataMap = treatProjectList.stream().filter(s->StringUtils.noNull(s.getItemMode())).collect(Collectors.toMap(TreatProject::getProjectName, TreatProject::getItemMode)); |
| | | if(dataMap == null || dataMap.size() < 1){ |
| | | return; |
| | | } |
| | | |
| | | SystemParameter sp = systemParameterMapper.selectOneByName(SystemParameter.KEY_ZLD_PROJECT_MODE_DATA); |
| | | List<TreatProjectModeDataVo> modeDataVoList = null; |
| | | if(sp != null && StringUtils.isEmpty(sp.getParamValue())){ |
| | | modeDataVoList = JSONArray.parseArray(sp.getParamValue(), TreatProjectModeDataVo.class); |
| | | } |
| | | |
| | | if(modeDataVoList == null){ |
| | | modeDataVoList = new ArrayList<>(); |
| | | } |
| | | |
| | | TreatProjectModeDataVo modeDataVo; |
| | | for(Map.Entry<String, String> entry : dataMap.entrySet()){ |
| | | //没有时则 |
| | | if(modeDataVoList.size() == 0){ |
| | | modeDataVoList.add(new TreatProjectModeDataVo(entry.getKey(), entry.getValue())); |
| | | continue; |
| | | |
| | | } |
| | | |
| | | for(int i = 0; i < modeDataVoList.size(); i++){ |
| | | modeDataVo = modeDataVoList.get(i); |
| | | //有相同的项目名数据 |
| | | if(modeDataVo.getProjectName().equals(entry.getKey())){ |
| | | //然后对应的打法不存在 |
| | | if(!modeDataVo.getModeList().contains(entry.getValue())){ |
| | | modeDataVo.getModeList().add(entry.getValue()); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | //最后一个时表示没匹配到,则新增 |
| | | if(i == modeDataVoList.size() - 1){ |
| | | modeDataVoList.add(new TreatProjectModeDataVo(entry.getKey(), entry.getValue())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(modeDataVoList.size() < 1){ |
| | | return; |
| | | } |
| | | |
| | | JSONArray arr = JSONArray.parseArray(JSONObject.toJSONString(modeDataVoList)); |
| | | if(sp == null){ |
| | | sp = new SystemParameter(); |
| | | sp.setParamName(SystemParameter.KEY_ZLD_PROJECT_MODE_DATA); |
| | | sp.setParamValue(arr.toString()); |
| | | systemParameterMapper.insert(sp); |
| | | }else{ |
| | | sp.setParamValue(arr.toString()); |
| | | systemParameterMapper.updateInfoById(sp); |
| | | } |
| | | } |
| | | |
| | | /////////////////////////////////////////////////////////////////////////////// |
| | | |
| | | //处理编辑治疗通知单时项目变动逻辑 |