|
@ -1,13 +1,14 @@
|
|
|
package com.yihu.jw.org.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.jw.entity.base.org.BaseOrgDO;
|
|
|
import com.yihu.jw.org.dao.BaseOrgDao;
|
|
|
import com.yihu.jw.utils.StringUtil;
|
|
|
import com.yihu.mysql.query.BaseJpaService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Service
|
|
@ -27,4 +28,27 @@ public class BaseOrgInfoService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
|
|
|
return baseOrgDao.findByCode(orgCode);
|
|
|
}
|
|
|
|
|
|
//新增或修改医院
|
|
|
public void addOrg(String jsonData){
|
|
|
JSONObject json = JSON.parseObject(jsonData);
|
|
|
String code = json.getString("code");
|
|
|
String name = json.getString("name");
|
|
|
String linkUrl = json.getString("linkUrl");
|
|
|
String photo = json.getString("photo");
|
|
|
|
|
|
BaseOrgDO orgDO = baseOrgDao.findByCode(code);
|
|
|
if(orgDO==null){
|
|
|
orgDO = new BaseOrgDO();
|
|
|
orgDO.setCreateTime(new Date());
|
|
|
orgDO.setCode(code);
|
|
|
orgDO.setName(name);
|
|
|
orgDO.setType("1");
|
|
|
orgDO.setDel("1");
|
|
|
orgDO.setOrgLevel(1);
|
|
|
orgDO.setWinNo("-1");
|
|
|
}
|
|
|
orgDO.setOrgUrl(linkUrl);
|
|
|
orgDO.setPhoto(photo);
|
|
|
baseOrgDao.save(orgDO);
|
|
|
}
|
|
|
}
|