Browse Source

开发我的任务界面操作

minitiger 9 năm trước cách đây
mục cha
commit
52efbe53f9
35 tập tin đã thay đổi với 2259 bổ sung360 xóa
  1. 3 3
      VisualInspection/js/lib/mytable.js
  2. BIN
      VisualInspection/js/lib/ystep/css/images/pointes_blue.png
  3. BIN
      VisualInspection/js/lib/ystep/css/images/pointes_green.png
  4. 293 0
      VisualInspection/js/lib/ystep/css/ystep.css
  5. 682 0
      VisualInspection/js/lib/ystep/js/ystep.js
  6. 29 2
      VisualInspection/js/mytask/check.js
  7. 188 4
      VisualInspection/js/mytask/unchecked.js
  8. 28 3
      VisualInspection/js/util/util.js
  9. 2 1
      VisualInspection/view/common/commoncsslink.html
  10. 1 0
      VisualInspection/view/common/commonscriptlink.html
  11. 2 1
      VisualInspection/view/main.html
  12. 23 0
      VisualInspection/view/mytask/applyDetail.html
  13. 13 23
      VisualInspection/view/mytask/check.html
  14. 59 112
      VisualInspection/view/mytask/dispatched.html
  15. 158 55
      VisualInspection/view/mytask/taskDetail.html
  16. 9 20
      VisualInspection/view/mytask/undispatched.html
  17. 59 115
      VisualInspection/view/mytask/unexamined.html
  18. 15 2
      VisualInspection_server/src/main/java/com/xintong/SystemInit.java
  19. 5 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/TaskAutoGen.java
  20. 57 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/CheckApply.java
  21. 5 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Task.java
  22. 27 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/BaseController.java
  23. 188 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/CheckApplyController.java
  24. 101 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/TaskController.java
  25. 21 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/CheckApplyDao.java
  26. 4 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/TaskDao.java
  27. 73 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/CheckApplylMapper.xml
  28. 45 2
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/TaskMapper.xml
  29. 26 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/CheckApplyService.java
  30. 6 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/TaskService.java
  31. 58 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/CheckApplyServiceImpl.java
  32. 57 11
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/TaskServiceImpl.java
  33. 5 2
      VisualInspection_server/src/main/java/com/xintong/visualinspection/util/CacheUtil.java
  34. 16 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/util/Constants.java
  35. 1 1
      VisualInspection_server/src/main/resources/errcode.properties

+ 3 - 3
VisualInspection/js/lib/mytable.js

@@ -108,8 +108,8 @@
                         if(pics){
                             var picArr = pics.split(',');
                             for(var j in picArr){
-                                var pic =  '<a class="card lightbox-toggle" href="'+picArr[j]+'">'
-                                    +      '<img class="pic-class" style="height:50px;" src="'+picArr[j]+'" alt="">'
+                                var pic =  '<a class="lightbox-toggle" href="'+picArr[j]+'" style="width:60px;height:50px;">'
+                                    +      '<img class="pic-class  img-thumbnail" style="width:60px;height:50px;" src="'+picArr[j]+'" alt="">'
                                     +  '</a>';
                                 picStr+=pic;
                             }
@@ -119,7 +119,7 @@
                         var oper = cols[i].oper;
                         var operStr="";
                         for(var j=0;j<oper.length;j++){
-                            operStr+='<a href="#" onclick="'+oper[j].func+'('+obj[cols[i].field]+','+obj[cols[i].field_other]+')"><i class="icon '+oper[j].col_class+'"></i>'+oper[j].text+'</a> ';
+                            operStr+='&nbsp;<a href="#" onclick="'+oper[j].func+'('+obj[cols[i].field]+','+obj[cols[i].field_other]+')"><i class="icon '+oper[j].icon_class+'"></i>'+oper[j].text+' </a>&nbsp;';
                         }
                         dArr.push(operStr);
                     }else{

BIN
VisualInspection/js/lib/ystep/css/images/pointes_blue.png


BIN
VisualInspection/js/lib/ystep/css/images/pointes_green.png


+ 293 - 0
VisualInspection/js/lib/ystep/css/ystep.css

@@ -0,0 +1,293 @@
+/*common css*/
+.ystep-container {
+  font-family: "Helvetica Neue",Helvetica,"Hiragino Sans GB","Wenquanyi Micro Hei","Microsoft Yahei",Arial,sans-serif;
+  display: inline-block;
+  position: relative;
+  color: #000;
+}
+.ystep-container ul {
+  list-style: none;
+}
+.ystep-container ul,.ystep-container li,.ystep-container p {
+  margin: 0;
+  padding: 0;
+}
+
+/*size css*/
+.ystep-sm {
+  width: 360px;
+  height: 30px;
+  font-size: 12px;
+  line-height: 1;
+}
+.ystep-lg {
+  width: 700px;
+  height: 60px;
+  font-size: 18px;
+  /*line-height: .3;*/
+}
+
+/*small size css*/
+.ystep-sm .ystep-container-steps {
+  position: absolute;
+  top: 2px;
+  cursor: pointer;
+  z-index: 10;
+}
+.ystep-sm li {
+  float: left;
+  width: 65px;
+  height: 50px;
+}
+.ystep-sm .ystep-step-done {
+  background-position: -119px -76px;
+}
+.ystep-sm .ystep-step-undone {
+  background-position: -60px -76px;
+}
+.ystep-sm .ystep-step-active {
+  background-position: -182px -76px;
+}
+.ystep-sm .ystep-progress {
+  width: 260px;
+  height: 3px;
+  position: absolute;
+  top: 30px;
+  left: 8px;
+  float: left;
+  margin-right: 10px;
+  overflow: hidden;
+}
+.ystep-sm .ystep-progress-bar {
+  width: 260px;
+  height: 6px;
+  background: #e4e4e4;
+  display: inline-block;
+  float: left;
+}
+.ystep-sm .ystep-progress-highlight {
+  height: 6px;
+	display: block;
+}
+
+/*large size css*/
+.ystep-lg .ystep-container-steps {
+  position: absolute;
+  top: 2px;
+  cursor: pointer;
+  z-index: 10;
+}
+.ystep-lg li {
+  float: left;
+  width: 100px;
+  height: 85px;
+}
+.ystep-lg .ystep-step-done {
+  background-position: -278px -132px;
+}
+.ystep-lg .ystep-step-undone {
+  background-position: -137px -131px;
+}
+.ystep-lg .ystep-step-active {
+  background-position: -414px -131px;
+}
+.ystep-lg .ystep-progress {
+  width: 400px;
+  height: 10px;
+  position: absolute;
+  top: 30px;
+  left: 15px;
+  float: left;
+  margin-right: 10px;
+  overflow: hidden;
+}
+.ystep-lg .ystep-progress-bar {
+  width: 400px;
+  height: 20px;
+  background: #e4e4e4;
+  display: inline-block;
+  float: left;
+}
+.ystep-lg .ystep-progress-highlight {
+  height: 20px;
+	display: block;
+}
+
+/*green css*/
+.ystep-green .ystep-step-done {
+  background-image: url("./images/pointes_green.png");
+  background-repeat: no-repeat;
+}
+.ystep-green .ystep-step-undone {
+  background-image: url("./images/pointes_green.png");
+  background-repeat: no-repeat;
+  color: #9c9a9b;
+}
+.ystep-green .ystep-step-active {
+  background-image: url("./images/pointes_green.png");
+  background-repeat: no-repeat;
+  color: #3d8e15;
+}
+.ystep-green .ystep-progress-highlight {
+  background: #89bc65;
+}
+
+/*blue css*/
+.ystep-blue .ystep-step-done {
+  background-image: url("./images/pointes_blue.png");
+  background-repeat: no-repeat;
+}
+.ystep-blue .ystep-step-undone {
+  background-image: url("./images/pointes_blue.png");
+  background-repeat: no-repeat;
+  color: #9c9a9b;
+}
+.ystep-blue .ystep-step-active {
+  background-image: url("./images/pointes_blue.png");
+  background-repeat: no-repeat;
+  color: #3276b1;
+}
+.ystep-blue .ystep-progress-highlight {
+  background: #60baff;
+}
+
+/*popover css*/
+.popover {
+  font-family: "Helvetica Neue",Helvetica,"Hiragino Sans GB","Wenquanyi Micro Hei","Microsoft Yahei",Arial,sans-serif;
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 1010;
+  display: none;
+  max-width: 276px;
+  padding: 1px;
+  text-align: left;
+  white-space: normal;
+  background-color: #ffffff;
+  border: 1px solid #cccccc;
+  border: 1px solid rgba(0, 0, 0, 0.2);
+  border-radius: 6px;
+  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+          box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+  background-clip: padding-box;
+}
+
+.popover.top {
+  margin-top: -10px;
+}
+
+.popover.right {
+  margin-left: 10px;
+}
+
+.popover.bottom {
+  margin-top: 10px;
+}
+
+.popover.left {
+  margin-left: -10px;
+}
+
+.popover-title {
+  padding: 2px 10px;
+  margin: 0;
+  font-size: 12px;
+  font-weight: bold;
+  line-height: 18px;
+  background-color: #f7f7f7;
+  border-bottom: 1px solid #ebebeb;
+  border-radius: 5px 5px 0 0;
+}
+
+.popover-content {
+  padding: 4px 10px;
+  font-size: 12px;
+}
+
+.popover .arrow,
+.popover .arrow:after {
+  position: absolute;
+  display: block;
+  width: 0;
+  height: 0;
+  border-color: transparent;
+  border-style: solid;
+}
+
+.popover .arrow {
+  border-width: 11px;
+}
+
+.popover .arrow:after {
+  border-width: 10px;
+  content: "";
+}
+
+.popover.top .arrow {
+  bottom: -11px;
+  left: 50%;
+  margin-left: -11px;
+  border-top-color: #999999;
+  border-top-color: rgba(0, 0, 0, 0.25);
+  border-bottom-width: 0;
+}
+
+.popover.top .arrow:after {
+  bottom: 1px;
+  margin-left: -10px;
+  border-top-color: #ffffff;
+  border-bottom-width: 0;
+  content: " ";
+}
+
+.popover.right .arrow {
+  top: 50%;
+  left: -11px;
+  margin-top: -11px;
+  border-right-color: #999999;
+  border-right-color: rgba(0, 0, 0, 0.25);
+  border-left-width: 0;
+}
+
+.popover.right .arrow:after {
+  bottom: -10px;
+  left: 1px;
+  border-right-color: #ffffff;
+  border-left-width: 0;
+  content: " ";
+}
+
+.popover.bottom .arrow {
+  top: -11px;
+  left: 50%;
+  margin-left: -11px;
+  border-bottom-color: #999999;
+  border-bottom-color: rgba(0, 0, 0, 0.25);
+  border-top-width: 0;
+}
+
+.popover.bottom .arrow:after {
+  top: 1px;
+  margin-left: -10px;
+  border-bottom-color: #ffffff;
+  border-top-width: 0;
+  content: " ";
+}
+
+.popover.left .arrow {
+  top: 50%;
+  right: -11px;
+  margin-top: -11px;
+  border-left-color: #999999;
+  border-left-color: rgba(0, 0, 0, 0.25);
+  border-right-width: 0;
+}
+
+.popover.left .arrow:after {
+  right: 1px;
+  bottom: -10px;
+  border-left-color: #ffffff;
+  border-right-width: 0;
+  content: " ";
+}
+

+ 682 - 0
VisualInspection/js/lib/ystep/js/ystep.js

@@ -0,0 +1,682 @@
+/* ========================================================================
+ * Bootstrap: tooltip.js v3.0.3
+ * http://getbootstrap.com/javascript/#tooltip
+ * Inspired by the original jQuery.tipsy by Jason Frame
+ * ========================================================================
+ * Copyright 2013 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ======================================================================== */
+
+
++function ($) { "use strict";
+
+  // TOOLTIP PUBLIC CLASS DEFINITION
+  // ===============================
+
+  var Tooltip = function (element, options) {
+    this.type       =
+    this.options    =
+    this.enabled    =
+    this.timeout    =
+    this.hoverState =
+    this.$element   = null
+
+    this.init('tooltip', element, options)
+  }
+
+  Tooltip.DEFAULTS = {
+    animation: true
+  , placement: 'top'
+  , selector: false
+  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
+  , trigger: 'hover focus'
+  , title: ''
+  , delay: 0
+  , html: false
+  , container: false
+  }
+
+  Tooltip.prototype.init = function (type, element, options) {
+    this.enabled  = true
+    this.type     = type
+    this.$element = $(element)
+    this.options  = this.getOptions(options)
+
+    var triggers = this.options.trigger.split(' ')
+
+    for (var i = triggers.length; i--;) {
+      var trigger = triggers[i]
+
+      if (trigger == 'click') {
+        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
+      } else if (trigger != 'manual') {
+        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focus'
+        var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
+
+        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
+        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
+      }
+    }
+
+    this.options.selector ?
+      (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
+      this.fixTitle()
+  }
+
+  Tooltip.prototype.getDefaults = function () {
+    return Tooltip.DEFAULTS
+  }
+
+  Tooltip.prototype.getOptions = function (options) {
+    options = $.extend({}, this.getDefaults(), this.$element.data(), options)
+
+    if (options.delay && typeof options.delay == 'number') {
+      options.delay = {
+        show: options.delay
+      , hide: options.delay
+      }
+    }
+
+    return options
+  }
+
+  Tooltip.prototype.getDelegateOptions = function () {
+    var options  = {}
+    var defaults = this.getDefaults()
+
+    this._options && $.each(this._options, function (key, value) {
+      if (defaults[key] != value) options[key] = value
+    })
+
+    return options
+  }
+
+  Tooltip.prototype.enter = function (obj) {
+    var self = obj instanceof this.constructor ?
+      obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
+
+    clearTimeout(self.timeout)
+
+    self.hoverState = 'in'
+
+    if (!self.options.delay || !self.options.delay.show) return self.show()
+
+    self.timeout = setTimeout(function () {
+      if (self.hoverState == 'in') self.show()
+    }, self.options.delay.show)
+  }
+
+  Tooltip.prototype.leave = function (obj) {
+    var self = obj instanceof this.constructor ?
+      obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
+
+    clearTimeout(self.timeout)
+
+    self.hoverState = 'out'
+
+    if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+    self.timeout = setTimeout(function () {
+      if (self.hoverState == 'out') self.hide()
+    }, self.options.delay.hide)
+  }
+
+  Tooltip.prototype.show = function () {
+    var e = $.Event('show.bs.'+ this.type)
+
+    if (this.hasContent() && this.enabled) {
+      this.$element.trigger(e)
+
+      if (e.isDefaultPrevented()) return
+
+      var $tip = this.tip()
+
+      this.setContent()
+
+      if (this.options.animation) $tip.addClass('fade')
+
+      var placement = typeof this.options.placement == 'function' ?
+        this.options.placement.call(this, $tip[0], this.$element[0]) :
+        this.options.placement
+
+      var autoToken = /\s?auto?\s?/i
+      var autoPlace = autoToken.test(placement)
+      if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
+
+      $tip
+        .detach()
+        .css({ top: 0, left: 0, display: 'block' })
+        .addClass(placement)
+
+      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
+
+      var pos          = this.getPosition()
+      var actualWidth  = $tip[0].offsetWidth
+      var actualHeight = $tip[0].offsetHeight
+
+      if (autoPlace) {
+        var $parent = this.$element.parent()
+
+        var orgPlacement = placement
+        var docScroll    = document.documentElement.scrollTop || document.body.scrollTop
+        var parentWidth  = this.options.container == 'body' ? window.innerWidth  : $parent.outerWidth()
+        var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
+        var parentLeft   = this.options.container == 'body' ? 0 : $parent.offset().left
+
+        placement = placement == 'bottom' && pos.top   + pos.height  + actualHeight - docScroll > parentHeight  ? 'top'    :
+                    placement == 'top'    && pos.top   - docScroll   - actualHeight < 0                         ? 'bottom' :
+                    placement == 'right'  && pos.right + actualWidth > parentWidth                              ? 'left'   :
+                    placement == 'left'   && pos.left  - actualWidth < parentLeft                               ? 'right'  :
+                    placement
+
+        $tip
+          .removeClass(orgPlacement)
+          .addClass(placement)
+      }
+
+      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
+
+      this.applyPlacement(calculatedOffset, placement)
+      this.$element.trigger('shown.bs.' + this.type)
+    }
+  }
+
+  Tooltip.prototype.applyPlacement = function(offset, placement) {
+    var replace
+    var $tip   = this.tip()
+    var width  = $tip[0].offsetWidth
+    var height = $tip[0].offsetHeight
+
+    // manually read margins because getBoundingClientRect includes difference
+    var marginTop = parseInt($tip.css('margin-top'), 10)
+    var marginLeft = parseInt($tip.css('margin-left'), 10)
+
+    // we must check for NaN for ie 8/9
+    if (isNaN(marginTop))  marginTop  = 0
+    if (isNaN(marginLeft)) marginLeft = 0
+
+    offset.top  = offset.top  + marginTop
+    offset.left = offset.left + marginLeft
+
+    $tip
+      .offset(offset)
+      .addClass('in')
+
+    // check to see if placing tip in new offset caused the tip to resize itself
+    var actualWidth  = $tip[0].offsetWidth
+    var actualHeight = $tip[0].offsetHeight
+
+    if (placement == 'top' && actualHeight != height) {
+      replace = true
+      offset.top = offset.top + height - actualHeight
+    }
+
+    if (/bottom|top/.test(placement)) {
+      var delta = 0
+
+      if (offset.left < 0) {
+        delta       = offset.left * -2
+        offset.left = 0
+
+        $tip.offset(offset)
+
+        actualWidth  = $tip[0].offsetWidth
+        actualHeight = $tip[0].offsetHeight
+      }
+
+      this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
+    } else {
+      this.replaceArrow(actualHeight - height, actualHeight, 'top')
+    }
+
+    if (replace) $tip.offset(offset)
+  }
+
+  Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
+    this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
+  }
+
+  Tooltip.prototype.setContent = function () {
+    var $tip  = this.tip()
+    var title = this.getTitle()
+
+    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
+    $tip.removeClass('fade in top bottom left right')
+  }
+
+  Tooltip.prototype.hide = function () {
+    var that = this
+    var $tip = this.tip()
+    var e    = $.Event('hide.bs.' + this.type)
+
+    function complete() {
+      if (that.hoverState != 'in') $tip.detach()
+    }
+
+    this.$element.trigger(e)
+
+    if (e.isDefaultPrevented()) return
+
+    $tip.removeClass('in')
+
+    $.support.transition && this.$tip.hasClass('fade') ?
+      $tip
+        .one($.support.transition.end, complete)
+        .emulateTransitionEnd(150) :
+      complete()
+
+    this.$element.trigger('hidden.bs.' + this.type)
+
+    return this
+  }
+
+  Tooltip.prototype.fixTitle = function () {
+    var $e = this.$element
+    if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
+      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
+    }
+  }
+
+  Tooltip.prototype.hasContent = function () {
+    return this.getTitle()
+  }
+
+  Tooltip.prototype.getPosition = function () {
+    var el = this.$element[0]
+    return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
+      width: el.offsetWidth
+    , height: el.offsetHeight
+    }, this.$element.offset())
+  }
+
+  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
+    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2  } :
+           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 - 20  } :
+           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
+        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width   }
+  }
+
+  Tooltip.prototype.getTitle = function () {
+    var title
+    var $e = this.$element
+    var o  = this.options
+
+    title = $e.attr('data-original-title')
+      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
+
+    return title
+  }
+
+  Tooltip.prototype.tip = function () {
+    return this.$tip = this.$tip || $(this.options.template)
+  }
+
+  Tooltip.prototype.arrow = function () {
+    return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
+  }
+
+  Tooltip.prototype.validate = function () {
+    if (!this.$element[0].parentNode) {
+      this.hide()
+      this.$element = null
+      this.options  = null
+    }
+  }
+
+  Tooltip.prototype.enable = function () {
+    this.enabled = true
+  }
+
+  Tooltip.prototype.disable = function () {
+    this.enabled = false
+  }
+
+  Tooltip.prototype.toggleEnabled = function () {
+    this.enabled = !this.enabled
+  }
+
+  Tooltip.prototype.toggle = function (e) {
+    var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
+    self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
+  }
+
+  Tooltip.prototype.destroy = function () {
+    this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
+  }
+
+
+  // TOOLTIP PLUGIN DEFINITION
+  // =========================
+
+  var old = $.fn.tooltip
+
+  $.fn.tooltip = function (option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.tooltip')
+      var options = typeof option == 'object' && option
+
+      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  $.fn.tooltip.Constructor = Tooltip
+
+
+  // TOOLTIP NO CONFLICT
+  // ===================
+
+  $.fn.tooltip.noConflict = function () {
+    $.fn.tooltip = old
+    return this
+  }
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: popover.js v3.0.3
+ * http://getbootstrap.com/javascript/#popovers
+ * ========================================================================
+ * Copyright 2013 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ======================================================================== */
+
+
++function ($) { "use strict";
+
+  // POPOVER PUBLIC CLASS DEFINITION
+  // ===============================
+
+  var Popover = function (element, options) {
+    this.init('popover', element, options)
+  }
+
+  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
+
+  Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
+    placement: 'right'
+  , trigger: 'click'
+  , content: ''
+  , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
+  })
+
+
+  // NOTE: POPOVER EXTENDS tooltip.js
+  // ================================
+
+  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
+
+  Popover.prototype.constructor = Popover
+
+  Popover.prototype.getDefaults = function () {
+    return Popover.DEFAULTS
+  }
+
+  Popover.prototype.setContent = function () {
+    var $tip    = this.tip()
+    var title   = this.getTitle()
+    var content = this.getContent()
+
+    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
+    $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
+
+    $tip.removeClass('fade top bottom left right in')
+
+    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
+    // this manually by checking the contents.
+    if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
+  }
+
+  Popover.prototype.hasContent = function () {
+    return this.getTitle() || this.getContent()
+  }
+
+  Popover.prototype.getContent = function () {
+    var $e = this.$element
+    var o  = this.options
+
+    return $e.attr('data-content')
+      || (typeof o.content == 'function' ?
+            o.content.call($e[0]) :
+            o.content)
+  }
+
+  Popover.prototype.arrow = function () {
+    return this.$arrow = this.$arrow || this.tip().find('.arrow')
+  }
+
+  Popover.prototype.tip = function () {
+    if (!this.$tip) this.$tip = $(this.options.template)
+    return this.$tip
+  }
+
+
+  // POPOVER PLUGIN DEFINITION
+  // =========================
+
+  var old = $.fn.popover
+
+  $.fn.popover = function (option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.popover')
+      var options = typeof option == 'object' && option
+
+      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  $.fn.popover.Constructor = Popover
+
+
+  // POPOVER NO CONFLICT
+  // ===================
+
+  $.fn.popover.noConflict = function () {
+    $.fn.popover = old
+    return this
+  }
+
+}(jQuery);
+
+(function($){
+  $.fn.extend({
+    //初始化
+    loadStep: function(params){
+      
+      //基础框架
+      var baseHtml =  "<div class='ystep-container'>"+
+                        "<ul class='ystep-container-steps'>"+
+                        "</ul>"+
+                        "<div class='ystep-progress'>"+
+                          "<p class='ystep-progress-bar'>"+
+                            "<span class='ystep-progress-highlight' style='width:0%'>"+
+                            "</span>"+
+                          "</p>"+
+                        "</div>"+
+                      "</div>";
+      //步骤框架
+      var stepHtml = "<li class='ystep-step ystep-step-undone' data-container='body' data-toggle='popover' data-placement='top' data-title='' data-content='' data-trigger='hover'>"+
+                     "</li>";
+      //决策器
+      var logic = {
+        size: {
+          small: function($html){
+            var stepCount = $html.find("li").length-1,
+            containerWidth = (stepCount*65+100)+"px",
+            progressWidth = (stepCount*65)+"px";
+            $html.css({
+              width: containerWidth
+            });
+            $html.find(".ystep-progress").css({
+              width: progressWidth
+            });
+            $html.find(".ystep-progress-bar").css({
+              width: progressWidth
+            });
+            $html.addClass("ystep-sm");
+          },
+          large: function($html){
+            var stepCount = $html.find("li").length-1,
+            containerWidth = (stepCount*100+100)+"px",
+            progressWidth = (stepCount*100)+"px";
+            $html.css({
+              width: containerWidth
+            });
+            $html.find(".ystep-progress").css({
+              width: progressWidth
+            });
+            $html.find(".ystep-progress-bar").css({
+              width: progressWidth
+            });
+            $html.addClass("ystep-lg"); 
+          }
+        },
+        color: {
+          green: function($html){
+            $html.addClass("ystep-green");
+          },
+          blue: function($html){
+            $html.addClass("ystep-blue");
+          }
+        }
+      };
+      
+      //支持填充多个步骤容器
+      $(this).each(function(i,n){
+        var $baseHtml = $(baseHtml),
+        $stepHtml = $(stepHtml),
+        $ystepContainerSteps = $baseHtml.find(".ystep-container-steps"),
+        arrayLength = 0,
+        $n = $(n),
+        i=0;
+        
+        //步骤
+        arrayLength = params.steps.length;
+        for(i=0;i<arrayLength;i++){
+          var _s = params.steps[i];
+          //构造步骤html
+          $stepHtml.attr("data-title",_s.title);
+          $stepHtml.attr("data-content",_s.content);
+          $stepHtml.text(_s.title);
+          //将步骤插入到步骤列表中
+          $ystepContainerSteps.append($stepHtml);
+          //重置步骤
+          $stepHtml = $(stepHtml);
+        }
+        
+        //尺寸
+        logic.size[params.size||"small"]($baseHtml);
+        //配色
+        logic.color[params.color||"green"]($baseHtml);
+        
+        //插入到容器中
+        $n.append($baseHtml);
+        //渲染提示气泡
+        $n.find(".ystep-step").popover({});
+        //默认执行第一个步骤
+        $n.setStep(1);
+      });
+    },
+    //跳转到指定步骤
+    setStep: function(step) {
+      $(this).each(function(i,n){
+        //获取当前容器下所有的步骤
+        var $steps = $(n).find(".ystep-container").find("li");
+        var $progress =$(n).find(".ystep-container").find(".ystep-progress-highlight");
+        //判断当前步骤是否在范围内
+        if(1<=step && step<=$steps.length){
+          //更新进度
+          var scale = "%";
+          scale = Math.round((step-1)*100/($steps.length-1))+scale;
+          $progress.animate({
+            width: scale
+          },{
+            speed: 1000,
+            done: function() {
+              //移动节点
+              $steps.each(function(j,m){
+                var _$m = $(m);
+                var _j = j+1;
+                if(_j < step){
+                  _$m.attr("class","ystep-step-done");
+                }else if(_j === step){
+                  _$m.attr("class","ystep-step-active");
+                }else if(_j > step){
+                  _$m.attr("class","ystep-step-undone");
+                }
+              });
+            }
+          });
+        }else{
+          return false;
+        }
+      });
+    },
+    //获取当前步骤
+    getStep: function() {
+      var result = [];
+      
+      $(this)._searchStep(function(i,j,n,m){
+        result.push(j+1);
+      });
+      
+      if(result.length == 1) {
+        return result[0];
+      }else{
+        return result;
+      }
+    },
+    //下一个步骤
+    nextStep: function() {
+      $(this)._searchStep(function(i,j,n,m){
+        $(n).setStep(j+2);
+      });
+    },
+    //上一个步骤
+    prevStep: function() {
+      $(this)._searchStep(function(i,j,n,m){
+        $(n).setStep(j);
+      });
+    },
+    //通用节点查找
+    _searchStep: function (callback) {
+      $(this).each(function(i,n){
+        var $steps = $(n).find(".ystep-container").find("li");
+        $steps.each(function(j,m){
+          //判断是否为活动步骤
+          if($(m).attr("class") === "ystep-step-active"){
+            if(callback){
+              callback(i,j,n,m);
+            }
+            return false;
+          }
+        });
+      });
+    }
+  });
+})(jQuery);

+ 29 - 2
VisualInspection/js/mytask/check.js

@@ -292,14 +292,41 @@ function addobj(data) {
         });
     });
  }
+
+ function submitCheck(){
+        var param = {
+            "id": $.checkTask.id,
+            "check_status":4
+        }
+        no_return_common_service("/task/taskEnd/",param,function(data){
+             layer.msg(data, {
+                time: 2000//20s后自动关闭
+             });
+            changePage("/view/mytask/unchecked.html");
+        });
+        
+    }
 function showPre(id){
     // $('#myModal').modal({name:"dd"});
     changePage("/view/mytask/taskDetail.html");
 }
+function showInvalid() {
+    invalidLayer = showPopup4Common('申请无效',function(){
+        saveValidReason();
+    },['400px','500px'],'#invalid_div');
 
+}
 function saveValidReason(){
-    alert("提交成功!");
-    $('#validSubmitWin').modal('toggle');
+    var param = {
+        "task_id": $.checkTask.id,
+        "apply_reason":$("#apply_reason").val()
+    }
+    no_return_common_service("/checkApply/add/",param,function(data){
+        layer.msg("申请提交成功", {
+            time: 2000//20s后自动关闭
+            });
+        changePage("/view/mytask/unchecked.html");
+    });
 }
 
 

+ 188 - 4
VisualInspection/js/mytask/unchecked.js

@@ -3,14 +3,15 @@ function queryUncheckedTask(){
     var data = {
         "start_time": $("#start_time").val(),
         "end_time": $("#end_time").val(),
-        "dept": $("#dept").val()
+        "dept": $("#dept").val(),
+        "check_status":2
     }
     var cols = [
                 {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
                 {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
-                {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person'},
-                {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept'},
-                {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman'},
+                {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
+                {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
+                {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
                 {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
                 {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
                 {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
@@ -28,8 +29,191 @@ function queryUncheckedTask(){
                             'param':data}
                             );
 }
+
 function showCheck(id){
     // $('#myModal').modal({name:"dd"});
     $.checkTask =getItemByIdFromArr(id,$('.datatable').mytable('getTableData'));
     changePage("/view/mytask/check.html");
+}
+
+function queryUnexaminedTask(){
+    var data = {
+        "start_time": $("#start_time").val(),
+        "end_time": $("#end_time").val(),
+        "dept": $("#dept").val(),
+        "check_status":21
+    }
+    var cols = [
+                {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
+                {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
+                {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
+                {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
+                {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
+                {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
+                {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
+                {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
+                    oper:[
+                        {func:'showApplyDetail',text:'详情',icon_class:'icon-edit'}
+                    ]
+                }
+            ];
+    
+    // var pager = {
+    //     page_size:10
+    // }
+    $('#unexamined_datatable').mytable({'cols':cols,
+                            'url':"/task/getTaskList/",
+                            'param':data}
+                            );
+}
+
+function showApplyDetail(id){
+    layer.open({
+        type: 1,
+        area: ['400px','500px'],
+        title: '申请详情',
+        closeBtn: 1,
+        shadeClose: true,
+        skin: 'layui-layer-lan',
+        content: $('#apply_detail_div'),
+        btn: ['同意', '拒绝'],
+        btnAlign: 'c', //按钮居中
+        shade: 0 ,//不显示遮罩
+        yes: function(index){
+            aggreeApply(id,);
+            layer.close(index);
+        },
+        btn2: function(index){
+            refuseApply(id)
+            layer.close(index);
+        }
+    });
+    var param = {
+        'id':id
+    };
+    post_common_service('/checkApply/getByTaskId', param, function(data) {
+        $('#apply_man').val(data.apply_man);
+        $('#apply_time').val(data.apply_time);
+        $('#apply_reason').val(data.apply_reason);
+        $('#apply_id').val(data.id);        
+    });
+}
+function aggreeApply(taskId){
+    var param = {
+        'id':$('#apply_id').val(),
+        'task_id':taskId
+    };
+    addOrUpdateItem4Common(param,'/checkApply/agree',queryUnexaminedTask);
+}
+
+function refuseApply(taskId){
+     var param = {
+        'id':$('#apply_id').val(),
+        'task_id':taskId
+    };
+    addOrUpdateItem4Common(param,'/checkApply/refuse',queryUnexaminedTask);
+}
+
+function queryUndispatchedTask(){
+    var data = {
+        "start_time": $("#start_time").val(),
+        "end_time": $("#end_time").val(),
+        "dept": $("#dept").val(),
+        "check_status":4
+    }
+    var cols = [
+                {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
+                {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
+                {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
+                {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
+                {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
+                {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
+                {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
+                {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
+                    oper:[
+                        {func:'showTaskDetail',text:'任务详情',icon_class:'icon-edit'},
+                        {func:'dispatchTaskById',text:'下发',icon_class:'icon-edit'}
+                    ]
+                }
+            ];
+    
+    // var pager = {
+    //     page_size:10
+    // }
+    $('#undispatched_datatable').mytable({'cols':cols,
+                            'url':"/task/getTaskList/",
+                            'param':data}
+                            );
+}
+function showTaskDetail(id){
+    var rowData=getItemByIdFromArr(id,$('#undispatched_datatable').mytable('getTableData'));
+    $.checkTask = rowData;
+    changePage("/view/mytask/taskDetail.html");
+}
+
+function dispatchTaskPatch(){
+    var param = {
+        "start_time": $("#start_time").val(),
+        "end_time": $("#end_time").val(),
+        "dept": $("#dept").val(),
+        "check_status":4
+    }
+
+    no_return_common_service('/task/dispatch', param, function(data){
+        queryUndispatchedTask();
+        layer.msg(data, {
+            time: 2000//20s后自动关闭
+        });
+    });
+}
+
+function dispatchTaskById(id){
+    var param = {
+        "id": id,
+        "check_status":5
+    }
+
+    no_return_common_service('/task/dispatchById', param, function(data){
+        queryUndispatchedTask();
+        layer.msg(data, {
+            time: 2000//20s后自动关闭
+        });
+    });
+}
+
+function queryDispatchedTask(){
+    var data = {
+        "start_time": $("#start_time").val(),
+        "end_time": $("#end_time").val(),
+        "dept": $("#dept").val(),
+        "check_status":5
+    }
+    var cols = [
+                {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
+                {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
+                {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
+                {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
+                {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
+                {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
+                {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
+                {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
+                    oper:[
+                        {func:'showTaskDetail1',text:'任务详情',icon_class:'icon-edit'}
+                    ]
+                }
+            ];
+    
+    // var pager = {
+    //     page_size:10
+    // }
+    $('#dispatched_datatable').mytable({'cols':cols,
+                            'url':"/task/getTaskList/",
+                            'param':data}
+                            );
+}
+
+function showTaskDetail1(id){
+    var rowData=getItemByIdFromArr(id,$('#dispatched_datatable').mytable('getTableData'));
+    $.checkTask = rowData;
+    changePage("/view/mytask/taskDetail.html");
 }

+ 28 - 3
VisualInspection/js/util/util.js

@@ -125,14 +125,15 @@ function showPopup4Common(title,callback,area,divId){
         btnAlign: 'c', //按钮居中
         shade: 0 ,//不显示遮罩
         yes: function(index){
-            callback();
-             if(callback()!=false){
-                layer.close(index);
+            if(callback!=false){
+               callback();
             }
+            layer.close(index);
         }
     });
 }
 
+
 function deleteItem4Common(id,url,okCb){
     //询问框
     layer.confirm('确定删除记录?', {
@@ -247,4 +248,28 @@ function tip(data,timeout){
     layer.msg(data, {
             time: (timeout!=null)?timeout:2000 //20s后自动关闭
         });
+}
+
+function showPopup4CommonBtns(title,area,divId,btns,callback1,callback2){
+    if(!area) area='auto';
+    if(!divId) divId='#form-div';
+    //添加常量页面
+    return layer.open({
+        type: 1,
+        area: area,
+        title: title,
+        closeBtn: 1,
+        shadeClose: true,
+        skin: 'layui-layer-lan',
+        content: $(divId),
+        btn: btns,
+        btnAlign: 'c', //按钮居中
+        shade: 0 ,//不显示遮罩
+        yes: function(index){
+            if(callback!=false){
+               callback();
+            }
+            layer.close(index);
+        }
+    });
 }

+ 2 - 1
VisualInspection/view/common/commoncsslink.html

@@ -4,4 +4,5 @@
 <link rel="stylesheet" type="text/css" href="/js/lib/treeSelect.css">
 <link rel="stylesheet" type="text/css" href="/css/common/header.css">
 <link rel="stylesheet" type="text/css" href="/css/common/foot.css">
-<link rel="stylesheet" type="text/css" href="/js/lib/kkpager_green.css">
+<link rel="stylesheet" type="text/css" href="/js/lib/kkpager_green.css">
+<link rel="stylesheet" type="text/css" href="/js/lib/ystep/css/ystep.css">

+ 1 - 0
VisualInspection/view/common/commonscriptlink.html

@@ -14,6 +14,7 @@
 <script src="/node_modules/ztree/js/jquery.ztree.all.min.js"></script>
 <script src="/js/lib/treeSelect.js"></script>
 <script src="/js/lib/kkpager.min.js"></script>
+<script src="/js/lib/ystep/js/ystep.js"></script>
 <script src="/js/util/util.js"></script>
 <script src="/js/util/service.js"></script>
 <script src="/js/constant/constant.js"></script>

+ 2 - 1
VisualInspection/view/main.html

@@ -7,7 +7,8 @@
     <link rel="import" href="/view/common/commoncsslink.html?__inline">
     <link rel="stylesheet" type="text/css" href="/css/main.css">
     <link rel="import" href="/view/common/commonscriptlink.html?__inline">
-    <script src="/js/mytask/check.js"></script> 
+    <script src="/js/mytask/unchecked.js"></script>
+    <script src="/js/mytask/check.js"></script>
     <!--<link rel="stylesheet" type="text/css" href="/css/user/userManager.css?__inline">
 <script type="text/javascript" src="/node_modules/zui/dist/lib/dashboard/zui.dashboard.min.js?__inline"></script>
 <link rel="stylesheet" type="text/css" href="/node_modules/zui/dist/lib/dashboard/zui.dashboard.min.css">

+ 23 - 0
VisualInspection/view/mytask/applyDetail.html

@@ -0,0 +1,23 @@
+<div class="container-fluid ">
+    <form class="form-horizontal" style="margin-top:10px;">
+        <input type="hidden" class="form-control" id="apply_id" disabled="disabled" placeholder="">
+        <div class="form-group">
+            <label for="exampleInputAccount1" class="col-md-4 col-sm-2">申请人</label>
+            <div class="col-md-6 col-sm-10">
+                <input type="text" class="form-control" id="apply_man" disabled="disabled" placeholder="">
+            </div>
+        </div>
+        <div class="form-group">
+            <label for="exampleInputAccount1" class="col-md-4 col-sm-2">申请时间</label>
+            <div class="col-md-6 col-sm-10">
+                <input type="text" class="form-control" id="apply_time" disabled="disabled" placeholder="">
+            </div>
+        </div>
+        <div class="form-group">
+            <label class="col-md-4 col-sm-2">原因</label>
+            <div class="col-md-6 col-sm-10">
+                <input type="text" class="form-control" id="apply_reason" disabled="disabled" placeholder="">
+            </div>
+        </div>
+    </form>
+</div>

+ 13 - 23
VisualInspection/view/mytask/check.html

@@ -15,7 +15,7 @@
                 <label class="col-sm-1">考核人员</label>
                 <div class="col-sm-2">
                     <!-- 使用图片 -->
-                    <a id="person_img" href="../../images/img4.jpg" class="lightbox-toggle"><img src="../../images/img4.jpg" alt="" style="width:50px;height:50px;"></a>
+                    <a id="person_img" href="../../images/img4.jpg" class="lightbox-toggle"><img src="../../images/img4.jpg" class="img-thumbnail" style="width:50px;height:50px;"></a>
                     <label id="checked_person"></label>
                 </div>
                 <div class="col-sm-2">
@@ -82,11 +82,11 @@
             <div id="score_datatable" style="height:490px;" data-checkable="true" data-sortable="true"></div>
             <div class="row" style="margin-top:5px;">
                 <div class="col-sm-10">
-                    <button class="btn btn-primary" type="button" onclick="submitResult()">直接提交</button>
+                    <button class="btn btn-primary" type="button" onclick="submitCheck()">直接提交</button>
                     <button class="btn btn-primary" type="button" onclick="showPre()">预览提交</button>
-                    <button class="btn btn-danger" type="button" data-toggle="modal" data-target="#validSubmitWin">申请无效</button>
-                    <button class="btn btn-primary" type="button" data-toggle="modal" data-target="#refuseApplyWin">拒绝申请</button>
-                    <button class="btn btn-primary" type="button" onclick="agreeApply()">同意申请</button>
+                    <button class="btn btn-danger" type="button" onclick="showInvalid()">申请无效</button>
+                    <!--<button class="btn btn-primary" type="button" data-toggle="modal" data-target="#refuseApplyWin">拒绝申请</button>
+                    <button class="btn btn-primary" type="button" onclick="agreeApply()">同意申请</button>-->
                 </div>
             </div>
         </div>
@@ -124,28 +124,18 @@
     </div>
 </div>
 <!-- 对话框HTML -->
-<div class="modal fade" id="refuseApplyWin">
-    <div class="modal-dialog">
-        <div class="modal-content">
-            <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
-                <h4 class="modal-title">拒绝申请</h4>
-            </div>
-            <div class="modal-body">
-                <form  class="form-horizontal">
-                    <label for="exampleInputAccount1" class="col-sm-2">拒绝原因</label>
-                    <div class="form-group">
-                        <input class="col-sm-3" type="text" id="valid-reason" class="form-control" placeholder="原因">
-                    </div>
-                </form>
-            </div>
-            <div class="modal-footer">
-                <button type="button" class="btn btn-primary" onclick="refuseApply()">保存</button>
+<div id="invalid_div" style="display:none;text-align:center;">
+    <div class="container-fluid ">
+        <div class="cards">
+            <div class="form-group">
+                <label class="col-md-4 col-sm-2">原因</label>
+                <div class="col-md-6 col-sm-10">
+                        <input type="text" class="form-control" id="apply_reason" placeholder="">
+                </div>
             </div>
         </div>
     </div>
 </div>
-
 <script>
     $(document).ready(function() {
         initCheck();

+ 59 - 112
VisualInspection/view/mytask/dispatched.html

@@ -1,115 +1,62 @@
-    <div class="container-fluid ">
-        <div class="row">
-            <form  class="form-horizontal">
-                <div class="form-group">
-                    <label for="exampleInputAccount1" class="col-sm-1">稽查日期</label>
-                    <div class="col-sm-2">
-                        <input type="text" id="start-time" class="form-control form-date" placeholder="开始时间">
-                    </div>
-                    <div class="col-sm-2">
-                        <input type="text" id="end-time" class="form-control form-date" placeholder="截止时间">
-                    </div>
-                    <label for="exampleInputAccount1" class="col-sm-1">考核部门</label>
-                    <div class="col-sm-2">
-                        <select class="form-control">
-                            <option value="">全部</option>
-                            <option value="1">东台收费站</option>
-                            <option value="2">收费站</option>
-                            <option value="3">收费站</option>
-                        </select>
-                    </div>
-                    <div class="col-sm-2">
-                        <button class="btn btn-primary " type="button">查询</button>
-                    </div>
+<!--<script src="/js/mytask/unchecked.js"></script> -->
+<div class="container-fluid ">
+    <div class="row">
+        <form  class="form-horizontal">
+            <div class="form-group">
+                <label for="exampleInputAccount1" class="col-sm-1">稽查日期</label>
+                <div class="col-sm-2">
+                    <input type="text" id="start-time" class="form-control form-date" placeholder="开始时间">
                 </div>
-            </form>
-        </div>
-        <br>
-
-        <div class="row">
-            <!-- 使用一个div来显示数据表格 -->
-            <div class="datatable" data-checkable="true" data-sortable="true"></div 
-        </div>
-        <div class="row" style="text-align:center">
-            <ul class="pager center-block">
-                <li class="previous"><a href="#">« 上一页</a></li>
-                <li><a href="#">1</a></li>
-                <li class="active"><a href="#">2</a></li>
-                <li><a href="#">3</a></li>
-                <li><a href="#">4</a></li>
-                <li><a href="#">5</a></li>
-                <li class="next"><a href="#">下一页 »</a></li>
-            </ul>
-        </div>
-    </div>
-    <!-- 对话框HTML -->
-    <div class="modal fade" id="myModal">
-    <div class="modal-dialog">
-        <div class="modal-content">
-            
-        </div>
-        <div class="modal-content">
-      <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
-        <h4 class="modal-title">添加常量</h4>
-      </div>
-      <div class="modal-body">
-        <link rel="import" href="/view/constant/form.html?__inline">
-      </div>
-    </div>
-    </div>
+                <div class="col-sm-2">
+                    <input type="text" id="end-time" class="form-control form-date" placeholder="截止时间">
+                </div>
+                <label for="exampleInputAccount1" class="col-sm-1">考核部门</label>
+                <div class="col-sm-2">
+                    <select class="form-control" id="fsList">
+                    </select>
+                </div>
+                <div class="col-sm-2">
+                    <button class="btn btn-primary " type="button" onclick="queryUnexaminedTask()">查询</button>
+                </div>
+            </div>
+        </form>
     </div>
-    <script>
-        $(document).ready(function() {
-            // 仅选择日期
-            $("#start-time").datetimepicker(
-            {
-                language:  "zh-CN",
-                weekStart: 1,
-                todayBtn:  1,
-                autoclose: 1,
-                todayHighlight: 1,
-                startView: 2,
-                minView: 2,
-                forceParse: 0,
-                format: "yyyy-mm-dd"
-            });
-            // 仅选择日期
-            $("#end-time").datetimepicker(
-            {
-                language:  "zh-CN",
-                weekStart: 1,
-                todayBtn:  1,
-                autoclose: 1,
-                todayHighlight: 1,
-                startView: 2,
-                minView: 2,
-                forceParse: 0,
-                format: "yyyy-mm-dd"
-            });
-            // 使用data参数更新数据:
-            $('.datatable').datatable( {
-                checkable:false,
-                sortable:false,
-                data: {
-                    cols: [
-                        {width: 30, text: '序号', type: 'number', flex: false, colClass: 'text-center'},
-                        {width: 80, text: '任务名称', type: 'date', flex: false, sort: 'down'},
-                        {width: 80, text: '考核人员', type: 'string', flex: true, colClass: ''},
-                        {width: 80, text: '考核部门', type: 'date', flex: false, sort: 'down'},
-                        {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: ''},
-                        {width: 80, text: '稽查时间段', type: 'date', flex: false, sort: 'down'},
-                        {width: 80, text: '状态', type: 'string', flex: true, colClass: ''},
-                        {width: 80, text: '稽查时间', type: 'string', flex: true, colClass: ''},
-                        {width: 160, text: '操作', type: 'string', flex: true, colClass: ''}
-                    ],
-                    rows: [
-                        {checked: false, data: [1, '20170404收费站稽查任务','李敏','收费站','徐薇','2017-04-04  00:00-24:00','已下发','2017-04-05 10:00','<a href="###" onclick="showTaskDetail()"><i class="icon-table"></i>查看结果</a>']},
-                        {checked: false, data: [2, '20170404收费站稽查任务','李敏','收费站','徐薇1','2017-04-04  00:00-24:00','已下发','2017-04-05 10:00','<a href="###"><i class="icon-table"></i>查看结果</a>']},
-                        // 更多数据
-                    ]
-                }
-            });
+    <br>
+
+    <div id="dispatched_datatable"></div>
+</div>
+<div id="apply_detail_div" style="display:none;text-align:center;">
+    <link rel="import" href="/view/mytask/applyDetail.html?__inline">   
+</div> 
+<script>
+    $(document).ready(function() {
+        // 仅选择日期
+        $("#start-time").datetimepicker(
+        {
+            language:  "zh-CN",
+            weekStart: 1,
+            todayBtn:  1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
+        });
+        // 仅选择日期
+        $("#end-time").datetimepicker(
+        {
+            language:  "zh-CN",
+            weekStart: 1,
+            todayBtn:  1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
         });
-        
-    </script>
+        setFeSelect("#fsList");
+        queryDispatchedTask();
+    });
+</script>

+ 158 - 55
VisualInspection/view/mytask/taskDetail.html

@@ -5,79 +5,182 @@
         <div class="page-header">
             <table style="width:100%;">
                 <tr>
-                    <td width="25%">考核任务名:20170404收费站稽查任务</td>
-                    <td width="25%">考核人:李娟</td>
-                    <td width="25%">考核时间: 8:20-10:30</td>
-                    <td width="25%">考核视频数:2</td>
+                    <td width="20%">考核任务名:<label id="name"></label></td>
+                    <td width="20%">考核人:<label id="checkman"></label></td>
+                    <td width="20%">考核时间: <label id="checktime"></label></td>
+                    <td width="20%">被考核人:<label id="checked_person"></label></td>
+                    <td width="20%">被考核部门:<label id="checked_dept"></label></td>
                 </tr>
             </table>
         </div>
       </div>
       <div class="row">
         <h3>考核任务流程</h3>
-        <div>
-            <div class="col-sm-2" style="text-align:center;">
-                <div class="row">
-                    <label for="exampleInputAccount1">2017-05-12 10:00</label>
-                </div>
-                <div class="row">
-                    <label for="exampleInputAccount1">任务生成</label>
-                </div>
-                <div class="row" style="text-align:center;font-size:20px;">
-                    <i class="icon icon-circle"></i>
-                </div>
-            </div>
-            <div class="col-sm-1" style="text-align:center;">
-                <div class="row">
-                    <label for="exampleInputAccount1"></label>
-                </div>
-                <div class="row" style="text-align:center;font-size:20px;">
-                    <i class="icon icon-long-arrow-right"></i>
-                </div>
-            </div>    
-            <div class="col-sm-2" style="text-align:center;">
-                <div class="row">
-                    <label for="exampleInputAccount1">2017-05-12 11:00</label>
-                </div>
-                 <div class="row">
-                    <label for="exampleInputAccount1">任务稽查</label>
-                </div>
-                <div class="row" style="font-size:20px;">
-                    <i class="icon icon-circle"></i>
-                </div>
-            </div>
+        <div id="flow_div">
         </div>
       </div>
       <hr>
       <div class="row">
         <h3>考核详细内容</h3>
         <div>
-            <div class="datatable" data-checkable="true" data-sortable="true"></div>
+            <div id="score_datatable" data-checkable="true" data-sortable="true"></div>
         </div>
       </div>
+    <div class="row" style="margin-top:5px;text-align:center">
+        <div class="btn-group">
+            <button type="button" class="btn btn-warning" onclick="submitCheck()">提交</button>
+        </div>
+    </div>
+</div>
+<div id="form-div" style="display:none;text-align:center;height:300px;padding:5px;">
+    <div class="row">
+        <div id="img_container" class="cards cards-borderless col-sm-12">
+        </div>
+    </div> 
 </div>
+<style>
+    .line{
+        text-align:center;font-size:20px;height:10px;margin:15px 0px;width:100%;background:#516784;overflow:hidden;
+    }
+    .timeline_item_station {
+        left: 50%;
+        margin-left: 60px;
+        margin-top: 50px;
+        width: 40px;
+        height: 40px;
+        padding: 15px;
+        border-width: 6px;
+        background-color: #516784;
+        position: absolute;
+        border-radius: 50%;
+        padding: 10px;
+        top: 0;
+        left: 10%;
+        -webkit-transition: all .3s ease-out;
+        transition: all .3s ease-out;
+    }
+</style>
 <script>
     $(document).ready(function() {
-        
+        $("#name").html($.checkTask.name);
+        $("#checkman").html($.checkTask.checkman_name);
+        $("#checktime").html($.checkTask.start_time);
+        $("#checked_person").html($.checkTask.checked_person_name);
+        $("#checked_dept").html($.checkTask.checked_dept_name);
+
+        genFlow();
+        queryScores();
+       
+        $('a.lightbox-toggle').lightbox();
+    });
+    function queryScores(){
         // 使用data参数更新数据:
-        $('.datatable').datatable( {
-            checkable:false,
-            sortable:false,
-            data: {
-                cols: [
-                    {width: 30, text: '序号', type: 'number', flex: true, colClass: 'text-center'},
-                    {width: 100, text: '考核内容', type: 'string', flex: true, sort: 'down'},
-                    {width: 30, text: '扣分', type: 'string', flex: true, colClass: ''},
-                    {width: 200, text: '录像截图', type: 'string', flex: true, colClass: ''},
-                    {width: 100, text: '操作', type: 'string', flex: true, colClass: ''}
-                ],
-                rows: [
-                    {checked: false, data: [1, '未按规定收取过路费,着装不规范','10','<a href="../../images/img4.jpg" class="lightbox-toggle" data-toggle="lightbox" data-group="image-group-1"><img src="../../images/img4.jpg" class="img-rounded" alt="" width="50px"></a><a href="../../images/img4.jpg" class="lightbox-toggle" data-toggle="lightbox" data-group="image-group-1"><img src="../../images/img4.jpg" class="img-rounded" alt="" width="50px"></a><a href="../../images/img4.jpg" class="lightbox-toggle" data-toggle="lightbox" data-group="image-group-1"><img src="../../images/img4.jpg" class="img-rounded" alt="" width="50px"></a>',' <a href="#" data-toggle="modal" data-target="#myModal"><i class="icon icon-edit"></i>修改 </a><a href="#"><i class="icon icon-remove-circle"></i>删除</a>']},
-                    {checked: false, data: [2, '服务区垃圾房应封闭,房内垃圾入袋,地面无污水','20','<a href="../../images/img4.jpg" class="lightbox-toggle" data-toggle="lightbox" data-group="image-group-1"><img src="../../images/img4.jpg" class="img-rounded" alt="" width="50px"></a> ','<a href="#" data-toggle="modal" data-target="#myModal"><i class="icon icon-edit"></i>修改 </a><a href="#"><i class="icon icon-remove-circle"></i>删除</a>']},
-                    // 更多数据
-                ]
+        var data = {
+            "task_id": $.checkTask.id
+        }
+        var cols = [
+                    {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
+                    {width: 60, text: '评分记录', type: 'string', flex: true, sort: 'down',field: 'content'},
+                    {width: 80, text: '分数', type: 'string', flex: true, colClass: '',field: 'check_item_score'},
+                    {width: 200, text: '图片', type: 'imagedd', flex: true, colClass: '',field: 'pics'},
+                    {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
+                        oper:[
+                            {func:'showEditScore',text:'修改',icon_class:'icon-edit'},
+                            {func:'deleteScore',text:'删除',icon_class:'icon-remove-circle'}
+                        ]
+                    }
+                ];
+        
+        $('#score_datatable').mytable({'cols':cols,
+                                'url':"/score/getScoreList/",
+                                'param':data}
+                                );
+    }
+    var curScoreId;
+    function showEditScore(id){
+        var rowData=getItemByIdFromArr(id,$('#score_datatable').mytable('getTableData'));
+        // alert(rowData.pics);
+        curScoreId = rowData.id;
+        scoreImageLayer = showPopup4Common('修改图片',updateImg,'600px');
+        showPics(rowData.pics);
+    }
+
+    function showPics(pics,divId){
+        var picStr='';
+        if(!divId) divId = '#img_container';
+        $(divId).html(picStr);
+        if(pics){
+            var picArr = pics.split(',');
+            for(var i in picArr){
+                var pic = '<div id="img_item_'+i+'" class="col-md-4 col-sm-6 col-lg-3">'
+                    +  '<a href="javascript:void(0)" onclick="removeImg(\'#img_item_'+i+'\')" style="float:right;position:absolute;z-index:100;"><span class="label label-danger"><i class="icon icon-remove-circle"></i> 删除</span></a>'
+                    +  '<a class="card lightbox-toggle" href="'+picArr[i]+'" style="position:absolute">'
+                    +      '<img class="pic-class img-thumbnail" style="width:200px;height:150px;" src="'+picArr[i]+'" alt="">'
+                    +  '</a>'
+                    +'</div>';
+                picStr+=pic;
+            }
+            $(divId).html(picStr);
+            $('a.lightbox-toggle').lightbox();
+        }
+    }
+    function updateImg(){
+        
+        var imgArr = $("#img_container .pic-class");
+        var picsStr="";
+        if(imgArr && imgArr.length>0) {
+            for(var i=0;i<imgArr.length;i++){
+                picsStr+=imgArr[i].src+","
             }
+            picsStr = picsStr.substr(0,picsStr.length-1);
+        }
+        var param= {
+            'id':curScoreId,
+            'pics':picsStr
+        }
+        // alert("dddd");
+        addOrUpdateItem4Common(param,"/score/update",queryScores);
+        curScoreId="";
+    }
+    function deleteScore(id){
+        deleteItem4Common(id,"/score/delete/",queryScores);
+    }
+    function genFlow(){
+        var data = {
+            "id": $.checkTask.id
+        };
+        post_common_service("/task/getStatusById/",data,function(data){
+            if(data) {
+                var flowStr="";
+                for(var i in data) {
+                    var str = '<div class="col-sm-2" style="text-align:center;padding:0px;">'
+                                + '<div class="row">'
+                                +  '   <label>'+data[i].update_time+'</label>'
+                                + '</div>'
+                                + '<div class="row">'
+                                +  '   <label>'+data[i].check_status_name+'</label>'
+                                + '</div>'
+                                + '<div class="row line">'
+                                + '    <div class="timeline_item_station"></div>'
+                                + '</div>'
+                                +'</div>';
+                    flowStr+=str;
+                }
+                $("#flow_div").html(flowStr);
+            }
+        })
+    }
+    function submitCheck(){
+        var param = {
+            "id": $.checkTask.id,
+            "check_status":4
+        }
+        no_return_common_service("/task/taskEnd/",param,function(data){
+             layer.msg(data, {
+                time: 2000//20s后自动关闭
+             });
+            changePage("/view/mytask/unchecked.html");
         });
-        $('a.lightbox-toggle').lightbox();
-    });
+        
+    }
     </script>

+ 9 - 20
VisualInspection/view/mytask/undispatched.html

@@ -1,4 +1,4 @@
-<script src="/js/mytask/undispatched.js"></script> 
+<!--<script src="/js/mytask/unchecked.js"></script> -->
 <div class="container-fluid ">
     <div class="row">
         <form  class="form-horizontal">
@@ -12,26 +12,25 @@
                 </div>
                 <label for="exampleInputAccount1" class="col-sm-1">考核部门</label>
                 <div class="col-sm-2">
-                    <select class="form-control">
-                        <option value="">全部</option>
-                        <option value="1">东台收费站</option>
-                        <option value="2">收费站</option>
-                        <option value="3">收费站</option>
+                    <select class="form-control" id="fsList">
                     </select>
                 </div>
                 <div class="col-sm-2">
-                    <button class="btn btn-primary " type="button" onclick="queryUndispatchedTask()">查询</button>
+                    <button class="btn btn-primary " type="button" onclick="queryUnexaminedTask()">查询</button>
                 </div>
                 <div style="float:right;">
-                    <button class="btn btn-success" type="button" onclick="dispatchAll()"><i class="icon icon-plus-sign"></i> 一键下发</button>
+                    <button class="btn btn-success" type="button" onclick="dispatchTaskPatch()"><i class="icon icon-plus-sign"></i> 一键下发</button>
                 </div>
             </div>
         </form>
     </div>
     <br>
 
-    <div class="datatable"></div>
+    <div id="undispatched_datatable"></div>
 </div>
+<div id="apply_detail_div" style="display:none;text-align:center;">
+    <link rel="import" href="/view/mytask/applyDetail.html?__inline">   
+</div> 
 <script>
     $(document).ready(function() {
         // 仅选择日期
@@ -60,17 +59,7 @@
             forceParse: 0,
             format: "yyyy-mm-dd"
         });
+        setFeSelect("#fsList");
         queryUndispatchedTask();
     });
-
-    function dispatch(){
-        alert("下发成功!");
-    }
-
-    function dispatchAll(){
-        alert("下发成功!");
-    }
-    function showTaskDetail(){
-        changePage("/view/mytask/taskDetail.html");
-    }
 </script>

+ 59 - 115
VisualInspection/view/mytask/unexamined.html

@@ -1,118 +1,62 @@
-    <div class="container-fluid ">
-        <div class="row">
-            <form  class="form-horizontal">
-                <div class="form-group">
-                    <label for="exampleInputAccount1" class="col-sm-1">稽查日期</label>
-                    <div class="col-sm-2">
-                        <input type="text" id="start-time" class="form-control form-date" placeholder="开始时间">
-                    </div>
-                    <div class="col-sm-2">
-                        <input type="text" id="end-time" class="form-control form-date" placeholder="截止时间">
-                    </div>
-                    <label for="exampleInputAccount1" class="col-sm-1">考核部门</label>
-                    <div class="col-sm-2">
-                        <select class="form-control">
-                            <option value="">全部</option>
-                            <option value="1">东台收费站</option>
-                            <option value="2">收费站</option>
-                            <option value="3">收费站</option>
-                        </select>
-                    </div>
-                    <div class="col-sm-2">
-                        <button class="btn btn-primary " type="button">查询</button>
-                    </div>
+<!--<script src="/js/mytask/unchecked.js"></script> -->
+<div class="container-fluid ">
+    <div class="row">
+        <form  class="form-horizontal">
+            <div class="form-group">
+                <label for="exampleInputAccount1" class="col-sm-1">稽查日期</label>
+                <div class="col-sm-2">
+                    <input type="text" id="start-time" class="form-control form-date" placeholder="开始时间">
                 </div>
-            </form>
-        </div>
-        <br>
-
-        <div class="row">
-            <!-- 使用一个div来显示数据表格 -->
-            <div class="datatable" data-checkable="true" data-sortable="true"></div 
-        </div>
-        <div class="row" style="text-align:center">
-            <ul class="pager center-block">
-                <li class="previous"><a href="#">« 上一页</a></li>
-                <li><a href="#">1</a></li>
-                <li class="active"><a href="#">2</a></li>
-                <li><a href="#">3</a></li>
-                <li><a href="#">4</a></li>
-                <li><a href="#">5</a></li>
-                <li class="next"><a href="#">下一页 »</a></li>
-            </ul>
-        </div>
-    </div>
-    <!-- 对话框HTML -->
-    <div class="modal fade" id="myModal">
-    <div class="modal-dialog">
-        <div class="modal-content">
-            
-        </div>
-        <div class="modal-content">
-      <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
-        <h4 class="modal-title">添加常量</h4>
-      </div>
-      <div class="modal-body">
-        <link rel="import" href="/view/constant/form.html?__inline">
-      </div>
-    </div>
-    </div>
+                <div class="col-sm-2">
+                    <input type="text" id="end-time" class="form-control form-date" placeholder="截止时间">
+                </div>
+                <label for="exampleInputAccount1" class="col-sm-1">考核部门</label>
+                <div class="col-sm-2">
+                    <select class="form-control" id="fsList">
+                    </select>
+                </div>
+                <div class="col-sm-2">
+                    <button class="btn btn-primary " type="button" onclick="queryUnexaminedTask()">查询</button>
+                </div>
+            </div>
+        </form>
     </div>
-    <script>
-        $(document).ready(function() {
-            // 仅选择日期
-            $("#start-time").datetimepicker(
-            {
-                language:  "zh-CN",
-                weekStart: 1,
-                todayBtn:  1,
-                autoclose: 1,
-                todayHighlight: 1,
-                startView: 2,
-                minView: 2,
-                forceParse: 0,
-                format: "yyyy-mm-dd"
-            });
-            // 仅选择日期
-            $("#end-time").datetimepicker(
-            {
-                language:  "zh-CN",
-                weekStart: 1,
-                todayBtn:  1,
-                autoclose: 1,
-                todayHighlight: 1,
-                startView: 2,
-                minView: 2,
-                forceParse: 0,
-                format: "yyyy-mm-dd"
-            });
-            // 使用data参数更新数据:
-            $('.datatable').datatable( {
-                checkable:false,
-                sortable:false,
-                data: {
-                    cols: [
-                        {width: 80, text: '序号', type: 'number', flex: false, colClass: 'text-center'},
-                        {width: 160, text: '任务名称', type: 'date', flex: false, sort: 'down'},
-                        {width: 80, text: '考核人员', type: 'string', flex: true, colClass: ''},
-                        {width: 160, text: '考核部门', type: 'date', flex: false, sort: 'down'},
-                        {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: ''},
-                        {width: 160, text: '稽查时间段', type: 'date', flex: false, sort: 'down'},
-                        {width: 80, text: '状态', type: 'string', flex: true, colClass: ''},
-                        {width: 80, text: '理由', type: 'string', flex: true, colClass: ''},
-                        {width: 80, text: '操作', type: 'string', flex: true, colClass: ''}
-                    ],
-                    rows: [
-                        {checked: false, data: [1, '20170404收费站稽查任务','李敏','收费站','徐薇','2017-04-04  00:00-24:00','待审核','无车辆进出','<a href="###" onclick="showExamine(1)"><i class="icon-ok-sign"></i>审核</a>']},
-                        {checked: false, data: [2, '20170404收费站稽查任务','李敏','收费站','徐薇1','2017-04-04  00:00-24:00','待审核','无车辆进出','<a href="###"><i class="icon-ok-sign"></i>审核</a>']},
-                        // 更多数据
-                    ]
-                }
-            });
+    <br>
+
+    <div id="unexamined_datatable"></div>
+</div>
+<div id="apply_detail_div" style="display:none;text-align:center;">
+    <link rel="import" href="/view/mytask/applyDetail.html?__inline">   
+</div> 
+<script>
+    $(document).ready(function() {
+        // 仅选择日期
+        $("#start-time").datetimepicker(
+        {
+            language:  "zh-CN",
+            weekStart: 1,
+            todayBtn:  1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
+        });
+        // 仅选择日期
+        $("#end-time").datetimepicker(
+        {
+            language:  "zh-CN",
+            weekStart: 1,
+            todayBtn:  1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
         });
-         function showExamine(id){
-            // $('#myModal').modal({name:"dd"});
-            changePage("/view/mytask/check.html");
-        }
-    </script>
+        setFeSelect("#fsList");
+        queryUnexaminedTask();
+    });
+</script>

+ 15 - 2
VisualInspection_server/src/main/java/com/xintong/SystemInit.java

@@ -6,16 +6,20 @@ import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationListener;
 import org.springframework.context.event.ContextRefreshedEvent;
 
+import com.xintong.visualinspection.bean.Constant;
 import com.xintong.visualinspection.bean.Organ;
 import com.xintong.visualinspection.bean.User;
+import com.xintong.visualinspection.service.ConstantService;
 import com.xintong.visualinspection.service.DepartmentService;
 import com.xintong.visualinspection.service.UserService;
+import com.xintong.visualinspection.service.impl.ConstantServiceImpl;
 import com.xintong.visualinspection.service.impl.DepartmentServiceImpl;
 import com.xintong.visualinspection.service.impl.UserServiceImpl;
 import com.xintong.visualinspection.util.CacheUtil;
 
 public class SystemInit implements ApplicationListener<ContextRefreshedEvent> {
 
+	ConstantService constantService;
 	UserService userService;
 	DepartmentService deptService;
 	
@@ -23,19 +27,28 @@ public class SystemInit implements ApplicationListener<ContextRefreshedEvent> {
 	@Override
 	public void onApplicationEvent(ContextRefreshedEvent arg0) {
 		
+		constantService = arg0.getApplicationContext().getBean(ConstantServiceImpl.class);
+		//加载用户信息
+		List<Constant> constantList = constantService.getAll();
+		for(Constant c:constantList){
+			CacheUtil.codeMap.put(c.getCode_flag()+"_"+c.getCode_value(), c);
+		}
+		logger.info("加载用户信息成功,数据数:"+CacheUtil.userMap.size());
+		
 		userService = arg0.getApplicationContext().getBean(UserServiceImpl.class);
 		//加载用户信息
 		List<User> userList = userService.getAll();
 		for(User user:userList){
-			CacheUtil.userMap.put(user.getId(), user);
+			CacheUtil.userMap.put(new Long(user.getId()), user);
 		}
 		logger.info("加载用户信息成功,数据数:"+CacheUtil.userMap.size());
 		//加载部门信息
 		deptService = arg0.getApplicationContext().getBean(DepartmentServiceImpl.class);
 		List<Organ> deptList = deptService.getAll();
 		for(Organ organ:deptList){
-			CacheUtil.deptMap.put(organ.getId(), organ);
+			CacheUtil.deptMap.put(new Long(organ.getId()), organ);
 		}
 		logger.info("加载部门信息成功,数据数:"+CacheUtil.deptMap.size());
+		
 	}
 }

+ 5 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/TaskAutoGen.java

@@ -0,0 +1,5 @@
+package com.xintong.visualinspection;
+
+public class TaskAutoGen {
+
+}

+ 57 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/CheckApply.java

@@ -0,0 +1,57 @@
+package com.xintong.visualinspection.bean;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import lombok.Data;
+
+@Data
+public class CheckApply {
+	//编号
+    private Long id;
+    //申诉证据
+    private String apply_reason;
+    //申诉状态
+    private Integer check_status;
+    //申诉时间
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  
+    private Date apply_time;
+    //更新时间
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  
+    private Date update_time;
+    //申诉人
+    private Long apply_man;
+    //核实人
+    private Long verify_person;
+    //申诉部门
+    private Long apply_dept;
+    //考核任务
+    private Long task_id;
+    //备注
+    private String remark;
+    
+    
+    //申诉人
+    private String apply_man_name;
+    //核实人
+    private String verify_person_name;
+    //申诉部门
+    private String apply_dept_name;
+    
+    
+    //稽查任务关联信息
+    //任务名称
+    private String name;
+    //任务开始时间
+    private Date start_time;
+    //任务结束时间
+    private Date end_time;
+    //申诉状态
+    private String code_name;
+    
+}

+ 5 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Task.java

@@ -20,6 +20,8 @@ public class Task{
     private String name;
     //审核状态
     private Integer check_status;
+    //更新后的值
+    private Integer update_check_status;
     //审核状态
     private String check_status_name;
     //视屏编号
@@ -40,10 +42,13 @@ public class Task{
     private Date update_time;
     //考核人员ids
     private Long checkman;
+    private String checkman_name;
     //被考核人员id
     private Long checked_person;
+    private String checked_person_name;
     //被考核部门id
     private Long checked_dept;
+    private String checked_dept_name;
     //结束考核时间
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  

+ 27 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/BaseController.java

@@ -8,7 +8,11 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.ibatis.exceptions.TooManyResultsException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.validation.BindingResult;
 import org.springframework.validation.ObjectError;
 import org.springframework.web.bind.MethodArgumentNotValidException;
@@ -19,6 +23,9 @@ import com.alibaba.fastjson.JSON;
 import com.github.pagehelper.PageInfo;
 import com.xintong.system.err.BusinessException;
 import com.xintong.system.err.ErrorCode;
+import com.xintong.system.securityTools.JwtTokenUtil;
+import com.xintong.system.securityTools.RedisCacheUtil;
+import com.xintong.visualinspection.bean.User;
 
 /**
  * 文件名:TestController
@@ -26,7 +33,15 @@ import com.xintong.system.err.ErrorCode;
  */
 @ControllerAdvice
 public class BaseController {
-    
+	
+	@Autowired
+	private JwtTokenUtil jwtTokenUtil;
+	@Autowired
+	private RedisCacheUtil redisCacheUtil;
+	@Value("${jwt.header}")
+	private String tokenHeader;
+	@Value("${jwt.tokenHead}")
+	private String tokenHead;
     /**
      * 返回前台结果结构体
      * @return
@@ -154,4 +169,15 @@ public class BaseController {
        	}
        	return sb.toString();
     }
+    
+    public User getCurrentUser(HttpServletRequest request){
+    	String authHeader = request.getHeader(this.tokenHeader);
+    	String authToken = authHeader.substring(tokenHead.length());
+    	String username = jwtTokenUtil.getUsernameFromToken(authToken);
+		if (username != null) {
+			UserDetails u = redisCacheUtil.getUserByUserName(username);
+			return (User)u;
+		}
+		return null;
+    }
 }

+ 188 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/CheckApplyController.java

@@ -0,0 +1,188 @@
+package com.xintong.visualinspection.controller;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.xintong.system.err.BusinessException;
+import com.xintong.visualinspection.bean.CheckApply;
+import com.xintong.visualinspection.bean.Task;
+import com.xintong.visualinspection.bean.TaskStatus;
+import com.xintong.visualinspection.bean.User;
+import com.xintong.visualinspection.service.CheckApplyService;
+import com.xintong.visualinspection.service.TaskService;
+import com.xintong.visualinspection.util.CacheUtil;
+import com.xintong.visualinspection.util.Constants;
+
+/**
+ * 文件名:CheckItemController
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@RestController
+@RequestMapping("/checkApply")
+public class CheckApplyController extends BaseController {
+
+    @Autowired
+    private CheckApplyService checkApplyService;
+
+    @Autowired
+    private TaskService taskService;
+   
+    /**
+     * 添加考核项
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    @RequestMapping(value = "/add")
+    public String add(HttpServletRequest request,@Valid @RequestBody CheckApply checkAppeal){
+    	
+    	CheckApply ca = checkApplyService.getByTaskId(checkAppeal.getTask_id());
+		if(ca!=null) {
+			throw new BusinessException(21201);
+		}
+		
+    	User u = getCurrentUser(request);
+    	checkAppeal.setApply_man(new Long(u.getId()));
+    	checkAppeal.setCheck_status(Constants.STATUS_APPLYING);
+    	if(u.getOrganid()!=null)
+    		checkAppeal.setApply_dept(new Long(u.getOrganid()));
+    	checkApplyService.insert(checkAppeal);
+    	Task task = taskService.getById(checkAppeal.getTask_id());
+    	task.setCheck_status(checkAppeal.getCheck_status());
+    	taskService.update(task);
+//    	//添加状态
+//    	TaskStatus status = new TaskStatus();
+//		status.setTask_id(checkAppeal.getTask_id());
+//		status.setUpdate_user(new Long(u.getId()));
+//		status.setUpdate_username(u.getTruename());
+//		status.setCheck_status(checkAppeal.getCheck_status());
+//		String name = (CacheUtil.codeMap.get("task_status_"+status.getCheck_status())).getCode_name();
+//		status.setCheck_status_name(name);
+//
+//    	taskService.insertStatus(status);
+    	return super.returnSuccessResult("添加成功");
+    }
+    
+    /**
+     * 修改考核项
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    @RequestMapping(value = "/update")
+    public String update(@Valid @RequestBody CheckApply checkAppeal){
+    	checkApplyService.update(checkAppeal);
+    	return super.returnSuccessResult("修改成功");
+    }
+    
+    /**
+     * 修改考核项
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    @RequestMapping(value = "/agree")
+    public String agree(HttpServletRequest request,@Valid @RequestBody CheckApply checkAppeal){
+    	if(checkAppeal.getId()==null) {
+    		throw new BusinessException(20001); 
+    	}
+    	User user = getCurrentUser(request);
+    	checkAppeal.setVerify_person(new Long(user.getId()));
+    	int check_status = Constants.STATUS_APPEAL_SUCCEED;
+    	checkAppeal.setCheck_status(check_status);
+    	checkApplyService.update(checkAppeal);
+    	Task task = new Task();
+    	task.setId(checkAppeal.getTask_id());
+    	task.setCheck_status(check_status);
+    	taskService.update(task);
+    	return super.returnSuccessResult("同意成功");
+    }
+    
+    /**
+     * 修改考核项
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    @RequestMapping(value = "/refuse")
+    public String refuse(HttpServletRequest request,@Valid @RequestBody CheckApply checkAppeal){
+    	if(checkAppeal.getId()==null) {
+    		throw new BusinessException(20001); 
+    	}
+    	User user = getCurrentUser(request);
+    	checkAppeal.setVerify_person(new Long(user.getId()));
+    	int check_status = Constants.STATUS_APPEAL_FAILED;
+    	checkAppeal.setCheck_status(check_status);
+    	checkApplyService.update(checkAppeal);
+    	Task task = new Task();
+    	task.setId(checkAppeal.getTask_id());
+    	task.setCheck_status(check_status);
+    	taskService.update(task);
+    	return super.returnSuccessResult("拒绝成功");
+    }
+    
+    /**
+     * 删除考核项
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    @RequestMapping(value = "/delete")
+    public String delete(@RequestBody CheckApply checkAppeal){
+    	checkApplyService.delete(checkAppeal.getId());
+    	return super.returnSuccessResult("删除成功");
+    }
+    
+    /**
+     * 根据id获取考核项数据
+     * @param checkItem
+     * @return
+     */
+    @RequestMapping(value = "/getById")
+    public String getById(@RequestBody CheckApply checkAppeal){
+    	if(checkAppeal.getId()==null){
+    		throw new BusinessException(20001);
+    	}
+    	CheckApply checkItemOne =  checkApplyService.getById(checkAppeal.getId()) ;
+    	return super.returnSuccessResult(checkItemOne);
+    }
+    
+    /**
+     * 根据任务id获取无效任务申请数据
+     * @param checkItem
+     * @return
+     */
+    @RequestMapping(value = "/getByTaskId")
+    public String getByTaskId(@RequestBody CheckApply checkAppeal){
+    	if(checkAppeal.getId()==null){
+    		throw new BusinessException(20101);
+    	}
+    	CheckApply checkItemOne =  checkApplyService.getByTaskId(checkAppeal.getId()) ;
+    	return super.returnSuccessResult(checkItemOne);
+    }
+    
+    @RequestMapping(value = "/getList/{page}/{size}")
+    public String getList(@RequestBody CheckApply param ,@PathVariable Integer page,@PathVariable Integer size){
+    	PageHelper.startPage(page, size);
+    	List<CheckApply> checkAppeal =  checkApplyService.getList(param) ;
+    	return super.returnSuccessResult(new PageInfo(checkAppeal));
+    }
+    
+    
+}

+ 101 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/TaskController.java

@@ -1,7 +1,10 @@
 package com.xintong.visualinspection.controller;
 
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -12,11 +15,14 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.mysql.jdbc.StringUtils;
 import com.xintong.system.err.BusinessException;
 import com.xintong.visualinspection.bean.Constant;
 import com.xintong.visualinspection.bean.Task;
+import com.xintong.visualinspection.bean.TaskStatus;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.service.TaskService;
+import com.xintong.visualinspection.util.CacheUtil;
+import com.xintong.visualinspection.util.Constants;
 
 /**
  * 文件名:TestController
@@ -59,6 +65,30 @@ public class TaskController extends BaseController {
     	return super.returnSuccessResult("修改成功");
     }
     
+    @RequestMapping(value = "/taskEnd")
+    public String taskEnd(@Valid @RequestBody Task task){
+    	if(task.getId()==null){
+    		throw new BusinessException(20002);
+    	}
+    	if(task.getCheck_status()==null || "".equals(task.getCheck_status())){
+    		task.setCheck_status(Constants.STATUS_CHECK_END);
+    	}
+    	taskService.update(task);
+    	return super.returnSuccessResult("修改成功");
+    }
+    
+    @RequestMapping(value = "/taskStart")
+    public String taskStart(@Valid @RequestBody Task task){
+    	if(task.getId()==null){
+    		throw new BusinessException(20002);
+    	}
+    	if(task.getCheck_status()==null || "".equals(task.getCheck_status())){
+    		task.setCheck_status(Constants.STATUS_CHECK_START);
+    	}
+    	taskService.update(task);
+    	return super.returnSuccessResult("修改成功");
+    }
+    
     /**
      * 删除考核任务
      * @return
@@ -75,6 +105,60 @@ public class TaskController extends BaseController {
     	return super.returnSuccessResult("删除成功");
     }
     
+    @RequestMapping(value = "/dispatch")
+    public String dispatch(HttpServletRequest request, @RequestBody Task task){
+    	if(task.getCheck_status()==null || "".equals(task.getCheck_status())){
+    		task.setCheck_status(Constants.STATUS_CHECK_END);
+    	}
+    	
+    	if(task.getUpdate_check_status()==null || "".equals(task.getUpdate_check_status())){
+    		task.setUpdate_check_status(Constants.STATUS_CHECK_DISPATCH);
+    	}
+    	List<Task> taskList = taskService.getTaskList(task);
+    	List<TaskStatus> taskStatusList = new ArrayList<TaskStatus>();
+    	User u = getCurrentUser(request);
+    	for(Task t:taskList) {
+    		//插入状态到表
+    		TaskStatus status = new TaskStatus();
+    		status.setTask_id(t.getId());
+    		status.setUpdate_time(new Date());
+    		status.setUpdate_user(new Long(u.getId()));
+    		status.setUpdate_username(u.getTruename());
+    		status.setCheck_status(task.getUpdate_check_status());
+    		String name = (CacheUtil.codeMap.get("task_status_"+task.getUpdate_check_status())).getCode_name();
+    		status.setCheck_status_name(name);
+    		taskStatusList.add(status);
+    	}
+    	taskService.dispatch(task);
+    	taskService.insertStatusBatch(taskStatusList);
+    	return super.returnSuccessResult("下发成功");
+    }
+    
+    @RequestMapping(value = "/dispatchById")
+    public String dispatchById(HttpServletRequest request, @RequestBody Task task){
+    	if(task.getId()==null){
+    		throw new BusinessException(20002);
+    	}
+    	if(task.getCheck_status()==null || "".equals(task.getCheck_status())){
+    		task.setCheck_status(Constants.STATUS_CHECK_DISPATCH);
+    	}
+    	taskService.dispatchById(task);
+    	
+		//插入状态到表
+		TaskStatus status = new TaskStatus();
+		User u = getCurrentUser(request);
+		status.setTask_id(task.getId());
+		status.setUpdate_time(new Date());
+		status.setUpdate_user(new Long(u.getId()));
+		status.setUpdate_username(u.getTruename());
+		status.setCheck_status(task.getCheck_status());
+		String name = (CacheUtil.codeMap.get("task_status_"+task.getCheck_status())).getCode_name();
+		status.setCheck_status_name(name);
+    	taskService.insertStatus(status);
+    	
+    	return super.returnSuccessResult("下发成功");
+    }
+    
     /**
      * 通过id获取考核任务
      * @return
@@ -104,4 +188,20 @@ public class TaskController extends BaseController {
     	List<Task> taskList = taskService.getTaskList(task);
     	return super.returnSuccessResult(new PageInfo(taskList));
     }
+    
+    /**
+     * 通过id获取状态
+     * @return
+     * String
+     * @exception
+     * @since  1.0.0
+     */
+    @RequestMapping(value = "/getStatusById")
+    public String getStatusById(@RequestBody Task task){
+    	if(task.getId()==null){
+    		throw new BusinessException(20002);
+    	}
+    	List<TaskStatus> tList = taskService.getTaskStatusList(task.getId());
+    	return super.returnSuccessResult(tList);
+    }
 }

+ 21 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/CheckApplyDao.java

@@ -0,0 +1,21 @@
+package com.xintong.visualinspection.dao.master;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.xintong.visualinspection.bean.CheckApply;
+
+/**
+ * 文件名:UserInfoDao
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Mapper
+public interface CheckApplyDao  {
+    public List<CheckApply> getList(CheckApply param);
+    public CheckApply getOne(Long id);
+    public CheckApply getOneByTaskId(Long id);
+    public void insert(CheckApply checkApply);
+    public void update(CheckApply checkApply);
+    public void delete(Long id);
+}

+ 4 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/TaskDao.java

@@ -20,4 +20,8 @@ public interface TaskDao  {
     public void insertStatus(TaskStatus taskStatus);
     public void update(Task task);
     public void delete(Long id);
+    public List<TaskStatus> getTaskStatusList(Long id);
+    public void dispatch(Task task);
+    public void dispatchById(Task task);
+    public void insertStatusBatch(List<TaskStatus> taskStatusList);
 }

+ 73 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/CheckApplylMapper.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xintong.visualinspection.dao.master.CheckApplyDao" >
+    <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.CheckApply" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="apply_reason" property="apply_reason" jdbcType="VARCHAR" />
+        <result column="check_status" property="check_status" jdbcType="INTEGER" />
+        <result column="apply_time" property="apply_time" jdbcType="DATE" />
+        <result column="update_time" property="update_time" jdbcType="DATE" />
+        <result column="apply_man" property="apply_man" jdbcType="INTEGER" />
+        <result column="verify_person" property="verify_person" jdbcType="INTEGER" />
+        <result column="apply_dept" property="apply_dept" jdbcType="INTEGER" />
+        <result column="task_id" property="task_id" jdbcType="INTEGER" />
+        <result column="remark" property="remark" jdbcType="VARCHAR" />
+        
+        
+        <result column="name" property="name" jdbcType="VARCHAR" />
+        <result column="start_time" property="start_time" jdbcType="DATE" />
+        <result column="end_time" property="end_time" jdbcType="DATE" />
+        
+        <result column="code_name" property="code_name" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <select id="getList" resultMap="BaseResultMap" parameterType="com.xintong.visualinspection.bean.CheckAppeal" >
+        SELECT ca.*,ct.name,ct.start_time,ct.end_time,sc.code_name FROM check_appeal ca LEFT JOIN check_task ct ON ca.task_id=ct.id 
+        LEFT JOIN sys_code sc ON ca.check_status=sc.code_value
+        WHERE 1=1 
+        <if test="start_time != null">AND ct.start_time >= #{start_time}</if>
+        <if test="end_time != null">
+        	<![CDATA[ AND ct.end_time < #{end_time}]]>
+        </if>
+        <if test="appeal_dept != null">AND ca.appeal_dept = #{appeal_dept}</if>
+        ORDER BY ca.appeal_time DESC
+    </select>
+
+    <select id="getOne" parameterType="java.lang.Long" resultMap="BaseResultMap" >
+        SELECT *
+        FROM check_apply
+        WHERE id = #{id}
+    </select>
+    
+    <select id="getOneByTaskId" parameterType="java.lang.Long" resultMap="BaseResultMap" >
+        SELECT *
+        FROM check_apply
+        WHERE task_id = #{id}
+    </select>
+    
+    <insert id="insert" parameterType="com.xintong.visualinspection.bean.CheckAppeal" >
+        INSERT INTO
+        check_apply
+        (apply_reason,check_status,apply_time,update_time,apply_man,verify_person,apply_dept,task_id,remark)
+        VALUES
+        (#{apply_reason}, #{check_status},now(),now(),#{apply_man},#{verify_person},#{apply_dept},#{task_id},#{remark})
+    </insert>
+
+    <update id="update" parameterType="com.xintong.visualinspection.bean.CheckAppeal" >
+        UPDATE
+        	check_apply
+        SET
+	        <if test="check_status != null">check_status = #{check_status},</if>
+	        <if test="verify_person != null">verify_person = #{verify_person},</if>
+	        update_time = now()
+        WHERE
+        id = #{id}
+    </update>
+
+    <delete id="delete" parameterType="java.lang.Long" >
+        DELETE FROM
+        check_apply
+        WHERE
+        id =#{id}
+    </delete>
+</mapper>

+ 45 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/TaskMapper.xml

@@ -40,6 +40,13 @@
         WHERE id = #{id}
     </select>
     
+    <select id="getTaskStatusList" parameterType="java.lang.Long" resultMap="taskStatusMap" >
+        SELECT *
+        FROM check_task_status
+        WHERE task_id = #{id}
+        order by update_time 
+    </select>
+    
     <select id="getList" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
         SELECT *,
               (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=check_status) as check_status_name
@@ -72,10 +79,22 @@
         	check_status_name
         )
         VALUES
-        (#{task_id}, #{update_time},#{update_user},#{update_username},#{check_status},
+        (#{task_id}, now(),#{update_user},#{update_username},#{check_status},
         	#{check_status_name}
         )
     </insert>
+    <insert id="insertStatusBatch" parameterType="java.util.List" >
+        INSERT INTO check_task_status
+        (task_id,update_time,update_user,update_username,check_status,
+        	check_status_name
+        )
+        VALUES
+        <foreach collection="list" item="item" index="index" separator="," >  
+	        (#{item.task_id}, #{item.update_time},#{item.update_user},#{item.update_username},#{item.check_status},
+	        	#{item.check_status_name}
+	        ) 
+	    </foreach>  
+    </insert>
 
     <update id="update" parameterType="com.xintong.visualinspection.bean.Task" >
         UPDATE
@@ -97,7 +116,31 @@
         WHERE
         id = #{id}
     </update>
-
+	
+	<update id="dispatch" parameterType="com.xintong.visualinspection.bean.Task" >
+        UPDATE
+        	check_task
+        SET
+	        <if test="update_check_status != null">check_status = #{update_check_status},</if>
+	        update_time = now()
+        WHERE 1=1
+        	<if test="check_status != null">AND check_status = #{check_status}</if>
+        	<if test="start_time != null">AND create_time &gt;= #{start_time}</if>
+        	<if test="end_time != null">AND create_time &lt;= #{end_time}</if>
+        	<if test="checked_dept != null">AND checked_dept = #{checked_dept}</if>
+        	<if test="checkman != null">AND checkman = #{checkman}</if>
+        	<if test="checked_person != null">AND checked_person = #{checked_person}</if>
+    </update>
+    
+    <update id="dispatchById" parameterType="com.xintong.visualinspection.bean.Task" >
+        UPDATE
+        	check_task
+        SET
+	        <if test="check_status != null">check_status = #{check_status},</if>
+	        update_time = now()
+        WHERE id=#{id}
+    </update>
+    
     <delete id="delete" parameterType="java.lang.Long" >
         DELETE FROM
         check_task

+ 26 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/CheckApplyService.java

@@ -0,0 +1,26 @@
+package com.xintong.visualinspection.service;
+
+import java.util.List;
+
+import com.xintong.visualinspection.bean.CheckApply;
+
+/**
+ * 
+ *
+ * ConstantService
+ * 
+ * tiger
+ * tiger
+ * 2017年5月4日 上午10:41:40
+ * 
+ * @version 1.0.0
+ *
+ */
+public interface CheckApplyService {
+    public List<CheckApply> getList(CheckApply param);
+    public CheckApply getById(Long id);
+    public CheckApply getByTaskId(Long id);
+    public void insert(CheckApply checkApply);
+    public void update(CheckApply checkApply);
+    public void delete(Long id);
+}

+ 6 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/TaskService.java

@@ -2,8 +2,8 @@ package com.xintong.visualinspection.service;
 
 import java.util.List;
 
-import com.xintong.visualinspection.bean.Constant;
 import com.xintong.visualinspection.bean.Task;
+import com.xintong.visualinspection.bean.TaskStatus;
 
 /**
  * 
@@ -24,4 +24,9 @@ public interface TaskService {
     public void insert(Task task);
     public void update(Task task);
     public void delete(Long id);
+    public List<TaskStatus> getTaskStatusList(Long id);
+    public void dispatch(Task task);
+    public void dispatchById(Task task);
+    public void insertStatus(TaskStatus taskStatus);
+    public void insertStatusBatch(List<TaskStatus> taskStatusList);
 }

+ 58 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/CheckApplyServiceImpl.java

@@ -0,0 +1,58 @@
+package com.xintong.visualinspection.service.impl;
+
+import java.util.List;
+
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.xintong.system.err.BusinessException;
+import com.xintong.visualinspection.bean.CheckApply;
+import com.xintong.visualinspection.dao.master.CheckApplyDao;
+import com.xintong.visualinspection.service.BaseService;
+import com.xintong.visualinspection.service.CheckApplyService;
+
+/**
+ * 文件名:UserServiceImpl
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Service
+public class CheckApplyServiceImpl extends BaseService implements CheckApplyService {
+
+    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CheckApplyServiceImpl.class);
+
+
+    @Autowired
+    private CheckApplyDao checkApplyDao;
+
+	@Override
+	public List<CheckApply> getList(CheckApply param) {
+		// TODO Auto-generated method stub
+		return checkApplyDao.getList(param);
+	}
+	@Override
+	public CheckApply getById(Long id) {
+		// TODO Auto-generated method stub
+		return checkApplyDao.getOne(id);
+	}
+	@Override
+	public void insert(CheckApply checkApply) {
+		// TODO Auto-generated method stub
+		checkApplyDao.insert(checkApply);
+	}
+	@Override
+	public void update(CheckApply checkApply) {
+		// TODO Auto-generated method stub
+		checkApplyDao.update(checkApply);
+	}
+	@Override
+	public void delete(Long id) {
+		// TODO Auto-generated method stub
+		checkApplyDao.delete(id);
+	}
+	@Override
+	public CheckApply getByTaskId(Long id) {
+		// TODO Auto-generated method stub
+		return checkApplyDao.getOneByTaskId(id);
+	}
+}

+ 57 - 11
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/TaskServiceImpl.java

@@ -8,11 +8,14 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.xintong.visualinspection.bean.Constant;
+import com.xintong.visualinspection.bean.Organ;
 import com.xintong.visualinspection.bean.Task;
 import com.xintong.visualinspection.bean.TaskStatus;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.dao.master.TaskDao;
 import com.xintong.visualinspection.service.BaseService;
 import com.xintong.visualinspection.service.TaskService;
+import com.xintong.visualinspection.util.CacheUtil;
 
 /**
  * 文件名:UserServiceImpl
@@ -31,7 +34,6 @@ public class TaskServiceImpl extends BaseService implements TaskService {
 		return taskDao.getAll();
 	}
 
-
 	@Override
 	public Task getById(Long id) {
 		// TODO Auto-generated method stub
@@ -42,7 +44,13 @@ public class TaskServiceImpl extends BaseService implements TaskService {
 	@Override
 	public List<Task> getTaskList(Task task) {
 		// TODO Auto-generated method stub
-		return taskDao.getList(task);
+		List<Task> taskList = taskDao.getList(task);
+		for(Task t : taskList) {
+			t.setCheckman_name(((User)CacheUtil.userMap.get(t.getCheckman())).getTruename());
+			t.setChecked_person_name(((User)CacheUtil.userMap.get(t.getChecked_person())).getTruename());
+			t.setChecked_dept_name(((Organ)CacheUtil.deptMap.get(t.getChecked_dept())).getOrganname());
+		}
+		return taskList;
 	}
 
 
@@ -65,16 +73,22 @@ public class TaskServiceImpl extends BaseService implements TaskService {
 	@Override
 	public void update(Task task) {
 		// TODO Auto-generated method stub
+		Task oldTask = taskDao.getOne(task.getId());
 		taskDao.update(task);
-		TaskStatus status = new TaskStatus();
-		status.setTask_id(task.getId());
-		status.setUpdate_time(new Date());
-		status.setUpdate_user(task.getCheckman());
-		status.setUpdate_username("");
-		status.setCheck_status(task.getCheck_status());
-		String name = (constantDao.getByFlagAndValue(new Constant("task_status",task.getCheck_status()))).getCode_name();
-		status.setCheck_status_name(name);
-		taskDao.insertStatus(status);
+		
+		//状态不一致才保存
+		if(!oldTask.getCheck_status().equals(task.getCheck_status())){
+			TaskStatus status = new TaskStatus();
+			status.setTask_id(task.getId());
+			status.setUpdate_time(new Date());
+			status.setUpdate_user(task.getCheckman());
+			status.setUpdate_username("");
+			status.setCheck_status(task.getCheck_status());
+			String name = (constantDao.getByFlagAndValue(new Constant("task_status",task.getCheck_status()))).getCode_name();
+			status.setCheck_status_name(name);
+			taskDao.insertStatus(status);
+		}
+		
 	}
 
 
@@ -84,4 +98,36 @@ public class TaskServiceImpl extends BaseService implements TaskService {
 		taskDao.delete(id);
 	}
 
+
+	@Override
+	public List<TaskStatus> getTaskStatusList(Long id) {
+		// TODO Auto-generated method stub
+		return taskDao.getTaskStatusList(id);
+	}
+
+
+	@Override
+	public void dispatch(Task task) {
+		// TODO Auto-generated method stub
+		taskDao.dispatch(task);
+	}
+
+	@Override
+	public void dispatchById(Task task) {
+		// TODO Auto-generated method stub
+		taskDao.dispatchById(task);
+	}
+
+
+	@Override
+	public void insertStatus(TaskStatus taskStatus) {
+		// TODO Auto-generated method stub
+		taskDao.insertStatus(taskStatus);
+	}
+
+	@Override
+	public void insertStatusBatch(List<TaskStatus> taskStatusList) {
+		// TODO Auto-generated method stub
+		taskDao.insertStatusBatch(taskStatusList);
+	}
 }

+ 5 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/util/CacheUtil.java

@@ -3,12 +3,15 @@ package com.xintong.visualinspection.util;
 import java.util.HashMap;
 import java.util.Map;
 
+import com.xintong.visualinspection.bean.Constant;
 import com.xintong.visualinspection.bean.Organ;
 import com.xintong.visualinspection.bean.User;
 
 public class CacheUtil {
 	
-	public static Map<Integer,User> userMap = new HashMap<Integer,User>();
+	public static Map<Long,User> userMap = new HashMap<Long,User>();
 	
-	public static Map<Integer,Organ> deptMap = new HashMap<Integer,Organ>();
+	public static Map<Long,Organ> deptMap = new HashMap<Long,Organ>();
+	
+	public static Map<String,Constant> codeMap = new HashMap<String,Constant>();
 }

+ 16 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/util/Constants.java

@@ -0,0 +1,16 @@
+package com.xintong.visualinspection.util;
+
+public class Constants {
+	
+	public static int STATUS_CREATE = 1;
+	public static int STATUS_ASSIGN = 2;
+	public static int STATUS_CHECK_START = 3;
+	public static int STATUS_CHECK_END = 4;
+	public static int STATUS_CHECK_DISPATCH = 5;
+	public static int STATUS_APPEALING = 11;
+	public static int STATUS_APPEAL_SUCCEED = 12;
+	public static int STATUS_APPEAL_FAILED = 13;
+	public static int STATUS_APPLYING = 21;
+	public static int STATUS_APPLY_SUCCEED = 22;
+	public static int STATUS_APPLY_FAILED = 23;
+}

+ 1 - 1
VisualInspection_server/src/main/resources/errcode.properties

@@ -39,7 +39,7 @@
 #\u8003\u6838\u529e\u6cd5\u7ba1\u7406\u9519\u8bef
 21101=\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a
 #\u4efb\u52a1\u7ba1\u7406\u9519\u8bef
-21201=
+21201=\u5df2\u63d0\u4ea4\u65e0\u6548\u7533\u8bf7\uff0c\u4e0d\u80fd\u91cd\u590d\u63d0\u4ea4
 #\u6263\u5206\u7ba1\u7406\u9519\u8bef
 21301=