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

View File

@@ -62,7 +62,7 @@ public interface ICheckStockinService
*/
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
@Transactional(rollbackFor = Exception.class)
public String saveBill(CheckStockVo checkStockVo) {
public AjaxResult saveBill(CheckStockVo checkStockVo) {
CheckStockin checkStockin = checkStockVo.getCheckStockin();
List<CheckStockinDetail> detailList = checkStockVo.getDetailList();
@@ -183,6 +183,9 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
checkStockinDetail.setStockCheckId(stockCheckId);
BasProduct basProduct = productService.selectBasProductByProductId(checkStockinDetail.getProductId());
if (basProduct==null){
throw new RuntimeException(checkStockinDetail.getProductId()+",系统内无该物料,请检查!");
}
checkStockinDetail.setProductGuid(basProduct.getProductGuid());
checkStockinDetail.setStockCheckGuid(checkStockin.getStockGuid());
checkStockinDetail.setScanNum("0");
@@ -193,13 +196,6 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
} else if ("2".equals(checkStockin.getCheckType())) {
//货位盘点
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.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
checkStockinDetail.setStockCheckId(stockCheckId);
@@ -211,7 +207,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
}
checkStockinMapper.insertCheckStockin(checkStockin);
return stockCheckId;
return AjaxResult.success("单据创建成功",stockCheckId);
}
@Override

View File

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

View File

@@ -181,8 +181,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{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}
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)
}
</select>

View File

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