| | |
| | | import com.ruoyi.production.dto.ProductionDispatchAddDto; |
| | | import com.ruoyi.production.dto.SalesLedgerSchedulingDto; |
| | | import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto; |
| | | import com.ruoyi.production.mapper.SpeculativeTradingInfoMapper; |
| | | import com.ruoyi.production.pojo.SpeculativeTradingInfo; |
| | | import com.ruoyi.production.service.impl.SalesLedgerSchedulingServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | private SalesLedgerSchedulingServiceImpl salesLedgerSchedulingService; |
| | | |
| | | |
| | | @Autowired |
| | | private SpeculativeTradingInfoMapper speculativeTradingInfoMapper; |
| | | |
| | | @GetMapping("/list") |
| | | @Log(title = "生产管理-生产派工-炒机信息", businessType = BusinessType.OTHER) |
| | | @ApiOperation("生产管理-生产派工-炒机信息") |
| | | public AjaxResult list() { |
| | | List<SpeculativeTradingInfo> result = speculativeTradingInfoMapper.selectList(null); |
| | | result.forEach(item -> { |
| | | item.setCurrentWorkLoad(salesLedgerSchedulingService.getSchedulingNumBySpeculativeTradingName(item.getName())); |
| | | item.setVacant(item.getWorkLoad().subtract(item.getCurrentWorkLoad())); |
| | | }); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/addSpeculatTrading") |
| | | @Log(title = "生产管理-生产派工-添加炒机信息", businessType = BusinessType.INSERT) |
| | | @ApiOperation("生产管理-生产派工-添加炒机信息") |
| | | public AjaxResult addSpeculatTrading(@RequestBody List<SpeculativeTradingInfo> speculativeTradingInfo) { |
| | | if(CollectionUtils.isEmpty(speculativeTradingInfo)) return AjaxResult.error("数据组不能为空"); |
| | | speculativeTradingInfo.forEach(item -> { |
| | | speculativeTradingInfoMapper.insert(item); |
| | | }); |
| | | return AjaxResult.success("添加炒机信息成功"); |
| | | } |
| | | |
| | | @PostMapping("/updateSpeculatTrading") |
| | | @Log(title = "生产管理-生产派工-修改炒机信息", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("生产管理-生产派工-修改炒机信息") |
| | | public AjaxResult updateSpeculatTrading(@RequestBody List<SpeculativeTradingInfo> speculativeTradingInfo) { |
| | | if(CollectionUtils.isEmpty(speculativeTradingInfo)) return AjaxResult.error("数据组不能为空"); |
| | | speculativeTradingInfo.forEach(item -> { |
| | | speculativeTradingInfoMapper.updateById(item); |
| | | }); |
| | | return AjaxResult.success("修改炒机信息成功"); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "生产管理-生产订单-分页查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation("生产管理-生产订单-分页查询") |