Преглед изворни кода

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

trick9191 пре 8 година
родитељ
комит
fae24b5ebd

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDiagnosisService.java

@ -50,8 +50,8 @@ public class PrescriptionDiagnosisService extends BaseService{
                    if(list!=null&&list.size()>0){
                        for (PrescriptionDiagnosis diagnosis:list){
                            JSONObject json = new JSONObject();
                            json.put("code",diagnosis.getCode());//疾病代码
                            json.put("name",diagnosis.getName());//疾病名称
                            json.put("code",diagnosis.getHealthProblem());//疾病代码
                            json.put("name",diagnosis.getHealthProblemName());//疾病名称
                            jsonArray.add(json);
                        }
                        re = jsonArray.toString();

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -102,7 +102,7 @@ public class PrescriptionService extends BaseService {
            }else if(prescription.getDispensaryType()==3){
                //健管师配送
                PrescriptionExpressage expressage = prescriptionExpressageDao.findByPrescriptionCode(code);
                if(StringUtils.isEmpty(expressage.getExpressageCode())){
                if(StringUtils.isNotBlank(expressage.getExpressageCode())){
                    String content = "您有一条新的续方订单待取药!";
                    Message message = new Message();
                    message.setCzrq(new Date());

+ 123 - 108
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -28,7 +28,7 @@ import java.util.List;
@RestController
@RequestMapping(value = "/doctor/prescriptionInfo")
@Api(description = "医生端-长处方接口")
public class PrescriptionInfoController extends BaseController{
public class PrescriptionInfoController extends BaseController {
    @Autowired
    private PrescriptionInfoService prescriptionInfoService;
@ -48,9 +48,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getPrescriptionFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取过滤规则信息列表")
    public String getPrescriptionFilter(){
    public String getPrescriptionFilter() {
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getPrescriptionFilter());
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionFilter());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -59,17 +59,17 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getDoctorPrescription", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生/建管师续方列表/搜索")
    public String getDoctorPrescription(@RequestParam(required = false)@ApiParam(value = "团队code", name = "teamCode") Integer teamCode,
                                        @RequestParam(required = false)@ApiParam(value = "续方状态", name = "state") String state,
                                        @RequestParam(required = false)@ApiParam(value = "所有诊断:1 糖尿病 2高血压", name = "dispensary") String diseases,
                                        @RequestParam(required = false)@ApiParam(name="startDate",value="开始时间")String startDate,
                                        @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate,
                                        @RequestParam(required = false)@ApiParam(name="nameKeyword",value="患者姓名模糊匹配")String nameKeyword,
                                        @RequestParam(required = false)@ApiParam(name="patient",value="患者Code")String patient,
                                        @RequestParam(required = false)@ApiParam(name="page",value="起始页")Integer page,
                                        @RequestParam(required = false)@ApiParam(name="size",value="每页条数")Integer size){
    public String getDoctorPrescription(@RequestParam(required = false) @ApiParam(value = "团队code", name = "teamCode") Integer teamCode,
                                        @RequestParam(required = false) @ApiParam(value = "续方状态", name = "state") String state,
                                        @RequestParam(required = false) @ApiParam(value = "所有诊断:1 糖尿病 2高血压", name = "dispensary") String diseases,
                                        @RequestParam(required = false) @ApiParam(name = "startDate", value = "开始时间") String startDate,
                                        @RequestParam(required = false) @ApiParam(name = "endDate", value = "结束时间") String endDate,
                                        @RequestParam(required = false) @ApiParam(name = "nameKeyword", value = "患者姓名模糊匹配") String nameKeyword,
                                        @RequestParam(required = false) @ApiParam(name = "patient", value = "患者Code") String patient,
                                        @RequestParam(required = false) @ApiParam(name = "page", value = "起始页") Integer page,
                                        @RequestParam(required = false) @ApiParam(name = "size", value = "每页条数") Integer size) {
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getDoctorPrescription(teamCode,state,diseases,startDate,endDate,nameKeyword,patient,page,size));
            return write(200, "查询成功!", "data", prescriptionInfoService.getDoctorPrescription(teamCode, state, diseases, startDate, endDate, nameKeyword, patient, page, size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -78,10 +78,10 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getContinuedPrescriptionAsDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "续方详情")
    public String getContinuedPrescriptionAsDoctor(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
                                                   @RequestParam(required = true)@ApiParam(value = "团队长标识:1:是;2否", name = "type") String type){
    public String getContinuedPrescriptionAsDoctor(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                                   @RequestParam(required = true) @ApiParam(value = "团队长标识:1:是;2否", name = "type") String type) {
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getContinuedPrescriptionAsDoctor(code));
            return write(200, "查询成功!", "data", prescriptionInfoService.getContinuedPrescriptionAsDoctor(code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -90,18 +90,18 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/reviewPrescription", method = RequestMethod.POST)
    @ApiOperation(value = "续方审核")
    public String reviewPrescription(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
                                     @RequestParam(required = false)@ApiParam(value = "不同意原因", name = "reason") String reason,
                                     @RequestParam(required = false)@ApiParam(value = "1同意,2不同意", name = "state") String state,
                                     @RequestParam(required = false)@ApiParam(value = "科室", name = "dept")String dept,
                                     @RequestParam(required = false)@ApiParam(value = "诊金", name = "registerFee")String registerFee,
                                     @RequestParam(required = false)@ApiParam(value = "诊金类型", name = "rateTypeCode")String rateTypeCode){
    public String reviewPrescription(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                     @RequestParam(required = false) @ApiParam(value = "不同意原因", name = "reason") String reason,
                                     @RequestParam(required = false) @ApiParam(value = "1同意,2不同意", name = "state") String state,
                                     @RequestParam(required = false) @ApiParam(value = "科室", name = "dept") String dept,
                                     @RequestParam(required = false) @ApiParam(value = "诊金", name = "registerFee") String registerFee,
                                     @RequestParam(required = false) @ApiParam(value = "诊金类型", name = "rateTypeCode") String rateTypeCode) {
        try {
            int rs = prescriptionInfoService.reviewPrescription(code,reason,state,dept,registerFee,rateTypeCode);
            if(rs==0){
                return write(200, "开方失败!", "data",rs);
            }else{
                return write(200, "成功提交开方", "data",rs);
            int rs = prescriptionInfoService.reviewPrescription(code, reason, state, dept, registerFee, rateTypeCode);
            if (rs == 0) {
                return write(200, "开方失败!", "data", rs);
            } else {
                return write(200, "成功提交开方", "data", rs);
            }
        } catch (Exception e) {
            error(e);
@ -112,12 +112,12 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/updatePresInfo", method = RequestMethod.POST)
    @ApiOperation(value = "调整处方")
    @ObserverRequired
    public String updatePresInfo(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
                                 @RequestParam(required = true)@ApiParam(value = "续方药品JSON", name = "infos") String infos,
                                 @RequestParam(required = false)@ApiParam(value = "疾病JSON", name = "diagnosis") String diagnosis,
                                 @RequestParam(required = false)@ApiParam(value = "调整原因", name = "reason") String reason ){
    public String updatePresInfo(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                 @RequestParam(required = true) @ApiParam(value = "续方药品JSON", name = "infos") String infos,
                                 @RequestParam(required = false) @ApiParam(value = "疾病JSON", name = "diagnosis") String diagnosis,
                                 @RequestParam(required = false) @ApiParam(value = "调整原因", name = "reason") String reason) {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.updatePresInfo(code,infos,diagnosis,reason));
            return write(200, "操作成功!", "data", prescriptionInfoService.updatePresInfo(code, infos, diagnosis, reason));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -127,10 +127,10 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/findDictByName", method = RequestMethod.GET)
    @ApiOperation(value = "药品列表")
    public String findDictByName(@ApiParam(name = "name", value = "药品名称(中文或拼音首字母查询)", defaultValue = "胰岛素")
                                 @RequestParam(value = "name", required = false) String name){
                                 @RequestParam(value = "name", required = false) String name) {
        try {
//            return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName("e3b3bfb3644011e69616fa163e424525",name));
            return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName(getUID(),name));
            return write(200, "操作成功!", "data", zyDictService.findDictByDoctorAndName(getUID(), name));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -139,9 +139,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getInfoTitle", method = RequestMethod.POST)
    @ApiOperation(value = "调整处方-药品分类及种类数目")
    public String getInfoTitle(){
    public String getInfoTitle() {
        try {
            return write(200, "操作成功!", "data","");
            return write(200, "操作成功!", "data", "");
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -150,9 +150,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getInfoListByParentCode", method = RequestMethod.POST)
    @ApiOperation(value = "药品类别获取药品")
    private String getInfoListByParentCode(@RequestParam(required = true)@ApiParam(value = "药品类别Code", name = "code") String code){
    private String getInfoListByParentCode(@RequestParam(required = true) @ApiParam(value = "药品类别Code", name = "code") String code) {
        try {
            return write(200, "操作成功!", "data","");
            return write(200, "操作成功!", "data", "");
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -171,7 +171,7 @@ public class PrescriptionInfoController extends BaseController{
    public String prescriptionFollow(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            JSONObject jo = new JSONObject();
            net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
            //获取处方信息
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            //获取处方药品信息
@ -181,14 +181,15 @@ public class PrescriptionInfoController extends BaseController{
            //获取配送信息
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", new JSONObject(prescriptionPay));
            jo.put("prescriptionExpressage", new JSONObject(prescriptionExpressage));
            jo.put("prescriptionHospital", prescription.getHospitalName());//出药机构
            jo.put("dispensaryDispensaryType", prescription.getDispensaryType());//处方配送方式
            jo.put("dispensaryDispensaryTypeName", prescription.getDispensaryTypeName());//处方配送方式
            jo.put("prescriptionStatus", prescription.getStatus());//处方状态
            jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(),""));//处方状态名称
            jo.put("prescriptionPay", prescriptionPay);
            jo.put("prescriptionExpressage", prescriptionExpressage);
            if (prescription != null) {
                jo.put("prescriptionHospital", prescription.getHospitalName());//出药机构
                jo.put("dispensaryDispensaryType", prescription.getDispensaryType());//处方配送方式
                jo.put("dispensaryDispensaryTypeName", prescription.getDispensaryTypeName());//处方配送方式
                jo.put("prescriptionStatus", prescription.getStatus());//处方状态
                jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(), ""));//处方状态名称
            }
            return write(200, "查询成功", "data", jo);
        } catch (Exception e) {
            error(e);
@ -198,9 +199,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getDrugTimes", method = RequestMethod.GET)
    @ApiOperation(value = "药品品使用频次字典")
    public String getDrugTimes(){
    public String getDrugTimes() {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getDrugTimes());
            return write(200, "操作成功!", "data", prescriptionInfoService.getDrugTimes());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -209,17 +210,18 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getHDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取健康管理师续方订单列表")
    public String getHDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode")String teamCode,
                                                  @RequestParam(required = false) @ApiParam(value = "1:需跟踪;2:已接收", name = "type")  String type,
                                                  @RequestParam(required = false) @ApiParam(value = "患者姓名关键字", name = "nameKey")String nameKey,
                                                  @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate")String startDate,
                                                  @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate")String endDate,
                                                  @RequestParam(required = false) @ApiParam(value = "服务站", name = "hospital")String hospital,
                                                  @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state")String state,
                                                  @RequestParam(required = false) @ApiParam(value = "页数", name = "page")Integer page,
                                                  @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size")Integer size){
    public String getHDoctorPrescriptionExpressage
            (@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode") String teamCode,
             @RequestParam(required = false) @ApiParam(value = "1:需跟踪;2:已接收", name = "type") String type,
             @RequestParam(required = false) @ApiParam(value = "患者姓名关键字", name = "nameKey") String nameKey,
             @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate") String startDate,
             @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate") String endDate,
             @RequestParam(required = false) @ApiParam(value = "服务站", name = "hospital") String hospital,
             @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state") String state,
             @RequestParam(required = false) @ApiParam(value = "页数", name = "page") Integer page,
             @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size") Integer size) {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getHDoctorPrescriptionExpressage(teamCode,type,getRepUID(),nameKey,startDate,endDate,hospital,state,page,size));
            return write(200, "操作成功!", "data", prescriptionInfoService.getHDoctorPrescriptionExpressage(teamCode, type, getRepUID(), nameKey, startDate, endDate, hospital, state, page, size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -228,19 +230,20 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getPrescriptionExpressageFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取健康管理师续方订单列表过滤条件")
    public String getPrescriptionExpressageFilter(){
    public String getPrescriptionExpressageFilter() {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionExpressageFilter(getUID()));
            return write(200, "操作成功!", "data", prescriptionInfoService.getPrescriptionExpressageFilter(getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescriptionExpressageAsdoctorFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生续方订单列表过滤条件")
    public String getPrescriptionExpressageAsdoctorFilter(){
    public String getPrescriptionExpressageAsdoctorFilter() {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionExpressageAsdoctorFilter());
            return write(200, "操作成功!", "data", prescriptionInfoService.getPrescriptionExpressageAsdoctorFilter());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -249,20 +252,23 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生续方订单列表")
    public String getDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode")Integer teamCode,
                                                  @RequestParam(required = false) @ApiParam(value = "居民搜素关键字", name = "nameKey")String nameKey,
                                                  @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate")String startDate,
                                                  @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate")String endDate,
                                                  @RequestParam(required = false) @ApiParam(value = "机构", name = "hospital")String hospital,
                                                  @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state")String state,
                                                  @RequestParam(required = false) @ApiParam(value = "配送方式:1 自取 2快递配送 3健管师配送", name = "dispensaryType")String dispensaryType,
                                                  @RequestParam(required = false) @ApiParam(value = "传1为未分配健管师", name = "AllocationType")String allocationType,
                                                  @RequestParam(required = false) @ApiParam(value = "起始页", name = "page")Integer page,
                                                  @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size")Integer size){
    public String getDoctorPrescriptionExpressage
            (@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode") Integer teamCode,
             @RequestParam(required = false) @ApiParam(value = "居民搜素关键字", name = "nameKey") String nameKey,
             @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate") String startDate,
             @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate") String endDate,
             @RequestParam(required = false) @ApiParam(value = "机构", name = "hospital") String hospital,
             @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state") String state,
             @RequestParam(required = false) @ApiParam(value = "配送方式:1 自取 2快递配送 3健管师配送", name = "dispensaryType") String
                     dispensaryType,
             @RequestParam(required = false) @ApiParam(value = "传1为未分配健管师", name = "AllocationType") String
                     allocationType,
             @RequestParam(required = false) @ApiParam(value = "起始页", name = "page") Integer page,
             @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size") Integer size) {
        try {
            return write(200, "操作成功!", "data",
                    prescriptionInfoService.
                            getDoctorPrescriptionExpressage(teamCode, nameKey, startDate, endDate, hospital, state, dispensaryType,allocationType, page, size));
                            getDoctorPrescriptionExpressage(teamCode, nameKey, startDate, endDate, hospital, state, dispensaryType, allocationType, page, size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -271,7 +277,8 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getCountExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取指定团队未分配建管师订单数目")
    public String getCountExpressage(@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode")String teamCode){
    public String getCountExpressage
            (@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode") String teamCode) {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getCountExpressage(teamCode));
        } catch (Exception e) {
@ -282,7 +289,8 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getHospitalListTitle", method = RequestMethod.GET)
    @ApiOperation(value = "获取服务站列表")
    public String getHospitalListTitle(@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode")String teamCode){
    public String getHospitalListTitle
            (@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode") String teamCode) {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getHospitalListTitle(teamCode));
        } catch (Exception e) {
@ -293,7 +301,7 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getTeamHealthDoctorCount", method = RequestMethod.GET)
    @ApiOperation(value = "获取医生同社区底下所有团队建管师数目")
    public String getTeamHealthDoctorCount(){
    public String getTeamHealthDoctorCount() {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getTeamHealthDoctorCount(getUID()));
        } catch (Exception e) {
@ -305,10 +313,11 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getPrescriptionDurgDict", method = RequestMethod.GET)
    @ApiOperation(value = "获取基卫的药品字典")
    public String getPrescriptionDurgDict(
            @RequestParam(required = true,name = "dictName") @ApiParam(value = "字典名称", name = "dictName",required = true)  String dictName
    ){
            @RequestParam(required = true, name = "dictName") @ApiParam(value = "字典名称", name = "dictName", required = true) String
                    dictName
    ) {
        try {
            return write(200, "操作成功!", "data",jwPrescriptionService.getDictForI(dictName));
            return write(200, "操作成功!", "data", jwPrescriptionService.getDictForI(dictName));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -317,10 +326,12 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/distributionHealthDoctor", method = RequestMethod.POST)
    @ApiOperation(value = "配置建管师")
    public String distributionHealthDoctor(@RequestParam(required = true) @ApiParam(value = "续方Code字符串用','分割", name = "codes") String codes,
                                           @RequestParam(required = true) @ApiParam(value = "健康管理师Code", name = "healthDoctor")String healthDoctor){
    public String distributionHealthDoctor
            (@RequestParam(required = true) @ApiParam(value = "续方Code字符串用','分割", name = "codes") String codes,
             @RequestParam(required = true) @ApiParam(value = "健康管理师Code", name = "healthDoctor") String
                     healthDoctor) {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.distributionHealthDoctor( codes, healthDoctor));
            return write(200, "操作成功!", "data", prescriptionInfoService.distributionHealthDoctor(codes, healthDoctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -329,9 +340,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/testAdapter", method = RequestMethod.POST)
    @ApiOperation(value = "测试适配器")
    public String testAdapter(@RequestParam(required = true) @ApiParam(value = "字符串", name = "json") String json){
    public String testAdapter(@RequestParam(required = true) @ApiParam(value = "字符串", name = "json") String json) {
        try {
            return write(200, "操作成功!", "data",adapter.modeTopresInfo(json));
            return write(200, "操作成功!", "data", adapter.modeTopresInfo(json));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -340,9 +351,10 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getIcd10Info", method = RequestMethod.GET)
    @ApiOperation(value = "获取诊断结果")
    public String getIcd10Info(@RequestParam(required = true) @ApiParam(value = "诊断结果关键字", name = "nameKey") String nameKey){
    public String getIcd10Info(@RequestParam(required = true) @ApiParam(value = "诊断结果关键字", name = "nameKey") String
                                       nameKey) {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getIcd10Info(nameKey));
            return write(200, "操作成功!", "data", prescriptionInfoService.getIcd10Info(nameKey));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -351,9 +363,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getPrescriptionTemp", method = RequestMethod.GET)
    @ApiOperation(value = "获取调整处方模板")
    public String getPrescriptionTemp(){
    public String getPrescriptionTemp() {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionTemp(getUID()));
            return write(200, "操作成功!", "data", prescriptionInfoService.getPrescriptionTemp(getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -362,9 +374,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/initDrugData", method = RequestMethod.GET)
    @ApiOperation(value = "刷入redis平次数据")
    public String initDrugData(){
    public String initDrugData() {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.initDrugData());
            return write(200, "操作成功!", "data", prescriptionInfoService.initDrugData());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -372,19 +384,20 @@ public class PrescriptionInfoController extends BaseController{
    }
    @RequestMapping(value = "/drugToRate", method = RequestMethod.GET)
    @ApiOperation(value ="频次翻译")
    public String drugToRate(@RequestParam(required = true)@ApiParam(name="code",value="频次CODE")String code){
    @ApiOperation(value = "频次翻译")
    public String drugToRate(@RequestParam(required = true) @ApiParam(name = "code", value = "频次CODE") String code) {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.drugToRate(code));
            return write(200, "操作成功!", "data", prescriptionInfoService.drugToRate(code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescription" ,method = RequestMethod.GET)
    @RequestMapping(value = "/getPrescription", method = RequestMethod.GET)
    @ApiOperation(value = "获取长处方详细信息")
    public String getPrescription(@RequestParam(required = true)@ApiParam(name="code",value="处方CODE")String code){
    public String getPrescription(@RequestParam(required = true) @ApiParam(name = "code", value = "处方CODE") String
                                          code) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescription(code));
        } catch (Exception e) {
@ -393,9 +406,9 @@ public class PrescriptionInfoController extends BaseController{
        }
    }
    @RequestMapping(value = "/getRateList" ,method = RequestMethod.GET)
    @RequestMapping(value = "/getRateList", method = RequestMethod.GET)
    @ApiOperation(value = "查询频次列表")
    public String getRateList(){
    public String getRateList() {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getRateList());
        } catch (Exception e) {
@ -404,33 +417,35 @@ public class PrescriptionInfoController extends BaseController{
        }
    }
    @RequestMapping(value = "/getRegisterRee" ,method = RequestMethod.GET)
    @RequestMapping(value = "/getRegisterRee", method = RequestMethod.GET)
    @ApiOperation(value = "获取挂号费+诊察费下拉列表")
    public String getRegisterRee(@RequestParam(required = true)@ApiParam(name="jwHospital",value="开方机构")String jwHospital,
                                 @RequestParam(required = true)@ApiParam(name="jwDoctorCode",value="开方医生Code")String jwDoctorCode){
    public String getRegisterRee
            (@RequestParam(required = true) @ApiParam(name = "jwHospital", value = "开方机构") String jwHospital,
             @RequestParam(required = true) @ApiParam(name = "jwDoctorCode", value = "开方医生Code") String jwDoctorCode) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getRegisterRee(jwHospital,jwDoctorCode));
            return write(200, "查询成功!", "data", prescriptionInfoService.getRegisterRee(jwHospital, jwDoctorCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getDeptList" ,method = RequestMethod.GET)
    @RequestMapping(value = "/getDeptList", method = RequestMethod.GET)
    @ApiOperation(value = "获取医生科室列表")
    public String getDeptList(@RequestParam(required = true)@ApiParam(name="jwHospital",value="开方机构")String jwHospital,
                                 @RequestParam(required = true)@ApiParam(name="jwDoctorCode",value="开方医生Code")String jwDoctorCode){
    public String getDeptList(@RequestParam(required = true) @ApiParam(name = "jwHospital", value = "开方机构") String
                                      jwHospital,
                              @RequestParam(required = true) @ApiParam(name = "jwDoctorCode", value = "开方医生Code") String jwDoctorCode) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getDeptList(jwHospital,jwDoctorCode));
            return write(200, "查询成功!", "data", prescriptionInfoService.getDeptList(jwHospital, jwDoctorCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getUsageDict" ,method = RequestMethod.GET)
    @RequestMapping(value = "/getUsageDict", method = RequestMethod.GET)
    @ApiOperation(value = "获取药品用法列表")
    public String getUsageDict(){
    public String getUsageDict() {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getUsageDict());
        } catch (Exception e) {

+ 49 - 44
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java

@ -46,39 +46,40 @@ public class PatientPrescriptionController extends WeixinBaseController {
    /**
     * 生成取药码
     */
    @RequestMapping(value = "/dispensaryCode/saveQRCode",method = RequestMethod.POST)
    @RequestMapping(value = "/dispensaryCode/saveQRCode", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String saveQRCode2(
            @ApiParam(required = true ,name = "prescriptionCode",value = "处方code")@RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){
            @ApiParam(required = true, name = "prescriptionCode", value = "处方code") @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode) {
        try {
           boolean b = prescriptionDispensaryCodeService.saveQRCode(getAccessToken(),prescriptionCode);
           if(b){
               return write(200, "生成二维码成功!");
           }else{
               return error(-1, "生成二维码失败!");
           }
        }catch (Exception e) {
            boolean b = prescriptionDispensaryCodeService.saveQRCode(getAccessToken(), prescriptionCode);
            if (b) {
                return write(200, "生成二维码成功!");
            } else {
                return error(-1, "生成二维码失败!");
            }
        } catch (Exception e) {
            error(e);
            return error(-1, "生成二维码失败!");
        }
    }
    /**
     *生成居民取药码
     * 生成居民取药码
     *
     * @return
     */
    @RequestMapping(value = "/dispensaryCode/savePatientQRCode",method = RequestMethod.GET)
    @RequestMapping(value = "/dispensaryCode/savePatientQRCode", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public String saveQRCode(
            //@RequestParam(value = "dispensaryType",required = true) Integer dispensaryType,
            @ApiParam(required = true ,name = "prescriptionCode",value = "处方code")@RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){
            @ApiParam(required = true, name = "prescriptionCode", value = "处方code") @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode) {
//        String token = getAccessToken();
        try {
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.savePatientQRCode(getAccessToken(),prescriptionCode);
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.savePatientQRCode(getAccessToken(), prescriptionCode);
            if (prescriptionDispensaryCode == null) {
                return error(-1, "生成居民取药码失败!");
            } else {
@ -91,18 +92,19 @@ public class PatientPrescriptionController extends WeixinBaseController {
    }
    /**
     *生成配送员取药码
     * 生成配送员取药码
     *
     * @return
     */
    @RequestMapping(value = "/dispensaryCode/saveDoctorQRCode",method = RequestMethod.GET)
    @RequestMapping(value = "/dispensaryCode/saveDoctorQRCode", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public String saveDoctorQRCode(
            @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode,
            @RequestParam(value = "code",required = true) String code){
            @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode,
            @RequestParam(value = "code", required = true) String code) {
        try {
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.saveQRCode(code,getAccessToken(),prescriptionCode,2);
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.saveQRCode(code, getAccessToken(), prescriptionCode, 2);
            if (prescriptionDispensaryCode == null) {
                return error(-1, "生成配送员取药码失败!");
            } else {
@ -116,18 +118,19 @@ public class PatientPrescriptionController extends WeixinBaseController {
    /**
     *生成配送员配送码
     * 生成配送员配送码
     *
     * @return
     */
    @RequestMapping(value = "/dispensaryCode/saveDoctorQRDeliveryCode",method = RequestMethod.GET)
    @RequestMapping(value = "/dispensaryCode/saveDoctorQRDeliveryCode", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public String saveDoctorQRDeliveryCode(
            @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode,
            @RequestParam(value = "code",required = true) String code){
            @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode,
            @RequestParam(value = "code", required = true) String code) {
        try {
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.saveQRCode(code,getAccessToken(),prescriptionCode,3);
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.saveQRCode(code, getAccessToken(), prescriptionCode, 3);
            if (prescriptionDispensaryCode == null) {
                return error(-1, "生成配送员配送码失败!");
            } else {
@ -142,17 +145,18 @@ public class PatientPrescriptionController extends WeixinBaseController {
    /**
     * 居民端获取取药码
     *
     * @param prescriptionCode
     * @return
     */
    @RequestMapping(value = "/dispensaryCode/getPatientQrcode", method = RequestMethod.GET)
    public String getPatientQrcode(@RequestParam(value = "prescriptionCode",required = true) String prescriptionCode) {
    public String getPatientQrcode(@RequestParam(value = "prescriptionCode", required = true) String prescriptionCode) {
        try{
            Map<String, Object> map = prescriptionDispensaryCodeService.getQrcode(prescriptionCode,getRepUID(),1);
        try {
            Map<String, Object> map = prescriptionDispensaryCodeService.getQrcode(prescriptionCode, getRepUID(), 1);
//            map.put("code",Base64.encode(map.get("code").toString().getBytes()));
            return write(200, "获取居民取药码成功!", "data", map);
        }catch (Exception e) {
        } catch (Exception e) {
            error(e);
            return error(-1, "获取取药码失败!");
        }
@ -160,24 +164,24 @@ public class PatientPrescriptionController extends WeixinBaseController {
    /**
     * 显示居民所有的取药码列表
     *
     * @param status
     * @param timeType
     * @param page
     * @param pagesize
     * type 1、居民端扫码列表 2、配送员(健管师)扫码列表
     * @param pagesize type 1、居民端扫码列表 2、配送员(健管师)扫码列表
     * @return
     */
    @RequestMapping(value = "/dispensaryCode/list",method = RequestMethod.GET)
    @RequestMapping(value = "/dispensaryCode/list", method = RequestMethod.GET)
    @ResponseBody
    //@ObserverRequired
    public String list(
            @RequestParam(value = "status",required = false) Integer status,
            @RequestParam(value = "timeType",required = false) Integer timeType,
            @RequestParam(value = "page",required = true) Integer page,
            @RequestParam(value = "pagesize",required = true) Integer pagesize) {
            @RequestParam(value = "status", required = false) Integer status,
            @RequestParam(value = "timeType", required = false) Integer timeType,
            @RequestParam(value = "page", required = true) Integer page,
            @RequestParam(value = "pagesize", required = true) Integer pagesize) {
        //getUID()"a663d0cf7f8c4d38a8327cedc921e65f"
        try {
            JSONArray result = prescriptionDispensaryCodeService.findByStatusAndTime(timeType,getRepUID(),status,page,pagesize,1);
            JSONArray result = prescriptionDispensaryCodeService.findByStatusAndTime(timeType, getRepUID(), status, page, pagesize, 1);
            return write(200, "获取信息成功!", "result", result);
        } catch (Exception e) {
@ -187,7 +191,6 @@ public class PatientPrescriptionController extends WeixinBaseController {
    }
    /**
     * 判断该居民是否有待取的药的接口
     * @return
@ -224,7 +227,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
    public String prescriptionFollow(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            JSONObject jo = new JSONObject();
            net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
            //获取处方信息
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            //获取处方药品信息
@ -233,14 +236,16 @@ public class PatientPrescriptionController extends WeixinBaseController {
            PrescriptionPay prescriptionPay = prescriptionPayService.findByPrescriptionCode(prescriptionCode);
            //获取配送信息
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            jo.put("prescriptionExpressage", new JSONObject(prescriptionExpressage));
            jo.put("prescriptionExpressage", prescriptionExpressage);
            jo.put("prescriptionPay", prescriptionPay);
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", new JSONObject(prescriptionPay));
            jo.put("prescriptionHospital", prescription.getHospitalName());//出药机构
            jo.put("prescriptionDispensaryType", prescription.getDispensaryType());//处方配送方式
            jo.put("prescriptionDispensaryTypeName", prescription.getDispensaryTypeName());//处方配送方式
            jo.put("prescriptionStatus", prescription.getStatus());//处方状态
            jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(),""));//处方状态名称
            if (prescription != null) {
                jo.put("prescriptionHospital", prescription.getHospitalName());//出药机构
                jo.put("dispensaryDispensaryType", prescription.getDispensaryType());//处方配送方式
                jo.put("dispensaryDispensaryTypeName", prescription.getDispensaryTypeName());//处方配送方式
                jo.put("prescriptionStatus", prescription.getStatus());//处方状态
                jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(), ""));//处方状态名称
            }
            return write(200, "查询成功", "data", jo);
        } catch (Exception e) {
            return error(-1, "获取失败");