| | |
| | | package org.jeecg.modules.tms.controller; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.jeecg.modules.tms.entity.InboundDetail; |
| | |
| | | InboundOrder inboundOrder = jSONObject.toJavaObject(InboundOrder.class); |
| | | inboundOrder.setOrderStatus("1"); |
| | | inboundOrder.setInStatus("1"); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | inboundOrder.setHandler(user.getUsername()); |
| | | inboundOrder.setInboundNum(businessCodeRuleService.generateBusinessCodeSeq("InBoundOrder")); |
| | | inboundOrderService.save(inboundOrder); |
| | | // 保存入库申请单明细数据 |
| | |
| | | List<InboundDetail> list = jsonArray.toJavaList(InboundDetail.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | InboundDetail temp = list.get(i); |
| | | temp.setId(null); |
| | | temp.setInStorehouseId(inboundOrder.getId()); |
| | | temp.setInActualCount(BigDecimal.ZERO); |
| | | temp.setInStatus("1"); |
| | | temp.setToolId(temp.getOnlyCode()); |
| | | temp.setToolCode(temp.getToolCodeId()); |
| | | } |
| | | inboundDetailService.saveBatch(list); |
| | |
| | | List<InboundDetail> list = jsonArray.toJavaList(InboundDetail.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | InboundDetail temp = list.get(i); |
| | | temp.setId(null); |
| | | temp.setInStorehouseId(inboundOrder.getId()); |
| | | temp.setInStatus("1"); |
| | | temp.setInActualCount(BigDecimal.ZERO); |
| | | temp.setToolId(temp.getOnlyCode()); |
| | | temp.setToolCode(temp.getToolCodeId()); |
| | | } |
| | | inboundDetailService.saveOrUpdateBatch(list); |
| | |
| | | } |
| | | |
| | | |
| | | @AutoLog(value = "新增入库") |
| | | @ApiOperation(value = "新增入库操作", notes = "新增入库操作") |
| | | @AutoLog(value = "工具入库-新增入库") |
| | | @ApiOperation(value = "工具入库-新增入库", notes = "工具入库-新增入库") |
| | | @PostMapping("/addInStorage") |
| | | public Result<?> addInStorage(@RequestBody JSONObject jSONObject) { |
| | | inboundOrderService.addInStorage(jSONObject); |
| | | return Result.OK("操作成功"); |
| | | } |
| | | |
| | | @AutoLog(value = "工具入库-申请单入库") |
| | | @ApiOperation(value = "工具入库-申请单入库", notes = "工具入库-申请单入库") |
| | | @PostMapping("/addApplyInStorage") |
| | | public Result<?> addApplyInStorage(@RequestBody JSONObject jSONObject) { |
| | | inboundOrderService.addApplyInStorage(jSONObject); |
| | | return Result.OK("操作成功"); |
| | | } |
| | | |
| | | } |