| | |
| | | } |
| | | materialInventoryMapper.updateMaterialInventoryAvailableInventoryOutMes(Long.valueOf(optimizeUses.getRawStockCode()),quantity); |
| | | materialInventoryMapper.updateOptimizeUsesMes(optimizeUses.getId(),quantity); |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | //保存日志 |
| | |
| | | |
| | | public Map<String, Object> mesOriginalSelect() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", materialInventoryMapper.getSelectMaterialInventoryMes()); |
| | | map.put("originalList", materialInventoryMapper.getSelectMaterialInventoryMes()); |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | public String updateMaterialInventory(Map<String,Object> object) { |
| | | String saveState = "true"; |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | try { |
| | | |
| | | long materialInventoryId = 0L; |
| | | if (object.get("materialInventoryId") != null) { |
| | | materialInventoryId = Long.parseLong(object.get("materialInventoryId").toString()); |
| | | } |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("updateMaterialInventory物料库存修改"); |
| | | MaterialInventory materialInventory = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), MaterialInventory.class); |
| | | |
| | | materialInventoryMapper.updateMaterialInventoryAll(materialInventoryId,materialInventory); |
| | | |
| | | logService.saveLog(log); |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e+Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("saveMaterialInventory"); |
| | | sysErrorService.insert(sysError); |
| | | saveState = "false"; |
| | | |
| | | } |
| | | return saveState; |
| | | |
| | | } |
| | | |
| | | } |