瀏覽代碼

Merge branch 'dev' of trick9191/jw2.0 into dev

trick9191 7 年之前
父節點
當前提交
814497785b

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/archives/PatientArchives.java

@ -13,7 +13,7 @@ import java.util.Date;
 */
 */
@Entity
@Entity
@Table(name = "wlyy_patient_archives")
@Table(name = "wlyy_patient_archives")
public class PatientArchives extends IdEntityWithOperation implements Serializable {
public class PatientArchivesDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    @Column(name = "saas_id")
    private String saasId; //saasid
    private String saasId; //saasid
    @Column(name = "patient_code")
    @Column(name = "patient_code")

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/archives/PatientArchivesInfo.java

@ -13,7 +13,7 @@ import java.util.Date;
 */
 */
@Entity
@Entity
@Table(name = "wlyy_patient_archives_info")
@Table(name = "wlyy_patient_archives_info")
public class PatientArchivesInfo extends IdEntityWithOperation implements Serializable {
public class PatientArchivesInfoDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    @Column(name = "saas_id")
    private String saasId; //saasid
    private String saasId; //saasid

+ 6 - 13
svr/svr-wlyy-archives/src/main/java/com/yihu/jw/controller/PatientArchivesController.java

@ -1,21 +1,15 @@
package com.yihu.jw.controller;
package com.yihu.jw.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.archives.PatientArchives;
import com.yihu.jw.entity.archives.PatientArchivesInfo;
import com.yihu.jw.iot.device.IotDeviceQualityInspectionPlanDO;
import com.yihu.jw.entity.archives.PatientArchivesDO;
import com.yihu.jw.entity.archives.PatientArchivesInfoDO;
import com.yihu.jw.restmodel.archives.PatientArchivesInfoVO;
import com.yihu.jw.restmodel.archives.PatientArchivesInfoVO;
import com.yihu.jw.restmodel.archives.PatientArchivesVO;
import com.yihu.jw.restmodel.archives.PatientArchivesVO;
import com.yihu.jw.restmodel.archives.Test;
import com.yihu.jw.restmodel.archives.Test;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportVO;
import com.yihu.jw.rm.archives.PatientArchivesMapping;
import com.yihu.jw.rm.archives.PatientArchivesMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.service.PatientArchivesSevice;
import com.yihu.jw.service.PatientArchivesSevice;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
@ -24,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
/**
/**
@ -85,9 +78,9 @@ public class PatientArchivesController extends EnvelopRestController {
                                                  @ApiParam(name = "list", value = "建档详情Json")
                                                  @ApiParam(name = "list", value = "建档详情Json")
                                                  @RequestParam(value = "list", required = true)String list){
                                                  @RequestParam(value = "list", required = true)String list){
        try {
        try {
            PatientArchives ps = toEntity(patientArchives, PatientArchives.class);
            PatientArchivesDO ps = toEntity(patientArchives, PatientArchivesDO.class);
            List<PatientArchivesInfo> infos = new ObjectMapper().readValue(list, new TypeReference<List<PatientArchivesInfo>>(){});
            List<PatientArchivesInfoDO> infos = new ObjectMapper().readValue(list, new TypeReference<List<PatientArchivesInfoDO>>(){});
            return patientArchivesSevice.createPatientArchives(ps,infos);
            return patientArchivesSevice.createPatientArchives(ps,infos);
        }catch (Exception e){
        }catch (Exception e){
@ -104,9 +97,9 @@ public class PatientArchivesController extends EnvelopRestController {
                                                  @ApiParam(name = "list", value = "建档详情")
                                                  @ApiParam(name = "list", value = "建档详情")
                                                  @RequestParam(value = "list", required = true)String list){
                                                  @RequestParam(value = "list", required = true)String list){
        try {
        try {
            PatientArchives ps = toEntity(patientArchives, PatientArchives.class);
            PatientArchivesDO ps = toEntity(patientArchives, PatientArchivesDO.class);
            List<PatientArchivesInfo> infos = new ObjectMapper().readValue(list, new TypeReference<List<PatientArchivesInfo>>(){});
            List<PatientArchivesInfoDO> infos = new ObjectMapper().readValue(list, new TypeReference<List<PatientArchivesInfoDO>>(){});
            return patientArchivesSevice.updatePatientArchives(ps,infos);
            return patientArchivesSevice.updatePatientArchives(ps,infos);
        }catch (Exception e){
        }catch (Exception e){

+ 3 - 3
svr/svr-wlyy-archives/src/main/java/com/yihu/jw/dao/PatientArchivesDao.java

@ -1,12 +1,12 @@
package com.yihu.jw.dao;
package com.yihu.jw.dao;
import com.yihu.jw.entity.archives.PatientArchives;
import com.yihu.jw.entity.archives.PatientArchivesDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * Created by Trick on 2018/2/7.
 * Created by Trick on 2018/2/7.
 */
 */
public interface PatientArchivesDao extends PagingAndSortingRepository<PatientArchives, String>,
        JpaSpecificationExecutor<PatientArchives> {
public interface PatientArchivesDao extends PagingAndSortingRepository<PatientArchivesDO, String>,
        JpaSpecificationExecutor<PatientArchivesDO> {
}
}

+ 4 - 4
svr/svr-wlyy-archives/src/main/java/com/yihu/jw/dao/PatientArchivesInfoDao.java

@ -1,6 +1,6 @@
package com.yihu.jw.dao;
package com.yihu.jw.dao;
import com.yihu.jw.entity.archives.PatientArchivesInfo;
import com.yihu.jw.entity.archives.PatientArchivesInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -9,8 +9,8 @@ import java.util.List;
/**
/**
 * Created by Trick on 2018/2/7.
 * Created by Trick on 2018/2/7.
 */
 */
public interface PatientArchivesInfoDao extends PagingAndSortingRepository<PatientArchivesInfo, String>,
        JpaSpecificationExecutor<PatientArchivesInfo> {
    List<PatientArchivesInfo> findByArchivesCodeOrderByLevel1(String archivesCode);
public interface PatientArchivesInfoDao extends PagingAndSortingRepository<PatientArchivesInfoDO, String>,
        JpaSpecificationExecutor<PatientArchivesInfoDO> {
    List<PatientArchivesInfoDO> findByArchivesCodeOrderByLevel1(String archivesCode);
    int deleteByArchivesCode(String archivesCode);
    int deleteByArchivesCode(String archivesCode);
}
}

+ 10 - 12
svr/svr-wlyy-archives/src/main/java/com/yihu/jw/service/PatientArchivesSevice.java

@ -4,8 +4,8 @@ package com.yihu.jw.service;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.jw.dao.PatientArchivesDao;
import com.yihu.jw.dao.PatientArchivesDao;
import com.yihu.jw.dao.PatientArchivesInfoDao;
import com.yihu.jw.dao.PatientArchivesInfoDao;
import com.yihu.jw.entity.archives.PatientArchives;
import com.yihu.jw.entity.archives.PatientArchivesInfo;
import com.yihu.jw.entity.archives.PatientArchivesDO;
import com.yihu.jw.entity.archives.PatientArchivesInfoDO;
import com.yihu.jw.restmodel.archives.PatientArchivesInfoVO;
import com.yihu.jw.restmodel.archives.PatientArchivesInfoVO;
import com.yihu.jw.restmodel.archives.PatientArchivesVO;
import com.yihu.jw.restmodel.archives.PatientArchivesVO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.Envelop;
@ -13,11 +13,9 @@ import com.yihu.jw.rm.archives.PatientArchivesMapping;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import java.text.ParseException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collection;
@ -28,7 +26,7 @@ import java.util.List;
 */
 */
@Service
@Service
@Transactional
@Transactional
public class PatientArchivesSevice extends BaseJpaService<PatientArchives,PatientArchivesDao> {
public class PatientArchivesSevice extends BaseJpaService<PatientArchivesDO,PatientArchivesDao> {
    @Autowired
    @Autowired
    private PatientArchivesInfoDao patientArchivesInfoDao;
    private PatientArchivesInfoDao patientArchivesInfoDao;
@ -62,7 +60,7 @@ public class PatientArchivesSevice extends BaseJpaService<PatientArchives,Patien
        }
        }
        String sorts = "-createTime";
        String sorts = "-createTime";
        //得到list数据
        //得到list数据
        List<PatientArchivesVO> list = search(null, filters, sorts, page, size);
        List<PatientArchivesDO> list = search(null, filters, sorts, page, size);
        //获取总数
        //获取总数
        long count = getCount(filters);
        long count = getCount(filters);
@ -79,26 +77,26 @@ public class PatientArchivesSevice extends BaseJpaService<PatientArchives,Patien
     */
     */
    public Envelop<PatientArchivesInfoVO> queryPatientArchivesInfoPage(String code) throws ParseException {
    public Envelop<PatientArchivesInfoVO> queryPatientArchivesInfoPage(String code) throws ParseException {
        List<PatientArchivesInfo> list = patientArchivesInfoDao.findByArchivesCodeOrderByLevel1(code);
        List<PatientArchivesInfoDO> list = patientArchivesInfoDao.findByArchivesCodeOrderByLevel1(code);
        List<PatientArchivesInfoVO> patientArchivesinfoVOs = convertToModelVOs2(list,new ArrayList<>(list.size()));
        List<PatientArchivesInfoVO> patientArchivesinfoVOs = convertToModelVOs2(list,new ArrayList<>(list.size()));
        return Envelop.getSuccessList(PatientArchivesMapping.api_success,patientArchivesinfoVOs);
        return Envelop.getSuccessList(PatientArchivesMapping.api_success,patientArchivesinfoVOs);
    }
    }
    public Envelop<Boolean> createPatientArchives(PatientArchives patientArchives,List<PatientArchivesInfo> list){
    public Envelop<Boolean> createPatientArchives(PatientArchivesDO patientArchivesDO, List<PatientArchivesInfoDO> list){
        patientArchivesDao.save(patientArchives);
        patientArchivesDao.save(patientArchivesDO);
        patientArchivesInfoDao.save(list);
        patientArchivesInfoDao.save(list);
        Envelop envelop = new Envelop();
        Envelop envelop = new Envelop();
        envelop.setObj(true);
        envelop.setObj(true);
        return envelop;
        return envelop;
    }
    }
    public  Envelop<Boolean> updatePatientArchives(PatientArchives patientArchives,List<PatientArchivesInfo> list){
    public  Envelop<Boolean> updatePatientArchives(PatientArchivesDO patientArchivesDO, List<PatientArchivesInfoDO> list){
        patientArchivesDao.save(patientArchives);
        patientArchivesInfoDao.deleteByArchivesCode(patientArchives.getId());
        patientArchivesDao.save(patientArchivesDO);
        patientArchivesInfoDao.deleteByArchivesCode(patientArchivesDO.getId());
        patientArchivesInfoDao.save(list);
        patientArchivesInfoDao.save(list);
        Envelop envelop = new Envelop();
        Envelop envelop = new Envelop();
        envelop.setObj(true);
        envelop.setObj(true);