| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | |
| | | private final IInformationService informationService; |
| | | private final IDeptService iDeptService; |
| | | |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | String id = kv.get("id").toString(); |
| | | information.setDepartmentid(id); |
| | | } |
| | | arg.test01(arg.url + "/information/save", information); |
| | | //arg.test01(arg.url + "/information/save", information); |
| | | return R.status(informationService.save(information)); |
| | | } |
| | | |
| | |
| | | List<Map<Object, Object>> lists = informationService.selectHold(deptid); |
| | | return R.data(lists); |
| | | } |
| | | |
| | | /** |
| | | * 派遣服务单位统计 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 保安派遣数量统计 |
| | | * 社保统计 |
| | | */ |
| | | @PostMapping("/selectSoil") |
| | | public R selectSoil(String deptid) { |
| | | List<Map<Object, Object>> lists = informationService.selectSoil(deptid); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (int i=0;i<lists.size();i++){ |
| | | for (int i = 0; i < lists.size(); i++) { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | String numj = lists.get(i).get("numj").toString(); |
| | | Integer a=Integer.valueOf(numj); |
| | | Integer a = Integer.valueOf(numj); |
| | | String numz = lists.get(i).get("numz").toString(); |
| | | Integer b=Integer.valueOf(numz); |
| | | Integer c=b-a; |
| | | map.put("numj",a); |
| | | map.put("nmuwj",c); |
| | | Integer b = Integer.valueOf(numz); |
| | | Integer c = b - a; |
| | | map.put("numj", a); |
| | | map.put("nmuwj", c); |
| | | list.add(map); |
| | | } |
| | | return R.data(list); |
| | | } |
| | | |
| | | public static String getJSONStringFromJavaBean(Class<? extends Object> clazz) { |
| | | |
| | | Field[] fields = clazz.getDeclaredFields(); |
| | | |
| | | StringBuffer stb = new StringBuffer("{"); |
| | | |
| | | for (int i = 0; i < fields.length; i++) { |
| | | |
| | | try { |
| | | |
| | | Field field = fields[i]; |
| | | |
| | | field.setAccessible(true); |
| | | |
| | | String name = field.getName(); |
| | | |
| | | stb.append("\"").append(name).append("\"").append(":\"\"").append(","); |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | e.printStackTrace(); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | int i = stb.lastIndexOf(","); |
| | | |
| | | return stb.substring(0, i) + "}"; |
| | | |
| | | } |
| | | |
| | | } |