| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.consumables.dto.ConsumablesInRecordDto; |
| | | import com.ruoyi.consumables.service.ConsumablesInRecordService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.word.WeighbridgeDocGenerator; |
| | | 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.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | public class ConsumablesInRecordController { |
| | | @Autowired |
| | | private ConsumablesInRecordService consumablesInRecordService; |
| | | @Autowired |
| | | private WeighbridgeDocGenerator weighbridgeDocGenerator; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "生产入库-入库管理-列表", businessType = BusinessType.OTHER) |
| | |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/editStockInStock") |
| | | @PreAuthorize("@ss.hasPermi('c_receipt_edit')") |
| | | @ApiOperation("编辑入库记录") |
| | | public AjaxResult editStockInStock(@RequestBody ConsumablesInRecordDto consumablesInRecordDto) { |
| | | if (consumablesInRecordDto.getId() == null) { |
| | | return AjaxResult.error("入库记录ID不能为空"); |
| | | } |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | BeanUtils.copyProperties(consumablesInRecordDto, stockInRecordDto); |
| | | String absoluteDocPath = weighbridgeDocGenerator.generateWeighbridgeDoc(stockInRecordDto); |
| | | consumablesInRecordDto.setWeighbridgeDocPath(absoluteDocPath); |
| | | consumablesInRecordDto.setStockInNum(consumablesInRecordDto.getQualitity()); |
| | | return AjaxResult.success(consumablesInRecordService.updateById(consumablesInRecordDto)); |
| | | } |
| | | |
| | | @DeleteMapping("") |
| | | @PreAuthorize("@ss.hasPermi('c_receipt_cancel')") |
| | | @Log(title = "入库管理-删除入库", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |