|
@@ -6,8 +6,14 @@ import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
|
|
|
import cn.ezhizao.framework.web.controller.BaseController;
|
|
|
import cn.ezhizao.framework.web.domain.AjaxResult;
|
|
|
import cn.ezhizao.framework.web.page.TableDataInfo;
|
|
|
+import cn.ezhizao.project.business.domain.BizAccessories;
|
|
|
+import cn.ezhizao.project.business.domain.BizCompany;
|
|
|
import cn.ezhizao.project.business.domain.BizCompanyProductPackage;
|
|
|
+import cn.ezhizao.project.business.domain.BizProduct;
|
|
|
+import cn.ezhizao.project.business.service.IBizAccessoriesService;
|
|
|
import cn.ezhizao.project.business.service.IBizCompanyProductPackageService;
|
|
|
+import cn.ezhizao.project.business.service.IBizCompanyService;
|
|
|
+import cn.ezhizao.project.business.service.IBizProductService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -17,10 +23,11 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
- * 产品包装客户关联Controller
|
|
|
+ * 包装方式Controller
|
|
|
*
|
|
|
* @author ezhizao
|
|
|
* @date 2024-09-10
|
|
@@ -32,9 +39,15 @@ public class BizCompanyProductPackageController extends BaseController
|
|
|
{
|
|
|
@Resource
|
|
|
private IBizCompanyProductPackageService bizCompanyProductPackageService;
|
|
|
+ @Resource
|
|
|
+ private IBizProductService bizProductService;
|
|
|
+ @Resource
|
|
|
+ private IBizCompanyService bizCompanyService;
|
|
|
+ @Resource
|
|
|
+ private IBizAccessoriesService bizAccessoriesService;
|
|
|
|
|
|
/**
|
|
|
- * 查询产品包装客户关联列表
|
|
|
+ * 查询包装方式列表
|
|
|
*/
|
|
|
@ApiOperation("获取包装方式详细")
|
|
|
@ApiImplicitParams({
|
|
@@ -42,7 +55,7 @@ public class BizCompanyProductPackageController extends BaseController
|
|
|
@ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
@ApiImplicitParam(name = "productCode", value = "产品编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
})
|
|
|
- @Log(title = "产品包装客户关联查询")
|
|
|
+ @Log(title = "包装方式查询")
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
|
|
|
{
|
|
@@ -51,9 +64,9 @@ public class BizCompanyProductPackageController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取产品包装客户关联详细信息
|
|
|
+ * 获取包装方式详细信息
|
|
|
*/
|
|
|
- @Log(title = "产品包装客户关联查询详细信息")
|
|
|
+ @Log(title = "包装方式查询详细信息")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
{
|
|
@@ -61,29 +74,169 @@ public class BizCompanyProductPackageController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 新增产品包装客户关联
|
|
|
+ * 新增包装方式
|
|
|
*/
|
|
|
- @Log(title = "产品包装客户关联新增", businessType = BusinessType.INSERT)
|
|
|
+ @ApiOperation("新增包装方式")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "productCode", value = "产品编码",required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "companyCode", value = "客户编码",required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码",required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageTypeCode", value = "包装形式码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageNo", value = "包装箱号", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageStandard", value = "包装尺寸", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageLength", value = "包装长度", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageWidth", value = "包装宽度", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageHeight", value = "包装箱高度", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "singleGrossWeight", value = "单箱毛重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
|
|
|
+ @ApiImplicitParam(name = "singleNumber", value = "单箱支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "perNumber", value = "每层箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "minNumber", value = "满托最小箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "maxNumber", value = "满托最大箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "maxBranchNumber", value = "满托支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "palletStandard", value = "托盘规格", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "palletType", value = "托盘类型", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "areaType", value = "放置区域", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "unit", value = "库存单位", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "deliveryStatus", value = "传送状态", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "outboxHeight", value = "外箱高度", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "recipientName", value = "收货方", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packingOrder", value = "装运单", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "purchaseOrderNo", value = "采购订单号", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "customerPartNo", value = "客户零件编号", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "customerPartName", value = "客户零件名称", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "netWeight", value = "净重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
|
|
|
+ @ApiImplicitParam(name = "engineerChangeNumber", value = "工程变更号", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "supplierCode", value = "供应商编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "Long", paramType = "path", dataTypeClass = Long.class),
|
|
|
+ })
|
|
|
+ @Log(title = "包装方式新增", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
|
|
|
{
|
|
|
+ if(bizCompanyProductPackage.getProductCode() == null || bizCompanyProductPackage.getProductCode() == ""||bizCompanyProductPackage.getCompanyCode() == null || bizCompanyProductPackage.getCompanyCode() == "" || bizCompanyProductPackage.getPackageCode() == null || bizCompanyProductPackage.getPackageCode() == ""){
|
|
|
+ return error("新增包装方式失败,必填项:产品编码,客户编码,包装箱辅料编码不能为空");
|
|
|
+ }
|
|
|
+ if(bizCompanyProductPackage.getAreaType() != null && bizCompanyProductPackage.getAreaType() != "" && !(bizCompanyProductPackage.getAreaType().equals("Manual")|| bizCompanyProductPackage.getAreaType().equals("Automatic"))){
|
|
|
+ return error("新增包装方式失败,区域类型只能为1或2");
|
|
|
+ }
|
|
|
+ if(bizCompanyProductPackage.getPalletType() != null && bizCompanyProductPackage.getPalletType() != "" && !(bizCompanyProductPackage.getPalletType().equals("0" ) || bizCompanyProductPackage.getPalletType().equals("1"))){
|
|
|
+ return error("新增包装方式失败,托盘类型只能为0或1");
|
|
|
+ }
|
|
|
+ //查询产品编码是否存在
|
|
|
+ List<BizProduct> productList = bizProductService.query().eq("product_code", bizCompanyProductPackage.getProductCode()).list();
|
|
|
+ if(productList.isEmpty()){
|
|
|
+ return error("新增包装方式失败,产品编码不存在");
|
|
|
+ }
|
|
|
+ bizCompanyProductPackage.setProductId(productList.get(0).getId());
|
|
|
+ bizCompanyProductPackage.setProductDescription(productList.get(0).getDescription());
|
|
|
+ //查询客户编码是否存在
|
|
|
+ List<BizCompany> companyList = bizCompanyService.query().eq("company_code", bizCompanyProductPackage.getCompanyCode()).list();
|
|
|
+ if (companyList.isEmpty()){
|
|
|
+ return error("新增包装方式失败,客户编码不存在");
|
|
|
+ }
|
|
|
+ bizCompanyProductPackage.setCompanyId(companyList.get(0).getId());
|
|
|
+ bizCompanyProductPackage.setCompanyAlias(companyList.get(0).getCompanyAlias());
|
|
|
+ bizCompanyProductPackage.setMnemonicCode(companyList.get(0).getMnemonicCode());
|
|
|
+ //查询包装箱辅料编码是否存在
|
|
|
+ List<BizAccessories> accessoriesList = bizAccessoriesService.query().eq("accessories_code", bizCompanyProductPackage.getPackageCode()).list();
|
|
|
+ if(accessoriesList.isEmpty()){
|
|
|
+ return error("新增包装方式失败,包装箱辅料编码不存在");
|
|
|
+ }
|
|
|
+ bizCompanyProductPackage.setAccessoriesId(accessoriesList.get(0).getId());
|
|
|
return toAjax(bizCompanyProductPackageService.save(bizCompanyProductPackage));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 修改产品包装客户关联
|
|
|
+ * 修改包装方式
|
|
|
*/
|
|
|
- @Log(title = "产品包装客户关联修改", businessType = BusinessType.UPDATE)
|
|
|
+ @ApiOperation("修改包装方式")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id", value = "包装方式ID",required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class),
|
|
|
+ @ApiImplicitParam(name = "productCode", value = "产品编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "companyCode", value = "客户编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageTypeCode", value = "包装形式码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageNo", value = "包装箱号", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageStandard", value = "包装尺寸", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageLength", value = "包装长度", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageWidth", value = "包装宽度", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packageHeight", value = "包装箱高度", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "singleGrossWeight", value = "单箱毛重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
|
|
|
+ @ApiImplicitParam(name = "singleNumber", value = "单箱支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "perNumber", value = "每层箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "minNumber", value = "满托最小箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "maxNumber", value = "满托最大箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "maxBranchNumber", value = "满托支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "palletStandard", value = "托盘规格", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "palletType", value = "托盘类型", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "areaType", value = "放置区域", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "unit", value = "库存单位", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "deliveryStatus", value = "传送状态", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "outboxHeight", value = "外箱高度", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
|
|
|
+ @ApiImplicitParam(name = "recipientName", value = "收货方", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "packingOrder", value = "装运单", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "purchaseOrderNo", value = "采购订单号", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "customerPartNo", value = "客户零件编号", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "customerPartName", value = "客户零件名称", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "netWeight", value = "净重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
|
|
|
+ @ApiImplicitParam(name = "engineerChangeNumber", value = "工程变更号", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "supplierCode", value = "供应商编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
|
|
|
+ @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "Long", paramType = "path", dataTypeClass = Long.class),
|
|
|
+ })
|
|
|
+ @Log(title = "包装方式修改", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
|
|
|
{
|
|
|
+ if(bizCompanyProductPackage.getId() == null){
|
|
|
+ return error("修改包装方式失败,包装方式ID不能为空");
|
|
|
+ }
|
|
|
+ if(bizCompanyProductPackage.getProductCode() == ""||bizCompanyProductPackage.getCompanyCode() == "" || bizCompanyProductPackage.getPackageCode() == ""){
|
|
|
+ return error("修改包装方式失败,产品编码,客户编码,包装箱辅料编码不能为空");
|
|
|
+ }
|
|
|
+ if(bizCompanyProductPackage.getAreaType() != null && bizCompanyProductPackage.getAreaType() != "" && !(bizCompanyProductPackage.getAreaType().equals("Manual") || bizCompanyProductPackage.getAreaType().equals("Automatic"))){
|
|
|
+ return error("修改包装方式失败,区域类型只能为1或2");
|
|
|
+ }
|
|
|
+ if(bizCompanyProductPackage.getPalletType() != null && bizCompanyProductPackage.getPalletType() != "" && !(bizCompanyProductPackage.getPalletType().equals("0" ) || bizCompanyProductPackage.getPalletType().equals("1"))){
|
|
|
+ return error("修改包装方式失败,托盘类型只能为0或1");
|
|
|
+ }
|
|
|
+ //查询产品编码是否存在
|
|
|
+ if(bizCompanyProductPackage.getProductCode() != null) {
|
|
|
+ List<BizProduct> productList = bizProductService.query().eq("product_code", bizCompanyProductPackage.getProductCode()).list();
|
|
|
+ if (productList.isEmpty()) {
|
|
|
+ return error("修改包装方式失败,产品编码不存在");
|
|
|
+ }
|
|
|
+ bizCompanyProductPackage.setProductId(productList.get(0).getId());
|
|
|
+ bizCompanyProductPackage.setProductDescription(productList.get(0).getDescription());
|
|
|
+ }
|
|
|
+ //查询客户编码是否存在
|
|
|
+ if(bizCompanyProductPackage.getCompanyCode() != null) {
|
|
|
+ List<BizCompany> companyList = bizCompanyService.query().eq("company_code", bizCompanyProductPackage.getCompanyCode()).list();
|
|
|
+ if (companyList.isEmpty()) {
|
|
|
+ return error("修改包装方式失败,客户编码不存在");
|
|
|
+ }
|
|
|
+ bizCompanyProductPackage.setCompanyId(companyList.get(0).getId());
|
|
|
+ bizCompanyProductPackage.setCompanyAlias(companyList.get(0).getCompanyAlias());
|
|
|
+ bizCompanyProductPackage.setMnemonicCode(companyList.get(0).getMnemonicCode());
|
|
|
+ }
|
|
|
+ //查询包装箱辅料编码是否存在
|
|
|
+ if(bizCompanyProductPackage.getPackageCode() != null) {
|
|
|
+ List<BizAccessories> accessoriesList = bizAccessoriesService.query().eq("accessories_code", bizCompanyProductPackage.getPackageCode()).list();
|
|
|
+ if (accessoriesList.isEmpty()) {
|
|
|
+ return error("修改包装方式失败,包装箱辅料编码不存在");
|
|
|
+ }
|
|
|
+ bizCompanyProductPackage.setAccessoriesId(accessoriesList.get(0).getId());
|
|
|
+ }
|
|
|
return toAjax(bizCompanyProductPackageService.updateById(bizCompanyProductPackage));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 删除产品包装客户关联
|
|
|
+ * 删除包装方式
|
|
|
*/
|
|
|
- @Log(title = "产品包装客户关联删除", businessType = BusinessType.DELETE)
|
|
|
+ @ApiOperation("删除包装方式")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id", value = "包装方式ID", required = true, dataType = "List<Long>", paramType = "path", dataTypeClass = List.class)
|
|
|
+ })
|
|
|
+ @Log(title = "包装方式删除", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
public AjaxResult remove(@PathVariable List<Long> ids)
|
|
|
{
|