代码重购建
This commit is contained in:
parent
4941fe1cd8
commit
60e9d5af18
@ -30,5 +30,10 @@
|
||||
<groupId>com.foreverwin</groupId>
|
||||
<artifactId>mes-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.foreverwin</groupId>
|
||||
<artifactId>mes-api</artifactId>
|
||||
<version>4.5.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
package com.foreverwin.nlv.wms.domain;
|
||||
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
|
||||
@Data
|
||||
public class CarrierUnbindBatchRequest {
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
package com.foreverwin.nlv.wms.dto;
|
||||
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class wmsInventoryDto extends WmsInventory {
|
||||
private String item;
|
||||
private String description;
|
||||
private String unitOfMeasure;
|
||||
private String carrier;
|
||||
private String printer;
|
||||
private String itemType;
|
||||
private String storageBinBo;
|
||||
private String operation;
|
||||
private String operationBo;
|
||||
private String shopOrder;
|
||||
private String resource;
|
||||
private String fifo;
|
||||
private String fifoMaterialLot;
|
||||
private String checkDateExp;
|
||||
private String wmsInventoryBo;
|
||||
private List<Map<String,Object>> outItemType;
|
||||
private String itemGroup;
|
||||
private String checkItemMaterialLot;
|
||||
private BigDecimal checkItemQtyOnHand;
|
||||
}
|
||||
@ -1,172 +0,0 @@
|
||||
package com.foreverwin.nlv.wms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.foreverwin.iep.common.utils.HandleBoProcessor;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 库存(物料批次)
|
||||
*
|
||||
* @author Snow
|
||||
* @date 2024-10-22
|
||||
*/
|
||||
@Data
|
||||
@TableName("wms_inventory")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "库存(物料批次)")
|
||||
public class WmsInventory extends Model<WmsInventory> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final String KW_WMS_INVENTORY_BO = "WmsInventoryBO";
|
||||
|
||||
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
@ApiModelProperty(value = "站点")
|
||||
private String site;
|
||||
|
||||
@ApiModelProperty(value = "关联物料主键")
|
||||
private String itemBo;
|
||||
|
||||
@ApiModelProperty(value = "物料编号")
|
||||
@TableField(exist = false)
|
||||
private String item;
|
||||
|
||||
@ApiModelProperty(value = "物料描述")
|
||||
@TableField(exist = false)
|
||||
private String itemDesc;
|
||||
|
||||
@ApiModelProperty(value = "物料单位")
|
||||
@TableField(exist = false)
|
||||
private String unitOfMeasure;
|
||||
|
||||
@ApiModelProperty(value = "现有数量")
|
||||
private BigDecimal qtyOnHand;
|
||||
|
||||
@ApiModelProperty(value = "原始批次数量")
|
||||
private BigDecimal originalQty;
|
||||
|
||||
@ApiModelProperty(value = "物料批号")
|
||||
private String materialLot;
|
||||
|
||||
@ApiModelProperty(value = "父物料批次")
|
||||
private String parentMaterialLot;
|
||||
|
||||
@ApiModelProperty(value = "仓库主键")
|
||||
private String wmsWarehouseBo;
|
||||
|
||||
@ApiModelProperty(value = "存储货格主键")
|
||||
private String wmsStorageBinBo;
|
||||
|
||||
@ApiModelProperty(value = "是否由ERP创建")
|
||||
private String erpInventory;
|
||||
|
||||
@ApiModelProperty(value = "供货商编号")
|
||||
private String supplierNo;
|
||||
|
||||
@ApiModelProperty(value = "供货商批次")
|
||||
private String supplierBatch;
|
||||
|
||||
@ApiModelProperty(value = "客户主数据主键")
|
||||
private String customerBasisBo;
|
||||
|
||||
@ApiModelProperty(value = "生产批序号")
|
||||
private String lotSerial;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "货架编号")
|
||||
private String rackNo;
|
||||
|
||||
@ApiModelProperty(value = "货位编号")
|
||||
private String locationNo;
|
||||
|
||||
@ApiModelProperty(value = "制造日期")
|
||||
private LocalDateTime dateMfg;
|
||||
|
||||
@ApiModelProperty(value = "到期日")
|
||||
private LocalDateTime dateExp;
|
||||
|
||||
@ApiModelProperty(value = "库存日期")
|
||||
private LocalDateTime dateInventory;
|
||||
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private LocalDateTime dateCreate;
|
||||
|
||||
@ApiModelProperty(value = "创建人员")
|
||||
private String creator;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime dateUpdate;
|
||||
|
||||
@ApiModelProperty(value = "更新人员")
|
||||
private String updater;
|
||||
|
||||
@ApiModelProperty(value = "扩展字段1")
|
||||
private String ext01;
|
||||
@ApiModelProperty(value = "扩展字段2")
|
||||
private String ext02;
|
||||
@ApiModelProperty(value = "扩展字段3")
|
||||
private String ext03;
|
||||
@ApiModelProperty(value = "扩展字段4")
|
||||
private String ext04;
|
||||
@ApiModelProperty(value = "扩展字段5")
|
||||
private String ext05;
|
||||
|
||||
@ApiModelProperty(value = "副数量")
|
||||
private BigDecimal deputyQty;
|
||||
@ApiModelProperty(value = "副单位")
|
||||
private String deputyUom;
|
||||
@ApiModelProperty(value = "主单位")
|
||||
private String mainUom;
|
||||
@ApiModelProperty(value = "特殊库存标识")
|
||||
private String sobkz;
|
||||
@ApiModelProperty(value = "销售订单行号")
|
||||
private String vgbelLineNumber;
|
||||
@ApiModelProperty(value = "销售订单号")
|
||||
private String vgbel;
|
||||
@ApiModelProperty(value = "拆分单据号")
|
||||
private String documentNo;
|
||||
@ApiModelProperty(value = "单据类型")
|
||||
private String documentType;
|
||||
/**
|
||||
* 托号
|
||||
*/
|
||||
@ApiModelProperty(value="托号")
|
||||
private String packageNumber;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String newPackageNumber;
|
||||
|
||||
/**
|
||||
* 料件标识(0:SAP料号、1:U8料号)
|
||||
*/
|
||||
@ApiModelProperty(value="料件标识(0:SAP料号、1:U8料号)")
|
||||
private String itemFlag;
|
||||
@TableField(exist = false)
|
||||
private String moveType;
|
||||
|
||||
/**
|
||||
* 质检等级
|
||||
*/
|
||||
@ApiModelProperty(value = "质检等级")
|
||||
private String inspectionLevel;
|
||||
|
||||
public static String genHandle(String site, String itemBo, String materialLot) {
|
||||
return HandleBoProcessor.genHandle(KW_WMS_INVENTORY_BO, site, itemBo, materialLot);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,138 +0,0 @@
|
||||
package com.foreverwin.nlv.wms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 库存移动日志记录表
|
||||
*
|
||||
* @author Snow
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
@Data
|
||||
@TableName("wms_inventory_log")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "库存移动日志记录表")
|
||||
public class WmsInventoryLog extends Model<WmsInventoryLog> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty(value = "站点")
|
||||
private String site;
|
||||
|
||||
@ApiModelProperty(value = "关联物料主键")
|
||||
private String itemBo;
|
||||
|
||||
@ApiModelProperty(value = "现有数量")
|
||||
private BigDecimal qtyOnHand;
|
||||
|
||||
@ApiModelProperty(value = "原始批次数量")
|
||||
private BigDecimal originalQty;
|
||||
|
||||
@ApiModelProperty(value = "物料批号")
|
||||
private String materialLot;
|
||||
|
||||
@ApiModelProperty(value = "父物料批次")
|
||||
private String parentMaterialLot;
|
||||
|
||||
@ApiModelProperty(value = "仓库主键")
|
||||
private String wmsWarehouseBo;
|
||||
|
||||
@ApiModelProperty(value = "存储货格主键")
|
||||
private String wmsStorageBinBo;
|
||||
|
||||
@ApiModelProperty(value = "是否由ERP创建")
|
||||
private String erpInventory;
|
||||
|
||||
@ApiModelProperty(value = "供货商编号")
|
||||
private String supplierNo;
|
||||
|
||||
@ApiModelProperty(value = "供货商批次")
|
||||
private String supplierBatch;
|
||||
|
||||
@ApiModelProperty(value = "客户主数据主键")
|
||||
private String customerBasisBo;
|
||||
|
||||
@ApiModelProperty(value = "生产批序号")
|
||||
private String lotSerial;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "货架编号")
|
||||
private String rackNo;
|
||||
|
||||
@ApiModelProperty(value = "货位编号")
|
||||
private String locationNo;
|
||||
|
||||
@ApiModelProperty(value = "制造日期")
|
||||
private LocalDateTime dateMfg;
|
||||
|
||||
@ApiModelProperty(value = "到期日")
|
||||
private LocalDateTime dateExp;
|
||||
|
||||
@ApiModelProperty(value = "库存日期")
|
||||
private LocalDateTime dateInventory;
|
||||
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private LocalDateTime dateCreate;
|
||||
|
||||
@ApiModelProperty(value = "创建人员")
|
||||
private String creator;
|
||||
|
||||
@ApiModelProperty(value = "扩展字段1")
|
||||
private String ext01;
|
||||
@ApiModelProperty(value = "扩展字段2")
|
||||
private String ext02;
|
||||
@ApiModelProperty(value = "扩展字段3")
|
||||
private String ext03;
|
||||
@ApiModelProperty(value = "扩展字段4")
|
||||
private String ext04;
|
||||
@ApiModelProperty(value = "扩展字段5")
|
||||
private String ext05;
|
||||
|
||||
@ApiModelProperty(value = "扩展字段5")
|
||||
private String moveType;
|
||||
|
||||
@ApiModelProperty(value = "副数量")
|
||||
private BigDecimal deputyQty;
|
||||
@ApiModelProperty(value = "副单位")
|
||||
private String deputyUom;
|
||||
@ApiModelProperty(value = "主单位")
|
||||
private String mainUom;
|
||||
@ApiModelProperty(value = "特殊库存标识")
|
||||
private String sobkz;
|
||||
@ApiModelProperty(value = "销售订单行号")
|
||||
private String vgbelLineNumber;
|
||||
@ApiModelProperty(value = "销售订单号")
|
||||
private String vgbel;
|
||||
@ApiModelProperty(value = "拆分单据号")
|
||||
private String documentNo;
|
||||
@ApiModelProperty(value = "单据类型")
|
||||
private String documentType;
|
||||
/**
|
||||
* 托号
|
||||
*/
|
||||
@ApiModelProperty(value="托号")
|
||||
private String packageNumber;
|
||||
|
||||
/**
|
||||
* 料件标识(0:SAP料号、1:U8料号)
|
||||
*/
|
||||
@ApiModelProperty(value="料件标识(0:SAP料号、1:U8料号)")
|
||||
private String itemFlag;
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package com.foreverwin.nlv.wms.feign;
|
||||
|
||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
@FeignClient(contextId = "remoteWmsInventoryService", value = "nlv-wms")
|
||||
public interface RemoteWmsInventoryService {
|
||||
/**
|
||||
* 更新库存
|
||||
*/
|
||||
@PostMapping("/wmsInventory/updateInventory")
|
||||
R<Boolean> remoteInventory(@RequestBody WmsInventory wmsInventory);
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@PostMapping("wmsInventory/api/selectById")
|
||||
R<WmsInventory> selectById(@RequestBody WmsInventory wmsInventory);
|
||||
}
|
||||
@ -137,11 +137,6 @@
|
||||
<artifactId>qms-api</artifactId>
|
||||
<version>4.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.foreverwin</groupId>
|
||||
<artifactId>mes-api</artifactId>
|
||||
<version>4.5.0</version>
|
||||
</dependency>
|
||||
<!--<dependency>
|
||||
<groupId>com.foreverwin</groupId>
|
||||
<artifactId>jxls-api</artifactId>
|
||||
|
||||
@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/barCodeQuery" )
|
||||
@RequestMapping("/barCodeQuery")
|
||||
public class BarCodeQueryController {
|
||||
|
||||
/*
|
||||
@ -18,10 +18,10 @@ public class BarCodeQueryController {
|
||||
return R.ok(barCodeQueryService.getObjByInventoryId(InventoryId));
|
||||
}
|
||||
*//**
|
||||
* 标签打印
|
||||
* @param inventoryDto inventoryDto
|
||||
* @return R
|
||||
*//*
|
||||
* 标签打印
|
||||
* @param inventoryDto inventoryDto
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "库存查询标签打印", notes = "库存查询标签打印")
|
||||
@GetMapping("/labelPrint" )
|
||||
public R labelRePrint(wmsInventoryDto inventoryDto) {
|
||||
|
||||
@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/barcode-creation" )
|
||||
@RequestMapping("/barcode-creation")
|
||||
public class BarcodeCreationLogController {
|
||||
/*
|
||||
private final BarcodeCreationLogService barcodeCreationLogService;
|
||||
|
||||
@ -25,24 +25,24 @@ import java.io.IOException;
|
||||
@Api(value = "complexReport")
|
||||
public class ComplexReportController {
|
||||
|
||||
@Autowired
|
||||
private ComplexReportService complexReportService;
|
||||
@Autowired
|
||||
private ComplexReportService complexReportService;
|
||||
|
||||
@ApiOperation(value = "备货汇总报表分页查询", notes = "备货汇总报表分页查询")
|
||||
@GetMapping("/list")
|
||||
public R list(String documentNo, String startS, String endS, String erpNo) {
|
||||
return R.ok(complexReportService.selectPickingStatisticsReport(documentNo, startS, endS, erpNo));
|
||||
}
|
||||
@ApiOperation(value = "备货汇总报表分页查询", notes = "备货汇总报表分页查询")
|
||||
@GetMapping("/list")
|
||||
public R list(String documentNo, String startS, String endS, String erpNo) {
|
||||
return R.ok(complexReportService.selectPickingStatisticsReport(documentNo, startS, endS, erpNo));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "备货汇总报表分页查询", notes = "备货汇总报表分页查询")
|
||||
@GetMapping("/page")
|
||||
public R page(Page page, String documentNo, String startS, String endS, String erpNo) {
|
||||
return R.ok(complexReportService.selectPickingStatisticsReport(page, documentNo, startS, endS, erpNo));
|
||||
}
|
||||
@ApiOperation(value = "备货汇总报表分页查询", notes = "备货汇总报表分页查询")
|
||||
@GetMapping("/page")
|
||||
public R page(Page page, String documentNo, String startS, String endS, String erpNo) {
|
||||
return R.ok(complexReportService.selectPickingStatisticsReport(page, documentNo, startS, endS, erpNo));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "备货汇总报表导出", notes = "备货汇总报表导出")
|
||||
@GetMapping("/export")
|
||||
public void export(String documentNo, String startS, String endS, String erpNo) throws IOException {
|
||||
complexReportService.export(documentNo, startS, endS, erpNo);
|
||||
}
|
||||
@ApiOperation(value = "备货汇总报表导出", notes = "备货汇总报表导出")
|
||||
@GetMapping("/export")
|
||||
public void export(String documentNo, String startS, String endS, String erpNo) throws IOException {
|
||||
complexReportService.export(documentNo, startS, endS, erpNo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/customer" )
|
||||
@RequestMapping("/customer")
|
||||
@Api(value = "customer", tags = "客户维护管理")
|
||||
public class CustomerController {
|
||||
|
||||
@ -30,19 +30,20 @@ public class CustomerController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param customer 客户维护
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getCustomerPage(FrontPage<Customer> page, Customer customer) {
|
||||
String searchText = page.getSearchText();
|
||||
QueryWrapper<Customer> query = Wrappers.query(customer);
|
||||
if (StrUtil.isNotBlank(searchText)){
|
||||
query.lambda().and(qw -> qw.like(Customer::getCustomer,searchText).or().like(Customer::getCustomerName,searchText));
|
||||
}
|
||||
return R.ok(customerService.page(page, query));
|
||||
String searchText = page.getSearchText();
|
||||
QueryWrapper<Customer> query = Wrappers.query(customer);
|
||||
if (StrUtil.isNotBlank(searchText)) {
|
||||
query.lambda().and(qw -> qw.like(Customer::getCustomer, searchText).or().like(Customer::getCustomerName, searchText));
|
||||
}
|
||||
return R.ok(customerService.page(page, query));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -41,8 +41,8 @@ public class CuttingInventoryController {
|
||||
private final CuttingInventoryService cuttingInventoryService;
|
||||
private final WmsCuttingPackageService wmsCuttingPackageService;
|
||||
|
||||
private static String urlStr = "http://10.10.11.51:3001";
|
||||
|
||||
private static final String urlStr = "http://10.10.11.51:3001";
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -55,8 +55,8 @@ public class CuttingInventoryController {
|
||||
public R getCuttingInventoryPage(Page page, CuttingInventory cuttingInventory) {
|
||||
return R.ok(cuttingInventoryService.page(page, Wrappers.query(cuttingInventory)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询线边盘点临时数据接口用
|
||||
*
|
||||
@ -68,7 +68,7 @@ public class CuttingInventoryController {
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(cuttingInventoryService.getById(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增线边盘点临时数据接口用
|
||||
*
|
||||
@ -83,7 +83,7 @@ public class CuttingInventoryController {
|
||||
CuttingInventory.genHandle(TenantContextHolder.getTenantId(), cuttingInventory.getInventoryId()));
|
||||
return R.ok(cuttingInventoryService.save(cuttingInventory));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增或修改线边盘点临时数据接口用
|
||||
*
|
||||
@ -101,7 +101,7 @@ public class CuttingInventoryController {
|
||||
cuttingInventory.setUpdater(SecurityUtils.getUserName());
|
||||
cuttingInventory.setDateUpdate(LocalDateTime.now());
|
||||
cuttingInventoryService.saveOrUpdate(cuttingInventory);
|
||||
|
||||
|
||||
// 创建WmsCuttingPackage对象
|
||||
WmsCuttingPackage wmsCuttingPackage = new WmsCuttingPackage();
|
||||
wmsCuttingPackage.setSite(site);
|
||||
@ -121,7 +121,7 @@ public class CuttingInventoryController {
|
||||
wmsCuttingPackageService.saveOrUpdate(wmsCuttingPackage);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改线边盘点临时数据接口用
|
||||
*
|
||||
@ -134,7 +134,7 @@ public class CuttingInventoryController {
|
||||
public R updateById(@RequestBody CuttingInventory cuttingInventory) {
|
||||
return R.ok(cuttingInventoryService.updateById(cuttingInventory));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除线边盘点临时数据接口用
|
||||
*
|
||||
@ -147,8 +147,8 @@ public class CuttingInventoryController {
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(cuttingInventoryService.removeById(handle));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
@ -160,8 +160,8 @@ public class CuttingInventoryController {
|
||||
public List<CuttingInventory> export(CuttingInventory cuttingInventory) {
|
||||
return cuttingInventoryService.list(Wrappers.query(cuttingInventory));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 扫描卷号后,调用分切小程序查询卷号信息
|
||||
*
|
||||
@ -174,17 +174,17 @@ public class CuttingInventoryController {
|
||||
public R getInventoryForFq(@PathVariable String sapItem) {
|
||||
HttpResponse httpResponse;
|
||||
try {
|
||||
httpResponse = HttpRequest.get(urlStr+"/api/slitting/" + sapItem).header("Authorization",
|
||||
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDgxMzg3MjQsImlhdCI6MTY0ODA1MjMyNCwiaXNzIjoiZ2l0aHViLmNvbS9saWJyYXJ5L2ZlbGl4IiwiVXNlciI6eyJpZCI6MSwiY3JlYXRlZEF0IjoxLCJ1cGRhdGVkQXQiOjEsImNQc25fTnVtIjoiMSIsImNQc25fTmFtZSI6Iua1i-ivlWFkbWluIiwiY0RlcHRfbnVtIjoiMSIsInJQZXJzb25UeXBlIjoiMSIsInJTZXgiOiIxIiwiZEJpcnRoRGF0ZSI6IjEiLCJyTmF0aXZlUGxhY2UiOiIxIiwick5hdGlvbmFsIjoiMSIsInJoZWFsdGhTdGF0dXMiOiIxIiwick1hcnJpU3RhdHVzIjoiMSIsInZJRE5vIjoiMSIsInJQZXJSZXNpZGVuY2UiOiIxIiwidkFsaWFOYW1lIjoiMSIsImRKb2lud29ya0RhdGUiOiIxIiwiZFJlZ3VsYXJEYXRlIjoiMSIsInZDYXJkTm8iOiIxIiwidXNlcm5hbWUiOiJhZG1pbiIsInBhc3N3b3JkIjoiIn19.-NKBZjgm6LdjvE4s27pzvFCeGFYZg3ObNaiqVPQ5rfc")
|
||||
.setReadTimeout(60000).execute();
|
||||
|
||||
httpResponse = HttpRequest.get(urlStr + "/api/slitting/" + sapItem).header("Authorization",
|
||||
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDgxMzg3MjQsImlhdCI6MTY0ODA1MjMyNCwiaXNzIjoiZ2l0aHViLmNvbS9saWJyYXJ5L2ZlbGl4IiwiVXNlciI6eyJpZCI6MSwiY3JlYXRlZEF0IjoxLCJ1cGRhdGVkQXQiOjEsImNQc25fTnVtIjoiMSIsImNQc25fTmFtZSI6Iua1i-ivlWFkbWluIiwiY0RlcHRfbnVtIjoiMSIsInJQZXJzb25UeXBlIjoiMSIsInJTZXgiOiIxIiwiZEJpcnRoRGF0ZSI6IjEiLCJyTmF0aXZlUGxhY2UiOiIxIiwick5hdGlvbmFsIjoiMSIsInJoZWFsdGhTdGF0dXMiOiIxIiwick1hcnJpU3RhdHVzIjoiMSIsInZJRE5vIjoiMSIsInJQZXJSZXNpZGVuY2UiOiIxIiwidkFsaWFOYW1lIjoiMSIsImRKb2lud29ya0RhdGUiOiIxIiwiZFJlZ3VsYXJEYXRlIjoiMSIsInZDYXJkTm8iOiIxIiwidXNlcm5hbWUiOiJhZG1pbiIsInBhc3N3b3JkIjoiIn19.-NKBZjgm6LdjvE4s27pzvFCeGFYZg3ObNaiqVPQ5rfc")
|
||||
.setReadTimeout(60000).execute();
|
||||
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.build("接口存在异常:" + e.getMessage());
|
||||
}
|
||||
if (httpResponse == null || httpResponse.getStatus() != 200) {
|
||||
throw BusinessException.build("接口存在异常");
|
||||
}
|
||||
|
||||
|
||||
String responseBody = httpResponse.body();
|
||||
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(responseBody);
|
||||
String code = jsonObject.getString("code");
|
||||
@ -193,7 +193,7 @@ public class CuttingInventoryController {
|
||||
if ("1".equals(code)) {
|
||||
throw BusinessException.build("接口返回:" + message);
|
||||
}
|
||||
|
||||
|
||||
JSONObject entries = JSONUtil.parseObj(data);
|
||||
// 返回前端
|
||||
CuttingInventory cuttingInventory = new CuttingInventory();
|
||||
@ -221,7 +221,7 @@ public class CuttingInventoryController {
|
||||
cuttingInventory.setClientprodctspec(
|
||||
entries.get("clientProductSpec") == null ? "" : entries.get("clientProductSpec").toString());
|
||||
String sapProductNumber = entries.get("sapProductNumber") == null ? "" : entries.get("sapProductNumber")
|
||||
.toString();
|
||||
.toString();
|
||||
cuttingInventory.setSapProductNumber(sapProductNumber);
|
||||
cuttingInventory.setSapProductName(
|
||||
entries.get("sapProductName") == null ? "" : entries.get("sapProductName").toString());
|
||||
@ -246,7 +246,7 @@ public class CuttingInventoryController {
|
||||
@ApiOperation(value = "扫描卷号后,调用分切小程序查询卷号信息", notes = "扫描卷号后,调用分切小程序查询卷号信息")
|
||||
@SysLog("扫描卷号后,调用分切小程序查询卷号信息")
|
||||
@GetMapping("/getInventoryForFqPlanB/{sapItem}/{stage}")
|
||||
public R getInventoryForFqPlanB(@PathVariable String sapItem,@PathVariable String stage) {
|
||||
public R getInventoryForFqPlanB(@PathVariable String sapItem, @PathVariable String stage) {
|
||||
return R.ok(cuttingInventoryService.batchNumberScanWhiteCheck(sapItem, stage));
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/daily-balance" )
|
||||
@RequestMapping("/daily-balance")
|
||||
@Api(value = "daily-balance", tags = "日结存报表管理")
|
||||
public class DailyBalanceController {
|
||||
|
||||
@ -31,26 +31,27 @@ public class DailyBalanceController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param dailyBalance 日结存报表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getDailyBalancePage(FrontPage page, DailyBalance dailyBalance) {
|
||||
dailyBalance.setSite(TenantContextHolder.getTenantId());
|
||||
QueryWrapper<DailyBalance> queryWrapper = new QueryWrapper<>(dailyBalance);
|
||||
if (page.getSearchText() != null && !"".equals(page.getSearchText().trim())) {
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(DailyBalance::getDateTime, page.getSearchText())
|
||||
.or().like(DailyBalance::getErpStorageLocation, page.getSearchText())
|
||||
.or().like(DailyBalance::getStorageLocation, page.getSearchText())
|
||||
.or().like(DailyBalance::getItem, page.getSearchText())
|
||||
.or().like(DailyBalance::getItemDescription, page.getSearchText())
|
||||
.or().like(DailyBalance::getUnit, page.getSearchText())
|
||||
.or().like(DailyBalance::getBatch, page.getSearchText())
|
||||
.or().like(DailyBalance::getVendorBatch, page.getSearchText())
|
||||
.or().like(DailyBalance::getCreator, page.getSearchText())
|
||||
.like(DailyBalance::getDateTime, page.getSearchText())
|
||||
.or().like(DailyBalance::getErpStorageLocation, page.getSearchText())
|
||||
.or().like(DailyBalance::getStorageLocation, page.getSearchText())
|
||||
.or().like(DailyBalance::getItem, page.getSearchText())
|
||||
.or().like(DailyBalance::getItemDescription, page.getSearchText())
|
||||
.or().like(DailyBalance::getUnit, page.getSearchText())
|
||||
.or().like(DailyBalance::getBatch, page.getSearchText())
|
||||
.or().like(DailyBalance::getVendorBatch, page.getSearchText())
|
||||
.or().like(DailyBalance::getCreator, page.getSearchText())
|
||||
);
|
||||
}
|
||||
return R.ok(dailyBalanceService.page(page, queryWrapper));
|
||||
@ -59,24 +60,26 @@ public class DailyBalanceController {
|
||||
|
||||
/**
|
||||
* 通过id查询日结存报表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(dailyBalanceService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增日结存报表
|
||||
*
|
||||
* @param
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增日结存报表", notes = "新增日结存报表")
|
||||
@SysLog("新增日结存报表" )
|
||||
@SysLog("新增日结存报表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_daily_balance_save')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_daily_balance_save')")
|
||||
public R save() {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
@ -85,27 +88,30 @@ public class DailyBalanceController {
|
||||
|
||||
/**
|
||||
* 修改日结存报表
|
||||
*
|
||||
* @param dailyBalance 日结存报表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改日结存报表", notes = "修改日结存报表")
|
||||
@SysLog("修改日结存报表" )
|
||||
@SysLog("修改日结存报表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_daily_balance_save')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_daily_balance_save')")
|
||||
public R updateById(@RequestBody DailyBalance dailyBalance) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
return R.ok(dailyBalanceService.updateById(site, dailyBalance));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除日结存报表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除日结存报表", notes = "通过id删除日结存报表")
|
||||
@SysLog("通过id删除日结存报表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_daily_balance_del')" )
|
||||
@SysLog("通过id删除日结存报表")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_daily_balance_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(dailyBalanceService.removeById(handle));
|
||||
}
|
||||
|
||||
@ -15,39 +15,41 @@ public class DataImportController {
|
||||
|
||||
// private final DataImportService dataImportService;
|
||||
|
||||
private final ExportTemplateService exportTemplateService;
|
||||
private final ExportTemplateService exportTemplateService;
|
||||
|
||||
@PostMapping("/import-document")
|
||||
@ResponseBody
|
||||
public R importX(MultipartFile file, String importType, String optionValue) {
|
||||
try {
|
||||
@PostMapping("/import-document")
|
||||
@ResponseBody
|
||||
public R importX(MultipartFile file, String importType, String optionValue) {
|
||||
try {
|
||||
// dataImportService.importX(file, importType, null)
|
||||
return R.ok();
|
||||
} catch (Exception e) {
|
||||
return R.failed(e.getMessage());
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
} catch (Exception e) {
|
||||
return R.failed(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/export-document-template")
|
||||
@ResponseBody
|
||||
public void exportTemplate(String importType) throws IOException {
|
||||
exportTemplateService.exportX(importType);
|
||||
}
|
||||
//单据预绑信息导入
|
||||
@PostMapping("/import-receipt")
|
||||
@ResponseBody
|
||||
public R importFile(MultipartFile file,String importType,String optionValue ){
|
||||
try {
|
||||
@GetMapping("/export-document-template")
|
||||
@ResponseBody
|
||||
public void exportTemplate(String importType) throws IOException {
|
||||
exportTemplateService.exportX(importType);
|
||||
}
|
||||
|
||||
//单据预绑信息导入
|
||||
@PostMapping("/import-receipt")
|
||||
@ResponseBody
|
||||
public R importFile(MultipartFile file, String importType, String optionValue) {
|
||||
try {
|
||||
// dataImportService.importFile(file,importType,optionValue)
|
||||
return R.ok();
|
||||
}catch (Exception e){
|
||||
return R.failed(e.getMessage());
|
||||
}
|
||||
}
|
||||
//单据预绑信息导出
|
||||
@GetMapping("/export-receipt-template")
|
||||
@ResponseBody
|
||||
public void exportTemplates(String importType) throws IOException {
|
||||
exportTemplateService.exportS(importType);
|
||||
}
|
||||
return R.ok();
|
||||
} catch (Exception e) {
|
||||
return R.failed(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//单据预绑信息导出
|
||||
@GetMapping("/export-receipt-template")
|
||||
@ResponseBody
|
||||
public void exportTemplates(String importType) throws IOException {
|
||||
exportTemplateService.exportS(importType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,45 +27,45 @@ import java.util.List;
|
||||
@Api(value = "dn-order", tags = "DN单主表管理")
|
||||
public class DnOrderController {
|
||||
|
||||
private final DnOrderService dnOrderService;
|
||||
private final DnOrderService dnOrderService;
|
||||
|
||||
private final DnOrderDetailService dnOrderDetailService;
|
||||
private final DnOrderDetailService dnOrderDetailService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param dnOrder DN单主表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getDnOrderPage(Page page, DnOrder dnOrder) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
return R.ok(dnOrderService.pageWithDocument(page, site, dnOrder));
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param dnOrder DN单主表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getDnOrderPage(Page page, DnOrder dnOrder) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
return R.ok(dnOrderService.pageWithDocument(page, site, dnOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询子表明细
|
||||
*
|
||||
* @param dnOrderBo 主表主键
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询明细", notes = "查询明细")
|
||||
@GetMapping("/selectDetailByID")
|
||||
public R selectDetailByID(String dnOrderBo) {
|
||||
return R.ok(dnOrderDetailService.list(Wrappers.lambdaQuery(DnOrderDetail.class).eq(DnOrderDetail::getDnOrderBo, dnOrderBo)));
|
||||
}
|
||||
/**
|
||||
* 查询子表明细
|
||||
*
|
||||
* @param dnOrderBo 主表主键
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询明细", notes = "查询明细")
|
||||
@GetMapping("/selectDetailByID")
|
||||
public R selectDetailByID(String dnOrderBo) {
|
||||
return R.ok(dnOrderDetailService.list(Wrappers.lambdaQuery(DnOrderDetail.class).eq(DnOrderDetail::getDnOrderBo, dnOrderBo)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新明细
|
||||
*
|
||||
* @param dnOrderDetailList 更新列表,主键必填
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询明细", notes = "查询明细")
|
||||
@PutMapping("/updateDetailBatchById")
|
||||
public R updateDetailBatchById(@RequestBody List<DnOrderDetail> dnOrderDetailList) {
|
||||
return R.ok(dnOrderDetailService.updateBatchById(dnOrderDetailList));
|
||||
}
|
||||
/**
|
||||
* 更新明细
|
||||
*
|
||||
* @param dnOrderDetailList 更新列表,主键必填
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询明细", notes = "查询明细")
|
||||
@PutMapping("/updateDetailBatchById")
|
||||
public R updateDetailBatchById(@RequestBody List<DnOrderDetail> dnOrderDetailList) {
|
||||
return R.ok(dnOrderDetailService.updateBatchById(dnOrderDetailList));
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,19 +22,19 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Api(value = "document-advance-bind", tags = "单据预绑表管理")
|
||||
public class DocumentAdvanceBindController {
|
||||
|
||||
private final DocumentAdvanceBindService documentAdvanceBindService;
|
||||
private final DocumentAdvanceBindService documentAdvanceBindService;
|
||||
|
||||
@GetMapping("/scanCode")
|
||||
public R scanCode(String documentNo, String code, String item, String batch) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
return R.ok(documentAdvanceBindService.scanCode(site, user, documentNo, code, item, batch, false));
|
||||
}
|
||||
@GetMapping("/scanCode")
|
||||
public R scanCode(String documentNo, String code, String item, String batch) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
return R.ok(documentAdvanceBindService.scanCode(site, user, documentNo, code, item, batch, false));
|
||||
}
|
||||
|
||||
@GetMapping("/scanCodeOnlyTray")
|
||||
public R scanCodeOnlyTray(String documentNo, String code, String item, String batch) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
return R.ok(documentAdvanceBindService.scanCode(site, user, documentNo, code, item, batch, true));
|
||||
}
|
||||
@GetMapping("/scanCodeOnlyTray")
|
||||
public R scanCodeOnlyTray(String documentNo, String code, String item, String batch) {
|
||||
String site = TenantContextHolder.getTenantStrId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
return R.ok(documentAdvanceBindService.scanCode(site, user, documentNo, code, item, batch, true));
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ public class DocumentSummaryReportController {
|
||||
@ResponseBody
|
||||
@PostMapping("/selectPage")
|
||||
public R retrieve(Page<DocumentSummaryReportDto> page, @RequestBody DocumentSummaryReportDto documentSummaryReportDto) {
|
||||
return R.ok(documentSummaryReportService.doRetrieve(page,documentSummaryReportDto));
|
||||
return R.ok(documentSummaryReportService.doRetrieve(page, documentSummaryReportDto));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,7 +53,7 @@ public class DocumentSummaryReportController {
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/tablePageExport")
|
||||
public void tablePageExport( DocumentSummaryReportDto documentSummaryReportDto) throws Exception{
|
||||
public void tablePageExport(DocumentSummaryReportDto documentSummaryReportDto) throws Exception {
|
||||
List<DocumentSummaryReportDto> documentSummaryReportDtoList = documentSummaryReportService.doSelect(documentSummaryReportDto);
|
||||
String fileName = "单据汇总报表";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
@ -66,13 +66,15 @@ public class DocumentSummaryReportController {
|
||||
EasyExcel.write(response.getOutputStream(), DocumentSummaryReport.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(documentSummaryReportDtoList);
|
||||
}
|
||||
|
||||
//获取来源仓数据
|
||||
@ResponseBody
|
||||
@GetMapping("/sourceWarehouse/page")
|
||||
public R page(Page<DocumentSummaryReportDto> frontPage, String searchText) {
|
||||
IPage<DocumentSummaryReportDto> sourceWarehouseIPage = documentSummaryReportService.getAllSourceWarehouse(frontPage, searchText);
|
||||
IPage<DocumentSummaryReportDto> sourceWarehouseIPage = documentSummaryReportService.getAllSourceWarehouse(frontPage, searchText);
|
||||
return R.ok(sourceWarehouseIPage);
|
||||
}
|
||||
|
||||
//获取目标仓数据
|
||||
@ResponseBody
|
||||
@GetMapping("/targetWarehouse/page")
|
||||
@ -80,13 +82,15 @@ public class DocumentSummaryReportController {
|
||||
IPage<DocumentSummaryReportDto> targetWarehouseIPage = documentSummaryReportService.getAllTargetWarehouse(frontPage, searchText);
|
||||
return R.ok(targetWarehouseIPage);
|
||||
}
|
||||
|
||||
//单据明细报表
|
||||
@ResponseBody
|
||||
@PostMapping("/selectDocumentDetailedPage")
|
||||
public R retrieveDocumentDetailed(FrontPage<DocumentSummaryReportDto> page, @RequestBody DocumentSummaryReportDto documentSummaryReportDto) {
|
||||
page.setOptimizeCountSql(false);
|
||||
return R.ok(documentSummaryReportService.doRetrieveDocumentDetailed(page,documentSummaryReportDto));
|
||||
return R.ok(documentSummaryReportService.doRetrieveDocumentDetailed(page, documentSummaryReportDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单据明细表导出
|
||||
*
|
||||
@ -94,7 +98,7 @@ public class DocumentSummaryReportController {
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/tableDetailedPageExport")
|
||||
public void tableDetailedPageExport( DocumentSummaryReportDto documentSummaryReportDto) throws Exception {
|
||||
public void tableDetailedPageExport(DocumentSummaryReportDto documentSummaryReportDto) throws Exception {
|
||||
List<DocumentSummaryReportDto> documentDetailReportDtoList = documentSummaryReportService.doDetailedSelect(documentSummaryReportDto);
|
||||
String fileName = "单据明细报表";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
@ -104,10 +108,10 @@ public class DocumentSummaryReportController {
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
EasyExcel.write(response.getOutputStream(), DocumentDetailedReport.class)
|
||||
EasyExcel.write(response.getOutputStream(), DocumentDetailedReport.class)
|
||||
.registerWriteHandler(widthStyleStrategy)
|
||||
.autoCloseStream(Boolean.FALSE)
|
||||
.sheet(fileName)
|
||||
.doWrite(documentDetailReportDtoList);
|
||||
}
|
||||
.doWrite(documentDetailReportDtoList);
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,129 +39,129 @@ import java.util.stream.Collectors;
|
||||
@Api(value = "falseWarehoursing", tags = "无实物入库表管理")
|
||||
public class FalseWarehoursingController {
|
||||
|
||||
private final FalseWarehoursingService falseWarehoursingService;
|
||||
private final FalseWarehoursingService falseWarehoursingService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param falseWarehoursing 无实物入库表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R pageForExtConsign(Page page, FalseWarehoursing falseWarehoursing) {
|
||||
LambdaQueryWrapper<FalseWarehoursing> falseWarehoursingLambdaQueryWrapper = Wrappers.lambdaQuery(FalseWarehoursing.class).setEntity(falseWarehoursing);
|
||||
if (StrUtil.isBlank(falseWarehoursing.getType())) {
|
||||
falseWarehoursingLambdaQueryWrapper.in(FalseWarehoursing::getType, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE);
|
||||
}
|
||||
return R.ok(falseWarehoursingService.page(page, falseWarehoursingLambdaQueryWrapper));
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param falseWarehoursing 无实物入库表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R pageForExtConsign(Page page, FalseWarehoursing falseWarehoursing) {
|
||||
LambdaQueryWrapper<FalseWarehoursing> falseWarehoursingLambdaQueryWrapper = Wrappers.lambdaQuery(FalseWarehoursing.class).setEntity(falseWarehoursing);
|
||||
if (StrUtil.isBlank(falseWarehoursing.getType())) {
|
||||
falseWarehoursingLambdaQueryWrapper.in(FalseWarehoursing::getType, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE);
|
||||
}
|
||||
return R.ok(falseWarehoursingService.page(page, falseWarehoursingLambdaQueryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param page
|
||||
* @param falseWarehoursing
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page2")
|
||||
public R pageForMatCustomer(Page page, FalseWarehoursing falseWarehoursing) {
|
||||
LambdaQueryWrapper<FalseWarehoursing> falseWarehoursingLambdaQueryWrapper = Wrappers.lambdaQuery(FalseWarehoursing.class).setEntity(falseWarehoursing);
|
||||
if (StrUtil.isBlank(falseWarehoursing.getType())) {
|
||||
falseWarehoursingLambdaQueryWrapper.in(FalseWarehoursing::getType, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER);
|
||||
}
|
||||
return R.ok(falseWarehoursingService.page(page, falseWarehoursingLambdaQueryWrapper));
|
||||
}
|
||||
/**
|
||||
* @param page
|
||||
* @param falseWarehoursing
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page2")
|
||||
public R pageForMatCustomer(Page page, FalseWarehoursing falseWarehoursing) {
|
||||
LambdaQueryWrapper<FalseWarehoursing> falseWarehoursingLambdaQueryWrapper = Wrappers.lambdaQuery(FalseWarehoursing.class).setEntity(falseWarehoursing);
|
||||
if (StrUtil.isBlank(falseWarehoursing.getType())) {
|
||||
falseWarehoursingLambdaQueryWrapper.in(FalseWarehoursing::getType, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER);
|
||||
}
|
||||
return R.ok(falseWarehoursingService.page(page, falseWarehoursingLambdaQueryWrapper));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "外仓库存导出", notes = "外仓库存导出")
|
||||
@GetMapping("/export")
|
||||
public void exportForExtConsign(FalseWarehoursing falseWarehoursing) throws IOException {
|
||||
LambdaQueryWrapper<FalseWarehoursing> falseWarehoursingLambdaQueryWrapper = Wrappers.lambdaQuery(FalseWarehoursing.class).setEntity(falseWarehoursing);
|
||||
if (StrUtil.isBlank(falseWarehoursing.getType())) {
|
||||
falseWarehoursingLambdaQueryWrapper.in(FalseWarehoursing::getType, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE);
|
||||
}
|
||||
List<FalseWarehoursingExportDTO> data = falseWarehoursingService.list(falseWarehoursingLambdaQueryWrapper).stream().map(o -> {
|
||||
FalseWarehoursingExportDTO exportDTO = new FalseWarehoursingExportDTO();
|
||||
exportDTO.setType(o.getType());
|
||||
exportDTO.setCustomer(o.getCustomer());
|
||||
exportDTO.setExternalWarehouse(o.getExternalWarehouse());
|
||||
exportDTO.setMaterial(o.getMaterial());
|
||||
exportDTO.setUnit(o.getUnit());
|
||||
exportDTO.setQty(o.getQty());
|
||||
return exportDTO;
|
||||
}).collect(Collectors.toList());
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
EasyExcel.write(response.getOutputStream(), FalseWarehoursingExportDTO.class).registerWriteHandler(new ExcelCellWidthStyleStrategy()).autoCloseStream(Boolean.FALSE).sheet("").doWrite(data);
|
||||
@ApiOperation(value = "外仓库存导出", notes = "外仓库存导出")
|
||||
@GetMapping("/export")
|
||||
public void exportForExtConsign(FalseWarehoursing falseWarehoursing) throws IOException {
|
||||
LambdaQueryWrapper<FalseWarehoursing> falseWarehoursingLambdaQueryWrapper = Wrappers.lambdaQuery(FalseWarehoursing.class).setEntity(falseWarehoursing);
|
||||
if (StrUtil.isBlank(falseWarehoursing.getType())) {
|
||||
falseWarehoursingLambdaQueryWrapper.in(FalseWarehoursing::getType, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE);
|
||||
}
|
||||
List<FalseWarehoursingExportDTO> data = falseWarehoursingService.list(falseWarehoursingLambdaQueryWrapper).stream().map(o -> {
|
||||
FalseWarehoursingExportDTO exportDTO = new FalseWarehoursingExportDTO();
|
||||
exportDTO.setType(o.getType());
|
||||
exportDTO.setCustomer(o.getCustomer());
|
||||
exportDTO.setExternalWarehouse(o.getExternalWarehouse());
|
||||
exportDTO.setMaterial(o.getMaterial());
|
||||
exportDTO.setUnit(o.getUnit());
|
||||
exportDTO.setQty(o.getQty());
|
||||
return exportDTO;
|
||||
}).collect(Collectors.toList());
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
EasyExcel.write(response.getOutputStream(), FalseWarehoursingExportDTO.class).registerWriteHandler(new ExcelCellWidthStyleStrategy()).autoCloseStream(Boolean.FALSE).sheet("").doWrite(data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "备件维修仓导出", notes = "备件维修仓导出")
|
||||
@GetMapping("/export2")
|
||||
public void exportForMatCustomer(FalseWarehoursing falseWarehoursing) throws IOException {
|
||||
LambdaQueryWrapper<FalseWarehoursing> falseWarehoursingLambdaQueryWrapper = Wrappers.lambdaQuery(FalseWarehoursing.class).setEntity(falseWarehoursing);
|
||||
if (StrUtil.isBlank(falseWarehoursing.getType())) {
|
||||
falseWarehoursingLambdaQueryWrapper.in(FalseWarehoursing::getType, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER);
|
||||
}
|
||||
List<FalseWarehoursingExport2DTO> data = falseWarehoursingService.list(falseWarehoursingLambdaQueryWrapper).stream().map(o -> {
|
||||
FalseWarehoursingExport2DTO exportDTO = new FalseWarehoursingExport2DTO();
|
||||
exportDTO.setType(o.getType());
|
||||
exportDTO.setCustomer(o.getCustomer());
|
||||
exportDTO.setMaterial(o.getMaterial());
|
||||
exportDTO.setUnit(o.getUnit());
|
||||
exportDTO.setQty(o.getQty());
|
||||
return exportDTO;
|
||||
}).collect(Collectors.toList());
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
EasyExcel.write(response.getOutputStream(), FalseWarehoursingExport2DTO.class).registerWriteHandler(new ExcelCellWidthStyleStrategy()).autoCloseStream(Boolean.FALSE).sheet("").doWrite(data);
|
||||
}
|
||||
@ApiOperation(value = "备件维修仓导出", notes = "备件维修仓导出")
|
||||
@GetMapping("/export2")
|
||||
public void exportForMatCustomer(FalseWarehoursing falseWarehoursing) throws IOException {
|
||||
LambdaQueryWrapper<FalseWarehoursing> falseWarehoursingLambdaQueryWrapper = Wrappers.lambdaQuery(FalseWarehoursing.class).setEntity(falseWarehoursing);
|
||||
if (StrUtil.isBlank(falseWarehoursing.getType())) {
|
||||
falseWarehoursingLambdaQueryWrapper.in(FalseWarehoursing::getType, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER);
|
||||
}
|
||||
List<FalseWarehoursingExport2DTO> data = falseWarehoursingService.list(falseWarehoursingLambdaQueryWrapper).stream().map(o -> {
|
||||
FalseWarehoursingExport2DTO exportDTO = new FalseWarehoursingExport2DTO();
|
||||
exportDTO.setType(o.getType());
|
||||
exportDTO.setCustomer(o.getCustomer());
|
||||
exportDTO.setMaterial(o.getMaterial());
|
||||
exportDTO.setUnit(o.getUnit());
|
||||
exportDTO.setQty(o.getQty());
|
||||
return exportDTO;
|
||||
}).collect(Collectors.toList());
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
EasyExcel.write(response.getOutputStream(), FalseWarehoursingExport2DTO.class).registerWriteHandler(new ExcelCellWidthStyleStrategy()).autoCloseStream(Boolean.FALSE).sheet("").doWrite(data);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "转移", notes = "转移")
|
||||
@PostMapping("/transfer")
|
||||
public R transfer(@RequestBody FalseWarehoursing falseWarehoursing) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
switch (falseWarehoursing.getType()) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE:
|
||||
falseWarehoursingService.consignForSaleTransfer(site, user, falseWarehoursing.getConsignForSaleNo(), falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getExternalWarehouse(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE:
|
||||
falseWarehoursingService.externalWarehouseTransfer(site, user, falseWarehoursing.getExternalWarehouse(), falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
falseWarehoursingService.matServiceTransfer(site, user, falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
falseWarehoursingService.customerTransfer(site, user, falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
break;
|
||||
default:
|
||||
throw BusinessException.build("不支持的类型");
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
@ApiOperation(value = "转移", notes = "转移")
|
||||
@PostMapping("/transfer")
|
||||
public R transfer(@RequestBody FalseWarehoursing falseWarehoursing) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
switch (falseWarehoursing.getType()) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE:
|
||||
falseWarehoursingService.consignForSaleTransfer(site, user, falseWarehoursing.getConsignForSaleNo(), falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getExternalWarehouse(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE:
|
||||
falseWarehoursingService.externalWarehouseTransfer(site, user, falseWarehoursing.getExternalWarehouse(), falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
falseWarehoursingService.matServiceTransfer(site, user, falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
falseWarehoursingService.customerTransfer(site, user, falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
break;
|
||||
default:
|
||||
throw BusinessException.build("不支持的类型");
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "转入", notes = "转入")
|
||||
@PostMapping("/transIn")
|
||||
public R transIn(@RequestBody FalseWarehoursing falseWarehoursing) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
falseWarehoursingService.transIn(site, user, falseWarehoursing.getType(), falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks(),null,true);
|
||||
return R.ok();
|
||||
}
|
||||
@ApiOperation(value = "转入", notes = "转入")
|
||||
@PostMapping("/transIn")
|
||||
public R transIn(@RequestBody FalseWarehoursing falseWarehoursing) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
falseWarehoursingService.transIn(site, user, falseWarehoursing.getType(), falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks(), null, true);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "转入", notes = "转入")
|
||||
@PutMapping("/transOut")
|
||||
public R transOut(@RequestBody FalseWarehoursing falseWarehoursing) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
falseWarehoursingService.transOut(site, user, falseWarehoursing.getType(), falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
return R.ok();
|
||||
}
|
||||
@ApiOperation(value = "转入", notes = "转入")
|
||||
@PutMapping("/transOut")
|
||||
public R transOut(@RequestBody FalseWarehoursing falseWarehoursing) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
falseWarehoursingService.transOut(site, user, falseWarehoursing.getType(), falseWarehoursing.getCustomer(), falseWarehoursing.getMaterial(), falseWarehoursing.getQty(), falseWarehoursing.getRemarks());
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,113 +32,113 @@ import java.util.List;
|
||||
@Api(value = "InventoryQueryReport", tags = "库存查询报表")
|
||||
public class InventoryQueryReportController {
|
||||
|
||||
private final InventoryQueryReportService inventoryQueryReportService;
|
||||
private final InventoryQueryReportService inventoryQueryReportService;
|
||||
|
||||
/**
|
||||
* 库存查询报表(非9001)- 分页查询
|
||||
*
|
||||
* @return R
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/selectPage")
|
||||
public R retrieve(Page<InventoryQueryReportDto> page, @RequestBody InventoryQueryReportDto inventoryQueryReportDto) {
|
||||
return R.ok(inventoryQueryReportService.doRetrieve(page,inventoryQueryReportDto));
|
||||
}
|
||||
/**
|
||||
* 库存查询报表(非9001)- 分页查询
|
||||
*
|
||||
* @return R
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/selectPage")
|
||||
public R retrieve(Page<InventoryQueryReportDto> page, @RequestBody InventoryQueryReportDto inventoryQueryReportDto) {
|
||||
return R.ok(inventoryQueryReportService.doRetrieve(page, inventoryQueryReportDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存查询报表(非9001)- 导出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/tablePageExport")
|
||||
public void tablePageExport( InventoryQueryReportDto inventoryQueryReportDto) throws Exception{
|
||||
List<InventoryQueryReportDto> inventoryQueryReportList = inventoryQueryReportService.doSelect(inventoryQueryReportDto);
|
||||
String fileName = "库存查询报表-非9001";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
EasyExcel.write(response.getOutputStream(), InventoryQueryReport.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(inventoryQueryReportList);
|
||||
}
|
||||
/**
|
||||
* 库存查询报表(非9001)- 导出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/tablePageExport")
|
||||
public void tablePageExport(InventoryQueryReportDto inventoryQueryReportDto) throws Exception {
|
||||
List<InventoryQueryReportDto> inventoryQueryReportList = inventoryQueryReportService.doSelect(inventoryQueryReportDto);
|
||||
String fileName = "库存查询报表-非9001";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
EasyExcel.write(response.getOutputStream(), InventoryQueryReport.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(inventoryQueryReportList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 9001库存查询报表(详细)- 分页查询
|
||||
*
|
||||
* @return R
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/selectInventoryDetailedPage")
|
||||
public R retrieveInventoryDetailed(Page<InventoryQueryReportDto> page, @RequestBody InventoryQueryReportDto inventoryQueryReportDto) {
|
||||
return R.ok(inventoryQueryReportService.doRetrieveInventoryDetailed(page,inventoryQueryReportDto));
|
||||
}
|
||||
/**
|
||||
* 9001库存查询报表(详细)- 分页查询
|
||||
*
|
||||
* @return R
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/selectInventoryDetailedPage")
|
||||
public R retrieveInventoryDetailed(Page<InventoryQueryReportDto> page, @RequestBody InventoryQueryReportDto inventoryQueryReportDto) {
|
||||
return R.ok(inventoryQueryReportService.doRetrieveInventoryDetailed(page, inventoryQueryReportDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 9001库存查询报表(详细)- 导出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/tableInventoryDetailedPageExport")
|
||||
public void tableInventoryDetailedPageExport(@RequestBody InventoryQueryReportDto inventoryQueryReportDto) throws Exception{
|
||||
List<InventoryQueryReportDto> inventoryQueryReportList = inventoryQueryReportService.doSelectInventoryDetailed(inventoryQueryReportDto);
|
||||
String fileName = "9001库存查询报表(详细)";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
EasyExcel.write(response.getOutputStream(), InventoryQueryDetailedReport.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(inventoryQueryReportList);
|
||||
}
|
||||
/**
|
||||
* 9001库存查询报表(详细)- 导出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/tableInventoryDetailedPageExport")
|
||||
public void tableInventoryDetailedPageExport(@RequestBody InventoryQueryReportDto inventoryQueryReportDto) throws Exception {
|
||||
List<InventoryQueryReportDto> inventoryQueryReportList = inventoryQueryReportService.doSelectInventoryDetailed(inventoryQueryReportDto);
|
||||
String fileName = "9001库存查询报表(详细)";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
EasyExcel.write(response.getOutputStream(), InventoryQueryDetailedReport.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(inventoryQueryReportList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 9001库存查询报表(托汇总) - 分页查询
|
||||
*
|
||||
* @return R
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/selectInventoryByPalletPage")
|
||||
public R retrieveInventoryByPallet(Page<InventoryQueryReportDto> page, @RequestBody InventoryQueryReportDto inventoryQueryReportDto) {
|
||||
return R.ok(inventoryQueryReportService.doRetrieveInventoryByPallet(page,inventoryQueryReportDto));
|
||||
}
|
||||
/**
|
||||
* 9001库存查询报表(托汇总) - 分页查询
|
||||
*
|
||||
* @return R
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/selectInventoryByPalletPage")
|
||||
public R retrieveInventoryByPallet(Page<InventoryQueryReportDto> page, @RequestBody InventoryQueryReportDto inventoryQueryReportDto) {
|
||||
return R.ok(inventoryQueryReportService.doRetrieveInventoryByPallet(page, inventoryQueryReportDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 9001库存查询报表(托汇总) - 导出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/tableInventoryByPalletPageExport")
|
||||
public void tableInventoryByPalletPageExport( InventoryQueryReportDto inventoryQueryReportDto) throws Exception{
|
||||
List<InventoryQueryReportDto> inventoryQueryReportList = inventoryQueryReportService.doSelectInventoryByPallet(inventoryQueryReportDto);
|
||||
String fileName = "9001库存查询报表(托汇总)";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
EasyExcel.write(response.getOutputStream(), PalletInventoryQueryReport.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(inventoryQueryReportList);
|
||||
}
|
||||
/**
|
||||
* 9001库存查询报表(托汇总) - 导出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/tableInventoryByPalletPageExport")
|
||||
public void tableInventoryByPalletPageExport(InventoryQueryReportDto inventoryQueryReportDto) throws Exception {
|
||||
List<InventoryQueryReportDto> inventoryQueryReportList = inventoryQueryReportService.doSelectInventoryByPallet(inventoryQueryReportDto);
|
||||
String fileName = "9001库存查询报表(托汇总)";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
EasyExcel.write(response.getOutputStream(), PalletInventoryQueryReport.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(inventoryQueryReportList);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping("/selectInventoryStatisticsReport")
|
||||
public R selectInventoryStatisticsReport(String status, String opType) {
|
||||
return R.ok(inventoryQueryReportService.selectInventoryStatisticsReport(status, opType));
|
||||
}
|
||||
@ResponseBody
|
||||
@GetMapping("/selectInventoryStatisticsReport")
|
||||
public R selectInventoryStatisticsReport(String status, String opType) {
|
||||
return R.ok(inventoryQueryReportService.selectInventoryStatisticsReport(status, opType));
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping("/exportInventoryStatisticsReport")
|
||||
public void exportInventoryStatisticsReport(String opType) throws IOException {
|
||||
inventoryQueryReportService.exportInventoryStatisticsReport(opType);
|
||||
}
|
||||
@ResponseBody
|
||||
@GetMapping("/exportInventoryStatisticsReport")
|
||||
public void exportInventoryStatisticsReport(String opType) throws IOException {
|
||||
inventoryQueryReportService.exportInventoryStatisticsReport(opType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,97 +34,97 @@ import java.io.IOException;
|
||||
@Api(value = "itemSafeInventory", tags = "物料安全库存表管理")
|
||||
public class ItemSafeInventoryController {
|
||||
|
||||
private final ItemSafeInventoryService itemSafeInventoryService;
|
||||
private final ItemSafeInventoryService itemSafeInventoryService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param itemSafeInventory 物料安全库存表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getItemSafeInventoryPage(Page page, ItemSafeInventory itemSafeInventory) {
|
||||
return R.ok(itemSafeInventoryService.page(page, Wrappers.query(itemSafeInventory)));
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param itemSafeInventory 物料安全库存表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getItemSafeInventoryPage(Page page, ItemSafeInventory itemSafeInventory) {
|
||||
return R.ok(itemSafeInventoryService.page(page, Wrappers.query(itemSafeInventory)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询物料安全库存表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(itemSafeInventoryService.getById(handle));
|
||||
}
|
||||
/**
|
||||
* 通过id查询物料安全库存表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(itemSafeInventoryService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料安全库存表
|
||||
*
|
||||
* @param itemSafeInventory 物料安全库存表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增物料安全库存表", notes = "新增物料安全库存表")
|
||||
@SysLog("新增物料安全库存表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody ItemSafeInventory itemSafeInventory) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
itemSafeInventoryService.greatSaveOrUpdate(site, user, itemSafeInventory);
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 新增物料安全库存表
|
||||
*
|
||||
* @param itemSafeInventory 物料安全库存表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增物料安全库存表", notes = "新增物料安全库存表")
|
||||
@SysLog("新增物料安全库存表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody ItemSafeInventory itemSafeInventory) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
itemSafeInventoryService.greatSaveOrUpdate(site, user, itemSafeInventory);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料安全库存表
|
||||
*
|
||||
* @param itemSafeInventory 物料安全库存表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改物料安全库存表", notes = "修改物料安全库存表")
|
||||
@SysLog("修改物料安全库存表")
|
||||
@PutMapping
|
||||
public R greatUpdate(@RequestBody ItemSafeInventory itemSafeInventory) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
itemSafeInventoryService.greatSaveOrUpdate(site, user, itemSafeInventory);
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 修改物料安全库存表
|
||||
*
|
||||
* @param itemSafeInventory 物料安全库存表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改物料安全库存表", notes = "修改物料安全库存表")
|
||||
@SysLog("修改物料安全库存表")
|
||||
@PutMapping
|
||||
public R greatUpdate(@RequestBody ItemSafeInventory itemSafeInventory) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String user = SecurityUtils.getUserName();
|
||||
itemSafeInventoryService.greatSaveOrUpdate(site, user, itemSafeInventory);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除物料安全库存表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除物料安全库存表", notes = "通过id删除物料安全库存表")
|
||||
@SysLog("通过id删除物料安全库存表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(itemSafeInventoryService.removeById(handle));
|
||||
}
|
||||
/**
|
||||
* 通过id删除物料安全库存表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除物料安全库存表", notes = "通过id删除物料安全库存表")
|
||||
@SysLog("通过id删除物料安全库存表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(itemSafeInventoryService.removeById(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param itemSafeInventory 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public void export(ItemSafeInventory itemSafeInventory) throws IOException {
|
||||
String fileName = "物料安全库存";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), ItemSafeInventory.class).registerWriteHandler(new CustomCellWriteWidthHandler()).registerConverter(new BooleanToYNConverter()).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(itemSafeInventoryService.list(Wrappers.query(itemSafeInventory)));
|
||||
}
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param itemSafeInventory 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public void export(ItemSafeInventory itemSafeInventory) throws IOException {
|
||||
String fileName = "物料安全库存";
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), ItemSafeInventory.class).registerWriteHandler(new CustomCellWriteWidthHandler()).registerConverter(new BooleanToYNConverter()).autoCloseStream(Boolean.FALSE).sheet(fileName)
|
||||
.doWrite(itemSafeInventoryService.list(Wrappers.query(itemSafeInventory)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,25 +25,25 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Api(value = "picking", tags = "拣货明细表管理")
|
||||
public class PickingController {
|
||||
|
||||
private final PickingService pickingService;
|
||||
private final PickingService pickingService;
|
||||
|
||||
@ApiOperation(value = "打印报告", notes = "打印报告")
|
||||
@SysLog("打印报告")
|
||||
@PostMapping("/printTaskReport")
|
||||
public R printTaskReport(@RequestBody Picking dto) {
|
||||
@ApiOperation(value = "打印报告", notes = "打印报告")
|
||||
@SysLog("打印报告")
|
||||
@PostMapping("/printTaskReport")
|
||||
public R printTaskReport(@RequestBody Picking dto) {
|
||||
|
||||
// return R.ok(pickingService.printTaskReport(dto));
|
||||
return R.ok();
|
||||
}
|
||||
// return R.ok(pickingService.printTaskReport(dto));
|
||||
return R.ok();
|
||||
}
|
||||
/*
|
||||
private final PickingService pickingService;
|
||||
|
||||
*//**
|
||||
* 通过行项目获取已拣货数据
|
||||
*
|
||||
* @param documentDetailed
|
||||
* @return R
|
||||
*//*
|
||||
* 通过行项目获取已拣货数据
|
||||
*
|
||||
* @param documentDetailed
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过行项目获取已拣货数据", notes = "通过行项目获取已拣货数据")
|
||||
@GetMapping("/getPickInventory")
|
||||
public R getPickInventory(DocumentDetailed documentDetailed) {
|
||||
@ -51,11 +51,11 @@ public class PickingController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过库存或载具查询数量
|
||||
*
|
||||
* @param documentDetailed inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
* 通过库存或载具查询数量
|
||||
*
|
||||
* @param documentDetailed inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过库存查询", notes = "通过库存查询")
|
||||
@GetMapping("/getInventoryQty")
|
||||
public R getInventoryQty(DocumentDetailedDto documentDetailed) {
|
||||
@ -70,12 +70,12 @@ public class PickingController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param picking 拣货明细表
|
||||
* @return
|
||||
*//*
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param picking 拣货明细表
|
||||
* @return
|
||||
*//*
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getPickingPage(FrontPage page, Picking picking) {
|
||||
@ -104,11 +104,11 @@ public class PickingController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 补签补打印
|
||||
*
|
||||
* @param reprintDtos reprintDto
|
||||
* @return R
|
||||
*//*
|
||||
* 补签补打印
|
||||
*
|
||||
* @param reprintDtos reprintDto
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@PostMapping("/reprint")
|
||||
public R reprint(@RequestBody List<Picking> reprintDtos) {
|
||||
@ -117,11 +117,11 @@ public class PickingController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 检索
|
||||
*
|
||||
* @param reprintDto reprintDto
|
||||
* @return R
|
||||
*//*
|
||||
* 检索
|
||||
*
|
||||
* @param reprintDto reprintDto
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/select")
|
||||
public R select(ReprintDto reprintDto) {
|
||||
@ -129,11 +129,11 @@ public class PickingController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过id查询拣货明细表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*//*
|
||||
* 通过id查询拣货明细表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
@ -141,11 +141,11 @@ public class PickingController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 新增拣货明细表
|
||||
*
|
||||
* @param picking 拣货明细表
|
||||
* @return R
|
||||
*//*
|
||||
* 新增拣货明细表
|
||||
*
|
||||
* @param picking 拣货明细表
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "新增拣货明细表", notes = "新增拣货明细表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_picking_save')")
|
||||
@ -156,11 +156,11 @@ public class PickingController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 修改拣货明细表
|
||||
*
|
||||
* @param picking 拣货明细表
|
||||
* @return R
|
||||
*//*
|
||||
* 修改拣货明细表
|
||||
*
|
||||
* @param picking 拣货明细表
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "修改拣货明细表", notes = "修改拣货明细表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_picking_save')")
|
||||
@ -171,11 +171,11 @@ public class PickingController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过id删除拣货明细表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*//*
|
||||
* 通过id删除拣货明细表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过id删除拣货明细表", notes = "通过id删除拣货明细表")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_picking_del')")
|
||||
@ -251,11 +251,11 @@ public class PickingController {
|
||||
return R.ok();
|
||||
}
|
||||
*//**
|
||||
* 暂存拣货数据
|
||||
*
|
||||
* @param documentDetailed inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
* 暂存拣货数据
|
||||
*
|
||||
* @param documentDetailed inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "暂存拣货数据", notes = "暂存拣货数据")
|
||||
@PostMapping("/saveTempPicking")
|
||||
public R saveTempPicking(@RequestBody DocumentDetailedDto documentDetailed) {
|
||||
|
||||
@ -28,9 +28,9 @@ import java.util.List;
|
||||
@RequestMapping("/print-pda-bind")
|
||||
@Api(value = "print-pda-bind", tags = "管理")
|
||||
public class PrintPdaBindController {
|
||||
|
||||
|
||||
private final PrintPdaBindService printPdaBindService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -44,8 +44,8 @@ public class PrintPdaBindController {
|
||||
public R getPrintPdaBindPage(Page page, PrintPdaBind printPdaBind) {
|
||||
return R.ok(printPdaBindService.page(page, Wrappers.query(printPdaBind)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
@ -58,7 +58,7 @@ public class PrintPdaBindController {
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(printPdaBindService.getById(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
@ -72,7 +72,7 @@ public class PrintPdaBindController {
|
||||
public R save(@RequestBody PrintPdaBind printPdaBind) {
|
||||
return R.ok(printPdaBindService.save(printPdaBind));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
@ -86,7 +86,7 @@ public class PrintPdaBindController {
|
||||
public R updateById(@RequestBody PrintPdaBind printPdaBind) {
|
||||
return R.ok(printPdaBindService.updateById(printPdaBind));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
@ -100,8 +100,8 @@ public class PrintPdaBindController {
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(printPdaBindService.removeById(handle));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
@ -114,8 +114,8 @@ public class PrintPdaBindController {
|
||||
public List<PrintPdaBind> export(PrintPdaBind printPdaBind) {
|
||||
return printPdaBindService.list(Wrappers.query(printPdaBind));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getPrintList/{site}")
|
||||
@ApiOperation(value = "获取打印机列表")
|
||||
public R getPrintList(@PathVariable String site) {
|
||||
@ -124,11 +124,12 @@ public class PrintPdaBindController {
|
||||
|
||||
/**
|
||||
* 打印接口用
|
||||
*
|
||||
* @param printPortDTO 打印DTO
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "打印接口用", notes = "打印接口用")
|
||||
@SysLog("打印接口用" )
|
||||
@SysLog("打印接口用")
|
||||
@PostMapping("/print")
|
||||
@Inner(value = false)
|
||||
public void print(@RequestBody PrintPortDTO printPortDTO) {
|
||||
|
||||
@ -25,63 +25,64 @@ import org.springframework.web.bind.annotation.*;
|
||||
@Api(value = "role-area-bind", tags = "角色区域绑定关系表管理")
|
||||
public class RoleAreaBindController {
|
||||
|
||||
private final RoleAreaBindService roleAreaBindService;
|
||||
private final RoleAreaBindService roleAreaBindService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page
|
||||
* @param roleCode
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage page, String roleCode, String status) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
return R.ok(roleAreaBindService.listWithSto(page, site, roleCode, status));
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param roleCode
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage page, String roleCode, String status) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
return R.ok(roleAreaBindService.listWithSto(page, site, roleCode, status));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增角色区域绑定关系表
|
||||
*
|
||||
* @param roleAreaBind 角色区域绑定关系表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增角色区域绑定关系表", notes = "新增角色区域绑定关系表")
|
||||
@SysLog("新增角色区域绑定关系表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody RoleAreaBindDTO roleAreaBind) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String userName = SecurityUtils.getUserName();
|
||||
return R.ok(roleAreaBindService.save(site,userName,roleAreaBind));
|
||||
}
|
||||
/**
|
||||
* 新增角色区域绑定关系表
|
||||
*
|
||||
* @param roleAreaBind 角色区域绑定关系表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增角色区域绑定关系表", notes = "新增角色区域绑定关系表")
|
||||
@SysLog("新增角色区域绑定关系表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody RoleAreaBindDTO roleAreaBind) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String userName = SecurityUtils.getUserName();
|
||||
return R.ok(roleAreaBindService.save(site, userName, roleAreaBind));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色区域绑定关系表
|
||||
*
|
||||
* @param roleAreaBind 角色区域绑定关系表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改角色区域绑定关系表", notes = "修改角色区域绑定关系表")
|
||||
@SysLog("修改角色区域绑定关系表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody RoleAreaBind roleAreaBind) {
|
||||
return R.ok(roleAreaBindService.updateById(roleAreaBind));
|
||||
}
|
||||
/**
|
||||
* 修改角色区域绑定关系表
|
||||
*
|
||||
* @param roleAreaBind 角色区域绑定关系表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改角色区域绑定关系表", notes = "修改角色区域绑定关系表")
|
||||
@SysLog("修改角色区域绑定关系表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody RoleAreaBind roleAreaBind) {
|
||||
return R.ok(roleAreaBindService.updateById(roleAreaBind));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除角色区域绑定关系表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除角色区域绑定关系表", notes = "通过id删除角色区域绑定关系表")
|
||||
@SysLog("通过id删除角色区域绑定关系表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(roleAreaBindService.removeById(handle));
|
||||
}
|
||||
/**
|
||||
* 通过id删除角色区域绑定关系表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除角色区域绑定关系表", notes = "通过id删除角色区域绑定关系表")
|
||||
@SysLog("通过id删除角色区域绑定关系表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(roleAreaBindService.removeById(handle));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/salesInvoiceDelivery" )
|
||||
@RequestMapping("/salesInvoiceDelivery")
|
||||
@Api(value = "salesInvoiceDelivery", tags = "销售出货管理平台")
|
||||
public class SalesInvoiceDeliveryController {
|
||||
|
||||
@ -31,36 +31,39 @@ public class SalesInvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param salesInvoiceDelivery 销售出货对象
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@SysLog("销售出货管理平台检索" )
|
||||
@GetMapping("/page" )
|
||||
@SysLog("销售出货管理平台检索")
|
||||
@GetMapping("/page")
|
||||
public R getSalesInvoiceDeliveryPage(Page page, SalesInvoiceDelivery salesInvoiceDelivery) {
|
||||
return R.ok(salesInvoiceDeliveryService.getSalesInvoiceDeliveryPage(page, salesInvoiceDelivery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询明细数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "销售出货管理单笔数据查询", notes = "销售出货管理单笔数据查询")
|
||||
@SysLog("销售出货管理单笔数据查询" )
|
||||
@GetMapping("/{handle}" )
|
||||
public R getOneObjByHandle(@PathVariable("handle" ) String handle) {
|
||||
@SysLog("销售出货管理单笔数据查询")
|
||||
@GetMapping("/{handle}")
|
||||
public R getOneObjByHandle(@PathVariable("handle") String handle) {
|
||||
return R.ok(salesInvoiceDeliveryService.getOneObjByHandle(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改销售交货主表接口用
|
||||
*
|
||||
* @param salesInvoiceDelivery 销售交货主表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增或修改销售交货主表接口用", notes = "新增或修改销售交货主表接口用")
|
||||
@SysLog("新增或修改销售交货主表接口用" )
|
||||
@SysLog("新增或修改销售交货主表接口用")
|
||||
@PostMapping("/saveOrUpdateSalesInvoiceDelivery")
|
||||
@Inner(value = false)
|
||||
public R<Boolean> saveOrUpdateSalesInvoiceDelivery(@RequestBody SalesInvoiceDelivery salesInvoiceDelivery) {
|
||||
@ -69,11 +72,12 @@ public class SalesInvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 开始拣货按钮
|
||||
*
|
||||
* @param salesInvoiceDelivery 开始拣货按钮
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "开始拣货按钮", notes = "开始拣货按钮")
|
||||
@SysLog("开始拣货按钮" )
|
||||
@SysLog("开始拣货按钮")
|
||||
@PostMapping("/startPickGoods")
|
||||
public R startPickGoods(@RequestBody SalesInvoiceDelivery salesInvoiceDelivery) {
|
||||
salesInvoiceDeliveryService.startPickGoods(salesInvoiceDelivery);
|
||||
@ -82,11 +86,12 @@ public class SalesInvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 发货开始、发货暂停按钮
|
||||
*
|
||||
* @param salesInvoiceDelivery 发货开始、发货暂停按钮
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "发货开始、发货暂停按钮", notes = "发货开始、发货暂停按钮")
|
||||
@SysLog("发货开始、发货暂停按钮" )
|
||||
@SysLog("发货开始、发货暂停按钮")
|
||||
@PostMapping("/startOrStopSendGoods")
|
||||
public R startOrStopSendGoods(@RequestBody SalesInvoiceDelivery salesInvoiceDelivery) {
|
||||
salesInvoiceDeliveryService.startOrStopSendGoods(salesInvoiceDelivery);
|
||||
@ -141,6 +146,7 @@ public class SalesInvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 纳科达扫码拣配-出库执行提交事件
|
||||
*
|
||||
* @param dtoList
|
||||
* @return R
|
||||
*/
|
||||
@ -154,11 +160,12 @@ public class SalesInvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 销售过账按钮
|
||||
*
|
||||
* @param salesInvoiceDelivery 销售过账按钮
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "销售过账按钮", notes = "销售过账按钮")
|
||||
@SysLog("销售过账按钮" )
|
||||
@SysLog("销售过账按钮")
|
||||
@PostMapping("/sendPayGoods")
|
||||
public R sendPayGoods(@RequestBody SalesInvoiceDelivery salesInvoiceDelivery) {
|
||||
salesInvoiceDeliveryService.sendPayGoods(salesInvoiceDelivery);
|
||||
@ -166,8 +173,8 @@ public class SalesInvoiceDeliveryController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "销售出货行查询其明细数据", notes = "销售出货行查询其明细数据")
|
||||
@SysLog("销售出货行查询其明细数据" )
|
||||
@PostMapping("/selectSalesOutDataByHandle" )
|
||||
@SysLog("销售出货行查询其明细数据")
|
||||
@PostMapping("/selectSalesOutDataByHandle")
|
||||
public R selectSalesOutDataByHandle(@RequestBody SalesInvoiceDeliveryItem salesInvoiceDeliveryItem) {
|
||||
return R.ok(salesInvoiceDeliveryService.selectSalesOutData(salesInvoiceDeliveryItem.getHandle()));
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/salesInvoiceDeliveryItemAttachment" )
|
||||
@RequestMapping("/salesInvoiceDeliveryItemAttachment")
|
||||
@Api(value = "salesInvoiceDeliveryItemAttachment", tags = "销售出货拣配单附件照片")
|
||||
public class SalesInvoiceDeliveryItemAttachmentController {
|
||||
|
||||
@ -26,16 +26,18 @@ public class SalesInvoiceDeliveryItemAttachmentController {
|
||||
|
||||
/**
|
||||
* 检索现有附件
|
||||
*
|
||||
* @param salesInvoiceDeliveryItemAttachment
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/list/findByDeliveryItemBo")
|
||||
public R findByDeliveryItemBo(@RequestBody SalesInvoiceDeliveryItemAttachment salesInvoiceDeliveryItemAttachment) {
|
||||
return R.ok(salesInvoiceDeliveryItemAttachmentService.findByDeliveryItemBoAndMaterial(salesInvoiceDeliveryItemAttachment.getSalesInvoiceDeliveryItemBo(),salesInvoiceDeliveryItemAttachment.getMaterialLot()));
|
||||
return R.ok(salesInvoiceDeliveryItemAttachmentService.findByDeliveryItemBoAndMaterial(salesInvoiceDeliveryItemAttachment.getSalesInvoiceDeliveryItemBo(), salesInvoiceDeliveryItemAttachment.getMaterialLot()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件通过minIo上传到minIo
|
||||
*
|
||||
* @param salesInvoiceDeliveryItemAttachmentDTO
|
||||
* @return R
|
||||
*/
|
||||
|
||||
@ -23,20 +23,21 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/sales-invoice-delivery-item" )
|
||||
@RequestMapping("/sales-invoice-delivery-item")
|
||||
@Api(value = "sales-invoice-delivery-item", tags = "SAP销售交货明细数据管理")
|
||||
public class SalesInvoiceDeliveryItemController {
|
||||
|
||||
private final SalesInvoiceDeliveryItemService salesInvoiceDeliveryItemService;
|
||||
private final SalesInvoiceDeliveryItemService salesInvoiceDeliveryItemService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param salesInvoiceDeliveryItem SAP销售交货明细数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getSalesInvoiceDeliveryItemPage(Page page, SalesInvoiceDeliveryItem salesInvoiceDeliveryItem) {
|
||||
return R.ok(salesInvoiceDeliveryItemService.page(page, Wrappers.query(salesInvoiceDeliveryItem)));
|
||||
}
|
||||
@ -44,22 +45,24 @@ public class SalesInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 通过id查询SAP销售交货明细数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(salesInvoiceDeliveryItemService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增SAP销售交货明细数据
|
||||
*
|
||||
* @param salesInvoiceDeliveryItem SAP销售交货明细数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增SAP销售交货明细数据", notes = "新增SAP销售交货明细数据")
|
||||
@SysLog("新增SAP销售交货明细数据" )
|
||||
@SysLog("新增SAP销售交货明细数据")
|
||||
@PostMapping
|
||||
public R save(@RequestBody SalesInvoiceDeliveryItem salesInvoiceDeliveryItem) {
|
||||
return R.ok(salesInvoiceDeliveryItemService.save(salesInvoiceDeliveryItem));
|
||||
@ -67,11 +70,12 @@ public class SalesInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 修改SAP销售交货明细数据
|
||||
*
|
||||
* @param salesInvoiceDeliveryItem SAP销售交货明细数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改SAP销售交货明细数据", notes = "修改SAP销售交货明细数据")
|
||||
@SysLog("修改SAP销售交货明细数据" )
|
||||
@SysLog("修改SAP销售交货明细数据")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody SalesInvoiceDeliveryItem salesInvoiceDeliveryItem) {
|
||||
return R.ok(salesInvoiceDeliveryItemService.updateById(salesInvoiceDeliveryItem));
|
||||
@ -79,11 +83,12 @@ public class SalesInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 批量新增或修改SAP销售交货明细数据接口用
|
||||
*
|
||||
* @param salesInvoiceDeliveryItemList 销售交货明细表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "批量新增或修改SAP销售交货明细数据接口用", notes = "批量新增或修改SAP销售交货明细数据接口用")
|
||||
@SysLog("批量新增或修改SAP销售交货明细数据接口用" )
|
||||
@SysLog("批量新增或修改SAP销售交货明细数据接口用")
|
||||
@PostMapping("/saveOrUpdateSalesInvoiceDeliveryItemList")
|
||||
@Inner(value = false)
|
||||
public R<Boolean> saveOrUpdateSalesInvoiceDeliveryItemList(@RequestBody List<SalesInvoiceDeliveryItem> salesInvoiceDeliveryItemList) {
|
||||
@ -92,18 +97,20 @@ public class SalesInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 通过id删除SAP销售交货明细数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除SAP销售交货明细数据", notes = "通过id删除SAP销售交货明细数据")
|
||||
@SysLog("通过id删除SAP销售交货明细数据" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@SysLog("通过id删除SAP销售交货明细数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(salesInvoiceDeliveryItemService.removeById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param salesInvoiceDeliveryItem 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
|
||||
@ -24,38 +24,42 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/sales-out-invoice-delivery-item" )
|
||||
@RequestMapping("/sales-out-invoice-delivery-item")
|
||||
@Api(value = "sales-out-invoice-delivery-item", tags = "发货信息查看表管理")
|
||||
public class SalesOutInvoiceDeliveryItemController {
|
||||
|
||||
private final SalesOutInvoiceDeliveryItemService salesOutInvoiceDeliveryItemService;
|
||||
private final SalesOutInvoiceDeliveryItemService salesOutInvoiceDeliveryItemService;
|
||||
|
||||
@ApiOperation(value = "接收信息查看", notes = "接收信息查看")
|
||||
@SysLog("接收信息查看" )
|
||||
@GetMapping("/selectReceiveInfoData/{handle}" )
|
||||
public R selectReceiveInfoData(@PathVariable("handle" ) String handle,SalesOutInvoiceDeliveryItem salesOutInvoiceDeliveryItem) {
|
||||
@SysLog("接收信息查看")
|
||||
@GetMapping("/selectReceiveInfoData/{handle}")
|
||||
public R selectReceiveInfoData(@PathVariable("handle") String handle, SalesOutInvoiceDeliveryItem salesOutInvoiceDeliveryItem) {
|
||||
return R.ok(salesOutInvoiceDeliveryItemService.selectReceiveInfoData(handle, salesOutInvoiceDeliveryItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收信息查看-保存
|
||||
*
|
||||
* @param salesOutInvoiceDeliveryItem 发货信息查看表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "接收信息查看-保存", notes = "接收信息查看-保存")
|
||||
@SysLog("接收信息查看-保存" )
|
||||
@PutMapping("/receiveInfoUpdate" )
|
||||
@SysLog("接收信息查看-保存")
|
||||
@PutMapping("/receiveInfoUpdate")
|
||||
public R receiveInfoUpdate(@RequestBody SalesOutInvoiceDeliveryItem salesOutInvoiceDeliveryItem) {
|
||||
salesOutInvoiceDeliveryItemService.receiveInfoUpdate(salesOutInvoiceDeliveryItem);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param salesOutInvoiceDeliveryItem 发货信息查看表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getSalesOutInvoiceDeliveryItemPage(Page page, SalesOutInvoiceDeliveryItem salesOutInvoiceDeliveryItem) {
|
||||
return R.ok(salesOutInvoiceDeliveryItemService.page(page, Wrappers.query(salesOutInvoiceDeliveryItem)));
|
||||
}
|
||||
@ -63,22 +67,24 @@ public class SalesOutInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 通过id查询发货信息查看表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(salesOutInvoiceDeliveryItemService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发货信息查看表
|
||||
*
|
||||
* @param salesOutInvoiceDeliveryItem 发货信息查看表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增发货信息查看表", notes = "新增发货信息查看表")
|
||||
@SysLog("新增发货信息查看表" )
|
||||
@SysLog("新增发货信息查看表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody SalesOutInvoiceDeliveryItem salesOutInvoiceDeliveryItem) {
|
||||
return R.ok(salesOutInvoiceDeliveryItemService.save(salesOutInvoiceDeliveryItem));
|
||||
@ -86,11 +92,12 @@ public class SalesOutInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 修改发货信息查看表
|
||||
*
|
||||
* @param salesOutInvoiceDeliveryItem 发货信息查看表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改发货信息查看表", notes = "修改发货信息查看表")
|
||||
@SysLog("修改发货信息查看表" )
|
||||
@SysLog("修改发货信息查看表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody SalesOutInvoiceDeliveryItem salesOutInvoiceDeliveryItem) {
|
||||
return R.ok(salesOutInvoiceDeliveryItemService.updateById(salesOutInvoiceDeliveryItem));
|
||||
@ -98,12 +105,13 @@ public class SalesOutInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 通过id删除发货信息查看表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除发货信息查看表", notes = "通过id删除发货信息查看表")
|
||||
@SysLog("通过id删除发货信息查看表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@SysLog("通过id删除发货信息查看表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(salesOutInvoiceDeliveryItemService.removeById(handle));
|
||||
}
|
||||
@ -111,6 +119,7 @@ public class SalesOutInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param salesOutInvoiceDeliveryItem 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ -122,11 +131,12 @@ public class SalesOutInvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 保存发货信息查看表接口用
|
||||
*
|
||||
* @param salesOutvoiceDelivery 销售退货主表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "保存发货信息查看表接口用", notes = "保存发货信息查看表接口用")
|
||||
@SysLog("保存发货信息查看表接口用" )
|
||||
@SysLog("保存发货信息查看表接口用")
|
||||
@PostMapping("/saveSalesOutInvoiceDeliveryItem")
|
||||
@Inner(value = false)
|
||||
public R<Boolean> saveSalesOutInvoiceDeliveryItem(@RequestBody SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
|
||||
@ -23,44 +23,47 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/sales-outvoice-delivery" )
|
||||
@RequestMapping("/sales-outvoice-delivery")
|
||||
@Api(value = "sales-outvoice-delivery", tags = "SAP销售退货主数据管理")
|
||||
public class SalesOutvoiceDeliveryController {
|
||||
|
||||
private final SalesOutvoiceDeliveryService salesOutvoiceDeliveryService;
|
||||
private final SalesOutvoiceDeliveryService salesOutvoiceDeliveryService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param salesOutvoiceDelivery SAP销售退货主数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@SysLog("销售退货处理平台检索" )
|
||||
@GetMapping("/page" )
|
||||
@SysLog("销售退货处理平台检索")
|
||||
@GetMapping("/page")
|
||||
public R getSalesOutvoiceDeliveryPage(Page page, SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
return R.ok(salesOutvoiceDeliveryService.getSalesOutvoiceDeliveryPage(page, salesOutvoiceDelivery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询SAP销售退货明细数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "销售退货处理平台单笔数据查询", notes = "销售退货处理平台单笔数据查询")
|
||||
@SysLog("销售退货处理平台单笔数据查询" )
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@SysLog("销售退货处理平台单笔数据查询")
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(salesOutvoiceDeliveryService.getOneObjByHandle(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 销售退货处理平台-拣配开始按钮
|
||||
*
|
||||
* @param salesOutvoiceDelivery
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "销售退货处理平台-拣配开始按钮", notes = "销售退货处理平台-拣配开始按钮")
|
||||
@SysLog("销售退货处理平台-拣配开始按钮" )
|
||||
@SysLog("销售退货处理平台-拣配开始按钮")
|
||||
@PostMapping("/startPickGoods")
|
||||
public R startPickGoods(@RequestBody SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
salesOutvoiceDeliveryService.startPickGoods(salesOutvoiceDelivery);
|
||||
@ -69,11 +72,12 @@ public class SalesOutvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 发货开始、发货暂停按钮
|
||||
*
|
||||
* @param salesOutvoiceDelivery
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "发货开始、发货暂停按钮", notes = "发货开始、发货暂停按钮")
|
||||
@SysLog("发货开始、发货暂停按钮" )
|
||||
@SysLog("发货开始、发货暂停按钮")
|
||||
@PostMapping("/startOrStopSendGoods")
|
||||
public R startOrStopSendGoods(@RequestBody SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
salesOutvoiceDeliveryService.startOrStopSendGoods(salesOutvoiceDelivery);
|
||||
@ -82,11 +86,12 @@ public class SalesOutvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 销售退货处理平台-入库过账按钮
|
||||
*
|
||||
* @param salesOutvoiceDelivery
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "入库过账按钮", notes = "入库过账按钮")
|
||||
@SysLog("入库过账按钮" )
|
||||
@SysLog("入库过账按钮")
|
||||
@PostMapping("/postReturnGoods")
|
||||
public R postReturnGoods(@RequestBody SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
salesOutvoiceDeliveryService.postReturnGoods(salesOutvoiceDelivery);
|
||||
@ -95,11 +100,12 @@ public class SalesOutvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 新增SAP销售退货主数据
|
||||
*
|
||||
* @param salesOutvoiceDelivery SAP销售退货主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增SAP销售退货主数据", notes = "新增SAP销售退货主数据")
|
||||
@SysLog("新增SAP销售退货主数据" )
|
||||
@SysLog("新增SAP销售退货主数据")
|
||||
@PostMapping
|
||||
public R save(@RequestBody SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
return R.ok(salesOutvoiceDeliveryService.save(salesOutvoiceDelivery));
|
||||
@ -107,11 +113,12 @@ public class SalesOutvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 修改SAP销售退货主数据
|
||||
*
|
||||
* @param salesOutvoiceDelivery SAP销售退货主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改SAP销售退货主数据", notes = "修改SAP销售退货主数据")
|
||||
@SysLog("修改SAP销售退货主数据" )
|
||||
@SysLog("修改SAP销售退货主数据")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
return R.ok(salesOutvoiceDeliveryService.updateById(salesOutvoiceDelivery));
|
||||
@ -119,12 +126,13 @@ public class SalesOutvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 通过id删除SAP销售退货主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除SAP销售退货主数据", notes = "通过id删除SAP销售退货主数据")
|
||||
@SysLog("通过id删除SAP销售退货主数据" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@SysLog("通过id删除SAP销售退货主数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(salesOutvoiceDeliveryService.removeById(handle));
|
||||
}
|
||||
@ -132,6 +140,7 @@ public class SalesOutvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param salesOutvoiceDelivery 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ -143,11 +152,12 @@ public class SalesOutvoiceDeliveryController {
|
||||
|
||||
/**
|
||||
* 新增或修改销售退货主表接口用
|
||||
*
|
||||
* @param salesOutvoiceDelivery 销售退货主表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增或修改销售退货主表接口用", notes = "新增或修改销售退货主表接口用")
|
||||
@SysLog("新增或修改销售退货主表接口用" )
|
||||
@SysLog("新增或修改销售退货主表接口用")
|
||||
@PostMapping("/saveOrUpdateSalesOutvoiceDelivery")
|
||||
@Inner(value = false)
|
||||
public R<Boolean> saveOrUpdateSalesOutvoiceDelivery(@RequestBody SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
|
||||
@ -24,21 +24,22 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/sales-outvoice-delivery-item" )
|
||||
@RequestMapping("/sales-outvoice-delivery-item")
|
||||
@Api(value = "sales-outvoice-delivery-item", tags = "SAP销售退货明细数据管理")
|
||||
public class SalesOutvoiceDeliveryItemController {
|
||||
|
||||
private final SalesOutvoiceDeliveryItemService salesOutvoiceDeliveryItemService;
|
||||
private final SalesOutvoiceDeliveryItemService salesOutvoiceDeliveryItemService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param salesOutvoiceDeliveryItem SAP销售退货明细数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_view')" )
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_view')")
|
||||
public R getSalesOutvoiceDeliveryItemPage(Page page, SalesOutvoiceDeliveryItem salesOutvoiceDeliveryItem) {
|
||||
return R.ok(salesOutvoiceDeliveryItemService.page(page, Wrappers.query(salesOutvoiceDeliveryItem)));
|
||||
}
|
||||
@ -46,49 +47,53 @@ public class SalesOutvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 通过id查询SAP销售退货明细数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_view')" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(salesOutvoiceDeliveryItemService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增SAP销售退货明细数据
|
||||
*
|
||||
* @param salesOutvoiceDeliveryItem SAP销售退货明细数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增SAP销售退货明细数据", notes = "新增SAP销售退货明细数据")
|
||||
@SysLog("新增SAP销售退货明细数据" )
|
||||
@SysLog("新增SAP销售退货明细数据")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_add')")
|
||||
public R save(@RequestBody SalesOutvoiceDeliveryItem salesOutvoiceDeliveryItem) {
|
||||
return R.ok(salesOutvoiceDeliveryItemService.save(salesOutvoiceDeliveryItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改SAP销售退货明细数据
|
||||
*
|
||||
* @param salesOutvoiceDeliveryItem SAP销售退货明细数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改SAP销售退货明细数据", notes = "修改SAP销售退货明细数据")
|
||||
@SysLog("修改SAP销售退货明细数据" )
|
||||
@SysLog("修改SAP销售退货明细数据")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_edit')")
|
||||
public R updateById(@RequestBody SalesOutvoiceDeliveryItem salesOutvoiceDeliveryItem) {
|
||||
return R.ok(salesOutvoiceDeliveryItemService.updateById(salesOutvoiceDeliveryItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增或修改SAP销售退货明细数据接口用
|
||||
*
|
||||
* @param salesOutvoiceDeliveryItemList 销售退货明细表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "批量新增或修改SAP销售退货明细数据接口用", notes = "批量新增或修改SAP销售退货明细数据接口用")
|
||||
@SysLog("批量新增或修改SAP销售退货明细数据接口用" )
|
||||
@SysLog("批量新增或修改SAP销售退货明细数据接口用")
|
||||
@PostMapping("/saveOrUpdateSalesOutvoiceDeliveryItemList")
|
||||
@Inner(value = false)
|
||||
public R<Boolean> saveOrUpdateSalesOutvoiceDeliveryItemList(@RequestBody List<SalesOutvoiceDeliveryItem> salesOutvoiceDeliveryItemList) {
|
||||
@ -97,25 +102,27 @@ public class SalesOutvoiceDeliveryItemController {
|
||||
|
||||
/**
|
||||
* 通过id删除SAP销售退货明细数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除SAP销售退货明细数据", notes = "通过id删除SAP销售退货明细数据")
|
||||
@SysLog("通过id删除SAP销售退货明细数据" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_del')" )
|
||||
@SysLog("通过id删除SAP销售退货明细数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(salesOutvoiceDeliveryItemService.removeById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param salesOutvoiceDeliveryItem 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_export')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_salesoutvoicedeliveryitem_export')")
|
||||
public List<SalesOutvoiceDeliveryItem> export(SalesOutvoiceDeliveryItem salesOutvoiceDeliveryItem) {
|
||||
return salesOutvoiceDeliveryItemService.list(Wrappers.query(salesOutvoiceDeliveryItem));
|
||||
}
|
||||
|
||||
@ -19,50 +19,50 @@ import java.util.Optional;
|
||||
@RequestMapping("/shelf-management")
|
||||
public class ShelfManagementController {
|
||||
|
||||
private final ShelfManagementService shelfManagementService;
|
||||
private final ShelfManagementService shelfManagementService;
|
||||
|
||||
@GetMapping("erp-storage-location")
|
||||
public R fetchErpStorageLocationList(Page page, String searchText, String site) {
|
||||
return R.ok(shelfManagementService.fetchErpStorageLocationList(page, searchText, site));
|
||||
}
|
||||
@GetMapping("erp-storage-location")
|
||||
public R fetchErpStorageLocationList(Page page, String searchText, String site) {
|
||||
return R.ok(shelfManagementService.fetchErpStorageLocationList(page, searchText, site));
|
||||
}
|
||||
|
||||
@GetMapping("storage-location")
|
||||
public R fetchStorageLocationList(Page page, String searchText, String site, String erpStorageLocation) {
|
||||
return R.ok(shelfManagementService.fetchStorageLocationList(page, searchText, site, erpStorageLocation));
|
||||
}
|
||||
@GetMapping("storage-location")
|
||||
public R fetchStorageLocationList(Page page, String searchText, String site, String erpStorageLocation) {
|
||||
return R.ok(shelfManagementService.fetchStorageLocationList(page, searchText, site, erpStorageLocation));
|
||||
}
|
||||
|
||||
@GetMapping("storage-bin")
|
||||
public R fetchStorageBinList(Page page, String searchText, String site, String storageLocation) {
|
||||
return R.ok(shelfManagementService.fetchStorageBinList(page, searchText, site, storageLocation));
|
||||
}
|
||||
@GetMapping("storage-bin")
|
||||
public R fetchStorageBinList(Page page, String searchText, String site, String storageLocation) {
|
||||
return R.ok(shelfManagementService.fetchStorageBinList(page, searchText, site, storageLocation));
|
||||
}
|
||||
|
||||
@GetMapping("storage-location-data")
|
||||
public R getStorageLocationData(Page page, String erpStorageLocation, String storageLocation) {
|
||||
if(StrUtil.isNotBlank(storageLocation)){
|
||||
return R.ok(shelfManagementService.getStorageLocationData(page, erpStorageLocation, Sets.newHashSet(Optional.ofNullable(storageLocation).orElse("").split(","))));
|
||||
} else{
|
||||
return R.ok(shelfManagementService.getStorageLocationData(page, erpStorageLocation,null));
|
||||
}
|
||||
@GetMapping("storage-location-data")
|
||||
public R getStorageLocationData(Page page, String erpStorageLocation, String storageLocation) {
|
||||
if (StrUtil.isNotBlank(storageLocation)) {
|
||||
return R.ok(shelfManagementService.getStorageLocationData(page, erpStorageLocation, Sets.newHashSet(Optional.ofNullable(storageLocation).orElse("").split(","))));
|
||||
} else {
|
||||
return R.ok(shelfManagementService.getStorageLocationData(page, erpStorageLocation, null));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("storage-bin-data")
|
||||
public R getStorageBinData(Page page, String storageLocation, String storageBin, String used, String isDefault) {
|
||||
return R.ok(shelfManagementService.getStorageBinData(page, Collections.singleton(storageLocation), storageBin, used, isDefault));
|
||||
}
|
||||
@GetMapping("storage-bin-data")
|
||||
public R getStorageBinData(Page page, String storageLocation, String storageBin, String used, String isDefault) {
|
||||
return R.ok(shelfManagementService.getStorageBinData(page, Collections.singleton(storageLocation), storageBin, used, isDefault));
|
||||
}
|
||||
|
||||
@GetMapping("export")
|
||||
public void exportExcel(String type, String erpStorageLocation, String storageLocation, String storageBin, String used, String isDefault) {
|
||||
try {
|
||||
if(StrUtil.isNotBlank(storageLocation)){
|
||||
shelfManagementService.exportExcel(type, erpStorageLocation, Sets.newHashSet(Optional.ofNullable(storageLocation).orElse("").split(",")), storageBin, used, isDefault);
|
||||
} else{
|
||||
shelfManagementService.exportExcel(type, erpStorageLocation, null, storageBin, used, isDefault);
|
||||
}
|
||||
@GetMapping("export")
|
||||
public void exportExcel(String type, String erpStorageLocation, String storageLocation, String storageBin, String used, String isDefault) {
|
||||
try {
|
||||
if (StrUtil.isNotBlank(storageLocation)) {
|
||||
shelfManagementService.exportExcel(type, erpStorageLocation, Sets.newHashSet(Optional.ofNullable(storageLocation).orElse("").split(",")), storageBin, used, isDefault);
|
||||
} else {
|
||||
shelfManagementService.exportExcel(type, erpStorageLocation, null, storageBin, used, isDefault);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.build("导出失败");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.build("导出失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -21,12 +21,12 @@ public class StorageBinBindInventoryController {
|
||||
private final StorageBinBindInventoryService storageBinBindInventoryService;
|
||||
|
||||
*//**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param storageBinBindInventory 货格库存绑定
|
||||
* @return
|
||||
*//*
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param storageBinBindInventory 货格库存绑定
|
||||
* @return
|
||||
*//*
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getStorageBinBindInventoryPage(FrontPage page, StorageBinBindInventory storageBinBindInventory) {
|
||||
@ -46,11 +46,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 库存移动
|
||||
*
|
||||
* @param dtoList inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
* 库存移动
|
||||
*
|
||||
* @param dtoList inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "库存移动(五金备件)", notes = "库存移动(五金备件)")
|
||||
@PostMapping("/inventoryTransferForKmat")
|
||||
public R inventoryTransferForKmat(@RequestBody List<StorageBinBindInventoryDto> dtoList) {
|
||||
@ -61,11 +61,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 库存移动
|
||||
*
|
||||
* @param dtoList inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
* 库存移动
|
||||
*
|
||||
* @param dtoList inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "库存移动", notes = "库存移动")
|
||||
@PostMapping("/inventoryTransfer")
|
||||
public R inventoryTransfer(@RequestBody List<StorageBinBindInventoryDto> dtoList) {
|
||||
@ -76,11 +76,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过库存或载具查询货架货格
|
||||
*
|
||||
* @param inventoryIdOrCarrier inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
* 通过库存或载具查询货架货格
|
||||
*
|
||||
* @param inventoryIdOrCarrier inventoryId
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过库存查询", notes = "通过库存查询")
|
||||
@GetMapping("/getStorageBin/{inventoryIdOrCarrier}")
|
||||
public R getStorageBin(@PathVariable("inventoryIdOrCarrier") String inventoryIdOrCarrier) {
|
||||
@ -88,11 +88,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过位置和物料查库存
|
||||
*
|
||||
* @param storageBinBindInventoryDto storageBinBindInventoryDto
|
||||
* @return R
|
||||
*//*
|
||||
* 通过位置和物料查库存
|
||||
*
|
||||
* @param storageBinBindInventoryDto storageBinBindInventoryDto
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过位置和物料查库存", notes = "通过位置和物料查库存")
|
||||
@GetMapping("/getKmatInventoryQty")
|
||||
public R getKmatInventoryQty(StorageBinBindInventoryDto storageBinBindInventoryDto) {
|
||||
@ -100,11 +100,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过载具查询箱数
|
||||
*
|
||||
* @param carrier carrier
|
||||
* @return R
|
||||
*//*
|
||||
* 通过载具查询箱数
|
||||
*
|
||||
* @param carrier carrier
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过载具查询", notes = "通过货格查询")
|
||||
@GetMapping("/getInDefaultCarrier/{carrier}")
|
||||
public R getInDefaultCarrier(@PathVariable("carrier") String carrier) {
|
||||
@ -112,11 +112,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过载具查询箱数
|
||||
*
|
||||
* @param carrier carrier
|
||||
* @return R
|
||||
*//*
|
||||
* 通过载具查询箱数
|
||||
*
|
||||
* @param carrier carrier
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过载具查询", notes = "通过货格查询")
|
||||
@GetMapping("/getNotInDefaultCarrier/{carrier}")
|
||||
public R getNotInDefaultCarrier(@PathVariable("carrier") String carrier) {
|
||||
@ -124,11 +124,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过载具查询货架货格
|
||||
*
|
||||
* @param carrier carrier
|
||||
* @return R
|
||||
*//*
|
||||
* 通过载具查询货架货格
|
||||
*
|
||||
* @param carrier carrier
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过货格查询", notes = "通过货格查询")
|
||||
@GetMapping("/getDownCarrier/{carrier}")
|
||||
public R getDownCarrier(@PathVariable("carrier") String carrier) {
|
||||
@ -136,11 +136,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过载具查询箱数
|
||||
*
|
||||
* @param carrier carrier
|
||||
* @return R
|
||||
*//*
|
||||
* 通过载具查询箱数
|
||||
*
|
||||
* @param carrier carrier
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过载具查询", notes = "通过货格查询")
|
||||
@GetMapping("/getUpCarrier/{carrier}")
|
||||
public R getUpCarrier(@PathVariable("carrier") String carrier) {
|
||||
@ -148,11 +148,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过id查询货格库存绑定
|
||||
*
|
||||
* @param storageBin id
|
||||
* @return R
|
||||
*//*
|
||||
* 通过id查询货格库存绑定
|
||||
*
|
||||
* @param storageBin id
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过货格查询", notes = "通过货格查询")
|
||||
@GetMapping("/getCarrierList")
|
||||
public R getCarrierList(String storageBin) {
|
||||
@ -160,11 +160,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 上架到默认库存
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
* 上架到默认库存
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "上架到默认库存", notes = "上架到默认库存")
|
||||
@SysLog("上架到默认库存")
|
||||
@PostMapping("/upDefault")
|
||||
@ -176,15 +176,15 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 下架到默认库位
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
*//**
|
||||
* @param dto
|
||||
* @return
|
||||
*//*
|
||||
* 下架到默认库位
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
*//**
|
||||
* @param dto
|
||||
* @return
|
||||
*//*
|
||||
@ApiOperation(value = "下架到默认库位", notes = "下架到默认库位")
|
||||
@SysLog("下架到默认库位")
|
||||
@PostMapping("/downDefault")
|
||||
@ -196,11 +196,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 上架
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
* 上架
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "新增货格库存绑定", notes = "新增货格库存绑定")
|
||||
@SysLog("新增货格库存绑定")
|
||||
@PostMapping("/up")
|
||||
@ -211,11 +211,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 一键下架
|
||||
*
|
||||
* @param storageLocation
|
||||
* @return R
|
||||
*//*
|
||||
* 一键下架
|
||||
*
|
||||
* @param storageLocation
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "一键下架", notes = "一键下架")
|
||||
@SysLog("新增货格库存绑定")
|
||||
@PostMapping("/unbindByStorageLocation")
|
||||
@ -227,11 +227,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 下架
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
* 下架
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "新增货格库存绑定", notes = "新增货格库存绑定")
|
||||
@SysLog("新增货格库存绑定")
|
||||
@PostMapping("/down")
|
||||
@ -244,11 +244,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 修改货格库存绑定
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
* 修改货格库存绑定
|
||||
*
|
||||
* @param dtoList 货格库存绑定
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "修改货格库存绑定", notes = "修改货格库存绑定")
|
||||
@SysLog("修改货格库存绑定")
|
||||
@PutMapping
|
||||
@ -266,11 +266,11 @@ public class StorageBinBindInventoryController {
|
||||
}
|
||||
|
||||
*//**
|
||||
* 通过id删除货格库存绑定
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*//*
|
||||
* 通过id删除货格库存绑定
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*//*
|
||||
@ApiOperation(value = "通过id删除货格库存绑定", notes = "通过id删除货格库存绑定")
|
||||
@SysLog("通过id删除货格库存绑定")
|
||||
@DeleteMapping("/{handle}")
|
||||
@ -281,12 +281,12 @@ public class StorageBinBindInventoryController {
|
||||
|
||||
|
||||
*//**
|
||||
* 获取备品备件的物料
|
||||
*
|
||||
* @param page
|
||||
* @param item
|
||||
* @return
|
||||
*//*
|
||||
* 获取备品备件的物料
|
||||
*
|
||||
* @param page
|
||||
* @param item
|
||||
* @return
|
||||
*//*
|
||||
@GetMapping("/fetchKmatItemList")
|
||||
public R fetchItemList(Page page, String item) {
|
||||
return R.ok(storageBinBindInventoryService.fetchKmatItemList(page, item));
|
||||
|
||||
@ -24,7 +24,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/storagebin-type" )
|
||||
@RequestMapping("/storagebin-type")
|
||||
@Api(value = "storagebintype", tags = "存储货格类型主数据管理")
|
||||
public class StorageBinTypeController {
|
||||
|
||||
@ -32,68 +32,73 @@ public class StorageBinTypeController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param storageBinType 存储货格类型主数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getStorageBinTypePage(Page page, StorageBinType storageBinType) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
return R.ok(storageBinTypeService.page(page, Wrappers.<StorageBinType>lambdaQuery()
|
||||
.like(storageBinType.getStorageBinType() != null,StorageBinType::getStorageBinType,storageBinType.getStorageBinType())
|
||||
.eq(StorageBinType::getSite,site)
|
||||
.orderByDesc(StorageBinType::getCreateTime)));
|
||||
.like(storageBinType.getStorageBinType() != null, StorageBinType::getStorageBinType, storageBinType.getStorageBinType())
|
||||
.eq(StorageBinType::getSite, site)
|
||||
.orderByDesc(StorageBinType::getCreateTime)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询存储货格类型主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_view')" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(storageBinTypeService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增存储货格类型主数据
|
||||
*
|
||||
* @param storageBinType 存储货格类型主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增存储货格类型主数据", notes = "新增存储货格类型主数据")
|
||||
@SysLog("新增存储货格类型主数据" )
|
||||
@SysLog("新增存储货格类型主数据")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_add')")
|
||||
public R save(@RequestBody StorageBinType storageBinType) {
|
||||
return R.ok(storageBinTypeService.save(storageBinType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改存储货格类型主数据
|
||||
*
|
||||
* @param storageBinType 存储货格类型主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改存储货格类型主数据", notes = "修改存储货格类型主数据")
|
||||
@SysLog("修改存储货格类型主数据" )
|
||||
@SysLog("修改存储货格类型主数据")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_edit')")
|
||||
public R updateById(@RequestBody StorageBinType storageBinType) {
|
||||
return R.ok(storageBinTypeService.updateById(storageBinType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除存储货格类型主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除存储货格类型主数据", notes = "通过id删除存储货格类型主数据")
|
||||
@SysLog("通过id删除存储货格类型主数据" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_del')" )
|
||||
@SysLog("通过id删除存储货格类型主数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(storageBinTypeService.removeById(handle));
|
||||
}
|
||||
@ -101,12 +106,13 @@ public class StorageBinTypeController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param storageBinType 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_export')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_type_export')")
|
||||
public List<StorageBinType> export(StorageBinType storageBinType) {
|
||||
return storageBinTypeService.list(Wrappers.query(storageBinType));
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/storage-location-type" )
|
||||
@RequestMapping("/storage-location-type")
|
||||
@Api(value = "wmsstoragelocationtype", tags = "存储位置类型主数据管理")
|
||||
public class StorageLocationTypeController {
|
||||
|
||||
@ -32,68 +32,73 @@ public class StorageLocationTypeController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param storageLocationType 存储位置类型主数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getWmsStorageLocationTypePage(Page page, StorageLocationType storageLocationType) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
return R.ok(storageLocationTypeService.page(page, Wrappers.<StorageLocationType>lambdaQuery()
|
||||
.like(storageLocationType.getStorageLocationType() != null,StorageLocationType::getStorageLocationType,storageLocationType.getStorageLocationType())
|
||||
.eq(StorageLocationType::getSite,site)
|
||||
.orderByDesc(StorageLocationType::getCreateTime)));
|
||||
.like(storageLocationType.getStorageLocationType() != null, StorageLocationType::getStorageLocationType, storageLocationType.getStorageLocationType())
|
||||
.eq(StorageLocationType::getSite, site)
|
||||
.orderByDesc(StorageLocationType::getCreateTime)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询存储位置类型主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsstoragelocationtype_view')" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsstoragelocationtype_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(storageLocationTypeService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增存储位置类型主数据
|
||||
*
|
||||
* @param storageLocationType 存储位置类型主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增存储位置类型主数据", notes = "新增存储位置类型主数据")
|
||||
@SysLog("新增存储位置类型主数据" )
|
||||
@SysLog("新增存储位置类型主数据")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_type_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_type_add')")
|
||||
public R save(@RequestBody StorageLocationType storageLocationType) {
|
||||
return R.ok(storageLocationTypeService.save(storageLocationType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改存储位置类型主数据
|
||||
*
|
||||
* @param storageLocationType 存储位置类型主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改存储位置类型主数据", notes = "修改存储位置类型主数据")
|
||||
@SysLog("修改存储位置类型主数据" )
|
||||
@SysLog("修改存储位置类型主数据")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_type_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_type_edit')")
|
||||
public R updateById(@RequestBody StorageLocationType storageLocationType) {
|
||||
return R.ok(storageLocationTypeService.updateById(storageLocationType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除存储位置类型主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除存储位置类型主数据", notes = "通过id删除存储位置类型主数据")
|
||||
@SysLog("通过id删除存储位置类型主数据" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_type_del')" )
|
||||
@SysLog("通过id删除存储位置类型主数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_type_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(storageLocationTypeService.removeById(handle));
|
||||
}
|
||||
@ -101,12 +106,13 @@ public class StorageLocationTypeController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param storageLocationType 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_type_export')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_type_export')")
|
||||
public List<StorageLocationType> export(StorageLocationType storageLocationType) {
|
||||
return storageLocationTypeService.list(Wrappers.query(storageLocationType));
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.foreverwin.iep.common.base.FrontPage;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
@ -17,14 +16,9 @@ import com.foreverwin.nlv.wms.service.TempUEightItemService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -44,7 +38,8 @@ public class TempUEightItemController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param tempUEightItem
|
||||
* @return
|
||||
*/
|
||||
@ -58,19 +53,20 @@ public class TempUEightItemController {
|
||||
queryWrapper.lambda().eq(TempUEightItem::getSite, TenantContextHolder.getTenantId()).eq(
|
||||
StrUtil.isNotBlank(tempUEightItem.getItemTypeCode()), TempUEightItem::getItemTypeCode,
|
||||
tempUEightItem.getItemTypeCode()).and(StrUtil.isNotBlank(isSingle) && "Y".equals(isSingle),
|
||||
qw -> qw.isNotNull(TempUEightItem::getSapItem)
|
||||
.and(q -> q.ne(TempUEightItem::getSapItem, ""))).and(
|
||||
qw -> qw.isNotNull(TempUEightItem::getSapItem)
|
||||
.and(q -> q.ne(TempUEightItem::getSapItem, ""))).and(
|
||||
isSelect, qw -> qw.like(TempUEightItem::getUEightCode,
|
||||
page.getSearchText()).or().like(
|
||||
TempUEightItem::getUEightDesc, page.getSearchText()).or().like(TempUEightItem::getSapItem,
|
||||
page.getSearchText()).or()
|
||||
.like(TempUEightItem::getSapItemDesc,
|
||||
page.getSearchText()));
|
||||
page.getSearchText()).or().like(
|
||||
TempUEightItem::getUEightDesc, page.getSearchText()).or().like(TempUEightItem::getSapItem,
|
||||
page.getSearchText()).or()
|
||||
.like(TempUEightItem::getSapItemDesc,
|
||||
page.getSearchText()));
|
||||
return R.ok(tempUEightItemService.page(page, queryWrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据U8Code获取数据
|
||||
*
|
||||
* @param u8Code
|
||||
* @return
|
||||
*/
|
||||
@ -80,12 +76,12 @@ public class TempUEightItemController {
|
||||
public R getTempSapItemByCode(String u8Code) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
TempUEightItem tempUEightItem = tempUEightItemService.getOne(Wrappers.<TempUEightItem>lambdaQuery()
|
||||
.eq(TempUEightItem::getSite, site)
|
||||
.eq(TempUEightItem::getUEightCode, u8Code), false);
|
||||
.eq(TempUEightItem::getSite, site)
|
||||
.eq(TempUEightItem::getUEightCode, u8Code), false);
|
||||
return R.ok(tempUEightItem);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "根据模板创建U8数据", notes = "根据模板创建U8数据")
|
||||
@SysLog("根据模板创建U8数据")
|
||||
@PostMapping("/createUEightCode")
|
||||
@ -93,21 +89,21 @@ public class TempUEightItemController {
|
||||
public R createUEightCode(@RequestBody String jsonList) {
|
||||
JSONArray dataArray = JSONArray.parseArray(jsonList);
|
||||
List<String> errorList = new ArrayList<>();
|
||||
|
||||
|
||||
List<TempUEightItem> tempUEightItems = new ArrayList<>();
|
||||
for (int i = 0; i < dataArray.size(); i++) {
|
||||
JSONObject jsonObject = dataArray.getJSONObject(i);
|
||||
String uEightCode = jsonObject.getString("uEightCode");
|
||||
String description = jsonObject.getString("description");
|
||||
|
||||
|
||||
// 查询是否存在uEightCode
|
||||
String site = "2031";
|
||||
TempUEightItem tempUEightItem = tempUEightItemService.getOne(Wrappers.<TempUEightItem>lambdaQuery()
|
||||
.eq(TempUEightItem::getSite, site)
|
||||
.eq(TempUEightItem::getUEightCode, uEightCode), false);
|
||||
.eq(TempUEightItem::getSite, site)
|
||||
.eq(TempUEightItem::getUEightCode, uEightCode), false);
|
||||
if (tempUEightItem != null) {
|
||||
errorList.add(uEightCode);
|
||||
}else {
|
||||
} else {
|
||||
// 创建tempUEightItem:白包
|
||||
TempUEightItem tempUEightItem_23 = new TempUEightItem();
|
||||
tempUEightItem_23.setUuid(UUID.randomUUID().toString());
|
||||
@ -127,7 +123,7 @@ public class TempUEightItemController {
|
||||
tempUEightItem_23.setCategroy("隐形车衣");
|
||||
tempUEightItem_23.setType("3");
|
||||
tempUEightItems.add(tempUEightItem_23);
|
||||
|
||||
|
||||
// 创建tempUEightItem:彩包
|
||||
TempUEightItem tempUEightItem_91 = new TempUEightItem();
|
||||
tempUEightItem_91.setUuid(UUID.randomUUID().toString());
|
||||
@ -149,14 +145,14 @@ public class TempUEightItemController {
|
||||
tempUEightItems.add(tempUEightItem_91);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (errorList.isEmpty()) {
|
||||
tempUEightItemService.saveBatch(tempUEightItems);
|
||||
return R.ok("新增成功");
|
||||
}else {
|
||||
} else {
|
||||
// 不为空
|
||||
return new R(2, "警告:以下u8code重复,不允许添加", errorList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,31 +24,31 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/vendor")
|
||||
public class VendorController {
|
||||
|
||||
private final VendorService vendorService;
|
||||
private final VendorService vendorService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param vendor 供应商维护
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getVendorPage(Page page, Vendor vendor) {
|
||||
return R.ok(vendorService.page(page, Wrappers.query(vendor)));
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param vendor 供应商维护
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getVendorPage(Page page, Vendor vendor) {
|
||||
return R.ok(vendorService.page(page, Wrappers.query(vendor)));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页弹窗查询", notes = "分页弹窗查询")
|
||||
@GetMapping("/pageText")
|
||||
public R getVendorPage(FrontPage<Vendor> page, Vendor vendor) {
|
||||
String searchText = page.getSearchText();
|
||||
return R.ok(vendorService.page(page, Wrappers.lambdaQuery(Vendor.class)
|
||||
.setEntity(vendor)
|
||||
.and(StrUtil.isNotBlank(searchText), qw -> qw.like(StrUtil.isNotBlank(searchText), Vendor::getVendorCode, searchText)
|
||||
.or().like(StrUtil.isNotBlank(searchText), Vendor::getVendorName, searchText))
|
||||
));
|
||||
}
|
||||
@ApiOperation(value = "分页弹窗查询", notes = "分页弹窗查询")
|
||||
@GetMapping("/pageText")
|
||||
public R getVendorPage(FrontPage<Vendor> page, Vendor vendor) {
|
||||
String searchText = page.getSearchText();
|
||||
return R.ok(vendorService.page(page, Wrappers.lambdaQuery(Vendor.class)
|
||||
.setEntity(vendor)
|
||||
.and(StrUtil.isNotBlank(searchText), qw -> qw.like(StrUtil.isNotBlank(searchText), Vendor::getVendorCode, searchText)
|
||||
.or().like(StrUtil.isNotBlank(searchText), Vendor::getVendorName, searchText))
|
||||
));
|
||||
}
|
||||
|
||||
/*@PostMapping("/receive")
|
||||
public R receiveInterface(@RequestBody Map<String,String> requestMap) {
|
||||
|
||||
@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wmscustomer" )
|
||||
@RequestMapping("/wmscustomer")
|
||||
@Api(value = "wmscustomer", tags = "客户信息临时表管理")
|
||||
public class WmsCustomerController {
|
||||
|
||||
@ -29,18 +29,19 @@ public class WmsCustomerController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wmsCustomer 客户信息临时表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getWmsCustomerPage(FrontPage<WmsCustomer> page, WmsCustomer wmsCustomer) {
|
||||
QueryWrapper<WmsCustomer> queryWrapper = new QueryWrapper<>(wmsCustomer);
|
||||
if (page.getSearchText() != null && !page.getSearchText().trim().isEmpty()) {
|
||||
queryWrapper.lambda().and(wrapper -> wrapper.eq(WmsCustomer::getSite, TenantContextHolder.getTenantId())
|
||||
.like(WmsCustomer::getCustomerCode, page.getSearchText()).or()
|
||||
.like(WmsCustomer::getCustomerName, page.getSearchText()));
|
||||
.like(WmsCustomer::getCustomerCode, page.getSearchText()).or()
|
||||
.like(WmsCustomer::getCustomerName, page.getSearchText()));
|
||||
} else {
|
||||
queryWrapper.lambda().eq(WmsCustomer::getSite, TenantContextHolder.getTenantId());
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wmscuttinginventory" )
|
||||
@RequestMapping("/wmscuttinginventory")
|
||||
@Api(value = "wmscuttinginventory", tags = "库存信息拓展表管理")
|
||||
public class WmsCuttingInventoryController {
|
||||
|
||||
@ -27,11 +27,12 @@ public class WmsCuttingInventoryController {
|
||||
|
||||
/**
|
||||
* 纳科达-白包托盘码生成、白包单件下线-扫描卷号事件
|
||||
*
|
||||
* @param wmsCuttingInventory
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过inventoryId卷号查询", notes = "通过inventoryId卷号查询")
|
||||
@GetMapping("/getLabelDataByLabelNo" )
|
||||
@GetMapping("/getLabelDataByLabelNo")
|
||||
@SysLog("纳科达白包托盘码生成-扫描卷号事件")
|
||||
public R getByInventoryId(WmsCuttingInventory wmsCuttingInventory) {
|
||||
return R.ok(wmsCuttingInventoryService.getByInventoryId(wmsCuttingInventory));
|
||||
@ -49,6 +50,6 @@ public class WmsCuttingInventoryController {
|
||||
public R cutOffLineStagnantSubstanceCheckCreate(WmsCuttingInventory wmsCuttingInventory) {
|
||||
return R.ok(wmsCuttingInventoryService.cutOffLineStagnantSubstanceCheckCreate(wmsCuttingInventory));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.iep.common.utils.ThreadPoolUtil;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
@ -12,7 +13,6 @@ import com.foreverwin.mom.common.security.annotation.Inner;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.nlv.wms.domain.CarrierUnbindBatchRequest;
|
||||
import com.foreverwin.nlv.wms.entity.WmsCuttingPackage;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.service.WmsCuttingPackageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -30,27 +30,29 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wmscuttingpackage" )
|
||||
@RequestMapping("/wmscuttingpackage")
|
||||
@Api(value = "wmscuttingpackage", tags = "分切下线包装表管理")
|
||||
public class WmsCuttingPackageController {
|
||||
|
||||
private final WmsCuttingPackageService wmsCuttingPackageService;
|
||||
|
||||
|
||||
/**
|
||||
* 纳科达白包托盘码生成-通过id删除事件
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除分切下线包装表", notes = "通过id删除分切下线包装表")
|
||||
@SysLog("通过id删除分切下线包装表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@SysLog("通过id删除分切下线包装表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(wmsCuttingPackageService.removeById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 纳科达白包托盘码生成-托盘码生成事件,呆滞物托盘码生成
|
||||
* @param wmsCuttingPackageList
|
||||
*
|
||||
* @param wmsCuttingPackageList
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "白包托盘码生成,呆滞物托盘码生成,白包盘点托盘码生成", notes = "白包托盘码生成,呆滞物托盘码生成,白包盘点托盘码生成")
|
||||
@ -63,7 +65,8 @@ public class WmsCuttingPackageController {
|
||||
|
||||
/**
|
||||
* 纳科达彩包托盘码生成-托盘码生成事件
|
||||
* @param wmsCuttingPackage
|
||||
*
|
||||
* @param wmsCuttingPackage
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "彩包托盘码生成", notes = "彩包托盘码生成")
|
||||
@ -76,7 +79,8 @@ public class WmsCuttingPackageController {
|
||||
|
||||
/**
|
||||
* 纳琳科单件码录入-卷号扫描事件
|
||||
* @param wmsCuttingPackage
|
||||
*
|
||||
* @param wmsCuttingPackage
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "纳琳科单件码录入-卷号扫描事件", notes = "纳琳科单件码录入-卷号扫描事件")
|
||||
@ -90,7 +94,8 @@ public class WmsCuttingPackageController {
|
||||
|
||||
/**
|
||||
* 单卷录入-卷号扫描事件
|
||||
* @param wmsCuttingPackage
|
||||
*
|
||||
* @param wmsCuttingPackage
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "单卷录入-卷号扫描事件", notes = "单卷录入-卷号扫描事件")
|
||||
@ -100,8 +105,8 @@ public class WmsCuttingPackageController {
|
||||
wmsCuttingPackageService.singleRollScan(wmsCuttingPackage, isSaveInventory);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 纳科达白包-卷号扫描事件
|
||||
*
|
||||
@ -115,8 +120,8 @@ public class WmsCuttingPackageController {
|
||||
wmsCuttingPackageService.batchNumberScanWhiteCheck(wmsCuttingPackage);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 纳科达呆滞物盘带点-生成卷号绑定关系
|
||||
*
|
||||
@ -130,8 +135,8 @@ public class WmsCuttingPackageController {
|
||||
wmsCuttingPackageService.generatePackageRelationship(wmsCuttingPackage);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 托盘明细查询
|
||||
*
|
||||
@ -151,7 +156,7 @@ public class WmsCuttingPackageController {
|
||||
public R packageBind(@PathVariable String batchNumber) {
|
||||
return R.ok(wmsCuttingPackageService.packageBind(batchNumber));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 托盘明细-卷号查询
|
||||
*
|
||||
@ -187,7 +192,7 @@ public class WmsCuttingPackageController {
|
||||
wmsCuttingPackageService.unbindMaterialLotAndPackageNumber(wmsInventory.getMaterialLot());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "按批次批量解托", notes = "按批次批量解托")
|
||||
@SysLog("按批次批量解托")
|
||||
@PostMapping("/unbindBatchMaterialLot")
|
||||
@ -199,7 +204,7 @@ public class WmsCuttingPackageController {
|
||||
@ApiOperation(value = "单卷查询-补打印", notes = "单卷查询-补打印")
|
||||
@SysLog("单卷查询-补打印")
|
||||
@GetMapping("/reprint/{printName}/{packageNumber}")
|
||||
public R reprint(@PathVariable String printName,@PathVariable String packageNumber) {
|
||||
public R reprint(@PathVariable String printName, @PathVariable String packageNumber) {
|
||||
wmsCuttingPackageService.rePrint(printName, packageNumber);
|
||||
return R.ok();
|
||||
}
|
||||
@ -214,9 +219,8 @@ public class WmsCuttingPackageController {
|
||||
}
|
||||
return wmsCuttingPackageService.updateCuttingPackageNoPrint(JSONArray.parseArray(jsonList));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/trayNumberCreate")
|
||||
@SysLog("托盘码创建")
|
||||
@ApiOperation(value = "托盘码创建")
|
||||
@ -226,7 +230,7 @@ public class WmsCuttingPackageController {
|
||||
if (StrUtil.isBlank(printName)) {
|
||||
throw BusinessException.build("打印机名称名称不能为空!");
|
||||
}
|
||||
|
||||
|
||||
if (StrUtil.isBlank(count)) {
|
||||
throw BusinessException.build("创建个数不能为空!");
|
||||
}
|
||||
@ -236,12 +240,12 @@ public class WmsCuttingPackageController {
|
||||
// 打印
|
||||
for (String packageNumber : strings) {
|
||||
// 开个独立的线程,避免阻塞
|
||||
ThreadPoolUtil.execute(()->{
|
||||
ThreadPoolUtil.execute(() -> {
|
||||
wmsCuttingPackageService.print(printName, packageNumber, tenantId, userName);
|
||||
});
|
||||
}
|
||||
return R.ok(strings);
|
||||
}else {
|
||||
} else {
|
||||
return R.failed("生成托盘码失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,21 +24,22 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wms-delivery-in-item-itf" )
|
||||
@RequestMapping("/wms-delivery-in-item-itf")
|
||||
@Api(value = "wms-delivery-in-item-itf", tags = "交货单接收接口从表管理")
|
||||
public class WmsDeliveryInItemItfController {
|
||||
|
||||
private final WmsDeliveryInItemItfService wmsDeliveryInItemItfService;
|
||||
private final WmsDeliveryInItemItfService wmsDeliveryInItemItfService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wmsDeliveryInItemItf 交货单接收接口从表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_view')" )
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_view')")
|
||||
public R getWmsDeliveryInItemItfPage(Page page, WmsDeliveryInItemItf wmsDeliveryInItemItf) {
|
||||
return R.ok(wmsDeliveryInItemItfService.page(page, Wrappers.query(wmsDeliveryInItemItf)));
|
||||
}
|
||||
@ -46,23 +47,25 @@ public class WmsDeliveryInItemItfController {
|
||||
|
||||
/**
|
||||
* 通过id查询交货单接收接口从表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_view')" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(wmsDeliveryInItemItfService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增交货单接收接口从表接口用
|
||||
*
|
||||
* @param wmsDeliveryInItemItfList 交货单接收接口从表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增交货单接收接口从表接口用", notes = "新增交货单接收接口从表接口用")
|
||||
@SysLog("新增交货单接收接口从表接口用" )
|
||||
@SysLog("新增交货单接收接口从表接口用")
|
||||
@PostMapping("/saveWmsDeliveryInItemItfList")
|
||||
@Inner(value = false)
|
||||
public R saveWmsDeliveryInItemItfList(@RequestBody List<WmsDeliveryInItemItf> wmsDeliveryInItemItfList) {
|
||||
@ -71,39 +74,42 @@ public class WmsDeliveryInItemItfController {
|
||||
|
||||
/**
|
||||
* 新增交货单接收接口从表
|
||||
*
|
||||
* @param wmsDeliveryInItemItf 交货单接收接口从表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增交货单接收接口从表", notes = "新增交货单接收接口从表")
|
||||
@SysLog("新增交货单接收接口从表" )
|
||||
@SysLog("新增交货单接收接口从表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_add')")
|
||||
public R save(@RequestBody WmsDeliveryInItemItf wmsDeliveryInItemItf) {
|
||||
return R.ok(wmsDeliveryInItemItfService.save(wmsDeliveryInItemItf));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改交货单接收接口从表
|
||||
*
|
||||
* @param wmsDeliveryInItemItf 交货单接收接口从表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改交货单接收接口从表", notes = "修改交货单接收接口从表")
|
||||
@SysLog("修改交货单接收接口从表" )
|
||||
@SysLog("修改交货单接收接口从表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_edit')")
|
||||
public R updateById(@RequestBody WmsDeliveryInItemItf wmsDeliveryInItemItf) {
|
||||
return R.ok(wmsDeliveryInItemItfService.updateById(wmsDeliveryInItemItf));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除交货单接收接口从表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除交货单接收接口从表", notes = "通过id删除交货单接收接口从表")
|
||||
@SysLog("通过id删除交货单接收接口从表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_del')" )
|
||||
@SysLog("通过id删除交货单接收接口从表")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(wmsDeliveryInItemItfService.removeById(handle));
|
||||
}
|
||||
@ -111,12 +117,13 @@ public class WmsDeliveryInItemItfController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param wmsDeliveryInItemItf 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_export')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitemitf_export')")
|
||||
public List<WmsDeliveryInItemItf> export(WmsDeliveryInItemItf wmsDeliveryInItemItf) {
|
||||
return wmsDeliveryInItemItfService.list(Wrappers.query(wmsDeliveryInItemItf));
|
||||
}
|
||||
|
||||
@ -24,21 +24,22 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wms-delivery-in-itf" )
|
||||
@RequestMapping("/wms-delivery-in-itf")
|
||||
@Api(value = "wms-delivery-in-itf", tags = "交货单接收接口主表管理")
|
||||
public class WmsDeliveryInItfController {
|
||||
|
||||
private final WmsDeliveryInItfService wmsDeliveryInItfService;
|
||||
private final WmsDeliveryInItfService wmsDeliveryInItfService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wmsDeliveryInItf 交货单接收接口主表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_view')" )
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_view')")
|
||||
public R getWmsDeliveryInItfPage(Page page, WmsDeliveryInItf wmsDeliveryInItf) {
|
||||
return R.ok(wmsDeliveryInItfService.page(page, Wrappers.query(wmsDeliveryInItf)));
|
||||
}
|
||||
@ -46,23 +47,25 @@ public class WmsDeliveryInItfController {
|
||||
|
||||
/**
|
||||
* 通过id查询交货单接收接口主表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_view')" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(wmsDeliveryInItfService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增交货单接收接口主表接口用
|
||||
*
|
||||
* @param wmsDeliveryInItf 交货单接收接口主表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增交货单接收接口主表接口用", notes = "新增交货单接收接口主表接口用")
|
||||
@SysLog("新增交货单接收接口主表接口用" )
|
||||
@SysLog("新增交货单接收接口主表接口用")
|
||||
@PostMapping("/saveWmsDeliveryInItf")
|
||||
@Inner(value = false)
|
||||
public R saveWmsDeliveryInItf(@RequestBody WmsDeliveryInItf wmsDeliveryInItf) {
|
||||
@ -71,39 +74,42 @@ public class WmsDeliveryInItfController {
|
||||
|
||||
/**
|
||||
* 新增交货单接收接口主表
|
||||
*
|
||||
* @param wmsDeliveryInItf 交货单接收接口主表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增交货单接收接口主表", notes = "新增交货单接收接口主表")
|
||||
@SysLog("新增交货单接收接口主表" )
|
||||
@SysLog("新增交货单接收接口主表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_add')")
|
||||
public R save(@RequestBody WmsDeliveryInItf wmsDeliveryInItf) {
|
||||
return R.ok(wmsDeliveryInItfService.save(wmsDeliveryInItf));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改交货单接收接口主表
|
||||
*
|
||||
* @param wmsDeliveryInItf 交货单接收接口主表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改交货单接收接口主表", notes = "修改交货单接收接口主表")
|
||||
@SysLog("修改交货单接收接口主表" )
|
||||
@SysLog("修改交货单接收接口主表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_edit')")
|
||||
public R updateById(@RequestBody WmsDeliveryInItf wmsDeliveryInItf) {
|
||||
return R.ok(wmsDeliveryInItfService.updateById(wmsDeliveryInItf));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除交货单接收接口主表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除交货单接收接口主表", notes = "通过id删除交货单接收接口主表")
|
||||
@SysLog("通过id删除交货单接收接口主表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_del')" )
|
||||
@SysLog("通过id删除交货单接收接口主表")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(wmsDeliveryInItfService.removeById(handle));
|
||||
}
|
||||
@ -111,12 +117,13 @@ public class WmsDeliveryInItfController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param wmsDeliveryInItf 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_export')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_wmsdeliveryinitf_export')")
|
||||
public List<WmsDeliveryInItf> export(WmsDeliveryInItf wmsDeliveryInItf) {
|
||||
return wmsDeliveryInItfService.list(Wrappers.query(wmsDeliveryInItf));
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wmsdocumentadvancebind" )
|
||||
@RequestMapping("/wmsdocumentadvancebind")
|
||||
@Api(value = "wmsdocumentadvancebind", tags = "单据预绑表管理")
|
||||
public class WmsDocumentAdvanceBindController {
|
||||
|
||||
@ -31,13 +31,14 @@ public class WmsDocumentAdvanceBindController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wmsDocumentAdvanceBind 单据预绑表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_view')" )
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_view')")
|
||||
public R getWmsDocumentAdvanceBindPage(Page page, WmsDocumentAdvanceBind wmsDocumentAdvanceBind) {
|
||||
return R.ok(wmsDocumentAdvanceBindService.page(page, Wrappers.query(wmsDocumentAdvanceBind)));
|
||||
}
|
||||
@ -45,51 +46,55 @@ public class WmsDocumentAdvanceBindController {
|
||||
|
||||
/**
|
||||
* 通过id查询单据预绑表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_view')" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(wmsDocumentAdvanceBindService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单据预绑表
|
||||
*
|
||||
* @param wmsDocumentAdvanceBind 单据预绑表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增单据预绑表", notes = "新增单据预绑表")
|
||||
@SysLog("新增单据预绑表" )
|
||||
@SysLog("新增单据预绑表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_add')")
|
||||
public R save(@RequestBody WmsDocumentAdvanceBind wmsDocumentAdvanceBind) {
|
||||
return R.ok(wmsDocumentAdvanceBindService.save(wmsDocumentAdvanceBind));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单据预绑表
|
||||
*
|
||||
* @param wmsDocumentAdvanceBind 单据预绑表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改单据预绑表", notes = "修改单据预绑表")
|
||||
@SysLog("修改单据预绑表" )
|
||||
@SysLog("修改单据预绑表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_edit')")
|
||||
public R updateById(@RequestBody WmsDocumentAdvanceBind wmsDocumentAdvanceBind) {
|
||||
return R.ok(wmsDocumentAdvanceBindService.updateById(wmsDocumentAdvanceBind));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除单据预绑表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除单据预绑表", notes = "通过id删除单据预绑表")
|
||||
@SysLog("通过id删除单据预绑表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_del')" )
|
||||
@SysLog("通过id删除单据预绑表")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(wmsDocumentAdvanceBindService.removeById(handle));
|
||||
}
|
||||
@ -97,12 +102,13 @@ public class WmsDocumentAdvanceBindController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param wmsDocumentAdvanceBind 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_export')" )
|
||||
@PreAuthorize("@pms.hasPermission('generator_wmsdocumentadvancebind_export')")
|
||||
public List<WmsDocumentAdvanceBind> export(WmsDocumentAdvanceBind wmsDocumentAdvanceBind) {
|
||||
return wmsDocumentAdvanceBindService.list(Wrappers.query(wmsDocumentAdvanceBind));
|
||||
}
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
package com.foreverwin.nlv.wms.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.foreverwin.iep.common.base.FrontPage;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import com.foreverwin.nlv.wms.dto.WmsDocumentSplittingDTO;
|
||||
import com.foreverwin.nlv.wms.dto.WmsProductrecDTO;
|
||||
@ -26,7 +22,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wmsdocumentsplitting" )
|
||||
@RequestMapping("/wmsdocumentsplitting")
|
||||
@Api(value = "wmsdocumentsplitting", tags = "单据拆分表管理")
|
||||
public class WmsDocumentSplittingController {
|
||||
|
||||
@ -34,7 +30,8 @@ public class WmsDocumentSplittingController {
|
||||
|
||||
/**
|
||||
* 新增单据拆分表
|
||||
* @param wmsDocumentSplittingList
|
||||
*
|
||||
* @param wmsDocumentSplittingList
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增单据拆分表", notes = "新增单据拆分表")
|
||||
@ -47,11 +44,12 @@ public class WmsDocumentSplittingController {
|
||||
|
||||
/**
|
||||
* 修改单据拆分表
|
||||
*
|
||||
* @param wmsDocumentSplittingList
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改单据拆分表", notes = "修改单据拆分表")
|
||||
@SysLog("修改单据拆分表" )
|
||||
@SysLog("修改单据拆分表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody List<WmsDocumentSplitting> wmsDocumentSplittingList) {
|
||||
wmsDocumentSplittingService.updateDocumentSplitting(wmsDocumentSplittingList);
|
||||
@ -60,12 +58,13 @@ public class WmsDocumentSplittingController {
|
||||
|
||||
/**
|
||||
* 通过原单据号删除单据拆分表数据
|
||||
*
|
||||
* @param originalDocumentNo
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过原单据号删除单据拆分表数据", notes = "通过原单据号删除单据拆分表数据")
|
||||
@SysLog("通过原单据号删除单据拆分表数据" )
|
||||
@DeleteMapping("/{originalDocumentNo}" )
|
||||
@SysLog("通过原单据号删除单据拆分表数据")
|
||||
@DeleteMapping("/{originalDocumentNo}")
|
||||
public R removeByOriginalDocumentNo(@PathVariable String originalDocumentNo) {
|
||||
wmsDocumentSplittingService.removeByOriginalDocumentNo(originalDocumentNo);
|
||||
return R.ok();
|
||||
@ -73,11 +72,12 @@ public class WmsDocumentSplittingController {
|
||||
|
||||
/**
|
||||
* 通过原单据号和物料号删除单据拆分表数据
|
||||
*
|
||||
* @param wmsDocumentSplittingList
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过原单据号和物料号删除单据拆分表数据", notes = "通过原单据号和物料号删除单据拆分表数据")
|
||||
@SysLog("通过原单据号删除单据拆分表" )
|
||||
@SysLog("通过原单据号删除单据拆分表")
|
||||
@DeleteMapping()
|
||||
public R removeByOriginalDocumentNoAndItemBo(@RequestBody List<WmsDocumentSplitting> wmsDocumentSplittingList) {
|
||||
wmsDocumentSplittingService.removeByOriginalDocumentNoAndItemBo(wmsDocumentSplittingList);
|
||||
@ -100,7 +100,7 @@ public class WmsDocumentSplittingController {
|
||||
@ApiOperation(value = "生产入库检索分页", notes = "生产入库检索分页")
|
||||
@SysLog("生产入库检索分页")
|
||||
@GetMapping("/selectProdcutionWarehousingPage")
|
||||
public R selectProdcutionWarehousingPage(FrontPage page,WmsDocumentSplitting wmsDocumentSplitting) {
|
||||
public R selectProdcutionWarehousingPage(FrontPage page, WmsDocumentSplitting wmsDocumentSplitting) {
|
||||
return R.ok(wmsDocumentSplittingService.selectProdcutionWarehousingPage(page, wmsDocumentSplitting));
|
||||
}
|
||||
|
||||
@ -108,8 +108,8 @@ public class WmsDocumentSplittingController {
|
||||
* 查询托盘
|
||||
*/
|
||||
@ApiOperation(value = "查询托盘", notes = "查询托盘")
|
||||
@GetMapping("/getTray" )
|
||||
@SysLog("查询托盘" )
|
||||
@GetMapping("/getTray")
|
||||
@SysLog("查询托盘")
|
||||
public R getTray(WmsDocumentSplittingDTO dto) {
|
||||
return R.ok(wmsDocumentSplittingService.selectCarrierWarehousing(dto));
|
||||
}
|
||||
@ -118,9 +118,9 @@ public class WmsDocumentSplittingController {
|
||||
* 查询托盘分页
|
||||
*/
|
||||
@ApiOperation(value = "查询托盘分页", notes = "查询托盘分页")
|
||||
@GetMapping("/getTrayPage" )
|
||||
@SysLog("查询托盘分页" )
|
||||
public R selectTrayPage(FrontPage page,WmsDocumentSplittingDTO dto) {
|
||||
@GetMapping("/getTrayPage")
|
||||
@SysLog("查询托盘分页")
|
||||
public R selectTrayPage(FrontPage page, WmsDocumentSplittingDTO dto) {
|
||||
return R.ok(wmsDocumentSplittingService.selectCarrierWarehousingPage(page, dto));
|
||||
}
|
||||
|
||||
@ -128,18 +128,19 @@ public class WmsDocumentSplittingController {
|
||||
* 生产入库
|
||||
*/
|
||||
@ApiOperation(value = "生产入库", notes = "生产入库")
|
||||
@SysLog("生产入库" )
|
||||
@PostMapping("/receive" )
|
||||
@SysLog("生产入库")
|
||||
@PostMapping("/receive")
|
||||
public R receive(@RequestBody WmsDocumentSplittingDTO dto) {
|
||||
wmsDocumentSplittingService.receive(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库执行
|
||||
*/
|
||||
@ApiOperation(value = "入库执行", notes = "入库执行")
|
||||
@SysLog("入库执行" )
|
||||
@PostMapping("/checkReceiveExecute" )
|
||||
@SysLog("入库执行")
|
||||
@PostMapping("/checkReceiveExecute")
|
||||
public R receiveExecute(@RequestBody WmsDocumentSplittingDTO dto) {
|
||||
wmsDocumentSplittingService.receiveExecute(dto);
|
||||
return R.ok();
|
||||
@ -149,18 +150,19 @@ public class WmsDocumentSplittingController {
|
||||
* 入库执行保存
|
||||
*/
|
||||
@ApiOperation(value = "入库执行保存", notes = "入库执行保存")
|
||||
@SysLog("入库执行保存" )
|
||||
@PostMapping("/saveReceiveList" )
|
||||
@SysLog("入库执行保存")
|
||||
@PostMapping("/saveReceiveList")
|
||||
public R receiveSave(@RequestBody WmsProductrecDTO dto) {
|
||||
wmsDocumentSplittingService.saveReceiveList(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库完成
|
||||
*/
|
||||
@ApiOperation(value = "入库完成", notes = "入库完成")
|
||||
@SysLog("入库完成" )
|
||||
@PostMapping("/receiveComplete" )
|
||||
@SysLog("入库完成")
|
||||
@PostMapping("/receiveComplete")
|
||||
public R receiveComplete(@RequestBody WmsDocumentSplittingDTO dto) {
|
||||
wmsDocumentSplittingService.receiveComplete(dto);
|
||||
return R.ok();
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
package com.foreverwin.nlv.wms.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import com.foreverwin.mom.common.security.annotation.Inner;
|
||||
import com.foreverwin.nlv.wms.dto.wmsInventoryDto;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.service.WmsInventoryService;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -80,7 +78,7 @@ public class WmsInventoryController {
|
||||
@SysLog("托盘解绑-确认")
|
||||
@PostMapping("/unbindPackageNumber")
|
||||
public R unbindPackageNumber(@RequestBody WmsInventory wmsInventory) {
|
||||
wmsInventoryService.unbindPackageNumber(wmsInventory.getPackageNumber(),true);
|
||||
wmsInventoryService.unbindPackageNumber(wmsInventory.getPackageNumber(), true);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -95,22 +93,22 @@ public class WmsInventoryController {
|
||||
/**
|
||||
* 设备投料条码号查询
|
||||
*/
|
||||
@ApiOperation(value = "设备投料条码号查询", notes = "设备投料条码号查询")
|
||||
/*@ApiOperation(value = "设备投料条码号查询", notes = "设备投料条码号查询")
|
||||
@SysLog("设备投料条码号查询")
|
||||
@PostMapping("/selectByMaterialLot")
|
||||
public R selectByMaterialLot(@RequestBody wmsInventoryDto dto) {
|
||||
return R.ok(wmsInventoryService.selectByMaterialLot(dto));
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 设备投料条码号查询(校验物料组)
|
||||
*/
|
||||
*//*
|
||||
@ApiOperation(value = "设备投料条码号校验物料组", notes = "设备投料条码号校验物料组")
|
||||
@SysLog("设备投料条码号校验物料组")
|
||||
@PostMapping("/checkItemGroup")
|
||||
public R checkItemGroup(@RequestBody wmsInventoryDto dto) {
|
||||
return R.ok(wmsInventoryService.checkItemGroup(dto));
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 更新
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.foreverwin.nlv.wms.controller;
|
||||
|
||||
import com.foreverwin.iep.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.nlv.wms.service.WmsInventoryLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -19,10 +19,11 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/wms-inventory-log" )
|
||||
@RequestMapping("/wms-inventory-log")
|
||||
@Api(value = "inventory-log", tags = "库存变更历史管理")
|
||||
public class WmsInventoryLogController {
|
||||
private final WmsInventoryLogService wmsInventoryLogService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
||||
@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/WarehouseMaterialPfep" )
|
||||
@RequestMapping("/WarehouseMaterialPfep")
|
||||
@Api(value = "WarehouseMaterialPfep", tags = "仓储自定义规则")
|
||||
public class WmsMaterialPfepController {
|
||||
|
||||
@ -26,36 +26,39 @@ public class WmsMaterialPfepController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wmsMaterialPfep 仓储自定义规则
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@SysLog("仓储自定义规则检索" )
|
||||
@GetMapping("/page" )
|
||||
@SysLog("仓储自定义规则检索")
|
||||
@GetMapping("/page")
|
||||
public R getWmMaterialPfepPage(Page page, WmsMaterialPfep wmsMaterialPfep) {
|
||||
return R.ok(wmsMaterialPfepService.getWmMaterialPfepPage(page, wmsMaterialPfep));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询明细数据
|
||||
*
|
||||
* @param wmsMaterialPfep id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "仓储自定义规则单笔数据编辑", notes = "仓储自定义规则单笔数据编辑")
|
||||
@SysLog("仓储自定义规则单笔数据编辑" )
|
||||
@PostMapping("/getByHandle" )
|
||||
@SysLog("仓储自定义规则单笔数据编辑")
|
||||
@PostMapping("/getByHandle")
|
||||
public R getByHandle(@RequestBody WmsMaterialPfep wmsMaterialPfep) {
|
||||
return R.ok(wmsMaterialPfepService.getByHandle(wmsMaterialPfep.getHandle()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓储自定义规则
|
||||
*
|
||||
* @param wmsMaterialPfep 仓储自定义规则
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增仓储自定义规则", notes = "新增仓储自定义规则")
|
||||
@SysLog("新增仓储自定义规则" )
|
||||
@SysLog("新增仓储自定义规则")
|
||||
@PostMapping("/saveWmMaterialPfep")
|
||||
public R saveWmMaterialPfep(@RequestBody WmsMaterialPfep wmsMaterialPfep) {
|
||||
wmsMaterialPfepService.saveWmMaterialPfep(wmsMaterialPfep);
|
||||
@ -64,11 +67,12 @@ public class WmsMaterialPfepController {
|
||||
|
||||
/**
|
||||
* 修改仓储自定义规则
|
||||
*
|
||||
* @param wmsMaterialPfep 仓储自定义规则
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改仓储自定义规则", notes = "修改仓储自定义规则")
|
||||
@SysLog("修改仓储自定义规则" )
|
||||
@SysLog("修改仓储自定义规则")
|
||||
@PutMapping("/updateWmMaterialPfep")
|
||||
public R updateWmMaterialPfep(@RequestBody WmsMaterialPfep wmsMaterialPfep) {
|
||||
wmsMaterialPfepService.updateWmMaterialPfep(wmsMaterialPfep);
|
||||
@ -77,16 +81,18 @@ public class WmsMaterialPfepController {
|
||||
|
||||
/**
|
||||
* 删除仓储自定义规则
|
||||
*
|
||||
* @param handle 删除仓储自定义规则
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "删除仓储自定义规则", notes = "删除仓储自定义规则")
|
||||
@SysLog("删除仓储自定义规则" )
|
||||
@SysLog("删除仓储自定义规则")
|
||||
@DeleteMapping("/deleteWmMaterialPfep/{handle}")
|
||||
public R deleteWmMaterialPfep(@PathVariable("handle" ) String handle) {
|
||||
public R deleteWmMaterialPfep(@PathVariable("handle") String handle) {
|
||||
wmsMaterialPfepService.deleteWmMaterialPfep(handle);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓储自定义规则明细表
|
||||
*/
|
||||
|
||||
@ -23,20 +23,21 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wms-productrec" )
|
||||
@RequestMapping("/wms-productrec")
|
||||
@Api(value = "wms-productrec", tags = "成品入库接收表管理")
|
||||
public class WmsProductrecController {
|
||||
|
||||
private final WmsProductrecService wmsProductrecService;
|
||||
private final WmsProductrecService wmsProductrecService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wmsProductrec 成品入库接收表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getWmsProductrecPage(Page page, WmsProductrec wmsProductrec) {
|
||||
return R.ok(wmsProductrecService.page(page, Wrappers.query(wmsProductrec)));
|
||||
}
|
||||
@ -45,7 +46,7 @@ public class WmsProductrecController {
|
||||
* 查询所有数据
|
||||
*/
|
||||
@ApiOperation(value = "查询所有数据", notes = "查询所有数据")
|
||||
@GetMapping("/list" )
|
||||
@GetMapping("/list")
|
||||
public R list(WmsProductrecDTO dto) {
|
||||
return R.ok(wmsProductrecService.getList(dto));
|
||||
}
|
||||
@ -54,7 +55,7 @@ public class WmsProductrecController {
|
||||
* 保存
|
||||
*/
|
||||
@ApiOperation(value = "保存", notes = "保存")
|
||||
@SysLog("保存" )
|
||||
@SysLog("保存")
|
||||
@PostMapping("/saveList")
|
||||
public R saveList(@RequestBody WmsProductrecDTO wmsProductrec) {
|
||||
wmsProductrecService.saveList(wmsProductrec);
|
||||
@ -65,7 +66,7 @@ public class WmsProductrecController {
|
||||
* 入库执行保存
|
||||
*/
|
||||
@ApiOperation(value = "入库执行保存", notes = "入库执行保存")
|
||||
@SysLog("入库执行保存" )
|
||||
@SysLog("入库执行保存")
|
||||
@PostMapping("/saveReceiveList")
|
||||
public R saveReceiveList(@RequestBody WmsProductrecDTO wmsProductrec) {
|
||||
wmsProductrecService.saveReceiveList(wmsProductrec);
|
||||
@ -75,22 +76,24 @@ public class WmsProductrecController {
|
||||
|
||||
/**
|
||||
* 通过id查询成品入库接收表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(wmsProductrecService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成品入库接收表
|
||||
*
|
||||
* @param wmsProductrec 成品入库接收表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增成品入库接收表", notes = "新增成品入库接收表")
|
||||
@SysLog("新增成品入库接收表" )
|
||||
@SysLog("新增成品入库接收表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody WmsProductrec wmsProductrec) {
|
||||
return R.ok(wmsProductrecService.save(wmsProductrec));
|
||||
@ -98,11 +101,12 @@ public class WmsProductrecController {
|
||||
|
||||
/**
|
||||
* 修改成品入库接收表
|
||||
*
|
||||
* @param wmsProductrec 成品入库接收表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改成品入库接收表", notes = "修改成品入库接收表")
|
||||
@SysLog("修改成品入库接收表" )
|
||||
@SysLog("修改成品入库接收表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody WmsProductrec wmsProductrec) {
|
||||
return R.ok(wmsProductrecService.updateById(wmsProductrec));
|
||||
@ -110,12 +114,13 @@ public class WmsProductrecController {
|
||||
|
||||
/**
|
||||
* 通过id删除成品入库接收表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除成品入库接收表", notes = "通过id删除成品入库接收表")
|
||||
@SysLog("通过id删除成品入库接收表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@SysLog("通过id删除成品入库接收表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(wmsProductrecService.removeById(handle));
|
||||
}
|
||||
@ -123,6 +128,7 @@ public class WmsProductrecController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param wmsProductrec 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
|
||||
@ -30,130 +30,130 @@ import java.util.List;
|
||||
@Api(value = "storagebin", tags = "存储货格主数据管理")
|
||||
public class WmsStorageBinController {
|
||||
|
||||
private final WmsStorageBinService storageBinService;
|
||||
private final WmsStorageBinService storageBinService;
|
||||
|
||||
/**
|
||||
* 标签打印
|
||||
*
|
||||
* @param printList printList
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "标签打印", notes = "标签打印")
|
||||
@PostMapping("/by-labelRePrint")
|
||||
public R labelRePrint(@RequestBody List<WmsStorageBin> printList) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String printer = printList.get(0).getPrinter();
|
||||
return R.ok(storageBinService.labelPrint(site, printList, printer));
|
||||
}
|
||||
/**
|
||||
* 标签打印
|
||||
*
|
||||
* @param printList printList
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "标签打印", notes = "标签打印")
|
||||
@PostMapping("/by-labelRePrint")
|
||||
public R labelRePrint(@RequestBody List<WmsStorageBin> printList) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String printer = printList.get(0).getPrinter();
|
||||
return R.ok(storageBinService.labelPrint(site, printList, printer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param storageBinDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getStorageBinPage(Page page, WmsStorageBinDto storageBinDto) {
|
||||
if (StringUtils.isBlank(storageBinDto.getStatus())) {
|
||||
storageBinDto.setStatus(WmsStorageBin.STATUS_Y);
|
||||
}
|
||||
return R.ok(storageBinService.getStorageBinPage(page, storageBinDto));
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param storageBinDto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getStorageBinPage(Page page, WmsStorageBinDto storageBinDto) {
|
||||
if (StringUtils.isBlank(storageBinDto.getStatus())) {
|
||||
storageBinDto.setStatus(WmsStorageBin.STATUS_Y);
|
||||
}
|
||||
return R.ok(storageBinService.getStorageBinPage(page, storageBinDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过货架查询默认货格
|
||||
*
|
||||
* @param storageLocation id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过货架查询默认货格", notes = "通过货架查询默认货格")
|
||||
@GetMapping("/getByStorageLocation/{storageLocation}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_view')")
|
||||
public R getByStorageLocation(@PathVariable("storageLocation") String storageLocation) {
|
||||
return R.ok(storageBinService.getByStorageLocation(TenantContextHolder.getTenantId(), storageLocation));
|
||||
}
|
||||
/**
|
||||
* 通过货架查询默认货格
|
||||
*
|
||||
* @param storageLocation id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过货架查询默认货格", notes = "通过货架查询默认货格")
|
||||
@GetMapping("/getByStorageLocation/{storageLocation}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_view')")
|
||||
public R getByStorageLocation(@PathVariable("storageLocation") String storageLocation) {
|
||||
return R.ok(storageBinService.getByStorageLocation(TenantContextHolder.getTenantId(), storageLocation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询存储货格主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(storageBinService.getById(handle));
|
||||
}
|
||||
/**
|
||||
* 通过id查询存储货格主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(storageBinService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增存储货格主数据
|
||||
*
|
||||
* @param storageBinDto 存储货格主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增存储货格主数据", notes = "新增存储货格主数据")
|
||||
@SysLog("新增存储货格主数据")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_add')")
|
||||
public R save(@RequestBody WmsStorageBinDto storageBinDto) {
|
||||
return R.ok(storageBinService.save(storageBinDto));
|
||||
}
|
||||
/**
|
||||
* 新增存储货格主数据
|
||||
*
|
||||
* @param storageBinDto 存储货格主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增存储货格主数据", notes = "新增存储货格主数据")
|
||||
@SysLog("新增存储货格主数据")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_add')")
|
||||
public R save(@RequestBody WmsStorageBinDto storageBinDto) {
|
||||
return R.ok(storageBinService.save(storageBinDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改存储货格主数据
|
||||
*
|
||||
* @param storageBinDto 存储货格主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改存储货格主数据", notes = "修改存储货格主数据")
|
||||
@SysLog("修改存储货格主数据")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_edit')")
|
||||
public R updateById(@RequestBody WmsStorageBinDto storageBinDto) {
|
||||
return R.ok(storageBinService.updateById(storageBinDto));
|
||||
}
|
||||
/**
|
||||
* 修改存储货格主数据
|
||||
*
|
||||
* @param storageBinDto 存储货格主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改存储货格主数据", notes = "修改存储货格主数据")
|
||||
@SysLog("修改存储货格主数据")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_edit')")
|
||||
public R updateById(@RequestBody WmsStorageBinDto storageBinDto) {
|
||||
return R.ok(storageBinService.updateById(storageBinDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除存储货格主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除存储货格主数据", notes = "通过id删除存储货格主数据")
|
||||
@SysLog("通过id删除存储货格主数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(storageBinService.removeById(handle));
|
||||
}
|
||||
/**
|
||||
* 通过id删除存储货格主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除存储货格主数据", notes = "通过id删除存储货格主数据")
|
||||
@SysLog("通过id删除存储货格主数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(storageBinService.removeById(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param wmsStorageBin 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_export')")
|
||||
public List<WmsStorageBin> export(WmsStorageBin wmsStorageBin) {
|
||||
return storageBinService.list(Wrappers.query(wmsStorageBin));
|
||||
}
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param wmsStorageBin 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storagebin_export')")
|
||||
public List<WmsStorageBin> export(WmsStorageBin wmsStorageBin) {
|
||||
return storageBinService.list(Wrappers.query(wmsStorageBin));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "通过货格查询对应货架", notes = "通过货格查询对应货架")
|
||||
@GetMapping("/getStorageLocationByStorageBin/{storageBin}")
|
||||
public R getStorageLocationByStorageBin(@PathVariable("storageBin") String storageBin) {
|
||||
return R.ok(storageBinService.getStorageLocationByStorageBin(storageBin));
|
||||
}
|
||||
@ApiOperation(value = "通过货格查询对应货架", notes = "通过货格查询对应货架")
|
||||
@GetMapping("/getStorageLocationByStorageBin/{storageBin}")
|
||||
public R getStorageLocationByStorageBin(@PathVariable("storageBin") String storageBin) {
|
||||
return R.ok(storageBinService.getStorageLocationByStorageBin(storageBin));
|
||||
}
|
||||
|
||||
@PutMapping("/updateBatchById")
|
||||
public R updateBatchById(@RequestBody List<WmsStorageBin> wmsStorageBins) {
|
||||
return R.ok(storageBinService.updateBatchById(wmsStorageBins));
|
||||
}
|
||||
@PutMapping("/updateBatchById")
|
||||
public R updateBatchById(@RequestBody List<WmsStorageBin> wmsStorageBins) {
|
||||
return R.ok(storageBinService.updateBatchById(wmsStorageBins));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -11,12 +11,10 @@ import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import com.foreverwin.nlv.wms.dto.StorageLocationDto;
|
||||
import com.foreverwin.nlv.wms.entity.StorageLocation;
|
||||
import com.foreverwin.nlv.wms.mapper.WmsStorageLocationMapper;
|
||||
import com.foreverwin.nlv.wms.service.WmsStorageLocationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -34,149 +32,149 @@ import java.util.List;
|
||||
@Api(value = "wmsstoragelocation", tags = "存储位置主数据管理")
|
||||
public class WmsStorageLocationController {
|
||||
|
||||
private final WmsStorageLocationService storageLocationService;
|
||||
private final WmsStorageLocationService storageLocationService;
|
||||
|
||||
/**
|
||||
* 标签打印
|
||||
*
|
||||
* @param printList printList
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "标签打印", notes = "标签打印")
|
||||
@PostMapping("/by-labelRePrint")
|
||||
public R labelRePrint(@RequestBody List<StorageLocation> printList) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String printer = printList.get(0).getPrinter();
|
||||
return R.ok(storageLocationService.labelRePrint(site, printList, printer));
|
||||
}
|
||||
/**
|
||||
* 标签打印
|
||||
*
|
||||
* @param printList printList
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "标签打印", notes = "标签打印")
|
||||
@PostMapping("/by-labelRePrint")
|
||||
public R labelRePrint(@RequestBody List<StorageLocation> printList) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String printer = printList.get(0).getPrinter();
|
||||
return R.ok(storageLocationService.labelRePrint(site, printList, printer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param storageLocationDto 存储位置主数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getStorageLocationPage(Page page, StorageLocationDto storageLocationDto) {
|
||||
if (StringUtils.isBlank(storageLocationDto.getStatus())) {
|
||||
storageLocationDto.setStatus(StorageLocation.STATUS_Y);
|
||||
}
|
||||
return R.ok(storageLocationService.getStorageLocationPage(page, storageLocationDto));
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param storageLocationDto 存储位置主数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getStorageLocationPage(Page page, StorageLocationDto storageLocationDto) {
|
||||
if (StringUtils.isBlank(storageLocationDto.getStatus())) {
|
||||
storageLocationDto.setStatus(StorageLocation.STATUS_Y);
|
||||
}
|
||||
return R.ok(storageLocationService.getStorageLocationPage(page, storageLocationDto));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/getStorageLocationPageBycode")
|
||||
public R getStorageLocationPageBycode(Page page, String str) {
|
||||
return R.ok(storageLocationService.getStorageLocationPageBycode(page, str));
|
||||
}
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/getStorageLocationPageBycode")
|
||||
public R getStorageLocationPageBycode(Page page, String str) {
|
||||
return R.ok(storageLocationService.getStorageLocationPageBycode(page, str));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询存储位置", notes = "查询存储位置")
|
||||
@GetMapping("/getStorageLocation")
|
||||
public R getStorageLocation(StorageLocation storageLocation) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String storageLocationBo = StorageLocation.genHandle(site, storageLocation.getStorageLocation());
|
||||
StorageLocation byId = storageLocationService.getById(storageLocationBo);
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("存储位置不存在");
|
||||
}
|
||||
if (!byId.getErpStorageLocation().equals(storageLocation.getErpStorageLocation())) {
|
||||
throw BusinessException.build("不是仓库" + storageLocation.getErpStorageLocation() + "下存储位置");
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
@ApiOperation(value = "查询存储位置", notes = "查询存储位置")
|
||||
@GetMapping("/getStorageLocation")
|
||||
public R getStorageLocation(StorageLocation storageLocation) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String storageLocationBo = StorageLocation.genHandle(site, storageLocation.getStorageLocation());
|
||||
StorageLocation byId = storageLocationService.getById(storageLocationBo);
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("存储位置不存在");
|
||||
}
|
||||
if (!byId.getErpStorageLocation().equals(storageLocation.getErpStorageLocation())) {
|
||||
throw BusinessException.build("不是仓库" + storageLocation.getErpStorageLocation() + "下存储位置");
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询存储位置主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(storageLocationService.getById(handle));
|
||||
}
|
||||
/**
|
||||
* 通过id查询存储位置主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_view')")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(storageLocationService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增存储位置主数据
|
||||
*
|
||||
* @param storageLocationDto 存储位置主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增存储位置主数据", notes = "新增存储位置主数据")
|
||||
@SysLog("新增存储位置主数据")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_add')")
|
||||
public R save(@RequestBody StorageLocationDto storageLocationDto) {
|
||||
return R.ok(storageLocationService.save(storageLocationDto));
|
||||
}
|
||||
/**
|
||||
* 新增存储位置主数据
|
||||
*
|
||||
* @param storageLocationDto 存储位置主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增存储位置主数据", notes = "新增存储位置主数据")
|
||||
@SysLog("新增存储位置主数据")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_add')")
|
||||
public R save(@RequestBody StorageLocationDto storageLocationDto) {
|
||||
return R.ok(storageLocationService.save(storageLocationDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改存储位置主数据
|
||||
*
|
||||
* @param storageLocationDto 存储位置主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改存储位置主数据", notes = "修改存储位置主数据")
|
||||
@SysLog("修改存储位置主数据")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_edit')")
|
||||
public R updateById(@RequestBody StorageLocationDto storageLocationDto) {
|
||||
return R.ok(storageLocationService.updateById(storageLocationDto));
|
||||
}
|
||||
/**
|
||||
* 修改存储位置主数据
|
||||
*
|
||||
* @param storageLocationDto 存储位置主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改存储位置主数据", notes = "修改存储位置主数据")
|
||||
@SysLog("修改存储位置主数据")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_edit')")
|
||||
public R updateById(@RequestBody StorageLocationDto storageLocationDto) {
|
||||
return R.ok(storageLocationService.updateById(storageLocationDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除存储位置主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除存储位置主数据", notes = "通过id删除存储位置主数据")
|
||||
@SysLog("通过id删除存储位置主数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(storageLocationService.removeById(handle));
|
||||
}
|
||||
/**
|
||||
* 通过id删除存储位置主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除存储位置主数据", notes = "通过id删除存储位置主数据")
|
||||
@SysLog("通过id删除存储位置主数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(storageLocationService.removeById(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param storageLocation 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_export')")
|
||||
public List<StorageLocation> export(StorageLocation storageLocation) {
|
||||
return storageLocationService.list(Wrappers.query(storageLocation));
|
||||
}
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param storageLocation 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wms_storage_location_export')")
|
||||
public List<StorageLocation> export(StorageLocation storageLocation) {
|
||||
return storageLocationService.list(Wrappers.query(storageLocation));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过货架查询默认货格", notes = "通过货架查询默认货格")
|
||||
@GetMapping("/getStorageBin/{storageLocation}")
|
||||
public R getStorageBin(@PathVariable("storageLocation") String storageLocation) {
|
||||
return R.ok(storageLocationService.getStorageBin(TenantContextHolder.getTenantId(), storageLocation));
|
||||
}
|
||||
@ApiOperation(value = "通过货架查询默认货格", notes = "通过货架查询默认货格")
|
||||
@GetMapping("/getStorageBin/{storageLocation}")
|
||||
public R getStorageBin(@PathVariable("storageLocation") String storageLocation) {
|
||||
return R.ok(storageLocationService.getStorageBin(TenantContextHolder.getTenantId(), storageLocation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询存储位置
|
||||
*
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/pages")
|
||||
public R getStorageLocation(Page page, StorageLocation storageLocation) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
IPage<StorageLocation> storageLocationList = storageLocationService.findStorageLocationList(page, site, storageLocation);
|
||||
return R.ok(storageLocationList);
|
||||
/**
|
||||
* 查询存储位置
|
||||
*
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/pages")
|
||||
public R getStorageLocation(Page page, StorageLocation storageLocation) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
IPage<StorageLocation> storageLocationList = storageLocationService.findStorageLocationList(page, site, storageLocation);
|
||||
return R.ok(storageLocationList);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping("/updateBatchById")
|
||||
public R updateBatchById(@RequestBody List<StorageLocation> storageLocations) {
|
||||
return R.ok(storageLocationService.updateBatchById(storageLocations));
|
||||
}
|
||||
@PutMapping("/updateBatchById")
|
||||
public R updateBatchById(@RequestBody List<StorageLocation> storageLocations) {
|
||||
return R.ok(storageLocationService.updateBatchById(storageLocations));
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,31 +21,33 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wms-temp-inventory" )
|
||||
@RequestMapping("/wms-temp-inventory")
|
||||
public class WmsTempInventoryController {
|
||||
|
||||
private final WmsTempInventoryService wmsTempInventoryService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wmsTempInventory 临时半成品库存导入
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getWmsTempInventoryPage(Page page, WmsTempInventory wmsTempInventory) {
|
||||
return R.ok(wmsTempInventoryService.page(page, Wrappers.query(wmsTempInventory)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param wmsTempInventory 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<WmsTempInventory> export(WmsTempInventory wmsTempInventory) {
|
||||
return wmsTempInventoryService.list(Wrappers.query(wmsTempInventory));
|
||||
}
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param wmsTempInventory 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<WmsTempInventory> export(WmsTempInventory wmsTempInventory) {
|
||||
return wmsTempInventoryService.list(Wrappers.query(wmsTempInventory));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wmstpucolorpack" )
|
||||
@RequestMapping("/wmstpucolorpack")
|
||||
@Api(value = "wmstpucolorpack", tags = "TPU彩包临时表管理")
|
||||
public class WmsTpuColorPackController {
|
||||
|
||||
@ -30,12 +30,13 @@ public class WmsTpuColorPackController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wmsTpuColorPack TPU彩包临时表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getWmsTpuColorPackPage(FrontPage page, WmsTpuColorPack wmsTpuColorPack) {
|
||||
return R.ok(wmsTpuColorPackService.page(page.genOrders(), Wrappers.<WmsTpuColorPack>lambdaQuery()
|
||||
.eq(WmsTpuColorPack::getSite, TenantContextHolder.getTenantId())
|
||||
|
||||
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/warehouse" )
|
||||
@RequestMapping("/warehouse")
|
||||
@Api(value = "wmswarehouse", tags = "仓库主数据管理")
|
||||
public class WmsWareHouseController {
|
||||
|
||||
@ -30,72 +30,77 @@ public class WmsWareHouseController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param warehouse 仓库主数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
//@PreAuthorize("@pms.hasPermission('wms_wmswarehouse_view')" )
|
||||
public R getWmsWarehousePage(Page page, WmsWareHouse warehouse) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
if(StringUtils.isBlank(warehouse.getWarehouse())){
|
||||
warehouse.setWarehouse("");
|
||||
}
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
if (StringUtils.isBlank(warehouse.getWarehouse())) {
|
||||
warehouse.setWarehouse("");
|
||||
}
|
||||
return R.ok(warehouseServiceWms.page(page, Wrappers.<WmsWareHouse>lambdaQuery()
|
||||
.like(WmsWareHouse::getWarehouse,warehouse.getWarehouse())
|
||||
.eq(WmsWareHouse::getSite,site)
|
||||
.orderByDesc(WmsWareHouse::getCreateTime)));
|
||||
.like(WmsWareHouse::getWarehouse, warehouse.getWarehouse())
|
||||
.eq(WmsWareHouse::getSite, site)
|
||||
.orderByDesc(WmsWareHouse::getCreateTime)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询仓库主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(warehouseServiceWms.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 新增仓库主数据
|
||||
*
|
||||
* @param warehouse 仓库主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增仓库主数据", notes = "新增仓库主数据")
|
||||
@SysLog("新增仓库主数据" )
|
||||
@SysLog("新增仓库主数据")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_warehouse_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_warehouse_add')")
|
||||
public R save(@RequestBody WmsWareHouse warehouse) {
|
||||
return R.ok(warehouseServiceWms.save(warehouse));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库主数据
|
||||
*
|
||||
* @param warehouse 仓库主数据
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改仓库主数据", notes = "修改仓库主数据")
|
||||
@SysLog("修改仓库主数据" )
|
||||
@SysLog("修改仓库主数据")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wms_warehouse_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_warehouse_edit')")
|
||||
public R updateById(@RequestBody WmsWareHouse warehouse) {
|
||||
return R.ok(warehouseServiceWms.updateById(warehouse));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除仓库主数据
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除仓库主数据", notes = "通过id删除仓库主数据")
|
||||
@SysLog("通过id删除仓库主数据" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@PreAuthorize("@pms.hasPermission('wms_warehouse_del')" )
|
||||
@SysLog("通过id删除仓库主数据")
|
||||
@DeleteMapping("/{handle}")
|
||||
@PreAuthorize("@pms.hasPermission('wms_warehouse_del')")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(warehouseServiceWms.removeById(handle));
|
||||
}
|
||||
|
||||
@ -22,20 +22,21 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/z-storag-request" )
|
||||
@RequestMapping("/z-storag-request")
|
||||
@Api(value = "z-storag-request", tags = "入库申请表管理")
|
||||
public class ZStoragRequestController {
|
||||
|
||||
private final ZStoragRequestService zStoragRequestService;
|
||||
private final ZStoragRequestService zStoragRequestService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param zStoragRequest 入库申请表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getZStoragRequestPage(Page page, ZStoragRequest zStoragRequest) {
|
||||
return R.ok(zStoragRequestService.page(page, Wrappers.query(zStoragRequest)));
|
||||
}
|
||||
@ -43,22 +44,24 @@ public class ZStoragRequestController {
|
||||
|
||||
/**
|
||||
* 通过id查询入库申请表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(zStoragRequestService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库申请表
|
||||
*
|
||||
* @param zStoragRequest 入库申请表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增入库申请表", notes = "新增入库申请表")
|
||||
@SysLog("新增入库申请表" )
|
||||
@SysLog("新增入库申请表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody ZStoragRequest zStoragRequest) {
|
||||
return R.ok(zStoragRequestService.save(zStoragRequest));
|
||||
@ -66,11 +69,12 @@ public class ZStoragRequestController {
|
||||
|
||||
/**
|
||||
* 修改入库申请表
|
||||
*
|
||||
* @param zStoragRequest 入库申请表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改入库申请表", notes = "修改入库申请表")
|
||||
@SysLog("修改入库申请表" )
|
||||
@SysLog("修改入库申请表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody ZStoragRequest zStoragRequest) {
|
||||
return R.ok(zStoragRequestService.updateById(zStoragRequest));
|
||||
@ -78,12 +82,13 @@ public class ZStoragRequestController {
|
||||
|
||||
/**
|
||||
* 通过id删除入库申请表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除入库申请表", notes = "通过id删除入库申请表")
|
||||
@SysLog("通过id删除入库申请表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@SysLog("通过id删除入库申请表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(zStoragRequestService.removeById(handle));
|
||||
}
|
||||
@ -91,6 +96,7 @@ public class ZStoragRequestController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param zStoragRequest 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
|
||||
@ -5,12 +5,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import com.foreverwin.nlv.wms.entity.ZStoragRequestDetail;
|
||||
import com.foreverwin.nlv.wms.service.ZStoragRequestDetailService;
|
||||
import com.foreverwin.nlv.wms.util.StringUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -26,7 +25,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/z-storag-request-detail" )
|
||||
@RequestMapping("/z-storag-request-detail")
|
||||
@Api(value = "z-storag-request-detail", tags = "入库申请明细表管理")
|
||||
public class ZStoragRequestDetailController {
|
||||
|
||||
@ -34,12 +33,13 @@ public class ZStoragRequestDetailController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param zStoragRequestDetail 入库申请明细表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@GetMapping("/page")
|
||||
public R getZStoragRequestDetailPage(Page page, ZStoragRequestDetail zStoragRequestDetail) {
|
||||
zStoragRequestDetail.setSite(TenantContextHolder.getTenantId());
|
||||
LambdaQueryWrapper<ZStoragRequestDetail> lambdaQuery = Wrappers.lambdaQuery(ZStoragRequestDetail.class);
|
||||
@ -53,7 +53,7 @@ public class ZStoragRequestDetailController {
|
||||
* 校验是否已经接收完成
|
||||
*/
|
||||
@ApiOperation(value = "校验是否已经接收完成", notes = "校验是否已经接收完成")
|
||||
@GetMapping("/checkReceive" )
|
||||
@GetMapping("/checkReceive")
|
||||
public R checkReceive(String documentNo) {
|
||||
zStoragRequestDetailService.checkReceive(documentNo);
|
||||
return R.ok();
|
||||
@ -62,22 +62,24 @@ public class ZStoragRequestDetailController {
|
||||
|
||||
/**
|
||||
* 通过id查询入库申请明细表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
@GetMapping("/{handle}")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(zStoragRequestDetailService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库申请明细表
|
||||
*
|
||||
* @param zStoragRequestDetail 入库申请明细表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增入库申请明细表", notes = "新增入库申请明细表")
|
||||
@SysLog("新增入库申请明细表" )
|
||||
@SysLog("新增入库申请明细表")
|
||||
@PostMapping
|
||||
public R save(@RequestBody ZStoragRequestDetail zStoragRequestDetail) {
|
||||
return R.ok(zStoragRequestDetailService.save(zStoragRequestDetail));
|
||||
@ -85,11 +87,12 @@ public class ZStoragRequestDetailController {
|
||||
|
||||
/**
|
||||
* 修改入库申请明细表
|
||||
*
|
||||
* @param zStoragRequestDetail 入库申请明细表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改入库申请明细表", notes = "修改入库申请明细表")
|
||||
@SysLog("修改入库申请明细表" )
|
||||
@SysLog("修改入库申请明细表")
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody ZStoragRequestDetail zStoragRequestDetail) {
|
||||
return R.ok(zStoragRequestDetailService.updateById(zStoragRequestDetail));
|
||||
@ -97,12 +100,13 @@ public class ZStoragRequestDetailController {
|
||||
|
||||
/**
|
||||
* 通过id删除入库申请明细表
|
||||
*
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除入库申请明细表", notes = "通过id删除入库申请明细表")
|
||||
@SysLog("通过id删除入库申请明细表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
@SysLog("通过id删除入库申请明细表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(zStoragRequestDetailService.removeById(handle));
|
||||
}
|
||||
@ -110,6 +114,7 @@ public class ZStoragRequestDetailController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param zStoragRequestDetail 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package com.foreverwin.nlv.wms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.dto.FreezeDto;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
package com.foreverwin.nlv.wms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.dto.InventoryGroupDTO;
|
||||
import com.foreverwin.nlv.wms.dto.InventoryGroupRequestDTO;
|
||||
import com.foreverwin.nlv.wms.entity.InventoryGroup;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -7,7 +7,7 @@ import com.foreverwin.nlv.wms.dto.SalesInvoiceDeliveryDto;
|
||||
import com.foreverwin.nlv.wms.entity.SalesInvoiceDelivery;
|
||||
import com.foreverwin.nlv.wms.entity.SalesInvoiceDeliveryItem;
|
||||
import com.foreverwin.nlv.wms.entity.WmsDocumentSplitting;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -8,9 +8,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.nlv.wms.domain.CarrierUnbindBatchRequest;
|
||||
import com.foreverwin.nlv.wms.entity.WmsCuttingPackage;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.entity.WmsOutDelivery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package com.foreverwin.nlv.wms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventoryLog;
|
||||
|
||||
public interface WmsInventoryLogService extends IService<WmsInventoryLog> {
|
||||
void createInventoryLog(WmsInventory wmsInventory);
|
||||
|
||||
@ -3,8 +3,7 @@ package com.foreverwin.nlv.wms.service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.nlv.wms.dto.wmsInventoryDto;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -18,12 +17,6 @@ import java.util.List;
|
||||
*/
|
||||
public interface WmsInventoryService extends IService<WmsInventory> {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
void createInventory(WmsInventory wmsInventory);
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
void outInventoryByMaterialLot(String site, String materialLot, BigDecimal outQty);
|
||||
|
||||
IPage getWmsInventoryPage(Page page, WmsInventory dto);
|
||||
|
||||
WmsInventory getOneObjByHandle(String handle);
|
||||
@ -32,11 +25,15 @@ public interface WmsInventoryService extends IService<WmsInventory> {
|
||||
|
||||
WmsInventory validateMaterialLot(String materialLot);
|
||||
|
||||
void unbindPackageNumber(String packageNumber,boolean isErrorShow);
|
||||
void unbindPackageNumber(String packageNumber, boolean isErrorShow);
|
||||
|
||||
void changePackageNumber(WmsInventory wmsInventory);
|
||||
|
||||
wmsInventoryDto selectByMaterialLot(wmsInventoryDto dto);
|
||||
wmsInventoryDto checkItemGroup(wmsInventoryDto dto);
|
||||
void updateInventory(WmsInventory wmsInventory);
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
void createInventory(WmsInventory wmsInventory);
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
void outInventoryByMaterialLot(String site, String materialLot, BigDecimal outQty);
|
||||
}
|
||||
|
||||
@ -32,93 +32,93 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class ComplexReportServiceImpl implements ComplexReportService {
|
||||
@Autowired
|
||||
private ComplexReportMapper complexReportMapper;
|
||||
@Autowired
|
||||
private ComplexReportMapper complexReportMapper;
|
||||
|
||||
@Override
|
||||
public List<PickingStatisticsReport> selectPickingStatisticsReport(String documentNo, String startS, String endS, String erpNo) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime start = null;
|
||||
LocalDateTime end = null;
|
||||
if (StrUtil.isNotBlank(startS)) {
|
||||
start = LocalDateTimeUtil.parse(startS, dateTimeFormatter);
|
||||
}
|
||||
if (StrUtil.isNotBlank(endS)) {
|
||||
end = LocalDateTimeUtil.parse(endS, dateTimeFormatter);
|
||||
}
|
||||
return complexReportMapper.selectPickingStatisticsReport(documentNo, start, end, erpNo);
|
||||
}
|
||||
@Override
|
||||
public List<PickingStatisticsReport> selectPickingStatisticsReport(String documentNo, String startS, String endS, String erpNo) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime start = null;
|
||||
LocalDateTime end = null;
|
||||
if (StrUtil.isNotBlank(startS)) {
|
||||
start = LocalDateTimeUtil.parse(startS, dateTimeFormatter);
|
||||
}
|
||||
if (StrUtil.isNotBlank(endS)) {
|
||||
end = LocalDateTimeUtil.parse(endS, dateTimeFormatter);
|
||||
}
|
||||
return complexReportMapper.selectPickingStatisticsReport(documentNo, start, end, erpNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<PickingStatisticsReport> selectPickingStatisticsReport(IPage iPage, String documentNo, String startS, String endS, String erpNo) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime start = null;
|
||||
LocalDateTime end = null;
|
||||
if (StrUtil.isNotBlank(startS)) {
|
||||
start = LocalDateTimeUtil.parse(startS, dateTimeFormatter);
|
||||
}
|
||||
if (StrUtil.isNotBlank(endS)) {
|
||||
end = LocalDateTimeUtil.parse(endS, dateTimeFormatter);
|
||||
}
|
||||
return complexReportMapper.selectPickingStatisticsReport(iPage, documentNo, start, end, erpNo);
|
||||
}
|
||||
@Override
|
||||
public IPage<PickingStatisticsReport> selectPickingStatisticsReport(IPage iPage, String documentNo, String startS, String endS, String erpNo) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime start = null;
|
||||
LocalDateTime end = null;
|
||||
if (StrUtil.isNotBlank(startS)) {
|
||||
start = LocalDateTimeUtil.parse(startS, dateTimeFormatter);
|
||||
}
|
||||
if (StrUtil.isNotBlank(endS)) {
|
||||
end = LocalDateTimeUtil.parse(endS, dateTimeFormatter);
|
||||
}
|
||||
return complexReportMapper.selectPickingStatisticsReport(iPage, documentNo, start, end, erpNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void export(String documentNo, String startS, String endS, String erpNo) throws IOException {
|
||||
List<PickingStatisticsReport> pickingStatisticsReports = selectPickingStatisticsReport(documentNo, startS, endS, erpNo);
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build();
|
||||
WriteSheet mainSheet = EasyExcel.writerSheet("统计页").head(PickingStatisticsReport.class).registerConverter(LocalDateStringConverter.INSTANCE).registerWriteHandler(widthStyleStrategy).build();
|
||||
excelWriter.write(pickingStatisticsReports, mainSheet);
|
||||
List<List<String>> head = Arrays.stream(new String[]{"单据号","物料编码", "规格型号", "宽度", "长度", "DN单号", "出货批次", "箱号", "箱总面积"}).collect(ArrayList::new, (objects, s) -> {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(s);
|
||||
objects.add(list);
|
||||
}, ArrayList::addAll);
|
||||
WriteSheet boxSheet = EasyExcel.writerSheet("箱明细页").head(head).registerWriteHandler(widthStyleStrategy).build();
|
||||
List<List<String>> data = pickingStatisticsReports.stream().collect(ArrayList::new, (objects, mainData) -> {
|
||||
for (PickingStatisticsReport.BoxDetail boxDetail : mainData.getBoxDetail()) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(mainData.getDocumentNo());
|
||||
list.add(mainData.getItem());
|
||||
list.add(mainData.getGroes());
|
||||
list.add(mainData.getWidth());
|
||||
list.add(mainData.getStandardLength());
|
||||
list.add(mainData.getExternalDocumentNo());
|
||||
list.add(mainData.getSalesBatch());
|
||||
list.add(boxDetail.getBox());
|
||||
list.add(boxDetail.getBoxQty().stripTrailingZeros().toPlainString());
|
||||
objects.add(list);
|
||||
}
|
||||
}, ArrayList::addAll);
|
||||
excelWriter.write(data, boxSheet);
|
||||
head = Arrays.stream(new String[]{"单据号","物料编码", "规格型号", "宽度", "长度", "DN单号", "出货批次", "托号", "托总面积"}).collect(ArrayList::new, (objects, s) -> {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(s);
|
||||
objects.add(list);
|
||||
}, ArrayList::addAll);
|
||||
WriteSheet palletSheet = EasyExcel.writerSheet("托明细页").head(head).registerWriteHandler(widthStyleStrategy).build();
|
||||
data = pickingStatisticsReports.stream().collect(ArrayList::new, (objects, mainData) -> {
|
||||
for (PickingStatisticsReport.PalletDetail palletDetail : mainData.getPalletDetail()) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(mainData.getDocumentNo());
|
||||
list.add(mainData.getItem());
|
||||
list.add(mainData.getGroes());
|
||||
list.add(mainData.getWidth());
|
||||
list.add(mainData.getStandardLength());
|
||||
list.add(mainData.getExternalDocumentNo());
|
||||
list.add(mainData.getSalesBatch());
|
||||
list.add(palletDetail.getPallet());
|
||||
list.add(palletDetail.getPalletQty().stripTrailingZeros().toPlainString());
|
||||
objects.add(list);
|
||||
}
|
||||
}, ArrayList::addAll);
|
||||
excelWriter.write(data, palletSheet);
|
||||
excelWriter.finish();
|
||||
}
|
||||
@Override
|
||||
public void export(String documentNo, String startS, String endS, String erpNo) throws IOException {
|
||||
List<PickingStatisticsReport> pickingStatisticsReports = selectPickingStatisticsReport(documentNo, startS, endS, erpNo);
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build();
|
||||
WriteSheet mainSheet = EasyExcel.writerSheet("统计页").head(PickingStatisticsReport.class).registerConverter(LocalDateStringConverter.INSTANCE).registerWriteHandler(widthStyleStrategy).build();
|
||||
excelWriter.write(pickingStatisticsReports, mainSheet);
|
||||
List<List<String>> head = Arrays.stream(new String[]{"单据号", "物料编码", "规格型号", "宽度", "长度", "DN单号", "出货批次", "箱号", "箱总面积"}).collect(ArrayList::new, (objects, s) -> {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(s);
|
||||
objects.add(list);
|
||||
}, ArrayList::addAll);
|
||||
WriteSheet boxSheet = EasyExcel.writerSheet("箱明细页").head(head).registerWriteHandler(widthStyleStrategy).build();
|
||||
List<List<String>> data = pickingStatisticsReports.stream().collect(ArrayList::new, (objects, mainData) -> {
|
||||
for (PickingStatisticsReport.BoxDetail boxDetail : mainData.getBoxDetail()) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(mainData.getDocumentNo());
|
||||
list.add(mainData.getItem());
|
||||
list.add(mainData.getGroes());
|
||||
list.add(mainData.getWidth());
|
||||
list.add(mainData.getStandardLength());
|
||||
list.add(mainData.getExternalDocumentNo());
|
||||
list.add(mainData.getSalesBatch());
|
||||
list.add(boxDetail.getBox());
|
||||
list.add(boxDetail.getBoxQty().stripTrailingZeros().toPlainString());
|
||||
objects.add(list);
|
||||
}
|
||||
}, ArrayList::addAll);
|
||||
excelWriter.write(data, boxSheet);
|
||||
head = Arrays.stream(new String[]{"单据号", "物料编码", "规格型号", "宽度", "长度", "DN单号", "出货批次", "托号", "托总面积"}).collect(ArrayList::new, (objects, s) -> {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(s);
|
||||
objects.add(list);
|
||||
}, ArrayList::addAll);
|
||||
WriteSheet palletSheet = EasyExcel.writerSheet("托明细页").head(head).registerWriteHandler(widthStyleStrategy).build();
|
||||
data = pickingStatisticsReports.stream().collect(ArrayList::new, (objects, mainData) -> {
|
||||
for (PickingStatisticsReport.PalletDetail palletDetail : mainData.getPalletDetail()) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(mainData.getDocumentNo());
|
||||
list.add(mainData.getItem());
|
||||
list.add(mainData.getGroes());
|
||||
list.add(mainData.getWidth());
|
||||
list.add(mainData.getStandardLength());
|
||||
list.add(mainData.getExternalDocumentNo());
|
||||
list.add(mainData.getSalesBatch());
|
||||
list.add(palletDetail.getPallet());
|
||||
list.add(palletDetail.getPalletQty().stripTrailingZeros().toPlainString());
|
||||
objects.add(list);
|
||||
}
|
||||
}, ArrayList::addAll);
|
||||
excelWriter.write(data, palletSheet);
|
||||
excelWriter.finish();
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,10 +30,10 @@ public class CuttingInventoryServiceImpl extends ServiceImpl<CuttingInventoryMap
|
||||
|
||||
private final WmsCuttingPackageService wmsCuttingPackageService;
|
||||
|
||||
private static String urlStr = "http://10.10.11.51:3001";
|
||||
private static final String urlStr = "http://10.10.11.51:3001";
|
||||
|
||||
@Override
|
||||
public void batchNumberScanWhiteCheck(WmsCuttingPackage wmsCuttingPackage){
|
||||
public void batchNumberScanWhiteCheck(WmsCuttingPackage wmsCuttingPackage) {
|
||||
wmsCuttingPackageService.batchNumberScanWhiteCheck(wmsCuttingPackage);
|
||||
}
|
||||
|
||||
@ -44,25 +44,25 @@ public class CuttingInventoryServiceImpl extends ServiceImpl<CuttingInventoryMap
|
||||
String errorSn = "";
|
||||
|
||||
List<WmsCuttingPackage> wmsCuttingPackageList = new ArrayList<>();
|
||||
for (CuttingInventory cutInv: cuttingInventoryList) {
|
||||
for (CuttingInventory cutInv : cuttingInventoryList) {
|
||||
String sapItem = cutInv.getInventoryId();
|
||||
String printer = cutInv.getGroes();
|
||||
String stage = cutInv.getBismt();
|
||||
|
||||
HttpResponse httpResponse;
|
||||
try {
|
||||
httpResponse = HttpRequest.get(urlStr+"/api/slitting/" + sapItem).header("Authorization",
|
||||
httpResponse = HttpRequest.get(urlStr + "/api/slitting/" + sapItem).header("Authorization",
|
||||
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDgxMzg3MjQsImlhdCI6MTY0ODA1MjMyNCwiaXNzIjoiZ2l0aHViLmNvbS9saWJyYXJ5L2ZlbGl4IiwiVXNlciI6eyJpZCI6MSwiY3JlYXRlZEF0IjoxLCJ1cGRhdGVkQXQiOjEsImNQc25fTnVtIjoiMSIsImNQc25fTmFtZSI6Iua1i-ivlWFkbWluIiwiY0RlcHRfbnVtIjoiMSIsInJQZXJzb25UeXBlIjoiMSIsInJTZXgiOiIxIiwiZEJpcnRoRGF0ZSI6IjEiLCJyTmF0aXZlUGxhY2UiOiIxIiwick5hdGlvbmFsIjoiMSIsInJoZWFsdGhTdGF0dXMiOiIxIiwick1hcnJpU3RhdHVzIjoiMSIsInZJRE5vIjoiMSIsInJQZXJSZXNpZGVuY2UiOiIxIiwidkFsaWFOYW1lIjoiMSIsImRKb2lud29ya0RhdGUiOiIxIiwiZFJlZ3VsYXJEYXRlIjoiMSIsInZDYXJkTm8iOiIxIiwidXNlcm5hbWUiOiJhZG1pbiIsInBhc3N3b3JkIjoiIn19.-NKBZjgm6LdjvE4s27pzvFCeGFYZg3ObNaiqVPQ5rfc")
|
||||
.setReadTimeout(60000).execute();
|
||||
|
||||
} catch (Exception e) {
|
||||
errorQty = errorQty+1;
|
||||
errorSn = errorSn+ ","+sapItem;
|
||||
errorQty = errorQty + 1;
|
||||
errorSn = errorSn + "," + sapItem;
|
||||
continue;
|
||||
}
|
||||
if (httpResponse == null || httpResponse.getStatus() != 200) {
|
||||
errorQty = errorQty+1;
|
||||
errorSn = errorSn+ ","+sapItem;
|
||||
errorQty = errorQty + 1;
|
||||
errorSn = errorSn + "," + sapItem;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -72,8 +72,8 @@ public class CuttingInventoryServiceImpl extends ServiceImpl<CuttingInventoryMap
|
||||
String data = jsonObject.getString("data");
|
||||
String message = jsonObject.getString("message");
|
||||
if ("1".equals(code)) {
|
||||
errorQty = errorQty+1;
|
||||
errorSn = errorSn+ ","+sapItem;
|
||||
errorQty = errorQty + 1;
|
||||
errorSn = errorSn + "," + sapItem;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -137,17 +137,17 @@ public class CuttingInventoryServiceImpl extends ServiceImpl<CuttingInventoryMap
|
||||
}
|
||||
|
||||
// 生成托盘码
|
||||
if(wmsCuttingPackageList.size()>0){
|
||||
if (wmsCuttingPackageList.size() > 0) {
|
||||
wmsCuttingPackageService.upadteCuttingPackage(wmsCuttingPackageList);
|
||||
}
|
||||
return "共处理"+sumQty+"条数据,其中"+errorQty+"条数据处理失败,失败的条码为:"+errorSn;
|
||||
return "共处理" + sumQty + "条数据,其中" + errorQty + "条数据处理失败,失败的条码为:" + errorSn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CuttingInventory batchNumberScanWhiteCheck(String sapItem, String stage) {
|
||||
HttpResponse httpResponse;
|
||||
try {
|
||||
httpResponse = HttpRequest.get(urlStr+"/api/slitting/" + sapItem).header("Authorization",
|
||||
httpResponse = HttpRequest.get(urlStr + "/api/slitting/" + sapItem).header("Authorization",
|
||||
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDgxMzg3MjQsImlhdCI6MTY0ODA1MjMyNCwiaXNzIjoiZ2l0aHViLmNvbS9saWJyYXJ5L2ZlbGl4IiwiVXNlciI6eyJpZCI6MSwiY3JlYXRlZEF0IjoxLCJ1cGRhdGVkQXQiOjEsImNQc25fTnVtIjoiMSIsImNQc25fTmFtZSI6Iua1i-ivlWFkbWluIiwiY0RlcHRfbnVtIjoiMSIsInJQZXJzb25UeXBlIjoiMSIsInJTZXgiOiIxIiwiZEJpcnRoRGF0ZSI6IjEiLCJyTmF0aXZlUGxhY2UiOiIxIiwick5hdGlvbmFsIjoiMSIsInJoZWFsdGhTdGF0dXMiOiIxIiwick1hcnJpU3RhdHVzIjoiMSIsInZJRE5vIjoiMSIsInJQZXJSZXNpZGVuY2UiOiIxIiwidkFsaWFOYW1lIjoiMSIsImRKb2lud29ya0RhdGUiOiIxIiwiZFJlZ3VsYXJEYXRlIjoiMSIsInZDYXJkTm8iOiIxIiwidXNlcm5hbWUiOiJhZG1pbiIsInBhc3N3b3JkIjoiIn19.-NKBZjgm6LdjvE4s27pzvFCeGFYZg3ObNaiqVPQ5rfc")
|
||||
.setReadTimeout(60000).execute();
|
||||
|
||||
|
||||
@ -34,153 +34,153 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class DailyBalanceServiceImpl extends ServiceImpl<DailyBalanceMapper, DailyBalance> implements DailyBalanceService {
|
||||
|
||||
private final WmsStorageLocationService storageLocationService;
|
||||
private final WmsStorageLocationService storageLocationService;
|
||||
|
||||
private final WmsItemService itemService;
|
||||
private final WmsItemService itemService;
|
||||
|
||||
private final DailyBalanceMapper dailyBalanceMapper;
|
||||
private final DailyBalanceMapper dailyBalanceMapper;
|
||||
|
||||
private final DocumentSfcService documentSfcService;
|
||||
private final DocumentSfcService documentSfcService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean save(String site, String creator) {
|
||||
String date = LocalDate.now().toString();
|
||||
LocalDate minusDate = LocalDate.now().minusDays(1);
|
||||
String yesterday = minusDate.toString();
|
||||
//找出所有货架
|
||||
List<DailyBalance> list = dailyBalanceMapper.getInitialQty(site);
|
||||
if (list.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
List<DailyBalance> dailyBalanceList = new ArrayList<>();
|
||||
for (DailyBalance dailyBalance : list) {
|
||||
BigDecimal initialQuantity = dailyBalance.getInitialQuantity();
|
||||
String item = dailyBalance.getItem();
|
||||
String batch = dailyBalance.getBatch();
|
||||
String vendorBatch = dailyBalance.getVendorBatch();
|
||||
String storageLocation = dailyBalance.getStorageLocation();
|
||||
if (StringUtil.isEmpty(storageLocation)) {
|
||||
continue;
|
||||
}
|
||||
//写前一日出入库数量
|
||||
LambdaQueryWrapper<DailyBalance> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DailyBalance::getDateTime,yesterday);
|
||||
queryWrapper.eq(DailyBalance::getSite,site);
|
||||
queryWrapper.eq(DailyBalance::getStorageLocation,storageLocation);
|
||||
queryWrapper.eq(DailyBalance::getItem,item);
|
||||
if (StringUtil.notEmpty(batch)) {
|
||||
queryWrapper.eq(DailyBalance::getBatch,batch);
|
||||
}else {
|
||||
queryWrapper.and(dw->dw.isNull(DailyBalance::getBatch).or().eq(DailyBalance::getBatch,""));
|
||||
}
|
||||
List<DailyBalance> yesterdayDataList = this.list(queryWrapper);
|
||||
//查询出入库数量
|
||||
LambdaQueryWrapper<DocumentSfc> documentWrapper = new LambdaQueryWrapper<>();
|
||||
documentWrapper.eq(DocumentSfc::getSite, site);
|
||||
documentWrapper.eq(DocumentSfc::getItem, item);
|
||||
if (StringUtil.isEmpty(batch)) {
|
||||
documentWrapper.and(dw->dw.isNull(DocumentSfc::getBatchNumber).or().eq(DocumentSfc::getBatchNumber,""));
|
||||
}else {
|
||||
documentWrapper.eq(DocumentSfc::getBatchNumber,batch);
|
||||
}
|
||||
documentWrapper.and(qw -> qw.eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_COST_CENTER_RECEIVE)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_PURCHASE_RETURN)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_STORES_REQUISITION)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_SALES_OUT)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_SCRAP_OUT)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_LOCAL_TRANSFER)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_OUTSOURCING)
|
||||
);
|
||||
documentWrapper.eq(DocumentSfc::getSourceLocation, storageLocation);
|
||||
documentWrapper.gt(DocumentSfc::getCreateDateTime, minusDate);
|
||||
List<DocumentSfc> deliveryList = documentSfcService.list(documentWrapper);
|
||||
BigDecimal deliveryQty = deliveryList.stream().map(DocumentSfc::getQty).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean save(String site, String creator) {
|
||||
String date = LocalDate.now().toString();
|
||||
LocalDate minusDate = LocalDate.now().minusDays(1);
|
||||
String yesterday = minusDate.toString();
|
||||
//找出所有货架
|
||||
List<DailyBalance> list = dailyBalanceMapper.getInitialQty(site);
|
||||
if (list.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
List<DailyBalance> dailyBalanceList = new ArrayList<>();
|
||||
for (DailyBalance dailyBalance : list) {
|
||||
BigDecimal initialQuantity = dailyBalance.getInitialQuantity();
|
||||
String item = dailyBalance.getItem();
|
||||
String batch = dailyBalance.getBatch();
|
||||
String vendorBatch = dailyBalance.getVendorBatch();
|
||||
String storageLocation = dailyBalance.getStorageLocation();
|
||||
if (StringUtil.isEmpty(storageLocation)) {
|
||||
continue;
|
||||
}
|
||||
//写前一日出入库数量
|
||||
LambdaQueryWrapper<DailyBalance> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DailyBalance::getDateTime, yesterday);
|
||||
queryWrapper.eq(DailyBalance::getSite, site);
|
||||
queryWrapper.eq(DailyBalance::getStorageLocation, storageLocation);
|
||||
queryWrapper.eq(DailyBalance::getItem, item);
|
||||
if (StringUtil.notEmpty(batch)) {
|
||||
queryWrapper.eq(DailyBalance::getBatch, batch);
|
||||
} else {
|
||||
queryWrapper.and(dw -> dw.isNull(DailyBalance::getBatch).or().eq(DailyBalance::getBatch, ""));
|
||||
}
|
||||
List<DailyBalance> yesterdayDataList = this.list(queryWrapper);
|
||||
//查询出入库数量
|
||||
LambdaQueryWrapper<DocumentSfc> documentWrapper = new LambdaQueryWrapper<>();
|
||||
documentWrapper.eq(DocumentSfc::getSite, site);
|
||||
documentWrapper.eq(DocumentSfc::getItem, item);
|
||||
if (StringUtil.isEmpty(batch)) {
|
||||
documentWrapper.and(dw -> dw.isNull(DocumentSfc::getBatchNumber).or().eq(DocumentSfc::getBatchNumber, ""));
|
||||
} else {
|
||||
documentWrapper.eq(DocumentSfc::getBatchNumber, batch);
|
||||
}
|
||||
documentWrapper.and(qw -> qw.eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_COST_CENTER_RECEIVE)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_PURCHASE_RETURN)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_STORES_REQUISITION)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_SALES_OUT)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_SCRAP_OUT)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_LOCAL_TRANSFER)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_OUTSOURCING)
|
||||
);
|
||||
documentWrapper.eq(DocumentSfc::getSourceLocation, storageLocation);
|
||||
documentWrapper.gt(DocumentSfc::getCreateDateTime, minusDate);
|
||||
List<DocumentSfc> deliveryList = documentSfcService.list(documentWrapper);
|
||||
BigDecimal deliveryQty = deliveryList.stream().map(DocumentSfc::getQty).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
documentWrapper = new LambdaQueryWrapper<>();
|
||||
documentWrapper.eq(DocumentSfc::getSite, site);
|
||||
documentWrapper.eq(DocumentSfc::getItem, item);
|
||||
if (StringUtil.isEmpty(batch)) {
|
||||
documentWrapper.and(dw->dw.isNull(DocumentSfc::getBatchNumber).or().eq(DocumentSfc::getBatchNumber,""));
|
||||
}else {
|
||||
documentWrapper.eq(DocumentSfc::getBatchNumber,batch);
|
||||
}
|
||||
documentWrapper.and(qw -> qw.eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_COST_CENTER_RETURNED)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_PROCUREMENT_STORAGE)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_STORES_RETURNED)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_STOR_REQUEST)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_SALES_RETURN)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_LOCAL_TRANSFER)
|
||||
);
|
||||
documentWrapper.eq(DocumentSfc::getTargetLocation, storageLocation);
|
||||
documentWrapper.gt(DocumentSfc::getCreateDateTime, minusDate);
|
||||
deliveryList = documentSfcService.list(documentWrapper);
|
||||
BigDecimal storageQty = deliveryList.stream().map(DocumentSfc::getQty).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
Item selectCurrent = itemService.selectCurrent(site, item);
|
||||
if (yesterdayDataList.isEmpty()) {
|
||||
DailyBalance yesterdayData = new DailyBalance();
|
||||
yesterdayData.setDateTime(yesterday);
|
||||
yesterdayData.setSite(site);
|
||||
yesterdayData.setInitialQuantity(BigDecimal.ZERO);
|
||||
yesterdayData.setEndQuantity(initialQuantity);
|
||||
yesterdayData.setStorageQuantity(storageQty);
|
||||
yesterdayData.setStorageLocation(storageLocation);
|
||||
yesterdayData.setItemDescription(selectCurrent.getDescription());
|
||||
yesterdayData.setUnit(selectCurrent.getUnitOfMeasure());
|
||||
yesterdayData.setItem(item);
|
||||
yesterdayData.setBatch(batch);
|
||||
yesterdayData.setVendorBatch(vendorBatch);
|
||||
yesterdayData.setErpStorageLocation(dailyBalance.getErpStorageLocation());
|
||||
yesterdayData.setDeliveryQuantity(deliveryQty);
|
||||
yesterdayData.setCreateTime(LocalDateTime.now());
|
||||
yesterdayData.setCreator("JOB");
|
||||
save(yesterdayData);
|
||||
} else {
|
||||
DailyBalance yesterdayData = yesterdayDataList.get(0);
|
||||
yesterdayData.setStorageQuantity(storageQty);
|
||||
yesterdayData.setDeliveryQuantity(deliveryQty);
|
||||
yesterdayData.setEndQuantity(initialQuantity);
|
||||
yesterdayData.setCreateTime(LocalDateTime.now());
|
||||
yesterdayData.setCreator("JOB");
|
||||
updateById(yesterdayData);
|
||||
}
|
||||
//存当日期初数量
|
||||
dailyBalance.setDateTime(date);
|
||||
dailyBalance.setInitialQuantity(initialQuantity);
|
||||
dailyBalance.setSite(site);
|
||||
dailyBalance.setCreateTime(LocalDateTime.now());
|
||||
dailyBalance.setCreator("JOB");
|
||||
dailyBalanceList.add(dailyBalance);
|
||||
documentWrapper = new LambdaQueryWrapper<>();
|
||||
documentWrapper.eq(DocumentSfc::getSite, site);
|
||||
documentWrapper.eq(DocumentSfc::getItem, item);
|
||||
if (StringUtil.isEmpty(batch)) {
|
||||
documentWrapper.and(dw -> dw.isNull(DocumentSfc::getBatchNumber).or().eq(DocumentSfc::getBatchNumber, ""));
|
||||
} else {
|
||||
documentWrapper.eq(DocumentSfc::getBatchNumber, batch);
|
||||
}
|
||||
documentWrapper.and(qw -> qw.eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_COST_CENTER_RETURNED)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_PROCUREMENT_STORAGE)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_STORES_RETURNED)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_STOR_REQUEST)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_SALES_RETURN)
|
||||
.or().eq(DocumentSfc::getDocumentType, Constant.DOCUMENT_LOCAL_TRANSFER)
|
||||
);
|
||||
documentWrapper.eq(DocumentSfc::getTargetLocation, storageLocation);
|
||||
documentWrapper.gt(DocumentSfc::getCreateDateTime, minusDate);
|
||||
deliveryList = documentSfcService.list(documentWrapper);
|
||||
BigDecimal storageQty = deliveryList.stream().map(DocumentSfc::getQty).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
Item selectCurrent = itemService.selectCurrent(site, item);
|
||||
if (yesterdayDataList.isEmpty()) {
|
||||
DailyBalance yesterdayData = new DailyBalance();
|
||||
yesterdayData.setDateTime(yesterday);
|
||||
yesterdayData.setSite(site);
|
||||
yesterdayData.setInitialQuantity(BigDecimal.ZERO);
|
||||
yesterdayData.setEndQuantity(initialQuantity);
|
||||
yesterdayData.setStorageQuantity(storageQty);
|
||||
yesterdayData.setStorageLocation(storageLocation);
|
||||
yesterdayData.setItemDescription(selectCurrent.getDescription());
|
||||
yesterdayData.setUnit(selectCurrent.getUnitOfMeasure());
|
||||
yesterdayData.setItem(item);
|
||||
yesterdayData.setBatch(batch);
|
||||
yesterdayData.setVendorBatch(vendorBatch);
|
||||
yesterdayData.setErpStorageLocation(dailyBalance.getErpStorageLocation());
|
||||
yesterdayData.setDeliveryQuantity(deliveryQty);
|
||||
yesterdayData.setCreateTime(LocalDateTime.now());
|
||||
yesterdayData.setCreator("JOB");
|
||||
save(yesterdayData);
|
||||
} else {
|
||||
DailyBalance yesterdayData = yesterdayDataList.get(0);
|
||||
yesterdayData.setStorageQuantity(storageQty);
|
||||
yesterdayData.setDeliveryQuantity(deliveryQty);
|
||||
yesterdayData.setEndQuantity(initialQuantity);
|
||||
yesterdayData.setCreateTime(LocalDateTime.now());
|
||||
yesterdayData.setCreator("JOB");
|
||||
updateById(yesterdayData);
|
||||
}
|
||||
//存当日期初数量
|
||||
dailyBalance.setDateTime(date);
|
||||
dailyBalance.setInitialQuantity(initialQuantity);
|
||||
dailyBalance.setSite(site);
|
||||
dailyBalance.setCreateTime(LocalDateTime.now());
|
||||
dailyBalance.setCreator("JOB");
|
||||
dailyBalanceList.add(dailyBalance);
|
||||
|
||||
}
|
||||
// 获取前一天期初数据写入之后无期初期末的出入库数据
|
||||
List<DailyBalance> missingList = dailyBalanceMapper.getMissingQty(site, yesterday);
|
||||
if(missingList != null && missingList.size() > 0) {
|
||||
for(DailyBalance dailyBalance : missingList) {
|
||||
dailyBalance.setDateTime(yesterday);
|
||||
dailyBalance.setSite(site);
|
||||
dailyBalance.setCreateTime(LocalDateTime.now());
|
||||
dailyBalance.setCreator("JOB");
|
||||
}
|
||||
this.saveOrUpdateBatch(missingList);
|
||||
}
|
||||
// 获取前一天无期末的出入库数据
|
||||
List<DailyBalance> notEndQtyDataList = dailyBalanceMapper.getNotEndQtyData(site, yesterday);
|
||||
if(notEndQtyDataList != null && notEndQtyDataList.size() > 0) {
|
||||
this.saveOrUpdateBatch(notEndQtyDataList);
|
||||
}
|
||||
// --------------------------------------------------------------------------------------------------------------
|
||||
return this.saveOrUpdateBatch(dailyBalanceList);
|
||||
}
|
||||
}
|
||||
// 获取前一天期初数据写入之后无期初期末的出入库数据
|
||||
List<DailyBalance> missingList = dailyBalanceMapper.getMissingQty(site, yesterday);
|
||||
if (missingList != null && missingList.size() > 0) {
|
||||
for (DailyBalance dailyBalance : missingList) {
|
||||
dailyBalance.setDateTime(yesterday);
|
||||
dailyBalance.setSite(site);
|
||||
dailyBalance.setCreateTime(LocalDateTime.now());
|
||||
dailyBalance.setCreator("JOB");
|
||||
}
|
||||
this.saveOrUpdateBatch(missingList);
|
||||
}
|
||||
// 获取前一天无期末的出入库数据
|
||||
List<DailyBalance> notEndQtyDataList = dailyBalanceMapper.getNotEndQtyData(site, yesterday);
|
||||
if (notEndQtyDataList != null && notEndQtyDataList.size() > 0) {
|
||||
this.saveOrUpdateBatch(notEndQtyDataList);
|
||||
}
|
||||
// --------------------------------------------------------------------------------------------------------------
|
||||
return this.saveOrUpdateBatch(dailyBalanceList);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateById(String site, DailyBalance dailyBalance) {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateById(String site, DailyBalance dailyBalance) {
|
||||
|
||||
String handle = dailyBalance.getHandle();
|
||||
if (StrUtil.isBlank(handle)) {
|
||||
throw BusinessException.build("handle不能为空");
|
||||
}
|
||||
return super.updateById(dailyBalance);
|
||||
}
|
||||
String handle = dailyBalance.getHandle();
|
||||
if (StrUtil.isBlank(handle)) {
|
||||
throw BusinessException.build("handle不能为空");
|
||||
}
|
||||
return super.updateById(dailyBalance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,21 +19,21 @@ import java.time.LocalDateTime;
|
||||
@Service
|
||||
public class DnOrderDetailServiceImpl extends ServiceImpl<DnOrderDetailMapper, DnOrderDetail> implements DnOrderDetailService {
|
||||
|
||||
@Override
|
||||
public void updateBySeq(String customerPoNumber, String deliveryLineRemarks, String material, String materialDescription, BigDecimal qty, String unit, String storagLocation, String charg, LocalDateTime dateTime, String user, String dnOrderBo, String seq, String deliveryBatch) {
|
||||
update(Wrappers.lambdaUpdate(DnOrderDetail.class)
|
||||
.eq(DnOrderDetail::getDnOrderBo, dnOrderBo)
|
||||
.eq(DnOrderDetail::getSeq,seq)
|
||||
.set(DnOrderDetail::getCustomerPoNumber,customerPoNumber)
|
||||
.set(DnOrderDetail::getDeliveryLineRemarks,deliveryLineRemarks)
|
||||
.set(DnOrderDetail::getMaterial,material)
|
||||
.set(DnOrderDetail::getMaterialDescription,materialDescription)
|
||||
.set(DnOrderDetail::getQty,qty)
|
||||
.set(DnOrderDetail::getUnit,unit)
|
||||
.set(DnOrderDetail::getStoragLocation,storagLocation)
|
||||
.set(DnOrderDetail::getCharg,charg)
|
||||
.set(DnOrderDetail::getModifyDateTime,dateTime)
|
||||
.set(DnOrderDetail::getModifyUser,user)
|
||||
.set(DnOrderDetail::getDeliveryBatch,deliveryBatch));
|
||||
}
|
||||
@Override
|
||||
public void updateBySeq(String customerPoNumber, String deliveryLineRemarks, String material, String materialDescription, BigDecimal qty, String unit, String storagLocation, String charg, LocalDateTime dateTime, String user, String dnOrderBo, String seq, String deliveryBatch) {
|
||||
update(Wrappers.lambdaUpdate(DnOrderDetail.class)
|
||||
.eq(DnOrderDetail::getDnOrderBo, dnOrderBo)
|
||||
.eq(DnOrderDetail::getSeq, seq)
|
||||
.set(DnOrderDetail::getCustomerPoNumber, customerPoNumber)
|
||||
.set(DnOrderDetail::getDeliveryLineRemarks, deliveryLineRemarks)
|
||||
.set(DnOrderDetail::getMaterial, material)
|
||||
.set(DnOrderDetail::getMaterialDescription, materialDescription)
|
||||
.set(DnOrderDetail::getQty, qty)
|
||||
.set(DnOrderDetail::getUnit, unit)
|
||||
.set(DnOrderDetail::getStoragLocation, storagLocation)
|
||||
.set(DnOrderDetail::getCharg, charg)
|
||||
.set(DnOrderDetail::getModifyDateTime, dateTime)
|
||||
.set(DnOrderDetail::getModifyUser, user)
|
||||
.set(DnOrderDetail::getDeliveryBatch, deliveryBatch));
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,8 +16,8 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class DnOrderServiceImpl extends ServiceImpl<DnOrderMapper, DnOrder> implements DnOrderService {
|
||||
|
||||
@Override
|
||||
public IPage<DnOrder> pageWithDocument(IPage iPage, String site, DnOrder dnOrder) {
|
||||
return baseMapper.pageWithDocument(iPage, site, dnOrder);
|
||||
}
|
||||
@Override
|
||||
public IPage<DnOrder> pageWithDocument(IPage iPage, String site, DnOrder dnOrder) {
|
||||
return baseMapper.pageWithDocument(iPage, site, dnOrder);
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,58 +23,58 @@ import java.util.List;
|
||||
@Service
|
||||
public class DocumentAdvanceBindServiceImpl extends ServiceImpl<DocumentAdvanceBindMapper, DocumentAdvanceBind> implements DocumentAdvanceBindService {
|
||||
|
||||
@Override
|
||||
public DocumentInventoryDto scanCode(String site, String user, String documentNo, String code, String item, String batch, boolean onlyTray) {
|
||||
DocumentInventoryDto response = new DocumentInventoryDto();
|
||||
List<DocumentAdvanceBind> documentAdvanceBindList = list(Wrappers.lambdaQuery(DocumentAdvanceBind.class).eq(DocumentAdvanceBind::getSite, site)
|
||||
.eq(DocumentAdvanceBind::getDocumentNo, documentNo)
|
||||
.eq(DocumentAdvanceBind::getTray, code)
|
||||
.eq(DocumentAdvanceBind::getItem, item)
|
||||
.eq(StrUtil.isNotBlank(batch), DocumentAdvanceBind::getBatch, batch));
|
||||
if (CollectionUtil.isNotEmpty(documentAdvanceBindList)) {
|
||||
documentAdvanceBindList.stream().reduce((documentAdvanceBind, documentAdvanceBind2) -> {
|
||||
documentAdvanceBind2.setQty(documentAdvanceBind2.getQty().add(documentAdvanceBind.getQty()));
|
||||
return documentAdvanceBind2;
|
||||
}).ifPresent(documentAdvanceBind -> {
|
||||
response.setInventoryIdOrCarrier(documentAdvanceBind.getTray());
|
||||
response.setInventoryQty(documentAdvanceBind.getQty());
|
||||
response.setType("TP01");
|
||||
});
|
||||
} else if (onlyTray) {
|
||||
throw BusinessException.build(code + "的库存绑定信息不存在,请核查");
|
||||
} else {
|
||||
documentAdvanceBindList = list(Wrappers.lambdaQuery(DocumentAdvanceBind.class).eq(DocumentAdvanceBind::getSite, site)
|
||||
.eq(DocumentAdvanceBind::getDocumentNo, documentNo)
|
||||
.eq(DocumentAdvanceBind::getBox, code)
|
||||
.isNull(DocumentAdvanceBind::getTray)
|
||||
.eq(DocumentAdvanceBind::getItem, item)
|
||||
.eq(StrUtil.isNotBlank(batch), DocumentAdvanceBind::getBatch, batch));
|
||||
if (CollectionUtil.isNotEmpty(documentAdvanceBindList)) {
|
||||
documentAdvanceBindList.stream().reduce((documentAdvanceBind, documentAdvanceBind2) -> {
|
||||
documentAdvanceBind2.setQty(documentAdvanceBind2.getQty().add(documentAdvanceBind.getQty()));
|
||||
return documentAdvanceBind2;
|
||||
}).ifPresent(documentAdvanceBind -> {
|
||||
response.setInventoryIdOrCarrier(documentAdvanceBind.getBox());
|
||||
response.setInventoryQty(documentAdvanceBind.getQty());
|
||||
response.setType(Constant.CARRIER_TYPE_BZX);
|
||||
});
|
||||
} else {
|
||||
DocumentAdvanceBind documentAdvanceBind = getOne(Wrappers.lambdaQuery(DocumentAdvanceBind.class)
|
||||
.eq(DocumentAdvanceBind::getHandle, DocumentAdvanceBind.genHandle(site, documentNo, code))
|
||||
.isNull(DocumentAdvanceBind::getBox)
|
||||
.isNull(DocumentAdvanceBind::getTray)
|
||||
.eq(DocumentAdvanceBind::getItem, item)
|
||||
.eq(StrUtil.isNotBlank(batch), DocumentAdvanceBind::getBatch, batch));
|
||||
if (documentAdvanceBind == null) {
|
||||
throw BusinessException.build(code + "的库存绑定信息不存在,请核查");
|
||||
} else {
|
||||
response.setInventoryIdOrCarrier(code);
|
||||
response.setInventoryQty(documentAdvanceBind.getQty());
|
||||
response.setType(Constant.DOCUMENT_SCAN_TYPE_INVENTORY);
|
||||
}
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
@Override
|
||||
public DocumentInventoryDto scanCode(String site, String user, String documentNo, String code, String item, String batch, boolean onlyTray) {
|
||||
DocumentInventoryDto response = new DocumentInventoryDto();
|
||||
List<DocumentAdvanceBind> documentAdvanceBindList = list(Wrappers.lambdaQuery(DocumentAdvanceBind.class).eq(DocumentAdvanceBind::getSite, site)
|
||||
.eq(DocumentAdvanceBind::getDocumentNo, documentNo)
|
||||
.eq(DocumentAdvanceBind::getTray, code)
|
||||
.eq(DocumentAdvanceBind::getItem, item)
|
||||
.eq(StrUtil.isNotBlank(batch), DocumentAdvanceBind::getBatch, batch));
|
||||
if (CollectionUtil.isNotEmpty(documentAdvanceBindList)) {
|
||||
documentAdvanceBindList.stream().reduce((documentAdvanceBind, documentAdvanceBind2) -> {
|
||||
documentAdvanceBind2.setQty(documentAdvanceBind2.getQty().add(documentAdvanceBind.getQty()));
|
||||
return documentAdvanceBind2;
|
||||
}).ifPresent(documentAdvanceBind -> {
|
||||
response.setInventoryIdOrCarrier(documentAdvanceBind.getTray());
|
||||
response.setInventoryQty(documentAdvanceBind.getQty());
|
||||
response.setType("TP01");
|
||||
});
|
||||
} else if (onlyTray) {
|
||||
throw BusinessException.build(code + "的库存绑定信息不存在,请核查");
|
||||
} else {
|
||||
documentAdvanceBindList = list(Wrappers.lambdaQuery(DocumentAdvanceBind.class).eq(DocumentAdvanceBind::getSite, site)
|
||||
.eq(DocumentAdvanceBind::getDocumentNo, documentNo)
|
||||
.eq(DocumentAdvanceBind::getBox, code)
|
||||
.isNull(DocumentAdvanceBind::getTray)
|
||||
.eq(DocumentAdvanceBind::getItem, item)
|
||||
.eq(StrUtil.isNotBlank(batch), DocumentAdvanceBind::getBatch, batch));
|
||||
if (CollectionUtil.isNotEmpty(documentAdvanceBindList)) {
|
||||
documentAdvanceBindList.stream().reduce((documentAdvanceBind, documentAdvanceBind2) -> {
|
||||
documentAdvanceBind2.setQty(documentAdvanceBind2.getQty().add(documentAdvanceBind.getQty()));
|
||||
return documentAdvanceBind2;
|
||||
}).ifPresent(documentAdvanceBind -> {
|
||||
response.setInventoryIdOrCarrier(documentAdvanceBind.getBox());
|
||||
response.setInventoryQty(documentAdvanceBind.getQty());
|
||||
response.setType(Constant.CARRIER_TYPE_BZX);
|
||||
});
|
||||
} else {
|
||||
DocumentAdvanceBind documentAdvanceBind = getOne(Wrappers.lambdaQuery(DocumentAdvanceBind.class)
|
||||
.eq(DocumentAdvanceBind::getHandle, DocumentAdvanceBind.genHandle(site, documentNo, code))
|
||||
.isNull(DocumentAdvanceBind::getBox)
|
||||
.isNull(DocumentAdvanceBind::getTray)
|
||||
.eq(DocumentAdvanceBind::getItem, item)
|
||||
.eq(StrUtil.isNotBlank(batch), DocumentAdvanceBind::getBatch, batch));
|
||||
if (documentAdvanceBind == null) {
|
||||
throw BusinessException.build(code + "的库存绑定信息不存在,请核查");
|
||||
} else {
|
||||
response.setInventoryIdOrCarrier(code);
|
||||
response.setInventoryQty(documentAdvanceBind.getQty());
|
||||
response.setType(Constant.DOCUMENT_SCAN_TYPE_INVENTORY);
|
||||
}
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author mushan
|
||||
@ -37,9 +37,9 @@ public class DocumentDetailedServiceImpl extends ServiceImpl<DocumentDetailedMap
|
||||
|
||||
private final DocumentDetailedMapper documentDetailedMapper;
|
||||
|
||||
private final DocumentMapper documentMapper;
|
||||
private final DocumentMapper documentMapper;
|
||||
|
||||
private final DocumentSfcMapper documentSfcMapper;
|
||||
private final DocumentSfcMapper documentSfcMapper;
|
||||
|
||||
@Override
|
||||
public IPage<DocumentDetailed> selectPage(Page<DocumentDetailed> frontPage, DocumentDetailed documentDetailed) {
|
||||
@ -57,80 +57,80 @@ public class DocumentDetailedServiceImpl extends ServiceImpl<DocumentDetailedMap
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDocumentDetailed(String site, String item) {
|
||||
return documentDetailedMapper.selectDocumentDetailed(site,item);
|
||||
return documentDetailedMapper.selectDocumentDetailed(site, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getRetrieve(IPage page, DocumentDetailed documentDetailed) {
|
||||
String site = documentDetailed.getSite();
|
||||
String documentType = documentDetailed.getDocumentType();
|
||||
String state = documentDetailed.getState();
|
||||
LocalDateTime createDateTime = documentDetailed.getCreateDateTime();
|
||||
LocalDateTime createDateTime2 = documentDetailed.getCreateDateTime2();
|
||||
if (createDateTime != null && createDateTime2 != null) {
|
||||
if (createDateTime.equals(createDateTime2)) {
|
||||
createDateTime2 = createDateTime2.plusDays(1);
|
||||
}
|
||||
}
|
||||
String item = documentDetailed.getItem();
|
||||
String sourceWarehouse = documentDetailed.getSourceWarehouse();
|
||||
String targetWarehouse = documentDetailed.getTargetWarehouse();
|
||||
String documentNo = documentDetailed.getDocumentNo();
|
||||
String createUser = documentDetailed.getCreateUser();
|
||||
return documentDetailedMapper.selectRetrieve(page,site,documentType,state,documentNo,createDateTime,createDateTime2,createUser,item,sourceWarehouse,targetWarehouse,null);
|
||||
@Override
|
||||
public IPage getRetrieve(IPage page, DocumentDetailed documentDetailed) {
|
||||
String site = documentDetailed.getSite();
|
||||
String documentType = documentDetailed.getDocumentType();
|
||||
String state = documentDetailed.getState();
|
||||
LocalDateTime createDateTime = documentDetailed.getCreateDateTime();
|
||||
LocalDateTime createDateTime2 = documentDetailed.getCreateDateTime2();
|
||||
if (createDateTime != null && createDateTime2 != null) {
|
||||
if (createDateTime.equals(createDateTime2)) {
|
||||
createDateTime2 = createDateTime2.plusDays(1);
|
||||
}
|
||||
}
|
||||
String item = documentDetailed.getItem();
|
||||
String sourceWarehouse = documentDetailed.getSourceWarehouse();
|
||||
String targetWarehouse = documentDetailed.getTargetWarehouse();
|
||||
String documentNo = documentDetailed.getDocumentNo();
|
||||
String createUser = documentDetailed.getCreateUser();
|
||||
return documentDetailedMapper.selectRetrieve(page, site, documentType, state, documentNo, createDateTime, createDateTime2, createUser, item, sourceWarehouse, targetWarehouse, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ItemDto> itemPage(IPage<ItemDto> iPage, String site, String searchText) {
|
||||
return documentDetailedMapper.itemPage(iPage,site,searchText);
|
||||
return documentDetailedMapper.itemPage(iPage, site, searchText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<DocumentDetailed> itemPages(IPage<DocumentDetailed> iPage, String site, String searchText) {
|
||||
return documentDetailedMapper.itemPages(iPage,site,searchText);
|
||||
return documentDetailedMapper.itemPages(iPage, site, searchText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemDto getItem(String site, String item) {
|
||||
return documentDetailedMapper.getItem(site,item);
|
||||
}
|
||||
@Override
|
||||
public ItemDto getItem(String site, String item) {
|
||||
return documentDetailedMapper.getItem(site, item);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DocumentDetailed> getDocumentDetailedByRefDoc(String site, String materialDocument, String seq) {
|
||||
return documentDetailedMapper.getDocumentDetailedByRefDoc(site,materialDocument,seq);
|
||||
}
|
||||
@Override
|
||||
public List<DocumentDetailed> getDocumentDetailedByRefDoc(String site, String materialDocument, String seq) {
|
||||
return documentDetailedMapper.getDocumentDetailedByRefDoc(site, materialDocument, seq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DocumentDetailed> getDocumentDetailedByExternalNo(String site, String externalDocumentNo, String item, String qty, String batch) {
|
||||
return documentDetailedMapper.getDocumentDetailedByExternalNo(site,externalDocumentNo,item,qty,batch);
|
||||
}
|
||||
@Override
|
||||
public List<DocumentDetailed> getDocumentDetailedByExternalNo(String site, String externalDocumentNo, String item, String qty, String batch) {
|
||||
return documentDetailedMapper.getDocumentDetailedByExternalNo(site, externalDocumentNo, item, qty, batch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBySeq(String item, String itemDesc, String unit, BigDecimal qty, String sourceWareHouse, String targetWareHouse, LocalDateTime dateTime, String user, String batch, String documentBo, String seq, String documentType) {
|
||||
update(Wrappers.lambdaUpdate(DocumentDetailed.class)
|
||||
.eq(DocumentDetailed::getDocumentBo,documentBo)
|
||||
.eq(DocumentDetailed::getSeq,seq)
|
||||
.eq(DocumentDetailed::getDocumentType,documentType)
|
||||
.set(DocumentDetailed::getItem,item)
|
||||
.set(DocumentDetailed::getItemDescription,itemDesc)
|
||||
.set(DocumentDetailed::getUnitOfMeasure,unit)
|
||||
.set(DocumentDetailed::getApplicationsQuantity,qty)
|
||||
.set(DocumentDetailed::getSourceWarehouse,sourceWareHouse)
|
||||
.set(DocumentDetailed::getTargetWarehouse,targetWareHouse)
|
||||
.set(DocumentDetailed::getModifyDateTime,dateTime)
|
||||
.set(DocumentDetailed::getModifyUser,user)
|
||||
.set(DocumentDetailed::getBatch,batch)
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public void updateBySeq(String item, String itemDesc, String unit, BigDecimal qty, String sourceWareHouse, String targetWareHouse, LocalDateTime dateTime, String user, String batch, String documentBo, String seq, String documentType) {
|
||||
update(Wrappers.lambdaUpdate(DocumentDetailed.class)
|
||||
.eq(DocumentDetailed::getDocumentBo, documentBo)
|
||||
.eq(DocumentDetailed::getSeq, seq)
|
||||
.eq(DocumentDetailed::getDocumentType, documentType)
|
||||
.set(DocumentDetailed::getItem, item)
|
||||
.set(DocumentDetailed::getItemDescription, itemDesc)
|
||||
.set(DocumentDetailed::getUnitOfMeasure, unit)
|
||||
.set(DocumentDetailed::getApplicationsQuantity, qty)
|
||||
.set(DocumentDetailed::getSourceWarehouse, sourceWareHouse)
|
||||
.set(DocumentDetailed::getTargetWarehouse, targetWareHouse)
|
||||
.set(DocumentDetailed::getModifyDateTime, dateTime)
|
||||
.set(DocumentDetailed::getModifyUser, user)
|
||||
.set(DocumentDetailed::getBatch, batch)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<DocumentDetailed> pageForCancel(IPage iPage, String site, String documentNo) {
|
||||
return baseMapper.selectByType(iPage, site, documentNo, Arrays.asList(Constant.DOCUMENT_PURCHASE_RETURN,Constant.DOCUMENT_COST_CENTER_RECEIVE, Constant.DOCUMENT_SALES_RETURN, Constant.DOCUMENT_SCRAP_OUT,Constant.DOCUMENT_OUTSOURCING,Constant.DOCUMENT_ENGINEER_RECEIVE));
|
||||
}
|
||||
@Override
|
||||
public IPage<DocumentDetailed> pageForCancel(IPage iPage, String site, String documentNo) {
|
||||
return baseMapper.selectByType(iPage, site, documentNo, Arrays.asList(Constant.DOCUMENT_PURCHASE_RETURN, Constant.DOCUMENT_COST_CENTER_RECEIVE, Constant.DOCUMENT_SALES_RETURN, Constant.DOCUMENT_SCRAP_OUT, Constant.DOCUMENT_OUTSOURCING, Constant.DOCUMENT_ENGINEER_RECEIVE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<DocumentDetailed> pageForNoEntity(IPage iPage, String site, String documentNo) {
|
||||
return baseMapper.selectByType(iPage, site, documentNo, Arrays.asList(Constant.DOCUMENT_PROCUREMENT_STORAGE,Constant.DOCUMENT_SALES_OUT, Constant.DOCUMENT_SALES_RETURN, Constant.DOCUMENT_SCRAP_OUT));
|
||||
}
|
||||
@Override
|
||||
public IPage<DocumentDetailed> pageForNoEntity(IPage iPage, String site, String documentNo) {
|
||||
return baseMapper.selectByType(iPage, site, documentNo, Arrays.asList(Constant.DOCUMENT_PROCUREMENT_STORAGE, Constant.DOCUMENT_SALES_OUT, Constant.DOCUMENT_SALES_RETURN, Constant.DOCUMENT_SCRAP_OUT));
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author mushan
|
||||
@ -35,9 +35,9 @@ public class DocumentSfcServiceImpl extends ServiceImpl<DocumentSfcMapper, Docum
|
||||
@Autowired
|
||||
private DocumentSfcMapper documentSfcMapper;
|
||||
@Autowired
|
||||
private DocumentMapper documentMapper;
|
||||
private DocumentMapper documentMapper;
|
||||
@Autowired
|
||||
private DataImportMapper dataImportMapper;
|
||||
private DataImportMapper dataImportMapper;
|
||||
|
||||
@Override
|
||||
public IPage<DocumentSfc> selectPage(Page<DocumentSfc> frontPage, DocumentSfc documentSfc) {
|
||||
@ -55,30 +55,30 @@ public class DocumentSfcServiceImpl extends ServiceImpl<DocumentSfcMapper, Docum
|
||||
|
||||
@Override
|
||||
public List<DocumentSfc> getSfc(String site, String documentNo, String seq, String item) {
|
||||
Item itemObj = dataImportMapper.getCurrentRevisionItem(site,item);
|
||||
List<DocumentSfc> documentSfcList = null;
|
||||
Item itemObj = dataImportMapper.getCurrentRevisionItem(site, item);
|
||||
List<DocumentSfc> documentSfcList = null;
|
||||
|
||||
if(itemObj != null && StrUtil.isNotBlank(itemObj.getMaterialType()) && MaterialTypeEnum.VERP.getCode().equals(itemObj.getMaterialType())){
|
||||
documentSfcList = documentSfcMapper.selectSfcAndItemMaterialTypeEqVERP(site, documentNo, seq);
|
||||
}else {
|
||||
documentSfcList = documentSfcMapper.selectSfc(site, documentNo, seq);
|
||||
}
|
||||
if (itemObj != null && StrUtil.isNotBlank(itemObj.getMaterialType()) && MaterialTypeEnum.VERP.getCode().equals(itemObj.getMaterialType())) {
|
||||
documentSfcList = documentSfcMapper.selectSfcAndItemMaterialTypeEqVERP(site, documentNo, seq);
|
||||
} else {
|
||||
documentSfcList = documentSfcMapper.selectSfc(site, documentNo, seq);
|
||||
}
|
||||
|
||||
for(DocumentSfc list : documentSfcList){
|
||||
String createUser = list.getCreateUser();
|
||||
String name = documentMapper.selectUsrName(site, createUser);
|
||||
if(!"".equals(name)&& !(name ==null)){
|
||||
list.setCreateUser(name);
|
||||
}
|
||||
}
|
||||
for (DocumentSfc list : documentSfcList) {
|
||||
String createUser = list.getCreateUser();
|
||||
String name = documentMapper.selectUsrName(site, createUser);
|
||||
if (!"".equals(name) && !(name == null)) {
|
||||
list.setCreateUser(name);
|
||||
}
|
||||
}
|
||||
|
||||
return documentSfcList;
|
||||
return documentSfcList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DocumentInventoryDto> getInventoryList(String site, String documentNo, String documentType, String seq) {
|
||||
return documentSfcMapper.getInventoryList(site,documentNo,documentType,seq);
|
||||
}
|
||||
@Override
|
||||
public List<DocumentInventoryDto> getInventoryList(String site, String documentNo, String documentType, String seq) {
|
||||
return documentSfcMapper.getInventoryList(site, documentNo, documentType, seq);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -29,522 +29,521 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class ExportTemplateServiceImpl implements ExportTemplateService {
|
||||
|
||||
@Override
|
||||
public void exportX(String importType) throws IOException {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
switch (importType) {
|
||||
case "1":
|
||||
//原材料
|
||||
this.exportMaterialROHTemplate(response);
|
||||
break;
|
||||
@Override
|
||||
public void exportX(String importType) throws IOException {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
switch (importType) {
|
||||
case "1":
|
||||
//原材料
|
||||
this.exportMaterialROHTemplate(response);
|
||||
break;
|
||||
|
||||
case "2":
|
||||
//包材
|
||||
this.exportMaterialKMATTemplate(response);
|
||||
break;
|
||||
case "2":
|
||||
//包材
|
||||
this.exportMaterialKMATTemplate(response);
|
||||
break;
|
||||
|
||||
case "3":
|
||||
//半成品
|
||||
this.exportMaterialHALBTemplate(response);
|
||||
break;
|
||||
case "3":
|
||||
//半成品
|
||||
this.exportMaterialHALBTemplate(response);
|
||||
break;
|
||||
|
||||
case "4":
|
||||
//成品
|
||||
this.exportMaterialFERTTemplate(response);
|
||||
break;
|
||||
case "4":
|
||||
//成品
|
||||
this.exportMaterialFERTTemplate(response);
|
||||
break;
|
||||
|
||||
case "5":
|
||||
//更新库存
|
||||
this.exportUpdateInventoryTemplate(response);
|
||||
break;
|
||||
case "5":
|
||||
//更新库存
|
||||
this.exportUpdateInventoryTemplate(response);
|
||||
break;
|
||||
|
||||
case "6":
|
||||
//临时半成品导入
|
||||
this.exportTempInventoryTemplate(response);
|
||||
break;
|
||||
case "6":
|
||||
//临时半成品导入
|
||||
this.exportTempInventoryTemplate(response);
|
||||
break;
|
||||
|
||||
case "7":
|
||||
//载具主数据
|
||||
this.exportCarrierTemplate(response);
|
||||
break;
|
||||
case "7":
|
||||
//载具主数据
|
||||
this.exportCarrierTemplate(response);
|
||||
break;
|
||||
|
||||
case "8":
|
||||
//货格主数据
|
||||
this.exportStorageBinTemplate(response);
|
||||
break;
|
||||
case "8":
|
||||
//货格主数据
|
||||
this.exportStorageBinTemplate(response);
|
||||
break;
|
||||
|
||||
case "9":
|
||||
//采购成品
|
||||
this.exportPurchaseManufacturedTemplate(response);
|
||||
break;
|
||||
case "10":
|
||||
//销售退货
|
||||
this.exportSalesReturnsDtoTemplate(response);
|
||||
break;
|
||||
case "11":
|
||||
//存储位置
|
||||
this.exportStorageLocationIODtoTemplate(response);
|
||||
break;
|
||||
case "12":
|
||||
//库存说明
|
||||
this.exportInventoryNoteTemplate(response);
|
||||
break;
|
||||
case "13":
|
||||
//角色区域绑定信息
|
||||
this.exportRoleAreaBindTemplate(response);
|
||||
break;
|
||||
case "14":
|
||||
this.exportStocktakingROHTemplate(response, Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
|
||||
break;
|
||||
case "15":
|
||||
this.exportStocktakingROHTemplate(response, Arrays.asList(1, 6));
|
||||
break;
|
||||
case "16":
|
||||
this.exportStocktakingKMATTemplate(response, Arrays.asList(0, 1, 2, 3, 4, 5, 6));
|
||||
break;
|
||||
case "17":
|
||||
this.exportStocktakingKMATTemplate(response, Arrays.asList(1, 4));
|
||||
break;
|
||||
case "18":
|
||||
this.exportStocktakingFERTTemplate(response, Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18));
|
||||
break;
|
||||
case "19":
|
||||
this.exportStocktakingFERTTemplate(response, Arrays.asList(1, 4));
|
||||
break;
|
||||
case "20":
|
||||
this.exportMaterialFERTwithQcDataTemplate(response);
|
||||
break;
|
||||
case "21":
|
||||
this.exportItemSafeInventoryTemplate(response);
|
||||
break;
|
||||
default:
|
||||
throw BusinessException.build("不支持的模板类型");
|
||||
}
|
||||
}
|
||||
case "9":
|
||||
//采购成品
|
||||
this.exportPurchaseManufacturedTemplate(response);
|
||||
break;
|
||||
case "10":
|
||||
//销售退货
|
||||
this.exportSalesReturnsDtoTemplate(response);
|
||||
break;
|
||||
case "11":
|
||||
//存储位置
|
||||
this.exportStorageLocationIODtoTemplate(response);
|
||||
break;
|
||||
case "12":
|
||||
//库存说明
|
||||
this.exportInventoryNoteTemplate(response);
|
||||
break;
|
||||
case "13":
|
||||
//角色区域绑定信息
|
||||
this.exportRoleAreaBindTemplate(response);
|
||||
break;
|
||||
case "14":
|
||||
this.exportStocktakingROHTemplate(response, Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
|
||||
break;
|
||||
case "15":
|
||||
this.exportStocktakingROHTemplate(response, Arrays.asList(1, 6));
|
||||
break;
|
||||
case "16":
|
||||
this.exportStocktakingKMATTemplate(response, Arrays.asList(0, 1, 2, 3, 4, 5, 6));
|
||||
break;
|
||||
case "17":
|
||||
this.exportStocktakingKMATTemplate(response, Arrays.asList(1, 4));
|
||||
break;
|
||||
case "18":
|
||||
this.exportStocktakingFERTTemplate(response, Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18));
|
||||
break;
|
||||
case "19":
|
||||
this.exportStocktakingFERTTemplate(response, Arrays.asList(1, 4));
|
||||
break;
|
||||
case "20":
|
||||
this.exportMaterialFERTwithQcDataTemplate(response);
|
||||
break;
|
||||
case "21":
|
||||
this.exportItemSafeInventoryTemplate(response);
|
||||
break;
|
||||
default:
|
||||
throw BusinessException.build("不支持的模板类型");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportS(String importType) throws IOException {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
switch (importType) {
|
||||
case "1":
|
||||
//销售退货成品导入
|
||||
this.exportFinishedProduct(response);
|
||||
break;
|
||||
@Override
|
||||
public void exportS(String importType) throws IOException {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
switch (importType) {
|
||||
case "1":
|
||||
//销售退货成品导入
|
||||
this.exportFinishedProduct(response);
|
||||
break;
|
||||
|
||||
case "2":
|
||||
//销售退货原材料导入
|
||||
this.exportRawMaterial(response);
|
||||
break;
|
||||
case "2":
|
||||
//销售退货原材料导入
|
||||
this.exportRawMaterial(response);
|
||||
break;
|
||||
|
||||
case "3":
|
||||
//公司间采购到货成品导入
|
||||
this.exportProcure(response);
|
||||
break;
|
||||
case "3":
|
||||
//公司间采购到货成品导入
|
||||
this.exportProcure(response);
|
||||
break;
|
||||
|
||||
case "4":
|
||||
//角色区域绑定信息
|
||||
this.exportRoleAreaBindTemplate(response);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
case "4":
|
||||
//角色区域绑定信息
|
||||
this.exportRoleAreaBindTemplate(response);
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
//销售退货成品导入
|
||||
private void exportFinishedProduct(HttpServletResponse response) throws IOException {
|
||||
List<DocumentAdvanceBindDto> list = new ArrayList<>();
|
||||
DocumentAdvanceBindDto documentAdvanceBindDto = new DocumentAdvanceBindDto();
|
||||
documentAdvanceBindDto.setDocumentNo("XT202404170040");
|
||||
documentAdvanceBindDto.setSeq("1");
|
||||
documentAdvanceBindDto.setTray("P21042423004");
|
||||
documentAdvanceBindDto.setBox("M024052001896");
|
||||
documentAdvanceBindDto.setInventoryId("2022110001INV");
|
||||
documentAdvanceBindDto.setItem("ITEM");
|
||||
documentAdvanceBindDto.setQty(BigDecimal.valueOf(1));
|
||||
documentAdvanceBindDto.setProductionDate("2024-03-28");
|
||||
documentAdvanceBindDto.setGroes("HG07D01");
|
||||
documentAdvanceBindDto.setQualityInspectionStatus("1001");
|
||||
documentAdvanceBindDto.setUpgradeFlag("Y");
|
||||
documentAdvanceBindDto.setStandardLength("1000");
|
||||
documentAdvanceBindDto.setCurrentLength("1000");
|
||||
documentAdvanceBindDto.setWidth("985");
|
||||
documentAdvanceBindDto.setBismt("7");
|
||||
documentAdvanceBindDto.setProductionBase("SX或JS");
|
||||
list.add(documentAdvanceBindDto);
|
||||
//销售退货成品导入
|
||||
private void exportFinishedProduct(HttpServletResponse response) throws IOException {
|
||||
List<DocumentAdvanceBindDto> list = new ArrayList<>();
|
||||
DocumentAdvanceBindDto documentAdvanceBindDto = new DocumentAdvanceBindDto();
|
||||
documentAdvanceBindDto.setDocumentNo("XT202404170040");
|
||||
documentAdvanceBindDto.setSeq("1");
|
||||
documentAdvanceBindDto.setTray("P21042423004");
|
||||
documentAdvanceBindDto.setBox("M024052001896");
|
||||
documentAdvanceBindDto.setInventoryId("2022110001INV");
|
||||
documentAdvanceBindDto.setItem("ITEM");
|
||||
documentAdvanceBindDto.setQty(BigDecimal.valueOf(1));
|
||||
documentAdvanceBindDto.setProductionDate("2024-03-28");
|
||||
documentAdvanceBindDto.setGroes("HG07D01");
|
||||
documentAdvanceBindDto.setQualityInspectionStatus("1001");
|
||||
documentAdvanceBindDto.setUpgradeFlag("Y");
|
||||
documentAdvanceBindDto.setStandardLength("1000");
|
||||
documentAdvanceBindDto.setCurrentLength("1000");
|
||||
documentAdvanceBindDto.setWidth("985");
|
||||
documentAdvanceBindDto.setBismt("7");
|
||||
documentAdvanceBindDto.setProductionBase("SX或JS");
|
||||
list.add(documentAdvanceBindDto);
|
||||
|
||||
List<Integer> columns = Arrays.asList(0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15);
|
||||
EasyExcel.write(response.getOutputStream(), DocumentAdvanceBindDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
List<Integer> columns = Arrays.asList(0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15);
|
||||
EasyExcel.write(response.getOutputStream(), DocumentAdvanceBindDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
//销售退货原材料导入
|
||||
private void exportRawMaterial(HttpServletResponse response) throws IOException {
|
||||
List<DocumentRawMaterialDto> list = new ArrayList<>();
|
||||
DocumentRawMaterialDto documentRawMaterialDto = new DocumentRawMaterialDto();
|
||||
documentRawMaterialDto.setDocumentNo("XT202404170040");
|
||||
documentRawMaterialDto.setSeq("1");
|
||||
documentRawMaterialDto.setInventoryId("2022110001INV");
|
||||
documentRawMaterialDto.setItem("ITEM");
|
||||
documentRawMaterialDto.setQty(BigDecimal.valueOf(1));
|
||||
documentRawMaterialDto.setBatch("12345");
|
||||
documentRawMaterialDto.setProductionDate("2024-03-28");
|
||||
documentRawMaterialDto.setVendorBatch("54321");
|
||||
documentRawMaterialDto.setQmsSpecialMarking("0/1/2/3/4");
|
||||
list.add(documentRawMaterialDto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7);
|
||||
EasyExcel.write(response.getOutputStream(), DocumentRawMaterialDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
//销售退货原材料导入
|
||||
private void exportRawMaterial(HttpServletResponse response) throws IOException {
|
||||
List<DocumentRawMaterialDto> list = new ArrayList<>();
|
||||
DocumentRawMaterialDto documentRawMaterialDto = new DocumentRawMaterialDto();
|
||||
documentRawMaterialDto.setDocumentNo("XT202404170040");
|
||||
documentRawMaterialDto.setSeq("1");
|
||||
documentRawMaterialDto.setInventoryId("2022110001INV");
|
||||
documentRawMaterialDto.setItem("ITEM");
|
||||
documentRawMaterialDto.setQty(BigDecimal.valueOf(1));
|
||||
documentRawMaterialDto.setBatch("12345");
|
||||
documentRawMaterialDto.setProductionDate("2024-03-28");
|
||||
documentRawMaterialDto.setVendorBatch("54321");
|
||||
documentRawMaterialDto.setQmsSpecialMarking("0/1/2/3/4");
|
||||
list.add(documentRawMaterialDto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7);
|
||||
EasyExcel.write(response.getOutputStream(), DocumentRawMaterialDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
//公司间采购到货成品导入
|
||||
private void exportProcure(HttpServletResponse response) throws IOException {
|
||||
List<DocumentFinishedProduct> list = new ArrayList<>();
|
||||
DocumentFinishedProduct documentFinishedProduct = new DocumentFinishedProduct();
|
||||
documentFinishedProduct.setDocumentNo("CD202404170040");
|
||||
documentFinishedProduct.setSeq("1");
|
||||
documentFinishedProduct.setTray("P21042423004");
|
||||
documentFinishedProduct.setBox("M024052001896");
|
||||
documentFinishedProduct.setInventoryId("2022110001INV");
|
||||
documentFinishedProduct.setItem("ITEM");
|
||||
documentFinishedProduct.setQty(BigDecimal.valueOf(1));
|
||||
documentFinishedProduct.setProductionDate("2024-03-28");
|
||||
documentFinishedProduct.setGroes("HG07D01");
|
||||
documentFinishedProduct.setQualityInspectionStatus("1001");
|
||||
documentFinishedProduct.setUpgradeFlag("Y");
|
||||
documentFinishedProduct.setStandardLength("1000");
|
||||
documentFinishedProduct.setCurrentLength("1000");
|
||||
documentFinishedProduct.setWidth("985");
|
||||
documentFinishedProduct.setBismt("7");
|
||||
documentFinishedProduct.setProductionBase("SX或JS");
|
||||
list.add(documentFinishedProduct);
|
||||
//公司间采购到货成品导入
|
||||
private void exportProcure(HttpServletResponse response) throws IOException {
|
||||
List<DocumentFinishedProduct> list = new ArrayList<>();
|
||||
DocumentFinishedProduct documentFinishedProduct = new DocumentFinishedProduct();
|
||||
documentFinishedProduct.setDocumentNo("CD202404170040");
|
||||
documentFinishedProduct.setSeq("1");
|
||||
documentFinishedProduct.setTray("P21042423004");
|
||||
documentFinishedProduct.setBox("M024052001896");
|
||||
documentFinishedProduct.setInventoryId("2022110001INV");
|
||||
documentFinishedProduct.setItem("ITEM");
|
||||
documentFinishedProduct.setQty(BigDecimal.valueOf(1));
|
||||
documentFinishedProduct.setProductionDate("2024-03-28");
|
||||
documentFinishedProduct.setGroes("HG07D01");
|
||||
documentFinishedProduct.setQualityInspectionStatus("1001");
|
||||
documentFinishedProduct.setUpgradeFlag("Y");
|
||||
documentFinishedProduct.setStandardLength("1000");
|
||||
documentFinishedProduct.setCurrentLength("1000");
|
||||
documentFinishedProduct.setWidth("985");
|
||||
documentFinishedProduct.setBismt("7");
|
||||
documentFinishedProduct.setProductionBase("SX或JS");
|
||||
list.add(documentFinishedProduct);
|
||||
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15);
|
||||
EasyExcel.write(response.getOutputStream(), DocumentFinishedProduct.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15);
|
||||
EasyExcel.write(response.getOutputStream(), DocumentFinishedProduct.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportMaterialROHTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialROHDto> list = new ArrayList<>();
|
||||
MaterialROHDto materialROHDto = new MaterialROHDto();
|
||||
materialROHDto.setErpStorage("9001");
|
||||
materialROHDto.setInventoryId("2022110001INV");
|
||||
materialROHDto.setStatus("1001");
|
||||
materialROHDto.setMaterial("ITEM");
|
||||
materialROHDto.setBatchNumber("B0001");
|
||||
materialROHDto.setVendorBatch("V0001");
|
||||
materialROHDto.setCurrentQty("1");
|
||||
materialROHDto.setProductionDataTime("2022-11-24");
|
||||
materialROHDto.setQmsSpecialMarking("");
|
||||
materialROHDto.setStorage("A001");
|
||||
list.add(materialROHDto);
|
||||
private void exportMaterialROHTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialROHDto> list = new ArrayList<>();
|
||||
MaterialROHDto materialROHDto = new MaterialROHDto();
|
||||
materialROHDto.setErpStorage("9001");
|
||||
materialROHDto.setInventoryId("2022110001INV");
|
||||
materialROHDto.setStatus("1001");
|
||||
materialROHDto.setMaterial("ITEM");
|
||||
materialROHDto.setBatchNumber("B0001");
|
||||
materialROHDto.setVendorBatch("V0001");
|
||||
materialROHDto.setCurrentQty("1");
|
||||
materialROHDto.setProductionDataTime("2022-11-24");
|
||||
materialROHDto.setQmsSpecialMarking("");
|
||||
materialROHDto.setStorage("A001");
|
||||
list.add(materialROHDto);
|
||||
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialROHDto.class).excludeColumnIndexes(Collections.singletonList(10)).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialROHDto.class).excludeColumnIndexes(Collections.singletonList(10)).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportMaterialKMATTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialKMATDto> list = new ArrayList<>();
|
||||
MaterialKMATDto materialKMATDto = new MaterialKMATDto();
|
||||
materialKMATDto.setErpStorage("9001");
|
||||
materialKMATDto.setInventoryId("2022110001INV");
|
||||
materialKMATDto.setStatus("1001");
|
||||
materialKMATDto.setMaterial("ITEM");
|
||||
materialKMATDto.setCurrentQty("1");
|
||||
materialKMATDto.setStorage("9001-A");
|
||||
list.add(materialKMATDto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialKMATDto.class).excludeColumnIndexes(Collections.singletonList(6)).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
private void exportMaterialKMATTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialKMATDto> list = new ArrayList<>();
|
||||
MaterialKMATDto materialKMATDto = new MaterialKMATDto();
|
||||
materialKMATDto.setErpStorage("9001");
|
||||
materialKMATDto.setInventoryId("2022110001INV");
|
||||
materialKMATDto.setStatus("1001");
|
||||
materialKMATDto.setMaterial("ITEM");
|
||||
materialKMATDto.setCurrentQty("1");
|
||||
materialKMATDto.setStorage("9001-A");
|
||||
list.add(materialKMATDto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialKMATDto.class).excludeColumnIndexes(Collections.singletonList(6)).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportMaterialFERTTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialFERTDto> list = new ArrayList<>();
|
||||
MaterialFERTDto materialFERTDto = new MaterialFERTDto();
|
||||
materialFERTDto.setErpStorage("5001");
|
||||
materialFERTDto.setInventoryId("2022110001INV");
|
||||
materialFERTDto.setStatus("1001");
|
||||
materialFERTDto.setMaterial("ITEM");
|
||||
materialFERTDto.setCurrentQty("1");
|
||||
materialFERTDto.setProductionDataTime("2022-11-24");
|
||||
materialFERTDto.setModel("X1");
|
||||
materialFERTDto.setQualityLevel("A1");
|
||||
materialFERTDto.setUpgradeFlag("Y");
|
||||
materialFERTDto.setStandardLength("1000");
|
||||
materialFERTDto.setLength("1000");
|
||||
materialFERTDto.setBismt("7");
|
||||
materialFERTDto.setWidth("400");
|
||||
materialFERTDto.setProductionBase("SX/JS");
|
||||
materialFERTDto.setDemandCustomers("70000");
|
||||
materialFERTDto.setPallet("T0001");
|
||||
materialFERTDto.setBox("X0001");
|
||||
materialFERTDto.setBoxType("X");
|
||||
materialFERTDto.setShelves("9001-A");
|
||||
list.add(materialFERTDto);
|
||||
private void exportMaterialFERTTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialFERTDto> list = new ArrayList<>();
|
||||
MaterialFERTDto materialFERTDto = new MaterialFERTDto();
|
||||
materialFERTDto.setErpStorage("5001");
|
||||
materialFERTDto.setInventoryId("2022110001INV");
|
||||
materialFERTDto.setStatus("1001");
|
||||
materialFERTDto.setMaterial("ITEM");
|
||||
materialFERTDto.setCurrentQty("1");
|
||||
materialFERTDto.setProductionDataTime("2022-11-24");
|
||||
materialFERTDto.setModel("X1");
|
||||
materialFERTDto.setQualityLevel("A1");
|
||||
materialFERTDto.setUpgradeFlag("Y");
|
||||
materialFERTDto.setStandardLength("1000");
|
||||
materialFERTDto.setLength("1000");
|
||||
materialFERTDto.setBismt("7");
|
||||
materialFERTDto.setWidth("400");
|
||||
materialFERTDto.setProductionBase("SX/JS");
|
||||
materialFERTDto.setDemandCustomers("70000");
|
||||
materialFERTDto.setPallet("T0001");
|
||||
materialFERTDto.setBox("X0001");
|
||||
materialFERTDto.setBoxType("X");
|
||||
materialFERTDto.setShelves("9001-A");
|
||||
list.add(materialFERTDto);
|
||||
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialFERTDto.class).excludeColumnIndexes(Collections.singletonList(19)).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialFERTDto.class).excludeColumnIndexes(Collections.singletonList(19)).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportMaterialHALBTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialHALBDto> list = new ArrayList<>();
|
||||
MaterialHALBDto materialHALBDto = new MaterialHALBDto();
|
||||
materialHALBDto.setStorage("9001");
|
||||
materialHALBDto.setInventoryId("2022110001INV");
|
||||
materialHALBDto.setMaterial("ITEM");
|
||||
materialHALBDto.setModel("X1");
|
||||
materialHALBDto.setCurrentQty("1");
|
||||
materialHALBDto.setQualityInspectionStatus("可用");
|
||||
materialHALBDto.setProductionDataTime(LocalDateTime.now());
|
||||
materialHALBDto.setValidityDate(LocalDateTime.now().plusDays(10));
|
||||
materialHALBDto.setPallet("T0001");
|
||||
materialHALBDto.setBox("X0001");
|
||||
materialHALBDto.setPalletType("T01");
|
||||
materialHALBDto.setLength("1000");
|
||||
materialHALBDto.setWidth("400");
|
||||
materialHALBDto.setShelves("9001-A");
|
||||
list.add(materialHALBDto);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialHALBDto.class).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
private void exportMaterialHALBTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialHALBDto> list = new ArrayList<>();
|
||||
MaterialHALBDto materialHALBDto = new MaterialHALBDto();
|
||||
materialHALBDto.setStorage("9001");
|
||||
materialHALBDto.setInventoryId("2022110001INV");
|
||||
materialHALBDto.setMaterial("ITEM");
|
||||
materialHALBDto.setModel("X1");
|
||||
materialHALBDto.setCurrentQty("1");
|
||||
materialHALBDto.setQualityInspectionStatus("可用");
|
||||
materialHALBDto.setProductionDataTime(LocalDateTime.now());
|
||||
materialHALBDto.setValidityDate(LocalDateTime.now().plusDays(10));
|
||||
materialHALBDto.setPallet("T0001");
|
||||
materialHALBDto.setBox("X0001");
|
||||
materialHALBDto.setPalletType("T01");
|
||||
materialHALBDto.setLength("1000");
|
||||
materialHALBDto.setWidth("400");
|
||||
materialHALBDto.setShelves("9001-A");
|
||||
list.add(materialHALBDto);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialHALBDto.class).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportUpdateInventoryTemplate(HttpServletResponse response) throws IOException {
|
||||
List<UpdateInventoryDto> list = new ArrayList<>();
|
||||
UpdateInventoryDto updateInventoryDto = new UpdateInventoryDto();
|
||||
updateInventoryDto.setInventoryId("2022110001INV");
|
||||
updateInventoryDto.setProductionDataTime(LocalDateTime.now());
|
||||
updateInventoryDto.setValidityDate(LocalDateTime.now().plusDays(10));
|
||||
list.add(updateInventoryDto);
|
||||
EasyExcel.write(response.getOutputStream(), UpdateInventoryDto.class).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
private void exportUpdateInventoryTemplate(HttpServletResponse response) throws IOException {
|
||||
List<UpdateInventoryDto> list = new ArrayList<>();
|
||||
UpdateInventoryDto updateInventoryDto = new UpdateInventoryDto();
|
||||
updateInventoryDto.setInventoryId("2022110001INV");
|
||||
updateInventoryDto.setProductionDataTime(LocalDateTime.now());
|
||||
updateInventoryDto.setValidityDate(LocalDateTime.now().plusDays(10));
|
||||
list.add(updateInventoryDto);
|
||||
EasyExcel.write(response.getOutputStream(), UpdateInventoryDto.class).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportCarrierTemplate(HttpServletResponse response) throws IOException {
|
||||
List<CarrierImportDto> list = new ArrayList<>();
|
||||
CarrierImportDto carrierImportDto = new CarrierImportDto();
|
||||
carrierImportDto.setCarrier("C0001");
|
||||
carrierImportDto.setDescription("载具 C0001");
|
||||
carrierImportDto.setCarrierTypeBo("TP01");
|
||||
carrierImportDto.setStatus("Y");
|
||||
list.add(carrierImportDto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3);
|
||||
EasyExcel.write(response.getOutputStream(), CarrierImportDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
private void exportCarrierTemplate(HttpServletResponse response) throws IOException {
|
||||
List<CarrierImportDto> list = new ArrayList<>();
|
||||
CarrierImportDto carrierImportDto = new CarrierImportDto();
|
||||
carrierImportDto.setCarrier("C0001");
|
||||
carrierImportDto.setDescription("载具 C0001");
|
||||
carrierImportDto.setCarrierTypeBo("TP01");
|
||||
carrierImportDto.setStatus("Y");
|
||||
list.add(carrierImportDto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3);
|
||||
EasyExcel.write(response.getOutputStream(), CarrierImportDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportTempInventoryTemplate(HttpServletResponse response) throws IOException {
|
||||
List<WmsTempInventory> list = new ArrayList<>();
|
||||
list.add(new WmsTempInventory());
|
||||
EasyExcel.write(response.getOutputStream(), WmsTempInventory.class).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
private void exportTempInventoryTemplate(HttpServletResponse response) throws IOException {
|
||||
List<WmsTempInventory> list = new ArrayList<>();
|
||||
list.add(new WmsTempInventory());
|
||||
EasyExcel.write(response.getOutputStream(), WmsTempInventory.class).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportStorageBinTemplate(HttpServletResponse response) throws IOException {
|
||||
List<StorageBinImportDto> list = new ArrayList<>();
|
||||
StorageBinImportDto storageBinImportDto = new StorageBinImportDto();
|
||||
storageBinImportDto.setStorageBin("9001-A");
|
||||
storageBinImportDto.setDescription("9001-A");
|
||||
storageBinImportDto.setStorageBinTypeBo("001");
|
||||
storageBinImportDto.setStorageLocationBo("9001");
|
||||
storageBinImportDto.setShelfRow(10);
|
||||
storageBinImportDto.setShelfColumn(10);
|
||||
storageBinImportDto.setIsDefault("N");
|
||||
storageBinImportDto.setExternalStorageBin("123");
|
||||
list.add(storageBinImportDto);
|
||||
private void exportStorageBinTemplate(HttpServletResponse response) throws IOException {
|
||||
List<StorageBinImportDto> list = new ArrayList<>();
|
||||
StorageBinImportDto storageBinImportDto = new StorageBinImportDto();
|
||||
storageBinImportDto.setStorageBin("9001-A");
|
||||
storageBinImportDto.setDescription("9001-A");
|
||||
storageBinImportDto.setStorageBinTypeBo("001");
|
||||
storageBinImportDto.setStorageLocationBo("9001");
|
||||
storageBinImportDto.setShelfRow(10);
|
||||
storageBinImportDto.setShelfColumn(10);
|
||||
storageBinImportDto.setIsDefault("N");
|
||||
storageBinImportDto.setExternalStorageBin("123");
|
||||
list.add(storageBinImportDto);
|
||||
|
||||
List<Integer> columns = Arrays.asList(0, 2, 3, 6);
|
||||
EasyExcel.write(response.getOutputStream(), StorageBinImportDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
List<Integer> columns = Arrays.asList(0, 2, 3, 6);
|
||||
EasyExcel.write(response.getOutputStream(), StorageBinImportDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportPurchaseManufacturedTemplate(HttpServletResponse response) throws IOException {
|
||||
List<PurchaseManufacturedDto> list = new ArrayList<>();
|
||||
private void exportPurchaseManufacturedTemplate(HttpServletResponse response) throws IOException {
|
||||
List<PurchaseManufacturedDto> list = new ArrayList<>();
|
||||
|
||||
PurchaseManufacturedDto purchaseManufacturedDto = new PurchaseManufacturedDto();
|
||||
purchaseManufacturedDto.setInventoryId("INV0001");
|
||||
purchaseManufacturedDto.setStatus("1001");
|
||||
purchaseManufacturedDto.setMaterial("ITEM001");
|
||||
purchaseManufacturedDto.setBatchNumber("B0001");
|
||||
purchaseManufacturedDto.setVendorBatch("V0001");
|
||||
purchaseManufacturedDto.setCurrentQty("100");
|
||||
purchaseManufacturedDto.setProductionData("2022-10-11");
|
||||
purchaseManufacturedDto.setExpireDate("2022-10-21");
|
||||
purchaseManufacturedDto.setQualityLevel("A1");
|
||||
purchaseManufacturedDto.setLength("1000");
|
||||
purchaseManufacturedDto.setWidth("400");
|
||||
purchaseManufacturedDto.setPallet("T0001");
|
||||
purchaseManufacturedDto.setPalletType("T");
|
||||
purchaseManufacturedDto.setBox("X0001");
|
||||
purchaseManufacturedDto.setBoxType("X");
|
||||
PurchaseManufacturedDto purchaseManufacturedDto = new PurchaseManufacturedDto();
|
||||
purchaseManufacturedDto.setInventoryId("INV0001");
|
||||
purchaseManufacturedDto.setStatus("1001");
|
||||
purchaseManufacturedDto.setMaterial("ITEM001");
|
||||
purchaseManufacturedDto.setBatchNumber("B0001");
|
||||
purchaseManufacturedDto.setVendorBatch("V0001");
|
||||
purchaseManufacturedDto.setCurrentQty("100");
|
||||
purchaseManufacturedDto.setProductionData("2022-10-11");
|
||||
purchaseManufacturedDto.setExpireDate("2022-10-21");
|
||||
purchaseManufacturedDto.setQualityLevel("A1");
|
||||
purchaseManufacturedDto.setLength("1000");
|
||||
purchaseManufacturedDto.setWidth("400");
|
||||
purchaseManufacturedDto.setPallet("T0001");
|
||||
purchaseManufacturedDto.setPalletType("T");
|
||||
purchaseManufacturedDto.setBox("X0001");
|
||||
purchaseManufacturedDto.setBoxType("X");
|
||||
|
||||
list.add(purchaseManufacturedDto);
|
||||
list.add(purchaseManufacturedDto);
|
||||
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 5, 6, 8, 9, 10, 11, 12, 13, 14);
|
||||
EasyExcel.write(response.getOutputStream(), PurchaseManufacturedDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 5, 6, 8, 9, 10, 11, 12, 13, 14);
|
||||
EasyExcel.write(response.getOutputStream(), PurchaseManufacturedDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportSalesReturnsDtoTemplate(HttpServletResponse response) throws IOException {
|
||||
List<SalesReturnsDto> list = new ArrayList<>();
|
||||
private void exportSalesReturnsDtoTemplate(HttpServletResponse response) throws IOException {
|
||||
List<SalesReturnsDto> list = new ArrayList<>();
|
||||
|
||||
SalesReturnsDto salesReturnsDto = new SalesReturnsDto();
|
||||
salesReturnsDto.setInventoryId("INV0001");
|
||||
salesReturnsDto.setStatus("1001");
|
||||
salesReturnsDto.setMaterial("ITEM001");
|
||||
salesReturnsDto.setBatchNumber("B0001");
|
||||
salesReturnsDto.setVendorBatch("V0001");
|
||||
salesReturnsDto.setCurrentQty("100");
|
||||
salesReturnsDto.setProductionData("2022-10-11");
|
||||
salesReturnsDto.setExpireDate("2022-10-21");
|
||||
salesReturnsDto.setQualityLevel("A1");
|
||||
salesReturnsDto.setLength("1000");
|
||||
salesReturnsDto.setWidth("400");
|
||||
salesReturnsDto.setPallet("T0001");
|
||||
salesReturnsDto.setPalletType("T");
|
||||
salesReturnsDto.setBox("X0001");
|
||||
salesReturnsDto.setBoxType("X");
|
||||
SalesReturnsDto salesReturnsDto = new SalesReturnsDto();
|
||||
salesReturnsDto.setInventoryId("INV0001");
|
||||
salesReturnsDto.setStatus("1001");
|
||||
salesReturnsDto.setMaterial("ITEM001");
|
||||
salesReturnsDto.setBatchNumber("B0001");
|
||||
salesReturnsDto.setVendorBatch("V0001");
|
||||
salesReturnsDto.setCurrentQty("100");
|
||||
salesReturnsDto.setProductionData("2022-10-11");
|
||||
salesReturnsDto.setExpireDate("2022-10-21");
|
||||
salesReturnsDto.setQualityLevel("A1");
|
||||
salesReturnsDto.setLength("1000");
|
||||
salesReturnsDto.setWidth("400");
|
||||
salesReturnsDto.setPallet("T0001");
|
||||
salesReturnsDto.setPalletType("T");
|
||||
salesReturnsDto.setBox("X0001");
|
||||
salesReturnsDto.setBoxType("X");
|
||||
|
||||
list.add(salesReturnsDto);
|
||||
list.add(salesReturnsDto);
|
||||
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 5, 6, 8, 9, 10, 11, 12, 13, 14);
|
||||
EasyExcel.write(response.getOutputStream(), SalesReturnsDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 5, 6, 8, 9, 10, 11, 12, 13, 14);
|
||||
EasyExcel.write(response.getOutputStream(), SalesReturnsDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportStorageLocationIODtoTemplate(HttpServletResponse response) throws IOException {
|
||||
List<StorageLocationIODto> list = new ArrayList<>();
|
||||
private void exportStorageLocationIODtoTemplate(HttpServletResponse response) throws IOException {
|
||||
List<StorageLocationIODto> list = new ArrayList<>();
|
||||
|
||||
StorageLocationIODto storageLocationIODto = new StorageLocationIODto();
|
||||
storageLocationIODto.setStorageLocation("7003-A");
|
||||
storageLocationIODto.setStorageLocationTypeBo("001");
|
||||
storageLocationIODto.setWarehouseBo(TenantContextHolder.getTenantId());
|
||||
storageLocationIODto.setErpStorageLocation("7003");
|
||||
storageLocationIODto.setIsDefault("N");
|
||||
list.add(storageLocationIODto);
|
||||
StorageLocationIODto storageLocationIODto = new StorageLocationIODto();
|
||||
storageLocationIODto.setStorageLocation("7003-A");
|
||||
storageLocationIODto.setStorageLocationTypeBo("001");
|
||||
storageLocationIODto.setWarehouseBo(TenantContextHolder.getTenantId());
|
||||
storageLocationIODto.setErpStorageLocation("7003");
|
||||
storageLocationIODto.setIsDefault("N");
|
||||
list.add(storageLocationIODto);
|
||||
|
||||
List<Integer> columns = Arrays.asList(0, 2, 3, 4, 5);
|
||||
EasyExcel.write(response.getOutputStream(), StorageLocationIODto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
List<Integer> columns = Arrays.asList(0, 2, 3, 4, 5);
|
||||
EasyExcel.write(response.getOutputStream(), StorageLocationIODto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportInventoryNoteTemplate(HttpServletResponse response) throws IOException {
|
||||
List<InventoryNoteImportDto> list = new ArrayList<>();
|
||||
private void exportInventoryNoteTemplate(HttpServletResponse response) throws IOException {
|
||||
List<InventoryNoteImportDto> list = new ArrayList<>();
|
||||
|
||||
InventoryNoteImportDto inventoryNoteImportDto = new InventoryNoteImportDto();
|
||||
inventoryNoteImportDto.setInventoryId("INV0001");
|
||||
inventoryNoteImportDto.setNote("note");
|
||||
list.add(inventoryNoteImportDto);
|
||||
List<Integer> columns = Arrays.asList(0, 1);
|
||||
EasyExcel.write(response.getOutputStream(), InventoryNoteImportDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
InventoryNoteImportDto inventoryNoteImportDto = new InventoryNoteImportDto();
|
||||
inventoryNoteImportDto.setInventoryId("INV0001");
|
||||
inventoryNoteImportDto.setNote("note");
|
||||
list.add(inventoryNoteImportDto);
|
||||
List<Integer> columns = Arrays.asList(0, 1);
|
||||
EasyExcel.write(response.getOutputStream(), InventoryNoteImportDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportRoleAreaBindTemplate(HttpServletResponse response) throws IOException {
|
||||
List<RoleAreaBindDTO> list = new ArrayList<>();
|
||||
private void exportRoleAreaBindTemplate(HttpServletResponse response) throws IOException {
|
||||
List<RoleAreaBindDTO> list = new ArrayList<>();
|
||||
|
||||
RoleAreaBindDTO roleAreaBindDTO = new RoleAreaBindDTO();
|
||||
roleAreaBindDTO.setRoleCode("MES_JS_PMC");
|
||||
roleAreaBindDTO.setRoleCodeDesc("MES_江苏_PMC");
|
||||
roleAreaBindDTO.setStorageLocation("101-A");
|
||||
list.add(roleAreaBindDTO);
|
||||
List<Integer> columns = Arrays.asList(0, 2);
|
||||
EasyExcel.write(response.getOutputStream(), RoleAreaBindDTO.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
RoleAreaBindDTO roleAreaBindDTO = new RoleAreaBindDTO();
|
||||
roleAreaBindDTO.setRoleCode("MES_JS_PMC");
|
||||
roleAreaBindDTO.setRoleCodeDesc("MES_江苏_PMC");
|
||||
roleAreaBindDTO.setStorageLocation("101-A");
|
||||
list.add(roleAreaBindDTO);
|
||||
List<Integer> columns = Arrays.asList(0, 2);
|
||||
EasyExcel.write(response.getOutputStream(), RoleAreaBindDTO.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportStocktakingROHTemplate(HttpServletResponse response, List<Integer> columns) throws IOException {
|
||||
List<MaterialROHDto> list = new ArrayList<>();
|
||||
MaterialROHDto materialROHDto = new MaterialROHDto();
|
||||
materialROHDto.setErpStorage("9001");
|
||||
materialROHDto.setInventoryId("2022110001INV");
|
||||
materialROHDto.setStatus("1001");
|
||||
materialROHDto.setMaterial("ITEM");
|
||||
materialROHDto.setBatchNumber("B0001");
|
||||
materialROHDto.setVendorBatch("V0001");
|
||||
materialROHDto.setCurrentQty("1");
|
||||
materialROHDto.setProductionDataTime("2022-11-24");
|
||||
materialROHDto.setQmsSpecialMarking("");
|
||||
materialROHDto.setStorage("A001");
|
||||
materialROHDto.setComments("COMMENTS");
|
||||
list.add(materialROHDto);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialROHDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
private void exportStocktakingROHTemplate(HttpServletResponse response, List<Integer> columns) throws IOException {
|
||||
List<MaterialROHDto> list = new ArrayList<>();
|
||||
MaterialROHDto materialROHDto = new MaterialROHDto();
|
||||
materialROHDto.setErpStorage("9001");
|
||||
materialROHDto.setInventoryId("2022110001INV");
|
||||
materialROHDto.setStatus("1001");
|
||||
materialROHDto.setMaterial("ITEM");
|
||||
materialROHDto.setBatchNumber("B0001");
|
||||
materialROHDto.setVendorBatch("V0001");
|
||||
materialROHDto.setCurrentQty("1");
|
||||
materialROHDto.setProductionDataTime("2022-11-24");
|
||||
materialROHDto.setQmsSpecialMarking("");
|
||||
materialROHDto.setStorage("A001");
|
||||
materialROHDto.setComments("COMMENTS");
|
||||
list.add(materialROHDto);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialROHDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportStocktakingKMATTemplate(HttpServletResponse response, List<Integer> columns) throws IOException {
|
||||
List<MaterialKMATDto> list = new ArrayList<>();
|
||||
MaterialKMATDto materialKMATDto = new MaterialKMATDto();
|
||||
materialKMATDto.setErpStorage("9001");
|
||||
materialKMATDto.setInventoryId("2022110001INV");
|
||||
materialKMATDto.setStatus("1001");
|
||||
materialKMATDto.setMaterial("ITEM");
|
||||
materialKMATDto.setCurrentQty("1");
|
||||
materialKMATDto.setStorage("9001-A");
|
||||
materialKMATDto.setComments("COMMENTS");
|
||||
list.add(materialKMATDto);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialKMATDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
private void exportStocktakingKMATTemplate(HttpServletResponse response, List<Integer> columns) throws IOException {
|
||||
List<MaterialKMATDto> list = new ArrayList<>();
|
||||
MaterialKMATDto materialKMATDto = new MaterialKMATDto();
|
||||
materialKMATDto.setErpStorage("9001");
|
||||
materialKMATDto.setInventoryId("2022110001INV");
|
||||
materialKMATDto.setStatus("1001");
|
||||
materialKMATDto.setMaterial("ITEM");
|
||||
materialKMATDto.setCurrentQty("1");
|
||||
materialKMATDto.setStorage("9001-A");
|
||||
materialKMATDto.setComments("COMMENTS");
|
||||
list.add(materialKMATDto);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialKMATDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportStocktakingFERTTemplate(HttpServletResponse response, List<Integer> columns) throws IOException {
|
||||
List<MaterialFERTDto> list = new ArrayList<>();
|
||||
MaterialFERTDto materialFERTDto = new MaterialFERTDto();
|
||||
materialFERTDto.setErpStorage("5001");
|
||||
materialFERTDto.setInventoryId("2022110001INV");
|
||||
materialFERTDto.setStatus("1001");
|
||||
materialFERTDto.setMaterial("ITEM");
|
||||
materialFERTDto.setCurrentQty("1");
|
||||
materialFERTDto.setProductionDataTime("2022-11-24");
|
||||
materialFERTDto.setModel("X1");
|
||||
materialFERTDto.setQualityLevel("A1");
|
||||
materialFERTDto.setUpgradeFlag("Y");
|
||||
materialFERTDto.setStandardLength("1000");
|
||||
materialFERTDto.setLength("1000");
|
||||
materialFERTDto.setBismt("7");
|
||||
materialFERTDto.setWidth("400");
|
||||
materialFERTDto.setProductionBase("SX/JS");
|
||||
materialFERTDto.setDemandCustomers("70000");
|
||||
materialFERTDto.setPallet("T0001");
|
||||
materialFERTDto.setBox("X0001");
|
||||
materialFERTDto.setBoxType("X");
|
||||
materialFERTDto.setShelves("9001-A");
|
||||
materialFERTDto.setComments("COMMENTS");
|
||||
list.add(materialFERTDto);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialFERTDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
private void exportStocktakingFERTTemplate(HttpServletResponse response, List<Integer> columns) throws IOException {
|
||||
List<MaterialFERTDto> list = new ArrayList<>();
|
||||
MaterialFERTDto materialFERTDto = new MaterialFERTDto();
|
||||
materialFERTDto.setErpStorage("5001");
|
||||
materialFERTDto.setInventoryId("2022110001INV");
|
||||
materialFERTDto.setStatus("1001");
|
||||
materialFERTDto.setMaterial("ITEM");
|
||||
materialFERTDto.setCurrentQty("1");
|
||||
materialFERTDto.setProductionDataTime("2022-11-24");
|
||||
materialFERTDto.setModel("X1");
|
||||
materialFERTDto.setQualityLevel("A1");
|
||||
materialFERTDto.setUpgradeFlag("Y");
|
||||
materialFERTDto.setStandardLength("1000");
|
||||
materialFERTDto.setLength("1000");
|
||||
materialFERTDto.setBismt("7");
|
||||
materialFERTDto.setWidth("400");
|
||||
materialFERTDto.setProductionBase("SX/JS");
|
||||
materialFERTDto.setDemandCustomers("70000");
|
||||
materialFERTDto.setPallet("T0001");
|
||||
materialFERTDto.setBox("X0001");
|
||||
materialFERTDto.setBoxType("X");
|
||||
materialFERTDto.setShelves("9001-A");
|
||||
materialFERTDto.setComments("COMMENTS");
|
||||
list.add(materialFERTDto);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialFERTDto.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
}
|
||||
|
||||
private void exportMaterialFERTwithQcDataTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialFERTwithQcDataDTO> list = new ArrayList<>();
|
||||
MaterialFERTwithQcDataDTO dto = new MaterialFERTwithQcDataDTO();
|
||||
dto.setInventoryId("2022110001INV");
|
||||
dto.setStatus("1001");
|
||||
dto.setMaterial("ITEM");
|
||||
dto.setCurrentQty("1");
|
||||
dto.setProductionDataTime("2022-11-24");
|
||||
dto.setQualityLevel("A1");
|
||||
dto.setLength("1000");
|
||||
dto.setWidth("400");
|
||||
dto.setPallet("T0001");
|
||||
dto.setPalletType("T01");
|
||||
dto.setBox("X0001");
|
||||
dto.setBoxType("X");
|
||||
dto.setDemandCustomers("70000");
|
||||
dto.setModel("X1");
|
||||
dto.setBismt("7");
|
||||
dto.setStandardLength("1000");
|
||||
dto.setErpStorage("5001");
|
||||
dto.setUpgradeFlag("Y");
|
||||
dto.setProductionBase("SX/JS");
|
||||
dto.setShelves("9001-A");
|
||||
dto.setReferenceSfc("XXX");
|
||||
dto.setMeasuredWidth("XXX");
|
||||
list.add(dto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 25, 26, 27, 28, 29, 31, 33, 37, 39, 40, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialFERTwithQcDataDTO.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
private void exportMaterialFERTwithQcDataTemplate(HttpServletResponse response) throws IOException {
|
||||
List<MaterialFERTwithQcDataDTO> list = new ArrayList<>();
|
||||
MaterialFERTwithQcDataDTO dto = new MaterialFERTwithQcDataDTO();
|
||||
dto.setInventoryId("2022110001INV");
|
||||
dto.setStatus("1001");
|
||||
dto.setMaterial("ITEM");
|
||||
dto.setCurrentQty("1");
|
||||
dto.setProductionDataTime("2022-11-24");
|
||||
dto.setQualityLevel("A1");
|
||||
dto.setLength("1000");
|
||||
dto.setWidth("400");
|
||||
dto.setPallet("T0001");
|
||||
dto.setPalletType("T01");
|
||||
dto.setBox("X0001");
|
||||
dto.setBoxType("X");
|
||||
dto.setDemandCustomers("70000");
|
||||
dto.setModel("X1");
|
||||
dto.setBismt("7");
|
||||
dto.setStandardLength("1000");
|
||||
dto.setErpStorage("5001");
|
||||
dto.setUpgradeFlag("Y");
|
||||
dto.setProductionBase("SX/JS");
|
||||
dto.setShelves("9001-A");
|
||||
dto.setReferenceSfc("XXX");
|
||||
dto.setMeasuredWidth("XXX");
|
||||
list.add(dto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 25, 26, 27, 28, 29, 31, 33, 37, 39, 40, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56);
|
||||
EasyExcel.write(response.getOutputStream(), MaterialFERTwithQcDataDTO.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void exportItemSafeInventoryTemplate(HttpServletResponse response) throws IOException {
|
||||
List<ItemSafeInventory> list = new ArrayList<>();
|
||||
ItemSafeInventory dto = new ItemSafeInventory();
|
||||
dto.setItem("item");
|
||||
dto.setSafeQty(BigDecimal.valueOf(10000));
|
||||
dto.setAlmQty(BigDecimal.valueOf(10000));
|
||||
dto.setAlmFlag(true);
|
||||
dto.setPurchaseCycle("123");
|
||||
list.add(dto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4);
|
||||
EasyExcel.write(response.getOutputStream(), ItemSafeInventory.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).registerConverter(new BooleanToYNConverter()).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
private void exportItemSafeInventoryTemplate(HttpServletResponse response) throws IOException {
|
||||
List<ItemSafeInventory> list = new ArrayList<>();
|
||||
ItemSafeInventory dto = new ItemSafeInventory();
|
||||
dto.setItem("item");
|
||||
dto.setSafeQty(BigDecimal.valueOf(10000));
|
||||
dto.setAlmQty(BigDecimal.valueOf(10000));
|
||||
dto.setAlmFlag(true);
|
||||
dto.setPurchaseCycle("123");
|
||||
list.add(dto);
|
||||
List<Integer> columns = Arrays.asList(0, 1, 2, 3, 4);
|
||||
EasyExcel.write(response.getOutputStream(), ItemSafeInventory.class).registerWriteHandler(new EasyExcelCellWriteHandler(columns, true)).registerConverter(new BooleanToYNConverter()).autoCloseStream(Boolean.FALSE).sheet("导出").doWrite(list);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,63 +24,64 @@ import java.util.UUID;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class FalseWarehoursingLogServiceImpl extends ServiceImpl<FalseWarehoursingLogMapper, FalseWarehoursingLog> implements FalseWarehoursingLogService {
|
||||
|
||||
@Override
|
||||
public void saveLog(String site, String user, String logType, String type, String cusotmer, String material, String externalWarehouse, BigDecimal beforeQty, BigDecimal afterQty, String remarks) {
|
||||
save(buildLog(site, user, logType, type, cusotmer, material, externalWarehouse, beforeQty, afterQty, remarks));
|
||||
}
|
||||
@Override
|
||||
public void saveLog(String site, String user, String logType, String type, String cusotmer, String material, String externalWarehouse, BigDecimal beforeQty, BigDecimal afterQty, String remarks) {
|
||||
save(buildLog(site, user, logType, type, cusotmer, material, externalWarehouse, beforeQty, afterQty, remarks));
|
||||
}
|
||||
|
||||
@Override
|
||||
public FalseWarehoursingLog buildLog(String site, String user, String logType, String type, String cusotmer, String material, String externalWarehouse, BigDecimal beforeQty, BigDecimal afterQty, String remarks) {
|
||||
FalseWarehoursingLog falseWarehoursingLog = new FalseWarehoursingLog();
|
||||
falseWarehoursingLog.setHandle(UUID.randomUUID().toString());
|
||||
falseWarehoursingLog.setSite(site);
|
||||
falseWarehoursingLog.setLogType(logType);
|
||||
falseWarehoursingLog.setType(type);
|
||||
falseWarehoursingLog.setCustomer(cusotmer);
|
||||
falseWarehoursingLog.setMaterial(material);
|
||||
falseWarehoursingLog.setExternalWarehouse(externalWarehouse);
|
||||
falseWarehoursingLog.setUpdateBeforeQty(beforeQty);
|
||||
falseWarehoursingLog.setUpdateAfterQty(afterQty);
|
||||
falseWarehoursingLog.setRemarks(remarks);
|
||||
falseWarehoursingLog.setCreateUser(user);
|
||||
falseWarehoursingLog.setCreateDateTime(LocalDateTime.now());
|
||||
return falseWarehoursingLog;
|
||||
}
|
||||
@Override
|
||||
public FalseWarehoursingLog buildLog(String site, String user, String logType, String type, String cusotmer, String material, String externalWarehouse, BigDecimal beforeQty, BigDecimal afterQty, String remarks) {
|
||||
FalseWarehoursingLog falseWarehoursingLog = new FalseWarehoursingLog();
|
||||
falseWarehoursingLog.setHandle(UUID.randomUUID().toString());
|
||||
falseWarehoursingLog.setSite(site);
|
||||
falseWarehoursingLog.setLogType(logType);
|
||||
falseWarehoursingLog.setType(type);
|
||||
falseWarehoursingLog.setCustomer(cusotmer);
|
||||
falseWarehoursingLog.setMaterial(material);
|
||||
falseWarehoursingLog.setExternalWarehouse(externalWarehouse);
|
||||
falseWarehoursingLog.setUpdateBeforeQty(beforeQty);
|
||||
falseWarehoursingLog.setUpdateAfterQty(afterQty);
|
||||
falseWarehoursingLog.setRemarks(remarks);
|
||||
falseWarehoursingLog.setCreateUser(user);
|
||||
falseWarehoursingLog.setCreateDateTime(LocalDateTime.now());
|
||||
return falseWarehoursingLog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FalseWarehoursingLog buildLog(String site, String user, BigDecimal beforeQty, String remarks, boolean isInWarehouseing, FalseWarehoursing falseWarehoursing) {
|
||||
FalseWarehoursingLog falseWarehoursingLog = new FalseWarehoursingLog();
|
||||
falseWarehoursingLog.setHandle(UUID.randomUUID().toString());
|
||||
falseWarehoursingLog.setSite(site);
|
||||
falseWarehoursingLog.setLogType(getLogType(falseWarehoursing.getType(), isInWarehouseing));
|
||||
falseWarehoursingLog.setType(falseWarehoursing.getType());
|
||||
falseWarehoursingLog.setCustomer(falseWarehoursing.getCustomer());
|
||||
falseWarehoursingLog.setMaterial(falseWarehoursing.getMaterial());
|
||||
falseWarehoursingLog.setExternalWarehouse(falseWarehoursing.getExternalWarehouse());
|
||||
falseWarehoursingLog.setUpdateBeforeQty(beforeQty);
|
||||
falseWarehoursingLog.setUpdateAfterQty(falseWarehoursing.getQty());
|
||||
falseWarehoursingLog.setRemarks(remarks);
|
||||
falseWarehoursingLog.setCreateUser(user);
|
||||
falseWarehoursingLog.setCreateDateTime(LocalDateTime.now());
|
||||
return falseWarehoursingLog;
|
||||
}
|
||||
@Override
|
||||
public FalseWarehoursingLog buildLog(String site, String user, BigDecimal beforeQty, String remarks, boolean isInWarehouseing, FalseWarehoursing falseWarehoursing) {
|
||||
FalseWarehoursingLog falseWarehoursingLog = new FalseWarehoursingLog();
|
||||
falseWarehoursingLog.setHandle(UUID.randomUUID().toString());
|
||||
falseWarehoursingLog.setSite(site);
|
||||
falseWarehoursingLog.setLogType(getLogType(falseWarehoursing.getType(), isInWarehouseing));
|
||||
falseWarehoursingLog.setType(falseWarehoursing.getType());
|
||||
falseWarehoursingLog.setCustomer(falseWarehoursing.getCustomer());
|
||||
falseWarehoursingLog.setMaterial(falseWarehoursing.getMaterial());
|
||||
falseWarehoursingLog.setExternalWarehouse(falseWarehoursing.getExternalWarehouse());
|
||||
falseWarehoursingLog.setUpdateBeforeQty(beforeQty);
|
||||
falseWarehoursingLog.setUpdateAfterQty(falseWarehoursing.getQty());
|
||||
falseWarehoursingLog.setRemarks(remarks);
|
||||
falseWarehoursingLog.setCreateUser(user);
|
||||
falseWarehoursingLog.setCreateDateTime(LocalDateTime.now());
|
||||
return falseWarehoursingLog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLogType(String type,boolean isInWarehouseing) {
|
||||
switch (type) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_EXTERNAL_WAREHOUSE_1 : Constant.FALSE_WAREHOURSING_LOG_EXTERNAL_WAREHOUSE_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_CONSIGN_FOR_SALE_1 : Constant.FALSE_WAREHOURSING_LOG_CONSIGN_FOR_SALE_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_1 : Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_1 : Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_NO_ENTITY:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_NO_ENTITY_1 : Constant.FALSE_WAREHOURSING_LOG_NO_ENTITY_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_IN_TRANSIT:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_IN_TRANSIT_1 : Constant.FALSE_WAREHOURSING_LOG_IN_TRANSIT_2;
|
||||
default: throw BusinessException.build("未知无实物库存类型");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getLogType(String type, boolean isInWarehouseing) {
|
||||
switch (type) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_EXTERNAL_WAREHOUSE_1 : Constant.FALSE_WAREHOURSING_LOG_EXTERNAL_WAREHOUSE_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_CONSIGN_FOR_SALE_1 : Constant.FALSE_WAREHOURSING_LOG_CONSIGN_FOR_SALE_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_1 : Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_1 : Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_NO_ENTITY:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_NO_ENTITY_1 : Constant.FALSE_WAREHOURSING_LOG_NO_ENTITY_2;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_IN_TRANSIT:
|
||||
return isInWarehouseing ? Constant.FALSE_WAREHOURSING_LOG_IN_TRANSIT_1 : Constant.FALSE_WAREHOURSING_LOG_IN_TRANSIT_2;
|
||||
default:
|
||||
throw BusinessException.build("未知无实物库存类型");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,289 +31,290 @@ import java.util.stream.Collectors;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class FalseWarehoursingServiceImpl extends ServiceImpl<FalseWarehoursingMapper, FalseWarehoursing> implements FalseWarehoursingService {
|
||||
|
||||
private final FalseWarehoursingLogService falseWarehoursingLogService;
|
||||
private final FalseWarehoursingLogService falseWarehoursingLogService;
|
||||
|
||||
// private final CustItemService custItemService;
|
||||
|
||||
@Override
|
||||
public void externalWarehouseTransfer(String site, String user, String externalWarehouseNo, String customer, String material, BigDecimal qty, String remarks) {
|
||||
//外仓减少数量
|
||||
FalseWarehoursing externalWarehouseObj = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, customer, externalWarehouseNo)))
|
||||
.orElseThrow(() -> BusinessException.build("外仓[" + externalWarehouseNo + "]不存在"));
|
||||
BigDecimal externalWarehouseBeforeQty = externalWarehouseObj.getQty();
|
||||
if (externalWarehouseBeforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + material + "库存不足");
|
||||
} else {
|
||||
externalWarehouseObj.setQty(externalWarehouseBeforeQty.subtract(qty));
|
||||
externalWarehouseObj.setQty(externalWarehouseBeforeQty.subtract(qty));
|
||||
externalWarehouseObj.setModifyUser(user);
|
||||
externalWarehouseObj.setModifyDateTime(LocalDateTime.now());
|
||||
//寄售仓增加数量,不存在则创建
|
||||
FalseWarehoursing consignForSaleObj = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE, customer, null)))
|
||||
.orElseGet(() -> createFalseWarehoursing(site, user, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE, null, customer, externalWarehouseObj.getMaterial(), externalWarehouseObj.getUnit()
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal consignForSaleBeforeQty = consignForSaleObj.getQty();
|
||||
consignForSaleObj.setQty(consignForSaleBeforeQty.add(qty));
|
||||
consignForSaleObj.setModifyUser(user);
|
||||
consignForSaleObj.setModifyDateTime(LocalDateTime.now());
|
||||
//更新外仓并记日志
|
||||
updateById(externalWarehouseObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_EXTERNAL_WAREHOUSE_2, externalWarehouseObj.getType(), externalWarehouseObj.getCustomer(), externalWarehouseObj.getMaterial(), externalWarehouseObj.getExternalWarehouse(), externalWarehouseBeforeQty, externalWarehouseObj.getQty(), remarks);
|
||||
//更新寄售仓并记日志
|
||||
updateById(consignForSaleObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_CONSIGN_FOR_SALE_1, consignForSaleObj.getType(), consignForSaleObj.getCustomer(), consignForSaleObj.getMaterial(), null, consignForSaleBeforeQty, consignForSaleObj.getQty(), remarks);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void externalWarehouseTransfer(String site, String user, String externalWarehouseNo, String customer, String material, BigDecimal qty, String remarks) {
|
||||
//外仓减少数量
|
||||
FalseWarehoursing externalWarehouseObj = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, customer, externalWarehouseNo)))
|
||||
.orElseThrow(() -> BusinessException.build("外仓[" + externalWarehouseNo + "]不存在"));
|
||||
BigDecimal externalWarehouseBeforeQty = externalWarehouseObj.getQty();
|
||||
if (externalWarehouseBeforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + material + "库存不足");
|
||||
} else {
|
||||
externalWarehouseObj.setQty(externalWarehouseBeforeQty.subtract(qty));
|
||||
externalWarehouseObj.setQty(externalWarehouseBeforeQty.subtract(qty));
|
||||
externalWarehouseObj.setModifyUser(user);
|
||||
externalWarehouseObj.setModifyDateTime(LocalDateTime.now());
|
||||
//寄售仓增加数量,不存在则创建
|
||||
FalseWarehoursing consignForSaleObj = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE, customer, null)))
|
||||
.orElseGet(() -> createFalseWarehoursing(site, user, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE, null, customer, externalWarehouseObj.getMaterial(), externalWarehouseObj.getUnit()
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal consignForSaleBeforeQty = consignForSaleObj.getQty();
|
||||
consignForSaleObj.setQty(consignForSaleBeforeQty.add(qty));
|
||||
consignForSaleObj.setModifyUser(user);
|
||||
consignForSaleObj.setModifyDateTime(LocalDateTime.now());
|
||||
//更新外仓并记日志
|
||||
updateById(externalWarehouseObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_EXTERNAL_WAREHOUSE_2, externalWarehouseObj.getType(), externalWarehouseObj.getCustomer(), externalWarehouseObj.getMaterial(), externalWarehouseObj.getExternalWarehouse(), externalWarehouseBeforeQty, externalWarehouseObj.getQty(), remarks);
|
||||
//更新寄售仓并记日志
|
||||
updateById(consignForSaleObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_CONSIGN_FOR_SALE_1, consignForSaleObj.getType(), consignForSaleObj.getCustomer(), consignForSaleObj.getMaterial(), null, consignForSaleBeforeQty, consignForSaleObj.getQty(), remarks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void consignForSaleTransfer(String site, String user, String consignForSaleNo, String customer, String material, String externalWarehouseNo, BigDecimal qty, String remarks) {
|
||||
//寄售仓减少数量
|
||||
FalseWarehoursing consignForSaleObj = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE, customer, "#")))
|
||||
.orElseThrow(() -> BusinessException.build("寄售仓[" + consignForSaleNo + "]不存在"));
|
||||
BigDecimal consignForSaleBeforeQty = consignForSaleObj.getQty();
|
||||
if (consignForSaleBeforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + material + "库存不足");
|
||||
} else {
|
||||
consignForSaleObj.setQty(consignForSaleBeforeQty.subtract(qty));
|
||||
consignForSaleObj.setModifyUser(user);
|
||||
consignForSaleObj.setModifyDateTime(LocalDateTime.now());
|
||||
//外仓增加数量,不存在则创建
|
||||
FalseWarehoursing externalWarehouseObj = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, customer, externalWarehouseNo)))
|
||||
.orElseGet(() -> createFalseWarehoursing(site, user, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, externalWarehouseNo, consignForSaleObj.getCustomer(), consignForSaleObj.getMaterial(), consignForSaleObj.getUnit()
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal externalWarehouseBeforeQty = externalWarehouseObj.getQty();
|
||||
externalWarehouseObj.setQty(externalWarehouseBeforeQty.add(qty));
|
||||
externalWarehouseObj.setModifyUser(user);
|
||||
externalWarehouseObj.setModifyDateTime(LocalDateTime.now());
|
||||
//更新寄售仓并记日志
|
||||
updateById(consignForSaleObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_CONSIGN_FOR_SALE_2, consignForSaleObj.getType(), consignForSaleObj.getCustomer(), consignForSaleObj.getMaterial(), null, consignForSaleBeforeQty, consignForSaleObj.getQty(), remarks);
|
||||
//更新外仓并记日志
|
||||
updateById(externalWarehouseObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_EXTERNAL_WAREHOUSE_1, externalWarehouseObj.getType(), externalWarehouseObj.getCustomer(), externalWarehouseObj.getMaterial(), externalWarehouseObj.getExternalWarehouse(), externalWarehouseBeforeQty, externalWarehouseObj.getQty(), remarks);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void consignForSaleTransfer(String site, String user, String consignForSaleNo, String customer, String material, String externalWarehouseNo, BigDecimal qty, String remarks) {
|
||||
//寄售仓减少数量
|
||||
FalseWarehoursing consignForSaleObj = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE, customer, "#")))
|
||||
.orElseThrow(() -> BusinessException.build("寄售仓[" + consignForSaleNo + "]不存在"));
|
||||
BigDecimal consignForSaleBeforeQty = consignForSaleObj.getQty();
|
||||
if (consignForSaleBeforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + material + "库存不足");
|
||||
} else {
|
||||
consignForSaleObj.setQty(consignForSaleBeforeQty.subtract(qty));
|
||||
consignForSaleObj.setModifyUser(user);
|
||||
consignForSaleObj.setModifyDateTime(LocalDateTime.now());
|
||||
//外仓增加数量,不存在则创建
|
||||
FalseWarehoursing externalWarehouseObj = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, customer, externalWarehouseNo)))
|
||||
.orElseGet(() -> createFalseWarehoursing(site, user, Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE, externalWarehouseNo, consignForSaleObj.getCustomer(), consignForSaleObj.getMaterial(), consignForSaleObj.getUnit()
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal externalWarehouseBeforeQty = externalWarehouseObj.getQty();
|
||||
externalWarehouseObj.setQty(externalWarehouseBeforeQty.add(qty));
|
||||
externalWarehouseObj.setModifyUser(user);
|
||||
externalWarehouseObj.setModifyDateTime(LocalDateTime.now());
|
||||
//更新寄售仓并记日志
|
||||
updateById(consignForSaleObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_CONSIGN_FOR_SALE_2, consignForSaleObj.getType(), consignForSaleObj.getCustomer(), consignForSaleObj.getMaterial(), null, consignForSaleBeforeQty, consignForSaleObj.getQty(), remarks);
|
||||
//更新外仓并记日志
|
||||
updateById(externalWarehouseObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_EXTERNAL_WAREHOUSE_1, externalWarehouseObj.getType(), externalWarehouseObj.getCustomer(), externalWarehouseObj.getMaterial(), externalWarehouseObj.getExternalWarehouse(), externalWarehouseBeforeQty, externalWarehouseObj.getQty(), remarks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FalseWarehoursing createFalseWarehoursing(String site, String user, String type, String externalWarehouse, String customer, String material, String unit, BigDecimal qty) {
|
||||
FalseWarehoursing falseWarehoursing = buildFalseWarehoursing(site, user, type, externalWarehouse, customer, material, unit, qty);
|
||||
save(falseWarehoursing);
|
||||
return falseWarehoursing;
|
||||
}
|
||||
@Override
|
||||
public FalseWarehoursing createFalseWarehoursing(String site, String user, String type, String externalWarehouse, String customer, String material, String unit, BigDecimal qty) {
|
||||
FalseWarehoursing falseWarehoursing = buildFalseWarehoursing(site, user, type, externalWarehouse, customer, material, unit, qty);
|
||||
save(falseWarehoursing);
|
||||
return falseWarehoursing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FalseWarehoursing buildFalseWarehoursing(String site, String user, String type, String externalWarehouse, String customer, String material, String unit, BigDecimal qty) {
|
||||
FalseWarehoursing falseWarehoursing = new FalseWarehoursing();
|
||||
externalWarehouse = Optional.ofNullable(externalWarehouse).orElse("#");
|
||||
customer = Optional.ofNullable(customer).orElse("#");
|
||||
falseWarehoursing.setHandle(FalseWarehoursing.genHandle(site, material, type, customer, externalWarehouse));
|
||||
falseWarehoursing.setSite(site);
|
||||
falseWarehoursing.setType(type);
|
||||
falseWarehoursing.setCustomer(customer);
|
||||
falseWarehoursing.setMaterial(material);
|
||||
falseWarehoursing.setQty(qty);
|
||||
falseWarehoursing.setUnit(unit);
|
||||
falseWarehoursing.setExternalWarehouse(externalWarehouse);
|
||||
falseWarehoursing.setCreateDateTime(LocalDateTime.now());
|
||||
falseWarehoursing.setCreateUser(user);
|
||||
return falseWarehoursing;
|
||||
}
|
||||
@Override
|
||||
public FalseWarehoursing buildFalseWarehoursing(String site, String user, String type, String externalWarehouse, String customer, String material, String unit, BigDecimal qty) {
|
||||
FalseWarehoursing falseWarehoursing = new FalseWarehoursing();
|
||||
externalWarehouse = Optional.ofNullable(externalWarehouse).orElse("#");
|
||||
customer = Optional.ofNullable(customer).orElse("#");
|
||||
falseWarehoursing.setHandle(FalseWarehoursing.genHandle(site, material, type, customer, externalWarehouse));
|
||||
falseWarehoursing.setSite(site);
|
||||
falseWarehoursing.setType(type);
|
||||
falseWarehoursing.setCustomer(customer);
|
||||
falseWarehoursing.setMaterial(material);
|
||||
falseWarehoursing.setQty(qty);
|
||||
falseWarehoursing.setUnit(unit);
|
||||
falseWarehoursing.setExternalWarehouse(externalWarehouse);
|
||||
falseWarehoursing.setCreateDateTime(LocalDateTime.now());
|
||||
falseWarehoursing.setCreateUser(user);
|
||||
return falseWarehoursing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customerTransfer(String site, String user, String customer, String material, BigDecimal qty, String remarks) {
|
||||
//客户仓减少
|
||||
FalseWarehoursing customerWarehouse = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER, customer, "#")))
|
||||
.orElseThrow(() -> BusinessException.build("客户仓不存在"));
|
||||
BigDecimal customerWarehouseBeforeQty = customerWarehouse.getQty();
|
||||
if (customerWarehouseBeforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + material + "库存不足");
|
||||
} else {
|
||||
customerWarehouse.setQty(customerWarehouseBeforeQty.subtract(qty));
|
||||
customerWarehouse.setModifyUser(user);
|
||||
customerWarehouse.setModifyDateTime(LocalDateTime.now());
|
||||
//备件维修仓增加
|
||||
FalseWarehoursing matWarehouse = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, "#", "#")))
|
||||
.orElseGet(() -> createFalseWarehoursing(site, user, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, null, customerWarehouse.getCustomer(), customerWarehouse.getMaterial(), customerWarehouse.getUnit()
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal matWarehouseBeforeQty = matWarehouse.getQty();
|
||||
matWarehouse.setQty(matWarehouseBeforeQty.add(qty));
|
||||
matWarehouse.setModifyUser(user);
|
||||
matWarehouse.setModifyDateTime(LocalDateTime.now());
|
||||
//更新客户仓并记日志
|
||||
updateById(customerWarehouse);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_2, customerWarehouse.getType(), customerWarehouse.getCustomer(), customerWarehouse.getMaterial(), null, customerWarehouseBeforeQty, customerWarehouse.getQty(), remarks);
|
||||
//更新备件维修仓并记日志
|
||||
updateById(matWarehouse);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_1, matWarehouse.getType(), matWarehouse.getCustomer(), matWarehouse.getMaterial(), null, matWarehouseBeforeQty, matWarehouse.getQty(), remarks);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void matServiceTransfer(String site, String user, String customer, String material, BigDecimal qty, String remarks) {
|
||||
//备件维修仓减少
|
||||
FalseWarehoursing matWarehouse = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, "#", "#")))
|
||||
.orElseThrow(() -> BusinessException.build("备件维修仓不存在"));
|
||||
BigDecimal matWarehouseBeforeQty = matWarehouse.getQty();
|
||||
if (matWarehouseBeforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + material + "库存不足");
|
||||
} else {
|
||||
matWarehouse.setQty(matWarehouseBeforeQty.subtract(qty));
|
||||
matWarehouse.setModifyUser(user);
|
||||
matWarehouse.setModifyDateTime(LocalDateTime.now());
|
||||
//客户仓增加
|
||||
FalseWarehoursing customerWarehouse = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER, customer, "#")))
|
||||
.orElseGet(() -> createFalseWarehoursing(site, user, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER, null, customer, matWarehouse.getMaterial(), matWarehouse.getUnit()
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal customerWarehouseBeforeQty = customerWarehouse.getQty();
|
||||
customerWarehouse.setQty(customerWarehouseBeforeQty.add(qty));
|
||||
customerWarehouse.setModifyUser(user);
|
||||
customerWarehouse.setModifyDateTime(LocalDateTime.now());
|
||||
//更新备件维修仓并记日志
|
||||
updateById(matWarehouse);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_2, matWarehouse.getType(), matWarehouse.getCustomer(), matWarehouse.getMaterial(), null, matWarehouseBeforeQty, matWarehouse.getQty(), remarks);
|
||||
//更新客户仓并记日志
|
||||
updateById(customerWarehouse);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_1, customerWarehouse.getType(), customerWarehouse.getCustomer(), customerWarehouse.getMaterial(), null, customerWarehouseBeforeQty, customerWarehouse.getQty(), remarks);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void customerTransfer(String site, String user, String customer, String material, BigDecimal qty, String remarks) {
|
||||
//客户仓减少
|
||||
FalseWarehoursing customerWarehouse = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER, customer, "#")))
|
||||
.orElseThrow(() -> BusinessException.build("客户仓不存在"));
|
||||
BigDecimal customerWarehouseBeforeQty = customerWarehouse.getQty();
|
||||
if (customerWarehouseBeforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + material + "库存不足");
|
||||
} else {
|
||||
customerWarehouse.setQty(customerWarehouseBeforeQty.subtract(qty));
|
||||
customerWarehouse.setModifyUser(user);
|
||||
customerWarehouse.setModifyDateTime(LocalDateTime.now());
|
||||
//备件维修仓增加
|
||||
FalseWarehoursing matWarehouse = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, "#", "#")))
|
||||
.orElseGet(() -> createFalseWarehoursing(site, user, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, null, customerWarehouse.getCustomer(), customerWarehouse.getMaterial(), customerWarehouse.getUnit()
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal matWarehouseBeforeQty = matWarehouse.getQty();
|
||||
matWarehouse.setQty(matWarehouseBeforeQty.add(qty));
|
||||
matWarehouse.setModifyUser(user);
|
||||
matWarehouse.setModifyDateTime(LocalDateTime.now());
|
||||
//更新客户仓并记日志
|
||||
updateById(customerWarehouse);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_2, customerWarehouse.getType(), customerWarehouse.getCustomer(), customerWarehouse.getMaterial(), null, customerWarehouseBeforeQty, customerWarehouse.getQty(), remarks);
|
||||
//更新备件维修仓并记日志
|
||||
updateById(matWarehouse);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_1, matWarehouse.getType(), matWarehouse.getCustomer(), matWarehouse.getMaterial(), null, matWarehouseBeforeQty, matWarehouse.getQty(), remarks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transIn(String site, String user, String type, String customer, String material, BigDecimal qty, String remarks, String unitOfMeasure, boolean checkMaterial) {
|
||||
@Override
|
||||
public void matServiceTransfer(String site, String user, String customer, String material, BigDecimal qty, String remarks) {
|
||||
//备件维修仓减少
|
||||
FalseWarehoursing matWarehouse = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE, "#", "#")))
|
||||
.orElseThrow(() -> BusinessException.build("备件维修仓不存在"));
|
||||
BigDecimal matWarehouseBeforeQty = matWarehouse.getQty();
|
||||
if (matWarehouseBeforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + material + "库存不足");
|
||||
} else {
|
||||
matWarehouse.setQty(matWarehouseBeforeQty.subtract(qty));
|
||||
matWarehouse.setModifyUser(user);
|
||||
matWarehouse.setModifyDateTime(LocalDateTime.now());
|
||||
//客户仓增加
|
||||
FalseWarehoursing customerWarehouse = Optional.ofNullable(getById(FalseWarehoursing.genHandle(site, material, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER, customer, "#")))
|
||||
.orElseGet(() -> createFalseWarehoursing(site, user, Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER, null, customer, matWarehouse.getMaterial(), matWarehouse.getUnit()
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal customerWarehouseBeforeQty = customerWarehouse.getQty();
|
||||
customerWarehouse.setQty(customerWarehouseBeforeQty.add(qty));
|
||||
customerWarehouse.setModifyUser(user);
|
||||
customerWarehouse.setModifyDateTime(LocalDateTime.now());
|
||||
//更新备件维修仓并记日志
|
||||
updateById(matWarehouse);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_2, matWarehouse.getType(), matWarehouse.getCustomer(), matWarehouse.getMaterial(), null, matWarehouseBeforeQty, matWarehouse.getQty(), remarks);
|
||||
//更新客户仓并记日志
|
||||
updateById(customerWarehouse);
|
||||
falseWarehoursingLogService.saveLog(site, user, Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_1, customerWarehouse.getType(), customerWarehouse.getCustomer(), customerWarehouse.getMaterial(), null, customerWarehouseBeforeQty, customerWarehouse.getQty(), remarks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transIn(String site, String user, String type, String customer, String material, BigDecimal qty, String remarks, String unitOfMeasure, boolean checkMaterial) {
|
||||
// if (checkMaterial) {
|
||||
// Item item = Optional.ofNullable(custItemService.selectCurrent(site, material)).orElseThrow(() -> BusinessException.build("物料不存在"));
|
||||
// unitOfMeasure = item.getUnitOfMeasure();
|
||||
// }
|
||||
String finalUnitOfMeasure = unitOfMeasure;
|
||||
String handle = FalseWarehoursing.genHandle(site, material, type, Optional.ofNullable(customer).orElse("#"), "#");
|
||||
FalseWarehoursing falseWarehoursingObj = Optional.ofNullable(getById(handle)).orElseGet(() -> createFalseWarehoursing(site, user, type, "#", customer, material, finalUnitOfMeasure
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal beforQty = falseWarehoursingObj.getQty();
|
||||
falseWarehoursingObj.setQty(beforQty.add(qty));
|
||||
falseWarehoursingObj.setModifyUser(user);
|
||||
falseWarehoursingObj.setModifyDateTime(LocalDateTime.now());
|
||||
String logType;
|
||||
switch (type) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
logType = Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_1;
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
logType = Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_1;
|
||||
break;
|
||||
default:
|
||||
throw BusinessException.build("不支持的类型");
|
||||
}
|
||||
updateById(falseWarehoursingObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, logType, falseWarehoursingObj.getType(), falseWarehoursingObj.getCustomer(), falseWarehoursingObj.getMaterial(), null, beforQty, falseWarehoursingObj.getQty(), remarks);
|
||||
}
|
||||
String finalUnitOfMeasure = unitOfMeasure;
|
||||
String handle = FalseWarehoursing.genHandle(site, material, type, Optional.ofNullable(customer).orElse("#"), "#");
|
||||
FalseWarehoursing falseWarehoursingObj = Optional.ofNullable(getById(handle)).orElseGet(() -> createFalseWarehoursing(site, user, type, "#", customer, material, finalUnitOfMeasure
|
||||
, BigDecimal.ZERO));
|
||||
BigDecimal beforQty = falseWarehoursingObj.getQty();
|
||||
falseWarehoursingObj.setQty(beforQty.add(qty));
|
||||
falseWarehoursingObj.setModifyUser(user);
|
||||
falseWarehoursingObj.setModifyDateTime(LocalDateTime.now());
|
||||
String logType;
|
||||
switch (type) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
logType = Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_1;
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
logType = Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_1;
|
||||
break;
|
||||
default:
|
||||
throw BusinessException.build("不支持的类型");
|
||||
}
|
||||
updateById(falseWarehoursingObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, logType, falseWarehoursingObj.getType(), falseWarehoursingObj.getCustomer(), falseWarehoursingObj.getMaterial(), null, beforQty, falseWarehoursingObj.getQty(), remarks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transOut(String site, String user, String type, String customer, String material, BigDecimal qty, String remarks) {
|
||||
String handle = FalseWarehoursing.genHandle(site, material, type, customer, null);
|
||||
FalseWarehoursing falseWarehoursingObj = Optional.ofNullable(getById(handle))
|
||||
.orElseThrow(() -> {
|
||||
switch (type) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
return BusinessException.build("备件维修仓不存在");
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
return BusinessException.build("客户仓不存在");
|
||||
default:
|
||||
return BusinessException.build("无实物库存不存在");
|
||||
}
|
||||
});
|
||||
BigDecimal beforeQty = falseWarehoursingObj.getQty();
|
||||
if (beforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + falseWarehoursingObj.getMaterial() + "库存不足");
|
||||
} else {
|
||||
falseWarehoursingObj.setQty(beforeQty.subtract(qty));
|
||||
}
|
||||
falseWarehoursingObj.setModifyUser(user);
|
||||
falseWarehoursingObj.setModifyDateTime(LocalDateTime.now());
|
||||
String logType;
|
||||
switch (type) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
logType = Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_2;
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
logType = Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_2;
|
||||
break;
|
||||
default:
|
||||
throw BusinessException.build("不支持的类型");
|
||||
}
|
||||
updateById(falseWarehoursingObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, logType, falseWarehoursingObj.getType(), falseWarehoursingObj.getCustomer(), falseWarehoursingObj.getMaterial(), null, beforeQty, falseWarehoursingObj.getQty(), remarks);
|
||||
}
|
||||
@Override
|
||||
public void transOut(String site, String user, String type, String customer, String material, BigDecimal qty, String remarks) {
|
||||
String handle = FalseWarehoursing.genHandle(site, material, type, customer, null);
|
||||
FalseWarehoursing falseWarehoursingObj = Optional.ofNullable(getById(handle))
|
||||
.orElseThrow(() -> {
|
||||
switch (type) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
return BusinessException.build("备件维修仓不存在");
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
return BusinessException.build("客户仓不存在");
|
||||
default:
|
||||
return BusinessException.build("无实物库存不存在");
|
||||
}
|
||||
});
|
||||
BigDecimal beforeQty = falseWarehoursingObj.getQty();
|
||||
if (beforeQty.compareTo(qty) < 0) {
|
||||
throw BusinessException.build("物料" + falseWarehoursingObj.getMaterial() + "库存不足");
|
||||
} else {
|
||||
falseWarehoursingObj.setQty(beforeQty.subtract(qty));
|
||||
}
|
||||
falseWarehoursingObj.setModifyUser(user);
|
||||
falseWarehoursingObj.setModifyDateTime(LocalDateTime.now());
|
||||
String logType;
|
||||
switch (type) {
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_MAT_SERVICE:
|
||||
logType = Constant.FALSE_WAREHOURSING_LOG_MAT_SERVICE_2;
|
||||
break;
|
||||
case Constant.FALSE_WAREHOURSING_TYPE_CUSTOMER:
|
||||
logType = Constant.FALSE_WAREHOURSING_LOG_CUSTOMER_2;
|
||||
break;
|
||||
default:
|
||||
throw BusinessException.build("不支持的类型");
|
||||
}
|
||||
updateById(falseWarehoursingObj);
|
||||
falseWarehoursingLogService.saveLog(site, user, logType, falseWarehoursingObj.getType(), falseWarehoursingObj.getCustomer(), falseWarehoursingObj.getMaterial(), null, beforeQty, falseWarehoursingObj.getQty(), remarks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transOutBatch(String site, String user, String remarks, Map<String, BigDecimal> falseWarehoursingMap) {
|
||||
//根据主键查询已存在的无实物库存主键和数量
|
||||
Map<String, FalseWarehoursing> existMap = list(Wrappers.lambdaQuery(FalseWarehoursing.class).in(FalseWarehoursing::getHandle, falseWarehoursingMap.keySet())
|
||||
.select(FalseWarehoursing::getHandle, FalseWarehoursing::getType, FalseWarehoursing::getCustomer, FalseWarehoursing::getMaterial, FalseWarehoursing::getExternalWarehouse, FalseWarehoursing::getQty))
|
||||
.stream().collect(Collectors.toMap(FalseWarehoursing::getHandle, falseWarehoursing -> falseWarehoursing));
|
||||
if (existMap.size() != falseWarehoursingMap.size()) {
|
||||
Set<String> keySet = new HashSet<>(falseWarehoursingMap.keySet());
|
||||
keySet.removeAll(existMap.keySet());
|
||||
throw BusinessException.build("未找到物料[" + keySet.stream().map(StringUtil::trimHandle).collect(Collectors.joining(",")) + "]对应的无实物库存");
|
||||
} else {
|
||||
//更新无实物库存
|
||||
List<FalseWarehoursingLog> logs = new ArrayList<>(falseWarehoursingMap.size());
|
||||
existMap.forEach((handle, falseWarehoursing) -> {
|
||||
BigDecimal beforeQty = falseWarehoursing.getQty();
|
||||
BigDecimal subQty = falseWarehoursingMap.get(handle);
|
||||
if (beforeQty.compareTo(subQty) < 0) {
|
||||
throw BusinessException.build("物料" + falseWarehoursing.getMaterial() + "无实物库存不足");
|
||||
} else {
|
||||
falseWarehoursing.setQty(beforeQty.subtract(subQty));
|
||||
falseWarehoursing.setModifyUser(user);
|
||||
falseWarehoursing.setModifyDateTime(LocalDateTime.now());
|
||||
logs.add(falseWarehoursingLogService.buildLog(site, user, beforeQty, remarks, false, falseWarehoursing));
|
||||
}
|
||||
});
|
||||
updateBatchById(existMap.values());
|
||||
falseWarehoursingLogService.saveBatch(logs);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void transOutBatch(String site, String user, String remarks, Map<String, BigDecimal> falseWarehoursingMap) {
|
||||
//根据主键查询已存在的无实物库存主键和数量
|
||||
Map<String, FalseWarehoursing> existMap = list(Wrappers.lambdaQuery(FalseWarehoursing.class).in(FalseWarehoursing::getHandle, falseWarehoursingMap.keySet())
|
||||
.select(FalseWarehoursing::getHandle, FalseWarehoursing::getType, FalseWarehoursing::getCustomer, FalseWarehoursing::getMaterial, FalseWarehoursing::getExternalWarehouse, FalseWarehoursing::getQty))
|
||||
.stream().collect(Collectors.toMap(FalseWarehoursing::getHandle, falseWarehoursing -> falseWarehoursing));
|
||||
if (existMap.size() != falseWarehoursingMap.size()) {
|
||||
Set<String> keySet = new HashSet<>(falseWarehoursingMap.keySet());
|
||||
keySet.removeAll(existMap.keySet());
|
||||
throw BusinessException.build("未找到物料[" + keySet.stream().map(StringUtil::trimHandle).collect(Collectors.joining(",")) + "]对应的无实物库存");
|
||||
} else {
|
||||
//更新无实物库存
|
||||
List<FalseWarehoursingLog> logs = new ArrayList<>(falseWarehoursingMap.size());
|
||||
existMap.forEach((handle, falseWarehoursing) -> {
|
||||
BigDecimal beforeQty = falseWarehoursing.getQty();
|
||||
BigDecimal subQty = falseWarehoursingMap.get(handle);
|
||||
if (beforeQty.compareTo(subQty) < 0) {
|
||||
throw BusinessException.build("物料" + falseWarehoursing.getMaterial() + "无实物库存不足");
|
||||
} else {
|
||||
falseWarehoursing.setQty(beforeQty.subtract(subQty));
|
||||
falseWarehoursing.setModifyUser(user);
|
||||
falseWarehoursing.setModifyDateTime(LocalDateTime.now());
|
||||
logs.add(falseWarehoursingLogService.buildLog(site, user, beforeQty, remarks, false, falseWarehoursing));
|
||||
}
|
||||
});
|
||||
updateBatchById(existMap.values());
|
||||
falseWarehoursingLogService.saveBatch(logs);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transInBatch(String site, String user, String remarks, Map<String, FalseWarehoursing> falseWarehoursingMap) {
|
||||
//根据主键查询已存在的无实物库存主键和数量
|
||||
Map<String, BigDecimal> existMap = list(Wrappers.lambdaQuery(FalseWarehoursing.class).in(FalseWarehoursing::getHandle, falseWarehoursingMap.keySet()).select(FalseWarehoursing::getHandle, FalseWarehoursing::getQty))
|
||||
.stream().collect(Collectors.toMap(FalseWarehoursing::getHandle, FalseWarehoursing::getQty));
|
||||
//创建或更新无实物库存
|
||||
List<FalseWarehoursingLog> logs = new ArrayList<>(falseWarehoursingMap.size());
|
||||
falseWarehoursingMap.forEach((handle, falseWarehoursing) -> {
|
||||
BigDecimal beforeQty = Optional.ofNullable(existMap.get(handle)).orElse(BigDecimal.ZERO);
|
||||
if (BigDecimal.ZERO.compareTo(beforeQty) < 0) {
|
||||
falseWarehoursing.setQty(falseWarehoursing.getQty().add(beforeQty));
|
||||
falseWarehoursing.setModifyUser(user);
|
||||
falseWarehoursing.setModifyDateTime(LocalDateTime.now());
|
||||
}
|
||||
logs.add(falseWarehoursingLogService.buildLog(site, user, beforeQty, remarks, true, falseWarehoursing));
|
||||
});
|
||||
saveOrUpdateBatch(falseWarehoursingMap.values());
|
||||
falseWarehoursingLogService.saveBatch(logs);
|
||||
}
|
||||
@Override
|
||||
public void transInBatch(String site, String user, String remarks, Map<String, FalseWarehoursing> falseWarehoursingMap) {
|
||||
//根据主键查询已存在的无实物库存主键和数量
|
||||
Map<String, BigDecimal> existMap = list(Wrappers.lambdaQuery(FalseWarehoursing.class).in(FalseWarehoursing::getHandle, falseWarehoursingMap.keySet()).select(FalseWarehoursing::getHandle, FalseWarehoursing::getQty))
|
||||
.stream().collect(Collectors.toMap(FalseWarehoursing::getHandle, FalseWarehoursing::getQty));
|
||||
//创建或更新无实物库存
|
||||
List<FalseWarehoursingLog> logs = new ArrayList<>(falseWarehoursingMap.size());
|
||||
falseWarehoursingMap.forEach((handle, falseWarehoursing) -> {
|
||||
BigDecimal beforeQty = Optional.ofNullable(existMap.get(handle)).orElse(BigDecimal.ZERO);
|
||||
if (BigDecimal.ZERO.compareTo(beforeQty) < 0) {
|
||||
falseWarehoursing.setQty(falseWarehoursing.getQty().add(beforeQty));
|
||||
falseWarehoursing.setModifyUser(user);
|
||||
falseWarehoursing.setModifyDateTime(LocalDateTime.now());
|
||||
}
|
||||
logs.add(falseWarehoursingLogService.buildLog(site, user, beforeQty, remarks, true, falseWarehoursing));
|
||||
});
|
||||
saveOrUpdateBatch(falseWarehoursingMap.values());
|
||||
falseWarehoursingLogService.saveBatch(logs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String assessFalseWarehoursingType(String projectType, String extWarehourseRemarks) {
|
||||
if (Constant.DN_ORDER_PROJECT_TYPE_NCCU.equals(projectType)) {
|
||||
return Constant.FALSE_WAREHOURSING_TYPE_IN_TRANSIT;
|
||||
} else if (Constant.DN_ORDER_PROJECT_TYPE_ZCFN.equals(projectType) || Constant.DN_ORDER_PROJECT_TYPE_ZCPN.equals(projectType) || Constant.DN_ORDER_PROJECT_TYPE_ZCIN.equals(projectType)) {
|
||||
if (StrUtil.isNotBlank(extWarehourseRemarks)) {
|
||||
return Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE;
|
||||
} else {
|
||||
return Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String assessFalseWarehoursingType(String projectType, String extWarehourseRemarks) {
|
||||
if (Constant.DN_ORDER_PROJECT_TYPE_NCCU.equals(projectType)) {
|
||||
return Constant.FALSE_WAREHOURSING_TYPE_IN_TRANSIT;
|
||||
} else if (Constant.DN_ORDER_PROJECT_TYPE_ZCFN.equals(projectType) || Constant.DN_ORDER_PROJECT_TYPE_ZCPN.equals(projectType) || Constant.DN_ORDER_PROJECT_TYPE_ZCIN.equals(projectType)) {
|
||||
if (StrUtil.isNotBlank(extWarehourseRemarks)) {
|
||||
return Constant.FALSE_WAREHOURSING_TYPE_EXTERNAL_WAREHOUSE;
|
||||
} else {
|
||||
return Constant.FALSE_WAREHOURSING_TYPE_CONSIGN_FOR_SALE;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cacheFalseWarehoursing(String site, String user, String projectType, Map<String, FalseWarehoursing> falseWarehoursingMap, String item, String deliveryParty, String extWarehourseRemarks, BigDecimal qtyOnHand, String unitOfMeasure) {
|
||||
if (falseWarehoursingMap != null) {
|
||||
String type = assessFalseWarehoursingType(projectType, extWarehourseRemarks);
|
||||
FalseWarehoursing falseWarehoursing = falseWarehoursingMap.computeIfAbsent(FalseWarehoursing.genHandle(site, item, type, deliveryParty, extWarehourseRemarks)
|
||||
, k -> buildFalseWarehoursing(site, user, type, extWarehourseRemarks, deliveryParty, item, unitOfMeasure, BigDecimal.ZERO));
|
||||
falseWarehoursing.setQty(falseWarehoursing.getQty().add(qtyOnHand));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void cacheFalseWarehoursing(String site, String user, String projectType, Map<String, FalseWarehoursing> falseWarehoursingMap, String item, String deliveryParty, String extWarehourseRemarks, BigDecimal qtyOnHand, String unitOfMeasure) {
|
||||
if (falseWarehoursingMap != null) {
|
||||
String type = assessFalseWarehoursingType(projectType, extWarehourseRemarks);
|
||||
FalseWarehoursing falseWarehoursing = falseWarehoursingMap.computeIfAbsent(FalseWarehoursing.genHandle(site, item, type, deliveryParty, extWarehourseRemarks)
|
||||
, k -> buildFalseWarehoursing(site, user, type, extWarehourseRemarks, deliveryParty, item, unitOfMeasure, BigDecimal.ZERO));
|
||||
falseWarehoursing.setQty(falseWarehoursing.getQty().add(qtyOnHand));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -22,9 +22,9 @@ public class ItemSafeInventoryServiceImpl extends ServiceImpl<ItemSafeInventoryM
|
||||
|
||||
// private final CustItemService itemService;
|
||||
|
||||
@Override
|
||||
public void greatSaveOrUpdate(String site, String user, ItemSafeInventory itemSafeInventory) {
|
||||
validate(itemSafeInventory);
|
||||
@Override
|
||||
public void greatSaveOrUpdate(String site, String user, ItemSafeInventory itemSafeInventory) {
|
||||
validate(itemSafeInventory);
|
||||
// Item item = Optional.ofNullable(itemService.selectCurrent(site, itemSafeInventory.getItem()))
|
||||
// .orElseThrow(() -> BusinessException.build("物料不存在"));
|
||||
// String handle = item.getHandle();
|
||||
@ -41,16 +41,16 @@ public class ItemSafeInventoryServiceImpl extends ServiceImpl<ItemSafeInventoryM
|
||||
// itemSafeInventory.setUpdateTime(LocalDateTime.now());
|
||||
// super.updateById(itemSafeInventory);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(ItemSafeInventory itemSafeInventory) {
|
||||
if (StrUtil.isBlank(itemSafeInventory.getItem())) {
|
||||
throw BusinessException.build("物料不能为空");
|
||||
} else if (ObjectUtil.hasNull(itemSafeInventory.getSafeQty(), itemSafeInventory.getAlmQty())) {
|
||||
throw BusinessException.build("安全数量和预警数量不能为空");
|
||||
} else if (itemSafeInventory.getAlmQty().compareTo(itemSafeInventory.getSafeQty()) < 0) {
|
||||
throw BusinessException.build("预警数量不能小于安全数量");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void validate(ItemSafeInventory itemSafeInventory) {
|
||||
if (StrUtil.isBlank(itemSafeInventory.getItem())) {
|
||||
throw BusinessException.build("物料不能为空");
|
||||
} else if (ObjectUtil.hasNull(itemSafeInventory.getSafeQty(), itemSafeInventory.getAlmQty())) {
|
||||
throw BusinessException.build("安全数量和预警数量不能为空");
|
||||
} else if (itemSafeInventory.getAlmQty().compareTo(itemSafeInventory.getSafeQty()) < 0) {
|
||||
throw BusinessException.build("预警数量不能小于安全数量");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,29 +36,30 @@ public class LabelFieldAllocationServiceImpl extends ServiceImpl<LabelFieldAlloc
|
||||
|
||||
private final LabelFieldAllocationDetailService labelFieldAllocationDetailService;
|
||||
|
||||
private final SystemFieldService systemFieldService;
|
||||
private final SystemFieldService systemFieldService;
|
||||
|
||||
private final LabelFieldAllocationMapper labelFieldAllocationMapper;
|
||||
private final LabelFieldAllocationMapper labelFieldAllocationMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public LabelFieldAllocation getByCode(String site, String code) {
|
||||
|
||||
LabelFieldAllocation labelFieldAllocation = getById(LabelFieldAllocation.genHandle(site, code));
|
||||
if(labelFieldAllocation == null) {
|
||||
if (labelFieldAllocation == null) {
|
||||
return null;
|
||||
}
|
||||
String id = labelFieldAllocation.getHandle();
|
||||
List<LabelFieldAllocationDetail> labelFieldAllocationDetailList = labelFieldAllocationDetailService.list(Wrappers.<LabelFieldAllocationDetail>query().lambda().eq(LabelFieldAllocationDetail::getZLabelFieldAllocationBo, id).orderByAsc(LabelFieldAllocationDetail::getSeq));
|
||||
if (labelFieldAllocationDetailList != null && labelFieldAllocationDetailList.size() > 0){
|
||||
for (LabelFieldAllocationDetail labelFieldAllocationDetail : labelFieldAllocationDetailList){
|
||||
SystemField systemField = systemFieldService.getById(SystemField.genHandle(site, labelFieldAllocationDetail.getFieldNumber()));
|
||||
labelFieldAllocationDetail.setFieldDescription(systemField.getFieldDescription());
|
||||
}
|
||||
labelFieldAllocation.setLabelFieldAllocationDetailList(labelFieldAllocationDetailList);
|
||||
}
|
||||
if (labelFieldAllocationDetailList != null && labelFieldAllocationDetailList.size() > 0) {
|
||||
for (LabelFieldAllocationDetail labelFieldAllocationDetail : labelFieldAllocationDetailList) {
|
||||
SystemField systemField = systemFieldService.getById(SystemField.genHandle(site, labelFieldAllocationDetail.getFieldNumber()));
|
||||
labelFieldAllocationDetail.setFieldDescription(systemField.getFieldDescription());
|
||||
}
|
||||
labelFieldAllocation.setLabelFieldAllocationDetailList(labelFieldAllocationDetailList);
|
||||
}
|
||||
return labelFieldAllocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByCode(String site, String code) {
|
||||
|
||||
@ -72,27 +73,26 @@ public class LabelFieldAllocationServiceImpl extends ServiceImpl<LabelFieldAlloc
|
||||
public boolean save(String site, String creator, LabelFieldAllocation labelFieldAllocation) {
|
||||
labelFieldAllocation.setSite(site);
|
||||
String handle = LabelFieldAllocation.genHandle(site, labelFieldAllocation.getLabelNumber());
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
labelFieldAllocation.setModifyUser(user);
|
||||
labelFieldAllocation.setModifyDateTime(time);
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
labelFieldAllocation.setModifyUser(user);
|
||||
labelFieldAllocation.setModifyDateTime(time);
|
||||
labelFieldAllocation.setHandle(handle);
|
||||
try {
|
||||
if (labelFieldAllocation.getLabelFieldAllocationDetailList() != null && labelFieldAllocation.getLabelFieldAllocationDetailList().size() > 0)
|
||||
{
|
||||
for(LabelFieldAllocationDetail labelFieldAllocationDetail : labelFieldAllocation.getLabelFieldAllocationDetailList()) {
|
||||
validateBeforeAdditionalDetailAddAndUpdate(site, labelFieldAllocationDetail);
|
||||
labelFieldAllocationDetail.setHandle(LabelFieldAllocationDetail.genHandle( handle, labelFieldAllocationDetail.getLabelField()));
|
||||
if (labelFieldAllocation.getLabelFieldAllocationDetailList() != null && labelFieldAllocation.getLabelFieldAllocationDetailList().size() > 0) {
|
||||
for (LabelFieldAllocationDetail labelFieldAllocationDetail : labelFieldAllocation.getLabelFieldAllocationDetailList()) {
|
||||
validateBeforeAdditionalDetailAddAndUpdate(site, labelFieldAllocationDetail);
|
||||
labelFieldAllocationDetail.setHandle(LabelFieldAllocationDetail.genHandle(handle, labelFieldAllocationDetail.getLabelField()));
|
||||
labelFieldAllocationDetail.setZLabelFieldAllocationBo(handle);
|
||||
labelFieldAllocationDetail.setFieldNumber(labelFieldAllocationDetail.getFieldNumber());
|
||||
labelFieldAllocationDetail.setModifyUser(user);
|
||||
labelFieldAllocationDetail.setModifyDateTime(time);
|
||||
labelFieldAllocationDetail.setFieldNumber(labelFieldAllocationDetail.getFieldNumber());
|
||||
labelFieldAllocationDetail.setModifyUser(user);
|
||||
labelFieldAllocationDetail.setModifyDateTime(time);
|
||||
}
|
||||
labelFieldAllocationDetailService.saveBatch(labelFieldAllocation.getLabelFieldAllocationDetailList());
|
||||
}
|
||||
return super.save(labelFieldAllocation);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("系统中已存在指定的值:[" + e.getCause().getLocalizedMessage() + "]");
|
||||
} else {
|
||||
throw e;
|
||||
@ -104,49 +104,48 @@ public class LabelFieldAllocationServiceImpl extends ServiceImpl<LabelFieldAlloc
|
||||
@Override
|
||||
public boolean updateById(String site, String updater, LabelFieldAllocation labelFieldAllocation) {
|
||||
String handle = labelFieldAllocation.getHandle();
|
||||
if(StrUtil.isBlank(handle)) {
|
||||
if (StrUtil.isBlank(handle)) {
|
||||
throw BusinessException.build("handle不能为空");
|
||||
}
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
labelFieldAllocation.setModifyUser(user);
|
||||
labelFieldAllocation.setModifyDateTime(time);
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
labelFieldAllocation.setModifyUser(user);
|
||||
labelFieldAllocation.setModifyDateTime(time);
|
||||
labelFieldAllocation.setSite(site);
|
||||
labelFieldAllocationDetailService.remove(Wrappers.<LabelFieldAllocationDetail>query().lambda().eq(LabelFieldAllocationDetail::getZLabelFieldAllocationBo, handle));
|
||||
if (labelFieldAllocation.getLabelFieldAllocationDetailList() != null && labelFieldAllocation.getLabelFieldAllocationDetailList().size() > 0)
|
||||
{
|
||||
for(LabelFieldAllocationDetail labelFieldAllocationDetail : labelFieldAllocation.getLabelFieldAllocationDetailList()) {
|
||||
validateBeforeAdditionalDetailAddAndUpdate(site, labelFieldAllocationDetail);
|
||||
labelFieldAllocationDetail.setHandle(LabelFieldAllocationDetail.genHandle( handle, labelFieldAllocationDetail.getLabelField()));
|
||||
if (labelFieldAllocation.getLabelFieldAllocationDetailList() != null && labelFieldAllocation.getLabelFieldAllocationDetailList().size() > 0) {
|
||||
for (LabelFieldAllocationDetail labelFieldAllocationDetail : labelFieldAllocation.getLabelFieldAllocationDetailList()) {
|
||||
validateBeforeAdditionalDetailAddAndUpdate(site, labelFieldAllocationDetail);
|
||||
labelFieldAllocationDetail.setHandle(LabelFieldAllocationDetail.genHandle(handle, labelFieldAllocationDetail.getLabelField()));
|
||||
labelFieldAllocationDetail.setZLabelFieldAllocationBo(handle);
|
||||
labelFieldAllocationDetail.setFieldNumber(labelFieldAllocationDetail.getFieldNumber());
|
||||
labelFieldAllocationDetail.setModifyUser(user);
|
||||
labelFieldAllocationDetail.setModifyDateTime(time);
|
||||
}
|
||||
labelFieldAllocationDetail.setFieldNumber(labelFieldAllocationDetail.getFieldNumber());
|
||||
labelFieldAllocationDetail.setModifyUser(user);
|
||||
labelFieldAllocationDetail.setModifyDateTime(time);
|
||||
}
|
||||
labelFieldAllocationDetailService.saveBatch(labelFieldAllocation.getLabelFieldAllocationDetailList());
|
||||
}
|
||||
return super.updateById(labelFieldAllocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabelFieldAllocation labelNumberInfo(String site, String labelNumber) {
|
||||
String fieldBo = StringUtils.genHandle(HandleBOConstants.LABEL_FIELD_ALLOCATION_BO, site, labelNumber);
|
||||
LabelFieldAllocation labelFieldAllocation;
|
||||
labelFieldAllocation = this.getById(fieldBo);
|
||||
List<LabelFieldAllocationDetail> detailList = labelFieldAllocationMapper.labelNumberInfo(site, fieldBo);
|
||||
if (labelFieldAllocation != null) {
|
||||
labelFieldAllocation.setLabelFieldAllocationDetailList(detailList);
|
||||
}
|
||||
return labelFieldAllocation;
|
||||
}
|
||||
@Override
|
||||
public LabelFieldAllocation labelNumberInfo(String site, String labelNumber) {
|
||||
String fieldBo = StringUtils.genHandle(HandleBOConstants.LABEL_FIELD_ALLOCATION_BO, site, labelNumber);
|
||||
LabelFieldAllocation labelFieldAllocation;
|
||||
labelFieldAllocation = this.getById(fieldBo);
|
||||
List<LabelFieldAllocationDetail> detailList = labelFieldAllocationMapper.labelNumberInfo(site, fieldBo);
|
||||
if (labelFieldAllocation != null) {
|
||||
labelFieldAllocation.setLabelFieldAllocationDetailList(detailList);
|
||||
}
|
||||
return labelFieldAllocation;
|
||||
}
|
||||
|
||||
|
||||
public void validateBeforeAdditionalDetailAddAndUpdate(String site, LabelFieldAllocationDetail labelFieldAllocationDetail){
|
||||
if (StrUtil.isBlank(labelFieldAllocationDetail.getFieldNumber())){
|
||||
throw BusinessException.build("明细项字段编号不能为空");
|
||||
}
|
||||
if (StrUtil.isNotBlank(labelFieldAllocationDetail.getFieldNumber()) && systemFieldService.getById(SystemField.genHandle(site, labelFieldAllocationDetail.getFieldNumber())) == null){
|
||||
throw BusinessException.build("明细项字段编号[" + labelFieldAllocationDetail.getFieldNumber() + "]不存在");
|
||||
}
|
||||
}
|
||||
public void validateBeforeAdditionalDetailAddAndUpdate(String site, LabelFieldAllocationDetail labelFieldAllocationDetail) {
|
||||
if (StrUtil.isBlank(labelFieldAllocationDetail.getFieldNumber())) {
|
||||
throw BusinessException.build("明细项字段编号不能为空");
|
||||
}
|
||||
if (StrUtil.isNotBlank(labelFieldAllocationDetail.getFieldNumber()) && systemFieldService.getById(SystemField.genHandle(site, labelFieldAllocationDetail.getFieldNumber())) == null) {
|
||||
throw BusinessException.build("明细项字段编号[" + labelFieldAllocationDetail.getFieldNumber() + "]不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,63 +26,60 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class PrintLabelTemplateServiceImpl extends ServiceImpl<PrintLabelTemplateMapper, PrintLabelTemplate> implements PrintLabelTemplateService {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(PrintLabelTemplateServiceImpl.class);
|
||||
private final static Logger logger = LoggerFactory.getLogger(PrintLabelTemplateServiceImpl.class);
|
||||
|
||||
private final PrintLabelTemplateMapper printLabelTemplateMapper;
|
||||
private final PrintLabelTemplateMapper printLabelTemplateMapper;
|
||||
|
||||
@Override
|
||||
public PrintLabelTemplate getFullById(String handle) {
|
||||
PrintLabelTemplate printLabelTemplate = getById(handle);
|
||||
if (printLabelTemplate == null) {
|
||||
return null;
|
||||
}
|
||||
return printLabelTemplate;
|
||||
}
|
||||
@Override
|
||||
public PrintLabelTemplate getFullById(String handle) {
|
||||
PrintLabelTemplate printLabelTemplate = getById(handle);
|
||||
return printLabelTemplate;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean validateAndSave(String site, String user, PrintLabelTemplate printLabelTemplate) {
|
||||
String handle = PrintLabelTemplate.genHandle(site, printLabelTemplate.getTemplateCode());
|
||||
validatePrintLabelTemplateExist(handle);
|
||||
printLabelTemplate.setHandle(handle);
|
||||
printLabelTemplate.setSite(site);
|
||||
printLabelTemplate.setCreatedUser(user);
|
||||
printLabelTemplate.setCreatedDateTime(LocalDateTime.now());
|
||||
return save(printLabelTemplate);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean validateAndSave(String site, String user, PrintLabelTemplate printLabelTemplate) {
|
||||
String handle = PrintLabelTemplate.genHandle(site, printLabelTemplate.getTemplateCode());
|
||||
validatePrintLabelTemplateExist(handle);
|
||||
printLabelTemplate.setHandle(handle);
|
||||
printLabelTemplate.setSite(site);
|
||||
printLabelTemplate.setCreatedUser(user);
|
||||
printLabelTemplate.setCreatedDateTime(LocalDateTime.now());
|
||||
return save(printLabelTemplate);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean validateAndUpdate(String site, String user, PrintLabelTemplate printLabelTemplate) {
|
||||
return updateById(printLabelTemplate);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean validateAndUpdate(String site, String user, PrintLabelTemplate printLabelTemplate) {
|
||||
return updateById(printLabelTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeById(java.io.Serializable id) {
|
||||
return super.removeById(id);
|
||||
}
|
||||
@Override
|
||||
public boolean removeById(java.io.Serializable id) {
|
||||
return super.removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前打印标签模板是否存在
|
||||
*
|
||||
* @param handle
|
||||
*/
|
||||
private void validatePrintLabelTemplateExist(String handle) {
|
||||
//存在性校验
|
||||
if (StrUtil.isNotBlank(handle)) {
|
||||
PrintLabelTemplate dbPrintLabelTemplate = printLabelTemplateMapper.selectById(handle);
|
||||
if (dbPrintLabelTemplate != null) {
|
||||
throw BusinessException.build("打印标签模板已经存在,无法新建");
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 判断当前打印标签模板是否存在
|
||||
*
|
||||
* @param handle
|
||||
*/
|
||||
private void validatePrintLabelTemplateExist(String handle) {
|
||||
//存在性校验
|
||||
if (StrUtil.isNotBlank(handle)) {
|
||||
PrintLabelTemplate dbPrintLabelTemplate = printLabelTemplateMapper.selectById(handle);
|
||||
if (dbPrintLabelTemplate != null) {
|
||||
throw BusinessException.build("打印标签模板已经存在,无法新建");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<PrintLabelTemplate> selectList(PrintLabelTemplate printLabelTemplate) {
|
||||
QueryWrapper<PrintLabelTemplate> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(printLabelTemplate);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
@Override
|
||||
public List<PrintLabelTemplate> selectList(PrintLabelTemplate printLabelTemplate) {
|
||||
QueryWrapper<PrintLabelTemplate> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(printLabelTemplate);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -17,8 +17,8 @@ import java.util.Map;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class PrintRuleServiceImpl extends ServiceImpl<PrintRuleMapper, PrintRule> implements PrintRuleService {
|
||||
|
||||
@Autowired
|
||||
private PrintRuleMapper printRuleMapper;
|
||||
@Autowired
|
||||
private PrintRuleMapper printRuleMapper;
|
||||
|
||||
@Override
|
||||
public List<PrintRule> selectList(PrintRule printRule) {
|
||||
@ -30,7 +30,7 @@ public class PrintRuleServiceImpl extends ServiceImpl<PrintRuleMapper, PrintRule
|
||||
@Override
|
||||
public void doSave(List<PrintRule> printRuleList) {
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
for(PrintRule printRule: printRuleList){
|
||||
for (PrintRule printRule : printRuleList) {
|
||||
PrintRule message = new PrintRule();
|
||||
message.setHandle(printRule.getHandle());
|
||||
QueryWrapper<PrintRule> queryWrapper = new QueryWrapper<>();
|
||||
@ -44,15 +44,15 @@ public class PrintRuleServiceImpl extends ServiceImpl<PrintRuleMapper, PrintRule
|
||||
|
||||
@Override
|
||||
public void doDelete(List<PrintRule> printRuleList) {
|
||||
for(PrintRule printRule: printRuleList){
|
||||
for (PrintRule printRule : printRuleList) {
|
||||
QueryWrapper<PrintRule> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(printRule);
|
||||
super.remove(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getLabelCategoryList(String site) {
|
||||
return printRuleMapper.selectLabelCategory(site);
|
||||
}
|
||||
@Override
|
||||
public List<Map<String, String>> getLabelCategoryList(String site) {
|
||||
return printRuleMapper.selectLabelCategory(site);
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,6 @@ import com.foreverwin.nlv.wms.mapper.WmsPrinterMapper;
|
||||
import com.foreverwin.nlv.wms.service.*;
|
||||
import com.foreverwin.nlv.wms.util.StringUtil;
|
||||
import com.foreverwin.nlv.wms.util.StringUtils;
|
||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -7,6 +7,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.iep.common.utils.HandleBoProcessor;
|
||||
import com.foreverwin.iep.prd.entity.Item;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.iep.wms.mapper.WmsInventoryLogMapper;
|
||||
import com.foreverwin.iep.wms.mapper.WmsInventoryMapper;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
@ -14,8 +18,6 @@ import com.foreverwin.nlv.wms.dto.SalesInvoiceDeliveryDto;
|
||||
import com.foreverwin.nlv.wms.entity.*;
|
||||
import com.foreverwin.nlv.wms.mapper.SalesInvoiceDeliveryItemMapper;
|
||||
import com.foreverwin.nlv.wms.mapper.SalesInvoiceDeliveryMapper;
|
||||
import com.foreverwin.nlv.wms.mapper.WmsInventoryLogMapper;
|
||||
import com.foreverwin.nlv.wms.mapper.WmsInventoryMapper;
|
||||
import com.foreverwin.nlv.wms.service.SalesInvoiceDeliveryItemAttachmentService;
|
||||
import com.foreverwin.nlv.wms.service.SalesInvoiceDeliveryService;
|
||||
import com.foreverwin.nlv.wms.service.WmsDocumentSplittingService;
|
||||
|
||||
@ -61,7 +61,7 @@ public class SalesOutInvoiceDeliveryItemServiceImpl extends ServiceImpl<SalesOut
|
||||
|
||||
// 接收信息查看
|
||||
@Override
|
||||
public List<SalesOutInvoiceDeliveryItem> selectReceiveInfoData(String handle,SalesOutInvoiceDeliveryItem dto) {
|
||||
public List<SalesOutInvoiceDeliveryItem> selectReceiveInfoData(String handle, SalesOutInvoiceDeliveryItem dto) {
|
||||
// 如果 handle 为空,则报错
|
||||
if (StringUtils.isBlank(handle)) {
|
||||
throw BusinessException.build("SAP销售退货明细数据主键为空");
|
||||
|
||||
@ -32,10 +32,11 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SalesOutvoiceDeliveryServiceImpl extends ServiceImpl<SalesOutvoiceDeliveryMapper, SalesOutvoiceDelivery> implements SalesOutvoiceDeliveryService {
|
||||
|
||||
|
||||
private final SalesOutvoiceDeliveryItemMapper salesOutvoiceDeliveryItemMapper;
|
||||
|
||||
private final WmsDocumentSplittingService wmsDocumentSplittingService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean saveOrUpdateSalesOutvoiceDelivery(SalesOutvoiceDelivery salesOutvoiceDelivery) {
|
||||
// 根据主键查询是否存在,存在时获取创建时间和删除标识
|
||||
@ -55,6 +56,7 @@ public class SalesOutvoiceDeliveryServiceImpl extends ServiceImpl<SalesOutvoiceD
|
||||
|
||||
return super.saveOrUpdate(salesOutvoiceDelivery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getSalesOutvoiceDeliveryPage(Page page, SalesOutvoiceDelivery dto) {
|
||||
return this.baseMapper.getSalesOutvoiceDeliveryPage(page, dto);
|
||||
|
||||
@ -26,104 +26,99 @@ import java.util.Date;
|
||||
@Service
|
||||
public class SalseBatchGenServiceImpl extends ServiceImpl<SalseBatchGenMapper, SalseBatchGen> implements SalseBatchGenService {
|
||||
|
||||
SalseBatchGen getByNumberTypeForUpdate(String site, String nextNumberType) {
|
||||
LambdaQueryWrapper<SalseBatchGen> queryWrapper = new LambdaQueryWrapper<>();
|
||||
SalseBatchGen salseBatchGen = this.getOne(queryWrapper
|
||||
.eq(SalseBatchGen::getSite, site)
|
||||
.eq(SalseBatchGen::getNextNumberType, nextNumberType)
|
||||
.last("for update"), false);
|
||||
return salseBatchGen;
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public BigDecimal genNextNumber(String site, String nextNumberType, Date nowDate) {
|
||||
BigDecimal[] salesBatchSeqRange = getSalesBatchSeqRange(site);
|
||||
BigDecimal lower = salesBatchSeqRange[0], upper = salesBatchSeqRange[1];
|
||||
BigDecimal seq = lower;
|
||||
SalseBatchGen salseBatchGen = this.getByNumberTypeForUpdate(site, nextNumberType);
|
||||
if(nowDate == null) {
|
||||
nowDate = new Date();
|
||||
}
|
||||
if(salseBatchGen == null) {
|
||||
salseBatchGen = new SalseBatchGen();
|
||||
salseBatchGen.setSite(StrUtil.uuid());
|
||||
salseBatchGen.setSite(site);
|
||||
salseBatchGen.setNextNumberType(nextNumberType);
|
||||
salseBatchGen.setCurrentSequence(seq);
|
||||
salseBatchGen.setCreatedDateTime(nowDate);
|
||||
salseBatchGen.setModifiedDateTime(nowDate);
|
||||
this.save(salseBatchGen);
|
||||
} else {
|
||||
// 是否需要重置序列号
|
||||
if(!this.shouldResetOccur(salseBatchGen, nowDate)) {
|
||||
// 不需要重置的情况下再原来的基础上增加
|
||||
BigDecimal currentSeq = salseBatchGen.getCurrentSequence();
|
||||
if(currentSeq.compareTo(upper) >= 0) {
|
||||
throw BusinessException.build("销售批次编号规则[" + nextNumberType +"]序号超出最大值[" + upper.toPlainString() +"]");
|
||||
}
|
||||
// 以9结尾则+2,跳过0
|
||||
if(currentSeq.stripTrailingZeros().toPlainString().endsWith("9")) {
|
||||
seq = currentSeq.add(BigDecimal.valueOf(2));
|
||||
} else {
|
||||
seq = currentSeq.add(BigDecimal.ONE);
|
||||
}
|
||||
salseBatchGen.setCurrentSequence(seq);
|
||||
} else {
|
||||
salseBatchGen.setCurrentSequence(lower);
|
||||
}
|
||||
salseBatchGen.setModifiedDateTime(nowDate);
|
||||
salseBatchGen.setChangeStamp(nowDate.getTime() + "");
|
||||
this.updateById(salseBatchGen);
|
||||
}
|
||||
return seq;
|
||||
}
|
||||
SalseBatchGen getByNumberTypeForUpdate(String site, String nextNumberType) {
|
||||
LambdaQueryWrapper<SalseBatchGen> queryWrapper = new LambdaQueryWrapper<>();
|
||||
SalseBatchGen salseBatchGen = this.getOne(queryWrapper
|
||||
.eq(SalseBatchGen::getSite, site)
|
||||
.eq(SalseBatchGen::getNextNumberType, nextNumberType)
|
||||
.last("for update"), false);
|
||||
return salseBatchGen;
|
||||
}
|
||||
|
||||
private BigDecimal[] getSalesBatchSeqRange(String site) {
|
||||
switch (site) {
|
||||
case "1301":
|
||||
return new BigDecimal[]{BigDecimal.valueOf(1),BigDecimal.valueOf(19)};
|
||||
case "1601":
|
||||
return new BigDecimal[]{BigDecimal.valueOf(21),BigDecimal.valueOf(39)};
|
||||
default:
|
||||
throw BusinessException.build("未定义工厂" + site + "对应的出货批次序流水号范围");
|
||||
}
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public BigDecimal genNextNumber(String site, String nextNumberType, Date nowDate) {
|
||||
BigDecimal[] salesBatchSeqRange = getSalesBatchSeqRange(site);
|
||||
BigDecimal lower = salesBatchSeqRange[0], upper = salesBatchSeqRange[1];
|
||||
BigDecimal seq = lower;
|
||||
SalseBatchGen salseBatchGen = this.getByNumberTypeForUpdate(site, nextNumberType);
|
||||
if (nowDate == null) {
|
||||
nowDate = new Date();
|
||||
}
|
||||
if (salseBatchGen == null) {
|
||||
salseBatchGen = new SalseBatchGen();
|
||||
salseBatchGen.setSite(StrUtil.uuid());
|
||||
salseBatchGen.setSite(site);
|
||||
salseBatchGen.setNextNumberType(nextNumberType);
|
||||
salseBatchGen.setCurrentSequence(seq);
|
||||
salseBatchGen.setCreatedDateTime(nowDate);
|
||||
salseBatchGen.setModifiedDateTime(nowDate);
|
||||
this.save(salseBatchGen);
|
||||
} else {
|
||||
// 是否需要重置序列号
|
||||
if (!this.shouldResetOccur(salseBatchGen, nowDate)) {
|
||||
// 不需要重置的情况下再原来的基础上增加
|
||||
BigDecimal currentSeq = salseBatchGen.getCurrentSequence();
|
||||
if (currentSeq.compareTo(upper) >= 0) {
|
||||
throw BusinessException.build("销售批次编号规则[" + nextNumberType + "]序号超出最大值[" + upper.toPlainString() + "]");
|
||||
}
|
||||
// 以9结尾则+2,跳过0
|
||||
if (currentSeq.stripTrailingZeros().toPlainString().endsWith("9")) {
|
||||
seq = currentSeq.add(BigDecimal.valueOf(2));
|
||||
} else {
|
||||
seq = currentSeq.add(BigDecimal.ONE);
|
||||
}
|
||||
salseBatchGen.setCurrentSequence(seq);
|
||||
} else {
|
||||
salseBatchGen.setCurrentSequence(lower);
|
||||
}
|
||||
salseBatchGen.setModifiedDateTime(nowDate);
|
||||
salseBatchGen.setChangeStamp(nowDate.getTime() + "");
|
||||
this.updateById(salseBatchGen);
|
||||
}
|
||||
return seq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否需要重置序号
|
||||
*
|
||||
* @param salseBatchGen
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
*/
|
||||
protected boolean shouldResetOccur(SalseBatchGen salseBatchGen, Date currentDT) throws BusinessException {
|
||||
private BigDecimal[] getSalesBatchSeqRange(String site) {
|
||||
switch (site) {
|
||||
case "1301":
|
||||
return new BigDecimal[]{BigDecimal.valueOf(1), BigDecimal.valueOf(19)};
|
||||
case "1601":
|
||||
return new BigDecimal[]{BigDecimal.valueOf(21), BigDecimal.valueOf(39)};
|
||||
default:
|
||||
throw BusinessException.build("未定义工厂" + site + "对应的出货批次序流水号范围");
|
||||
}
|
||||
}
|
||||
|
||||
if (salseBatchGen == null) {
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* 是否需要重置序号
|
||||
*
|
||||
* @param salseBatchGen
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
*/
|
||||
protected boolean shouldResetOccur(SalseBatchGen salseBatchGen, Date currentDT) throws BusinessException {
|
||||
|
||||
String changeStampStr = salseBatchGen.getChangeStamp();
|
||||
Date lastUpdateDT;
|
||||
if (salseBatchGen == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!StringUtils.isBlank(changeStampStr)) {
|
||||
lastUpdateDT = new Date(Long.parseLong(changeStampStr));
|
||||
} else {
|
||||
lastUpdateDT = salseBatchGen.getModifiedDateTime();
|
||||
}
|
||||
String changeStampStr = salseBatchGen.getChangeStamp();
|
||||
Date lastUpdateDT;
|
||||
|
||||
log.debug(new StringBuilder().append("lastUpdate: ").append(lastUpdateDT).toString());
|
||||
if (!StringUtils.isBlank(changeStampStr)) {
|
||||
lastUpdateDT = new Date(Long.parseLong(changeStampStr));
|
||||
} else {
|
||||
lastUpdateDT = salseBatchGen.getModifiedDateTime();
|
||||
}
|
||||
|
||||
if (shouldResetOccur(lastUpdateDT, currentDT)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
log.debug("lastUpdate: " + lastUpdateDT);
|
||||
|
||||
public boolean shouldResetOccur(Date lastUpdateDT, Date currentDT) {
|
||||
return shouldResetOccur(lastUpdateDT, currentDT);
|
||||
}
|
||||
|
||||
if (!DateUtil.sameDate(lastUpdateDT, currentDT)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean shouldResetOccur(Date lastUpdateDT, Date currentDT) {
|
||||
|
||||
return !DateUtil.sameDate(lastUpdateDT, currentDT);
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,86 +31,86 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class ShelfManagementServiceImpl implements ShelfManagementService {
|
||||
|
||||
private final WmsStorageLocationService storageLocationService;
|
||||
private final WmsStorageLocationService storageLocationService;
|
||||
|
||||
private final WmsStorageBinService storageBinService;
|
||||
private final WmsStorageBinService storageBinService;
|
||||
|
||||
private final WmsStorageLocationMapper storageLocationMapper;
|
||||
private final WmsStorageLocationMapper storageLocationMapper;
|
||||
|
||||
@Override
|
||||
public IPage fetchErpStorageLocationList(Page page, String searchText, String site) {
|
||||
QueryWrapper<StorageLocation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("DISTINCT ERP_STORAGE_LOCATION");
|
||||
queryWrapper.eq("SITE", site);
|
||||
if (StrUtil.isNotBlank(searchText)) {
|
||||
queryWrapper.eq("ERP_STORAGE_LOCATION", searchText);
|
||||
}
|
||||
return storageLocationService.page(page, queryWrapper);
|
||||
}
|
||||
@Override
|
||||
public IPage fetchErpStorageLocationList(Page page, String searchText, String site) {
|
||||
QueryWrapper<StorageLocation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("DISTINCT ERP_STORAGE_LOCATION");
|
||||
queryWrapper.eq("SITE", site);
|
||||
if (StrUtil.isNotBlank(searchText)) {
|
||||
queryWrapper.eq("ERP_STORAGE_LOCATION", searchText);
|
||||
}
|
||||
return storageLocationService.page(page, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage fetchStorageLocationList(Page page, String searchText, String site, String erpStorageLocation) {
|
||||
QueryWrapper<StorageLocation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("DISTINCT STORAGE_LOCATION,DESCRIPTION");
|
||||
queryWrapper.eq("SITE", site);
|
||||
queryWrapper.eq("ERP_STORAGE_LOCATION", erpStorageLocation);
|
||||
if (StrUtil.isNotBlank(searchText)) {
|
||||
queryWrapper.eq("STORAGE_LOCATION", searchText);
|
||||
}
|
||||
return storageLocationService.page(page, queryWrapper);
|
||||
}
|
||||
@Override
|
||||
public IPage fetchStorageLocationList(Page page, String searchText, String site, String erpStorageLocation) {
|
||||
QueryWrapper<StorageLocation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("DISTINCT STORAGE_LOCATION,DESCRIPTION");
|
||||
queryWrapper.eq("SITE", site);
|
||||
queryWrapper.eq("ERP_STORAGE_LOCATION", erpStorageLocation);
|
||||
if (StrUtil.isNotBlank(searchText)) {
|
||||
queryWrapper.eq("STORAGE_LOCATION", searchText);
|
||||
}
|
||||
return storageLocationService.page(page, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage fetchStorageBinList(Page page, String searchText, String site, String storageLocation) {
|
||||
QueryWrapper<WmsStorageBin> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("DISTINCT STORAGE_BIN,DESCRIPTION");
|
||||
queryWrapper.eq("SITE", site);
|
||||
queryWrapper.eq("STORAGE_LOCATION_BO", StorageLocation.genHandle(site, storageLocation));
|
||||
if (StrUtil.isNotBlank(searchText)) {
|
||||
queryWrapper.eq("STORAGE_BIN", searchText);
|
||||
}
|
||||
return storageBinService.page(page, queryWrapper);
|
||||
}
|
||||
@Override
|
||||
public IPage fetchStorageBinList(Page page, String searchText, String site, String storageLocation) {
|
||||
QueryWrapper<WmsStorageBin> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("DISTINCT STORAGE_BIN,DESCRIPTION");
|
||||
queryWrapper.eq("SITE", site);
|
||||
queryWrapper.eq("STORAGE_LOCATION_BO", StorageLocation.genHandle(site, storageLocation));
|
||||
if (StrUtil.isNotBlank(searchText)) {
|
||||
queryWrapper.eq("STORAGE_BIN", searchText);
|
||||
}
|
||||
return storageBinService.page(page, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getStorageLocationData(Page page, String erpStorageLocation, Collection<String> storageLocationList) {
|
||||
return storageLocationMapper.getStorageLocationData(page, TenantContextHolder.getTenantId(), erpStorageLocation, storageLocationList);
|
||||
}
|
||||
@Override
|
||||
public IPage getStorageLocationData(Page page, String erpStorageLocation, Collection<String> storageLocationList) {
|
||||
return storageLocationMapper.getStorageLocationData(page, TenantContextHolder.getTenantId(), erpStorageLocation, storageLocationList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getStorageBinData(Page page, Collection<String> storageLocationList, String storageBin, String used, String isDefault) {
|
||||
if (StrUtil.isBlank(storageBin)) {
|
||||
storageBin = null;
|
||||
}
|
||||
if (StrUtil.isBlank(used)) {
|
||||
used = null;
|
||||
}
|
||||
if (StrUtil.isBlank(isDefault)) {
|
||||
isDefault = null;
|
||||
}
|
||||
return storageLocationMapper.getStorageBinData(page, TenantContextHolder.getTenantId(), storageLocationList, storageBin, used, isDefault);
|
||||
}
|
||||
@Override
|
||||
public IPage getStorageBinData(Page page, Collection<String> storageLocationList, String storageBin, String used, String isDefault) {
|
||||
if (StrUtil.isBlank(storageBin)) {
|
||||
storageBin = null;
|
||||
}
|
||||
if (StrUtil.isBlank(used)) {
|
||||
used = null;
|
||||
}
|
||||
if (StrUtil.isBlank(isDefault)) {
|
||||
isDefault = null;
|
||||
}
|
||||
return storageLocationMapper.getStorageBinData(page, TenantContextHolder.getTenantId(), storageLocationList, storageBin, used, isDefault);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportExcel(String type, String erpStorageLocation, Collection<String> storageLocationList, String storageBin, String used, String isDefault) throws IOException {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
@Override
|
||||
public void exportExcel(String type, String erpStorageLocation, Collection<String> storageLocationList, String storageBin, String used, String isDefault) throws IOException {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = attributes.getResponse();
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + System.currentTimeMillis() + ".xlsx");
|
||||
|
||||
|
||||
List<ShelfManagementDto> main = storageLocationMapper.getStorageLocationData(site, erpStorageLocation, storageLocationList);
|
||||
List<ShelfManagementDetailedDto> detail = storageLocationMapper.getStorageBinData(site, storageLocationList, storageBin, used, isDefault);
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build();
|
||||
WriteSheet mainSheet = EasyExcel.writerSheet("货格管理").head(ShelfManagementDto.class).registerWriteHandler(widthStyleStrategy).build();
|
||||
excelWriter.write(main, mainSheet);
|
||||
WriteSheet boxSheet = EasyExcel.writerSheet("货格管理明细").head(ShelfManagementDetailedDto.class).registerWriteHandler(widthStyleStrategy).build();
|
||||
excelWriter.write(detail, boxSheet);
|
||||
excelWriter.finish();
|
||||
List<ShelfManagementDto> main = storageLocationMapper.getStorageLocationData(site, erpStorageLocation, storageLocationList);
|
||||
List<ShelfManagementDetailedDto> detail = storageLocationMapper.getStorageBinData(site, storageLocationList, storageBin, used, isDefault);
|
||||
ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy();
|
||||
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build();
|
||||
WriteSheet mainSheet = EasyExcel.writerSheet("货格管理").head(ShelfManagementDto.class).registerWriteHandler(widthStyleStrategy).build();
|
||||
excelWriter.write(main, mainSheet);
|
||||
WriteSheet boxSheet = EasyExcel.writerSheet("货格管理明细").head(ShelfManagementDetailedDto.class).registerWriteHandler(widthStyleStrategy).build();
|
||||
excelWriter.write(detail, boxSheet);
|
||||
excelWriter.finish();
|
||||
/*if ("1".equals(type)) {
|
||||
if (StrUtil.isBlank(erpStorageLocation)) {
|
||||
throw BusinessException.build("ERP仓库不能为空");
|
||||
@ -143,5 +143,5 @@ public class ShelfManagementServiceImpl implements ShelfManagementService {
|
||||
} else {
|
||||
throw BusinessException.build("没有需要导出的数据");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ public class StockOrderServiceImpl extends ServiceImpl<StockOrderMapper, StockOr
|
||||
try {
|
||||
return super.save(stockOrder);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("系统中已存在指定的值:[" + e.getCause().getLocalizedMessage() + "]");
|
||||
} else {
|
||||
throw e;
|
||||
@ -46,7 +46,7 @@ public class StockOrderServiceImpl extends ServiceImpl<StockOrderMapper, StockOr
|
||||
public boolean updateById(String site, StockOrder stockOrder) {
|
||||
|
||||
String handle = stockOrder.getHandle();
|
||||
if(StrUtil.isBlank(handle)) {
|
||||
if (StrUtil.isBlank(handle)) {
|
||||
throw BusinessException.build("handle不能为空");
|
||||
}
|
||||
return super.updateById(stockOrder);
|
||||
|
||||
@ -31,60 +31,60 @@ import java.time.LocalDateTime;
|
||||
@Service
|
||||
public class StorageBinTypeServiceImpl extends ServiceImpl<StorageBinTypeMapper, StorageBinType> implements StorageBinTypeService {
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WmsStorageBinService storageBinService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WmsStorageBinService storageBinService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean save(StorageBinType storageBinType) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isBlank(storageBinType.getStorageBinType())){
|
||||
throw BusinessException.build("存储货格类型不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(storageBinType.getStorageBinType())){
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = StorageBinType.genHandle(site, storageBinType.getStorageBinType());
|
||||
storageBinType.setHandle(handle);
|
||||
storageBinType.setSite(site);
|
||||
storageBinType.setCreateTime(localDateTime);
|
||||
storageBinType.setCreator(user);
|
||||
try {
|
||||
return super.save(storageBinType);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此存储货格类型已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean save(StorageBinType storageBinType) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isBlank(storageBinType.getStorageBinType())) {
|
||||
throw BusinessException.build("存储货格类型不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(storageBinType.getStorageBinType())) {
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = StorageBinType.genHandle(site, storageBinType.getStorageBinType());
|
||||
storageBinType.setHandle(handle);
|
||||
storageBinType.setSite(site);
|
||||
storageBinType.setCreateTime(localDateTime);
|
||||
storageBinType.setCreator(user);
|
||||
try {
|
||||
return super.save(storageBinType);
|
||||
} catch (Exception e) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此存储货格类型已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateById(StorageBinType storageBinType) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
storageBinType.setUpdateTime(localDateTime);
|
||||
storageBinType.setUpdater(user);
|
||||
return super.updateById(storageBinType);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateById(StorageBinType storageBinType) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
storageBinType.setUpdateTime(localDateTime);
|
||||
storageBinType.setUpdater(user);
|
||||
return super.updateById(storageBinType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeById(String handle) {
|
||||
LambdaQueryWrapper<WmsStorageBin> queryWrapper = new LambdaQueryWrapper<WmsStorageBin>().eq(WmsStorageBin::getStorageBinTypeBo,handle);
|
||||
WmsStorageBin one = storageBinService.getOne(queryWrapper, false);
|
||||
if (one != null){
|
||||
throw BusinessException.build("此类型正在被使用,不可删除");
|
||||
}
|
||||
return super.removeById(handle);
|
||||
}
|
||||
@Override
|
||||
public boolean removeById(String handle) {
|
||||
LambdaQueryWrapper<WmsStorageBin> queryWrapper = new LambdaQueryWrapper<WmsStorageBin>().eq(WmsStorageBin::getStorageBinTypeBo, handle);
|
||||
WmsStorageBin one = storageBinService.getOne(queryWrapper, false);
|
||||
if (one != null) {
|
||||
throw BusinessException.build("此类型正在被使用,不可删除");
|
||||
}
|
||||
return super.removeById(handle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,61 +31,61 @@ import java.time.LocalDateTime;
|
||||
@Service
|
||||
public class StorageLocationTypeServiceImpl extends ServiceImpl<StorageLocationTypeMapper, StorageLocationType> implements StorageLocationTypeService {
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WmsStorageLocationService storageLocationService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WmsStorageLocationService storageLocationService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean save(StorageLocationType storageLocationType) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
//拼接主键
|
||||
if (StrUtil.isBlank(storageLocationType.getStorageLocationType())){
|
||||
throw BusinessException.build("存储位置类型不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(storageLocationType.getStorageLocationType())){
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = StorageLocationType.genHandle(site, storageLocationType.getStorageLocationType());
|
||||
storageLocationType.setHandle(handle);
|
||||
storageLocationType.setSite(site);
|
||||
storageLocationType.setCreator(user);
|
||||
storageLocationType.setCreateTime(localDateTime);
|
||||
try {
|
||||
return super.save(storageLocationType);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此存储位置类型已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean save(StorageLocationType storageLocationType) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
//拼接主键
|
||||
if (StrUtil.isBlank(storageLocationType.getStorageLocationType())) {
|
||||
throw BusinessException.build("存储位置类型不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(storageLocationType.getStorageLocationType())) {
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = StorageLocationType.genHandle(site, storageLocationType.getStorageLocationType());
|
||||
storageLocationType.setHandle(handle);
|
||||
storageLocationType.setSite(site);
|
||||
storageLocationType.setCreator(user);
|
||||
storageLocationType.setCreateTime(localDateTime);
|
||||
try {
|
||||
return super.save(storageLocationType);
|
||||
} catch (Exception e) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此存储位置类型已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateById(StorageLocationType storageLocationType) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
storageLocationType.setUpdater(user);
|
||||
storageLocationType.setUpdateTime(localDateTime);
|
||||
return false;
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateById(StorageLocationType storageLocationType) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
storageLocationType.setUpdater(user);
|
||||
storageLocationType.setUpdateTime(localDateTime);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeById(String handle) {
|
||||
//查询此存储位置类型是否被使用
|
||||
LambdaQueryWrapper<StorageLocation> queryWrapper = new LambdaQueryWrapper<StorageLocation>().eq(StorageLocation::getStorageLocationTypeBo,handle);
|
||||
StorageLocation one = storageLocationService.getOne(queryWrapper, false);
|
||||
if (one != null){
|
||||
throw BusinessException.build("此类型已被使用,不可删除");
|
||||
}
|
||||
return super.removeById(handle);
|
||||
}
|
||||
@Override
|
||||
public boolean removeById(String handle) {
|
||||
//查询此存储位置类型是否被使用
|
||||
LambdaQueryWrapper<StorageLocation> queryWrapper = new LambdaQueryWrapper<StorageLocation>().eq(StorageLocation::getStorageLocationTypeBo, handle);
|
||||
StorageLocation one = storageLocationService.getOne(queryWrapper, false);
|
||||
if (one != null) {
|
||||
throw BusinessException.build("此类型已被使用,不可删除");
|
||||
}
|
||||
return super.removeById(handle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,36 +21,36 @@ import java.util.List;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements SysConfigService {
|
||||
|
||||
@Autowired
|
||||
private SysConfigMapper sysConfigMapper;
|
||||
@Autowired
|
||||
private SysConfigMapper sysConfigMapper;
|
||||
|
||||
@Override
|
||||
public SysConfig getConfig(SysConfig sysConfig) {
|
||||
return sysConfigMapper.getConfig(sysConfig);
|
||||
}
|
||||
@Override
|
||||
public SysConfig getConfig(SysConfig sysConfig) {
|
||||
return sysConfigMapper.getConfig(sysConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<SysConfig> getAll() {
|
||||
return sysConfigMapper.getAll();
|
||||
}
|
||||
@Override
|
||||
public ArrayList<SysConfig> getAll() {
|
||||
return sysConfigMapper.getAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateChoice(List<SysConfig> sysConfigList) {
|
||||
int count = 0;
|
||||
for (int i = 0; i < sysConfigList.size(); i++){
|
||||
int j = sysConfigMapper.updateOne(sysConfigList.get(i));
|
||||
if (j > 0) count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
@Override
|
||||
public int updateChoice(List<SysConfig> sysConfigList) {
|
||||
int count = 0;
|
||||
for (int i = 0; i < sysConfigList.size(); i++) {
|
||||
int j = sysConfigMapper.updateOne(sysConfigList.get(i));
|
||||
if (j > 0) count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteChoice(List<SysConfig> configs) {
|
||||
int count = 0;
|
||||
for(int i = 0; i < configs.size(); i++){
|
||||
int j = sysConfigMapper.deleteChoice(configs.get(i));
|
||||
if (j > 0)count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
@Override
|
||||
public int deleteChoice(List<SysConfig> configs) {
|
||||
int count = 0;
|
||||
for (int i = 0; i < configs.size(); i++) {
|
||||
int j = sysConfigMapper.deleteChoice(configs.get(i));
|
||||
if (j > 0) count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,19 +45,17 @@ import java.util.regex.Pattern;
|
||||
@AllArgsConstructor
|
||||
public class SystemFieldServiceImpl extends ServiceImpl<SystemFieldMapper, SystemField> implements SystemFieldService {
|
||||
|
||||
private final FieldsCustomLogicService fieldsCustomLogicService;
|
||||
private final FieldsCustomLogicService fieldsCustomLogicService;
|
||||
|
||||
private final SystemFieldMapper systemFieldMapper;
|
||||
private final SystemFieldMapper systemFieldMapper;
|
||||
|
||||
@Override
|
||||
public SystemField getByCode(String site, String code) {
|
||||
|
||||
SystemField systemField = getById(SystemField.genHandle(site, code));
|
||||
if(systemField == null) {
|
||||
return null;
|
||||
}
|
||||
return systemField;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByCode(String site, String code) {
|
||||
|
||||
@ -76,7 +74,7 @@ public class SystemFieldServiceImpl extends ServiceImpl<SystemFieldMapper, Syste
|
||||
try {
|
||||
return super.save(systemField);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("系统中已存在指定的值:[" + e.getCause().getLocalizedMessage() + "]");
|
||||
} else {
|
||||
throw e;
|
||||
@ -89,200 +87,198 @@ public class SystemFieldServiceImpl extends ServiceImpl<SystemFieldMapper, Syste
|
||||
public boolean updateById(String site, String updater, SystemField systemField) {
|
||||
|
||||
String handle = systemField.getHandle();
|
||||
if(StrUtil.isBlank(handle)) {
|
||||
if (StrUtil.isBlank(handle)) {
|
||||
throw BusinessException.build("handle不能为空");
|
||||
}
|
||||
return super.updateById(systemField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SystemField getFieldData(String site, String fieldNumber) {
|
||||
if (StrUtil.isBlank(fieldNumber)) {
|
||||
throw BusinessException.build("field number should not be null");
|
||||
}
|
||||
return this.getById(SystemField.genHandle(site, fieldNumber));
|
||||
}
|
||||
@Override
|
||||
public SystemField getFieldData(String site, String fieldNumber) {
|
||||
if (StrUtil.isBlank(fieldNumber)) {
|
||||
throw BusinessException.build("field number should not be null");
|
||||
}
|
||||
return this.getById(SystemField.genHandle(site, fieldNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统字段的实际值
|
||||
* @param site
|
||||
* @param fieldNumber
|
||||
* @param baseData
|
||||
* @return
|
||||
*/
|
||||
@Transactional(propagation = Propagation.SUPPORTS)
|
||||
@Override
|
||||
public List<String> getSystemFieldValue(String site, String fieldNumber, Map<String, Object> baseData) {
|
||||
return getSystemFieldValue(site, fieldNumber, null, baseData);
|
||||
}
|
||||
/**
|
||||
* 获取系统字段的实际值
|
||||
*
|
||||
* @param site
|
||||
* @param fieldNumber
|
||||
* @param baseData
|
||||
* @return
|
||||
*/
|
||||
@Transactional(propagation = Propagation.SUPPORTS)
|
||||
@Override
|
||||
public List<String> getSystemFieldValue(String site, String fieldNumber, Map<String, Object> baseData) {
|
||||
return getSystemFieldValue(site, fieldNumber, null, baseData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统字段的实际值(缓存预处理)
|
||||
* @param site
|
||||
* @param fieldNumber
|
||||
* @param systemFieldMap
|
||||
* @param baseData
|
||||
* @return
|
||||
*/
|
||||
@Transactional(propagation = Propagation.SUPPORTS)
|
||||
@Override
|
||||
public List<String> getSystemFieldValue(String site, String fieldNumber, Map<String, SystemField> systemFieldMap, Map<String, Object> baseData) {
|
||||
try {
|
||||
long current = System.currentTimeMillis();
|
||||
long current1 = System.currentTimeMillis();
|
||||
SystemField systemField;
|
||||
if(systemFieldMap != null && systemFieldMap.size() > 0) {
|
||||
systemField = systemFieldMap.get(fieldNumber);
|
||||
} else {
|
||||
systemField = getFieldData(site, fieldNumber);
|
||||
}
|
||||
/**
|
||||
* 获取系统字段的实际值(缓存预处理)
|
||||
*
|
||||
* @param site
|
||||
* @param fieldNumber
|
||||
* @param systemFieldMap
|
||||
* @param baseData
|
||||
* @return
|
||||
*/
|
||||
@Transactional(propagation = Propagation.SUPPORTS)
|
||||
@Override
|
||||
public List<String> getSystemFieldValue(String site, String fieldNumber, Map<String, SystemField> systemFieldMap, Map<String, Object> baseData) {
|
||||
try {
|
||||
long current = System.currentTimeMillis();
|
||||
long current1 = System.currentTimeMillis();
|
||||
SystemField systemField;
|
||||
if (systemFieldMap != null && systemFieldMap.size() > 0) {
|
||||
systemField = systemFieldMap.get(fieldNumber);
|
||||
} else {
|
||||
systemField = getFieldData(site, fieldNumber);
|
||||
}
|
||||
|
||||
System.out.println("get system field data:" + (System.currentTimeMillis() - current));
|
||||
String type = systemField.getType();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
baseData.put("site", site);
|
||||
baseData.put("dateTime", DateUtil.format(now, "yyyy-MM-dd hh:mm:ss"));
|
||||
String context = StringUtil.isEmpty(systemField.getGetValueContext())? "" : systemField.getGetValueContext();
|
||||
// key值转换成驼峰标识
|
||||
Map<String, Object> camelCaseMap = new HashMap<>();
|
||||
ArrayUtil.transferKeyToUnderline(baseData, camelCaseMap, new HashSet<>());
|
||||
System.out.println("transfer key to underline:" + (System.currentTimeMillis() - current));
|
||||
List<String> resultList = new ArrayList<>();
|
||||
System.out.println("get system field data:" + (System.currentTimeMillis() - current));
|
||||
String type = systemField.getType();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
baseData.put("site", site);
|
||||
baseData.put("dateTime", DateUtil.format(now, "yyyy-MM-dd hh:mm:ss"));
|
||||
String context = StringUtil.isEmpty(systemField.getGetValueContext()) ? "" : systemField.getGetValueContext();
|
||||
// key值转换成驼峰标识
|
||||
Map<String, Object> camelCaseMap = new HashMap<>();
|
||||
ArrayUtil.transferKeyToUnderline(baseData, camelCaseMap, new HashSet<>());
|
||||
System.out.println("transfer key to underline:" + (System.currentTimeMillis() - current));
|
||||
List<String> resultList = new ArrayList<>();
|
||||
|
||||
if ("sql".equals(type)) { // SQL
|
||||
//参数替换
|
||||
current = System.currentTimeMillis();
|
||||
if (camelCaseMap != null) {
|
||||
for (Map.Entry<String, Object> entry : camelCaseMap.entrySet()) {
|
||||
context = context.replace("${" + entry.getKey() + "}", "" + entry.getValue() + "");
|
||||
}
|
||||
}
|
||||
List<Map<String, Object>> list = systemFieldMapper.executeSqlQuery(context);
|
||||
for (Map<String, Object> map1 : list) {
|
||||
String fieldValue = map1.get(fieldNumber) == null ? "" : map1.get(fieldNumber).toString();
|
||||
resultList.add(fieldValue);
|
||||
}
|
||||
System.out.println("sql field time:" + (System.currentTimeMillis() - current));
|
||||
}
|
||||
if ("pattern".equals(type)) { // JSON PATH
|
||||
current = System.currentTimeMillis();
|
||||
String json = JSONObject.toJSONString(camelCaseMap);
|
||||
Object temp;
|
||||
try {
|
||||
//为了解决包装标签中设置了34个Field,而实际baseData中可能只有其中一部分
|
||||
//其他没有的,程式在此自动赋固定值 FIELD_EMPTY
|
||||
if(context.substring(2).indexOf("Field")>-1)
|
||||
{
|
||||
if(json.indexOf(context.substring(2))>-1)
|
||||
{
|
||||
temp = JsonPath.read(json, context);
|
||||
}else
|
||||
{
|
||||
temp="FIELD_EMPTY";
|
||||
}
|
||||
}else {
|
||||
if ("sql".equals(type)) { // SQL
|
||||
//参数替换
|
||||
current = System.currentTimeMillis();
|
||||
if (camelCaseMap != null) {
|
||||
for (Map.Entry<String, Object> entry : camelCaseMap.entrySet()) {
|
||||
context = context.replace("${" + entry.getKey() + "}", "" + entry.getValue());
|
||||
}
|
||||
}
|
||||
List<Map<String, Object>> list = systemFieldMapper.executeSqlQuery(context);
|
||||
for (Map<String, Object> map1 : list) {
|
||||
String fieldValue = map1.get(fieldNumber) == null ? "" : map1.get(fieldNumber).toString();
|
||||
resultList.add(fieldValue);
|
||||
}
|
||||
System.out.println("sql field time:" + (System.currentTimeMillis() - current));
|
||||
}
|
||||
if ("pattern".equals(type)) { // JSON PATH
|
||||
current = System.currentTimeMillis();
|
||||
String json = JSONObject.toJSONString(camelCaseMap);
|
||||
Object temp;
|
||||
try {
|
||||
//为了解决包装标签中设置了34个Field,而实际baseData中可能只有其中一部分
|
||||
//其他没有的,程式在此自动赋固定值 FIELD_EMPTY
|
||||
if (context.substring(2).indexOf("Field") > -1) {
|
||||
if (json.indexOf(context.substring(2)) > -1) {
|
||||
temp = JsonPath.read(json, context);
|
||||
} else {
|
||||
temp = "FIELD_EMPTY";
|
||||
}
|
||||
} else {
|
||||
|
||||
temp = JsonPath.read(json, context);
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw BusinessException.build("系统定义字段[" + fieldNumber + "]解析错误"+e.getMessage());
|
||||
}
|
||||
if (temp != null && temp instanceof net.minidev.json.JSONArray) {
|
||||
net.minidev.json.JSONArray arrValue = (net.minidev.json.JSONArray) temp;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
arrValue.forEach(a -> {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(a);
|
||||
});
|
||||
resultList.add(sb.toString());
|
||||
} else {
|
||||
resultList.add(String.valueOf(temp));
|
||||
}
|
||||
System.out.println("json path field time:" + (System.currentTimeMillis() - current));
|
||||
}
|
||||
if ("3".equals(type)) {
|
||||
// 固定值
|
||||
// 返回context
|
||||
//固定值传EMPTY代表空字串;转成3_EMPTY方便上层方法处理
|
||||
if("EMPTY".equals(context))
|
||||
{
|
||||
temp = JsonPath.read(json, context);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.build("系统定义字段[" + fieldNumber + "]解析错误" + e.getMessage());
|
||||
}
|
||||
if (temp != null && temp instanceof net.minidev.json.JSONArray) {
|
||||
net.minidev.json.JSONArray arrValue = (net.minidev.json.JSONArray) temp;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
arrValue.forEach(a -> {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(a);
|
||||
});
|
||||
resultList.add(sb.toString());
|
||||
} else {
|
||||
resultList.add(String.valueOf(temp));
|
||||
}
|
||||
System.out.println("json path field time:" + (System.currentTimeMillis() - current));
|
||||
}
|
||||
if ("3".equals(type)) {
|
||||
// 固定值
|
||||
// 返回context
|
||||
//固定值传EMPTY代表空字串;转成3_EMPTY方便上层方法处理
|
||||
if ("EMPTY".equals(context)) {
|
||||
// context="3_EMPTY";
|
||||
context="N_EMPTY";
|
||||
}
|
||||
resultList.add(context);
|
||||
}
|
||||
if ("script".equals(type)) {
|
||||
current = System.currentTimeMillis();
|
||||
Object result = this.evaScripts(fieldNumber, context, camelCaseMap);
|
||||
resultList.add(String.valueOf(result));
|
||||
System.out.println("script field time:" + (System.currentTimeMillis() - current));
|
||||
}
|
||||
if ("fixed".equals(type)) {
|
||||
List<FieldsCustomLogic> list = fieldsCustomLogicService.list(Wrappers.<FieldsCustomLogic>lambdaQuery()
|
||||
.eq(FieldsCustomLogic::getSite, site)
|
||||
.eq(FieldsCustomLogic::getFieldNumber, fieldNumber));
|
||||
context = "N_EMPTY";
|
||||
}
|
||||
resultList.add(context);
|
||||
}
|
||||
if ("script".equals(type)) {
|
||||
current = System.currentTimeMillis();
|
||||
Object result = this.evaScripts(fieldNumber, context, camelCaseMap);
|
||||
resultList.add(String.valueOf(result));
|
||||
System.out.println("script field time:" + (System.currentTimeMillis() - current));
|
||||
}
|
||||
if ("fixed".equals(type)) {
|
||||
List<FieldsCustomLogic> list = fieldsCustomLogicService.list(Wrappers.<FieldsCustomLogic>lambdaQuery()
|
||||
.eq(FieldsCustomLogic::getSite, site)
|
||||
.eq(FieldsCustomLogic::getFieldNumber, fieldNumber));
|
||||
|
||||
if (list.size() > 0) {
|
||||
FieldsCustomLogic fieldsCustomLogic = list.get(0);
|
||||
String methodName = fieldsCustomLogic.getFunctionName();
|
||||
Class clazz = Class.forName("com.foreverwin.business.label.service.impl.LabelFieldSpecificLogicServiceImpl");
|
||||
if (list.size() > 0) {
|
||||
FieldsCustomLogic fieldsCustomLogic = list.get(0);
|
||||
String methodName = fieldsCustomLogic.getFunctionName();
|
||||
Class clazz = Class.forName("com.foreverwin.business.label.service.impl.LabelFieldSpecificLogicServiceImpl");
|
||||
|
||||
Method method = clazz.getMethod(methodName, LabelFieldSpecificLogicDTO.class);
|
||||
LabelFieldSpecificLogicDTO dto = new LabelFieldSpecificLogicDTO();
|
||||
dto.setSite(site);
|
||||
Object result = method.invoke(clazz.newInstance(), dto);
|
||||
String returnType = method.getGenericReturnType().getTypeName();
|
||||
if ("java.util.List<java.lang.String>".equals(returnType)) {
|
||||
return (List<String>) result;
|
||||
} else {
|
||||
resultList.add((String) result);
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("特定逻辑的字段[" + fieldNumber + "]未维护对应的执行方法");
|
||||
}
|
||||
}
|
||||
System.out.println("system field [" + fieldNumber + "] costs:" + (System.currentTimeMillis() - current1));
|
||||
return resultList;
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.build(e.getMessage() == null ? e.toString() : e.getMessage());
|
||||
}
|
||||
}
|
||||
Method method = clazz.getMethod(methodName, LabelFieldSpecificLogicDTO.class);
|
||||
LabelFieldSpecificLogicDTO dto = new LabelFieldSpecificLogicDTO();
|
||||
dto.setSite(site);
|
||||
Object result = method.invoke(clazz.newInstance(), dto);
|
||||
String returnType = method.getGenericReturnType().getTypeName();
|
||||
if ("java.util.List<java.lang.String>".equals(returnType)) {
|
||||
return (List<String>) result;
|
||||
} else {
|
||||
resultList.add((String) result);
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("特定逻辑的字段[" + fieldNumber + "]未维护对应的执行方法");
|
||||
}
|
||||
}
|
||||
System.out.println("system field [" + fieldNumber + "] costs:" + (System.currentTimeMillis() - current1));
|
||||
return resultList;
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.build(e.getMessage() == null ? e.toString() : e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析js表达式
|
||||
*
|
||||
* @param fieldName
|
||||
* @param script
|
||||
* @param camelCaseMap
|
||||
* @return
|
||||
*/
|
||||
public Object evaScripts(String fieldName, String script, Map<String, Object> camelCaseMap) {
|
||||
// convert values
|
||||
try {
|
||||
ScriptEngine engine = new ScriptEngineManager().getEngineByName("javascript");
|
||||
//替换js中自定义字段
|
||||
Pattern p=Pattern.compile("(#\\{)([\\w]+)(\\})");
|
||||
Matcher matcher = p.matcher(script);
|
||||
while (matcher.find()){
|
||||
String group = matcher.group(0);
|
||||
String param = group.substring(2,group.length()-1);
|
||||
List<String> systemFieldValue = getSystemFieldValue(TenantContextHolder.getTenantStrId(), param, camelCaseMap);
|
||||
script=script.replaceFirst("(#\\{)([\\w]+)(\\})",systemFieldValue.get(0));
|
||||
}
|
||||
String function = "function parse(data) {\n" + script + "\n}";
|
||||
engine.eval(function);
|
||||
Invocable invoke = (Invocable) engine;
|
||||
SerializeConfig config = new SerializeConfig();
|
||||
config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase; // 下划线转驼峰
|
||||
Object result = invoke.invokeFunction("parse", camelCaseMap); // 将map数据对象作为js函数参数值,可通过json对象的方式获取
|
||||
if (result.toString().indexOf("null")>=0){
|
||||
throw BusinessException.build(fieldName);
|
||||
}
|
||||
return result;
|
||||
} catch (Exception ex) {
|
||||
throw BusinessException.build("JS解析失败编号:" +fieldName+ ex.getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 解析js表达式
|
||||
*
|
||||
* @param fieldName
|
||||
* @param script
|
||||
* @param camelCaseMap
|
||||
* @return
|
||||
*/
|
||||
public Object evaScripts(String fieldName, String script, Map<String, Object> camelCaseMap) {
|
||||
// convert values
|
||||
try {
|
||||
ScriptEngine engine = new ScriptEngineManager().getEngineByName("javascript");
|
||||
//替换js中自定义字段
|
||||
Pattern p = Pattern.compile("(#\\{)([\\w]+)(\\})");
|
||||
Matcher matcher = p.matcher(script);
|
||||
while (matcher.find()) {
|
||||
String group = matcher.group(0);
|
||||
String param = group.substring(2, group.length() - 1);
|
||||
List<String> systemFieldValue = getSystemFieldValue(TenantContextHolder.getTenantStrId(), param, camelCaseMap);
|
||||
script = script.replaceFirst("(#\\{)([\\w]+)(\\})", systemFieldValue.get(0));
|
||||
}
|
||||
String function = "function parse(data) {\n" + script + "\n}";
|
||||
engine.eval(function);
|
||||
Invocable invoke = (Invocable) engine;
|
||||
SerializeConfig config = new SerializeConfig();
|
||||
config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase; // 下划线转驼峰
|
||||
Object result = invoke.invokeFunction("parse", camelCaseMap); // 将map数据对象作为js函数参数值,可通过json对象的方式获取
|
||||
if (result.toString().indexOf("null") >= 0) {
|
||||
throw BusinessException.build(fieldName);
|
||||
}
|
||||
return result;
|
||||
} catch (Exception ex) {
|
||||
throw BusinessException.build("JS解析失败编号:" + fieldName + ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,14 +37,13 @@ public class WmsCuttingInventoryServiceImpl extends ServiceImpl<WmsCuttingInvent
|
||||
private final WmsCuttingPackageService wmsCuttingPackageService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public WmsCuttingInventory getByInventoryId(WmsCuttingInventory cuttingInventory) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
// 阶段
|
||||
String stage = cuttingInventory.getStage();
|
||||
// 如果阶段为空,则报错,否则执行下一步
|
||||
if (StringUtils.isBlank(stage)){
|
||||
if (StringUtils.isBlank(stage)) {
|
||||
// 阶段不能为空
|
||||
throw BusinessException.build(I18nUtil.getI18nText("wms.cuttingInventory.error1"));
|
||||
}
|
||||
@ -52,17 +51,17 @@ public class WmsCuttingInventoryServiceImpl extends ServiceImpl<WmsCuttingInvent
|
||||
String inventoryId = cuttingInventory.getInventoryId();
|
||||
|
||||
// 如果 inventoryId 为空则报错,否则查询 inventoryId 在 wms_cutting_inventory 是否存在
|
||||
if (StringUtils.isBlank(inventoryId)){
|
||||
if (StringUtils.isBlank(inventoryId)) {
|
||||
// 卷号不能为空
|
||||
throw BusinessException.build(I18nUtil.getI18nText("wms.cuttingInventory.error2"));
|
||||
|
||||
}
|
||||
//查询 inventoryId 在 wms_cutting_inventory 是否存在,若不存在则报错,否则执行下一步
|
||||
List<WmsCuttingInventory> wmsCuttingInventorys = wmsCuttingInventoryMapper.selectList(Wrappers.<WmsCuttingInventory>lambdaQuery()
|
||||
.eq(WmsCuttingInventory::getInventoryId,inventoryId)
|
||||
.eq(WmsCuttingInventory::getSite,site));
|
||||
.eq(WmsCuttingInventory::getInventoryId, inventoryId)
|
||||
.eq(WmsCuttingInventory::getSite, site));
|
||||
// wmsCuttingInventorys 集合为空,则报错,否则返回 wmsCuttingInventorys.get(0)
|
||||
if (wmsCuttingInventorys.isEmpty()){
|
||||
if (wmsCuttingInventorys.isEmpty()) {
|
||||
// 卷号[{0}]不存在
|
||||
throw BusinessException.build("卷号[" + inventoryId + "]不存在");
|
||||
}
|
||||
@ -72,25 +71,25 @@ public class WmsCuttingInventoryServiceImpl extends ServiceImpl<WmsCuttingInvent
|
||||
|
||||
// 是否是白包单件下线
|
||||
Boolean isFlag = cuttingInventory.getIsFlag();
|
||||
if(isFlag) {
|
||||
if (isFlag) {
|
||||
//查询 inventoryId 在 WMS_CUTTING_PACKAGE 是否存在,若存在则报错,否则执行下一步
|
||||
List<WmsCuttingPackage> wmsCuttingPackages = wmsCuttingPackageMapper.selectList(Wrappers.<WmsCuttingPackage>lambdaQuery()
|
||||
.eq(WmsCuttingPackage::getBatchNumber,inventoryId)
|
||||
.eq(WmsCuttingPackage::getSite,site));
|
||||
.eq(WmsCuttingPackage::getBatchNumber, inventoryId)
|
||||
.eq(WmsCuttingPackage::getSite, site));
|
||||
|
||||
if (!wmsCuttingPackages.isEmpty()){
|
||||
if (!wmsCuttingPackages.isEmpty()) {
|
||||
// 卷号[{0}]已扫入
|
||||
throw BusinessException.build("库存已存在,不可重复扫描");
|
||||
}
|
||||
} else {
|
||||
//查询 inventoryId 在 WMS_CUTTING_PACKAGE 是否存在,若存在则报错,否则执行下一步
|
||||
List<WmsCuttingPackage> wmsCuttingPackages = wmsCuttingPackageMapper.selectList(Wrappers.<WmsCuttingPackage>lambdaQuery()
|
||||
.eq(WmsCuttingPackage::getBatchNumber,inventoryId)
|
||||
.eq(WmsCuttingPackage::getSite,site)
|
||||
.eq(WmsCuttingPackage::getBatchNumber, inventoryId)
|
||||
.eq(WmsCuttingPackage::getSite, site)
|
||||
.isNotNull(WmsCuttingPackage::getPackageNumber)
|
||||
);
|
||||
|
||||
if (!wmsCuttingPackages.isEmpty()){
|
||||
if (!wmsCuttingPackages.isEmpty()) {
|
||||
// 卷号[{0}]已扫入
|
||||
throw BusinessException.build("该卷号已经绑定托盘码,不可重复扫描");
|
||||
}
|
||||
@ -106,6 +105,7 @@ public class WmsCuttingInventoryServiceImpl extends ServiceImpl<WmsCuttingInvent
|
||||
|
||||
return wmsCuttingInventorys.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WmsCuttingInventory cutOffLineStagnantSubstanceCheckCreate(WmsCuttingInventory cuttingInventory) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
@ -116,47 +116,47 @@ public class WmsCuttingInventoryServiceImpl extends ServiceImpl<WmsCuttingInvent
|
||||
// 阶段不能为空
|
||||
throw BusinessException.build(I18nUtil.getI18nText("wms.cuttingInventory.error1"));
|
||||
}
|
||||
|
||||
|
||||
String inventoryId = cuttingInventory.getInventoryId();
|
||||
|
||||
|
||||
// 如果 inventoryId 为空则报错,否则查询 inventoryId 在 wms_cutting_inventory 是否存在
|
||||
if (StringUtils.isBlank(inventoryId)) {
|
||||
// 卷号不能为空
|
||||
throw BusinessException.build(I18nUtil.getI18nText("wms.cuttingInventory.error2"));
|
||||
|
||||
|
||||
}
|
||||
// 扫描一卷往wms_cutting_package插入数据
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
// 获取卷号
|
||||
String batchNumber = cuttingInventory.getInventoryId();
|
||||
|
||||
|
||||
// 生成handle
|
||||
String handle = WmsCuttingPackage.genHandle(site, batchNumber);
|
||||
|
||||
|
||||
// 获取SAP物料号
|
||||
String sapNumber = cuttingInventory.getSapProductNumber();
|
||||
|
||||
|
||||
// 生成SAP批次 6位时间+4位流水,每天重置
|
||||
String sapBatch = wmsCuttingPackageService.generateSapBatch();
|
||||
|
||||
|
||||
// 获取长度
|
||||
String length = cuttingInventory.getCurrentLength();
|
||||
if (StringUtils.isBlank(length)) {
|
||||
// 长度不能为空
|
||||
throw BusinessException.build(I18nUtil.getI18nText("wms.cuttingInventory.error7"));
|
||||
}
|
||||
|
||||
|
||||
// 获取等级
|
||||
String grade = cuttingInventory.getQualityInspectionStatus();
|
||||
if (StringUtils.isBlank(grade)) {
|
||||
// 等级不能为空
|
||||
throw BusinessException.build(I18nUtil.getI18nText("wms.cuttingInventory.error8"));
|
||||
}
|
||||
|
||||
|
||||
// 获取U8料号
|
||||
String u8Code = cuttingInventory.getU8Code();
|
||||
|
||||
|
||||
// 创建WmsCuttingPackage对象
|
||||
WmsCuttingPackage wmsCuttingPackage = new WmsCuttingPackage();
|
||||
wmsCuttingPackage.setSite(site);
|
||||
@ -192,7 +192,7 @@ public class WmsCuttingInventoryServiceImpl extends ServiceImpl<WmsCuttingInvent
|
||||
|
||||
// 获取SAP物料号
|
||||
String sapNumber = wmsCuttingInventory.getSapProductNumber();
|
||||
|
||||
|
||||
// 生成SAP批次 6位时间+4位流水,每天重置
|
||||
String sapBatch = wmsCuttingPackageService.generateSapBatch();
|
||||
|
||||
|
||||
@ -16,6 +16,8 @@ import com.foreverwin.iep.prd.domain.GenerateNextNumberRequest;
|
||||
import com.foreverwin.iep.prd.domain.GenerateNextNumberResponse;
|
||||
import com.foreverwin.iep.prd.entity.Item;
|
||||
import com.foreverwin.iep.prd.feign.RemoteNextNumberService;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.core.util.I18nUtil;
|
||||
@ -26,8 +28,6 @@ import com.foreverwin.nlv.wms.domain.CarrierUnbindBatchRequest;
|
||||
import com.foreverwin.nlv.wms.domain.PrintRequest;
|
||||
import com.foreverwin.nlv.wms.entity.WmsCuttingPackage;
|
||||
import com.foreverwin.nlv.wms.entity.WmsCuttingPackageItf;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.nlv.wms.mapper.WmsCuttingPackageItfMapper;
|
||||
import com.foreverwin.nlv.wms.mapper.WmsCuttingPackageMapper;
|
||||
import com.foreverwin.nlv.wms.service.PrintService;
|
||||
@ -1126,17 +1126,17 @@ public class WmsCuttingPackageServiceImpl extends ServiceImpl<WmsCuttingPackageM
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getPackageInDataPage(Page page, WmsCuttingPackage wmsCuttingPackage){
|
||||
public IPage getPackageInDataPage(Page page, WmsCuttingPackage wmsCuttingPackage) {
|
||||
return this.baseMapper.getPackageInDataPage(page, wmsCuttingPackage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getPackageInDataItemPage(Page page, WmsCuttingPackage wmsCuttingPackage){
|
||||
public IPage getPackageInDataItemPage(Page page, WmsCuttingPackage wmsCuttingPackage) {
|
||||
return this.baseMapper.getPackageInDataItemPage(page, wmsCuttingPackage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsCuttingPackage> getTrayList(String site,String packageNumber){
|
||||
public List<WmsCuttingPackage> getTrayList(String site, String packageNumber) {
|
||||
return this.baseMapper.getTrayList(site, packageNumber);
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,9 @@ import com.foreverwin.iep.prd.domain.GenerateNextNumberRequest;
|
||||
import com.foreverwin.iep.prd.domain.GenerateNextNumberResponse;
|
||||
import com.foreverwin.iep.prd.entity.Item;
|
||||
import com.foreverwin.iep.prd.feign.RemoteNextNumberService;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.iep.wms.mapper.WmsInventoryMapper;
|
||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.core.util.I18nUtil;
|
||||
@ -121,13 +124,13 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
// 有批次号的数据
|
||||
if (batchExistList.size() > 0) {
|
||||
// 有批次号数据处理
|
||||
this.batchExistData(site,batchExistList, userGroupExistList);
|
||||
this.batchExistData(site, batchExistList, userGroupExistList);
|
||||
}
|
||||
|
||||
// 无批次号的数据
|
||||
if (batchNotExistList.size() > 0) {
|
||||
// 无批次号数据处理
|
||||
this.batchNotExistData(site,batchNotExistList, userGroupExistList,userGroupNotExistList);
|
||||
this.batchNotExistData(site, batchNotExistList, userGroupExistList, userGroupNotExistList);
|
||||
}
|
||||
|
||||
// 处理有用户组的数据, 按照用户组生成单据号
|
||||
@ -136,8 +139,8 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
}
|
||||
|
||||
// 处理无用户组的数据, 把没有用户组的数据放到同一个单据上,仓库组所有成员都能做
|
||||
if (userGroupNotExistList.size() > 0 ) {
|
||||
this.userGroupNotExistData(site, documentType, userGroupNotExistList, saveDataList);
|
||||
if (userGroupNotExistList.size() > 0) {
|
||||
this.userGroupNotExistData(site, documentType, userGroupNotExistList, saveDataList);
|
||||
|
||||
}
|
||||
|
||||
@ -145,24 +148,24 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
this.saveBatch(saveDataList);
|
||||
}
|
||||
|
||||
private String getNextNumberTypeBySrcType(String srcType){
|
||||
Map<String,String> hashMap = new HashMap();
|
||||
private String getNextNumberTypeBySrcType(String srcType) {
|
||||
Map<String, String> hashMap = new HashMap();
|
||||
hashMap.put("01", Constant.WMS_DJCF_SHLLD);
|
||||
hashMap.put("02",Constant.WMS_DJCF_SHTLD);
|
||||
hashMap.put("03",Constant.WMS_DJCF_YFLLD);
|
||||
hashMap.put("04",Constant.WMS_DJCF_YFTLD);
|
||||
hashMap.put("05",Constant.WMS_DJCF_QTLLD);
|
||||
hashMap.put("06",Constant.WMS_DJCF_QTTLD);
|
||||
hashMap.put("07",Constant.WMS_DJCF_CPRKD);
|
||||
hashMap.put("08",Constant.WMS_DJCF_XXFHD);
|
||||
hashMap.put("09",Constant.WMS_DJCF_XXTHD);
|
||||
hashMap.put("10",Constant.WMS_DJCF_CPBBD);
|
||||
hashMap.put("02", Constant.WMS_DJCF_SHTLD);
|
||||
hashMap.put("03", Constant.WMS_DJCF_YFLLD);
|
||||
hashMap.put("04", Constant.WMS_DJCF_YFTLD);
|
||||
hashMap.put("05", Constant.WMS_DJCF_QTLLD);
|
||||
hashMap.put("06", Constant.WMS_DJCF_QTTLD);
|
||||
hashMap.put("07", Constant.WMS_DJCF_CPRKD);
|
||||
hashMap.put("08", Constant.WMS_DJCF_XXFHD);
|
||||
hashMap.put("09", Constant.WMS_DJCF_XXTHD);
|
||||
hashMap.put("10", Constant.WMS_DJCF_CPBBD);
|
||||
|
||||
// TODO 待追加其它
|
||||
return hashMap.get(srcType);
|
||||
}
|
||||
|
||||
private String createDocumentNo(String documentType,Map<String, Object> customData){
|
||||
private String createDocumentNo(String documentType, Map<String, Object> customData) {
|
||||
//根据编号规则生成箱号
|
||||
GenerateNextNumberRequest generateNextNumberRequest = new GenerateNextNumberRequest();
|
||||
generateNextNumberRequest.setSite(TenantContextHolder.getTenantId());
|
||||
@ -237,7 +240,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
userGroupExistList.add(item);
|
||||
} else {
|
||||
// 批次号[{0}]不存在或没有收货位置
|
||||
throw BusinessException.build(I18nUtil.getI18nText("批次号["+ batchNumber +"]不存在或没有收货位置"));
|
||||
throw BusinessException.build(I18nUtil.getI18nText("批次号[" + batchNumber + "]不存在或没有收货位置"));
|
||||
// throw BusinessException.build(I18nUtil.getI18nText("批次号[{0}]不存在或没有收货位置"), batchNumber);
|
||||
}
|
||||
}
|
||||
@ -245,7 +248,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
}
|
||||
|
||||
// 无批次号数据处理
|
||||
private void batchNotExistData(String site, List<WmsDocumentSplitting> batchNotExistList, List<WmsDocumentSplitting> userGroupExistList,List<WmsDocumentSplitting> userGroupNotExistList) {
|
||||
private void batchNotExistData(String site, List<WmsDocumentSplitting> batchNotExistList, List<WmsDocumentSplitting> userGroupExistList, List<WmsDocumentSplitting> userGroupNotExistList) {
|
||||
// 循环遍历数据
|
||||
for (WmsDocumentSplitting item : batchNotExistList) {
|
||||
// 校验必填项是否为空
|
||||
@ -260,7 +263,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
// 判断物料是否维护了仓储自定义规则 或者 维护的仓储自定义规则是否是启用状态
|
||||
WmsMaterialPfep wmsMaterialPfep = wmsMaterialPfepMapper.selectOne(Wrappers.<WmsMaterialPfep>lambdaQuery()
|
||||
.eq(WmsMaterialPfep::getItemBo, itemBo)
|
||||
.eq(WmsMaterialPfep::getIsUse,ENABLE)
|
||||
.eq(WmsMaterialPfep::getIsUse, ENABLE)
|
||||
);
|
||||
|
||||
if (wmsMaterialPfep != null) {
|
||||
@ -271,7 +274,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 获取周期/天
|
||||
Integer cycle = 0 ;
|
||||
Integer cycle = 0;
|
||||
if (wmsMaterialPfep.getCycle() != null) {
|
||||
cycle = wmsMaterialPfep.getCycle();
|
||||
}
|
||||
@ -304,10 +307,10 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
// 把数据存到有用户组中
|
||||
userGroupExistList.add(item);
|
||||
} else {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("物料["+ item.getItem() +"]仓储自定义规则,没有找到满足条件的收货位置"));
|
||||
throw BusinessException.build(I18nUtil.getI18nText("物料[" + item.getItem() + "]仓储自定义规则,没有找到满足条件的收货位置"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.build("查询仓储自定义规则明细表发生异常:" + e );
|
||||
throw BusinessException.build("查询仓储自定义规则明细表发生异常:" + e);
|
||||
}
|
||||
} else {
|
||||
// 否则就把数据存到无用户组中
|
||||
@ -318,7 +321,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
}
|
||||
|
||||
// 有用户组的数据
|
||||
private void userGroupExistData(String site, String documentType,List<WmsDocumentSplitting> userGroupExistList, List<WmsDocumentSplitting> saveDataList) {
|
||||
private void userGroupExistData(String site, String documentType, List<WmsDocumentSplitting> userGroupExistList, List<WmsDocumentSplitting> saveDataList) {
|
||||
// 循环遍历 userGroupExistList,把该列表中不重复的 userGroup 信息,存储到 userGroupList
|
||||
List<WmsDocumentSplitting> userGroupList = new ArrayList<>();
|
||||
userGroupExistList.forEach(WmsDocumentSplitting -> {
|
||||
@ -331,7 +334,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
|
||||
userGroupList.forEach(userGroupItem -> {
|
||||
// 按照用户组生成单据号
|
||||
String documentNo = this.createDocumentNo(getNextNumberTypeBySrcType(documentType),null);
|
||||
String documentNo = this.createDocumentNo(getNextNumberTypeBySrcType(documentType), null);
|
||||
userGroupItem.setDocumentNo(documentNo);
|
||||
});
|
||||
|
||||
@ -352,9 +355,9 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
}
|
||||
|
||||
// 无用户组的数据
|
||||
private void userGroupNotExistData(String site, String documentType,List<WmsDocumentSplitting> userGroupNotExistList, List<WmsDocumentSplitting> saveDataList) {
|
||||
private void userGroupNotExistData(String site, String documentType, List<WmsDocumentSplitting> userGroupNotExistList, List<WmsDocumentSplitting> saveDataList) {
|
||||
// 根据单据类型生成单据号
|
||||
String documentNo = this.createDocumentNo(getNextNumberTypeBySrcType(documentType),null);
|
||||
String documentNo = this.createDocumentNo(getNextNumberTypeBySrcType(documentType), null);
|
||||
|
||||
for (WmsDocumentSplitting item : userGroupNotExistList) {
|
||||
item.setDocumentNo(documentNo);
|
||||
@ -378,7 +381,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
// 如果itemBo为空,报错,否则返回itemBo
|
||||
if (StringUtils.isBlank(itemBo)) {
|
||||
// 物料[{0}]在物料表不存在
|
||||
throw BusinessException.build(I18nUtil.getI18nText("物料["+ item +"]在物料表不存在"));
|
||||
throw BusinessException.build(I18nUtil.getI18nText("物料[" + item + "]在物料表不存在"));
|
||||
// throw BusinessException.build(I18nUtil.getI18nText("物料[{0}]在物料表不存在"), item);
|
||||
}
|
||||
return itemBo;
|
||||
@ -395,14 +398,14 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
|
||||
if (StringUtils.isBlank(deptUser)) {
|
||||
// 接收位置[{0}]没有维护用户组
|
||||
throw BusinessException.build("接收位置["+ storageBin +"]没有维护用户组");
|
||||
throw BusinessException.build("接收位置[" + storageBin + "]没有维护用户组");
|
||||
}
|
||||
return deptUser;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsDocumentSplitting> selectUnSoldDataByStatusAndDeptId() {
|
||||
MomUser momUser = SecurityUtils.getUser();
|
||||
MomUser momUser = SecurityUtils.getUser();
|
||||
Long deptId = momUser.getDeptId();
|
||||
return this.baseMapper.selectUnSoldDataByStatusAndDeptId(String.valueOf(deptId));
|
||||
}
|
||||
@ -419,11 +422,11 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
String itemBo = this.getItemHandle(site, item.getItem());
|
||||
|
||||
// 根据 站点+原单据号+单据类型+物料外键盘键 查询单据拆分表
|
||||
List<WmsDocumentSplitting> updateList= list(Wrappers.<WmsDocumentSplitting>lambdaQuery()
|
||||
List<WmsDocumentSplitting> updateList = list(Wrappers.<WmsDocumentSplitting>lambdaQuery()
|
||||
.eq(WmsDocumentSplitting::getSite, site)
|
||||
.eq(WmsDocumentSplitting::getOriginalDocumentNo, item.getOriginalDocumentNo())
|
||||
.eq(WmsDocumentSplitting::getDocumentType, item.getDocumentType())
|
||||
.eq(WmsDocumentSplitting::getItemBo,itemBo));
|
||||
.eq(WmsDocumentSplitting::getItemBo, itemBo));
|
||||
// 循环遍历 updateList
|
||||
for (WmsDocumentSplitting wmsDocumentSplitting : updateList) {
|
||||
wmsDocumentSplitting.setRequiredQty(item.getRequiredQty());
|
||||
@ -441,7 +444,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
// 根据站点+原单据号查询单据拆分表
|
||||
List<WmsDocumentSplitting> updateList= list(Wrappers.<WmsDocumentSplitting>lambdaQuery()
|
||||
List<WmsDocumentSplitting> updateList = list(Wrappers.<WmsDocumentSplitting>lambdaQuery()
|
||||
.eq(WmsDocumentSplitting::getSite, site)
|
||||
.eq(WmsDocumentSplitting::getOriginalDocumentNo, originalDocumentNo));
|
||||
// 物理删除
|
||||
@ -457,10 +460,10 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
String itemBo = this.getItemHandle(site, item.getItem());
|
||||
|
||||
// 根据站点+原单据号+物料外键盘查询单据拆分表
|
||||
List<WmsDocumentSplitting> updateList= list(Wrappers.<WmsDocumentSplitting>lambdaQuery()
|
||||
List<WmsDocumentSplitting> updateList = list(Wrappers.<WmsDocumentSplitting>lambdaQuery()
|
||||
.eq(WmsDocumentSplitting::getSite, site)
|
||||
.eq(WmsDocumentSplitting::getOriginalDocumentNo, item.getOriginalDocumentNo())
|
||||
.eq(WmsDocumentSplitting::getItemBo,itemBo)
|
||||
.eq(WmsDocumentSplitting::getItemBo, itemBo)
|
||||
);
|
||||
this.updateDelFlag(updateList);
|
||||
}
|
||||
@ -481,12 +484,12 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
Item item = itemService.getOne(Wrappers.<Item>lambdaQuery()
|
||||
.eq(Item::getItem, requestDetail.getItem())
|
||||
.eq(Item::getSite, site)
|
||||
.eq(Item::getCurrentRevision,"Y"));
|
||||
.eq(Item::getCurrentRevision, "Y"));
|
||||
if (item == null) {
|
||||
throw BusinessException.build("物料["+ requestDetail +"]在物料表不存在");
|
||||
throw BusinessException.build("物料[" + requestDetail + "]在物料表不存在");
|
||||
}
|
||||
WmsMaterialPfep materialPfep = wmsMaterialPfepService.getOne(Wrappers.<WmsMaterialPfep>lambdaQuery()
|
||||
.like(WmsMaterialPfep::getItemBo, item.getHandle().split(",")[0]+","+item.getItem()));
|
||||
.like(WmsMaterialPfep::getItemBo, item.getHandle().split(",")[0] + "," + item.getItem()));
|
||||
if (materialPfep != null) {
|
||||
if ("ENABLE".equals(materialPfep.getIsUse())) {
|
||||
if ("Y".equals(materialPfep.getIsReceOut())) {
|
||||
@ -529,10 +532,10 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WmsDocumentSplittingDTO> selectProdcutionWarehousingPage(FrontPage page,WmsDocumentSplitting wmsDocumentSplitting) {
|
||||
public IPage<WmsDocumentSplittingDTO> selectProdcutionWarehousingPage(FrontPage page, WmsDocumentSplitting wmsDocumentSplitting) {
|
||||
List<WmsDocumentSplittingDTO> list = selectProdcutionWarehousing(wmsDocumentSplitting);
|
||||
int size = (int)page.getSize();
|
||||
int current = (int)page.getCurrent();
|
||||
int size = (int) page.getSize();
|
||||
int current = (int) page.getCurrent();
|
||||
int startIndex = Math.toIntExact(Math.min((current - 1) * size, list.size()));
|
||||
int endIndex = Math.toIntExact(Math.min(startIndex + size, list.size()));
|
||||
List<WmsDocumentSplittingDTO> records = list.subList(startIndex, endIndex);
|
||||
@ -551,30 +554,30 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
.eq(Item::getCurrentRevision, "Y")
|
||||
.eq(Item::getSite, site));
|
||||
if (item == null) {
|
||||
throw BusinessException.build("物料["+dto.getItem()+"]在物料表不存在");
|
||||
throw BusinessException.build("物料[" + dto.getItem() + "]在物料表不存在");
|
||||
}
|
||||
WmsDocumentSplitting splitting = super.getOne(Wrappers.<WmsDocumentSplitting>lambdaQuery()
|
||||
.eq(WmsDocumentSplitting::getOriginalDocumentNo, dto.getDocumentNo())
|
||||
.eq(WmsDocumentSplitting::getSite, site)
|
||||
.eq(WmsDocumentSplitting::getItemBo,item.getHandle())
|
||||
.eq(WmsDocumentSplitting::getItemBo, item.getHandle())
|
||||
.eq(WmsDocumentSplitting::getDocumentType, "07"));
|
||||
if (splitting == null) {
|
||||
throw BusinessException.build("原单具号["+dto.getDocumentNo()+"]不存在");
|
||||
throw BusinessException.build("原单具号[" + dto.getDocumentNo() + "]不存在");
|
||||
}
|
||||
List<ZStoragRequestDetail> requestDetailList = zStoragRequestDetailService.list(Wrappers.<ZStoragRequestDetail>lambdaQuery()
|
||||
.eq(ZStoragRequestDetail::getSite, site)
|
||||
.eq(ZStoragRequestDetail::getDocumentNo, dto.getDocumentNo())
|
||||
.eq(ZStoragRequestDetail::getCarrierNumber, dto.getCarrierNumber()));
|
||||
if (requestDetailList.size() == 0) {
|
||||
throw BusinessException.build("托盘号["+dto.getCarrierNumber()+"]不存在");
|
||||
throw BusinessException.build("托盘号[" + dto.getCarrierNumber() + "]不存在");
|
||||
}
|
||||
for (ZStoragRequestDetail detail : requestDetailList) {
|
||||
if ("10".equals(detail.getStatus())) {
|
||||
throw BusinessException.build("托盘号["+dto.getCarrierNumber()+"]状态为已拣配");
|
||||
throw BusinessException.build("托盘号[" + dto.getCarrierNumber() + "]状态为已拣配");
|
||||
} else if ("20".equals(detail.getStatus())) {
|
||||
throw BusinessException.build("托盘号["+dto.getCarrierNumber()+"]状态为已入库拣配");
|
||||
throw BusinessException.build("托盘号[" + dto.getCarrierNumber() + "]状态为已入库拣配");
|
||||
} else if ("30".equals(detail.getStatus())) {
|
||||
throw BusinessException.build("托盘号["+dto.getCarrierNumber()+"]状态为已入库完成");
|
||||
throw BusinessException.build("托盘号[" + dto.getCarrierNumber() + "]状态为已入库完成");
|
||||
}
|
||||
WmsDocumentSplittingDTO splittingDTO = new WmsDocumentSplittingDTO();
|
||||
splittingDTO.setItem(detail.getItem());
|
||||
@ -599,12 +602,12 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
.eq(Item::getCurrentRevision, "Y")
|
||||
.eq(Item::getSite, site));
|
||||
if (item == null) {
|
||||
throw BusinessException.build("物料["+dto.getItem()+"]在物料表不存在");
|
||||
throw BusinessException.build("物料[" + dto.getItem() + "]在物料表不存在");
|
||||
}
|
||||
List<ZStoragRequestDetail> list = zStoragRequestDetailService.list(Wrappers.<ZStoragRequestDetail>lambdaQuery()
|
||||
.eq(ZStoragRequestDetail::getSite, site)
|
||||
.eq(ZStoragRequestDetail::getDocumentNo, dto.getDocumentNo())
|
||||
.eq(ZStoragRequestDetail::getItem,dto.getItem()));
|
||||
.eq(ZStoragRequestDetail::getItem, dto.getItem()));
|
||||
List<WmsDocumentSplittingDTO> returnList = new ArrayList<WmsDocumentSplittingDTO>();
|
||||
for (ZStoragRequestDetail detail : list) {
|
||||
WmsDocumentSplittingDTO splittingDTO = new WmsDocumentSplittingDTO();
|
||||
@ -615,8 +618,8 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
splittingDTO.setUnit(item.getUnitOfMeasure());
|
||||
returnList.add(splittingDTO);
|
||||
}
|
||||
int size = (int)page.getSize();
|
||||
int current = (int)page.getCurrent();
|
||||
int size = (int) page.getSize();
|
||||
int current = (int) page.getCurrent();
|
||||
int startIndex = Math.toIntExact(Math.min((current - 1) * size, returnList.size()));
|
||||
int endIndex = Math.toIntExact(Math.min(startIndex + size, returnList.size()));
|
||||
List<WmsDocumentSplittingDTO> records = returnList.subList(startIndex, endIndex);
|
||||
@ -635,7 +638,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
.eq(Item::getCurrentRevision, "Y")
|
||||
.eq(Item::getItem, dto.getItem()));
|
||||
if (item == null) {
|
||||
throw BusinessException.build("物料["+dto.getItem()+"]在物料表不存在");
|
||||
throw BusinessException.build("物料[" + dto.getItem() + "]在物料表不存在");
|
||||
}
|
||||
//查询是否该单据是否存在拣配数据
|
||||
List<WmsProductrec> list = wmsProductrecService.list(Wrappers.<WmsProductrec>lambdaQuery()
|
||||
@ -643,19 +646,19 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
.eq(WmsProductrec::getDocumentNo, dto.getDocumentNo())
|
||||
.eq(WmsProductrec::getItemBo, item.getHandle()));
|
||||
if (list.size() == 0) {
|
||||
throw BusinessException.build("该单据["+dto.getDocumentNo()+"]不存在拣配数据");
|
||||
throw BusinessException.build("该单据[" + dto.getDocumentNo() + "]不存在拣配数据");
|
||||
}
|
||||
//查询入库申请明细表
|
||||
ZStoragRequestDetail requestDetail = getRequestDetail(dto);
|
||||
if (requestDetail == null) {
|
||||
throw BusinessException.build("入库申请明细表["+dto.getDocumentNo()+"]不存在");
|
||||
throw BusinessException.build("入库申请明细表[" + dto.getDocumentNo() + "]不存在");
|
||||
}
|
||||
if ("20".equals(requestDetail.getStatus())) {
|
||||
throw BusinessException.build("已入库执行完毕,请入库完成");
|
||||
} else if ("30".equals(requestDetail.getStatus())) {
|
||||
throw BusinessException.build("已入库完成,请勿重复操作");
|
||||
}
|
||||
updateStatus(dto,"RECEIVE");
|
||||
updateStatus(dto, "RECEIVE");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -664,7 +667,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
//查询入库申请明细表
|
||||
ZStoragRequestDetail requestDetail = getRequestDetail(dto);
|
||||
if (requestDetail == null) {
|
||||
throw BusinessException.build("入库申请明细表["+dto.getDocumentNo()+"]不存在");
|
||||
throw BusinessException.build("入库申请明细表[" + dto.getDocumentNo() + "]不存在");
|
||||
}
|
||||
if (requestDetail.getStatus() == null) {
|
||||
throw BusinessException.build("请先接收");
|
||||
@ -678,7 +681,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
public void receiveComplete(WmsDocumentSplittingDTO dto) {
|
||||
ZStoragRequestDetail requestDetail = getRequestDetail(dto);
|
||||
if (requestDetail == null) {
|
||||
throw BusinessException.build("入库申请明细表["+dto.getDocumentNo()+"]不存在");
|
||||
throw BusinessException.build("入库申请明细表[" + dto.getDocumentNo() + "]不存在");
|
||||
}
|
||||
if (requestDetail.getStatus() == null) {
|
||||
throw BusinessException.build("未入库执行");
|
||||
@ -689,7 +692,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
if (!requestDetail.getStatus().equals("20")) {
|
||||
throw BusinessException.build("未入库执行");
|
||||
}
|
||||
updateStatus(dto,"CLOSE");
|
||||
updateStatus(dto, "CLOSE");
|
||||
}
|
||||
|
||||
private ZStoragRequestDetail getRequestDetail(WmsDocumentSplittingDTO dto) {
|
||||
@ -702,7 +705,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
return requestDetail;
|
||||
}
|
||||
|
||||
private Map<String,Object> updateStatus(WmsDocumentSplittingDTO dto,String type) {
|
||||
private Map<String, Object> updateStatus(WmsDocumentSplittingDTO dto, String type) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String requestStatus = null;
|
||||
@ -723,11 +726,11 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
.eq(ZStoragRequestDetail::getDocumentNo, dto.getDocumentNo())
|
||||
.eq(ZStoragRequestDetail::getItem, dto.getItem()));
|
||||
if (requestDetail == null) {
|
||||
throw BusinessException.build("入库申请明细表["+dto.getDocumentNo()+"]不存在");
|
||||
throw BusinessException.build("入库申请明细表[" + dto.getDocumentNo() + "]不存在");
|
||||
}
|
||||
zStoragRequestDetailService.update(Wrappers.<ZStoragRequestDetail>lambdaUpdate()
|
||||
.eq(ZStoragRequestDetail::getHandle, requestDetail.getHandle())
|
||||
.set(ZStoragRequestDetail::getStatus,requestDetailStatus));
|
||||
.set(ZStoragRequestDetail::getStatus, requestDetailStatus));
|
||||
List<ZStoragRequestDetail> requestDetailList = zStoragRequestDetailService.list(Wrappers.<ZStoragRequestDetail>lambdaQuery()
|
||||
.eq(ZStoragRequestDetail::getDocumentNo, dto.getDocumentNo())
|
||||
.eq(ZStoragRequestDetail::getSite, site));
|
||||
@ -779,14 +782,14 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
if (flag) {
|
||||
//更新入库申请单状态
|
||||
zStoragRequestService.update(Wrappers.<ZStoragRequest>lambdaUpdate()
|
||||
.eq(ZStoragRequest::getSite,site)
|
||||
.eq(ZStoragRequest::getDocumentType,"07")
|
||||
.eq(ZStoragRequest::getDocumentNo,dto.getDocumentNo())
|
||||
.set(ZStoragRequest::getDocumentStatus,requestStatus)
|
||||
.set(ZStoragRequest::getUpdateUserBo,SecurityUtils.getUserName())
|
||||
.set(ZStoragRequest::getUpdatedDateTime,LocalDateTime.now()));
|
||||
returnMap.put("requestStatus",requestStatus);
|
||||
returnMap.put("requestDetailList",requestDetailList);
|
||||
.eq(ZStoragRequest::getSite, site)
|
||||
.eq(ZStoragRequest::getDocumentType, "07")
|
||||
.eq(ZStoragRequest::getDocumentNo, dto.getDocumentNo())
|
||||
.set(ZStoragRequest::getDocumentStatus, requestStatus)
|
||||
.set(ZStoragRequest::getUpdateUserBo, SecurityUtils.getUserName())
|
||||
.set(ZStoragRequest::getUpdatedDateTime, LocalDateTime.now()));
|
||||
returnMap.put("requestStatus", requestStatus);
|
||||
returnMap.put("requestDetailList", requestDetailList);
|
||||
return returnMap;
|
||||
}
|
||||
return returnMap;
|
||||
@ -797,7 +800,7 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
String storageBin = wmsProductrec.getStorageBin();
|
||||
Item item = itemService.getById(wmsProductrec.getItemBo());
|
||||
if (item == null) {
|
||||
throw BusinessException.build("物料["+wmsProductrec.getItem()+"]不存在");
|
||||
throw BusinessException.build("物料[" + wmsProductrec.getItem() + "]不存在");
|
||||
}
|
||||
//查询物料自定义字段保质期
|
||||
String customItemType = wmsCustomFieldsService.getCustomFieldsValue(wmsProductrec.getItemBo(), "SHELF_LIFE");
|
||||
@ -810,12 +813,12 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = new ArrayList<>();
|
||||
WmsMaterialPfep wmsMaterialPfep = wmsMaterialPfepMapper.selectOne(new QueryWrapper<WmsMaterialPfep>().lambda().eq(WmsMaterialPfep::getItemBo, itemBo));
|
||||
if (wmsMaterialPfep != null) {
|
||||
wmsMaterialPfepItemList = wmsMaterialPfepItemMapper.getDetailListByParentBo(wmsMaterialPfep.getHandle(),"ENABLE","StorageBinBO:"+site+","+storageBin);
|
||||
wmsMaterialPfepItemList = wmsMaterialPfepItemMapper.getDetailListByParentBo(wmsMaterialPfep.getHandle(), "ENABLE", "StorageBinBO:" + site + "," + storageBin);
|
||||
}
|
||||
if (wmsMaterialPfepItemList.size() == 0) {
|
||||
throw BusinessException.build("当前货位号["+storageBin+"]不存在");
|
||||
throw BusinessException.build("当前货位号[" + storageBin + "]不存在");
|
||||
}
|
||||
List<WmsProductrecDTO> oldList = wmsProductrecMapper.selectWmsProductrecList(wmsProductrec.getDocumentNo(),wmsProductrec.getItem(),site);
|
||||
List<WmsProductrecDTO> oldList = wmsProductrecMapper.selectWmsProductrecList(wmsProductrec.getDocumentNo(), wmsProductrec.getItem(), site);
|
||||
wmsProductrecDService.removeBatchByIds(oldList);
|
||||
List<WmsProductrec> list = wmsProductrec.getWmsProductrecList();
|
||||
for (WmsProductrec newWmsProductrec : list) {
|
||||
@ -841,16 +844,16 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
Date dateByDay = DateUtil.getDateByDay(new Date(), day);
|
||||
//新增库存表
|
||||
WmsInventory wmsInventory = new WmsInventory();
|
||||
wmsInventory.setHandle(WmsInventory.genHandle(site, Item.genHandle(site,item.getItem(),"#"), requestDetail.getLotNumber()));
|
||||
wmsInventory.setHandle(WmsInventory.genHandle(site, Item.genHandle(site, item.getItem(), "#"), requestDetail.getLotNumber()));
|
||||
wmsInventory.setSite(site);
|
||||
wmsInventory.setItemBo(Item.genHandle(site,item.getItem(),"#"));
|
||||
wmsInventory.setItemBo(Item.genHandle(site, item.getItem(), "#"));
|
||||
wmsInventory.setQtyOnHand(new BigDecimal(requestDetail.getLength()));
|
||||
wmsInventory.setOriginalQty(new BigDecimal(requestDetail.getLength()));
|
||||
wmsInventory.setMaterialLot(requestDetail.getLotNumber());
|
||||
wmsInventory.setWmsStorageBinBo("StorageBinBO:"+site+","+storageBin);
|
||||
wmsInventory.setWmsStorageBinBo("StorageBinBO:" + site + "," + storageBin);
|
||||
wmsInventory.setCreator(SecurityUtils.getUserName());
|
||||
wmsInventory.setDateCreate(LocalDateTime.now());
|
||||
wmsInventory.setWmsStorageBinBo(WmsStorageBin.genHandle(site,storageBin));
|
||||
wmsInventory.setWmsStorageBinBo(WmsStorageBin.genHandle(site, storageBin));
|
||||
wmsInventory.setStatus("0");
|
||||
wmsInventory.setDeputyQty(new BigDecimal(requestDetail.getWidth()));
|
||||
wmsInventory.setMainUom(item.getUnitOfMeasure());
|
||||
@ -865,11 +868,11 @@ public class WmsDocumentSplittingServiceImpl extends ServiceImpl<WmsDocumentSpli
|
||||
WmsInventoryLog wmsInventoryLog = new WmsInventoryLog();
|
||||
wmsInventoryLog.setUuid(UUID.randomUUID().toString());
|
||||
wmsInventoryLog.setSite(site);
|
||||
wmsInventoryLog.setItemBo(Item.genHandle(site,item.getItem(),"#"));
|
||||
wmsInventoryLog.setItemBo(Item.genHandle(site, item.getItem(), "#"));
|
||||
wmsInventoryLog.setQtyOnHand(new BigDecimal(requestDetail.getLength()));
|
||||
wmsInventoryLog.setOriginalQty(new BigDecimal(requestDetail.getLength()));
|
||||
wmsInventoryLog.setMaterialLot(requestDetail.getLotNumber());
|
||||
wmsInventoryLog.setWmsStorageBinBo(WmsStorageBin.genHandle(site,storageBin));
|
||||
wmsInventoryLog.setWmsStorageBinBo(WmsStorageBin.genHandle(site, storageBin));
|
||||
wmsInventoryLog.setCreator(SecurityUtils.getUserName());
|
||||
wmsInventoryLog.setDateCreate(LocalDateTime.now());
|
||||
wmsInventoryLog.setMoveType("0");
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
package com.foreverwin.nlv.wms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.iep.wms.mapper.WmsInventoryLogMapper;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.nlv.wms.mapper.WmsInventoryLogMapper;
|
||||
import com.foreverwin.nlv.wms.service.WmsInventoryLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -3,28 +3,16 @@ package com.foreverwin.nlv.wms.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.iep.prd.dto.CustomFieldBoundDTO;
|
||||
import com.foreverwin.iep.prd.entity.CustomFieldDef;
|
||||
import com.foreverwin.iep.prd.entity.CustomFields;
|
||||
import com.foreverwin.iep.prd.entity.Item;
|
||||
import com.foreverwin.iep.prd.mapper.CustomFieldDefMapper;
|
||||
import com.foreverwin.iep.prd.mapper.CustomFieldsMapper;
|
||||
import com.foreverwin.iep.wms.dto.EqpFeedingDTO;
|
||||
import com.foreverwin.iep.wms.mapper.EqpFeedingMapper;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventory;
|
||||
import com.foreverwin.iep.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.iep.wms.mapper.WmsInventoryMapper;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.nlv.wms.dto.wmsInventoryDto;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventory;
|
||||
import com.foreverwin.nlv.wms.entity.WmsInventoryLog;
|
||||
import com.foreverwin.nlv.wms.mapper.WmsInventoryLogMapper;
|
||||
import com.foreverwin.nlv.wms.mapper.WmsInventoryMapper;
|
||||
import com.foreverwin.nlv.wms.service.WmsInventoryLogService;
|
||||
import com.foreverwin.nlv.wms.service.WmsInventoryService;
|
||||
import com.foreverwin.nlv.wms.service.WmsItemService;
|
||||
import com.foreverwin.nlv.wms.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@ -34,7 +22,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@ -48,70 +35,7 @@ import java.util.UUID;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, WmsInventory> implements WmsInventoryService {
|
||||
|
||||
private final WmsInventoryLogMapper wmsInventoryLogMapper;
|
||||
private final WmsInventoryMapper wmsInventoryMapper;
|
||||
private final WmsInventoryLogService wmsInventoryLogService;
|
||||
private final EqpFeedingMapper eqpFeedingMapper;
|
||||
private final WmsItemService wmsItemService;
|
||||
private final CustomFieldDefMapper customFieldDefMapper;
|
||||
private final CustomFieldsMapper customFieldsMapper;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void createInventory(WmsInventory wmsInventory) {
|
||||
if (StringUtils.isEmpty(wmsInventory.getItemBo())) {
|
||||
throw BusinessException.build("创建库存时物料不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(wmsInventory.getMaterialLot())) {
|
||||
throw BusinessException.build("创建库存时物料批次不能为空");
|
||||
}
|
||||
wmsInventory.setHandle(WmsInventory.genHandle(wmsInventory.getSite(), wmsInventory.getItemBo(), wmsInventory.getMaterialLot()));
|
||||
WmsInventory checkInv = this.baseMapper.selectById(wmsInventory.getHandle());
|
||||
if (checkInv != null) {
|
||||
throw BusinessException.build("当前物料同一批次库存已存在!");
|
||||
}
|
||||
wmsInventory.setCreator(SecurityUtils.getUserName());
|
||||
wmsInventory.setDateCreate(LocalDateTime.now());
|
||||
wmsInventory.setStatus("0");
|
||||
this.baseMapper.insert(wmsInventory);
|
||||
// 写入库存日志记录表
|
||||
WmsInventoryLog wmsInventoryLog = new WmsInventoryLog();
|
||||
BeanUtils.copyProperties(wmsInventory, wmsInventoryLog);
|
||||
wmsInventoryLog.setUuid(UUID.randomUUID().toString());
|
||||
wmsInventoryLog.setCreator(SecurityUtils.getUserName());
|
||||
wmsInventoryLog.setDateCreate(LocalDateTime.now());
|
||||
wmsInventoryLog.setMoveType("0"); // 新创建的库存
|
||||
wmsInventoryLogMapper.insert(wmsInventoryLog);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void outInventoryByMaterialLot(String site, String materialLot, BigDecimal outQty) {
|
||||
// 扫码出库,没有销售单的出库
|
||||
QueryWrapper<WmsInventory> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(WmsInventory::getMaterialLot, materialLot).eq(WmsInventory::getSite, site);
|
||||
WmsInventory wmsInventory = this.baseMapper.selectOne(queryWrapper);
|
||||
if (wmsInventory == null) {
|
||||
throw BusinessException.build("库存数据已不存在");
|
||||
}else if (wmsInventory.getQtyOnHand().compareTo(outQty)==0){
|
||||
// 移除库存数据
|
||||
super.removeById(wmsInventory);
|
||||
}else{
|
||||
BigDecimal remainQty = wmsInventory.getQtyOnHand().subtract(outQty);
|
||||
wmsInventory.setQtyOnHand(remainQty);
|
||||
wmsInventory.setUpdater(SecurityUtils.getUserName());
|
||||
wmsInventory.setDateUpdate(LocalDateTime.now());
|
||||
super.updateById(wmsInventory);
|
||||
}
|
||||
// 写入库存日志记录表
|
||||
WmsInventoryLog wmsInventoryLog = new WmsInventoryLog();
|
||||
BeanUtils.copyProperties(wmsInventory, wmsInventoryLog);
|
||||
wmsInventoryLog.setUuid(UUID.randomUUID().toString());
|
||||
wmsInventoryLog.setCreator(SecurityUtils.getUserName());
|
||||
wmsInventoryLog.setDateCreate(LocalDateTime.now());
|
||||
wmsInventoryLog.setMoveType("3"); // 出库
|
||||
wmsInventoryLogMapper.insert(wmsInventoryLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getWmsInventoryPage(Page page, WmsInventory dto) {
|
||||
@ -148,13 +72,13 @@ public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, Wms
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unbindPackageNumber(String packageNumber,boolean isErrorShow) {
|
||||
public void unbindPackageNumber(String packageNumber, boolean isErrorShow) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
QueryWrapper<WmsInventory> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(WmsInventory::getPackageNumber, packageNumber).eq(WmsInventory::getSite, site);
|
||||
List<WmsInventory> wmsInventoryList = this.baseMapper.selectList(queryWrapper);
|
||||
if (wmsInventoryList == null || wmsInventoryList.size() < 1) {
|
||||
if(isErrorShow){
|
||||
if (isErrorShow) {
|
||||
throw BusinessException.build("当前托盘并未绑定批次");
|
||||
}
|
||||
} else {
|
||||
@ -179,85 +103,6 @@ public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, Wms
|
||||
super.update(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public wmsInventoryDto selectByMaterialLot(wmsInventoryDto dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setSite(site);
|
||||
wmsInventoryDto wmsInventory = wmsInventoryMapper.selectByMaterialLot(dto);
|
||||
if (wmsInventory == null) {
|
||||
throw BusinessException.build("料件批号的物料不在当前工单的BOM中");
|
||||
}
|
||||
//校验是否超过到期日
|
||||
if ("Y".equals(dto.getCheckDateExp())) {
|
||||
LocalDateTime dateExp = wmsInventory.getDateExp();
|
||||
if (dateExp != null) {
|
||||
boolean after = dateExp.isAfter(LocalDateTime.now());
|
||||
if (!after) {
|
||||
throw BusinessException.build("料件批号[" + wmsInventory.getMaterialLot() + "]已过期,到期日为["+wmsInventory.getDateExp()+"]请调整");
|
||||
}
|
||||
}
|
||||
}
|
||||
//校验料件库存先进先出
|
||||
if ("Y".equals(dto.getFifo())) {
|
||||
List<WmsInventory> list = list(Wrappers.<WmsInventory>lambdaQuery()
|
||||
.eq(WmsInventory::getSite, site)
|
||||
.eq(WmsInventory::getItemBo, wmsInventory.getItemBo())
|
||||
.eq(WmsInventory::getWmsWarehouseBo, wmsInventory.getWmsWarehouseBo())
|
||||
.gt(WmsInventory::getQtyOnHand, 0)
|
||||
.eq(WmsInventory::getStatus,"0")
|
||||
.orderByAsc(WmsInventory::getDateMfg));
|
||||
if (list.size() > 0) {
|
||||
LocalDateTime dateMfg = list.get(0).getDateMfg();
|
||||
boolean before = dateMfg.isBefore(wmsInventory.getDateMfg());
|
||||
if (before) {
|
||||
wmsInventory.setFifo("N");//N表示返回前端有弹窗提示 先进先出
|
||||
wmsInventory.setFifoMaterialLot(list.get(0).getMaterialLot());
|
||||
}
|
||||
}
|
||||
}
|
||||
return wmsInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public wmsInventoryDto checkItemGroup(wmsInventoryDto dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setSite(site);
|
||||
wmsInventoryDto wmsInventory = wmsInventoryMapper.selectByMaterialLot(dto);
|
||||
if (wmsInventory == null) {
|
||||
throw BusinessException.build("料件批号的物料不在当前工单的BOM中");
|
||||
}
|
||||
//校验扫描条码的物料在物料表中物料组是否在字典管理为OUT_ITEM_TYPE对应的值一致
|
||||
EqpFeedingDTO eqpFeedingDTO = new EqpFeedingDTO();
|
||||
eqpFeedingDTO.setSite(site);
|
||||
eqpFeedingDTO.setResource(dto.getResource());
|
||||
eqpFeedingDTO.setOperation(dto.getOperation());
|
||||
eqpFeedingDTO.setShopOrder(dto.getShopOrder());
|
||||
//eqpFeedingDTO.setMaterialLot(dto.getMaterialLot());
|
||||
List<EqpFeedingDTO> eqpFeedingDTOSList = eqpFeedingMapper.selectEqpFeedingList(eqpFeedingDTO);
|
||||
boolean isBreak = false;
|
||||
for (EqpFeedingDTO feeding : eqpFeedingDTOSList) {
|
||||
String item = feeding.getItemBo().split(",")[1];
|
||||
String itemGroup = selectItemCustomField(item);
|
||||
if (feeding.getQtyOnHand().compareTo(feeding.getOriginalQty()) < 0) {
|
||||
for (Map<String, Object> itemType : dto.getOutItemType()) {
|
||||
String value = (String) itemType.get("value");
|
||||
if (itemGroup.equals(value)) {
|
||||
isBreak = true;
|
||||
wmsInventory.setItemGroup("N");//N表示返回前端有弹窗提示 XX条码剩余量是xx,
|
||||
wmsInventory.setCheckItemQtyOnHand(feeding.getQtyOnHand());
|
||||
wmsInventory.setCheckItemMaterialLot(feeding.getMaterialLot());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isBreak) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("设备["+dto.getResource()+"]工序["+dto.getOperation()+"]工单["+dto.getShopOrder()+"]物料已存在,不允许重复上料;请先进行下料操作");
|
||||
}
|
||||
}
|
||||
return wmsInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInventory(WmsInventory wmsInventory) {
|
||||
@ -265,21 +110,61 @@ public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, Wms
|
||||
wmsInventoryLogService.createInventoryLog(wmsInventory);
|
||||
}
|
||||
|
||||
//查询物料的自定义字段
|
||||
private String selectItemCustomField(String item){
|
||||
String itemGroup = null;
|
||||
Item itemServiceOne = wmsItemService.getOne(Wrappers.<Item>lambdaQuery().eq(Item::getItem, item)
|
||||
.eq(Item::getSite, TenantContextHolder.getTenantId())
|
||||
.eq(Item::getCurrentRevision, "Y"));
|
||||
if (itemServiceOne != null) {
|
||||
CustomFields customFields = customFieldsMapper.selectOne(Wrappers.<CustomFields>lambdaQuery()
|
||||
.eq(CustomFields::getFieldName, "ITEM_GROUP")
|
||||
.eq(CustomFields::getHandle, itemServiceOne.getHandle()));
|
||||
if (customFields != null) {
|
||||
itemGroup = customFields.getFieldValue();
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void createInventory(WmsInventory wmsInventory) {
|
||||
if (StringUtils.isEmpty(wmsInventory.getItemBo())) {
|
||||
throw BusinessException.build("创建库存时物料不能为空");
|
||||
}
|
||||
return itemGroup;
|
||||
if (StringUtils.isEmpty(wmsInventory.getMaterialLot())) {
|
||||
throw BusinessException.build("创建库存时物料批次不能为空");
|
||||
}
|
||||
wmsInventory.setHandle(WmsInventory.genHandle(wmsInventory.getSite(), wmsInventory.getItemBo(), wmsInventory.getMaterialLot()));
|
||||
WmsInventory checkInv = this.baseMapper.selectById(wmsInventory.getHandle());
|
||||
if (checkInv != null) {
|
||||
throw BusinessException.build("当前物料同一批次库存已存在!");
|
||||
}
|
||||
wmsInventory.setCreator(SecurityUtils.getUserName());
|
||||
wmsInventory.setDateCreate(LocalDateTime.now());
|
||||
wmsInventory.setStatus("0");
|
||||
this.baseMapper.insert(wmsInventory);
|
||||
// 写入库存日志记录表
|
||||
WmsInventoryLog wmsInventoryLog = new WmsInventoryLog();
|
||||
BeanUtils.copyProperties(wmsInventory, wmsInventoryLog);
|
||||
wmsInventoryLog.setUuid(UUID.randomUUID().toString());
|
||||
wmsInventoryLog.setCreator(SecurityUtils.getUserName());
|
||||
wmsInventoryLog.setDateCreate(LocalDateTime.now());
|
||||
wmsInventoryLog.setMoveType("0"); // 新创建的库存
|
||||
wmsInventoryLogService.save(wmsInventoryLog);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void outInventoryByMaterialLot(String site, String materialLot, BigDecimal outQty) {
|
||||
// 扫码出库,没有销售单的出库
|
||||
QueryWrapper<WmsInventory> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(WmsInventory::getMaterialLot, materialLot).eq(WmsInventory::getSite, site);
|
||||
WmsInventory wmsInventory = this.baseMapper.selectOne(queryWrapper);
|
||||
if (wmsInventory == null) {
|
||||
throw BusinessException.build("库存数据已不存在");
|
||||
}else if (wmsInventory.getQtyOnHand().compareTo(outQty)==0){
|
||||
// 移除库存数据
|
||||
super.removeById(wmsInventory);
|
||||
}else{
|
||||
BigDecimal remainQty = wmsInventory.getQtyOnHand().subtract(outQty);
|
||||
wmsInventory.setQtyOnHand(remainQty);
|
||||
wmsInventory.setUpdater(SecurityUtils.getUserName());
|
||||
wmsInventory.setDateUpdate(LocalDateTime.now());
|
||||
super.updateById(wmsInventory);
|
||||
}
|
||||
// 写入库存日志记录表
|
||||
WmsInventoryLog wmsInventoryLog = new WmsInventoryLog();
|
||||
BeanUtils.copyProperties(wmsInventory, wmsInventoryLog);
|
||||
wmsInventoryLog.setUuid(UUID.randomUUID().toString());
|
||||
wmsInventoryLog.setCreator(SecurityUtils.getUserName());
|
||||
wmsInventoryLog.setDateCreate(LocalDateTime.now());
|
||||
wmsInventoryLog.setMoveType("3"); // 出库
|
||||
wmsInventoryLogService.save(wmsInventoryLog);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author syngna
|
||||
@ -42,7 +42,7 @@ public class WmsItemServiceImpl extends ServiceImpl<WmsItemMapper, Item> impleme
|
||||
public Item selectById(String handle) {
|
||||
Item item = null;
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
if(StringUtils.notBlank(handle) && handle.endsWith("#")) {
|
||||
if (StringUtils.notBlank(handle) && handle.endsWith("#")) {
|
||||
List<Item> itemList = this.itemMapper.selectList(locale.getLanguage(), new QueryWrapper<Item>().lambda()
|
||||
.eq(Item::getSite, StringUtils.trimSite(handle))
|
||||
.eq(Item::getItem, StringUtils.trimHandle(handle))
|
||||
@ -72,6 +72,7 @@ public class WmsItemServiceImpl extends ServiceImpl<WmsItemMapper, Item> impleme
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
return this.itemMapper.selectList(locale.getLanguage(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Item> selectItemAndCustomerId(Wrapper<Item> queryWrapper) {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
@ -80,7 +81,7 @@ public class WmsItemServiceImpl extends ServiceImpl<WmsItemMapper, Item> impleme
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getItemDetailList() {
|
||||
String site= TenantContextHolder.getTenantId();
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
return itemMapper.getItemDetailList(site);
|
||||
}
|
||||
|
||||
@ -97,10 +98,10 @@ public class WmsItemServiceImpl extends ServiceImpl<WmsItemMapper, Item> impleme
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
LambdaQueryWrapper<Item> queryWrapper = new QueryWrapper<Item>().lambda();
|
||||
queryWrapper.eq(Item::getItem, site);
|
||||
if( item.getItem() != null){
|
||||
if (item.getItem() != null) {
|
||||
queryWrapper.like(Item::getItem, item.getItem());
|
||||
}
|
||||
if(item.getDescription()!= null){
|
||||
if (item.getDescription() != null) {
|
||||
queryWrapper.like(Item::getDescription, item.getDescription());
|
||||
}
|
||||
return itemMapper.selectListByCriteria(locale.getLanguage(), queryWrapper);
|
||||
@ -113,7 +114,7 @@ public class WmsItemServiceImpl extends ServiceImpl<WmsItemMapper, Item> impleme
|
||||
LambdaQueryWrapper<Item> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Item::getSite, site);
|
||||
queryWrapper.eq(Item::getItem, item);
|
||||
queryWrapper.eq(Item::getCurrentRevision,"Y");
|
||||
queryWrapper.eq(Item::getCurrentRevision, "Y");
|
||||
queryWrapper.orderByDesc(Item::getCurrentRevision);
|
||||
//----------------------------------------------------------------------------------
|
||||
List<Item> resultLit = itemMapper.selectList(locale.getLanguage(), queryWrapper);
|
||||
@ -155,13 +156,12 @@ public class WmsItemServiceImpl extends ServiceImpl<WmsItemMapper, Item> impleme
|
||||
|
||||
@Override
|
||||
public String selectItemBySfc(String site, String sfc) {
|
||||
return itemMapper.selectItemBySfc(site,sfc);
|
||||
return itemMapper.selectItemBySfc(site, sfc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemDescriptionByLocale(String itemBO)
|
||||
{
|
||||
public String getItemDescriptionByLocale(String itemBO) {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
return itemMapper.selectItemDescriptionByLocale(locale.getLanguage(),itemBO);
|
||||
return itemMapper.selectItemDescriptionByLocale(locale.getLanguage(), itemBO);
|
||||
}
|
||||
}
|
||||
@ -32,99 +32,100 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class WmsMaterialPfepServiceImpl extends ServiceImpl<WmsMaterialPfepMapper, WmsMaterialPfep> implements WmsMaterialPfepService {
|
||||
|
||||
private final WmsMaterialPfepItemMapper wmsMaterialPfepItemMapper;
|
||||
@Override
|
||||
public IPage getWmMaterialPfepPage(Page page, WmsMaterialPfep dto) {
|
||||
return this.baseMapper.getWmMaterialPfepPage(page,dto);
|
||||
}
|
||||
private final WmsMaterialPfepItemMapper wmsMaterialPfepItemMapper;
|
||||
|
||||
@Override
|
||||
public WmsMaterialPfep getByHandle(String handle) {
|
||||
WmsMaterialPfep wmMaterialPfep = this.baseMapper.getOneObjByHandle(handle);
|
||||
if(wmMaterialPfep != null) {
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = wmsMaterialPfepItemMapper.getAllWmMaterialPfepItemByParentBo(wmMaterialPfep.getHandle());
|
||||
wmMaterialPfep.setWmsMaterialPfepItemList(wmsMaterialPfepItemList);
|
||||
}
|
||||
return wmMaterialPfep;
|
||||
}
|
||||
@Override
|
||||
public IPage getWmMaterialPfepPage(Page page, WmsMaterialPfep dto) {
|
||||
return this.baseMapper.getWmMaterialPfepPage(page, dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveWmMaterialPfep(WmsMaterialPfep dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setSite(site);
|
||||
dto.setItemBo(Item.genHandle(site,dto.getItem(),"#"));
|
||||
dto.setHandle(WmsMaterialPfep.genHandle(dto.getSite(), dto.getItemBo()));
|
||||
dto.setCreator(SecurityUtils.getUserName());
|
||||
dto.setDateCreate(LocalDateTime.now());
|
||||
this.baseMapper.insert(dto);
|
||||
// 保存明细数据
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = dto.getWmsMaterialPfepItemList();
|
||||
Integer seqNum = 1;
|
||||
if(wmsMaterialPfepItemList != null && wmsMaterialPfepItemList.size()>0){
|
||||
for (WmsMaterialPfepItem wmsMaterialPfepItem : wmsMaterialPfepItemList){
|
||||
wmsMaterialPfepItem.setHandle(WmsMaterialPfepItem.genHandle(dto.getHandle(), wmsMaterialPfepItem.getStorageBinBo()));
|
||||
wmsMaterialPfepItem.setParentBo(dto.getHandle());
|
||||
wmsMaterialPfepItem.setSeqNum(seqNum);
|
||||
seqNum = seqNum+1;
|
||||
wmsMaterialPfepItem.setCreator(SecurityUtils.getUserName());
|
||||
wmsMaterialPfepItem.setDateCreate(LocalDateTime.now());
|
||||
wmsMaterialPfepItemMapper.insert(wmsMaterialPfepItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public WmsMaterialPfep getByHandle(String handle) {
|
||||
WmsMaterialPfep wmMaterialPfep = this.baseMapper.getOneObjByHandle(handle);
|
||||
if (wmMaterialPfep != null) {
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = wmsMaterialPfepItemMapper.getAllWmMaterialPfepItemByParentBo(wmMaterialPfep.getHandle());
|
||||
wmMaterialPfep.setWmsMaterialPfepItemList(wmsMaterialPfepItemList);
|
||||
}
|
||||
return wmMaterialPfep;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWmMaterialPfep(WmsMaterialPfep dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setSite(site);
|
||||
dto.setItemBo(Item.genHandle(site,dto.getItem(),"#"));
|
||||
dto.setUpdater(SecurityUtils.getUserName());
|
||||
dto.setDateUpdate(LocalDateTime.now());
|
||||
this.baseMapper.updateById(dto);
|
||||
// 先删除明细再全部新增
|
||||
wmsMaterialPfepItemMapper.delete(new QueryWrapper<WmsMaterialPfepItem>().lambda().eq(WmsMaterialPfepItem::getParentBo, dto.getHandle()));
|
||||
// 保存明细数据
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = dto.getWmsMaterialPfepItemList();
|
||||
if(wmsMaterialPfepItemList != null && wmsMaterialPfepItemList.size()>0){
|
||||
Integer seqNum = 1;
|
||||
for (WmsMaterialPfepItem wmsMaterialPfepItem : wmsMaterialPfepItemList){
|
||||
wmsMaterialPfepItem.setHandle(WmsMaterialPfepItem.genHandle(dto.getHandle(), wmsMaterialPfepItem.getStorageBinBo()));
|
||||
wmsMaterialPfepItem.setParentBo(dto.getHandle());
|
||||
wmsMaterialPfepItem.setSeqNum(seqNum);
|
||||
seqNum = seqNum+1;
|
||||
wmsMaterialPfepItem.setCreator(SecurityUtils.getUserName());
|
||||
wmsMaterialPfepItem.setDateCreate(LocalDateTime.now());
|
||||
wmsMaterialPfepItemMapper.insert(wmsMaterialPfepItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void saveWmMaterialPfep(WmsMaterialPfep dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setSite(site);
|
||||
dto.setItemBo(Item.genHandle(site, dto.getItem(), "#"));
|
||||
dto.setHandle(WmsMaterialPfep.genHandle(dto.getSite(), dto.getItemBo()));
|
||||
dto.setCreator(SecurityUtils.getUserName());
|
||||
dto.setDateCreate(LocalDateTime.now());
|
||||
this.baseMapper.insert(dto);
|
||||
// 保存明细数据
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = dto.getWmsMaterialPfepItemList();
|
||||
Integer seqNum = 1;
|
||||
if (wmsMaterialPfepItemList != null && wmsMaterialPfepItemList.size() > 0) {
|
||||
for (WmsMaterialPfepItem wmsMaterialPfepItem : wmsMaterialPfepItemList) {
|
||||
wmsMaterialPfepItem.setHandle(WmsMaterialPfepItem.genHandle(dto.getHandle(), wmsMaterialPfepItem.getStorageBinBo()));
|
||||
wmsMaterialPfepItem.setParentBo(dto.getHandle());
|
||||
wmsMaterialPfepItem.setSeqNum(seqNum);
|
||||
seqNum = seqNum + 1;
|
||||
wmsMaterialPfepItem.setCreator(SecurityUtils.getUserName());
|
||||
wmsMaterialPfepItem.setDateCreate(LocalDateTime.now());
|
||||
wmsMaterialPfepItemMapper.insert(wmsMaterialPfepItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteWmMaterialPfep(String handle) {
|
||||
this.removeById(handle);
|
||||
// 先删除明细再全部新增
|
||||
wmsMaterialPfepItemMapper.delete(new QueryWrapper<WmsMaterialPfepItem>().lambda().eq(WmsMaterialPfepItem::getParentBo, handle));
|
||||
}
|
||||
@Override
|
||||
public void updateWmMaterialPfep(WmsMaterialPfep dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setSite(site);
|
||||
dto.setItemBo(Item.genHandle(site, dto.getItem(), "#"));
|
||||
dto.setUpdater(SecurityUtils.getUserName());
|
||||
dto.setDateUpdate(LocalDateTime.now());
|
||||
this.baseMapper.updateById(dto);
|
||||
// 先删除明细再全部新增
|
||||
wmsMaterialPfepItemMapper.delete(new QueryWrapper<WmsMaterialPfepItem>().lambda().eq(WmsMaterialPfepItem::getParentBo, dto.getHandle()));
|
||||
// 保存明细数据
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = dto.getWmsMaterialPfepItemList();
|
||||
if (wmsMaterialPfepItemList != null && wmsMaterialPfepItemList.size() > 0) {
|
||||
Integer seqNum = 1;
|
||||
for (WmsMaterialPfepItem wmsMaterialPfepItem : wmsMaterialPfepItemList) {
|
||||
wmsMaterialPfepItem.setHandle(WmsMaterialPfepItem.genHandle(dto.getHandle(), wmsMaterialPfepItem.getStorageBinBo()));
|
||||
wmsMaterialPfepItem.setParentBo(dto.getHandle());
|
||||
wmsMaterialPfepItem.setSeqNum(seqNum);
|
||||
seqNum = seqNum + 1;
|
||||
wmsMaterialPfepItem.setCreator(SecurityUtils.getUserName());
|
||||
wmsMaterialPfepItem.setDateCreate(LocalDateTime.now());
|
||||
wmsMaterialPfepItemMapper.insert(wmsMaterialPfepItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialPfepItem> getWmMaterialPfepDetailList(WmsMaterialPfep dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setItemBo(Item.genHandle(site,dto.getItem(),"#"));
|
||||
String storageBin = dto.getStorageBin();
|
||||
String storageBinBo = null;
|
||||
if (storageBin != null) {
|
||||
storageBinBo = "StorageBinBO:"+site+","+dto.getStorageBin();
|
||||
}
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = new ArrayList<>();
|
||||
WmsMaterialPfep wmsMaterialPfep = this.baseMapper.selectOne(new QueryWrapper<WmsMaterialPfep>().lambda().eq(WmsMaterialPfep::getItemBo, dto.getItemBo()));
|
||||
if (wmsMaterialPfep != null) {
|
||||
wmsMaterialPfepItemList = wmsMaterialPfepItemMapper.getDetailListByParentBo(wmsMaterialPfep.getHandle(),"ENABLE",storageBinBo);
|
||||
}
|
||||
if (storageBinBo != null) {
|
||||
if (wmsMaterialPfepItemList.size() == 0) {
|
||||
throw BusinessException.build("当前货位号["+dto.getStorageBin()+"]不存在");
|
||||
}
|
||||
}
|
||||
return wmsMaterialPfepItemList;
|
||||
}
|
||||
@Override
|
||||
public void deleteWmMaterialPfep(String handle) {
|
||||
this.removeById(handle);
|
||||
// 先删除明细再全部新增
|
||||
wmsMaterialPfepItemMapper.delete(new QueryWrapper<WmsMaterialPfepItem>().lambda().eq(WmsMaterialPfepItem::getParentBo, handle));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialPfepItem> getWmMaterialPfepDetailList(WmsMaterialPfep dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setItemBo(Item.genHandle(site, dto.getItem(), "#"));
|
||||
String storageBin = dto.getStorageBin();
|
||||
String storageBinBo = null;
|
||||
if (storageBin != null) {
|
||||
storageBinBo = "StorageBinBO:" + site + "," + dto.getStorageBin();
|
||||
}
|
||||
List<WmsMaterialPfepItem> wmsMaterialPfepItemList = new ArrayList<>();
|
||||
WmsMaterialPfep wmsMaterialPfep = this.baseMapper.selectOne(new QueryWrapper<WmsMaterialPfep>().lambda().eq(WmsMaterialPfep::getItemBo, dto.getItemBo()));
|
||||
if (wmsMaterialPfep != null) {
|
||||
wmsMaterialPfepItemList = wmsMaterialPfepItemMapper.getDetailListByParentBo(wmsMaterialPfep.getHandle(), "ENABLE", storageBinBo);
|
||||
}
|
||||
if (storageBinBo != null) {
|
||||
if (wmsMaterialPfepItemList.size() == 0) {
|
||||
throw BusinessException.build("当前货位号[" + dto.getStorageBin() + "]不存在");
|
||||
}
|
||||
}
|
||||
return wmsMaterialPfepItemList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ public class WmsOutDeliveryServiceImpl extends ServiceImpl<WmsOutDeliveryMapper,
|
||||
WmsCuttingPackage wmsCuttingPackage = wmsCuttingPackageService.findObjDataByBatchNumber(batchNumber, site);
|
||||
if (wmsCuttingPackage == null) {
|
||||
throw BusinessException.build("此标签号不存在!");
|
||||
} else if ("1".equals(wmsOutDelivery.getType()) ) {
|
||||
} else if ("1".equals(wmsOutDelivery.getType())) {
|
||||
wmsCuttingPackage.setOutState("1");
|
||||
wmsCuttingPackage.setPackageNumber(null); // 单只出时进行解绑
|
||||
wmsCuttingPackage.setUpdater(SecurityUtils.getUserName());
|
||||
@ -118,14 +118,14 @@ public class WmsOutDeliveryServiceImpl extends ServiceImpl<WmsOutDeliveryMapper,
|
||||
wmsCuttingPackageService.updateById(wmsCuttingPackage);
|
||||
// 更新库存
|
||||
wmsInventoryService.outInventoryByMaterialLot(site, batchNumber, qty);
|
||||
} else if("2".equals(wmsOutDelivery.getType())){
|
||||
} else if ("2".equals(wmsOutDelivery.getType())) {
|
||||
wmsCuttingPackage.setOutState("1");
|
||||
wmsCuttingPackage.setUpdater(SecurityUtils.getUserName());
|
||||
wmsCuttingPackage.setDateUpdate(LocalDateTime.now());
|
||||
wmsCuttingPackageService.updateById(wmsCuttingPackage);
|
||||
// 更新库存
|
||||
wmsInventoryService.outInventoryByMaterialLot(site, batchNumber, qty);
|
||||
}else if ("3".equals(wmsOutDelivery.getType())) {
|
||||
} else if ("3".equals(wmsOutDelivery.getType())) {
|
||||
BigDecimal qtyHand = new BigDecimal(wmsCuttingPackage.getLength());
|
||||
// 彩包拖
|
||||
if (qty.compareTo(qtyHand) == 0) {
|
||||
|
||||
@ -31,77 +31,74 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class WmsPrinterServiceImpl extends ServiceImpl<WmsPrinterMapper, Printer> implements WmsPrinterService {
|
||||
|
||||
private final RemoteResourceService remoteResourceService;
|
||||
private final RemoteResourceService remoteResourceService;
|
||||
|
||||
@Override
|
||||
public Printer getByCode(String site, String code) {
|
||||
Printer printer;
|
||||
printer = getById(Printer.genHandle(site, code));
|
||||
if (printer == null) {
|
||||
return null;
|
||||
}
|
||||
return printer;
|
||||
}
|
||||
@Override
|
||||
public Printer getByCode(String site, String code) {
|
||||
Printer printer;
|
||||
printer = getById(Printer.genHandle(site, code));
|
||||
return printer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByCode(String site, String code) {
|
||||
String id = Printer.genHandle(site, code);
|
||||
return removeById(id);
|
||||
}
|
||||
@Override
|
||||
public boolean deleteByCode(String site, String code) {
|
||||
String id = Printer.genHandle(site, code);
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean save(String site, Printer printer) {
|
||||
validateBeforeSaveOrUpdate(site, printer);
|
||||
printer.setSite(site);
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
String handle = Printer.genHandle(site, printer.getPrinterId());
|
||||
printer.setHandle(handle);
|
||||
printer.setModifyDateTime(time);
|
||||
printer.setModifyUser(user);
|
||||
try {
|
||||
return super.save(printer);
|
||||
} catch (Exception e) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("系统中已存在指定的值:[" + e.getCause().getLocalizedMessage() + "]");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean save(String site, Printer printer) {
|
||||
validateBeforeSaveOrUpdate(site, printer);
|
||||
printer.setSite(site);
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
String handle = Printer.genHandle(site, printer.getPrinterId());
|
||||
printer.setHandle(handle);
|
||||
printer.setModifyDateTime(time);
|
||||
printer.setModifyUser(user);
|
||||
try {
|
||||
return super.save(printer);
|
||||
} catch (Exception e) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("系统中已存在指定的值:[" + e.getCause().getLocalizedMessage() + "]");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateById(String site, Printer printer) {
|
||||
String handle = printer.getHandle();
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
printer.setModifyDateTime(time);
|
||||
printer.setModifyUser(user);
|
||||
if (StrUtil.isBlank(handle)) {
|
||||
throw BusinessException.build("handle不能为空");
|
||||
}
|
||||
validateBeforeSaveOrUpdate(site, printer);
|
||||
return super.updateById(printer);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateById(String site, Printer printer) {
|
||||
String handle = printer.getHandle();
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
String user = SecurityUtils.getUserName();
|
||||
printer.setModifyDateTime(time);
|
||||
printer.setModifyUser(user);
|
||||
if (StrUtil.isBlank(handle)) {
|
||||
throw BusinessException.build("handle不能为空");
|
||||
}
|
||||
validateBeforeSaveOrUpdate(site, printer);
|
||||
return super.updateById(printer);
|
||||
}
|
||||
|
||||
private void validateBeforeSaveOrUpdate(String site, Printer printer) {
|
||||
if (StrUtil.isBlank(printer.getPrintScenario())) {
|
||||
throw BusinessException.build("打印场景不能为空");
|
||||
}
|
||||
String resrceHandle = Resrce.genHandle(site, printer.getResource());
|
||||
Resrce resrce = remoteResourceService.getById(resrceHandle, SecurityConstants.FROM_IN).getData();
|
||||
if (StrUtil.isNotBlank(printer.getResource()) && resrce == null) {
|
||||
throw BusinessException.build("关联资源作业[" + printer.getResource() + "]不存在");
|
||||
}
|
||||
}
|
||||
private void validateBeforeSaveOrUpdate(String site, Printer printer) {
|
||||
if (StrUtil.isBlank(printer.getPrintScenario())) {
|
||||
throw BusinessException.build("打印场景不能为空");
|
||||
}
|
||||
String resrceHandle = Resrce.genHandle(site, printer.getResource());
|
||||
Resrce resrce = remoteResourceService.getById(resrceHandle, SecurityConstants.FROM_IN).getData();
|
||||
if (StrUtil.isNotBlank(printer.getResource()) && resrce == null) {
|
||||
throw BusinessException.build("关联资源作业[" + printer.getResource() + "]不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Printer> selectList(Printer printer) {
|
||||
QueryWrapper<Printer> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(printer);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
@Override
|
||||
public List<Printer> selectList(Printer printer) {
|
||||
QueryWrapper<Printer> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(printer);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ public class WmsProductrecServiceImpl extends ServiceImpl<WmsProductrecMapper, W
|
||||
public List<WmsProductrecDTO> getList(WmsProductrecDTO dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
ArrayList<WmsProductrecDTO> wmsProductrecDTOS = new ArrayList<>();
|
||||
List<WmsProductrecDTO> list = wmsProductrecMapper.selectWmsProductrecList(dto.getDocumentNo(),dto.getItem(),site);
|
||||
List<WmsProductrecDTO> list = wmsProductrecMapper.selectWmsProductrecList(dto.getDocumentNo(), dto.getItem(), site);
|
||||
for (WmsProductrecDTO wmsProductrecDTO : list) {
|
||||
wmsProductrecDTO.setQty(wmsProductrecDTO.getMainQty().toString());
|
||||
String item = HandleEnum.ITEM.getPart(wmsProductrecDTO.getItemBo(), 1);
|
||||
@ -57,7 +57,7 @@ public class WmsProductrecServiceImpl extends ServiceImpl<WmsProductrecMapper, W
|
||||
@Override
|
||||
public void saveList(WmsProductrecDTO wmsProductrec) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
List<WmsProductrecDTO> oldList = wmsProductrecMapper.selectWmsProductrecList(wmsProductrec.getDocumentNo(),wmsProductrec.getItem(),site);
|
||||
List<WmsProductrecDTO> oldList = wmsProductrecMapper.selectWmsProductrecList(wmsProductrec.getDocumentNo(), wmsProductrec.getItem(), site);
|
||||
super.removeBatchByIds(oldList);
|
||||
List<WmsProductrec> list = wmsProductrec.getWmsProductrecList();
|
||||
for (WmsProductrec newWmsProductrec : list) {
|
||||
@ -83,12 +83,12 @@ public class WmsProductrecServiceImpl extends ServiceImpl<WmsProductrecMapper, W
|
||||
WmsMaterialPfep wmsMaterialPfep = wmsMaterialPfepMapper.selectOne(new QueryWrapper<WmsMaterialPfep>().lambda().eq(WmsMaterialPfep::getItemBo, itemBo));
|
||||
if (wmsMaterialPfep != null) {
|
||||
wmsMaterialPfepItemList = wmsMaterialPfepItemMapper
|
||||
.getDetailListByParentBo(wmsMaterialPfep.getHandle(),"ENABLE","StorageBinBO:"+site+","+storageBin);
|
||||
.getDetailListByParentBo(wmsMaterialPfep.getHandle(), "ENABLE", "StorageBinBO:" + site + "," + storageBin);
|
||||
}
|
||||
if (wmsMaterialPfepItemList.size() == 0) {
|
||||
throw BusinessException.build("当前货位号["+storageBin+"]不存在");
|
||||
throw BusinessException.build("当前货位号[" + storageBin + "]不存在");
|
||||
}
|
||||
List<WmsProductrecDTO> oldList = wmsProductrecMapper.selectWmsProductrecList(wmsProductrec.getDocumentNo(),wmsProductrec.getItem(),site);
|
||||
List<WmsProductrecDTO> oldList = wmsProductrecMapper.selectWmsProductrecList(wmsProductrec.getDocumentNo(), wmsProductrec.getItem(), site);
|
||||
super.removeBatchByIds(oldList);
|
||||
List<WmsProductrec> list = wmsProductrec.getWmsProductrecList();
|
||||
for (WmsProductrec newWmsProductrec : list) {
|
||||
|
||||
@ -43,197 +43,200 @@ import java.util.Map;
|
||||
@Service
|
||||
public class WmsStorageBinServiceImpl extends ServiceImpl<WmsStorageBinMapper, WmsStorageBin> implements WmsStorageBinService {
|
||||
|
||||
@Autowired
|
||||
private WmsStorageLocationService storageLocationService;
|
||||
@Autowired
|
||||
private WmsStorageLocationService storageLocationService;
|
||||
|
||||
@Autowired
|
||||
private StorageBinTypeService storageBinTypeService;
|
||||
@Autowired
|
||||
private StorageBinTypeService storageBinTypeService;
|
||||
|
||||
@Autowired
|
||||
private PrintService printService;
|
||||
@Autowired
|
||||
private PrintService printService;
|
||||
|
||||
@Autowired
|
||||
private WmsStorageBinMapper storageBinMapper;
|
||||
@Autowired
|
||||
private WmsStorageBinMapper storageBinMapper;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private StorageBinBindInventoryService storageBinBindInventoryService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private StorageBinBindInventoryService storageBinBindInventoryService;
|
||||
|
||||
@Override
|
||||
public IPage getStorageBinPage(Page page, WmsStorageBinDto storageBinDto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
storageBinDto.setSite(site);
|
||||
return storageBinMapper.getStorageBinPage(page,storageBinDto);
|
||||
}
|
||||
@Override
|
||||
public Boolean save(WmsStorageBinDto storageBinDto) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isBlank(storageBinDto.getStorageBin())){
|
||||
throw BusinessException.build("存储货格不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(storageBinDto.getStorageBin())){
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = WmsStorageBin.genHandle(site,storageBinDto.getStorageBin());
|
||||
WmsStorageBin wmsStorageBin = new WmsStorageBin();
|
||||
@Override
|
||||
public IPage getStorageBinPage(Page page, WmsStorageBinDto storageBinDto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
storageBinDto.setSite(site);
|
||||
return storageBinMapper.getStorageBinPage(page, storageBinDto);
|
||||
}
|
||||
|
||||
if(!StrUtil.isBlank(storageBinDto.getStorageLocation()) && StrUtil.isBlank(storageBinDto.getStorageLocationBo())){
|
||||
String s = StorageLocation.genHandle(site, storageBinDto.getStorageLocation());
|
||||
StorageLocation byId = storageLocationService.getById(s);
|
||||
if (byId == null){
|
||||
throw BusinessException.build("不存在此存储位置");
|
||||
}
|
||||
storageBinDto.setStorageLocationBo(byId.getHandle());
|
||||
}
|
||||
BeanUtils.copyProperties(this.validate(storageBinDto,site), wmsStorageBin);
|
||||
wmsStorageBin.setHandle(handle);
|
||||
wmsStorageBin.setSite(site);
|
||||
wmsStorageBin.setCreateTime(localDateTime);
|
||||
wmsStorageBin.setCreator(user);
|
||||
wmsStorageBin.setStatus(WmsStorageBin.STATUS_Y);
|
||||
try {
|
||||
return super.save(wmsStorageBin);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此存储位置已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Boolean save(WmsStorageBinDto storageBinDto) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isBlank(storageBinDto.getStorageBin())) {
|
||||
throw BusinessException.build("存储货格不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(storageBinDto.getStorageBin())) {
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = WmsStorageBin.genHandle(site, storageBinDto.getStorageBin());
|
||||
WmsStorageBin wmsStorageBin = new WmsStorageBin();
|
||||
|
||||
@Override
|
||||
public Boolean updateById(WmsStorageBinDto storageBinDto) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
String handle = storageBinDto.getHandle();
|
||||
WmsStorageBin byId = this.getById(handle);
|
||||
if(!StrUtil.isBlank(storageBinDto.getStorageLocation())){
|
||||
String s = StorageLocation.genHandle(site, storageBinDto.getStorageLocation());
|
||||
StorageLocation storageLocation = storageLocationService.getById(s);
|
||||
if (storageLocation == null){
|
||||
throw BusinessException.build(I18nUtil.getI18nText("wms.wmsStorageBin.error1"));
|
||||
} else if (!StorageLocation.STATUS_Y.equals(storageLocation.getStatus())){
|
||||
throw BusinessException.build(storageLocation.getStorageLocation() + "区域停用,货格不允许置为可用");
|
||||
}
|
||||
storageBinDto.setStorageLocationBo(storageLocation.getHandle());
|
||||
}else{
|
||||
storageBinDto.setStorageLocationBo("");
|
||||
}
|
||||
if (!StrUtil.isBlank(storageBinDto.getStorageLocation()) && StrUtil.isBlank(storageBinDto.getStorageLocationBo())) {
|
||||
String s = StorageLocation.genHandle(site, storageBinDto.getStorageLocation());
|
||||
StorageLocation byId = storageLocationService.getById(s);
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("不存在此存储位置");
|
||||
}
|
||||
storageBinDto.setStorageLocationBo(byId.getHandle());
|
||||
}
|
||||
BeanUtils.copyProperties(this.validate(storageBinDto, site), wmsStorageBin);
|
||||
wmsStorageBin.setHandle(handle);
|
||||
wmsStorageBin.setSite(site);
|
||||
wmsStorageBin.setCreateTime(localDateTime);
|
||||
wmsStorageBin.setCreator(user);
|
||||
wmsStorageBin.setStatus(WmsStorageBin.STATUS_Y);
|
||||
try {
|
||||
return super.save(wmsStorageBin);
|
||||
} catch (Exception e) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此存储位置已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(WmsStorageBin.STATUS_N.equals(storageBinDto.getStatus())){
|
||||
long count = storageBinBindInventoryService.count(Wrappers.lambdaQuery(StorageBinBindInventory.class).eq(StorageBinBindInventory::getStorageBinBo, handle));
|
||||
if (count > 0) {
|
||||
throw BusinessException.build(byId.getStorageBin() + "货格存在货物,不可停用");
|
||||
}
|
||||
}
|
||||
BeanUtils.copyProperties(this.validate(storageBinDto,site),byId);
|
||||
byId.setUpdateTime(localDateTime);
|
||||
byId.setUpdater(user);
|
||||
return super.updateById(byId);
|
||||
}
|
||||
@Override
|
||||
public String labelPrint(String site, List<WmsStorageBin> printList, String printNumber) {
|
||||
PrintResult printResult = null;
|
||||
String user = SecurityUtils.getUserName();
|
||||
List<Map<String, Object>> mapList=new ArrayList<>();
|
||||
for (WmsStorageBin printDto:printList){
|
||||
String storageBin = printDto.getStorageBin();
|
||||
String handle = WmsStorageBin.genHandle(site,storageBin);
|
||||
WmsStorageBin byId = this.getById(handle);
|
||||
if (byId==null){
|
||||
throw BusinessException.build("存储货格"+ storageBin +"不存在");
|
||||
}
|
||||
Map<String,Object> dataMap = new HashMap();
|
||||
dataMap.put("storageNo",storageBin);
|
||||
dataMap.put("description",byId.getDescription());
|
||||
mapList.add(dataMap);
|
||||
}
|
||||
printResult= printService.doPrintForHorizon2(site, user, "", printList.get(0).getStorageBin(), 1, "", Constant.PRINT_SCENARIO_STORAGE_LOCATION, mapList, printNumber);
|
||||
@Override
|
||||
public Boolean updateById(WmsStorageBinDto storageBinDto) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
String handle = storageBinDto.getHandle();
|
||||
WmsStorageBin byId = this.getById(handle);
|
||||
if (!StrUtil.isBlank(storageBinDto.getStorageLocation())) {
|
||||
String s = StorageLocation.genHandle(site, storageBinDto.getStorageLocation());
|
||||
StorageLocation storageLocation = storageLocationService.getById(s);
|
||||
if (storageLocation == null) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("wms.wmsStorageBin.error1"));
|
||||
} else if (!StorageLocation.STATUS_Y.equals(storageLocation.getStatus())) {
|
||||
throw BusinessException.build(storageLocation.getStorageLocation() + "区域停用,货格不允许置为可用");
|
||||
}
|
||||
storageBinDto.setStorageLocationBo(storageLocation.getHandle());
|
||||
} else {
|
||||
storageBinDto.setStorageLocationBo("");
|
||||
}
|
||||
|
||||
return printResult.getMsg();
|
||||
}
|
||||
@Override
|
||||
public WmsStorageBin getByStorageLocation(String site, String storageLocation) {
|
||||
String storageLocationBo = StorageLocation.genHandle(site, storageLocation);
|
||||
LambdaQueryWrapper<WmsStorageBin> queryWrapper=new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(WmsStorageBin::getStorageLocationBo,storageLocationBo);
|
||||
queryWrapper.eq(WmsStorageBin::getIsDefault,"Y");
|
||||
queryWrapper.eq(WmsStorageBin::getStatus, WmsStorageBin.STATUS_Y);
|
||||
List<WmsStorageBin> list = this.list(queryWrapper);
|
||||
if (!list.isEmpty()){
|
||||
return list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (WmsStorageBin.STATUS_N.equals(storageBinDto.getStatus())) {
|
||||
long count = storageBinBindInventoryService.count(Wrappers.lambdaQuery(StorageBinBindInventory.class).eq(StorageBinBindInventory::getStorageBinBo, handle));
|
||||
if (count > 0) {
|
||||
throw BusinessException.build(byId.getStorageBin() + "货格存在货物,不可停用");
|
||||
}
|
||||
}
|
||||
BeanUtils.copyProperties(this.validate(storageBinDto, site), byId);
|
||||
byId.setUpdateTime(localDateTime);
|
||||
byId.setUpdater(user);
|
||||
return super.updateById(byId);
|
||||
}
|
||||
|
||||
//新增和更新时个别字段的验证
|
||||
private WmsStorageBinDto validate(WmsStorageBinDto storageBinDto, String site){
|
||||
//判断是否选择存储货格类型
|
||||
if(StrUtil.isBlank(storageBinDto.getStorageBinType())){
|
||||
throw BusinessException.build("存储货格类型不能为空");
|
||||
}else {
|
||||
String s = StorageBinType.genHandle(site, storageBinDto.getStorageBinType());
|
||||
StorageBinType byId = storageBinTypeService.getById(s);
|
||||
if (byId == null){
|
||||
throw BusinessException.build("不存在此存储货格类型");
|
||||
}
|
||||
storageBinDto.setStorageBinTypeBo(byId.getHandle());
|
||||
}
|
||||
@Override
|
||||
public String labelPrint(String site, List<WmsStorageBin> printList, String printNumber) {
|
||||
PrintResult printResult = null;
|
||||
String user = SecurityUtils.getUserName();
|
||||
List<Map<String, Object>> mapList = new ArrayList<>();
|
||||
for (WmsStorageBin printDto : printList) {
|
||||
String storageBin = printDto.getStorageBin();
|
||||
String handle = WmsStorageBin.genHandle(site, storageBin);
|
||||
WmsStorageBin byId = this.getById(handle);
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("存储货格" + storageBin + "不存在");
|
||||
}
|
||||
Map<String, Object> dataMap = new HashMap();
|
||||
dataMap.put("storageNo", storageBin);
|
||||
dataMap.put("description", byId.getDescription());
|
||||
mapList.add(dataMap);
|
||||
}
|
||||
printResult = printService.doPrintForHorizon2(site, user, "", printList.get(0).getStorageBin(), 1, "", Constant.PRINT_SCENARIO_STORAGE_LOCATION, mapList, printNumber);
|
||||
|
||||
//判断是否为默认存储货格
|
||||
if ("Y".equals(storageBinDto.getIsDefault())){
|
||||
//判断选择的存储货格类型下是否已拥有默认货格
|
||||
LambdaQueryWrapper<WmsStorageBin> queryWrapper = new LambdaQueryWrapper<WmsStorageBin>().eq(WmsStorageBin::getStorageLocationBo,storageBinDto.getStorageLocationBo())
|
||||
.eq(WmsStorageBin::getIsDefault,"Y").eq(WmsStorageBin::getSite,site);
|
||||
WmsStorageBin one = this.getOne(queryWrapper,false);
|
||||
if (one != null && !one.getHandle().equals(storageBinDto.getHandle()) ){
|
||||
throw BusinessException.build("当前存储位置下已有默认存储货格");
|
||||
}
|
||||
}
|
||||
return storageBinDto;
|
||||
}
|
||||
return printResult.getMsg();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageLocation getStorageLocationByStorageBin(String storageBin) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
WmsStorageBin byId = this.getById(WmsStorageBin.genHandle(site, storageBin));
|
||||
if(byId != null){
|
||||
String storageLocationBo = byId.getStorageLocationBo();
|
||||
StorageLocation storageLocation = storageLocationService.getById(storageLocationBo);
|
||||
if (StorageLocation.STATUS_N.equals(storageLocation.getStatus())){
|
||||
throw BusinessException.build("存储位置已停用");
|
||||
} else {
|
||||
return storageLocation;
|
||||
}
|
||||
}else {
|
||||
throw BusinessException.build("存储货格" + storageBin + "不存在");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public WmsStorageBin getByStorageLocation(String site, String storageLocation) {
|
||||
String storageLocationBo = StorageLocation.genHandle(site, storageLocation);
|
||||
LambdaQueryWrapper<WmsStorageBin> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(WmsStorageBin::getStorageLocationBo, storageLocationBo);
|
||||
queryWrapper.eq(WmsStorageBin::getIsDefault, "Y");
|
||||
queryWrapper.eq(WmsStorageBin::getStatus, WmsStorageBin.STATUS_Y);
|
||||
List<WmsStorageBin> list = this.list(queryWrapper);
|
||||
if (!list.isEmpty()) {
|
||||
return list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WmsStorageBinDto getByCode(String site, String storageBin) {
|
||||
WmsStorageBinDto storageBinDto = new WmsStorageBinDto();
|
||||
WmsStorageBin byId = this.getById(WmsStorageBin.genHandle(site, storageBin));
|
||||
if (byId==null){
|
||||
throw BusinessException.build("存储货格"+storageBin+"不存在");
|
||||
} else if (WmsStorageBin.STATUS_N.equals(byId.getStatus())) {
|
||||
throw BusinessException.build("存储货格"+storageBin+"已停用");
|
||||
}
|
||||
BeanUtils.copyProperties(byId,storageBinDto);
|
||||
StorageBinType storageBinType = storageBinTypeService.getById(byId.getStorageBinTypeBo());
|
||||
StorageLocation storageLocation = storageLocationService.getById(byId.getStorageLocationBo());
|
||||
storageBinDto.setStorageLocation(storageLocation.getStorageLocation());
|
||||
storageBinDto.setErpStorageLocation(storageLocation.getErpStorageLocation());
|
||||
storageBinDto.setStorageBinQty(storageBinType.getStorageBinQty());
|
||||
storageBinDto.setMixItem(storageBinType.getMixItem());
|
||||
return storageBinDto;
|
||||
}
|
||||
//新增和更新时个别字段的验证
|
||||
private WmsStorageBinDto validate(WmsStorageBinDto storageBinDto, String site) {
|
||||
//判断是否选择存储货格类型
|
||||
if (StrUtil.isBlank(storageBinDto.getStorageBinType())) {
|
||||
throw BusinessException.build("存储货格类型不能为空");
|
||||
} else {
|
||||
String s = StorageBinType.genHandle(site, storageBinDto.getStorageBinType());
|
||||
StorageBinType byId = storageBinTypeService.getById(s);
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("不存在此存储货格类型");
|
||||
}
|
||||
storageBinDto.setStorageBinTypeBo(byId.getHandle());
|
||||
}
|
||||
|
||||
//判断是否为默认存储货格
|
||||
if ("Y".equals(storageBinDto.getIsDefault())) {
|
||||
//判断选择的存储货格类型下是否已拥有默认货格
|
||||
LambdaQueryWrapper<WmsStorageBin> queryWrapper = new LambdaQueryWrapper<WmsStorageBin>().eq(WmsStorageBin::getStorageLocationBo, storageBinDto.getStorageLocationBo())
|
||||
.eq(WmsStorageBin::getIsDefault, "Y").eq(WmsStorageBin::getSite, site);
|
||||
WmsStorageBin one = this.getOne(queryWrapper, false);
|
||||
if (one != null && !one.getHandle().equals(storageBinDto.getHandle())) {
|
||||
throw BusinessException.build("当前存储位置下已有默认存储货格");
|
||||
}
|
||||
}
|
||||
return storageBinDto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageLocation getStorageLocationByStorageBin(String storageBin) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
WmsStorageBin byId = this.getById(WmsStorageBin.genHandle(site, storageBin));
|
||||
if (byId != null) {
|
||||
String storageLocationBo = byId.getStorageLocationBo();
|
||||
StorageLocation storageLocation = storageLocationService.getById(storageLocationBo);
|
||||
if (StorageLocation.STATUS_N.equals(storageLocation.getStatus())) {
|
||||
throw BusinessException.build("存储位置已停用");
|
||||
} else {
|
||||
return storageLocation;
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("存储货格" + storageBin + "不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WmsStorageBinDto getByCode(String site, String storageBin) {
|
||||
WmsStorageBinDto storageBinDto = new WmsStorageBinDto();
|
||||
WmsStorageBin byId = this.getById(WmsStorageBin.genHandle(site, storageBin));
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("存储货格" + storageBin + "不存在");
|
||||
} else if (WmsStorageBin.STATUS_N.equals(byId.getStatus())) {
|
||||
throw BusinessException.build("存储货格" + storageBin + "已停用");
|
||||
}
|
||||
BeanUtils.copyProperties(byId, storageBinDto);
|
||||
StorageBinType storageBinType = storageBinTypeService.getById(byId.getStorageBinTypeBo());
|
||||
StorageLocation storageLocation = storageLocationService.getById(byId.getStorageLocationBo());
|
||||
storageBinDto.setStorageLocation(storageLocation.getStorageLocation());
|
||||
storageBinDto.setErpStorageLocation(storageLocation.getErpStorageLocation());
|
||||
storageBinDto.setStorageBinQty(storageBinType.getStorageBinQty());
|
||||
storageBinDto.setMixItem(storageBinType.getMixItem());
|
||||
return storageBinDto;
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,223 +43,225 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class WmsStorageLocationServiceImpl extends ServiceImpl<WmsStorageLocationMapper, StorageLocation> implements WmsStorageLocationService {
|
||||
|
||||
@Autowired
|
||||
private WmsWareHouseService warehouseServiceWms;
|
||||
@Autowired
|
||||
private WmsWareHouseService warehouseServiceWms;
|
||||
|
||||
@Autowired
|
||||
private StorageLocationTypeService storageLocationTypeService;
|
||||
@Autowired
|
||||
private StorageLocationTypeService storageLocationTypeService;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WmsStorageBinService storageBinService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WmsStorageBinService storageBinService;
|
||||
|
||||
@Autowired
|
||||
private PrintService printService;
|
||||
@Autowired
|
||||
private PrintService printService;
|
||||
|
||||
@Autowired
|
||||
private WmsStorageLocationMapper storageLocationMapper;
|
||||
@Autowired
|
||||
private WmsStorageLocationMapper storageLocationMapper;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private StorageBinBindInventoryService storageBinBindInventoryService;
|
||||
@Override
|
||||
public IPage getStorageLocationPageBycode(Page page, String str) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
List<StorageLocation> dtoList = new ArrayList<>();
|
||||
IPage result = new Page();
|
||||
String[] strArr= str.split(",");
|
||||
for(String storageLocation: strArr){
|
||||
String handle = StorageLocation.genHandle(site,storageLocation);
|
||||
StorageLocation byId = this.getById(handle);
|
||||
if(byId != null){
|
||||
dtoList.add(byId);
|
||||
}
|
||||
}
|
||||
result.setRecords(dtoList);
|
||||
return result;
|
||||
}
|
||||
@Autowired
|
||||
@Lazy
|
||||
private StorageBinBindInventoryService storageBinBindInventoryService;
|
||||
|
||||
@Override
|
||||
public IPage getStorageLocationPage(Page page, StorageLocationDto storageLocationDto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
storageLocationDto.setSite(site);
|
||||
return storageLocationMapper.getStorageLocationPage(page,storageLocationDto);
|
||||
}
|
||||
@Override
|
||||
public IPage getStorageLocationPageBycode(Page page, String str) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
List<StorageLocation> dtoList = new ArrayList<>();
|
||||
IPage result = new Page();
|
||||
String[] strArr = str.split(",");
|
||||
for (String storageLocation : strArr) {
|
||||
String handle = StorageLocation.genHandle(site, storageLocation);
|
||||
StorageLocation byId = this.getById(handle);
|
||||
if (byId != null) {
|
||||
dtoList.add(byId);
|
||||
}
|
||||
}
|
||||
result.setRecords(dtoList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<StorageLocation> findStorageLocationList(Page page, String site, StorageLocation storageLocation) {
|
||||
return this.baseMapper.findStorageLocationList(page,site,storageLocation);
|
||||
}
|
||||
@Override
|
||||
public IPage getStorageLocationPage(Page page, StorageLocationDto storageLocationDto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
storageLocationDto.setSite(site);
|
||||
return storageLocationMapper.getStorageLocationPage(page, storageLocationDto);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Boolean save(StorageLocationDto storageLocationDto) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isBlank(storageLocationDto.getStorageLocation())){
|
||||
throw BusinessException.build("存储位置不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(storageLocationDto.getStorageLocation())){
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = StorageLocation.genHandle(site,storageLocationDto.getStorageLocation());
|
||||
StorageLocation storageLocation = new StorageLocation();
|
||||
BeanUtils.copyProperties(this.validate(storageLocationDto),storageLocation);
|
||||
storageLocation.setHandle(handle);
|
||||
storageLocation.setSite(site);
|
||||
storageLocation.setCreateTime(localDateTime);
|
||||
storageLocation.setCreator(user);
|
||||
storageLocation.setStatus(StorageLocation.STATUS_Y);
|
||||
try {
|
||||
return super.save(storageLocation);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此存储位置已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public IPage<StorageLocation> findStorageLocationList(Page page, String site, StorageLocation storageLocation) {
|
||||
return this.baseMapper.findStorageLocationList(page, site, storageLocation);
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Boolean save(StorageLocationDto storageLocationDto) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isBlank(storageLocationDto.getStorageLocation())) {
|
||||
throw BusinessException.build("存储位置不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(storageLocationDto.getStorageLocation())) {
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = StorageLocation.genHandle(site, storageLocationDto.getStorageLocation());
|
||||
StorageLocation storageLocation = new StorageLocation();
|
||||
BeanUtils.copyProperties(this.validate(storageLocationDto), storageLocation);
|
||||
storageLocation.setHandle(handle);
|
||||
storageLocation.setSite(site);
|
||||
storageLocation.setCreateTime(localDateTime);
|
||||
storageLocation.setCreator(user);
|
||||
storageLocation.setStatus(StorageLocation.STATUS_Y);
|
||||
try {
|
||||
return super.save(storageLocation);
|
||||
} catch (Exception e) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此存储位置已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Boolean updateById(StorageLocationDto storageLocationDto) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
String handle = storageLocationDto.getHandle();
|
||||
StorageLocation byId = this.getById(handle);
|
||||
StorageLocationDto validate = this.validate(storageLocationDto);
|
||||
BeanUtils.copyProperties(validate,byId);
|
||||
byId.setUpdater(user);
|
||||
byId.setUpdateTime(localDateTime);
|
||||
changeStorageBinStatus(handle,byId.getStatus());
|
||||
return super.updateById(byId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeById(String handle) {
|
||||
LambdaQueryWrapper<WmsStorageBin> queryWrapper = new LambdaQueryWrapper<WmsStorageBin>().eq(WmsStorageBin::getStorageLocationBo,handle);
|
||||
WmsStorageBin one = storageBinService.getOne(queryWrapper,false);
|
||||
if (one != null){
|
||||
throw BusinessException.build("存储位置正在被使用,不可删除");
|
||||
}
|
||||
return super.removeById(handle);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Boolean updateById(StorageLocationDto storageLocationDto) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
String handle = storageLocationDto.getHandle();
|
||||
StorageLocation byId = this.getById(handle);
|
||||
StorageLocationDto validate = this.validate(storageLocationDto);
|
||||
BeanUtils.copyProperties(validate, byId);
|
||||
byId.setUpdater(user);
|
||||
byId.setUpdateTime(localDateTime);
|
||||
changeStorageBinStatus(handle, byId.getStatus());
|
||||
return super.updateById(byId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeById(String handle) {
|
||||
LambdaQueryWrapper<WmsStorageBin> queryWrapper = new LambdaQueryWrapper<WmsStorageBin>().eq(WmsStorageBin::getStorageLocationBo, handle);
|
||||
WmsStorageBin one = storageBinService.getOne(queryWrapper, false);
|
||||
if (one != null) {
|
||||
throw BusinessException.build("存储位置正在被使用,不可删除");
|
||||
}
|
||||
return super.removeById(handle);
|
||||
}
|
||||
|
||||
|
||||
//保存和更新时需验证的字段
|
||||
private StorageLocationDto validate(StorageLocationDto storageLocationDto){
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//保存和更新时需验证的字段
|
||||
private StorageLocationDto validate(StorageLocationDto storageLocationDto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
//判断是否选择存储位置类型
|
||||
if(StrUtil.isBlank(storageLocationDto.getStorageLocationType())){
|
||||
throw BusinessException.build("存储位置类型不能为空");
|
||||
}else {
|
||||
String s = StorageLocationType.genHandle(site, storageLocationDto.getStorageLocationType());
|
||||
StorageLocationType byId = storageLocationTypeService.getById(s);
|
||||
if (byId == null){
|
||||
throw BusinessException.build("不存在此存储位置类型");
|
||||
}
|
||||
storageLocationDto.setStorageLocationTypeBo(byId.getHandle());
|
||||
}
|
||||
//判断是否选择存储位置类型
|
||||
if (StrUtil.isBlank(storageLocationDto.getStorageLocationType())) {
|
||||
throw BusinessException.build("存储位置类型不能为空");
|
||||
} else {
|
||||
String s = StorageLocationType.genHandle(site, storageLocationDto.getStorageLocationType());
|
||||
StorageLocationType byId = storageLocationTypeService.getById(s);
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("不存在此存储位置类型");
|
||||
}
|
||||
storageLocationDto.setStorageLocationTypeBo(byId.getHandle());
|
||||
}
|
||||
|
||||
//判断是否选择仓库
|
||||
if(StrUtil.isBlank(storageLocationDto.getWarehouse())){
|
||||
throw BusinessException.build("仓库不能为空");
|
||||
}else {
|
||||
String s = WmsWareHouse.genHandle(site, storageLocationDto.getWarehouse());
|
||||
WmsWareHouse byId = warehouseServiceWms.getById(s);
|
||||
if (byId == null){
|
||||
throw BusinessException.build("不存在此仓库");
|
||||
}
|
||||
storageLocationDto.setWarehouseBo(byId.getHandle());
|
||||
}
|
||||
//判断是否选择仓库
|
||||
if (StrUtil.isBlank(storageLocationDto.getWarehouse())) {
|
||||
throw BusinessException.build("仓库不能为空");
|
||||
} else {
|
||||
String s = WmsWareHouse.genHandle(site, storageLocationDto.getWarehouse());
|
||||
WmsWareHouse byId = warehouseServiceWms.getById(s);
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("不存在此仓库");
|
||||
}
|
||||
storageLocationDto.setWarehouseBo(byId.getHandle());
|
||||
}
|
||||
|
||||
//判断是否为默认存储位置
|
||||
if ("Y".equals(storageLocationDto.getIsDefault())){
|
||||
//判断选择的存储位置类型下是否已存在默认的存储位置
|
||||
LambdaQueryWrapper<StorageLocation> queryWrapper = new LambdaQueryWrapper<StorageLocation>().ne(StorageLocation::getHandle,StorageLocation.genHandle(site,storageLocationDto.getStorageLocation())).eq(StorageLocation::getErpStorageLocation,storageLocationDto.getErpStorageLocation())
|
||||
.eq(StorageLocation::getIsDefault,"Y").eq(StorageLocation::getSite,site);
|
||||
StorageLocation one = this.getOne(queryWrapper,false);
|
||||
if (one != null){
|
||||
throw BusinessException.build("当前ERP仓库下已有默认存储位置");
|
||||
}
|
||||
//判断是否为默认存储位置
|
||||
if ("Y".equals(storageLocationDto.getIsDefault())) {
|
||||
//判断选择的存储位置类型下是否已存在默认的存储位置
|
||||
LambdaQueryWrapper<StorageLocation> queryWrapper = new LambdaQueryWrapper<StorageLocation>().ne(StorageLocation::getHandle, StorageLocation.genHandle(site, storageLocationDto.getStorageLocation())).eq(StorageLocation::getErpStorageLocation, storageLocationDto.getErpStorageLocation())
|
||||
.eq(StorageLocation::getIsDefault, "Y").eq(StorageLocation::getSite, site);
|
||||
StorageLocation one = this.getOne(queryWrapper, false);
|
||||
if (one != null) {
|
||||
throw BusinessException.build("当前ERP仓库下已有默认存储位置");
|
||||
}
|
||||
|
||||
}
|
||||
return storageLocationDto;
|
||||
}
|
||||
}
|
||||
return storageLocationDto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WmsStorageBin getStorageBin(String site, String storageLocation) {
|
||||
String storageLocationBo = StorageLocation.genHandle(site,storageLocation);
|
||||
if(this.getById(storageLocationBo) == null){
|
||||
throw BusinessException.build("存储位置’" + storageLocation + "‘不存在");
|
||||
}
|
||||
LambdaQueryWrapper<WmsStorageBin> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(WmsStorageBin::getSite,site).eq(WmsStorageBin::getStorageLocationBo,storageLocationBo).eq(WmsStorageBin::getIsDefault,"Y");
|
||||
WmsStorageBin one = storageBinService.getOne(lambdaQueryWrapper);
|
||||
if(one == null){
|
||||
throw BusinessException.build("存储位置"+ storageLocation +"不存在默认货格");
|
||||
} else if (WmsStorageBin.STATUS_N.equals(one.getStatus())) {
|
||||
throw BusinessException.build("存储位置"+ storageLocation +"的默认货格" + one.getStorageBin() + "已停用");
|
||||
}
|
||||
return one;
|
||||
}
|
||||
@Override
|
||||
public WmsStorageBin getStorageBin(String site, String storageLocation) {
|
||||
String storageLocationBo = StorageLocation.genHandle(site, storageLocation);
|
||||
if (this.getById(storageLocationBo) == null) {
|
||||
throw BusinessException.build("存储位置’" + storageLocation + "‘不存在");
|
||||
}
|
||||
LambdaQueryWrapper<WmsStorageBin> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(WmsStorageBin::getSite, site).eq(WmsStorageBin::getStorageLocationBo, storageLocationBo).eq(WmsStorageBin::getIsDefault, "Y");
|
||||
WmsStorageBin one = storageBinService.getOne(lambdaQueryWrapper);
|
||||
if (one == null) {
|
||||
throw BusinessException.build("存储位置" + storageLocation + "不存在默认货格");
|
||||
} else if (WmsStorageBin.STATUS_N.equals(one.getStatus())) {
|
||||
throw BusinessException.build("存储位置" + storageLocation + "的默认货格" + one.getStorageBin() + "已停用");
|
||||
}
|
||||
return one;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageLocation getDefaultLocation(String site, String erpStorageLocation) {
|
||||
LambdaQueryWrapper<StorageLocation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(StorageLocation::getSite,site).eq(StorageLocation::getErpStorageLocation,erpStorageLocation).eq(StorageLocation::getIsDefault,"Y");
|
||||
StorageLocation one = this.getOne(lambdaQueryWrapper);
|
||||
if (one==null){
|
||||
throw BusinessException.build("ERP存储位置"+ erpStorageLocation +"不存在默认存储区域");
|
||||
} else if (StorageLocation.STATUS_N.equals(one.getStatus())) {
|
||||
throw BusinessException.build("ERP存储位置"+ erpStorageLocation +"的默认存储区域" + one.getStorageLocation() + "已停用");
|
||||
}
|
||||
return one;
|
||||
}
|
||||
@Override
|
||||
public String labelRePrint(String site,List<StorageLocation> printList, String printNumber) {
|
||||
PrintResult printResult = null;
|
||||
String user = SecurityUtils.getUserName();
|
||||
List<Map<String, Object>> mapList=new ArrayList<>();
|
||||
for (StorageLocation print:printList){
|
||||
String storageLocation = print.getStorageLocation();
|
||||
String handle = StorageLocation.genHandle(site,storageLocation);
|
||||
StorageLocation byId = this.getById(handle);
|
||||
if (byId==null){
|
||||
throw BusinessException.build("存储位置"+ storageLocation +"不存在");
|
||||
}
|
||||
Map<String,Object> dataMap = new HashMap();
|
||||
dataMap.put("storageNo",storageLocation);
|
||||
dataMap.put("description",byId.getDescription());
|
||||
mapList.add(dataMap);
|
||||
}
|
||||
printResult = printService.doPrintForHorizon2(site, user, "", printList.get(0).getStorageLocation(), 1, "", Constant.PRINT_SCENARIO_STORAGE_LOCATION, mapList , printNumber);
|
||||
@Override
|
||||
public StorageLocation getDefaultLocation(String site, String erpStorageLocation) {
|
||||
LambdaQueryWrapper<StorageLocation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(StorageLocation::getSite, site).eq(StorageLocation::getErpStorageLocation, erpStorageLocation).eq(StorageLocation::getIsDefault, "Y");
|
||||
StorageLocation one = this.getOne(lambdaQueryWrapper);
|
||||
if (one == null) {
|
||||
throw BusinessException.build("ERP存储位置" + erpStorageLocation + "不存在默认存储区域");
|
||||
} else if (StorageLocation.STATUS_N.equals(one.getStatus())) {
|
||||
throw BusinessException.build("ERP存储位置" + erpStorageLocation + "的默认存储区域" + one.getStorageLocation() + "已停用");
|
||||
}
|
||||
return one;
|
||||
}
|
||||
|
||||
return printResult.getMsg();
|
||||
}
|
||||
@Override
|
||||
public String labelRePrint(String site, List<StorageLocation> printList, String printNumber) {
|
||||
PrintResult printResult = null;
|
||||
String user = SecurityUtils.getUserName();
|
||||
List<Map<String, Object>> mapList = new ArrayList<>();
|
||||
for (StorageLocation print : printList) {
|
||||
String storageLocation = print.getStorageLocation();
|
||||
String handle = StorageLocation.genHandle(site, storageLocation);
|
||||
StorageLocation byId = this.getById(handle);
|
||||
if (byId == null) {
|
||||
throw BusinessException.build("存储位置" + storageLocation + "不存在");
|
||||
}
|
||||
Map<String, Object> dataMap = new HashMap();
|
||||
dataMap.put("storageNo", storageLocation);
|
||||
dataMap.put("description", byId.getDescription());
|
||||
mapList.add(dataMap);
|
||||
}
|
||||
printResult = printService.doPrintForHorizon2(site, user, "", printList.get(0).getStorageLocation(), 1, "", Constant.PRINT_SCENARIO_STORAGE_LOCATION, mapList, printNumber);
|
||||
|
||||
private void changeStorageBinStatus(String storageLocationBo,String status){
|
||||
List<String> storageBinBoList = storageBinService.list(Wrappers.lambdaQuery(WmsStorageBin.class).eq(WmsStorageBin::getStorageLocationBo, storageLocationBo).eq(WmsStorageBin::getStatus, WmsStorageBin.STATUS_Y).select(WmsStorageBin::getHandle))
|
||||
.stream().map(WmsStorageBin::getHandle).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(storageBinBoList)) {
|
||||
if (StorageLocation.STATUS_Y.equals(status)) {
|
||||
storageBinService.update(Wrappers.lambdaUpdate(WmsStorageBin.class).in(WmsStorageBin::getHandle,storageBinBoList).set(WmsStorageBin::getStatus, WmsStorageBin.STATUS_Y));
|
||||
} else {
|
||||
List<StorageBinBindInventory> bindList = storageBinBindInventoryService.list(Wrappers.lambdaQuery(StorageBinBindInventory.class).in(StorageBinBindInventory::getStorageBinBo, storageBinBoList));
|
||||
if (CollectionUtil.isNotEmpty(bindList)){
|
||||
throw BusinessException.build(bindList.stream().map(o -> StringUtil.trimHandle(o.getStorageBinBo())).distinct().collect(Collectors.joining(",","[","]货格存在货物,不可停用")));
|
||||
} else {
|
||||
storageBinService.update(Wrappers.lambdaUpdate(WmsStorageBin.class).in(WmsStorageBin::getHandle,storageBinBoList).set(WmsStorageBin::getStatus, WmsStorageBin.STATUS_N));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return printResult.getMsg();
|
||||
}
|
||||
|
||||
private void changeStorageBinStatus(String storageLocationBo, String status) {
|
||||
List<String> storageBinBoList = storageBinService.list(Wrappers.lambdaQuery(WmsStorageBin.class).eq(WmsStorageBin::getStorageLocationBo, storageLocationBo).eq(WmsStorageBin::getStatus, WmsStorageBin.STATUS_Y).select(WmsStorageBin::getHandle))
|
||||
.stream().map(WmsStorageBin::getHandle).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(storageBinBoList)) {
|
||||
if (StorageLocation.STATUS_Y.equals(status)) {
|
||||
storageBinService.update(Wrappers.lambdaUpdate(WmsStorageBin.class).in(WmsStorageBin::getHandle, storageBinBoList).set(WmsStorageBin::getStatus, WmsStorageBin.STATUS_Y));
|
||||
} else {
|
||||
List<StorageBinBindInventory> bindList = storageBinBindInventoryService.list(Wrappers.lambdaQuery(StorageBinBindInventory.class).in(StorageBinBindInventory::getStorageBinBo, storageBinBoList));
|
||||
if (CollectionUtil.isNotEmpty(bindList)) {
|
||||
throw BusinessException.build(bindList.stream().map(o -> StringUtil.trimHandle(o.getStorageBinBo())).distinct().collect(Collectors.joining(",", "[", "]货格存在货物,不可停用")));
|
||||
} else {
|
||||
storageBinService.update(Wrappers.lambdaUpdate(WmsStorageBin.class).in(WmsStorageBin::getHandle, storageBinBoList).set(WmsStorageBin::getStatus, WmsStorageBin.STATUS_N));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,59 +30,59 @@ import java.time.LocalDateTime;
|
||||
@Service
|
||||
public class WmsWmsWareHouseServiceImpl extends ServiceImpl<WmsWareHouseMapper, WmsWareHouse> implements WmsWareHouseService {
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WmsStorageLocationService storageLocationService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WmsStorageLocationService storageLocationService;
|
||||
|
||||
@Override
|
||||
public boolean save(WmsWareHouse warehouse) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
//拼接主键
|
||||
if (StrUtil.isBlank(warehouse.getWarehouse())){
|
||||
throw BusinessException.build("仓库名称不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(warehouse.getWarehouse())){
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = WmsWareHouse.genHandle(site, warehouse.getWarehouse());
|
||||
warehouse.setHandle(handle);
|
||||
warehouse.setSite(site);
|
||||
warehouse.setCreator(user);
|
||||
warehouse.setCreateTime(localDateTime);
|
||||
try {
|
||||
return super.save(warehouse);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此仓库已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean save(WmsWareHouse warehouse) {
|
||||
//获取当前站点
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//获取当前登陆用户
|
||||
String user = SecurityUtils.getUserName();
|
||||
//获取当前时间
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
//拼接主键
|
||||
if (StrUtil.isBlank(warehouse.getWarehouse())) {
|
||||
throw BusinessException.build("仓库名称不能为空");
|
||||
}
|
||||
//名称中不可带中文
|
||||
if (RegexUtils.isContainsChinese(warehouse.getWarehouse())) {
|
||||
throw BusinessException.build("名称中不可带中文");
|
||||
}
|
||||
String handle = WmsWareHouse.genHandle(site, warehouse.getWarehouse());
|
||||
warehouse.setHandle(handle);
|
||||
warehouse.setSite(site);
|
||||
warehouse.setCreator(user);
|
||||
warehouse.setCreateTime(localDateTime);
|
||||
try {
|
||||
return super.save(warehouse);
|
||||
} catch (Exception e) {
|
||||
if (e instanceof SQLIntegrityConstraintViolationException || e instanceof DuplicateKeyException) {
|
||||
throw new MybatisPlusException("此仓库已存在");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateById(WmsWareHouse warehouse) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
warehouse.setUpdater(user);
|
||||
warehouse.setUpdateTime(localDateTime);
|
||||
return super.updateById(warehouse);
|
||||
}
|
||||
@Override
|
||||
public boolean updateById(WmsWareHouse warehouse) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
warehouse.setUpdater(user);
|
||||
warehouse.setUpdateTime(localDateTime);
|
||||
return super.updateById(warehouse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeById(String handle) {
|
||||
//查询此仓库是否在存储中心被使用
|
||||
LambdaQueryWrapper<StorageLocation> queryWrapper = new LambdaQueryWrapper<StorageLocation>().eq(StorageLocation::getWarehouseBo,handle);
|
||||
StorageLocation one = storageLocationService.getOne(queryWrapper, false);
|
||||
if (one != null){
|
||||
throw BusinessException.build("此仓库已被使用,不可删除");
|
||||
}
|
||||
return super.removeById(handle);
|
||||
}
|
||||
@Override
|
||||
public boolean removeById(String handle) {
|
||||
//查询此仓库是否在存储中心被使用
|
||||
LambdaQueryWrapper<StorageLocation> queryWrapper = new LambdaQueryWrapper<StorageLocation>().eq(StorageLocation::getWarehouseBo, handle);
|
||||
StorageLocation one = storageLocationService.getOne(queryWrapper, false);
|
||||
if (one != null) {
|
||||
throw BusinessException.build("此仓库已被使用,不可删除");
|
||||
}
|
||||
return super.removeById(handle);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user