-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
149 additions
and
11 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
.../com/newbiest/mms/rest/materiallot/split/standard/SplitStandardMaterialLotController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.newbiest.mms.rest.materiallot.split.standard; | ||
|
||
import com.newbiest.base.rest.AbstractRestController; | ||
import com.newbiest.mms.model.MaterialLot; | ||
import com.newbiest.mms.service.MmsService; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiImplicitParam; | ||
import io.swagger.annotations.ApiOperation; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/mms") | ||
@Slf4j | ||
@Api(value="/mms", tags="MaterialManagerSystem", description = "物料管理相关") | ||
public class SplitStandardMaterialLotController extends AbstractRestController { | ||
|
||
@Autowired | ||
MmsService mmsService; | ||
|
||
@ApiOperation(value = "物料批次按数量分批") | ||
@ApiImplicitParam(name="request", value="request", required = true, dataType = "SplitStandardMaterialLotRequest") | ||
@RequestMapping(value = "/splitStandardMaterialLot", method = RequestMethod.POST, produces = "application/json; charset=utf-8") | ||
public SplitStandardMaterialLotResponse execute(@RequestBody SplitStandardMaterialLotRequest request) throws Exception { | ||
SplitStandardMaterialLotResponse response = new SplitStandardMaterialLotResponse(); | ||
response.getHeader().setTransactionId(request.getHeader().getTransactionId()); | ||
SplitStandardMaterialLotResponseBody responseBody = new SplitStandardMaterialLotResponseBody(); | ||
SplitStandardMaterialLotRequestBody requestBody = request.getBody(); | ||
|
||
List<MaterialLot> subMaterialLots = mmsService.splitStandardMLot(requestBody.getMaterialLotAction().getMaterialLotId(), requestBody.getMaterialLotAction().getTransQty()); | ||
responseBody.setSubMaterialLots(subMaterialLots); | ||
response.setBody(responseBody); | ||
return response; | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...ava/com/newbiest/mms/rest/materiallot/split/standard/SplitStandardMaterialLotRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.newbiest.mms.rest.materiallot.split.standard; | ||
|
||
import com.newbiest.base.msg.Request; | ||
import io.swagger.annotations.ApiModel; | ||
import lombok.Data; | ||
|
||
@Data | ||
@ApiModel | ||
public class SplitStandardMaterialLotRequest extends Request { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public static final String MESSAGE_NAME = "SplitStandardMaterialLot"; | ||
|
||
private SplitStandardMaterialLotRequestBody body; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...com/newbiest/mms/rest/materiallot/split/standard/SplitStandardMaterialLotRequestBody.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.newbiest.mms.rest.materiallot.split.standard; | ||
|
||
import com.newbiest.base.msg.RequestBody; | ||
import com.newbiest.mms.dto.MaterialLotAction; | ||
import io.swagger.annotations.ApiModel; | ||
import lombok.Data; | ||
|
||
import java.math.BigDecimal; | ||
|
||
@Data | ||
@ApiModel("具体请求操作信息") | ||
public class SplitStandardMaterialLotRequestBody extends RequestBody { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private MaterialLotAction materialLotAction; | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...va/com/newbiest/mms/rest/materiallot/split/standard/SplitStandardMaterialLotResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.newbiest.mms.rest.materiallot.split.standard; | ||
|
||
import com.newbiest.base.msg.Response; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class SplitStandardMaterialLotResponse extends Response { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private SplitStandardMaterialLotResponseBody body; | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
...om/newbiest/mms/rest/materiallot/split/standard/SplitStandardMaterialLotResponseBody.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.newbiest.mms.rest.materiallot.split.standard; | ||
|
||
import com.newbiest.base.msg.ResponseBody; | ||
import com.newbiest.mms.model.MaterialLot; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class SplitStandardMaterialLotResponseBody extends ResponseBody { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private List<MaterialLot> subMaterialLots; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters