diff --git a/WebContent/WEB-INF/views/rm/UnFinishContentList.jsp b/WebContent/WEB-INF/views/rm/UnFinishContentList.jsp index 4f3403c..24bff8a 100644 --- a/WebContent/WEB-INF/views/rm/UnFinishContentList.jsp +++ b/WebContent/WEB-INF/views/rm/UnFinishContentList.jsp @@ -6,8 +6,8 @@ - + ${(page.pageNum-1)*page.pageSize+index.index+1} <%-- ${ma.unitName} @@ -193,18 +193,9 @@ --%> - ${ma.number} + ${ma.number} ${ma.creatorName} - - - - 任务未完成 - - <%-- - 任务已完成 - --%> - - + <%-- --%> @@ -221,7 +212,7 @@ function topage(id,processName) { $.ajax({ 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: { username: uname, password: pwd @@ -233,10 +224,10 @@ localStorage.setItem("name", name); //window.open("http://192.168.0.14:21625/gz-gqj/index.html") 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 === '用车计划'){ - 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 { diff --git a/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp b/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp index 31017c9..b01122d 100644 --- a/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp +++ b/WebContent/WEB-INF/views/rm/unFinishWorkList.jsp @@ -30,6 +30,7 @@ + @@ -38,15 +39,17 @@ + - - - - - + + + + @@ -104,8 +107,70 @@ getbaseList(1); // 重新请求表格数据 } $(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); + $(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) { keycode = e.which || e.keyCode; 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(){ $("#search").trigger("click"); } @@ -136,6 +211,7 @@ dataType:"html", contentType:"application/json", success:function(data){ + $('#checkAll').prop('checked', false); // 如果你还有全选框,也一并清除 $("#baseTable tbody").html(data); JY.Model.loadingClose(); }, diff --git a/WebContent/WEB-INF/views/rm/unFinishWorkListDetails.jsp b/WebContent/WEB-INF/views/rm/unFinishWorkListDetails.jsp index e93a835..12dd53c 100644 --- a/WebContent/WEB-INF/views/rm/unFinishWorkListDetails.jsp +++ b/WebContent/WEB-INF/views/rm/unFinishWorkListDetails.jsp @@ -25,8 +25,8 @@ - @@ -49,4 +49,10 @@
+ + 序号 任务名称创建时间任务单号创建人任务情况任务名称创建时间任务单号创建人
协议号:  - +   +
- \ No newline at end of file + + \ No newline at end of file diff --git a/resources/mybatis/rm/ReturnMaterialTaskRecordMapper.xml b/resources/mybatis/rm/ReturnMaterialTaskRecordMapper.xml index 0f91b4c..cb12439 100644 --- a/resources/mybatis/rm/ReturnMaterialTaskRecordMapper.xml +++ b/resources/mybatis/rm/ReturnMaterialTaskRecordMapper.xml @@ -710,4 +710,79 @@ wtr.DEFINITION_ID = 21 AND wtr.ID = #{id} + + + + + + + + UPDATE car_plan_out + SET + + + status = 1 + + + status = 2 + + + WHERE id = #{item.id} + + + + + UPDATE car_plan_apply + SET + + + status_type = '1' + + + status_type = '4' + + + WHERE id = #{item.id} + + + + + + + + + + + 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}) + + + + + + + + + + update car_plan_apply set dispatch_num=#{dispatchNum},dispatch_day=#{dispatchDay},dispatch_status=#{status} + where id=#{id} + \ No newline at end of file diff --git a/resources/mybatis/wf/TaskRecordMapper.xml b/resources/mybatis/wf/TaskRecordMapper.xml index 45262c7..ac8d9cd 100644 --- a/resources/mybatis/wf/TaskRecordMapper.xml +++ b/resources/mybatis/wf/TaskRecordMapper.xml @@ -1,358 +1,412 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + SELECT wtr.ID, + wtr.DEFINITION_ID as definitionId, + wtd.`NAME` as definishtionName, + wtr.PROCESS_ID as processId, + wpd.`NAME` as processName, + wtr.OPERATION_USER as operationUserId, + pu.`NAME` as operationUserName, + 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 + wtr.id AS id, + wtr.id AS checkerId, + CASE + WHEN wtr.DEFINITION_ID IN (1,2,8) THEN wtr.NUMBER + WHEN wtr.DEFINITION_ID IN (5,11) THEN wtr1.NUMBER + END AS number, + wpd.NAME AS processName, + wtd.NAME AS definitionName, + pu.NAME AS creatorName, + DATE_FORMAT(wtr.OPERATION_TIME, '%Y-%m-%d') AS operationTime, + wtr.DEFINITION_ID AS definitionId, + CASE + WHEN wtr.DEFINITION_ID = 11 THEN wtr1.IS_FINISH + ELSE wtr.IS_FINISH + END AS isFinish, + 'TASK' AS source + FROM + wf_task_record wtr + LEFT JOIN wf_task_record wtr1 ON wtr1.ID = wtr.SUP_ID + LEFT JOIN pm_user pu ON pu.id = wtr.OPERATION_USER + LEFT JOIN wf_task_definition wtd ON wtd.ID = wtr.DEFINITION_ID + LEFT JOIN wf_process_definition wpd ON wpd.id = wtr.PROCESS_ID + WHERE + wtr.DEFINITION_ID IN (1, 2, 5, 8, 11) + AND ( + (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 + + AND wtr.OPERATION_USER = #{param.operationUserId} + + + AND ( + wpd.NAME LIKE CONCAT('%', #{param.keyWord}, '%') + OR wtd.NAME LIKE CONCAT('%', #{param.keyWord}, '%') + OR pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%') + ) + + ) - UNION ALL + UNION ALL - ( - SELECT - cpa.id AS id, - cpa.code AS number, - '用车计划' AS processName, - '用车申请' AS definitionName, - pu.NAME AS creatorName, - DATE_FORMAT(cpa.create_time, '%Y-%m-%d') AS operationTime, - NULL AS definitionId, - NULL AS isFinish, - 'PLAN' AS source - FROM - car_plan_apply cpa - LEFT JOIN pm_user pu ON pu.id = cpa.creator - WHERE - cpa.status = '1' + ( + SELECT + cpa.id AS id, + cpa.id AS checkerId, + cpa.code AS number, + '用车计划' AS processName, + '用车申请' AS definitionName, + pu.NAME AS creatorName, + DATE_FORMAT(cpa.create_time, '%Y-%m-%d') AS operationTime, + NULL AS definitionId, + NULL AS isFinish, + 'PLAN' AS source + FROM + car_plan_apply cpa + LEFT JOIN pm_user pu ON pu.id = cpa.creator + WHERE + cpa.status = '1' + + + + AND cpa.status_type = '4' + + + AND cpa.status_type = '1' + + + + + AND cpa.status_type = '3' + + + AND cpa.status_type in ('4','1') + + + + AND 1 = 0 + + + + AND pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%') + + ) - - - AND cpa.status_type = '4' - - - AND cpa.status_type = '3' - - - AND 1 = 0 - - - - AND pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%') - - ) + UNION ALL - 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 + + + + + AND cpo.status = 0 + + + AND cpo.status in (1, 2) + + + + + AND cpo.status = '1' + + + AND cpo.status = '2' + - ( - SELECT - cpa.id AS id, - 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 - - - - AND cpa.status_type = '0' - - - AND cpo.status = '1' - - - AND 1 = 0 - - - - AND pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%') - - - ) + + + AND 1 = 0 + + + + AND pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%') + + + ) - ORDER BY id DESC + ORDER BY id DESC - + - + - + - + - - insert into wf_task_record - - - DEFINITION_ID, - - - PROCESS_ID, - - - OPERATION_USER, - - - OPERATION_TIME, - - - NUMBER, - - - IS_SPLIT, - - - IS_FINISH, - - - LEASE_PERSON, - - - PHONE, - - - REMARK, - - - SUP_ID, - - - SUBCONTRACTORS_ID, - + + insert into wf_task_record + + + DEFINITION_ID, + + + PROCESS_ID, + + + OPERATION_USER, + + + OPERATION_TIME, + + + NUMBER, + + + IS_SPLIT, + + + IS_FINISH, + + + LEASE_PERSON, + + + PHONE, + + + REMARK, + + + SUP_ID, + + + SUBCONTRACTORS_ID, + - - org_id, - - IS_ACTIVE,PLAN_OUT_ID - - - - #{definitionId}, - - - #{processId}, - - - #{operationUserId}, - - - #{operationTime}, - - - #{number}, - - - #{isFinish}, - - - #{isSplit}, - - - #{leasePerson}, - - - #{phone}, - - - #{remark}, - - - #{taskId}, - - - #{subcontractors}, - + + org_id, + + IS_ACTIVE,PLAN_OUT_ID + + + + #{definitionId}, + + + #{processId}, + + + #{operationUserId}, + + + #{operationTime}, + + + #{number}, + + + #{isFinish}, + + + #{isSplit}, + + + #{leasePerson}, + + + #{phone}, + + + #{remark}, + + + #{taskId}, + + + #{subcontractors}, + - - #{companyId}, - - 1,#{planOutId} - - + + #{companyId}, + + 1,#{planOutId} + + - + - - delete from wf_task_record where id = #{id} - + + delete + from wf_task_record + where id = #{id} + - - update wf_task_record - - - DEFINITION_ID = #{definitionId}, - - - PROCESS_ID = #{processId}, - - - OPERATION_USER = #{operationUserId}, - - - OPERATION_TIME = #{operationTime}, - - - NUMBER = #{number}, - - - IS_FINISH = #{isFinish}, - - - IS_SPLIT = #{isSplit}, - - - ORG_ID = #{companyId}, - - - REMARK = #{remark}, - - - where id = #{id} - + + update wf_task_record + + + DEFINITION_ID = #{definitionId}, + + + PROCESS_ID = #{processId}, + + + OPERATION_USER = #{operationUserId}, + + + OPERATION_TIME = #{operationTime}, + + + NUMBER = #{number}, + + + IS_FINISH = #{isFinish}, + + + IS_SPLIT = #{isSplit}, + + + ORG_ID = #{companyId}, + + + REMARK = #{remark}, + + + where id = #{id} + - - insert into wf_agreement_task(TASK_ID,AGREEMENT_ID) - values(#{taskId},#{agreementId}) - + + insert into wf_agreement_task(TASK_ID, AGREEMENT_ID) + values (#{taskId}, #{agreementId}) + - - DELETE FROM wf_process_record WHERE id in( - - #{o.id} - - ) - + + DELETE FROM wf_process_record WHERE id in( + + #{o.id} + + ) + - + \ No newline at end of file diff --git a/src/com/bonus/core/DateTimeHelper.java b/src/com/bonus/core/DateTimeHelper.java index 5c862cc..202da34 100644 --- a/src/com/bonus/core/DateTimeHelper.java +++ b/src/com/bonus/core/DateTimeHelper.java @@ -492,4 +492,33 @@ public class DateTimeHelper { 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 + "分钟"; + } } diff --git a/src/com/bonus/rm/beans/AuditRecordVo.java b/src/com/bonus/rm/beans/AuditRecordVo.java new file mode 100644 index 0000000..bdbe30e --- /dev/null +++ b/src/com/bonus/rm/beans/AuditRecordVo.java @@ -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; + } + + +} diff --git a/src/com/bonus/rm/beans/CarNeedPlanVo.java b/src/com/bonus/rm/beans/CarNeedPlanVo.java new file mode 100644 index 0000000..584e915 --- /dev/null +++ b/src/com/bonus/rm/beans/CarNeedPlanVo.java @@ -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; + } + + + +} diff --git a/src/com/bonus/rm/beans/CarPlanOutVo.java b/src/com/bonus/rm/beans/CarPlanOutVo.java new file mode 100644 index 0000000..e3588be --- /dev/null +++ b/src/com/bonus/rm/beans/CarPlanOutVo.java @@ -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; + } + + + +} diff --git a/src/com/bonus/rm/controller/ReturnMaterialTaskRecordController.java b/src/com/bonus/rm/controller/ReturnMaterialTaskRecordController.java index 883d944..17bf9de 100644 --- a/src/com/bonus/rm/controller/ReturnMaterialTaskRecordController.java +++ b/src/com/bonus/rm/controller/ReturnMaterialTaskRecordController.java @@ -7,7 +7,8 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; - +import java.util.Objects; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; 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.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.bonus.exp.POIOutputHelper; import com.bonus.rm.beans.ReturnMaterialTaskRecordBean; @@ -146,6 +144,21 @@ public class ReturnMaterialTaskRecordController extends BaseController 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) @ResponseBody diff --git a/src/com/bonus/rm/dao/ReturnMaterialTaskRecordDao.java b/src/com/bonus/rm/dao/ReturnMaterialTaskRecordDao.java index 4207342..353b2ca 100644 --- a/src/com/bonus/rm/dao/ReturnMaterialTaskRecordDao.java +++ b/src/com/bonus/rm/dao/ReturnMaterialTaskRecordDao.java @@ -2,7 +2,13 @@ package com.bonus.rm.dao; import java.util.List; + +import org.apache.ibatis.annotations.Param; + 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.sys.BaseDao; @@ -19,4 +25,17 @@ public interface ReturnMaterialTaskRecordDao extends BaseDao findUnFinishContentDetails(ReturnMaterialTaskRecordBean o); + + int batchApproval(List 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); + } diff --git a/src/com/bonus/rm/service/ReturnMaterialTaskRecordService.java b/src/com/bonus/rm/service/ReturnMaterialTaskRecordService.java index 903b8d8..88e26dd 100644 --- a/src/com/bonus/rm/service/ReturnMaterialTaskRecordService.java +++ b/src/com/bonus/rm/service/ReturnMaterialTaskRecordService.java @@ -1,7 +1,7 @@ package com.bonus.rm.service; import java.util.List; - +import com.bonus.sys.AjaxRes; import com.bonus.rm.beans.ReturnMaterialTaskRecordBean; import com.bonus.sys.BaseService; import com.bonus.sys.Page; @@ -20,4 +20,7 @@ public interface ReturnMaterialTaskRecordService extends BaseService findUnFinishContentDetails(ReturnMaterialTaskRecordBean o); + + AjaxRes batchApproval(List ids); + } diff --git a/src/com/bonus/rm/service/ReturnMaterialTaskRecordServiceImp.java b/src/com/bonus/rm/service/ReturnMaterialTaskRecordServiceImp.java index 541af91..a937d21 100644 --- a/src/com/bonus/rm/service/ReturnMaterialTaskRecordServiceImp.java +++ b/src/com/bonus/rm/service/ReturnMaterialTaskRecordServiceImp.java @@ -1,7 +1,11 @@ package com.bonus.rm.service; 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.stereotype.Service; @@ -11,6 +15,11 @@ import com.bonus.sys.BaseServiceImp; import com.bonus.sys.Page; import com.bonus.wf.beans.TaskRecordBean; 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") public class ReturnMaterialTaskRecordServiceImp extends BaseServiceImp @@ -58,4 +67,154 @@ public class ReturnMaterialTaskRecordServiceImp extends BaseServiceImp ids) { + AjaxRes ar = getAjaxRes(); + try { + // 拆分出纯数字ID列表 + List 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); + } + + } + + }