diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsProductOutstockController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsProductOutstockController.java index 893c5c5..760e2db 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsProductOutstockController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsProductOutstockController.java @@ -3,7 +3,10 @@ package com.hw.wms.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; + +import com.hw.wms.domain.vo.WmsProductOutstockAuditVo; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -102,4 +105,40 @@ public class WmsProductOutstockController extends BaseController { return toAjax(wmsProductOutstockService.deleteWmsProductOutstockByProductOutstockIds(productOutstockIds)); } + + /** + * 查询成品出库记录列表,供审核使用 + * @param wmsProductOutstock + * @return + */ + @RequiresPermissions("wms:productoutstock:audit:list") + @GetMapping("/auditList") + public TableDataInfo auditList(WmsProductOutstock wmsProductOutstock) + { + startPage(); + List list = wmsProductOutstockService.selectWmsProductOutstockListAudit(wmsProductOutstock); + return getDataTable(list); + } + + /** + * 获取成品出库记录详细信息,供审核使用 + * @param productOutstockId + * @return + */ + @RequiresPermissions("wms:productoutstock:audit:query") + @GetMapping(value = "/getProductOutstockAudit/{productOutstockId}") + public AjaxResult getProductOutstockAudit(@PathVariable("productOutstockId") Long productOutstockId) + { + return success(wmsProductOutstockService.selectGetProductOutstockAuditByProductOutstockId(productOutstockId)); + } + + /** + * 审核成品出库记录 + */ + @RequiresPermissions("wms:productoutstock:audit:audit") + @Log(title = "成品出库记录", businessType = BusinessType.AUDIT) + @PostMapping(("/auditProductOutstock")) + public AjaxResult auditProductOutstock(@Validated @RequestBody WmsProductOutstockAuditVo wmsProductOutstockAuditVo) { + return success(wmsProductOutstockService.auditProductOutstock(wmsProductOutstockAuditVo)); + } } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java new file mode 100644 index 0000000..688492d --- /dev/null +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java @@ -0,0 +1,27 @@ +package com.hw.wms.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description: 原材料出库审核VO + * @ClassName: WmsRawOutstockAuditVo + * @Author : xins + * @Date :2023-12-21 16:33 + * @Version :1.0 + */ +@Data +public class WmsProductOutstockAuditVo { + + //审核状态 + @NotBlank(message = "任务编号必须输入") + private String taskCode; + + //审核状态 + @NotBlank(message = "审核状态必须输入") + private String auditStatus; + + //审核意见 + private String auditReason; +} diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductOutstockMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductOutstockMapper.java index 0814237..7a8ecaa 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductOutstockMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductOutstockMapper.java @@ -119,4 +119,26 @@ public interface WmsProductOutstockMapper * @return */ List selectWmsProductOutstockERPNotSynchronized(WmsProductOutstock wmsProductOutstock); + + /** + * 查询成品出库记录列表,供审核使用 + * @param wmsProductOutstock + * @return + */ + List selectWmsProductOutstockListAudit(WmsProductOutstock wmsProductOutstock); + + /** + * 根据任务编号审核成品出库记录 + * + * @param wmsProductOutstock 成品出库记录 + * @return 结果 + */ + public int auditWmsProductOutstockByTaskCode(WmsProductOutstock wmsProductOutstock); + + /** + * 获取成品出库记录详细信息,供审核使用 + * @param productOutstockId + * @return + */ + WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsProductOutstockService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsProductOutstockService.java index b73c4da..c06390b 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsProductOutstockService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsProductOutstockService.java @@ -3,6 +3,7 @@ package com.hw.wms.service; import java.util.List; import com.hw.wms.domain.WmsProductOutstock; import com.hw.wms.domain.vo.WmsProduceInstockVo; +import com.hw.wms.domain.vo.WmsProductOutstockAuditVo; import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo; import org.springframework.transaction.annotation.Transactional; @@ -94,4 +95,26 @@ public interface IWmsProductOutstockService * @return */ public int fourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo); + + /** + * 查询成品出库记录列表,供审核使用 + * @param wmsProductOutstock + * @return + */ + List selectWmsProductOutstockListAudit(WmsProductOutstock wmsProductOutstock); + + /** + * 获取成品出库记录详细信息,供审核使用 + * @param productOutstockId + * @return + */ + WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId); + + /** + * 审核成品出库记录 + * @param wmsProductOutstockAuditVo + * @return + */ + public int auditProductOutstock(WmsProductOutstockAuditVo wmsProductOutstockAuditVo); + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java index e947d38..fce4f83 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java @@ -16,6 +16,7 @@ import com.hw.wms.config.WmsConfig; import com.hw.wms.domain.WmsBaseWarehouse; import com.hw.wms.domain.WmsProductStock; import com.hw.wms.domain.vo.WmsProduceInstockVo; +import com.hw.wms.domain.vo.WmsProductOutstockAuditVo; import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo; import com.hw.wms.mapper.WmsBaseWarehouseMapper; import com.hw.wms.mapper.WmsProductOutstockDetailMapper; @@ -326,6 +327,65 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService } + /** + * 查询成品出库记录列表,供审核使用 + * @param wmsProductOutstock + * @return + */ + @Override + public List selectWmsProductOutstockListAudit(WmsProductOutstock wmsProductOutstock) { + return wmsProductOutstockMapper.selectWmsProductOutstockListAudit(wmsProductOutstock); + } + + /** + * 获取成品出库记录详细信息,供审核使用 + * @param productOutstockId + * @return + */ + @Override + public WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId) { + WmsProductOutstock wmsProductOutstock = wmsProductOutstockMapper.selectGetProductOutstockAuditByProductOutstockId(productOutstockId); + return wmsProductOutstock; + } + + /** + * 审核成品出库记录 + * @param wmsProductOutstockAuditVo + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int auditProductOutstock(WmsProductOutstockAuditVo wmsProductOutstockAuditVo) { + String auditStatus = wmsProductOutstockAuditVo.getAuditStatus(); + String auditReason = wmsProductOutstockAuditVo.getAuditReason(); + String taskCode = wmsProductOutstockAuditVo.getTaskCode(); + Date currentDate = new Date(); + String userName = SecurityUtils.getUsername(); + + WmsProductOutstock queryProductOutstock = new WmsProductOutstock(); + queryProductOutstock.setTaskCode(taskCode); + queryProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT); + List wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock); + if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) { + throw new ServiceException("无待审核成品出库记录"); + } + + //审核不通过,需要有审核意见 + if (auditStatus.equalsIgnoreCase(WmsConstants.WMS_AUDIT_STATUS_FAIL)) { + if (StringUtils.isEmpty(auditReason)) { + throw new ServiceException("请输入审核意见"); + } + } + + WmsProductOutstock wmsProductOutstock = new WmsProductOutstock(); + wmsProductOutstock.setAuditStatus(auditStatus); + wmsProductOutstock.setAuditReason(auditReason); + wmsProductOutstock.setAuditBy(userName); + wmsProductOutstock.setAuditDate(currentDate); + wmsProductOutstock.setTaskCode(taskCode); + return wmsProductOutstockMapper.auditWmsProductOutstockByTaskCode(wmsProductOutstock); + } + private static BigDecimal getAvailableAmount(WmsProductStock productStock) { if (productStock == null) { throw new ServiceException("没有库存信息"); diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml index 5e825b4..50eddeb 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml @@ -325,4 +325,79 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + update wms_product_outstock + + audit_reason = #{auditReason}, + audit_status = #{auditStatus}, + audit_by = #{auditBy}, + audit_date = #{auditDate}, + update_by = #{updateBy}, + update_date = #{updateDate}, + + where task_code = #{taskCode} + + diff --git a/hw-ui/src/api/wms/productoutstock.js b/hw-ui/src/api/wms/productoutstock.js new file mode 100644 index 0000000..61892e6 --- /dev/null +++ b/hw-ui/src/api/wms/productoutstock.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +// 查询成品出库记录列表,提供审核使用 +export function auditListProductoutstock(query) { + return request({ + url: '/wms/productoutstock/auditList', + method: 'get', + params: query + }) +} + +// 获取成品出库记录详细信息,供审核使用 +export function getProductOutstockAudit(productOutstockId) { + return request({ + url: '/wms/productoutstock/getProductOutstockAudit/' + productOutstockId, + method: 'get' + }) +} + +// 审核成品出库记录 +export function auditProductOutstock(data) { + return request({ + url: '/wms/productoutstock/auditProductOutstock', + method: 'post', + data: data + }) +} diff --git a/hw-ui/src/router/index.js b/hw-ui/src/router/index.js index d6d44f7..a0d234f 100644 --- a/hw-ui/src/router/index.js +++ b/hw-ui/src/router/index.js @@ -525,6 +525,21 @@ export const dynamicRoutes = [ ] }, + { + path: '/wms/product-outstock', + component: Layout, + hidden: true, + permissions: ['wms:productoutstock:info'], + children: [ + { + path: 'audit/:taskCode', + component: () => import('@/views/wms/productmanagement/productoutstock/productoutstockDetail'), + name: 'ProductOutStockDetail', + meta: { title: '成品出库审核', activeMenu: '/wms/productmanagement/productoutstock' } + } + ] + }, + { path: '/wms/raw-outstock', component: Layout, diff --git a/hw-ui/src/views/wms/productmanagement/productoutstock/index.vue b/hw-ui/src/views/wms/productmanagement/productoutstock/index.vue new file mode 100644 index 0000000..49fbde6 --- /dev/null +++ b/hw-ui/src/views/wms/productmanagement/productoutstock/index.vue @@ -0,0 +1,288 @@ + + + diff --git a/hw-ui/src/views/wms/productmanagement/productoutstock/productoutstockDetail.vue b/hw-ui/src/views/wms/productmanagement/productoutstock/productoutstockDetail.vue new file mode 100644 index 0000000..6534324 --- /dev/null +++ b/hw-ui/src/views/wms/productmanagement/productoutstock/productoutstockDetail.vue @@ -0,0 +1,276 @@ + + +