| | |
| | | */ |
| | | package org.springblade.modules.information.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.annotations.*; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.desk.entity.Notice; |
| | | import org.springblade.modules.desk.vo.NoticeVO; |
| | | import org.springblade.modules.desk.wrapper.NoticeWrapper; |
| | | import org.springblade.modules.member.service.IMemberService; |
| | | import org.springblade.modules.shareholder.service.IShareholderService; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserDeptService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.information.entity.Information; |
| | | import org.springblade.modules.information.vo.InformationVO; |
| | | import org.springblade.modules.information.service.IInformationService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2021-07-07 |
| | |
| | | public class InformationController extends BladeController { |
| | | |
| | | private final IInformationService informationService; |
| | | private final IDeptService iDeptService; |
| | | |
| | | |
| | | /** |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入information") |
| | | public R<IPage<Information>> list(Information information, Query query) { |
| | | IPage<Information> pages = informationService.page(Condition.getPage(query), Condition.getQueryWrapper(information)); |
| | | public R<IPage<Information>> list(@ApiIgnore @RequestParam Map<String, Object> information, Query query) { |
| | | IPage<Information> pages = informationService.page(Condition.getPage(query), Condition.getQueryWrapper(information, Information.class)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入information") |
| | | public R<IPage<InformationVO>> page(InformationVO information, Query query) { |
| | | IPage<InformationVO> pages = informationService.selectInformationPage(Condition.getPage(query), information); |
| | | public R<IPage<Information>> page(Information information, Query query) { |
| | | IPage<Information> pages = informationService.selectInformationPage(Condition.getPage(query), information); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | return R.success("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 首页保安公司统计接口 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/SelectCount") |
| | | public R SelectCount() { |
| | | List<Map<Object, String>> list = iDeptService.selectCount(); |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String title = list.get(i).get("title");//部门名称 |
| | | String departmentid = String.valueOf(list.get(i).get("jurisdiction"));//部门id |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Map maps = informationService.selectCount(departmentid); |
| | | map.put("name", title); |
| | | map.put("server", maps); |
| | | lists.add(map); |
| | | } |
| | | return R.data(lists); |
| | | } |
| | | |
| | | /** |
| | | * 首页保安持证统计接口 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/SelectCounthold") |
| | | public R SelectCounthold() { |
| | | List<Map<Object, String>> list = iDeptService.selectCount(); |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | int cznumber = 0;//总的持证数量 |
| | | int wcznumber = 0;//总的未持证数量 |
| | | String title = list.get(i).get("title");//部门名称 |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Map<Object, Integer> objectStringMap = iDeptService.selectHold(String.valueOf(list.get(i).get("jurisdiction"))); |
| | | if (objectStringMap==null) { |
| | | map.put("name", title); |
| | | map.put("cz", cznumber); |
| | | map.put("wcz", wcznumber); |
| | | lists.add(map); |
| | | } |
| | | else { |
| | | cznumber = objectStringMap.get("cz"); |
| | | wcznumber = objectStringMap.get("wcz"); |
| | | map.put("name", title); |
| | | map.put("cz", cznumber); |
| | | map.put("wcz", wcznumber); |
| | | lists.add(map); |
| | | } |
| | | } |
| | | return R.data(lists); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 统计保安公司未持证的保安的公司数量 |
| | | */ |
| | | @PostMapping("/selectInCount") |
| | | public R selectInCount() { |
| | | List<Map<Object, String>> maps = informationService.selectInCount(); |
| | | return R.data(maps); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 管辖区域下拉 |
| | | */ |
| | | @PostMapping("/selecttree") |
| | | public R selecttree() { |
| | | List<Map<Object, String>> maps = iDeptService.selectCount(); |
| | | return R.data(maps); |
| | | } |
| | | |
| | | } |