Ver código fonte

药品字典

chenjiasheng 3 anos atrás
pai
commit
73617f4900

+ 38 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/a1entity/Mediicinedrugs.java

@ -13,6 +13,44 @@ import java.io.Serializable;
public class Mediicinedrugs extends UuidIdentityEntityWithOperator implements Serializable {
    @Override
    public String toString() {
        return "Mediicinedrugs{" +
                "state='" + state + '\'' +
                ", drugName='" + drugName + '\'' +
                ", barcode='" + barcode + '\'' +
                ", drugCode='" + drugCode + '\'' +
                ", drugShortCode='" + drugShortCode + '\'' +
                ", drugClass='" + drugClass + '\'' +
                ", earlywarningcate='" + earlywarningcate + '\'' +
                ", medCabinet='" + medCabinet + '\'' +
                ", pic='" + pic + '\'' +
                ", drugNameAlies='" + drugNameAlies + '\'' +
                ", drugBarCode='" + drugBarCode + '\'' +
                ", drugClassCode='" + drugClassCode + '\'' +
                ", dosForm='" + dosForm + '\'' +
                ", drugTypeCode='" + drugTypeCode + '\'' +
                ", unit='" + unit + '\'' +
                ", price=" + price +
                ", inventory='" + inventory + '\'' +
                ", saleVolume='" + saleVolume + '\'' +
                ", selfCode='" + selfCode + '\'' +
                ", specif='" + specif + '\'' +
                ", manufactor='" + manufactor + '\'' +
                ", approvalNum='" + approvalNum + '\'' +
                ", brand='" + brand + '\'' +
                ", drugSku='" + drugSku + '\'' +
                ", drugNum=" + drugNum +
                ", useNum=" + useNum +
                ", useWay='" + useWay + '\'' +
                ", useRate='" + useRate + '\'' +
                ", useDose='" + useDose + '\'' +
                ", useWayAdd='" + useWayAdd + '\'' +
                ", orgCode='" + orgCode + '\'' +
                ", orgName='" + orgName + '\'' +
                '}';
    }
    /**
     * 状态
     */

+ 37 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineEndpoint.java

@ -0,0 +1,37 @@
package com.yihu.jw.base.endpoint.a4endpoint;
import com.yihu.jw.base.service.a3service.MedicineServive;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@Api(description = "获取同步信息")
@RestController
public class MedicineEndpoint extends EnvelopRestEndpoint {
    @Autowired
    MedicineServive servive;
    @ApiOperation( value = "获取药品字典")
    @GetMapping("wlyygc/webHospital/getOrgPhysicDict")
    @ResponseBody
    public Envelop getOrgPhysicDict(@ApiParam(value ="orgCode",name = "orgCode",required = false)
                                   @RequestParam(value = "orgCode",required = false)String orgCode,
                                    @ApiParam(value = "name",name = "name",required = false)
                                   @RequestParam(value = "name",required = false)String name,
                                    @ApiParam(value = "orgName",name = "orgName",required = false)
                                   @RequestParam(value = "orgName",required = false)String orgName,
                                    @ApiParam(value = "physicCode",name = "physicCode",required = false)
                                   @RequestParam(value = "physicCode",required = false)String physicCode){
        servive.getOrgPhysicDict(orgCode, name, orgName, physicCode);
        return success("同步药品字典成功",200);
    }
}

+ 13 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineServive.java

@ -25,10 +25,19 @@ public class MedicineServive {
    private MediicinedrugsDao mediicinedrugsDao;
    public void getOrgPhysicDict(String jsonData){
    public void getOrgPhysicDict(String orgCode,String name,String orgName,String physicCode){
        String param="";
        if (StringUtils.isNoneBlank(jsonData)){
            param="?jsonData="+jsonData;
        if (StringUtils.isNoneBlank(orgCode)){
            param="?orgCode="+orgCode;
        }
        if (StringUtils.isNoneBlank(name)){
            param+="?name="+name;
        }
        if (StringUtils.isNoneBlank(orgName)){
            param+="?orgName"+orgName;
        }
        if (StringUtils.isNoneBlank(physicCode)){
            param+="?physicCode"+physicCode;
        }
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getOrgPhysicDict",param);
        if(re!=null){
@ -49,7 +58,7 @@ public class MedicineServive {
                        org.setUnit(h.getString("dose_unit"));
                        org.setUseDose(h.getString("min_dose"));
                        org.setOrgCode(h.getString("orgCode"));
                        mediicinedrugsDao.save(org);
                        Mediicinedrugs mediicinedrugs=mediicinedrugsDao.save(org);
                        addCount++;
                    }else{
                        Mediicinedrugs org = mediicinedrugsDao.findByDrugCode(drugCode);