| | |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.common.cache.DictCache; |
| | | import org.springblade.common.enums.DictEnum; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | 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.support.Kv; |
| | | 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.jurisdiction.vo.JurisdictionVO; |
| | | import org.springblade.modules.member.service.IMemberService; |
| | | import org.springblade.modules.shareholder.service.IShareholderService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserDeptService; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.*; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入information") |
| | | public R save(@Valid @RequestBody Information information) { |
| | | Dept dept= new Dept(); |
| | | Long i = 1413470343230877697L; |
| | | dept.setParentId(i); |
| | | dept.setTenantId("000000"); |
| | | dept.setDeptName(information.getEnterprisename()); |
| | | dept.setAncestors("0,1413470343230877697"); |
| | | dept.setDeptCategory(1); |
| | | if (iDeptService.submit(dept)) { |
| | | CacheUtil.clear(SYS_CACHE); |
| | | // 返回懒加载树更新节点所需字段 |
| | | Kv kv = Kv.create().set("id", String.valueOf(dept.getId())).set("tenantId", dept.getTenantId()) |
| | | .set("deptCategoryName", DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory())); |
| | | String id = kv.get("id").toString(); |
| | | information.setDepartmentid(id); |
| | | } |
| | | return R.status(informationService.save(information)); |
| | | } |
| | | |
| | |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Integer count=0; |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | List<Map<Object, Integer>> maps = informationService.selectExtype(jurisdiction, deptid); |
| | | List<Map<Object, Object>> maps = informationService.selectExtype(jurisdiction, deptid); |
| | | for (int i=0;i<maps.size();i++){ |
| | | count+=maps.get(i).get("num"); |
| | | String num = maps.get(i).get("num").toString(); |
| | | count+= Integer.valueOf(num); |
| | | } |
| | | map.put("count",count); |
| | | map.put("list",maps); |
| | |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Integer count=0; |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | List<Map<Object, Integer>> maps = informationService.selectExtype(jurisdiction, deptid); |
| | | List<Map<Object, Object>> maps = informationService.selectBx(jurisdiction, deptid); |
| | | for (int i=0;i<maps.size();i++){ |
| | | count+=maps.get(i).get("num"); |
| | | String num = maps.get(i).get("num").toString(); |
| | | count+= Integer.valueOf(num); |
| | | } |
| | | map.put("count",count); |
| | | map.put("list",maps); |
| | |
| | | //辖区名称 |
| | | String jurname = list.get(i).get("dept_name").toString(); |
| | | //保安员表现差预警数量 |
| | | List<Map<Object, Integer>> mapbx = informationService.selectBx(jurisdiction, ""); |
| | | List<Map<Object, Object>> mapbx = informationService.selectBx(jurisdiction, ""); |
| | | for (int ibx=0;ibx<mapbx.size();ibx++){ |
| | | count+=mapbx.get(ibx).get("num"); |
| | | String num = mapbx.get(ibx).get("num").toString(); |
| | | count+= Integer.valueOf(num); |
| | | } |
| | | //保安员资格异常的数量 |
| | | List<Map<Object, Integer>> mapEx = informationService.selectExtype(jurisdiction, ""); |
| | | List<Map<Object, Object>> mapEx = informationService.selectExtype(jurisdiction, ""); |
| | | for (int iex=0;iex<mapEx.size();iex++){ |
| | | count+=mapEx.get(iex).get("num"); |
| | | String num = mapEx.get(iex).get("num").toString(); |
| | | count+= Integer.valueOf(num); |
| | | } |
| | | //保安公司未持证数量 |
| | | List<Map<Object, String>> mapgs = informationService.selectInCount(jurisdiction,""); |
| | |
| | | } |
| | | return R.data(lists); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 派遣數量統計 |
| | | */ |
| | | @PostMapping("/selectPCount") |
| | | public R selectPCount(String jurisdiction,String deptid) { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | Map map1 = informationService.selectPcount(jurisdiction, deptid); |
| | | String pnum = map1.get("pnum").toString(); |
| | | Integer a=Integer.valueOf(pnum); |
| | | Map map2 = informationService.selectWPcount(jurisdiction, deptid); |
| | | String wpnum = map2.get("wpnum").toString(); |
| | | Integer b=Integer.valueOf(wpnum); |
| | | map.put("PCount",a); |
| | | map.put("WPCount",b); |
| | | lists.add(map); |
| | | return R.data(lists); |
| | | } |
| | | } |