大屏统计修改
This commit is contained in:
parent
d75ccfe889
commit
e83235e955
|
@ -17,7 +17,7 @@ import java.util.Date;
|
|||
@Data
|
||||
public class SysUser extends BaseEntity {
|
||||
|
||||
public static final String DEFAULT_PASSWORD = "Aqpx123456";
|
||||
public static final String DEFAULT_PASSWORD = "123456";
|
||||
|
||||
/** 用户ID **/
|
||||
@TableId(type = IdType.AUTO)
|
||||
|
|
|
@ -5,7 +5,6 @@ import com.org.utils.AjaxResult;
|
|||
import com.org.web.data.service.DataService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -19,7 +18,7 @@ public class DataController extends BaseController {
|
|||
DataService dataService;
|
||||
|
||||
@PostMapping("/statistics")
|
||||
@PreAuthorize("@ss.hasPermi('data:statistics')")
|
||||
// @PreAuthorize("@ss.hasPermi('data:statistics')")
|
||||
public AjaxResult statistics() {
|
||||
return AjaxResult.success(dataService.queryDataStatistics());
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ public interface DataMapper extends BaseMapper<BcPersonSupport> {
|
|||
|
||||
|
||||
// 房源入住情况
|
||||
@Select("select '床位' as name, " +
|
||||
@Select("select '供养床位' as name, " +
|
||||
" (select count(1) " +
|
||||
" from bc_room_bed a " +
|
||||
" left join bc_room b on a.room_id = b.id " +
|
||||
|
@ -236,7 +236,7 @@ public interface DataMapper extends BaseMapper<BcPersonSupport> {
|
|||
|
||||
"union " +
|
||||
|
||||
"select '房间' as name, " +
|
||||
"select '供养房间' as name, " +
|
||||
" (select count(1) " +
|
||||
" from bc_room " +
|
||||
" where is_delete = 0 " +
|
||||
|
|
|
@ -38,7 +38,21 @@ public class DataService extends ServiceImpl<DataMapper, BcPersonSupport> {
|
|||
|
||||
List<DataStatisticsItem> villageRankList = baseMapper.listVillageRank();
|
||||
|
||||
// 修改value总数->剩余数
|
||||
List<DataStatisticsItem> roomCountList = baseMapper.listRoomCount();
|
||||
|
||||
// 供养床位
|
||||
DataStatisticsItem gycw = new DataStatisticsItem();
|
||||
if (roomCountList != null && !roomCountList.isEmpty()) {
|
||||
gycw.setName("供养床位");
|
||||
gycw.setId(1);
|
||||
gycw.setValue(roomCountList.get(0).getValue()); // 床位总数
|
||||
}
|
||||
|
||||
for (DataStatisticsItem item : roomCountList) {
|
||||
item.setValue(item.getValue() - item.getValue2());
|
||||
}
|
||||
|
||||
List<DataStatisticsItem> roomTypeList = baseMapper.listRoomType();
|
||||
|
||||
List<DataStatisticsItem> villageCountList = baseMapper.listVillageCount();
|
||||
|
@ -61,6 +75,8 @@ public class DataService extends ServiceImpl<DataMapper, BcPersonSupport> {
|
|||
|
||||
|
||||
dataStatistics.setRoomCountList(roomCountList);
|
||||
|
||||
roomTypeList.add(gycw);
|
||||
dataStatistics.setRoomTypeList(roomTypeList);
|
||||
|
||||
dataStatistics.setVillageCountList(villageCountList);
|
||||
|
|
Loading…
Reference in New Issue