|
@ -36,6 +36,7 @@ import com.yihu.mysql.query.BaseJpaService;
|
|
import com.ylzinfo.onepay.sdk.utils.StringUtil;
|
|
import com.ylzinfo.onepay.sdk.utils.StringUtil;
|
|
import jxl.format.VerticalAlignment;
|
|
import jxl.format.VerticalAlignment;
|
|
import jxl.write.*;
|
|
import jxl.write.*;
|
|
|
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.apache.commons.collections4.IterableUtils;
|
|
import org.apache.commons.collections4.IterableUtils;
|
|
import org.apache.http.NameValuePair;
|
|
import org.apache.http.NameValuePair;
|
|
@ -53,6 +54,8 @@ import java.lang.Boolean;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.logging.Logger;
|
|
import java.util.logging.Logger;
|
|
|
|
import java.util.regex.*;
|
|
|
|
import java.util.regex.Pattern;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static jxl.biff.BaseCellFeatures.logger;
|
|
import static jxl.biff.BaseCellFeatures.logger;
|
|
@ -848,8 +851,14 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
if (Integer.compare(totalShipmentLog, shipped + 1) == 0) {
|
|
if (Integer.compare(totalShipmentLog, shipped + 1) == 0) {
|
|
Mediicineorder order = orderDao.findOne(medicineShipmentLog.getOrderId());
|
|
Mediicineorder order = orderDao.findOne(medicineShipmentLog.getOrderId());
|
|
order.setSellState("1");
|
|
order.setSellState("1");
|
|
Boolean flag = scanQrdispensaryCode(order.getPickUpNum());
|
|
|
|
logger.info("flag"+flag);
|
|
|
|
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(order.getApplyNo())){
|
|
|
|
Boolean flag = sickPhysicDosage(order.getBelongCommunity(),order.getApplyNo());
|
|
|
|
logger.info("flag"+flag);
|
|
|
|
}else {
|
|
|
|
Boolean flag = scanQrdispensaryCode(order.getPickUpNum());
|
|
|
|
logger.info("flag"+flag);
|
|
|
|
}
|
|
|
|
|
|
orderDao.save(order);
|
|
orderDao.save(order);
|
|
}
|
|
}
|
|
if (Integer.compare(totalShipmentLog, shipped + 1) < 0) {
|
|
if (Integer.compare(totalShipmentLog, shipped + 1) < 0) {
|
|
@ -1285,13 +1294,13 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
* 线下订单药柜取药回调发药
|
|
* 线下订单药柜取药回调发药
|
|
* 线上续方 可只传处方号
|
|
* 线上续方 可只传处方号
|
|
线下续方 无处方号 机构、单据号必传
|
|
线下续方 无处方号 机构、单据号必传
|
|
* @param recipeNo
|
|
|
|
|
|
*
|
|
* @param orgCode
|
|
* @param orgCode
|
|
* @param applyNo
|
|
* @param applyNo
|
|
* @param execOperator
|
|
|
|
|
|
*
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public boolean sickPhysicDosage(String recipeNo,String orgCode,String applyNo,String execOperator){
|
|
|
|
|
|
public boolean sickPhysicDosage(String orgCode,String applyNo){
|
|
OauthWlyyConfigDO oauthWlyyConfigDO = oauthWlyyConfigDao.findOne("sickPhysicDosage");
|
|
OauthWlyyConfigDO oauthWlyyConfigDO = oauthWlyyConfigDao.findOne("sickPhysicDosage");
|
|
//token获取accesstoken
|
|
//token获取accesstoken
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
@ -1308,7 +1317,6 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
|
|
|
//设置入参
|
|
//设置入参
|
|
List<NameValuePair> p = new ArrayList<>();
|
|
List<NameValuePair> p = new ArrayList<>();
|
|
p.add(new BasicNameValuePair("recipeNo", recipeNo));
|
|
|
|
p.add(new BasicNameValuePair("orgCode", orgCode));
|
|
p.add(new BasicNameValuePair("orgCode", orgCode));
|
|
p.add(new BasicNameValuePair("applyNo", applyNo));
|
|
p.add(new BasicNameValuePair("applyNo", applyNo));
|
|
|
|
|
|
@ -1420,16 +1428,26 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
mediicineorder.setBelongCommunity(orgCode);
|
|
mediicineorder.setBelongCommunity(orgCode);
|
|
mediicineorder.setCommunity(community);
|
|
mediicineorder.setCommunity(community);
|
|
mediicineorder.setDoctorName(jsonObject.getString("APPLY_OPERATOR_NAME"));
|
|
mediicineorder.setDoctorName(jsonObject.getString("APPLY_OPERATOR_NAME"));
|
|
|
|
mediicineorder.setPrescribeTime(DateUtil.strToDateLong(jsonObject.getString("APPLY_TIME")+" 00:00:00"));
|
|
|
|
mediicineorder.setPayTime(DateUtil.strToDateLong(jsonObject.getString("APPLY_TIME")+" 00:00:00"));
|
|
mediicineorder = orderDao.save(mediicineorder);
|
|
mediicineorder = orderDao.save(mediicineorder);
|
|
JSONArray drugList = jsonObject.getJSONArray("APPLY_DETAIL");
|
|
JSONArray drugList = jsonObject.getJSONArray("APPLY_DETAIL");
|
|
for (int j =0;j<drugList.size();j++){
|
|
for (int j =0;j<drugList.size();j++){
|
|
JSONObject drugObj = drugList.getJSONObject(j);
|
|
JSONObject drugObj = drugList.getJSONObject(j);
|
|
|
|
String itemQc = drugObj.getString("ITEM_QUANTITY_C");
|
|
|
|
String quantity = getNumbers(itemQc);
|
|
|
|
String packageName = splitNotNumber(itemQc);
|
|
|
|
if (!org.apache.commons.lang3.StringUtils.isNoneBlank(quantity)){
|
|
|
|
mediicineorder.setOrderState("-1");
|
|
|
|
mediicineorder.setSellState("-3");
|
|
|
|
orderDao.save(mediicineorder);
|
|
|
|
}
|
|
Mediicineorderdetail mediicineorderdetail = new Mediicineorderdetail();
|
|
Mediicineorderdetail mediicineorderdetail = new Mediicineorderdetail();
|
|
mediicineorderdetail.setIdOrder(mediicineorder.getId());
|
|
mediicineorderdetail.setIdOrder(mediicineorder.getId());
|
|
mediicineorderdetail.setDrugCode(drugObj.getString("ITEM_CODE"));
|
|
mediicineorderdetail.setDrugCode(drugObj.getString("ITEM_CODE"));
|
|
mediicineorderdetail.setOrderNo(realOrder);
|
|
mediicineorderdetail.setOrderNo(realOrder);
|
|
mediicineorderdetail.setPrice(drugObj.getFloat("ITEM_PRICE"));
|
|
mediicineorderdetail.setPrice(drugObj.getFloat("ITEM_PRICE"));
|
|
mediicineorderdetail.setQuantity(drugObj.getString("ITEM_QUANTITY"));
|
|
|
|
|
|
mediicineorderdetail.setQuantity(quantity);
|
|
mediicineorderdetail.setGoodsName(drugObj.getString("ITEM_NAME"));
|
|
mediicineorderdetail.setGoodsName(drugObj.getString("ITEM_NAME"));
|
|
mediicineorderdetail.setOrderState("1");
|
|
mediicineorderdetail.setOrderState("1");
|
|
mediicineorderdetail.setPickUpNum(realOrder);
|
|
mediicineorderdetail.setPickUpNum(realOrder);
|
|
@ -1460,6 +1478,26 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//截取数字
|
|
|
|
public String getNumbers(String content) {
|
|
|
|
Pattern pattern = Pattern.compile("\\d+");
|
|
|
|
Matcher matcher = pattern.matcher(content);
|
|
|
|
while (matcher.find()) {
|
|
|
|
return matcher.group(0);
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
// 截取非数字
|
|
|
|
public String splitNotNumber(String content) {
|
|
|
|
Pattern pattern = Pattern.compile("\\D+");
|
|
|
|
Matcher matcher = pattern.matcher(content);
|
|
|
|
while (matcher.find()) {
|
|
|
|
return matcher.group(0);
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据处方号获取处方状态
|
|
* 根据处方号获取处方状态
|