| | |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.controller.params.AsnOrderAndItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.TransferItemParams; |
| | | import com.vincent.rsf.server.manager.entity.Transfer; |
| | | import com.vincent.rsf.server.manager.entity.excel.CheckOrderTemplate; |
| | | import com.vincent.rsf.server.manager.service.TransferService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | transfer.setCreateTime(new Date()); |
| | | transfer.setUpdateBy(getLoginUserId()); |
| | | transfer.setUpdateTime(new Date()); |
| | | |
| | | if (Objects.isNull(transfer.getCode())) { |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_TRANSFER_ORDER_CODE, transfer); |
| | | transfer.setCode(ruleCode); |
| | | } |
| | | |
| | | if (!transferService.save(transfer)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PostMapping("/transfer/items/save") |
| | | @ApiOperation("保存主单及明细") |
| | | @PreAuthorize("hasAuthority('manager:transfer:save')") |
| | | public R saveOutStock(@RequestBody TransferItemParams params) throws Exception { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return transferService.saveTransfer(params, getLoginUserId()); |
| | | } |
| | | |
| | | @ApiOperation("单据信息修改") |
| | | @PostMapping("/transfer/items/update") |
| | | @PreAuthorize("hasAuthority('manager:outStock:update')") |
| | | public R orderAndrItemUpdate(@RequestBody TransferItemParams params) throws Exception { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return transferService.updateTransfer(params, getLoginUserId()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 下载模板 |