| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.mm.MaterialStore; |
| | | import com.example.erp.entity.userInfo.Log; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | | import com.example.erp.mapper.mm.BasicWarehouseTypeMapper; |
| | | import com.example.erp.mapper.mm.MaterialInventoryMapper; |
| | | import com.example.erp.mapper.mm.MaterialStoreMapper; |
| | | import com.example.erp.service.userInfo.LogService; |
| | | import com.example.erp.service.userInfo.SysErrorService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | BasicWarehouseTypeMapper basicWarehouseTypeMapper; |
| | | @Autowired |
| | | SysErrorService sysErrorService; |
| | | @Autowired |
| | | LogService logService; |
| | | |
| | | public String saveMaterialStore(Map<String,Object> object) { |
| | | String saveState = "true"; |
| | |
| | | if (object.get("height") != null) { |
| | | height = Double.parseDouble(object.get("height").toString()); |
| | | } |
| | | |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | |
| | | DecimalFormat decimalFormat = new DecimalFormat("#0.00"); |
| | | singlePieceArea= Double.parseDouble(decimalFormat.format(width * height / 100000)); |
| | | Integer jsonCount=materialStoreMapper.selectMaterialStoreJson(json); |
| | |
| | | if (Objects.equals(type, "原片")){ |
| | | materialInventoryMapper.updateMaterialInventoryArea(Long.valueOf(id),singlePieceArea); |
| | | } |
| | | log.setFunction("saveMaterialStore修改"); |
| | | }else{ |
| | | materialStoreMapper.insertMaterialStore(type,json); |
| | | log.setFunction("saveMaterialStore新增"); |
| | | } |
| | | }else{ |
| | | saveState = "false1"; |
| | | } |
| | | logService.saveLog(log); |
| | | |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectMaterialStores(MaterialStore materialStore) { |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", materialStoreMapper.getSelectMaterialStores(materialStore)); |
| | | return map; |
| | | } |
| | | |
| | | public String deleteMaterialStore(Map<String,Object> object) { |
| | | String saveState = "true"; |
| | | //设置回滚点 |
| | |
| | | } |
| | | |
| | | } |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("deleteMaterialStore删除:"+id); |
| | | logService.saveLog(log); |
| | | |
| | | |
| | | |