|
@ -24,6 +24,7 @@ import com.yihu.jw.hospital.HospitalDao;
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
|
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
|
|
|
import com.yihu.jw.hospital.prescription.dao.OauthCaConfigDao;
|
|
|
import com.yihu.jw.restmodel.ResponseContant;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
@ -220,7 +221,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
//orderNum, equNum, contact, startTime, endTime, sellState, orderState, dispensingWindow
|
|
|
public JSONObject queryOrderListFullInfo(String content,String orderNum, String equNum, String contact,
|
|
|
String startTime, String endTime, String sellState,
|
|
|
String orderState, String dispensingWindow, String community,String town,
|
|
|
String orderState,String reviewerState, String dispensingWindow, String community,String town,
|
|
|
String userId, int page, int size, String wechatId) throws Exception {
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
@ -313,6 +314,8 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
" t.prescribe_num as prescribeNum,\n" +
|
|
|
" t.prescribe_time as prescribeTime,\n" +
|
|
|
" t.sell_state as sellState,\n" +
|
|
|
" t.reviewer_state as reviewerState,\n" +
|
|
|
" t.reviewer_content as reviewerContent,\n" +
|
|
|
" t.sex as sex,\n" +
|
|
|
" t.shipping_equ as shippingEqu,\n" +
|
|
|
" t.shipping_time as shippingTime,\n" +
|
|
@ -373,6 +376,9 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
if (!StringUtils.isEmpty(orderState)) {
|
|
|
conditionSql += " and t.order_state = '" + orderState + "'";
|
|
|
}
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(reviewerState)){
|
|
|
conditionSql += " and t.reviewer_state='"+reviewerState+"' ";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(dispensingWindow)) {
|
|
|
conditionSql += " and t.dispensing_window = '" + dispensingWindow + "'";
|
|
|
}
|
|
@ -474,6 +480,8 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
break;
|
|
|
}
|
|
|
jsonObject.put("sellStateName", sellStateName);
|
|
|
jsonObject.put("socialSecurityCardNum", mediicineorder.getSocialSecurityCardNum());
|
|
|
jsonObject.put("doctorName", mediicineorder.getDoctorName());
|
|
|
jsonObject.put("infoAccess", mediicineorder.getInfoAccess());
|
|
|
jsonObject.put("orderTypeName", orderTypeMap.get(mediicineorder.getOrderType()));
|
|
|
//取药码
|
|
@ -1379,7 +1387,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
* @param cardNo
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean getPhysicApplyWaitExecList(String deviceId,String cardNo){
|
|
|
public boolean getPhysicApplyWaitExecList(String deviceId,String cardNo,String patientName){
|
|
|
Mediicinedevice mediicinedevice = deviceDao.findMediicinedeviceByEquNum(deviceId);
|
|
|
String orgCode = "";
|
|
|
String community = "";
|
|
@ -1448,10 +1456,14 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
mediicineorder.setApplyNo(alyNo);
|
|
|
mediicineorder.setOrderSource("智业系统");
|
|
|
mediicineorder.setOrderState("1");
|
|
|
mediicineorder.setReviewerState(0);
|
|
|
mediicineorder.setPickUpNum(realOrder);
|
|
|
mediicineorder.setPrescribeNum(realOrder);
|
|
|
mediicineorder.setSellState("0");
|
|
|
mediicineorder.setInfo("慢病");
|
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(patientName)){
|
|
|
mediicineorder.setName(patientName);
|
|
|
}
|
|
|
mediicineorder.setSocialSecurityCardNum(cardNo);
|
|
|
mediicineorder.setBelongCommunity(orgCode);
|
|
|
mediicineorder.setCommunity(community);
|
|
@ -1594,6 +1606,30 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 待审核发送模板消息
|
|
|
* @param hospital
|
|
|
*/
|
|
|
public void reviewRemindSendMessage(String hospital,String patientName){
|
|
|
try {
|
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(hospital)){
|
|
|
List<WlyyUserAreaDO> userAreaDOList = userAreaDao.findAllByHospital(hospital);
|
|
|
for (WlyyUserAreaDO userAreaDO:userAreaDOList){
|
|
|
UserDO userDO = userDao.findById(userAreaDO.getUserId());
|
|
|
if (userDO!=null){
|
|
|
RoleDO roleDO = roleDao.findOne(userDO.getRoleId());
|
|
|
if (roleDO.getCode().equalsIgnoreCase("replenisher")
|
|
|
||roleDO.getCode().equalsIgnoreCase("communityAdmin")){
|
|
|
sendDoctorTemplates(userDO.getIdcard(),"9","","您好,您有1位患者的续方待审方,请前往审核。","居民:"+patientName,"审方提醒,"+userAreaDO.getHospitalName()+","+userDO.getName());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 温度、在线离线发送模板消息
|
|
|
* @param hospital
|
|
@ -2133,7 +2169,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public JSONObject checkOrderAndReturnOrderList(String deviceId, String pickUpNum, String cardNum) {
|
|
|
public JSONObject checkOrderAndReturnOrderList(String deviceId, String pickUpNum, String cardNum,String patientName) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
if (deviceId == null || StringUtils.isEmpty(deviceId)) {
|
|
|
result.put("msg", "parameter deviceId is null or empty");
|
|
@ -2180,7 +2216,14 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
}
|
|
|
List<Map<String , Object>> orderList = new ArrayList<>();
|
|
|
//遍历所有订单
|
|
|
List<Mediicineorder> orderSetName = new ArrayList<>();
|
|
|
for (Mediicineorder order : orders) {
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(order.getName())){
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(patientName)){
|
|
|
order.setName(patientName);
|
|
|
orderSetName.add(order);
|
|
|
}
|
|
|
}
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
DmHospitalDO dmHospitalDO = hospitalDao.findByCode(order.getBelongCommunity());
|
|
|
if (!mediicinedevice.getBelongCommunity().equals(order.getBelongCommunity())) {
|
|
@ -2468,7 +2511,9 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
}
|
|
|
orderList.add(map);
|
|
|
}
|
|
|
|
|
|
if (orderSetName.size()>0){
|
|
|
orderDao.save(orderSetName);
|
|
|
}
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("orderList", orderList);
|
|
@ -2782,4 +2827,28 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public JSONObject reviewerOrder(String orderId,Integer reviewerState,String reviewerContent) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
Mediicineorder mediicineorder = orderDao.findOne(orderId);
|
|
|
if (null == mediicineorder) {
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.fail);
|
|
|
result.put(ResponseContant.resultMsg, "审方订单不存在");
|
|
|
return result;
|
|
|
}
|
|
|
if (0!= mediicineorder.getReviewerState()) {
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.fail);
|
|
|
result.put(ResponseContant.resultMsg, "该订单已审核过,无需重复审核");
|
|
|
return result;
|
|
|
}
|
|
|
mediicineorder.setReviewerState(reviewerState);
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(reviewerContent)) {
|
|
|
mediicineorder.setReviewerContent(reviewerContent);
|
|
|
}
|
|
|
orderDao.save(mediicineorder);
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.success);
|
|
|
result.put(ResponseContant.resultMsg, mediicineorder);
|
|
|
return result;
|
|
|
}
|
|
|
}
|