|
@ -5471,8 +5471,11 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
String orderConditionSql = "";
|
|
String orderConditionSql = "";
|
|
if ("replenisher".equals(role.getCode())) {
|
|
if ("replenisher".equals(role.getCode())) {
|
|
deviceIds = mediicineDeviceUserDao.getdevicesbyuserid(userId, "1");
|
|
deviceIds = mediicineDeviceUserDao.getdevicesbyuserid(userId, "1");
|
|
conditionSql = "AND ',"+ String.join(",", deviceIds) +",' LIKE CONCAT('%,',d.id,',%')\n";
|
|
|
|
orderConditionSql = "AND ',"+ String.join(",", deviceIds) +",' LIKE CONCAT('%,',d.shipping_equ,',%')\n";
|
|
|
|
|
|
orderConditionSql = " and d.belong_community IN(SELECT t.hospital AS community" +
|
|
|
|
" FROM wlyy_user_area AS t WHERE t.user_id = '" + userId + "' AND t.del = 1) ";
|
|
|
|
conditionSql = " AND ',"+ String.join(",", deviceIds) +",' LIKE CONCAT('%,',d.id,',%')\n";
|
|
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
String belongCommunitys = "";
|
|
String belongCommunitys = "";
|
|
String tempSql = "";
|
|
String tempSql = "";
|
|
@ -5509,6 +5512,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
"t.user_id = '" + userId + "'\n" +
|
|
"t.user_id = '" + userId + "'\n" +
|
|
"AND t.del = 1";
|
|
"AND t.del = 1";
|
|
}
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(tempSql);
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(tempSql);
|
|
for (Map<String, Object> stringObjectMap : list) {
|
|
for (Map<String, Object> stringObjectMap : list) {
|
|
if (stringObjectMap.get("community") != null && !StringUtils.isEmpty(stringObjectMap.get("community").toString())) {
|
|
if (stringObjectMap.get("community") != null && !StringUtils.isEmpty(stringObjectMap.get("community").toString())) {
|
|
@ -5526,7 +5530,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
conditionSql += "AND d.belong_community IS NOT NULL\n";
|
|
|
|
|
|
conditionSql += " AND d.belong_community IS NOT NULL\n";
|
|
String areaCondition = "";
|
|
String areaCondition = "";
|
|
if (level!=null){
|
|
if (level!=null){
|
|
if(level==1){
|
|
if(level==1){
|
|
@ -5600,8 +5604,9 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
maintain.put("noOnlineTotal1WithUserId", noOnlineTotal1WithUserId);
|
|
maintain.put("noOnlineTotal1WithUserId", noOnlineTotal1WithUserId);
|
|
//温湿度预警数
|
|
//温湿度预警数
|
|
maintain.put("hcWaringTotalNum", hcWaringTotalNum);
|
|
maintain.put("hcWaringTotalNum", hcWaringTotalNum);
|
|
|
|
|
|
//未取药
|
|
//未取药
|
|
String noGetDrugSql = "SELECT COUNT(1) as \"count\" FROM t_mediicine_order d WHERE d.sell_state=0 \n" + orderConditionSql+areaCondition;
|
|
|
|
|
|
String noGetDrugSql = "SELECT COUNT(1) as \"count\" FROM t_mediicine_order d WHERE d.sell_state=0 \n" +orderConditionSql+areaCondition;
|
|
Map<String,Object> noGetDrugMap = jdbcTemplate.queryForMap(noGetDrugSql);
|
|
Map<String,Object> noGetDrugMap = jdbcTemplate.queryForMap(noGetDrugSql);
|
|
Integer noGetDrugNum = 0;
|
|
Integer noGetDrugNum = 0;
|
|
if (noGetDrugMap!=null){
|
|
if (noGetDrugMap!=null){
|
|
@ -5637,7 +5642,13 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
List<String> deviceIds = null;
|
|
List<String> deviceIds = null;
|
|
if ("replenisher".equals(role.getCode())) {
|
|
if ("replenisher".equals(role.getCode())) {
|
|
deviceIds = mediicineDeviceUserDao.getdevicesbyuserid(userId, "1");
|
|
deviceIds = mediicineDeviceUserDao.getdevicesbyuserid(userId, "1");
|
|
condition = "AND ',"+ String.join(",", deviceIds) +",' LIKE CONCAT('%,',o.shipping_equ,',%')\n";
|
|
|
|
|
|
String ids ="";
|
|
|
|
for (int i=0;i<deviceIds.size();i++){
|
|
|
|
Mediicinedevice mediicinedevice = deviceDao.findOne(deviceIds.get(i));
|
|
|
|
ids +="'"+mediicinedevice.getEquNum()+"',";
|
|
|
|
}
|
|
|
|
ids = ids.substring(0,ids.length()-1);
|
|
|
|
condition = " AND o.shipping_equ IN ("+ids+")";
|
|
} else {
|
|
} else {
|
|
String belongCommunitys = "";
|
|
String belongCommunitys = "";
|
|
String tempSql = "";
|
|
String tempSql = "";
|
|
@ -5789,7 +5800,13 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
List<String> deviceIds = null;
|
|
List<String> deviceIds = null;
|
|
if ("replenisher".equals(role.getCode())) {
|
|
if ("replenisher".equals(role.getCode())) {
|
|
deviceIds = mediicineDeviceUserDao.getdevicesbyuserid(userId, "1");
|
|
deviceIds = mediicineDeviceUserDao.getdevicesbyuserid(userId, "1");
|
|
condition = "AND ',"+ String.join(",", deviceIds) +",' LIKE CONCAT('%,',o.shipping_equ,',%')\n";
|
|
|
|
|
|
String ids ="";
|
|
|
|
for (int i=0;i<deviceIds.size();i++){
|
|
|
|
Mediicinedevice mediicinedevice = deviceDao.findOne(deviceIds.get(i));
|
|
|
|
ids +="'"+mediicinedevice.getEquNum()+"',";
|
|
|
|
}
|
|
|
|
ids = ids.substring(0,ids.length()-1);
|
|
|
|
condition = " AND o.shipping_equ IN ("+ids+")";
|
|
} else {
|
|
} else {
|
|
String belongCommunitys = "";
|
|
String belongCommunitys = "";
|
|
String tempSql = "";
|
|
String tempSql = "";
|
|
@ -5907,7 +5924,13 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
String oorderConditionSql = "";
|
|
String oorderConditionSql = "";
|
|
if ("replenisher".equals(role.getCode())) {
|
|
if ("replenisher".equals(role.getCode())) {
|
|
deviceIds = mediicineDeviceUserDao.getdevicesbyuserid(userId, "1");
|
|
deviceIds = mediicineDeviceUserDao.getdevicesbyuserid(userId, "1");
|
|
condition = "AND ',"+ String.join(",", deviceIds) +",' LIKE CONCAT('%,',o.shipping_equ,',%')\n";
|
|
|
|
|
|
String ids ="";
|
|
|
|
for (int i=0;i<deviceIds.size();i++){
|
|
|
|
Mediicinedevice mediicinedevice = deviceDao.findOne(deviceIds.get(i));
|
|
|
|
ids +="'"+mediicinedevice.getEquNum()+"',";
|
|
|
|
}
|
|
|
|
ids = ids.substring(0,ids.length()-1);
|
|
|
|
condition = " AND o.shipping_equ IN ("+ids+")";
|
|
} else {
|
|
} else {
|
|
String belongCommunitys = "";
|
|
String belongCommunitys = "";
|
|
String tempSql = "";
|
|
String tempSql = "";
|