|
@ -15,7 +15,6 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
|
|
|
import com.yihu.jw.entity.base.team.BaseTeamDO;
|
|
|
import com.yihu.jw.entity.base.team.BaseTeamMemberDO;
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
@ -294,117 +293,7 @@ public class MedicineDrugsService extends BaseJpaService<Mediicinedrugs, Mediici
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public MixEnvelop queryDrugListFullInfo2(String state, String content, String drugClass,
|
|
|
String drugType, String lowVolume, String heightVolume,
|
|
|
String lowPrice, String heightPrice, int page, int size,String wechatId) {
|
|
|
String sql ="";
|
|
|
|
|
|
{
|
|
|
sql += "SELECT\n" +
|
|
|
" t.id as id,\n" +
|
|
|
" t.approval_num as approvalNum,\n" +
|
|
|
" t.barcode as barcode,\n" +
|
|
|
" t.brand as brand,\n" +
|
|
|
" t.dos_form as dosForm,\n" +
|
|
|
" t.state as state,\n" +
|
|
|
" t.drug_bar_code as drugBarCode,\n" +
|
|
|
" t.drug_class as drugClass,\n" +
|
|
|
" t.drug_class_code as drugClassCode,\n" +
|
|
|
" t.drug_code as drugCode,\n" +
|
|
|
" t.drug_name as drugName,\n" +
|
|
|
" t.drug_name_alies as drugNameAlies,\n" +
|
|
|
" t.drug_short_code as drugShortCode,\n" +
|
|
|
" t.drug_type_code as drugTypeCode,\n" +
|
|
|
" t.earlywarningcate as earlywarningcate,\n" +
|
|
|
" t.inventory as inventory,\n" +
|
|
|
" t.manufactor as manufactor,\n" +
|
|
|
" t.med_cabinet as medCabinet,\n" +
|
|
|
" t.pic as pic,\n" +
|
|
|
" t.price as price,\n" +
|
|
|
" t.sale_volume as saleVolume,\n" +
|
|
|
" t.self_code as selfCode,\n" +
|
|
|
" t.specif as specif,\n" +
|
|
|
" t.unit as unit,\n" +
|
|
|
" t.create_time as createTime,\n" +
|
|
|
" t.create_user as createUser,\n" +
|
|
|
" t.create_user_name as createUserName,\n" +
|
|
|
" t.update_time as updateTime,\n" +
|
|
|
" t.update_user as updateUser,\n" +
|
|
|
" t.update_user_name as updateUserName,\n" +
|
|
|
" t.drug_sku as drugSku,\n" +
|
|
|
" t.drug_num as drugNum,\n" +
|
|
|
" t.use_num as useNum,\n" +
|
|
|
" t.use_way as useWay,\n" +
|
|
|
" t.use_rate as useRate,\n" +
|
|
|
" t.use_dose as useDose,\n" +
|
|
|
" t.use_way_add as useWayAdd,\n" +
|
|
|
" t.org_code as orgCode,\n" +
|
|
|
" t.org_name as orgName,\n" +
|
|
|
" t.quantity_unit as quantityUnit,\n" +
|
|
|
" t.pack_unit as packUnit\n" +
|
|
|
"FROM\n" +
|
|
|
" t_mediicine_drugs AS t where 1=1";
|
|
|
}
|
|
|
|
|
|
String conditionSql = "";
|
|
|
if (!StringUtils.isEmpty(state)){
|
|
|
conditionSql += " and t.state = '" + state + "'";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(content)){
|
|
|
conditionSql += " and CONCAT(t.drug_code, t.drug_bar_code, drug_name, t.drug_short_code) like '%"+content+"%'";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(drugClass)){
|
|
|
conditionSql += " and t.drug_class_code = '" + drugClass + "'";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(drugType)){
|
|
|
conditionSql += " and t.drug_type_code = '" + drugType + "'";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(lowVolume)){
|
|
|
conditionSql += " and t.sale_volume >= " + lowVolume;
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(heightVolume)) {
|
|
|
conditionSql += " and t.sale_volume <= " + heightVolume;
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(lowPrice)){
|
|
|
conditionSql += " and t.price >= " + lowPrice;
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(heightPrice)) {
|
|
|
conditionSql += " and t.price <= " + heightPrice;
|
|
|
}
|
|
|
sql = sql + conditionSql;
|
|
|
|
|
|
List<Map<String,Object>> list=null;
|
|
|
list = hibenateUtils.createSQLQuery(sql,page,size);
|
|
|
|
|
|
String countSql = " select " +
|
|
|
" COUNT(DISTINCT (t.id)) as count " +
|
|
|
" from " +
|
|
|
" t_mediicine_drugs t " +
|
|
|
" where " +
|
|
|
" 1=1 " +
|
|
|
conditionSql;
|
|
|
Logger.getAnonymousLogger().info("finalCountSql="+countSql);
|
|
|
int count = jdbcTemplate.queryForObject(countSql,Integer.class);
|
|
|
for (Map<String,Object> stringObjectMap:list){
|
|
|
if (stringObjectMap.get("state") != null) {
|
|
|
if (!StringUtils.isEmpty(stringObjectMap.get("state").toString())) {
|
|
|
if ("1".equals(stringObjectMap.get("state").toString())) {
|
|
|
stringObjectMap.put("stateName", "已上架");
|
|
|
}
|
|
|
if ("2".equals(stringObjectMap.get("state").toString())) {
|
|
|
stringObjectMap.put("stateName", "已下架");
|
|
|
}
|
|
|
if ("3".equals(stringObjectMap.get("state").toString())) {
|
|
|
stringObjectMap.put("stateName", "处方");
|
|
|
}
|
|
|
if ("4".equals(stringObjectMap.get("state").toString())) {
|
|
|
stringObjectMap.put("stateName", "非处方");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return MixEnvelop.getSuccessListWithPage2(BaseHospitalRequestMapping.Prescription.api_success, list);
|
|
|
}
|
|
|
|
|
|
public void pushListWrite(OutputStream os, List<Map<String, Object>> ls) throws Exception {
|
|
|
WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
|
|
@ -490,7 +379,122 @@ public class MedicineDrugsService extends BaseJpaService<Mediicinedrugs, Mediici
|
|
|
}
|
|
|
|
|
|
|
|
|
public void getOrgPhysicDict(String jsonData) {
|
|
|
public MixEnvelop queryDrugListFullInfo2(String state, String content, String drugClass,
|
|
|
String drugType, String lowVolume, String heightVolume,
|
|
|
String lowPrice, String heightPrice, int page, int size, String wechatId) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
/*String orgCodeVale = null == orgCode ? "" : orgCode;
|
|
|
String del = null == docStatus ? "" : docStatus;
|
|
|
String nameOrIdcardValue = null == nameOrIdcard ? "" : "%" + nameOrIdcard + "%";
|
|
|
int start = 0 == page ? page++ : (page - 1) * size;
|
|
|
int end = 0 == size ? 15 : page * size;*/
|
|
|
String sql = "SELECT\n" +
|
|
|
" t.id as id,\n" +
|
|
|
" t.approval_num as approvalNum,\n" +
|
|
|
" t.barcode as barcode,\n" +
|
|
|
" t.brand as brand,\n" +
|
|
|
" t.dos_form as dosForm,\n" +
|
|
|
" t.state as state,\n" +
|
|
|
" t.drug_bar_code as drugBarCode,\n" +
|
|
|
" t.drug_class as drugClass,\n" +
|
|
|
" t.drug_class_code as drugClassCode,\n" +
|
|
|
" t.drug_code as drugCode,\n" +
|
|
|
" t.drug_name as drugName,\n" +
|
|
|
" t.drug_name_alies as drugNameAlies,\n" +
|
|
|
" t.drug_short_code as drugShortCode,\n" +
|
|
|
" t.drug_type_code as drugTypeCode,\n" +
|
|
|
" t.earlywarningcate as earlywarningcate,\n" +
|
|
|
" t.inventory as inventory,\n" +
|
|
|
" t.manufactor as manufactor,\n" +
|
|
|
" t.med_cabinet as medCabinet,\n" +
|
|
|
" t.pic as pic,\n" +
|
|
|
" t.price as price,\n" +
|
|
|
" t.sale_volume as saleVolume,\n" +
|
|
|
" t.self_code as selfCode,\n" +
|
|
|
" t.specif as specif,\n" +
|
|
|
" t.unit as unit,\n" +
|
|
|
" t.create_time as createTime,\n" +
|
|
|
" t.create_user as createUser,\n" +
|
|
|
" t.create_user_name as createUserName,\n" +
|
|
|
" t.update_time as updateTime,\n" +
|
|
|
" t.update_user as updateUser,\n" +
|
|
|
" t.update_user_name as updateUserName,\n" +
|
|
|
" t.drug_sku as drugSku,\n" +
|
|
|
" t.drug_num as drugNum,\n" +
|
|
|
" t.use_num as useNum,\n" +
|
|
|
" t.use_way as useWay,\n" +
|
|
|
" t.use_rate as useRate,\n" +
|
|
|
" t.use_dose as useDose,\n" +
|
|
|
" t.use_way_add as useWayAdd,\n" +
|
|
|
" t.org_code as orgCode,\n" +
|
|
|
" t.org_name as orgName,\n" +
|
|
|
" t.quantity_unit as quantityUnit,\n" +
|
|
|
" t.pack_unit as packUnit\n" +
|
|
|
"FROM\n" +
|
|
|
" t_mediicine_drugs AS t where 1=1";
|
|
|
|
|
|
String conditionSql = "";
|
|
|
if (!StringUtils.isEmpty(state)){
|
|
|
conditionSql += " and t.state = '" + state + "'";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(content)){
|
|
|
conditionSql += " and CONCAT(t.drug_code, t.drug_bar_code, drug_name, t.drug_short_code) like '%"+content+"%'";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(drugClass)){
|
|
|
conditionSql += " and t.drug_class_code = '" + drugClass + "'";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(drugType)){
|
|
|
conditionSql += " and t.drug_type_code = '" + drugType + "'";
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(lowVolume)){
|
|
|
conditionSql += " and t.sale_volume >= " + lowVolume;
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(heightVolume)) {
|
|
|
conditionSql += " and t.sale_volume <= " + heightVolume;
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(lowPrice)){
|
|
|
conditionSql += " and t.price >= " + lowPrice;
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(heightPrice)) {
|
|
|
conditionSql += " and t.price <= " + heightPrice;
|
|
|
}
|
|
|
sql = sql + conditionSql;
|
|
|
|
|
|
List<Map<String,Object>> list=null;
|
|
|
list = hibenateUtils.createSQLQuery(sql,page,size);
|
|
|
|
|
|
String countSql = " select " +
|
|
|
" COUNT(DISTINCT (t.id)) as count " +
|
|
|
" from " +
|
|
|
" t_mediicine_drugs t " +
|
|
|
" where " +
|
|
|
" 1=1 " +
|
|
|
conditionSql;
|
|
|
Logger.getAnonymousLogger().info("finalCountSql="+countSql);
|
|
|
int count = jdbcTemplate.queryForObject(countSql,Integer.class);
|
|
|
for (Map<String,Object> stringObjectMap:list){
|
|
|
if (stringObjectMap.get("state") != null) {
|
|
|
if (!StringUtils.isEmpty(stringObjectMap.get("state").toString())) {
|
|
|
if ("1".equals(stringObjectMap.get("state").toString())) {
|
|
|
stringObjectMap.put("stateName", "已上架");
|
|
|
}
|
|
|
if ("2".equals(stringObjectMap.get("state").toString())) {
|
|
|
stringObjectMap.put("stateName", "已下架");
|
|
|
}
|
|
|
if ("3".equals(stringObjectMap.get("state").toString())) {
|
|
|
stringObjectMap.put("stateName", "处方");
|
|
|
}
|
|
|
if ("4".equals(stringObjectMap.get("state").toString())) {
|
|
|
stringObjectMap.put("stateName", "非处方");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Map<String,Object> map=new HashMap<>();
|
|
|
map.put("count",count);
|
|
|
list.add(map);
|
|
|
// result.put("count", count);
|
|
|
// result.put("msg", JavaBeanUtils.getInstance().mapListJson(list));
|
|
|
return MixEnvelop.getSuccessListWithPage2(BaseHospitalRequestMapping.Prescription.api_success,list);
|
|
|
}
|
|
|
}
|