| | |
| | | |
| | | import io.swagger.annotations.*; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherVO; |
| | | import org.springblade.modules.information.vo.InformationVO; |
| | | import org.springblade.modules.jurisdiction.service.JurisdictionService; |
| | | import org.springblade.modules.jurisdiction.vo.JurisdictionVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.List; |
| | | import java.util.ArrayList; |
| | | import java.util.Map; |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入information") |
| | | public R<IPage<Information>> page(Information information, Query query) { |
| | | IPage<Information> pages = informationService.selectInformationPage(Condition.getPage(query), information); |
| | | public R<IPage<InformationVO>> page(InformationVO information, Query query) { |
| | | IPage<InformationVO> pages = informationService.selectInformationPage(Condition.getPage(query), information); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | mapzc1.put("zc", mapzc); |
| | | lists.add(mapzc1); |
| | | //保安持证数量 |
| | | Map<String, String> mapcz = informationService.queryYearZc(year, jurisdiction, deptid); |
| | | Map<String, String> mapcz = informationService.queryYearCz(year, jurisdiction, deptid); |
| | | mapcz = (HashMap<String, String>) sortMapBykeyAsc(mapcz);//key升序 |
| | | mapcz1.put("chiz", mapcz); |
| | | lists.add(mapcz1); |
| | |
| | | * 保安员统计 |
| | | */ |
| | | @PostMapping("/selectLi") |
| | | public R<IPage> selectLi(String jurisdiction, String deptid, Query query) { |
| | | IPage list = informationService.selectLi(Condition.getPage(query),jurisdiction, deptid); |
| | | public R<IPage> selectLi(String jurisdiction, String deptid,String stats, Query query) { |
| | | IPage list = informationService.selectLi(Condition.getPage(query), jurisdiction, deptid,stats); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/selectTb") |
| | | public R<IPage> selectTb(String jurisdiction, String enterpriseName, Query query) { |
| | | IPage list =informationService.selectTb(Condition.getPage(query),jurisdiction, enterpriseName); |
| | | IPage list = informationService.selectTb(Condition.getPage(query), jurisdiction, enterpriseName); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/selectJj") |
| | | public R<IPage> selectJj(String jurisdiction, String enterpriseName, Query query) { |
| | | IPage list = informationService.selectJj(Condition.getPage(query),jurisdiction, enterpriseName); |
| | | IPage list = informationService.selectJj(Condition.getPage(query), jurisdiction, enterpriseName); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | * 业务统计情况 |
| | | */ |
| | | @PostMapping("/selectYw") |
| | | public R<IPage> selectYw(String jurisdiction, String deptid, Query query) { |
| | | IPage list = informationService.selectYw(Condition.getPage(query),jurisdiction, deptid); |
| | | public R<IPage> selectYw(String jurisdiction, String deptid,String stats, Query query) { |
| | | IPage list = informationService.selectYw(Condition.getPage(query), jurisdiction, deptid,stats); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | * 保安员详情 |
| | | */ |
| | | @PostMapping("/selectUIn") |
| | | public R selectUIn(String deptid, String name, String hold, String photo, String examinationtype, String dispatch, String soil) { |
| | | List<Map<Object, Object>> list = informationService.selectUIn(deptid, name, hold, photo, examinationtype, dispatch, soil); |
| | | public R<IPage> selectUIn(String deptid, String name, String hold, String photo, String examinationtype, String dispatch, String soil,Query query) { |
| | | IPage list = informationService.selectUIn(Condition.getPage(query),deptid, name, hold, photo, examinationtype, dispatch, soil); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/selectDis") |
| | | public R<IPage> selectDis(String jurisdiction, String deptid, String fid, Query query) { |
| | | IPage list = informationService.selectDis(Condition.getPage(query),jurisdiction, deptid, fid); |
| | | IPage list = informationService.selectDis(Condition.getPage(query), jurisdiction, deptid, fid); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | Integer count = 0; |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | List<Map<Object, Object>> maps = informationService.selectCf(jurisdiction); |
| | | for (int i = 0; i < maps.size(); i++) { |
| | | String num = maps.get(i).get("num").toString(); |
| | | count += Integer.valueOf(num); |
| | | } |
| | | map.put("count", count); |
| | | map.put("list", maps); |
| | | lists.add(map); |
| | | return R.data(lists); |
| | | map.put("count", maps.size()); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.data(lists); |
| | | } |
| | | |
| | | // public static void main(String[] args) throws Exception { |
| | | // //ftp服务器IP地址 |
| | | // String ftpHost = "192.168.0.105"; |
| | | // //ftp服务器端口 |
| | | // int ftpPort = 21; |
| | | // //ftp服务器用户名 |
| | | // String ftpUserName = "yly"; |
| | | // //ftp服务器密码 |
| | | // String ftpPassword = "Yly@123"; |
| | | // //ftp服务器路径 |
| | | // String ftpPath = ""; |
| | | // //本地路径 |
| | | // String localPath = "D:\\anbao"; |
| | | // //文件名 |
| | | // String fileName = "sql.json"; |
| | | // FtpUtil.downloadFtpFile(ftpHost, ftpUserName, ftpPassword, ftpPort, ftpPath, localPath, fileName); |
| | | // String s = TestJson(); |
| | | // String sql = stringReplace(s); |
| | | // MysqlCenlint.inster(sql); |
| | | // MysqlCenlint.delete(); |
| | | // } |
| | | /** |
| | | * 违规经营 |
| | | */ |
| | | @PostMapping("/selectWg") |
| | | public R selectWg(String jurisdiction) { |
| | | List<Map<Object, Object>> list = informationService.selectWg(jurisdiction); |
| | | List list1 = new ArrayList(); |
| | | int count=0; |
| | | Map map = new HashMap(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | //总数 |
| | | String znums = list.get(i).get("znum").toString(); |
| | | int znum = Integer.parseInt(znums); |
| | | //持证人数 |
| | | String cznums = list.get(i).get("cznum").toString(); |
| | | int cznum = Integer.parseInt(cznums); |
| | | //缴纳社保人数 |
| | | String sbnums = list.get(i).get("sbnum").toString(); |
| | | int sbnum = Integer.parseInt(sbnums); |
| | | //保安总人数为0 |
| | | if (znum==0){ |
| | | continue; |
| | | } |
| | | else { |
| | | int a = znum / 2; |
| | | if (cznum<=a || sbnum<=a){ |
| | | count++; |
| | | list1.add(list.get(i)); |
| | | } |
| | | } |
| | | } |
| | | map.put("count",count); |
| | | map.put("list",list1); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 经营不善 |
| | | */ |
| | | @PostMapping("/selectJy") |
| | | public R selectJy(String jurisdiction) { |
| | | List<Map<Object, Object>> list = informationService.selectJy(jurisdiction); |
| | | List list1 = new ArrayList(); |
| | | Map map = new HashMap(); |
| | | int count = 0; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String num = list.get(i).get("fwnum").toString(); |
| | | int a = Integer.parseInt(num); |
| | | if (a == 0) { |
| | | count++; |
| | | list1.add(list.get(i)); |
| | | } |
| | | } |
| | | map.put("count", count); |
| | | map.put("List", list1); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 有实无名 |
| | | */ |
| | | @PostMapping("/selectYs") |
| | | public R selectYs(String jurisdiction) { |
| | | List<Map<Object, Object>> list = informationService.selectYs(jurisdiction); |
| | | List list1 = new ArrayList(); |
| | | Map map = new HashMap(); |
| | | int count = 0; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String num = list.get(i).get("znum").toString(); |
| | | int a = Integer.parseInt(num); |
| | | if (a == 0) { |
| | | count++; |
| | | list1.add(list.get(i)); |
| | | } |
| | | } |
| | | map.put("count", count); |
| | | map.put("List", list1); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectAge") |
| | | public R selectAge(String jurisdiction, String deptid) { |
| | | List<Map<Object, Object>> list = informationService.selectAge(jurisdiction, deptid); |
| | | int qcount = 0;//青年 |
| | | int zcount = 0;//中年 |
| | | int lcount = 0;//老年 |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String age = list.get(i).get("age").toString(); |
| | | int a = Integer.parseInt(age); |
| | | if (a <= 0) { |
| | | continue; |
| | | } else if (a >= 19 && a < 35) { |
| | | qcount ++; |
| | | } else if (a >= 36 && a < 59) { |
| | | zcount++; |
| | | } else { |
| | | lcount++; |
| | | } |
| | | } |
| | | Map map = new HashMap(); |
| | | map.put("qcount",qcount); |
| | | map.put("zcount",zcount); |
| | | map.put("lcount",lcount); |
| | | return R.data(map); |
| | | } |
| | | |
| | | |
| | | } |