| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | 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; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.mail.Multipart; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | |
| | | public R save(@RequestBody AsnOrder asnOrder) { |
| | | asnOrder.setCreateBy(getLoginUserId()); |
| | | asnOrder.setUpdateBy(getLoginUserId()); |
| | | String code = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_ASN_ORDER, asnOrder); |
| | | if (!Objects.isNull(code)) { |
| | | asnOrder.setCode(code); |
| | | } |
| | | if (!asnOrderService.save(asnOrder)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/asnOrder") |
| | | @ApiOperation("ASN导入接口") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:update')") |
| | | public R importExcel() { |
| | | @PostMapping("/asnOrder/matnr/list") |
| | | @ApiOperation("物料获取订单") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | public R getListByMatnr(@RequestBody Map<String, String> params){ |
| | | if (Objects.isNull(params)) { |
| | | throw new CoolException("查询条件不能为空!!"); |
| | | } |
| | | return R.ok(asnOrderService.getListByMatnr(params)); |
| | | } |
| | | |
| | | return R.ok(); |
| | | @PostMapping("/asnOrder/generate/barcode") |
| | | @ApiOperation("生成ASN标签") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | public R generateBarcode(@RequestBody List<AsnOrder> orders) { |
| | | if (orders.isEmpty()) { |
| | | return R.error("单据不能为空!!"); |
| | | } |
| | | return asnOrderService.generateBarcode(orders); |
| | | } |
| | | } |