LAPTOP-KB9HII50\70708 пре 2 година
родитељ
комит
61794e775b

+ 1 - 2
business/base-service/src/main/java/com/yihu/jw/team/BaseDoctorTeamMemberDao.java

@ -4,7 +4,6 @@ import com.yihu.jw.entity.base.team.BaseTeamMemberDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.List;
import java.util.Map;
import java.util.Map;
@ -22,7 +21,7 @@ import java.util.Set;
 * </pre>
 * </pre>
 * @since 1.
 * @since 1.
 */
 */
public interface BaseDoctorTeamMemberDao extends JpaRepository<BaseTeamMemberDO, String>, JpaSpecificationExecutor<BaseTeamMemberDO>  {
public interface BaseDoctorTeamMemberDao extends JpaRepository<BaseTeamMemberDO, Long>, JpaSpecificationExecutor<BaseTeamMemberDO>  {
    @Query("select doc.name as name,doc.idcard as idcard ,doc.id as doctorCode from BaseDoctorDO doc where doc.id in (select team.doctorCode from BaseTeamMemberDO team where team.teamCode = ?1)")
    @Query("select doc.name as name,doc.idcard as idcard ,doc.id as doctorCode from BaseDoctorDO doc where doc.id in (select team.doctorCode from BaseTeamMemberDO team where team.teamCode = ?1)")
    List<Map<String,Object>> getTeamMemberList(String teamCode);
    List<Map<String,Object>> getTeamMemberList(String teamCode);

+ 28 - 8
business/base-service/src/main/java/com/yihu/jw/team/service/TeamService.java

@ -100,7 +100,7 @@ public class TeamService {
    //删除团队成员
    //删除团队成员
    public void delTeamMember(String id){
    public void delTeamMember(Long id){
        teamMemberDao.deleteById(id);
        teamMemberDao.deleteById(id);
    }
    }
@ -110,15 +110,31 @@ public class TeamService {
    }
    }
    //保存团队
    //保存团队
    @Transactional
    public BaseTeamDO saveTeam(String jsonData){
    public BaseTeamDO saveTeam(String jsonData){
        BaseTeamDO teamDO = JSONObject.parseObject(jsonData,BaseTeamDO.class);
        BaseTeamDO teamDO = JSONObject.parseObject(jsonData,BaseTeamDO.class);
        if(teamDO.getCreateTime()==null){
        if(teamDO.getCreateTime()==null){
            teamDO.setCreateTime(new Date());
            teamDO.setCreateTime(new Date());
        }
        }
        if(StringUtils.isBlank(teamDO.getId())){
        if(StringUtils.isBlank(teamDO.getId())){
            teamDO.setDel("1");
            teamDO.setDel("1");
        }
        }
        return teamDao.save(teamDO);
        teamDO = teamDao.save(teamDO);
        //判断推荐医生是否在团队中
        BaseTeamMemberDO memberDO = teamMemberDao.findUseDoctorCodeAndTeamCode(teamDO.getRecommendDoctor(),teamDO.getId());
        if(memberDO==null){
            memberDO = new BaseTeamMemberDO();
            memberDO.setDoctorCode(teamDO.getRecommendDoctor());
            memberDO.setCreateTime(new Date());
            memberDO.setUpdateTime(new Date());
            memberDO.setDel("1");
            memberDO.setTeamCode(teamDO.getId());
            memberDO.setOrgCode(teamDO.getOrgCode());
            teamMemberDao.save(memberDO);
        }
        return teamDO;
    }
    }
    //按id获取专科团队信息
    //按id获取专科团队信息
@ -212,7 +228,7 @@ public class TeamService {
    //获取团队成员列表
    //获取团队成员列表
    public Envelop getTeamMemberList(String teamId, String doctorName, Integer page, Integer pageSize, String mobile) {
    public Envelop getTeamMemberList(String teamId, String doctorName, Integer page, Integer pageSize, String mobile) {
        String countSql = " select count(t.id) ";
        String countSql = " select count(t.id) ";
        String sql = "SELECT d.id,d.`name`,d.idcard,d.job_title_name jobTitleName,d.mobile," +
        String sql = "SELECT t.id,d.id doctor,d.`name`,d.idcard,d.job_title_name jobTitleName,d.mobile," +
                " DATE_FORMAT(t.create_time,'%Y-%m-%d %H:%i:%S') createTime ";
                " DATE_FORMAT(t.create_time,'%Y-%m-%d %H:%i:%S') createTime ";
        String filter = " from base_team_member t,base_doctor d WHERE t.del ='1' and t.doctor_code = d.id";
        String filter = " from base_team_member t,base_doctor d WHERE t.del ='1' and t.doctor_code = d.id";
        if(StringUtils.isNotEmpty(teamId)){
        if(StringUtils.isNotEmpty(teamId)){
@ -297,11 +313,15 @@ public class TeamService {
                String doc[] = adminTeamIds.split(",");
                String doc[] = adminTeamIds.split(",");
                List<BaseTeamRelationDO> list = new ArrayList<>();
                List<BaseTeamRelationDO> list = new ArrayList<>();
                for (String d:doc){
                for (String d:doc){
                    BaseTeamRelationDO relationDO = new BaseTeamRelationDO();
                    relationDO.setAdminTeamId(Integer.parseInt(d));
                    relationDO.setTeamId(teamId);
                    relationDO.setCreateTime(new Date());
                    list.add(relationDO);
                    Integer adminTeamId = Integer.parseInt(d);
                    List<BaseTeamRelationDO> temp = teamRelationDao.findAdminTeamById(teamId,adminTeamId);
                    if(temp.size()==0){
                        BaseTeamRelationDO relationDO = new BaseTeamRelationDO();
                        relationDO.setAdminTeamId(adminTeamId);
                        relationDO.setTeamId(teamId);
                        relationDO.setCreateTime(new Date());
                        list.add(relationDO);
                    }
                }
                }
                teamRelationDao.saveAll(list);
                teamRelationDao.saveAll(list);
            }
            }

+ 7 - 5
business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java

@ -763,9 +763,10 @@ public class WlyyBusinessService {
    }
    }
    //获取团队列表
    //获取团队列表
    public JSONObject getAdminTeamList(String teamName, String leadName, Integer page, Integer pageSize, String hospital,String doctorName,String mobile) {
        String param = "?teamName="+nullToTransfor(teamName)+"&leadName="+nullToTransfor(leadName)+"&page="+page+"&pageSize="+pageSize
                +"&hospital="+nullToTransfor(hospital)+"&doctorName="+nullToTransfor(doctorName)+"&mobile="+nullToTransfor(mobile);
    public JSONObject getAdminTeamList(String teamName,String town,String teamId, String leadName, Integer page, Integer pageSize, String hospital,String doctorName,String mobile) {
        String param = "?teamName="+nullToTransfor(teamName)+"&leadName="+nullToTransfor(leadName)+"&teamId="+nullToTransfor(teamId)
                +"&page="+page+"&pageSize="+pageSize+"&hospital="+nullToTransfor(hospital)+"&doctorName="+nullToTransfor(doctorName)
                +"&mobile="+nullToTransfor(mobile)+"&town="+nullToTransfor(town);
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getAdminTeamList",param);
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getAdminTeamList",param);
        return re;
        return re;
    }
    }
@ -786,11 +787,12 @@ public class WlyyBusinessService {
    //获取签约列表分页(只查询有效的)
    //获取签约列表分页(只查询有效的)
    public JSONObject getSignList(String name, Integer page, Integer pageSize, String town,String hospital,String adminTeamCode
    public JSONObject getSignList(String name, Integer page, Integer pageSize, String town,String hospital,String adminTeamCode
            ,String doctor,String doctorName,String doctorHealthName,String hospitalName,String idcard,String address,String teamName,String leaderName) {
            ,String doctor,String doctorName,String doctorHealthName,String hospitalName,String idcard,String address
            ,String teamName,String leaderName,String teamId) {
        String param = "?name="+nullToTransfor(name)+"&town="+nullToTransfor(town)+"&page="+page+"&pageSize="+pageSize+"&hospital="+nullToTransfor(hospital)+
        String param = "?name="+nullToTransfor(name)+"&town="+nullToTransfor(town)+"&page="+page+"&pageSize="+pageSize+"&hospital="+nullToTransfor(hospital)+
                "&adminTeamCode="+nullToTransfor(adminTeamCode)+"&doctor="+nullToTransfor(doctor)+"&doctorName="+nullToTransfor(doctorName)+
                "&adminTeamCode="+nullToTransfor(adminTeamCode)+"&doctor="+nullToTransfor(doctor)+"&doctorName="+nullToTransfor(doctorName)+
                "&doctorHealthName="+nullToTransfor(doctorHealthName)+"&hospitalName="+nullToTransfor(hospitalName)+"&idcard="+nullToTransfor(idcard)+
                "&doctorHealthName="+nullToTransfor(doctorHealthName)+"&hospitalName="+nullToTransfor(hospitalName)+"&idcard="+nullToTransfor(idcard)+
                "&address="+nullToTransfor(address)+"&teamName="+nullToTransfor(teamName)+"&leaderName="+nullToTransfor(leaderName);
                "&address="+nullToTransfor(address)+"&teamName="+nullToTransfor(teamName)+"&leaderName="+nullToTransfor(leaderName)+"&teamId="+nullToTransfor(teamId);
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getSignList",param);
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getSignList",param);
        return re;
        return re;
    }
    }

+ 92 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/LongIdentityEntityWithOperator.java

@ -0,0 +1,92 @@
package com.yihu.jw.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.util.Date;
/**
 * Created by yeshijie on 2023/04/27.
 */
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class LongIdentityEntityWithOperator extends LongIdentityEntity {
    protected Date createTime;
    protected String createUser;
    protected String createUserName;
    protected Date updateTime;
    protected String updateUser;
    protected String updateUserName;
    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time", nullable = false, length = 0,updatable = false)
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @CreatedBy
    @Column(name = "create_user",updatable = false)
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    @CreatedBy
    @Column(name = "create_user_name",updatable = false)
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    @LastModifiedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "update_time", nullable = false, length = 0)
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    @LastModifiedBy
    @Column(name = "update_user")
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    @LastModifiedBy
    @Column(name = "update_user_name")
    public String getUpdateUserName() {
        return updateUserName;
    }
    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }
}

+ 2 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamMemberDO.java

@ -1,6 +1,7 @@
package com.yihu.jw.entity.base.team;
package com.yihu.jw.entity.base.team;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import com.yihu.jw.entity.LongIdentityEntityWithOperator;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
@ -18,7 +19,7 @@ import java.util.Date;
@Entity
@Entity
@Table(name = "base_team_member")
@Table(name = "base_team_member")
@SequenceGenerator(name="id_generated", sequenceName="BASE_TEAM_MEMBER_SEQ")
@SequenceGenerator(name="id_generated", sequenceName="BASE_TEAM_MEMBER_SEQ")
public class BaseTeamMemberDO extends IntegerIdentityEntityWithOperator {
public class BaseTeamMemberDO extends LongIdentityEntityWithOperator {
    /**
    /**
	* 团队ID
	* 团队ID

+ 3 - 0
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -85,6 +85,9 @@ public class DateUtil {
    public static Date localTimeToDate(LocalDateTime localDateTime){
    public static Date localTimeToDate(LocalDateTime localDateTime){
        return Date.from(localDateTime.atZone(zone).toInstant());
        return Date.from(localDateTime.atZone(zone).toInstant());
    }
    }
    public static String localTimeToLong(LocalDateTime localDateTime){
        return dateTimeFormatter.format(localDateTime);
    }
    /**
    /**
     * 时间格式转中文格式
     * 时间格式转中文格式

+ 19 - 3
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/im/ImJobService.java

@ -3,11 +3,13 @@ package com.yihu.jw.service.im;
import com.yihu.jw.entity.knowledge.BaseSystemDialogSetting;
import com.yihu.jw.entity.knowledge.BaseSystemDialogSetting;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.knowledge.dao.BaseSystemDialogSettingDao;
import com.yihu.jw.knowledge.dao.BaseSystemDialogSettingDao;
import com.yihu.jw.util.date.DateUtil;
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.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
import java.util.List;
import java.util.Map;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Collectors;
@ -54,10 +56,24 @@ public class ImJobService {
    }
    }
    /**
     * 时间处理
     * @param time
     * @param timeUnit {"1":"秒","2":"分钟","3":"小时"}
     * @return
     */
    public String timeTransfor(String time,String timeUnit){
    public String timeTransfor(String time,String timeUnit){
        String result = "";
        return result;
        Long timgLong = Long.parseLong(time);
        if("1".equals(timeUnit)){
            return DateUtil.localTimeToLong(LocalDateTime.now().minusSeconds(timgLong));
        }
        if("2".equals(timeUnit)){
            return DateUtil.localTimeToLong(LocalDateTime.now().minusMinutes(timgLong));
        }
        if("3".equals(timeUnit)){
            return DateUtil.localTimeToLong(LocalDateTime.now().minusHours(timgLong));
        }
        return null;
    }
    }
}
}

+ 4 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/team/DoctorTeamEndpoint.java

@ -1,8 +1,6 @@
package com.yihu.jw.hospital.endpoint.team;
package com.yihu.jw.hospital.endpoint.team;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.team.service.TeamService;
import com.yihu.jw.team.service.TeamService;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
@ -55,6 +53,7 @@ public class DoctorTeamEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getAdminTeamList")
    @GetMapping(value = "getAdminTeamList")
    @ApiOperation(value = "获取社区团队列表")
    @ApiOperation(value = "获取社区团队列表")
    public String getAdminTeamList(@RequestParam(required = false) String teamName,
    public String getAdminTeamList(@RequestParam(required = false) String teamName,
                                    @RequestParam(required = false) String teamId,
                                    @RequestParam(required = false) String leadName,
                                    @RequestParam(required = false) String leadName,
                                   @RequestParam(required = false) String doctorName,
                                   @RequestParam(required = false) String doctorName,
                                   @RequestParam(required = false) String mobile,
                                   @RequestParam(required = false) String mobile,
@ -62,7 +61,7 @@ public class DoctorTeamEndpoint extends EnvelopRestEndpoint {
                                    @RequestParam(required = false) Integer pageSize,
                                    @RequestParam(required = false) Integer pageSize,
                                    @RequestParam(required = false) String hospital) {
                                    @RequestParam(required = false) String hospital) {
        try {
        try {
            return wlyyBusinessService.getAdminTeamList(teamName,leadName,page,pageSize,hospital,doctorName,mobile).toJSONString();
            return wlyyBusinessService.getAdminTeamList(teamName,TONGAN_TOWN,teamId,leadName,page,pageSize,hospital,doctorName,mobile).toJSONString();
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            return error(-1,"查询失败");
            return error(-1,"查询失败");
@ -102,7 +101,7 @@ public class DoctorTeamEndpoint extends EnvelopRestEndpoint {
    public String getSignList(@RequestParam(required = false) String name,
    public String getSignList(@RequestParam(required = false) String name,
                               @RequestParam(required = false) Integer page,
                               @RequestParam(required = false) Integer page,
                               @RequestParam(required = false) Integer pageSize,
                               @RequestParam(required = false) Integer pageSize,
//                               @RequestParam(required = false) String town,
                               @RequestParam(required = false) String teamId,
                               @RequestParam(required = false) String hospital,
                               @RequestParam(required = false) String hospital,
                               @RequestParam(required = false) String adminTeamCode,
                               @RequestParam(required = false) String adminTeamCode,
                               @RequestParam(required = false) String doctor,
                               @RequestParam(required = false) String doctor,
@ -115,7 +114,7 @@ public class DoctorTeamEndpoint extends EnvelopRestEndpoint {
                               @RequestParam(required = false) String leaderName) {
                               @RequestParam(required = false) String leaderName) {
        try {
        try {
            return wlyyBusinessService.getSignList(name,page,pageSize,TONGAN_TOWN,hospital,adminTeamCode,doctor,doctorName,
            return wlyyBusinessService.getSignList(name,page,pageSize,TONGAN_TOWN,hospital,adminTeamCode,doctor,doctorName,
                    doctorHealthName,hospitalName, idcard, address,teamName,leaderName).toJSONString();
                    doctorHealthName,hospitalName, idcard, address,teamName,leaderName,teamId).toJSONString();
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            return error(-1,"查询失败");
            return error(-1,"查询失败");

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/team/SpecialistTeamEndpoint.java

@ -166,7 +166,7 @@ public class SpecialistTeamEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = "delTeamMember")
    @PostMapping(value = "delTeamMember")
    @ApiOperation(value = "删除团队成员")
    @ApiOperation(value = "删除团队成员")
    public Envelop delTeamMember(@RequestParam(required = true) String id) {
    public Envelop delTeamMember(@RequestParam(required = true) Long id) {
        try {
        try {
            teamService.delTeamMember(id);
            teamService.delTeamMember(id);
            return Envelop.getSuccess("保存成功");
            return Envelop.getSuccess("保存成功");