|
@ -1,6 +1,10 @@
|
|
|
package com.yihu.wlyy.controller.synergy.doctor;
|
|
package com.yihu.wlyy.controller.synergy.doctor;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
|
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
|
|
|
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
|
|
|
import com.yihu.wlyy.service.synergy.SynergyManageService;
|
|
import com.yihu.wlyy.service.synergy.SynergyManageService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
@ -10,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
@ -20,6 +25,8 @@ public class DoctorSynergyManageController extends BaseController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SynergyManageService synergyManageService;
|
|
private SynergyManageService synergyManageService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ObjectMapper objectMapper;
|
|
|
|
|
|
|
|
@RequestMapping(value = "workorderList", method = RequestMethod.GET)
|
|
@RequestMapping(value = "workorderList", method = RequestMethod.GET)
|
|
|
@ApiOperation("医生端-协同服务列表")
|
|
@ApiOperation("医生端-协同服务列表")
|
|
@ -51,4 +58,27 @@ public class DoctorSynergyManageController extends BaseController {
|
|
|
return error(-1, "请求失败");
|
|
return error(-1, "请求失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "createWorkorder", method = RequestMethod.GET)
|
|
|
|
|
@ApiOperation("医生端-创建协同服务")
|
|
|
|
|
public String workorderList(@ApiParam(name = "workorder", value = "工单对象", required = false)
|
|
|
|
|
@RequestParam(value = "workorder")String workorder,
|
|
|
|
|
@ApiParam(name = "servicers", value = "服务对象", required = false)
|
|
|
|
|
@RequestParam(value = "servicers")String servicers){
|
|
|
|
|
try {
|
|
|
|
|
ManageSynergyWorkorderDO workorderDO = objectMapper.readValue(workorder,ManageSynergyWorkorderDO.class);
|
|
|
|
|
JSONArray jsonArray = JSONArray.parseArray(servicers);
|
|
|
|
|
List<ManageSynergyWorkorderServicerDO> servicerDOS = new ArrayList<>();
|
|
|
|
|
for (int i=0;i<jsonArray.size();i++){
|
|
|
|
|
ManageSynergyWorkorderServicerDO servicerDO = objectMapper.readValue(jsonArray.getJSONObject(i).toJSONString(),ManageSynergyWorkorderServicerDO.class);
|
|
|
|
|
servicerDOS.add(servicerDO);
|
|
|
|
|
}
|
|
|
|
|
synergyManageService.createWorkorder(workorderDO,servicerDOS);
|
|
|
|
|
return write(200, "获取成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
error(e);
|
|
|
|
|
return error(-1, "请求失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
}
|
|
}
|