diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java index 7f539730..9e06c07c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java @@ -1,15 +1,13 @@ package com.ruoyi.aftersales.controller; import java.util.List; + +import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail; 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.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.aftersales.domain.AftersalesOutOrder; @@ -148,4 +146,132 @@ public class AftersalesOutOrderController extends BaseController } + /** + * 售后第一次维护设备 + */ + @GetMapping("/maintenanceEquipmentOne/{outOrderId}") + public String maintenanceEquipmentOne(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) + { + AftersalesOutOrder aftersalesOutOrder = aftersalesOutOrderService.selectAftersalesOutOrderById(outOrderId); + mmap.put("aftersalesOutOrder", aftersalesOutOrder); + return prefix + "/maintenanceEquipmentOne"; + } + + /** + * 修改保存售后第一次维护设备 + */ + @RequiresPermissions("aftersales:aftersalesOutOrder:maintenanceEquipmentOne") + @Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) + @PostMapping("/maintenanceEquipmentOne") + @ResponseBody + public AjaxResult maintenanceEquipmentOneSave(@RequestBody AftersalesOutOrder aftersalesOutOrder) + { + return toAjax(aftersalesOutOrderService.updateMaintenanceEquipmentOne(aftersalesOutOrder)); + } + + + /** + * 展示售后第一次维护设备需要维护出货物料信息 + * */ + @PostMapping("/getNeedShippingDeviceMaterialsOne") + @ResponseBody + public TableDataInfo getNeedShippingDeviceMaterialsOne(AftersalesOutOrder aftersalesOutOrder) + { + + startPage(); + List list = aftersalesOutOrderService.getNeedShippingDeviceMaterialsOne(aftersalesOutOrder); + return getDataTable(list); + } + + + /** + * 展示售后第一次维护设备不需要维护出货物料信息 + * */ + @PostMapping("/getNoShippingDeviceMaterialsOne") + @ResponseBody + public TableDataInfo getNoShippingDeviceMaterialsOne(AftersalesOutOrder aftersalesOutOrder) + { + + startPage(); + List list = aftersalesOutOrderService.getNoShippingDeviceMaterialsOne(aftersalesOutOrder); + return getDataTable(list); + } + +// +// /** +// * 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息 +// */ +// @PostMapping("/showAftersalesShippingDeviceListOne") +// @ResponseBody +// public TableDataInfo showAftersalesShippingDeviceListOne(@RequestParam("materialNo") String materialNo, +// @RequestParam("salesOrderCode") String salesOrderCode, +// @RequestParam("makeNo") String makeNo) +// { +// +// startPage(); +// List list = aftersalesOutOrderService.showAftersalesShippingDeviceList(materialNo,salesOrderCode,makeNo); +// return getDataTable(list); +// } +// +// +// +// +// /** +// * 售后第一次维护设备 添加出货设备信息 +// */ +// @GetMapping("/addShippingDevicesOne") +// public String addShippingDevicesOne(@RequestParam("outOrderDetailId") Long outOrderDetailId, +// @RequestParam("salesOrderCode") String salesOrderCode, +// @RequestParam("makeNo") String makeNo, +// ModelMap mmap) +// { +// WarehouseOutOrderDetail warehouseOutOrderDetail = outOrderDetailService.selectWarehouseOutOrderDetailById(outOrderDetailId); +// mmap.put("salesOrderCode",salesOrderCode); +// mmap.put("makeNo",makeNo); +// mmap.put("warehouseOutOrderDetail", warehouseOutOrderDetail); +// return prefix + "/addShippingDevicesOne"; +// } +// +// /** +// * 修改保存售后第一次维护设备 添加出货设备信息 +// */ +// @ResponseBody +// @PostMapping("/addShippingDevicesOne") +// public AjaxResult addShippingDevicesOneSave(@RequestBody WarehouseOutOrderDetail warehouseOutOrderDetail) +// { +// +// return toAjax(outOrderDetailService.addShippingDevicesOne(warehouseOutOrderDetail)); +// } +// +// +// +// /** +// * 展示售后第一次维护设备添加出货设备料号相关出货设备信息 +// */ +// @PostMapping("/getAllMaterialShippingDevices") +// @ResponseBody +// public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrderDetail warehouseOutOrderDetail) +// { +// +// startPage(); +// List list = aftersalesOutOrderService.selectAftersalesShippingDeviceList(warehouseOutOrderDetail); +// return getDataTable(list); +// } +// +// +// +// /** +// * 第一次维护设备删除物料信息出货设备信息 +// */ +// @Log(title = "售后维护设备出库", businessType = BusinessType.DELETE) +// @PostMapping("/deleteRow") +// @ResponseBody +// public AjaxResult deleteRow(String shippingDeviceId) +// { +// return toAjax(aftersalesOutOrderService.deleteAftersalesShippingDeviceById(shippingDeviceId)); +// } + + + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOutOrderDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOutOrderDetailMapper.java index 7a93f0ed..70bff156 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOutOrderDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOutOrderDetailMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.aftersales.mapper; import java.util.List; import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail; + /** * 售后维护设备出库详情Mapper接口 * @@ -80,4 +81,8 @@ public interface AftersalesOutOrderDetailMapper * */ int insertBatchAftersalesOutOrderDetail(List aftersalesOutOrderDetails); + /** + * 根据出库单号查询详情集合 + * */ + List selectDetailListByOutOrderCode(String outOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java index 05ca9a82..afb4f4c2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java @@ -2,6 +2,7 @@ package com.ruoyi.aftersales.service; import java.util.List; import com.ruoyi.aftersales.domain.AftersalesOutOrder; +import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail; /** * 售后维护设备出库Service接口 @@ -72,4 +73,26 @@ public interface IAftersalesOutOrderService * @return */ int restoreAftersalesOutOrderById(Long outOrderId); + + /** + * 修改保存售后第一次维护设备出库 + * @param aftersalesOutOrder + * @return + */ + int updateMaintenanceEquipmentOne(AftersalesOutOrder aftersalesOutOrder); + + + /** + * 展示售后第一次维护设备需要维护出货物料信息 + * @param aftersalesOutOrder + * @return + */ + List getNeedShippingDeviceMaterialsOne(AftersalesOutOrder aftersalesOutOrder); + + /** + * 展示售后第一次维护设备不需要维护出货物料信息 + * @param aftersalesOutOrder + * @return + */ + List getNoShippingDeviceMaterialsOne(AftersalesOutOrder aftersalesOutOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java index 212db251..1a777275 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java @@ -1,6 +1,10 @@ package com.ruoyi.aftersales.service.impl; import java.util.List; +import java.util.stream.Collectors; + +import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail; +import com.ruoyi.aftersales.mapper.AftersalesOutOrderDetailMapper; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -22,6 +26,9 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService @Autowired private AftersalesOutOrderMapper aftersalesOutOrderMapper; + @Autowired + private AftersalesOutOrderDetailMapper aftersalesOutOrderDetailMapper; + /** * 查询售后维护设备出库 * @@ -123,4 +130,45 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService { return aftersalesOutOrderMapper.restoreAftersalesOutOrderById(outOrderId); } + + + /** + * 修改保存售后第一次维护设备出库 + * @param aftersalesOutOrder + * @return + */ + @Override + public int updateMaintenanceEquipmentOne(AftersalesOutOrder aftersalesOutOrder) { + return 0; + } + + /** + * 展示售后第一次维护设备需要维护出货物料信息 + * @param aftersalesOutOrder + * @return + */ + @Override + public List getNeedShippingDeviceMaterialsOne(AftersalesOutOrder aftersalesOutOrder) { + String outOrderCode = aftersalesOutOrder.getOutOrderCode(); + List list = aftersalesOutOrderDetailMapper.selectDetailListByOutOrderCode(outOrderCode); + //只保留成品 + List filterList = list.stream().filter(item -> "chcpsb".equals(item.getMaterialType())).collect(Collectors.toList()); + return filterList; + } + + + /** + * 展示售后第一次维护设备不需要维护出货物料信息 + * @param aftersalesOutOrder + * @return + */ + @Override + public List getNoShippingDeviceMaterialsOne(AftersalesOutOrder aftersalesOutOrder) { + String outOrderCode = aftersalesOutOrder.getOutOrderCode(); + List list = aftersalesOutOrderDetailMapper.selectDetailListByOutOrderCode(outOrderCode); + //过滤掉成品 + List filterList = list.stream().filter(item -> !"chcpsb".equals(item.getMaterialType())).collect(Collectors.toList()); + return filterList; + + } } diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOutOrderDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOutOrderDetailMapper.xml index 6c5938b6..07e86a25 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOutOrderDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOutOrderDetailMapper.xml @@ -71,7 +71,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where out_order_detail_id = #{outOrderDetailId} - + + + insert into aftersales_out_order_detail diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html index 784e1b35..80bf0888 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html @@ -210,6 +210,15 @@ }; $.table.init(options); }); + + + + /*售后第一次维护设备*/ + function maintenanceEquipmentOne(outOrderId) { + var url = ctx + 'aftersales/aftersalesOutOrder/maintenanceEquipmentOne/'+outOrderId; + $.modal.open("售后第一次维护设备",url); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html new file mode 100644 index 00000000..b1a5152c --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html @@ -0,0 +1,476 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+

需要维护出货设备信息

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

无需维护出货设备信息

+
+
+
+
+
+
+
+ + + +
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html index 9c973cfd..a7a69998 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html @@ -386,14 +386,14 @@ return '申请出货数不能为空'; } if (isNaN(value)) { - return '申请出货数不能为空'; + return '请输入有效的数字'; } - if (value < 0) { - return '申请出货数不能为空'; + if (value <= 0) { + return '申请出货数必须大于0'; } //不能为小数 if (value % 1 !== 0) { - return '申请出货数不能为空'; + return '申请出货数不能为小数'; } }, }, diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html index 048aca10..94baca9d 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html @@ -128,6 +128,8 @@ "materialBrand": item.materialBrand, "materialUnit": item.materialUnit, "materialProcessMethod": item.materialProcessMethod, + "makeNum": item.makeNum, + "hasOutOrderSum": item.hasOutOrderSum, "applyOutOrderSum": item.applyOutOrderSum, "prepareOutOrderSum": item.prepareOutOrderSum, // ...其他字段