|
@@ -12,12 +12,11 @@ import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.OrderUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.store.bean.Drug;
|
|
|
+import com.fs.store.bean.DrugV2;
|
|
|
import com.fs.store.bean.Prescribe;
|
|
|
+import com.fs.store.bean.PrescribeV2;
|
|
|
import com.fs.store.domain.*;
|
|
|
-import com.fs.store.param.FsPrescribeParam;
|
|
|
-import com.fs.store.param.FsPrescribeQueryParam;
|
|
|
-import com.fs.store.param.FsPrescribeVOParam;
|
|
|
-import com.fs.store.param.PrescribeParam;
|
|
|
+import com.fs.store.param.*;
|
|
|
import com.fs.store.service.*;
|
|
|
import com.fs.store.vo.FsPrescribeVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -143,49 +142,47 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
String rpId=OrderUtils.getOrderNo();
|
|
|
FsPatient patient=patientService.selectFsPatientById(param.getPatientId());
|
|
|
FsUser user=userService.selectFsUserById(userId);
|
|
|
- PrescribeParam prescribeParam=new PrescribeParam();
|
|
|
- List<Prescribe> data=new ArrayList<>();
|
|
|
- Prescribe prescribe=new Prescribe();
|
|
|
- prescribe.setRp_type("01");
|
|
|
- prescribe.setRp_id(rpId);
|
|
|
- prescribe.setPharmacy_code("00001");
|
|
|
- prescribe.setPharmacy_name("零利润药房");
|
|
|
- prescribe.setPatient_name(patient.getPatientName());
|
|
|
- prescribe.setPatient_age(DateUtils.getAge(patient.getBirthday()));
|
|
|
- prescribe.setPatient_tel(user.getPhone());
|
|
|
- prescribe.setPatient_gender(patient.getGender().toString());
|
|
|
- prescribe.setIs_history_allergic(param.getIsAllergic()?"是":"否");
|
|
|
- prescribe.setLiver_unusual(param.getIsLiver()?"是":"否");
|
|
|
- prescribe.setRenal_unusual(param.getIsRenal()?"是":"否");
|
|
|
- prescribe.setLactation_flag(param.getIsLactation()?"是":"否");
|
|
|
- prescribe.setChief_complaint(param.getChiefComplaint());
|
|
|
- prescribe.setNow_illness(param.getNowIllness());
|
|
|
- prescribe.setHistory_illness(param.getHistoryIllness());
|
|
|
+ PrescribeV2Param prescribeParam=new PrescribeV2Param();
|
|
|
+ PrescribeV2 prescribe=new PrescribeV2();
|
|
|
+ prescribe.setDrugType("01");
|
|
|
+ prescribe.setOnlyId(rpId);
|
|
|
+ prescribe.setDrugstoreName("零利润药房");
|
|
|
+ prescribe.setPatientName(patient.getPatientName());
|
|
|
+ prescribe.setPatientAge(DateUtils.getAge(patient.getBirthday()));
|
|
|
+// prescribe.setPatientTel(user.getPhone());
|
|
|
+ prescribe.setPatientSex(patient.getGender());
|
|
|
+ prescribe.setPatientAllergy(param.getIsAllergic()?1:0);
|
|
|
+ prescribe.setLiverUnusual(param.getIsLiver()?1:0);
|
|
|
+ prescribe.setRenalUnusual(param.getIsRenal()?1:0);
|
|
|
+ prescribe.setLactationFlag(param.getIsLactation()?1:0);
|
|
|
+ prescribe.setChiefComplaint(param.getChiefComplaint());
|
|
|
+ prescribe.setNowIllness(param.getNowIllness());
|
|
|
+ prescribe.setHistoryIllness(param.getHistoryIllness());
|
|
|
if(StringUtils.isNotEmpty(param.getRecordPic())){
|
|
|
- prescribe.setRecord_pic(param.getRecordPic().split(","));
|
|
|
+ prescribe.setRecordPic(param.getRecordPic().split(","));
|
|
|
}
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Date now = new Date();
|
|
|
- prescribe.setRp_create_time(sdf.format(now));
|
|
|
- prescribe.setRp_url_type("png");
|
|
|
- prescribe.setLactation_flag("否");
|
|
|
- prescribe.setCallback_url(fsSysConfig.getCallbackUrl());
|
|
|
- data.add(prescribe);
|
|
|
+ prescribe.setCreateTime(sdf.format(now));
|
|
|
+ prescribe.setPictureType("png");
|
|
|
+// prescribe.setLactationFlag("否");
|
|
|
+ prescribe.setCallbackUrl(fsSysConfig.getCallbackUrl());
|
|
|
|
|
|
- List<Drug> drug_list=new ArrayList<>();
|
|
|
+ List<DrugV2> drug_list=new ArrayList<>();
|
|
|
for(FsStoreOrderItem item:items){
|
|
|
FsStoreProduct product=productService.selectFsStoreProductById(item.getProductId());
|
|
|
- Drug drug=new Drug();
|
|
|
- drug.setDrug_common_name(product.getPrescribeName());
|
|
|
- drug.setDrug_specification(product.getPrescribeSpec());
|
|
|
- drug.setSale_amount(item.getNum().toString());
|
|
|
- drug.setSale_unit(product.getUnitName());
|
|
|
- drug.setApproval_number(product.getPrescribeCode());
|
|
|
+ DrugV2 drug=new DrugV2();
|
|
|
+ drug.setDrugCommonName(product.getPrescribeName());
|
|
|
+ drug.setDrugSpecification(product.getPrescribeSpec());
|
|
|
+ drug.setSaleAmount(item.getNum().toString());
|
|
|
+ drug.setSaleUnit(product.getUnitName());
|
|
|
+ drug.setApprovalNumber(product.getPrescribeCode());
|
|
|
+ drug.setDrugCode(product.getProductId());
|
|
|
drug_list.add(drug);
|
|
|
- prescribe.setDrug_list(drug_list);
|
|
|
- prescribeParam.setData(data);
|
|
|
+ prescribe.setDrugList(drug_list);
|
|
|
+ prescribeParam.setData(prescribe);
|
|
|
}
|
|
|
- R response=prescribeService.doPrescribe(prescribeParam);
|
|
|
+ R response=prescribeService.doPrescribeV2(prescribeParam);
|
|
|
if(response.get("code").equals(200)){
|
|
|
FsPrescribe fsPrescribe=new FsPrescribe();
|
|
|
fsPrescribe.setRpId(rpId);
|