Commit 717957ab62f65617e912b2d9771e7fd2a7c9a846
1 parent
146db63b
bf
Showing
7 changed files
with
116 additions
and
63 deletions
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineAddController.java
| ... | ... | @@ -97,6 +97,12 @@ public class BsthTLineAddController extends BaseController |
| 97 | 97 | { |
| 98 | 98 | User loginUser = ShiroUtils.getSysUser(); |
| 99 | 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 | 106 | return toAjax(bsthTLineService.insertBsthTLineExamine(bsthTLine)); |
| 101 | 107 | } |
| 102 | 108 | |
| ... | ... | @@ -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
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/IBsthTLineService.java
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/impl/BsthTLineServiceImpl.java
| ... | ... | @@ -432,4 +432,14 @@ public class BsthTLineServiceImpl implements IBsthTLineService |
| 432 | 432 | public BsthTLine selectBsthTLineExamineByLineName(String lineName){ |
| 433 | 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 | 99 | <result property="startDate" column="start_date" /> |
| 100 | 100 | <result property="startReason" column="start_reason" /> |
| 101 | 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 | 105 | <result property="updateStatus" column="update_status" /> |
| 103 | 106 | <result property="lineUpdateType" column="line_update_type" /> |
| 104 | 107 | <result property="examineStatus" column="examine_status" /> |
| ... | ... | @@ -1616,7 +1619,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 1616 | 1619 | full_customer_percent, low_customer_percent, divide_level, |
| 1617 | 1620 | has_timelists, is_metro, metro_time, cold_bonus_type, revenues_month, |
| 1618 | 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 | 1623 | </sql> |
| 1621 | 1624 | |
| 1622 | 1625 | <select id="selectBsthTLineExamineList" parameterType="BsthTLine" |
| ... | ... | @@ -1793,6 +1796,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 1793 | 1796 | <if test="personAvg != null">person_avg,</if> |
| 1794 | 1797 | <if test="startDate != null">start_date,</if> |
| 1795 | 1798 | <if test="nightParking != null">night_parking,</if> |
| 1799 | + <if test="files != null">files,</if> | |
| 1796 | 1800 | <if test="revenueType != null">revenue_type,</if> |
| 1797 | 1801 | <if test="examineType != null">examine_type,</if> |
| 1798 | 1802 | <if test="startReason != null">start_reason,</if> |
| ... | ... | @@ -1878,6 +1882,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 1878 | 1882 | <if test="personAvg != null">#{personAvg},</if> |
| 1879 | 1883 | <if test="startDate != null">#{startDate},</if> |
| 1880 | 1884 | <if test="nightParking != null">#{nightParking},</if> |
| 1885 | + <if test="files != null">#{files},</if> | |
| 1881 | 1886 | <if test="revenueType != null">#{revenueType},</if> |
| 1882 | 1887 | <if test="examineType != null">#{examineType},</if> |
| 1883 | 1888 | <if test="startReason != null">#{startReason},</if> |
| ... | ... | @@ -1976,12 +1981,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 1976 | 1981 | <if test="startDate != null">start_date = #{startDate},</if> |
| 1977 | 1982 | <if test="nightParking != null">night_parking = #{nightParking},</if> |
| 1978 | 1983 | <if test="files != null">files = #{files},</if> |
| 1984 | + <if test="revenueType != null">revenue_type = #{revenueType},</if> | |
| 1979 | 1985 | <if test="examineStatus != null">examine_status = #{examineStatus},</if> |
| 1980 | 1986 | <if test="startReason != null">start_reason = #{startReason},</if> |
| 1981 | - <if test="startDate != null">start_date = #{startDate},</if> | |
| 1982 | 1987 | <if test="lineUpdateType != null">line_update_type = #{lineUpdateType},</if> |
| 1983 | 1988 | <if test="startReason != null">start_reason = #{startReason},</if> |
| 1984 | - | |
| 1985 | 1989 | </trim> |
| 1986 | 1990 | where id = #{id} |
| 1987 | 1991 | </update> |
| ... | ... | @@ -2001,4 +2005,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 2001 | 2005 | where line_name= #{lineName} |
| 2002 | 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 | 2014 | </mapper> |
| 2005 | 2015 | \ No newline at end of file | ... | ... |
bsthLineProfiles/src/main/resources/templates/system/lineAdd/add.html
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | <head> |
| 4 | 4 | <th:block th:include="include :: header('添加线路档案信息')" /> |
| 5 | 5 | <th:block th:include="include :: datetimepicker-css" /> |
| 6 | + <th:block th:include="include :: bootstrap-fileinput-css" /> | |
| 6 | 7 | </head> |
| 7 | 8 | <body class="white-bg"> |
| 8 | 9 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
| ... | ... | @@ -224,7 +225,7 @@ |
| 224 | 225 | <textarea name="remark" class="form-control"></textarea> |
| 225 | 226 | </div> |
| 226 | 227 | </div> |
| 227 | - <div class="form-group"> | |
| 228 | + <!--<div class="form-group"> | |
| 228 | 229 | <label class="col-sm-3 control-label">是否逻辑删除:</label> |
| 229 | 230 | <div class="col-sm-8"> |
| 230 | 231 | <select name="isLogicDelete" |
| ... | ... | @@ -236,7 +237,7 @@ |
| 236 | 237 | </option> |
| 237 | 238 | </select> |
| 238 | 239 | </div> |
| 239 | - </div> | |
| 240 | + </div>--> | |
| 240 | 241 | <div class="form-group"> |
| 241 | 242 | <label class="col-sm-3 control-label">更新人:</label> |
| 242 | 243 | <div class="col-sm-8"> |
| ... | ... | @@ -516,74 +517,55 @@ |
| 516 | 517 | </div> |
| 517 | 518 | <div class="form-group"> |
| 518 | 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 | 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 | 525 | th:value="${dict.dictValue}"></option> |
| 524 | - </select> | |
| 526 | + </select> | |
| 527 | + </div> | |
| 525 | 528 | </div> |
| 526 | 529 | <div class="form-group"> |
| 527 | 530 | <label class="col-sm-3 control-label">轨交时间:</label> |
| 528 | 531 | <div class="col-sm-8"> |
| 529 | 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 | 536 | </div> |
| 533 | 537 | </div> |
| 534 | 538 | </div> |
| 535 | - <div class="form-group"> | |
| 539 | + <div class="form-group"> | |
| 536 | 540 | <label class="col-sm-3 control-label">冷僻线路补贴类型:</label> |
| 537 | 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 | 543 | </div> |
| 570 | 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 | 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 | 552 | </div> |
| 576 | 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 | 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 | 561 | </div> |
| 582 | 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 | 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 | 569 | </div> |
| 588 | 570 | </div> |
| 589 | 571 | <div class="form-group"> |
| ... | ... | @@ -599,8 +581,36 @@ |
| 599 | 581 | </div> |
| 600 | 582 | <th:block th:include="include :: footer" /> |
| 601 | 583 | <th:block th:include="include :: datetimepicker-js" /> |
| 584 | + <th:block th:include="include :: bootstrap-fileinput-js" /> | |
| 602 | 585 | <script th:inline="javascript"> |
| 603 | 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 | 614 | $("#form-line-add").validate({ |
| 605 | 615 | rules:{ |
| 606 | 616 | isWarrantStartTime:{ |
| ... | ... | @@ -666,12 +676,6 @@ |
| 666 | 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 | 679 | $("input[name='startDate']").datetimepicker({ |
| 676 | 680 | format: "yyyy-mm-dd", |
| 677 | 681 | minView: "month", | ... | ... |
bsthLineProfiles/src/main/resources/templates/system/lineAdd/edit.html
| ... | ... | @@ -590,7 +590,7 @@ |
| 590 | 590 | class="form-control" type="text"> |
| 591 | 591 | </div> |
| 592 | 592 | </div> |
| 593 | - <div class="form-group"> | |
| 593 | + <!--<div class="form-group"> | |
| 594 | 594 | <label class="col-sm-3 control-label">月度营收:</label> |
| 595 | 595 | <div class="col-sm-8"> |
| 596 | 596 | <input name="revenuesMonth" th:field="*{revenuesMonth}" |
| ... | ... | @@ -645,7 +645,7 @@ |
| 645 | 645 | <input name="personAvg" th:field="*{personAvg}" |
| 646 | 646 | class="form-control" type="text"> |
| 647 | 647 | </div> |
| 648 | - </div> | |
| 648 | + </div>--> | |
| 649 | 649 | |
| 650 | 650 | <div class="form-group"> |
| 651 | 651 | <label class="col-sm-3 control-label">启用时间:</label> |
| ... | ... | @@ -660,6 +660,7 @@ |
| 660 | 660 | |
| 661 | 661 | </div> |
| 662 | 662 | </div> |
| 663 | + | |
| 663 | 664 | <div class="form-group"> |
| 664 | 665 | <label class="col-sm-3 control-label">性质:</label> |
| 665 | 666 | <div class="col-sm-8"> |
| ... | ... | @@ -667,14 +668,25 @@ |
| 667 | 668 | th:with="type=${@dict.getType('lineUpdateType')}" |
| 668 | 669 | class="form-control m-b"> |
| 669 | 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 | 683 | </select> |
| 672 | 684 | </div> |
| 673 | 685 | </div> |
| 674 | 686 | <div class="form-group"> |
| 675 | 687 | <label class="col-sm-3 control-label">启用原因:</label> |
| 676 | 688 | <div class="col-sm-8"> |
| 677 | - <textarea name="startReason" class="form-control"></textarea> | |
| 689 | + <textarea name="startReason" class="form-control">[[*{startReason}]]</textarea> | |
| 678 | 690 | </div> |
| 679 | 691 | </div> |
| 680 | 692 | <div class="form-group"> | ... | ... |