移动端的单据编号自动生成

This commit is contained in:
yinjinlu-pc\尹金路 2023-08-17 22:21:37 +08:00
parent 7f6547d999
commit 8a25d8dd0d
3 changed files with 21 additions and 18 deletions

View File

@ -78,10 +78,6 @@ public class WmIssueMobController extends BaseController {
@PostMapping @PostMapping
public AjaxResult add(@RequestBody WmIssueHeader wmIssueHeader) public AjaxResult add(@RequestBody WmIssueHeader wmIssueHeader)
{ {
if(UserConstants.NOT_UNIQUE.equals(wmIssueHeaderService.checkIssueCodeUnique(wmIssueHeader))){
return AjaxResult.error("领料单编号已存在");
}
if(StringUtils.isNotNull(wmIssueHeader.getIssueCode())){ if(StringUtils.isNotNull(wmIssueHeader.getIssueCode())){
if(UserConstants.NOT_UNIQUE.equals(wmIssueHeaderService.checkIssueCodeUnique(wmIssueHeader))){ if(UserConstants.NOT_UNIQUE.equals(wmIssueHeaderService.checkIssueCodeUnique(wmIssueHeader))){
return AjaxResult.error("单据编号已存在!"); return AjaxResult.error("单据编号已存在!");

View File

@ -14,6 +14,7 @@ import com.ktg.mes.pro.service.IProWorkorderService;
import com.ktg.mes.wm.domain.*; import com.ktg.mes.wm.domain.*;
import com.ktg.mes.wm.domain.tx.RtIssueTxBean; import com.ktg.mes.wm.domain.tx.RtIssueTxBean;
import com.ktg.mes.wm.service.*; import com.ktg.mes.wm.service.*;
import com.ktg.system.strategy.AutoCodeUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -35,22 +36,15 @@ public class WmRtIssueMobController extends BaseController {
@Autowired @Autowired
private IWmRtIssueLineService wmRtIssueLineService; private IWmRtIssueLineService wmRtIssueLineService;
@Autowired
private IWmWarehouseService wmWarehouseService;
@Autowired
private IWmStorageLocationService wmStorageLocationService;
@Autowired
private IWmStorageAreaService wmStorageAreaService;
@Autowired @Autowired
private IStorageCoreService storageCoreService; private IStorageCoreService storageCoreService;
@Autowired @Autowired
private IProWorkorderService proWorkorderService; private IProWorkorderService proWorkorderService;
@Autowired
private AutoCodeUtil autoCodeUtil;
/** /**
* 查询生产退料单头列表 * 查询生产退料单头列表
*/ */
@ -85,10 +79,15 @@ public class WmRtIssueMobController extends BaseController {
@PostMapping @PostMapping
public AjaxResult add(@RequestBody WmRtIssue wmRtIssue) public AjaxResult add(@RequestBody WmRtIssue wmRtIssue)
{ {
if(UserConstants.NOT_UNIQUE.equals(wmRtIssueService.checkUnique(wmRtIssue))){ if(StringUtils.isNotNull(wmRtIssue.getRtCode())){
return AjaxResult.error("退料单编号已存在"); if(UserConstants.NOT_UNIQUE.equals(wmRtIssueService.checkUnique(wmRtIssue))){
return AjaxResult.error("退料单编号已存在");
}
}else {
wmRtIssue.setRtCode(autoCodeUtil.genSerialCode(UserConstants.RTISSUE_CODE,""));
} }
if(StringUtils.isNotNull(wmRtIssue.getWorkorderId())){ if(StringUtils.isNotNull(wmRtIssue.getWorkorderId())){
ProWorkorder workorder = proWorkorderService.selectProWorkorderByWorkorderId(wmRtIssue.getWorkorderId()); ProWorkorder workorder = proWorkorderService.selectProWorkorderByWorkorderId(wmRtIssue.getWorkorderId());
wmRtIssue.setWorkorderCode(workorder.getWorkorderCode()); wmRtIssue.setWorkorderCode(workorder.getWorkorderCode());

View File

@ -13,6 +13,7 @@ import com.ktg.mes.wm.domain.WmRtVendor;
import com.ktg.mes.wm.domain.tx.RtVendorTxBean; import com.ktg.mes.wm.domain.tx.RtVendorTxBean;
import com.ktg.mes.wm.service.IStorageCoreService; import com.ktg.mes.wm.service.IStorageCoreService;
import com.ktg.mes.wm.service.IWmRtVendorService; import com.ktg.mes.wm.service.IWmRtVendorService;
import com.ktg.system.strategy.AutoCodeUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -36,6 +37,9 @@ public class WmRtVendorMobController extends BaseController {
@Autowired @Autowired
private IMdVendorService mdVendorService; private IMdVendorService mdVendorService;
@Autowired
private AutoCodeUtil autoCodeUtil;
/** /**
* 查询供应商退货列表 * 查询供应商退货列表
*/ */
@ -69,8 +73,12 @@ public class WmRtVendorMobController extends BaseController {
@PostMapping @PostMapping
public AjaxResult add(@RequestBody WmRtVendor wmRtVendor) public AjaxResult add(@RequestBody WmRtVendor wmRtVendor)
{ {
if(UserConstants.NOT_UNIQUE.equals(wmRtVendorService.checkCodeUnique(wmRtVendor))){ if(StringUtils.isNotNull(wmRtVendor.getRtCode())){
return AjaxResult.error("退货单编号已经存在!"); if(UserConstants.NOT_UNIQUE.equals(wmRtVendorService.checkCodeUnique(wmRtVendor))){
return AjaxResult.error("退货单编号已经存在!");
}
}else {
wmRtVendor.setRtCode(autoCodeUtil.genSerialCode(UserConstants.WM_RTVENDOR_CODE,""));
} }
if(StringUtils.isNotNull(wmRtVendor.getVendorId())){ if(StringUtils.isNotNull(wmRtVendor.getVendorId())){