| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import liquibase.pro.packaged.G; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.cms.entity.CuttingInbound; |
| | | import org.jeecg.modules.cms.entity.CuttingInboundDetail; |
| | | import org.jeecg.modules.cms.entity.CuttingReceive; |
| | | import org.jeecg.modules.cms.entity.CuttingReceiveDetail; |
| | | import org.jeecg.modules.cms.entity.*; |
| | | import org.jeecg.modules.cms.service.ICuttingInventoryService; |
| | | import org.jeecg.modules.cms.service.ICuttingReceiveDetailService; |
| | | import org.jeecg.modules.cms.service.ICuttingReceiveService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICuttingReceiveDetailService cuttingReceiveDetailService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody JSONObject jSONObject) { |
| | | // 保存主表数据 |
| | | CuttingReceive cuttingReceive = jSONObject.toJavaObject(CuttingReceive.class); |
| | | cuttingReceive.setOrderStatus("1"); |
| | | cuttingReceiveService.saveOrUpdate(cuttingReceive); |
| | | //删除原关联数据 |
| | | |
| | | // 删除原有关联的明细数据 |
| | | List<CuttingReceiveDetail> cuttingReceiveDetailList = cuttingReceiveDetailService.lambdaQuery().eq(CuttingReceiveDetail::getOrderId, cuttingReceive.getId()).list(); |
| | | cuttingReceiveDetailService.removeBatchByIds(cuttingReceiveDetailList); |
| | | //添加新关联数据 |
| | | |
| | | // 重新添加新的明细数据 |
| | | JSONArray jsonArray = jSONObject.getJSONArray("detailData"); |
| | | List<CuttingReceiveDetail> list = jsonArray.toJavaList(CuttingReceiveDetail.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 选择库存刀具的列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/getInventoryToolList") |
| | | public Result<?> getInventoryToolList(@RequestParam("pageNo") Integer pageNo, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> inventoryTooList = cuttingReceiveService.getInventoryToolList(pageNo, pageSize, params); |
| | | return Result.ok(inventoryTooList); |
| | | } |
| | | } |