Browse Source

行政团队删除使用逻辑删除,而非物理删除;去除sf.json-lib依赖

Sand 8 years ago
parent
commit
406430a638

+ 0 - 5
patient-co-wlyy/pom.xml

@ -260,11 +260,6 @@
        </dependency>
        <!-- JSON end -->
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>xom</groupId>
            <artifactId>xom</artifactId>

+ 8 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamDao.java

@ -31,6 +31,10 @@ public interface DoctorAdminTeamDao extends
    Integer getDoctorSignCount(@Param(value = "doctorCode") String doctorCode,
                               @Param(value = "teamId") long teamId);
    @Modifying
    @Query("UPDATE AdminTeam t SET t.available = false where t.id = :teamId")
    void delete(@Param("teamId") long teamId);
    /**
     * 团队内,健康管理师的签约数。
     *
@ -62,16 +66,17 @@ public interface DoctorAdminTeamDao extends
     * @return
     */
    @Query("SELECT t.id, t.name, t.leaderCode, f.doctor, f.doctorName, f.doctorHealth, f.doctorHealthName " +
            "FROM SignFamily f, AdminTeam t WHERE f.patient = :patientCode AND f.status in (-3, 1) AND t.id=f.adminTeamId ORDER BY f.czrq DESC")
            "FROM SignFamily f, AdminTeam t WHERE f.patient = :patientCode AND f.status in (-3, 1) AND " +
            "t.id=f.adminTeamId AND t.available = true ORDER BY f.czrq DESC")
    List<Object> findAdminTeamByPatientSignTeam(@Param("patientCode") String patientCode, Pageable pageable);
    @Query("SELECT t.id from AdminTeam t WHERE t.leaderCode = :leaderCode")
    @Query("SELECT t.id from AdminTeam t WHERE t.leaderCode = :leaderCode AND t.available = true")
    Long findIdByLeaderCode(@Param("leaderCode") String leaderCode);
    @Query(" from AdminTeam t")
    List<AdminTeam> findAllTeam();
    @Query("SELECT t from AdminTeam t WHERE t.leaderCode = :leaderCode")
    @Query("SELECT t from AdminTeam t WHERE t.leaderCode = :leaderCode AND t.available = true")
    AdminTeam findByLeaderCode(@Param("leaderCode") String leaderCode);
    List<AdminTeam> findByOrgCode(String orgCode);

+ 5 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamMemberDao.java

@ -23,10 +23,11 @@ public interface DoctorAdminTeamMemberDao extends
    AdminTeamMember findByTeamIdAndDoctorCodeOrderByDoctorCodeAsc(long teamId, String doctorCode);
    @Query("SELECT t FROM AdminTeamMember m, AdminTeam t WHERE m.doctorCode = :doctorCode AND t.id = m.teamId")
    @Query("SELECT t FROM AdminTeamMember m, AdminTeam t WHERE m.doctorCode = :doctorCode AND t.id = m.teamId AND t.available = true")
    List<AdminTeam> findDoctorTeams(@Param(value = "doctorCode") String doctorCode);
    @Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = :teamId AND t.id = m.teamId AND m.doctorCode = d.code ORDER BY d.level")
    @Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = :teamId AND t.id = m.teamId " +
            "AND m.doctorCode = d.code AND t.available = true ORDER BY d.level")
    List<Doctor> findAllMembers(@Param(value = "teamId") long teamId);
    @Query("SELECT case when count(A) > 0 then true else false END FROM AdminTeamMember A WHERE A.teamId = :teamId " +
@ -41,6 +42,7 @@ public interface DoctorAdminTeamMemberDao extends
                                         @Param(value = "teamId") long teamId,
                                         Pageable pageable);
    @Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = ?1 AND t.id = m.teamId AND m.doctorCode = d.code and  d.code != ?2 and d.level != 1 ")
    @Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = ?1 AND t.id = m.teamId AND " +
            "m.doctorCode = d.code and  d.code != ?2 AND t.available = true and d.level != 1 ")
    List<Doctor> findAllHeathExcludeThis(long teamId, String doctorCode);
}

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/team/AdminTeamService.java

@ -72,6 +72,10 @@ public class AdminTeamService extends BaseService {
        return team;
    }
    public void deleteTeam(long teamId){
        teamDao.delete(teamId);
    }
    /**
     * 获取团队信息。
     *

File diff suppressed because it is too large
+ 0 - 111
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/XMLUtil.java


+ 0 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/WlyySerivceController.java

@ -1,22 +1,15 @@
package com.yihu.wlyy.web.common.util;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.SOAPUtil;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.parser.JSONParser;
import net.sf.json.JSON;
import net.sf.json.util.JSONUtils;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

+ 16 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java

@ -69,6 +69,19 @@ public class AdminTeamController extends BaseController {
        }
    }
    @RequestMapping(value = "/deletion", method = RequestMethod.POST)
    @ApiOperation(value = "删除团队信息")
    public String deleteTeam(@RequestParam("teamId") long teamId){
        try {
            teamService.deleteTeam(teamId);
            return write(200, "OK");
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/{team_id}/name", method = RequestMethod.POST)
    @ApiOperation(value = "更新团队名称")
    public String updateTeamName(@PathVariable("team_id") long teamId,
@ -140,9 +153,10 @@ public class AdminTeamController extends BaseController {
            return error(-1, e.getMessage());
        }
    }
    //目前没用到,之后可能会用到
//    @RequestMapping(value = "/{team_id}/members/excludedThisAndLevel3", method = RequestMethod.GET)
//    @ApiOperation(value = "获取团队成员,排除自己和专科医生")
//  @RequestMapping(value = "/{team_id}/members/excludedThisAndLevel3", method = RequestMethod.GET)
//  @ApiOperation(value = "获取团队成员,排除自己和专科医生")
    public String getTeamMembersExcludedThisAndLevel3(@PathVariable("team_id") long teamId) {
        try {
            List<Doctor> members = memberService.getMembers(teamId,super.getUID());