add:半成品虚拟库
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
package org.nl.wms.storage_manage.semimanage.controller.iostorInv;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpService;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dto.BcpIostorInvQuery;
|
||||
import org.nl.wms.system_manage.service.tableData.ColumnInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "半成品虚拟入库")
|
||||
@RequestMapping("/api/in/semivproductIn")
|
||||
@Slf4j
|
||||
@SaIgnore
|
||||
public class StIvtIoVstorinvBcpController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtIostorinvBcpService stIvtIostorinvBcpService;
|
||||
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService; // 载具扩展属性信息表服务
|
||||
|
||||
|
||||
@GetMapping
|
||||
@Log("查询入库单据")
|
||||
//("查询入库单据")
|
||||
public ResponseEntity<Object> query(BcpIostorInvQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(stIvtIostorinvBcpService.queryDtl(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Log("新增入库单")
|
||||
//("新增入库单")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject form) {
|
||||
stIvtIostorinvBcpService.create(form);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("删除出入库单")
|
||||
//("删除出入库单")
|
||||
@PostMapping("/delete")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
if (ids.length>0){
|
||||
stIvtIostorinvBcpService.update(new UpdateWrapper<StIvtIostorinvBcp>()
|
||||
.set("is_delete","1")
|
||||
.in("iostorinv_id",ids));
|
||||
|
||||
List<StIvtIostorinvBcp> bcps = stIvtIostorinvBcpService.listByIds(Arrays.asList(ids));
|
||||
List<String> collect = bcps.stream().map(StIvtIostorinvBcp::getStoragevehicle_code).collect(Collectors.toList());
|
||||
// 更新载具扩展属性 - 释放载具对应物料关系 清空数量
|
||||
if (!CollectionUtils.isEmpty(collect)){
|
||||
iMdPbStoragevehicleextService.update(
|
||||
new MdPbStoragevehicleext()
|
||||
.setMaterial_id("")
|
||||
.setStorage_qty(BigDecimal.valueOf(0)),
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.in(MdPbStoragevehicleext::getStoragevehicle_code,collect)
|
||||
);
|
||||
}
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/update")
|
||||
@Log("修改入库单")
|
||||
//("修改入库单")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
stIvtIostorinvBcpService.updateBill(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/commit")
|
||||
@Log("出入单提交")
|
||||
//("出入单提交")
|
||||
public ResponseEntity<Object> commit(@RequestBody Map<String,Object> whereJson) {
|
||||
//semiProductInService.commit(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/getIODtl")
|
||||
@Log("查询入库分配明细")
|
||||
//("查询入库分配明细")
|
||||
public ResponseEntity<Object> getIODtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(stIvtIostorinvBcpService.getIoDtl(whereJson.toJavaObject(BcpIostorInvQuery.class)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("完成单据")
|
||||
//("完成单据")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
stIvtIostorinvBcpService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmTask")
|
||||
@Log("下发任务")
|
||||
//("下发任务")
|
||||
public ResponseEntity<Object> confirmTask(@RequestBody JSONObject whereJson) {
|
||||
stIvtIostorinvBcpService.confirmTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@GetMapping("/download")
|
||||
@Log("半成品入库单导出")
|
||||
//("半成品入库单导出")
|
||||
public ResponseEntity<Object> download(BcpIostorInvQuery query, PageQuery page, HttpServletResponse response) throws IOException {
|
||||
stIvtIostorinvBcpService.download(query,page,response);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user