diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceStorageOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceStorageOrderController.java new file mode 100644 index 00000000..269823bc --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceStorageOrderController.java @@ -0,0 +1,126 @@ +package com.ruoyi.system.controller; + +import java.util.List; + +import com.ruoyi.system.service.IOutsourceStorageOrderService; +import com.ruoyi.warehouse.domain.WarehouseStorageOrder; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 委外入库Controller + * + * @author ruoyi + * @date 2024-07-14 + */ +@Controller +@RequestMapping("/system/outsource_storage") +public class OutsourceStorageOrderController extends BaseController +{ + private String prefix = "system/outsource_storage"; + + @Autowired + private IOutsourceStorageOrderService outsourceStorageOrderService ; + + @RequiresPermissions("system:storage:view") + @GetMapping() + public String storage() + { + return prefix + "/storage"; + } + + /** + * 查询委外入库列表 + */ + @RequiresPermissions("system:storage:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(WarehouseStorageOrder warehouseStorageOrder) + { + startPage(); + List list = outsourceStorageOrderService.selectWarehouseStorageOrderList(warehouseStorageOrder); + return getDataTable(list); + } + + /** + * 导出委外入库列表 + */ + @RequiresPermissions("system:storage:export") + @Log(title = "委外入库", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(WarehouseStorageOrder warehouseStorageOrder) + { + List list = outsourceStorageOrderService.selectWarehouseStorageOrderList(warehouseStorageOrder); + ExcelUtil util = new ExcelUtil(WarehouseStorageOrder.class); + return util.exportExcel(list, "委外入库数据"); + } + + /** + * 新增委外入库 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存委外入库 + */ + @RequiresPermissions("system:storage:add") + @Log(title = "委外入库", businessType = BusinessType.INSERT) + @PostMapping("/addStorage") + @ResponseBody + public AjaxResult addSave(@RequestBody WarehouseStorageOrder warehouseStorageOrder) + { + System.out.println(warehouseStorageOrder); + return toAjax(outsourceStorageOrderService.insertWarehouseStorageOrder(warehouseStorageOrder)); + } + + /** + * 修改委外入库 + */ + @RequiresPermissions("system:storage:edit") + @GetMapping("/edit/{warehouseStorageId}") + public String edit(@PathVariable("warehouseStorageId") Long warehouseStorageId, ModelMap mmap) + { + WarehouseStorageOrder warehouseStorageOrder = outsourceStorageOrderService.selectWarehouseStorageOrderByWarehouseStorageId(warehouseStorageId); + mmap.put("warehouseStorageOrder", warehouseStorageOrder); + return prefix + "/edit"; + } + + /** + * 修改保存委外入库 + */ + @RequiresPermissions("system:storage:edit") + @Log(title = "委外入库", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(WarehouseStorageOrder warehouseStorageOrder) + { + return toAjax(outsourceStorageOrderService.updateWarehouseStorageOrder(warehouseStorageOrder)); + } + + /** + * 删除委外入库 + */ + @RequiresPermissions("system:storage:remove") + @Log(title = "委外入库", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(outsourceStorageOrderService.deleteWarehouseStorageOrderByWarehouseStorageIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceStorageOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceStorageOrderService.java new file mode 100644 index 00000000..eaa21efd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceStorageOrderService.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.service; + + +import com.ruoyi.warehouse.domain.WarehouseStorageOrder; + +import java.util.List; + +/** + * 委外入库Service接口 + * + * @author ruoyi + * @date 2024-07-14 + */ +public interface IOutsourceStorageOrderService +{ + /** + * 查询委外入库 + * + * @param warehouseStorageId 委外入库主键 + * @return 委外入库 + */ + public WarehouseStorageOrder selectWarehouseStorageOrderByWarehouseStorageId(Long warehouseStorageId); + + /** + * 查询委外入库列表 + * + * @param warehouseStorageOrder 委外入库 + * @return 委外入库集合 + */ + public List selectWarehouseStorageOrderList(WarehouseStorageOrder warehouseStorageOrder); + + /** + * 新增委外入库 + * + * @param warehouseStorageOrder 委外入库 + * @return 结果 + */ + public int insertWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder); + + /** + * 修改委外入库 + * + * @param warehouseStorageOrder 委外入库 + * @return 结果 + */ + public int updateWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder); + + /** + * 批量删除委外入库 + * + * @param warehouseStorageIds 需要删除的委外入库主键集合 + * @return 结果 + */ + public int deleteWarehouseStorageOrderByWarehouseStorageIds(String warehouseStorageIds); + + /** + * 删除委外入库信息 + * + * @param warehouseStorageId 委外入库主键 + * @return 结果 + */ + public int deleteWarehouseStorageOrderByWarehouseStorageId(Long warehouseStorageId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceStorageOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceStorageOrderServiceImpl.java new file mode 100644 index 00000000..10cbac74 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceStorageOrderServiceImpl.java @@ -0,0 +1,133 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.service.IOutsourceStorageOrderService; +import com.ruoyi.warehouse.domain.WarehouseStorageOrder; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; +import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.stream.Collectors; + +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.common.core.text.Convert; + +/** + * 委外入库Service业务层处理 + * + * @author ruoyi + * @date 2024-07-14 + */ +@Service +public class OutsourceStorageOrderServiceImpl implements IOutsourceStorageOrderService +{ + @Autowired + private WarehouseStorageOrderMapper warehouseStorageOrderMapper; + + + @Override + public WarehouseStorageOrder selectWarehouseStorageOrderByWarehouseStorageId(Long warehouseStorageId) { + return warehouseStorageOrderMapper.selectWarehouseStorageOrderById(warehouseStorageId); + } + + @Override + public List selectWarehouseStorageOrderList(WarehouseStorageOrder warehouseStorageOrder) { + //得到订单类型为委外订单的数据 + List warehouseStorageOrders = warehouseStorageOrderMapper.selectOutsourceStorageOrderList(warehouseStorageOrder); + + return warehouseStorageOrders; + } + + /** + * 新增委外入库 + * + * @param warehouseStorageOrder 委外入库 + * @return 结果 + */ + @Transactional + @Override + public int insertWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder) + { + warehouseStorageOrder.setCreateTime(DateUtils.getNowDate()); + warehouseStorageOrder.setWarehouseOrderType("3"); + warehouseStorageOrder.setWarehouseStorageType("4"); + warehouseStorageOrder.setWarehouseStorageCode("RK20231102002"); + warehouseStorageOrder.setCreateBy("张三"); + int rows = warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder); + insertWarehouseStorageOrderDetail(warehouseStorageOrder); + return rows; + } + + /** + * 修改委外入库 + * + * @param warehouseStorageOrder 委外入库 + * @return 结果 + */ + @Transactional + @Override + public int updateWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder) + { + warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate()); + warehouseStorageOrderMapper.deleteWarehouseStorageOrderDetailByWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageId()); + insertWarehouseStorageOrderDetail(warehouseStorageOrder); + return warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder); + } + + /** + * 批量删除委外入库 + * + * @param warehouseStorageIds 需要删除的委外入库主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteWarehouseStorageOrderByWarehouseStorageIds(String warehouseStorageIds) + { + warehouseStorageOrderMapper.deleteWarehouseStorageOrderDetailByWarehouseStorageCodes(Convert.toStrArray(warehouseStorageIds)); + return warehouseStorageOrderMapper.deleteWarehouseStorageOrderByWarehouseStorageIds(Convert.toStrArray(warehouseStorageIds)); + } + + /** + * 删除委外入库信息 + * + * @param warehouseStorageId 委外入库主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteWarehouseStorageOrderByWarehouseStorageId(Long warehouseStorageId) + { + warehouseStorageOrderMapper.deleteWarehouseStorageOrderDetailByWarehouseStorageCode(warehouseStorageId); + return warehouseStorageOrderMapper.deleteWarehouseStorageOrderByWarehouseStorageId(warehouseStorageId); + } + + /** + * 新增仓库入库单详情信息 + * + * @param warehouseStorageOrder 委外入库对象 + */ + public void insertWarehouseStorageOrderDetail(WarehouseStorageOrder warehouseStorageOrder) + { + List warehouseStorageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList(); + String warehouseStorageCode = warehouseStorageOrder.getWarehouseStorageCode(); + if (StringUtils.isNotNull(warehouseStorageOrderDetailList)) + { + List list = new ArrayList(); + for (WarehouseStorageOrderDetail warehouseStorageOrderDetail : warehouseStorageOrderDetailList) + { + warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode); + warehouseStorageOrderDetail.setWarehouseOrderType("3"); + list.add(warehouseStorageOrderDetail); + } + if (list.size() > 0) + { + warehouseStorageOrderMapper.batchWarehouseStorageOrderDetail(list); + } + } + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderMapper.java index 55ff6f61..922f9387 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderMapper.java @@ -95,4 +95,52 @@ public interface WarehouseStorageOrderMapper */ public int restoreWarehouseStorageOrderById(Long warehouseStorageId); + + //以下是委外相关接口 + /** + * 删除委外入库 + * + * @param warehouseStorageId 委外入库主键 + * @return 结果 + */ + public int deleteWarehouseStorageOrderByWarehouseStorageId(Long warehouseStorageId); + + /** + * 批量删除委外入库 + * + * @param warehouseStorageIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWarehouseStorageOrderByWarehouseStorageIds(String[] warehouseStorageIds); + + /** + * 批量删除仓库入库单详情 + * + * @param warehouseStorageIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWarehouseStorageOrderDetailByWarehouseStorageCodes(String[] warehouseStorageIds); + + /** + * 批量新增仓库入库单详情 + * + * @param warehouseStorageOrderDetailList 仓库入库单详情列表 + * @return 结果 + */ + public int batchWarehouseStorageOrderDetail(List warehouseStorageOrderDetailList); + + + /** + * 通过委外入库主键删除仓库入库单详情信息 + * + * @param warehouseStorageId 委外入库ID + * @return 结果 + */ + public int deleteWarehouseStorageOrderDetailByWarehouseStorageCode(Long warehouseStorageId); + + + /** + * 查询委外入库通知单列表数据 + * */ + List selectOutsourceStorageOrderList(WarehouseStorageOrder warehouseStorageOrder); } diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseStorageOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseStorageOrderMapper.xml index 00381439..ed791f7c 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseStorageOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseStorageOrderMapper.xml @@ -237,4 +237,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update warehouse_storage_order set del_flag = '0' where warehouse_storage_id = #{warehouseStorageId} + + + + delete from warehouse_storage_order where warehouse_storage_id = #{warehouseStorageId} + + + + delete from warehouse_storage_order where warehouse_storage_id in + + #{warehouseStorageId} + + + + + delete from warehouse_storage_order_detail where warehouse_storage_code in + + #{warehouseStorageCode} + + + + + delete from warehouse_storage_order_detail where warehouse_storage_code = #{warehouseStorageCode} + + + + insert into warehouse_storage_order_detail( warehouse_storage_detail_id, warehouse_storage_code, related_order_code, warehouse_storage_status, warehouse_quality_status, warehouse_storage_type, warehouse_storage_class, warehouse_order_type, warehouse_dept_type, warehouse_employee, warehouse_code, warehouse_name, warehouse_detail_address, supplier_code, supplier_name, customer_contact, contact_number, supplier_address, customer_id, customer_name, customer_contact_people, customer_contact_number, customer_company_address, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, material_dept_type, make_total, notify_has_arrived_num, notify_arrive_num, actual_has_arrived_num, actual_arrive_num, temporary_has_qualified_num, temporary_qualified_num, has_storage_num, storage_num, make_storage_num, quality_has_qualified_num, quality_qualified_num, refunds_exchanges_num, arrived_time, temporary_time, delivery_inspection_time, quality_time, storage_time, storage_location, temporary_remark, temporary_report_url, create_time, create_by, update_by, update_time) values + + ( #{item.warehouseStorageDetailId}, #{item.warehouseStorageCode}, #{item.relatedOrderCode}, #{item.warehouseStorageStatus}, #{item.warehouseQualityStatus}, #{item.warehouseStorageType}, #{item.warehouseStorageClass}, #{item.warehouseOrderType}, #{item.warehouseDeptType}, #{item.warehouseEmployee}, #{item.warehouseCode}, #{item.warehouseName}, #{item.warehouseDetailAddress}, #{item.supplierCode}, #{item.supplierName}, #{item.customerContact}, #{item.contactNumber}, #{item.supplierAddress}, #{item.customerId}, #{item.customerName}, #{item.customerContactPeople}, #{item.customerContactNumber}, #{item.customerCompanyAddress}, #{item.materialNo}, #{item.materialName}, #{item.materialType}, #{item.materialPhotourl}, #{item.materialBrand}, #{item.materialUnit}, #{item.materialDescribe}, #{item.materialProcessMethod}, #{item.materialDeptType}, #{item.makeTotal}, #{item.notifyHasArrivedNum}, #{item.notifyArriveNum}, #{item.actualHasArrivedNum}, #{item.actualArriveNum}, #{item.temporaryHasQualifiedNum}, #{item.temporaryQualifiedNum}, #{item.hasStorageNum}, #{item.storageNum}, #{item.makeStorageNum}, #{item.qualityHasQualifiedNum}, #{item.qualityQualifiedNum}, #{item.refundsExchangesNum}, #{item.arrivedTime}, #{item.temporaryTime}, #{item.deliveryInspectionTime}, #{item.qualityTime}, #{item.storageTime}, #{item.storageLocation}, #{item.temporaryRemark}, #{item.temporaryReportUrl}, #{item.createTime}, #{item.createBy}, #{item.updateBy}, #{item.updateTime}) + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_storage/add.html b/ruoyi-admin/src/main/resources/templates/system/outsource_storage/add.html new file mode 100644 index 00000000..88d7f194 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_storage/add.html @@ -0,0 +1,817 @@ + + + + + + + +
+
+

委外入库信息

+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+

仓库入库单详情信息

+
+
+ + +
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_storage/edit.html b/ruoyi-admin/src/main/resources/templates/system/outsource_storage/edit.html new file mode 100644 index 00000000..1f0c8318 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_storage/edit.html @@ -0,0 +1,874 @@ + + + + + + + +
+
+

委外入库信息

+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+

仓库入库单详情信息

+
+
+ + +
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_storage/storage.html b/ruoyi-admin/src/main/resources/templates/system/outsource_storage/storage.html new file mode 100644 index 00000000..e9cc633f --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_storage/storage.html @@ -0,0 +1,207 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file