Trick 5 years ago
parent
commit
0ce48901c8

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/area/dao/BaseStreetDao.java

@ -5,6 +5,8 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.jw.entity.base.area.BaseStreetDO;
import java.util.List;
/**
 * 
 * 街道字典 数据库访问层
@ -18,4 +20,6 @@ import com.yihu.jw.entity.base.area.BaseStreetDO;
 * @since 1.
 */
public interface BaseStreetDao extends PagingAndSortingRepository<BaseStreetDO, Integer>, JpaSpecificationExecutor<BaseStreetDO>  {
    List<BaseStreetDO> findByTown(String town);
}

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/area/service/BaseStreetService.java

@ -5,6 +5,8 @@ import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.area.BaseStreetDO;
import java.util.List;
/**
 * 
 * 街道字典服务service
@ -19,4 +21,8 @@ import com.yihu.jw.entity.base.area.BaseStreetDO;
 */
@Service
public class BaseStreetService extends BaseJpaService<BaseStreetDO, BaseStreetDao> {
    public List<BaseStreetDO> findByTown(String town){
        return findByTown(town);
    }
}

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

@ -4055,23 +4055,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @throws Exception
     */
    public net.sf.json.JSONObject setRecord(String json,String type)throws Exception{
        net.sf.json.JSONObject rs = new JSONObject();
        ArchiveVO archiveVO = objectMapper.readValue(json,ArchiveVO.class);
        if(archiveVO!=null){
            if(StringUtils.isNotBlank(archiveVO.getBrnl00())){
            if(StringUtils.isBlank(archiveVO.getBrnl00())){
               archiveVO.setBrnl00(IdCardUtil.getAgeForIdcard(archiveVO.getSfzhao())+"");
            }
            if(StringUtils.isNotBlank(archiveVO.getCsrq00())){
               archiveVO.setCsrq00(DateUtil.dateToStr(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()),"yyyyMMddHHmmss"));
            if(StringUtils.isBlank(archiveVO.getCsrq00())){
               archiveVO.setCsrq00(DateUtil.dateToStr(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()),"yyyyMMdd"));
            }
            //保存互联网医院居民账户
            savePatient(archiveVO);
            //1为需要同步建档
            if("1".equals(type)){
                return entranceService.BS16018(archiveVO,demoFlag);
                rs = entranceService.BS16018(archiveVO,demoFlag);
            }
            //保存互联网医院居民账户
            BasePatientDO patientDO = savePatient(archiveVO);
            rs.put("patient",patientDO.getId());
        }
        return null;
        return rs;
    }
    /**
@ -4079,7 +4080,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param archiveVO
     * @return
     */
    public Boolean savePatient(ArchiveVO archiveVO)throws Exception{
    public BasePatientDO savePatient(ArchiveVO archiveVO)throws Exception{
        BasePatientDO patientDO =  basePatientDao.findByIdcardAndDel(archiveVO.getSfzhao(),"1");
        if(patientDO == null) {
            BasePatientDO patient = new BasePatientDO();
@ -4100,9 +4101,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            patient.setUpdateTime(new Date());
            patient.setBirthday(IdCardUtil.getBirthdayForIdcard(archiveVO.getSfzhao()));
            basePatientDao.save(patient);
            return basePatientDao.save(patient);
        }
        return true;
        return patientDO;
    }
    /**

+ 2 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -2367,9 +2367,8 @@ public class EntranceService {
            sbs.append("</Msg>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            //查询信息拼接
            logger.info(fid+" sbs:"+sbs.toString());
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            //查询信息拼接{"cardno":"DA9549295","xming0":"侯颖龙","sfzhao":"350583199510282220","xbie00":"2","yytel0":"18859250126","grsfen":"2","addres":"","brnl00":"25","csrq00":"19951028"}
            // {"code":"1","MsgInfo":[{"resquest":{"@ans_code":"00","@msg":"该卡已注册"}}]}
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            logger.info(fid+" resp:"+resp);

+ 10 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java

@ -1,6 +1,7 @@
package com.yihu.jw.hospital.endpoint.base;
import com.yihu.jw.area.service.BaseCityService;
import com.yihu.jw.area.service.BaseStreetService;
import com.yihu.jw.dict.service.BaseDictJobTitleService;
import com.yihu.jw.dict.service.HospitalDeptService;
import com.yihu.jw.doctor.service.BaseDoctorHosService;
@ -50,6 +51,9 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseOrgInfoService baseOrgInfoService;
    @Autowired
    private BaseStreetService baseStreetService;
    /**
     * 获取市列表信息
     * @return
@ -137,6 +141,11 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "/findByTown")
    @ApiOperation(value = "获取街道信息", notes = "获取街道信息")
    public Envelop findByTown(@ApiParam(name = "town", value = "区级code")
                              @RequestParam(value = "town", required = true) String town)  {
        return success(baseStreetService.findByTown(town));
    }
}