Jelajahi Sumber

代码修改

suqinyi 3 bulan lalu
induk
melakukan
eb1fb5031a

+ 0 - 27
business/base-service/src/main/java/com/yihu/jw/article/service/KnowledgeArticleDictService.java

@ -703,32 +703,5 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
        return result;
    }
    /**
     * 业务类型1、文章2、问卷   relationType
     */
    public HashMap<String, Object> findSendPatientList(String doctorCode, String patientCode, String sendType, int page, int pageSize) {
        String sql = " SELECT DISTINCT \n" +
                " b.doctor 'sendDoctorCode',b.doctor_name 'sendDoctorName'," +
                " c.fabulous 'userFabulous', c.is_read 'userIsRead',c.is_share 'userShare',c.collection 'userCollection'," +
                " a.* \n" +
                " FROM wlyy_knowledge_article_dict a " +
                " INNER JOIN base_patient_business b ON a.id=b.relation_code" +
                " LEFT JOIN  wlyy_knowledge_article_user c ON a.id=c.relation_code \n" +
                " WHERE 1=1 AND b.relation_type='" + sendType + "' ";
        if (StringUtils.isNotBlank(doctorCode)) {
            sql += " and  b.doctor='" + doctorCode + "' ";
        }
        if (StringUtils.isNotBlank(doctorCode)) {
            sql += " and  b.patient='" + patientCode + "' ";
        }
        String countSql = " slect count(1) from (" + sql + ") qqq";
        sql += " order by create_time desc " + " LIMIT " + (page - 1) * pageSize + "," + pageSize + "";
        List<BasePatientBusinessDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePatientBusinessDO.class));
        Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("data", list);
        resultMap.put("count", count);
        return resultMap;
    }
}

+ 23 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -7986,6 +7986,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        rs.put("id", patient);
        rs.put("name", basePatientDO.getName());
        rs.put("birthday", "");
        try {
            if (basePatientDO.getBirthday()!=null){
                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
                rs.put("birthday", dateFormat.format(basePatientDO.getBirthday()));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        rs.put("sex", basePatientDO.getSex());
        rs.put("provinceCode", basePatientDO.getProvinceCode());
        rs.put("provinceName", basePatientDO.getProvinceName());
@ -8019,7 +8030,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public Map<String, Object> updatePatientInfo(String patient, String name, String idcard,String cardType, String ssc, Integer sex, String townCode, String townName, String committeeCode, String committeeName, String address, String photo, String mobile, String province, String provinceName, String city, String cityName) {
    public Map<String, Object> updatePatientInfo(
            String patient, String name, String idcard,String cardType, String ssc, Integer sex, String townCode, String townName,
            String committeeCode, String committeeName, String address, String photo, String mobile,
            String province, String provinceName, String city, String cityName,String birthday) {
        Map<String, Object> rs = new HashedMap();
        BasePatientDO basePatientDO = basePatientDao.findById(patient).orElse(null);
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01", patient, "1");
@ -8036,6 +8050,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                basePatientDO.setIdcard(idcard);
            }
        }
        try {
            if (StringUtils.isNotBlank(birthday)){
                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
                basePatientDO.setBirthday(dateFormat.parse(birthday));
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        if (StringUtils.isNoneBlank(cardType)) {
            basePatientDO.setCardType(cardType);
        }

+ 75 - 58
server/svr-authentication/src/main/java/com/yihu/jw/security/service/RegisterService.java

@ -21,6 +21,8 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -54,27 +56,27 @@ public class RegisterService {
    @Autowired
    private YkyyService ykyyService;
    public Map<String,Object> registerPatient(String name, String mobile, String idcard, String ssc, String pw,String openid,String wxId,String captcha)throws Exception{
    public Map<String, Object> registerPatient(String name, String mobile, String idcard, String ssc, String pw, String openid, String wxId, String captcha) throws Exception {
        Map<String,Object> rs = new HashedMap();
        try{
            BasePatientDO p1 = basePatientDao.findByIdcardAndDel(idcard,"1");
            if(p1!=null){
                rs.put("code","-1");
                rs.put("mes","身份证已经存在");
        Map<String, Object> rs = new HashedMap();
        try {
            BasePatientDO p1 = basePatientDao.findByIdcardAndDel(idcard, "1");
            if (p1 != null) {
                rs.put("code", "-1");
                rs.put("mes", "身份证已经存在");
                return rs;
            }
            List<BasePatientDO> p2 = basePatientDao.findByMobileAndDel(mobile,"1");
            if(p2!=null&&p2.size()>0){
                rs.put("code","-2");
                rs.put("mes","手机号已经存在");
            List<BasePatientDO> p2 = basePatientDao.findByMobileAndDel(mobile, "1");
            if (p2 != null && p2.size() > 0) {
                rs.put("code", "-2");
                rs.put("mes", "手机号已经存在");
                return rs;
            }
            BasePatientDO patient = new BasePatientDO();
            String salt = UUID.randomUUID().toString().substring(0,5);
            String salt = UUID.randomUUID().toString().substring(0, 5);
            patient.setIdcard(idcard);
            patient.setName(name);
@ -101,7 +103,7 @@ public class RegisterService {
            basePatientMedicareCardDao.save(medicareCardDO);
            //保存微信信息
            if(StringUtils.isNotBlank(openid)&&StringUtils.isNotBlank(wxId)){
            if (StringUtils.isNotBlank(openid) && StringUtils.isNotBlank(wxId)) {
                BasePatientWechatDo wechatDo = new BasePatientWechatDo();
                wechatDo.setWechatId(wxId);
                wechatDo.setOpenid(openid);
@ -112,25 +114,26 @@ public class RegisterService {
                ykyyService.registerYkt(temp.getId(),pw,captcha);
            }*/
            rs.put("code","1");
            rs.put("mes","ok");
            rs.put("patient",temp);
            rs.put("code", "1");
            rs.put("mes", "ok");
            rs.put("patient", temp);
            return rs;
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
        }
        rs.put("code","-3");
        rs.put("mes","保存用户信息失败");
        rs.put("code", "-3");
        rs.put("mes", "保存用户信息失败");
        return rs;
    }
    public Map<String,Object> registerPatient(String mobile,String pw,String name,String idcard, String cardType,String ssc,String openid)throws Exception{
        Map<String,Object> rs = new HashedMap();
        try{
            List<BasePatientDO> p2 = basePatientDao.findByMobileAndDel(mobile,"1");
            if(p2!=null&&p2.size()>0){
                rs.put("code","-2");
                rs.put("mes","手机号已经存在");
    public Map<String, Object> registerPatient(String mobile, String pw, String name, String idcard, String cardType, String ssc, String openid) throws Exception {
        Map<String, Object> rs = new HashedMap();
        try {
            List<BasePatientDO> p2 = basePatientDao.findByMobileAndDel(mobile, "1");
            if (p2 != null && p2.size() > 0) {
                rs.put("code", "-2");
                rs.put("mes", "手机号已经存在");
                return rs;
            }
            List<BasePatientDO> p3 = basePatientDao.findListByIdcardAndDel(idcard, "1");
@ -145,10 +148,24 @@ public class RegisterService {
                idcard = idcard.toUpperCase();
            }
            BasePatientDO patient = new BasePatientDO();
            String salt = UUID.randomUUID().toString().substring(0,5);
            String salt = UUID.randomUUID().toString().substring(0, 5);
            patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
            patient.setSalt(salt);
            patient.setCardType(cardType);
            try {
                System.out.println("cardType==>" + cardType);
                if ("身份证".equals(cardType)) {
                    String year = idcard.substring(6, 10);
                    String month = idcard.substring(10, 12);
                    String day = idcard.substring(12, 14);
                    String birthday = year + "-" + month + "-" + day;
                    System.out.println("birthday===>" + birthday);
                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
                    patient.setBirthday(dateFormat.parse(birthday));
                }
            } catch (ParseException e) {
                e.printStackTrace();
            }
            patient.setMobile(mobile);
            patient.setDel("1");
            patient.setEnabled(1);
@ -156,13 +173,13 @@ public class RegisterService {
            patient.setSsc(ssc);
            patient.setCreateTime(new Date());
            patient.setUpdateTime(new Date());
            if(StringUtils.isNoneBlank(name)){
            if (StringUtils.isNoneBlank(name)) {
                patient.setName(name);
            }
            if (StringUtils.isNoneBlank(idcard)){
            if (StringUtils.isNoneBlank(idcard)) {
                patient.setIdcard(idcard);
            }
            if(StringUtils.isNoneBlank(openid)){
            if (StringUtils.isNoneBlank(openid)) {
                patient.setOpenid(openid);
            }
@ -181,7 +198,7 @@ public class RegisterService {
            wlyyPatientFamilyMemberDO.setFamilyMember(patient.getId());
            wlyyPatientFamilyMemberDO.setFamilyRelation("7");
            wlyyPatientFamilyMemberDO.setFamilyRelationName("本人");
            if (StringUtils.isNoneBlank(idcard)){
            if (StringUtils.isNoneBlank(idcard)) {
                wlyyPatientFamilyMemberDO.setCardNo(idcard);
            }
            familyMemberDao.save(wlyyPatientFamilyMemberDO);
@ -189,58 +206,58 @@ public class RegisterService {
                ykyyService.registerYkt(temp.getId(),pw,captcha);
            }*/
            rs.put("code","1");
            rs.put("mes","ok");
            rs.put("patient",temp);
            rs.put("code", "1");
            rs.put("mes", "ok");
            rs.put("patient", temp);
            return rs;
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
        }
        rs.put("code","-3");
        rs.put("mes","保存用户信息失败");
        rs.put("code", "-3");
        rs.put("mes", "保存用户信息失败");
        return rs;
    }
    public Integer checkeMobileAndIdcard(String mobile,String idcard){
        BasePatientDO patientDO =  basePatientDao.findByIdcardAndDel(idcard, "1");
        if(patientDO==null){
    public Integer checkeMobileAndIdcard(String mobile, String idcard) {
        BasePatientDO patientDO = basePatientDao.findByIdcardAndDel(idcard, "1");
        if (patientDO == null) {
            return -1;
        }
        if(!mobile.equals(patientDO.getMobile())){
        if (!mobile.equals(patientDO.getMobile())) {
            return -2;
        }
        return 1;
    }
    public String updatePatientPw(String pw,String mobile){
    public String updatePatientPw(String pw, String mobile) {
        List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile,"1");
        if(list!=null&&list.size()>0){
            for(BasePatientDO patient:list){
                String salt = UUID.randomUUID().toString().substring(0,5);
        List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile, "1");
        if (list != null && list.size() > 0) {
            for (BasePatientDO patient : list) {
                String salt = UUID.randomUUID().toString().substring(0, 5);
                patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                patient.setSalt(salt);
            }
            basePatientDao.saveAll(list);
        }else{
        } else {
            return "-1";
        }
        return "ok";
    }
    public boolean saveDoctorPwlimitDate(String doctor){
    public boolean saveDoctorPwlimitDate(String doctor) {
        String key = "hlwyy:authPw:doctor:" + doctor;
        com.alibaba.fastjson.JSONObject valueJson = new com.alibaba.fastjson.JSONObject();
        valueJson.put("updateTime",new Date().getTime());
        valueJson.put("isChanged",true);
        redisTemplate.opsForValue().set(key,valueJson.toJSONString());
        valueJson.put("updateTime", new Date().getTime());
        valueJson.put("isChanged", true);
        redisTemplate.opsForValue().set(key, valueJson.toJSONString());
        return true;
    }
    public String updateDoctorPw(String mobile,String pw,String wxId){
    public String updateDoctorPw(String mobile, String pw, String wxId) {
        List<BaseDoctorDO> list = baseDoctorDao.findByMobile(mobile);
        if(list!=null&&list.size()>0){
            for(BaseDoctorDO doctorDO:list){
        if (list != null && list.size() > 0) {
            for (BaseDoctorDO doctorDO : list) {
                //认证信息设置
                String salt = randomString(5);
                doctorDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
@ -248,14 +265,14 @@ public class RegisterService {
                baseDoctorDao.save(doctorDO);
                saveDoctorPwlimitDate(doctorDO.getId());
            }
        }else{
        } else {
            return "-1";
        }
        return "ok";
    }
    public String updateDoctorMoble(String id,String mobile){
    public String updateDoctorMoble(String id, String mobile) {
        BaseDoctorDO doctorDO = baseDoctorDao.getOne(id);
        //认证信息设置
        doctorDO.setMobile(mobile);
@ -268,7 +285,7 @@ public class RegisterService {
        StringBuffer buffer = new StringBuffer();
        Random random = new Random();
        for(int i = 0; i < length; ++i) {
        for (int i = 0; i < length; ++i) {
            int pos = random.nextInt(str.length());
            buffer.append(str.charAt(pos));
        }

+ 22 - 36
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -1544,42 +1544,28 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.updatePatientInfo)
    @ApiOperation(value = "修改居民信息", notes = "修改居民信息")
    public ObjEnvelop findPatientInfo(@ApiParam(name = "patient", value = "居民ID")
                                      @RequestParam(value = "patient", required = true) String patient,
                                      @ApiParam(name = "name", value = "居民名称")
                                      @RequestParam(value = "name", required = true) String name,
                                      @ApiParam(name = "ssc", value = "社保卡")
                                      @RequestParam(value = "ssc", required = true) String ssc,
                                      @ApiParam(name = "idcard", value = "居民身份证")
                                      @RequestParam(value = "idcard", required = true) String idcard,
                                      @ApiParam(name = "cardType", value = "证件类型")
                                      @RequestParam(value = "cardType", required = false) String cardType,
                                      @ApiParam(name = "sex", value = "性别")
                                      @RequestParam(value = "sex", required = false) Integer sex,
                                      @ApiParam(name = "town", value = "所在区code")
                                      @RequestParam(value = "town", required = false) String town,
                                      @ApiParam(name = "townName", value = "所在区名称")
                                      @RequestParam(value = "townName", required = false) String townName,
                                      @ApiParam(name = "committeeCode", value = "居委会code")
                                      @RequestParam(value = "committeeCode", required = false) String committeeCode,
                                      @ApiParam(name = "committeeName", value = "居委会code")
                                      @RequestParam(value = "committeeName", required = false) String committeeName,
                                      @ApiParam(name = "address", value = "常驻地址")
                                      @RequestParam(value = "address", required = false) String address,
                                      @ApiParam(name = "photo", value = "头像")
                                      @RequestParam(value = "photo", required = false) String photo,
                                      @ApiParam(name = "mobile", value = "手机号")
                                      @RequestParam(value = "mobile", required = false) String mobile,
                                      @ApiParam(name = "province", value = "所在省code")
                                      @RequestParam(value = "province", required = false) String province,
                                      @ApiParam(name = "provinceName", value = "所在省名称")
                                      @RequestParam(value = "provinceName", required = false) String provinceName,
                                      @ApiParam(name = "city", value = "市code")
                                      @RequestParam(value = "city", required = false) String city,
                                      @ApiParam(name = "cityName", value = "市名称")
                                      @RequestParam(value = "cityName", required = false) String cityName) {
        try {
            return success(prescriptionService.updatePatientInfo(patient, name, idcard,cardType, ssc, sex, town, townName, committeeCode, committeeName, address, photo, mobile, province, provinceName, city, cityName));
    public ObjEnvelop findPatientInfo(
            @ApiParam(name = "patient", value = "居民ID") @RequestParam(value = "patient", required = true) String patient,
            @ApiParam(name = "name", value = "居民名称") @RequestParam(value = "name", required = true) String name,
            @ApiParam(name = "ssc", value = "社保卡") @RequestParam(value = "ssc", required = true) String ssc,
            @ApiParam(name = "idcard", value = "居民身份证") @RequestParam(value = "idcard", required = true) String idcard,
            @ApiParam(name = "cardType", value = "证件类型") @RequestParam(value = "cardType", required = false) String cardType,
            @ApiParam(name = "sex", value = "性别") @RequestParam(value = "sex", required = false) Integer sex,
            @ApiParam(name = "town", value = "所在区code") @RequestParam(value = "town", required = false) String town,
            @ApiParam(name = "townName", value = "所在区名称") @RequestParam(value = "townName", required = false) String townName,
            @ApiParam(name = "committeeCode", value = "居委会code") @RequestParam(value = "committeeCode", required = false) String committeeCode,
            @ApiParam(name = "committeeName", value = "居委会code") @RequestParam(value = "committeeName", required = false) String committeeName,
            @ApiParam(name = "address", value = "常驻地址") @RequestParam(value = "address", required = false) String address,
            @ApiParam(name = "photo", value = "头像") @RequestParam(value = "photo", required = false) String photo,
            @ApiParam(name = "mobile", value = "手机号") @RequestParam(value = "mobile", required = false) String mobile,
            @ApiParam(name = "province", value = "所在省code") @RequestParam(value = "province", required = false) String province,
            @ApiParam(name = "provinceName", value = "所在省名称") @RequestParam(value = "provinceName", required = false) String provinceName,
            @ApiParam(name = "city", value = "市code") @RequestParam(value = "city", required = false) String city,
            @ApiParam(name = "cityName", value = "市名称") @RequestParam(value = "cityName", required = false) String cityName,
            @ApiParam(name = "birthday", value = "出生日期") @RequestParam(value = "birthday", required = false) String birthday
    ) {
        try {
            return success(prescriptionService.updatePatientInfo(patient, name, idcard,cardType, ssc, sex, town, townName, committeeCode, committeeName, address, photo, mobile, province, provinceName, city, cityName,birthday));
        }catch (ServiceException se){
            return ObjEnvelop.getError(se.getMessage());
        }catch (Exception e) {