Merge remote-tracking branch 'origin/dev_drug' into dev_drug
						commit
						4a92d3d323
					
				| @ -0,0 +1,73 @@ | |||||||
|  | package com.glxp.api.entity.alihealth; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AliYljgBillDetail { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 单据编码 | ||||||
|  |      */ | ||||||
|  |     private String billCode; | ||||||
|  |     /** | ||||||
|  |      * 单据类型描述 | ||||||
|  |      */ | ||||||
|  |     private String billTypeName; | ||||||
|  |     /** | ||||||
|  |      * 单据类型 | ||||||
|  |      */ | ||||||
|  |     private String billType; | ||||||
|  |     /** | ||||||
|  |      * 发货企业名称 | ||||||
|  |      */ | ||||||
|  |     private String entSendName; | ||||||
|  |     /** | ||||||
|  |      * 收货企业名称 | ||||||
|  |      */ | ||||||
|  |     private String entRecvName; | ||||||
|  |     /** | ||||||
|  |      * 收货企业refEntId | ||||||
|  |      */ | ||||||
|  |     private String entRecvId; | ||||||
|  |     /** | ||||||
|  |      * 单据日期 | ||||||
|  |      */ | ||||||
|  |     private String storeOutDate; | ||||||
|  |     /** | ||||||
|  |      * 最后更新时间 | ||||||
|  |      */ | ||||||
|  |     private String updateDate; | ||||||
|  |     /** | ||||||
|  |      * 药品详情集合 | ||||||
|  |      */ | ||||||
|  |     private List<AliYljgBillDetailDrug> aliYljgBillDetailDrugList; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     private String erpId; | ||||||
|  |     /** | ||||||
|  |      * 创建时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "createTime") | ||||||
|  |     @ApiModelProperty(value = "创建时间") | ||||||
|  |     private Date createTime; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 更新时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "updateTime") | ||||||
|  |     @ApiModelProperty(value = "更新时间") | ||||||
|  |     private Date updateTime; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,98 @@ | |||||||
|  | package com.glxp.api.entity.alihealth; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AliYljgBillDetailDrug { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 生产日期 | ||||||
|  |      */ | ||||||
|  |     private String produceDate; | ||||||
|  |     /** | ||||||
|  |      * 生产企业名称 | ||||||
|  |      */ | ||||||
|  |     private String productEntName; | ||||||
|  |     /** | ||||||
|  |      * 产品包装规格 | ||||||
|  |      */ | ||||||
|  |     private String packageSpec; | ||||||
|  |     /** | ||||||
|  |      * 药品商品名 | ||||||
|  |      */ | ||||||
|  |     private String prodName; | ||||||
|  |     /** | ||||||
|  |      * 药品通用名 | ||||||
|  |      */ | ||||||
|  |     private String physicName; | ||||||
|  |     /** | ||||||
|  |      * 制剂规格 | ||||||
|  |      */ | ||||||
|  |     private String prepnSpec; | ||||||
|  |     /** | ||||||
|  |      * 制剂单位编码 | ||||||
|  |      */ | ||||||
|  |     private String prepnUnit; | ||||||
|  |     /** | ||||||
|  |      * 批次号 | ||||||
|  |      */ | ||||||
|  |     private String produceBatchNo; | ||||||
|  |     /** | ||||||
|  |      * 药品标识 | ||||||
|  |      */ | ||||||
|  |     private String prodSeqNo; | ||||||
|  |     /** | ||||||
|  |      * | ||||||
|  |      */ | ||||||
|  |     private String drugEntBaseInfoId; | ||||||
|  |     /** | ||||||
|  |      * 有效期至 | ||||||
|  |      */ | ||||||
|  |     private String validEndDate; | ||||||
|  |     /** | ||||||
|  |      * 按最小包装单位统计数量 | ||||||
|  |      */ | ||||||
|  |     private String leastPkgAmount; | ||||||
|  |     /** | ||||||
|  |      * 按最小制剂单位统计数量 | ||||||
|  |      */ | ||||||
|  |     private String leastPrepnAmount; | ||||||
|  |     /** | ||||||
|  |      * 批准文号 | ||||||
|  |      */ | ||||||
|  |     private String approvalNo; | ||||||
|  |     /** | ||||||
|  |      * 药品类型 | ||||||
|  |      */ | ||||||
|  |     private String physicType; | ||||||
|  |     /** | ||||||
|  |      * 药品类型描述 | ||||||
|  |      */ | ||||||
|  |     private String physicTypeName; | ||||||
|  |     /** | ||||||
|  |      * 制剂单位 | ||||||
|  |      */ | ||||||
|  |     private String preparationsUnit; | ||||||
|  |     /** | ||||||
|  |      * 制剂规格描述 | ||||||
|  |      */ | ||||||
|  |     private String prepnTypeDesc; | ||||||
|  |     /** | ||||||
|  |      * 码信息集合 | ||||||
|  |      */ | ||||||
|  |     private List<AliYljgBillDetailDrugCode> aliYljgBillDetailDrugCodeList; | ||||||
|  |     /** | ||||||
|  |      * 包装单位描述 | ||||||
|  |      */ | ||||||
|  |     private String pkgUnitDesc; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,39 @@ | |||||||
|  | package com.glxp.api.entity.alihealth; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AliYljgBillDetailDrugCode { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 制剂规格 | ||||||
|  |      */ | ||||||
|  |     private String prepnSpec; | ||||||
|  |     /** | ||||||
|  |      * 最小制剂数量 | ||||||
|  |      */ | ||||||
|  |     private String prepnAmount; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 最小包装数量 | ||||||
|  |      */ | ||||||
|  |     private String pkgAmount; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 监管码级别 | ||||||
|  |      */ | ||||||
|  |     private String codeLevel; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 监管码 | ||||||
|  |      */ | ||||||
|  |     private String code; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,130 @@ | |||||||
|  | package com.glxp.api.entity.alihealth; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AliYljgSearchbill { | ||||||
|  |     /** | ||||||
|  |      * 发货单位 | ||||||
|  |      */ | ||||||
|  |     private String fromEntName; | ||||||
|  |     /** | ||||||
|  |      * 最小码量 | ||||||
|  |      */ | ||||||
|  |     private String codeCount; | ||||||
|  |     /** | ||||||
|  |      * 失效日期 | ||||||
|  |      */ | ||||||
|  |     private String exprieDate; | ||||||
|  |     /** | ||||||
|  |      * 厂商 | ||||||
|  |      */ | ||||||
|  |     private String produceEntName; | ||||||
|  |     /** | ||||||
|  |      * 生产日期 | ||||||
|  |      */ | ||||||
|  |     private String produceDate; | ||||||
|  |     /** | ||||||
|  |      * 生产批号 | ||||||
|  |      */ | ||||||
|  |     private String produceBatchNo; | ||||||
|  |     /** | ||||||
|  |      * 包装规格 | ||||||
|  |      */ | ||||||
|  |     private String pkgSpec; | ||||||
|  |     /** | ||||||
|  |      * 药品信息 | ||||||
|  |      */ | ||||||
|  |     private String physicInfo; | ||||||
|  |     /** | ||||||
|  |      * 药品名称 | ||||||
|  |      */ | ||||||
|  |     private String physicName; | ||||||
|  |     /** | ||||||
|  |      * 制剂数量 | ||||||
|  |      */ | ||||||
|  |     private String prepnCount; | ||||||
|  |     /** | ||||||
|  |      * 发货单位REFENTID | ||||||
|  |      */ | ||||||
|  |     private String fromRefUserId; | ||||||
|  |     /** | ||||||
|  |      * 收货单位REFENTID | ||||||
|  |      */ | ||||||
|  |     private String toRefUserId; | ||||||
|  |     /** | ||||||
|  |      * 单据时间 | ||||||
|  |      */ | ||||||
|  |     private String billTime; | ||||||
|  |     /** | ||||||
|  |      * 单据码 | ||||||
|  |      */ | ||||||
|  |     private String billCode; | ||||||
|  |     /** | ||||||
|  |      * 单据类型 | ||||||
|  |      */ | ||||||
|  |     private String billType; | ||||||
|  |     /** | ||||||
|  |      * 发货企业 | ||||||
|  |      */ | ||||||
|  |     private String toUserName; | ||||||
|  |     /** | ||||||
|  |      * 收货企业 | ||||||
|  |      */ | ||||||
|  |     private String fromUserName; | ||||||
|  |     /** | ||||||
|  |      * 失效日期格式化 | ||||||
|  |      */ | ||||||
|  |     private String exprieDateFormat; | ||||||
|  |     /** | ||||||
|  |      * 单据时间格式化 | ||||||
|  |      */ | ||||||
|  |     private String billTimeFormat; | ||||||
|  |     /** | ||||||
|  |      * 单据ID | ||||||
|  |      */ | ||||||
|  |     private String billOutId; | ||||||
|  |     /** | ||||||
|  |      * 制剂单位 | ||||||
|  |      */ | ||||||
|  |     private String prepnUnit; | ||||||
|  |     /** | ||||||
|  |      * 制剂规格 | ||||||
|  |      */ | ||||||
|  |     private String prepnSpec; | ||||||
|  |     /** | ||||||
|  |      * 药品ID | ||||||
|  |      */ | ||||||
|  |     private String drugEntBaseInfoId; | ||||||
|  |     /** | ||||||
|  |      * 生产日期格式化 | ||||||
|  |      */ | ||||||
|  |     private String produceDateFormat; | ||||||
|  |     /** | ||||||
|  |      * 确认状态1未确认2已确认 | ||||||
|  |      */ | ||||||
|  |     private String status; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     private String erpId; | ||||||
|  |     /** | ||||||
|  |      * 创建时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "createTime") | ||||||
|  |     @ApiModelProperty(value = "创建时间") | ||||||
|  |     private Date createTime; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 更新时间 | ||||||
|  |      */ | ||||||
|  |     @TableField(value = "updateTime") | ||||||
|  |     @ApiModelProperty(value = "更新时间") | ||||||
|  |     private Date updateTime; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,14 @@ | |||||||
|  | package com.glxp.api.req.alihealth; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.req.alihealth.local.AlihealthYljgLocaCodedetailReqeust; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthYljgCodedetailReqeust extends AlihealthKytCommonParametersReqeust { | ||||||
|  |     private String ref_ent_id; | ||||||
|  |     private String codes; | ||||||
|  | 
 | ||||||
|  |     public AlihealthYljgCodedetailReqeust(){ | ||||||
|  |         this.setMethod("alibaba.alihealth.drugtrace.top.yljg.query.codedetail"); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,29 @@ | |||||||
|  | package com.glxp.api.req.alihealth; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthYljgListupoutDetailReqeust extends AlihealthKytCommonParametersReqeust { | ||||||
|  |     /** | ||||||
|  |      * 企业ID | ||||||
|  |      */ | ||||||
|  |     private String ref_ent_id; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 单据编码 | ||||||
|  |      */ | ||||||
|  |     private String bill_code; | ||||||
|  |     /** | ||||||
|  |      * 发货企业renEntId | ||||||
|  |      */ | ||||||
|  |     private String from_ref_user_id; | ||||||
|  |     /** | ||||||
|  |      * 收货企业refEntId | ||||||
|  |      */ | ||||||
|  |     private String to_ref_user_id; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public AlihealthYljgListupoutDetailReqeust(){ | ||||||
|  |         this.setMethod("alibaba.alihealth.drugtrace.top.yljg.listupout.detail"); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,14 @@ | |||||||
|  | package com.glxp.api.req.alihealth; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthYljgSinglerelationReqeust extends AlihealthKytCommonParametersReqeust { | ||||||
|  |     private String ref_ent_id; | ||||||
|  |     private String des_ref_ent_id; | ||||||
|  |     private String code; | ||||||
|  |     public AlihealthYljgSinglerelationReqeust(){ | ||||||
|  |         this.setMethod("alibaba.alihealth.drugtrace.top.yljg.query.relation"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,50 @@ | |||||||
|  | package com.glxp.api.req.alihealth; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.req.alihealth.AlihealthKytCommonParametersReqeust; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthYljgUploadinoutbillReqeust extends AlihealthKytCommonParametersReqeust { | ||||||
|  |     private String bill_code; | ||||||
|  |     private String bill_time; | ||||||
|  |     private String bill_type; | ||||||
|  |     private String physic_type; | ||||||
|  |     private String ref_user_id; | ||||||
|  |     private String agent_ref_user_id; | ||||||
|  |     private String from_user_id; | ||||||
|  |     private String to_user_id; | ||||||
|  |     private String dest_user_id; | ||||||
|  |     private String oper_ic_code; | ||||||
|  |     private String oper_ic_name; | ||||||
|  |     private String warehouse_id; | ||||||
|  |     private String drug_id; | ||||||
|  |     private String trace_codes; | ||||||
|  |     private String client_type; | ||||||
|  |     private String return_reason_code; | ||||||
|  |     private String return_reason_des; | ||||||
|  |     private String cancel_reason_code; | ||||||
|  |     private String cancel_reason_des; | ||||||
|  |     private String executer_name; | ||||||
|  |     private String executer_code; | ||||||
|  |     private String superviser_name; | ||||||
|  |     private String superviser_code; | ||||||
|  |     private String from_address; | ||||||
|  |     private String to_address; | ||||||
|  |     private String from_bill_code; | ||||||
|  |     private String order_code; | ||||||
|  |     private String from_person; | ||||||
|  |     private String to_person; | ||||||
|  |     private String dis_ref_ent_id; | ||||||
|  |     private String dis_ent_id; | ||||||
|  |     private String qu_receivable; | ||||||
|  |     private String xt_is_check; | ||||||
|  |     private String xt_check_code; | ||||||
|  |     private String xt_check_code_desc; | ||||||
|  |     private String drug_list_json; | ||||||
|  |     private String ass_ref_ent_id; | ||||||
|  |     private String ass_ent_id; | ||||||
|  | 
 | ||||||
|  |     public AlihealthYljgUploadinoutbillReqeust(){ | ||||||
|  |         this.setMethod("alibaba.alihealth.drugtrace.top.yljg.uploadinoutbill"); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,16 @@ | |||||||
|  | package com.glxp.api.req.alihealth.local; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.req.alihealth.AlihealthKytDrugrescodeReqeust; | ||||||
|  | import com.glxp.api.req.alihealth.AlihealthYljgUploadinoutbillReqeust; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthRelCodeInsertYljgReqeust { | ||||||
|  |     /** | ||||||
|  |      * 往来单位名称 | ||||||
|  |      */ | ||||||
|  |     private String erpId; | ||||||
|  |     private String appSecret; | ||||||
|  | 
 | ||||||
|  |     private AlihealthYljgUploadinoutbillReqeust alihealthYljgUploadinoutbillReqeust; | ||||||
|  | } | ||||||
| @ -0,0 +1,11 @@ | |||||||
|  | package com.glxp.api.req.alihealth.local; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.req.alihealth.AlihealthYljgCodedetailReqeust; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthYljgLocaCodedetailReqeust { | ||||||
|  |     private String erpId; | ||||||
|  |     private String appSecret; | ||||||
|  |     private AlihealthYljgCodedetailReqeust alihealthYljgCodedetailReqeust; | ||||||
|  | } | ||||||
| @ -0,0 +1,12 @@ | |||||||
|  | package com.glxp.api.req.alihealth.local; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.req.alihealth.AlihealthYljgUploadinoutbillReqeust; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthYljgLocalUploadinoutbillReqeust { | ||||||
|  |     private String erpId; | ||||||
|  |     private String appSecret; | ||||||
|  | 
 | ||||||
|  |     private AlihealthYljgUploadinoutbillReqeust alihealthYljgUploadinoutbillReqeust; | ||||||
|  | } | ||||||
| @ -0,0 +1,92 @@ | |||||||
|  | package com.glxp.api.res.alihealth; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.json.JSONArray; | ||||||
|  | import cn.hutool.json.JSONObject; | ||||||
|  | import cn.hutool.json.JSONUtil; | ||||||
|  | import com.glxp.api.entity.collect.RelCodeBatch; | ||||||
|  | import com.glxp.api.util.udi.FilterUdiUtils; | ||||||
|  | import lombok.Data; | ||||||
|  | import org.apache.commons.lang3.StringUtils; | ||||||
|  | import org.springframework.beans.BeanUtils; | ||||||
|  | 
 | ||||||
|  | import java.util.*; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthYljgCodedetailResponse extends AlihealthKytCommonParametersResponse{ | ||||||
|  | 
 | ||||||
|  |     private JSONArray code_full_info_dto; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public AlihealthYljgCodedetailResponse(String json) { | ||||||
|  |         // 初始化请求的值
 | ||||||
|  |         JSONObject jsonObject = JSONUtil.parseObj(json); | ||||||
|  |         JSONObject jsonObjectResult = null; | ||||||
|  |         for (String s : jsonObject.keySet()) { | ||||||
|  |             jsonObjectResult = jsonObject.getJSONObject(s).getJSONObject("result"); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  |         AlihealthKytCommonParametersResponse alihealthKytCommonParametersResponse = JSONUtil.toBean(jsonObjectResult.toString(), | ||||||
|  |                 AlihealthKytCommonParametersResponse.class); | ||||||
|  |         BeanUtils.copyProperties(alihealthKytCommonParametersResponse, this); | ||||||
|  |         if (StringUtils.isNotEmpty(this.getMsg_info()) | ||||||
|  |                 && this.getMsg_info().equals("调用成功") | ||||||
|  |         ) { | ||||||
|  |             this.disposeResult(jsonObjectResult); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void disposeResult(JSONObject jsonObjectResult) { | ||||||
|  |         JSONObject jsonObjectModel = jsonObjectResult.getJSONObject("models"); | ||||||
|  |         if (!Objects.isNull(jsonObjectModel)) { | ||||||
|  |             this.code_full_info_dto = jsonObjectResult.getJSONArray("code_full_info_dto"); | ||||||
|  | 
 | ||||||
|  | //            this.setTotal_num(jsonObjectModel.getInt("total_num"));
 | ||||||
|  | //            this.setBill_up_out_detail_do(jsonObjectModel.getJSONObject("result_list").getJSONArray("bill_up_out_detail_do"));
 | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     public List<RelCodeBatch> disposeRelCodeBatch(String customerId){ | ||||||
|  |         List<RelCodeBatch> relCodeBatchList  =new ArrayList<>(); | ||||||
|  | 
 | ||||||
|  |         List<JSONObject> list  = (List)this.getCode_full_info_dto(); | ||||||
|  |         if(list != null & list.size() >0){ | ||||||
|  |             for (JSONObject jsonObject : list) { | ||||||
|  |                 RelCodeBatch relCodeBatch = new RelCodeBatch(); | ||||||
|  |                 relCodeBatch.setProductCode(FilterUdiUtils.getUdi(jsonObject.getStr("code")).getUdi()); | ||||||
|  | //                relCodeBatch.setSubTypeNo();
 | ||||||
|  | //                relCodeBatch.setCascadeRatio();
 | ||||||
|  |                 relCodeBatch.setPackageSpec(jsonObject.getStr("pkg_spec_crit")); | ||||||
|  | //                relCodeBatch.setComment();
 | ||||||
|  |                 List<JSONObject>  jsonArray =  (List) jsonObject.getJSONObject("code_produce_info_d_t_o").getJSONArray("produce_info_list"); | ||||||
|  |                 JSONObject  produceInfo =jsonArray.get(0); | ||||||
|  |                 relCodeBatch.setBatchNo(produceInfo.getStr("batch_no")); | ||||||
|  |                 relCodeBatch.setMadeDate(produceInfo.getStr("produce_date_str")); | ||||||
|  |                 relCodeBatch.setValidateDate(produceInfo.getStr("expire_date")); | ||||||
|  |                 relCodeBatch.setWorkShop(jsonObject.getJSONObject("p_user_ent_d_t_o").getStr("ent_name")); | ||||||
|  | //                relCodeBatch.setLineName();
 | ||||||
|  | //                relCodeBatch.setLineManager();
 | ||||||
|  | //                relCodeBatch.setCreateTime();
 | ||||||
|  | //                relCodeBatch.setCreateUser();
 | ||||||
|  |                 relCodeBatch.setUpdateTime(new Date()); | ||||||
|  |                 relCodeBatch.setUpdateUser(customerId); | ||||||
|  |                 relCodeBatch.setUploadFlagUp(0); | ||||||
|  |                 relCodeBatch.setUploadFlagDown(0); | ||||||
|  |                 relCodeBatch.setParentCode(null); | ||||||
|  |                 relCodeBatch.setErpId(customerId); | ||||||
|  |                 relCodeBatch.setCurCode(jsonObject.getStr("code")); | ||||||
|  | //                if(jsonObject.getJSONObject("p_user_ent_d_t_o").equals("1")){
 | ||||||
|  | //
 | ||||||
|  | //                }else if(jsonObject.getJSONObject("p_user_ent_d_t_o").equals("2")){
 | ||||||
|  | //
 | ||||||
|  | //                }
 | ||||||
|  |                 relCodeBatch.setOneLevelCount(0); | ||||||
|  |                 relCodeBatch.setTwoLevelCount(0); | ||||||
|  |                 relCodeBatch.setThreeLevelCount(0); | ||||||
|  |                 relCodeBatchList.add(relCodeBatch); | ||||||
|  | 
 | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         return relCodeBatchList; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,79 @@ | |||||||
|  | package com.glxp.api.res.alihealth; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.json.JSONArray; | ||||||
|  | import cn.hutool.json.JSONObject; | ||||||
|  | import cn.hutool.json.JSONUtil; | ||||||
|  | import lombok.Data; | ||||||
|  | import org.apache.commons.lang3.StringUtils; | ||||||
|  | import org.springframework.beans.BeanUtils; | ||||||
|  | 
 | ||||||
|  | import java.util.Objects; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class AlihealthYljgListupoutResponse extends AlihealthKytCommonParametersResponse { | ||||||
|  |     /** | ||||||
|  |      * 单据编码 | ||||||
|  |      */ | ||||||
|  |     private String bill_code; | ||||||
|  |     /** | ||||||
|  |      * 单据类型描述 | ||||||
|  |      */ | ||||||
|  |     private String bill_type_name; | ||||||
|  |     /** | ||||||
|  |      * 单据类型 | ||||||
|  |      */ | ||||||
|  |     private String bill_type; | ||||||
|  |     /** | ||||||
|  |      * 发货企业名称 | ||||||
|  |      */ | ||||||
|  |     private String ent_send_name; | ||||||
|  |     /** | ||||||
|  |      * 收货企业名称 | ||||||
|  |      */ | ||||||
|  |     private String ent_recv_name; | ||||||
|  |     /** | ||||||
|  |      * 收货企业ref_ent_id | ||||||
|  |      */ | ||||||
|  |     private String ent_recv_id; | ||||||
|  |     /** | ||||||
|  |      * 单据日期 | ||||||
|  |      */ | ||||||
|  |     private String store_out_date; | ||||||
|  |     /** | ||||||
|  |      * 最后更新时间 | ||||||
|  |      */ | ||||||
|  |     private String update_date; | ||||||
|  |     private JSONArray drug_infos_dto_list; | ||||||
|  |     public AlihealthYljgListupoutResponse(String json) { | ||||||
|  |         // 初始化请求的值
 | ||||||
|  |         cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(json); | ||||||
|  |         JSONObject jsonObjectResult = null; | ||||||
|  |         for (String s : jsonObject.keySet()) { | ||||||
|  |             jsonObjectResult = jsonObject.getJSONObject(s).getJSONObject("result"); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  |         AlihealthKytCommonParametersResponse alihealthKytCommonParametersResponse = JSONUtil.toBean(jsonObjectResult.toString(), | ||||||
|  |                 AlihealthKytCommonParametersResponse.class); | ||||||
|  |         BeanUtils.copyProperties(alihealthKytCommonParametersResponse, this); | ||||||
|  |         if (StringUtils.isNotEmpty(this.getMsg_info()) | ||||||
|  |                 && this.getMsg_info().equals("调用成功") | ||||||
|  |         ) { | ||||||
|  |             this.disposeResult(jsonObjectResult); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public void disposeResult(JSONObject jsonObjectResult) { | ||||||
|  |         JSONObject jsonObjectModel = jsonObjectResult.getJSONObject("model"); | ||||||
|  |         if (!Objects.isNull(jsonObjectModel)) { | ||||||
|  |             BeanUtils.copyProperties(jsonObjectModel,this); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | //    public void disposeAliKytBillDetail() {
 | ||||||
|  | //        JSONObject jsonObjectModel = jsonObjectResult.getJSONObject("model");
 | ||||||
|  | //        if (!Objects.isNull(jsonObjectModel)) {
 | ||||||
|  | //            this.setTotal_num(jsonObjectModel.getInt("total_num"));
 | ||||||
|  | //            this.setBill_up_out_detail_do(jsonObjectModel.getJSONObject("result_list").getJSONArray("bill_up_out_detail_do"));
 | ||||||
|  | //        }
 | ||||||
|  | //    }
 | ||||||
|  | } | ||||||
| @ -0,0 +1,14 @@ | |||||||
|  | package com.glxp.api.res.alihealth; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.json.JSONObject; | ||||||
|  | import cn.hutool.json.JSONUtil; | ||||||
|  | import org.apache.commons.lang3.StringUtils; | ||||||
|  | import org.springframework.beans.BeanUtils; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | 
 | ||||||
|  | @Resource | ||||||
|  | public class AlihealthYljgUploadinoutbillResponse extends AlihealthKytCommonParametersResponse{ | ||||||
|  |     private String response_success; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,135 @@ | |||||||
|  | package com.glxp.api.util.alihealth; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.http.HttpUtil; | ||||||
|  | import cn.hutool.json.JSONUtil; | ||||||
|  | import com.glxp.api.common.res.BaseResponse; | ||||||
|  | import com.glxp.api.common.util.ResultVOUtils; | ||||||
|  | import com.glxp.api.entity.collect.RelCodeBatch; | ||||||
|  | import com.glxp.api.req.alihealth.*; | ||||||
|  | import com.glxp.api.req.alihealth.local.*; | ||||||
|  | import com.glxp.api.res.alihealth.*; | ||||||
|  | import com.glxp.api.service.auth.CustomerInfoService; | ||||||
|  | import com.glxp.api.service.collect.RelCodeBatchService; | ||||||
|  | import com.glxp.api.service.collect.RelCodeDetailService; | ||||||
|  | import org.springframework.beans.factory.annotation.Value; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | 
 | ||||||
|  | @Component | ||||||
|  | public class AlihealthYljgUtils { | ||||||
|  |     @Resource | ||||||
|  |     private CustomerInfoService customerInfoService; | ||||||
|  |     @Resource | ||||||
|  |     private AlihealthUtils alihealthUtils; | ||||||
|  |     @Resource | ||||||
|  |     private RelCodeDetailService relCodeDetailService; | ||||||
|  |     @Resource | ||||||
|  |     private RelCodeBatchService relCodeBatchService; | ||||||
|  |     @Value("${ALIHEALTH_URL:http://gw.api.taobao.com/router/rest}") | ||||||
|  |     private String alihealthUrl; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 出入库单据上传 | ||||||
|  |      * @param reqeust | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public BaseResponse<AlihealthKytSinglerelationResponse> yljgUploadinoutbill(AlihealthYljgLocalUploadinoutbillReqeust reqeust) { | ||||||
|  |         AlihealthYljgUploadinoutbillResponse alihealthYljgUploadinoutbillResponse = null; | ||||||
|  |         if (reqeust != null | ||||||
|  |                 && org.apache.commons.lang3.StringUtils.isNotEmpty(reqeust.getAppSecret()) | ||||||
|  |                 && org.apache.commons.lang3.StringUtils.isNotEmpty(reqeust.getAppSecret()) | ||||||
|  |         ) { | ||||||
|  |             try { | ||||||
|  |                 Map map = alihealthUtils.disposeSign(reqeust.getAlihealthYljgUploadinoutbillReqeust(), reqeust.getAppSecret()); | ||||||
|  |                 String json = HttpUtil.get(alihealthUrl, map); | ||||||
|  |                  alihealthYljgUploadinoutbillResponse = JSONUtil.toBean(json, AlihealthYljgUploadinoutbillResponse.class); | ||||||
|  | 
 | ||||||
|  |             } catch (Exception e) { | ||||||
|  |                 return ResultVOUtils.error("阿里健康接口调用失败===" + e.getMessage()); | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |         } else { | ||||||
|  |             return ResultVOUtils.error("阿里健康接口调用失败===用户找不到或者key和秘钥为空"); | ||||||
|  |         } | ||||||
|  |         if (alihealthYljgUploadinoutbillResponse.judgeCall()) { | ||||||
|  | 
 | ||||||
|  |             return ResultVOUtils.success(alihealthYljgUploadinoutbillResponse); | ||||||
|  |         } else { | ||||||
|  |             return ResultVOUtils.error("阿里健康接口调用失败===" + alihealthYljgUploadinoutbillResponse.getMsg_info()); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 单码关联关系查询 | ||||||
|  |      * @param reqeust | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public BaseResponse<AlihealthYljgUploadinoutbillReqeust> relCodeInsert(AlihealthRelCodeInsertYljgReqeust reqeust) { | ||||||
|  |         AlihealthYljgListupoutDetailResponse alihealthYljgListupoutDetailResponse = null; | ||||||
|  |         AlihealthYljgUploadinoutbillReqeust alihealthYljgUploadinoutbillReqeust  = reqeust.getAlihealthYljgUploadinoutbillReqeust(); | ||||||
|  |         if (reqeust != null | ||||||
|  |                 && org.apache.commons.lang3.StringUtils.isNotEmpty(alihealthYljgUploadinoutbillReqeust.getApp_key()) | ||||||
|  |                 && org.apache.commons.lang3.StringUtils.isNotEmpty(reqeust.getAppSecret()) | ||||||
|  |         ) { | ||||||
|  |             try { | ||||||
|  | 
 | ||||||
|  |                 Map map = alihealthUtils.disposeSign(alihealthYljgUploadinoutbillReqeust, reqeust.getAppSecret()); | ||||||
|  |                 String json = HttpUtil.get(alihealthUrl, map); | ||||||
|  |                 alihealthYljgListupoutDetailResponse = new AlihealthYljgListupoutDetailResponse(json); | ||||||
|  | 
 | ||||||
|  |             } catch (Exception e) { | ||||||
|  |                 return ResultVOUtils.error("阿里健康接口调用失败===" + e.getMessage()); | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |         } else { | ||||||
|  |             return ResultVOUtils.error("阿里健康接口调用失败===用户找不到或者key和秘钥为空"); | ||||||
|  |         } | ||||||
|  |         if (alihealthYljgListupoutDetailResponse.judgeCall()) { | ||||||
|  | 
 | ||||||
|  |             return ResultVOUtils.success(alihealthYljgListupoutDetailResponse); | ||||||
|  |         } else { | ||||||
|  |             return ResultVOUtils.error("阿里健康接口调用失败===" + alihealthYljgListupoutDetailResponse.getMsg_info()); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 根据码查询码信息 | ||||||
|  |      * @param reqeust | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     public BaseResponse<List<RelCodeBatch>> codedetail(AlihealthYljgLocaCodedetailReqeust reqeust) { | ||||||
|  |         AlihealthYljgCodedetailResponse alihealthYljgCodedetailResponse = null; | ||||||
|  |         AlihealthYljgCodedetailReqeust alihealthYljgCodedetailReqeust  = reqeust.getAlihealthYljgCodedetailReqeust(); | ||||||
|  |         if (reqeust != null | ||||||
|  |                 && org.apache.commons.lang3.StringUtils.isNotEmpty(alihealthYljgCodedetailReqeust.getApp_key()) | ||||||
|  |                 && org.apache.commons.lang3.StringUtils.isNotEmpty(reqeust.getAppSecret()) | ||||||
|  |         ) { | ||||||
|  |             try { | ||||||
|  | 
 | ||||||
|  |                 Map map = alihealthUtils.disposeSign(alihealthYljgCodedetailReqeust, reqeust.getAppSecret()); | ||||||
|  |                 String json = HttpUtil.get(alihealthUrl, map); | ||||||
|  |                 alihealthYljgCodedetailResponse = new AlihealthYljgCodedetailResponse(json); | ||||||
|  | 
 | ||||||
|  |             } catch (Exception e) { | ||||||
|  |                 return ResultVOUtils.error("阿里健康接口调用失败===" + e.getMessage()); | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |         } else { | ||||||
|  |             return ResultVOUtils.error("阿里健康接口调用失败===用户找不到或者key和秘钥为空"); | ||||||
|  |         } | ||||||
|  |         if (alihealthYljgCodedetailResponse.judgeCall()) { | ||||||
|  |             return ResultVOUtils.success( alihealthYljgCodedetailResponse.disposeRelCodeBatch(reqeust.getErpId())); | ||||||
|  |         } else { | ||||||
|  |             return ResultVOUtils.error("阿里健康接口调用失败===" + alihealthYljgCodedetailResponse.getMsg_info()); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in New Issue