基于javaweb和mysql的ssm+maven高校后勤报修系统(java+ssm+jsp+mysql)

私信源码获取及调试交流

私信源码获取及调试交流

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb的SSM+Maven高校后勤报修系统(java+ssm+jsp+mysql)

管理员

admin 12346

学生

a1 123456

a2 123456

a3 123456

后勤人员

a1 123456

a2 123456

a3 123456

登录:

http://localhost:8080/houqinbaoxiu/jsp/login.jsp

图片存放路径: src\main\webapp\upload,项目全路径不能有中文

流程:

1 学生报修

2 管理员指派后勤人员

3 后勤确认结果

        Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            List<BaoxiuEntity> baoxiuList = new ArrayList<>();//上传的东西
            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"该文件没有后缀");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后缀为xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("../../upload/" + fileName);//获取文件路径
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上传文件,请联系管理员");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            BaoxiuEntity baoxiuEntity = new BaoxiuEntity();
//                            baoxiuEntity.setXueshengId(Integer.valueOf(data.get(0)));   //学生 要改的
//                            baoxiuEntity.setHouqinrenyuanId(Integer.valueOf(data.get(0)));   //后勤人员 要改的
//                            baoxiuEntity.setBaoxiuUuidNumber(data.get(0));                    //报修编号 要改的
//                            baoxiuEntity.setBaoxiuName(data.get(0));                    //报修名称 要改的
//                            baoxiuEntity.setBaoxiuWupinName(data.get(0));                    //报修物品 要改的
//                            baoxiuEntity.setBaoxiuAddress(data.get(0));                    //报修地点 要改的
//                            baoxiuEntity.setBaoxiuTypes(Integer.valueOf(data.get(0)));   //报修类型 要改的
//                            baoxiuEntity.setInsertTime(date);//时间
//                            baoxiuEntity.setBaoxiuContent("");//详情和图片
//                            baoxiuEntity.setBaoxiuZhuangtaiTypes(Integer.valueOf(data.get(0)));   //报修状态 要改的
//                            baoxiuEntity.setCreateTime(date);//时间
                            baoxiuList.add(baoxiuEntity);

                            //把要查询是否重复的字段放入map中
                                //报修编号
                                if(seachFields.containsKey("baoxiuUuidNumber")){
                                    List<String> baoxiuUuidNumber = seachFields.get("baoxiuUuidNumber");
                                    baoxiuUuidNumber.add(data.get(0));//要改的
	 * @return
	 */
	@RequestMapping("/newSelectDateGroupSum")
	public R newSelectDateGroupSum(@RequestParam Map<String,Object> params) {
		logger.debug("newSelectDateGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
		String dateFormatType = String.valueOf(params.get("dateFormatType"));
		if("1".equals(dateFormatType)){
			params.put("dateFormat", "%Y");
		}else if("2".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m");
		}else if("3".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m-%d");
		}else{
			R.error("日期格式化不正确");
		}
		List<Map<String, Object>> result = commonService.newSelectDateGroupSum(params);
		return R.ok().put("data", result);
	}

	/**
	 *
	 * 查询字典表的分组统计总条数
	 * tableName  		表名
	 * groupColumn  		分组字段
	 * dateFormatType	日期格式化类型   1:年 2:月 3:日
	 * @return
	 */
	@RequestMapping("/newSelectDateGroupCount")
	public R newSelectDateGroupCount(@RequestParam Map<String,Object> params) {
		logger.debug("newSelectDateGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);
		String dateFormatType = String.valueOf(params.get("dateFormatType"));
		if("1".equals(dateFormatType)){
			params.put("dateFormat", "%Y");
		}else if("2".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m");
		}else if("3".equals(dateFormatType)){
			params.put("dateFormat", "%Y-%m-%d");
		}else{
			R.error("日期格式化类型不正确");
		}
		List<Map<String, Object>> result = commonService.newSelectDateGroupCount(params);
		return R.ok().put("data", result);
	}
/**
 * 饼状图
 * -- 饼状图  查询当前表
 -- 				查询字典表【月】
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永不会进入");
        else if("学生".equals(role))
            params.put("xueshengId",request.getSession().getAttribute("userId"));
        else if("后勤人员".equals(role))
            params.put("houqinrenyuanId",request.getSession().getAttribute("userId"));
        if(params.get("orderBy")==null || params.get("orderBy")==""){
            params.put("orderBy","id");
        }
        PageUtils page = jiaoshiService.queryPage(params);

        //字典表数据转换
        List<JiaoshiView> list =(List<JiaoshiView>)page.getList();
        for(JiaoshiView c:list){
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(c, request);
        }
        return R.ok().put("data", page);
    }

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        JiaoshiEntity jiaoshi = jiaoshiService.selectById(id);
        if(jiaoshi !=null){
            //entity转view
            JiaoshiView view = new JiaoshiView();
            BeanUtils.copyProperties( jiaoshi , view );//把实体数据重构到view中

            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }


    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
		List<UsersEntity> user = usersService.selectList(null);
		if(user.size() > 1){
			usersService.deleteBatchIds(Arrays.asList(ids));
		}else{
			return R.error("管理员最少保留一个");
		}
        return R.ok();
    }
}

/**
 * 权限(Token)验证
 */
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {

    public static final String LOGIN_TOKEN_KEY = "Token";

    @Autowired
    private TokenService tokenService;
    
	@Override

/**
 * 耗材使用
 * 后端接口
 * @email
*/
@RestController
@Controller
@RequestMapping("/haocaiShiyong")
public class HaocaiShiyongController {
    private static final Logger logger = LoggerFactory.getLogger(HaocaiShiyongController.class);

    @Autowired
    private HaocaiShiyongService haocaiShiyongService;

    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表service
    @Autowired
    private BaoxiuService baoxiuService;
    @Autowired
    private HaocaiService haocaiService;

    @Autowired
    private XueshengService xueshengService;
    @Autowired
    private HouqinrenyuanService houqinrenyuanService;

                                }
                        }

                        //查询是否重复
                         //报修编号
                        List<BaoxiuEntity> baoxiuEntities_baoxiuUuidNumber = baoxiuService.selectList(new EntityWrapper<BaoxiuEntity>().in("baoxiu_uuid_number", seachFields.get("baoxiuUuidNumber")));
                        if(baoxiuEntities_baoxiuUuidNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(BaoxiuEntity s:baoxiuEntities_baoxiuUuidNumber){
                                repeatFields.add(s.getBaoxiuUuidNumber());
                            }
                            return R.error(511,"数据库的该表中的 [报修编号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                        baoxiuService.insertBatch(baoxiuList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }

}

            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        haocaiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }

    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName, HttpServletRequest request){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            List<HaocaiEntity> haocaiList = new ArrayList<>();//上传的东西
            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"该文件没有后缀");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后缀为xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("../../upload/" + fileName);//获取文件路径
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上传文件,请联系管理员");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            HaocaiEntity haocaiEntity = new HaocaiEntity();
//                            haocaiEntity.setHaocaiUuidNumber(data.get(0));                    //耗材编号 要改的
//                            haocaiEntity.setHaocaiName(data.get(0));                    //耗材名称 要改的
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            HaocaiShiyongEntity haocaiShiyongEntity = new HaocaiShiyongEntity();
//                            haocaiShiyongEntity.setHaocaiId(Integer.valueOf(data.get(0)));   //耗材 要改的
//                            haocaiShiyongEntity.setBaoxiuId(Integer.valueOf(data.get(0)));   //报修 要改的
//                            haocaiShiyongEntity.setHaocaiShiyongUuidNumber(data.get(0));                    //耗材使用编号 要改的
//                            haocaiShiyongEntity.setHaocaiShiyongNumber(Integer.valueOf(data.get(0)));   //使用数量 要改的
//                            haocaiShiyongEntity.setHaocaiShiyongContent("");//详情和图片
//                            haocaiShiyongEntity.setInsertTime(date);//时间
//                            haocaiShiyongEntity.setCreateTime(date);//时间
                            haocaiShiyongList.add(haocaiShiyongEntity);

                            //把要查询是否重复的字段放入map中
                                //耗材使用编号
                                if(seachFields.containsKey("haocaiShiyongUuidNumber")){
                                    List<String> haocaiShiyongUuidNumber = seachFields.get("haocaiShiyongUuidNumber");
                                    haocaiShiyongUuidNumber.add(data.get(0));//要改的
                                }else{
                                    List<String> haocaiShiyongUuidNumber = new ArrayList<>();
                                    haocaiShiyongUuidNumber.add(data.get(0));//要改的
                                    seachFields.put("haocaiShiyongUuidNumber",haocaiShiyongUuidNumber);
                                }
                        }

                        //查询是否重复
                         //耗材使用编号
                        List<HaocaiShiyongEntity> haocaiShiyongEntities_haocaiShiyongUuidNumber = haocaiShiyongService.selectList(new EntityWrapper<HaocaiShiyongEntity>().in("haocai_shiyong_uuid_number", seachFields.get("haocaiShiyongUuidNumber")));
                        if(haocaiShiyongEntities_haocaiShiyongUuidNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(HaocaiShiyongEntity s:haocaiShiyongEntities_haocaiShiyongUuidNumber){
                                repeatFields.add(s.getHaocaiShiyongUuidNumber());
                            }
                            return R.error(511,"数据库的该表中的 [耗材使用编号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                        haocaiShiyongService.insertBatch(haocaiShiyongList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }

    
    /**
     * 详情
     */
    @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        ConfigEntity config = configService.selectById(id);
        return R.ok().put("data", config);
    }
    
    /**
     * 根据name获取信息
     */
    @RequestMapping("/info")
    public R infoByName(@RequestParam String name){
        ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
        return R.ok().put("data", config);
    }
    
    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody ConfigEntity config){
//    	ValidatorUtils.validateEntity(config);
    	configService.insert(config);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ConfigEntity config){
//        ValidatorUtils.validateEntity(config);
        configService.updateById(config);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
    	configService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

                        //查询是否重复
                        dictionaryService.insertBatch(dictionaryList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }

}

				one ="thisTypes0";
			}else{
				if(StringUtil.isEmpty(two)){
					two ="thisTypes0";
				}
			}
		}
		if(isJoinTableFlag){//级联表类型
			Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");
			if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){
				joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));
				if(StringUtil.isEmpty(one)){
					one ="joinTypes0";
				}else{
					if(StringUtil.isEmpty(two)){
						two ="joinTypes0";
					}
				}

			}
		}

		List<Map<String, Object>> result = commonService.barCount(params);

		List<String> xAxis = new ArrayList<>();//报表x轴
		List<List<String>> yAxis = new ArrayList<>();//y轴
		List<String> legend = new ArrayList<>();//标题

		if(StringUtil.isEmpty(two)){//不包含第二列
			List<String> yAxis0 = new ArrayList<>();
			yAxis.add(yAxis0);
			legend.add("数值");
			for(Map<String, Object> map :result){
				String oneValue = String.valueOf(map.get(one));
				String value = String.valueOf(map.get("value"));
				xAxis.add(oneValue);
				yAxis0.add(value);
			}
		}else{//包含第二列
			Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();
			if(StringUtil.isNotEmpty(two)){
				for(Map<String, Object> map :result){
					String oneValue = String.valueOf(map.get(one));
					String twoValue = String.valueOf(map.get(two));
					String value = String.valueOf(map.get("value"));
					if(!legend.contains(twoValue)){
						legend.add(twoValue);//添加完成后 就是最全的第二列的类型
					}
					if(dataMap.containsKey(oneValue)){
						dataMap.get(oneValue).put(twoValue,value);
					}else{
						HashMap<String, String> oneData = new HashMap<>();
						oneData.put(twoValue,value);
						dataMap.put(oneValue,oneData);

/**
 * 字典 服务实现类
 */
@Service("dictionaryService")
@Transactional
public class DictionaryServiceImpl extends ServiceImpl<DictionaryDao, DictionaryEntity> implements DictionaryService {

    @Override
    public PageUtils queryPage(Map<String,Object> params) {
        if(params != null && (params.get("limit") == null || params.get("page") == null)){
            params.put("page","1");
            params.put("limit","10");
        }
        Page<DictionaryView> page =new Query<DictionaryView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,params));
        return new PageUtils(page);
    }

     /**
     * 赋值给字典表
     * @param obj view对象
     */
    public void dictionaryConvert(Object obj, HttpServletRequest request) {
        try {
            if (obj == null) return;
            //当前view和entity中的所有types的字段
            List<String> fieldNameList = new ArrayList<>();
            Class tempClass = obj.getClass();
            while (tempClass !=null) {
                Field[] declaredFields = tempClass.getDeclaredFields();
                for (Field f : declaredFields) {
                    f.setAccessible(true);
                    if (f.getType().getName().equals("java.lang.Integer") && f.getName().contains("Types")) {
                        fieldNameList.add(f.getName());
                    }
                }
                tempClass = tempClass.getSuperclass(); //得到父类,然后赋给自己
            }

            // 获取监听器中的字典表
//            ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
            ServletContext servletContext = request.getServletContext();
            Map<String, Map<Integer, String>> dictionaryMap= (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");

/**
 * 后勤人员
 * 后端接口
 * @email
*/
@RestController
@Controller
@RequestMapping("/houqinrenyuan")
public class HouqinrenyuanController {
    private static final Logger logger = LoggerFactory.getLogger(HouqinrenyuanController.class);

    @Autowired
    private HouqinrenyuanService houqinrenyuanService;

    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表service

    @Autowired
    private XueshengService xueshengService;

    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永不会进入");
        else if("学生".equals(role))
            params.put("xueshengId",request.getSession().getAttribute("userId"));
        else if("后勤人员".equals(role))
            params.put("houqinrenyuanId",request.getSession().getAttribute("userId"));
        if(params.get("orderBy")==null || params.get("orderBy")==""){
            params.put("orderBy","id");
        }
        PageUtils page = houqinrenyuanService.queryPage(params);

        //字典表数据转换
                                repeatFields.add(s.getXueshengPhone());
                            }
                            return R.error(511,"数据库的该表中的 [学生手机号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                         //学生身份证号
                        List<XueshengEntity> xueshengEntities_xueshengIdNumber = xueshengService.selectList(new EntityWrapper<XueshengEntity>().in("xuesheng_id_number", seachFields.get("xueshengIdNumber")));
                        if(xueshengEntities_xueshengIdNumber.size() >0 ){
                            ArrayList<String> repeatFields = new ArrayList<>();
                            for(XueshengEntity s:xueshengEntities_xueshengIdNumber){
                                repeatFields.add(s.getXueshengIdNumber());
                            }
                            return R.error(511,"数据库的该表中的 [学生身份证号] 字段已经存在 存在数据为:"+repeatFields.toString());
                        }
                        xueshengService.insertBatch(xueshengList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }

    /**
    * 登录
    */
    @IgnoreAuth
    @RequestMapping(value = "/login")
    public R login(String username, String password, String captcha, HttpServletRequest request) {
        XueshengEntity xuesheng = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("username", username));
        if(xuesheng==null || !xuesheng.getPassword().equals(password))
            return R.error("账号或密码不正确");
        //  // 获取监听器中的字典表
        // ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();
        // Map<String, Map<Integer, String>> dictionaryMap= (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");
        // Map<Integer, String> role_types = dictionaryMap.get("role_types");
        // role_types.get(.getRoleTypes());
        String token = tokenService.generateToken(xuesheng.getId(),username, "xuesheng", "学生");
        R r = R.ok();
        r.put("token", token);
        r.put("role","学生");
        r.put("username",xuesheng.getXueshengName());
}

/**
 * 字典
 * 后端接口
 * @email
*/
@RestController
@Controller
@RequestMapping("/dictionary")
    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        haocaiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }

    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName, HttpServletRequest request){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            List<HaocaiEntity> haocaiList = new ArrayList<>();//上传的东西
            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"该文件没有后缀");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后缀为xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("../../upload/" + fileName);//获取文件路径
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上传文件,请联系管理员");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            HaocaiEntity haocaiEntity = new HaocaiEntity();
//                            haocaiEntity.setHaocaiUuidNumber(data.get(0));                    //耗材编号 要改的
//                            haocaiEntity.setHaocaiName(data.get(0));                    //耗材名称 要改的
//                            haocaiEntity.setHaocaiPhoto("");//详情和图片
//                            haocaiEntity.setHaocaiTypes(Integer.valueOf(data.get(0)));   //耗材类型 要改的
//                            haocaiEntity.setHaocaiKucunNumber(Integer.valueOf(data.get(0)));   //耗材库存数量 要改的
//                            haocaiEntity.setHaocaiContent("");//详情和图片
//                            haocaiEntity.setInsertTime(date);//时间
//                            haocaiEntity.setCreateTime(date);//时间
                            haocaiList.add(haocaiEntity);
		params.put("yColumn", yColumnName);
		List<Map<String, Object>> result = commonService.selectValue(params);
		return R.ok().put("data", result);
	}

	/**
	 * 下面为新加的
	 *
	 *
	 *
	 */

	/**
	 * 查询字典表的分组求和
	 * tableName  		表名
	 * groupColumn  		分组字段
	 * sumCloum			统计字段
	 * @return
	 */
	@RequestMapping("/newSelectGroupSum")
	public R newSelectGroupSum(@RequestParam Map<String,Object> params) {
		logger.debug("newSelectGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);
		List<Map<String, Object>> result = commonService.newSelectGroupSum(params);
		return R.ok().put("data", result);
	}

    /**
     tableName 查询表
     condition1 条件1
     condition1Value 条件1值
     average 计算平均评分

     取值
        有值 Number(res.data.value.toFixed(1))
        无值 if(res.data){}
     * */
    @IgnoreAuth
    @RequestMapping("/queryScore")
    public R queryScore(@RequestParam Map<String, Object> params) {
        logger.debug("queryScore:,,Controller:{},,params:{}",this.getClass().getName(),params);
        Map<String, Object> queryScore = commonService.queryScore(params);
        return R.ok().put("data", queryScore);
    }

	/**
	 * 查询字典表的分组统计总条数
	 *  tableName  		表名
	 *	groupColumn  	分组字段
	 * @return
	 */
	@RequestMapping("/newSelectGroupCount")

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐