|
@ -6313,11 +6313,11 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
|
|
|
jsonObject.put("maintain", maintain);
|
|
|
|
|
|
jsonObject.put("prescriptionStatics", getPrescriptionStaticsByUserId(userId, 1,level,area));
|
|
|
jsonObject.put("prescriptionStatics", getPrescriptionStaticsByUserId(userId, 1,null,null,level,area));
|
|
|
//非设备管理员
|
|
|
if (!"replenisher".equals(role.getCode())) {
|
|
|
jsonObject.put("devicePriceStatistics", getDevicePriceStatisticsByUserId(userId, 1,level,area));
|
|
|
jsonObject.put("shippingType", getShippingTypeByUserId(userId, 1,level,area));
|
|
|
jsonObject.put("shippingType", getShippingTypeByUserId(userId, 1,null,null,level,area));
|
|
|
}
|
|
|
result.put("response",ConstantUtils.SUCCESS);
|
|
|
result.put("msg", jsonObject);
|
|
@ -6481,7 +6481,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
* @param userId
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getShippingTypeByUserId(String userId,Integer day,Integer level,String area){
|
|
|
public JSONObject getShippingTypeByUserId(String userId,Integer day,String startTime,String endTime,Integer level,String area){
|
|
|
JSONObject object = new JSONObject();
|
|
|
String condition = "";
|
|
|
String areaCondition = "";
|
|
@ -6571,9 +6571,17 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
} else {
|
|
|
startDate = DateUtil.getPreDays(new Date(), -day);
|
|
|
}
|
|
|
String endTime = DateUtil.getStringDate();
|
|
|
endTime = DateUtil.getStringDate();
|
|
|
timeCondition = " and o.shipping_time >='" + DateUtil.dateToStrLong(startDate) + "' and o.shipping_time <= '" + endTime + "' ";
|
|
|
}
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(startTime)){
|
|
|
timeCondition = " and o.create_time >='" + startTime + "' ";
|
|
|
}
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(endTime)){
|
|
|
timeCondition += " and o.create_time <= '" + endTime + "' ";
|
|
|
}
|
|
|
|
|
|
|
|
|
String sql = "SELECT count(1) as \"count\" FROM t_mediicine_order o WHERE o.sell_state=1 "+condition+ timeCondition+ areaCondition;
|
|
|
Map<String,Object> totalMap = jdbcTemplate.queryForMap(sql);
|
|
|
int total =0;
|
|
@ -6616,7 +6624,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
* @param day
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getPrescriptionStaticsByUserId(String userId,Integer day,Integer level,String area){
|
|
|
public JSONObject getPrescriptionStaticsByUserId(String userId,Integer day,String startTime,String endTime,Integer level,String area){
|
|
|
JSONObject object = new JSONObject();
|
|
|
String condition = "";
|
|
|
UserDO user = userDao.findOne(userId);
|
|
@ -6706,9 +6714,17 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
} else {
|
|
|
startDate = DateUtil.getPreDays(new Date(), -day);
|
|
|
}
|
|
|
String endTime = DateUtil.getStringDate();
|
|
|
endTime = DateUtil.getStringDate();
|
|
|
timeCondition = " and o.create_time >='" + DateUtil.dateToStrLong(startDate) + "' and o.create_time <= '" + endTime + "' ";
|
|
|
}
|
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(startTime)){
|
|
|
timeCondition = " and o.create_time >='" + startTime + "' ";
|
|
|
}
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(endTime)){
|
|
|
timeCondition += " and o.create_time <= '" + endTime + "' ";
|
|
|
}
|
|
|
|
|
|
String sql = "SELECT count(1) as \"count\" FROM t_mediicine_order o WHERE 1=1 "+condition+ timeCondition+areaCondition;
|
|
|
Map<String,Object> totalMap = jdbcTemplate.queryForMap(sql);
|
|
|
int total =0;
|