Commit 717957ab62f65617e912b2d9771e7fd2a7c9a846

Authored by yiming
1 parent 146db63b

bf

bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineAddController.java
@@ -97,6 +97,12 @@ public class BsthTLineAddController extends BaseController @@ -97,6 +97,12 @@ public class BsthTLineAddController extends BaseController
97 { 97 {
98 User loginUser = ShiroUtils.getSysUser(); 98 User loginUser = ShiroUtils.getSysUser();
99 bsthTLine.setCreateBy(loginUser.getUserName()); 99 bsthTLine.setCreateBy(loginUser.getUserName());
  100 + if(!bsthTLineService.lineNameIsExist(bsthTLine.getLineName())){
  101 + AjaxResult ajaxResult=new AjaxResult();
  102 + ajaxResult.put("code","96");
  103 + ajaxResult.put("msg","线路已存在或提交申请");
  104 + return ajaxResult;
  105 + }
100 return toAjax(bsthTLineService.insertBsthTLineExamine(bsthTLine)); 106 return toAjax(bsthTLineService.insertBsthTLineExamine(bsthTLine));
101 } 107 }
102 108
@@ -133,7 +139,14 @@ public class BsthTLineAddController extends BaseController @@ -133,7 +139,14 @@ public class BsthTLineAddController extends BaseController
133 139
134 140
135 141
136 - 142 + @RequiresPermissions("system:line:remove")
  143 + @Log(title = "线路删除", businessType = BusinessType.DELETE)
  144 + @PostMapping( "/remove")
  145 + @ResponseBody
  146 + public AjaxResult remove(String ids)
  147 + {
  148 + return toAjax(bsthTLineService.deleteBsthTLineExamineById(ids));
  149 + }
137 150
138 151
139 } 152 }
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/mapper/BsthTLineMapper.java
@@ -113,4 +113,6 @@ public interface BsthTLineMapper @@ -113,4 +113,6 @@ public interface BsthTLineMapper
113 int deleteBsthTLineExamineById(String[] ids); 113 int deleteBsthTLineExamineById(String[] ids);
114 114
115 BsthTLine selectBsthTLineExamineByLineName(String lineName); 115 BsthTLine selectBsthTLineExamineByLineName(String lineName);
  116 +
  117 + BsthTLine selectBsthTLineByLineName(String lineName);
116 } 118 }
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/IBsthTLineService.java
@@ -118,4 +118,6 @@ public interface IBsthTLineService @@ -118,4 +118,6 @@ public interface IBsthTLineService
118 int examine(BsthTLine bsthTLine); 118 int examine(BsthTLine bsthTLine);
119 119
120 BsthTLine selectBsthTLineExamineByLineName(String lineName); 120 BsthTLine selectBsthTLineExamineByLineName(String lineName);
  121 +
  122 + boolean lineNameIsExist(String lineName);
121 } 123 }
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/impl/BsthTLineServiceImpl.java
@@ -432,4 +432,14 @@ public class BsthTLineServiceImpl implements IBsthTLineService @@ -432,4 +432,14 @@ public class BsthTLineServiceImpl implements IBsthTLineService
432 public BsthTLine selectBsthTLineExamineByLineName(String lineName){ 432 public BsthTLine selectBsthTLineExamineByLineName(String lineName){
433 return bsthTLineMapper.selectBsthTLineExamineByLineName(lineName); 433 return bsthTLineMapper.selectBsthTLineExamineByLineName(lineName);
434 } 434 }
  435 +
  436 + @Override
  437 + public boolean lineNameIsExist(String lineName) {
  438 + boolean flag=true;
  439 + if(bsthTLineMapper.selectBsthTLineByLineName(lineName)!=null || bsthTLineMapper.selectBsthTLineExamineByLineName(lineName)!=null){
  440 + flag=false;
  441 + }
  442 + return flag;
  443 + }
  444 +
435 } 445 }
bsthLineProfiles/src/main/resources/mybatis/mybatis/system/BsthTLineMapper.xml
@@ -99,6 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -99,6 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
99 <result property="startDate" column="start_date" /> 99 <result property="startDate" column="start_date" />
100 <result property="startReason" column="start_reason" /> 100 <result property="startReason" column="start_reason" />
101 <result property="nightParking" column="night_parking" /> 101 <result property="nightParking" column="night_parking" />
  102 + <result property="files" column="files" />
  103 + <result property="startReason" column="start_reason" />
  104 + <result property="revenueType" column="revenue_type" />
102 <result property="updateStatus" column="update_status" /> 105 <result property="updateStatus" column="update_status" />
103 <result property="lineUpdateType" column="line_update_type" /> 106 <result property="lineUpdateType" column="line_update_type" />
104 <result property="examineStatus" column="examine_status" /> 107 <result property="examineStatus" column="examine_status" />
@@ -1616,7 +1619,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -1616,7 +1619,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
1616 full_customer_percent, low_customer_percent, divide_level, 1619 full_customer_percent, low_customer_percent, divide_level,
1617 has_timelists, is_metro, metro_time, cold_bonus_type, revenues_month, 1620 has_timelists, is_metro, metro_time, cold_bonus_type, revenues_month,
1618 person_month, mileage_month, person_month_avg, revenues, persons, 1621 person_month, mileage_month, person_month_avg, revenues, persons,
1619 - mileages, person_avg, start_date,night_parking,files,examine_status,examine_type,start_reason,line_update_type from bsth_t_line_examine 1622 + mileages, person_avg, start_date,night_parking,files,revenue_type,examine_status,examine_type,start_reason,line_update_type from bsth_t_line_examine
1620 </sql> 1623 </sql>
1621 1624
1622 <select id="selectBsthTLineExamineList" parameterType="BsthTLine" 1625 <select id="selectBsthTLineExamineList" parameterType="BsthTLine"
@@ -1793,6 +1796,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -1793,6 +1796,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
1793 <if test="personAvg != null">person_avg,</if> 1796 <if test="personAvg != null">person_avg,</if>
1794 <if test="startDate != null">start_date,</if> 1797 <if test="startDate != null">start_date,</if>
1795 <if test="nightParking != null">night_parking,</if> 1798 <if test="nightParking != null">night_parking,</if>
  1799 + <if test="files != null">files,</if>
1796 <if test="revenueType != null">revenue_type,</if> 1800 <if test="revenueType != null">revenue_type,</if>
1797 <if test="examineType != null">examine_type,</if> 1801 <if test="examineType != null">examine_type,</if>
1798 <if test="startReason != null">start_reason,</if> 1802 <if test="startReason != null">start_reason,</if>
@@ -1878,6 +1882,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -1878,6 +1882,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
1878 <if test="personAvg != null">#{personAvg},</if> 1882 <if test="personAvg != null">#{personAvg},</if>
1879 <if test="startDate != null">#{startDate},</if> 1883 <if test="startDate != null">#{startDate},</if>
1880 <if test="nightParking != null">#{nightParking},</if> 1884 <if test="nightParking != null">#{nightParking},</if>
  1885 + <if test="files != null">#{files},</if>
1881 <if test="revenueType != null">#{revenueType},</if> 1886 <if test="revenueType != null">#{revenueType},</if>
1882 <if test="examineType != null">#{examineType},</if> 1887 <if test="examineType != null">#{examineType},</if>
1883 <if test="startReason != null">#{startReason},</if> 1888 <if test="startReason != null">#{startReason},</if>
@@ -1976,12 +1981,11 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -1976,12 +1981,11 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
1976 <if test="startDate != null">start_date = #{startDate},</if> 1981 <if test="startDate != null">start_date = #{startDate},</if>
1977 <if test="nightParking != null">night_parking = #{nightParking},</if> 1982 <if test="nightParking != null">night_parking = #{nightParking},</if>
1978 <if test="files != null">files = #{files},</if> 1983 <if test="files != null">files = #{files},</if>
  1984 + <if test="revenueType != null">revenue_type = #{revenueType},</if>
1979 <if test="examineStatus != null">examine_status = #{examineStatus},</if> 1985 <if test="examineStatus != null">examine_status = #{examineStatus},</if>
1980 <if test="startReason != null">start_reason = #{startReason},</if> 1986 <if test="startReason != null">start_reason = #{startReason},</if>
1981 - <if test="startDate != null">start_date = #{startDate},</if>  
1982 <if test="lineUpdateType != null">line_update_type = #{lineUpdateType},</if> 1987 <if test="lineUpdateType != null">line_update_type = #{lineUpdateType},</if>
1983 <if test="startReason != null">start_reason = #{startReason},</if> 1988 <if test="startReason != null">start_reason = #{startReason},</if>
1984 -  
1985 </trim> 1989 </trim>
1986 where id = #{id} 1990 where id = #{id}
1987 </update> 1991 </update>
@@ -2001,4 +2005,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -2001,4 +2005,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
2001 where line_name= #{lineName} 2005 where line_name= #{lineName}
2002 </select> 2006 </select>
2003 2007
  2008 + <select id="selectBsthTLineByLineName" parameterType="String"
  2009 + resultMap="BsthTLineResult">
  2010 + <include refid="selectBsthTLineVo" />
  2011 + where line_name= #{lineName}
  2012 + </select>
  2013 +
2004 </mapper> 2014 </mapper>
2005 \ No newline at end of file 2015 \ No newline at end of file
bsthLineProfiles/src/main/resources/templates/system/lineAdd/add.html
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 <head> 3 <head>
4 <th:block th:include="include :: header('添加线路档案信息')" /> 4 <th:block th:include="include :: header('添加线路档案信息')" />
5 <th:block th:include="include :: datetimepicker-css" /> 5 <th:block th:include="include :: datetimepicker-css" />
  6 + <th:block th:include="include :: bootstrap-fileinput-css" />
6 </head> 7 </head>
7 <body class="white-bg"> 8 <body class="white-bg">
8 <div class="wrapper wrapper-content animated fadeInRight ibox-content"> 9 <div class="wrapper wrapper-content animated fadeInRight ibox-content">
@@ -224,7 +225,7 @@ @@ -224,7 +225,7 @@
224 <textarea name="remark" class="form-control"></textarea> 225 <textarea name="remark" class="form-control"></textarea>
225 </div> 226 </div>
226 </div> 227 </div>
227 - <div class="form-group"> 228 + <!--<div class="form-group">
228 <label class="col-sm-3 control-label">是否逻辑删除:</label> 229 <label class="col-sm-3 control-label">是否逻辑删除:</label>
229 <div class="col-sm-8"> 230 <div class="col-sm-8">
230 <select name="isLogicDelete" 231 <select name="isLogicDelete"
@@ -236,7 +237,7 @@ @@ -236,7 +237,7 @@
236 </option> 237 </option>
237 </select> 238 </select>
238 </div> 239 </div>
239 - </div> 240 + </div>-->
240 <div class="form-group"> 241 <div class="form-group">
241 <label class="col-sm-3 control-label">更新人:</label> 242 <label class="col-sm-3 control-label">更新人:</label>
242 <div class="col-sm-8"> 243 <div class="col-sm-8">
@@ -516,74 +517,55 @@ @@ -516,74 +517,55 @@
516 </div> 517 </div>
517 <div class="form-group"> 518 <div class="form-group">
518 <label class="col-sm-3 control-label">是否轨交末班车衔接:</label> 519 <label class="col-sm-3 control-label">是否轨交末班车衔接:</label>
519 - <select name="isMetro" th:with="type=${@dict.getType('trueFalse')}" 520 + <div class="col-sm-8">
  521 + <select name="isMetro" th:with="type=${@dict.getType('trueFalse')}"
520 class="form-control m-b"> 522 class="form-control m-b">
521 - <option value=""></option>  
522 - <option th:each="dict : ${type}" th:text="${dict.dictLabel}" 523 + <option value=""></option>
  524 + <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
523 th:value="${dict.dictValue}"></option> 525 th:value="${dict.dictValue}"></option>
524 - </select> 526 + </select>
  527 + </div>
525 </div> 528 </div>
526 <div class="form-group"> 529 <div class="form-group">
527 <label class="col-sm-3 control-label">轨交时间:</label> 530 <label class="col-sm-3 control-label">轨交时间:</label>
528 <div class="col-sm-8"> 531 <div class="col-sm-8">
529 <div class="input-group date"> 532 <div class="input-group date">
530 - <input name="metroTime" class="form-control" placeholder="yyyy-MM-dd" type="text" autocomplete="off">  
531 - <span class="input-group-addon"><i class="fa fa-calendar"></i></span> 533 + <input name="metroTime" class="form-control"
  534 + placeholder="HH:mm:ss" > <span
  535 + class="input-group-addon"><i class="fa fa-calendar"></i></span>
532 </div> 536 </div>
533 </div> 537 </div>
534 </div> 538 </div>
535 - <div class="form-group"> 539 + <div class="form-group">
536 <label class="col-sm-3 control-label">冷僻线路补贴类型:</label> 540 <label class="col-sm-3 control-label">冷僻线路补贴类型:</label>
537 <div class="col-sm-8"> 541 <div class="col-sm-8">
538 - <input name="coldBonusType" lass="form-control" type="text">  
539 - </div>  
540 - </div>  
541 - <div class="form-group">  
542 - <label class="col-sm-3 control-label">月度营收:</label>  
543 - <div class="col-sm-8">  
544 - <input name="revenuesMonth" class="form-control" type="text">  
545 - </div>  
546 - </div>  
547 - <div class="form-group">  
548 - <label class="col-sm-3 control-label">月度人次:</label>  
549 - <div class="col-sm-8">  
550 - <input name="personMonth" class="form-control" type="text">  
551 - </div>  
552 - </div>  
553 - <div class="form-group">  
554 - <label class="col-sm-3 control-label">月度里程:</label>  
555 - <div class="col-sm-8">  
556 - <input name="mileageMonth" class="form-control" type="text">  
557 - </div>  
558 - </div>  
559 - <div class="form-group">  
560 - <label class="col-sm-3 control-label">百公里人次:</label>  
561 - <div class="col-sm-8">  
562 - <input name="personMonthAvg" class="form-control" type="text">  
563 - </div>  
564 - </div>  
565 - <div class="form-group">  
566 - <label class="col-sm-3 control-label">营收:</label>  
567 - <div class="col-sm-8">  
568 - <input name="revenues" class="form-control" type="text"> 542 + <input name="coldBonusType" class="form-control" type="text">
569 </div> 543 </div>
570 </div> 544 </div>
571 - <div class="form-group">  
572 - <label class="col-sm-3 control-label">人次:</label> 545 + <div class="form-group">
  546 + <label class="col-sm-3 control-label">性质:</label>
573 <div class="col-sm-8"> 547 <div class="col-sm-8">
574 - <input name="persons" class="form-control" type="text"> 548 + <select name="lineUpdateType" th:with="type=${@dict.getType('lineUpdateType')}" class="form-control m-b">
  549 + <option value=""></option>
  550 + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  551 + </select>
575 </div> 552 </div>
576 </div> 553 </div>
577 - <div class="form-group">  
578 - <label class="col-sm-3 control-label">里程:</label> 554 + <div class="form-group">
  555 + <label class="col-sm-3 control-label">营收类型:</label>
579 <div class="col-sm-8"> 556 <div class="col-sm-8">
580 - <input name="mileages" class="form-control" type="text"> 557 + <select name="revenueType" th:with="type=${@dict.getType('revenueType')}" class="form-control m-b">
  558 + <option value=""></option>
  559 + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  560 + </select>
581 </div> 561 </div>
582 </div> 562 </div>
583 - <div class="form-group">  
584 - <label class="col-sm-3 control-label">百公里人次:</label> 563 + <div class="form-group">
  564 + <label class="col-sm-3 control-label">附件:</label>
585 <div class="col-sm-8"> 565 <div class="col-sm-8">
586 - <input name="personAvg" class="form-control" type="text"> 566 + <div class="file-loading" id="uploadDiv">
  567 + <input id="fileinput" type="file" multiple>
  568 + </div>
587 </div> 569 </div>
588 </div> 570 </div>
589 <div class="form-group"> 571 <div class="form-group">
@@ -599,8 +581,36 @@ @@ -599,8 +581,36 @@
599 </div> 581 </div>
600 <th:block th:include="include :: footer" /> 582 <th:block th:include="include :: footer" />
601 <th:block th:include="include :: datetimepicker-js" /> 583 <th:block th:include="include :: datetimepicker-js" />
  584 + <th:block th:include="include :: bootstrap-fileinput-js" />
602 <script th:inline="javascript"> 585 <script th:inline="javascript">
603 var prefix = ctx + "system/lineAdd" 586 var prefix = ctx + "system/lineAdd"
  587 +
  588 + $(function() {
  589 +
  590 + $("#fileinput").fileinput({
  591 + 'theme' : 'explorer-fas',
  592 + 'uploadUrl' : '/common/upload',
  593 + overwriteInitial : false,
  594 + initialPreviewAsData : false
  595 + });
  596 +
  597 + $("#fileinput").on("fileuploaded",
  598 + function(event, data, proviewId, index) {
  599 +
  600 + var obj = '<div><input name="files" type="hidden" value='+data.files[index].name + ':' + data.response.url + '>'+
  601 + '<a href='+data.response.url+'>'+ data.files[index].name +
  602 + '</a><button onclick="deleteFile(this);">删除</button></div>';
  603 +
  604 +
  605 + $(".file-input").before(obj);
  606 +
  607 + });
  608 + })
  609 +
  610 + function deleteFile(obj){
  611 + $(obj).parent().remove();
  612 + }
  613 +
604 $("#form-line-add").validate({ 614 $("#form-line-add").validate({
605 rules:{ 615 rules:{
606 isWarrantStartTime:{ 616 isWarrantStartTime:{
@@ -666,12 +676,6 @@ @@ -666,12 +676,6 @@
666 autoclose: true 676 autoclose: true
667 }); 677 });
668 678
669 - $("input[name='metroTime']").datetimepicker({  
670 - format: "yyyy-mm-dd",  
671 - minView: "month",  
672 - autoclose: true  
673 - });  
674 -  
675 $("input[name='startDate']").datetimepicker({ 679 $("input[name='startDate']").datetimepicker({
676 format: "yyyy-mm-dd", 680 format: "yyyy-mm-dd",
677 minView: "month", 681 minView: "month",
bsthLineProfiles/src/main/resources/templates/system/lineAdd/edit.html
@@ -590,7 +590,7 @@ @@ -590,7 +590,7 @@
590 class="form-control" type="text"> 590 class="form-control" type="text">
591 </div> 591 </div>
592 </div> 592 </div>
593 - <div class="form-group"> 593 + <!--<div class="form-group">
594 <label class="col-sm-3 control-label">月度营收:</label> 594 <label class="col-sm-3 control-label">月度营收:</label>
595 <div class="col-sm-8"> 595 <div class="col-sm-8">
596 <input name="revenuesMonth" th:field="*{revenuesMonth}" 596 <input name="revenuesMonth" th:field="*{revenuesMonth}"
@@ -645,7 +645,7 @@ @@ -645,7 +645,7 @@
645 <input name="personAvg" th:field="*{personAvg}" 645 <input name="personAvg" th:field="*{personAvg}"
646 class="form-control" type="text"> 646 class="form-control" type="text">
647 </div> 647 </div>
648 - </div> 648 + </div>-->
649 649
650 <div class="form-group"> 650 <div class="form-group">
651 <label class="col-sm-3 control-label">启用时间:</label> 651 <label class="col-sm-3 control-label">启用时间:</label>
@@ -660,6 +660,7 @@ @@ -660,6 +660,7 @@
660 660
661 </div> 661 </div>
662 </div> 662 </div>
  663 +
663 <div class="form-group"> 664 <div class="form-group">
664 <label class="col-sm-3 control-label">性质:</label> 665 <label class="col-sm-3 control-label">性质:</label>
665 <div class="col-sm-8"> 666 <div class="col-sm-8">
@@ -667,14 +668,25 @@ @@ -667,14 +668,25 @@
667 th:with="type=${@dict.getType('lineUpdateType')}" 668 th:with="type=${@dict.getType('lineUpdateType')}"
668 class="form-control m-b"> 669 class="form-control m-b">
669 <option th:each="dict : ${type}" th:text="${dict.dictLabel}" 670 <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
670 - th:value="${dict.dictValue}"></option> 671 + th:value="${dict.dictValue}"
  672 + th:selected="${#arrays.contains(#strings.toString(bsthTLine.lineUpdateType== null ? '' : bsthTLine.lineUpdateType),#strings.toString(dict.dictValue))}"></option>></option>
  673 + </select>
  674 + </div>
  675 + </div>
  676 + <div class="form-group">
  677 + <label class="col-sm-3 control-label">营收类型:</label>
  678 + <div class="col-sm-8">
  679 + <select name="revenueType" th:with="type=${@dict.getType('revenueType')}" class="form-control m-b">
  680 + <option value=""></option>
  681 + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
  682 + th:selected="${#arrays.contains(#strings.toString(bsthTLine.revenueType== null ? '' : bsthTLine.revenueType),#strings.toString(dict.dictValue))}"></option>></option>></option>
671 </select> 683 </select>
672 </div> 684 </div>
673 </div> 685 </div>
674 <div class="form-group"> 686 <div class="form-group">
675 <label class="col-sm-3 control-label">启用原因:</label> 687 <label class="col-sm-3 control-label">启用原因:</label>
676 <div class="col-sm-8"> 688 <div class="col-sm-8">
677 - <textarea name="startReason" class="form-control"></textarea> 689 + <textarea name="startReason" class="form-control">[[*{startReason}]]</textarea>
678 </div> 690 </div>
679 </div> 691 </div>
680 <div class="form-group"> 692 <div class="form-group">