[若依]系统各种案例展示

日期案例

<div class="form-group">    
            <label class="col-sm-3 control-label">提交日期:</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="submitdate" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>

在这里插入图片描述

附件上传

前端页面

    <!--附件上传-->

         案例一
            <div class="form-group">
                <label class="col-sm-2 control-label">附件1-发改委立项批复或领导批示:</label>
                <div class="col-sm-9">
                    <div class="file-loading">
                        <input id="multipleFile1" name="files" type="file" multiple>
                    </div>
                    <input id="accessorypf1"  name="accessorypf1"  >
                </div>
            </div>

            
		案例二
            <div class="col-sm-8 col-md-offset-2" >
            <div class="ibox form-group float-e-margins col-sm-8">
            <div class="ibox-title col-sm-8">
                <label class=" control-label is-required">附件1-发改委立项批复或领导批示:</label>
            </div>
            <div class="ibox-content ">
                    <div class="form-group col-sm-12">
                      <div class="file-loading col-sm-12">
                          <input id="accessorypf_up" name="accessorypf_up" type="file" multiple>

                      </div>
                        <input id="accessorypf"  name="accessorypf"  >
                    </div>
                </div>
                </div>
            </div>


在这里插入图片描述
前端js

 $(document).ready(function () {

            // 发改委立项批复或领导批示
            $("#multipleFile1").fileinput({
                language: 'zh',
                uploadUrl: ctx + 'common/uploads',
                showUpload: false, //是否显示上传按钮,加上这个,把上传按钮隐藏掉,避免歧义
                uploadAsync: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                //上传成功
                console.log("上傳成功!")
                var rsp = data.response;
                let urls = rsp.urls;
                var filepath =urls+';id:'+previewId;
                log.info("return urls:" +urls)
                log.info("return filepath:" +filepath)
                //存放在input
                var url=$("#accessorypf1").val();
                if (url != null || url !=''){
                    $("#accessorypf1").val(url+"*|||*"+filepath);
                }else {
                    $("#accessorypf1").val(filepath)
                }
                console.log(event)
                console.log(data)
                console.log(previewId)
                console.log(index)
                var rsp = data.response;
                log.info("return urls:" + rsp.urls)
                log.info("return fileMsg:" + rsp.fileMsg)
                log.info("reutrn fileNames:" + rsp.fileNames)
                log.info("reutrn newFileNames:" + rsp.newFileNames)
                log.info("return originalFilenames:" + rsp.originalFilenames)
                log.info("return previewId:" + rsp.previewId)
            }).on('filesuccessremove', function (event,id) {
                //event,data,previewId,index
                console.log("删除成功上传通知")
                var urls=$("#accessorypf1").val();
                //删除input urls
                var szarr=urls.split('*|||*');
                //遍历删除指定图片
                for(let i = 0; i < szarr.length; i++) {
                    var index= szarr[i].indexOf(id);
                    if(index > 0){
                        //存在
                        //服务器本地删除
                        $.get(
                            '/common/del',
                            {
                                fileurl:szarr[i],
                                id:id
                            },function(data){ //回传函数
                                $.modal.msg(data.msg)
                            },
                        )
                        console.log("id存在,删除成功!")
                        szarr.splice(i, 1);
                        i--;
                    }else{
                        //不存在
                        console.log("id不存在,删除失败!")
                    }
                }
                //遍历还原字符串
                var newurl="";
                for(let i = 0; i < szarr.length; i++) {
                    newurl=newurl+szarr[i]+'*|||*';
                }
                $("#accessorypf1").val(newurl)

                console.log(event.currentTarget.id)
                console.log(id)

            }).on('fileremoved', function (event, data, previewId, index) {
                //删除信息
                console.log("删除")
                console.log(event)
                console.log(data)
                console.log(previewId)
                console.log(index)
            }).on('filebatchselected', function (event, data, id, index) {
                $(this).fileinput("upload");//主要就是这个事件啊,选择文件之后,直接出发upload事件
            })


js 上面html尾部加上这段
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <th:block th:include="include :: datetimepicker-js" />

在这里插入图片描述

文件上传后端代码,看common/uploads通用上传代码

idea热部署方法

热部署==》打开连接

https://www.jianshu.com/p/c50df2882325  免费使用JRebel插件教程

前端表单校验

前端校验规则明细

在input中的class 增加 required,必输入校验
<div class="form-group">    
                <label class="col-sm-3 control-label is-required">送审单位:</label>
                <div class="col-sm-8">
                    <input name="submitunit" class="form-control required" type="text">
                </div>
            </div>

后端发起ajax请求,post提交

前端表单

 <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-project-add">
            <div class="form-group">
                <h2 style=" text-align:center;"><b>项目评审填报</b></h2>
                <hr>
                <label class="col-sm-3 control-label is-required">项目名称:</label>
                <div class="col-sm-8">
                    <input name="rojectname" class="form-control required "></input>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">送审单位:</label>
                <div class="col-sm-8">
                    <input name="submitunit" class="form-control required" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">联系人:</label>
                <div class="col-sm-8">
                    <input name="linkman" class="form-control required" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label  class="col-sm-3 control-label is-required "> 手机:</label>
                <div class="col-sm-8">
                    <input  name="phone" onkeyup="this.value=this.value.replace(/\D/g,'')"  class="form-control  required" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required" >单位座机电话:</label>
                <div class="col-sm-8">
                    <input name="call" onkeyup="this.value=this.value.replace(/\D/g,'')" class="form-control required" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required" >前期是否已编制控制价:</label>
                <div class="col-sm-8">
                    <div class="radio check-box">
                        <label>
                            <input type="radio" value="1" name="enableqqkzj" class="form-control required"> <i></i></label>
                    </div>
                    <div class="radio check-box">
                        <label>
                            <input type="radio" value="0" name="enableqqkzj" class="form-control required"> <i></i></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">金额(万元)</label>
                <div class="col-sm-8">
                    <input name="rojectmoney" onkeyup="value=value.replace(/[^\d.]/g,'')" class="form-control required" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">概算金额(万元)</label>
                <div class="col-sm-8">
                    <input name="budgetmoney" onkeyup="value=value.replace(/[^\d.]/g,'')" class="form-control required" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">概算的工程费(万元)</label>
                <div class="col-sm-8">
                    <input name="budgetengineeringmoney" onkeyup="value=value.replace(/[^\d.]/g,'')" class="form-control required" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">投资估算工程费(万元)</label>
                <div class="col-sm-8">
                    <input name="investengineeringmoney" onkeyup="value=value.replace(/[^\d.]/g,'')" class="form-control required" type="text">
                </div>
            </div>
            <hr>
    <!--附件上传-->

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">附件1-发改委立项批复或领导批示:</label>
                <div class="col-sm-6">
                    <div class="file-loading">
                        <input id="accessorypf_up" name="files" type="file" multiple>
                    </div>
                    <input id="accessorypf"  name="accessorypf" type="hidden" class="form-control required" >
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label is-required">附件2-可行性研究报告:</label>
                <div class="col-sm-6">
                    <div class="file-loading">
                        <input id="accessorykxxbg_up" name="files" type="file" multiple>
                    </div>
                    <input id="accessorykxxbg"  name="accessorykxxbg" class="form-control required" >
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label is-required">附件3-初步设计:</label>
                <div class="col-sm-5">
                    <div class="file-loading">
                        <input id="accessorycbsj_up" name="files" type="file" multiple>
                    </div>
                    <input id="accessorycbsj"  name="accessorycbsj"  class="form-control required" >
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">附件4-发改委初步设计批复:</label>
                <div class="col-sm-5">
                    <div class="file-loading">
                        <input id="accessorycbsjpf_up" name="files" type="file" multiple>
                    </div>
                    <input id="accessorycbsjpf"  name="accessorycbsjpf" class="form-control required" >
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label is-required">附件5-委托函:</label>
                <div class="col-sm-5">
                    <div class="file-loading">
                        <input id="accessorywth_up" name="files" type="file" multiple>
                    </div>
                    <input id="accessorywth"  name="accessorywth" class="form-control required" >
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">附件6-评审项目报审表(前期)<a href="">模版下载</a></label>
                <div class="col-sm-5">
                    <div class="file-loading">
                        <input id="accessorypsxmb_up" name="files" type="file" multiple>
                    </div>
                    <input id="accessorypsxmb"  name="accessorypsxmb" class="form-control required" >
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label is-required">附件7-电子版图纸:</label>
                <div class="col-sm-5">
                    <div class="file-loading">
                        <input id="electronicdrawing_up" name="files" type="file" multiple>
                    </div>
                    <input id="electronicdrawing"  name="electronicdrawing" class="form-control required" >
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label ">附件8-其他附件:</label>
                <div class="col-sm-5">
                    <div class="file-loading">
                        <input id="accessory_up" name="files" type="file" multiple>
                    </div>
                    <input id="accessory"  name="accessory" class="form-control required" >
                </div>
            </div>

            <div class="col-md-12">
                <div class="form-group">
                    <div class="col-sm-12 col-sm-offset-3">
                        <button type="submit" class="btn btn-primary">提交</button>

                        <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
                    </div>
                </div>
            </div>
        </form>
    </div>

后端js提交

   var prefix = ctx + "business/project"
        //表单清除
        $("#form-project-add").validate({
            focusCleanup: true
        });
        //提交表单
        function submitHandler() {
            if ($.validate.form()) {
                add();
            }
        }
        //ajax异步提交表单数据
        function add() {

            //获取全部参数 $('#form-project-add').serialize()
            //校验全部参数   $("#form-xxx").validate().form();
            var rojectname = $("input[name='rojectname']").val();
            var submitunit = $("textarea[name='submitunit']").val();
            var linkman = $("input[name='linkman']").val();
            var phone = $("input[name='phone']").val();
            var call = $("input[name='call']").val();
            var enableqqkzj = $("input[name='enableqqkzj']").val();
            var rojectmoney = $("input[name='rojectmoney']").val();
            var budgetmoney = $("input[name='budgetmoney']").val();
            var budgetengineeringmoney = $("input[name='budgetengineeringmoney']").val();
            var investengineeringmoney = $("input[name='investengineeringmoney']").val();
            var accessorypf = $("input[name='accessorypf']").val();
            var accessorykxxbg = $("input[name='accessorykxxbg']").val();
            var accessorycbsj = $("input[name='accessorycbsj']").val();
            var accessorycbsjpf = $("input[name='accessorycbsjpf']").val();
            var accessorywth = $("input[name='accessorywth']").val();
            var accessorypsxmb = $("input[name='accessorypsxmb']").val();
            var electronicdrawing = $("input[name='electronicdrawing']").val();
            var accessory = $("input[name='accessory']").val();

            $.ajax({
                cache : true,
                type : "POST",
                url : prefix + "/add",
                data : {
                    "rojectname": rojectname,
                    "submitunit": submitunit,
                    "linkman": linkman,
                    "phone": phone,
                    "call": call,
                    "enableqqkzj": enableqqkzj,
                    "rojectmoney": rojectmoney,
                    "budgetmoney": budgetmoney,
                    "budgetengineeringmoney": budgetengineeringmoney,
                    "investengineeringmoney": investengineeringmoney,
                    "accessorypf": accessorypf,
                    "accessorykxxbg": accessorykxxbg,
                    "accessorycbsj": accessorycbsj,
                    "accessorycbsjpf": accessorycbsjpf,
                    "accessorywth": accessorywth,
                    "accessorypsxmb": accessorypsxmb,
                    "electronicdrawing": electronicdrawing,
                    "accessory": accessory,

                },
                async : false,
                error : function(request) {
                    $.modal.alertError("系统错误");
                },
                success : function(data) {
                    $.operate.successCallback(data);
                }
            });
        }

日志输出

在这里插入图片描述


private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(BusinessProjectController.class);

//使用

log.info("进入上传文件接口");

后端工具类使用

1.是否包含制定内容
busBuy.getState().contains("待编辑")

2.设置uuid
IdUtils.fastSimpleUUID()

3.解析日期到date
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(DateUtils.getTime())

4.map 赋值到实体类
 //map 赋值 实体类
           BusinessProject businessProject = new BusinessProject();
           BeanUtils.populate(businessProject, allParams);

卡片列表

table自动计算

https://blog.csdn.net/weixin_30790841/article/details/97834511

表格table 组合/合并

在这里插入图片描述

<table id="tb_report"  border="1px" cellspacing="0"  cellpadding="15px" >
  <caption style="font-size: 30px;margin-top: 10px;margin-bottom: 20px;">工程造价咨询服务项目和收费汇总表</caption>

  <tr class="success">
    <th data-field="district" rowspan="2" data-valign="middle" data-align="center">阶段</th>
    <th data-field="sprayPropertyName" rowspan="2" data-valign="middle" data-align="center">咨询服务范围名称</th>
    <th data-field="parentBuildName" rowspan="2" data-valign="middle" data-align="center">收费基数</th>
    <th data-field="parentBuildName" rowspan="2" data-valign="middle" data-align="center">造价(万元)</th>
    <th data-field="parentBuildName" rowspan="2" data-valign="middle" data-align="center">咨询服务费(万元)</th>
    <th colspan="5" data-valign="middle" data-align="center">划分标准</th>
  </tr>
  <tr class="success">
    <td>≤500万元</td>
    <td>501-3000万元</td>
    <td>3001-5000万元</td>
    <td>5001-10000万元</td>
    <td>>10000万元</td>
  </tr>
  <!--表头结束-->
  <tr>
    <td rowspan="2">发承包阶段</td>
    <td data-valign="middle" data-align="center"> 工程量清单</td>
    <td data-valign="middle" data-align="center"> 建筑安装工程造价</td>
    <td data-valign="middle" data-align="center"> <input  name="accessorywth" class="form-control" ></td>
    <td style="text-align: center;"> 咨询结果</td>
    <td style="text-align: center;"> 500</td>
    <td style="text-align: center;"> 400</td>
    <td style="text-align: center;"> 500</td>
    <td style="text-align: center;"> 500</td>
    <td style="text-align: center;"> 500</td>
  </tr>
  <tr>
    <td data-valign="middle" data-align="center"> 最高投标限价</td>
    <td data-valign="middle" data-align="center"> 建筑安装工程造价</td>
    <td data-valign="middle" data-align="center"> <input  name="accessorywth" class="form-control" ></td>
    <td  style="text-align: center;"> 咨询结果</td>
    <td  style="text-align: center;"> 500</td>
    <td  style="text-align: center;"> 400</td>
    <td  style="text-align: center;"> 500</td>
    <td  style="text-align: center;"> 500</td>
    <td  style="text-align: center;"> 500</td>
  </tr>


  <!--竣工结算-->
  <tr>
    <td rowspan="2">竣工结算</td>
    <td data-valign="middle" data-align="center"> (1)基本收费</td>
    <td data-valign="middle" data-align="center"> 建筑安装工程送审造价</td>
    <td data-valign="middle" data-align="center"> <input  name="accessorywth" class="form-control" ></td>
    <td data-valign="middle" style="text-align: center;"> 咨询结果</td>
    <td data-valign="middle" style="text-align: center;"> 500</td>
    <td data-valign="middle" style="text-align: center;"> 500</td>
    <td data-valign="middle" style="text-align: center;"> 500</td>
    <td data-valign="middle" style="text-align: center;"> 500</td>
    <td data-valign="middle" style="text-align: center;"> 500</td>
  </tr>
  <tr>
    <td data-valign="middle" data-align="center"> (2)效益收费</td>
    <td data-valign="middle" data-align="center"> 核减额+核增额</td>
    <td data-valign="middle" data-align="center"> <input  name="accessorywth" class="form-control" ></td>
    <td data-valign="middle" style="text-align: center;" > 咨询结果</td>
    <td colspan="5"   style="text-align: center;"> 6%</td>

  </tr>

</table>

input 前端输入限制

1. 只能输入数字和点
<input name="gongclqingdan" oninput="value=value.replace(/[^0-9\.]/g,'').replace(/^\./g,'').replace(/\.{2,}/g,'.').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" />

2. 

若依选项卡+Thymeleaf 局部刷新

效果图
在这里插入图片描述
前端代码

<!DOCTYPE html>
<html lang="zh">
<head>
    <th:block th:include="include :: header('评审项目列表')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeIn">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" onclick="viewBystate(0)" href="#tab-1" aria-expanded="true">草稿</a>
                    </li>
                    <li class=""><a data-toggle="tab" onclick="viewBystate(1)" href="#tab-2" aria-expanded="false">待审核</a>
                    </li>
                    <li class=""><a data-toggle="tab" onclick="viewBystate(2)" href="#tab-3" aria-expanded="false">已审核</a>
                    </li>
                    <li class=""><a data-toggle="tab" onclick="viewBystate(3)" href="#tab-4" aria-expanded="false">已撤销</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <!--草稿-->
                    <div id="tab-1"  class="tab-pane active">
                        <div class="panel-body"  id="main-content0">
                            <div class="ibox" th:fragment="main-content0"   style="background-color: #3c8dbc;" th:each="mode0:${Projectslist0}">
                                <div class="ibox-title">
                                    <span class="label label-primary pull-right">草稿</span>
                                    <span class="ibox-title" style="font-weight:bold " th:text="${#dates.format(mode0.submitdate, 'yyyy-MM-dd')}"></span>
                                    <span class="ibox-title" style="font-weight:bold " th:text="'预算单位:'+${mode0.submitunit}"></span>
                                    <span class="ibox-title" style="color: #1a7bb9" th:text="'状态:待审核'"></span>
                                </div>
                                <div class="ibox-content">
                                    <div class="row  m-t-sm">
                                        <div class="col-sm-10" >
                                            <h5>项目详情</h5>
                                            <p  th:text="'          项目名称:'+${mode0.rojectname}">
                                            <p  th:text="'          联系人:'+${mode0.linkman}">
                                            <p  th:text="'          手机号:'+${mode0.phone}">
                                        </div>
                                        <div class="col-sm-2" >
                                            <h5>操作</h5>
                                            <button type="button" onclick="viewByid(${mode0.id})" class="btn btn-w-m btn-primary">查看</button>
                                            <button style="margin-top: 10px;" type="button" class="btn btn-w-m btn-info"> 审核</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                    <!--待审核-->
                    <div id="tab-2"    class="tab-pane">
                        <div class="panel-body" id="main-content1" >
                            <div class="ibox" th:fragment="main-content1"  style="background-color: #3c8dbc;" th:each="mode1:${Projectslist1}">
                                <div class="ibox-title">
                                    <span class="label label-primary pull-right">待审核</span>
                                    <span class="ibox-title" style="font-weight:bold " th:text="${#dates.format(mode1.submitdate, 'yyyy-MM-dd')}"></span>
                                    <span class="ibox-title" style="font-weight:bold " th:text="'预算单位:'+${mode1.submitunit}"></span>
                                    <span class="ibox-title" style="color: #1a7bb9" th:text="'状态:待审核'"></span>
                                </div>
                                <div class="ibox-content">
                                    <div class="row  m-t-sm">
                                        <div class="col-sm-10" >
                                            <h5>项目详情</h5>
                                            <p  th:text="'          项目名称:'+${mode1.rojectname}">
                                            <p  th:text="'          联系人:'+${mode1.linkman}">
                                            <p  th:text="'          手机号:'+${mode1.phone}">
                                        </div>
                                        <div class="col-sm-2" >
                                            <h5>操作</h5>
                                            <button type="button" onclick="viewByid(${mode1.id})" class="btn btn-w-m btn-primary">查看</button>
                                            <button style="margin-top: 10px;" type="button" class="btn btn-w-m btn-info"> 审核</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                    <!--已审核-->
                    <div id="tab-3"  class="tab-pane">
                            <div class="panel-body" id="main-content2" >
                                <div class="ibox" th:fragment="main-content2"   style="background-color: #3c8dbc;" th:each="mode:${Projectslist2}">
                                    <div class="ibox-title">
                                        <span class="label label-primary pull-right">已审核</span>
                                        <span class="ibox-title" style="font-weight:bold " th:text="${#dates.format(mode.submitdate, 'yyyy-MM-dd')}"></span>
                                        <span class="ibox-title" style="font-weight:bold " th:text="'预算单位:'+${mode.submitunit}"></span>
                                        <span class="ibox-title" style="color: #1a7bb9" th:text="'状态:待审核'"></span>

                                    </div>
                                    <div class="ibox-content">
                                        <div class="row  m-t-sm">
                                            <div class="col-sm-10" >
                                                <h5>项目详情</h5>
                                                <p  th:text="'          项目名称:'+${mode.rojectname}">
                                                <p  th:text="'          联系人:'+${mode.linkman}">
                                                <p  th:text="'          手机号:'+${mode.phone}">
                                            </div>
                                            <div class="col-sm-2" >
                                                <h5>操作</h5>
                                                <button type="button" onclick="viewByid(${mode.id})" class="btn btn-w-m btn-primary">查看</button>
                                                <button style="margin-top: 10px;" type="button" class="btn btn-w-m btn-info"> 审核</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>


                    <!--已撤销-->
                    <div id="tab-4"  class="tab-pane">
                        <div class="panel-body" id="main-content3" >
                            <div class="ibox"  th:fragment="main-content3"  style="background-color: #3c8dbc;" th:each="mode:${Projectslist3}">
                                <div class="ibox-title">
                                    <span class="label label-primary pull-right">已撤销</span>
                                    <span class="ibox-title" style="font-weight:bold " th:text="${#dates.format(mode.submitdate, 'yyyy-MM-dd')}"></span>
                                    <span class="ibox-title" style="font-weight:bold " th:text="'预算单位:'+${mode.submitunit}"></span>
                                    <span class="ibox-title" style="color: #1a7bb9" th:text="'状态:待审核'"></span>

                                </div>
                                <div class="ibox-content">
                                    <div class="row  m-t-sm">
                                        <div class="col-sm-10" >
                                            <h5>项目详情</h5>
                                            <p  th:text="'          项目名称:'+${mode.rojectname}">
                                            <p  th:text="'          联系人:'+${mode.linkman}">
                                            <p  th:text="'          手机号:'+${mode.phone}">
                                        </div>
                                        <div class="col-sm-2" >
                                            <h5>操作</h5>
                                            <button type="button" onclick="viewByid(${mode.id})" class="btn btn-w-m btn-primary">查看</button>
                                            <button style="margin-top: 10px;" type="button" class="btn btn-w-m btn-info"> 审核</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>
</div>
</div>
</body>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script> var ctx = "\/"; var lockscreen = null; if(lockscreen){window.top.location=ctx+"lockscreen";} </script>
<a id="scroll-up" href="#" class="btn btn-sm display"><i class="fa fa-angle-double-up"></i></a>
<script src="/js/jquery.min.js?v=3.6.1"></script>
<script src="/js/bootstrap.min.js?v=3.3.7"></script>
<!-- bootstrap-table 表格插件 -->
<script src="/ajax/libs/bootstrap-table/bootstrap-table.min.js?v=1.18.3"></script>
<script src="/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=1.18.3"></script>
<script src="/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js?v=1.18.3"></script>
<!-- jquery-validate 表单验证插件 -->
<script src="/ajax/libs/validate/jquery.validate.min.js?v=1.19.3"></script>
<script src="/ajax/libs/validate/jquery.validate.extend.js?v=1.19.3"></script>
<script src="/ajax/libs/validate/messages_zh.js?v=1.19.3"></script>
<!-- bootstrap-table 表格树插件 -->
<script src="/ajax/libs/bootstrap-table/extensions/tree/bootstrap-table-tree.min.js?v=1.18.3"></script>
<!-- 遮罩层 -->
<script src="/ajax/libs/blockUI/jquery.blockUI.js?v=2.70.0"></script>
<script src="/ajax/libs/iCheck/icheck.min.js?v=1.0.3"></script>
<script src="/ajax/libs/layer/layer.min.js?v=3.5.1"></script>
<script src="/ajax/libs/layui/layui.min.js?v=2.7.5"></script>
<script src="/ruoyi/js/common.js?v=4.7.6"></script>
<script src="/ruoyi/js/ry-ui.js?v=4.7.6"></script>
<script th:inline="javascript">
    var prefix = ctx + "business/project"

    //选项卡查询不同数据
    function  viewBystate(state){
        console.log("选择状态"+state)
        $.ajax({
            type : "get",
            url : prefix + "/ByStatelist/"+state,
            error : function(request) {
                console.log("cuowuxinxi:"+request)
               // $.modal.alertError("系统错误");
            },
            success : function(data) {
               // $.operate.successCallback(data);
                console.log(data)
                if(state==0){
                    console.log(0)
                    $("#main-content0").html(data);
                }else if(state==1){
                    console.log(1)
                    $("#main-content1").html(data);
                }else if(state==2){
                    $("#main-content2").html(data);
                }else if(state==3){
                    $("#main-content3").html(data);
                }

                //$("#box3").children.remove();
                //$.modal.alertSuccess(data)
               // $.modal.closeTab();
            }
        });
    }

</script>

</html>

在这里插入图片描述

局部刷新重点,    th:fragment="main-content1"  在遍历元素加上,然后在父div 加上同名字的id 

页面必须直接放在template 目录下,不可放在新建文件里面

在这里插入图片描述

详细具体查看—转载此处

后端

 @RequiresPermissions("system:project:list")
    @GetMapping("/ByStatelist/{state}")
    public String aaa(ModelMap mmap,@PathVariable String state) {
        try {
            BusinessProject businessProject = new BusinessProject();
            businessProject.setState(state);
            log.info("根据状态查询实体类"+businessProject);
            startPage();
            List<BusinessProject> list = businessProjectService.selectBusinessProjectList(businessProject);
            if(businessProject.getState().equals("0")){
                mmap.put("Projectslist0",list);
                return "project::main-content0";
            } else if (businessProject.getState().equals("1")) {
                mmap.put("Projectslist1",list);
                 return "project::main-content1";
            }else if (businessProject.getState().equals("2")) {
                mmap.put("Projectslist2",list);
                return "project::main-content2";
            }else if (businessProject.getState().equals("3")) {
                mmap.put("Projectslist3",list);
                return "project::main-content3";
            }
            log.info("根据状态查询list: "+list);
            return "评审项目,局部刷新数据错误,!";

        } catch (Exception e) {
            throw new RuntimeException(e);
        }


    }

在这里插入图片描述

分页案例

分页插件

异步提交

1.pots方式

 $.ajax({
                cache : false,
                type : "POST",
                url : prefix + "/add",
                data : {
                    "rojectname": rojectname,
                    "submitunit": submitunit,
                    "linkman": linkman,
                    "phone": phone,
                    "calls": calls,
                    "enableqqkzj": enableqqkzj,
                    //估算
                    "estimatemoney": estimatemoney,
                    "estimateengmoney": estimateengmoney,
                    "estimateengothermoney": estimateengothermoney,
                    "estimatereadymoney": estimatereadymoney,
                    //概算
                    "budgetmoney": budgetmoney,
                    "budgetengmoney": budgetengmoney,
                    "budgetengothermoney": budgetengothermoney,
                    "budgetreadymoney": budgetreadymoney,
                    //附件
                    "accessorypf": accessorypf,
                    "accessorykxxbg": accessorykxxbg,
                    "accessorycbsj": accessorycbsj,
                    "accessorycbsjpf": accessorycbsjpf,
                    "accessorywth": accessorywth,
                    "accessorypsxmb": accessorypsxmb,
                    "electronicdrawing": electronicdrawing,
                    "accessory": accessory,
                },
                async : false,
                error : function(request) {
                    $.modal.alertError("系统错误");
                },
                success : function(data) {
                    $.operate.successCallback(data);
                    console.log(data)
                    $.modal.alertSuccess(data)
                    $.modal.closeTab();
                }
            });

2.get方式

    //跳转通过id查看页面
        function view(projectid){
            console.log("通过id查看页面"+projectid);

            $.modal.openTab('查看报审项目', prefix + "/view/"+projectid);
        }

若依系统导入表格并解析表格入库(案例分析)

效果图
在这里插入图片描述

后端接口代码

  /**
     * 导入表格解析
     */
    @PostMapping("/uploadFileSave")
    @ResponseBody
    public AjaxResult uploadFileSave(@RequestParam("file") MultipartFile file,@RequestParam("filepath") String filepath)
    {
       try {
           log.info("【导入表格解析】入参file:"+file);
          // 上传文件路径
            String filePath = RuoYiConfig.getUploadPath();
            // 上传并返回新文件名称
            String fileName = FileUploadUtils.upload(filePath, file);
            log.info("【导入表格解析】新文件的名称"+fileName);
            log.info("【导入表格解析】新文件的路径"+filePath);
            //开始解析
            if(StringUtils.isBlank(fileName)){
                return  error("文件上传错误!");
            }
            //上传到本地服务器地址为:
           int i = fileName.lastIndexOf("upload/");
           String substring = fileName.substring(i + 6);
           filePath=filePath+substring;
           log.info("【导入表格解析】新文件的路径"+filePath);

           InputStream is = new FileInputStream(new File(filePath));
           //开始解析
           ExcelUtil<BusinessProject> util = new ExcelUtil<BusinessProject>(BusinessProject.class);
           List<BusinessProject> list = util.importExcel(is,3);
           log.info("[导入表格解析]解析之后的集合:"+list);
           int success =0;
           int err=0;
           for (BusinessProject businessProject : list) {
               businessProject.setState("4");
               businessProject.setEnableqqkzj("0");
               businessProject.setRojectid(IdUtils.fastSimpleUUID());
               if(businessProject.getAuthorizedmoney()>businessProject.getReportmoney()){
                   throw new RuntimeException("[档案馆]["+businessProject.getRojectname()+"][审定金额大于报审金额!无法填报!]");
               }
           }

       }catch (Exception e) {
           throw new RuntimeException("[(注意表头必须在第四行)导入档案馆表格出现错误:]"+e);
       }

        return success("表格已导入档案馆!");
    }



}

前端代码


               <a class="btn btn-primary"  onclick="clickbtn()">
                   <i class="fa fa-cloud-upload"></i>
                   表格导入档案馆
               </a>

            <input id="filePath" onchange="uploadFile(this.files)" style="display: none;" name="filePath" class="btn btn-primary form-control"  type="file">

前端js

//点击  button代替input file 修改样式
function clickbtn() {
    file = document.getElementById("filePath");
            if(file){
                $('#filePath').click();
            }

}


//导入数据
function uploadFile() {
       //构建返回data
        var formData = new FormData();
        //判断是否选择路径文件
        if ($('#filePath')[0].files[0] == null) {
            $.modal.alertWarning("请先选择文件路径");
            return false;
        }
        let file = $("#filePath").val();
        console.log(file)
        //判断是否文件是xls或者xlsx
        if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))) {
            $.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。");
            return false;
        }
		//data 构造 (字段,值)
        formData.append('filepath', file);
        formData.append('file', $('#filePath')[0].files[0]);
		//异步请求接口
    $.ajax({
        url: prefixda + "/uploadFileSave",
        data: formData,
        cache: false,
        contentType: false,
        processData: false,
        type: 'POST',
        success: function (result) {
            if (result.code == web_status.SUCCESS) {
                $.modal.closeAll();
                $.modal.alertSuccess(result.msg);
                //成功后表格刷新
                $.table.refresh();
            } else if (result.code == web_status.WARNING) {

                $.modal.enable();
                $.modal.alertWarning(result.msg)
            } else {

                $.modal.enable();
                $.modal.alertError(result.msg);
            }
        }});

}

若依系统根据表格勾选导出数据

效果图
在这里插入图片描述

前端

 <a class="btn btn-warning" onclick="checkItem()" >
                    <i class="fa fa-download"></i> 导出
                </a>

前端js

// 导出数据到表格
function checkItem(){
    // var arrays = $.table.selectColumns("userId");
    var arrays = $.table.selectColumns("rojectid");
   // alert(arrays);
    $.modal.loading("正在导出数据,请稍候...");
    $.ajax({
        type : "POST",
        url : ctx + "business/project/export",
        data : {
            "arrays_ids": arrays.toString(),
        },
        async : false,
        error : function(request) {
            console.log("填报返回结果错误:"+request)
            $.modal.alertError("系统错误");
        },
        success : function(result) {
                if (result.code == web_status.SUCCESS) {
                    console.log("成功:")
                    console.log(result)
                    window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
                } else if (result.code == web_status.WARNING) {
                    $.modal.alertWarning(result.msg)
                } else {
                    $.modal.alertError(result.msg);
                }
            $.modal.closeLoading();

        }
    });
    
}

后端

 /**
     * 导出【评审项目】列表
     */
    @Log(title = "【评审项目】", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(@RequestParam("arrays_ids") String ids  )
    {
        log.info("[导出表格][入参]"+ids);
        List<BusinessProject> list =new ArrayList<>() ;
        String[] split = ids.split(",");
        for (String s : split) {
            if(StringUtils.isBlank(s)){

            }else {
                BusinessProject businessProjects = businessProjectService.selectBusinessProjectByRojectid(s);
                list.add(businessProjects);
            }
        }
        // businessProjectService.selectBusinessProjectList(businessProject);
        ExcelUtil<BusinessProject> util = new ExcelUtil<BusinessProject>(BusinessProject.class);
        return util.exportExcel(list, "【评审项目】数据");
    }

模板下载

在这里插入图片描述
前端

  <a  onclick="mobanxiazai()" >
                    <i class="fa fa-download"></i> 导入模版下载
                </a>

前端js

//模板下载
function mobanxiazai(){
    $.modal.msgSuccess("模板下载成功!",5000)
    window.location.href =  "/ImportTemplate/【评审项目】导入数据模板.xlsx";
}

idea 设置模板文件
在这里插入图片描述

div悬浮效果

效果图
在这里插入图片描述

   <style>
       .buttonDiv{
        }
        .buttonDiv:hover{
            position:relative;
            top:-10px;
            left:-10px;
            box-shadow: 10px 10px 5px #888888;
        }
        .buttonDiv>i{
            position:relative;
            color:#2959ad;
        }
    </style>

在这里插入图片描述

大数据平台

在这里插入图片描述

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <th:block th:include="include :: header('图表组合')" />
  <link href="/css/bootstrap.min.css?v=3.3.7" rel="stylesheet"/>
  <link href="/css/font-awesome.min.css?v=4.7.0" rel="stylesheet"/>
  <link rel="stylesheet" href="/shujupingtai/css/index.css">
  <title>二连浩特市财政预算评审综合管理系统数据平台</title>
</head>
<body>
<div class="t_container">
  <header class="t_header">
    <span>二连浩特市财政预算评审大数据平台</span>
  </header>
  <main class="t_main">
<!--    //三个方块 显示金额-->
    <div class="t_left_box">
      <div class="t_mbox t_rbox">
        <i></i>
        <span>[[${year}]]年控制价审定金额</span>
        <h2>[[${
          #numbers.formatDecimal(kzj_totle,1,'COMMA',4,'POINT')
          }]]万元</h2>
      </div>
      <div class="t_mbox t_gbox">
        <i></i>
        <span>[[${year}]]年结算报审金额</span>
        <h2>[[${
          #numbers.formatDecimal(totle_js_ss,1,'COMMA',4,'POINT')
          }]]万元</h2>
      </div>
      <div class="t_mbox t_ybox">
        <i></i>
        <span>[[${year}]]年结算审定金额</span>
        <h2>[[${
          #numbers.formatDecimal(totle_js_sd,1,'COMMA',4,'POINT')
          }]]万元</h2>
      </div>
    </div>

<!--    //中间显示评审项目数量 和地图-->
    <div class="t_center_box">
      <div class="t_top_box">
        <ul class="t_nav">
          <li>
            <span>评审总项目数</span>
            <h1>[[${total}]]</h1>
            <i></i>
          </li>
          <li>
            <span>控制价评审项目数</span>
            <h1>[[${kzj_size}]]</h1>
            <i></i>
          </li>
          <li>
            <span>结算项目数</span>
            <h1>[[${js_size}]]</h1>
            <i></i>
          </li>
        </ul>
      </div>
<!--      //中间二连浩特市地图显示-->
      <div class="t_bottom_box">
        <div id="chart_3" class="echart" style="width: 100%; height: 3.6rem;"></div>
      </div>
    </div>


    <!--最右侧 柱状图-->
    <div class="t_right_box">

      <div id="chart_2" class="echart" style="height: 4.6rem;"></div>

    </div>


    <div class="b_left_box">
      <h1 class="t_title">[[${year}]]年Top3评审项目</h1>
      <table class="t_table">
        <thead >
        <tr style=" text-align: center; ">
          <th>申请时间</th>
          <th>送审项目</th>
          <th>送审单位</th>
          <th>前期是否编制控制价</th>
          <th>状态</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="buy:${pingshenlist}">
          <td th:text="
${#dates.format(buy.submitdate,'yyyy-MM-dd HH:mm:ss')}

"></td>
          <td th:text="${buy.rojectname}"></td>
          <td th:text="${buy.submitunit}"></td>
          <td th:if="${buy.enableqqkzj} eq '1' "></td>
          <td th:if="${buy.enableqqkzj} eq '0' "></td>

          <td th:if="${buy.state} eq '0'">草稿</td>
          <td th:if="${buy.state} eq '1'">待审核</td>
          <td th:if="${buy.state} eq '2'">待填报控制价</td>
          <td th:if="${buy.state} eq '3'">待结算</td>
          <td th:if="${buy.state} eq '4'">已完成</td>
          <td th:if="${buy.state} eq '5'">已终止</td>
        </tr>
        </tbody>
      </table>

    </div>

    <!--并状态-->
    <div class="b_center_box">

      <div id="chart_1" class="echart" style="width: 100%; height: 3.6rem; "></div>

    </div>
    <!--最后-->
    <div class="b_right_box">
      <div id="chart_4" style="position: relative;height:3.6rem;overflow: hidden; " ></div>
    </div>

  </main>
</div>
<script src="/shujupingtai/js/jquery-2.2.1.min.js"></script>
<script src="/shujupingtai/js/rem.js"></script>
<script src="/shujupingtai/js/echarts.min.js"></script>
<script src="/shujupingtai/js/erlians.js"></script>
<!--<script src="/shujupingtai/js/index.js"></script>-->
<script>
  $(function () {
    echart_1();
    echart_2();
    echart_3();
    echart_4();
    linyiChart();
    //饼状图
    function echart_1() {
      var dangernum=[[${totle_js_sj}]];
      var Greennum=[[${totle_js_ss}]];

      // 基于准备好的dom,初始化echarts实例
      var myChart = echarts.init(document.getElementById('chart_1'));
      option = {
        title: {
          text: [[${year}]]+'年结算报审金额与审减金额比例',
          top: 35,
          left: 20,
          textStyle: {
            fontSize: 18,
            color: '#fff'
          }
        },
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        series: [{
          name: '单位:万元',
          type: 'pie',
          radius: '65%',
          center: ['50%', '50%'],
          color: ['#2ca3fd', '#d9780b'],
          label: {
            normal: {
              formatter: '{b}\n{d}%'
            },

          },
          grid:{
            left:'8%',
            right:'0',
            bottom:'1%',
            containLabel:true
          },
          data: [{
            value: dangernum,
            name: '审减金额'
          },
            {
              value: Greennum,
              name: '报审金额',
              selected: true
            }
          ]
        }]
      };
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    }

    //柱状图
    function echart_2() {

      var kzj=[[${array_kzj}]]
      var js=[[${array_js}]]
      console.log("大数据柱状图——控制价:"+kzj);
      console.log("大数据柱状图--结算:"+js);
      // 基于准备好的dom,初始化echarts实例
      var myChart = echarts.init(document.getElementById('chart_2'));

      option = {
        title: {
          text: [[${year}]]+'年控制价和结算审定金额',
          textStyle: {
            fontSize: 18,
            color: '#fff'
          }
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: ['控制价', '结算审定金额']
        },
        toolbox: {
          show: true,
          feature: {
            dataView: { show: true, readOnly: true },
            magicType: { show: true, type: ['line', 'bar'] },
            restore: { show: true },
            saveAsImage: { show: true }
          }
        },
        calculable: true,
        xAxis: [
          {
            type: 'category',
            // prettier-ignore
            data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
            axisLabel:{
              show: true,
              textStyle: {
                color: '#fff'
              }
            }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel:{
              show: true,
              formatter:'{value}万元',
              textStyle: {
                color: '#fff'
              }
            }
            ,
            show:true
          }
        ],
        series: [
          {
            name: '控制价',
            type: 'bar',
            color: '#2ca3fd',
            data: /*[
              2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
            ]*/kzj,
            markPoint: {
              data: [
                { type: 'max', name: 'Max' },
                { type: 'min', name: 'Min' }
              ]
            },
            markLine: {
              data: [{ type: 'average', name: 'Avg' }]
            }
          },
          {
            name: '结算审定金额',
            type: 'bar',
            color:  '#d9780b',
            data: /*[
              2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
            ]*/js,
            markPoint: {
              data: [
                { name: 'Max',type: 'max'},
                { name: 'Min', type: 'min' }
              ]
            },
            markLine: {
              data: [{ type: 'average', name: 'Avg' }]
            }
          }
        ]
      };

      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    }


    function linyiChart() {
      var linyiMapChart = echarts.init(document.getElementById('linyiMap'))
      echarts.registerMap('linyi', linyiMap, {})
      //echarts提供的方法echarts.registerMap(名称,地图数据,其他配置)
      option = {
        series: [
          {
            type: 'map',
            mapType: 'linyi',//名称需要echarts.registerMap('linyi',linyiMap,{})中的名称一致
            label: { show: true }, //显示文字
            roam: true,
            data: [],
          },
        ],
      }
      linyiMapChart.setOption(option)
      window.addEventListener('resize', function () {
        linyiMapChart.resize()
      })
    }


    //地图
    function echart_3() {
      // 基于准备好的dom,初始化echarts实例
      var myChart = echarts.init(document.getElementById('chart_3'));

      function showProvince() {
        var geoCoordMap = {
          '二连浩特市': [111.94300677940726,
            43.63998921077686],
          /*    '柳州': [109.412578,24.354875],
              '梧州': [111.323462,23.478238],
              '南宁': [108.359656,22.81328],
              '北海': [109.171374,21.477419],
              '崇左': [107.347374,22.377503]*/
        };
        var data = [{
          name: '二连浩特市',
          value: 100
        }/*,
                {
                    name: '柳州',
                    value: 100
                },
                {
                    name: '梧州',
                    value: 100
                },
                {
                    name: '北海',
                    value: 100
                },
                {
                    name: '崇左',
                    value: 100
                }*/
        ];
        var max = 480,
                min = 9; // todo
        var maxSize4Pin = 100,
                minSize4Pin = 20;
        var convertData = function (data) {
          var res = [];
          for (var i = 0; i < data.length; i++) {
            var geoCoord = geoCoordMap[data[i].name];
            if (geoCoord) {
              res.push({
                name: data[i].name,
                value: geoCoord.concat(data[i].value)
              });
            }
          }
          return res;
        };

        myChart.setOption(option = {
          title: {
            text: '二连浩特市',
            subtext: '',
            x: 'center',
            textStyle: {
              color: '#FFF'
            },
            left: '6%',
            top: '10%'
          },
          legend: {
            orient: 'vertical',
            y: 'bottom',
            x: 'right',
            data: ['pm2.5'],
            textStyle: {
              color: '#fff'
            }
          },
          visualMap: {
            show: false,
            min: 0,
            max: 480,
            left: 'left',
            top: 'bottom',
            text: ['高', '低'], // 文本,默认为数值文本
            calculable: true,
            seriesIndex: [1],
            inRange: {}
          },
          geo: {
            show: true,
            map: 'guangxi',
            mapType: 'guangxi',
            label: {
              normal: {},
              //鼠标移入后查看效果
              emphasis: {
                textStyle: {
                  color: '#fff'
                }
              }
            },
            //鼠标缩放和平移
            roam: true,
            itemStyle: {
              normal: {
                //          	color: '#ddd',
                borderColor: 'rgba(147, 235, 248, 1)',
                borderWidth: 1,
                areaColor: {
                  type: 'radial',
                  x: 0.5,
                  y: 0.5,
                  r: 0.5,
                  colorStops: [{
                    offset: 0,
                    color: 'rgba(175,238,238, 0)' // 0% 处的颜色
                  }, {
                    offset: 1,
                    color: 'rgba(	47,79,79, .1)' // 100% 处的颜色
                  }],
                  globalCoord: false // 缺省为 false
                },
                shadowColor: 'rgba(128, 217, 248, 1)',
                shadowOffsetX: -2,
                shadowOffsetY: 2,
                shadowBlur: 10
              },
              emphasis: {
                areaColor: '#389BB7',
                borderWidth: 0
              }
            }
          },
          series: [{
            name: 'light',
            type: 'map',
            coordinateSystem: 'geo',
            data: convertData(data),
            itemStyle: {
              normal: {
                color: '#F4E925'
              }
            }
          },
            {
              name: '点',
              type: 'scatter',
              coordinateSystem: 'geo',
              symbol: 'pin',
              symbolSize: function (val) {
                var a = (maxSize4Pin - minSize4Pin) / (max - min);
                var b = minSize4Pin - a * min;
                b = maxSize4Pin - a * max;
                return a * val[2] + b;
              },
              label: {
                normal: {
                  // show: true,
                  // textStyle: {
                  //     color: '#fff',
                  //     fontSize: 9,
                  // }
                }
              },
              itemStyle: {
                normal: {
                  color: '#F62157', //标志颜色
                }
              },
              zlevel: 6,
              data: convertData(data),
            },
            {
              name: 'light',
              type: 'map',
              mapType: 'hunan',
              geoIndex: 0,
              aspectScale: 0.75, //长宽比
              showLegendSymbol: false, // 存在legend时显示
              label: {
                normal: {
                  show: false
                },
                emphasis: {
                  show: false,
                  textStyle: {
                    color: '#fff'
                  }
                }
              },
              roam: true,
              itemStyle: {
                normal: {
                  areaColor: '#031525',
                  borderColor: '#FFFFFF',
                },
                emphasis: {
                  areaColor: '#2B91B7'
                }
              },
              animation: false,
              data: data
            },
            {
              name: ' ',
              type: 'effectScatter',
              coordinateSystem: 'geo',
              data: convertData(data.sort(function (a, b) {
                return b.value - a.value;
              }).slice(0, 5)),
              symbolSize: function (val) {
                return val[2] / 10;
              },
              showEffectOn: 'render',
              rippleEffect: {
                brushType: 'stroke'
              },
              hoverAnimation: true,
              label: {
                normal: {
                  formatter: '{b}',
                  position: 'right',
                  show: true
                }
              },
              itemStyle: {
                normal: {
                  color: '#05C3F9',
                  shadowBlur: 10,
                  shadowColor: '#05C3F9'
                }
              },
              zlevel: 1
            },

          ]
        });
      }
      showProvince();

      // 使用刚指定的配置项和数据显示图表。
      // myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    }

    //马力图
    function echart_4() {

      // 基于准备好的dom,初始化echarts实例
      var myChart = echarts.init(document.getElementById('chart_4'));
      var data = [[${totle_js_sjl}]];
      console.log("大数据审减率:"+data);

      var myColor = ['#1089E7', '#F57474', '#56D0E3', '#F8B448', '#8B78F6'];
      option = {
        title: {
          text: [[${year}]]+'年审减率',
          textStyle: {
            fontSize: 18,
            color: '#fff'
          }
        },
        series: [
          {
            type: 'gauge',
            axisLine: {
              lineStyle: {
                width: 15,
                color: [
                  [0.3, '#67e0e3'],
                  [0.7, '#37a2da'],
                  [1, '#fd666d']
                ]
              }
            },
            pointer: {
              itemStyle: {
                color: 'auto'
              }
            },
            axisTick: {
              distance: -30,
              length: 8,
              lineStyle: {
                color: '#fff',
                width: 2
              }
            },
            splitLine: {
              distance: -30,
              length: 15,
              lineStyle: {
                color: '#fff',
                width: 4
              }
            },
            axisLabel: {
              color: '#inherit',
              distance: 10,
              fontSize: 12
            },
            detail: {
              valueAnimation: true,
              formatter: '审减率{value}%',
              color: '#67e0e3',
              fontSize: 12
            },
            data: [
              {
                value: data
              }
            ]
          }
        ]
      };

      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
      // window.addEventListener("resize", function () {
      //     myChart.resize();
      // });
    }
  });

</script>
</body>
</html>

报表平台(查询生成word文档)

在这里插入图片描述
因内网系统无连接外网,连接外网可对接第三方"帆软平台"进行生成文档 显示

前端代码

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <th:block th:include="include :: header('报表平台')" />
  <th:block th:include="include :: bootstrap-fileinput-css" />
  <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
<div class="container-div">
  <div class="row">
    <div class="col-sm-12 search-collapse">
      <form id="formId">
        <div class="select-list">
          <ul>

            <li>
              <label>开始日期:</label>

              <input type="text"    name="strt_submitdate"  id="laydate-startTime" placeholder="请选择开始日期yyyy-MM-dd"/>
            </li>

            <li>
              <label>截至日期:</label>
              <input type="text"   name="end_submitdate" id="laydate-endTime" placeholder="请选择截至日期yyyy-MM-dd"/>

            </li>

            <li>
              <a class="btn btn-primary btn-rounded btn-sm" onclick="reportShreach()"><i class="fa fa-search"></i>&nbsp;报表查询</a>
              <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
            </li>
          </ul>
        </div>
      </form>
    </div>



    <div class="btn-group-sm" id="toolbar" role="group">
      <a class="btn btn-primary"  onclick="reportExport()">
        <i class="fa fa-file-word-o"></i></i>
        报告导出
      </a>
      <a class="btn btn-info"  onclick="mingxiExport()">
        <i class="fa fa-file-excel-o"></i>
        明细导出[核对]
      </a>
      <input id="export" type="hidden">
      <input id="mingxi" type="hidden">
    </div>
  </div>


 <!-- <div class="row">
    https://view.xdocin.com/view?src=你的文档地址
    <a href=" https://view.xdocin.com/view?src=" target="_blank" rel="nofollow"></a>

  </div>-->

</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/ajax/libs/layui/layui.min.js?v=2.7.5}"></script>
<script src="/viewerjs/viewer.min.js"></script>
<script th:inline="javascript">

  var prefixda = ctx + "business/DangAn"
  //页面加载函数
  $(function() {
    <!-- laydate示例 -->
    //开始时间
    layui.use('laydate', function(){
      var laydate = layui.laydate;
      var startDate = laydate.render({
        elem: '#laydate-startTime',
        max: $('#laydate-endTime').val(),
        theme: 'molv',
        trigger: 'click',
        done: function(value, date) {
          // 结束时间大于开始时间
          if (value !== '') {
            endDate.config.min.year = date.year;
            endDate.config.min.month = date.month - 1;
            endDate.config.min.date = date.date;
          } else {
            endDate.config.min.year = '';
            endDate.config.min.month = '';
            endDate.config.min.date = '';
          }
        }
      });

      //  结束
      var endDate = laydate.render({
        elem: '#laydate-endTime',
        min: $('#laydate-startTime').val(),
        theme: 'molv',
        trigger: 'click',
        done: function(value, date) {
          // 开始时间小于结束时间
          if (value !== '') {
            startDate.config.max.year = date.year;
            startDate.config.max.month = date.month - 1;
            startDate.config.max.date = date.date;
          } else {
            startDate.config.max.year = '';
            startDate.config.max.month = '';
            startDate.config.max.date = '';
          }
        }
      });

    });


  })

  //报表导出
  function reportExport(){
    var filepath=$('#export').val();
    //window.location.href =  "/ImportTemplate/【评审项目】导入数据模板.xlsx";
    window.location.href =  filepath;
    $.modal.msgSuccess("总结报告下载成功!",5000)
  }

  //明细导出
  function mingxiExport(){
    var filepath=$('#mingxi').val();
    //window.location.href =  "/ImportTemplate/【评审项目】导入数据模板.xlsx";
    window.location.href =  filepath;
    $.modal.msgSuccess("明细表下载成功!",5000)
  }

  //文件预览
  function ciew_file(){
    // 获取要预览的 Word 文档的 URL
   // let wordDocUrl = 'your_word_doc_url';
    var filepath=$('#export').val();
console.log("开始预览");
console.log(filepath);
    var viewer = new Viewer(document.getElementById('preview'), {
      url: filepath,
      // 其他配置选项...
    });
// 初始化 Viewer.js
  /*  Viewer.init({
      container: '#preview', // 预览容器的 ID
      url: filepath // Word 文档的 URL
    });*/
  }


  // 报表查询
  function reportShreach(){
    let start = $('input[name="strt_submitdate"]').val();
    let end = $('input[name="end_submitdate"]').val();
    if(start.length==0){
      $.modal.alertError("请选择开始时间!")
      return
    }
    if(end.length==0){
      $.modal.alertError("请选择结束时间!")
      return
    }
    $.modal.loading("正在查询数据,请稍候...");
    $.ajax({
      type : "POST",
      url : prefixda + "/reportExport",
      data : {
        "submitdate": start,
        "end_submitdate": end,
      },
      async : false,
      error : function(request) {
        console.log("填报返回结果错误:"+request)
        $.modal.alertError("系统错误");
      },
      success : function(result) {

        if (result.code == web_status.SUCCESS) {
          console.log("成功:")
          console.log(result)
         // window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
          //文件预览


          //word  url
          var hddata=result.data

          console.log(hddata)
          console.log(hddata.wordurl)
          console.log(hddata.mingxi)
          //$('#export').val(result.data.'wordurl');
          $('#export').val(hddata.wordurl);
          $('#mingxi').val(hddata.mingxi);

          ciew_file();
          $.modal.msgSuccess(result.msg,5000)
          //window.location.href =  "/ImportTemplate/【评审项目】导入数据模板.xlsx";

        } else if (result.code == web_status.WARNING) {
          $.modal.alertWarning(result.msg)
        } else {
          $.modal.alertError(result.msg);
        }
        $.modal.closeLoading();
      }
    });
  }




</script>
</body>
</html>

后端代码

 /**
     * 跳转评审项目报表平台页面
     */
    @GetMapping("/reportExport_view")
    public String reportExport_view()
    {
        log.info("[跳转报表平台页面]");
        return "czps/reportExport/repoetExport";
    }
 /**
     * 评审项目报表导出
     */
    @PostMapping("/reportExport")
    @ResponseBody
    public AjaxResult reportExport(@RequestParam Map<String, Object> map)
    {
        List<BusinessProject> businessProjectslist=null;
        try {
            log.info("[评审项目报表导出][入参数据:]"+map.toString());
            //获取参数,根据时间范围查询评审项目
            String  start = map.get("submitdate").toString();
            String  end = map.get("end_submitdate").toString();

            if(StringUtils.isBlank(start) || StringUtils.isBlank(end)){
                throw new Exception("[评审项目报表导出][入参为空]"+map);
            }

            //map.put("state",4);

            List<BusinessProject> businessProjects = businessProjectService.SreachBusinessProjectListByreport(map);
            log.info("[评审项目报表导出][查询数据:]"+businessProjects.toString());

            //总项目数
            int size = businessProjects.size();
            map.put("size",size);
            LinkedHashMap<String, Double> kzj = new LinkedHashMap<>();
            //计算控制价项目
            for (BusinessProject businessProject : businessProjects) {

                if( businessProject.getCheckprice()==null){
                    break;
                }
                if(businessProject.getCheckprice()==0.0){
                    break;
                }
                kzj.put(businessProject.getRojectname(),businessProject.getCheckprice());
            }
            log.info("[评审项目报表导出][控制价map数据:]"+kzj.toString());
            //控制价个数
            map.put("kzj_size",kzj.size());
            log.info("[评审项目报表导出][控制价项目个数:]"+kzj.size());
            //控制价
            double totle_kzj=0.00;
            for (Map.Entry<String, Double> entry : kzj.entrySet()) {

                BigDecimal bigDecimal = new BigDecimal(entry.getValue());
                BigDecimal bigDecimal2 = new BigDecimal(totle_kzj);
                BigDecimal add = bigDecimal.add(bigDecimal2);
                totle_kzj = add.doubleValue();
            }
            BigDecimal totle_kzj_bd = new BigDecimal(totle_kzj);
            String v = totle_kzj_bd.setScale(4, BigDecimal.ROUND_HALF_UP).toString();
            log.info("[评审项目报表导出][控制价项目总价double:]"+totle_kzj);
            log.info("[评审项目报表导出][控制价项目总价db:]"+v);
            map.put("kzj_totle",v);

            //计算结算价项目
            LinkedHashMap<String, ReportExportDTO> js = new LinkedHashMap<>();
            for (BusinessProject businessProject : businessProjects) {

                if( businessProject.getReportmoney()==null || businessProject.getAuthorizedmoney()==null){
                    break;
                }
                if(businessProject.getReportmoney()==0.0 || businessProject.getAuthorizedmoney()==0.0){
                    break;
                }
                ReportExportDTO reportExportDTO = new ReportExportDTO();
                reportExportDTO.setAuthorizedmoney(businessProject.getAuthorizedmoney());
                reportExportDTO.setReportmoney(businessProject.getReportmoney());
                reportExportDTO.setReductionrate(businessProject.getReductionrate());
                reportExportDTO.setReducedmoney(businessProject.getReducedmoney());

                //
                js.put(businessProject.getRojectname(),reportExportDTO);
            }

            //结算项目数
            map.put("js_size",js.size());
            log.info("[评审项目报表导出][结算项目个数:]"+kzj.size());
            //送审金额_总 reportmoney
            //审定金额_总 authorizedmoney
            //审减金额_总 reducedmoney
            Double reportmoney_tole =0.0;
            Double authorizedmoney_tole =0.0;
            Double reducedmoney_tole =0.0;
            for (Map.Entry<String, ReportExportDTO> entry : js.entrySet()) {
                //送审
                BigDecimal bigDecimal1 = new BigDecimal(entry.getValue().getReportmoney());
                BigDecimal bigDecimal3 = new BigDecimal(reportmoney_tole);
                BigDecimal add1 = bigDecimal1.add(bigDecimal3);
                reportmoney_tole=add1.doubleValue();
                //审定
                BigDecimal bigDecimal2 = new BigDecimal(entry.getValue().getAuthorizedmoney());
                BigDecimal bigDecimal4 = new BigDecimal(authorizedmoney_tole);
                BigDecimal add2 = bigDecimal2.add(bigDecimal4);
                authorizedmoney_tole=add2.doubleValue();
                //减少
                BigDecimal bigDecimal5 = new BigDecimal(entry.getValue().getReducedmoney());
                BigDecimal bigDecimal6 = new BigDecimal(reducedmoney_tole);
                BigDecimal add3 = bigDecimal5.add(bigDecimal6);
                reducedmoney_tole=add3.doubleValue();
            }

            double totle_js_ss = new BigDecimal(reportmoney_tole).setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue();
            map.put("totle_js_ss",totle_js_ss);
            log.info("[评审项目报表导出][结算送审金额总价:]"+totle_js_ss);
            double totle_js_sd = new BigDecimal(authorizedmoney_tole).setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue();
            map.put("totle_js_sd",totle_js_sd);
            log.info("[评审项目报表导出][结算审定金额总价:]"+totle_js_sd);
            double totle_js_sj = new BigDecimal(reducedmoney_tole).setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue();
            map.put("totle_js_sj",totle_js_sj);
            log.info("[评审项目报表导出][结算审减金额总价:]"+totle_js_sj);
            //审减率
            if(reportmoney_tole==0.0){
                map.put("totle_js_sjl",0.0);
                log.info("[评审项目报表导出][送审金额为0,结算审减率为0]");
            }else {
                BigDecimal sj = new BigDecimal(reducedmoney_tole);
                BigDecimal ss = new BigDecimal(reportmoney_tole);
                BigDecimal bigDecimal = new BigDecimal(100);
                BigDecimal divide = sj.divide(ss,2, BigDecimal.ROUND_HALF_UP)
                        .multiply(bigDecimal)
                        .setScale(2, BigDecimal.ROUND_HALF_UP);

                map.put("totle_js_sjl",divide.toString());
                log.info("[评审项目报表导出][结算审减率:]"+divide.toString());
            }





            //开始生成报表
            String localPath = RuoYiConfig.getProfile()+"/word";
            log.info("[评审项目报表导出][导出路径]"+localPath);


            // 创建 File 对象
            File file = new File(localPath);

            // 判断路径是否存在
            if (file.exists()) {
                log.info("文件路径存在");
            } else {
                // 如果路径不存在,则创建该路径
                file.mkdirs();
                log.info("文件路径不存在,已创建");
            }


            // 插件列表,可以去官网查看,有列循环,还有行循环,这里是行循环实例
            LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
            //这里可以指定一个config类,用来指定一些规则,也可以改变模板中{{}}的这种格式
            Configure config = Configure.builder()
                    .bind("list", policy).build();

            XWPFTemplate compile = XWPFTemplate.compile( new ClassPathResource("templates/doc/czps/二连浩特市财政投资评审中心工作报告.docx").getFile(),config).render(map);
            //设置输出文件名字
            String outFilename ="/out_二连浩特市财政绩效评审服务中心服务报告_" + System.currentTimeMillis() + ".docx";
            compile.writeToFile(localPath+outFilename);
            log.info("[评审项目报表导出][输出成功]"+localPath+outFilename);
            //word 下载地址
            String url="http://localhost/profile/word"+outFilename;
            //明细下载
            ExcelUtil<BusinessProject> util = new ExcelUtil<BusinessProject>(BusinessProject.class);
            AjaxResult mingxi = util.exportExcel(businessProjects, "总结报告数据明细");
            String filename = mingxi.get("msg").toString();
            log.info("[评审项目报表导出][明细数据filename]"+filename);
            if(StringUtils.isBlank(filename)){
                throw new Exception("[评审项目报表导出][明细数据filename为空!]");
            }
            String mingxiurl = "http://localhost/profile/download/"+filename;

            //返回结果
            HashMap<String, String> stringStringHashMap = new HashMap<>();
            stringStringHashMap.put("wordurl",url);
            stringStringHashMap.put("mingxi",mingxiurl);


            return AjaxResult.success("报告生成成功,可下载明细进行核对!",stringStringHashMap);


        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.error("生成失败!"+e.getMessage());
        }


    }

导入解析excel存入数据库(电子档案馆)

在这里插入图片描述

前端代码

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('【请填写功能名称】列表')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>项目名称:</label>
                            <input type="text" name="rojectname"/>
                        </li>
                        <li>
                            <label>送审单位:</label>
                            <input type="text" name="submitunit"/>
                        </li>

                        <li>
                            <label>联系人:</label>
                            <input type="text" name="linkman"/>
                        </li>
                        <li>
                            <label>手机:</label>
                            <input type="text" name="phone"/>
                        </li>


                        <li>
                            <label>开始日期:</label>

                            <input type="text"    name="submitdate"  id="laydate-startTime" placeholder="请选择开始日期yyyy-MM-dd"/>
                        </li>

                        <li>
                            <label>截至日期:</label>
                            <input type="text"   name="end_submitdate" id="laydate-endTime" placeholder="请选择截至日期yyyy-MM-dd"/>

                        </li>


                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>



        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="checkItem()" >
                <i class="fa fa-download"></i> 导出excel
            </a>

          <!--  <a class="btn btn-primary"  onclick="reportExport()">
                <i class="fa fa-cloud-upload"></i>
                报告导出
            </a>-->

            <a class="btn btn-primary"  onclick="clickbtn()">
                <i class="fa fa-cloud-upload"></i>
                表格导入档案馆
            </a>

            <input id="filePath" onchange="uploadFile(this.files)" style="display: none;" name="filePath" class="btn btn-primary form-control"  type="file">
            <a  onclick="mobanxiazai()" >
                <i class="fa fa-download"></i> 导入模版下载
            </a>
        </div>



        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>

    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/ajax/libs/layui/layui.min.js?v=2.7.5}"></script>
<script th:inline="javascript">


    /*        var editFlag = [[${@permission.hasPermi('system:project:edit')}]];
            var removeFlag = [[${@permission.hasPermi('system:project:remove')}]];*/

    var viewFlag = [[${@permission.hasPermi('system:project:view')}]];
    var shenheFlag = [[${@permission.hasPermi('system:project:shenhe')}]];

    var prefix = ctx + "business/project"
    var prefixda = ctx + "business/DangAn"
    //页面加载函数
    $(function() {
        var options = {
            url: prefixda + "/list",
            modalName: "【评审项目】",
            columns: [{
                checkbox: true
            },
                {
                    field: 'rojectid',
                    title: '项目编号',
                    visible: false
                },
                {
                    field: 'rojectname',
                    title: '项目名称'
                },
                {
                    field: 'submitunit',
                    title: '送审单位'
                },
                {
                    field: 'linkman',
                    title: '联系人'
                },
                {
                    field: 'phone',
                    title: '手机'
                },
                {
                    field: 'calls',
                    title: '电话',
                    visible: false
                },
                {
                    field: 'budgetmoney',
                    title: '概算金额',
                    visible: false
                },
                {
                    field: 'budgetengmoney',
                    title: '概算的工程费',
                    visible: false
                },
                {
                    field: 'budgetengothermoney',
                    title: '概算工程建设其他费',
                    visible: false
                }, {
                    field: 'enableqqkzj',
                    title: '前期是否编制控制价',
                    visible: true,
                    formatter: function (value, row, index) {
                        if (row.enableqqkzj == '1') {
                            // return $.table.tooltip("是");
                            return '<span style="color: red">是</span>';
                        } else if (row.enableqqkzj == '0') {
                            // return $.table.tooltip("否");
                            return '<span >否</span>';
                        }
                    }

                },
                {
                    field: 'state',
                    title: '状态',
                    formatter: function (value, row, index) {

                        if (row.state == '0') {
                            return $.table.tooltip("草稿");
                        } else if (row.state == '1') {
                            return $.table.tooltip("待审核");
                        } else if (row.state == '2') {
                            return $.table.tooltip("待控制价填报");
                        } else if (row.state == '3') {
                            return $.table.tooltip("待结算");
                        } else if (row.state == '4') {
                            return $.table.tooltip("已完成");
                        } else if (row.state == '5') {
                            return $.table.tooltip("已终止");
                        }


                        /*  actions.push("<a class='btn btn-success btn-xs " + viewFlag + "'href='javascript:void(0)' οnclick='viewupload(\""+
                                  row.sanzhongyida +"\",\"三重一大及采购手续\")'><i class='fa fa-adn'></i>查看</a> ");
                              return actions.join('');*/
                    }
                },
                {
                    field: 'budgetreadymoney',
                    title: '概算预备费',
                    visible: false
                },
                {
                    field: 'estimatemoney',
                    title: '估算金额',
                    visible: false
                },
                {
                    field: 'estimateengmoney',
                    title: '估算工程费用',
                    visible: false
                },
                {
                    field: 'estimateengothermoney',
                    title: '估算工程建设其他费',
                    visible: false
                },
                {
                    field: 'estimatereadymoney',
                    title: '估算预备费',
                    visible: false
                },
                {
                    field: 'checkprice',
                    title: '控制价',
                    visible: false
                },
                {
                    field: 'authorizedmoney',
                    title: '审定金额',
                    visible: false
                },
                {
                    field: 'reportmoney',
                    title: '报审金额',
                    visible: false
                },
                {
                    field: 'reductionrate',
                    title: '审减率',
                    visible: false
                },
                {
                    field: 'reducedmoney',
                    title: '审减金额',
                    visible: false
                },
                {
                    field: 'submitdate',
                    title: '提交日期'
                },
                {
                    field: 'accessorypf',
                    title: '附件-发改委立项批复或领导批示',
                    visible: false
                },
                {
                    field: 'accessorykxxbg',
                    title: '附件-可行性研究报告',
                    visible: false
                },
                {
                    field: 'accessorycbsj',
                    title: '附件-初步设计',
                    visible: false
                },
                {
                    field: 'accessorycbsjpf',
                    title: '附件-发改委初步设计批复',
                    visible: false
                },
                {
                    field: 'accessorywth',
                    title: '附件-委托函',
                    visible: false
                },
                {
                    field: 'accessorypsxmb',
                    title: '附件-评审项目报审表(前期)',
                    visible: false
                },
                {
                    field: 'electronicdrawing',
                    title: '附件-图纸及电子版图纸',
                    visible: false
                },

                {
                    field: 'otheraccessory',
                    title: '其他附件',
                    visible: false
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        //已完成  档案查看
                        actions.push('<a class="btn btn-success btn-xs ' + viewFlag + '" href="javascript:void(0)" οnclick="view_dangan(\'' + row.rojectid + '\')"><i class="fa fa-edit"></i>档案查看</a> ');
                        actions.push('<a class="btn btn-primary btn-xs ' + shenheFlag + '" href="javascript:void(0)" οnclick="buchongziliao(\'' + row.rojectid + '\')"><i class="fa fa-edit"></i>补充资料</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);

        <!-- laydate示例 -->
        //开始时间
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            var startDate = laydate.render({
                elem: '#laydate-startTime',
                max: $('#laydate-endTime').val(),
                theme: 'molv',
                trigger: 'click',
                done: function(value, date) {
                    // 结束时间大于开始时间
                    if (value !== '') {
                        endDate.config.min.year = date.year;
                        endDate.config.min.month = date.month - 1;
                        endDate.config.min.date = date.date;
                    } else {
                        endDate.config.min.year = '';
                        endDate.config.min.month = '';
                        endDate.config.min.date = '';
                    }
                }
            });

            //  结束
            var endDate = laydate.render({
                elem: '#laydate-endTime',
                min: $('#laydate-startTime').val(),
                theme: 'molv',
                trigger: 'click',
                done: function(value, date) {
                    // 开始时间小于结束时间
                    if (value !== '') {
                        startDate.config.max.year = date.year;
                        startDate.config.max.month = date.month - 1;
                        startDate.config.max.date = date.date;
                    } else {
                        startDate.config.max.year = '';
                        startDate.config.max.month = '';
                        startDate.config.max.date = '';
                    }
                }
            });

    });


    })





    // 导出数据到表格
    function checkItem(){
        var arrays = $.table.selectColumns("rojectid");
        if (arrays.toString().length==0){
            $.modal.alertError("请勾选表格数据!");
            return;
        }

        $.modal.loading("正在导出数据,请稍候...");
        $.ajax({
            type : "POST",
            url : ctx + "business/project/export",
            data : {
                "arrays_ids": arrays.toString(),
            },
            async : false,
            error : function(request) {
                console.log("填报返回结果错误:"+request)
                $.modal.alertError("系统错误");
            },
            success : function(result) {

                if (result.code == web_status.SUCCESS) {
                    console.log("成功:")
                    console.log(result)
                    window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
                } else if (result.code == web_status.WARNING) {
                    $.modal.alertWarning(result.msg)
                } else {
                    $.modal.alertError(result.msg);
                }
                $.modal.closeLoading();
            }
        });
    }



    //点击
    function clickbtn() {
        file = document.getElementById("filePath");
        if(file){
            $('#filePath').click();
        }
    }
    //导入数据
    function uploadFile() {
        var formData = new FormData();
        if ($('#filePath')[0].files[0] == null) {
            $.modal.alertWarning("请先选择文件路径");
            return false;
        }
        // let file = $("input[name='filePath']").val();
        let file = $("#filePath").val();
        console.log(file)
        //  console.log(file2)

        if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))) {
            $.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。");
            return false;
        }

        formData.append('filename', file);
        formData.append('file', $('#filePath')[0].files[0]);

        $.ajax({
            url: prefixda + "/uploadFileSave",
            data: formData,
            cache: false,
            contentType: false,
            processData: false,
            type: 'POST',
            success: function (result) {
                if (result.code == web_status.SUCCESS) {
                    $.modal.closeAll();
                    $.modal.alertSuccess(result.msg);
                    $.table.refresh();
                } else if (result.code == web_status.WARNING) {

                    $.modal.enable();
                    $.modal.alertWarning(result.msg)
                } else {

                    $.modal.enable();
                    $.modal.alertError(result.msg);
                }
            }});

    }

    //模板下载
    function mobanxiazai(){
        $.modal.msgSuccess("模板下载成功!",5000)
        window.location.href =  "/ImportTemplate/【评审项目】导入数据模板.xlsx";
    }

    //补充资料
    function buchongziliao(projectid){
        $.modal.open('补充资料', prefix + "/buchongziliao/"+projectid);
    }

    //view_dangan 档案查看 状态为已完成
    function view_dangan(projectid){
        $.modal.openTab('档案查看', prefix + "/view_dangan/"+projectid);
    }





</script>
</body>
</html>

后端代码

 /**
     * 跳转评审档案页面
     */
    @GetMapping("/view")
    public String jsproject()
    {
        return "czps/danganguan/da_project";
    }

/**
     * 导入表格解析
     */
    @PostMapping("/uploadFileSave")
    @ResponseBody
    @Transactional
    public AjaxResult uploadFileSave(@RequestParam("file") MultipartFile file,@RequestParam("filename") String filename)
    {
        List<BusinessProject> list =new ArrayList<>();
        int success =0;
       try {
           log.info("【导入表格解析】入参file:"+file);
          // 上传文件路径
            String filePath = RuoYiConfig.getUploadPath();
            // 上传并返回新文件名称
            String fileName = FileUploadUtils.upload(filePath, file);
            log.info("【导入表格解析】新文件的名称"+fileName);
            log.info("【导入表格解析】新文件的路径"+filePath);
            //开始解析
            if(StringUtils.isBlank(fileName)){
                return  error("文件上传错误!");
            }
            //上传到本地服务器地址为:
           int i = fileName.lastIndexOf("upload/");
           String substring = fileName.substring(i + 6);
           filePath=filePath+substring;
           log.info("【导入表格解析】新文件的路径"+filePath);
           InputStream is = new FileInputStream(new File(filePath));
           //开始解析
           ExcelUtil<BusinessProject> util = new ExcelUtil<BusinessProject>(BusinessProject.class);



           //3就是前三行都是title 从第四行开始解析
            list = util.importExcel(is,3);



           log.info("[导入表格解析]解析之后的集合:"+list);
          if(list.size()==0){
              throw new RuntimeException("[导入档案馆][导入数据集合为空,请检查模版是否正确][list:]"+list.toString());
          }

           for (BusinessProject businessProject : list) {
               businessProject.setState("4");
               businessProject.setEnableqqkzj("0");
               businessProject.setRojectid(IdUtils.fastSimpleUUID());
               if(businessProject.getAuthorizedmoney()==null ){
                   businessProject.setAuthorizedmoney(0.0);

               }
               if(businessProject.getReportmoney()==null){
                   businessProject.setReportmoney(0.0);
               }

               if(businessProject.getAuthorizedmoney()>businessProject.getReportmoney()){
                   throw new RuntimeException("[导入档案馆]["+businessProject.getRojectname()+"][审定金额大于报审金额!无法填报!]");
               }
               //设置审减金额
               Double shenjian=businessProject.getReportmoney()-businessProject.getAuthorizedmoney();
               businessProject.setReducedmoney(shenjian);
               Double shenjianlv=(shenjian/businessProject.getReportmoney())*100;
               if(Double.isNaN(shenjianlv)){
                   shenjianlv=0.0;
               }

               BigDecimal b   =   new   BigDecimal(shenjianlv);
               Double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();
               //审减率
               businessProject.setReductionrate(f1.toString()+"%");
               if(StringUtils.isBlank(businessProject.getSubmitdate().toString())){
                   throw new RuntimeException("[导入档案馆]["+businessProject.getRojectname()+"][项目提交日期为空!]");
               }
               int i1 = businessProjectService.insertBusinessProject(businessProject);
               if(i1>0){
               }else {
                   throw new RuntimeException("[导入档案馆]["+businessProject.getRojectname()+"][保存数据库错误!]");
               }
               success=success+1;
           }

       }catch (Exception e) {
           throw new RuntimeException("[(注意表头必须在第四行)导入档案馆表格出现错误:]"+e);
       }

        return success("已导入档案馆,总共:"+list.size()+",成功导入:"+success+".");
    }

前端input显示科学计数法(解决方案)

在这里插入图片描述
前端代码

//只需将其转成字符串即可
            var budgetmoney = $("input[name='budgetmoney']").val();
            var budgetmoney_str=parseFloat(budgetmoney).toString();
            $("input[name='budgetmoney']").val(budgetmoney_str);

在这里插入图片描述

Thymeleaf案例和实际演示

后端跳转页面携带参数
在这里插入图片描述

public string 方法名(ModelMap mmap){
			//参数名     参数值
	mmap.put("quanxian",lrg_list);
}

1.根据实体类展示各属性值
在这里插入图片描述

在form表单中加入
th:object="${businessProject}"
各表项加入
th:field="*{submitunit}"

2.遍历list 页面展示
在这里插入图片描述

th:each="buy:${pingshenlist}"
buy是遍历的单个实体类, 右侧list参数名

3.时间格式化
在这里插入图片描述

${#dates.format(buy.submitdate,'yyyy-MM-dd HH:mm:ss')}

4.if的使用
在这里插入图片描述

  <td th:if="${buy.state} eq '0'">草稿</td>
  如果等于就展示该元素

5.前端js项获取值

[[${参数值}]]  前端页面任何地方可随时获取.
  • 7
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依管理系统。她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错效率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 您是否在找一套合适后台管理系统。 您是否在找一套代码易读易懂后台管理系统。 那么,现在若依来了。诚意奉献之作 若依是给刚出生的女儿取的名字 寓意:你若不离不弃,我必生死相依 内置功能 用户管理:用户是系统操作者。 部门管理:配置系统组织机构。 岗位管理:岗位是用户所属职务。 菜单管理:配置系统菜单(支持控制到按钮)。 角色管理:角色菜单权限分配。 字典管理:对系统中经常使用的一些较为固定的数据进行维护。 操作日志:系统操作日志记录(含异常)。 登录日志:系统登录情况记录(含异常)。 在线用户:当前系统中活跃用户状态监控。 连接池监视:监视当期系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。 为何选择若依 是一个完全响应式,基于Bootstrap3.3.6最新版本开发的主题。 她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。 拥有良好的代码结构,层次结构清晰。内置一系列基础功能。 操作权限控制精密细致,对所有管理链接都进行权限验证,可控制到按钮。 提供在线功能代码生成工具,提高开发效率及质量。 提供常用工具类封装,日志、国际化、缓存、验证、字典等数据。 兼容目前最流行浏览器(IE7+、Chrome、Firefox)手机移动端也支持。 技术选型 1、后端 核心框架:Spring Boot 安全框架:Apache Shiro 模板引擎:Thymeleaf 持久层框架:MyBatis 数据库连接池:Druid 缓存框架:Ehcache 日志管理:SLF4J 工具类:Apache Commons Fastjson POJO:Lombok 2、前端 框架:Bootstrap 数据表格:Bootstrap Table 客户端验证:JQuery Validation 树结构控件:zTree 弹出层:layer 3、平台 服务器中间件:SpringBoot内置 数据库支持:目前仅提供MySql数据库的支持,但不限于数据库 开发环境:Java、Eclipse、Maven、Git
毕业设计是高等教育阶段学生在完成学业前所进行的一项重要学术任务,旨在检验学生通过学习所获得的知识、技能以及对特定领域的深刻理解能力。这项任务通常要求学生运用所学专业知识,通过独立研究和创新,完成一个实际问题的解决方案或者开展一项有价值的项目。 首先,毕业设计的选择通常由学生根据个人兴趣、专业方向以及实际需求来确定。学生需要在导师的指导下明确研究目标、问题陈述,确立研究的范围和深度。毕业设计可以包括文献综述、需求分析、方案设计、实施与测试等多个阶段,以确保整个过程的科学性和系统性。 其次,毕业设计的完成通常需要学生具备一定的独立思考和解决问题的能力。在研究过程中,学生可能需要采用各种研究方法,如实验、调查、案例分析等,以获取必要的数据和信息。通过这些活动,学生能够培养扎实的专业技能,提升解决实际问题的实际能力。 第三,毕业设计的撰写是整个过程的重要组成部分。学生需要将研究过程、方法、结果以及结论等详细记录在毕业论文中,以展示其研究的全貌和成果。同时,撰写毕业设计还有助于提高学生的学术写作水平,培养清晰、逻辑的表达能力。 最后,毕业设计的评价通常由导师和相关专业人士进行。评价标准包括研究的创新性、实用性、方法的科学性以及论文的质量等方面。学生在毕业设计中获得的成绩也将直接影响其最终的学业成绩和学位授予。 总的来说,毕业设计是高等教育中的一项重要环节,通过此过程,学生不仅能够巩固所学知识,还能培养独立思考和解决问题的能力,为将来的职业发展奠定坚实的基础。
以下是一些可能有用的数据库购物车系统测试案例: 1. 用户注册和登录测试:测试用户能否成功注册账户并登录到系统。包括测试注册表单的数据验证、登录表单的数据验证、密码加密和解密、登录凭据的有效性等。 2. 商品浏览和搜索测试:测试用户能否通过系统浏览和搜索商品。包括测试商品分类、排序、过滤、分页等功能,以及测试商品信息的展示和数据的正确性。 3. 商品添加和编辑测试:测试管理员能否添加和编辑商品信息。包括测试商品信息表单的数据验证、图片上传、富文本编辑器、价格计算等功能。 4. 商品库存和价格测试:测试商品库存和价格的正确性。包括测试商品库存是否准确、价格是否正确、促销折扣是否生效等。 5. 购物车添加和删除测试:测试用户能否将商品添加到购物车并从购物车中删除商品。包括测试购物车的操作流程、购物车信息的展示和数据的正确性等。 6. 订单结算和支付测试:测试用户能否完成订单的结算和支付。包括测试订单信息的展示和数据的正确性、订单结算流程、支付接口的可用性等。 7. 订单查询和管理测试:测试管理员能否查询和管理所有订单。包括测试订单信息的展示和数据的正确性、订单查询和过滤、订单状态的更新等功能。 8. 数据库安全性测试:测试系统的数据库是否具有足够的安全性,如数据加密、防止SQL注入、防止跨站脚本攻击等。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值