2026.3.18 晚

This commit is contained in:
1009473166@qq.com
2026-03-18 20:28:14 +08:00
parent 76517dc3a5
commit e65b5933ad
6 changed files with 37 additions and 39 deletions

View File

@@ -27,8 +27,7 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/check/stockCheck") @RequestMapping("/check/stockCheck")
public class CheckStockinController extends BaseController public class CheckStockinController extends BaseController {
{
@Autowired @Autowired
private ICheckStockinService checkStockinService; private ICheckStockinService checkStockinService;
@Autowired @Autowired
@@ -39,13 +38,12 @@ public class CheckStockinController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('check:stockCheck:list')") @PreAuthorize("@ss.hasPermi('check:stockCheck:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(CheckStockin checkStockin) public TableDataInfo list(CheckStockin checkStockin) {
{
startPage(); startPage();
List<CheckStockin> list = new ArrayList<>(); List<CheckStockin> list = new ArrayList<>();
if (checkStockin.getStatus() == null || Convert.toInt(checkStockin.getStatus())<4){ if (checkStockin.getStatus() == null || Convert.toInt(checkStockin.getStatus()) < 4) {
list = checkStockinService.selectCheckStockinList(checkStockin); list = checkStockinService.selectCheckStockinList(checkStockin);
}else { } else {
list = checkStockinFinishService.selectCheckStockinList(checkStockin); list = checkStockinFinishService.selectCheckStockinList(checkStockin);
} }
@@ -58,8 +56,7 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:export')") @PreAuthorize("@ss.hasPermi('check:stockCheck:export')")
@Log(title = "盘库单据主信息", businessType = BusinessType.EXPORT) @Log(title = "盘库单据主信息", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, CheckStockin checkStockin) public void export(HttpServletResponse response, CheckStockin checkStockin) {
{
List<CheckStockin> list = checkStockinService.selectCheckStockinList(checkStockin); List<CheckStockin> list = checkStockinService.selectCheckStockinList(checkStockin);
ExcelUtil<CheckStockin> util = new ExcelUtil<CheckStockin>(CheckStockin.class); ExcelUtil<CheckStockin> util = new ExcelUtil<CheckStockin>(CheckStockin.class);
util.exportExcel(response, list, "盘库单据主信息数据"); util.exportExcel(response, list, "盘库单据主信息数据");
@@ -70,8 +67,7 @@ public class CheckStockinController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('check:stockCheck:query')") @PreAuthorize("@ss.hasPermi('check:stockCheck:query')")
@GetMapping(value = "/{stockGuid}") @GetMapping(value = "/{stockGuid}")
public AjaxResult getInfo(@PathVariable("stockGuid") String stockGuid) public AjaxResult getInfo(@PathVariable("stockGuid") String stockGuid) {
{
return success(checkStockinService.selectCheckStockinByStockGuid(stockGuid)); return success(checkStockinService.selectCheckStockinByStockGuid(stockGuid));
} }
@@ -81,8 +77,7 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:add')") @PreAuthorize("@ss.hasPermi('check:stockCheck:add')")
@Log(title = "盘库单据主信息", businessType = BusinessType.INSERT) @Log(title = "盘库单据主信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody CheckStockin checkStockin) public AjaxResult add(@RequestBody CheckStockin checkStockin) {
{
return toAjax(checkStockinService.insertCheckStockin(checkStockin)); return toAjax(checkStockinService.insertCheckStockin(checkStockin));
} }
@@ -92,8 +87,7 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:edit')") @PreAuthorize("@ss.hasPermi('check:stockCheck:edit')")
@Log(title = "盘库单据主信息", businessType = BusinessType.UPDATE) @Log(title = "盘库单据主信息", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody CheckStockin checkStockin) public AjaxResult edit(@RequestBody CheckStockin checkStockin) {
{
return checkStockinService.updateCheckStockin(checkStockin); return checkStockinService.updateCheckStockin(checkStockin);
} }
@@ -103,8 +97,7 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:remove')") @PreAuthorize("@ss.hasPermi('check:stockCheck:remove')")
@Log(title = "盘库单据主信息", businessType = BusinessType.DELETE) @Log(title = "盘库单据主信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockGuids}") @DeleteMapping("/{stockGuids}")
public AjaxResult remove(@PathVariable String[] stockGuids) public AjaxResult remove(@PathVariable String[] stockGuids) {
{
return toAjax(checkStockinService.deleteCheckStockinByStockGuids(stockGuids)); return toAjax(checkStockinService.deleteCheckStockinByStockGuids(stockGuids));
} }
@@ -119,12 +112,15 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:saveBill')") @PreAuthorize("@ss.hasPermi('check:stockCheck:saveBill')")
@ResponseBody @ResponseBody
public AjaxResult saveBill(@RequestBody CheckStockVo checkStockVo) { public AjaxResult saveBill(@RequestBody CheckStockVo checkStockVo) {
String stockOutId = checkStockinService.saveBill(checkStockVo); return checkStockinService.saveBill(checkStockVo);
return AjaxResult.success(stockOutId);
} }
/** /**
* 盘点自动分配 * 盘点自动分配
*
* @param checkStockin * @param checkStockin
* @return * @return
*/ */

View File

@@ -62,7 +62,7 @@ public interface ICheckStockinService
*/ */
public int deleteCheckStockinByStockGuid(String stockGuid); public int deleteCheckStockinByStockGuid(String stockGuid);
String saveBill(CheckStockVo outStockoutVo); AjaxResult saveBill(CheckStockVo outStockoutVo);
/** /**
* 盘点自动分配 * 盘点自动分配

View File

@@ -162,7 +162,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String saveBill(CheckStockVo checkStockVo) { public AjaxResult saveBill(CheckStockVo checkStockVo) {
CheckStockin checkStockin = checkStockVo.getCheckStockin(); CheckStockin checkStockin = checkStockVo.getCheckStockin();
List<CheckStockinDetail> detailList = checkStockVo.getDetailList(); List<CheckStockinDetail> detailList = checkStockVo.getDetailList();
@@ -183,6 +183,9 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1)); checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
checkStockinDetail.setStockCheckId(stockCheckId); checkStockinDetail.setStockCheckId(stockCheckId);
BasProduct basProduct = productService.selectBasProductByProductId(checkStockinDetail.getProductId()); BasProduct basProduct = productService.selectBasProductByProductId(checkStockinDetail.getProductId());
if (basProduct==null){
throw new RuntimeException(checkStockinDetail.getProductId()+",系统内无该物料,请检查!");
}
checkStockinDetail.setProductGuid(basProduct.getProductGuid()); checkStockinDetail.setProductGuid(basProduct.getProductGuid());
checkStockinDetail.setStockCheckGuid(checkStockin.getStockGuid()); checkStockinDetail.setStockCheckGuid(checkStockin.getStockGuid());
checkStockinDetail.setScanNum("0"); checkStockinDetail.setScanNum("0");
@@ -193,13 +196,6 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
} else if ("2".equals(checkStockin.getCheckType())) { } else if ("2".equals(checkStockin.getCheckType())) {
//货位盘点 //货位盘点
for (int i = 0; i < detailList.size(); i++) { for (int i = 0; i < detailList.size(); i++) {
// BasStock param = new BasStock();
// param.setCargoSpaceId(detailList.get(i).getSpare1());
// List<BasStock> basStocks = basStockService.selectBasStockList(param);
// Integer quantity = 0;
// for (BasStock basStock : basStocks) {
// quantity += Convert.toInt(basStock.getQuantity());
// }
CheckStockinDetail checkStockinDetail = detailList.get(i); CheckStockinDetail checkStockinDetail = detailList.get(i);
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1)); checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
checkStockinDetail.setStockCheckId(stockCheckId); checkStockinDetail.setStockCheckId(stockCheckId);
@@ -211,7 +207,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
} }
checkStockinMapper.insertCheckStockin(checkStockin); checkStockinMapper.insertCheckStockin(checkStockin);
return stockCheckId; return AjaxResult.success("单据创建成功",stockCheckId);
} }
@Override @Override

View File

@@ -243,10 +243,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMydoJobByEntranceId" parameterType="MydoJob" resultMap="MydoJobResult"> <select id="selectMydoJobByEntranceId" parameterType="MydoJob" resultMap="MydoJobResult">
select top(1)* from mydo_job mj select top(1)* from mydo_job mj
where in_or_out&lt;20 and mj.entrance_id = #{entranceId} where in_or_out&lt;20
and mj.status = #{status} and mj.tray_code = #{trayCode}
<if test="lineId != null and lineId != ''"> and mj.line_id = #{lineId}</if> <!-- <if test="lineId != null and lineId != ''"> and mj.line_id = #{lineId}</if>-->
<if test="workshopId != null and workshopId != ''"> and mj.workshop_id = #{workshopId}</if> <!-- <if test="workshopId != null and workshopId != ''"> and mj.workshop_id = #{workshopId}</if>-->
order by mj.create_time order by mj.create_time
</select> </select>

View File

@@ -181,8 +181,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{status,mode=IN,jdbcType=VARCHAR}, #{status,mode=IN,jdbcType=VARCHAR},
#{newStatus,mode=IN,jdbcType=VARCHAR}, #{newStatus,mode=IN,jdbcType=VARCHAR},
#{exitId,mode=IN,jdbcType=VARCHAR}, #{exitId,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=VARCHAR}, #{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultString,mode=OUT,jdbcType=VARCHAR} #{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
) )
} }
</select> </select>

View File

@@ -670,9 +670,15 @@ export default {
console.log(data) console.log(data)
// 这里需要调用保存接口 // 这里需要调用保存接口
saveCheckStock(data).then(response => { saveCheckStock(data).then(response => {
if (response.code==200){
this.$modal.msgSuccess('保存成功:' + response.msg); this.$modal.msgSuccess('保存成功:' + response.msg);
this.$tab.refreshPage(this.$route); this.$tab.refreshPage(this.$route);
}
else {
this.$modal.msgError('建单失败:' + response.msg);
}
// this.reset(); // this.reset();
}); });
} }