dev
This commit is contained in:
parent
2bb5b01136
commit
72ebcc7f03
|
|
@ -65,6 +65,16 @@ public class StatisticsController extends BaseController {
|
|||
PersonPayOverviewVo personPayOverviewVo = statisticsService.getPersonPayOverview(beginTime, endTime);
|
||||
return success(personPayOverviewVo);
|
||||
|
||||
}
|
||||
@RequestMapping("getSalesVolumeOverview")
|
||||
public Result<SalesVolumeOverviewVo> getSalesVolumeOverview() {
|
||||
String begin = parmsUtil.getString("beginTime", "开始时间为空");
|
||||
String end = parmsUtil.getString("endTime", "结束时间为空");
|
||||
LocalDateTime beginTime = DateUtil.getDateTime(begin);
|
||||
LocalDateTime endTime = DateUtil.getDateTime(end);
|
||||
SalesVolumeOverviewVo salesVolumeOverviewVo = statisticsService.getSalesVolumeOverview(beginTime, endTime);
|
||||
return success(salesVolumeOverviewVo);
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/salePerson")
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ public class ChargeDetailVo {
|
|||
|
||||
@ApiModelProperty("病例id")
|
||||
private Integer medicalRecordId;
|
||||
@ApiModelProperty("销售人姓名")
|
||||
private String salePersonName;
|
||||
|
||||
|
||||
@ApiModelProperty("患者姓名")
|
||||
private String patientName;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.syjiaer.clinic.server.entity.statistics;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class SalesVolumeOverviewVo {
|
||||
private List<String> dateList;
|
||||
private List<Long> countList;
|
||||
}
|
||||
|
|
@ -326,6 +326,8 @@ public class ChargeService extends BaseService {
|
|||
ChargeOrder chargeOrder = chargeOrderMapper.selectOne(queryWrapper);
|
||||
ChargeDetailVo detailVo = new ChargeDetailVo();
|
||||
BeanUtils.copyProperties(chargeOrder, detailVo);
|
||||
OrganizationMember organizationMember = organizationMemberMapper.selectById(chargeOrder.getSalePersonId());
|
||||
detailVo.setSalePersonName(organizationMember ==null?null:organizationMember.getName());
|
||||
detailVo.setDiagnosisMedicalRecord(diagnosisMedicalRecordMapper.selectByDiagnosisCode(chargeOrder.getDiagnosisCode()));
|
||||
detailVo.setPatientInfo(patientInfoMapper.selectById(chargeOrder.getPatientId()));
|
||||
detailVo.setServiceDetail(chargeItemListMapper.selectByCode(chargeOrder.getCode()));
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.syjiaer.clinic.server.service.common;
|
|||
|
||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||
import com.syjiaer.clinic.server.service.BaseService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.UrlResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
|
|
@ -17,6 +18,7 @@ import java.nio.file.Path;
|
|||
import java.nio.file.Paths;
|
||||
import java.util.UUID;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class FileService extends BaseService {
|
||||
|
||||
|
|
@ -37,7 +39,7 @@ public class FileService extends BaseService {
|
|||
file.transferTo(new File(filePath));
|
||||
return fileName;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("文件上传失败", e);
|
||||
throw new MessageException("文件上传失败:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -262,4 +262,30 @@ public class StatisticsService extends BaseService {
|
|||
|
||||
return goodsStatistics;
|
||||
}
|
||||
/*
|
||||
统计人次
|
||||
*/
|
||||
public SalesVolumeOverviewVo getSalesVolumeOverview(LocalDateTime beginTime, LocalDateTime endTime) {
|
||||
|
||||
QueryWrapper<ChargeOrder> commonQuery = new QueryWrapper<>();
|
||||
commonQuery.select("create_date,count(1) as count");
|
||||
commonQuery.ge("pay_time", beginTime);
|
||||
commonQuery.le("pay_time", endTime);
|
||||
|
||||
commonQuery.groupBy("create_date");
|
||||
commonQuery.orderByAsc("create_date");
|
||||
List<Map<String, Object>> commonMaps = chargeOrderMapper.selectMaps(commonQuery);
|
||||
List<LocalDate> dateList = DateUtil.getDatesBetween(beginTime, endTime);
|
||||
Map<Object, Long> tempMap = new TreeMap<>();
|
||||
for (LocalDate date : dateList) {
|
||||
tempMap.put(date.toString(), 0L);
|
||||
}
|
||||
SalesVolumeOverviewVo vo = new SalesVolumeOverviewVo();
|
||||
vo.setDateList(dateList.stream().map(LocalDate::toString).toList());
|
||||
for (Map<String, Object> map : commonMaps) {
|
||||
tempMap.put(map.get("create_date").toString(), (Long) map.get("count"));
|
||||
}
|
||||
vo.setCountList(new ArrayList<>(tempMap.values()));
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue