Browse Source

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan 4 years ago
parent
commit
a542c74f46
23 changed files with 337 additions and 36 deletions
  1. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/httplog/service/WlyyHttpLogService.java
  2. 3 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 23 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  4. 14 3
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  5. 1 0
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  6. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  7. 21 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java
  8. 18 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java
  9. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemDO.java
  10. 1 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  11. 13 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/team/BaseTeamVO.java
  12. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorIncentiveDao.java
  13. 3 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/org/BaseOrgUserDao.java
  14. 0 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/team/BaseTeamDao.java
  15. 9 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/team/BaseTeamMemberDao.java
  16. 14 3
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorEndpoint.java
  17. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java
  18. 6 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/team/BaseTeamEndpoint.java
  19. 110 16
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  20. 6 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java
  21. 22 4
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageItemService.java
  22. 15 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java
  23. 18 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/team/BaseTeamService.java

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/httplog/service/WlyyHttpLogService.java

@ -96,6 +96,7 @@ public class WlyyHttpLogService  extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
        if (StringUtils.isNotBlank(doctor)){
        if (StringUtils.isNotBlank(doctor)){
            sql+=" and b.name like '%"+doctor+"%'";
            sql+=" and b.name like '%"+doctor+"%'";
        }
        }
        sql+=" order by t.create_time desc ";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        Long count = 0L;
        Long count = 0L;
@ -176,6 +177,7 @@ public class WlyyHttpLogService  extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
        if (StringUtils.isNotBlank(responeKeyWord)){
        if (StringUtils.isNotBlank(responeKeyWord)){
            sql+=" and t.response like '%"+responeKeyWord+"%'";
            sql+=" and t.response like '%"+responeKeyWord+"%'";
        }
        }
        sql+=" order by t.create_time desc";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        Long count = 0L;
        Long count = 0L;

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

@ -5664,6 +5664,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param consutlSort
     * @param consutlSort
     * @return
     * @return
     */
     */
    @Transactional(readOnly = true)
    public MixEnvelop findDoctorByHospitalAndDiseaseAndDept(String iswork, String patientid, String orgCode, String dept,
    public MixEnvelop findDoctorByHospitalAndDiseaseAndDept(String iswork, String patientid, String orgCode, String dept,
                                                                           String diseaseKey, String doctorNameKey,
                                                                           String diseaseKey, String doctorNameKey,
                                                                           String jobTitleNameKey, String outpatientType,
                                                                           String jobTitleNameKey, String outpatientType,
@ -6450,10 +6451,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    @Autowired
    @Autowired
    private FileUploadService fileUploadService;
    private FileUploadService fileUploadService;
    public Map<String, Object> test() throws Exception {
   /* public Map<String, Object> test() throws Exception {
        entranceService.MS02014(false);
        entranceService.MS02014(false);
        return null;
        return null;
    }
    }*/
    public String test2(String no) throws Exception {
    public String test2(String no) throws Exception {
        TransRequest e = new TransRequest();
        TransRequest e = new TransRequest();

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

@ -7,9 +7,11 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.doctor.BaseDoctorZsInfoDO;
import com.yihu.jw.entity.hospital.doctor.BaseDoctorZsInfoDO;
@ -134,6 +136,8 @@ public class EntranceService {
    private OutpatientDao outpatientDao;
    private OutpatientDao outpatientDao;
    @Autowired
    @Autowired
    private WlyyHttpLogDao wlyyHttpLogDao;
    private WlyyHttpLogDao wlyyHttpLogDao;
    @Autowired
    private BaseDoctorRoleDao baseDoctorRoleDao;
    private static String entranceUrl="http://172.16.100.240:10023/mqsdk/";
    private static String entranceUrl="http://172.16.100.240:10023/mqsdk/";
//    private static String entranceUrl="http://localhost:10023/mqsdk/";
//    private static String entranceUrl="http://localhost:10023/mqsdk/";
@ -2596,6 +2600,10 @@ public class EntranceService {
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    }
    public static void main(String[] args) {
        String ss ="ss";
        System.out.println(ss.split(",")[0]+"==="+ss.split(",").length);
    }
    /**
    /**
     * 同步医生信息
     * 同步医生信息
@ -2655,9 +2663,12 @@ public class EntranceService {
                                //保存医生信息
                                //保存医生信息
                                BaseDoctorDO baseDoctorDO = new BaseDoctorDO();
                                BaseDoctorDO baseDoctorDO = new BaseDoctorDO();
                                String idCard = null == jsonObjectBody.get("Card_Id") ? "" : jsonObjectBody.get("Card_Id").toString();
                                String idCard = null == jsonObjectBody.get("Card_Id") ? "" : jsonObjectBody.get("Card_Id").toString();
                                String[] doctorIdcards = docIdCard.split(",");
                                String docIdCardOne ="";
                                for (int j =0 ;j<doctorIdcards.length;j++){
                                    docIdCardOne = doctorIdcards[j];
                                //同步单条信息
                                //同步单条信息
                                if (docIdCard.equals(idCard)) {
                                if (docIdCardOne.equals(idCard)) {
                                    baseDoctorDO.setIdcard(idCard);
                                    baseDoctorDO.setIdcard(idCard);
                                    baseDoctorDO.setBirthday(IdCardUtil.getBirthdayForIdcard(idCard));
                                    baseDoctorDO.setBirthday(IdCardUtil.getBirthdayForIdcard(idCard));
@ -2719,14 +2730,24 @@ public class EntranceService {
                                        baseDoctorHospitalDO.setDel("1");
                                        baseDoctorHospitalDO.setDel("1");
                                        baseDoctorHospitalDao.save(baseDoctorHospitalDO);
                                        baseDoctorHospitalDao.save(baseDoctorHospitalDO);
                                    }
                                    }
                                    BaseDoctorRoleDO roleList = baseDoctorRoleDao.findByDoctorCodeAndroleCode(baseDoctorDO.getId(), "specialist");
                                    if (roleList == null) {
                                        roleList = new BaseDoctorRoleDO();
                                        roleList.setDoctorCode(baseDoctorDO.getId());
                                        roleList.setRoleCode("specialist");
                                        baseDoctorRoleDao.save(roleList);
                                    }
                                    i++;
                                    i++;
                                }
                                }
                                }
                            }
                            }
                        }
                        }
                    }
                    }
                }
                }
            }
            }
        }
        }
        return i;
        return i;
    }
    }

+ 14 - 3
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -1,5 +1,6 @@
package com.yihu.jw.internet.service;
package com.yihu.jw.internet.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -134,7 +135,15 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
        getBaseSurperviseDict();
        getBaseSurperviseDict();
        WsapiProxy proxy = new WsapiProxy();
        WsapiProxy proxy = new WsapiProxy();
        proxy.setEndpoint(url);
        proxy.setEndpoint(url);
        logger.info("入参:"+JSONUtils.toString(params));
        JSONObject jsonObject= new JSONObject();
        if (params!=null&&params.size()>0){
            jsonObject= params.getJSONObject(0);
            jsonObject.put("docimg","");
            jsonObject.put("doc_cert","");
            jsonObject.put("cert_doc_prac","");
        }
        logger.info("入参:"+jsonObject.toString());
        Wsapi wsapi = proxy.getWsapi();
        Wsapi wsapi = proxy.getWsapi();
//        logger.info("postToInter:"+JSONUtils.toString(new String[] {token, params.toString()}));
//        logger.info("postToInter:"+JSONUtils.toString(new String[] {token, params.toString()}));
@ -772,7 +781,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
               "JOIN "+base+".topics t ON t.id = b.consult\n" +
               "JOIN "+base+".topics t ON t.id = b.consult\n" +
               "WHERE\n" +
               "WHERE\n" +
               "\ta.id = b.consult\n" +
               "\ta.id = b.consult\n" +
               " AND a.symptoms IS NOT NULL AND b.status=1 ";
               " AND a.symptoms IS NOT NULL AND b.status=1 " +
               "  and c.doctor not in ('402803816babc778016babd0dee21112')";
        Map<String,Object> params = new HashedMap();
        Map<String,Object> params = new HashedMap();
@ -1578,7 +1588,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "JOIN "+base+".topics t ON t.id = b.consult\n" +
                "JOIN "+base+".topics t ON t.id = b.consult\n" +
                "WHERE\n" +
                "WHERE\n" +
                "\ta.id = b.consult\n" +
                "\ta.id = b.consult\n" +
                "AND a.symptoms IS NOT NULL AND b.status=1";
                "AND a.symptoms IS NOT NULL AND b.status=1 " +
                " and c.doctor not in ('402803816babc778016babd0dee21112')";
        if(StringUtils.isNotBlank(startDate)){
        if(StringUtils.isNotBlank(startDate)){
            wlzxSql =  wlzxSql + "  and a.czrq >=:startDate ";
            wlzxSql =  wlzxSql + "  and a.czrq >=:startDate ";

+ 1 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -4008,6 +4008,7 @@ public class ImService {
	 * @param end_time 结束时间
	 * @param end_time 结束时间
	 * @return
	 * @return
	 */
	 */
	@Transactional(readOnly = true)
	public List<Map<String,Object>>  findConsultRecordByDoctorNew(String doctor, String id,
	public List<Map<String,Object>>  findConsultRecordByDoctorNew(String doctor, String id,
															   String type, Integer status,
															   String type, Integer status,
															   int page,int pagesize,
															   int page,int pagesize,

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -280,6 +280,17 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     * 家医咨询号别
     * 家医咨询号别
     */
     */
    private String jyzxChargeType;
    private String jyzxChargeType;
    private String visitTime;
    @Column(name = "visit_time")
    public String getVisitTime() {
        return visitTime;
    }
    public void setVisitTime(String visitTime) {
        this.visitTime = visitTime;
    }
    @Column(name = "jyzx_charge_type")
    @Column(name = "jyzx_charge_type")
    public String getJyzxChargeType() {
    public String getJyzxChargeType() {
        return jyzxChargeType;
        return jyzxChargeType;

+ 21 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
/**
@ -174,6 +175,26 @@ public class BaseOrgDO extends UuidIdentityEntityWithOperator {
     * 机构logo
     * 机构logo
     */
     */
    private String logo;
    private String logo;
    private BaseOrgUserDO baseOrgUserDO;
    private String adminMobile;
    @Column(name = "admin_mobile")
    public String getAdminMobile() {
        return adminMobile;
    }
    public void setAdminMobile(String adminMobile) {
        this.adminMobile = adminMobile;
    }
    @Transient
    public BaseOrgUserDO getBaseOrgUserDO() {
        return baseOrgUserDO;
    }
    public void setBaseOrgUserDO(BaseOrgUserDO baseOrgUserDO) {
        this.baseOrgUserDO = baseOrgUserDO;
    }
    @Column(name = "credentials")
    @Column(name = "credentials")
    public String getCredentials() {
    public String getCredentials() {
        return credentials;
        return credentials;

+ 18 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java

@ -22,16 +22,33 @@ public class ServicePackageDO extends UuidIdentityEntityWithCreateTime implement
    private String name;//'服务包名称'
    private String name;//'服务包名称'
    private String type;//服务类型(1养老服务、2医疗服务、3安防监护、4慢病管理)
    private String type;//服务类型(1养老服务、2医疗服务、3安防监护、4慢病管理)
    private String typeName;
    private BigDecimal price;//价格
    private BigDecimal price;//价格
    private Integer num;//服务项数量
    private Integer num;//服务项数量
    private String introduce;//'服务介绍'
    private String introduce;//'服务介绍'
    private String del;//'是否有效(1生效,0失效)'
    private String del;//'是否有效(1生效,0失效)'
    private String delName;
    private List<ServicePackageItemDO> packageItemDOList;//服务项
    private List<ServicePackageItemDO> packageItemDOList;//服务项
    private List<BaseOrgDO> orgDOList;//提供机构
    private List<BaseOrgDO> orgDOList;//提供机构
    private List<BaseTeamDO> teamDOList;//服务团队
    private List<BaseTeamDO> teamDOList;//服务团队
    private String teamNames;//服务团队
    private String teamNames;//服务团队
    private String orgNames;//服务机构
    private String orgNames;//服务机构
    @Transient
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    @Transient
    public String getDelName() {
        return delName;
    }
    public void setDelName(String delName) {
        this.delName = delName;
    }
    @Column(name = "name")
    @Column(name = "name")
    public String getName() {
    public String getName() {

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemDO.java

@ -26,6 +26,15 @@ public class ServicePackageItemDO extends UuidIdentityEntity implements java.io.
    private String teamCode;//'服务团队code'
    private String teamCode;//'服务团队code'
    private String teamName;//'服务团队名称'
    private String teamName;//'服务团队名称'
    private String createTime;//
    private String createTime;//
    private String dictId;//
    @Column(name = "dict_id")
    public String getDictId() {
        return dictId;
    }
    public void setDictId(String dictId) {
        this.dictId = dictId;
    }
    @Column(name = "service_package_id")
    @Column(name = "service_package_id")
    public String getServicePackageId() {
    public String getServicePackageId() {

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -419,6 +419,7 @@ public class BaseRequestMapping {
        public static final String findDoctorIncentive  = "/findDoctorIncentive";
        public static final String findDoctorIncentive  = "/findDoctorIncentive";
        public static final String findDoctorOtherIncentive  = "/findDoctorOtherIncentive";
        public static final String findDoctorOtherIncentive  = "/findDoctorOtherIncentive";
        public static final String removeIncentive  = "/removeIncentive";
        public static final String removeIncentive  = "/removeIncentive";
        public static final String resetDoctorPwd  = "/resetDoctorPwd";
    }
    }

+ 13 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/team/BaseTeamVO.java

@ -62,6 +62,19 @@ public class BaseTeamVO extends UuidIdentityVOWithOperator {
	 */
	 */
	@ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
	@ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
    private String del;
    private String del;
    /**
     * 作废标识,1正常,0作废
     */
    @ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
    private String delName;
    public String getDelName() {
        return delName;
    }
    public void setDelName(String delName) {
        this.delName = delName;
    }
    public String getOrgCode() {
    public String getOrgCode() {
        return orgCode;
        return orgCode;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorIncentiveDao.java

@ -8,14 +8,14 @@ import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.List;
public interface BaseDoctorIncentiveDao extends PagingAndSortingRepository<BaseDoctorIncentiveDO, String>, JpaSpecificationExecutor<BaseDoctorIncentiveDO> {
public interface BaseDoctorIncentiveDao extends PagingAndSortingRepository<BaseDoctorIncentiveDO, String>, JpaSpecificationExecutor<BaseDoctorIncentiveDO> {
    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1")
    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and isDel = '1'")
    List<BaseDoctorIncentiveDO> findByDoctorCode(String doctorCode);
    List<BaseDoctorIncentiveDO> findByDoctorCode(String doctorCode);
    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and incentiveId = ?2 and isDel = '1'")
    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and incentiveId = ?2 and isDel = '1'")
    List<BaseDoctorIncentiveDO> findByDoctorCodeAndIncentiveId(String doctorCode,String incentiveId);
    List<BaseDoctorIncentiveDO> findByDoctorCodeAndIncentiveId(String doctorCode,String incentiveId);
    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and incentiveId = ?2 ")
    @Query("from BaseDoctorIncentiveDO where doctorCode = ?1 and incentiveId = ?2 and isDel =?3")
    BaseDoctorIncentiveDO findByDoctorCodeAndIncentiveIdAndIsDel(String doctorCode,String incentiveId,String isDel);
    BaseDoctorIncentiveDO findByDoctorCodeAndIncentiveIdAndIsDel(String doctorCode,String incentiveId,String isDel);

+ 3 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/org/BaseOrgUserDao.java

@ -33,4 +33,7 @@ public interface BaseOrgUserDao extends PagingAndSortingRepository<BaseOrgUserDO
    Set<String> findorgCodeListByUserId(String userId);
    Set<String> findorgCodeListByUserId(String userId);
    List<BaseOrgUserDO> findAllByUserId(String userId);
    List<BaseOrgUserDO> findAllByUserId(String userId);
    @Query("select orgCode from BaseOrgUserDO where orgCode = ?1 and userId =?2")
    BaseOrgUserDO getBaseOrgUserByOrgCodeAndUserid(String orgCode,String userId);
}
}

+ 0 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/team/BaseTeamDao.java

@ -24,5 +24,4 @@ import java.util.Map;
public interface BaseTeamDao extends PagingAndSortingRepository<BaseTeamDO, String>, JpaSpecificationExecutor<BaseTeamDO>  {
public interface BaseTeamDao extends PagingAndSortingRepository<BaseTeamDO, String>, JpaSpecificationExecutor<BaseTeamDO>  {
    @Query("select orgCode as code,orgName as name from BaseTeamDO")
    @Query("select orgCode as code,orgName as name from BaseTeamDO")
    List<Map<String,Object>> getTeamOrgList();
    List<Map<String,Object>> getTeamOrgList();
 }
 }

+ 9 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/team/BaseTeamMemberDao.java

@ -31,4 +31,13 @@ public interface BaseTeamMemberDao extends PagingAndSortingRepository<BaseTeamMe
    Set<Object> findIdListByTeamCode(String teamCode);
    Set<Object> findIdListByTeamCode(String teamCode);
    List<BaseTeamMemberDO> findByTeamCode(String teamCode);
    List<BaseTeamMemberDO> findByTeamCode(String teamCode);
    @Query("from BaseTeamMemberDO  t where t.doctorCode = ?1 and t.del ='1'")
    List<BaseTeamMemberDO> findUseDoctorCode(String doctorCode);
    @Query("from BaseTeamMemberDO  t where t.doctorCode = ?1 and t.del ='1'")
    List<BaseTeamMemberDO> findUseDoctorCodeAndDel(String doctorCode);
    @Query("from BaseTeamMemberDO  t where t.doctorCode = ?1 and t.teamCode=?2 and t.del ='1'")
    BaseTeamMemberDO findUseDoctorCodeAndTeamCode(String doctorCode,String teamCode);
}
}

+ 14 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorEndpoint.java

@ -455,13 +455,15 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    public MixEnvelop findDoctorIncentive(
    public MixEnvelop findDoctorIncentive(
            @ApiParam(name = "doctor", value = "", required = false)
            @ApiParam(name = "doctor", value = "", required = false)
            @RequestParam(value = "doctor", required = false)String doctor,
            @RequestParam(value = "doctor", required = false)String doctor,
            @ApiParam(name = "name", value = "", required = false)
            @RequestParam(value = "name", required = false)String name,
            @ApiParam(name = "page", value = "", required = false)
            @ApiParam(name = "page", value = "", required = false)
            @RequestParam(value = "page", required = false)Integer page,
            @RequestParam(value = "page", required = false)Integer page,
            @ApiParam(name = "pageSize", value = "", required = false)
            @ApiParam(name = "pageSize", value = "", required = false)
            @RequestParam(value = "pageSize", required = false)Integer pageSize) {
            @RequestParam(value = "pageSize", required = false)Integer pageSize) {
        return baseDoctorService.findIncentiveByDoctor(doctor,page,pageSize);
        return baseDoctorService.findIncentiveByDoctor(doctor,name,page,pageSize);
    }
    }
@ -480,9 +482,18 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    public Envelop removeIncentive(
    public Envelop removeIncentive(
            @ApiParam(name = "doctor", value = "", required = false)
            @ApiParam(name = "doctor", value = "", required = false)
            @RequestParam(value = "doctor", required = false)String doctor,
            @RequestParam(value = "doctor", required = false)String doctor,
            @ApiParam(name = "doctor", value = "", required = false)
            @RequestParam(value = "doctor", required = false)String incentiveId) {
            @ApiParam(name = "incentiveId", value = "", required = false)
            @RequestParam(value = "incentiveId", required = false)String incentiveId) {
        return success(baseDoctorService.removeDoctorIncentive(doctor,incentiveId));
        return success(baseDoctorService.removeDoctorIncentive(doctor,incentiveId));
    }
    }
    @GetMapping(value = BaseRequestMapping.BaseDoctor.resetDoctorPwd)
    @ApiOperation(value = "医生充值密码")
    public Envelop resetDoctorPwd(
            @ApiParam(name = "doctor", value = "", required = false)
            @RequestParam(value = "doctor", required = true)String doctor) {
        return success(baseDoctorService.resetDoctorPwd(doctor));
    }
}
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java

@ -5,6 +5,8 @@ import com.yihu.jw.base.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.base.service.servicePackage.ServicePackageService;
import com.yihu.jw.base.service.servicePackage.ServicePackageService;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -36,6 +38,8 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    private ServicePackageDao servicePackageDao;
    private ServicePackageDao servicePackageDao;
    @Autowired
    @Autowired
    private ServicePackageItemDao servicePackageItemDao;
    private ServicePackageItemDao servicePackageItemDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = BaseRequestMapping.ServicePackage.CREATE)
    @PostMapping(value = BaseRequestMapping.ServicePackage.CREATE)
    @ApiOperation(value = "创建")
    @ApiOperation(value = "创建")
@ -77,6 +81,18 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
            List<String> teamNames = itemDOList.stream().map(p -> p.getTeamName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
            List<String> teamNames = itemDOList.stream().map(p -> p.getTeamName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
            servicePackageDO.setOrgNames(StringUtils.join(orgNames,","));
            servicePackageDO.setOrgNames(StringUtils.join(orgNames,","));
            servicePackageDO.setTeamNames(StringUtils.join(teamNames,","));
            servicePackageDO.setTeamNames(StringUtils.join(teamNames,","));
            List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("serviceType");
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS){
                if (servicePackageDO.getType().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    servicePackageDO.setTypeName(wlyyHospitalSysDictDO.getDictValue());
                }
            }
            List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS1 = wlyyHospitalSysDictDao.findByDictName("isEffect");
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS1){
                if (servicePackageDO.getDel().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    servicePackageDO.setDelName(wlyyHospitalSysDictDO.getDictValue());
                }
            }
        }
        }
        int count = (int)servicePackageService.getCount(filters);
        int count = (int)servicePackageService.getCount(filters);
        return success(servicePackageDOS, count, page, size);
        return success(servicePackageDOS, count, page, size);

+ 6 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/team/BaseTeamEndpoint.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.service.team.BaseTeamService;
import com.yihu.jw.base.service.team.BaseTeamService;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.restmodel.base.team.BaseTeamVO;
import com.yihu.jw.restmodel.base.team.BaseTeamVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -15,11 +16,13 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
/**
/**
@ -104,6 +107,9 @@ public class BaseTeamEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<BaseTeamDO> baseTeams = baseTeamService.search(fields, filters, sorts);
        List<BaseTeamDO> baseTeams = baseTeamService.search(fields, filters, sorts);
        List<BaseTeamVO> baseTeamVOS = new ArrayList<>();
        BeanUtils.copyProperties(baseTeams,baseTeamVOS);
        baseTeamService.transDel(baseTeamVOS);
        return success(baseTeams, BaseTeamVO.class);
        return success(baseTeams, BaseTeamVO.class);
    }
    }

+ 110 - 16
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorIncentiveDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorIncentiveDao;
import com.yihu.jw.base.dao.team.BaseTeamDao;
import com.yihu.jw.base.dao.team.BaseTeamMemberDao;
import com.yihu.jw.base.service.dict.DictDoctorDutyService;
import com.yihu.jw.base.service.dict.DictDoctorDutyService;
import com.yihu.jw.base.service.doctor.excelImport.BaseDoctorExcelDO;
import com.yihu.jw.base.service.doctor.excelImport.BaseDoctorExcelDO;
import com.yihu.jw.base.service.org.OrgTree;
import com.yihu.jw.base.service.org.OrgTree;
@ -25,6 +27,8 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorIncentiveDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorIncentiveDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.entity.base.team.BaseTeamMemberDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.exception.business.ManageException;
import com.yihu.jw.exception.business.ManageException;
@ -117,6 +121,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    private BaseDoctorIncentiveDao baseDoctorIncentiveDao;
    private BaseDoctorIncentiveDao baseDoctorIncentiveDao;
    @Autowired
    @Autowired
    private BaseIncentiveDictDao baseIncentiveDictDao;
    private BaseIncentiveDictDao baseIncentiveDictDao;
    @Autowired
    private BaseTeamMemberDao baseTeamMemberDao;
    @Value("${wechat.flag}")
    @Value("${wechat.flag}")
    private boolean flag;
    private boolean flag;
@ -131,6 +137,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    private HibenateUtils hibenateUtils;
    private HibenateUtils hibenateUtils;
    @Autowired
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private BaseTeamDao baseTeamDao;
    /**
    /**
@ -157,10 +165,22 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        //医生归属业务模块角色信息,非必填,数据可有可没有
        //医生归属业务模块角色信息,非必填,数据可有可没有
        String[] paramNames = {"doctorCode"};
        String[] paramNames = {"doctorCode"};
        Object[] paramValue = {doctorId};
        Object[] paramValue = {doctorId};
        List<BaseDoctorRoleDO> roleList = baseDoctorRoleService.findByFields(paramNames,paramValue);
        JSONObject jsonObject = new JSONObject();
        JSONObject jsonObject = new JSONObject();
        List<BaseTeamMemberDO> baseTeamMemberDO = baseTeamMemberDao.findUseDoctorCode(doctorId);
        List<BaseTeamDO> teamlist = new ArrayList<>();
        if (baseTeamMemberDO!=null&&baseTeamMemberDO.size()>0){
            for (BaseTeamMemberDO baseTeamMemberDO1:baseTeamMemberDO){
                String teamCode = baseTeamMemberDO1.getTeamCode();
                BaseTeamDO baseTeamDO = baseTeamDao.findOne(teamCode);
                teamlist.add(baseTeamDO);
            }
            jsonObject.put("teamInfo",teamlist);
        }
        List<BaseDoctorRoleDO> roleList = baseDoctorRoleService.findByFields(paramNames,paramValue);
        jsonObject.put("doctor",doctors);
        jsonObject.put("doctor",doctors);
        jsonObject.put("role",roleList);
        jsonObject.put("role",roleList);
        List<BaseDoctorHospitalDO> baseDoctorHospitalDO = baseDoctorHospitalDao.findByDoctorCode(doctorId);
        jsonObject.put("hospital",baseDoctorHospitalDO);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",jsonObject);
        result.put("msg",jsonObject);
        return result;
        return result;
@ -413,6 +433,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        JSONObject doctor = jsonObject.getJSONObject("doctor");
        JSONObject doctor = jsonObject.getJSONObject("doctor");
        JSONArray role = jsonObject.getJSONArray("role");
        JSONArray role = jsonObject.getJSONArray("role");
        String teamCode = jsonObject.getString("teamCode");
        JSONArray hospital = jsonObject.getJSONArray("hospital");
        JSONArray hospital = jsonObject.getJSONArray("hospital");
        String doctorMappingCode = jsonObject.getString("doctorMappingCode");
        String doctorMappingCode = jsonObject.getString("doctorMappingCode");
        if (null == doctor) {
        if (null == doctor) {
@ -423,6 +444,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        //组装医生信息
        //组装医生信息
        BaseDoctorDO baseDoctorDO = null;
        BaseDoctorDO baseDoctorDO = null;
        BaseDoctorDO baseDoctorvo = null;
        BaseDoctorDO baseDoctorvo = null;
        String orgCode = "";
        DoctorMappingDO doctorMappingDO = null;
        DoctorMappingDO doctorMappingDO = null;
        try {
        try {
            baseDoctorvo = objectMapper.readValue(doctor.toJSONString(), BaseDoctorDO.class);
            baseDoctorvo = objectMapper.readValue(doctor.toJSONString(), BaseDoctorDO.class);
@ -517,7 +539,6 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        if (!CollectionUtils.isEmpty(hospital)) {
        if (!CollectionUtils.isEmpty(hospital)) {
            BaseDoctorHospitalDO baseDoctorHospitalDO = null;
            BaseDoctorHospitalDO baseDoctorHospitalDO = null;
            List<BaseDoctorHospitalDO> hospitalDOList = new ArrayList<>();
            List<BaseDoctorHospitalDO> hospitalDOList = new ArrayList<>();
            String orgCode = "";
            String orgName = "";
            String orgName = "";
            try {
            try {
                for (Object object : hospital) {
                for (Object object : hospital) {
@ -553,6 +574,22 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                return result.toJSONString();
                return result.toJSONString();
            }
            }
        }
        if (!StringUtils.isEmpty(teamCode)){
            String[] teamCodeList = teamCode.split(",");
            for (int i=0;i<teamCodeList.length;i++){
                BaseTeamMemberDO mems = baseTeamMemberDao.findUseDoctorCodeAndTeamCode(baseDoctorDO.getId(),teamCodeList[i]);
                if (mems==null){
                    mems = new BaseTeamMemberDO();
                }
                mems.setTeamCode(teamCodeList[i]);
                mems.setDoctorCode(baseDoctorDO.getId());
                mems.setOrgCode(orgCode);
                mems.setDel("1");
                mems.setCreateTime(new Date());
                baseTeamMemberDao.save(mems);
            }
        }
        }
        result.put("response", ConstantUtils.SUCCESS);
        result.put("response", ConstantUtils.SUCCESS);
        result.put("msg", baseDoctorDO);
        result.put("msg", baseDoctorDO);
@ -573,6 +610,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            return result.toJSONString();
            return result.toJSONString();
        }
        }
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        String teamCode = jsonObject.getString("teamCode");
        JSONObject doctor = jsonObject.getJSONObject("doctor");
        JSONObject doctor = jsonObject.getJSONObject("doctor");
        JSONArray role = jsonObject.getJSONArray("role");
        JSONArray role = jsonObject.getJSONArray("role");
        String doctorMappingCode = jsonObject.getString("doctorMappingCode");
        String doctorMappingCode = jsonObject.getString("doctorMappingCode");
@ -582,6 +620,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            result.put("response", ConstantUtils.FAIL);
            result.put("response", ConstantUtils.FAIL);
            return result.toJSONString();
            return result.toJSONString();
        }
        }
        String orgCode="";
        //判断医生id是否存在
        //判断医生id是否存在
        if(StringUtils.isEmpty(doctor.getString("id"))){
        if(StringUtils.isEmpty(doctor.getString("id"))){
            result.put("msg","parameter id for doctor is null when update doctor");
            result.put("msg","parameter id for doctor is null when update doctor");
@ -656,7 +695,6 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
         if(!CollectionUtils.isEmpty(hospital)){
         if(!CollectionUtils.isEmpty(hospital)){
             BaseDoctorHospitalDO baseDoctorHospitalDO = null;
             BaseDoctorHospitalDO baseDoctorHospitalDO = null;
             Set<Object> hospitalIdList = baseDoctorHospitalService.findDocHospIdList(baseDoctorDO.getId());
             Set<Object> hospitalIdList = baseDoctorHospitalService.findDocHospIdList(baseDoctorDO.getId());
             String orgCode = "";
             String orgName="";
             String orgName="";
             try {
             try {
                 for(Object object : hospital){
                 for(Object object : hospital){
@ -672,11 +710,14 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                     }
                     }
                     orgCode = baseDoctorHospitalDO.getOrgCode();
                     orgCode = baseDoctorHospitalDO.getOrgCode();
                     orgName = baseDoctorHospitalDO.getOrgName();
                     orgName = baseDoctorHospitalDO.getOrgName();
                     baseDoctorHospitalDO.setDel("1");
                     baseDoctorHospitalService.save(baseDoctorHospitalDO);
                     baseDoctorHospitalService.save(baseDoctorHospitalDO);
                 }
                 }
                 doctorMappingDO.setOrgCode(orgCode);
                 doctorMappingDO.setOrgName(orgName);
                 doctorMappingDao.save(doctorMappingDO);
                 if(doctorMappingDO!=null){
                     doctorMappingDO.setOrgCode(orgCode);
                     doctorMappingDO.setOrgName(orgName);
                     doctorMappingDao.save(doctorMappingDO);
                 }
             } catch (IOException e) {
             } catch (IOException e) {
                 result.put("msg","convert hospital jsonObject to baseDoctorHospitalDO failed," + e.getCause());
                 result.put("msg","convert hospital jsonObject to baseDoctorHospitalDO failed," + e.getCause());
                 result.put("response",ConstantUtils.FAIL);
                 result.put("response",ConstantUtils.FAIL);
@ -685,7 +726,33 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                 baseDoctorHospitalService.delete(hospitalIdList.toArray());
                 baseDoctorHospitalService.delete(hospitalIdList.toArray());
             }
             }
         }
         }
        if (!StringUtils.isEmpty(teamCode)){
            String[] teamCodeList = teamCode.split(",");
            List<BaseTeamMemberDO> tmlist = baseTeamMemberDao.findUseDoctorCode(baseDoctorDO.getId());
            for (BaseTeamMemberDO baseTeamMemberDO:tmlist){
                baseTeamMemberDO.setDel("0");
            }
            baseTeamMemberDao.save(tmlist);
            for (int i=0;i<teamCodeList.length;i++){
                BaseTeamMemberDO mems = baseTeamMemberDao.findUseDoctorCodeAndTeamCode(baseDoctorDO.getId(),teamCodeList[i]);
                if (mems==null){
                    mems = new BaseTeamMemberDO();
                }
                mems.setTeamCode(teamCodeList[i]);
                mems.setDoctorCode(baseDoctorDO.getId());
                mems.setOrgCode(orgCode);
                mems.setDel("1");
                mems.setCreateTime(new Date());
                baseTeamMemberDao.save(mems);
            }
        }else {
            List<BaseTeamMemberDO> tmlist = baseTeamMemberDao.findUseDoctorCode(baseDoctorDO.getId());
            for (BaseTeamMemberDO baseTeamMemberDO:tmlist){
                baseTeamMemberDO.setDel("0");
            }
            baseTeamMemberDao.save(tmlist);
        }
        result.put("response",ConstantUtils.SUCCESS);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",baseDoctorDO);
        result.put("msg",baseDoctorDO);
        return result.toJSONString();
        return result.toJSONString();
@ -1071,9 +1138,6 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                        if (list.get(j).getIncentiveId().equalsIgnoreCase(incentiveId[i])&&"1".equalsIgnoreCase(list.get(j).getIsDel())){
                        if (list.get(j).getIncentiveId().equalsIgnoreCase(incentiveId[i])&&"1".equalsIgnoreCase(list.get(j).getIsDel())){
                            throw new Exception("该激励已经保存过");
                            throw new Exception("该激励已经保存过");
                        }else if (list.get(j).getIncentiveId().equalsIgnoreCase(incentiveId[i])&&"0".equalsIgnoreCase(list.get(j).getIsDel())){
                            list.get(j).setIsDel("1");
                            saveList.add(list.get(j));
                        }else {
                        }else {
                            BaseDoctorIncentiveDO baseDoctorIncentiveDO = new BaseDoctorIncentiveDO();
                            BaseDoctorIncentiveDO baseDoctorIncentiveDO = new BaseDoctorIncentiveDO();
                            baseDoctorIncentiveDO.setIsDel("1");
                            baseDoctorIncentiveDO.setIsDel("1");
@ -1131,9 +1195,25 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        return envelop;
        return envelop;
    }
    }
    public MixEnvelop findIncentiveByDoctor(String doctorId, Integer page, Integer pageSize) {
    public MixEnvelop findIncentiveByDoctor(String doctorId,String name, Integer page, Integer pageSize) {
        MixEnvelop mixEnvelop = new MixEnvelop();
        MixEnvelop mixEnvelop = new MixEnvelop();
        List<BaseDoctorIncentiveDO> list = baseDoctorIncentiveDao.findByDoctorCodeList(doctorId,creatPage(page,pageSize,""));
        String sql = "select t.id as \"id\"," +
                "t.doctor_code as \"doctorCode\"," +
                "t.doctor_name as \"doctorName\"," +
                "t.incentive_id as \"incentiveId\"," +
                "b.incentive_code as \"incentiveCode\"," +
                "t.incentive_img as \"incentiveImg\"," +
                "t.incentive_name as \"incentiveName\"," +
                "t.create_time as \"createTime\"," +
                "t.is_del as \"isDel\" from base_doctor_incentive t left join base_incentive_dict b " +
                " on b.id = t.incentive_id where t.is_del =1 ";
        if (!StringUtils.isEmpty(doctorId)){
            sql +=" and t.doctor_code ='"+doctorId+"'";
        }
        if (!StringUtils.isEmpty(name)){
            sql +=" and t.incentive_name like '%"+name+"%'";
        }
        List<Map<String,Object>> list  = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<BaseDoctorIncentiveDO> listCount = baseDoctorIncentiveDao.findByDoctorCodeListCount(doctorId);
        List<BaseDoctorIncentiveDO> listCount = baseDoctorIncentiveDao.findByDoctorCodeListCount(doctorId);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setCurrPage(page);
@ -1149,13 +1229,11 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                "b.is_del as \"isDel\"," +
                "b.is_del as \"isDel\"," +
                "b.incentive_code as \"incentiveCode\"," +
                "b.incentive_code as \"incentiveCode\"," +
                "b.create_time as \"createTime\"" +
                "b.create_time as \"createTime\"" +
                "from base_incentive_dict b left join base_doctor_incentive d" +
                " on b.id = d.incentive_id where is_del = '1'";
                "from base_incentive_dict b where b.is_del = '1' ";
        if (!StringUtils.isEmpty(doctorCode)){
        if (!StringUtils.isEmpty(doctorCode)){
            sql+=" and d.doctor_code!='"+doctorCode+"'";
            sql+=" and b.id not in (select  d.incentive_id from base_doctor_incentive d where d.doctor_code ='"+doctorCode+"'  and d.is_del= '1'" +
                    "  group by  d.incentive_id)";
        }
        }
        sql+=" group by  b.id,b.incentive_img,b.incentive_name" +
                "b.incentive_status ,b.is_del, b.incentive_code,b.create_time";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        List<WlyyHospitalSysDictDO> sysDictDOS=wlyyHospitalSysDictDao.findByDictName("drugStoreStatus");
        List<WlyyHospitalSysDictDO> sysDictDOS=wlyyHospitalSysDictDao.findByDictName("drugStoreStatus");
        if (sysDictDOS!=null&&list.size()>0){
        if (sysDictDOS!=null&&list.size()>0){
@ -1169,4 +1247,20 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        }
        }
        return list;
        return list;
    }
    }
    //医生重置密码
    public String  resetDoctorPwd(String doctor){
        BaseDoctorDO baseDoctorDO= baseDoctorDao.findById(doctor);
        if (baseDoctorDO!=null){
            String salt = baseDoctorDO.getSalt();
            if (StringUtils.isEmpty(salt)){
                salt = randomString(5);
                baseDoctorDO.setSalt(salt);
            }
            baseDoctorDO.setPassword(MD5.md5Hex(baseDoctorDO.getIdcard().substring(12, 18) + "{" + salt + "}"));
            baseDoctorDao.save(baseDoctorDO);
            return "操作成功";
        }
        return "医生不存在";
    }
}
}

+ 6 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SimplePropertyPreFilter;
import com.alibaba.fastjson.serializer.SimplePropertyPreFilter;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.org.BaseOrgUserDao;
import com.yihu.jw.base.service.org.tree.SimpleTree;
import com.yihu.jw.base.service.org.tree.SimpleTree;
import com.yihu.jw.base.service.org.tree.SimpleTreeNode;
import com.yihu.jw.base.service.org.tree.SimpleTreeNode;
import com.yihu.jw.base.service.org.tree.TreeNode;
import com.yihu.jw.base.service.org.tree.TreeNode;
@ -73,6 +74,8 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
    @Autowired
    @Autowired
    private HibenateUtils hibenateUtils;
    private HibenateUtils hibenateUtils;
    @Autowired
    private BaseOrgUserDao  baseOrgUserDao;
    @Value("${wechat.flag}")
    @Value("${wechat.flag}")
    private boolean flag;
    private boolean flag;
@ -217,6 +220,8 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
        if(null == baseOrgDO){
        if(null == baseOrgDO){
            return null;
            return null;
        }
        }
        /*BaseOrgUserDO baseOrgUserDO=baseOrgUserDao.getBaseOrgUserByOrgCodeAndUserid(baseOrgDO.getCode(),baseOrgDO.getOrgAdmin());
        baseOrgDO.setBaseOrgUserDO(baseOrgUserDO);*/
        result.put("response",ConstantUtils.SUCCESS);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",baseOrgDO);
        result.put("msg",baseOrgDO);
        return result;
        return result;
@ -238,6 +243,7 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
                return "paramter for admin is null";
                return "paramter for admin is null";
            }
            }
            baseOrgDO.setOrgAdmin(adminName);
            baseOrgDO.setOrgAdmin(adminName);
            baseOrgDO.setAdminMobile(mobile);
            baseOrgDao.save(baseOrgDO);
            baseOrgDao.save(baseOrgDO);
            //新增机构与saas关联关系,初始saas设置为默认值,机构分配给租户在租户管理中操作
            //新增机构与saas关联关系,初始saas设置为默认值,机构分配给租户在租户管理中操作

+ 22 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageItemService.java

@ -2,15 +2,21 @@ package com.yihu.jw.base.service.servicePackage;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.base.dao.team.BaseTeamDao;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.util.List;
/**
/**
 * Created by yeshijie on 2021/2/23.
 * Created by yeshijie on 2021/2/23.
@ -20,21 +26,32 @@ public class ServicePackageItemService extends BaseJpaService<ServicePackageItem
    @Autowired
    @Autowired
    private ServicePackageItemDao servicePackageItemDao;
    private ServicePackageItemDao servicePackageItemDao;
    @Autowired
    private BaseOrgDao  baseOrgDao;
    @Autowired
    private BaseTeamDao baseTeamDao;
    public JSONObject create(ServicePackageItemDO itemDO){
    public JSONObject create(ServicePackageItemDO itemDO){
        JSONObject result = new JSONObject();
        JSONObject result = new JSONObject();
/*         if(StringUtils.isEmpty(itemDO.getTeamCode())){
         if(StringUtils.isEmpty(itemDO.getTeamCode())){
            result.put("msg","请选择服务团队");
            result.put("msg","请选择服务团队");
            result.put("response", ConstantUtils.FAIL);
            result.put("response", ConstantUtils.FAIL);
            return result;
            return result;
        }
        }
       List<ServicePackageItemDO> itemDOList = servicePackageItemDao.findByTeamCode(itemDO.getTeamCode(),itemDO.getCode());
       List<ServicePackageItemDO> itemDOList = servicePackageItemDao.findByTeamCode(itemDO.getTeamCode(),itemDO.getCode());
        if(itemDOList.size()>0){
        if(itemDOList!=null&&itemDOList.size()>0){
            result.put("msg","该服务团队已存在此服务项,请勿重复添加");
            result.put("msg","该服务团队已存在此服务项,请勿重复添加");
            result.put("response", ConstantUtils.FAIL);
            result.put("response", ConstantUtils.FAIL);
            return result;
            return result;
        }*/
        }
        BaseOrgDO baseOrgDO = baseOrgDao.findByCode(itemDO.getOrgCode());
        if (baseOrgDO!=null){
            itemDO.setOrgName(baseOrgDO.getName());
        }
        BaseTeamDO baseTeamDO  = baseTeamDao.findOne(itemDO.getTeamCode());
        if (baseTeamDO!=null){
            itemDO.setTeamName(baseTeamDO.getName());
        }
        if(StringUtil.isEmpty(itemDO.getId())){
        if(StringUtil.isEmpty(itemDO.getId())){
            //新增
            //新增
            itemDO.setPrice(new BigDecimal(0));
            itemDO.setPrice(new BigDecimal(0));
@ -50,6 +67,7 @@ public class ServicePackageItemService extends BaseJpaService<ServicePackageItem
            oldItemDO.setFeeType(itemDO.getFeeType());
            oldItemDO.setFeeType(itemDO.getFeeType());
            oldItemDO.setIntroduce(itemDO.getIntroduce());
            oldItemDO.setIntroduce(itemDO.getIntroduce());
            oldItemDO.setOrgCode(itemDO.getOrgCode());
            oldItemDO.setOrgCode(itemDO.getOrgCode());
            oldItemDO.setOrgName(itemDO.getOrgName());
            oldItemDO.setOrgName(itemDO.getOrgName());
            oldItemDO.setTeamCode(itemDO.getTeamCode());
            oldItemDO.setTeamCode(itemDO.getTeamCode());
            oldItemDO.setTeamName(itemDO.getTeamName());
            oldItemDO.setTeamName(itemDO.getTeamName());

+ 15 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java

@ -4,9 +4,13 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.dao.servicePackage.ServicePackageDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageSignRecordDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageSignRecordDao;
import com.yihu.jw.base.dao.team.BaseTeamDao;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.mysql.query.BaseJpaService;
@ -35,6 +39,10 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    private ServicePackageDao servicePackageDao;
    private ServicePackageDao servicePackageDao;
    @Autowired
    @Autowired
    private ServicePackageItemDao servicePackageItemDao;
    private ServicePackageItemDao servicePackageItemDao;
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private BaseTeamDao baseTeamDao;
    @Autowired
    @Autowired
    private ServicePackageSignRecordDao servicePackageSignRecordDao;
    private ServicePackageSignRecordDao servicePackageSignRecordDao;
@ -53,7 +61,7 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
        if(StringUtil.isEmpty(servicePackageDO.getId())){
        if(StringUtil.isEmpty(servicePackageDO.getId())){
            //新增
            //新增
            servicePackageDO.setCreateTime(new Date());
            servicePackageDO.setCreateTime(new Date());
            servicePackageDao.save(servicePackageDO);
            servicePackageDO=servicePackageDao.save(servicePackageDO);
        }else{
        }else{
            //修改
            //修改
            ServicePackageDO oldDO = servicePackageDao.findOne(servicePackageDO.getId());
            ServicePackageDO oldDO = servicePackageDao.findOne(servicePackageDO.getId());
@ -61,15 +69,20 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
            oldDO.setDel(servicePackageDO.getDel());
            oldDO.setDel(servicePackageDO.getDel());
            oldDO.setType(servicePackageDO.getType());
            oldDO.setType(servicePackageDO.getType());
            oldDO.setIntroduce(servicePackageDO.getIntroduce());
            oldDO.setIntroduce(servicePackageDO.getIntroduce());
            servicePackageDao.save(oldDO);
            servicePackageDO= servicePackageDao.save(oldDO);
            servicePackageItemDao.deleteByServicePackageId(oldDO.getId());
            servicePackageItemDao.deleteByServicePackageId(oldDO.getId());
        }
        }
        List<ServicePackageItemDO> itemDOs = new ArrayList<>();
        List<ServicePackageItemDO> itemDOs = new ArrayList<>();
        for (ServicePackageItemDO itemDO:itemDOList){
        for (ServicePackageItemDO itemDO:itemDOList){
            BaseOrgDO baseOrgDO = baseOrgDao.findByCode(itemDO.getOrgCode());
            if (baseOrgDO!=null){
                itemDO.setOrgName(baseOrgDO.getName());
            }
            itemDO = servicePackageItemDao.findOne(itemDO.getId());
            itemDO = servicePackageItemDao.findOne(itemDO.getId());
            ServicePackageItemDO itemDO1 = new ServicePackageItemDO();
            ServicePackageItemDO itemDO1 = new ServicePackageItemDO();
            BeanUtils.copyProperties(itemDO,itemDO1);
            BeanUtils.copyProperties(itemDO,itemDO1);
            itemDO1.setId(null);
            itemDO1.setId(null);
            itemDO1.setDictId(itemDO.getId());
            itemDO1.setServicePackageId(servicePackageDO.getId());
            itemDO1.setServicePackageId(servicePackageDO.getId());
            itemDO1.setCreateTime(DateUtil.getStringDate());
            itemDO1.setCreateTime(DateUtil.getStringDate());
            itemDOs.add(itemDO1);
            itemDOs.add(itemDO1);

+ 18 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/team/BaseTeamService.java

@ -19,6 +19,9 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.team.BaseTeamMemberDO;
import com.yihu.jw.entity.base.team.BaseTeamMemberDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.base.team.BaseTeamVO;
import com.yihu.jw.restmodel.base.wx.WxGraphicMessageVO;
import com.yihu.jw.restmodel.base.wx.WxGraphicMessageVO;
import com.yihu.jw.restmodel.base.wx.WxReplySceneVO;
import com.yihu.jw.restmodel.base.wx.WxReplySceneVO;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.StringUtil;
@ -73,6 +76,8 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
    private HibenateUtils hibenateUtils;
    private HibenateUtils hibenateUtils;
    @Value("${wechat.flag}")
    @Value("${wechat.flag}")
    private boolean flag;
    private boolean flag;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    /**
    /**
     * 新增团队
     * 新增团队
@ -466,4 +471,17 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
        result.put("response",ConstantUtils.SUCCESS);
        result.put("response",ConstantUtils.SUCCESS);
        return result;
        return result;
    }
    }
    public List<BaseTeamVO> transDel(List<BaseTeamVO> list){
        for (BaseTeamVO baseTeamVO :list){
            List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("isEffect");
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS){
                if (baseTeamVO.getDel().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    baseTeamVO.setDelName(wlyyHospitalSysDictDO.getDictValue());
                }
            }
        }
        return list;
    }
}
}