| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public AjaxResult list() { |
| | | List<SpeculativeTradingInfo> result = speculativeTradingInfoMapper.selectList(null); |
| | | result.forEach(item -> { |
| | | item.setCurrentWorkLoad(salesLedgerSchedulingService.getSchedulingNumBySpeculativeTradingName(item.getName())); |
| | | |
| | | item.setCurrentWorkLoad(salesLedgerSchedulingService.getSchedulingNumBySpeculativeTradingName(item.getName()).divide(new BigDecimal(1000),2, RoundingMode.CEILING)); |
| | | item.setVacant(item.getWorkLoad().subtract(item.getCurrentWorkLoad())); |
| | | }); |
| | | return AjaxResult.success(result); |
| | |
| | | @ApiOperation("生产管理-生产订单-生产派工") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult productionDispatch(@RequestBody ProductionDispatchAddDto productionDispatchAddDto) { |
| | | int result = salesLedgerSchedulingService.productionDispatch(productionDispatchAddDto); |
| | | List<ProductionDispatchAddDto> productionDispatchAddDtoList = new ArrayList<>(); |
| | | productionDispatchAddDtoList.add(productionDispatchAddDto); |
| | | String result = salesLedgerSchedulingService.productionDispatch(productionDispatchAddDtoList); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/productionDispatchList") |
| | | @Log(title = "生产管理-生产订单-自动派工", businessType = BusinessType.INSERT) |
| | | @ApiOperation("生产管理-生产订单-自动派工") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult productionDispatchList(@RequestBody List<ProductionDispatchAddDto> productionDispatchAddDto) { |
| | | String result = salesLedgerSchedulingService.productionDispatch(productionDispatchAddDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |