Browse Source

[feat]

仓库管理 入库单
新增按入库单号批量查询入库单记录service和mapper方法;
修改生产入库单controller,新增查询生产入库单方法,修改导出入库单列表方法,实现多选和全部导出;
修改生产入库列表页面,调整搜索栏字段,新增导出方法;
修改添加生产入库页面表格数据来源;
dev
王晓迪 3 days ago
parent
commit
a30fc15ff4
  1. 28
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java
  2. 3
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderMapper.java
  3. 3
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  5. 11
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseStorageOrderMapper.xml
  6. 35
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html
  7. 2
      ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html

28
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java

@ -9,6 +9,7 @@ import com.ruoyi.quality.service.IQualityOrderService;
import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.dto.SysEquipMaterialDto; import com.ruoyi.system.dto.SysEquipMaterialDto;
import com.ruoyi.system.service.ISysSalesOrderChildService; import com.ruoyi.system.service.ISysSalesOrderChildService;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamageChild;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import com.ruoyi.warehouse.service.IWarehouseStorageOrderService; import com.ruoyi.warehouse.service.IWarehouseStorageOrderService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -16,6 +17,7 @@ import org.springframework.beans.BeanUtils;
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.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
@ -63,6 +65,17 @@ public class ErpInboundOrderController extends BaseController
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(WarehouseStorageOrder storageOrder) public TableDataInfo list(WarehouseStorageOrder storageOrder)
{
startPage();
List<WarehouseStorageOrder> list = storageOrderService.selectWarehouseStorageOrderList(storageOrder);
return getDataTable(list);
}
/**
* 查询生产入库单列表
*/
@PostMapping("/makeStorageList")
@ResponseBody
public TableDataInfo makeStorageList(WarehouseStorageOrder storageOrder)
{ {
startPage(); startPage();
List<WarehouseStorageOrder> list = storageOrderService.selectWarehouseStorageOrderList(storageOrder); List<WarehouseStorageOrder> list = storageOrderService.selectWarehouseStorageOrderList(storageOrder);
@ -78,11 +91,20 @@ public class ErpInboundOrderController extends BaseController
@Log(title = "入库单", businessType = BusinessType.EXPORT) @Log(title = "入库单", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(QualityOrder qualityOrder) public AjaxResult export(WarehouseStorageOrder storageOrder,String ids)
{ {
List<QualityOrder> list = qualityOrderService.selectAllMakeQualityOrderList(qualityOrder); storageOrder.setWarehouseOrderType("1");
ExcelUtil<QualityOrder> util = new ExcelUtil<QualityOrder>(QualityOrder.class); storageOrder.setWarehouseStorageType("5");
if (StringUtils.isEmpty(ids)){
List<WarehouseStorageOrder> list = storageOrderService.selectWarehouseStorageOrderList(storageOrder);
ExcelUtil<WarehouseStorageOrder> util = new ExcelUtil<WarehouseStorageOrder>(WarehouseStorageOrder.class);
return util.exportExcel(list, "入库单数据"); return util.exportExcel(list, "入库单数据");
}else {
String[] storageCodes = ids.split(",");
List<WarehouseStorageOrder> list = storageOrderService.selectStorageOrderListByCodes(storageCodes);
ExcelUtil<WarehouseStorageOrder> util = new ExcelUtil<WarehouseStorageOrder>(WarehouseStorageOrder.class);
return util.exportExcel(list, ids);
}
} }
/** /**

3
ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderMapper.java

@ -144,4 +144,7 @@ public interface WarehouseStorageOrderMapper
* 查询委外入库通知单列表数据 * 查询委外入库通知单列表数据
* */ * */
List<WarehouseStorageOrder> selectOutsourceStorageOrderList(WarehouseStorageOrder warehouseStorageOrder); List<WarehouseStorageOrder> selectOutsourceStorageOrderList(WarehouseStorageOrder warehouseStorageOrder);
//根据入库单号批量查询
List<WarehouseStorageOrder> selectStorageOrderListByCodes(String[] ids);
} }

3
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java

@ -150,4 +150,7 @@ public interface IWarehouseStorageOrderService
* 修改保存入库-采购单(仓库入库) * 修改保存入库-采购单(仓库入库)
*/ */
int updateStoragePurchaseWarehouseSave(WarehouseStorageOrder warehouseStorageOrder); int updateStoragePurchaseWarehouseSave(WarehouseStorageOrder warehouseStorageOrder);
//根据入库单号批量查询
List<WarehouseStorageOrder> selectStorageOrderListByCodes(String[] ids);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java

@ -1462,5 +1462,10 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
return warehouseStorageOrderMapper.restoreWarehouseStorageOrderById(warehouseStorageId); return warehouseStorageOrderMapper.restoreWarehouseStorageOrderById(warehouseStorageId);
} }
//根据入库单号批量查询
@Override
public List<WarehouseStorageOrder> selectStorageOrderListByCodes(String[] ids){
return warehouseStorageOrderMapper.selectStorageOrderListByCodes(ids);
}
} }

11
ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseStorageOrderMapper.xml

@ -53,7 +53,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="warehouseStorageCode != null and warehouseStorageCode != ''"> and warehouse_storage_code like concat('%', #{warehouseStorageCode}, '%')</if> <if test="warehouseStorageCode != null and warehouseStorageCode != ''"> and warehouse_storage_code like concat('%', #{warehouseStorageCode}, '%')</if>
<if test="relatedOrderCode != null and relatedOrderCode != ''"> and related_order_code like concat('%', #{relatedOrderCode}, '%')</if> <if test="relatedOrderCode != null and relatedOrderCode != ''"> and related_order_code like concat('%', #{relatedOrderCode}, '%')</if>
<if test="qualityOrderCode != null and qualityOrderCode != ''"> and quality_order_code like concat('%', #{qualityOrderCode}, '%')</if>
<if test="warehouseStorageStatus != null and warehouseStorageStatus != ''"> and warehouse_storage_status = #{warehouseStorageStatus}</if> <if test="warehouseStorageStatus != null and warehouseStorageStatus != ''"> and warehouse_storage_status = #{warehouseStorageStatus}</if>
<if test="warehouseOrderType != null and warehouseOrderType != ''"> and warehouse_order_type = #{warehouseOrderType}</if>
<if test="warehouseQualityStatus != null and warehouseQualityStatus != ''"> and warehouse_quality_status = #{warehouseQualityStatus}</if> <if test="warehouseQualityStatus != null and warehouseQualityStatus != ''"> and warehouse_quality_status = #{warehouseQualityStatus}</if>
<if test="warehouseDeptType != null and warehouseDeptType != ''"> and warehouse_dept_type = #{warehouseDeptType}</if> <if test="warehouseDeptType != null and warehouseDeptType != ''"> and warehouse_dept_type = #{warehouseDeptType}</if>
<if test="warehouseEmployee != null and warehouseEmployee != ''"> and warehouse_employee = #{warehouseEmployee}</if> <if test="warehouseEmployee != null and warehouseEmployee != ''"> and warehouse_employee = #{warehouseEmployee}</if>
@ -289,4 +291,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
<select id="selectStorageOrderListByCodes" parameterType="String" resultMap="WarehouseStorageOrderResult">
<include refid="selectWarehouseStorageOrderVo"/>
where warehouse_storage_code in
<foreach item="warehouseStorageCode" collection="array" open="(" separator="," close=")">
#{warehouseStorageCode}
</foreach>
</select>
</mapper> </mapper>

35
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

@ -16,11 +16,11 @@
</li> </li>
<li> <li>
<label>入库单号:</label> <label>入库单号:</label>
<input type="text" name="inStorageCode"/> <input type="text" name="warehouseStorageCode"/>
</li> </li>
<li> <li>
<label>品质状态:</label> <label>品质状态:</label>
<select name="qualityStatus" th:with="type=${@dict.getType('qualityStatus')}"> <select name="warehouseQualityStatus" th:with="type=${@dict.getType('qualityStatus')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
@ -29,10 +29,6 @@
<label>关联订单号:</label> <label>关联订单号:</label>
<input type="text" name="relatedOrderCode"/> <input type="text" name="relatedOrderCode"/>
</li> </li>
<li>
<label>品质员:</label>
<input type="text" name="qualityEmployee"/>
</li>
<li class="select-time"> <li class="select-time">
<label>录入时间:</label> <label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/> <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
@ -49,7 +45,7 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:inboundOrder:export"> <a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="erp:inboundOrder:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
</div> </div>
@ -74,7 +70,7 @@
$(function() { $(function() {
var options = { var options = {
url: prefix + "/list", url: prefix + "/makeStorageList",
createUrl: prefix + "/add", createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
detailUrl: prefix + "/detail/{id}", detailUrl: prefix + "/detail/{id}",
@ -185,6 +181,29 @@
var url = ctx + 'warehouse/storageOrder/storageMakeDetail/' + warehouseStorageId; var url = ctx + 'warehouse/storageOrder/storageMakeDetail/' + warehouseStorageId;
$.modal.open("详情",url); $.modal.open("详情",url);
}; };
// 导出
function exportExcel() {
var ids = $.table.selectColumns("warehouseStorageCode");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出 ${ids} 数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.confirm(tipMsg, function () {
$.modal.loading("正在导出数据,请稍后...");
$.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);
}
$.modal.closeLoading();
});
});
}
</script> </script>
</body> </body>
</html> </html>

2
ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html

@ -65,7 +65,7 @@
$(function(){ $(function(){
var options = { var options = {
url: ctx + "system/makeorderbom/list", url: ctx + "system/makeorderbom/storageList",
id: 'bootstrap-sub-table-1', id: 'bootstrap-sub-table-1',
showSearch: false, showSearch: false,
showRefresh: false, showRefresh: false,

Loading…
Cancel
Save