|
@@ -12,10 +12,7 @@ import cn.ezhizao.framework.web.controller.BaseController;
|
|
|
import cn.ezhizao.framework.web.domain.AjaxResult;
|
|
|
import cn.ezhizao.framework.web.page.TableDataInfo;
|
|
|
import cn.ezhizao.project.business.domain.*;
|
|
|
-import cn.ezhizao.project.business.service.IBizDayworkService;
|
|
|
-import cn.ezhizao.project.business.service.IBizOutsourcedOrderDetailService;
|
|
|
-import cn.ezhizao.project.business.service.IBizProductionPlanDetailSubDetailService;
|
|
|
-import cn.ezhizao.project.business.service.IBizTaksStockLotService;
|
|
|
+import cn.ezhizao.project.business.service.*;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -45,6 +42,10 @@ public class BizTaksStockLotController extends BaseController {
|
|
|
private IBizProductionPlanDetailSubDetailService bizProductionPlanDetailSubDetailService;
|
|
|
@Resource
|
|
|
private IBizDayworkService bizDayworkService;
|
|
|
+ @Resource
|
|
|
+ private IBizTaksStockCertificateLotService bizTaksStockCertificateLotService;
|
|
|
+ @Resource
|
|
|
+ private IBizTaksStockInboundOrderDetailService bizTaksStockInboundOrderDetailService;
|
|
|
|
|
|
/**
|
|
|
* 查询盘点批次信息列表
|
|
@@ -122,7 +123,112 @@ public class BizTaksStockLotController extends BaseController {
|
|
|
List<BizTaksStockLot> outsourcedOrderDetailList = bizTaksStockLotService.getOutsourceDetailList(bizTaksStockLot);
|
|
|
return getDataTable(outsourcedOrderDetailList);
|
|
|
}
|
|
|
+ @GetMapping(value = "/getNotInboundInfo")
|
|
|
+ @Log(title = "查询未入库盘点明细列表", businessType = BusinessType.SELECT)
|
|
|
+ public TableDataInfo getNotInboundInfo(BizTaksStockCertificateLot bizTaksStockCertificateLot) {
|
|
|
+ startPage();
|
|
|
+ List<BizTaksStockCertificateLot> data = bizTaksStockCertificateLotService.getNotInboundInfo(bizTaksStockCertificateLot);
|
|
|
+ return getDataTable(data);
|
|
|
+ }
|
|
|
+ @GetMapping(value = "/getAnyInboundInfo")
|
|
|
+ @Log(title = "查询部分库盘点明细列表", businessType = BusinessType.SELECT)
|
|
|
+ public TableDataInfo getAnyInboundInfo(BizTaksStockInboundOrderDetail bizTaksStockInboundOrderDetail) {
|
|
|
+ startPage();
|
|
|
+ List<BizTaksStockInboundOrderDetail> data = bizTaksStockInboundOrderDetailService.getAnyInboundInfo(bizTaksStockInboundOrderDetail);
|
|
|
+ return getDataTable(data);
|
|
|
+ }
|
|
|
+ @Log(title = "未入库盘点导出", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/notInboundExport")
|
|
|
+ public void notInboundExport(HttpServletResponse response,BizTaksStockCertificateLot bizTaksStockCertificateLot) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ List<BizTaksStockCertificateLot> data = bizTaksStockCertificateLotService.getNotInboundInfo(bizTaksStockCertificateLot);
|
|
|
+ if(data.isEmpty()){
|
|
|
+ throw new RuntimeException("没有可导出的数据");
|
|
|
+ }
|
|
|
+ data.forEach(item -> {
|
|
|
+ item.setIsTaksStockStr(item.getIsTaksStock() == 1 ? "已盘点" : "未盘点");
|
|
|
+ StringBuilder flagsBuilder = new StringBuilder();
|
|
|
+ if (item.getIsWaste() == 1) {
|
|
|
+ flagsBuilder.append("批废");
|
|
|
+ }
|
|
|
+ if (item.getIsAmend() == 1) {
|
|
|
+ if (flagsBuilder.length() > 0) {
|
|
|
+ flagsBuilder.append(",");
|
|
|
+ }
|
|
|
+ flagsBuilder.append("工艺修改");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.getIsWasteRecycling() == 1) {
|
|
|
+ if (flagsBuilder.length() > 0) {
|
|
|
+ flagsBuilder.append(",");
|
|
|
+ }
|
|
|
+ flagsBuilder.append("废品回用");
|
|
|
+ }
|
|
|
|
|
|
+ if (item.getFromId()!=0) {
|
|
|
+ if (flagsBuilder.length() > 0) {
|
|
|
+ flagsBuilder.append(",");
|
|
|
+ }
|
|
|
+ flagsBuilder.append("分批");
|
|
|
+ }
|
|
|
+ if (item.getIsSuperaddition() == 1) {
|
|
|
+ if (flagsBuilder.length() > 0) {
|
|
|
+ flagsBuilder.append(",");
|
|
|
+ }
|
|
|
+ flagsBuilder.append("追增");
|
|
|
+ }
|
|
|
+
|
|
|
+ String flags = flagsBuilder.toString();
|
|
|
+ item.setFlags(flags);
|
|
|
+ });
|
|
|
+ ExcelUtil<BizTaksStockCertificateLot> util = new ExcelUtil<>(BizTaksStockCertificateLot.class);
|
|
|
+ util.exportExcel(response, data, "未入库盘点");
|
|
|
+ }
|
|
|
+ @Log(title = "部分入库盘点导出", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/anyInboundExport")
|
|
|
+ public void anyInboundExport(HttpServletResponse response,BizTaksStockInboundOrderDetail bizTaksStockInboundOrderDetail) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ List<BizTaksStockInboundOrderDetail> data = bizTaksStockInboundOrderDetailService.getAnyInboundInfo(bizTaksStockInboundOrderDetail);
|
|
|
+ if(data.isEmpty()){
|
|
|
+ throw new RuntimeException("没有可导出的数据");
|
|
|
+ }
|
|
|
+ data.forEach(item -> {
|
|
|
+ item.setIsTaksStockStr(item.getIsTaksStock() == 1 ? "已盘点" : "未盘点");
|
|
|
+ StringBuilder flagsBuilder = new StringBuilder();
|
|
|
+ if (item.getIsWaste() == 1) {
|
|
|
+ flagsBuilder.append("批废");
|
|
|
+ }
|
|
|
+ if (item.getIsAmend() == 1) {
|
|
|
+ if (flagsBuilder.length() > 0) {
|
|
|
+ flagsBuilder.append(",");
|
|
|
+ }
|
|
|
+ flagsBuilder.append("工艺修改");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.getIsWasteRecycling() == 1) {
|
|
|
+ if (flagsBuilder.length() > 0) {
|
|
|
+ flagsBuilder.append(",");
|
|
|
+ }
|
|
|
+ flagsBuilder.append("废品回用");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.getFromId()!=0) {
|
|
|
+ if (flagsBuilder.length() > 0) {
|
|
|
+ flagsBuilder.append(",");
|
|
|
+ }
|
|
|
+ flagsBuilder.append("分批");
|
|
|
+ }
|
|
|
+ if (item.getIsSuperaddition() == 1) {
|
|
|
+ if (flagsBuilder.length() > 0) {
|
|
|
+ flagsBuilder.append(",");
|
|
|
+ }
|
|
|
+ flagsBuilder.append("追增");
|
|
|
+ }
|
|
|
+
|
|
|
+ String flags = flagsBuilder.toString();
|
|
|
+ item.setFlags(flags);
|
|
|
+ });
|
|
|
+ ExcelUtil<BizTaksStockInboundOrderDetail> util = new ExcelUtil<>(BizTaksStockInboundOrderDetail.class);
|
|
|
+ util.exportExcel(response, data, "部分入库盘点");
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 一键盘点未收回批次信息
|
|
@@ -142,6 +248,36 @@ public class BizTaksStockLotController extends BaseController {
|
|
|
});
|
|
|
return success(bizTaksStockLotService.saveOrUpdateBatch(outsourcedOrderDetailList));
|
|
|
}
|
|
|
+ @PostMapping(value = "/saveNotInboundInfo")
|
|
|
+ @Log(title = "一键盘点未入库", businessType = BusinessType.UPDATE)
|
|
|
+ public AjaxResult saveNotInboundInfo(@RequestBody BizTaksStockCertificateLot bizTaksStockCertificateLot) {
|
|
|
+
|
|
|
+ //查询出未收回的批次信息
|
|
|
+ List<BizTaksStockCertificateLot> data = bizTaksStockCertificateLotService.query().eq("take_stock_period_id", bizTaksStockCertificateLot.getTakeStockPeriodId()).list();
|
|
|
+ if(data.isEmpty()){
|
|
|
+ return error("没有可盘点的批次");
|
|
|
+ }
|
|
|
+ data.forEach(item -> {
|
|
|
+ item.setTaksStockNum(item.getProdNum().intValue());
|
|
|
+ item.setIsTaksStock(1);
|
|
|
+ });
|
|
|
+ return success(bizTaksStockCertificateLotService.updateBatchById(data));
|
|
|
+ }
|
|
|
+ @PostMapping(value = "/saveAnyInboundInfo")
|
|
|
+ @Log(title = "一键盘点部分入库", businessType = BusinessType.UPDATE)
|
|
|
+ public AjaxResult saveAnyInboundInfo(@RequestBody BizTaksStockCertificateLot bizTaksStockCertificateLot) {
|
|
|
+
|
|
|
+ //查询出未收回的批次信息
|
|
|
+ List<BizTaksStockInboundOrderDetail> data = bizTaksStockInboundOrderDetailService.query().eq("take_stock_period_id", bizTaksStockCertificateLot.getTakeStockPeriodId()).list();
|
|
|
+ if(data.isEmpty()){
|
|
|
+ return error("没有可盘点的批次");
|
|
|
+ }
|
|
|
+ data.forEach(item -> {
|
|
|
+ item.setTaksStockNum(item.getProdNum().intValue());
|
|
|
+ item.setIsTaksStock(1);
|
|
|
+ });
|
|
|
+ return success(bizTaksStockInboundOrderDetailService.updateBatchById(data));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 新增盘点批次信息
|