Browse Source

Merge remote-tracking branch 'origin/master'

master
刘忱 2 years ago
parent
commit
cc8a605cc7
  1. 17
      win-module-wms/win-module-wms-api/src/main/java/com/win/module/wms/enums/ErrorCodeConstants.java
  2. 102
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/SwitchController.java
  3. 31
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchBaseVO.java
  4. 12
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchCreateReqVO.java
  5. 32
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchExcelVO.java
  6. 24
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchExportReqVO.java
  7. 26
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchPageReqVO.java
  8. 15
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchRespVO.java
  9. 18
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchUpdateReqVO.java
  10. 37
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/documentSwitch/SwitchConvert.java
  11. 44
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/documentSwitch/SwitchDO.java
  12. 39
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/documentSwitch/SwitchMapper.java
  13. 53
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/balance/BalanceServiceImpl.java
  14. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/businesstype/BusinesstypeService.java
  15. 12
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/businesstype/BusinesstypeServiceImpl.java
  16. 10
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/currencyexchange/CurrencyexchangeService.java
  17. 13
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/currencyexchange/CurrencyexchangeServiceImpl.java
  18. 7
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customer/CustomerService.java
  19. 5
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customer/CustomerServiceImpl.java
  20. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customeritem/CustomeritemService.java
  21. 14
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customeritem/CustomeritemServiceImpl.java
  22. 82
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentSwitch/SwitchService.java
  23. 98
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentSwitch/SwitchServiceImpl.java
  24. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentsetting/DocumentsettingService.java
  25. 12
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentsetting/DocumentsettingServiceImpl.java
  26. 6
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/expectout/ExpectoutServiceImpl.java
  27. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/itempackaging/ItempackagingService.java
  28. 12
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/itempackaging/ItempackagingServiceImpl.java
  29. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/jobsetting/JobsettingService.java
  30. 12
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/jobsetting/JobsettingServiceImpl.java
  31. 14
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productionline/ProductionlineService.java
  32. 15
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productionline/ProductionlineServiceImpl.java
  33. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productionlineitem/ProductionlineitemService.java
  34. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productionlineitem/ProductionlineitemServiceImpl.java
  35. 11
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasePlan/PurchasePlanMainService.java
  36. 33
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasePlan/PurchasePlanMainServiceImpl.java
  37. 10
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchasereceiptRecordMainService.java
  38. 27
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchasereceiptRecordMainServiceImpl.java
  39. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/recordsetting/RecordsettingService.java
  40. 12
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/recordsetting/RecordsettingServiceImpl.java
  41. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/requestsetting/RequestsettingService.java
  42. 12
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/requestsetting/RequestsettingServiceImpl.java
  43. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/saleprice/SalepriceService.java
  44. 51
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/saleprice/SalepriceServiceImpl.java
  45. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/stdcostprice/StdcostpriceService.java
  46. 18
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/stdcostprice/StdcostpriceServiceImpl.java
  47. 8
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplieritem/SupplieritemService.java
  48. 15
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplieritem/SupplieritemServiceImpl.java
  49. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/transactiontype/TransactiontypeService.java
  50. 17
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/transactiontype/TransactiontypeServiceImpl.java
  51. 7
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/workshop/WorkshopService.java
  52. 14
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/workshop/WorkshopServiceImpl.java
  53. 17
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/workstation/WorkstationService.java
  54. 26
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/workstation/WorkstationServiceImpl.java
  55. 129
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/until/job/JobUtils.java
  56. 12
      win-module-wms/win-module-wms-biz/src/main/resources/mapper/documentSwitch/SwitchMapper.xml

17
win-module-wms/win-module-wms-api/src/main/java/com/win/module/wms/enums/ErrorCodeConstants.java

@ -35,11 +35,12 @@ public interface ErrorCodeConstants {
ErrorCode ITEMPACKAGING_NOT_EXISTS = new ErrorCode(1_000_021_000, "物品包装信息 不存在");
ErrorCode ITEMPACKAGING_ITEM_CODE_NOT_EXISTS = new ErrorCode(1_000_021_001, "code不存在");
ErrorCode ITEMPACKAGING_ITEM_CODE_EXISTS = new ErrorCode(1_000_021_002, "code已存在");
ErrorCode ITEMPACKAGING_UOM_NOT_EXISTS = new ErrorCode(1_000_021_003, "物品包装信息不存在");
ErrorCode ITEMPACKAGING_UOM_NOT_EXISTS = new ErrorCode(1_000_021_003, "计量单位不存在");
ErrorCode ITEMPACKAGING_STD_PACK_UNIT_NOT_EXISTS = new ErrorCode(1_000_021_004, "包装单位不存在");
ErrorCode ITEMPACKAGING_STD_PACK_QTY_NOT_EXISTS = new ErrorCode(1_000_021_005, "包装数量不存在");
ErrorCode ITEMPACKAGING_AVAILABLE_NOT_EXISTS = new ErrorCode(1_000_021_006, "是否可用不存在");
ErrorCode ITEMPACKAGING_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_021_007, "导入物品包装信息不能为空");
ErrorCode ITEMPACKAGING_NULL = new ErrorCode(1_000_021_008, "物品包装信息无效");
//物料清单ErrorCode
ErrorCode BOM_NOT_EXISTS = new ErrorCode(1_000_022_000, "物料清单不存在");
ErrorCode BOM_PRODUCT_ITEM_CODE_NOT_EXISTS = new ErrorCode(1_000_022_001, "父物料代码不存在");
@ -65,6 +66,7 @@ public interface ErrorCodeConstants {
ErrorCode PRODUCTIONLINEITEM_PRODUCT_LINE_COED_NOT_EXISTS = new ErrorCode(1_000_024_003, "产线代码不存在");
ErrorCode PRODUCTIONLINEITEM_ITEM_CODE_NOT_EXISTS = new ErrorCode(1_000_024_004, "物品代码不存在");
ErrorCode PRODUCTIONLINEITEM_AVAILABLE_NOT_EXISTS = new ErrorCode(1_000_024_005, "是否可用不存在");
ErrorCode PRODUCTIONLINEITEM_PRODUCTIONLINECODE_AND_ITEMCODE_NOT_EXIST = new ErrorCode(1_000_024_006, "生产线于零件关系无效");
//采购价格单ErrorCode
ErrorCode SUPPLIER_NOT_EXISTS = new ErrorCode(1_000_025_000, "供应商不存在");
ErrorCode SUPPLIER_NOT_EXISTSNO = new ErrorCode(1_000_025_001, "code已存在");
@ -188,6 +190,7 @@ public interface ErrorCodeConstants {
ErrorCode PRODUCTIONLINE_CODE_NOT_EXISTS = new ErrorCode(1_000_039_003, "code不存在");
ErrorCode PRODUCTIONLINE_WORKSHOP_CODE_NOT_EXISTS = new ErrorCode(1_000_039_004, "车间代码不存在");
ErrorCode PRODUCTIONLINE_AVAILABLE_NOT_EXISTS = new ErrorCode(1_000_039_005, "是否可用不存在");
ErrorCode PRODUCTIONLINE_AND_WORKSHOP_RELATION_ERROR = new ErrorCode(1_000_039_004, "未查到该生产线与车间的关系");
//工序ErrorCode
ErrorCode WORKSTATION_NOT_EXISTS = new ErrorCode(1_000_040_000, "工位不存在");
ErrorCode WORKSTATION_CODE_NOT_EXISTS = new ErrorCode(1_000_040_001, "code不存在");
@ -196,6 +199,7 @@ public interface ErrorCodeConstants {
ErrorCode WORKSTATION_WORKSHOP_CODE_NOT_EXISTS = new ErrorCode(1_000_040_004, "车间代码不存在");
ErrorCode WORKSTATION_PRODUECTION_LINE_CODE_NOT_EXISTS = new ErrorCode(1_000_040_005, "生产线代码不存在");
ErrorCode WORKSTATION_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_040_006, "导入工序不能为空");
ErrorCode WORKSTATION_PRODUECTION_LINE_CODE_AND_WORKSTATION_RELATION_ERROR = new ErrorCode(1_000_040_007, "生产线代码与工位不匹配");
//工序ErrorCode
ErrorCode PROCESS_NOT_EXISTS = new ErrorCode(1_000_041_000, "工序不存在");
ErrorCode PROCESS_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_041_001, "导入工序数据不能为空");
@ -220,6 +224,7 @@ public interface ErrorCodeConstants {
ErrorCode CURRENCYEXCHANGE_RATE_NOT_EXISTS = new ErrorCode(1_000_044_003, "比率不存在");
ErrorCode CURRENCYEXCHANGE_AVAILABLE_NOT_EXISTS = new ErrorCode(1_000_044_004, "是否可用不存在");
ErrorCode CURRENCYEXCHANGE_CURRENCY_NOT_EXISTS = new ErrorCode(1_000_044_005, "货币不存在");
ErrorCode TWO_CURRENCIES_HAVE_NO_CONVERSION_RELATIONSHIP = new ErrorCode(1_000_044_006, "当前两种货币没有转换关系");
//规则ErrorCode
ErrorCode RULE_NOT_EXISTS = new ErrorCode(1_000_045_000, "规则不存在");
ErrorCode RULE_CODE_EXISTS = new ErrorCode(1_000_045_001, "code已存在");
@ -403,6 +408,9 @@ public interface ErrorCodeConstants {
ErrorCode PURCHASE_PLAN_MAIN_NOT_EXISTS = new ErrorCode(1_000_069_000, "要货计划主不存在");
//要货计划子ErrorCode
ErrorCode PURCHASE_PLAN_DETAIL_NOT_EXISTS = new ErrorCode(1_000_069_001, "要货计划子不存在");
ErrorCode PURCHASE_PLAN_DETAIL_PONUMBER_POLINE_ITEMCODE_INVALID = new ErrorCode(1_000_069_002, "要货计划明细:订单号,订单行,零件号无效");
ErrorCode PURCHASE_PLAN_IS_CLOSED = new ErrorCode(1_000_069_003, "要货计划已经关闭");
ErrorCode PURCHASE_PLAN_MAIN_NUMBER_INVALID = new ErrorCode(1_000_069_004, "要货计划number无效");
//供应商发货申请主ErrorCode
ErrorCode SUPPLIERDELIVER_REQUEST_MAIN_NOT_EXISTS = new ErrorCode(1_000_070_000, "供应商发货申请主不存在");
//供应商发货申请子ErrorCode
@ -426,6 +434,8 @@ public interface ErrorCodeConstants {
ErrorCode PURCHASERECEIPT_RECORD_MAIN_NOT_EXISTS = new ErrorCode(1_000_074_000, "采购收货记录主不存在");
//采购收货记录子ErrorCode
ErrorCode PURCHASERECEIPT_RECORD_DETAIL_NOT_EXISTS = new ErrorCode(1_000_074_001, "采购收货记录子不存在");
ErrorCode PURCHASERECEIPT_RECORD_MAIN_NUMBER_NOT_EXISTS = new ErrorCode(1_000_074_002, "采购收货记录无效,number无效");
ErrorCode PURCHASERECEIPT_RECORD_DETAIL_PONUMBER_POLINE_ITEMCODE_INVALID = new ErrorCode(1_000_074_003, "采购收货记录明细:订单号,订单行,零件号无效");
//采购退货申请主ErrorCode
ErrorCode PURCHASERETURN_REQUEST_MAIN_NOT_EXISTS = new ErrorCode(1_000_075_000, "采购退货申请主不存在");
//采购退货申请子ErrorCode
@ -797,8 +807,7 @@ public interface ErrorCodeConstants {
ErrorCode TRANSACTION_NOT_EXISTS = new ErrorCode(1_000_164_000, "库存事务不存在");
//库存事务ErrorCode
ErrorCode TRANSFERLOG_NOT_EXISTS = new ErrorCode(1_000_165_000, "库存转移日志不存在");
//生产线与零件关系ErrorCode
ErrorCode PRODUCTIONLINEITEM_PITEM_NOT_EXISTS = new ErrorCode(1_000_166_000, "生产线与零件关系无效");
//单据开关ErrorCode
ErrorCode SWITCH_NOT_EXISTS = new ErrorCode(1_000_166_000, "单据开关不存在");
}

102
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/SwitchController.java

@ -0,0 +1,102 @@
package com.win.module.wms.controller.documentSwitch;
import com.win.module.wms.controller.documentSwitch.vo.*;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.pojo.CommonResult;
import static com.win.framework.common.pojo.CommonResult.success;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.win.module.wms.controller.documentSwitch.vo.*;
import com.win.module.wms.dal.dataobject.documentSwitch.SwitchDO;
import com.win.module.wms.convert.documentSwitch.SwitchConvert;
import com.win.module.wms.service.documentSwitch.SwitchService;
@Tag(name = "管理后台 - 单据开关")
@RestController
@RequestMapping("/wms/switch")
@Validated
public class SwitchController {
@Resource
private SwitchService switchService;
@PostMapping("/create")
@Operation(summary = "创建单据开关")
@PreAuthorize("@ss.hasPermission('wms:switch:create')")
public CommonResult<Long> createSwitch(@Valid @RequestBody SwitchCreateReqVO createReqVO) {
return success(switchService.createSwitch(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新单据开关")
@PreAuthorize("@ss.hasPermission('wms:switch:update')")
public CommonResult<Boolean> updateSwitch(@Valid @RequestBody SwitchUpdateReqVO updateReqVO) {
switchService.updateSwitch(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除单据开关")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:switch:delete')")
public CommonResult<Boolean> deleteSwitch(@RequestParam("id") Long id) {
switchService.deleteSwitch(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得单据开关")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('wms:switch:query')")
public CommonResult<SwitchRespVO> getSwitch(@RequestParam("id") Long id) {
SwitchDO documentSwitch = switchService.getSwitch(id);
return success(SwitchConvert.INSTANCE.convert(documentSwitch));
}
@GetMapping("/list")
@Operation(summary = "获得单据开关列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:switch:query')")
public CommonResult<List<SwitchRespVO>> getSwitchList(@RequestParam("ids") Collection<Long> ids) {
List<SwitchDO> list = switchService.getSwitchList(ids);
return success(SwitchConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得单据开关分页")
@PreAuthorize("@ss.hasPermission('wms:switch:query')")
public CommonResult<PageResult<SwitchRespVO>> getSwitchPage(@Valid SwitchPageReqVO pageVO) {
PageResult<SwitchDO> pageResult = switchService.getSwitchPage(pageVO);
return success(SwitchConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出单据开关 Excel")
@PreAuthorize("@ss.hasPermission('wms:switch:export')")
@OperateLog(type = EXPORT)
public void exportSwitchExcel(@Valid SwitchExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<SwitchDO> list = switchService.getSwitchList(exportReqVO);
// 导出 Excel
List<SwitchExcelVO> datas = SwitchConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "单据开关.xls", "数据", SwitchExcelVO.class, datas);
}
}

31
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchBaseVO.java

@ -0,0 +1,31 @@
package com.win.module.wms.controller.documentSwitch.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
/**
* 单据开关 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class SwitchBaseVO {
@Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "代码不能为空")
private String code;
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
@NotNull(message = "描述不能为空")
private String description;
@Schema(description = "有效设置值 TRUE FALSE", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "有效设置值 TRUE FALSE不能为空")
private String effectiveSetValue;
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "是否可用不能为空")
private String available;
}

12
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchCreateReqVO.java

@ -0,0 +1,12 @@
package com.win.module.wms.controller.documentSwitch.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description = "管理后台 - 单据开关创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SwitchCreateReqVO extends SwitchBaseVO {
}

32
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchExcelVO.java

@ -0,0 +1,32 @@
package com.win.module.wms.controller.documentSwitch.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 单据开关 Excel VO
*
* @author 源码
*/
@Data
public class SwitchExcelVO {
@ExcelProperty("id")
private Long id;
@ExcelProperty("代码")
private String code;
@ExcelProperty("描述")
private String description;
@ExcelProperty("有效设置值 TRUE FALSE")
private String effectiveSetValue;
@ExcelProperty("是否可用")
private String available;
}

24
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchExportReqVO.java

@ -0,0 +1,24 @@
package com.win.module.wms.controller.documentSwitch.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.win.framework.common.pojo.PageParam;
@Schema(description = "管理后台 - 单据开关 Excel 导出 Request VO,参数和 SwitchPageReqVO 是一致的")
@Data
public class SwitchExportReqVO {
@Schema(description = "代码")
private String code;
@Schema(description = "描述", example = "你猜")
private String description;
@Schema(description = "有效设置值 TRUE FALSE")
private String effectiveSetValue;
@Schema(description = "是否可用")
private String available;
}

26
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchPageReqVO.java

@ -0,0 +1,26 @@
package com.win.module.wms.controller.documentSwitch.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.win.framework.common.pojo.PageParam;
@Schema(description = "管理后台 - 单据开关分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SwitchPageReqVO extends PageParam {
@Schema(description = "代码")
private String code;
@Schema(description = "描述", example = "你猜")
private String description;
@Schema(description = "有效设置值 TRUE FALSE")
private String effectiveSetValue;
@Schema(description = "是否可用")
private String available;
}

15
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchRespVO.java

@ -0,0 +1,15 @@
package com.win.module.wms.controller.documentSwitch.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Schema(description = "管理后台 - 单据开关 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SwitchRespVO extends SwitchBaseVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17760")
private Long id;
}

18
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/documentSwitch/vo/SwitchUpdateReqVO.java

@ -0,0 +1,18 @@
package com.win.module.wms.controller.documentSwitch.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 单据开关更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SwitchUpdateReqVO extends SwitchBaseVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17760")
@NotNull(message = "id不能为空")
private Long id;
}

37
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/documentSwitch/SwitchConvert.java

@ -0,0 +1,37 @@
package com.win.module.wms.convert.documentSwitch;
import java.util.*;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.documentSwitch.vo.SwitchCreateReqVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchExcelVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchRespVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchUpdateReqVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import com.win.module.wms.dal.dataobject.documentSwitch.SwitchDO;
/**
* 单据开关 Convert
*
* @author 源码
*/
@Mapper
public interface SwitchConvert {
SwitchConvert INSTANCE = Mappers.getMapper(SwitchConvert.class);
SwitchDO convert(SwitchCreateReqVO bean);
SwitchDO convert(SwitchUpdateReqVO bean);
SwitchRespVO convert(SwitchDO bean);
List<SwitchRespVO> convertList(List<SwitchDO> list);
PageResult<SwitchRespVO> convertPage(PageResult<SwitchDO> page);
List<SwitchExcelVO> convertList02(List<SwitchDO> list);
}

44
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/documentSwitch/SwitchDO.java

@ -0,0 +1,44 @@
package com.win.module.wms.dal.dataobject.documentSwitch;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import com.win.framework.mybatis.core.dataobject.BaseDO;
/**
* 单据开关 DO
*
* @author 源码
*/
@TableName("document_switch")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SwitchDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* 代码
*/
private String code;
/**
* 描述
*/
private String description;
/**
* 有效设置值 TRUE FALSE
*/
private String effectiveSetValue;
/**
* 是否可用
*/
private String available;
}

39
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/documentSwitch/SwitchMapper.java

@ -0,0 +1,39 @@
package com.win.module.wms.dal.mysql.documentSwitch;
import java.util.*;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.module.wms.controller.documentSwitch.vo.SwitchExportReqVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchPageReqVO;
import com.win.module.wms.dal.dataobject.documentSwitch.SwitchDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 单据开关 Mapper
*
* @author 源码
*/
@Mapper
public interface SwitchMapper extends BaseMapperX<SwitchDO> {
default PageResult<SwitchDO> selectPage(SwitchPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SwitchDO>()
.eqIfPresent(SwitchDO::getCode, reqVO.getCode())
.eqIfPresent(SwitchDO::getDescription, reqVO.getDescription())
.eqIfPresent(SwitchDO::getEffectiveSetValue, reqVO.getEffectiveSetValue())
.eqIfPresent(SwitchDO::getAvailable, reqVO.getAvailable())
.orderByDesc(SwitchDO::getId));
}
default List<SwitchDO> selectList(SwitchExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<SwitchDO>()
.eqIfPresent(SwitchDO::getCode, reqVO.getCode())
.eqIfPresent(SwitchDO::getDescription, reqVO.getDescription())
.eqIfPresent(SwitchDO::getEffectiveSetValue, reqVO.getEffectiveSetValue())
.eqIfPresent(SwitchDO::getAvailable, reqVO.getAvailable())
.orderByDesc(SwitchDO::getId));
}
}

53
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/balance/BalanceServiceImpl.java

@ -1,5 +1,6 @@
package com.win.module.wms.service.balance;
import cn.hutool.core.exceptions.UtilException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.win.framework.common.exception.ErrorCode;
import com.win.module.wms.controller.balance.vo.BalanceCreateReqVO;
@ -90,8 +91,15 @@ public class BalanceServiceImpl implements BalanceService {
return balanceMapper.selectList(exportReqVO);
}
//跟据管理模式查询数量
//按数量查找 TB2-BY_QUANTITY
/**
* TB----TB2----BY_QUANTITY
* 跟据管理模式查询数量
* @author lianhongxi
* @param itemcode 物品code
* @param inventorystatus 库存状态
* @param locationcode 库位code
* @return
*/
@Override
public List<BalanceDO> selectNumber(String itemcode, String inventorystatus, String locationcode) {
QueryWrapper queryWrapper = new QueryWrapper();
@ -102,11 +110,20 @@ public class BalanceServiceImpl implements BalanceService {
if (!balanceDO.isEmpty()) {
return balanceDO;
} else {
throw exception(new ErrorCode(123, "物料号" + itemcode + "库存状态" + inventorystatus + "在" + locationcode + "库位中未查找到库存记录"));
throw new UtilException( "物料号" + itemcode + "库存状态" + inventorystatus + "在" + locationcode + "库位中未查找到库存记录");
}
}
//按批次查找 TB2-BY_BATCH
/**
* 按批次查找
* TB----TB2-----BY_BATCH
* @author lianhongxi
* @param itemcode 物品code
* @param batch 批次
* @param inventorystatus 库存状态
* @param locationcode 库位code
* @return
*/
@Override
public List<BalanceDO> selectBatch(String itemcode, String batch, String inventorystatus, String locationcode) {
QueryWrapper queryWrapper = new QueryWrapper();
@ -118,11 +135,23 @@ public class BalanceServiceImpl implements BalanceService {
if (!balanceDO.isEmpty()) {
return balanceDO;
} else {
throw exception(new ErrorCode(124, "物料号" + itemcode + "批次" + batch + "库存状态" + inventorystatus + "在" + locationcode + "库位中未查找到库存记录"));
throw new UtilException( "物料号" + itemcode + "批次" + batch + "库存状态" + inventorystatus + "在" + locationcode + "库位中未查找到库存记录");
}
}
//按包裝查找 TB2-BY_PACKGING
/**
* TB----TB2-----BY_PACKGING
* 按包装查找
* @author lianhongxi
* @param itemcode 物品code
* @param packingnumber 包装号
* @param batch 批次
* @param inventorystatus 库存状态
* @param locationcode 库位code
* @return
*/
@Override
public List<BalanceDO> selectPackaging(String itemcode, String packingnumber, String batch, String inventorystatus, String locationcode) {
QueryWrapper queryWrapper = new QueryWrapper();
@ -135,11 +164,19 @@ public class BalanceServiceImpl implements BalanceService {
if (!balanceDO.isEmpty()) {
return balanceDO;
} else {
throw exception(new ErrorCode(128, "物料号" + itemcode + "箱码" + packingnumber + "批次" + batch + "库存状态" + inventorystatus + "在" + locationcode + "库位中未查找到库存记录"));
throw new UtilException( "物料号" + itemcode + "箱码" + packingnumber + "批次" + batch + "库存状态" + inventorystatus + "在" + locationcode + "库位中未查找到库存记录");
}
}
//按唯一码查找 TB2-BY_UNIQUE_ID
/**
* TB----TB2-----BY_UNIQUE_ID
* 按唯一码查找
* @author lianhongxi
* @param packingnumber 包装号
* @param locationcode 库位code
* @param inventorystatus 库存状态
* @return
*/
@Override
public List<BalanceDO> selectUniqueId(String packingnumber, String locationcode, String inventorystatus) {
QueryWrapper queryWrapper = new QueryWrapper();
@ -150,7 +187,7 @@ public class BalanceServiceImpl implements BalanceService {
if (!balanceDO.isEmpty()) {
return balanceDO;
} else {
throw exception(new ErrorCode(129, "唯一码" + packingnumber + "库存状态" + inventorystatus + "在" + locationcode + "库位中未查找到库存记录"));
throw new UtilException( "唯一码" + packingnumber + "库存状态" + inventorystatus + "在" + locationcode + "库位中未查找到库存记录");
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/businesstype/BusinesstypeService.java

@ -70,4 +70,13 @@ public interface BusinesstypeService {
List<BusinesstypeDO> getBusinesstypeList(BusinesstypeExportReqVO exportReqVO);
List<BusinesstypeImportExcelVo> importBusinesstypeList(List<BusinesstypeImportExcelVo> businesstypes, Integer mode, Boolean updatePart);
/**
* 查询业务类型是否存在
* DBT-------DBT1
* @author chenfang
* @param pcode code
* @return
*/
public BusinesstypeDO selectBusinesstypeExist(String pcode);
}

12
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/businesstype/BusinesstypeServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.businesstype;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -211,4 +212,15 @@ public class BusinesstypeServiceImpl implements BusinesstypeService {
throw exception(BUSINESSTYPE_AVAILABLE_NOT_EXISTS);
}
}
@Override
public BusinesstypeDO selectBusinesstypeExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode);
BusinesstypeDO businesstypeDO = businesstypeMapper.selectOne(queryWrapper);
if(businesstypeDO != null && "TRUE".equals(businesstypeDO.getAvailable())){
return businesstypeDO;
}else {
throw exception(BUSINESSTYPE_NOT_EXISTS);
}
}
}

10
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/currencyexchange/CurrencyexchangeService.java

@ -70,4 +70,14 @@ public interface CurrencyexchangeService {
List<CurrencyexchangeDO> getCurrencyexchangeList(CurrencyexchangeExportReqVO exportReqVO);
List<CurrencyexchangeImportExcelVo> importCurrencyexchangeList(List<CurrencyexchangeImportExcelVo> currencyexchanges, Integer mode, Boolean updatePart);
/**
* BQ-------CE
* 判断当前两种货币是否存在转换关系
* @author chenfang
* @param pcurrency 货币
* @param pbasiccurrency 基础货币
* @return
*/
public CurrencyexchangeDO selectCurrencyexchangeExist(String pcurrency,String pbasiccurrency);
}

13
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/currencyexchange/CurrencyexchangeServiceImpl.java

@ -1,6 +1,7 @@
package com.win.module.wms.service.currencyexchange;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -170,4 +171,16 @@ public class CurrencyexchangeServiceImpl implements CurrencyexchangeService {
throw exception(CURRENCYEXCHANGE_AVAILABLE_NOT_EXISTS);
}
}
@Override
public CurrencyexchangeDO selectCurrencyexchangeExist(String pcurrency,String pbasiccurrency){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("currency",pcurrency);
queryWrapper.eq("basiccurrency",pbasiccurrency);
CurrencyexchangeDO currencyexchangeDO = currencyexchangeMapper.selectOne(queryWrapper);
if(currencyexchangeDO != null && "TRUE".equals(currencyexchangeDO.getAvailable())){
return currencyexchangeDO;
}else {
throw exception(TWO_CURRENCIES_HAVE_NO_CONVERSION_RELATIONSHIP);
}
}
}

7
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customer/CustomerService.java

@ -72,9 +72,10 @@ public interface CustomerService {
List<CustomerImportExcelVo> importCustomerList(List<CustomerImportExcelVo> customers, Integer mode, Boolean updatePart);
/**
* 校验客户信息有效
* @author chenfang
* @param pcustomerCode 客户代码
* BQ-----QCus
* @author lianhongxi
* @param pcode 客户code
* @return 客户列表
*/
public CustomerDO selectCustomerExist(String pcustomerCode);
public CustomerDO selectCustomerExist(String pcode);
}

5
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customer/CustomerServiceImpl.java

@ -12,6 +12,7 @@ import com.win.module.wms.convert.customer.CustomerConvert;
import com.win.module.wms.dal.dataobject.currencyexchange.CurrencyexchangeDO;
import com.win.module.wms.dal.dataobject.customer.CustomerDO;
import com.win.module.wms.dal.dataobject.customeritem.CustomeritemDO;
import com.win.module.wms.dal.dataobject.itempackaging.ItempackagingDO;
import com.win.module.wms.dal.dataobject.warehouse.WarehouseDO;
import com.win.module.wms.dal.mysql.customer.CustomerMapper;
import org.springframework.stereotype.Service;
@ -173,9 +174,9 @@ public class CustomerServiceImpl implements CustomerService {
}
}
@Override
public CustomerDO selectCustomerExist(String pcustomerCode) {
public CustomerDO selectCustomerExist(String pcode) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("customer_code",pcustomerCode);
queryWrapper.eq("code",pcode);
CustomerDO customerDO = customerMapper.selectOne(queryWrapper);
if(customerDO != null && "TRUE".equals(customerDO.getAvailable())){
return customerDO;

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customeritem/CustomeritemService.java

@ -70,4 +70,13 @@ public interface CustomeritemService {
List<CustomeritemDO> getCustomeritemList(CustomeritemExportReqVO exportReqVO);
List<CustomeritemImportExcelVO> CustomeritemimportCustomeritemList(List<CustomeritemImportExcelVO> customeritems, Integer mode, Boolean updatePart);
/**
* 查询客户物品是否存在
* BQ-----QCusI
* @param pcustomerCode 客户code
* @param pitemCode 物品code
* @return
*/
public CustomeritemDO selectCustomeritemExist(String pcustomerCode,String pitemCode);
}

14
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customeritem/CustomeritemServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.customeritem;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -197,5 +198,16 @@ public class CustomeritemServiceImpl implements CustomeritemService {
throw exception(CUSTOMERITEM_AVAILABLE_NOT_EXISTS);
}
}
@Override
public CustomeritemDO selectCustomeritemExist(String pcustomerCode,String pitemCode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("customer_code",pcustomerCode);
queryWrapper.eq("itemcode",pitemCode);
CustomeritemDO customeritemDO = customeritemMapper.selectOne(queryWrapper);
if(customeritemDO != null && "TRUE".equals(customeritemDO.getAvailable())){
return customeritemDO;
}else {
throw exception(CUSTOMERITEM_NOT_EXISTS);
}
}
}

82
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentSwitch/SwitchService.java

@ -0,0 +1,82 @@
package com.win.module.wms.service.documentSwitch;
import java.util.*;
import javax.validation.*;
import com.win.module.wms.controller.documentSwitch.vo.SwitchCreateReqVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchExportReqVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchPageReqVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchUpdateReqVO;
import com.win.module.wms.dal.dataobject.documentSwitch.SwitchDO;
import com.win.framework.common.pojo.PageResult;
/**
* 单据开关 Service 接口
*
* @author 源码
*/
public interface SwitchService {
/**
* 创建单据开关
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createSwitch(@Valid SwitchCreateReqVO createReqVO);
/**
* 更新单据开关
*
* @param updateReqVO 更新信息
*/
void updateSwitch(@Valid SwitchUpdateReqVO updateReqVO);
/**
* 删除单据开关
*
* @param id 编号
*/
void deleteSwitch(Long id);
/**
* 获得单据开关
*
* @param id 编号
* @return 单据开关
*/
SwitchDO getSwitch(Long id);
/**
* 获得单据开关列表
*
* @param ids 编号
* @return 单据开关列表
*/
List<SwitchDO> getSwitchList(Collection<Long> ids);
/**
* 获得单据开关分页
*
* @param pageReqVO 分页查询
* @return 单据开关分页
*/
PageResult<SwitchDO> getSwitchPage(SwitchPageReqVO pageReqVO);
/**
* 获得单据开关列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 单据开关列表
*/
List<SwitchDO> getSwitchList(SwitchExportReqVO exportReqVO);
/**
* Setting-----QSwitch
* 查询单据开关是否存在
* @author chenfang
* @param pcode code
* @return
*/
public SwitchDO selectSwitchExist(String pcode);
}

98
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentSwitch/SwitchServiceImpl.java

@ -0,0 +1,98 @@
package com.win.module.wms.service.documentSwitch;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.win.module.wms.controller.documentSwitch.vo.SwitchCreateReqVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchExportReqVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchPageReqVO;
import com.win.module.wms.controller.documentSwitch.vo.SwitchUpdateReqVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.win.module.wms.dal.dataobject.documentSwitch.SwitchDO;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.convert.documentSwitch.SwitchConvert;
import com.win.module.wms.dal.mysql.documentSwitch.SwitchMapper;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.win.module.wms.enums.ErrorCodeConstants.*;
/**
* 单据开关 Service 实现类
*
* @author 源码
*/
@Service
@Validated
public class SwitchServiceImpl implements SwitchService {
@Resource
private SwitchMapper switchMapper;
@Override
public Long createSwitch(SwitchCreateReqVO createReqVO) {
// 插入
SwitchDO documentSwitch = SwitchConvert.INSTANCE.convert(createReqVO);
switchMapper.insert(documentSwitch);
// 返回
return documentSwitch.getId();
}
@Override
public void updateSwitch(SwitchUpdateReqVO updateReqVO) {
// 校验存在
validateSwitchExists(updateReqVO.getId());
// 更新
SwitchDO updateObj = SwitchConvert.INSTANCE.convert(updateReqVO);
switchMapper.updateById(updateObj);
}
@Override
public void deleteSwitch(Long id) {
// 校验存在
validateSwitchExists(id);
// 删除
switchMapper.deleteById(id);
}
private void validateSwitchExists(Long id) {
if (switchMapper.selectById(id) == null) {
throw exception(SWITCH_NOT_EXISTS);
}
}
@Override
public SwitchDO getSwitch(Long id) {
return switchMapper.selectById(id);
}
@Override
public List<SwitchDO> getSwitchList(Collection<Long> ids) {
return switchMapper.selectBatchIds(ids);
}
@Override
public PageResult<SwitchDO> getSwitchPage(SwitchPageReqVO pageReqVO) {
return switchMapper.selectPage(pageReqVO);
}
@Override
public List<SwitchDO> getSwitchList(SwitchExportReqVO exportReqVO) {
return switchMapper.selectList(exportReqVO);
}
@Override
public SwitchDO selectSwitchExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode);
SwitchDO switchDO = switchMapper.selectOne(queryWrapper);
if(switchDO != null && "TRUE".equals(switchDO.getAvailable())){
return switchDO;
}else {
throw exception(SWITCH_NOT_EXISTS);
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentsetting/DocumentsettingService.java

@ -70,4 +70,13 @@ public interface DocumentsettingService {
List<DocumentsettingDO> getDocumentsettingList(DocumentsettingExportReqVO exportReqVO);
List<DocumentsettingImportExcelVO> documentSettingimportDocumentList(List<DocumentsettingImportExcelVO> documentsettings, Integer mode, Boolean updatePart);
/**
* Setting----QDS
* 查询单据设置是否存在
* @author chenfang
* @param pcode
* @return
*/
public DocumentsettingDO selectDocumentsettingExist(String pcode);
}

12
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/documentsetting/DocumentsettingServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.documentsetting;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -223,4 +224,15 @@ public class DocumentsettingServiceImpl implements DocumentsettingService {
throw exception(DOCUMENTSETTING_AVAILABLE_NOT_EXISTS);
}
}
@Override
public DocumentsettingDO selectDocumentsettingExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode);
DocumentsettingDO documentsettingDO = documentsettingMapper.selectOne(queryWrapper);
if(documentsettingDO != null && "TRUE".equals(documentsettingDO.getAvailable())){
return documentsettingDO;
}else {
throw exception(DOCUMENTSETTING_NOT_EXISTS);
}
}
}

6
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/expectout/ExpectoutServiceImpl.java

@ -5,6 +5,9 @@ import com.win.module.wms.controller.expectout.vo.ExpectoutCreateReqVO;
import com.win.module.wms.controller.expectout.vo.ExpectoutExportReqVO;
import com.win.module.wms.controller.expectout.vo.ExpectoutPageReqVO;
import com.win.module.wms.controller.expectout.vo.ExpectoutUpdateReqVO;
import com.win.module.wms.controller.rule.vo.RuleRespVO;
import com.win.module.wms.service.rule.RuleService;
import com.win.module.wms.service.rule.RuleServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -32,6 +35,9 @@ public class ExpectoutServiceImpl implements ExpectoutService {
@Resource
private ExpectoutMapper expectoutMapper;
@Resource
private RuleService ruleService;
@Override
public String createExpectout(ExpectoutCreateReqVO createReqVO) {
// 插入

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/itempackaging/ItempackagingService.java

@ -70,4 +70,13 @@ public interface ItempackagingService {
List<ItempackagingDO> getItempackagingList(ItempackagingExportReqVO exportReqVO);
List<ItempackagingImportExcelVO> itempackagingimportDocumentList(List<ItempackagingImportExcelVO> itempackagings, Integer mode, Boolean updatePart);
/**
* BQ----QIP
* 查询物品标包信息
* @author chenfang
* @param pitemCode 物品code
* @return
*/
public ItempackagingDO selectItemPackagingExist(String pitemCode);
}

12
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/itempackaging/ItempackagingServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.itempackaging;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -183,4 +184,15 @@ public class ItempackagingServiceImpl implements ItempackagingService {
throw exception(ITEMPACKAGING_AVAILABLE_NOT_EXISTS);
}
}
@Override
public ItempackagingDO selectItemPackagingExist(String pitemCode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("itemcode",pitemCode);
ItempackagingDO itempackagingDO = itempackagingMapper.selectOne(queryWrapper);
if(itempackagingDO != null && "TRUE".equals(itempackagingDO.getAvailable())){
return itempackagingDO;
}else {
throw exception(ITEMPACKAGING_NULL);
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/jobsetting/JobsettingService.java

@ -70,4 +70,13 @@ public interface JobsettingService {
List<JobsettingDO> getJobsettingList(JobsettingExportReqVO exportReqVO);
List<JobsettingImportExcelVO> importJobsettingList(List<JobsettingImportExcelVO> jobsettings, Integer mode, Boolean updatePart);
/**
* Setting------QJS
* 查询任务单设置是否存在
* @author chenfang
* @param pcode code
* @return
*/
public JobsettingDO selectJobsettingExist(String pcode);
}

12
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/jobsetting/JobsettingServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.jobsetting;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -245,4 +246,15 @@ public class JobsettingServiceImpl implements JobsettingService {
throw exception(JOBSETTING_AVAILABLE_NOT_EXISTS);
}
}
@Override
public JobsettingDO selectJobsettingExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode);
JobsettingDO jobsettingDO = jobsettingMapper.selectOne(queryWrapper);
if(jobsettingDO != null && "TRUE".equals(jobsettingDO.getAvailable())){
return jobsettingDO;
}else {
throw exception(JOBSETTING_NOT_EXISTS);
}
}
}

14
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productionline/ProductionlineService.java

@ -72,10 +72,20 @@ public interface ProductionlineService {
List<ProductionlineImportExcelVO> importProductionlineList(List<ProductionlineImportExcelVO> productionlines, Integer mode, Boolean updatePart);
/**
*生产线有效状态正确
*查询生产线是否存在
* BS-------QProdL
* @author lianhongxi
* @param code
* @param code 代码
* @return
*/
public ProductionlineDO ProductionlineExist(String code);
/**
* 判断车间与生产线关系是否存在
* @author chenfang
* @param pworkshopCode 车间code
* @param productionLineCode 生产线code
* @return
*/
public boolean ifProductionPlaninWorkshop(String pworkshopCode,String productionLineCode);
}

15
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productionline/ProductionlineServiceImpl.java

@ -9,7 +9,6 @@ import com.win.framework.common.pojo.PageResult;
import com.win.framework.datapermission.core.util.DataPermissionUtils;
import com.win.module.wms.controller.productionline.vo.*;
import com.win.module.wms.convert.productionline.ProductionlineConvert;
import com.win.module.wms.dal.dataobject.customerdock.CustomerdockDO;
import com.win.module.wms.dal.dataobject.owner.OwnerDO;
import com.win.module.wms.dal.dataobject.productionline.ProductionlineDO;
import com.win.module.wms.dal.mysql.productionline.ProductionlineMapper;
@ -174,7 +173,19 @@ public class ProductionlineServiceImpl implements ProductionlineService {
if(productionlineDO != null&& "TRUE".equals(productionlineDO.getAvailable())){
return productionlineDO;
}else {
throw exception(PRODUCTIONLINEITEM_PITEM_NOT_EXISTS);
throw exception(PRODUCTIONLINE_CODE_NOT_EXISTS);
}
}
@Override
public boolean ifProductionPlaninWorkshop(String pworkshopCode,String productionLineCode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",productionLineCode);
queryWrapper.eq("workshop_code",pworkshopCode);
ProductionlineDO productionlineDO = productionlineMapper.selectOne(queryWrapper);
if(productionlineDO != null && "TRUE".equals(productionlineDO.getAvailable())){
return true;
}else {
throw exception(PRODUCTIONLINE_AND_WORKSHOP_RELATION_ERROR);
}
}
}

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productionlineitem/ProductionlineitemService.java

@ -72,10 +72,11 @@ public interface ProductionlineitemService {
List<ProductionlineItemImportExcelVO> importProductionlineItemList(List<ProductionlineItemImportExcelVO> productionlineItems, Integer mode, Boolean updatePart);
/**
* 零件生产线关系有效
* BQ-----QPLI
* @author chenfang
* @param pproductionLineCode 产线代码
* @param pitemCode 物品代码
* @return 生产线物料关系
*/
public List<ProductionlineitemDO> pProductionLineCodeAndpItemCodeExist(String pproductionLineCode,String pitemCode);
public List<ProductionlineitemDO> productionLineCodeAndpItemCodeExist(String pproductionLineCode,String pitemCode);
}

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/productionlineitem/ProductionlineitemServiceImpl.java

@ -166,7 +166,7 @@ public class ProductionlineitemServiceImpl implements ProductionlineitemService
}
}
//零件生产线关系有效
public List<ProductionlineitemDO> pProductionLineCodeAndpItemCodeExist(String pproductionLineCode,String pitemCode) {
public List<ProductionlineitemDO> productionLineCodeAndpItemCodeExist(String pproductionLineCode,String pitemCode) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("production_line_code",pproductionLineCode);
queryWrapper.eq("item_code",pitemCode);
@ -178,7 +178,7 @@ public class ProductionlineitemServiceImpl implements ProductionlineitemService
}
}
}else {
throw exception(PRODUCTIONLINEITEM_NOT_EXISTS);
throw exception(PRODUCTIONLINEITEM_PRODUCTIONLINECODE_AND_ITEMCODE_NOT_EXIST);
}
return productionlineitemDO;
}

11
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasePlan/PurchasePlanMainService.java

@ -7,6 +7,7 @@ import com.win.module.wms.controller.purchasePlan.vo.PurchasePlanMainCreateReqVO
import com.win.module.wms.controller.purchasePlan.vo.PurchasePlanMainExportReqVO;
import com.win.module.wms.controller.purchasePlan.vo.PurchasePlanMainPageReqVO;
import com.win.module.wms.controller.purchasePlan.vo.PurchasePlanMainUpdateReqVO;
import com.win.module.wms.dal.dataobject.purchasePlan.PurchasePlanDetailDO;
import com.win.module.wms.dal.dataobject.purchasePlan.PurchasePlanMainDO;
import com.win.framework.common.pojo.PageResult;
@ -71,4 +72,14 @@ public interface PurchasePlanMainService {
*/
List<PurchasePlanMainDO> getPurchasePlanMainList(PurchasePlanMainExportReqVO exportReqVO);
/**
* PLAN----VPur
* @param pnubmer 单据号
* @param psupplierCode 供应商code
* @param ppoNumber 订单号
* @param ppoLine 订单行
* @param pitemCode 物品code
* @return
*/
public PurchasePlanDetailDO selectPurchasePlan(String pnubmer, String psupplierCode, String ppoNumber, String ppoLine, String pitemCode);
}

33
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasePlan/PurchasePlanMainServiceImpl.java

@ -1,9 +1,12 @@
package com.win.module.wms.service.purchasePlan;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.win.module.wms.controller.purchasePlan.vo.PurchasePlanMainCreateReqVO;
import com.win.module.wms.controller.purchasePlan.vo.PurchasePlanMainExportReqVO;
import com.win.module.wms.controller.purchasePlan.vo.PurchasePlanMainPageReqVO;
import com.win.module.wms.controller.purchasePlan.vo.PurchasePlanMainUpdateReqVO;
import com.win.module.wms.dal.dataobject.purchasePlan.PurchasePlanDetailDO;
import com.win.module.wms.dal.mysql.purchasePlan.PurchasePlanDetailMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -31,6 +34,9 @@ public class PurchasePlanMainServiceImpl implements PurchasePlanMainService {
@Resource
private PurchasePlanMainMapper purchasePlanMainMapper;
@Resource
private PurchasePlanDetailMapper purchasePlanDetailMapper;
@Override
public Long createPurchasePlanMain(PurchasePlanMainCreateReqVO createReqVO) {
// 插入
@ -82,5 +88,30 @@ public class PurchasePlanMainServiceImpl implements PurchasePlanMainService {
public List<PurchasePlanMainDO> getPurchasePlanMainList(PurchasePlanMainExportReqVO exportReqVO) {
return purchasePlanMainMapper.selectList(exportReqVO);
}
@Override
public PurchasePlanDetailDO selectPurchasePlan(String pnubmer,String psupplierCode,String ppoNumber,String ppoLine,String pitemCode){
QueryWrapper queryWrapperMain = new QueryWrapper();
queryWrapperMain.eq("number",pnubmer);
queryWrapperMain.eq("supplier_code",psupplierCode);
PurchasePlanMainDO purchasePlanMainDO = purchasePlanMainMapper.selectOne(queryWrapperMain);
if(purchasePlanMainDO != null && "TRUE".equals(purchasePlanMainDO.getAvailable())){
if(!"CLOSED".equals(purchasePlanMainDO.getStatus())){
QueryWrapper queryWrapperDetail = new QueryWrapper();
queryWrapperDetail.eq("master_id",purchasePlanMainDO.getId());
queryWrapperDetail.eq("number",ppoNumber);
queryWrapperDetail.eq("po_line",ppoLine);
queryWrapperDetail.eq("item_code",pitemCode);
PurchasePlanDetailDO purchasePlanDetailDO = purchasePlanDetailMapper.selectOne(queryWrapperDetail);
if(purchasePlanDetailDO != null && "TRUE".equals(purchasePlanDetailDO.getAvailable())){
return purchasePlanDetailDO;
}else {
throw exception(PURCHASE_PLAN_DETAIL_PONUMBER_POLINE_ITEMCODE_INVALID);
}
}else {
throw exception(PURCHASE_PLAN_IS_CLOSED);
}
}else {
throw exception(PURCHASE_PLAN_MAIN_NUMBER_INVALID);
}
}
}

10
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchasereceiptRecordMainService.java

@ -7,6 +7,7 @@ import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchasereceiptRec
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchasereceiptRecordMainExportReqVO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchasereceiptRecordMainPageReqVO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchasereceiptRecordMainUpdateReqVO;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchasereceiptRecordDetailDO;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchasereceiptRecordMainDO;
import com.win.framework.common.pojo.PageResult;
@ -71,4 +72,13 @@ public interface PurchasereceiptRecordMainService {
*/
List<PurchasereceiptRecordMainDO> getPurchasereceiptRecordMainList(PurchasereceiptRecordMainExportReqVO exportReqVO);
/**
* 查询采购收货记录是否存在
* Record-----VPur
* @param ppoNumber 订单号
* @param ppoLine 订单行
* @param pitemCode 零件号
* @return
*/
public PurchasereceiptRecordDetailDO selectPurchasereceiptExist(String ppoNumber, String ppoLine, String pitemCode);
}

27
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchasereceiptRecordMainServiceImpl.java

@ -1,9 +1,12 @@
package com.win.module.wms.service.purchasereceiptRecord;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchasereceiptRecordMainCreateReqVO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchasereceiptRecordMainExportReqVO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchasereceiptRecordMainPageReqVO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchasereceiptRecordMainUpdateReqVO;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchasereceiptRecordDetailDO;
import com.win.module.wms.dal.mysql.purchasereceiptRecord.PurchasereceiptRecordDetailMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -31,6 +34,9 @@ public class PurchasereceiptRecordMainServiceImpl implements PurchasereceiptReco
@Resource
private PurchasereceiptRecordMainMapper purchasereceiptRecordMainMapper;
@Resource
private PurchasereceiptRecordDetailMapper purchasereceiptRecordDetailMapper;
@Override
public Long createPurchasereceiptRecordMain(PurchasereceiptRecordMainCreateReqVO createReqVO) {
// 插入
@ -82,5 +88,24 @@ public class PurchasereceiptRecordMainServiceImpl implements PurchasereceiptReco
public List<PurchasereceiptRecordMainDO> getPurchasereceiptRecordMainList(PurchasereceiptRecordMainExportReqVO exportReqVO) {
return purchasereceiptRecordMainMapper.selectList(exportReqVO);
}
@Override
public PurchasereceiptRecordDetailDO selectPurchasereceiptExist(String ppoNumber,String ppoLine,String pitemCode){
QueryWrapper queryWrapperMain = new QueryWrapper();
queryWrapperMain.eq("asn_number",ppoNumber);
PurchasereceiptRecordMainDO purchasereceiptRecordMainDO = purchasereceiptRecordMainMapper.selectOne(queryWrapperMain);
if(purchasereceiptRecordMainDO != null && "TRUE".equals(purchasereceiptRecordMainDO.getAvailable())){
QueryWrapper queryWrapperDetail = new QueryWrapper();
queryWrapperDetail.eq("po_number",ppoNumber);
queryWrapperDetail.eq("po_line",ppoLine);
queryWrapperDetail.eq("item_code",pitemCode);
PurchasereceiptRecordDetailDO purchasereceiptRecordDetailDO = purchasereceiptRecordDetailMapper.selectOne(queryWrapperDetail);
if(purchasereceiptRecordDetailDO != null){
return purchasereceiptRecordDetailDO;
}else {
throw exception(PURCHASERECEIPT_RECORD_DETAIL_PONUMBER_POLINE_ITEMCODE_INVALID);
}
}else {
throw exception(PURCHASERECEIPT_RECORD_MAIN_NUMBER_NOT_EXISTS);
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/recordsetting/RecordsettingService.java

@ -70,4 +70,13 @@ public interface RecordsettingService {
List<RecordsettingDO> getRecordsettingList(RecordsettingExportReqVO exportReqVO);
List<RecordsettingImportExcelVO> importRecordsettingList(List<RecordsettingImportExcelVO> recordsettings, Integer mode, Boolean updatePart);
/**
* Setting-----QRS
* 查询记录单设置是否存在
* @author chenfang
* @param pcode
* @return
*/
public RecordsettingDO selectRecordsettingExist(String pcode);
}

12
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/recordsetting/RecordsettingServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.recordsetting;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -165,4 +166,15 @@ public class RecordsettingServiceImpl implements RecordsettingService {
throw exception(RECORDSETTING_AVAILABLE_NOT_EXISTS);
}
}
@Override
public RecordsettingDO selectRecordsettingExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode);
RecordsettingDO recordsettingDO = recordsettingMapper.selectOne(queryWrapper);
if(recordsettingDO != null && "TRUE".equals(recordsettingDO)){
return recordsettingDO;
}else {
throw exception(RECORDSETTING_NOT_EXISTS);
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/requestsetting/RequestsettingService.java

@ -70,4 +70,13 @@ public interface RequestsettingService {
List<RequestsettingDO> getRequestsettingList(RequestsettingExportReqVO exportReqVO);
List<RequestsettingImportExcelVO> importRequestsettingList(List<RequestsettingImportExcelVO> requestsettings, Integer mode, Boolean updatePart);
/**
* Setting-----QRS
* 查询申请单设置是否存在
* @author chenfang
* @param pcode
* @return
*/
public RequestsettingDO selectRequestsettingExist(String pcode);
}

12
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/requestsetting/RequestsettingServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.requestsetting;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -196,4 +197,15 @@ public class RequestsettingServiceImpl implements RequestsettingService {
throw exception(REQUESTSETTING_AVAILABLE_NOT_EXISTS);
}
}
@Override
public RequestsettingDO selectRequestsettingExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode);
RequestsettingDO requestsettingDO = requestsettingMapper.selectOne(queryWrapper);
if(requestsettingDO != null && "TRUE".equals(requestsettingDO.getAutoAgree())){
return requestsettingDO;
}else {
throw exception(REQUESTSETTING_NOT_EXISTS);
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/saleprice/SalepriceService.java

@ -74,4 +74,13 @@ public interface SalepriceService {
List<SalepriceImportExcelVo> importSalepriceList(List<SalepriceImportExcelVo> importTeam, Integer mode, boolean updatePart);
/**
* 查询销售价格单
* BQ------QSaleP
* @author chenfang
* @param pcustomerCode 客户code
* @param pitemCode 物品code
* @return
*/
public SalepriceDO selectItemPackagingExist(String pcustomerCode,String pitemCode);
}

51
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/saleprice/SalepriceServiceImpl.java

@ -2,12 +2,14 @@ package com.win.module.wms.service.saleprice;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.datapermission.core.util.DataPermissionUtils;
import com.win.module.wms.controller.saleprice.vo.*;
import com.win.module.wms.convert.saleprice.SalepriceConvert;
import com.win.module.wms.dal.dataobject.itempackaging.ItempackagingDO;
import com.win.module.wms.dal.dataobject.saleprice.SalepriceDO;
import com.win.module.wms.dal.mysql.saleprice.SalepriceMapper;
import org.springframework.stereotype.Service;
@ -37,8 +39,7 @@ public class SalepriceServiceImpl implements SalepriceService {
@Override
public Long createSaleprice(SalepriceCreateReqVO createReqVO) {
validateSalepriceForCreateOrUpdate(createReqVO.getId(),createReqVO.getCustomerCode(),createReqVO.getItemCode(),createReqVO.getCurrency()
,createReqVO.getPrice(),createReqVO.getAvailable());
validateSalepriceForCreateOrUpdate(createReqVO.getId(), createReqVO.getCustomerCode(), createReqVO.getItemCode(), createReqVO.getCurrency(), createReqVO.getPrice(), createReqVO.getAvailable());
// 插入
SalepriceDO saleprice = SalepriceConvert.INSTANCE.convert(createReqVO);
salepriceMapper.insert(saleprice);
@ -49,8 +50,7 @@ public class SalepriceServiceImpl implements SalepriceService {
@Override
public void updateSaleprice(SalepriceUpdateReqVO updateReqVO) {
// 校验存在
validateSalepriceForCreateOrUpdate(updateReqVO.getId(),updateReqVO.getCustomerCode(),updateReqVO.getItemCode(),updateReqVO.getCurrency()
,updateReqVO.getPrice(),updateReqVO.getAvailable());
validateSalepriceForCreateOrUpdate(updateReqVO.getId(), updateReqVO.getCustomerCode(), updateReqVO.getItemCode(), updateReqVO.getCurrency(), updateReqVO.getPrice(), updateReqVO.getAvailable());
// 更新
SalepriceDO updateObj = SalepriceConvert.INSTANCE.convert(updateReqVO);
salepriceMapper.updateById(updateObj);
@ -84,7 +84,7 @@ public class SalepriceServiceImpl implements SalepriceService {
return salepriceMapper.selectList(exportReqVO);
}
public List<SalepriceImportExcelVo> importSalepriceList(List<SalepriceImportExcelVo> saleprices, Integer mode, boolean updatePart) {
public List<SalepriceImportExcelVo> importSalepriceList(List<SalepriceImportExcelVo> saleprices, Integer mode, boolean updatePart) {
if (CollUtil.isEmpty(saleprices)) {
throw exception(SALEPRICE_IMPORT_LIST_IS_EMPTY);
}
@ -92,9 +92,8 @@ public class SalepriceServiceImpl implements SalepriceService {
saleprices.forEach(saleprice -> {
// 校验,判断是否有不符合的原因
try {
if(mode != null){
validateSalepriceForCreateOrUpdate(null,saleprice.getCustomerCode(),saleprice.getItemCode(),saleprice.getCurrency()
,saleprice.getPrice(),saleprice.getAvailable());
if (mode != null) {
validateSalepriceForCreateOrUpdate(null, saleprice.getCustomerCode(), saleprice.getItemCode(), saleprice.getCurrency(), saleprice.getPrice(), saleprice.getAvailable());
}
} catch (ServiceException ex) {
errorList.add(saleprice);
@ -103,29 +102,27 @@ public class SalepriceServiceImpl implements SalepriceService {
// 判断如果不存在,在进行插入
SalepriceDO existSaleprice = salepriceMapper.selectByItemCode(saleprice.getItemCode());
if (existSaleprice == null&& mode != 3) {
if (existSaleprice == null && mode != 3) {
salepriceMapper.insert(SalepriceConvert.INSTANCE.convert(saleprice));
}
else if (existSaleprice != null && mode != 2) {// 如果存在,判断是否允许更新
} else if (existSaleprice != null && mode != 2) {// 如果存在,判断是否允许更新
SalepriceDO salepriceDO = SalepriceConvert.INSTANCE.convert(saleprice);
salepriceDO.setId(existSaleprice.getId());
salepriceMapper.updateById(salepriceDO);
}
});
//错误不为空并非部分更新,手工回滚
if(!errorList.isEmpty() && !updatePart) {
if (!errorList.isEmpty() && !updatePart) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return errorList;
}
private void validateSalepriceForCreateOrUpdate(Long id, String customercode, String itemcode, String currency,
BigDecimal price, String available ) {
private void validateSalepriceForCreateOrUpdate(Long id, String customercode, String itemcode, String currency, BigDecimal price, String available) {
// 关闭数据权限,避免因为没有数据权限,查询不到数据,进而导致唯一校验不正确
DataPermissionUtils.executeIgnore(() -> {
validateSalepriceExists(id);
// 校验code唯一
validateCodeExists(id,itemcode);
validateCodeExists(id, itemcode);
validateCustomerCodeExists(customercode);
validateCurrencyExists(currency);
validatePriceExists(price);
@ -133,6 +130,7 @@ public class SalepriceServiceImpl implements SalepriceService {
});
}
@VisibleForTesting
private void validateSalepriceExists(Long id) {
if (id == null) {
@ -144,7 +142,7 @@ public class SalepriceServiceImpl implements SalepriceService {
}
@VisibleForTesting
private void validateCodeExists(Long id,String itemcode) {
private void validateCodeExists(Long id, String itemcode) {
if (itemcode.isEmpty()) {
throw exception(SALEPRICE_ITEM_CODE_NOT_EXISTS);
}
@ -163,9 +161,10 @@ public class SalepriceServiceImpl implements SalepriceService {
throw exception(SALEPRICE_ITEM_CODE_EXISTS);
}
}
@VisibleForTesting
private void validatePriceExists(BigDecimal price) {
if (price ==null) {
if (price == null) {
throw exception(SALEPRICE_PRICE_NOT_EXISTS);
}
}
@ -177,7 +176,6 @@ public class SalepriceServiceImpl implements SalepriceService {
}
}
@VisibleForTesting
private void validateCustomerCodeExists(String customerCode) {
if (customerCode.isEmpty()) {
@ -185,8 +183,6 @@ public class SalepriceServiceImpl implements SalepriceService {
}
}
@VisibleForTesting
private void validateAvailableExists(String available) {
if (available == null) {
@ -194,7 +190,16 @@ public class SalepriceServiceImpl implements SalepriceService {
}
}
@Override
public SalepriceDO selectItemPackagingExist(String pcustomerCode,String pitemCode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("itemcode",pitemCode);
queryWrapper.eq("customer_code",pcustomerCode);
SalepriceDO salepriceDO = salepriceMapper.selectOne(queryWrapper);
if(salepriceDO != null && "TRUE".equals(salepriceDO.getAvailable())){
return salepriceDO;
}else {
throw exception(SALEPRICE_NOT_EXISTS);
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/stdcostprice/StdcostpriceService.java

@ -75,4 +75,13 @@ public interface StdcostpriceService {
List<StdcostpriceImportExcelVo> importStdcostpriceList(List<StdcostpriceImportExcelVo> importTeam, Integer mode, boolean updatePart);
/**
* 查询标准成本价格是否存在
* BQ-----QSCP
* @author chenfang
* @param supplierCode
* @param pitemCode
* @return
*/
public StdcostpriceDO selectStdcostpriceExist(String supplierCode,String pitemCode);
}

18
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/stdcostprice/StdcostpriceServiceImpl.java

@ -2,12 +2,14 @@ package com.win.module.wms.service.stdcostprice;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.datapermission.core.util.DataPermissionUtils;
import com.win.module.wms.controller.stdcostprice.vo.*;
import com.win.module.wms.convert.stdcostprice.StdcostpriceConvert;
import com.win.module.wms.dal.dataobject.itempackaging.ItempackagingDO;
import com.win.module.wms.dal.dataobject.stdcostprice.StdcostpriceDO;
import com.win.module.wms.dal.mysql.stdcostprice.StdcostpriceMapper;
import org.springframework.stereotype.Service;
@ -187,6 +189,16 @@ public class StdcostpriceServiceImpl implements StdcostpriceService {
throw exception(STDCOSTPRICE_AVAILABLE_NOT_EXISTS);
}
}
}
@Override
public StdcostpriceDO selectStdcostpriceExist(String supplierCode,String pitemCode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("itemcode",pitemCode);
queryWrapper.eq("supplier_code",supplierCode);
StdcostpriceDO stdcostpriceDO = stdcostpriceMapper.selectOne(queryWrapper);
if(stdcostpriceDO != null && "TRUE".equals(stdcostpriceDO.getAvailable())){
return stdcostpriceDO;
}else {
throw exception(STDCOSTPRICE_NOT_EXISTS);
}
}
}

8
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplieritem/SupplieritemService.java

@ -74,4 +74,12 @@ public interface SupplieritemService {
List<SupplieriteamImportExcelVo> importSupplieriteamList(List<SupplieriteamImportExcelVo> importTeam, Integer mode, boolean updatePart);
/**
* BQ----QSI
* 查询供应商物品是否存在
* @param psupplierCode 供应商code
* @param pitemCode 物品code
* @return
*/
public SupplieritemDO selectSupplierItemExist(String psupplierCode,String pitemCode);
}

15
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplieritem/SupplieritemServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.supplieritem;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -194,8 +195,18 @@ public class SupplieritemServiceImpl implements SupplieritemService {
throw exception(SUPPLIERITEM_AVAILABLE_NOT_EXISTS);
}
}
@Override
public SupplieritemDO selectSupplierItemExist(String psupplierCode,String pitemCode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("itemcode",pitemCode);
queryWrapper.eq("supplier_code",psupplierCode);
SupplieritemDO supplieritemDO = supplieritemMapper.selectOne(queryWrapper);
if(supplieritemDO != null && "TRUE".equals(supplieritemDO.getAvailable())){
return supplieritemDO;
}else {
throw exception(SUPPLIERITEM_NOT_EXISTS);
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/transactiontype/TransactiontypeService.java

@ -76,6 +76,15 @@ public interface TransactiontypeService {
List<TransactiontypeImportExcelVo> importTransactiontypeList(List<TransactiontypeImportExcelVo> importWarehouse, Integer mode, boolean updatePart);
/**
* 查询事务类型是否存在
* Setting-----QTT
* @author chenfang
* @param pcode code
* @return
*/
public TransactiontypeDO selectTransactiontype(String pcode);
}

17
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/transactiontype/TransactiontypeServiceImpl.java

@ -2,6 +2,7 @@ package com.win.module.wms.service.transactiontype;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
@ -160,9 +161,15 @@ public class TransactiontypeServiceImpl implements TransactiontypeService {
throw exception(TRANSACTIONTYPE_AVAIABLE_NOT_EXISTS);
}
}
@Override
public TransactiontypeDO selectTransactiontype(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode);
TransactiontypeDO transactiontypeDO = transactiontypeMapper.selectOne(queryWrapper);
if(transactiontypeDO != null && "TRUE".equals(transactiontypeDO.getAvailable())){
return transactiontypeDO;
}else {
throw exception(TRANSACTIONTYPE_NOT_EXISTS);
}
}
}

7
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/workshop/WorkshopService.java

@ -71,4 +71,11 @@ public interface WorkshopService {
List<WorkshopImportExcelVo> importUserList(List<WorkshopImportExcelVo> importWorkshop, Integer mode, boolean updatePart);
/**
* 查询车间是否存在
* BQ-----QWShop
* @param pcode 代码
* @return
*/
public WorkshopDO selectWorkshopExist(String pcode);
}

14
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/workshop/WorkshopServiceImpl.java

@ -2,12 +2,14 @@ package com.win.module.wms.service.workshop;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.datapermission.core.util.DataPermissionUtils;
import com.win.module.wms.controller.workshop.vo.*;
import com.win.module.wms.convert.workshop.WorkshopConvert;
import com.win.module.wms.dal.dataobject.itempackaging.ItempackagingDO;
import com.win.module.wms.dal.dataobject.workshop.WorkshopDO;
import com.win.module.wms.dal.mysql.workshop.WorkshopMapper;
import org.springframework.stereotype.Service;
@ -160,5 +162,15 @@ public class WorkshopServiceImpl implements WorkshopService {
throw exception(WORKSHOP_AVAIABLE_NOT_EXISTS);
}
}
@Override
public WorkshopDO selectWorkshopExist(String pcode){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("code",pcode);
WorkshopDO workshopDO = workshopMapper.selectOne(queryWrapper);
if(workshopDO != null && "TRUE".equals(workshopDO.getAvailable())){
return workshopDO;
}else {
throw exception(WORKSHOP_NOT_EXISTS);
}
}
}

17
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/workstation/WorkstationService.java

@ -70,4 +70,21 @@ public interface WorkstationService {
List<WorkstationDO> getWorkstationList(WorkstationExportReqVO exportReqVO);
List<WorkstationImportExcelVo> importWorkstationList(List<WorkstationImportExcelVo> workstations, Integer mode,Boolean updatePart);
/**
* BQ-----QWStation
* 查询工位是否存在
* @param pcode 工位code
* @return
*/
public WorkstationDO selectWorkstationExist(String pcode);
/**
* 校验工位与生产线关系是否存在
* @author chenfang
* @param pcode 工位code
* @param pructionLineCode 生产线code
* @return
*/
public boolean ifInPructionLine(String pcode,String pructionLineCode);
}

26
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/workstation/WorkstationServiceImpl.java

@ -1,13 +1,16 @@
package com.win.module.wms.service.workstation;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.exceptions.UtilException;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.win.framework.common.exception.ServiceException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.datapermission.core.util.DataPermissionUtils;
import com.win.module.wms.controller.workstation.vo.*;
import com.win.module.wms.convert.workstation.WorkstationConvert;
import com.win.module.wms.dal.dataobject.itempackaging.ItempackagingDO;
import com.win.module.wms.dal.dataobject.workstation.WorkstationDO;
import com.win.module.wms.dal.mysql.workstation.WorkstationMapper;
import org.springframework.stereotype.Service;
@ -179,4 +182,27 @@ public class WorkstationServiceImpl implements WorkstationService {
throw exception(WORKSTATION_AVAIABLE_NOT_EXISTS);
}
}
@Override
public WorkstationDO selectWorkstationExist(String pcode){
QueryWrapper queryWrapperWorkstation = new QueryWrapper();
queryWrapperWorkstation.eq("code",pcode);
WorkstationDO workstationDO = workstationMapper.selectOne(queryWrapperWorkstation);
if(workstationDO != null && "TRUE".equals(workstationDO.getAvailable())){
return workstationDO;
}else {
throw exception(WORKSTATION_NOT_EXISTS);
}
}
@Override
public boolean ifInPructionLine(String pcode,String pructionLineCode){
QueryWrapper queryWrapperWorkstation = new QueryWrapper();
queryWrapperWorkstation.eq("code",pcode);
queryWrapperWorkstation.eq("pruction_line_code",pructionLineCode);
WorkstationDO workstationDO = workstationMapper.selectOne(queryWrapperWorkstation);
if(workstationDO != null && "TRUE".equals(workstationDO.getAvailable())){
return true;
}else {
throw exception(WORKSTATION_PRODUECTION_LINE_CODE_AND_WORKSTATION_RELATION_ERROR);
}
}
}

129
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/until/job/JobUtils.java

@ -17,7 +17,6 @@ import com.win.module.wms.dal.mysql.expectout.ExpectoutMapper;
import com.win.module.wms.dal.mysql.location.LocationMapper;
import com.win.module.wms.service.balance.BalanceService;
import com.win.module.wms.service.expectout.ExpectoutService;
import com.win.module.wms.service.expectout.ExpectoutServiceImpl;
import com.win.module.wms.service.itembasic.ItembasicService;
import com.win.module.wms.service.location.LocationService;
import com.win.module.wms.service.rule.RuleService;
@ -141,7 +140,7 @@ public class JobUtils {
/**
* 校验物料有效状态正确
*
* @author chenfang
* @param itemCode 物品代码
* @return 物品基本信息列表
* @author chenfang
@ -157,7 +156,7 @@ public class JobUtils {
/**
* 校验供应商有效状态正确
*
* @author chenfang
* @param supplierCode 代码
* @return 供应商列表
* @author chenfang
@ -193,7 +192,7 @@ public class JobUtils {
* 从库位号有效状态正确开关正确
* 到库位号有效状态正确开关正确
* 共用同一个方法
*
* @author chenfang
* @param locationCode 库位
* @return 库位信息
* @author chenfang
@ -221,7 +220,7 @@ public class JobUtils {
/**
* 零件库位关系有效
*
* @author chenfang
* @param pitemCode 物品代码
* @return 上架策略信息
* @author chenfang
@ -348,54 +347,98 @@ public class JobUtils {
}
// TB1 查询库存
public List<BalanceDO> selectlocation(String itemcode, String packingnumber, String batch, String locationcode, String status) {
/**
* TB-------TB1
* 查询库存返回管理精度
* @author lianhongxi
* @param itemcode 零件号
* @param packingnumber 包装号
* @param batch 批次
* @param locationcode 库位号
* @param inventoryStatus 入库库存状态
* @return
*/
public List<BalanceDO> selectlocation(String itemcode, String packingnumber, String batch, String locationcode, String inventoryStatus) {
RuleRespVO managementtRule = ruleService.management(null, null, null, null, null, null, itemcode, null, null,
null, locationcode, null, null);
List<BalanceDO> balanceDO = null;
if ("{\"ManagementPrecision\":\"BY_QUANTITY\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectNumber(itemcode, status, locationcode);
balanceDO = balanceService.selectNumber(itemcode, inventoryStatus, locationcode);
} else if ("{\"ManagementPrecision\":\"BY_BATCH\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectBatch(itemcode, batch, status, locationcode);
balanceDO = balanceService.selectBatch(itemcode, batch, inventoryStatus, locationcode);
} else if ("{\"ManagementPrecision\":\"BY_PACKAGING\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectPackaging(itemcode, packingnumber, batch, status, locationcode);
balanceDO = balanceService.selectPackaging(itemcode, packingnumber, batch, inventoryStatus, locationcode);
} else if ("{\"ManagementPrecision\":\"BY_UNIQUE_ID\"}".equals(managementtRule.getConfiguration())) {
balanceDO = balanceService.selectUniqueId(packingnumber, locationcode, status);
balanceDO = balanceService.selectUniqueId(packingnumber, locationcode, inventoryStatus);
}
return balanceDO;
}
//跟据管理模式查询预计库存 TEO1
public List<ExpectoutDO> selectLocatioNew(String itemcode, String packingnumber, String batch, String locationcode, String status) {
//
/**
* 跟据管理模式查询预计库存
* TB-----TB3-----TEO----TEO1
* @author lianhongxi
* @param itemcode 零件号
* @param packingnumber 包装号
* @param batch 批次
* @param locationcode 库位号
* @param inventoryStatus 入库库存状态
* @return
*/
public List<ExpectoutDO> selectLocatioNew(String itemcode, String packingnumber, String batch, String locationcode, String inventoryStatus) {
RuleRespVO managementtRule = ruleService.management(null, null, null, null, null, null, itemcode, null, null,
null, locationcode, null, null);
List<ExpectoutDO> expectoutDO = null;
if ("{\"ManagementPrecision\":\"BY_QUANTITY\"}".equals(managementtRule.getConfiguration())) {
expectoutDO = expectoutService.selectNumberNew(itemcode, status, locationcode);
expectoutDO = expectoutService.selectNumberNew(itemcode, inventoryStatus, locationcode);
} else if ("{\"ManagementPrecision\":\"BY_BATCH\"}".equals(managementtRule.getConfiguration())) {
expectoutDO = expectoutService.selectBatchNew(itemcode, batch, status, locationcode);
expectoutDO = expectoutService.selectBatchNew(itemcode, batch, inventoryStatus, locationcode);
} else if ("{\"ManagementPrecision\":\"BY_PACKAGING\"}".equals(managementtRule.getConfiguration())) {
expectoutDO = expectoutService.selectPackingNew(itemcode, packingnumber, batch, status, locationcode);
expectoutDO = expectoutService.selectPackingNew(itemcode, packingnumber, batch, inventoryStatus, locationcode);
} else if ("{\"ManagementPrecision\":\"BY_UNIQUE_ID\"}".equals(managementtRule.getConfiguration())) {
expectoutDO = expectoutService.selectUniqeIdNew(packingnumber, locationcode, status);
expectoutDO = expectoutService.selectUniqeIdNew(packingnumber, locationcode, inventoryStatus);
}
return expectoutDO;
}
//查询可用库存 TB3
public BigDecimal CountLocaltion(String itemcode, String packingnumber, String batch, String locationcode, String status) {
List<ExpectoutDO> expectoutDO = selectLocatioNew(itemcode, packingnumber, batch, locationcode, status);
List<BalanceDO> balanceDO = selectlocation(itemcode, packingnumber, batch, locationcode, status);
/**
* 查询可用库存
* TB----TB3
* @author lianhongxi
* @param itemcode 零件号
* @param packingnumber 包装号
* @param batch 批次
* @param locationcode 库位好
* @param inventoryStatus 入库库存状态
* @return
*/
public BigDecimal CountLocaltion(String itemcode, String packingnumber, String batch, String locationcode, String inventoryStatus) {
List<BalanceDO> balanceDO = selectlocation(itemcode, packingnumber, batch, locationcode, inventoryStatus);
List<ExpectoutDO> expectoutDO = selectLocatioNew(itemcode, packingnumber, batch, locationcode, inventoryStatus);
BigDecimal esum = BigDecimal.valueOf(expectoutDO.stream().mapToDouble(expectoutDO1 -> expectoutDO1.getQty().doubleValue()).sum());
BigDecimal bsum = BigDecimal.valueOf(balanceDO.stream().mapToDouble(balanceDO1 -> balanceDO1.getQty().doubleValue()).sum());
BigDecimal sum = bsum.subtract(esum);
return sum;
}
//有无库存效验
public String LocaltionExist(String itemcode, String packingnumber, String batch, String locationcode, String status, BigDecimal requstqty) {
BigDecimal enableqty = CountLocaltion(itemcode, packingnumber, batch, locationcode, status);
/**
* 请求库存校验是否有库存余额
* @author lianhongxi
* @param itemcode 零件号
* @param packingnumber 包装号
* @param batch 批次
* @param locationcode 库位好
* @param inventoryStatus 入库库存状态
* @param requstqty 请求数量
* @return
*/
public String LocaltionExist(String itemcode, String packingnumber, String batch, String locationcode, String inventoryStatus, BigDecimal requstqty) {
BigDecimal enableqty = CountLocaltion(itemcode, packingnumber, batch, locationcode, inventoryStatus);
if (requstqty.compareTo(enableqty) > 0) {
throw exception(new ErrorCode(1256, "请求数量" + requstqty + "大于库存数量" + enableqty));
} else {
@ -441,17 +484,51 @@ public class JobUtils {
}
//从库位未被其他任务占用,有可用库存
public String locationExistnew(String itemcode, String packingnumber, String batch, String fromlocationcode, String status, BigDecimal requstqty) {
public String locationExistnew(String itemcode, String packingnumber, String batch, String fromlocationcode, String inventoryStatus, BigDecimal requstqty) {
if (fromlocationcode.isEmpty()) {
return "不需要其他校验";
}
String Yesorno = selectlocation(fromlocationcode);
if ("TURE".equals(Yesorno)) {
String END = LocaltionExist(itemcode, packingnumber, batch, fromlocationcode, status, requstqty);
String END = LocaltionExist(itemcode, packingnumber, batch, fromlocationcode, inventoryStatus, requstqty);
return END;
} else {
return "效验通过";
}
}
/**
* 根据管理模式查询预计出库存
* TEO----TEO1
* @author lianhongxi
* @param pitemcode 零件号
* @param ppackingnumber 包装号
* @param pbatch 批次
* @param pinventorystatus 入库库存状态
* @param plocationcode 库位号
* @return
*/
public List<ExpectoutDO> selectExpectort(String pitemcode, String ppackingnumber, String pbatch, String pinventorystatus, String plocationcode){
RuleRespVO management = ruleService.management(null, null, null, null, null, null, pitemcode,
null, null, null, plocationcode, null, null);
List<ExpectoutDO> expectoutDO = null;
if(management != null){
String[] splits = management.getConfiguration().split("\"");
for (String split : splits) {
if ("{\"ManagementPrecision\":\"BY_QUANTITY\"}".equals(management.getConfiguration())) {
expectoutService.selectNumberNew(pitemcode, pinventorystatus, plocationcode);
} else if ("{\"ManagementPrecision\":\"BY_BATCH\"}".equals(management.getConfiguration())) {
expectoutDO = expectoutService.selectBatchNew(pitemcode, pbatch, pinventorystatus, plocationcode);
} else if ("{\"ManagementPrecision\":\"BY_PACKAGING\"}".equals(management.getConfiguration())) {
expectoutDO = expectoutService.selectPackingNew(pitemcode, ppackingnumber, pbatch, pinventorystatus, plocationcode);
} else if ("{\"ManagementPrecision\":\"BY_UNIQUE_ID\"}".equals(management.getConfiguration())) {
expectoutDO = expectoutService.selectUniqeIdNew(ppackingnumber, plocationcode, pinventorystatus);
}
return expectoutDO;
}
}else {
throw exception(RULE_NOT_EXISTS);
}
return expectoutDO;
}
}

12
win-module-wms/win-module-wms-biz/src/main/resources/mapper/documentSwitch/SwitchMapper.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.win.module.wms.dal.mysql.documentSwitch.SwitchMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>
Loading…
Cancel
Save