添加 出库单据出口选择 盘点单据粗口选择功能

This commit is contained in:
liuhanqing
2025-07-10 17:40:16 +08:00
parent 8e3f72e0ae
commit 745ba9e49d
10 changed files with 306 additions and 25 deletions

View File

@@ -11,6 +11,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.bas.BasProduct.service.IBasProductService;
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
@@ -102,24 +103,30 @@ public class CheckStockinServiceImpl implements ICheckStockinService
public AjaxResult updateCheckStockin(CheckStockin checkStockin)
{
CheckStockin old = selectCheckStockinByStockGuid(checkStockin.getStockGuid());
checkStockinMapper.updateCheckStockin(checkStockin);
if ("5".equals(checkStockin.getStatus())){
//作废
if (!"1".equals(old.getStatus())){
throw new RuntimeException("单据状态非未执行状态!");
return AjaxResult.error("单据状态非未执行状态!");
}
checkStockinMapper.updateCheckStockin(checkStockin);
//插入历史单据
insertCheckStockinHistory(checkStockin);
}else if ("2".equals(checkStockin.getStatus())){
if (StrUtil.isEmpty(checkStockin.getSpare1())){
return AjaxResult.error("请选择出口!");
}
//审核
if (!"1".equals(old.getStatus())){
throw new RuntimeException("单据状态非未执行状态!");
return AjaxResult.error("单据状态非未执行状态!");
}
checkStockinMapper.updateCheckStockin(checkStockin);
}else if ("4".equals(checkStockin.getStatus())){
//确认
if (!"3".equals(old.getStatus())){
throw new RuntimeException("单据状态非正执行状态!");
return AjaxResult.error("单据状态非正执行状态!");
}
checkStockinMapper.updateCheckStockin(checkStockin);
insertCheckStockinHistory(checkStockin);
}
return AjaxResult.success();

View File

@@ -124,11 +124,16 @@ public class OutStockoutController extends BaseController {
@Log(title = "出库主单状态改变", businessType = BusinessType.OTHER)
@RequestMapping("/changeStatus")
@ResponseBody
public String changeStatus(@RequestParam("stockoutIds") String[] stockoutIds, @RequestParam("status") String status,@RequestParam("newStatus")String newStatus) {
String s = outStockoutService.updateOutStockoutStatus(stockoutIds, status, newStatus);
public String changeStatus(@RequestParam("stockoutIds") String[] stockoutIds, @RequestParam("status") String status,@RequestParam("newStatus")String newStatus,@RequestParam(value = "exitId",required = false)String exitId) {
String s = outStockoutService.updateOutStockoutStatus(stockoutIds, status, newStatus,exitId);
return s;
}
/**
* 自动出库
* @param stockoutId
* @return
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:autoAllot')")
@Log(title = "出库单自动分配", businessType = BusinessType.OTHER)
@GetMapping("/autoAllot")

View File

@@ -8,15 +8,15 @@ import com.ruoyi.out.outStockout.domain.OutStockoutVo;
/**
* 出库主单Service接口
*
*
* @author ruoyi
* @date 2025-05-20
*/
public interface IOutStockoutService
public interface IOutStockoutService
{
/**
* 查询出库主单
*
*
* @param stockoutGuid 出库主单主键
* @return 出库主单
*/
@@ -24,7 +24,7 @@ public interface IOutStockoutService
/**
* 查询出库主单列表
*
*
* @param outStockout 出库主单
* @return 出库主单集合
*/
@@ -32,7 +32,7 @@ public interface IOutStockoutService
/**
* 新增出库主单
*
*
* @param outStockout 出库主单
* @return 结果
*/
@@ -40,7 +40,7 @@ public interface IOutStockoutService
/**
* 修改出库主单
*
*
* @param outStockout 出库主单
* @return 结果
*/
@@ -48,7 +48,7 @@ public interface IOutStockoutService
/**
* 批量删除出库主单
*
*
* @param stockoutGuids 需要删除的出库主单主键集合
* @return 结果
*/
@@ -56,7 +56,7 @@ public interface IOutStockoutService
/**
* 删除出库主单信息
*
*
* @param stockoutGuid 出库主单主键
* @return 结果
*/
@@ -66,7 +66,7 @@ public interface IOutStockoutService
*/
public String saveBill(OutStockoutVo outStockoutVo);
public String updateOutStockoutStatus(String[] stockoutIds, String status,String newStatus);
public String updateOutStockoutStatus(String[] stockoutIds, String status,String newStatus,String exitId);
AjaxResult autoAllot(String stockoutId);
}

View File

@@ -142,13 +142,14 @@ public class OutStockoutServiceImpl implements IOutStockoutService
}
@Override
public String updateOutStockoutStatus(String[] stockoutIds, String status, String newStatus) {
public String updateOutStockoutStatus(String[] stockoutIds, String status, String newStatus,String exitId) {
HashMap<String, String> map = new HashMap<>();
StringBuilder stringBuilder = new StringBuilder();
for(String stockoutId:stockoutIds){
map.put("outStockId",stockoutId);
map.put("status",status);
map.put("newStatus",newStatus);
map.put("exitId",exitId);
outStockoutMapper.updateOutStockoutStatus(map);
stringBuilder.append(",").append(map.get("v_resultString"));
}

View File

@@ -152,6 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{outStockId,mode=IN,jdbcType=VARCHAR},
#{status,mode=IN,jdbcType=VARCHAR},
#{newStatus,mode=IN,jdbcType=VARCHAR},
#{exitId,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=VARCHAR},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}
)