Explorar el Código

添加搜索字典

humingfen hace 6 años
padre
commit
93ba27a9ab

+ 36 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java

@ -13,9 +13,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -80,6 +77,42 @@ public class CustomerSynergyManageController extends BaseController {
    }
    @RequestMapping(value = "/labels", method = RequestMethod.GET)
    @ApiOperation("根据分组类型查找标签")
    public String labels(
            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true)
            @RequestParam(value = "labelType", required = true) String labelType) {
        try {
            return write(200,"保存成功", "data", synergyManageService.getLabels(labelType));
        } catch (Exception e) {
            error(e);
            return error(-1,"保存失败");
        }
    }
    @RequestMapping(value = "/unitLabels", method = RequestMethod.GET)
    @ApiOperation("获取所属社区")
    public String unitLabels(@ApiParam(name = "currentRoleCode", value = "选择的区县", required = false)
                             @RequestParam(value = "currentRoleCode", required = false) String currentRoleCode) {
        try {
            return write(200,"获取成功", "data", synergyManageService.getUnitLabels(currentRoleCode));
        } catch (Exception e) {
            error(e);
            return error(-1,"获取失败");
        }
    }
    @RequestMapping(value = "/towns", method = RequestMethod.GET)
    @ApiOperation("获取所属区县")
    public String towns() {
        try {
            return write(200,"获取成功", "data", synergyManageService.getTowns());
        } catch (Exception e) {
            error(e);
            return error(-1,"获取失败");
        }
    }
    @RequestMapping(value = "workorderList", method = RequestMethod.GET)
    @ApiOperation("客服系统-协同服务列表")
    public String workorderList(@ApiParam(name = "userCode", value = "客服code", required = false)

+ 6 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/TownDao.java

@ -10,6 +10,9 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.Town;
import java.util.List;
import java.util.Map;
public interface TownDao extends PagingAndSortingRepository<Town, Long> {
	// 根據CODE查詢區縣名稱
	@Query("select p from Town p where p.code = ?1")
@ -23,4 +26,7 @@ public interface TownDao extends PagingAndSortingRepository<Town, Long> {
	@Query("select p from Town p where p.name = ?1 and p.city = ?2")
	Town findByNameAndCity(String name,String city);
	@Query("SELECT t.code,t.name from dm_town t ")
	List<Map<String,String>> getTowns();
}

+ 20 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -57,6 +57,8 @@ public class SynergyManageService extends BaseJpaService {
    private ManageSynergyWorkorderReminderDao manageSynergyWorkorderReminderDao;
    @Autowired
    private ManageSynergyWorkorderServicerLogDao manageSynergyWorkorderServicerLogDao;
    @Autowired
    private TownDao townDao;
    /**
     * 根据服务编码获取工单
@ -744,4 +746,22 @@ public class SynergyManageService extends BaseJpaService {
        }
        return resultList;
    }
    public JSONObject getLabels(String labelType) {
        String url = wlyyUrl + "/wlyygc/doctor/label/labels?labelType=" + labelType;
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = new JSONObject(response);
        return  jsonObject;
    }
    public JSONObject getUnitLabels(String currentRoleCode) {
        String url = wlyyUrl + "/wlyygc/doctor/label/unitLabels?currentRoleCode=" + currentRoleCode + "&currentRoleLevel=3";
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = new JSONObject(response);
        return  jsonObject;
    }
    public List<Town> getTowns() {
        return (List<Town>) townDao.findAll();
    }
}