Merge remote-tracking branch 'origin/master'

This commit is contained in:
lsymicc
2025-06-04 08:48:51 +08:00
14 changed files with 6932 additions and 862 deletions

View File

@@ -5,17 +5,12 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.convert.Convert;
import com.ruoyi.check.stockcheck.domain.CheckStockVo;
import com.ruoyi.check.stockcheckfinish.service.ICheckStockinFinishService;
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -100,7 +95,7 @@ public class CheckStockinController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody CheckStockin checkStockin)
{
return toAjax(checkStockinService.updateCheckStockin(checkStockin));
return checkStockinService.updateCheckStockin(checkStockin);
}
/**
@@ -113,4 +108,18 @@ public class CheckStockinController extends BaseController
{
return toAjax(checkStockinService.deleteCheckStockinByStockGuids(stockGuids));
}
/**
* 出库单据保存
*
* @param checkStockVo
* @return
*/
@Log(title = "盘点主单保存", businessType = BusinessType.INSERT)
@PostMapping("/saveBill")
@ResponseBody
public AjaxResult saveBill(@RequestBody CheckStockVo checkStockVo) {
String stockOutId = checkStockinService.saveBill(checkStockVo);
return AjaxResult.success(stockOutId);
}
}

View File

@@ -0,0 +1,21 @@
package com.ruoyi.check.stockcheck.domain;
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
import com.ruoyi.out.outStockout.domain.OutStockout;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CheckStockVo {
private CheckStockin checkStockin;
private List<CheckStockinDetail> detailList;
}

View File

@@ -5,15 +5,15 @@ import com.ruoyi.check.stockcheck.domain.CheckStockin;
/**
* 盘库单据主信息Mapper接口
*
*
* @author ruoyi
* @date 2025-05-29
*/
public interface CheckStockinMapper
public interface CheckStockinMapper
{
/**
* 查询盘库单据主信息
*
*
* @param stockGuid 盘库单据主信息主键
* @return 盘库单据主信息
*/
@@ -21,7 +21,7 @@ public interface CheckStockinMapper
/**
* 查询盘库单据主信息列表
*
*
* @param checkStockin 盘库单据主信息
* @return 盘库单据主信息集合
*/
@@ -29,7 +29,7 @@ public interface CheckStockinMapper
/**
* 新增盘库单据主信息
*
*
* @param checkStockin 盘库单据主信息
* @return 结果
*/
@@ -37,7 +37,7 @@ public interface CheckStockinMapper
/**
* 修改盘库单据主信息
*
*
* @param checkStockin 盘库单据主信息
* @return 结果
*/
@@ -45,7 +45,7 @@ public interface CheckStockinMapper
/**
* 删除盘库单据主信息
*
*
* @param stockGuid 盘库单据主信息主键
* @return 结果
*/
@@ -53,9 +53,11 @@ public interface CheckStockinMapper
/**
* 批量删除盘库单据主信息
*
*
* @param stockGuids 需要删除的数据主键集合
* @return 结果
*/
public int deleteCheckStockinByStockGuids(String[] stockGuids);
void insertCheckStockinHistory(CheckStockin checkStockin);
}

View File

@@ -1,19 +1,23 @@
package com.ruoyi.check.stockcheck.service;
import java.util.List;
import com.ruoyi.check.stockcheck.domain.CheckStockVo;
import com.ruoyi.check.stockcheck.domain.CheckStockin;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
/**
* 盘库单据主信息Service接口
*
*
* @author ruoyi
* @date 2025-05-29
*/
public interface ICheckStockinService
public interface ICheckStockinService
{
/**
* 查询盘库单据主信息
*
*
* @param stockGuid 盘库单据主信息主键
* @return 盘库单据主信息
*/
@@ -21,7 +25,7 @@ public interface ICheckStockinService
/**
* 查询盘库单据主信息列表
*
*
* @param checkStockin 盘库单据主信息
* @return 盘库单据主信息集合
*/
@@ -29,7 +33,7 @@ public interface ICheckStockinService
/**
* 新增盘库单据主信息
*
*
* @param checkStockin 盘库单据主信息
* @return 结果
*/
@@ -37,15 +41,15 @@ public interface ICheckStockinService
/**
* 修改盘库单据主信息
*
*
* @param checkStockin 盘库单据主信息
* @return 结果
*/
public int updateCheckStockin(CheckStockin checkStockin);
public AjaxResult updateCheckStockin(CheckStockin checkStockin);
/**
* 批量删除盘库单据主信息
*
*
* @param stockGuids 需要删除的盘库单据主信息主键集合
* @return 结果
*/
@@ -53,9 +57,11 @@ public interface ICheckStockinService
/**
* 删除盘库单据主信息信息
*
*
* @param stockGuid 盘库单据主信息主键
* @return 结果
*/
public int deleteCheckStockinByStockGuid(String stockGuid);
String saveBill(CheckStockVo outStockoutVo);
}

View File

@@ -1,27 +1,54 @@
package com.ruoyi.check.stockcheck.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.bas.BasProduct.service.IBasProductService;
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
import com.ruoyi.check.stockcheck.domain.CheckStockVo;
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
import com.ruoyi.check.stockcheckdetail.service.ICheckStockinDetailService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.in.stockin.domain.InStockin;
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
import com.ruoyi.out.outStockout.domain.OutStockout;
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import com.ruoyi.check.stockcheck.mapper.CheckStockinMapper;
import com.ruoyi.check.stockcheck.domain.CheckStockin;
import com.ruoyi.check.stockcheck.service.ICheckStockinService;
import org.springframework.transaction.annotation.Transactional;
/**
* 盘库单据主信息Service业务层处理
*
*
* @author ruoyi
* @date 2025-05-29
*/
@Service
public class CheckStockinServiceImpl implements ICheckStockinService
public class CheckStockinServiceImpl implements ICheckStockinService
{
@Autowired
private CheckStockinMapper checkStockinMapper;
@Autowired
private IBasJobIdService basJobIdService;
@Autowired
private ICheckStockinDetailService checkStockinDetailService;
@Autowired
private IBasProductService productService;
/**
* 查询盘库单据主信息
*
*
* @param stockGuid 盘库单据主信息主键
* @return 盘库单据主信息
*/
@@ -33,7 +60,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService
/**
* 查询盘库单据主信息列表
*
*
* @param checkStockin 盘库单据主信息
* @return 盘库单据主信息
*/
@@ -45,7 +72,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService
/**
* 新增盘库单据主信息
*
*
* @param checkStockin 盘库单据主信息
* @return 结果
*/
@@ -57,19 +84,59 @@ public class CheckStockinServiceImpl implements ICheckStockinService
/**
* 修改盘库单据主信息
*
*
* @param checkStockin 盘库单据主信息
* @return 结果
*/
@Override
public int updateCheckStockin(CheckStockin checkStockin)
@Transactional(rollbackFor = Exception.class)
public AjaxResult updateCheckStockin(CheckStockin checkStockin)
{
return checkStockinMapper.updateCheckStockin(checkStockin);
CheckStockin old = selectCheckStockinByStockGuid(checkStockin.getStockGuid());
checkStockinMapper.updateCheckStockin(checkStockin);
if ("5".equals(checkStockin.getStatus())){
//作废
if (!"1".equals(old.getStatus())){
throw new RuntimeException("单据状态非未执行状态!");
}
//插入历史单据
insertCheckStockinHistory(checkStockin);
}else if ("2".equals(checkStockin.getStatus())){
//审核
if (!"1".equals(old.getStatus())){
throw new RuntimeException("单据状态非未执行状态!");
}
}else if ("4".equals(checkStockin.getStatus())){
//确认
if (!"3".equals(old.getStatus())){
throw new RuntimeException("单据状态非正执行状态!");
}
//对比扫码数量 与实际入库数量是否一致
CheckStockinDetail checkStockinParam = new CheckStockinDetail();
checkStockinParam.setStockCheckGuid(checkStockin.getStockGuid());
List<CheckStockinDetail> list = checkStockinDetailService.selectCheckStockinDetailList(checkStockinParam);
if (CollUtil.isNotEmpty(list)){
boolean b = list.stream().allMatch(x -> x.getAssignNum().equals(x.getScanNum()));
if (!b){
throw new RuntimeException("扫码数量与实际入库数量不一致!");
}
}
insertCheckStockinHistory(checkStockin);
}
return AjaxResult.success();
}
private void insertCheckStockinHistory(CheckStockin checkStockin) {
//插入历史单据
checkStockinMapper.insertCheckStockinHistory(checkStockin);
checkStockinDetailService.insertCheckStockinDetailHistory(checkStockin);
checkStockinMapper.deleteCheckStockinByStockGuid(checkStockin.getStockGuid());
checkStockinDetailService.deleteCheckStockinDetailByStockinGuid(checkStockin.getStockGuid());
}
/**
* 批量删除盘库单据主信息
*
*
* @param stockGuids 需要删除的盘库单据主信息主键
* @return 结果
*/
@@ -81,7 +148,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService
/**
* 删除盘库单据主信息信息
*
*
* @param stockGuid 盘库单据主信息主键
* @return 结果
*/
@@ -90,4 +157,33 @@ public class CheckStockinServiceImpl implements ICheckStockinService
{
return checkStockinMapper.deleteCheckStockinByStockGuid(stockGuid);
}
@Override
@Transactional(rollbackFor = Exception.class)
public String saveBill(CheckStockVo checkStockVo) {
CheckStockin checkStockin = checkStockVo.getCheckStockin();
List<CheckStockinDetail> detailList = checkStockVo.getDetailList();
String stockCheckId = basJobIdService.getJobId("CKD");
checkStockin.setStockCheckId(stockCheckId);
checkStockin.setStockGuid(IdUtil.simpleUUID());
checkStockin.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
String username = SecurityContextHolder.getContext().getAuthentication().getName();
checkStockin.setCreateManId(username);
checkStockin.setStatus("1");
checkStockin.setStockSource("0");
checkStockin.setCheckType(checkStockin.getCheckType());
for (int i = 0; i < detailList.size(); i++) {
CheckStockinDetail checkStockinDetail = detailList.get(i);
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
checkStockinDetail.setStockCheckId(stockCheckId);
BasProduct basProduct = productService.selectBasProductByProductId(checkStockinDetail.getProductId());
checkStockinDetail.setProductGuid(basProduct.getProductGuid());
checkStockinDetail.setStockCheckGuid(checkStockin.getStockGuid());
checkStockinDetail.setScanNum("0");
checkStockinDetail.setAssignNum("0");
checkStockinDetailService.insertCheckStockinDetail(checkStockinDetail);
}
checkStockinMapper.insertCheckStockin(checkStockin);
return stockCheckId;
}
}

View File

@@ -1,19 +1,21 @@
package com.ruoyi.check.stockcheckdetail.mapper;
import java.util.List;
import com.ruoyi.check.stockcheck.domain.CheckStockin;
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
/**
* 盘库单据子信息Mapper接口
*
*
* @author ruoyi
* @date 2025-05-29
*/
public interface CheckStockinDetailMapper
public interface CheckStockinDetailMapper
{
/**
* 查询盘库单据子信息
*
*
* @param stockCheckDetailId 盘库单据子信息主键
* @return 盘库单据子信息
*/
@@ -21,7 +23,7 @@ public interface CheckStockinDetailMapper
/**
* 查询盘库单据子信息列表
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 盘库单据子信息集合
*/
@@ -29,7 +31,7 @@ public interface CheckStockinDetailMapper
/**
* 新增盘库单据子信息
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 结果
*/
@@ -37,7 +39,7 @@ public interface CheckStockinDetailMapper
/**
* 修改盘库单据子信息
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 结果
*/
@@ -45,7 +47,7 @@ public interface CheckStockinDetailMapper
/**
* 删除盘库单据子信息
*
*
* @param stockCheckDetailId 盘库单据子信息主键
* @return 结果
*/
@@ -53,9 +55,13 @@ public interface CheckStockinDetailMapper
/**
* 批量删除盘库单据子信息
*
*
* @param stockCheckDetailIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteCheckStockinDetailByStockCheckDetailIds(String[] stockCheckDetailIds);
void insertCheckStockinDetailHistory(CheckStockin checkStockin);
void deleteCheckStockinDetailByStockinGuid(String stockGuid);
}

View File

@@ -1,19 +1,21 @@
package com.ruoyi.check.stockcheckdetail.service;
import java.util.List;
import com.ruoyi.check.stockcheck.domain.CheckStockin;
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
/**
* 盘库单据子信息Service接口
*
*
* @author ruoyi
* @date 2025-05-29
*/
public interface ICheckStockinDetailService
public interface ICheckStockinDetailService
{
/**
* 查询盘库单据子信息
*
*
* @param stockCheckDetailId 盘库单据子信息主键
* @return 盘库单据子信息
*/
@@ -21,7 +23,7 @@ public interface ICheckStockinDetailService
/**
* 查询盘库单据子信息列表
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 盘库单据子信息集合
*/
@@ -29,7 +31,7 @@ public interface ICheckStockinDetailService
/**
* 新增盘库单据子信息
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 结果
*/
@@ -37,7 +39,7 @@ public interface ICheckStockinDetailService
/**
* 修改盘库单据子信息
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 结果
*/
@@ -45,7 +47,7 @@ public interface ICheckStockinDetailService
/**
* 批量删除盘库单据子信息
*
*
* @param stockCheckDetailIds 需要删除的盘库单据子信息主键集合
* @return 结果
*/
@@ -53,9 +55,13 @@ public interface ICheckStockinDetailService
/**
* 删除盘库单据子信息信息
*
*
* @param stockCheckDetailId 盘库单据子信息主键
* @return 结果
*/
public int deleteCheckStockinDetailByStockCheckDetailId(String stockCheckDetailId);
void insertCheckStockinDetailHistory(CheckStockin checkStockin);
void deleteCheckStockinDetailByStockinGuid(String stockGuid);
}

View File

@@ -1,6 +1,8 @@
package com.ruoyi.check.stockcheckdetail.service.impl;
import java.util.List;
import com.ruoyi.check.stockcheck.domain.CheckStockin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.check.stockcheckdetail.mapper.CheckStockinDetailMapper;
@@ -9,19 +11,19 @@ import com.ruoyi.check.stockcheckdetail.service.ICheckStockinDetailService;
/**
* 盘库单据子信息Service业务层处理
*
*
* @author ruoyi
* @date 2025-05-29
*/
@Service
public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
{
@Autowired
private CheckStockinDetailMapper checkStockinDetailMapper;
/**
* 查询盘库单据子信息
*
*
* @param stockCheckDetailId 盘库单据子信息主键
* @return 盘库单据子信息
*/
@@ -33,7 +35,7 @@ public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
/**
* 查询盘库单据子信息列表
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 盘库单据子信息
*/
@@ -45,7 +47,7 @@ public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
/**
* 新增盘库单据子信息
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 结果
*/
@@ -57,7 +59,7 @@ public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
/**
* 修改盘库单据子信息
*
*
* @param checkStockinDetail 盘库单据子信息
* @return 结果
*/
@@ -69,7 +71,7 @@ public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
/**
* 批量删除盘库单据子信息
*
*
* @param stockCheckDetailIds 需要删除的盘库单据子信息主键
* @return 结果
*/
@@ -81,7 +83,7 @@ public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
/**
* 删除盘库单据子信息信息
*
*
* @param stockCheckDetailId 盘库单据子信息主键
* @return 结果
*/
@@ -90,4 +92,14 @@ public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
{
return checkStockinDetailMapper.deleteCheckStockinDetailByStockCheckDetailId(stockCheckDetailId);
}
@Override
public void insertCheckStockinDetailHistory(CheckStockin checkStockin) {
checkStockinDetailMapper.insertCheckStockinDetailHistory(checkStockin);
}
@Override
public void deleteCheckStockinDetailByStockinGuid(String stockGuid) {
checkStockinDetailMapper.deleteCheckStockinDetailByStockinGuid(stockGuid);
}
}

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.check.stockcheckdetail.mapper.CheckStockinDetailMapper">
<resultMap type="CheckStockinDetail" id="CheckStockinDetailResult">
<result property="stockCheckDetailId" column="stock_check_detail_id" />
<result property="stockCheckGuid" column="stock_check_guid" />
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCheckStockinDetailList" parameterType="CheckStockinDetail" resultMap="CheckStockinDetailResult">
<include refid="selectCheckStockinDetailVo"/>
<where>
<where>
<if test="stockCheckGuid != null and stockCheckGuid != ''"> and stock_check_guid = #{stockCheckGuid}</if>
<if test="stockCheckId != null and stockCheckId != ''"> and stock_check_id = #{stockCheckId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
@@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
</where>
</select>
<select id="selectCheckStockinDetailByStockCheckDetailId" parameterType="String" resultMap="CheckStockinDetailResult">
<include refid="selectCheckStockinDetailVo"/>
where stock_check_detail_id = #{stockCheckDetailId}
@@ -147,6 +147,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare6 != null">#{spare6},</if>
</trim>
</insert>
<insert id="insertCheckStockinDetailHistory">
insert into check_stockin_detail_finish
select * from check_stockin_detail where stock_check_guid = #{stockCheckGuid}
</insert>
<update id="updateCheckStockinDetail" parameterType="CheckStockinDetail">
update check_stockin_detail
@@ -189,9 +193,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteCheckStockinDetailByStockCheckDetailIds" parameterType="String">
delete from check_stockin_detail where stock_check_detail_id in
delete from check_stockin_detail where stock_check_detail_id in
<foreach item="stockCheckDetailId" collection="array" open="(" separator="," close=")">
#{stockCheckDetailId}
</foreach>
</delete>
</mapper>
<delete id="deleteCheckStockinDetailByStockinGuid">
delete from check_stockin_detail where stock_check_guid = #{stockCheckGuid}
</delete>
</mapper>

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.check.stockcheck.mapper.CheckStockinMapper">
<resultMap type="CheckStockin" id="CheckStockinResult">
<result property="stockGuid" column="stock_guid" />
<result property="stockCheckId" column="stock_check_id" />
@@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCheckStockinList" parameterType="CheckStockin" resultMap="CheckStockinResult">
<include refid="selectCheckStockinVo"/>
<where>
<where>
<if test="stockCheckId != null and stockCheckId != ''"> and stock_check_id = #{stockCheckId}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
</where>
</select>
<select id="selectCheckStockinByStockGuid" parameterType="String" resultMap="CheckStockinResult">
<include refid="selectCheckStockinVo"/>
where stock_guid = #{stockGuid}
@@ -104,6 +104,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare5 != null">#{spare5},</if>
</trim>
</insert>
<insert id="insertCheckStockinHistory">
insert into check_stockin_finish
select * from check_stockin where stock_guid = #{stockGuid}
</insert>
<update id="updateCheckStockin" parameterType="CheckStockin">
update check_stockin
@@ -135,9 +139,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteCheckStockinByStockGuids" parameterType="String">
delete from check_stockin where stock_guid in
delete from check_stockin where stock_guid in
<foreach item="stockGuid" collection="array" open="(" separator="," close=")">
#{stockGuid}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -24,6 +24,13 @@ export function addStockCheck(data) {
method: 'post',
data: data
})
}// 新增盘库单据主信息
export function saveCheckStock(data) {
return request({
url: '/check/stockCheck/saveBill',
method: 'post',
data: data
})
}
// 修改盘库单据主信息

View File

@@ -19,10 +19,10 @@
clearable
/>
</el-form-item>
<el-form-item label="单据类型" prop="outType" required>
<el-select v-model="formData.outType" placeholder="请选择单据类型" clearable>
<el-form-item label="单据类型" prop="checkType" required>
<el-select v-model="formData.checkType" placeholder="请选择单据类型" clearable>
<el-option
v-for="dict in dict.type.out_bill_type"
v-for="dict in dict.type.check_stock_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@@ -44,7 +44,11 @@
<el-table v-loading="loading" :data="materialList">
<el-table-column label="物资编号" align="center" prop="productId" />
<el-table-column label="物资名称" align="center" prop="productName" />
<el-table-column label="批号" align="center" prop="lotNo" />
<el-table-column label="批号" align="center" prop="lotNo">
<template slot-scope="scope">
<el-input v-model="scope.row.lotNo" size="mini" placeholder="请输入批号" />
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="quantity">
<template slot-scope="scope">
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
@@ -102,7 +106,11 @@
<el-table-column type="selection" width="55" />
<el-table-column label="物资编码" align="center" prop="productId" />
<el-table-column label="物资名称" align="center" prop="productName" />
<el-table-column label="批号" align="center" prop="lotNo" />
<!-- <el-table-column label="批号" align="center" prop="lotNo">
<template slot-scope="scope">
<el-input v-model="scope.row.lotNo" size="mini" placeholder="请输入批号" />
</template>
</el-table-column> -->
<el-table-column label="数量" align="center" prop="quantity" />
<!-- <el-table-column label="仓库" align="center" prop="warehouseId" /> -->
</el-table>
@@ -116,12 +124,13 @@
</template>
<script>
import { listProductAndStock,saveOutStock } from "@/api/out/outStockout";
import { listProductAndStock } from "@/api/out/outStockout";
import {listWarehouse} from "@/api/bas/warehouse";
import {saveCheckStock} from "@/api/check/stockCheck";
export default {
name: "AddOutStock",
dicts: ['out_bill_type', 'bill_status'],
dicts: ['check_stock_type', 'bill_status'],
data() {
return {
// 遮罩层
@@ -143,7 +152,7 @@
formData: {
warehouseId: null,
customerNo: null,
outType: null
checkType: null
},
// 仓库选项
warehouseOptions: [],
@@ -215,6 +224,7 @@
this.materialList = this.materialList.concat(
newMaterials.map(item => ({
productId: item.productId,
productGuId: item.productGuid,
productName: item.productName,
quantity: item.quantity,
quantityOrignal: item.quantity,
@@ -263,11 +273,11 @@
return;
}
const data = {
outStockout: this.formData,
checkStockin: this.formData,
detailList: this.materialList
};
// 这里需要调用保存接口
saveOutStock(data).then(response => {
saveCheckStock(data).then(response => {
console.log(response)
this.$modal.msgSuccess("单据"+response.msg+"保存成功");
this.$tab.refreshPage(this.$route);

View File

@@ -150,15 +150,26 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleInvalidated"
v-hasPermi="['check:stockCheck:edit']"
>单据作废</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['check:stockCheck:add']"
>新增</el-button>
@click="handleReview"
v-hasPermi="['check:stockCheck:edit']"
>单据审核</el-button>
</el-col>
<el-col :span="1.5">
<el-button
@@ -167,37 +178,17 @@
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
@click="handleConfirmation"
v-hasPermi="['check:stockCheck:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['check:stockCheck:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['check:stockCheck:export']"
>导出</el-button>
>单据确认</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="stockCheckList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="GUID" align="center" prop="stockGuid" />
<!-- <el-table-column label="GUID" align="center" prop="stockGuid" /> -->
<el-table-column label="盘点单据ID" align="center" prop="stockCheckId" />
<el-table-column label="盘库类型" align="center" prop="checkType">
<template slot-scope="scope">
@@ -217,34 +208,6 @@
<el-table-column label="创建人" align="center" prop="createManId" />
<el-table-column label="建立时间" align="center" prop="createDate" />
<el-table-column label=" 完成日期" align="center" prop="finishDate" />
<!-- <el-table-column label="erp单号" align="center" prop="erpBill" />-->
<!-- <el-table-column label="客户编码" align="center" prop="customerNo" />
<el-table-column label="班组编码" align="center" prop="classNo" />
<el-table-column label="供应商编码" align="center" prop="supplierNo" />-->
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
<el-table-column label="备用字段2" align="center" prop="spare2" />
<el-table-column label="备用字段3" align="center" prop="spare3" />
<el-table-column label="备用字段4" align="center" prop="spare4" />
<el-table-column label="备用字段5" align="center" prop="spare5" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['check:stockCheck:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['check:stockCheck:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table>
<pagination
@@ -258,20 +221,20 @@
<el-table v-loading="detailLoading" :data="stockCheckDetailList" @selection-change="handleDetailSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="子单ID" align="center" prop="stockCheckDetailId" />
<el-table-column label="主单GUID" align="center" prop="stockCheckGuid" />
<!-- <el-table-column label="主单GUID" align="center" prop="stockCheckGuid" /> -->
<el-table-column label="主单ID" align="center" prop="stockCheckId" />
<el-table-column label="批次号" align="center" prop="lotNo" />
<el-table-column label="物料ID" align="center" prop="productGuid" />
<!-- <el-table-column label="物料ID" align="center" prop="productGuid" /> -->
<el-table-column label="物料编码" align="center" prop="productId" />
<el-table-column label="计划数量" align="center" prop="quantity" />
<el-table-column label="计划数量(箱)" align="center" prop="quantityX" />
<el-table-column label="计划数量(件)" align="center" prop="quantityJ" />
<!-- <el-table-column label="计划数量(箱)" align="center" prop="quantityX" />-->
<!-- <el-table-column label="计划数量(件)" align="center" prop="quantityJ" />-->
<el-table-column label="参考单价" align="center" prop="price" />
<el-table-column label="品牌" align="center" prop="cargoNo" />
<el-table-column label="描述" align="center" prop="remark" />
<el-table-column label="实际数量" align="center" prop="assignNum" />
<el-table-column label="实际数量(箱)" align="center" prop="assignNumX" />
<el-table-column label="实际数量(件)" align="center" prop="assignNumJ" />
<!-- <el-table-column label="实际数量(箱)" align="center" prop="assignNumX" />-->
<!-- <el-table-column label="实际数量(件)" align="center" prop="assignNumJ" />-->
<el-table-column label="入库日期" align="center" prop="printDate" />
<el-table-column label="单据状态" align="center" prop="stockStatus" />
<el-table-column label="供应商编码" align="center" prop="supplierId" />
@@ -279,8 +242,8 @@
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="规格" align="center" prop="spec" />
<el-table-column label="扫码数量" align="center" prop="scanNum" />
<el-table-column label="扫码数量(箱)" align="center" prop="scanNumX" />
<el-table-column label="扫码数量(件)" align="center" prop="scanNumJ" />
<!-- <el-table-column label="扫码数量(箱)" align="center" prop="scanNumX" />-->
<!-- <el-table-column label="扫码数量(件)" align="center" prop="scanNumJ" />-->
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
<el-table-column label="备用字段2" align="center" prop="spare2" />
<el-table-column label="备用字段3" align="center" prop="spare3" />
@@ -484,22 +447,8 @@ export default {
this.detailTotal = 0
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加盘库单据主信息"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const stockGuid = row.stockGuid || this.ids
getStockCheck(stockGuid).then(response => {
this.form = response.data
this.open = true
this.title = "修改盘库单据主信息"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
@@ -520,22 +469,58 @@ export default {
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const stockGuids = row.stockGuid || this.ids
this.$modal.confirm('是否确认删除盘库单据主信息编号为"' + stockGuids + '"的数据项?').then(function() {
return delStockCheck(stockGuids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
/** 作废按钮操作 */
handleInvalidated(row) {
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row.stockGuid || this.ids[0]));
if (stockCheck.status === "1") {
let data = {
"stockGuid": stockCheck.stockGuid,
"status": "5"
}
updateStockCheck(data).then(response => {
this.$modal.msgSuccess("作废成功")
this.getList()
})
} else {
this.$modal.msgError("只有未审核的单据可以作废")
}
},
/** 审核按钮操作 */
handleReview(row) {
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row?.stockGuid || this.ids[0]));
if (stockCheck.status === "2") {
this.$modal.msgError("单据已审核,请勿重复审核")
return
}
if (stockCheck.status === "1") {
let data = {
"stockGuid": stockCheck.stockGuid,
"status": "2"
}
updateStockCheck(data).then(response => {
this.$modal.msgSuccess("审核成功")
this.getList()
})
} else {
this.$modal.msgError("只有未审核的单据可以审核")
}
},
/** 确认按钮操作 */
handleConfirmation(row) {
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row?.stockGuid || this.ids[0]));
if (stockCheck.status === "3") {
let data = {
"stockGuid": stockCheck.stockGuid,
"status": "4"
}
updateStockCheck(data).then(response => {
this.$modal.msgSuccess("确认成功")
this.getList()
})
} else {
this.$modal.msgError("只有已审核的单据可以确认")
}
},
/** 导出按钮操作 */
handleExport() {
this.download('check/stockCheck/export', {
...this.queryParams
}, `stockCheck_${new Date().getTime()}.xlsx`)
}
}
}
</script>

File diff suppressed because it is too large Load Diff