*
lsh
2025-04-28 8bfb0b15fb16e4e7314bcd55088ab445d56e3dd3
*
6个文件已修改
110 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/TaskWrkLogController.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/TaskWrkLogMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/TaskWrkLogService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/TaskWrkLogServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/TaskWrkLogMapper.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/taskWrkLog/taskWrkLog.html 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/TaskWrkLogController.java
@@ -1,6 +1,5 @@
package com.zy.asrs.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
@@ -37,12 +36,36 @@
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam Map<String, Object> param){
        EntityWrapper<TaskWrkLog> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        wrapper.orderDesc(Collections.singleton("CREATE_TIME"));
        return R.ok(taskWrkLogService.selectPage(new Page<>(curr, limit), wrapper));
        try{
            Integer wrkNo = null;
            Integer taskNo = null;
            Integer status = null;
            Date modiTimeStart = null, modiTimeEnd = null;
            for (Map.Entry<String, Object> entry : param.entrySet()) {
                String val = String.valueOf(entry.getValue());
                if (Cools.isEmpty(val)) {
                    continue;
                }
                if (val.contains(RANGE_TIME_LINK)) {
                    String[] dates = val.split(RANGE_TIME_LINK);
                    modiTimeStart = DateUtils.convert(dates[0]);
                    modiTimeEnd = DateUtils.convert(dates[1]);
                } else if (entry.getKey().equals("wrk_no")) {
                    wrkNo = Integer.parseInt(val);
                } else if (entry.getKey().equals("task_no")) {
                    taskNo = Integer.parseInt(val);
                } else if (entry.getKey().equals("status")) {
                    status = Integer.parseInt(val);
                }
            }
            List<TaskWrkLog> taskWrkList = taskWrkLogService.selectTaskWrkLogList(wrkNo,taskNo,status,modiTimeStart,modiTimeEnd, curr, limit);
            Page<TaskWrkLog> page1 = new Page<TaskWrkLog>(curr, limit).setRecords(taskWrkList);
            page1.setTotal(taskWrkLogService.selectTaskWrkLogListTotal(wrkNo,taskNo,status,modiTimeStart,modiTimeEnd));
            return R.ok(page1);
        } catch (Exception e) {
            return R.error("查询失败,请检查参数:"+e.getMessage());
        }
    }
    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
src/main/java/com/zy/asrs/mapper/TaskWrkLogMapper.java
@@ -3,10 +3,27 @@
import com.zy.asrs.entity.TaskWrkLog;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Mapper
@Repository
public interface TaskWrkLogMapper extends BaseMapper<TaskWrkLog> {
    List<TaskWrkLog> selectTaskWrkLogList(@Param("wrkNo") Integer wrkNo,
                                       @Param("taskNo") Integer taskNo,
                                       @Param("status") Integer status,
                                       @Param("modiTimeStart") Date modiTimeStart,
                                       @Param("modiTimeEnd") Date modiTimeEnd,
                                       @Param("pageNumber") Integer curr,
                                       @Param("pageSize") Integer limit);
    Long selectTaskWrkLogListTotal(@Param("wrkNo") Integer wrkNo,
                                @Param("taskNo") Integer taskNo,
                                @Param("status") Integer status,
                                @Param("modiTimeStart") Date modiTimeStart,
                                @Param("modiTimeEnd") Date modiTimeEnd);
}
src/main/java/com/zy/asrs/service/TaskWrkLogService.java
@@ -3,6 +3,11 @@
import com.zy.asrs.entity.TaskWrkLog;
import com.baomidou.mybatisplus.service.IService;
import java.util.Date;
import java.util.List;
public interface TaskWrkLogService extends IService<TaskWrkLog> {
    List<TaskWrkLog> selectTaskWrkLogList(Integer wrkNo, Integer taskNo, Integer status, Date modiTimeStart, Date modiTimeEnd, Integer curr, Integer limit);
    Long selectTaskWrkLogListTotal(Integer wrkNo,Integer taskNo,Integer status,Date modiTimeStart,Date modiTimeEnd);
}
src/main/java/com/zy/asrs/service/impl/TaskWrkLogServiceImpl.java
@@ -6,7 +6,18 @@
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("taskWrkLogService")
public class TaskWrkLogServiceImpl extends ServiceImpl<TaskWrkLogMapper, TaskWrkLog> implements TaskWrkLogService {
    @Override
    public List<TaskWrkLog> selectTaskWrkLogList(Integer wrkNo, Integer taskNo, Integer status, Date modiTimeStart, Date modiTimeEnd, Integer curr, Integer limit) {
        return this.baseMapper.selectTaskWrkLogList(wrkNo,taskNo, status,modiTimeStart,modiTimeEnd,curr,limit);
    }
    @Override
    public Long selectTaskWrkLogListTotal(Integer wrkNo,Integer taskNo,Integer status,Date modiTimeStart,Date modiTimeEnd) {
        return this.baseMapper.selectTaskWrkLogListTotal(wrkNo,taskNo, status,modiTimeStart,modiTimeEnd);
    }
}
src/main/resources/mapper/TaskWrkLogMapper.xml
@@ -26,4 +26,36 @@
    </resultMap>
    <sql id="batchSeq">
        <if test="wrkNo != null">
            and WRK_NO = #{wrkNo}
        </if>
        <if test="taskNo != null">
            and TASK_NO = #{taskNo}
        </if>
        <if test="status != null">
            and STATUS = #{status}
        </if>
        <if test="modiTimeStart != null ">
            <if test="modiTimeEnd != null ">
                and MODI_TIME between #{modiTimeStart} and #{modiTimeEnd}
            </if>
        </if>
    </sql>
    <select id="selectTaskWrkLogList" resultMap="BaseResultMap">
        SELECT * FROM "SOURCE"."wcs_task_wrk_log"
        WHERE 1=1
        <include refid="batchSeq"></include>
        ORDER BY CREATE_TIME DESC
        LIMIT #{pageSize} OFFSET ((#{pageNumber} - 1) * #{pageSize});
    </select>
    <select id="selectTaskWrkLogListTotal" resultType="Long">
        SELECT count(1) FROM "SOURCE"."wcs_task_wrk_log"
        WHERE 1=1
        <include refid="batchSeq"></include>
    </select>
</mapper>
src/main/webapp/views/taskWrkLog/taskWrkLog.html
@@ -25,6 +25,14 @@
                <el-form-item label="">
                    <el-input v-model="tableSearchParam.wrk_no" placeholder="工作号"></el-input>
                </el-form-item>
                <el-form-item label="">
                    <el-select v-model="tableSearchParam.status" placeholder="任务状态">
                        <el-option label="接收" value="1"></el-option>
                        <el-option label="派发" value="2"></el-option>
                        <el-option label="完结" value="3"></el-option>
                        <el-option label="取消" value="4"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="getTableData">查询</el-button>
                    <el-button type="primary" @click="resetParam">重置</el-button>