| | |
| | | */ |
| | | package org.springblade.modules.information.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | 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.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 org.springblade.modules.information.vo.InformationVO; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | public class InformationController extends BladeController { |
| | | |
| | | private final IInformationService informationService; |
| | | private final IDeptService iDeptService; |
| | | |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(informationService.removeByIds(Func.toLongList(ids))); |
| | | public R remove(String creditcode) { |
| | | informationService.deleteIn(creditcode); |
| | | informationService.deleteSh(creditcode); |
| | | informationService.deleteMe(creditcode); |
| | | return R.success("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 首页保安公司统计接口 |
| | | * @return |
| | | */ |
| | | @PostMapping("/SelectCount") |
| | | public R SelectCount() { |
| | | String name="分局"; |
| | | List<Map<Object, String>> list = iDeptService.selectCount(name); |
| | | 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() { |
| | | String name="分局"; |
| | | List<Map<Object, String>> list = iDeptService.selectCount(name); |
| | | 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"))); |
| | | 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() { |
| | | String name="分局"; |
| | | List<Map<Object, String>> maps = iDeptService.selectCount(name); |
| | | return R.data(maps); |
| | | } |
| | | |
| | | } |