|
@@ -566,6 +566,13 @@ public class DTPService {
|
|
|
List<PageData> addList = new ArrayList<>();
|
|
|
int resultDrug=0;
|
|
|
int drugQuantity=0;
|
|
|
+
|
|
|
+ //生成计划ID
|
|
|
+ String planId = IdUtils.fastSimpleUUID();
|
|
|
+ String registrant = (String) pd.get("registrant");
|
|
|
+ if(StringUtils.isEmpty(registrant)){
|
|
|
+ pd.put("registrant", getSysUser().getLoginName());
|
|
|
+ }
|
|
|
try {
|
|
|
if (StringUtils.isNotNull(drugList)) {
|
|
|
// 将 JSON 字符串转换为 List<Map<String, Object>>
|
|
@@ -576,7 +583,7 @@ public class DTPService {
|
|
|
if (rowsdrugList.size() > 0) {
|
|
|
for (Map<String, Object> lxr : rowsdrugList) {
|
|
|
PageData pageData = new PageData();
|
|
|
-
|
|
|
+ PageData pdPlan = new PageData();
|
|
|
// 设置固定或默认值
|
|
|
pageData.put("createdBy", getSysUser().getLoginName());
|
|
|
pageData.put("createdTime", DateUtils.getTime());
|
|
@@ -622,8 +629,85 @@ public class DTPService {
|
|
|
// pageData.put("updatedBy", lxr.get("updatedBy"));
|
|
|
// pageData.put("updatedTime", lxr.get("updatedTime"));
|
|
|
// pageData.put("remarks", lxr.get("remarks"));
|
|
|
+
|
|
|
+
|
|
|
+ String followUpItem = (String) lxr.get("followUpItem");//是否是随访品 1是,0否
|
|
|
+ if( StringUtils.isNotEmpty(followUpItem) && "是".equals(followUpItem) ){
|
|
|
+
|
|
|
+ PageData pdCPB=new PageData();
|
|
|
+ if (StringUtils.isNotEmpty(patientId)) {
|
|
|
+ pdCPB.put("patientId", patientId);
|
|
|
+ }else {
|
|
|
+ returnPageData.put("msg", "天添加败未获取患者信息");
|
|
|
+ returnPageData.put("code", 300);
|
|
|
+ return returnPageData;
|
|
|
+ }
|
|
|
+ pdCPB.put("mdmCode", lxr.get("mdmCode"));
|
|
|
+ pdCPB.put("productCode", lxr.get("productCode"));
|
|
|
+
|
|
|
+ List<PageData> SOPList= (List<PageData>) daoSupport.findForList("SDtpYypzFollowUpSopMapper.selectSOPTemplateByProductCode", pdCPB);
|
|
|
+ if(SOPList.size()>0){//说明是配置品
|
|
|
+ String businessBelonging = (String) SOPList.get(0).get("businessBelonging");//业务归属
|
|
|
+ }
|
|
|
+
|
|
|
+ //先查询该患者购买在这个药品是否已经有计划 mdmCode patientId businessBelonging
|
|
|
+ //List<PageData> planList= (List<PageData>) daoSupport.findForList("followPlanMapper.selectPlanListByCPB", pdCPB);
|
|
|
+ PageData plan= (PageData) daoSupport.findForObject("followPlanMapper.selectPlanByCPB", pdCPB);
|
|
|
+ //生成任务ID
|
|
|
+ String taskId = IdUtils.fastSimpleUUID();
|
|
|
+ if(StringUtils.isNotNull(plan)){
|
|
|
+ pdCPB.put("planId", plan.get("planId"));
|
|
|
+ planId= plan.get("planId").toString();
|
|
|
+ }else {
|
|
|
+ pdCPB.put("planId", planId);
|
|
|
+ pdCPB.put("productName", lxr.get("productName"));//'药品名称'
|
|
|
+ pdCPB.put("businessBelonging", "常规随访");//业务归属 先写死 默认这个药品已经配置了业务归属为常规随访的药
|
|
|
+ pdCPB.put("specification", lxr.get("specification"));
|
|
|
+ pdCPB.put("storeId", getSysUser().getDeptId());
|
|
|
+ pdCPB.put("storeName", getSysUser().getDept().getDeptName());
|
|
|
+ pdCPB.put("templateId", "12345");//'模版ID' 先假设写死 实际是获取模板ID
|
|
|
+ pdCPB.put("planName", lxr.get("productName")+"-随访");//'计划名称' 默认用药品作为名称
|
|
|
+ // pdCPB.put("taskId", taskId);
|
|
|
+ pdCPB.put("follow_up_person", "周敏");//'随访跟进人' 先写死
|
|
|
+ pdCPB.put("follow_up_person_id", "7");//'随访跟进人id' 先写死
|
|
|
+ pdCPB.put("createdBy", "系统创建");//'创建人'
|
|
|
+ pdCPB.put("createdTime", DateUtils.getTime());//'创建时间'
|
|
|
+ pdCPB.put("updatedBy", getSysUser().getLoginName());//'创建时间'
|
|
|
+ pdCPB.put("updatedTime", DateUtils.getTime());//'创建时间'
|
|
|
+ pdCPB.put("status", 1);//'计划状态: 0关闭 1开启/进行中,2默认:2已创建待开启'
|
|
|
+ int FollowPlan = dao.executeBatch("followPlanMapper.insertFollowPlan", pdCPB);
|
|
|
+ System.out.println("FollowPlan.size()="+FollowPlan);
|
|
|
+ }
|
|
|
+ pdCPB.put("appointmentDate", DateUtils.getTime());//'预约日期'
|
|
|
+ pdCPB.put("businessBelonging", "常规随访");//'业务归属:常规随访,脱落召回'
|
|
|
+ pdCPB.put("taskName", "第1次任务");//'任务名称'
|
|
|
+ pdCPB.put("taskTheme", "常规随访");//'任务主题'
|
|
|
+ pdCPB.put("planId", planId);//'计划ID'
|
|
|
+ pdCPB.put("patientId", patientId);//'患者id'
|
|
|
+ pdCPB.put("patientName", pd.get("patientName"));//'患者姓名'
|
|
|
+ pdCPB.put("gender", pd.get("gender"));//'性别:0男,1女,2未知'
|
|
|
+ pdCPB.put("age", pd.get("age"));//'年龄'
|
|
|
+ //pdCPB.put("followUpSummary", "无");//'随访小结'
|
|
|
+ //pdCPB.put("followUpSummaryid", lxr.get("followUpSummaryid"));//'随访小结id'
|
|
|
+ pdCPB.put("disease", pd.get("prescriptionDiagnosis"));//'疾病' 先用处方诊断字段代替
|
|
|
+ pdCPB.put("storeName", getSysUser().getDeptId());//'门店'
|
|
|
+ pdCPB.put("mdmCode", lxr.get("mdmCode"));//'药品编码'
|
|
|
+ pdCPB.put("genericName", lxr.get("genericName"));//'药品通用名'
|
|
|
+ pdCPB.put("productName", lxr.get("productName"));//'商品名'
|
|
|
+ pdCPB.put("taskFollower", "周敏");//'任务跟进人'
|
|
|
+ pdCPB.put("nutrition_evaluation_id", "11111111");//'营养测评id'
|
|
|
+ pdCPB.put("medication_record_id", "22222222");//'用药记录id'
|
|
|
+ pdCPB.put("taskStatus", "待执行");//任务状态:\r\n,0待执行,\r\n1已完成,\r\n2未完成,\r\n3已下发
|
|
|
+ pdCPB.put("operator", pd.get("registrant"));//'操作人'
|
|
|
+ pdCPB.put("createdAt", DateUtils.getTime());
|
|
|
+ pdCPB.put("updatedAt", DateUtils.getTime());
|
|
|
+ pdCPB.put("storeId", getSysUser().getDeptId());
|
|
|
+ int FollowTask = dao.executeBatch("followTaskMapper.insertFollowTask", pdCPB);
|
|
|
+ System.out.println("FollowTask.size()="+FollowTask);
|
|
|
+ }
|
|
|
addList.add(pageData);
|
|
|
resultDrug = dao.executeBatch("DTPCFDJMapper.batchAddDrugPurchaseRecordNew", pageData);
|
|
|
+ System.out.println("resultDrug.size()="+resultDrug);
|
|
|
}
|
|
|
// final HashMap<String, Object> addMap = new HashMap<String, Object>();
|
|
|
// addMap.put("dataList", addList);
|
|
@@ -653,11 +737,9 @@ public class DTPService {
|
|
|
pd.put("registerPharmacistName", getSysUser().getLoginName());
|
|
|
}
|
|
|
|
|
|
- String registrant = (String) pd.get("registrant");
|
|
|
- if(StringUtils.isEmpty(registrant)){
|
|
|
- pd.put("registrant", getSysUser().getLoginName());
|
|
|
- }
|
|
|
+
|
|
|
int result = daoSupport.save("DTPCFDJMapper.insertPrescriptionRegistration", pd);
|
|
|
+ System.out.println("result.size()="+result);
|
|
|
if(resultDrug>0 && result>0){
|
|
|
returnPageData.put("code", 200);
|
|
|
returnPageData.put("prescriptionNumber", prescriptionNumber);
|