机具库存收藏修改

This commit is contained in:
jiang 2025-07-16 14:31:33 +08:00
parent 418a217700
commit c9f34ad08f
13 changed files with 1677 additions and 358 deletions

View File

@ -6,8 +6,8 @@
<c:choose> <c:choose>
<c:when test="${page.totalRecord > 0}"> <c:when test="${page.totalRecord > 0}">
<c:forEach items="${page.results}" var="ma" varStatus="index"> <c:forEach items="${page.results}" var="ma" varStatus="index">
<tr ondblclick="setChecked(${ma.id})" onclick="topage(${ma.id} , '${ma.processName}')"> <tr ondblclick="setChecked(${ma.id})" onclick="topage(${ma.id} , '${ma.processName}')">
<th style="vertical-align:middle;" class="center"><label> <input type='checkbox' value='${ma.checkerId}_${ma.processName}' class="ace rowCheck" name="rowCheck" /> <span class='lbl'></span></label></th>
<th style="vertical-align:middle;" class="center">${(page.pageNum-1)*page.pageSize+index.index+1}</th> <th style="vertical-align:middle;" class="center">${(page.pageNum-1)*page.pageSize+index.index+1}</th>
<%-- <th style="vertical-align:middle;" class="center"> <%-- <th style="vertical-align:middle;" class="center">
${ma.unitName} ${ma.unitName}
@ -193,18 +193,9 @@
</th> --%> </th> --%>
<th style="vertical-align:middle;" class="center">${ma.number}</th> <th style="vertical-align:middle;" class="center">${ma.number}</th>
<th style="vertical-align:middle;" class="center">${ma.creatorName}</th> <th style="vertical-align:middle;" class="center">${ma.creatorName}</th>
<th style="vertical-align:middle;color:red" class="center">
<c:choose>
<c:when test="${page.isFinish == 0}">
任务未完成
</c:when>
<%-- <c:otherwise>
任务已完成
</c:otherwise> --%>
</c:choose>
</th>
<%-- <th style="vertical-align:middle;" class="center"><a href='#' title='查看' onclick="edit(${ma.id} ,${ma.definitionId})" class='aBtnNoTD' ><i class='icon-zoom-in color-p bigger-140'></i></a></th> <%-- <th style="vertical-align:middle;" class="center"><a href='#' title='查看' onclick="edit(${ma.id} ,${ma.definitionId})" class='aBtnNoTD' ><i class='icon-zoom-in color-p bigger-140'></i></a></th>
--%> </tr> --%> </tr>
</c:forEach> </c:forEach>
@ -221,7 +212,7 @@
function topage(id,processName) { function topage(id,processName) {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "http://10.1.0.142:1999/gz_car/login/userLogin", url: "http://127.0.0.1:21522/gz-car/login/userLogin",
data: { data: {
username: uname, username: uname,
password: pwd password: pwd
@ -233,10 +224,10 @@
localStorage.setItem("name", name); localStorage.setItem("name", name);
//window.open("http://192.168.0.14:21625/gz-gqj/index.html") //window.open("http://192.168.0.14:21625/gz-gqj/index.html")
if(processName === '派车计划'){ if(processName === '派车计划'){
window.open("http://10.1.0.142:1999/gz-car/page/car_demand_plan/child/dispatch_car_detail.html?id="+id +"&token="+data.token) window.open("http://localhost:63343/gz_car_ui/page/car_demand_plan/child/dispatch_car_detail.html?id="+id +"&token="+data.token)
}else if(processName === '用车计划'){ }else if(processName === '用车计划'){
window.open("http://10.1.0.142:1999/gz-car/page/car_demand_plan/child/apply_plan_detail.html?id="+id +"&token="+data.token) window.open("http://localhost:63343/gz_car_ui/page/car_demand_plan/child/apply_plan_detail.html?id="+id +"&token="+data.token)
} }
} else { } else {

View File

@ -30,6 +30,7 @@
</select> </select>
<input type="text" id="keyWord" name="keyWord" placeholder="这里输入关键词" class="input-large"> <input type="text" id="keyWord" name="keyWord" placeholder="这里输入关键词" class="input-large">
<button id='searchBtn' class="btn btn-warning btn-sm" title="过滤" type="button" onclick="getbaseList(1)"><i class="icon-search bigger-110 icon-only"></i></button> <button id='searchBtn' class="btn btn-warning btn-sm" title="过滤" type="button" onclick="getbaseList(1)"><i class="icon-search bigger-110 icon-only"></i></button>
<button id='getSelectedBtn' class="btn btn-success btn-sm" title="过滤" type="button">批量审批</i></button>
</div> </div>
</div> </div>
<input type='hidden' class='pageNum' name='pageNum' value='1'/> <input type='hidden' class='pageNum' name='pageNum' value='1'/>
@ -38,15 +39,17 @@
<table id="baseTable" class="table table-striped table-bordered table-hover" > <table id="baseTable" class="table table-striped table-bordered table-hover" >
<thead> <thead>
<tr> <tr>
<th style="width:3%" class="center">
<label><input type="checkbox" class="ace" id="checkAll" ><span class="lbl"></span></label>
</th>
<th style="width:5%" class="center hidden-480">序号</th> <th style="width:5%" class="center hidden-480">序号</th>
<!-- <th style="width:10%" class="center">单位名称</th> <!-- <th style="width:10%" class="center">单位名称</th>
<th style="width:15%" class="center">工程名称</th> <th style="width:15%" class="center">工程名称</th>
<th style="width:10%" class="center">任务单号</th> --> <th style="width:10%" class="center">任务单号</th> -->
<th style="width:15%" class="center">任务名称</th> <th style="width:25%" class="center">任务名称</th>
<th style="width:10%" class="center">创建时间</th> <th style="width:25%" class="center">创建时间</th>
<th style="width:10%" class="center">任务单号</th> <th style="width:25%" class="center">任务单号</th>
<th style="width:10%" class="center">创建人</th> <th style="width:25%" class="center">创建人</th>
<th style="width:10%" class="center">任务情况</th>
<!-- <th style="width:10%" class="center">操作</th> --> <!-- <th style="width:10%" class="center">操作</th> -->
</tr> </tr>
</thead> </thead>
@ -104,8 +107,70 @@
getbaseList(1); // 重新请求表格数据 getbaseList(1); // 重新请求表格数据
} }
$(function() { $(function() {
// 获取所有选中的 value你可以绑定按钮触发
$('#getSelectedBtn').on('click', function () {
let selectedValues = $('.rowCheck:checked')
.map(function () {
return $(this).val();
}).get(); // 转为数组
if(selectedValues.length == 0){
JY.Model.info("您没有选择任何内容!");
return;
}
console.log("selectedValues:", selectedValues);
$.ajax({
type: 'POST',
url: bonuspath + '/backstage/rm/taskRecord/batchApproval',
traditional: true,
data: { ids: selectedValues },
success: function(data) {
JY.Model.info("操作成功",function () {
getbaseList(1);
});
},
error: function(xhr) {
console.error("请求失败,状态码:", xhr.status);
console.error("响应内容:", xhr.responseText);
}
});
});
getbaseList(1); getbaseList(1);
$(document).ready(function () {
// 下拉框改变时监听
$('#isFinish').change(function () {
toggleButton();
});
$('.rowCheck').prop('checked', false); // 取消所有 rowCheck 的选中状态
$('#checkAll').prop('checked', false); // 如果你还有全选框,也一并清除
});
// 全选逻辑
$('#checkAll').on('click', function (e) {
e.stopPropagation(); // ✅ 阻止冒泡
}).on('change', function () {
let checked = $(this).is(':checked');
$('.rowCheck').prop('checked', checked);
});
// 行内 checkbox阻止冒泡 + 同步全选框
$(document).on('click', '.rowCheck', function (e) {
e.stopPropagation(); // ✅ 阻止冒泡
});
// 如果所有行都被勾选了,全选框也自动勾选;否则取消
$(document).on('change', '.rowCheck', function () {
let all = $('.rowCheck').length;
let checked = $('.rowCheck:checked').length;
$('#checkAll').prop('checked', all === checked);
});
$("#keyWord").keydown(function(e) { $("#keyWord").keydown(function(e) {
keycode = e.which || e.keyCode; keycode = e.which || e.keyCode;
if (keycode == 13) { if (keycode == 13) {
@ -114,6 +179,16 @@
}); });
}); });
function toggleButton() {
var value = $('#isFinish').val();
if (value === '1') {
$('#getSelectedBtn').prop('disabled', true); // 禁用按钮
} else {
$('#getSelectedBtn').prop('disabled', false); // 启用按钮
}
}
function search(){ function search(){
$("#search").trigger("click"); $("#search").trigger("click");
} }
@ -136,6 +211,7 @@
dataType:"html", dataType:"html",
contentType:"application/json", contentType:"application/json",
success:function(data){ success:function(data){
$('#checkAll').prop('checked', false); // 如果你还有全选框,也一并清除
$("#baseTable tbody").html(data); $("#baseTable tbody").html(data);
JY.Model.loadingClose(); JY.Model.loadingClose();
}, },

View File

@ -25,8 +25,8 @@
<input type="text" id="taskName" name="taskName" class="FormElement ui-widget-content ui-corner-all"> <input type="text" id="taskName" name="taskName" class="FormElement ui-widget-content ui-corner-all">
</td> </td>
<td class="CaptionTD">协议号:</td> <td class="CaptionTD">协议号:</td>
<td class="DataTD">&nbsp; <td class="DataTD" onclick="topage()">&nbsp;
<input type="text" id="agreementCode" name="agreementCode" class="FormElement ui-widget-content ui-corner-all"> <input type="text" id="agreementCode" onclick="topage()" name="agreementCode" class="FormElement ui-widget-content ui-corner-all">
</td> </td>
</tr> </tr>
<tr class="FormData"> <tr class="FormData">
@ -50,3 +50,9 @@
</table> </table>
</form> </form>
</div> </div>
<script type="text/javascript">
function topage() {
alert('1');
window.open("http://10.1.0.142:1999/gz-car/index.html")
}
</script>

View File

@ -710,4 +710,79 @@
wtr.DEFINITION_ID = 21 AND wtr.ID = #{id} wtr.DEFINITION_ID = 21 AND wtr.ID = #{id}
</if> </if>
</select> </select>
<update id="batchApproval" parameterType="java.util.Map">
<foreach collection="list" item="item" separator=";">
<choose>
<!-- 派车计划 -->
<when test="item.leaseName == '派车计划'">
UPDATE car_plan_out
SET
<choose>
<when test="item.operator == '57' or item.operator == '29' or item.operator == '55' or item.operator == '56' or item.operator == '67'">
status = 1
</when>
<when test="item.operator == '49' or item.operator == '50'">
status = 2
</when>
</choose>
WHERE id = #{item.id}
</when>
<!-- 用车计划 -->
<when test="item.leaseName == '用车计划'">
UPDATE car_plan_apply
SET
<choose>
<when test="item.operator == '14'">
status_type = '1'
</when>
<when test="item.operator == '74' or item.operator == '75'">
status_type = '4'
</when>
</choose>
WHERE id = #{item.id}
</when>
</choose>
</foreach>
</update>
<select id="getUpTimes" resultType="java.lang.String">
select audit_time
from car_plan_audit_record
where apply_id=#{id} and audit_type=#{auditType}
ORDER BY audit_time desc
limit 1
</select>
<insert id="addRecord">
insert into car_plan_audit_record(
apply_id, auditor,audit_time, audit_status, audit_remark,
creator,create_time,audit_type, type, user_name,times
)values (#{applyId},#{auditor},#{auditTime},#{auditStatus},#{auditRemark},
#{creator},now(),#{auditType},#{type},#{userName},#{times})
</insert>
<select id="getPlanInfo" resultType="com.bonus.rm.beans.CarNeedPlanVo">
select dispatch_num dispatchNum,id,need_num needNum
FROM car_plan_apply
where id= #{pureId}
</select>
<select id="getCarPlanOut" resultType="com.bonus.rm.beans.CarPlanOutVo">
select apply_id planId, dispatch_num dispatchNum,out_time outDay,status
from car_plan_out
where id=#{pureId}
</select>
<update id="updateCarPlanInfo">
update car_plan_apply set dispatch_num=#{dispatchNum},dispatch_day=#{dispatchDay},dispatch_status=#{status}
where id=#{id}
</update>
</mapper> </mapper>

View File

@ -1,358 +1,412 @@
<?xml version="1.0" encoding="UTF-8"?> <?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" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bonus.wf.dao.TaskRecordDao" > <mapper namespace="com.bonus.wf.dao.TaskRecordDao">
<resultMap id="taskRecord" type="com.bonus.wf.beans.TaskRecordBean"> <resultMap id="taskRecord" type="com.bonus.wf.beans.TaskRecordBean">
<id property="id" column="id" /> <id property="id" column="id"/>
<result property="processId" column="processId"/> <result property="processId" column="processId"/>
<result property="companyId" column="companyId"/> <result property="companyId" column="companyId"/>
<result property="processName" column="processName"/> <result property="processName" column="processName"/>
<result property="definitionId" column="definitionId"/> <result property="definitionId" column="definitionId"/>
<result property="definitionName" column="definitionName"/> <result property="definitionName" column="definitionName"/>
<result property="operationTime" column="operationTime"/> <result property="operationTime" column="operationTime"/>
<result property="operationUserId" column="operationId"/> <result property="operationUserId" column="operationId"/>
<result property="operationUserName" column="operationName"/> <result property="operationUserName" column="operationName"/>
<result property="checkerId" column="checkerId"/> <result property="checkerId" column="checkerId"/>
<result property="checkerName" column="checkerName"/> <result property="checkerName" column="checkerName"/>
<result property="definitionId" column="definitionId"/> <result property="definitionId" column="definitionId"/>
<result property="creatorName" column="creatorName"/> <result property="creatorName" column="creatorName"/>
<result property="isExamine2" column="isExamine2"/> <result property="isExamine2" column="isExamine2"/>
<result property="isApproval2" column="isApproval2"/> <result property="isApproval2" column="isApproval2"/>
<result property="responer2" column="responer2"/> <result property="responer2" column="responer2"/>
<result property="responer8" column="responer8"/> <result property="responer8" column="responer8"/>
<result property="responer11" column="responer11"/> <result property="responer11" column="responer11"/>
<result property="checkStatus12" column="checkStatus12"/> <result property="checkStatus12" column="checkStatus12"/>
<result property="isExamine12" column="isExamine12"/> <result property="isExamine12" column="isExamine12"/>
<result property="isApproval12" column="isApproval12"/> <result property="isApproval12" column="isApproval12"/>
<result property="checker12" column="checker12"/> <result property="checker12" column="checker12"/>
<result property="responer12" column="responer12"/> <result property="responer12" column="responer12"/>
<result property="responer18" column="responer18"/> <result property="responer18" column="responer18"/>
<result property="responer19" column="responer19"/> <result property="responer19" column="responer19"/>
<result property="responer20" column="responer20"/> <result property="responer20" column="responer20"/>
<result property="responer21" column="responer21"/> <result property="responer21" column="responer21"/>
<result property="responer22" column="responer22"/> <result property="responer22" column="responer22"/>
<result property="responer23" column="responer23"/> <result property="responer23" column="responer23"/>
<result property="responer24" column="responer24"/> <result property="responer24" column="responer24"/>
<result property="responer25" column="responer25"/> <result property="responer25" column="responer25"/>
<result property="number" column="number"/> <result property="number" column="number"/>
<result property="unitName" column="unitName"/> <result property="unitName" column="unitName"/>
<result property="projectName" column="projectName"/> <result property="projectName" column="projectName"/>
<result property="isFinish" column="isFinish"/> <result property="isFinish" column="isFinish"/>
</resultMap> </resultMap>
<select id="findAll" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord"> <select id="findAll" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord">
SELECT wtr.ID,wtr.DEFINITION_ID as definitionId,wtd.`NAME` as definishtionName,wtr.PROCESS_ID as processId, SELECT wtr.ID,
wpd.`NAME` as processName,wtr.OPERATION_USER as operationUserId,pu.`NAME` as operationUserName, wtr.DEFINITION_ID as definitionId,
wtr.OPERATION_TIME as operationTime,wtr.IS_FINISH as isFinish,wtr.REMARK wtd.`NAME` as definishtionName,
FROM wf_task_record wtr,wf_task_definition wtd,wf_process_record wpr, wtr.PROCESS_ID as processId,
wf_process_definition wpd,pm_user pu wpd.`NAME` as processName,
WHERE wtr.DEFINITION_ID = wtd.ID AND wtr.PROCESS_ID = wpr.ID wtr.OPERATION_USER as operationUserId,
AND wpr.PROCESS_ID = wpd.ID AND wtr.OPERATION_USER = pu.ID pu.`NAME` as operationUserName,
AND wtr.IS_ACTIVE = 1 wtr.OPERATION_TIME as operationTime,
wtr.IS_FINISH as isFinish,
wtr.REMARK
FROM wf_task_record wtr,
wf_task_definition wtd,
wf_process_record wpr,
wf_process_definition wpd,
pm_user pu
WHERE wtr.DEFINITION_ID = wtd.ID
AND wtr.PROCESS_ID = wpr.ID
AND wpr.PROCESS_ID = wpd.ID
AND wtr.OPERATION_USER = pu.ID
AND wtr.IS_ACTIVE = 1
</select> </select>
<select id="findUnFinishContent" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord"> <select id="findUnFinishContent" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord">
( (
SELECT SELECT
wtr.id AS id, wtr.id AS id,
CASE wtr.id AS checkerId,
WHEN wtr.DEFINITION_ID IN (1,2,8) THEN wtr.NUMBER CASE
WHEN wtr.DEFINITION_ID IN (5,11) THEN wtr1.NUMBER WHEN wtr.DEFINITION_ID IN (1,2,8) THEN wtr.NUMBER
END AS number, WHEN wtr.DEFINITION_ID IN (5,11) THEN wtr1.NUMBER
wpd.NAME AS processName, END AS number,
wtd.NAME AS definitionName, wpd.NAME AS processName,
pu.NAME AS creatorName, wtd.NAME AS definitionName,
DATE_FORMAT(wtr.OPERATION_TIME, '%Y-%m-%d') AS operationTime, pu.NAME AS creatorName,
wtr.DEFINITION_ID AS definitionId, DATE_FORMAT(wtr.OPERATION_TIME, '%Y-%m-%d') AS operationTime,
CASE wtr.DEFINITION_ID AS definitionId,
WHEN wtr.DEFINITION_ID = 11 THEN wtr1.IS_FINISH CASE
ELSE wtr.IS_FINISH WHEN wtr.DEFINITION_ID = 11 THEN wtr1.IS_FINISH
END AS isFinish, ELSE wtr.IS_FINISH
'TASK' AS source END AS isFinish,
FROM 'TASK' AS source
wf_task_record wtr FROM
LEFT JOIN wf_task_record wtr1 ON wtr1.ID = wtr.SUP_ID wf_task_record wtr
LEFT JOIN pm_user pu ON pu.id = wtr.OPERATION_USER LEFT JOIN wf_task_record wtr1 ON wtr1.ID = wtr.SUP_ID
LEFT JOIN wf_task_definition wtd ON wtd.ID = wtr.DEFINITION_ID LEFT JOIN pm_user pu ON pu.id = wtr.OPERATION_USER
LEFT JOIN wf_process_definition wpd ON wpd.id = wtr.PROCESS_ID LEFT JOIN wf_task_definition wtd ON wtd.ID = wtr.DEFINITION_ID
WHERE LEFT JOIN wf_process_definition wpd ON wpd.id = wtr.PROCESS_ID
wtr.DEFINITION_ID IN (1, 2, 5, 8, 11) WHERE
AND ( wtr.DEFINITION_ID IN (1, 2, 5, 8, 11)
(wtr.DEFINITION_ID = 11 AND wtr1.IS_FINISH = #{param.isFinish}) AND (
OR (wtr.DEFINITION_ID != 11 AND wtr.IS_FINISH = #{param.isFinish}) (wtr.DEFINITION_ID = 11 AND wtr1.IS_FINISH = #{param.isFinish})
) OR (wtr.DEFINITION_ID != 11 AND wtr.IS_FINISH = #{param.isFinish})
AND wtr.IS_ACTIVE = 1 )
<if test="param.operationUserId != null and param.operationUserId != ''"> AND wtr.IS_ACTIVE = 1
AND wtr.OPERATION_USER = #{param.operationUserId} <if test="param.operationUserId != null and param.operationUserId != ''">
</if> AND wtr.OPERATION_USER = #{param.operationUserId}
<if test="param.keyWord != null and param.keyWord != ''"> </if>
AND ( <if test="param.keyWord != null and param.keyWord != ''">
wpd.NAME LIKE CONCAT('%', #{param.keyWord}, '%') AND (
OR wtd.NAME LIKE CONCAT('%', #{param.keyWord}, '%') wpd.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
OR pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%') OR wtd.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
) OR pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
</if> )
) </if>
)
UNION ALL UNION ALL
( (
SELECT SELECT
cpa.id AS id, cpa.id AS id,
cpa.code AS number, cpa.id AS checkerId,
'用车计划' AS processName, cpa.code AS number,
'用车申请' AS definitionName, '用车计划' AS processName,
pu.NAME AS creatorName, '用车申请' AS definitionName,
DATE_FORMAT(cpa.create_time, '%Y-%m-%d') AS operationTime, pu.NAME AS creatorName,
NULL AS definitionId, DATE_FORMAT(cpa.create_time, '%Y-%m-%d') AS operationTime,
NULL AS isFinish, NULL AS definitionId,
'PLAN' AS source NULL AS isFinish,
FROM 'PLAN' AS source
car_plan_apply cpa FROM
LEFT JOIN pm_user pu ON pu.id = cpa.creator car_plan_apply cpa
WHERE LEFT JOIN pm_user pu ON pu.id = cpa.creator
cpa.status = '1' WHERE
cpa.status = '1'
<choose>
<when test="param.operationUserId == '14'">
<if test="param.isFinish == 0">
AND cpa.status_type = '4'
</if>
<if test="param.isFinish == 1">
AND cpa.status_type = '1'
</if>
</when>
<when test="param.operationUserId == '84' or param.operationUserId == '85'">
<if test="param.isFinish == 0">
AND cpa.status_type = '3'
</if>
<if test="param.isFinish == 1">
AND cpa.status_type in ('4','1')
</if>
</when>
<otherwise>
AND 1 = 0
</otherwise>
</choose>
<if test="param.keyWord != null and param.keyWord != ''">
AND pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
</if>
)
<choose> UNION ALL
<when test="param.operationUserId == '14'">
AND cpa.status_type = '4'
</when>
<when test="param.operationUserId == '84' or param.operationUserId == '85'">
AND cpa.status_type = '3'
</when>
<otherwise>
AND 1 = 0
</otherwise>
</choose>
<if test="param.keyWord != null and param.keyWord != ''">
AND pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
</if>
)
UNION ALL (
SELECT
cpa.id AS id,
cpo.id AS checkerId,
cpa.code AS number,
'派车计划' AS processName,
CASE cpo.type
WHEN 1 THEN '车辆派车'
WHEN 2 THEN '吊车派车'
ELSE '派车'
END AS definitionName,
pu.NAME AS creatorName,
DATE_FORMAT(cpo.create_time, '%Y-%m-%d') AS operationTime,
NULL AS definitionId,
cpo.status AS isFinish,
'OUT' AS source
FROM
car_plan_out cpo
LEFT JOIN pm_user pu ON pu.id = cpo.creator
LEFT JOIN car_plan_apply cpa ON cpo.apply_id = cpa.id
<where>
<choose>
<when test="param.operationUserId == '57' or param.operationUserId == '29' or param.operationUserId == '55' or param.operationUserId == '56' or param.operationUserId == '67'">
<if test="param.isFinish == 0">
AND cpo.status = 0
</if>
<if test="param.isFinish == 1">
AND cpo.status in (1, 2)
</if>
</when>
<when test="param.operationUserId == '49' or param.operationUserId == '50'">
<if test="param.isFinish == 0">
AND cpo.status = '1'
</if>
<if test="param.isFinish == 1">
AND cpo.status = '2'
</if>
( </when>
SELECT <otherwise>
cpa.id AS id, AND 1 = 0
cpa.code AS number, </otherwise>
'派车计划' AS processName, </choose>
CASE cpo.type <if test="param.keyWord != null and param.keyWord != ''">
WHEN 1 THEN '车辆派车' AND pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
WHEN 2 THEN '吊车派车' </if>
ELSE '派车' </where>
END AS definitionName, )
pu.NAME AS creatorName,
DATE_FORMAT(cpo.create_time, '%Y-%m-%d') AS operationTime,
NULL AS definitionId,
cpo.status AS isFinish,
'OUT' AS source
FROM
car_plan_out cpo
LEFT JOIN pm_user pu ON pu.id = cpo.creator
LEFT JOIN car_plan_apply cpa ON cpo.apply_id = cpa.id
<where>
<choose>
<when test="param.operationUserId == '57' or param.operationUserId == '29' or param.operationUserId == '55' or param.operationUserId == '56' or param.operationUserId == '67'">
AND cpa.status_type = '0'
</when>
<when test="param.operationUserId == '49' or param.operationUserId == '50'">
AND cpo.status = '1'
</when>
<otherwise>
AND 1 = 0
</otherwise>
</choose>
<if test="param.keyWord != null and param.keyWord != ''">
AND pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
</if>
</where>
)
ORDER BY id DESC ORDER BY id DESC
</select> </select>
<select id="find" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord"> <select id="find" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord">
SELECT wtr.ID,wtr.DEFINITION_ID as definitionId,wtd.`NAME` as definishtionName,wtr.PROCESS_ID as processId, SELECT wtr.ID,
wpd.`NAME` as processName,wtr.OPERATION_USER as operationUserId,pu.`NAME` as operationUserName, wtr.DEFINITION_ID as definitionId,
wtr.OPERATION_TIME as operationTime,wtr.IS_FINISH as isFinish,wtr.REMARK wtd.`NAME` as definishtionName,
FROM wf_task_record wtr,wf_task_definition wtd,wf_process_record wpr, wtr.PROCESS_ID as processId,
wf_process_definition wpd,pm_user pu wpd.`NAME` as processName,
WHERE wtr.DEFINITION_ID = wtd.ID AND wtr.PROCESS_ID = wpr.ID wtr.OPERATION_USER as operationUserId,
AND wpr.PROCESS_ID = wpd.ID AND wtr.OPERATION_USER = pu.ID pu.`NAME` as operationUserName,
AND wtr.IS_ACTIVE = 1 wtr.OPERATION_TIME as operationTime,
where wtr.ID = #{id} wtr.IS_FINISH as isFinish,
</select> wtr.REMARK
FROM wf_task_record wtr,
wf_task_definition wtd,
wf_process_record wpr,
wf_process_definition wpd,
pm_user pu
WHERE wtr.DEFINITION_ID = wtd.ID
AND wtr.PROCESS_ID = wpr.ID
AND wpr.PROCESS_ID = wpd.ID
AND wtr.OPERATION_USER = pu.ID
AND wtr.IS_ACTIVE = 1 where wtr.ID = #{id}
</select>
<select id="findTaskInfo" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord"> <select id="findTaskInfo" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord">
SELECT wtr.ID AS taskId SELECT wtr.ID AS taskId
FROM wf_task_record wtr FROM wf_task_record wtr
LEFT JOIN wf_task_record wtr1 ON wtr1.ID = wtr.SUP_ID LEFT JOIN wf_task_record wtr1 ON wtr1.ID = wtr.SUP_ID
LEFT JOIN wf_new_check wnc ON wnc.TASK_ID = wtr.ID LEFT JOIN wf_new_check wnc ON wnc.TASK_ID = wtr.ID
WHERE wtr.SUP_ID = #{taskId} AND wtr.DEFINITION_ID = #{definitionId} WHERE wtr.SUP_ID = #{taskId}
</select> AND wtr.DEFINITION_ID = #{definitionId}
</select>
<select id="findRepairTask" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord"> <select id="findRepairTask" parameterType="com.bonus.wf.beans.TaskRecordBean" resultMap="taskRecord">
SELECT wtr.ID as taskId SELECT wtr.ID as taskId
FROM wf_task_record wtr FROM wf_task_record wtr
WHERE wtr.SUP_ID = #{taskId} AND wtr.DEFINITION_ID = #{definitionId} and wtr.IS_FINISH = 0 WHERE wtr.SUP_ID = #{taskId}
</select> AND wtr.DEFINITION_ID = #{definitionId}
and wtr.IS_FINISH = 0
</select>
<insert id="insert" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" useGeneratedKeys="true" keyProperty="id">
insert into wf_task_record insert into wf_task_record
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="definitionId != null"> <if test="definitionId != null">
DEFINITION_ID, DEFINITION_ID,
</if> </if>
<if test="processId != null"> <if test="processId != null">
PROCESS_ID, PROCESS_ID,
</if> </if>
<if test="operationUserId != null"> <if test="operationUserId != null">
OPERATION_USER, OPERATION_USER,
</if> </if>
<if test="operationTime != null"> <if test="operationTime != null">
OPERATION_TIME, OPERATION_TIME,
</if> </if>
<if test="number != null"> <if test="number != null">
NUMBER, NUMBER,
</if> </if>
<if test="isSplit != null"> <if test="isSplit != null">
IS_SPLIT, IS_SPLIT,
</if> </if>
<if test="isFinish != null"> <if test="isFinish != null">
IS_FINISH, IS_FINISH,
</if> </if>
<if test="leasePerson != null"> <if test="leasePerson != null">
LEASE_PERSON, LEASE_PERSON,
</if> </if>
<if test="phone != null"> <if test="phone != null">
PHONE, PHONE,
</if> </if>
<if test="remark != null"> <if test="remark != null">
REMARK, REMARK,
</if> </if>
<if test="taskId != null"> <if test="taskId != null">
SUP_ID, SUP_ID,
</if> </if>
<if test="subcontractors != null"> <if test="subcontractors != null">
SUBCONTRACTORS_ID, SUBCONTRACTORS_ID,
</if> </if>
<if test="companyId != null"> <if test="companyId != null">
org_id, org_id,
</if> </if>
IS_ACTIVE,PLAN_OUT_ID IS_ACTIVE,PLAN_OUT_ID
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="definitionId != null"> <if test="definitionId != null">
#{definitionId}, #{definitionId},
</if> </if>
<if test="processId != null"> <if test="processId != null">
#{processId}, #{processId},
</if> </if>
<if test="operationUserId != null"> <if test="operationUserId != null">
#{operationUserId}, #{operationUserId},
</if> </if>
<if test="operationTime != null"> <if test="operationTime != null">
#{operationTime}, #{operationTime},
</if> </if>
<if test="number != null"> <if test="number != null">
#{number}, #{number},
</if> </if>
<if test="isFinish != null"> <if test="isFinish != null">
#{isFinish}, #{isFinish},
</if> </if>
<if test="isSplit != null"> <if test="isSplit != null">
#{isSplit}, #{isSplit},
</if> </if>
<if test="leasePerson != null"> <if test="leasePerson != null">
#{leasePerson}, #{leasePerson},
</if> </if>
<if test="phone != null"> <if test="phone != null">
#{phone}, #{phone},
</if> </if>
<if test="remark != null"> <if test="remark != null">
#{remark}, #{remark},
</if> </if>
<if test="taskId != null"> <if test="taskId != null">
#{taskId}, #{taskId},
</if> </if>
<if test="subcontractors != null"> <if test="subcontractors != null">
#{subcontractors}, #{subcontractors},
</if> </if>
<if test="companyId != null"> <if test="companyId != null">
#{companyId}, #{companyId},
</if> </if>
1,#{planOutId} 1,#{planOutId}
</trim> </trim>
</insert> </insert>
<select id="findNumber" parameterType="com.bonus.wf.beans.TaskRecordBean" resultType="java.lang.String"> <select id="findNumber" parameterType="com.bonus.wf.beans.TaskRecordBean" resultType="java.lang.String">
SELECT COUNT(*) FROM wf_task_record wtr SELECT COUNT(*)
WHERE wtr.OPERATION_TIME LIKE CONCAT("%",#{operationTime},"%") FROM wf_task_record wtr
AND wtr.DEFINITION_ID = #{definitionId} WHERE wtr.OPERATION_TIME LIKE CONCAT("%", #{operationTime}, "%")
</select> AND wtr.DEFINITION_ID = #{definitionId}
</select>
<delete id="delete" parameterType="com.bonus.wf.beans.TaskRecordBean"> <delete id="delete" parameterType="com.bonus.wf.beans.TaskRecordBean">
delete from wf_task_record where id = #{id} delete
</delete> from wf_task_record
where id = #{id}
</delete>
<update id="update" parameterType="com.bonus.wf.beans.TaskRecordBean"> <update id="update" parameterType="com.bonus.wf.beans.TaskRecordBean">
update wf_task_record update wf_task_record
<set> <set>
<if test="definitionId != null"> <if test="definitionId != null">
DEFINITION_ID = #{definitionId}, DEFINITION_ID = #{definitionId},
</if> </if>
<if test="processId != null"> <if test="processId != null">
PROCESS_ID = #{processId}, PROCESS_ID = #{processId},
</if> </if>
<if test="operationUserId !=null"> <if test="operationUserId !=null">
OPERATION_USER = #{operationUserId}, OPERATION_USER = #{operationUserId},
</if> </if>
<if test="operationTime !=null"> <if test="operationTime !=null">
OPERATION_TIME = #{operationTime}, OPERATION_TIME = #{operationTime},
</if> </if>
<if test="number !=null"> <if test="number !=null">
NUMBER = #{number}, NUMBER = #{number},
</if> </if>
<if test="isFinish !=null"> <if test="isFinish !=null">
IS_FINISH = #{isFinish}, IS_FINISH = #{isFinish},
</if> </if>
<if test="isSplit !=null"> <if test="isSplit !=null">
IS_SPLIT = #{isSplit}, IS_SPLIT = #{isSplit},
</if> </if>
<if test="companyId !=null"> <if test="companyId !=null">
ORG_ID = #{companyId}, ORG_ID = #{companyId},
</if> </if>
<if test="remark != null"> <if test="remark != null">
REMARK = #{remark}, REMARK = #{remark},
</if> </if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
<insert id="addTaskAgreement" parameterType="com.bonus.wf.beans.TaskRecordBean"> <insert id="addTaskAgreement" parameterType="com.bonus.wf.beans.TaskRecordBean">
insert into wf_agreement_task(TASK_ID,AGREEMENT_ID) insert into wf_agreement_task(TASK_ID, AGREEMENT_ID)
values(#{taskId},#{agreementId}) values (#{taskId}, #{agreementId})
</insert> </insert>
<delete id="deleteBatch" parameterType="java.util.List"> <delete id="deleteBatch" parameterType="java.util.List">
DELETE FROM wf_process_record WHERE id in( DELETE FROM wf_process_record WHERE id in(
<foreach item="o" collection="list" open="" separator="," <foreach item="o" collection="list" open="" separator=","
close=""> close="">
#{o.id} #{o.id}
</foreach> </foreach>
) )
</delete> </delete>
<select id="checkTask" parameterType="java.lang.String" resultMap="taskRecord"> <select id="checkTask" parameterType="java.lang.String" resultMap="taskRecord">
SELECT wtr.ID AS taskId,number SELECT wtr.ID AS taskId, number
FROM wf_task_record wtr FROM wf_task_record wtr
WHERE wtr.SUP_ID = #{taskId} AND wtr.DEFINITION_ID = 20 AND wtr.IS_SPLIT = 0 WHERE wtr.SUP_ID = #{taskId}
</select> AND wtr.DEFINITION_ID = 20
AND wtr.IS_SPLIT = 0
</select>
</mapper> </mapper>

View File

@ -492,4 +492,33 @@ public class DateTimeHelper {
return 0; return 0;
} }
public static String getNowDay() {
String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
return time;
}
public static String getTimeDiff(String endTime,String nowTime) {
Long[] dateArr = new Long[2];
try {
String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
Date date = sdf.parse(endTime);
Date time = sdf.parse(nowTime);
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
long diff = date.getTime() - time.getTime();
long hour = diff/ nh;
long min = diff % nh / nm;
// dateArr[0] = hour;
// dateArr[1] = min == 0 ? 1 : min;
return hour+ "小时" + min + "分钟";
} catch (Exception e) {
dateArr[0] = 0L;
dateArr[1] = 0L;
}
return 0 + "小时" + 0 + "分钟";
}
} }

View File

@ -0,0 +1,160 @@
package com.bonus.rm.beans;
public class AuditRecordVo {
private String id;
/**
* 计划
*/
private String applyId;
/**
* 审核人
*/
private String auditor;
/**
* 审核时间
*/
private String auditTime;
/**
* 审核状态
*/
private String auditStatus;
/**
* 审核备注
*/
private String auditRemark;
/**
* 审核节点
*/
private String auditType;
/**
* 操作类型 1 创建 2 提交 3审核 4 修改
*/
private String type;
/**
* 操作人名称
*/
private String userName;
/**
* 操作人昵称
*/
private String nikeName;
private String times;
private String phone;
private String creator;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getApplyId() {
return applyId;
}
public void setApplyId(String applyId) {
this.applyId = applyId;
}
public String getAuditor() {
return auditor;
}
public void setAuditor(String auditor) {
this.auditor = auditor;
}
public String getAuditTime() {
return auditTime;
}
public void setAuditTime(String auditTime) {
this.auditTime = auditTime;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getAuditRemark() {
return auditRemark;
}
public void setAuditRemark(String auditRemark) {
this.auditRemark = auditRemark;
}
public String getAuditType() {
return auditType;
}
public void setAuditType(String auditType) {
this.auditType = auditType;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getNikeName() {
return nikeName;
}
public void setNikeName(String nikeName) {
this.nikeName = nikeName;
}
public String getTimes() {
return times;
}
public void setTimes(String times) {
this.times = times;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
}

View File

@ -0,0 +1,526 @@
package com.bonus.rm.beans;
public class CarNeedPlanVo {
/**
* 主键
*/
private String id;
/**
* 合同id
*/
private String contractId;
/**
* 计划编号
*/
private String code;
/**
* 类型 1车辆 2吊车
*/
private int type;
private String typeName;
/**
* 申请人
*/
private String userName;
private String appLyTime;
/**
* 工程id
*/
private String proId;
/**
* 工程名称
*/
private String proName;
/**
* 工程类型
*/
private String proType;
/**
* 项目部分
*/
private String projectPart;
/**
* 施工地点
*/
// @NotBlank(message = "请填施工地点")
private String projectContent;
/**
* 需用时间
*/
private String needTime;
/**
* 审核状态中文
*/
private String auditStatus;
/**
* 派车状态
*/
private String statusName;
/**
* 备注
*/
private String remark;
/**
* 计划类型 0 正常 1紧急
*/
private String applyType;
/**
* 审核状态 1 待审核 2审核通过 3 审核驳回
*/
private int status;
/**
* 审核节点
*/
private int statusType;
/**
* 计划数量
*/
private int carNum;
/**
* 用车数量
*/
private int needNum;
/**
* 已派车数量
*/
private int dispatchNum;
/**
* 待派车数量
*/
private int noDispatchNum;
/**
* 删除的类型id
*/
private String delIds;
private String model;
private String name;
private String supId;
/**
* 供应商名称
*/
private String supName;
/**
* 发货日期
*/
private String dispatchDay;
/**
* 是否发车
*/
private String isDispatch;
/**
* 人员id
*/
private String userId;
private String roleCode;
/**
* 计划id
*/
private String planId;
/**
* 派车时间
*/
private String outTime;
private String carLength;
private String carWidth;
private String carHeight;
private String carWeight;
private String carStart;
private String carEnd;
private String routePoint;
private int fileNum;
/**
* 删除的文件
*/
private String delFile;
private String outId;
/**
* 车牌
*/
private String licensePlate;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getContractId() {
return contractId;
}
public void setContractId(String contractId) {
this.contractId = contractId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getAppLyTime() {
return appLyTime;
}
public void setAppLyTime(String appLyTime) {
this.appLyTime = appLyTime;
}
public String getProId() {
return proId;
}
public void setProId(String proId) {
this.proId = proId;
}
public String getProName() {
return proName;
}
public void setProName(String proName) {
this.proName = proName;
}
public String getProType() {
return proType;
}
public void setProType(String proType) {
this.proType = proType;
}
public String getProjectPart() {
return projectPart;
}
public void setProjectPart(String projectPart) {
this.projectPart = projectPart;
}
public String getProjectContent() {
return projectContent;
}
public void setProjectContent(String projectContent) {
this.projectContent = projectContent;
}
public String getNeedTime() {
return needTime;
}
public void setNeedTime(String needTime) {
this.needTime = needTime;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getStatusName() {
return statusName;
}
public void setStatusName(String statusName) {
this.statusName = statusName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getApplyType() {
return applyType;
}
public void setApplyType(String applyType) {
this.applyType = applyType;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getStatusType() {
return statusType;
}
public void setStatusType(int statusType) {
this.statusType = statusType;
}
public int getCarNum() {
return carNum;
}
public void setCarNum(int carNum) {
this.carNum = carNum;
}
public int getNeedNum() {
return needNum;
}
public void setNeedNum(int needNum) {
this.needNum = needNum;
}
public int getDispatchNum() {
return dispatchNum;
}
public void setDispatchNum(int dispatchNum) {
this.dispatchNum = dispatchNum;
}
public int getNoDispatchNum() {
return noDispatchNum;
}
public void setNoDispatchNum(int noDispatchNum) {
this.noDispatchNum = noDispatchNum;
}
public String getDelIds() {
return delIds;
}
public void setDelIds(String delIds) {
this.delIds = delIds;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSupId() {
return supId;
}
public void setSupId(String supId) {
this.supId = supId;
}
public String getSupName() {
return supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public String getDispatchDay() {
return dispatchDay;
}
public void setDispatchDay(String dispatchDay) {
this.dispatchDay = dispatchDay;
}
public String getIsDispatch() {
return isDispatch;
}
public void setIsDispatch(String isDispatch) {
this.isDispatch = isDispatch;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getRoleCode() {
return roleCode;
}
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
public String getPlanId() {
return planId;
}
public void setPlanId(String planId) {
this.planId = planId;
}
public String getOutTime() {
return outTime;
}
public void setOutTime(String outTime) {
this.outTime = outTime;
}
public String getCarLength() {
return carLength;
}
public void setCarLength(String carLength) {
this.carLength = carLength;
}
public String getCarWidth() {
return carWidth;
}
public void setCarWidth(String carWidth) {
this.carWidth = carWidth;
}
public String getCarHeight() {
return carHeight;
}
public void setCarHeight(String carHeight) {
this.carHeight = carHeight;
}
public String getCarWeight() {
return carWeight;
}
public void setCarWeight(String carWeight) {
this.carWeight = carWeight;
}
public String getCarStart() {
return carStart;
}
public void setCarStart(String carStart) {
this.carStart = carStart;
}
public String getCarEnd() {
return carEnd;
}
public void setCarEnd(String carEnd) {
this.carEnd = carEnd;
}
public String getRoutePoint() {
return routePoint;
}
public void setRoutePoint(String routePoint) {
this.routePoint = routePoint;
}
public int getFileNum() {
return fileNum;
}
public void setFileNum(int fileNum) {
this.fileNum = fileNum;
}
public String getDelFile() {
return delFile;
}
public void setDelFile(String delFile) {
this.delFile = delFile;
}
public String getOutId() {
return outId;
}
public void setOutId(String outId) {
this.outId = outId;
}
public String getLicensePlate() {
return licensePlate;
}
public void setLicensePlate(String licensePlate) {
this.licensePlate = licensePlate;
}
}

View File

@ -0,0 +1,208 @@
package com.bonus.rm.beans;
public class CarPlanOutVo {
/**
* 主键
*/
private String id;
private String outId;
/**
* 计划id
*/
private String planId;
/**
* 计划类型 1车辆 2 吊车
*/
private int planType;
/**
* 派车日期
*/
private String outDay;
/**
* 经办人
*/
private String manager;
/**
* 备注
*/
private String remark;
/**
* 派车数量
*/
private int dispatchNum;
/**
* 合同id
*/
private String contractId;
/**
* 供应商id
*/
private String supId;
/**
* 供应商名称
*/
private String supName;
/**
* 审核状态
*/
private String status;
/**
* 金额
*/
private String money;
private String delFileId;
private String updateRemark;
private String resource;
private String file;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getOutId() {
return outId;
}
public void setOutId(String outId) {
this.outId = outId;
}
public String getPlanId() {
return planId;
}
public void setPlanId(String planId) {
this.planId = planId;
}
public int getPlanType() {
return planType;
}
public void setPlanType(int planType) {
this.planType = planType;
}
public String getOutDay() {
return outDay;
}
public void setOutDay(String outDay) {
this.outDay = outDay;
}
public String getManager() {
return manager;
}
public void setManager(String manager) {
this.manager = manager;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public int getDispatchNum() {
return dispatchNum;
}
public void setDispatchNum(int dispatchNum) {
this.dispatchNum = dispatchNum;
}
public String getContractId() {
return contractId;
}
public void setContractId(String contractId) {
this.contractId = contractId;
}
public String getSupId() {
return supId;
}
public void setSupId(String supId) {
this.supId = supId;
}
public String getSupName() {
return supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
public String getDelFileId() {
return delFileId;
}
public void setDelFileId(String delFileId) {
this.delFileId = delFileId;
}
public String getUpdateRemark() {
return updateRemark;
}
public void setUpdateRemark(String updateRemark) {
this.updateRemark = updateRemark;
}
public String getResource() {
return resource;
}
public void setResource(String resource) {
this.resource = resource;
}
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
}

View File

@ -7,7 +7,8 @@ import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
@ -17,10 +18,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.bonus.exp.POIOutputHelper; import com.bonus.exp.POIOutputHelper;
import com.bonus.rm.beans.ReturnMaterialTaskRecordBean; import com.bonus.rm.beans.ReturnMaterialTaskRecordBean;
@ -146,6 +144,21 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
return map; return map;
} }
@RequestMapping(value = "batchApproval", method = RequestMethod.POST)
@ResponseBody
public AjaxRes batchApproval(@RequestParam("ids") List<String> ids) {
System.out.println("接收到的ids" + ids);
AjaxRes ar = getAjaxRes();
if (ids == null || ids.isEmpty()) {
ar.setFailMsg("未接收到ids参数");
} else {
service.batchApproval(ids);
ar.setSucceedMsg("接收到" + ids.size() + "个ID");
}
return ar;
}
// 待办详情 // 待办详情
@RequestMapping(value = "findUnFinishContentDetails", method = RequestMethod.POST) @RequestMapping(value = "findUnFinishContentDetails", method = RequestMethod.POST)
@ResponseBody @ResponseBody

View File

@ -2,7 +2,13 @@ package com.bonus.rm.dao;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.bonus.core.BonusBatis; import com.bonus.core.BonusBatis;
import com.bonus.rm.beans.AuditRecordVo;
import com.bonus.rm.beans.CarNeedPlanVo;
import com.bonus.rm.beans.CarPlanOutVo;
import com.bonus.rm.beans.ReturnMaterialTaskRecordBean; import com.bonus.rm.beans.ReturnMaterialTaskRecordBean;
import com.bonus.sys.BaseDao; import com.bonus.sys.BaseDao;
@ -19,4 +25,17 @@ public interface ReturnMaterialTaskRecordDao extends BaseDao<ReturnMaterialTaskR
int updateRemarkMachinebyId(ReturnMaterialTaskRecordBean o); int updateRemarkMachinebyId(ReturnMaterialTaskRecordBean o);
List<ReturnMaterialTaskRecordBean> findUnFinishContentDetails(ReturnMaterialTaskRecordBean o); List<ReturnMaterialTaskRecordBean> findUnFinishContentDetails(ReturnMaterialTaskRecordBean o);
int batchApproval(List<ReturnMaterialTaskRecordBean> list);
int addRecord(AuditRecordVo vo);
String getUpTimes(@Param("id") String id,@Param("auditType") int statusType);
CarNeedPlanVo getPlanInfo(@Param("pureId") String pureId);
CarPlanOutVo getCarPlanOut( @Param("pureId") String pureId);
void updateCarPlanInfo(CarNeedPlanVo carNeedPlanVo);
} }

View File

@ -1,7 +1,7 @@
package com.bonus.rm.service; package com.bonus.rm.service;
import java.util.List; import java.util.List;
import com.bonus.sys.AjaxRes;
import com.bonus.rm.beans.ReturnMaterialTaskRecordBean; import com.bonus.rm.beans.ReturnMaterialTaskRecordBean;
import com.bonus.sys.BaseService; import com.bonus.sys.BaseService;
import com.bonus.sys.Page; import com.bonus.sys.Page;
@ -20,4 +20,7 @@ public interface ReturnMaterialTaskRecordService extends BaseService<ReturnMater
int updateRemarkMachinebyId(ReturnMaterialTaskRecordBean o); int updateRemarkMachinebyId(ReturnMaterialTaskRecordBean o);
List<ReturnMaterialTaskRecordBean> findUnFinishContentDetails(ReturnMaterialTaskRecordBean o); List<ReturnMaterialTaskRecordBean> findUnFinishContentDetails(ReturnMaterialTaskRecordBean o);
AjaxRes batchApproval(List<String> ids);
} }

View File

@ -1,7 +1,11 @@
package com.bonus.rm.service; package com.bonus.rm.service;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.bonus.sys.AjaxRes;
import com.bonus.sys.UserShiroHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -11,6 +15,11 @@ import com.bonus.sys.BaseServiceImp;
import com.bonus.sys.Page; import com.bonus.sys.Page;
import com.bonus.wf.beans.TaskRecordBean; import com.bonus.wf.beans.TaskRecordBean;
import com.bonus.wf.dao.TaskRecordDao; import com.bonus.wf.dao.TaskRecordDao;
import com.bonus.core.DateTimeHelper;
import com.bonus.core.StringHelper;
import com.bonus.rm.beans.AuditRecordVo;
import com.bonus.rm.beans.CarNeedPlanVo;
import com.bonus.rm.beans.CarPlanOutVo;
@Service("returnTaskRecord") @Service("returnTaskRecord")
public class ReturnMaterialTaskRecordServiceImp extends BaseServiceImp<ReturnMaterialTaskRecordBean> public class ReturnMaterialTaskRecordServiceImp extends BaseServiceImp<ReturnMaterialTaskRecordBean>
@ -58,4 +67,154 @@ public class ReturnMaterialTaskRecordServiceImp extends BaseServiceImp<ReturnMat
return dao.findUnFinishContentDetails(o); return dao.findUnFinishContentDetails(o);
} }
@Override
public AjaxRes batchApproval(List<String> ids) {
AjaxRes ar = getAjaxRes();
try {
// 拆分出纯数字ID列表
List<ReturnMaterialTaskRecordBean> list = ids.stream()
.filter(Objects::nonNull)
.map(id -> {
int index = id.indexOf('_');
String pureId = index == -1 ? id : id.substring(0, index);
String desc = index == -1 ? "" : id.substring(index + 1);
String userId = UserShiroHelper.getCurrentUser().getId() + "";
ReturnMaterialTaskRecordBean bean = new ReturnMaterialTaskRecordBean();
if ("派车计划".equals(desc)) {
CarPlanOutVo vo = dao.getCarPlanOut(pureId); // 当前记录
CarNeedPlanVo carNeedPlanVo = dao.getPlanInfo(vo.getPlanId());
int statusType = 0;
String currentStatus ="";
if ("57".equals(userId) || "29".equals(userId) || "55".equals(userId)
|| "56".equals(userId) || "67".equals(userId)) {
statusType = 1;
currentStatus = "3";
carNeedPlanVo.setStatus(0);
} else if ("49".equals(userId) || "50".equals(userId)) {
int dispatchNum = carNeedPlanVo.getDispatchNum();
carNeedPlanVo.setDispatchDay(DateTimeHelper.getNowDay());
carNeedPlanVo.setDispatchNum(dispatchNum + vo.getDispatchNum());
// 如果没有其他待审核记录状态置为1完成调度否则2继续审核
carNeedPlanVo.setStatus(2);
// 更新计划信息
statusType = 2;
currentStatus = "3";
}
dao.updateCarPlanInfo(carNeedPlanVo);
// 写操作记录
String uptime = getUpTimes("out-" + pureId, statusType);
addRecord("out-" + pureId, String.valueOf(statusType), "2", "3", uptime);
}
if ("用车计划".equals(desc)) {
int statusType = 0;
if ("14".equals(userId)) {
statusType = 4;
} else if ("84".equals(userId) || "85".equals(userId)) {
statusType = 3;
}
String upTimes = getUpTimes(pureId, statusType, 2);
addRecord(pureId, "2",String.valueOf(statusType) , "3" ,upTimes);
}
bean.setId(pureId); // 假设id字段是String类型或者你要转换成Long再赋值
bean.setLeaseName(desc);
bean.setOperator(userId);
// 如果有其它字段根据需要设置
return bean;
})
.collect(Collectors.toList());
int num = dao.batchApproval(list);
if (num > 0) {
ar.setSucceedMsg("审批成功");
} else {
ar.setFailMsg("审批失败");
}
return ar;
} catch (Exception e) {
logger.error(e.toString(), e);
ar.setFailMsg("审批失败");
}
return ar;
}
/**
* 添加记录数据
* @param applyId 审计id
* @param auditStatus 深恶黑状态
* @param auditType 审核节点
* @param type 类型
* @return
*/
public int addRecord(String applyId,String auditStatus,String auditType,String type,String times){
try {
AuditRecordVo vo=new AuditRecordVo();
if(StringHelper.isNotEmpty(times)){
String time = DateTimeHelper.getTimeDiff(DateTimeHelper.getNowTime(),times);
vo.setTimes(time);
}
String userId= Objects.requireNonNull(UserShiroHelper.getCurrentUser().getId()).toString();
String userName= UserShiroHelper.getCurrentUser().getName();
vo.setApplyId(applyId);
vo.setCreator(userId);
vo.setAuditTime(DateTimeHelper.getNowTime());
vo.setAuditStatus(auditStatus);
vo.setAuditType(auditType);
vo.setType(type);
vo.setAuditRemark("审核通过");
vo.setUserName(userName);
vo.setAuditor(userId);
return dao.addRecord(vo);
}catch (Exception e){
}
return 0;
}
/**
* 查询上个节点时间
* @param id
* @param statusType
* @return
*/
public String getUpTimes(String id, int statusType,int status) {
if(status==2){
statusType=statusType-1;
if(statusType==3){
return dao.getUpTimes(id,1);
}else{
return dao.getUpTimes(id,statusType);
}
}else{
return dao.getUpTimes(id,1);
}
}
public String getUpTimes(String id,int status) {
//发车审核
if(status==3){
status=2;
return dao.getUpTimes(id,status);
}else{
return dao.getUpTimes(id,1);
}
}
} }