diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordOutController.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordOutController.java index 54a7805..4697269 100644 --- a/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordOutController.java +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordOutController.java @@ -1,6 +1,10 @@ package com.ruoyi.manage.controller; import java.util.List; + +import com.ruoyi.manage.domain.RecordIn; +import com.ruoyi.manage.domain.RecordInSort; +import com.ruoyi.manage.domain.RecordOutSort; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -30,7 +34,7 @@ import com.ruoyi.common.core.page.TableDataInfo; public class RecordOutController extends BaseController { private String prefix = "manage/record_out"; - + private String prefix2 = "manage/record_out_sort"; @Autowired private IRecordOutService recordOutService; @@ -40,7 +44,12 @@ public class RecordOutController extends BaseController { return prefix + "/record_out"; } - + @RequiresPermissions("manage:record_out_sort:view") + @GetMapping("/record_out_sort") + public String record_out_sort() + { + return prefix2 + "/record_out_sort"; + } /** * 查询轮挡出库记录列表 */ @@ -53,7 +62,30 @@ public class RecordOutController extends BaseController List list = recordOutService.selectRecordOutList(recordOut); return getDataTable(list); } - + /** + * 分类查询轮挡入库记录列表 + */ + @RequiresPermissions("manage:record_out:sort_list") + @PostMapping("/sort_list") + @ResponseBody + public TableDataInfo sort_list(RecordOutSort recordOutSort) + { + startPage(); + List list = recordOutService.selectRecordOutSortList(recordOutSort); + return getDataTable(list); + } + /** + * 按批次码分类查询轮挡入库记录列表 + */ + @RequiresPermissions("manage:record_out:sort_list") + @PostMapping("/sort_LocationCode") + @ResponseBody + public TableDataInfo selectByBatchCode(String locationCode) + { +// startPage(); + List list = recordOutService.selectByLocationCode(locationCode); + return getDataTable(list); + } /** * 导出轮挡出库记录列表 */ diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/domain/RecordOutSort.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/domain/RecordOutSort.java new file mode 100644 index 0000000..ada8f47 --- /dev/null +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/domain/RecordOutSort.java @@ -0,0 +1,51 @@ +package com.ruoyi.manage.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 轮挡出库记录对象 record_out + * + * @author wangh + * @date 2024-01-18 + */ +public class RecordOutSort extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 机位码 */ + @Excel(name = "机位码") + private String locationCode; + + /** 数量 */ + @Excel(name = "数量") + public int recordCount; + + public void setLocationCode(String locationCode) + { + this.locationCode = locationCode; + } + + public String getLocationCode() + { + return locationCode; + } + + public int getRecordCount() { + return recordCount; + } + + public void setRecordCount(int recordCount) { + this.recordCount = recordCount; + } + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("locationCode", getLocationCode()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/RecordOutMapper.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/RecordOutMapper.java index 60142a9..927b58e 100644 --- a/ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/RecordOutMapper.java +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/RecordOutMapper.java @@ -1,7 +1,11 @@ package com.ruoyi.manage.mapper; import java.util.List; + +import com.ruoyi.manage.domain.RecordIn; +import com.ruoyi.manage.domain.RecordInSort; import com.ruoyi.manage.domain.RecordOut; +import com.ruoyi.manage.domain.RecordOutSort; import org.springframework.stereotype.Repository; /** * 轮挡出库记录Mapper接口 @@ -59,4 +63,18 @@ public interface RecordOutMapper * @return 结果 */ public int deleteRecordOutByObjids(String[] objids); + /** + * 分类查询轮挡入库记录列表 + * + * @param recordOutSort 分类轮挡入库记录 + * @return 分类轮挡入库记录 + */ + List selectRecordOutSortList(RecordOutSort recordOutSort); + /** + * 按批次码分类查询轮挡入库记录列表 + * + * @param locationCode + * @return 轮挡入库记录 + */ + public List selectByLocationCode(String locationCode); } diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/service/IRecordOutService.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/service/IRecordOutService.java index e0d3b4c..095085a 100644 --- a/ruoyi-manage/src/main/java/com/ruoyi/manage/service/IRecordOutService.java +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/service/IRecordOutService.java @@ -1,7 +1,11 @@ package com.ruoyi.manage.service; import java.util.List; + +import com.ruoyi.manage.domain.RecordIn; +import com.ruoyi.manage.domain.RecordInSort; import com.ruoyi.manage.domain.RecordOut; +import com.ruoyi.manage.domain.RecordOutSort; /** * 轮挡出库记录Service接口 @@ -58,4 +62,18 @@ public interface IRecordOutService * @return 结果 */ public int deleteRecordOutByObjid(Long objid); + /** + * 分类查询轮挡出库记录列表 + * + * @param recordOutSort 轮挡出库记录 + * @return 轮挡入库记录集合 + */ + List selectRecordOutSortList(RecordOutSort recordOutSort); + /** + * 按批次码分类查询轮挡入库记录列表 + * + * @param + * @return 分类轮挡入库记录 + */ + public List selectByLocationCode(String locationCode); } diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/RecordOutServiceImpl.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/RecordOutServiceImpl.java index 67e05aa..2005d09 100644 --- a/ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/RecordOutServiceImpl.java +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/RecordOutServiceImpl.java @@ -5,6 +5,9 @@ import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.manage.domain.RecordIn; +import com.ruoyi.manage.domain.RecordInSort; +import com.ruoyi.manage.domain.RecordOutSort; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.manage.mapper.RecordOutMapper; @@ -90,4 +93,24 @@ public class RecordOutServiceImpl implements IRecordOutService { public int deleteRecordOutByObjid(Long objid) { return recordOutMapper.deleteRecordOutByObjid(objid); } + /** + * 分类查询轮挡入库记录列表 + * + * @param recordOutSort 分类轮挡入库记录 + * @return 分类轮挡入库记录 + */ + @Override + public List selectRecordOutSortList(RecordOutSort recordOutSort) { + return recordOutMapper.selectRecordOutSortList(recordOutSort); + } + /** + * 按批次码分类查询轮挡入库记录列表 + * + * @param + * @return 分类轮挡入库记录 + */ + @Override + public List selectByLocationCode(String locationCode) { + return recordOutMapper.selectByLocationCode(locationCode); + } } diff --git a/ruoyi-manage/src/main/resources/mapper/manage/RecordOutMapper.xml b/ruoyi-manage/src/main/resources/mapper/manage/RecordOutMapper.xml index a590499..fbf9036 100644 --- a/ruoyi-manage/src/main/resources/mapper/manage/RecordOutMapper.xml +++ b/ruoyi-manage/src/main/resources/mapper/manage/RecordOutMapper.xml @@ -12,7 +12,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + + + + + + select objid, epc_code, location_code, use_user, create_by, create_time from record_out @@ -30,7 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where objid = #{objid} - + + insert into record_out diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_in_sort/record_in_sort.html b/ruoyi-manage/src/main/resources/templates/manage/record_in_sort/record_in_sort.html index dbcaab6..75d659e 100644 --- a/ruoyi-manage/src/main/resources/templates/manage/record_in_sort/record_in_sort.html +++ b/ruoyi-manage/src/main/resources/templates/manage/record_in_sort/record_in_sort.html @@ -26,6 +26,12 @@ data-detail-view-by-click="true" -->
+
` + 勾选数据导出指定列,否则为全部 + + 导出 + +
@@ -63,6 +69,7 @@ showToggle: false, showColumns: false, detailView: true, + onExpandRow : function(index, row, $detail) { initChildTable(index, row, $detail); }, @@ -118,7 +125,7 @@ initChildTable = function(index, row, $detail) { var batchCode = row.batchCode; - var childTable = $detail.html('').find('table'); + var childTable = $detail.html('
').find('table'); $(childTable).bootstrapTable({ url: prefix + "/sort_BatchCode", method: 'post', @@ -142,9 +149,9 @@ }; }, columns: [ - // { - // checkbox: true - // }, + { + checkbox: true + }, { title: '序号', formatter: function (value, row, index) { @@ -199,6 +206,78 @@ }*/] }); }; + // 导出数据 + // function exportSelected() { + // var $table =$('#bootstrap-table'); + // var selections = $table.bootstrapTable('getSelections'); + // var userIds = $.map(selections, function (row) { + // return row.objid; // 假设objid是子表每行的唯一标识 + // }); + // + // if(userIds.length === 0){ + // $.modal.alertWarning("请至少选择一条记录"); + // return; + // } + // + // var dataParam = { + // userIds: userIds.join(',') + // }; + // if($.common.isNotEmpty(userIds)){ + // tipMsg = "确定导出勾选" + userIds.length + "条数据吗?"; + // dataParam.push({ "name": "userIds", "value": userIds }); + // } + // $.modal.confirm(tipMsg, function() { + // $.post(prefix + "/export", dataParam, function(result) { + // if (result.code == web_status.SUCCESS) { + // window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; + // } else { + // $.modal.alertError(result.msg); + // } + // }); + // }); + // } + // 导出子表数据 + function exportSelected() { + var childTables = $('.detail-view table'); // 获取所有子表的引用 + var userIds = []; + + // 遍历每个子表 + childTables.each(function() { + var selections = $(this).bootstrapTable('getSelections'); // 获取子表中的选中行 + // 将子表中选中行的objid添加到userIds数组中 + userIds = userIds.concat($.map(selections, function (row) { + return row.objid; // 假设objid是子表每行的唯一标识 + })); + }); + + if(userIds.length === 0){ + $.modal.alertWarning("请至少选择一条记录"); + return; + } + + var dataParam = { + userIds: userIds.join(',') + }; + + $.modal.confirm("确定导出选中的" + userIds.length + "条数据吗?", function() { + $.ajax({ + url: prefix + "/export", // 修改为你的导出接口URL + method: 'POST', + data: dataParam, + success: function(result) { + if (result.code === web_status.SUCCESS) { + window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; + } else { + $.modal.alertError(result.msg); + } + }, + error: function(error) { + $.modal.alertError("导出失败"); + } + }); + }); + } + diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_out_sort/record_out_sort.html b/ruoyi-manage/src/main/resources/templates/manage/record_out_sort/record_out_sort.html new file mode 100644 index 0000000..1996698 --- /dev/null +++ b/ruoyi-manage/src/main/resources/templates/manage/record_out_sort/record_out_sort.html @@ -0,0 +1,232 @@ + + + + + + + + + + 轮挡入库分类记录 + + + + + + + + + + +
+
+
+ +
+
+
+ 勾选数据导出指定列,否则为全部 + + 导出 + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +